How a packet finds its way across the internet
A packet crossing the internet passes through a series of routers, and each router decides only the next step. The idea to keep: every hop is a table lookup, and a counter makes sure a wrong turn cannot go on forever.
The short version
The packet is passed from one network to the next through routers. Each router looks in its own route database and forwards the packet. When several routes match the destination, the most specific one wins: the longest matching network prefix. Meanwhile a time-to-live field is lowered wherever the packet is processed. When it reaches zero, the packet is destroyed.
Step by step
- The sender hands the packet to the first router.
- The router looks up the destination in its route database.
- If more than one route matches, it uses the longest matching network prefix.
- It lowers the time-to-live field and forwards the packet to the next router.
- This repeats until the receiver is reached. If the time-to-live hits zero first, the packet is dropped.
Why it matters
A wrong turn between two routers cannot make a packet circle forever, because the counter runs out. My reading, not a quoted line: no single router needs to know the whole path, only the next hop. Simplified: one path, no error messages, no routing protocols.
Sources
- RFC 791: Internet Protocol — datagrams are routed from one internet module to another through individual networks; the time-to-live field is decreased where the header is processed and a datagram with zero must be destroyed
- RFC 1812: Requirements for IP Version 4 Routers — forwarding depends on a route database within the router; the longest matching network prefix is used; datagrams whose time-to-live reached zero are dropped