cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6791
Views
10
Helpful
20
Replies

why eBGP AD is 20 less than any dynamic routing protocols?

ashok_boin
Level 5
Level 5

Hi all,

Shall I know why eBGP AD is 20 which is less than any dynamic routing protocols?

As far as I know, one reason is suboptimal paths and not sure about any thing related with routing loops.

Regards...

-Ashok.


With best regards...
Ashok
20 Replies 20

Exactly. In fact, Huewai made the AD for iBGP/eBGP as 255 giving very last priority for BGP (both internal and external BGP).

Not sure what made Juniper and Huewai decide this AD for BGP.

Regards...

-Ashok.


With best regards...
Ashok

but if eBGP has a "lower" priority (less significant) then a IGP  it will lead for the sub-optimal routing for th external subnets, in some case the traffic will be routed over the local network before it goes out.

I would put it like this: the AD is rarely used in the BGP case.

In the first place the only routers that will use AD=20 in taking routing decisions will be the border routers (that have eBGP). They have two possible alternative sources for the prefix besides eBGP: iBGP and IGP. This two alternatives also have to have their source also in a eBGP either directly (BGP has a single table for both eBGP and iBGP) or thru redistribution. We need to have at least two border routers in order to have any comparison taking place.

Now let's go to the inside of the network where the routing decision is taking place.

Case A. iBGP is used

The inside router will receive BGP advertisments from both border routers. The best path decision is done inside BGP regardless of the AD. Without any attributes manipulation (mainly local preference) the closest border in terms of IGP metric will be preffered.

Case B. IGP is used

The inside router will usually choose the minimal cost to reach the border (OSPF E2 routes may be an exception).

The real challenge is when a border router learns either directly or through the local network of the same prefix and have to compare it with the external information. (btw: there are cases when you prefer to exit the AS through a different border router)

Case A. iBGP is used (no need to redistribute on the border router)

Keep in mind that BGP is a single process so that AD is irrelevant inside the best path selection. The AD is relevant only when installing the routes in the routing table but before that other factors influences the decision (external vs. internal source is one of the factors but definitely not the first in the BGP best path algorithm). This means also that AD=20 will never compare to AD=200. It's only with the IGP that the comparison takes place.

Case B. IGP is used (and redistribution from eBGP to IGP on the border routers)

The comparison takes place between the prefix learned from eBGP and the prefix learned from IGP.

In the Cisco view a prefix will be redistributed only if that prefix is used for routing (is already in the routing table installed by the "source" protocol in the redistribution). Let's consider that one prefix is learned from eBGP and installed in the routing table without having an IGP version to compete with. Through redistribution the prefix will go to IGP and finaly get to the other border router.

Now let's consider that eBGP AD is 255 (as someone said about Huawei routers). This means that on the second border router the eBGP prefix will lose the AD battle and moreover it will never get in IGP through redistribution. The outcome is that the first learned eBGP prefix will always be used irrespective of BGP attributes or IGP cost.

If the eBGP AD is 20 (lower than any IGP AD - besides EIGRP summary) both borders will use their eBGP learned prefixes to exist the network and consequently both prefixes will get in IGP and the internal router will have both exit options in the IGP topology to choose from.

As Giuseppe already stated before the Case B is rarely used in real life scenarios nowadays and maybe when eBGP is not used for Internet access but for e.g. interprovider AS VPNs or CsC.

Maybe the reason other vendors have a high AD for BGP is that they have a different logic for AD comparision and redistribution (if anyone knows the other vendor's logic it might be interesting to share it).

Regards,
Eduard

edigheorghiu wrote:


Case A. iBGP is used (no need to redistribute on the border router)

Keep in mind that BGP is a single process so that AD is irrelevant inside the best path selection. The AD is relevant only when installing the routes in the routing table but before that other factors influences the decision (external vs. internal source is one of the factors but definitely not the first in the BGP best path algorithm). This means also that AD=20 will never compare to AD=200. It's only with the IGP that the comparison takes place.


I'm not agree  with this statment - BGP path selection takes into account the origin of prefixes and choose the "external" source over the internal. Comparison between eBGP and iBGP AD's doesn't really takes plase, may be in a rare situations (which is normaly shouldn't take a place)

Konstantin, I believe we are saying the same thing:  I've put in in parantheses.

Konstantin Dunaev wrote:

edigheorghiu wrote:


Case A. iBGP is used (no need to redistribute on the border router)

Keep in mind that BGP is a single process so that AD is irrelevant inside the best path selection. The AD is relevant only when installing the routes in the routing table but before that other factors influences the decision (external vs. internal source is one of the factors but definitely not the first in the BGP best path algorithm). This means also that AD=20 will never compare to AD=200. It's only with the IGP that the comparison takes place.


I'm not agree  with this statment - BGP path selection takes into account the origin of prefixes and choose the "external" source over the internal. Comparison between eBGP and iBGP AD's doesn't really takes plase, may be in a rare situations (which is normaly shouldn't take a place)

oh, exactly, It seems that I've wrong understood you first time. Sorry.

Review Cisco Networking products for a $25 gift card