1

I'm trying to understand how a packet gets from client to server. I understand that it leaves the local switch and heads to the internet to get routed to its destination but what happens inbetween?

1 <1 ms <1 ms <1 ms BrightBox.ee [192.168.1.1] 2 * * * Request timed out. 3 * * * Request timed out. 4 6 ms 5 ms 5 ms 213.1.114.77 5 6 ms 6 ms 6 ms 213.1.67.166 6 7 ms 12 ms 10 ms 87.237.20.136 7 8 ms 8 ms 8 ms 212.187.166.149 8 8 ms 8 ms 8 ms 149.6.8.142 9 8 ms 8 ms 8 ms 151.101.129.111

Lets say I'm travelling from 192.168.1.19 to 151.101.129.111. I understand the TCP/IP layers and the concepts of Link Layers, Transport Layers etc but when a packet gets forwarded to a router at say 213.1.114.77, how does it know that there is a link between 213.1.67.166 (5 on the table) and 151.101.129.111. I'm also aware of routing tables at each router that maintain the list of routers its connected to.

Hope you guys understand what I'm trying to ask.

  • 2
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer. – Ron Maupin Dec 25 '18 at 9:46
3

When a packet gets forwarded to a router at say 213.1.114.77, how does it know that there is a link between 213.1.67.166 (5 on the table) and 151.101.129.111?

Short answer: Every router makes its own routing decision, based on the information it learns from other routers. So the router at hop 5 tells the router at hop 4 that it (R5) can get to 151.101.129.111. That's all R4 needs to know.

R5 knows it can reach the address because R6 tells it. And so on.

Routers learn about each other's routes by using routing protocols. The most common are OSPF, EIGRP and BGP.

@eddie 's link is also a good read.

| improve this answer | |
  • There is also the router's own route of last resourt which can come into play, if the router does not know of the appropriate next hop from other router's advertisements, manually configured routes, or having the network directly connected to one of it's interfaces, it will forward the packet to the router it had designated as it's Gateway of last resort (AKA Default Gateway). So essentially that makes four methods by which it may determine the next hop. – Ben Personick Oct 11 '18 at 17:37
  • 1
    I'd argue that the default route is just another, less specific route. It can be learned from another router or be manually configured. – Ron Trunk Oct 11 '18 at 20:40
  • True but that can be said of anything, Routing protocols were originally just automation of manual updates to the route tables before they started getting their own fancy metrics. If you chose to, you could still manually update the information while running them. The point is more about calling out that the hop 5 router may or may not know explicitly how to get to hop 9, and if it doesn;t explicitly know where to point it, then it would be using the gateway of last resort. and that is very different from saying it's routing table understands where hop 9 is explicitly through updates. – Ben Personick Oct 11 '18 at 21:40
  • 1
    @Ron "Routers learn about each other's routes by using routing protocols": indeed, of course, but need to include interface routes and manual configuration, without which there surely won't be any routing protocol traffic. – jonathanjo Oct 12 '18 at 9:13
0

The packet gets handed off from one router to the next, one by one, hop by hop.

As for how a router knows about about a link down the line- they communicate through routing algorithms. 5 has a link to 6, and it tells 4 about it. So 4 has an entry in its routing table that says "if I get anything destined for 87.x.x.x send it to 5 because it told me it knows where to send it." 4 doesn't know or care about the details of how 5 gets it to 6.

| improve this answer | |
-1

Routers have Four methods for determining the appropriate routing decision.

In No Particular Order:

A) Locally Connected Networks

B) Gateway of Last Resort (Default Gateway)

C) Manually Defined Routes (Static Routes, Route-Maps, Policy Based Routes, etc)

D) Updates from neighbor Routers through Routing Protocols (RIP, OSPF, BGP, etc.)

Method A: Is only in play on Hop 8 (149.6.8.142), and other than possibly being the way Hop 8 is aware to advertise the route to other hops is not very relevant, but it always applies automatically to any given routing instance.

Method B: Just as with a Desktop (technically computers are considered Routers) the router usually has a gateway of last resort configured usually to another router within a single owner's (ISP's/Company's) Network which is more aware of other routes to undertake.

-- This is unlikely, as it is used truly as the last resort, but without knowing the specifics of the routers at the moment in question it's impossible to know if this is a case of using the last resort.

Method C: Just as with your desktop, you can manually define static routes, or complex routing policies and route maps by hand, which will tel the router where to forward packets for any given destination.

Today this is only seen in small networks or devices which only serve simple purposes, and are also most likely to have a gateway of last resort as well. Again, it might be in play here but it's impossible to say for certain.

Method D: Modern routing protocols update the route tables of the routers by sharing advertisements wit their neighbors through several methods.

While these methods are basically an automation of Method C they introduce advanced methods for determining the best route for the next hop for a given packet to it's destination.

Essentially they all entail the routers speaking to their direct neighbors to tell them about the routes to other networks that they know about, which may have been obtained by any of the methods listed.

Depending on the protocol and it';s configuration there are several ways the routes may be shared and decisions made, which would require delving into the individual routing protocols in more depth.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.