A ping is a Command Prompt (Windows) or Terminal (macOS) command that tests a connection between two computers. So, what is a ping? It works like the sonar on a submarine. A sub sends an audible signal or ping out to check its surroundings. When the ping strikes a nearby object, it echoes back, allowing operators to determine an object’s distance based on the time it takes to return an echo.

Read More about a Ping

Learn all about pinging in this post—how it works, how to run one, its uses, and more.

How Does Pinging Work?

Pinging is pretty straightforward. When you issue a ping command to a specific address, your device sends a series of Internet Control Message Protocol (ICMP) echo requests to that address. These messages are small data packets that ask for a response.

The ICMP protocol is part of the Internet Protocol (IP) suite. Network devices like routers use it to send error messages and operational information. It is thus crucial for network troubleshooting, one of pinging’s uses.

Once the echo request leaves your device, it travels through the network, passing through routers and switches until it reaches the destination host. After that, several outcomes can happen:

  • If the host is available and accepts ICMP requests, it will receive the request and respond with an ICMP echo reply that signals the host is reachable and its connection to your device is stable.
  • If the host is offline or does not accept ICMP requests, your device will not receive a reply. If the process times out, your device assumes the request failed, which indicates a network problem.
  • If the echo request packet does not reach the host due to network latency, it will be discarded and your device will get notified of the packet loss.
How Pinging Works

The echo reply provides vital information about the network. The time taken from sending the request to receiving a reply is measured and reported as the Round-Trip Time (RTT). This measurement directly reflects the latency between your device and the target host. Lower RTT values indicate faster, more responsive network connections while higher values may signify potential network issues, such as congestion or improper configuration.

Note, though, that the RTT also includes processing delay at the host and any delay introduced by intermediate devices like routers. Therefore, while it is a useful indicator, you should not solely rely on it to check your network’s performance.

The ping command typically sends four echo requests to calculate the average RTT. This process mitigates the impact of network anomalies, such as temporary traffic spikes, that might skew the results of a single request.

How Do You Run a Ping?

All computers have the ping utility regardless of their operating system (OS). On Windows, you just need to open Command Prompt while on macOS and Linux OSs, open Terminal.

Take a look at this example of a ping for the domain name techslang.com on macOS.

Sample Ping Request

You will see what you are pinging, the source IP address, the packet size—64 bytes, the sequence number, the time to live (TTL), and the response time in milliseconds.

Apart from domains, you can also ping an IP address. It will also show the response time and how well-connected that device is.

What Are the Uses of a Ping?

Pinging has several uses.

Troubleshooting Connectivity Problems

Pinging is commonly used to verify the connection between two computers. You can, for instance, use it to test a network printer or copier connection to see if it is offline or verify if you are connected to your router. If you are having trouble with an application hosted on a server, check the connection using a series of ping commands to help pinpoint the problem. If your ping comes back fast, your connection is good so the problem likely lies with the server or application.

To check your Internet connection, you can also ping a website to see if it works or there is a problem.

Troubleshooting Networking Issues

You can use a ping to test routers or servers for throughput and speed. It is also useful in finding which device uses a specific IP address in a given range. You can also use it to test computer names and addresses. Note, though, that pinging an IP address and not a computer name may be prone to name resolution issues.

If a ping comes back showing a successful connection but has a long response time, you are likely facing a routing, congestion, or networking issue.

You can run ping commands manually or automatically as scheduled tasks to monitor network reliability. The gist is that ping failure indicates a problem.

Testing Internet Connection Speed

In a speed test, a ping measures the latency or RTT of your Internet connection. It assesses how fast your connection responds to requests by sending small data packets to a nearby server and measuring the time it takes for them to return. A low ping is important for real-time applications like gaming and video calls, as high latency can lead to lags and poor user experiences. As such, it provides valuable insights into your connection’s responsiveness and overall quality, complementing download and upload speed measurements.

Ping and Traceroute: How Are They Related?

A traceroute provides a map of how data travels on the Internet travels from the source to the destination. You see, when you access a website, the data you get travels across multiple devices and networks, particularly routers.

Speed tests, pings, and traceroutes work together as a three-pronged approach to troubleshooting. First, the speed test confirms that a problem exists. Second, the ping measures device responsiveness. Finally, the traceroute identifies where an issue lies in the network path.

Ping and Traceroute Relationship

So, if you cannot access a website, you can ping its server to determine if it is reachable. If it is, run a speed test to evaluate the network’s connection speed. Then, run a traceroute to see if a connection is failing at a specific hop between your device and the website’s server.

As you have probably realized, pings are helpful in networking. But did you know that threat actors can also use pings in an attack known as “ping spoofing”?

What Is Ping Spoofing?

Ping spoofing is a network attack where attackers send fake ICMP echo request packets to target systems. The attackers manipulate the IP address in the ping request to make it appear as if it is from a trusted source. The attack’s main goal is to overload or confuse a target system into sending back responses to the spoofed address so it becomes unavailable to legitimate users.

Ping spoofing  pose various risks, such as:

  • Denial of service (DoS): The target system or network becomes unavailable to legitimate users.
  • Security vulnerabilities: The attack can open the door for other attacks like data theft if attackers gain more access to a target network.
  • Network congestion: The attack can overload network connections that can lead to packet loss and delayed communication.

Pings are crucial to networking in that it helps in troubleshooting.

Key Takeaways

Sources

  • https://en.wikipedia.org/wiki/Ping_(networking_utility)
  • https://www.lenovo.com/ph/en/glossary/ping/
  • https://www.solarwinds.com/resources/it-glossary/ping