Share This Article
What happens when a router receives an IP packet with a TTL of 0? The answer to this question is not as easy as it may sound. There are many factors that determine what the router does when it receives a packet with such low TTL.
A router looks at the TTL to determine if its a request or response packet. If it is not, then the packet will be forwarded based on whats configured in the routing table for that interface (if nothing is enabled, it defaults to forwarding packets with no preference). But what about requests? The answer depends on how low you set your ttl value when sending out this IP packet. More specifically, there are two answers:
If you have specified a high enough time-to-live value of 255 and sent out an echo request from one host to another – chances are they will receive successful responses back from each other since both should still see themselves as live hosts. Lets say we modify our original question now by specifying a lower TTL value of 16. A packet with a ttl of 0 would now be considered dead because it is close to if not already expired – and too far away from the destination host for any responses to make their way back. What does this mean? Well, you will no longer receive an echo request or response due to the TTL being set at such low value; packets are simply forwarded without preference which means that they may end up in one location as opposed to another based on what your routing table specifies.
What Happens When a Router Receives an IP Packet with Pkt-ToS of 0: The answer depends on how low you set your ttl value when sending out this IP packet. More specifically, there are two answers:
A packet with a ttl of 0 would now be considered dead because it is close to if not already expired – and too far away from the destination host for any responses to make their way back. What does this mean? Well, you will no longer receive an echo request or response due to the TTL being set at such low value; packets are simply forwarded without preference which means that they may end up in one location as opposed to another based on what your routing table specifies.
The answer depends on how low you set your ttl value when sending out this IP packet. More specifically, there are two answers: If you want all packets sent through the router (regardless of TTL) routed outward then setting a very low TTL is the answer. If you want all packets sent through the router (regardless of TTL) routed inward then setting a very high ttl is the answer.
But what about when you send out an IP packet with a Pkt-ToS 0? Well, it’s going to depend on whether or not your routing table specifies that ALL OUTGOING PACKETS should go through this particular router – in which case if there are any other routers between where our destination host would be along with ours, then we will need to set up some tunneling/routing rules so that those packets do make their way back without getting lost because they can’t reach the intended destination host due to having no remaining life left from sending them too far away.
Otherwise, if it doesn’t specify ALL OUTGOING PACKETS and you don’t want to bother with the tunneling/routing rules for packets which have a ttl of 0 then just set your router’s “Max TTL” setting to 255. That way all incoming packets will go through this router but outgoing packets won’t unless specified by the routing table. This is because there are different types of routes – those that include an explicit maximum hop count as well as those where it is implied. The latter means that we can send out any number of hops away before reaching our intended destination without having them get lost due to lack of life time left on their ttl value since they’re not being sent very far at all; in this case, we don’t specify the ttl in our packet.
In this scenario, you can also set your “Max TTL” setting to 255 and not bother with the routing rules for packets with a ttl of 0 at all if you’re just using one router on your network. You might be thinking that since it doesn’t specify ALL OUTGOING PACKETS than why would any outgoing packets have a ttl value? Well .. remember how I said there were different types of routes? Well, those routes which only go out from here are ones where we want to make sure they get their full lifetime because they will never loop back around again; whereas when sending out packets as part of an established connection or tunnel then presumably these packets will be looping back around and so we might want to set the TTL on these packets lower.
This time, instead of creating a routing rule for every possible outgoing packet (which there are an infinite number of), we create one main route which specifies that all our OUTGOING PACKETS should have “Max TTL” value 0. If you’re curious as to how this works then let’s take a look at what happens when I send a ping with ttl=0 from my client machine out through my router:
here are ones where we want to make sure they get their full lifetime because they will never loop back around again; whereas when sending out packets as part of an established connection or tunnel then presumably these packets will be looping back around and so we might want to set the TTL on these packets lower.
This time, instead of creating a routing rule for every possible outgoing packet (which there are an infinite number of), we create one main route which specifies that all our OUTGOING PACKETS should have “Max TTL” value 0. If you’re curious as to how this works then let’s take a look at what happens when I send a ping with ttl=0 from my client machine out through my router:
The router receives my packet with a ttl=0 and changes the value to 255. The TTL now is set to 255, which means that this particular packet will never loop back around again – it’s gone for good! So what does the router do with packets after it has decremented their TLL? It forwards them on to the next destination in its routing table (remember those forwarding tables?). For example:
So when I sent out a ping from my client machine, then presumably other traffic was being forwarded by the router as well. This would mean that any non-zero ttl values were not changed because they are going through our OUTGOING rule where we only set Max TTL = 0. Note also that if there were any packets with a ttl of 255, they were NOT changed because our rule only affects packets that have not yet expired. In the case above, when I sent out my pings to Google’s DNS server and then waited for them on an incoming interface (in order to see how long it takes), every packet was returned within about one second – which means that all of these outgoing packets had TTLs of 256 or less. What would happen if we set Max TTL = 0? In this case, there will be no change in TLL values; so even though some traffic is going through OUTGOING rules where we never increment the ttl value by setting MaxTTL=0, our ping responses from google should still take