Table of Contents ICMP for IP Version 6
TCP/IP Tutorial and Technical Overview

2.5 Ping

Figure: Packet InterNet Groper (PING)

Ping is the simplest of all TCP/IP applications. It sends one or more IP datagrams to a specified destination host requesting a reply and measures the round trip time. The word ping, which is used as a noun and a verb, is taken from the sonar operation to locate an underwater object. It is also an abbreviation for Packet InterNet Groper.

Traditionally, if you could ping a host other applications like Telnet or FTP could reach that host. With the advent of security measures on the Internet, particularly firewalls (see Firewalls), which control access to networks by application protocol and/or port number, this is no longer strictly true. Nonetheless, the first test of reachability for a host is still to attempt to ping it.

The syntax that is used in different implementations of ping varies from platform to platform. The syntax here is for the OS/2 implementation:

ping [-switches] host [size [packets]]
Switches to enable various ping options
The destination: either a symbolic name or an IP address
The size of the data portion of the packet
The number of packets to send

Ping uses the ICMP Echo and Echo Reply messages, as described in Echo (8) and Echo Reply (0). Since ICMP is required in every TCP/IP implementation, hosts do not require a separate server to respond to pings.

Ping is useful for verifying a TCP/IP installation. Consider the following four forms of the command; each requires the operation of an additional part of the TCP/IP installation.

ping loopback
Verifies the operation of the base TCP/IP software.
ping my-IP-address
Verifies whether the physical network device can be addressed.
ping a-remote-IP-address
Verifies whether the network can be accessed.
ping a-remote-host-name
Verifies the operation of the name server (or the flat namespace resolver, depending on the installation).

Ping is implemented in all IBM TCP/IP products. TCP/IP for OS/2 (including the OS/2 Warp LAN Client version) also has a Presentation Manager program called PM Ping that uses ping to monitor a user-defined list of hosts stored in the file \TCPIP\ETC\PINGHOST.LST. This program can be iconized: when all hosts are responding, the icon is green, but if one or more hosts do not respond, the icon turns red.

Table of Contents Traceroute