How To Conduct A Ping Test

published
August 16, 2024
TABLE OF CONTENTS
Get Secure Remote Access with Netmaker
Sign up for a 2-week free trial and experience seamless remote access for easy setup and full control with Netmaker.

Ping tests are used to check if a server or device is awake and responding. When you perform a ping test, your computer sends a small data packet to the target device. 

The data packet, known as an ICMP (Internet Control Message Protocol) echo request, travels across the network to the specified IP address, which is like an address on a letter. 

Once the packet reaches its destination, the target device sends back an echo reply packet. This reply is the confirmation that the target device is indeed online and reachable.

How ping tests work in practice

Imagine you are testing the connection to a website, say www.example.com. When you ping this site, your computer sends out those tiny data packets to the site's server. If everything's working properly, we'll receive an echo reply almost instantly. 

The time it takes for this round trip – the ping time – is measured in milliseconds. If it takes 20 milliseconds, that's a super-fast response. But if it takes 200 milliseconds, that's considerably slower, even though it's still less than a blink of an eye.

Ping tests can reveal more than just whether a server is up or down. They can also tell you about network congestion or packet loss. For instance, if you ping www.example.com multiple times and notice some packets never make it back, it suggests packet loss. 

That's like sending ten text messages to a friend and only getting nine replies. It means something got lost in transit. High ping times can indicate network congestion, much like getting stuck in traffic on your way to work.

Sometimes, different devices on the same network can respond to pings differently. For example, pinging a local printer on your office network might yield faster responses compared to pinging a remote server across the country. This difference is because local network traffic usually has fewer hurdles to clear than traffic traversing the internet.

Diagnosing network issues

Ping tests can be incredibly useful for diagnosing network issues. Suppose a user complains that your online store is slow. The first thing you might do is ping the user’s IP address. 

If you see that the response times are high or packets are getting lost, you will know that the problem might not be with your server but somewhere along the network path.

Another useful example involves multiple data centers. Let’s say your company has servers in New York, London, and Tokyo. You can run ping tests between these locations to ensure everything is running smoothly. 

If the ping times between New York and Tokyo are significantly higher than usual, it might indicate a routing issue or network congestion that needs to be resolved.

So, ping tests using the ICMP Protocol are like a first line of defense when it comes to monitoring and troubleshooting network issues. They give us quick, useful insights with just a few simple commands.

Measuring latency and packet loss

To measure latency and packet loss, ping tests send packets of data to a specific server and wait for a response. That helps you see how long it takes for data to travel back and forth—the round trip time or latency—and whether any packets get lost along the way.

For instance, when you send a ping to a server in New Jersey, it might take 30ms for the data to come back to you. If you do the same test with a server in Germany, it could take 80ms. This is because the distance the data travels affects the latency. 

Using the settings on the site, you can adjust the packet size, frequency, and duration of these tests to simulate different scenarios.

Take gaming as an example. Different games have different requirements. For one game, you might set the packet size to 1105 bytes, the frequency to 45 pings per second, and the acceptable delay to 65 milliseconds. 

For a game like Fortnite, the settings would be different—probably around 35 bytes for packet size and 30 pings per second. These settings align with the demands of each game's communication needs.

Ping tests are also useful for voice over IP (VoIP) services like Zoom or regular internet browsing. If you’re having trouble with Zoom calls, you might set the packet size to 800 bytes and frequency to 250 pings per second to mimic a typical video call.

You can customize these tests to match your exact needs or use preset configurations for popular applications. Your site can use WebRTC technology to run these tests directly in your browser, making it easy to check your connection without needing extra software. 

What’s great about this is that it complements traditional speed tests, which usually just measure speed and basic latency. Ping tests give a clearer picture of your overall connection quality, including how reliable and prompt your connection is, which is crucial for real-time activities like gaming or video calls.

Ping testing tools

ICMP Echo request and echo reply

Echo request and echo reply is one of the simplest tests you can perform on your network to verify if a remote system is up and running on the network. 

This test becomes essential when basic connectivity appears to be failing. For this purpose, ICMP provides two nifty query messages: Echo Request and Echo Reply.

The ICMP Echo Request query message acts as a probe you (or any user) send to a destination system. The destination then responds with an ICMP Echo Reply query message. 

According to RFC 1122, "every host must implement an ICMP Echo server." This means any user should theoretically be able to send an ICMP Echo Request to any host on the Internet and get an ICMP Echo Reply in return. 

In reality, however, firewalls often block these packets for security reasons, or the packets might simply fail to be delivered. So, it's not always guaranteed.

RFC 1122 also suggests that there should be an end-user-accessible application interface for sending these Echo Request messages to other hosts. This is usually implemented as a program called `ping`. 

Almost every computing environment, even the most basic network print servers and fax gateways, offers some form of a `ping` program for testing basic connectivity. You can thank RFC 1122 for making this mandatory for any device with a TCP/IP stack.

Here’s how `ping` typically works: it sends one or more ICMP Echo Request messages to a destination system and then measures the time it takes to receive the ICMP Echo Reply messages. 

This time measurement helps in diagnosing network issues. For example, if you want to check whether Google's server is reachable, you can simply open your terminal or command prompt and type:

ping google.com

‍

This command sends several Echo Request messages to Google's server. If all is well, you will see Echo Reply messages coming back, along with round-trip time statistics. It's that simple.

Another practical scenario: imagine you want to test connectivity to your home router. You can `ping` the router's IP address:

ping 192.168.1.1

‍

This lets you know if your router is active and responding as expected.

While `ping` is incredibly useful, remember that network configurations or firewalls might prevent the Echo Replies from coming back, even if the destination system is up. Always consider these factors when interpreting `ping` results.

Built-in OS tools

Built-in OS tools for ping tests are incredibly handy for quick diagnostics. For instance, on a Windows machine, you simply open Command Prompt and type `ping followed by the server's IP address or domain name`. This command sends packets to the server and waits for a response, showing you the round-trip time.

A typical ping command might look like this:

ping google.com

‍

The output tells you if the packets reached their destination and how long the trip took. If you see high round-trip times, it could indicate network congestion or issues with the server.

On a Mac or Linux system, the process is quite similar. You use the Terminal app and run the same `ping` command. The response is formatted differently, but the information is the same. You see how many packets were sent, how many were received, and the round-trip times for each.

One thing to appreciate is how these tools highlight packet loss. If packets are dropped, the ping command will show a failed count, which is a clear indicator of potential network issues. 

For example, a series of commands like `ping -c 4 example.com` will send exactly four packets to the server. The `-c` flag specifies the count, which is useful for controlled tests.

These built-in tools also support additional options like setting the packet size, specifying the number of pings, and adjusting the time interval between pings. For example, using `ping -s 1000 google.com` on a Mac will set the packet size to 1000 bytes, which can help simulate different network conditions.

In scenarios where you need to monitor multiple servers, you can run ping tests in parallel using different terminal windows or scripts. This gives you a real-time view of how various parts of the network are performing.

While built-in ping tools are incredibly useful, they don't provide the comprehensive monitoring features of dedicated tools. For more advanced needs, you often complement these basic tools with solutions like ManageEngine's Free Ping Tool. This gives you graphical views of round-trip times, traceroute details, and even DNS lookup, providing a fuller picture of network health.

Third-party network tools

These tools basically send packets of data to a specific IP address or domain and then measure the time it takes for the packets to travel back to your device. Think of it as playing catch with your network!

One popular tool for this is Pingdom. It's super user-friendly. You just enter the URL you want to test, and Pingdom does the rest. It shows you detailed information like response time and whether the site is up or down. 

What’s to love about Pingdom is its easy-to-read dashboard. It even offers a mobile app, so you can stay updated on the go. Imagine you're monitoring your company's website, and you get a real-time alert that the server is down. You can act quickly to fix the issue before customers even notice.

Another great third party tool is MTR (My Traceroute). It's a bit more technical but incredibly powerful. MTR combines the functionality of the 'ping' command with 'traceroute'. It sends packets and shows you the path they take to reach their destination. 

This helps you identify exactly where the problem is happening. I once used MTR to diagnose a network slowdown that was traced back to a specific router in our ISP's network. Knowing the exact problem saved us hours of guessing and troubleshooting.

For those who prefer a simpler interface, there's PingPlotter, which is like MTR but with a much more graphical interface. PingPlotter shows you a visual map of your network path and highlights any problem areas in red. 

This makes it easy to share with team members who may not be as technically inclined. You can use PingPlotter to create a report for your management team. They will appreciate its visual representation and how easy it makes it to understand your network issues and the steps you are taking to resolve them.

How to automate ping testing

The EMCO Ping Monitor is probably the most popular tool for automating ping tests. It uses ICMP ping to check the availability of network hosts and gives you a clear picture of their connection quality. 

What's great about this tool is that it doesn't just send a one-off ping. It regularly pings each monitored host in a constant 24/7 cycle. This way, you can detect any connection outages or quality issues as they happen.

For example, if a host responds to the ping, the tool marks it as "Up". But if it doesn't respond to several pings in a row, the host is marked as "Down". 

This is useful because the program will save this outage information and send you notifications whenever there’s a state change. So if you’re monitoring a server and you lose connection, you would instantly get an alert about the server being down.

In terms of quality, the tool looks at ping results to calculate metrics like packet loss, latency, and jitter. Based on these metrics, it can tell if the connection quality is Good, Warning, Bad, or even Critical. 

You can also customize these thresholds to fit your specific needs. This is handy because it allows you to tweak the settings so the notifications you get are more meaningful to your particular scenario.

Ping Monitor also stores all the results from the pings it makes. You can pull up a timeline of pings for any period you choose. This historical data is useful for analyzing the performance of a host over time. 

For instance, you can see all the times a server went offline and for how long each time. Plus, it lets you export this data into files for use in other tools or reports.

Speaking of reports, the program can generate detailed statistical reports on demand or on schedule. These reports can include a ton of information, from uptime and latency to the number of outages. 

You can even integrate this ping monitor with other software by setting up scripts or executables to run when there are changes in host state or connection quality.

Notifications are also highly customizable. You can set it up to send you an email, show a balloon notification in your Windows Tray, or even play a sound whenever there’s a change in host status or connection quality. This flexibility ensures you’re always in the loop, whether you’re at your desk or on the go.

Overall, EMCO Ping Monitor is a well-rounded tool that’s packed with features to keep your network monitoring efficient and straightforward.

How to run ping tests, step by step

The first step is to open the Command Prompt on your computer

If you're using Windows, you can do this by typing "cmd" in the search bar and pressing Enter. For Mac users, open Terminal by navigating to Applications > Utilities > Terminal.

Once you're in the Command Prompt or Terminal, you need to know the website or IP address you want to ping. For example, you might want to check the connectivity to Google's servers. 

In the Command Prompt or Terminal, type `ping google.com` and press Enter. This will send a series of packets to Google's servers and measure how long it takes for them to respond.

You'll see a series of lines displaying the results. Each line represents a single ping and shows the time it took for the server to respond. If you see "Request timed out," it means that the server didn't respond within the expected time frame. This could indicate a connectivity issue.

You can also ping an IP address directly. For instance, if you want to ping the IP address 8.8.8.8 (which is one of Google's public DNS servers), type `ping 8.8.8.8` and hit Enter. This command works the same way as pinging a domain name and will give you the same type of results.

If you're troubleshooting a specific server, replace the domain or IP address in the command with the one you're testing. For example, if you want to test the connection to your company's server at the IP address 192.168.1.1, you would type `ping 192.168.1.1` and press Enter.

In some cases, you might need to send more or fewer ping requests. By default, the ping command sends four packets. You can adjust this by adding a parameter. For example, to send only two ping requests to google.com, type `ping -n 2 google.com`. On a Mac, you can achieve the same by typing `ping -c 2 google.com`.

If you need to ping continuously, you can add a `-t` to the command on Windows, like `ping -t google.com`. This will keep pinging until you stop it manually by pressing Ctrl + C. For Mac users, use `ping google.com` without specifying a count, and it will continue until you stop it with Ctrl + C.

Advanced ping testing techniques

Using of different packet sizes

Normally, ping tests use a standard packet size of 56 bytes. But you can change this to see how your network handles larger or smaller packets. 

For example, you can use the `-s` option in the ping command like this: `ping -s 128 google.com`. This sends 128-byte packets instead of the default. It’s a simple tweak but it can reveal a lot about your network's performance under different load conditions.

Varying the interval between pings

Maybe you've noticed that typical ping tests send packets at one-second intervals. However, with the `-i` option, you can alter this interval. 

For example, `ping -i 0.5 google.com` will send packets every half second. This can help you understand how your network performs under more frequent requests, which can be particularly useful if you're dealing with real-time data applications.

Changing the number of ping requests sent using the `-c` option.

Normally, pinging continues until you stop it manually, but sometimes you just want a quick check. For instance, `ping -c 5 google.com` will send only five packets. This can be great for quick diagnostics without the fuss of stopping the command.

Using the `-t` option to set the Time-to-Live (TTL) for packets

The TTL specifies the maximum number of hops a packet can take before being discarded. This can be useful for diagnosing where packets are being dropped in a network. 

For example, `ping -t 64 google.com` sets the TTL to 64. If the packets don't reach their destination, you can use this information to identify potential problem spots in your network.

To capture even more detailed information, you can use the `-D` option to add timestamps to each packet sent. This is really handy for performance tuning and analysis. 

When you run a command like `ping -D google.com`, you'll get a timestamp for each response, making it easier to calculate how network latency changes over time.

Using the `ping6` command instead of `ping`

If you need to test IPv6 connectivity, you can simply use the `ping6` command instead of `ping`. This is pretty much the same as using `ping`, but specifically for IPv6 addresses. 

For example, `ping6 google.com` will check the IPv6 connectivity to Google. This is crucial if your company is transitioning to IPv6, as you'll need to ensure that everything is running smoothly in the new protocol.

These advanced techniques can reveal a lot about your network and help you troubleshoot issues more effectively. With just a few tweaks, you can get a deeper understanding of how your network performs under different conditions.

Analyzing ping test results

When you run a ping command, you'll see a series of lines in the output. Let's break down these lines step by step.

Destination IP address or hostname at the top

This is the server or device you're pinging. For instance, if you ping "jsdelivr.com," you'll see its IP address displayed, typically something like "104.16.121.96".

Packet size

In most cases, you’ll read that the packet size is 56 bytes. This size is for the data portion of the packet, but when combined with the ICMP header, the total packet size becomes 64 bytes.

Ping responses

Each line represents a response from the target device. For instance, you'll see something like "64 bytes from 104.16.121.96: icmp_seq=1 ttl=53 time=10.2 ms". Let's decode this:

  • "64 bytes from 104.16.121.96": This confirms success receiving a 64-byte packet from the IP address.
  • "icmp_seq=1": This number indicates the sequence of the ping request. It starts at 0 and increments with each request.
  • "ttl=53": The Time-to-Live value indicates the number of hops (or routers) the packet passed through to reach its destination. This shows the complexity of your network path.
  • "time=10.2 ms": Most importantly, this is the round-trip time (RTT). It tells you how long it took for the packet to travel from your device to the target and back, measured in milliseconds.

At the end of the ping results, you'll see a summary. This summary includes packet loss and round-trip time statistics.

Packet loss is the percentage of packets that didn't make it to the destination. For example, if it shows "0% packet loss," all packets were successfully received. Any non-zero packet loss suggests potential network issues.

The round-trip time statistics will give you four values: minimum, average, maximum, and mean deviation. For example, you might see something like:

rtt min/avg/max/mdev = 10.1/12.3/15.6/1.2 ms

‍

  • The minimum RTT is the shortest time recorded, here 10.1 ms.
  • The average RTT is the average time of all ping requests, 12.3 ms in this case.
  • The maximum RTT is the longest time recorded, which is 15.6 ms.
  • The mean deviation shows the variability in RTT, here 1.2 ms, indicating how consistent the ping times were.

Understanding these results helps you gauge network performance. Lower RTTs are generally better, indicating a faster and more reliable connection. However, occasional spikes and fluctuations are normal. And by interpreting these results, you can diagnose network issues, check performance, and ensure smooth network operations.

Get Secure Remote Access with Netmaker
Sign up for a 2-week free trial and experience seamless remote access for easy setup and full control with Netmaker.
More posts

GET STARTED

A WireGuard® VPN that connects machines securely, wherever they are.
Star us on GitHub
Can we use Cookies?  (see  Privacy Policy).