TraceRoute is a network diagnostic tool, that you can use to track where a packet of data goes from its source to its destination

This tool is used to understand the flow of data in the network and can used to diagnose network connectivity issues

When you use traceroute, the traceroute command reveals each hop the data packet takes along the route to its destination

Hop means a router or a gateway that the data packet encouners along the journey to its destination

The Traceroute uses the ICMP protocol that is the Internet Control Message Protocol to echo the requests.

In this article we are going to learn about the traceroute command. Here is what we are going to learn

  • Basic networking principles as background knowledge
  • How to use Traceroute command in different OS
  • Traceroute Example and Interpretation of output
  • How to use traceroute command in Linux  (traceroute command).
  • Insights into traceroute in Windows (tracert command).
  • Overview of traceroute in macOS (similar to Linux ).

Basic Traceroute networking principles

Before we discuss about traceroute, we need to know some basic networking pricinples related to it. Here are some of the terminologies that you should know before starting

  1. Data Transmission in Networks: In a network, the data passes from source to destination in the form of packets. thorugh their journey these packets of data traverse through various routers and switches
  2. Routers and Hops: A router is a networking device that forwards the data from one point to another and sets the rules for the transmission of data. When a packet of data moves from one network to another it is called as a hop
  3. IP Addresses: Devices that are connected to the internet are assigned a unique IP that is internet protocol address. This address is used to uniquely identify the device on the network
  4. Time to Live (TTL):  Time to live in the context of a packet is a field in the header that limits the lifetime of a packet of data in the network. It is a decrementing counter and whenever the packet passes though a hop it's count is reduced and when it reaches zero the packet is descarded preventing it from circulating indefinately
  5. ICMP messages: ICMP protocol is used by routers and hosts to communicate network level information. In traceroute when the packet of data reaches the last router, the last router sends an ICMP message of : time exceeded back to the source this helps in identifying each hop in the path

How to use Traceroute command in different OS

traceroute command in linux with its options and interpretation of its output

As we have already seen traceroute is a network diagnostic tool that lets us trace the path of a packet of data from its source to its destination

Functionality of Traceroute

  1. Packet transmission
  2. Time to live
  3. Path Discovery
  4. Destination reached

Usage and Options of traceroute

Basic Usage

The basic command of the traceroute is simple, you can simple traceroute any website like

//mac and linux
traceroute some-example.com
//windows
tracert some-example.com

Options

Here are some of the common options and how you can use them

  1. Specifying the number of Hops: Limits the number of hops traceroute will probe
  2. Changing the wait time: You can set the maximum wait time here
  3. Using ICMP: Use ICMP protocol instead of UDP
  4. Specifying the number of probes: specify the number of probes you want to send
  5. Verbose Output: Provide more details about the output.

Explanation

  1. traceroute some-example.com : Traceroute to some-example.com exposing each hop along the way
  2. traceroute -m 15 some-example.com Limits the trace to a max of 15 hops
  3. traceroute -w 3 google.com waits for a maximum of 3 seconds for a response from each hop before declaring the hop as unresponsive
  4. traceroute -I some-example.com for sending ICMP requests instead of the UDP requests.
  5. traceroute -q 6 some-example.com sending 6 probe packets instead of the default 1 packet

Traceroute Example and Interpretation

To do a traceroute in linux, open the bash terminal and write the destination website after the command like

traceroute some-example.com

traceroute to some-example.com (142.251.41.46), 64 hops max, 52 byte packets
 1  192.168.2.1 (192.168.2.1)  3.834 ms  3.574 ms  2.881 ms
 2  172.23.52.24 (172.23.52.1)  3.474 ms  2.823 ms  2.909 ms
 3  64.230.14.234 (64.230.14.234)  5.301 ms  5.940 ms  5.260 ms
 4  64.230.132.789 (64.230.102.789)  8.040 ms  6.632 ms
    64.230.232.34 (64.230.102.34)  8.946 ms
 5  64.260.60.241 (64.260.60.241)  9.627 ms  10.733 ms
    64.260.60.245 (64.260.60.245)  8.542 ms

this is a hypotetical website and a hypothetical result, but good enough for us to analyse

Let us analyse what the output means

Interpreting the Output of traceroute

  1. the first line states the destination or the target of the traceroute that can be any website for us it is (`some-example.com`) and its resolved IP address is (142.251.41.46). In the first line we also have the max number of hops that is 64 hops and the packet size that is 52 byte packets
  2. The subsequent lines: Each line represents a hop in the path of the packet from source to the destination
  3. Hop number: The number of the line (1,2,3, .. 5) represents the Hop number
  4. IP address and hostname: the next item on the line showns the IP address of the hop and sometimes if reverse DNS is sucessfull it also shows the domain name
  5. Response Time: lastly it shows the response time that was required to receive a response from the Hop

Analysis

  • Hop identification: Each hop is generally a router or a switch that comes in the way of the packet as it tries to reach its destination
  • Response Time: The time represents how long a part of the journey from one hop to another takes. Longer times could suggest either congestion or long destances
  • Missing Hops: Sometimes you might also see` * * * ` instead of response times. This means that the Hop is not responding to the probe within specified time limit. This could be either because of firewall rules that don't allow it or deep packet filteration.
  • Final Hop: final hop is the destination in this case some-example.com

Thus the output of the traceroute shows the journey of a packet of data from its source to its destination.

Traceroute in Linux, Windows and Mac

Trace route in Linux

In linux tracerooute is installed by default, here is how you can use it along with the common options

  • Basic Usage
traceroute some-example.com
traceroute command
  • Options to specify max number of hops: -m specifies the max number of hops in the traceroute in order to avoid long traces
traceroute -m 15 some-example.com
  • Option to change the wait time: -w option you can change the wait time. That is the time to respond at each hop before declaring it as unresponsive
traceroute -w 2 some-example.com
  • Using ICMP: I forces the use of ICMP requests instead of UDP requests
traceroute -I some-example.com

Tracert in Windows

In windows the equivalent of  traceroute is called as tracert . You can use the tracert command in terminal like this

tracert some-example.com

Here are some of the common Options when using tracert

  • Option to specify max hops
  • Using IPv6
  • Specifying the timeout

Traceroute in Mac

Using traceroute in mac is similar to using traceroute in Linux, with all the  same options. Hence here I will just be specifying the basic usage and you can use and refer to the Options from the Linux section

traceroute some-example.com

The performance and exact format of the output of  traceroute in mac and linux slightly differ because the network stack is implemented differently in each of these OS.

WebRTC Stun Turn Servers | Metered
Add one-to-one or Group Video and Audio Calling to your app or website with Metered Video Call SDK
Metered TURN servers

Metered TURN servers

  1. API: TURN server management with powerful API. You can do things like Add/ Remove credentials via the API, Retrieve Per User / Credentials and User metrics via the API, Enable/ Disable credentials via the API, Retrive Usage data by date via the API.
  2. Global Geo-Location targeting: Automatically directs traffic to the nearest servers, for lowest possible latency and highest quality performance. less than 50 ms latency anywhere around the world
  3. Servers in 12 Regions of the world: Toronto, Miami, San Francisco, Amsterdam, London, Frankfurt, Bangalore, Singapore,Sydney (Coming Soon: South Korea, Japan and Oman)
  4. Low Latency: less than 50 ms latency, anywhere across the world.
  5. Cost-Effective: pay-as-you-go pricing with bandwidth and volume discounts available.
  6. Easy Administration: Get usage logs, emails when accounts reach threshold limits, billing records and email and phone support.
  7. Standards Compliant: Conforms to RFCs 5389, 5769, 5780, 5766, 6062, 6156, 5245, 5768, 6336, 6544, 5928 over UDP, TCP, TLS, and DTLS.
  8. Multi‑Tenancy: Create multiple credentials and separate the usage by customer, or different apps. Get Usage logs, billing records and threshold alerts.
  9. Enterprise Reliability: 99.999% Uptime with SLA.
  10. Enterprise Scale: With no limit on concurrent traffic or total traffic. Metered TURN Servers provide Enterprise Scalability
  11. 50 GB/mo Free: Get 50 GB every month free TURN server usage with the Free Plan
  12. Runs on port 80 and 443
  13. Support TURNS + SSL to allow connections through deep packet inspection firewalls.
  14. Support STUN
  15. Supports both TCP and UDP

Conclusion

In this article we learned about the traceroute and how to use traceroute in different operating systems

Traceroute is an excellent command that can be used to diagnose the network and fix networking issues.