MPLS L3 VPNs - AD of the protocol versus BGP Path Selection

Hello, everyone.

I have a fairly complicated question that I haven’t found an answer to.

I have this topology here. The configuration part doesn’t matter, the customers are running EIGRP everywhere (even over the backdoor link). The PE routers perform redistribution into MP-BGP and carry those routes as VPNv4.

My question here is, I understand that EIGRP routes, for example, carry the extended cost community with a POI of 128. This makes the PE routers evaluate the EIGRP cost in the community before the whole BGP path selection process.

Thanks to that, it prevents a scenario like this from happening where P3-XR (or P4) would prefer the backdoor path instead to reach the remote prefix.

My question is, though, how does this provide loop prevention? Wouldn’t P3-XR (or P4) still accept the route just because EIGRP’s AD is much less than iBGP’s AD? A course I was following said that P3-XR would only prefer the route because it would redistribute it into BGP with a weight of 32768 which would make that route preferrable over the route sent by P4. Weight would simply always win, that’s why we use the extended cost community.

My question is, why isn’t the AD being compared here? Why doesn’t P3-XR still install the EIGRP route for 20.20.20.20/32? The AD is 90 < 200.

Why is the route from P4 (AD 200) being preferred over the route from P1 (AD 90)?

A blogpost from INE states

BGP updates that contain the cost community attribute will use the EIGRP AD instead of the iBGP AD of 200 to compare routes on metric alone.

So does the extended cost community make the PE routers consider the EIGRP AD for both routes instead?

Thank you
David

Hello David

Wow, thanks for the detailed setup and description, it’s invaluable to understanding how all of this works.

There are actually two separate comparisons taking place, and I think this is the key to what you’re seeing.

First, within BGP, P3 has two BGP paths for the prefix: one created by redistributing the EIGRP route learned through P1, and another learned through MP-BGP from P4. Normally, the locally redistributed path would have Weight 32768 and could therefore beat the remote path with Weight 0.

This is where the EIGRP Cost Community comes in. Cisco automatically attaches the prebestpath cost community when EIGRP routes are redistributed into BGP. Because its POI is prebestpath, BGP compares the original EIGRP metrics before Weight and the rest of the normal BGP best-path algorithm. In your case, the VPN path has the better EIGRP metric, so it becomes the BGP best path.

But that still leaves your AD question: why doesn’t the actual EIGRP route learned from P1, with AD 90, beat that iBGP route with AD 200 when the route reaches the RIB?

The answer is that IOS XR also uses the Cost Community during the RIB comparison.

At this point P3 really does have two different protocol candidates: the EIGRP route through P1 and the BGP/VPN route through P4. Normally, AD 90 would beat AD 200. However, because both routes contain the relevant Cost Community information, the RIB compares those costs before performing its normal route-selection steps.

Cisco describes this explicitly in step 8 of this section of Cisco’s documentation:

“Because both the route paths have cost community, RIB compares the costs first.”

If that comparison produces a winner, the RIB uses it. Only if the cost-community comparison ties does it continue with the remaining selection criteria.

So in your case:

VPN/MPLS path: 1392640
Backdoor path: 2048000

The VPN/MPLS path wins the Cost Community comparison. The normal EIGRP 90 versus iBGP 200 comparison therefore never becomes the deciding factor.

That’s why show route can legitimately display:
B 20.20.20.20/32 [200/10880] via 4.4.4.4

The route is still an iBGP route and therefore still displays AD 200. The Cost Community has not changed its AD to 90. Instead, it caused the RIB to choose that route before the AD could decide between the two candidates.

I hope this has been helpful!

Laz

Hello, Laz!

This was really well explained. I found that if you did the same thing with OSPF, OSPF could prefer the backdoor link because of the AD. The funny thing is, it’s a matter of time.

If OSPF learned the route first, it would redistribute it into BGP with a weight of 32768. This route would always be preferred not because of AD but because of weight, since it’s now a local BGP route!

If BGP learned the route first and then with OSPF, OSPF would replace it again but this time, because of AD. This is where sham links and such can come into play and help us in both scenarios.

Thank you so much! Too bad OSPF doesn’t also have a cost community like EIGRP does

David

1 Like