1819689 Members
3344 Online
109605 Solutions
New Discussion юеВ

how does traceroute work

 
Scott_20
Occasional Advisor

how does traceroute work

basically, what is it and how should it be used?
thanks
I'm ok
4 REPLIES 4
Dave Olker
Neighborhood Moderator

Re: how does traceroute work

Hi Scott,

From the traceroute man page:

This program attempts to trace the route an IPv4/IPv6 packet would follow to some internet host by launching UDP probe packets with a small ttl (time to live) or hop-limit then listening for an ICMPv4 or ICMPv6 "time exceeded" reply from a gateway. We start our probes with a ttl of one and increase by one until we get an ICMPv4 or ICMPv6 "port unreachable" (which means we got to "host") or hit a max (which defaults to 30 hops and can be changed with the -m flag). Three probes (change with -q flag) are sent at each ttl setting and a line is printed showing the ttl, address of the gateway and round trip time of each probe. If the probe answers come from different gateways, the address of each responding system will be printed. If there is no response within a 5 sec. timeout interval (changed with the -w flag), a "*" is printed for that probe.


So basically, traceroute sends network packets out and calculates the route the packets took through the network from point A (originator) to point B (destination).

Basic usage:

# traceroute


Regards,

Dave


I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
Patrick Wallek
Honored Contributor

Re: how does traceroute work

It traces all the hops of the route between your local machine and some remote machine.

Usage is:

# traceroute 1.2.3.4

It will then list all the machines that the packets pass through to get from your machine to 1.2.3.4.

It is very useful if you are having connectivity problems. With traceroute you can see where the problem could possibly lie. If the packets only make it part of the way to their destination, then there is a problem.

The man page will give more details as well.

# man traceroute
R. Sri Ram Kishore_1
Respected Contributor

Re: how does traceroute work

Asif Sharif
Honored Contributor

Re: how does traceroute work

When you issue the traceroute command, the utility starts sending of a packet (Internet Control Message Protocol), including in the packet a "time to live" (TTL) time limit value. It is designed to be exceeded by the first router that receives it, which will send back a "time exceeded" message.

This enables traceroute to calculate the time needed for the hop to the first router. It then resends the packet increasing the time limit value so that it will reach the second router in the path to the destination point, which returns another "time exceeded" message, and so on.

Traceroute finds out when the packet has reached the destination point by including a port number that is outside of the normal range. When it is received, a "port unreachable" message is returned, enabling traceroute to determine the time length of the final hop. Each hop is measured three times by the most of the trace-route programs

Regards,

Asif Sharif
Regards,
Asif Sharif