Tracert utility uses the ttl field of ip packet header to accomplish its goal. TTL field(usually set to 32 or 64) tells us the number of hops a packet will have travel to reach to its destination host.
Each time a packet passes a hop, the ttl value is decreased by one and when the TTL value at an intermediate hop (router) becomes 1, the packet is discarded.
Traceroute requires the same and it incrementally gives the ip addresses of the hops through which the packet passes.
It utilizes the IP protocol's time to live (TTL) field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to the host.
We have to supply only name or IP address of the destination host. This paremeter can be followed by the size of the probing packet [packetlen] sent to that host (40 by default).
By default this command will use first ttl as 1, maximum 30 hops. port no. as 33434 and packates of length 40 byte using UDP protocol
Options:
-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target.
-j host-list Loose source route along host-list (IPv4-only).
-w timeout Wait timeout milliseconds for each reply.
-R Trace round-trip path (IPv6-only).
-S srcaddr Source address to use (IPv6-only).
-4 Force using IPv4.
-6 Force using IPv6.
Examples:
C:\Users\shankar_bhagat>tracert 10.219.202.17
Tracing route to HYDPCM316109D.ad.infosys.com [10.219.202.17]
over a maximum of 30 hops:
1 <1 ms <1 ms <1 ms HYDPCM316109D.ad.infosys.com [10.219.202.17]
Trace complete.
If you dont want to resolve ip addresses to ip name, use option "-d".
C:\Users\shankar_bhagat>tracert -d 10.219.202.17
Tracing route to 10.219.202.17 over a maximum of 30 hops