Understanding Ping Command

By | July 20, 2009

Ping command:

This is the most widely used tool to check the connectivity between the network devices. It uses port no 69 and is TCP based. It relies on ICMP(Internet control message Protocol)

It uses two types of  ICMP messages;

  • Type 0, Echo request  – sent by the source machine;
  • Type 0, Echo reply – sent by the Destination machine.

Ping command Helps in following way.

1)      Access: It helps us to see if the system is in reach of the connected system. If you get a reply from the destination then you can say that the system is reachable or else not.

2)      Distance : You can also find the distance and time it takes to reach the destination system. You can compare the time and the ping distance to determine if the system or site or the network is slow.

3)      IP Address: You can use the Ping command to find the IP address of the site. If you ping the domain name it automatically displays the IP address of the site.

Using Ping command is very easy:

Open the MSDOS on the windows computer and type PING followed by the computer name or the IP address of the computer. You will get the result in few seconds.

The output of the command consists:

IP Address of the remote machine

ICMP Sequence number

TTL i.e Time To Live, which shows the no of routers the packet hoped to reach the destination

Round-trip delay: It is the length of the time between the source and the destination

The number of lost packets.


Lets see the exact process of execution:

1. The source machine generates  the ICMP Data unit

2. This ICMP data unit is encapsulated with source and destination IP address and IP header

3. The Host machine also notes the time on the local machine while it sends the IP datagram towards the destination.

4. Each system reads the IP datagram if the destination address contains the IPaddress of its machine if not it forwards it to the next machine.

5. Finally when the destination machine receives the IP datagram and then Ipaddess maches with the machine.

6. The destination machine then replies with the ICMP Reply message, encapsulates it in the datagram placing its own IP address in source IP address field and the original senders IP in Destination field

7. This new IP datagram is routed back to the original sender of the command.

8. The host receives it and then notes the time on the clock and at last displays the output information which include the time elapsed