Pages

Monday, November 7, 2022

Traveling Through a Network | What Are Ping and Traceroute?

Image courtesy of Site24x7

If you are like me, you may be looking at the title of this post and asking yourself, “What are ping and traceroute?” Ping and traceroute are two terms that I had not heard of before my recent experience using them for a recent class assignment. Since that was the first time I had even heard of ping and traceroute, let alone used them, I closely followed the instructions provided to ensure the steps were executed properly. In reviewing the steps, I learned that ping and traceroute were two commands that had to be inputted into a command line interpreter. As my computer uses Windows software, I had to use the application Command Prompt.

What Is A Packet?

Before I get into the specifics of what ping and traceroute actually do, I will first discuss packets as they play a big part in the functions of both commands. A packet is a small portion of a larger set of information. To paraphrase the class text, packets travel over communication links and through several other computers across the internet to reach their destination (Vahid, Lysecky, & Wheatland, 2019). The reason information is sent across the internet through smaller packets is that sending longer/larger portions at one time could potentially cause delays with other computers trying to send or receive information simultaneously. So now that you have a better understanding of what a packet is, let’s discuss ping and traceroute.

What Is Ping?

As previously stated, ping is a command. “Ping uses ICMP (Internet Control Message Protocol) Echo messages to see if a remote host is active or inactive, how long a trip message takes to reach the target host and return, and any packet loss.” (Kaczanowski, 2021) This means that ping is used to determine a device or website's accessibility, or reachability. For the class assignment, I was tasked with performing pings and traceroutes to internet addresses in three different countries. Understanding ping a little better, the next step was to send the first ping to google.com.

Next, I ran the command two more times. The second image displays the ping results for the website thedetailgeek.ca, a Canadian website that specializes in selling car detailing supplies.

And the third result displays the outcome of the website nintendo.co.jp, a website in Japan for the company Nintendo.

Comparing The Ping Results

Comparing all three ping results I saw that each ping sent out four 32-byte packets (a total of 12 overall) of which all 12 packets were received with no loss. I was very surprised by the reply time results for each ping. Again, I am not well-versed in pinging, so I am not exactly sure what I expected the results to be. However, I certainly did not expect the replies for google.com and nintendo.co.jp to be so similar since I assumed that domestic websites would ping faster than foreign websites. I did not expect thedetailgeek.ca to have the longest reply time as Canada is much closer to the United States than Japan.

Out of curiosity, I looked up the IP locations using www.iplocation.net and found that both google.com and thedetailgeek.ca have computers in California, while nintendo.co.jp has computers in Seattle, Washington. Having discovered this, I would have expected google.com and thedetailgeek.ca to have similar response times, given the geolocation of their computers, but thedetailgeek.ca has a much longer average response time than google.com. I also noticed that google.com did have similar response times to nintendo.co.jp, but their TTL numbers were very different.

Having no general understanding of what TTL stood for, I looked it up and learned that TTL, or time to live, is the number of times a packet is allowed to pass to a router. TTL is set to a default value amount and that value is reduced by one each time the packet travels through a router. “By default, in Windows and many other OS’s, the TTL will be 128 – that means that after a packet passes through 128 routers if it hasn’t reached its final destination yet, the packet will expire and will be removed from the network” (Gabriel, 2021). I found this to be interesting because that means that the packets to google.com had to pass through 61 more routers than nintendo.co.jp despite them having similar response times. Note, that some of this is speculative as I have no idea if the default TTL settings vary depending on the destination. So, I looked at the traceroute results to help me better understand the ping results.

What Is Traceroute?

Traceroute is exactly as its name implies. It is a command that is used to trace the route that packets use to travel through a network of computers, servers, and routers. The following three images were the results of all three traceroutes performed for google.com, thedetailgeek.ca, and nintendo.co.jp, respectively.



Analyzing each of the traceroutes, it seems that all three followed the same route up to the fourth router or destination, but afterward, all traveled completely different routes. Despite the packets for google.com having to travel through more routers (21) than packets for thedetailgeek.ca (11), each consecutive hop for the former was faster than the hops for the latter. Meanwhile, the packets for nintendo.co.jp only had to hop through 9 routers of which three times they experienced failure. I can only assume that the packets for google.com were traveling fast enough to compensate for the failures they experienced which allowed them to keep pace with the more successful travels experienced by nintendo.co.jp. On the other hand, thedetailgeek.ca experienced much longer time delays than the other two despite having traveled through just as few routers as nintendo.co.jp.

Last Thoughts

Ping and traceroute can be useful in diagnosing issues that occur with network connectivity. They do so by allowing the user to see step by step where the information or packet is traveling to and where it is experiencing issues, but both are still subject to experiencing issues or timeouts that might prevent the commands from fully executing. One reason that ping or traceroute requests may experience a timeout is if the receiving system is disconnected from the network. Not being connected to the network means that the server or computer is simply not reachable. Another reason is because of the receiving network’s security or firewall. These work to block any incoming requests which would result in a timeout.

Ping and traceroute can best be described through the analogy of shipping a package through the mail. When I place an order online, I received my shipping details once the shipping has been processed. These details show me the origin and the intended destination. As the package travels along its route, I receive updates that usually include the time of arrival at its current stop and the time of departure to its next stop. If my package does not arrive on time, I can look at my shipping trace and figure out which stop was most likely responsible for the delay in shipping based on the date and times the package arrived and left each location. This information also allows the shipper to improve their shipping process to reduce the chances of shipping delays in the future.

References:

  1. Gabriel. (2021). What is TTL in ping/ traceroute?. IO Flood. https://ioflood.com/blog/2021/01/28/what-is-ttl-in-ping-traceroute/
  2. Kaczanowski, M. (2021). How to Use the Traceroute and Ping Commands to Troubleshoot Network Connectivity Issues. Free Code Camp. https://www.freecodecamp.org/news/traceroute-and-ping
  3. Vahid, F., Lysecky, S., & Wheatland, N. (2019). TEC 101: Fundamentals of Information Technology & Literacy. zyBooks. Retrieved from https://learn.zybooks.com/zybook/TEC101

 



No comments:

Post a Comment