Ping Command IP User and Privileged

The ping command is supported at the user and privileged exec modes.When used at the user mode, a set of default parameters such as five echoes, 100 bytes each with two-second time-outs will be used (in non-verbose form). You may enter an IP address or a name with the ping command (if the name can be resolved to an IP address using the local HOSTS table or using a DNS server).

Ping sends ICMP echo (echo request) to the destination, and the destination node replies to the source with an ICMP echo-reply. If you receive five echo-replies to the five echoes (echo requests) submitted, it means that five 100-byte packets could travel to the destination and back, each within a two-second time interval. There is a distinct possibility that the first of the five echoes times out; the cause is usually attributed to the need for ARP, or, in case of a DDR connection, to the need to build a circuit.

Example 4-3 displays sample outputs of the ping command. If all of the five packets don't get to the destination and back, or at least not within the two-second time interval, you need to investigate further. In this situation, you should usually choose closer and closer targets; once you find one that you can communicate with, you can define the problem area and focus your troubleshooting efforts. When you encounter timeouts or administratively prohibited cases, you will have to discover (and deal with) the busy or the protected devices accordingly.

Example 4-3 User Mode ping (IP)

RouterA> ping routerB

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.3.2.1, timeout is 2 seconds: !!!!!

Success rate is 100 percent, round-trip min/avg/max = 1/3/4 ms

RouterA> ping 172.16.5.5 Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.5.5, timeout is 2 seconds: .U.U.

Success rate is 0 percent (0/5)

A fundamental point of the ping tool is that it tests the round-trip path to and from a target. I often notice that when ping fails, people focus all of their effort on trying to troubleshoot the local device (source), and they forget that a ping failure is often caused by the destination device not having a path for sending the echo reply back to the source. See Table 4-4 for short descriptions of the test characters used by the ping facility. To abort a ping session, type the escape sequence (Shift, Control, and the 6 key, all at once). Another useful command that you can use when troubleshooting connectivity issues is the debug ip icmp command.

Table 4-4 ping (IP) Response Characters

Character

Description

! Reply received

Time-out

U

Destination unreachable

N

Network unreachable

P

Protocol unreachable

Q

Source quench

M

Could not fragment

?

Unknown packet type

You also have the option of using the extended ping in privileged exec mode. From the privileged mode, if you just enter the ping command, you will be prompted for the protocol (default is IP). After selecting IP, you are prompted for the target IP address, repeat count, datagram size, and timeout in seconds; finally, you are asked if you are interested in extended commands. Table 4-5 provides explanations for the parameters you are prompted for if you choose the extended commands option.

Table 4-5 ping (IP) Extended Commands

Readers' Questions

  • CELENDINE
    What does the option do in the ping command?
    7 months ago
  • The 'option' flag in the ping command is used to specify certain additional parameters and options for the ping command. Examples include setting the packet size, setting the time-to-live (TTL) value, setting the number of pings to send, and setting the size of the timeouts.
    • Ewan Murray
      When you issue the ping command, what protocol are you using?
      7 months ago
    • The ping command uses the Internet Control Message Protocol (ICMP) to send echo request messages and receive echo reply responses.
      • louise
        What is a ping command?
        8 months ago
      • Ping is a computer network administration software utility used to test the reachability of a host on an Internet Protocol (IP) network. It measures the round-trip time for messages sent from the originating host to a destination computer that are echoed back to the source.

        Field

        Explanation

        Source address:

        You may enter one of the router's local IP addresses or one of

        its interfaces.

        Type of service [0]:

        You may turn this bit to 1 to indicate Internet Service Quality

        selection.

        Set DF bit in IP header? [no]:

        If you answer yes, the Don't Fragment option will not allow

        this packet to be fragmented when it has to go through a

        segment with a smaller MTU and you will receive an error

        message from the device that wanted to fragment the packet.

        Data Pattern [0xABCD]:

        This prompt allows you to modify the 16-bit data pattern.

        All ones and all zeroes testing are commonly used to check

        sensitivity problems at the CSU/DSU or to detect cable

        problems such as crosstalk.

        Even though it looks like this prompt is offering one (or none) of the options listed, if you select one, the prompt shows up again, in case you wanted to select more than one of the available options. If you select any option, Verbose is automatically selected also. Record is a very useful option because it displays the address(es) of the hops (up to nine) the packet goes through. Loose allows you to influence the path by specifying the address(es) of the hop(s) you want the packet to go through, perhaps as well as other hop(s). With the Strict option you specify the hop(s) that you want the packet to go through, but no other hop(s) are allowed to be visited as well. The difference between using the Record option of this command and using the traceroute command is quite interesting and worth discussing. The Record option of this command not only informs you of the hops that the echo request (of ping) went through to get to the destination, but it also informs you of the hops it visited on the return path. With the traceroute command you do not get information about the path that the echo reply takes.

        Loose, Strict, Record, Timestamp, Verbose [none]:

        Sweep range of sizes [n]:

        Allows you to vary the size of the packets.

        Continue reading here: Ping Command IPX and Apple Talk

        Was this article helpful?

        +1 0