Octet

What is an extended ping on a Cisco router, and when do you use it?

Show the answer

Say this first

Extended ping lets me set the source address or interface, the repeat count, datagram size, timeout, the DF bit, and a sweep of sizes. I use the source option to test the return route for a specific subnet, because a ping from the WAN interface can work while one sourced from the LAN fails. I use DF with a size sweep to find the path MTU, and a high repeat count to measure loss on a suspect link.

Go deeper

Why the source matters

A router sources its ping from the exit interface by default. The far end may have a route back to that WAN /30 but not to the user subnet. Sourcing from the LAN interface or a loopback tests the path that users actually use.

Cisco IOS
R1# ping 10.20.0.10 source GigabitEthernet0/0/1 repeat 100
R1# ping 10.20.0.10 source Loopback0 size 1500 df-bit

The interactive form

Type ping alone in privileged mode. It prompts for protocol, target, repeat count, datagram size and timeout, then "Extended commands". Answer y to get the source address or interface, type of service, DF bit, data pattern, and "Sweep range of sizes".

Finding the path MTU

Set DF and sweep from 1400 to 1500. Sizes above the path MTU come back as M (a router sent "fragmentation needed") or . (the message was filtered). Equivalent host tests:

Shell
ping -M do -s 1472 10.20.0.10     # Linux: 1472 data + 8 ICMP + 20 IP = 1500
ping -f -l 1472 10.20.0.10        # Windows

Measuring loss

ping 10.20.0.10 repeat 1000 timeout 1 gives a loss percentage worth quoting. Five pings do not.

Traps

  • Mixing up Cisco's size (the whole IP datagram) with Linux and Windows sizes (ICMP data only, so 1472 fills 1500).
How did you do?Book 3.3 Internet (IP)