Skip to main content

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.

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


Hari said…
Hi Alex, I am pursuing CCNA and was looking for an answer for the packet fragmentation problem. Thanks for your answer.

About Author

My photo
Alex George
Alex George has Engineering graduation in Computer Science and an MBA in Finance. He had been working as a senior Network Engineer for ten years. His specialization is in Cisco products. Traveling is one of his hobbies and visited various places as part of his onsite work. He visited different places as part of his onsite work like New York, Dubai, London, etc. Right now Alex is a director of one of the leading career development firms in India, which trains students for UPSC, SSC, and PSC examinations. He guides a lot of students to get selection for various prestigious institutions like CBI, Income Tax Department, etc. Alex George is a stock market investor and a very active intraday trader. Engineering Background: He has a B.Tech in Computer Science and Engineering and passed different network and security courses like CCNA, CCNP (Security), CEH, and various Microsoft certifications. Finance Background: Alex has an MBA in Finance. He is an active intraday trader and a Share Market Investor. Webmaster Skills: Alex is a blogger since 2004. He has a working knowledge of HTML, CSS, PHP, and JavaScrip.