IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.
-
date post
20-Dec-2015 -
Category
Documents
-
view
217 -
download
0
Transcript of IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.
![Page 1: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/1.jpg)
IP Function and IP Function and ImplementationImplementation
Chuck Davin
UPenn CSE 350
12 April 2001
![Page 2: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/2.jpg)
OSI Reference ModelOSI Reference Model
Application Layer
Presentation Layer
Session Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
![Page 3: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/3.jpg)
Unix Network ImplementationUnix Network Implementation
Application Application
Sockets
Protocols
Devices
System Call Interface
Abstract Network Interface
![Page 4: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/4.jpg)
Model vs. ImplementationModel vs. Implementation
Application Application
Sockets
Protocols
Devices
System Call Interface
Abstract Network Interface
Application Layer
Presentation Layer
Session Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
![Page 5: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/5.jpg)
OSI Reference ModelOSI Reference Model
Possible Points of MultiplexingPossible Points of MultiplexingApplication Layer
Presentation Layer
Session Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
![Page 6: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/6.jpg)
Unix Network ImplementationUnix Network Implementation
Possible Points of MultiplexingPossible Points of Multiplexing
Application Application
Sockets
Protocols
Devices
System Call Interface
Abstract Network Interface
![Page 7: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/7.jpg)
Protocol Layer FunctionsProtocol Layer Functions
Protocol-Specific Functions– UDP– TCP
– IP
![Page 8: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/8.jpg)
Protocol Layer Service Protocol Layer Service InterfaceInterface
XXX_usrreq (so, cmd, …)XXX_input (data, …)XXX_ctlinput (so, cmd, …)XXX_ctloutput (so, cmd, …)XXX_init ()
![Page 9: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/9.jpg)
Protocol User RequestsProtocol User Requests
PRU_ATTACH PRU_DETACH PRU_SEND PRU_RECV PRU_BIND PRU_CONNECT PRU_SHUTDOWN And so forth
![Page 10: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/10.jpg)
Generic Protocol Data Generic Protocol Data StructuresStructures
Application Application
Sockets
Devices
System Call Interface
Abstract Network Interface
ProtocolControlBlock(PCB)
To Protocol-Specific State(if any)
Protocol-Specific Links
![Page 11: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/11.jpg)
IP ObservationsIP Observations
Raw IP sockets are available– But less often used
The most frequent “users” of IP services are UDP and TCP
The most interesting data structures for IP are unrelated to sockets
![Page 12: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/12.jpg)
IP Data FlowsIP Data FlowsApplication Application
TCP
Sockets
Devices
System Call Interface
IP
UDP
Ip_output() XXX_input()
Ifp->if_output() Ip_input()
IP Packets
IP Packets
![Page 13: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/13.jpg)
IP Input ProcessingIP Input Processing
Remove packet from delivery queueValidate IP header checksum, versionCheck packet length for consistencyIs it for me?
– See if_withaddr()Reassemble if packet is a fragmentDeliver entire packets to ULP based on
protocol number
![Page 14: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/14.jpg)
IP Output ProcessingIP Output Processing
Complete IP header, compute IP header checksum
Determine outgoing interface and next hop for this packet
Fragment if packet exceeds MTU of chosen interface
Present packet(s) plus next hop IP address to device via abstract network interface
![Page 15: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/15.jpg)
IP Routing TableIP Routing Table
Destination IP AddressDestination NetmaskRoute Type (e.g., local or remote)Route MetricNext Hop IPCached MTU, Network Device, …
– See if_withaddr()
![Page 16: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/16.jpg)
IP Forwarding ProcedureIP Forwarding Procedure
Find routing entries for which the masked destination address matches the masked destination address of the packet
Of these entries, pick the one with the longest netmask– Contiguous subnet masks
Forwarding table vs. routing table
![Page 17: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/17.jpg)
Network Device FunctionsNetwork Device Functions
Device congestion managementProtocol adaptationBuffer management
![Page 18: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/18.jpg)
Network Device InterfaceNetwork Device Interface
Generic interface presented to ULPs (IP)IF_ENQUEUE()IF_QFULL()Ifp->If_output()Ifp->If_start()…
![Page 19: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/19.jpg)
Network Device Data Network Device Data StructuresStructures
Application Application
Sockets
Protocols
System Call Interface
Abstract Network Interface
IfnetChain
…
IfnetStructure
IfnetStructure
PrivateDeviceData
PrivateDeviceData
![Page 20: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/20.jpg)
Network Device Output Network Device Output ProcedureProcedure
ULP has already enqueued packets and next hop addresses on the output queue
If the medium is multipoint, then resolve the passed ULP address into a local medium address (e.g., ARP)
If the device is currently idle, take a packet from the output queue, frame it and start I/O
![Page 21: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/21.jpg)
Network Device Input Network Device Input ProcedureProcedure
Received frame is checked for integrity and length consistency
Frame is examined to identify ULPFrame is stripped of data link headerFrame Payload plus notation of receiving
device are enqueued on ULP input queue– E.g., ipintrq
![Page 22: IP Function and Implementation Chuck Davin UPenn CSE 350 12 April 2001.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d535503460f94a2f602/html5/thumbnails/22.jpg)
Questions to PonderQuestions to Ponder
Private device data is stored contiguously with generic ifnet data rather than according to the linked PCB scheme in upper layers.– What are the tradeoffs?
To what degree should/need a network device do its own routing?
What must a network device do to properly receive striped IP traffic?