December 5, 2026

Ping Explained: What Every Number in the Output Means, From ICMP to TTL

A ripple spreading across a dark lake from a point of light

64 bytes from 10.3.0.5: icmp_seq=1 ttl=62 time=0.058 ms. Most people read one thing in that line, the time, and skip the rest. The ttl=62 quietly reports that the reply crossed exactly two routers. Set ping’s own TTL to 1 and the answer comes back from a different machine entirely. Make the packet 100 bytes too big for one link and a router two hops away names the exact size it would have accepted. Every example here came from a four-machine test network, a host, two routers and a server, built from Linux network namespaces for this post.

Video: Tim Wilborne on YouTube

What ping sends

Echo request, echo reply

Ping uses ICMP, the Internet Control Message Protocol, defined in RFC 792 in September 1981. The RFC lists “8 for echo message” and “0 for echo reply message.” Ping sends type 8; any machine willing to answer sends back type 0 with the same data. There’s no port number, because ICMP sits beside TCP and UDP rather than on top of them.

The capture

A tcpdump on the server’s interface recorded one exchange:

10.1.0.2 > 10.3.0.5: ICMP echo request, id 12203, seq 1, length 64
10.3.0.5 > 10.1.0.2: ICMP echo reply, id 12203, seq 1, length 64

The id ties replies to the ping process that sent them; RFC 792 describes it as “an identifier to aid in matching echos and replies.” The seq number counts up with each packet, which is how ping notices a missing or out-of-order reply.

Why 56, 64 and 84

Ping’s first line read 56(84) bytes of data, and each reply said 64 bytes. The ping manual explains the first two: the default size “is 56, which translates into 64 ICMP data bytes when combined with the 8 bytes of ICMP header data.” Add the 20-byte IP header and the whole packet on the wire is 84 bytes, which is the length 84 tcpdump showed in its verbose output.

Blue LAN cable plugged in green and black router

Reading the TTL

Counting hops backward

Every IP packet carries a time-to-live field that each router decreases by one. On the test network, the server’s reply left with TTL 64 and arrived at the host as ttl=62. Two routers, two decrements. The manual confirms what the number is: “In normal operation ping prints the TTL value from the packet it receives,” meaning the reply’s TTL, not the request’s.

Starting values differ

Linux sends with 64 by default: sysctl net.ipv4.ip_default_ttl on the test host returned 64. The ping manual notes the field’s maximum is 255 and that systems differ in their starting value, so a reply TTL is only useful for counting hops when the remote system’s starting point is known. A reply of ttl=54 from a Linux server most likely means 10 hops; a reply of ttl=118 probably came from a system that started at 128.

When it hits zero

RFC 792 sets the rule: a gateway that finds the time to live “is zero it must discard the datagram,” and “may also notify the source host via the time exceeded message,” which is ICMP type 11.

Setting the TTL on purpose

ttl 1 and ttl 2

ping -t sets the outgoing TTL; the manual describes it as “Set the IP Time to Live.” With -t 1, the first router received the packet, decremented it to zero, dropped it and reported back:

$ ping -c1 -t1 10.3.0.5
From 10.1.0.1 icmp_seq=1 Time to live exceeded

With -t 2, the packet got one router further:

From 10.2.0.2 icmp_seq=1 Time to live exceeded

This is traceroute

Those two commands, run with TTL 1, 2, 3 and upward, are what traceroute automates. Each step reveals the next router’s address, because each router in turn is the one whose decrement reaches zero. Ping does it by hand; traceroute does it in a loop and times each step.

A stone bridge over a stream in a forest

The error messages, decoded

Destination Net Unreachable

The second router was given no route for 10.9.9.0. A ping to 10.9.9.9 came back immediately with From 10.2.0.2 icmp_seq=1 Destination Net Unreachable. RFC 792’s destination unreachable message, type 3, uses code 0 for “net unreachable.” The From address names the router that gave up.

Destination Host Unreachable

A ping to 10.3.0.99, an unused address on the server’s own network, behaved differently. The final router knew the network but couldn’t find a machine with that address on it. After a pause of a few seconds while it tried, the reply was From 10.2.0.2 icmp_seq=1 Destination Host Unreachable, code 1 in the RFC, “host unreachable.” With the default one-second wait, -W 3 wasn’t enough to see it; -W 6 was.

Silence versus a refusal

A firewall rule on the server dropping echo requests produced only 100% packet loss and no messages, exactly what a dead machine looks like. Changing the rule to reject them with an “administratively prohibited” message produced From 10.3.0.5 icmp_seq=1 Packet filtered instead. A machine that doesn’t answer ping isn’t necessarily down. A machine that sends “Packet filtered” is definitely up.

Finding the path’s size limit

Don’t fragment

The link from the second router to the server was set to an MTU of 1,400 bytes. Ping’s -M do option sets the Don’t Fragment flag; the manual explains that oversized packets “will be rejected.” A 1,472-byte payload, which with 28 bytes of headers fills a standard 1,500-byte Ethernet frame, was refused by the router in front of the narrow link:

$ ping -c1 -M do -s 1472 10.3.0.5
From 10.2.0.2 icmp_seq=1 Frag needed and DF set (mtu = 1400)

That’s RFC 792 type 3, code 4: “fragmentation needed and DF set.” The router even reported the size it could pass.

The size that fits

1,400 minus 28 bytes of headers is 1,372. ping -M do -s 1372 went through: 1380 bytes from 10.3.0.5, 1,372 data bytes plus the 8-byte ICMP header. This is the standard way to find a path’s MTU by hand, and it’s often the explanation when small requests work over a VPN but large downloads or uploads stall.

Stepping stones lead across calm water at dusk

Packet loss and the summary lines

Making a lossy link

To see what loss looks like, a separate pair of test machines was set up with a firewall rule on the receiver that dropped incoming echo requests at random, each with a 30 percent chance. Then 100 pings went out, 20 milliseconds apart, with -q to print only the summary:

100 packets transmitted, 69 received, 31% packet loss, time 2373ms
rtt min/avg/max/mdev = 0.027/0.035/0.064/0.005 ms

Thirty-one lost against an expected thirty is about what random chance delivers over 100 tries. Run again with every reply shown, the gaps were visible in the sequence numbers: replies arrived for 1 through 9, then 11, 12, 14, 15, 16, then 20. Each missing number is a request that never came back. That’s the value of icmp_seq: it shows not just how much was lost but whether the losses came singly or in runs, and runs usually point to something different, such as a link dropping out for a moment, than scattered single losses do.

The four timing numbers

The last line gives the shortest, average and longest round trip, plus mdev, ping’s measure of how much the times varied. A low average with a large mdev describes a link that is usually quick but erratic, which matters more for calls and games than the average does. On this test link everything stayed under a tenth of a millisecond, because both machines were in the same computer.

Loss in one direction looks like loss in both

The firewall in this test dropped requests, but ping can’t tell a lost request from a lost reply. Either way the sequence number never comes back. Telling the two apart takes a packet capture at the far end, or a test that runs in the other direction.

Ping as a troubleshooting tool

An order that narrows things down

  1. ping 127.0.0.1: is the local network stack working?
  2. Ping the default gateway: is the local link working?
  3. Ping an outside IP address: does routing beyond the gateway work?
  4. Ping a hostname: does DNS work too?

Each step that fails points at a different layer. A failure at step 4 after success at step 3 is a name-resolution problem, not a network one.

What the time tells

On the test network, round trips were around 0.06 milliseconds, because nothing left one computer. Real Wi-Fi adds milliseconds and long-distance links add tens of milliseconds. A steady time with occasional spikes points to congestion; steadily climbing times point to a queue filling somewhere along the path.

The interval

Ping sends one packet a second by default. Faster rates need -i, and the manual notes that “Only super-user may set interval to values less than 2 ms.” Rapid pinging of someone else’s network is unwelcome; on a home lab, it’s a handy way to watch a link under load.

Sources

  • RFC 792, “Internet Control Message Protocol”: https://www.rfc-editor.org/rfc/rfc792.html
  • ping(8) manual page, man7.org: https://man7.org/linux/man-pages/man8/ping.8.html

920 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *