DEV Community

Rounak Polley
Rounak Polley

Posted on

Finding Path of Packets

We know data travels across the internet in small packets. But it does not fly from one computer to another computer instead it passes through various network devices. But, can we determine an approximate path through which the packets travel ?
The answer is yes!

For example the path of accessing form Kolkata (India) looks like this.
(Note : Here I have joined server locations with straight lines for simplicity)
Reaching from Kolkata

It can be done by using tracert command on Windows which is equivalent to traceroute command on Mac and Linux.
Note : These commands take some time to execute so be patient or to cancel mid-way press ctrl+c.

tracert or traceroute displays the route taken by packets from a local system to reach a remote server/host over an IP network (network that uses IP to send and receive messages between one or more computers).

tracert sends ICMP (Internet Control Message Protocol) echo packets to the destination and listens for the reply.
Trace route sets the TTL to 1 and increments it for every hop. The routers receiving the message decrement this value and when it reaches 0 they reply a message that the TTL has reached zero. This reply then tells client (which executed the command) from where it has returned. This process continues until the Destination is reached.

Following is a tracert on That I have used to plot the map shown above.

C:\Users\ROUNAK POLLEY>tracert

Tracing route to []
over a maximum of 30 hops:

  1     2 ms     1 ms     1 ms
  2     4 ms     3 ms     3 ms
  3     7 ms    21 ms    13 ms []
  4     7 ms     7 ms     8 ms
  5     4 ms     4 ms     4 ms []
  6    42 ms    45 ms    46 ms
  7    42 ms    43 ms    42 ms []
  8    84 ms    77 ms    78 ms []
  9    74 ms    75 ms    75 ms []
 10    94 ms    81 ms    77 ms
 11    77 ms    78 ms    77 ms []
 12    78 ms    77 ms    78 ms []
 13    77 ms    76 ms    79 ms
 14    78 ms    76 ms    76 ms []

Trace complete.
Enter fullscreen mode Exit fullscreen mode

Output of the command :

  • The output is divided into columns which are

hop Number, RTT 1, RTT 2, RTT 3 Domain Name and IP Address
RTT stands for Round Trip Time.

  • Here is the IP address of my router. And is my ISP (Internet Service Provider) etc.
  • If a router does not respond within a timeout (TTL) then asterisk is printed. For example :
 3     *        *        *     Request timed out. 
 4     5 ms     *        *[]
Enter fullscreen mode Exit fullscreen mode
  • Generally when we use a IP location finder on the IP addresses returned by tracert we see that some of the IP(s) are private. This is due to the fact that these are the internal IP(s) of servers/gateways of some organizations.

'Hops' are nothing but the computers, routers, or any devices between the source and the destination.
For using different options with tracert type 'tracert' and press 'enter' (In the command prompt). It will show all the available syntax.

To visualize the physical locations we just use any IP Geolocation service like . And then simply plot them on the map.

Top comments (1)

dpaine20 profile image
David Paine20

Great content. Thanks for sharing. Just to add, if you want to visualize the IP location on Google maps, that tool
with four geolocation databases information on IP, and displays each database information on Google maps, will surely help the user.