170 likes | 321 Views
IP Fragmentation. MTU. Maximum Transmission Unit (MTU) Largest IP packet a network will accept Arriving IP packet may be larger. MTU. IP Packet. IP Fragmentation. If IP packet is longer than the MTU, the router fragments the packet Extracts data field from incoming packet
E N D
MTU • Maximum Transmission Unit (MTU) • Largest IP packet a network will accept • Arriving IP packet may be larger MTU IP Packet
IP Fragmentation • If IP packet is longer than the MTU, the router fragments the packet • Extracts data field from incoming packet • Divides data field into smaller fragments • Sends each fragment in its own IP packet MTU IP Packet 2 1 3 IP Packets Fragmentation
IP Fragmentation • Each packet is smaller than the MTU • Suppose MTU is 500 octets • IP header is 20 octets if there are no options • Only 480 octets available for data in each fragmented IP packet MTU (500 Octets) IP Data Field (480) IP Header (20)
Multiple Fragmentations • Original packet may be fragmented multiple times along its route Source Host Internet Process Destination Host Internet Process Fragmentation
Defragmentation • Internet layer process on destination host defragments, restoring the original packet • Defragmentation only occurs once Source Host Internet Process Destination Host Internet Process Defragmentation
Fragmentation and IP Fields • More Fragments field (1 bit) • 1 if more fragments, 0 if not • Source host internet process sets more fragments field to 0 • If router fragments, keeps More Fragments field in last fragment 0 • In all other fragments, sets to 1 0 0 1 1 Original IP Packet Fragments
Fragmentation and IP Fields • More Fragments field (1 bit) • If another fragmentation • If MF field is 1, make all MF fields 1 in fragment IP packets • IF MF field is zero, make all MF fields 1 in fragment IP packets except the last one. Make that 0. 1 1 1 1 0 0 1 1 Original IP Packet Fragments
Identification Field • IP packet has a 16-bit Identification field • Source host internet process places a random number in the Identification field • Different for each IP packet Identification Field 47 Original IP Packet
Identification Field • IP packet has a 16-bit Identification field • If router fragments, places the original Identification field value in the Identification field of each fragment Identification Fields 47 47 47 47 Original IP Packet Fragments
Identification Field • Purpose • Allows receiving host’s internet layer process know what fragments belong to each original packet • Works even if an IP packet is fragmented several times 47 47 47 47 Original IP Packet Fragments
Fragment Offset Field • Used to reorder fragments with the same Identification field • Contains the data field’s starting point (in bytes) from the start of the data field in the original IP packet First byte is 731st from start of fragment 212 730 0 Fragment Offset Field
Fragment Offset Field • Receiving host’s internet layer process assembles fragments in order of increasing fragment offset field value • This works even if fragments arrive out of order! • Works even if fragmentation occurs multiple times 2nd Fragment 3rd Fragment 1st Fragment 212 730 0
Fragmentation: Recap • Fragmentation • Large IP is packet broken into a series of smaller IP packets fitting a network’s MTU • Fragmentation is done by routers • Fragmentation may be done multiple times along the route
Fragmentation: Recap • Fragmentation • Defragmentation (reassembly) is done once, by destination host’s internet layer process