ping command
ping command
Ping is a command used to check network communication with the connection partner.
By using this ping command, you can check not only whether it is reachable, but also the status corresponding to various errors. You can also easily measure network congestion by checking statistics.
Ping first sends an ICMP type 8 echo request (Echo) to the destination. The destination terminal that receives this will return an ICMP type 0 Echo Reply.
*However, echo requests (Echo) may be blocked in the middle of the route or by the firewall on the PC, so there is no guarantee that a reply will be returned.
The sender can confirm whether communication is possible by receiving this echo reply. In case of errors, the error message will tell you why the destination is unreachable.
Execute the ping command on Windows from the command prompt. The usage is as follows.
For Windows
[Usage] ping [-t] [-a] [-n number of requests] [-l size] [-f] [-i TTL] [-v TOS] [-r number of hops] [-s number of hops] [[-j host list] | [-k host list]][-w timeout] [-R] [-S source address] [-4] [-6] target name |
For example, an example of executing ping to "www.yahoo.co.jp" is shown below.
ping command options
option | explanation |
-t | Pings the specified host until interrupted. Press Ctrl+Break to view statistics and continue. Press Ctrl+C to stop. |
-a | Resolve an address to a host name. |
-n number of requests | The number of echo requests to send. |
-l size | The size of the send buffer. |
-f | Set the Don't Fragment flag in the packet (IPv4 only). |
-v TOS | TOS Type Of Service (IPv4 only). |
-r hop count | Records routes with a specified number of hops (IPv4 only). |
-s number of hops | Shows the timestamp for the specified hop count (IPv4 only). |
-j list of hosts | Use the loose source root specified in the list. (IPv4 only). |
-k list of hosts | Use the strict source root specified in the list. (IPv4 only). |
-w timeout | Timeout in milliseconds to wait for a response. |
-R | Also test the reverse route using the routing header. |
-S source address | Source address to use. |
-Four | Force use of IPv4. |
-6 | Force use of IPv6. |
An example of using the command with options would be:
C:\ping -n 10 192.168.1.254
By default, the number of echo requests sent is 4, but here we specify 10.
ping command (error message)
Here, we will explain the Destination Unreachable (Type 3) error.
In IP communication, when some kind of problem occurs, routers and terminals along the route report the error to the source. For Destination Unreachable (Type3) errors, the following list of information is now reported.
Type 3 error list
code | information | meaning |
0 | Network Unreachable | network unreachable |
1 | Host Unreachable | Specific host unreachable |
2 | Protocol Unreachable | protocol unreachable |
3 | Port Unreachable | port unreachable |
Four | Fragmentation Needed and DF set | need fragmentation |
Five | Source Route Failed | It cannot be routed according to the source route. |
6 | Destination Network Unknown | I don't know the destination network. |
7 | Destination Host Unknown | I don't know the destination host. |
8 | Source Host Isolated | Sender cannot communicate |
9 | Network Administratively Prohibited | The destination network is rejecting it. |
Ten | Destination Host Administratively Prohibited | The destination host is rejecting it. |
11 | Network Unreachable For TOS | Network unreachable with requested TOS |
12 | Host Unreachable For TOS | Host unreachable at requested TOS |
13 | Communication Administratively Prohibited | Communication is denied. |
List of errors for Cisco routers
code | information |
! | Each exclamation point (!) indicates receipt of a response. |
. | A period (.) indicates that the network server timed out waiting for a response. |
U | Destination unreachable error received by PDU |
Q. | source quench (destination busy) |
M. | Not fragmentable |
? | Unknown packet type |
& | Packet Time to Live Exceeded |
You can find the cause of the trouble from this error message.