
You may use -p flag to set your own port number. In most of the UNIX implementation, the port is set to 33434 By default, it sends 3 probes at a time and at each probe it prints the set TTL, the IP address of the router and the roundtrip time in milliseconds.Ī highly unlikely port number is set on the packet and incremented upon each probe.
#ITRACE ROUTE CODE#
Traceroute will keep incrementing the TTL by 1 until it reaches the max hop (64 default) or it gets back an ICMP Packet Type 3, Code 3 (Destination port unreachable). Each router on the way will decrement the TTL by 1 and when the TTL value is 0, the router will drop the UDP packet and send back an ICMP Packet Type 11, Code 0 ( time exceeded). $ traceroute When you issue a simple traceroute command, as shown above, a UDP probe packet is sent towards the destination with a TTL set to 1. I have little to no experience of using traceroute in Windows, hence this blog would majorly cover the Unix based implementation. Most of the implementations would allow you to configure sending TCP packets as well. This can be very useful to identify if there is a router/gateway in the path that is rejecting/dropping the packets midway before it reaches the destination, or if there is any unwanted loop in the network.Īlmost all the UNIX based implementation uses UDP packets whereas Windows uses ICMP probe packets. When a user runs traceroute, an IP packet (ICMP/UDP/TCP) is routed through all intermediary hops until it reaches the intended destination. What is traceroute? It is a networking utility that routes IP packets from source to destination following all the hops (gateways and routers) in between. write your own traceroute: let's see if we can write own dumb version.trace the traceroute: use strace to step through it.traceroute: Just an intro into traceroute.

#ITRACE ROUTE PLUS#
I’ll probably do a series this time since I feel I won’t be able to compress everything into one blog and plus I don't want to make it a super long blog. While reading and learning more about it, I got curious and I wanted to understand what exactly is traceroute doing under the skin.

At that time I did not understand any of it since I was new to the world of Linux networking.īut just recently while I was debugging a similar issue, traceroute really helped me pinpoint where the actual problem was and all of a sudden I had a new found respect for it. I came across traceroute a long time back while I was shadowing one of my teammate who was trying to debug a firewall issue.
