How does traceroute work?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right so this is my chance Craig's gone he's headed lunch um but actually I'm here to talk about a traceroute so how does traceroute work traceroute is a really useful and interesting tool that you can use to figure out how packets are being transmitted from a source on the Internet to a destination so let's let's talk about how that works here you are here on your computer and here is some other computer on the Internet let's say this is a server that you're communicating with and you'd like to know how are the packets that are transmitted to the server and actually from the server or path that they taking through the internet so most of the time the Internet is just this blob of computers routers and the operation of the internet assuming everything is working properly it's pretty much invisible and that's good but sometimes we are just kind of curious what Pam for these packets say so here's how this works within the Internet packets that are transmitted from your computer to this server are going to be touched and transmitted and retransmitted by a variety of different routers along the routing path so a packet that I sent to the server might go to this router let me try and fit it to this router to this router this router before finally reaching the server what I'm interested in knowing is what are the identities of these routers these routers are addressable they have to have public IP addresses otherwise they wouldn't be able to transmit data to each other so how do I figure out what those IP addresses are traceroute works in this very clever way and it exploits a field in the IP packet header so the iQue packet includes along with the destination and the source IP addresses it also includes this field called the time to live or TTL the time to live field is normally used to prevent routing loops so let's say that there's a Miss configuration in the network and some packet ends up being rounded back and forth between these two routers unfortunately if that happens that packet could just sit there going and forth forever consuming Network resources and we can never get rid of this packet it's never going to get where it's going because there's some sort of routing this configuration but it's also going to be stuck there forever so the time to live field is used by routers to prevent this from happening and here's how it works I initialize the time to live field to some values 64 is a common value that's used every time the router retransmits the packet to another router it decrements the time to live so what would happen is this router would see a time to live it of 64 it would send it on to this guy you would see it time to load of 63 it would send along this guy haven't seen a time limit of 62 etc and by the time it gets to the destination maybe the time to live is been decremented by 12 or 13 or 20 or whatever how many hops it took to get there now normally this is all works fine but the way that this is used to prevent routing loops is if the time to live ever reaches 0 the packet is dropped so a time to live zero means this packet has been transmitted now for maybe 64 hops and the idea is that that's too many something's wrong the packet isn't making any progress towards its destination maybe it's stuck in one of these loops and so the packet is dropped at that point now what traceroute does is it exploits this time-to-live field to find out the identities of the routers along the routing path between a source and a destination and the way it does this is it uses the ICMP the internet control message protocol because routers can be configured most routers are configured to do the following when a packet expires because the time-to-live field goes to 0 the router sends a message back to the source saying oh by the way I dropped this tack remember IDs best-effort so there's launched drop packets and all that message does to say I dropped the packet so here's what traceroute does to find out the identity of these routers first and traceroute works internally so it starts 1/2 2 hops three hops it's going to try to find this guy first and then identify this guy identify this guy you keep going all the way into the destination so the first thing it does is it sends a packet with the time-to-live of 1 so that packet gets to this router this router says uh-oh the time to live decremented by 1 is zero so I'm going to drop this packet but I'm going to ascend a message back here that says I drop the packet and at that point this router has identified itself because I look at the source of the message that I get back from this router and so let's say I found out this is routers seat great ok so you might see what we're going to do here now what I do is I set the time to live of the packet to be 2 and so routers see will route the packet 1 hop forward decrementing the time to live but when it gets here the time to live is 1 the router decrements the time to live and it says the same thing is the first router it says uh-oh I have to drop this packet so it sends a message back to the source and it identifies itself and traceroute just continues to do this setting packets toward the destination with incrementally increasing time to live 1 2 3 4 all the way until it reaches the destination and in doing so it can identify potentially all of the routers that are used along a particular routing path now there's some caveats here one important thing is that these routers have to be configured to send these ICMP responses not all routers do that the other thing is the network has to allow those responses to come back so sometimes when you run a traceroute you'll see that it stops at some point and then you don't get any more information and the reason is certain networks block these types of packets so once I get here this router doesn't send one and even if routers farther down the chain try to send one of these I drop the packet messages back to the source it's dropped at this network and so there's cases where you try to run a traceroute it gets to a certain point that's going fine and then you just don't see any more information and that's why but this is how tracer works it's pretty clever exploits the time-to-live field in order to find out the path between a source and a destination
Info
Channel: internet-class
Views: 94,563
Rating: 4.9532166 out of 5
Keywords: internet, internet-class.org
Id: G05y9UKT69s
Channel Id: undefined
Length: 6min 31sec (391 seconds)
Published: Thu Sep 08 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.