What Is Ping?

Ping is a powerful TCP/IP command designed to help track and resolve connectivity issues between two or more networked devices.

What Is Ping?

  • Ping is a command-line program designed to allow network admins to track the availability status of different devices in a network. It also helps discover network connectivity and latency issues.

  • Ping is essentially a combination of Internet Control Message Protocol (ICMP) echo requests and response messages. When a network administrator inputs a ping command on the command prompt, an echo request—a small data packet of up to 64 bytes—is sent to the target device or a specified IP address. The local computer that sent the request then waits for the response of the remote host. If available or online, the target computer sends an echo response packet back to the originating computer. Generally, multiple echo requests are sent in a ping network test to assess the remote host's availability. For instance, in Windows, the usual number of echo requests sent to an IP address is four. The command prompt displays the result of every request and helps network admins determine whether it got a response. It also shows the total number of bytes sent/received and time-to-live, an indicator of a packet’s life span in a network before getting rejected.

    The absence of ping response despite robust network connectivity indicates the target device is unavailable or offline. If the ping network test results show packet loss, poor network connectivity can be a possible reason. Similarly, having frequent echo request timeouts in a ping network test is often due to incorrect IP address entry.

  • To run the ping utility, a user should enter the ping command followed by the target device's hostname or IP address into a command-line interface. Here’s the basic syntax of this command and some examples:

    Syntax:

    • ping <space> <IP address or hostname>

    Example:

    • ping 127.0.0.1
    • ping google.com

    The ping utility was initially developed for the Unix OS. Later, most operating systems started supporting ping, but unfortunately, they introduced their own customizable parameters lacking consistency. To set the number of echo requests in a ping network test, for example, Windows uses the -n (number) option, whereas Unix leverages the -c (count) parameter.

    Example:

    • Windows: ping -n 5 google.com
    • Unix: ping -c 4 google.com

    Popular ping switches and modifiers:

    The parameters added after the ping command are known as the ping switches or modifiers. Typically, the command “ping ?” allows IT staff to get details for all the ping options they can use on any operating system. Outlined below are some of the popular switches in Windows:

    • -t: Use this option to continuously send ping requests to the target system.
    • -a: This option helps unveil the hostname of the target IP address.
    • -n: This option sets the number of echo requests.
    • -l: This ping parameter specifies the size of an echo request packet, typically in bytes.
    • -f: This IPv4-centric option prevents echo request fragmentation by intermediary routers.
    • -i: This ping option sets the life span or TTL value of a request packet. The maximum value is 255.
    • -v: This option specifies the type of service (TOS) applicable for a particular echo request.
    • -r: This IPv4-based option sets the number of hops between two communicating nodes.
    • -s: This option displays the time in internet timestamp format for every ping request sent/received.
  • Monitoring: The ping command is most often used to determine whether a host computer can respond to access requests from other devices in a network. IT admins can schedule a continuous ping network test to monitor devices' up/down status and receive timely alerts upon test failure, indicating the target host is unreachable.

    Device discovery: IT teams can use ping as a network device discovery tool to help locate all the accessible devices in a subnet. Generally, all connected nodes respond in a ping network test.

    Troubleshooting: A ping network test helps resolve network connectivity and latency issues. If an echo request gets timed out, it indicates configuration issues either in the target system or on the network, resulting in a connection error. Similarly, delayed response or echo reply messages from the target system often denote network congestion or latency. Network admins can confirm delayed acknowledgment by looking at the round-trip time data. Pinging the IPv4 loopback address and default gateway also helps track network connectivity issues.

    Name resolution: The ping command with the -a option helps resolve the hostname of an IP address. Similarly, pinging a domain address like Google reveals its corresponding IP address. IT teams can identify a name resolution issue if they get the response for an echo request to an IP address but not its hostname. This can indicate a missing DNS record for forward or reverse lookup or a missing entry to the local hosts file.

  • A ping network test helps verify the status of a networked device. Such tests also help network administrators determine the latency, routing, or congestion issues between two devices communicating over a network. If a small data packet or echo request travels from the local machine to the remote host and returns to the originating destination as an echo response, then the ping network test is considered successful. Network admins use command prompt to execute the ping utility test. The test results visible on the command prompt contain information on packet loss, total bytes sent/received, time-to-live (TTL), and the average time the data packet takes to travel back and forth between two network nodes.

    Outlined below are the steps to execute a ping network test:

    For Windows 10 and above:

    • Input "cmd" in the search bar and open the command prompt.
    • Enter the "ping" command and press the space button.
    • Enter the target IP address or hostname and hit enter.
    • The test results are displayed.

    For Linux:

    • Open a terminal or telnet Window instead of the command prompt and follow the same steps for the Windows ping test.

    For macOS:

    • Open the network utility app.
    • Navigate to the ping tab and enter the target IP address or domain URL.
    • Specify the number of echo requests and click on the ping button.
    • The test results will be available on the screen, similar to the Windows ping test.
  • The results of a ping network test, such as request timed out and destination host unreachable, help IT admins determine whether they can connect with a networked device. They can also identify and troubleshoot network latency and speed issues by analyzing the ping network test data, such as the average round-trip time and packet loss. Lower latency offers a better user experience while accessing websites. In online gaming scenarios where minimal lag is preferable, low latency is even more critical. The test result statistics often vary based on the network conditions and the target device location. Businesses should choose feature-rich ping monitoring tools offering accurate results. These advanced tools allow IT teams to continuously monitor the network devices' reachability and perform precise troubleshooting.

Featured in this Resource
Like what you see? Try out the product.
Pingdom

Make your websites faster and more reliable with easy-to-use web performance and digital experience monitoring.

View More Resources

What Is CIDR?

Classless Inter-Domain Routing (CIDR) refers to the standard process of efficiently allocating and organizing IP addresses across networks and devices.

View IT Glossary

What is MIB?

MIB is an organized, up-to-date repository of managed objects for identifying and monitoring SNMP network devices.

View IT Glossary

What is CPU usage?

CPU utilization indicates the amount of load handled by individual processor cores to run various programs on a computer.

View IT Glossary

What is HTTP?

HTTP is a standard protocol enlisting the recommended guidelines and procedures for exchanging information over the internet.

View IT Glossary

What Is DHCP?

DHCP intelligently manages IP address allotment and renewal activities in a network.

View IT Glossary

What is Network Administration?

Network administration aims to manage, monitor, maintain, secure, and service an organization’s network.

View IT Glossary