cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1167
Views
0
Helpful
5
Replies

BGP decision algorithm nitty-gritty (relationship of locally originated routes to weight attribute)

keiran_harris
Level 1
Level 1

Hello everyone, i have a question on this algorithm. Specifically the relationship between (cisco specific) WEIGHT which is right at the top of the path selection algorithm.... and routes that are ORIGINATED_LOCALLY (3rd one down, after weight and local_pref). 

Heres the relevant steps of the decision tree: 

   1/WEIGHT (highest wins)

   2/LOCAL_PREF (highest wins) 

   3/ORIGINATED LOCALLY (prefer locally originated over peer learnt) 

Whats confusing to me is that Jeff's book tells us that if a prefix is ORIGINATED_LOCALLY (ie entered into BGP on that same router - either by a network/aggregate-address statement, or from redistribution) then its WEIGHT will also be set to 32768 (as opposed to a BGP peer learnt route whose WEIGHT is set to 0). I understand this. 

My question is why??? Seems to me that if this is the case there is little purpose of having ORIGINATED_LOCALLY in the decision tree at all, as the logic will never get there on account of the the propagation of its value into (the higher up) WEIGHT decision. This also in turn means that ORIGINATED_LOCALLY has the power to override the attribute LOCAL_PREF.... so couldn't this whole logic be simplified to be: 

   1/WEIGHT or ORIGINATED LOCALLY

   2/LOCAL_PREF (highest wins) 

This very thing has confused another user on another post too, that user writes:  "I tried thinking of an example where "ORIGINATED LOCALLY" works but weight doesn't, but couldn't think of any."

looking forward to the thoughts of this community.

Thanks in advance, Keiran. 

PS> perhaps the attached diagram will help visualise this. 

5 Replies 5

shaikhkamran123
Level 1
Level 1

As per my understanding WEIGHT is Cisco Propritery attribute , and BGP is industry standard routing protocol , so how do other vendor router will decide? thats why  3/ORIGINATED LOCALLY (prefer locally originated over peer learnt)  is required ,

because all the other vendor routers do not have weight attribute ,

so they  select 1) Local Preference

2) Locally originated

 

thus , Locally originated attribute is required because we have hundreds or thousands of routers  running BGP which do not support weight attribute.

 

above is as per my understanding , please correct me if something wrong

Thanks  & regards

Kamran Shaikh

Thanks for your reply shaikhkamran123, i hadn't considered the multivendor environment (where cisco specific concept of 'weight' would be irrelevant to those routers), so yes their decision would start with: 

1) Local Preference

2) Locally originated

as opposed to cisco

   1/WEIGHT (highest wins)

   2/LOCAL_PREF (highest wins) 

   3/ORIGINATED LOCALLY (prefer locally originated over peer learnt) 

but it still doesn't really explain why cisco chose to alter their inbuilt weight based on if a route was locally originated. This alters the logic of the above decision algorithm: ie if its locally originated, it will set a high weight (32768), which will be preferred.... and heres the main thing *BEFORE* local_pref is even looked at.  So in other words decision criteria#3, gets merged into #1, skipping ahead of #2.  Am i going crazy here?? 

thanks in advance all... 

K. 

 

Sajid Ali
Level 1
Level 1

Hi keiran_harris

Weight is a Cisco Specific attribute that is applied to a route within a router.

Note:  WEIGHT is a Cisco-specific parameter. It is local to the router on which it is configured.

(http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html)

 It is not communicated to other routers, its means if router is taking decision upon weight it is purely local router decision and will never affect other routers decision process. While Origin is a Well-known Mandatory attirbute: that recognized and Included in all BGP Updates messages, so if router is selecting a path on Origin it may effect on neighbor router decision process.

Don't forget to rate helpful posts

Sajid Ali Pathan

 

Hello sajid, thanks, but yes i understand all this. Im talking about *within* a given router, basically whats the purpose of having the weight automatically set to 32768 on a locally originated route within that router. It will win anyway when it comes to that step #3 (prefer locally originated) in the decision process (assuming #2 local pref is the same of course).

keiran_harris
Level 1
Level 1
.
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: