0

In BGP all routers choose the best route to a single destination. So for Router A and destination D, A will forward the packet to the next-hop router (let us say router R) after knowing the best route and what is the selected next hop. However, how will router A guarantees or know that router R will also follow the same path selected by router A and will forward the packet accordingly. Thank you.

  • 2
    I'm not sure I understand your question. Why do you think a path selected by Router A would have any impact on path selection on Router R? They both have their own route tables and therefore have their own path selections. – Jesse P. Oct 12 at 11:50
  • @JesseP. So router A will choose the best route to destination D according to routing updates by BGP so this might be for example be the shortest route and then it will forward the packet to the next hope but how will it guarantee that the best route it selected that is the shortest path is taken by the packet all the way? – kaki no Oct 12 at 12:00
  • Each packet is routed independently by each router along its path. The basis for IP packet switching is that the path may change due to outside circumstances (natural or man-made disasters, etc.), and the packets will find their way to the destination. Even packets in the same flow can take different paths. On the other hand, circuit switching will set up a circuit for the entire conversation, and if the circuit is interrupted for some reason, the conversation ends. Packet switching was developed to overcome this limitation. – Ron Maupin Oct 13 at 19:11
  • @RonMaupin So router A chooses the next hop based on different metrics that one of them may include the shortest path. Then the next hope which receives the packet will do the same right? It wil also choose the next best hope? and assuming discussions are made based on the shortest path only then the final path taken by the packet should be the shortest right? Assuming no other things happen that are out of our hands and can change the parth. – kaki no Oct 14 at 9:01
  • Each router maintains its own set of metrics or attributes (note that BGP doesn't use simple metrics the way that IGPs do, it has a full set of attributes that can be complex in order to determine the next hop). Someone configuring a router can set up filters, add or change metrics or attributes, etc. Each router determines the next interface out which it will send a packet, and other routers really do not know about that. – Ron Maupin Oct 14 at 17:56
5

It doesn’t. Each router makes an independent routing decision. There’s no guarantee that the entire path is valid or that it won’t change.

  • But router A chooses this path for example because is the shortest and then forwarded the packet. Shouldn't this also be taken into consideration by other routers? So A choose the shortest path and forwarded the packet accordingly will router R aslo take the same route? If not how is shortest path guaranteed? I know there is more than BGP but I am taking the big picture. – kaki no Oct 12 at 12:02
  • 1
    "A" makes its decisions based on what its peers present it. There are various methods for filtering and modifying path selection (local and remote.) – Ricky Beam Oct 12 at 19:59
  • 1
    A does not choose the best path. It chooses the best next hop. Each router makes that choice independently. – Ron Trunk Oct 13 at 8:26
  • @RonTrunk So router A chooses the next hop based on different metrics that one of them may include the shortest path. Then the next hope which receives the packet will do the same right? It wil also choose the next best hope? and assuming discussions are made based on the shortest path only then the final path taken by the packet should be the shortest right? Assuming no other things happen that are out of our hands and can change the parth. – kaki no Oct 14 at 8:49
  • Assuming all routers have the same information, you are correct. – Ron Trunk Oct 14 at 9:28
3

Each router only selects the next hop, not the entire path.

The next hop is selected by the best match (longest prefix) from the router's routing table entries and, for multiple matches, by the best metric/cost (mainly distance & bandwidth) towards the destination. If metrics are correct, each hop brings a packet closer to each destination until it is finally reached - routing is a collaborative effort.

BGP is one of many routing protocols that routers use to exchange their (knowledge of) routes.

  • yes but the routing table is filled according to the BGP updates which contains the list of ASs and the route is chosen based on this (let us say the shortest path). And the routing table is filled according to the BGP updates and decision process. So when A forwards a packet how will it guarantee that the path it chose as the best path is taken by the packet? If this is not guaranteed then why router A fills the routing table according to the best paths if it is not guaranteed why not filling it according to best next hop. know there is more than BGP but I am taking the big picture. Thanks. – kaki no Oct 12 at 12:06
  • and if the path is not guaranteed then how the best path is guaranteed (for example how it is guaranteed that the path taken by the packet is the shortest or what effort is made to make this possible without guaranteeing it). – kaki no Oct 12 at 12:46
  • 1
    "Because the router is programmed to do so" is probably the best answer here. It feels as if there's either some misunderstanding on your side on how routers and BGP work, or that there's a underlying question you're not clear about. You can consider improving your question by adding more details. – Teun Vink Oct 12 at 13:34
  • @kakino The router's decision doesn't guarantee to use the "best" next hop unless the routing table holds that information. Each forwarding decision is from the router's perspective. Routing along a path is a cumulative effort using a distributed algorithm. – Zac67 Oct 12 at 14:06
  • 1
    As others pointed out a number of times now: each router makes its own decisions, based on its own criteria. Thus, the final path does not have to be the shortest path, since every router in the path use other criteria and decide that a longer path is better. And also, there's not one point at which the entire path is considered, only next-hops are chosen. – Teun Vink Oct 14 at 9:30

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.