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. 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 , 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 | Switches to enable various ping options |
host | The destination: either a symbolic name or an IP address |
size | The size of the data portion of the packet |
packets | The number of packets to send |
Ping uses the ICMP Echo and Echo Reply messages. 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). |
taken from TCP/IP tutorial