Table of Contents
Ping is often used to verify end-to-end communication using ICMP. Ping is a very commonly used command to verify that communication to a specified destination IP address is possible. Ping is an essential command in network installation and operation management.
How Ping works
The ping works in a very simple way.Sends an ICMP echo request message to the specified IP address. This message says, “Please send back the data as it was sent. When an ICMP echo request message is received, the data is sent back as is as an ICMP echo response message; if an ICMP echo response message is returned, the ping is successful.You can see that round-trip end-to-end communication is established with the specified IP address, with the data you sent being replied to properly.
Ping command (Windows)
To execute Ping command on a Windows OS PC, use the following command from the command prompt.
Ping command (Windows)
C:\ping <IP address of hostname>
If a hostname is specified instead of an IP address, the ICMP echo request message is sent after automatically using DNS to find the IP address.
The following is an example of pinging to a Google web server(www.google.co.jp).
Ping command sample (text)
C:\Users\gene>ping www.google.co.jp Pinging www.google.co.jp [220.127.116.11] with 32 bytes of data: Reply from 18.104.22.168: bytes=32 time=5ms TTL=59 Reply from 22.214.171.124: bytes=32 time=4ms TTL=59 Reply from 126.96.36.199: bytes=32 time=4ms TTL=59 Reply from 188.8.131.52: bytes=32 time=4ms TTL=59 Ping statistics for 184.108.40.206: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 4ms, Maximum = 5ms, Average = 4ms
The Ping command also provides a simple network performance measurement. It shows the round trip time to a specified IP address.
Note that just because a ping response is not returned does not necessarily mean that end-to-end communication is not possible. For security reasons, some devices are configured not to respond to pings.
For more information about the Ping command on Windows OS, please also see the following article.
Ping command (Cisco)
To execute the Ping command on Cisco devices, run the following command from the command line.
Ping command (Cisco)
A sample result of the Ping command on Cisco is shown below.
Ping command sample(Cisco)
Router#ping 172.16.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 20/36/56 ms
“!” means that a Ping response, i.e., an ICMP echo reply, has been received. Other meanings of the results of the Ping command are as follows.
|!||Echo response received.|
|U||Unable to reach destination|
|Q||Source quench message received|
|?||Unknown packet type|
|&||Packet TTL exceeded|
Then, by typing only “ping” and executing the command, an extended ping can be performed. Extended ping allows flexibility in specifying various parameters of the ICMP packets to be sent. For example, you can specify various parameters such as the number of ICMP packets, data size, source IP address or interface.
The following is an example of executing the extended ping command.
Extended Ping sample(Cisco)
R2#ping Protocol [ip]: Target IP address: 10.3.3.3 Repeat count : Datagram size : Timeout in seconds : Extended commands [n]: y Source address or interface: Type of service : Set DF bit in IP header? [no]: Validate reply data? [no]: Data pattern [0xABCD]: Loose, Strict, Record, Timestamp, Verbose[none]: Sweep range of sizes [n]: Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.3.3.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 20/22/24 ms
The following table summarizes the meaning of each parameter specified in the extended Ping command.
|Protocol [ip]||Layer 3 Protocol|
|Repeat count ||Packet number|
|Datagrame size ||Data Size|
|Timeout in seconds ||Time out in second|
|Extended commands [n]||Specify additional parameters|
|Source address or interface||Source IP address of Interface|
|Type of service ||Tos value of IP header|
|Set DF bit in IP header? [no]||Adding DF bits in IP header|
|Validate reply data? [no]||Verification of ICMP echo response data|
|Data pattern [0xABCD]||Data Pattern|
|Loose,Strict, Record, Timestamp, Verbose [none]||Specifying IP header options|
|Sweep range of sizes [n]||Continuous packet sending within a specified size range|
Values in  are default values
- Ping is a very commonly used command to verify that communication to a specified destination IP address is possible.
- When the Ping command is executed, an ICMP echo request message is sent to the specified IP address. Then, when you receive an ICMP echo response message in reply, you will know that the round-trip communication was successful.
- When you run the command on Cisco IOS by typing only “ping”, you execute an extended ping. Extended Ping allows you to specify various parameters for the ICMP message to be sent.
- 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