Professional Documents
Culture Documents
二、EVPN二层相关测试及分析
二、EVPN二层相关测试及分析
2018/5/20 下午11:48
MAC地址通过bgp消息同步过程:
mac表项有两层,一层是L2vpn中的mac地址表,这个地址表示最终指导转发的,通过该表项下发到硬件上。
设备学习到下面vm的mac地址后,会上送到上层的evpn协议,形成evpn的mac表项,通过bgp协议传给RR设备上,RR设备再转给其他的leaf。
所以设备上mac地址维护有两张表,如下:
[Leaf-1]dis l2vpn mac-address
MAC Address State VSI Name Link ID/Name Aging
3822-d6e4-9b14 Dynamic vpn10 0 Aging
487a-da33-a3d6 EVPN vpn10 Tunnel0 NotAging
--- 2 mac address(es) found ---
[Leaf-1]dis evpn route mac
Flags: D - Dynamic Type B - BGP Type L - Local active
VSI name: vpn10
MAC address Link ID/Name Flags Next hop
487a-da33-a3d6 Tunnel0 B 3.3.3.3
3822-d6e4-9b14 0 DL -
1、VM1上线,leaf-1收到vm1的报文,vlan10,对应vsi10映射到vxlan 10,之后会发布2类的bgp消息给RR,通知vm的mac地址给其他的leaf设备。
[Leaf-1]*Jan 4 04:56:50:910 2011 Leaf-1 BGP/7/DEBUG:
BGP_EVPN.: Send UPDATE to update-group 0 for following destinations:
Origin : IGP
AS path :
Next hop : 0.0.0.0 自己产生的。
Local pref : 100
MED :0
Ext-Community: <RT: 100:10>, <Encapsulation Type: VXLAN>
RouteType : MAC/IP advertisement route 2类消息,通知mac/arp信息
RD : 1:10
ESI : 00:00:00:00:00:00:00:00:00:00
EthernetTagID: 10 tag信息10
MAC address : 3822-d6e4-9b14 主机mac地址
MPLS label1 : 10 VNI信息 10
*Jan 4 04:56:50:910 2011 Leaf-1 BGP/7/DEBUG:
BGP.: Send UPDATE MSG to peer 1.1.1.1(L2VPN-EVPN) NextHop: 2.2.2.2.
2、对方主机上线后远方的leaf学习到mac地址后, 通过bgp消息发给自己:
[Leaf-1]*Jan 4 04:57:27:047 2011 Leaf-1 BGP/7/DEBUG:
BGP.: 1.1.1.1 Recv KEEPALIVE
Length: 19
*Jan 4 04:57:27:048 2011 Leaf-1 BGP/7/DEBUG:
BGP_EVPN.: Recv UPDATE from peer 1.1.1.1 with following destinations:
Update message length : 125
Origin : IGP
AS path :
Next hop : 3.3.3.3
Local pref : 100
MED :0
Ext-Community: <RT: 100:10>, <Encapsulation Type: VXLAN>
Originator : 3.3.3.3
Cluster list : 192.168.10.211
AFI/SAFI : 25/70 (L2VPN EVPN)
RouteType : MAC/IP advertisement route
RD : 1:10
ESI : 00:00:00:00:00:00:00:00:00:00
EthernetTagID: 10
MAC address : 487a-da33-a3d6
MPLS label1 : 10
3、当主机下线后,leaf会更新mac表项,同时会通过bgp报文发给rr通知该mac已经下线,通知别的leaf设备删除该mac地址,此时使用的是新增的第二个属性,
MP_UNREACH_NLRI。
MP_UNREACH_NLRI:Multiprotocol Unreachable NLRI,多协议不可达NLRI。用于撤销不可达路由。
*Jan 4 06:10:04:910 2011 Leaf-1 BGP/7/DEBUG:
BGP_EVPN.: Send UPDATE(Withdraw) to update-group 0 for destinations:
RouteType : MAC/IP advertisement route
RD : 1:10
EthernetTagID: 10
MAC address : 3822-d6e4-9b14
*Jan 4 06:10:04:914 2011 Leaf-1 BGP/7/DEBUG:
BGP_EVPN.: Recv UPDATE(Withdraw) from peer 1.1.1.1 for destinations:
AFI/SAFI : 25/70 (L2VPN EVPN)
RouteType : MAC/IP advertisement route
RD : 1:10
EthernetTagID: 10
MAC address : 3822-d6e4-9b14
ARP的泛洪抑制(arp代答):
如上是leaf设备同步学习mac地址的过程,但是此过程仅仅为mac地址的学习过程,目前的配置下,vm之间的互通还是通过两个虚机之间的arp交互来通信。因为在leaf设备上
没有开启arp的泛洪抑制功能。
leaf上存在两个虚机的mac地址,但是两个vm之间还不知道对方的arp信息,此时会发arp来确认对方位置,虚机发出的arp广播报文在leaf上进行vxlan封装,变为外层为单播的
报文发给远端的leaf设备,远端设备收到后解封装,再泛红自己的AC口。
arp报文内层是广播报文,但是经过vtep封装后,发给所有的远端vtep,是单播的报文,所以arp在隧道上传递都是单播进行的。
ARP泛洪抑制的处理过程如下:(设备收到arp后就建议代答表项,有远端和本端之分)
(1) 虚拟机VM 1发送ARP请求,获取VM 7的MAC地址。
(2) VTEP 1根据接收到的ARP请求,建立VM 1的ARP泛洪抑制表项,并在VXLAN内泛洪该ARP请求(图1-12以单播路由泛洪方式为例)。
(3) 远端VTEP(VTEP 2和VTEP 3)解封装VXLAN报文,获取原始的ARP请求报文后,建立VM 1的ARP泛洪抑制表项,并在本地站点的指定VXLAN内泛洪该ARP请求。
(4) VM 7接收到ARP请求后,回复ARP应答报文。
(5) VTEP 2接收到ARP应答后,建立VM 7的ARP泛洪抑制表项,并通过VXLAN隧道将ARP应答发送给VTEP 1。
(6) VTEP 1解封装VXLAN报文,获取原始的ARP应答,并根据该应答建立VM 7的ARP泛洪抑制表项,之后将ARP应答报文发送给VM 1。
(7) 在VTEP 1上建立ARP泛洪抑制表项后,虚拟机VM 4发送ARP请求,获取VM 1或VM 7的MAC地址。
(8) VTEP 1接收到ARP请求后,建立VM 4的ARP泛洪抑制表项,并查找本地ARP泛洪抑制表项,根据已有的表项回复ARP应答报文,不会对ARP请求进行泛洪。
(9) 在VTEP 3上建立ARP泛洪抑制表项后,虚拟机VM 10发送ARP请求,获取VM 1的MAC地址。
(10) VTEP 3接收到ARP请求后,建立VM 10的ARP泛洪抑制表项,并查找本地ARP泛洪抑制表项,根据已有的表项回复ARP应答报文,不会对ARP请求进行泛洪。
5、开启arp的泛洪抑制之后,leaf设备上存在vm2的mac地址,这时设备自己构建一个arp的回应报文,和vm2的回应报文一摸一样。
vsi vpn10
arp suppression enable
vxlan 10
evpn encapsulation vxlan
route-distinguisher auto
vpn-target auto export-extcommunity
vpn-target auto import-extcommunity
<Leaf-1>*Jan 4 06:34:45:474 2011 Leaf-1 ARP/7/ARP_VSISUP: ARP VSI suppression: Received an ARP packet from VsiIndex 0, LinkID 0.
*Jan 4 06:34:45:474 2011 Leaf-1 ARP/7/ARP_VSISUP:
ARP VSI suppression: Received an ARP packet from VsiIndex 0, LinkID 0:
SenderMAC : 3822-d6e4-9b14 SenderIP : 10.1.1.1
TargetMAC : 0000-0000-0000 TargetIP : 10.1.1.2
SrcMAC : 3822-d6e4-9b14 DstMAC : ffff-ffff-ffff
PacketType : REQUEST
*Jan 4 06:34:45:474 2011 Leaf-1 ARP/7/ARP_VSISUP: ARP VSI fast-reply: Received an ARP packet from VsiIndex 0, LinkID 0.
*Jan 4 06:34:45:474 2011 Leaf-1 ARP/7/ARP_VSISUP:
ARP VSI fast-reply: Sent an ARP packet from VsiIndex 0, LinkID 0:
SenderMAC : 487a-da33-a3d6 SenderIP : 10.1.1.2
TargetMAC : 3822-d6e4-9b14 TargetIP : 10.1.1.1
SrcMAC : 487a-da33-a3d6 DstMAC : 3822-d6e4-9b14
PacketType : REPLY
<VM1>ping 10.1.1.2
PING 10.1.1.2: 56 data bytes, press CTRL_C to break
*Apr 30 07:30:46:169 2000 VM1 ARP/7/arp_send: Send an ARP Packet, operation : 1, sender_eth_addr : 3822-d6e4-9b14,sender_ip_addr : 10.1.1.1,
target_eth_addr : 0000-0000-0000, target_ip_addr : 10.1.1.2
*Apr 30 07:30:46:173 2000 VM1 ARP/7/arp_rcv: Receive an ARP Packet, operation : 2, sender_eth_addr : 487a-da33-a3d6, sender_ip_addr : 10.1.1.2,
target_eth_addr : 3822-d6e4-9b14, target_ip_addr : 10.1.1.1
Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=7 ms
Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=2 ms
Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=2 ms
--- 10.1.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/2/7 ms
二层转发时报文转发流程:
二层转发时,内层报文的源目ip地址和源目mac地址为vm的不变,外层封装vxlan头,外层ip地址为tunnel隧道的源目ip地址,再外层的mac地址为leaf-1的vlan12接口地址
mac,从该接口发出到spin设备上。回程的报文一样用vlan13的接口mac地址作为源,目的mac为vmmac地址。