Table of Contents
What is Ping command?
The ping command is used to verify that communication with a particular PC or server is possible. It is a very commonly used verification command to find out the cause of network problems.
The Ping command works in a very simple way: When you execute the ping command, it asks the specified peer to return some data (in Windows, a sequence of alphabetic characters) verbatim. When the peer receives the ICMP echo request, it responds with the data exactly as it was received, which is called an ICMP echo reply. When an ICMP echo reply is returned, it means that data has been exchanged back and forth between the communication partner.
The ping command also shows the approximate time required for round-trip data exchange.
Ping command on Windows OS
The ping command is executed at the command prompt; the syntax of the ping command is as follows.
Windows OS ping command
C:\>ping <IP address or hostname>
When a hostname is specified, the system automatically queries the DNS server to obtain the IP address for the hostname and sends an ICMP echo request to that IP address.
As shown below, if a response (ICMP echo reply) is returned from the specified IP address, it indicates that normal communication is possible. In addition to verifying communication, the ping command can also be used as a simple network performance measurement as it provides an estimate of the response time.
C:\Users\gene>ping 22.214.171.124 Pinging 126.96.36.199 with 32 bytes of data: Reply from 188.8.131.52: bytes=32 time=4ms TTL=59 Reply from 184.108.40.206: bytes=32 time=3ms TTL=59 Reply from 220.127.116.11: bytes=32 time=4ms TTL=59 Reply from 18.104.22.168: bytes=32 time=3ms TTL=59 Ping statistics for 22.214.171.124: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 3ms, Maximum = 4ms, Average = 3ms
You can specify various options when executing the ping command.
|ping command options||Meaning|
|-t||Continuously execute the ping command. To stop, type CTRL+C|
|-l <size>||Specify the data size to be sent when the ping command is executed|
|-w <msec>||Specify the time to wait for a response in milliseconds|
|-n <number>||Specifies the number of times data is sent when a ping command is executed|
If the ping command does not return a successful response from the communication partner, there is a problem somewhere between you and the communication peer. Note that if the ping command fails, it may simply time out, or it may return a response from someone other than the communicating peer.
A response from a non-communicating peer reports an error that the data could not be delivered. For example, in the following figure, the command ping 10.10.10.10 returns a response. However, this is not a response from the specified 10.10.10.10. The 126.96.36.199 along the way is reporting to the source that executed the ping command that it “could not transfer data to 10.10.10.10.10.
C:\Users\gene>ping 188.8.131.52 Pinging 184.108.40.206 with 32 bytes of data: Request timed out. Request timed out. Request timed out. Request timed out. Ping statistics for 220.127.116.11: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss), C:\Users\gene>ping 10.10.10.10 Pinging 10.10.10.10 with 32 bytes of data: Reply from 18.104.22.168: Destination network unreachable. Reply from 22.214.171.124: Destination network unreachable. Reply from 126.96.36.199: Destination network unreachable. Reply from 188.8.131.52: Destination network unreachable. Ping statistics for 10.10.10.10: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Note that a failed ping command does not necessarily mean that there is a problem with the network. A malicious user may exploit ICMP used in the ping command to attack the network or a specific server. To prevent such attacks, security software or firewalls may prevent responses to ping commands.
Also, when a ping command fails, it is often simply a matter of specifying the wrong IP address; be careful not to specify the wrong IP address when executing the ping command.
- IP(Internet Protocol) : The Most Important Data Transfer Protocol
- Ping “Will the data be transfered properly?”
- Ping command on Windows OS
- Traceroute : Which router does the data go through?
- ICMP Redirect
- Where’s the Trouble? Ping and Traceroute
- ARP(Address Resolution Protocol)
- ARP Format
- Gratuitous ARP(GARP)
- nslookup command : Verifying DNS name resolution
- DHCP : Automatically Assign IP Address
- Cisco IOS DHCP Server Configuration and Verification Commands
- Cisco Router DHCP Server Configuration Example
- DHCP Relay Agent
- DHCP Relay Agent Configuration Example [Cisco]
- Summary of DHCP Server Placement
- TCP/IP Configuration Summary
- ipconfig command : To verify TCP/IP configurations on Windows OS
- Commands to Verify TCP/IP Configuration On Linux (Ubuntu)
- Web Proxy Server
- FTP : Representative File Transfer Protocol
- TFTP(Trivial File Transfer Protocol)
- TFTP Client on Windows10/11