menu
close

Tell Packets to Don't Fragment While in Ping Test (ping -f)

While in Ping test if the packet size is higher than the size your network can handle, it will be fragmented and reassembled at receiver. So even if the packet size we specified is invalid, we will get a reply from the destination. This situation is not good because it fails the actual objective of the ping by giving reply from destination through the packets we send are having invalid size. So it is important to disable fragmentation of packets send from your computer to ensure you are using optimum packet size. We can use ping -f syntax to stop fragmentation of ping packets.


How to Stop Ping Packet Fragmentation
Let us explain it by an example. Here we send packets to global DNS address with size 1480 bytes. See the difference with and without the ping syntax -f. By using this syntax, we prevent the packets from dividing and try to reach the destination address with actual size. To change the original packet size, you must use another ping syntax -l. Use of this syntax is explained at the end of the guide.
result

When we use the -f ping syntax, we received error message Packet Needs To Be Fragmented But DF Set instead of a valid reply from the destination. Without -f syntax the packet is fragmented and reassembled at the destination.

So now onwards in case if you want to send a packet to destination without fragmenting it, you must use the ping syntax ping -f. the same syntax helps you to find the optimum MTU size of your network. To learn more about this, visit the link below.
Ping Test to Determine Correct MTU Size of a Network

We must understand the use of each and every symbol we use in this command to learn its working. In this ping test, you may note the use of another ping syntax -l. To learn more about it, visit the link below.
Use -l to Change Default Ping Packet Size

Technology Tips