Pinging same address multiple times

icmpnetworkingping

I am just wondering if it is possible to ping the same ip address from the same source multiple times (ie fast enough so they get pipelined) and still get a valid result. By a valid result, I mean that you record a valid round trip time for all ping packets.

What I am getting at is that is there a possibility that packets could get mixed so the receiver does not know which packet is which, and thus the recorded round trip time not be accurate. Are there any mechanisms with ICMP or IP that number ping packets so they are distinguishable from the other pings to the same address.

Best Answer

In the ICMP header there is an Identifier and a Sequence number, used for exactly this purpose. They occupy bytes 5-7.

See RFC792 page 15:

The identifier and sequence number may be used by the echo sender to aid in matching the replies with the requests. For example, the identifier might be used like a port in TCP or UDP to identify a session, and the sequence number might be incremented on each request sent. The destination returns these same values in the reply.

Related Topic