Computer Networks
Packet Fragmentation(5.5.5)
David Wetherall ([email protected])
Professor of Computer Science & Engineering
Topic
How do we connect networks with
different maximum packet sizes?
Need to split up packets, or discover
the largest size to use
Its too big!
Take that
Big packet
Computer Networks
Packet Size Problem
Different networks have different
maximum packet sizes
Or MTU (Maximum Transmission Unit)
E.g., Ethernet 1.5K, WiFi 2.3K
Prefer large packets for efficiency
But what size is too large?
Difficult because node does not know
complete network path
Computer Networks
Packet Size Solutions
Fragmentation (now)
Split up large packets in the network
if they are too big to send
Classic method, dated
Discovery (next)
Find the largest packet that fits on the
network path and use it
IP uses today instead of fragmentation
Computer Networks
IPv4 Fragmentation
Routers fragment packets that are too large to forward
Receiving host reassembles to reduce load on routers
Fragment!
Reassemble!
Fits on first link
Computer Networks
IPv4 Fragmentation Fields
Header fields used to handle packet size differences
Identification, Fragment offset, MF/DF control bits
Payload (e.g., TCP segment)
Computer Networks
IPv4 Fragmentation Procedure
Routers split a packet that is too large:
Typically break into large pieces
Copy IP header to pieces
Adjust length on pieces
Set offset to indicate position
Set MF (More Fragments) on all pieces
except last
Receiving hosts reassembles the pieces:
Identification field links pieces together,
MF tells receiver when it has all pieces
Computer Networks
IPv4 Fragmentation (2)
Before
MTU = 2300
ID = 0x12ef
Data Len = 2300
Offset = 0
MF = 0
After
MTU = 1500
ID =
Data Len =
Offset =
MF =
Computer Networks
(Ignore length
of headers)
ID =
Data Len =
Offset =
MF =
IPv4 Fragmentation (3)
Before
MTU = 2300
ID = 0x12ef
Data Len = 2300
Offset = 0
MF = 0
After
MTU = 1500
ID = 0x12ef
Data Len = 1500
Offset = 0
MF = 1
Computer Networks
ID = 0x12ef
Data Len = 800
Offset = 1500
MF = 0
IPv4 Fragmentation (4)
It works!
Allows repeated fragmentation
But fragmentation is undesirable
More work for routers, hosts
Tends to magnify loss rate
Security vulnerabilities too
Computer Networks
10
Path MTU Discovery
Discover the MTU that will fit
So we can avoid fragmentation
The method in use today
Host tests path with large packet
Routers provide feedback if too large;
they tell host what size would have fit
Computer Networks
11
Path MTU Discovery (2)
Computer Networks
MTU=1400
MTU=1200 bytes
Try 1200
Try 900
MTU=900
12
Path MTU Discovery (3)
Test #1
Computer Networks
Test #2
MTU=1400
MTU=1200 bytes
Try 1200
Try 900
Test #3
MTU=900
13
Path MTU Discovery (4)
Process may seem involved
But usually quick to find right size
Path MTU depends on the path and
so can change over time
Search is ongoing
Implemented with ICMP (next)
Set DF (Dont Fragment) bit in IP
header to get feedback messages
Computer Networks
14
END
2013 D. Wetherall
Slide material from: TANENBAUM, ANDREW S.; WETHERALL, DAVID J., COMPUTER NETWORKS, 5th Edition, 2011.
Electronically reproduced by permission of Pearson Education, Inc., Upper Saddle River, New Jersey
Computer Networks
15