How does internet routing work?

848 views

So I’ve been researching online about this lately, but I can’t seem to find a comprehensive article that digs deep into this. I understand that the internet is decentralized and thus, packets are passed from router to router on the way to the destination, and I am aware of the underlying protocols and layers (link, application, etc), but when it comes down to the specifics of routing, there are just some things I can’t understand:

1. How is a packet’s route determined? Is it true that each router only has to decide which of its neighboring routers to pass the packet to? If so, how does that work?
2. How does a router know which direction the destination IP is physically located?
3. If a connection with a server is closed and then reopened, will the new connection follow the same route as before, assuming that each router along the way is still online?
4. Does each packet in a connection follow the same route as the others? If not, why?
5. How efficient is a typical route?
6. What role do ISPs play in all of this?

I know this is a lot of questions, but I would appreciate it if anyone here could help explain some of this. Thanks!

In: Technology

2 Answers

Anonymous 0 Comments

Every router keeps a *routing table* (this includes your PC by the way). Records in this table are either entered manually or received/calculated from neighboring routers through a routing protocol which is a way for routers to interact with each other.

[Here’s a screenshot from a Cisco router’s table](https://www.certiology.com/wp-content/uploads/2014/07/The-Routing-Table-of-Router-B-looks-like.jpg)

The routes in this table are all static (set up by hand), as you can see from the letter S. Another letter would imply one of the listed routing protocols as the source.

“10.0.0.0/24 is subnetted” means that the following records pertain to how to reach IP addresses matching 10.0.0.* .

“10.0.0.0 via 192.168.1.1” means that there is a router at 192.168.1.1 that knows how to get to the 10.0.0.0 network, so such packets should go towards it.

But where is 192.168.1.1? Note the bottom where it says 192.168.1.0/24 is directly connected, Serial2/0.
This means that the router has one of its network cards assigned to an IP in the same subnet as 192.168.1.1, so the router can directly pass the packet on to the neighbor.

If there is no matching record in the routing table for an IP address, the router sends to the default address – this should be either a router’s IP as above or a directly connected router. In this case this router has no default routing set up (“Gateway of last resort is not set”), so packets that cannot be routed using the local routing table are discarded.

You are viewing 1 out of 2 answers, click here to view all answers.