其用于同子网主机互访场景下进行主机 MAC 地址通告,包含主机 MAC 信息和二层 VNI:
报文结构
报文示例(Wirkshark)
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: INCOMPLETE Path Attribute - AS_PATH: empty Path Attribute - LOCAL_PREF: 100 Path Attribute - EXTENDED_COMMUNITIES Flags: 0xc0, Optional, Transitive, Complete 1... .... = Optional: Set .1.. .... = Transitive: Set ..0. .... = Partial: Not set ...0 .... = Extended-Length: Not set .... 0000 = Unused: 0x0 Type Code: EXTENDED_COMMUNITIES (16) Length: 24 Carried extended communities: (3 communities) Route Target: 742:1 [Transitive 2-Octet AS-Specific] Type: Transitive 2-Octet AS-Specific (0x00) 0... .... = IANA Authority: Allocated on Standard Action, Early Allocation or Experimental Basis .0.. .... = Transitive across AS: Transitive Subtype (AS2): Route Target (0x02) 2-Octet AS: 742 4-Octet AN: 1 Encapsulation: VXLAN Encapsulation [Transitive Opaque] Type: Transitive Opaque (0x03) 0... .... = IANA Authority: Allocated on Standard Action, Early Allocation or Experimental Basis .0.. .... = Transitive across AS: Transitive Subtype (Opaque): Encapsulation (0x0c) Tunnel type: VXLAN Encapsulation (8) MAC Mobility: Sticky MAC [Transitive EVPN] Type: Transitive EVPN (0x06) 0... .... = IANA Authority: Allocated on Standard Action, Early Allocation or Experimental Basis .0.. .... = Transitive across AS: Transitive Subtype (EVPN): MAC Mobility (0x00) Flags: 0x01 .... ...1 = Sticky/Static MAC: Yes Sequence number: 0 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: 44 Address family identifier (AFI): Layer-2 VPN (25) Subsequent address family identifier (SAFI): EVPN (70) Next hop: 10.0.0.1 IPv4 Address: 10.0.0.1 Number of Subnetwork points of attachment (SNPA): 0 Network Layer Reachability Information (NLRI) EVPN NLRI: MAC Advertisement Route Route Type: MAC Advertisement Route (2) Length: 33 Route Distinguisher: 000002e600000001 (742:1) ESI: 00:00:00:00:00:00:00:00:00:00 ESI Type: ESI 9 bytes value (0) ESI Value: 00 00 00 00 00 00 00 00 00 ESI 9 bytes value: 00 00 00 00 00 00 00 00 00 Ethernet Tag ID: 0 MAC Address Length: 48 MAC Address: HuaweiTe_17:6c:c6 (70:7b:e8:17:6c:c6) IP Address Length: 0 IP Address: NOT INCLUDED [Expert Info (Note/Protocol): IP Address: NOT INCLUDED] [IP Address: NOT INCLUDED] [Severity level: Note] [Group: Protocol] VNI: 6731
MP_REACH_NLRI
我们重点关注在 NLRI 中的字段:
Route Distinguisher
Ethernet Segment Identifier
Ethernet Tag ID
MAC Address Length = Length of MAC-ADDR
MAC Address = MAC-ADDR
IP Address Length
IP Address
MPLS Label1 = LAYER-2-VNI
MPLS Label2
场景:同子网互访
所示如图,BGP EVPN 通过 TYPE-2-ROUTE 完成 MAC-ADDR 动态学习,以实现 VXLAN 同子网互访;
同子网主机 MAC-ADDR 通告:
PC1 产生数据流量并发往 SW1;
SW1 获知 PC1 的 MAC-ADDR,它在 MAC-ADDR-TAB 中创建一个表项,记录该 MAC-ADDR、BD-ID、入接口;
SW1 根据该表项生成 BGP EVPN ROUTE 并发送给 SW2 设备。该路由携带本端 EVPN-Inst 的 RT 值(Path-Attr.Ext-Cmty.RT)以及 TYPE-2-ROUTE( MAC-ROUTE)。在 MAC ROUTE 中,PC1 的 MAC-ADDR 存放在 MAC Address 字段中,LAYER-2-VNI 存放在 MPLS Label1 字段中;
SW2 收到 SW1 发来的 BGP EVPN ROUTE 后:
1)首先,检查其携带的 RT(类似 MPLS VPN 的 RT 的概念),如果与本端 EVPN 实例的入站 RT 相等,则接收该路由,否则丢弃;
2)在接收该路由后,SW2 获得 PC1 的 MAC-ADDR、BD-ID 和 SW1.VTEP-IP-ADDR(MP_REACH_NLRI.Next-hop-network-address 携带)的对应关系,并在本地的 MAC-ADDR-TAB 中生成对应表项,其出接口需根据下一跳进行迭代,最终迭代结果是指向 SW1 的 VXLAN 隧道;
补充说明
在 eNSP 中,我们进行同网段互通实验,我们并没有观察到该类型路由通告。但是,在跨网段互通实验中,我们观察到网关发送包含 Vbdif MAC-ADDR 的 TYPE-2-ROUTE 给同网段内的设备;