Lecture 21 IP Packet + Fragmentation Andd Assembly + ICMP
Lecture 21 IP Packet + Fragmentation Andd Assembly + ICMP
Destination Address
Data
1
IPv4 Header Fields
0 4 8 12 16 19 24 28 31
• Version: IP Version
• 4 for IPv4
ver-
sion HLen TOS Length
Flag
Identifier s Offset
Source Address
Destination Address
2
IPv4 Header Fields
• Identifier, flags, fragment offset used primarily for fragmentation
• Time to live
• Must be decremented at each router
0 4 8 12 16 19 24 28 31
ver-
sion HLen TOS Length
3
IPv4 Header Fields
0 4 8 12 16 19 24 28 31
ver-
sion HLen
Identifier
TOS
Flags
Length
Offset
• Source Address
• 32-bit IP address of sender
TTL Protocol Checksum
Source Address
Destination Address
Data
• Destination Address
• 32-bit IP address of destination
4
IP Delivery Model
5
IP Fragmentation
MTU =
2000 host
router
router MTU = 1500
host
MTU = 4000
6
Reassembly
• Where to do reassembly?
• End nodes or at routers?
• End nodes
• Avoids unnecessary work where large packets are
fragmented multiple times
• If any fragment missing, delete entire packet
7
Fragmentation Related Fields
• Length
• Length of IP fragment
• Identification
• To match up with other fragments
• Flags
• Don’t fragment flag
• More fragments flag
• Fragment offset
• Where this fragment lies in entire IP datagram
• Measured in 8 octet units (13 bit field)
8
IP Fragmentation Example #1
router
host
MTU = 4000
IP IP
Header Data
9
IP Fragmentation Example #2
MTU =
2000
router
router
Length = 2000, M=1, Offset = 0
Length = 3820, M=0
IP IP
IP IP Header Data
Header Data
1980 bytes
3800 bytes
Length = 1840, M=0, Offset = 1980
IP IP
Header Data
1820 bytes
10
IP Fragmentation Example #3
IP IP
Header Data
IP IP IP IP
Data Data Data Data
12
Fragmentation and Reassembly
Concepts
• Demonstrates many Internet concepts
• Decentralized
• Every network can choose MTU
• Connectionless
• Each (fragment of) packet contains full routing information
• Fragments can proceed independently and along different routes
• Best effort
• Fail by dropping packet
• Destination can give up on reassembly
• No need to signal sender that failure occurred
• Complex endpoints and simple routers
• Reassembly at endpoints
13
Fragmentation is Harmful
14
Internet Control Message Protocol
(ICMP)
• Short messages used to send error & other control information
• Examples
• Ping request / response
• Can use to check whether remote host reachable
• Destination unreachable
• Indicates how packet got & why couldn’t go further
• Flow control
• Slow down packet delivery rate
• Redirect
• Suggest alternate routing path for future messages
• Router solicitation / advertisement
• Helps newly connected host discover local router
• Timeout
• Packet exceeded maximum hop limit
15
IP MTU Discovery with ICMP
MTU =
2000 host
router
router MTU = 1500
host
MTU = 4000
• Typically send series of packets from one host to another
• Typically, all will follow same route
• Routes remain stable for minutes at a time
• Makes sense to determine path MTU before sending real packets
• Operation
• Send max-sized packet with “do not fragment” flag set
• If encounters problem, ICMP message will be returned
• “Destination unreachable: Fragmentation needed”
• Usually indicates MTU encountered
16
IP MTU Discovery with ICMP
ICMP
Frag. Needed
MTU = 2000 MTU =
2000 host
router
router MTU = 1500
host
MTU = 4000
IP
Packet
17
IP MTU Discovery with ICMP
ICMP
Frag. Needed
MTU = 1500 MTU =
2000 host
router
router MTU = 1500
host
MTU = 4000
IP
Packet
18
IP MTU Discovery with ICMP
MTU =
2000 host
router
router MTU = 1500
host
MTU = 4000
IP
Packet
19