Testing fragmentation using ping command

In Windows it is possible to use the ping command in the CLI to find the point where fragmentation is needed. Simply, add the -f option to the ping command which sets the Do Not Fragment bit to 1. Then increase the payload size using the -l option in the same ping command until the pings start to fail. The ping response will show “Packet needs to be fragmented but DF set” message which indicates the point where fragmentation is required.

Using ping without options will use 74 bytes packets on the wire (14 byte Ethernet + 20 byte IP + 40 byte ICMP Payload). If specify ping options an extra 16 bytes is added to the IP header.

Increasing the ICMP payload size increases the packet size further and if the DF bit is set you will soon discover the point where fragmentation is required.

In a test I discovered that I could send 1456 bytes of ICMP payload resulting in a frame size of 1514 bytes without fragmentation. When I specified 1457 bytes the ICMP Requests were dropped and the message above was returned.

Fragmentation can lead to issues between client and server and sometimes segments arrive out of order causing issues with reordering or reassembly.

The MSS and MTU settings can be used on a WAN router to prevent fragmentation. The IP layer uses a Path MTU Discovery mechanism to discover the optimum MTU size for transmission. This requires the proper handling of ICMP messages between network devices. Alternatively, TCP MSS can be used to avoid fragmentation.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s