Docsity

IP Forwarding and Subnetting in Internetworking, Slides of Software Engineering

Partial preview of the text

Download IP Forwarding and Subnetting in Internetworking and more Slides Software Engineering in PDF only on Docsity!

Internetworking II

TopicsNovember 24, 1998

IP datagram forwarding, ARP

IPv

End-to-end protocols: UDP, TCP

End-to-end data: presentation formatting

network programming: sockets interface

class27.ppt

CS 213 F’

  • 2 –

class27.ppt

IP Datagram Forwarding

Forwarding: the process of copying an input packet

from an input port to an output port.

Routing: the process of building the tables on each

determined (beyond our scope)router that allow the correct output port to be

Key points

Every IP datagram contains the IP address of the destination.

network.Network part of IP address uniquely identifies a single physical

physical network.All hosts and routers with same network part are on the same

least one other physical network.Every physical network on the Internet has a router connected to at

CS 213 F’

  • 4 –

class27.ppt

IP Forwarding Algorithm

if (NetworkNum(S) == NetworkNum(D)) { deliver packet directly to D

/* IP->physical mapping via ARP */

else deliver packet to default router

if (NextHop is an interface)NextHop = lookup(NetworkNum(D));

deliver packet directly to D using interface NextHop

else if (NextHop != ) deliver packet to NextHop (a router)

else deliver packet to default router

NextHop) pairs(NetworkNum,consists ofForwarding table

Algorithm for router receiving packet for host DAlgorithm for host S sending to host D:

CS 213 F’

  • 5 –

class27.ppt

IP Forwarding example

R

R

H

H

H Network 3 (FDDI) H

H

H H

H

R

(Ethernet)Network 2

(Point-to-point)Network 4

Network 1 (Ethernet)

NetworkNum

NextHop

R

R

Interface

Interface

tableforwarding Router R

CS 213 F’

  • 7 –

class27.ppt

Subnetting

Problem: IP addressing scheme makes inefficient use

of addresses

Partial solution: subnetting

network to the external world.physical network part of address identifies a “virtual” physical

networks within the “virtual” physical network.use some of the high order “host” bits to identify local physical

network number

host number

Subnet mask (255.255.255.0)Class B address

xxxxxxxx xxxxxxxx xxxxxxxx

Subnet number

  • All hosts on subnet configured with this mask (ifconfig)- There is exactly one subnet mask per subnet.- All hosts on same physical network have same subnet number.

CS 213 F’

  • 8 –

class27.ppt

IP forwarding with subnetting

if (D1 == MySubnetNum)D1 = SubnetMask & destination IP address deliver datagram directly to destination

else deliver datagram to default router for each forwarding table entry <SubnetNum,SubnetMask,NextHop>Algorithm on a host: if (D1 == SubnetNum)D1 = SubnetMask & destination IP address if (NextHop is an interface) deliver datagram directly to destination

else deliver datagram to NextHop (a router)

Algorithm on a router:

CS 213 F’

  • 10 –

class27.ppt

IPv

010 Hierarchical address space:Extends address space from 32 bits to 128 bitsAlso called Next Generation IP and IPng

registryID

providerID

SubscriberID

SubnetID

InterfaceID

neat feature

embedded InterfaceID allows host to assign itself an IP address!

CS 213 F’

  • 11 –

class27.ppt

IPv6 packet format

Ver

Pri

Ver

IP version (6)

Pri/Flowlabel

Quality of Service )

PayloadLen

packet len (max 64KB)

NextHdr

header typeoptional/encapsulated

HopLimit

same as TTL in IPv

Source Address

128-bit source addr

Dest Address

128-bit dest addr

FlowLabel

PayloadLen

NextHdr

Source Address

HopLimit

Next header/data

(^4)

(^8)

16

24

31

Destination Address

TCP (6)authentication (51)fragmentation (44)Optional header examples:

CS 213 F’

  • 13 –

class27.ppt

Internet protocol stack

interfacesocketsBerkeley

process)(process-deliverybyte streamReliable

host)(host-to-deliverydatagrambest effortprocess)(process-deliverydatagrambest effort

Application (FTP, Telnet, WWW, email)Application (FTP, Telnet, WWW, email)

User Datagram Protocol

(UDP)

User Datagram Protocol

(UDP)

Transmission Control Protocol

(TCP)

Transmission Control Protocol

(TCP)

Internet Protocol (IP)Internet Protocol (IP)

Network Interface (ethernet)Network Interface (ethernet)

HardwareHardware

physical leveldata link levelnetwork leveltransport level

CS 213 F’

  • 14 –

class27.ppt

UDP: User datagram protocol

Extends IP to provide

process-to-process (end-to-end)

datagram delivery

Process identified by <host, port> pair.Based on port abstractionMechanism for demultiplexing IP packets

SrcPort

DstPort

CheckSum

Length

Data

CS 213 F’

  • 16 –

class27.ppt

TCP functions

Reliability and congestion control.Sliding window protocolSequence numbersConnections

Source PortSource Port

Dest. PortDest. Port

AcknowledgmentAcknowledgmentSequence NumberSequence Number

Hlen/FlagsHlen/Flags

WindowWindow

D. ChecksumD. Checksum

Urgent PointerUrgent Pointer

Options..Options..

CS 213 F’

  • 17 –

class27.ppt

Connections

Connection is fundamental TCP communication

• abstraction.

  • (^) implies allocation of resources (buffers) on hosts (^) data sent along a connection arrives in order

The endpoint of a connection is a pair of integers:

(IP address, port)

A connection is defined by a pair of endpoints:

connection

CS 213 F’

  • 19 –

class27.ppt Sliding window protocol (sender)

Sender maintains a “window” of unacknowledged

last byte it sent:bytes that it is allowed to send, and a pointer to the

current window

Bytes 10 and higher cannot be sent until the right edge of window moves.Bytes 7 -- 9 have been not been sent but will be sent without delay.Bytes 3 -- 6 have been sent but not acknowledged (and thus must be buffered)Bytes through 2 have been sent and acknowledged (and thus can be discarded)

byte stream

left 1 2 3 4 5 6 7 8 9 10 11 ...

right

curr

CS 213 F’

  • 20 –

class27.ppt^ Sliding window protocol (receiver)

Receiver acknowledges receipt of a segment with two

• pieces of information:

  • (^) WIN: amount of available buffer space.stream it has already received (^) ACK: the sequence number of the next byte in the contiguous

ACK indicates that data was received correctly.

sender can increment left edge of window

sender can delete data to the left of the window.

WIN indicates that more buffer space was freed up.

sender can increment the right edge of its window

sender can transmit more data.