注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

amei@纯真年代

感恩的心,知足者常乐!

 
 
 

日志

 
 

BGP选路原则的中英文对照版  

2007-08-26 13:43:46|  分类: 工作小记 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

BGP有很多的属性,如何根据这些属性来进行选路,这个顺序很重要。但是除了记住他们的选择顺序,还有很多其他需要关注的,比如:哪些是私有的,哪些有公有的,哪些一定会被考虑,哪些会被命令屏蔽,哪些是越大越优先,哪些是越小越优先,等等。

我一直觉得各种材料上写的都不是很全,比如华为的材料写的就比较简略,而不会有思科私有的weight的介绍。思科材料讲的还可以,不过都是英文的,如果只是在描述,而没有用很清楚的排版进行说明了话,很容易看晕了。

在网上找到一份很清楚的关于如何利用BGP属性进行选路的英文讲解,个人觉得这份英文版本讲的比较细致,也比较清楚。另外,我把他再做一下中文翻译和小结,贴出来共享吧。欢迎批评指正:

【英文版】

The following list of rules determines the best path:

1.Prefer the path with the largest WEIGHT. WEIGHT is a Cisco proprietary parameter, local to the router on which it is configured.

2.Prefer the path with the largest local preference (LOCAL_PREF).

3.Prefer the path that was locally originated through a network or aggregate BGP subcommand, or through redistribution from an IGP. Local paths sourced by network/redistribute commands are preferred over local aggregates sourced by the aggregate-address command.

4.Prefer the path with the shortest AS_PATH. The AS_PATH is a listing of the autonomous systems through which this particular update traveled to reach the local autonomous system. The fewer autonomous systems it crossed, the more preferred the route is. Note the following:

a.- This step is skipped if you configure bgp bestpath as-path ignore.

b.- An AS_SET counts as 1, no matter how many autonomous systems are in the set.

c.- The AS_CONFED_SEQUENCE is not included in the AS_PATH length.

5.Prefer the path with the lowest origin type: IGP is lower than EGP, and EGP is lower than INCOMPLETE.

6.Prefer the path with the lowest multi-exit discriminator (MED). Note the following:

a.- This comparison is done only if the first (neighboring) AS is the same in the two paths; any Confederation Sub-autonomous systems are ignored. In other words, MEDs are compared only if the first AS in the AS_SEQUENCE is the same for multiple paths. Any preceding AS_CONFED_SEQUENCE is ignored.

b.- If bgp always-compare-med is enabled, MEDs are compared for all paths. This option needs to be enabled over the entire AS, otherwise, routing loops can occur.

c.- If bgp bestpath med-confed is enabled, MEDs are compared for all paths that consist only of AS_CONFED_SEQUENCE (paths originated within the local confederation).

d.- Paths received from a neighbor with a MED of 4,294,967,295 will have the MED changed to 4,294,967,294 before insertion into the BGP table.

e.- Paths received with no MED are assigned a MED of 0, unless bgp bestpath missing-as-worst is enabled; in that case, they are assigned a MED of 4,294,967,294.

f.- The bgp deterministic med command also can influence this step.

7.Prefer external (eBGP) over internal (iBGP) paths. Paths containing AS_CONFED_SEQUENCE are local to the confederation and, therefore, are treated as internal paths. There is no distinction between Confederation External and Confederation Internal.

8.Prefer the path with the lowest IGP metric to the BGP next hop.

9.If the maximum-paths n command is enabled and there are multiple external or confederation external paths from the same neighboring AS or Sub-AS, BGP inserts up to n most recently received paths in the IP routing table. This allows eBGP multi-path load sharing. The maximum value of n is currently 6. The default value, when this option is disabled, is 1. The oldest received path is marked as the best path in the output of show ip bgp longer-prefixes, and the equivalent of next-hop-self is performed before forwarding this best path to internal peers.

10.If both paths are external, prefer the path that was received first (the oldest one). This step minimizes route flapping because a newer path won't displace an older one, even if it was the preferred route based on the RID. It is better practice to apply the additional decision steps in 11, 12, and 13 to iBGP paths only, to ensure a consistent best path decision within the network and thereby avoid loops. This step is skipped if any of the following is true:

a.- The bgp best path compare-routerid command is enabled.

b.- The router ID is the same for multiple paths because the routes were received from the same router.

c.- No current best path exists. An example of losing the current best path occurs when the neighbor offering the path goes down.

11.Prefer the route coming from the BGP router with the lowest router ID. The router ID is the highest IP address on the router, with preference given to loopback addresses. It can also be set manually using the bgp router-id command. If a path contains RR attributes, the originator ID is substituted for the router ID in the path selection process.

12.If the originator or RID is the same for multiple paths, prefer the path with the minimum cluster ID length. This will be present only in a BGP Route-Reflector environment in which clients peer with RRs or clients in other clusters. In this scenario, the client must be aware of the RR-specific BGP attribute.

13.Prefer the path coming from the lowest neighbor address. This is the IP address used in the BGP neighbor configuration, and it corresponds to the remote peer used in the TCP connection with the local router.

【中文版】

1, Wightwight为思科私有,本地有效。越大越优先。

2, Local-pref越大越优先。

3, 本地产生的BGP路由优先于注入的路由只有两种途径是本地产生的network宣告aggregate聚合destribute的路由都是注入路由。

4, AS-pathAS-path越短越优先。在比较这项时有以下注意点:

(a)      如果配置了bgp bestpath as-path ignore,就不会再比较AS-path

(b)     无论as-set中的as list有多长,as-set的长度都记为1

(c)      计算在AS_path长度时不统计AS_confed_sequence的长度。

5, BGP路由的三种生成方式比较:IGP>EGP>imcomplted

6, MED值:比较这项时有以下注意点:

(a)      缺省情况下,只有当多条pathAS_sequence中的第一个AS号相同时,才会进行这项比较。As-set和联盟中的AS_confed中如果有相同的AS都不会被比较。

(b)     如果路由器上配置了 bgp alwayscomparemed ,在全部的路径进行MED比较。但是这需要全体AS 都同时启用这个功能,否则有可能发生路由环路。

(c)      如果路由器上配置了bgp bestpath med confed ,将对所有只包括AS_confed_sequence的路径进行MED比较(即路径是起源于本地联盟)。

(d) 如果接收到的路径没有分配MED值,则将此路径分配为0,如果路由器配置了bestpath missing—is—worst,将被看作MED值为4,294,967,295的路由将在注入到BGP路由选择表之前被改为4,294,967,294。

(e) BGP明确的MED值9也可以影响此步骤。

7, eBGP邻居学来的path优于iBGP邻居学来的pathAS_confed_sequence对联盟只在本地有效,都被看作是内部路径。

8, 比较到达BGPIGP metric。越小越优先。

 

  评论这张
 
阅读(191)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017