Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

BGP question path selection steps

Hi

I'M currently studding my BSCI Certification Exam, currently I'm studdiyng on subject about BGP,

In best path selection in BGP, in find the text for the step four and seven in conflict. I explain myself :

"Step 4 selects the path that has the fewest autonomous systems to cross. This is the most common reason a path is selected in

BGP. If a network administrator does not like the path with the fewest autonomous systems, he or she needs to manipulate weight

or local preference to change which outbound path BGP chooses.

....

If multiple paths have the same number of autonomous systems to traverse, the second most common decision point is Step 7,

which states that an externally learned path from an EBGP neighbor is preferred over a path learned from an IBGP neighbor. A

router in an AS prefers to use the ISP's bandwidth to reach a network rather than using internal bandwidth to reach an IBGP

neighbor on the other side of its own AS."  copy paste from my cisco press document "Authorized Self-Study Guide..."

If step 4 make preferable a path with a fewest AS between local and final destination, how a path trought a external AS can be preferable than a path within the AS ? A path within the AS is a fewest path then any other path ? (if I'm refering only of the AS concept !) Also in the explanation of the step 7, is it not a defenition of AS loop, I'm in the AS 65000, going to AS 65001 to going back to AS 65000 at the final destination at the other end of the 65000 AS.

Thanks a lot for your explantion !

3 ACCEPTED SOLUTIONS

Accepted Solutions
Cisco Employee

Re: BGP question path selection steps

Hi,

First of all, have in mind that the step 7 is performed only if the steps 1-6 did not already decide which route is better. So if the router came to evaluate the step 7, it means that the step 4 was not helpful in determining the best route. There are obviously two or even more paths to the same destination network that have the same count of AS to traverse so neither of them is shorter or longer in means of AS path.

However, the step 7 tells you that if you can immediately hand off the traffic to another AS (which is expressed by the fact that the route has been advertised to you over an eBGP session) then do it! Do not let the transit traffic traverse your own AS to a distant iBGP neighbor, rather, let it go out as soon as possible.

I hope this helps a bit.

Best regards,

Peter

Hall of Fame Super Blue

Re: BGP question path selection steps

xine32@gmail.com

Hi

I'M currently studding my BSCI Certification Exam, currently I'm studdiyng on subject about BGP,

In best path selection in BGP, in find the text for the step four and seven in conflict. I explain myself :

"Step 4 selects the path that has the fewest autonomous systems to cross. This is the most common reason a path is selected in

BGP. If a network administrator does not like the path with the fewest autonomous systems, he or she needs to manipulate weight

or local preference to change which outbound path BGP chooses.

....

If multiple paths have the same number of autonomous systems to traverse, the second most common decision point is Step 7,

which states that an externally learned path from an EBGP neighbor is preferred over a path learned from an IBGP neighbor. A

router in an AS prefers to use the ISP's bandwidth to reach a network rather than using internal bandwidth to reach an IBGP

neighbor on the other side of its own AS."  copy paste from my cisco press document "Authorized Self-Study Guide..."

If step 4 make preferable a path with a fewest AS between local and final destination, how a path trought a external AS can be preferable than a path within the AS ? A path within the AS is a fewest path then any other path ? (if I'm refering only of the AS concept !) Also in the explanation of the step 7, is it not a defenition of AS loop, I'm in the AS 65000, going to AS 65001 to going back to AS 65000 at the final destination at the other end of the 65000 AS.

Thanks a lot for your explantion !

It's not in conflict because the 2 steps are never carried out at the same time and only one can be used to select a route at any one time.

What i mean by this is that you only get to step 7 if the step 4 is passed (+ the others obviously). So if 2 routes are considered in step 4 and one has an AS_PATH of 1 AS and the other 2 then the route with the 1 AS will be chosen. If bot routes have the same AS_PATH length then you move on.

Now if you get to Step 7 that means, among other things, that the AS_PATH is the same length so step 7 is not concerned with AS_PATH length, that has already been tested at step 4. All it's concerned with now is whether the route is EBGP or IBGP. And whether it's IBGP or EBGP it will actually have the same AS_PATH length.

As for a loop, well no it's not a definition of one. It only states an EBGP learned route is perferred over an IGBP route. You are not ending up back at your own AS, it is simply talking about routes received from EBGP peers. Bear in mind also that by default EBGP speaking routers always check for their own AS in the path and if they find it they reject the route advertisement (unless the allowas-in option is used under the bgp config).

Jon

Hall of Fame Super Silver

Re: BGP question path selection steps

Hello Christian,

an eBGP path and an iBGP path can have the same AS path length because local AS number is not added to the AS path attribute until the advertisement has to be sent out to an eBGP peer.

Consider two border routers R1 and R2 of AS 65000 having both an eBGP session to ISP1 and to ISP2 respectively.

on both eBGP sessions R1 and R2 receives an advertisement for a prefix.

on the iBGP session they can exchange prefixes

eBGP paths are preferred over iBGP paths because they are seen as first hand information: traffic destinated to a remote destination can be sent out to an eBGP peer that is likely directly connected instead of going through the inside of the AS 65000.

Hope to help

Giuseppe

6 REPLIES
Cisco Employee

Re: BGP question path selection steps

Hi,

First of all, have in mind that the step 7 is performed only if the steps 1-6 did not already decide which route is better. So if the router came to evaluate the step 7, it means that the step 4 was not helpful in determining the best route. There are obviously two or even more paths to the same destination network that have the same count of AS to traverse so neither of them is shorter or longer in means of AS path.

However, the step 7 tells you that if you can immediately hand off the traffic to another AS (which is expressed by the fact that the route has been advertised to you over an eBGP session) then do it! Do not let the transit traffic traverse your own AS to a distant iBGP neighbor, rather, let it go out as soon as possible.

I hope this helps a bit.

Best regards,

Peter

Community Member

Re: BGP question path selection steps

Hi Peter,

in the text of my book it was maybe missing a part of sentence for my understanding when she said :

"

f multiple paths have the same number of autonomous systems to traverse, the second most common decision point is Step 7,

which states that an externally learned path from an EBGP neighbor is preferred over a path learned from an IBGP neighbor. A

router in an AS prefers to use the ISP's bandwidth to reach a network rather than using internal bandwidth to reach an IBGP

neighbor on the other side of its own AS."  For enventually going in another AS at time point.....

Hall of Fame Super Blue

Re: BGP question path selection steps

xine32@gmail.com

Hi

I'M currently studding my BSCI Certification Exam, currently I'm studdiyng on subject about BGP,

In best path selection in BGP, in find the text for the step four and seven in conflict. I explain myself :

"Step 4 selects the path that has the fewest autonomous systems to cross. This is the most common reason a path is selected in

BGP. If a network administrator does not like the path with the fewest autonomous systems, he or she needs to manipulate weight

or local preference to change which outbound path BGP chooses.

....

If multiple paths have the same number of autonomous systems to traverse, the second most common decision point is Step 7,

which states that an externally learned path from an EBGP neighbor is preferred over a path learned from an IBGP neighbor. A

router in an AS prefers to use the ISP's bandwidth to reach a network rather than using internal bandwidth to reach an IBGP

neighbor on the other side of its own AS."  copy paste from my cisco press document "Authorized Self-Study Guide..."

If step 4 make preferable a path with a fewest AS between local and final destination, how a path trought a external AS can be preferable than a path within the AS ? A path within the AS is a fewest path then any other path ? (if I'm refering only of the AS concept !) Also in the explanation of the step 7, is it not a defenition of AS loop, I'm in the AS 65000, going to AS 65001 to going back to AS 65000 at the final destination at the other end of the 65000 AS.

Thanks a lot for your explantion !

It's not in conflict because the 2 steps are never carried out at the same time and only one can be used to select a route at any one time.

What i mean by this is that you only get to step 7 if the step 4 is passed (+ the others obviously). So if 2 routes are considered in step 4 and one has an AS_PATH of 1 AS and the other 2 then the route with the 1 AS will be chosen. If bot routes have the same AS_PATH length then you move on.

Now if you get to Step 7 that means, among other things, that the AS_PATH is the same length so step 7 is not concerned with AS_PATH length, that has already been tested at step 4. All it's concerned with now is whether the route is EBGP or IBGP. And whether it's IBGP or EBGP it will actually have the same AS_PATH length.

As for a loop, well no it's not a definition of one. It only states an EBGP learned route is perferred over an IGBP route. You are not ending up back at your own AS, it is simply talking about routes received from EBGP peers. Bear in mind also that by default EBGP speaking routers always check for their own AS in the path and if they find it they reject the route advertisement (unless the allowas-in option is used under the bgp config).

Jon

Community Member

Re: BGP question path selection steps

Hi Jon,

Excuse my English, but I do not understand what you mean in your last sentence :

"Bear in mind also that by default EBGP speaking routers always check for their own AS in the path and if they find it they reject the route advertisement (unless the allowas-in option is used under the bgp config)."

Hall of Fame Super Blue

Re: BGP question path selection steps

xine32@gmail.com

Hi Jon,

Excuse my English, but I do not understand what you mean in your last sentence :

"Bear in mind also that by default EBGP speaking routers always check for their own AS in the path and if they find it they reject the route advertisement (unless the allowas-in option is used under the bgp config)."

BGP uses the AS_PATH to avoid routing loops. So when an EBGP router receives a route advertisement from an EBGP peer it checks the AS_PATH. If it sees it's own AS number in the AS_PATH then it will reject the route because it means that the route has already been advertised out of that AS.

This is the default behaviour for BGP but you can override that behaviour by telling the router that it is okay to see an occurence of it's own AS in the AS_PATH with the "allowas-in " command. The specifies how many times it's own AS can be seen in the AS_PATH for any route it receives from an EBGP peer.

Jon

Hall of Fame Super Silver

Re: BGP question path selection steps

Hello Christian,

an eBGP path and an iBGP path can have the same AS path length because local AS number is not added to the AS path attribute until the advertisement has to be sent out to an eBGP peer.

Consider two border routers R1 and R2 of AS 65000 having both an eBGP session to ISP1 and to ISP2 respectively.

on both eBGP sessions R1 and R2 receives an advertisement for a prefix.

on the iBGP session they can exchange prefixes

eBGP paths are preferred over iBGP paths because they are seen as first hand information: traffic destinated to a remote destination can be sent out to an eBGP peer that is likely directly connected instead of going through the inside of the AS 65000.

Hope to help

Giuseppe

501
Views
5
Helpful
6
Replies
CreatePlease to create content