Using the Ping Command
Ping command is the most common method to check the status of a network entity, the IP connectivity between two nodes or the quality of the network (e.g. delay and packet loss). This post provides an introduction to the ping command and some of its parameters.
With the ping command, the source sends an Internet Control Message Protocol (ICMP) Echo Request to a specific destination address and it returns either a successful ICMP Echo Reply or an ICMP error message (when destination is unreachable). The ping command allows you to define several parameters such as ICMP packet size, number of ping counts, source IP address etc. The ping output differs for different systems. In Cisco routers (and in Juniper with the “rapid” option), the ping output is presented with an exclamation mark (!) for every successful ping and a dot (.) for every unsuccessful trial, followed by Round-Trip-Time (RTT) and packet loss statistics. The picture below shows an example of a ping output in a Cisco router where the “extended” command has been used in order to define extra parameters:
As you can see in the picture, the destination address, source address, ping size and count are defined. So the output shows 200 successful ICMP Echo Requests sent with size 1000 bytes to the destination 10.11.0.2 from the source 10.10.0.1. Moreover, the output shows packet loss statistics (100% success) and the minimum/average/maximum values for the RTT (2/5/15 ms). Note also here the “extended commands” parameter which allows to set extra parameters (e.g. the source address).
An interesting note here is the definition of the packet size in the ping command. Cisco and Juniper have different implementations for this. When you define a packet size value in the ping command, Cisco includes the IP (20 bytes) and ICMP (8 bytes) headers in that value (datagram size), while Juniper adds those headers as extra. For example, if you specify size 100 bytes, then Cisco will create a packet of 100 bytes, while Juniper will create a packet of 128 bytes (on the wire the Ethernet overhead is added as well).
In later posts, I will describe how to troubleshoot different network issues with the use of ping command.
- How Traceroute Works (telconotes.wordpress.com)