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 [] 2 * * * Request timed out. 3 * * * Request timed out. 4 6 ms 5 ms 5 ms 5 6 ms 6 ms 6 ms 6 7 ms 12 ms 10 ms 7 8 ms 8 ms 8 ms 8 8 ms 8 ms 8 ms 9 8 ms 8 ms 8 ms

Lets say I'm travelling from to 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, how does it know that there is a link between (5 on the table) and 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
    This might be an enjoyable read for you.
    – Eddie
    Oct 11, 2018 at 15:06
  • 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, 2018 at 9:46

3 Answers 3


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

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 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.

  • 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. Oct 11, 2018 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, 2018 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. Oct 11, 2018 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, 2018 at 9:13

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.


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 (, 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.

  • Comments are not for extended discussion; this conversation has been moved to chat.
    – Ron Maupin
    Dec 17, 2018 at 0:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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