How to test ping with cmd ping

How to use the ping command in Windows

In order to determine whether a computer can be reached, Ping sends four ICMP echo request packets with a size of 32 bytes each to the address given as a parameter in the standard setting.

ICMP (Internet Control Message Protocol) is a protocol that is used to exchange information and error messages in IPv4 networks. A follow-up protocol, ICMPv6, is available for computer networks based on IPv6.

Theoretically, computers that support ICMP or ICMPv6 must automatically answer incoming echo requests with an ICMP echo reply in accordance with the protocol specification. In practice, this does not always work, as some administrators configure the computers under their management for security reasons so that ICMP packets are discarded unanswered. An unanswered ICMP request does not necessarily mean that the target computer cannot be reached.

If the addressed target computer does not respond, ICMP provides for a response from the responsible gateway. In this case, a router usually gives the answer that either the network or the corresponding host cannot be reached.

If the router does not respond, it can be assumed that the computer can be reached, but will not automatically respond to the echo request due to its configuration.

The ping command provides the following information as output:

  • Response time in milliseconds (ms)
  • Period of validity of the ICMP packets (Time to Live, TTL) (only with IPv4)

The Response time specifies how long a data packet needs to get to the target computer and back again. The period of validity specified as TTL corresponds to the expiry time of a data packet. The initial value is a maximum of 255. Implementations with an initial TTL of 31, 63 or 127 are common. The TTL is reduced by 1 by each network node through which the data packet passes. In this case one speaks of hops. If the TTL drops to 0, the data packet is discarded.

The TTL that you receive as output usually corresponds to the initial value of the responding computer minus the number of hops on the route.

With a TTL of 58, for example, you can assume that the response packet was sent with an initial value of 63 and passed 5 network nodes on the way back.