Technical documentation
发布日期:2022-05-07 浏览次数:2857 来源:崔志鹏
HCIE Datacom学习大纲-MP-BGP报文详解-WOLFLAB
WOLFLAB沃尔夫IE培训讲师:崔志鹏 CCIE#64969 HCIE#15621提供编写,
联系WOLFLAB官网客服,获取HCIE Datacom学习资料
传统的BGP-4只能管理IPv4单播路由信息,对于使用其它网络层协议(如IPv6、组播等)的应用,在跨AS传播时就受到一定限制。BGP多协议扩展MP-BGP(MultiProtocol BGP)就是为了提供对多种网络层协议的支持,对BGP-4进行的扩展。目前的MP-BGP标准是RFC4760,使用扩展属性和地址族来实现对IPv6、组播和VPN相关内容的支持,BGP协议原有的报文机制和路由机制并没有改变。
MP-BGP对IPv6单播网络的支持特性称为BGP4+,对IPv4组播网络的支持特性称为MBGP(Multicast BGP)。MP-BGP为IPv6单播网络和IPv4组播网络建立独立的拓扑结构,并将路由信息储存在独立的路由表中,保持单播IPv4网络、单播IPv6网络和组播网络之间路由信息相互隔离,也就实现了用单独的路由策略维护各自网络的路由。
扩展属性
为实现对多种网络层协议的支持,因此MP-BGP引入了两个新的可选非过渡路径属性:
MP_REACH_NLRI:Multiprotocol Reachable NLRI,多协议可达NLRI。用于发布可达路由及下一跳信息。
MP_UNREACH_NLRI:Multiprotocol Unreachable NLRI,多协议不可达NLRI。用于撤销不可达路由。
地址族
MP-BGP采用地址族(Address Family)来区分不同的网络层协议,目前支持的地址族视图包括:
BGP-IPv4单播地址族视图
BGP-IPv4组播地址族视图
BGP-VPN实例IPv4地址族视图
BGP-VPNv4地址族视图
BGP-IPv6单播地址族视图
BGP-VPN实例IPv6地址族视图
1、扩展能力的协商:
Border Gateway Protocol - OPEN Message
Marker: ffffffffffffffffffffffffffffffff
Length: 45
Type: OPEN Message (1)
Version: 4
My AS: 123
Hold Time: 180
BGP Identifier: 1.1.1.1
Optional Parameters Length: 16
Optional Parameters
Optional Parameter: Capability
Parameter Type: Capability (2)
Parameter Length: 14
Capability: Multiprotocol extensions capability
Type: Multiprotocol extensions capability (1)
Length: 4
AFI: IPv4 (1)
Reserved: 00
SAFI: Labeled VPN Unicast (128)
Capability: Route refresh capability
Type: Route refresh capability (2)
Length: 0
Capability: Support for 4-octet AS number capability
Type: Support for 4-octet AS number capability (65)
Length: 4
AS Number: 123
2、路由的更新
@地址族信息( Address Family Information )域:由2字节的地址族标识AFI ( Address Family Identifier )和1字节的子地址族标识SAFI ( Subsequent Address Family Identifier )组成;
@下一跳长度( Length of Next Hop Network Address )域:1字节长度,表示下一跳地址的长度,通常情况下为16;
@下一跳地址( Network Address of Next Hop)域:长度由上一个字段决定, 一般情况下为全球单播地址;
@保留字段( Reserved )域:1字节,必须为0;
@网络层可达信息( Network Layer Reachability Infomation )域:表示含有匹配相同属性的路由信息,当此字段为0时,表示为缺省路由;
Border Gateway Protocol - UPDATE Message
Marker: ffffffffffffffffffffffffffffffff
Length: 112
Type: UPDATE Message (2)
Withdrawn Routes Length: 0
Total Path Attribute Length: 89
Path attributes
Path Attribute - ORIGIN: IGP
Path Attribute - AS_PATH: 600
Path Attribute - MULTI_EXIT_DISC: 0
Path Attribute - LOCAL_PREF: 100
Path Attribute - ORIGINATOR_ID: 3.3.3.3
Path Attribute - CLUSTER_LIST: 2.2.2.2
Path Attribute - EXTENDED_COMMUNITIES
Flags: 0xc0, Optional, Transitive, Complete
Type Code: EXTENDED_COMMUNITIES (16)
Length: 8
Carried extended communities: (1 community)
Route Target: 1:1 [Transitive 2-Octet AS-Specific]
Type: Transitive 2-Octet AS-Specific (0x00)
Subtype (AS2): Route Target (0x02)
2-Octet AS: 1
4-Octet AN: 1
Path Attribute - MP_REACH_NLRI
Flags: 0x90, Optional, Extended-Length, Non-transitive, Complete
Type Code: MP_REACH_NLRI (14)
Length: 33
Address family identifier (AFI): IPv4 (1)
Subsequent address family identifier (SAFI): Labeled VPN Unicast (128)
Next hop: RD=0:0 IPv4=3.3.3.3
Route Distinguisher: 0:0
IPv4 Address: 3.3.3.3
Number of Subnetwork points of attachment (SNPA): 0
Network Layer Reachability Information (NLRI)
BGP Prefix
Prefix Length: 120
Label Stack: 1026 (bottom)
Route Distinguisher: 3:3
MP Reach NLRI IPv4 prefix: 6.6.6.6
注意:BGP和MP-BGP的update有所不同
@BGP的路由信息单独有个NLRI字段去携带,MP-BGP是通过新增的可选非过渡路径属性MP_REACH_NLRI携带的;
@BGP的下一跳属性放在路径属性里面,MP-BGP下一跳还是放在MP_REACH_NLRI里面;
@BGP的NLRI信息携带前缀和掩码,MP-BGP携带RD、私网标签,前缀、前缀长度;
注意:前缀长度,120表示mask=32 88表示mask=0 96表示mask=8 104表示mask=16 112表示mask=24;
怎么算的?
用前缀的长度120-(私网标签3byte+RD8byte)加起来的长度=32
3、路由的撤销
地址族信息( Address Family Information )域:由2字节的地址族标识AFI ( Address Family Identifier )和1字节的子地址族标识SAFI ( Subsequent Address Family Identifier )组成。
撤销路由( Withdrawn Routes )域:表示撤销的路由条目。格式为<掩码长度,路由前缀>,当此掩码长度为0时,表示为缺省路由。
Border Gateway Protocol - UPDATE Message
Marker: ffffffffffffffffffffffffffffffff
Length: 46
Type: UPDATE Message (2)
Withdrawn Routes Length: 0 //撤销路由的长度为0,MP-BGP撤销路由不看这个,就看是否有MP_UNREACH_NLRI这个属性,BGP才看。
Total Path Attribute Length: 23
Path attributes
Path Attribute - MP_UNREACH_NLRI
Flags: 0x90, Optional, Extended-Length, Non-transitive, Complete
Type Code: MP_UNREACH_NLRI (15)
Length: 19
Address family identifier (AFI): IPv4 (1)
Subsequent address family identifier (SAFI): Labeled VPN Unicast (128)
Withdrawn Routes
BGP Prefix
Prefix Length: 120
Label Stack: 0 (bottom)
Route Distinguisher: 3:3
MP Unreach NLRI IPv4 prefix: 6.6.6.6
HCIE Datacom学习资料联系网站客服获取