What happens when a router receives a packet with a TTL of 0 is a question that has been asked a lot when it comes to studying networking. Although there are tons of answers out there, many of them aren’t quite easy to understand. In this article, we will try to make it as simple as possible.
See also: Router IP Addresses – Everything You Should Know About It!
What is a router and what is its usage?
What is a router?
This is for those who are new to networking. You need to know what a router is in the first place. Routers are a vital part of the infrastructure in our households, however, many of us don’t really understand them. A large number of people even mistaken them for modems.
A router is a piece of hardware that helps your local home network such as your PCs and other devices communicate with the Internet. It acts as an information manager between the internet and all online devices.
See more: How to Setup Cisco Router?
What is its usage?
A router helps other devices to be connected to a modem such as the fiber, cable or DSL modem so they can communicate with the Internet. In general, most routers, including wireless routers, have several network ports which concurrently link multiple devices to the Internet.
A router is like a small computer that has a CPU and memory to process incoming and outgoing data. These data may be conveyed from devices to the internet or between them.
To make sure that the data packets are sent to the right place rather than being lost in transmission, a router assigns each device in the network with an IP address.
Simply put, a router helps devices within a network to be connected by forwarding data packets between them.
How does a router transfer packet?
After receiving a packet, the router scans its routing table to determine whether the target address is for a device on one of the networks that it has connected or whether the request must be transmitted by another router.
Then, the router sends a message to the next system. This operation is repeated on any router receiving the message before the message hits the targeted destination.
What is ICMP?
ICMP (Internet Control Message Protocol) is a network layer protocol used for network equipment to detect problems related to network communication. The key aim of ICMP is to determine whether or not the data reach their destination on schedule.
The ICMP protocol is commonly used on network equipment and routers. For error reporting and checking, ICMP is critical, but it can also be used in distributed DDoS attacks.
What is TTL?
As we have discussed above, a packet can “hop” through the network. The amount of time or “hops” a packet can remain in the network until a router discards it is called TTL (Time-To-Live).
When an information packet is generated and transmitted across the Internet, there is a risk that it can go infinitely from router to router. Packets with an expiry period called Time-To-Live or hop limit are built to minimize this risk.
There is a specified location in each packet where the value of TTL is stored. It’s a numerical value that represents the amount of time that the packet can travel across the Internet.
The router will eliminate 1 unit from the TTL count before transferring it to the next location. This will repeat until the TTL count in the packet decreases to 0.
See also: How to Get to Router Settings
What happens when a router receives a packet with a TTL of 0?
Now that you have equipped all the knowledge required to comprehend today’s answer, let’s dive right in.
So, if a router receives a packet with a TTL of 0, what would happen? The router will drop the packet and send an ICMP message type 11 and code 0 (time exceeded code) back to the host.
In theory, when the originating system receives this message, it must identify a problem, such as a routing issue when sending to this specific location or an initial TTL value that is too small, then react to deal with the problem accordingly.
Well then, how does a router handle a packet with a TTL of 1? This might surprise you since a router doesn’t forward and will discard a packet with TTL of 1, which is quite a similar behaviour with the case that TTL = 0. In this situation, the router will send an ICMP unreachable message back to the originator.
The ICMP message, however, is not immediately pinged back to the originator, as an interim LSR may not have an IP path to the packet source. The ICMP message is instead transmitted via the initial packet LSP.
Bottom lines
That’s how routers handle a packet with a TTL of 0. It is quite easy to comprehend as long as you’re equipped with some basic networking knowledge. If you have some other questions, leave them down in the comment section below, and stay tuned for the upcoming explanations. We will see you in the next article very soon.