BGP Attributes and Path Selection

Hello Manami

Address Family Indicator (AFI) and Subsequent Address Family Indicator (SAFI) are fields within Multi-Protocol BGP (MP-BGP) extensions. The information in these fields is sent as part of the neighbor capability exchange during the process of becoming BGP peers. The information in these fields is used to tell the remote peer what address family (IPv4, IPv6, VPNv4, VPNv6 etc.) and what specific sub-address family (multicast or unicast) the local BGP router will be transporting routes for.

I hope this has been helpful!

Laz

Hello, everyone.

With eBGP peerings, is the “Prefer the oldest route/Route that was learned earlier” considered the final one? Since this seems like the final tiebreaker that will always pick one path over another without moving to the rest (lowest RID/neighbor iP).

So does this mean that the lowest RID/neighbor IP tiebreakers are limited to iBGP peerings only?

Kind regards,
David

Hello David

The “Oldest Path” attribute written out in full is the one that says: “When both paths are external, prefer the path that was received first (the oldest one).”

So this attribute is only valid for routes external to the local AS. Now your question comes down to this: Is it possible for this to be a tie? Well, this attribute is designed in such a way that it’s extremely unlikely to result in a tie. This is because it is based on the timing of when the route was received.

In a real-world scenario, it’s practically impossible for a router to receive two routes from two different peers at the exact same microsecond. Thus, this tiebreaker will almost always be able to determine a preference between routes, unless perhaps in the highly unlikely event of some form of synchronization or a bug.

So to answer your question, it is not impossible, but it is extremely unlikely that this tie breaker will be unable to resolve the issue. So in virtually all cases, for external paths, this will be the last attribute to be checked.

Well, the attributes are used to choose the best “path” not the best “peering”. So it doesn’t really matter what peerings the particular router has, but what is taken into account is if the path is external to the local AS. An iBGP router that has no eBGP peerings can still receive two paths to a particular external prefix, so the attribute is still examined. Does that make sense?

I hope this has been helpful!

Laz

2 Likes

Hello Laz!

Allow me to elaborate on this

So does this mean that the lowest RID/neighbor IP tiebreakers are limited to iBGP peerings only?

If the received route contains an external prefix but was advetised to us by an iBGP neighbor, doesn’t that automatically make it an iBGP route? So the “Prefer oldest path for eBGP” tiebreaker cannot be used there.

By the way, an excellent explanation about everything I’ve asked for, thank you :slight_smile:

David

Hello David

An eBGP route is defined as a route received directly from an eBGP neighbor (a neighbor in a different AS). When the route is first received via eBGP, it’s marked as an external route.

If that route is then propagated within the same AS using iBGP (from one router in the AS to another), it retains its characteristics as an eBGP-learned route, including its original AS Path and other attributes. However, the mechanism of its propagation within the AS is through iBGP. In other words, the “source” or “origin” of the route in terms of AS traversal is still eBGP because it is external, but the immediate source of propagation within the AS is an iBGP peer.

What does that mean for our attribute? When we refer to the “oldest path for eBGP routes” in the BGP decision-making process, we’re talking about routes that originated from an eBGP neighbor, regardless of whether they were subsequently propagated within the AS using iBGP.

So if a BGP router learns about a route to a network external to its local AS, regardless of whether it learns about that route via iBGP or eBGP, the particular attribute applies, simply because the path is to an external network.

Note that the text of the attribute is “when both paths are external”. It doesn’t stipulate how you learned those paths (iBGP or eBGP), but simply that the paths are external.

No, but it does mean that the lowest RID/neighbor IP tiebreakers are limited to multiple routes to internal paths.

I hope this has been helpful!

Laz

Hello everyone,
I’m getting confused over path selection, say my router gets 3 routes for identical destinations : ospf with default parameters; ebgp with default parameters; ibgp with local preference set to 200. How is the decision made and which route will be selected?

Thanks

Hello Betul

This is an excellent question, and its answer will help to clarify the process by which routes are installed in the routing table.

When a router learns about paths to particular destinations from multiple sources (OSPF, BGP, static routes etc), before the actual BGP path selection process is even considered, the first thing that happens is it chooses which source of the routing information to use. This is determined using the Administrative Distance (AD).

If BGP (either iBGP or eBGP) becomes the source of choice using the AD, only then will the BGP best path algorithm take place. For more information about this process, take a look at this NetworkLessons note about how the routing table is populated.

I hope this has been helpful!

Laz

Hello Team,

I want to test the No. 8 BGP attribute—the shortest IGP path to BGP next hop. Can you please share if you have any sample lab task ?

Hello Sathish

We don’t have a specific lab for this.However, I can share with you some guidelines that will be helpful to create such a lab.

To test this attribute, you can create a single AS with five routers like so:

  1. Configure an underlying IGP between the routers such as OSPF. Make sure all of the networks between routers have been advertised and that OSPF has converged.
  2. Create loopback 1 on both R4 and R5 that will act as the target network. Let’s use an address of 172.16.0.1/24 for that. There is no need to advertise this using the IGP.
  3. Create iBGP peerings between all routers. Make sure to assign a loopback0 interface on R4 and R5 to use as the source of BGP messages. Let’s assume addresses of 4.4.4.4/32 and 5.5.5.5/32 for those. You’ll see shortly why this is important.
  4. Create iBGP peerings between all routers and advertise the 172.16.0.0/24 network using BGP on both R4 and R5.

Now if all the defaults are kept, R1 should learn about the 172.16.0.0/24 network via iBGP, and will choose a best path based on the lowest next hop IP of the iBGP peer. R4 should be chosen because of the lower router ID.

Now at this point you can start manipulating the cost on some of the interfaces to change the metric that OSPF advertises for each path. This way you can cause attribute 8 of the BGP path selection algorithm to kick in and affect which path will be taken.

If you would like you can make a suggestion to include a lesson with such a topology to show how the IGP metric plays a role as a tie breaker in the BGP path selection algorithm. You can go to the member ideas page below and make your suggestion. You may find that others have had similar suggestions and you can add your voice to theirs.

I hope this has been helpful!

Laz