Update 报文用于在 BGP Peer 间的传递路由信息,其用于发布路由、撤销路由;
报文格式
单个 Update 报文:
1)可以通告具有相同路径属性的多条路由,这些路由保存在 NLRI(Network Layer Reachable Information,网络层可达信息)中;
2)同时 Update 还可以携带多条不可达路由,用于告知对方撤销路由,这些保存在 Withdrawn Routes 字段中;
报文格式如图所示,主要字段解释如下:
Withdrawn Routes Length(Unfeasible routes length):标明 Withdrawn Routes 部分的长度,以 Byte 为单位。其值为零时,表示没有撤销的路由;
Withdrawn routes:不可达路由的列表;
Total path attribute length:路径属性字段的长度,以 Byte 为单位。如果为 0,则表示无 Path Attributes 字段;
Path attributes:与 NLRI 相关的所有路径属性列表,每个路径属性由一个 TLV(Type-Length-Value)三元组构成;
NLRI:其为二元组(可达路由前缀、前缀长度)。简而言之,该字段保存的是被通告的网段。
报文示例
更新路由的报文
Frame 28: 109 bytes on wire (872 bits), 109 bytes captured (872 bits) on interface -, id 0 Ethernet II, Src: HuaweiTe_2e:4a:35 (00:e0:fc:2e:4a:35), Dst: HuaweiTe_0b:50:b5 (00:e0:fc:0b:50:b5) Internet Protocol Version 4, Src: 10.1.12.1, Dst: 10.1.12.2 Transmission Control Protocol, Src Port: 50115, Dst Port: 179, Seq: 65, Ack: 65, Len: 55 Border Gateway Protocol - UPDATE Message Marker: ffffffffffffffffffffffffffffffff Length: 55 Type: UPDATE Message (2) Withdrawn Routes Length: 0 Total Path Attribute Length: 27 Path attributes Path Attribute - ORIGIN: IGP Path Attribute - AS_PATH: 200 Path Attribute - NEXT_HOP: 10.1.12.1 Path Attribute - MULTI_EXIT_DISC: 0 Network Layer Reachability Information (NLRI) 10.1.1.1/32
带有撤销路由的报文
Frame 22: 86 bytes on wire (688 bits), 86 bytes captured (688 bits) on interface -, id 0 Ethernet II, Src: HuaweiTe_2e:4a:35 (00:e0:fc:2e:4a:35), Dst: HuaweiTe_0b:50:b5 (00:e0:fc:0b:50:b5) Internet Protocol Version 4, Src: 10.1.12.1, Dst: 10.1.12.2 Transmission Control Protocol, Src Port: 179, Dst Port: 50969, Seq: 250, Ack: 65, Len: 32 Border Gateway Protocol - UPDATE Message Marker: ffffffffffffffffffffffffffffffff Length: 32 Type: UPDATE Message (2) Withdrawn Routes Length: 9 Withdrawn Routes 10.1.12.0/24 Withdrawn route prefix length: 24 Withdrawn prefix: 10.1.12.0 100.100.100.100/32 Withdrawn route prefix length: 32 Withdrawn prefix: 100.100.100.100 Total Path Attribute Length: 0
BGP-4 Update
BGP-4 中 IPv4 地址族特有的三个信息是 NEXT_HOP 属性、AGGREGATOR、IPv4 NLRI;
R1 向 R2 通告 BGP-4 Update 报文。通告网段为 10.0.0.0/8,下一跳地址为 1.1.1.1;
BGP Update 报文中在 NLRI 中携带 IPv4 网段信息,在 Path attributes 的 NEXT_HOP 中携带下一跳地址;
MP-BGP VPNv4
MP-BGP 为了支持新的地址族并兼容 IPv4,IETF 规定 MP-BGP 增加 MP_REACH_NLRI 和 MP_UNREACH_NLRI 两种新的路径属性,分别用于表示可达的目的信息和不可达的目的信息;
MP-BGP Update 报文结构与 BGP 相比略有区别。如图 R3 向 R2 通告 VPNv4 路由信息如下。其 RD 值和 IPv4 路由信息被存放于新的 NLRI 字段中,RT 值则被存放于路径属性的团体属性中;
参考文献
报文示例
IPv4 Labeled Unicast
Frame 12: 123 bytes on wire (984 bits), 123 bytes captured (984 bits) on interface -, id 0 Ethernet II, Src: 38:39:cc:01:01:01 (38:39:cc:01:01:01), Dst: 38:39:cc:02:01:00 (38:39:cc:02:01:00) MultiProtocol Label Switching Header, Label: 16003, Exp: 6, S: 1, TTL: 255 Internet Protocol Version 4, Src: 1.1.1.1, Dst: 3.3.3.3 Transmission Control Protocol, Src Port: 179, Dst Port: 64776, Seq: 1, Ack: 20, Len: 65 Border Gateway Protocol - UPDATE Message Marker: ffffffffffffffffffffffffffffffff Length: 65 Type: UPDATE Message (2) Withdrawn Routes Length: 0 Total Path Attribute Length: 42 Path attributes Path Attribute - ORIGIN: IGP Flags: 0x40, Transitive, Well-known, Complete 0... .... = Optional: Not set .1.. .... = Transitive: Set ..0. .... = Partial: Not set ...0 .... = Extended-Length: Not set .... 0000 = Unused: 0x0 Type Code: ORIGIN (1) Length: 1 Origin: IGP (0) Path Attribute - AS_PATH: empty Flags: 0x40, Transitive, Well-known, Complete 0... .... = Optional: Not set .1.. .... = Transitive: Set ..0. .... = Partial: Not set ...0 .... = Extended-Length: Not set .... 0000 = Unused: 0x0 Type Code: AS_PATH (2) Length: 0 Path Attribute - MULTI_EXIT_DISC: 0 Flags: 0x80, Optional, Non-transitive, Complete 1... .... = Optional: Set .0.. .... = Transitive: Not set ..0. .... = Partial: Not set ...0 .... = Extended-Length: Not set .... 0000 = Unused: 0x0 Type Code: MULTI_EXIT_DISC (4) Length: 4 Multiple exit discriminator: 0 Path Attribute - LOCAL_PREF: 100 Flags: 0x40, Transitive, Well-known, Complete 0... .... = Optional: Not set .1.. .... = Transitive: Set ..0. .... = Partial: Not set ...0 .... = Extended-Length: Not set .... 0000 = Unused: 0x0 Type Code: LOCAL_PREF (5) Length: 4 Local preference: 100 Path Attribute - MP_REACH_NLRI Flags: 0x90, Optional, Extended-Length, Non-transitive, Complete 1... .... = Optional: Set .0.. .... = Transitive: Not set ..0. .... = Partial: Not set ...1 .... = Extended-Length: Set .... 0000 = Unused: 0x0 Type Code: MP_REACH_NLRI (14) Length: 17 Address family identifier (AFI): IPv4 (1) Subsequent address family identifier (SAFI): Labeled Unicast (4) Next hop: 1.1.1.1 IPv4 Address: 1.1.1.1 Number of Subnetwork points of attachment (SNPA): 0 Network Layer Reachability Information (NLRI) Label Stack=48120 (bottom) IPv4=1.1.1.1/32 MP Reach NLRI Prefix length: 56 MP Reach NLRI Label Stack: 48120 (bottom) MP Reach NLRI IPv4 prefix: 1.1.1.1