8.VXLAN_二层VXLAN 复习

几个问题

VTEP对BUM流量的处理过程?

  • (注意,有两个动作)
    1. 学习源MAC地址与接口的对应关系
    2. 根据头端复制列表进行复制

VTEP对已经知单播的处理过程?

  • 查MAC地址表,根据MAC地址表转发

VXLAN为什么用UDP而不用TCP呢?
用UDP的目的在于取它根据随机函数生成的源端口,从而做为负载均衡算法的输入,其目的在于进行负载均衡。虽然TCP本身也能实现此功能,但TCP的首部过大,会造成没必要的资源浪费。

何为OVS交换机?
VXLAN当中的接入交换机称为OVS,此交换机通常情况下是以软件的形式集成在虚拟化或超融合系统软件上的,并非实体。

静态VXLAN隧道是无状态的,什么是无状态?
即没有七层之上的探测,只有简单的三层探测,三层通则UP,不通则Down;

关键点-默写MAC地址表
VTEP的上的MAC地址表是非常关键的,要能默写下来,清楚地知道每一条记录都是通过什么报文学到的?是如何学到的?

[CE1-Tunnel1]dis l2vpn mac-address 
* - The output interface is issued to another VSI
MAC Address    State     VSI Name                        Link ID/Name   Aging   
50f8-b2a5-0606 Dynamic   vpna                            GE1/0/5        Aging   
50f8-bc0b-0706 Dynamic   vpna                            Tunnel1        Aging   
--- 2 mac address(es) found  ---****

为什么两个VTEP当中的主机通信 ,为什么另一个VTEP也有MAC地址表?
会根据头端复制列表会泛洪嘛

数据转发流程-ARP的请求

PC6执行PING程序构建报文

# PC6 ping PC7
ping 192.168.10.20

之后的动作:

  1. 构建ICMP首部
  2. IP首部
    1. 192.168.10.10
    2. 192.168.10.20
  3. 在进行二层封装时发现对方跟自己一个网段,本地查找对方的MAC地址缓存,如果有直接进行构建二层首部,如果没有,触发ARP广播。
# PC6 构建ARP报文
ARP-Request
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      0000-0000-0000(全0)
	source-ip            192.168.10.10 (PC6的IP地址)
	destination          192.168.10.20 (PC7的IP地址)
Ethernet
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      ffff-ffff-ffff(全f)

到达OVS交换机之后

# 到达OVS交换机之后,发出时
ARP-Request
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      0000-0000-0000(全0)
	source-ip            192.168.10.10 (PC6的IP地址)
	destination          192.168.10.20 (PC7的IP地址)
VLAN
	VLAN-ID              10
Ethernet
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      ffff-ffff-ffff(全f)

NOTE:注意别忘了交换机还要进行学习

到达VTEP1之后

# 到达VTEP之后,dot1q或svid把VLAN-TAG拆除
ARP-Request
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      0000-0000-0000(全0)
	source-ip            192.168.10.10 (PC6的IP地址)
	destination          192.168.10.20 (PC7的IP地址)
Ethernet
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      ffff-ffff-ffff(全f)

NOTE:注意别忘了交换机还要进行学习

到此发几份,由什么决定呢?
头端复制列表

<HUAWEI> **display vxlan vni**
VNI            BD-ID            State
---------------------------------------
10             vpna             up

<HUAWEI> **display vxlan vni 10 verbose**
    BD ID                  : vpna
    State                  : up
    NVE                    : 1610612739
    Source Address         : 1.1.1.1
    Source IPv6 Address    : -
    UDP Port               : 4789
    BUM Mode               : head-end
    Group Address          : -
    Peer List              : 3.3.3.3 4.4.4.4
    IPv6 Peer List         : -
# 第一份
ARP-Request
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      0000-0000-0000(全0)
	source-ip            192.168.10.10 (PC6的IP地址)
	destination          192.168.10.20 (PC7的IP地址)
Ethernet
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      ffff-ffff-ffff(全f)
VXLAN 
	VNI                  10
UDP 
	Source-port          RANDOM
	destination-port     4789
IP 
	source-ip            1.1.1.1
	destination-ip       3.3.3.3
Ethernet
	source-mac          50f8-1212-0106  (CE1 G1/0/1的MAC地址)
	destination-mac     50f8-5ffc-0305  (10.0.12.2,即AR2上的地址)
# 第二份
ARP-Request
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      0000-0000-0000(全0)
	source-ip            192.168.10.10 (PC6的IP地址)
	destination          192.168.10.20 (PC7的IP地址)
Ethernet
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      ffff-ffff-ffff(全f)
VXLAN 
	VNI                  10
UDP 
	Source-port          RANDOM
	destination-port     4789
IP 
	source-ip            1.1.1.1
	destination-ip       4.4.4.4 # 仅这里有变化
Ethernet
	source-mac          50f8-1212-0106  (CE1 G1/0/1的MAC地址)
	destination-mac     50f8-5ffc-0305  (10.0.12.2,即AR2上的地址)

R2

# 第一份
ARP-Request
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      0000-0000-0000(全0)
	source-ip            192.168.10.10 (PC6的IP地址)
	destination          192.168.10.20 (PC7的IP地址)
Ethernet
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      ffff-ffff-ffff(全f)
VXLAN 
	VNI                  10
UDP 
	Source-port          RANDOM
	destination-port     4789
IP 
	source-ip            1.1.1.1
	destination-ip       3.3.3.3
Ethernet
	source-mac          50f8-5ffc-0306(R2  g0/0/1)
	destination-mac     50f8-2d61-0206 (CE  10.0.23.3)

到达VTEP3之后

# 第一份报文到达VTEP3之后
ARP-Request
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      0000-0000-0000(全0)
	source-ip            192.168.10.10 (PC6的IP地址)
	destination          192.168.10.20 (PC7的IP地址)
Ethernet
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      ffff-ffff-ffff(全f)
VXLAN 
	VNI                  10
UDP 
	Source-port          RANDOM
	destination-port     4789
IP 
	source-ip            1.1.1.1
	destination-ip       3.3.3.3
Ethernet
	source-mac          50f8-5ffc-0306(R2  g0/0/1)
	destination-mac     50f8-2d61-0206 (CE  10.0.23.3)

依次拆掉Ethernet、IP层,通过UDP的端口将报文交给VXLAN进程,交给VXLAN进程的报文:

ARP-Request
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      0000-0000-0000(全0)
	source-ip            192.168.10.10 (PC6的IP地址)
	destination          192.168.10.20 (PC7的IP地址)
Ethernet
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      ffff-ffff-ffff(全f)
VXLAN 
	VNI                  10

VXLAN进程通过VNI最终确定交给BD或VSI,VNI使用完成之后就会拆掉了,此时的报文变成这样了:

ARP-Request
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      0000-0000-0000(全0)
	source-ip            192.168.10.10 (PC6的IP地址)
	destination          192.168.10.20 (PC7的IP地址)
Ethernet
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      ffff-ffff-ffff(全f)

而VSI又绑定着下游接口,通过下游接口配置(如果是dot1q的配置),会在报文当中再把VLAN TAG打上从VTEP发出,此时的报文如下所示:

ARP-Request
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      0000-0000-0000(全0)
	source-ip            192.168.10.10 (PC6的IP地址)
	destination          192.168.10.20 (PC7的IP地址)
VLAN
	VLAN-ID              10
Ethernet
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      ffff-ffff-ffff(全f)

到达LSW2

由于LSW2的上游接口的配置这样的,如下所示,所以会原封不动放行数据帧

int g1/0/5
	port link-type trunk
	port trunk permit 10 20

从下游接口发给PC7的时候,变成了这样:

# vlan又被拿掉了!
ARP-Request
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      0000-0000-0000(全0)
	source-ip            192.168.10.10 (PC6的IP地址)
	destination          192.168.10.20 (PC7的IP地址)
Ethernet
	source-mac           50f8-b2a5-0606 (PC6的MAC地址)
	destination-mac      ffff-ffff-ffff(全f)

数据转发流程-ARP的响应报文

PC7响应报文的构建

# PC6 构建ARP响应报文-单播
ARP-Request
	source-mac 50f8-bc0b-0706(PC7的MAC地址)
	destination-mac 50f8-b2a5-0606 (PC6的MAC地址)
	source-ip 192.168.10.20 (PCI7的P地址)
	destination 192.168.10.10 (PC6的IP地址)
Ethernet
	source-mac 50f8-bc0b-0706(PC7的MAC地址)
	destination-mac 50f8-b2a5-0606 (PC6的MAC地址)

LSW2发出

# PC6 构建ARP响应报文-单播
ARP-Request
	source-mac 50f8-bc0b-0706(PC7的MAC地址)
	destination-mac 50f8-b2a5-0606 (PC6的MAC地址)
	source-ip 192.168.10.20 (PC7的IP地址)
	destination 192.168.10.10 (PC6的IP地址)
vlan 10
Ethernet
	source-mac 50f8-bc0b-0706(PC7的MAC地址)
	destination-mac 50f8-b2a5-0606 (PC6的MAC地址)

VTEP3接收并发出

# 只此一份,此时查的不再是头端复制列表,而是MAC地址表
ARP-Request
	source-mac        50f8-bc0b-0706(PC7的MAC地址)
	destination-mac   50f8-b2a5-0606 (PC6的MAC地址)
	source-ip         192.168.10.20 (PC7的IP地址)
	destination       192.168.10.10 (PC6的IP地址)
Ethernet
	source-mac        50f8-bc0b-0706(PC7的MAC地址)
	destination-mac   50f8-b2a5-0606 (PC6的MAC地址)
VXLAN
	VNI               10
UDP
	source            RANDOM
	destination       4789
IP
	source-IP         3.3.3.3
	destination-ip    1.1.1.1
Ethernet
	source-mac        CE的出接口中
	destiantion-mac   AR2

VTEP1接收

# 拆掉VXLAN封装之后,交给vsi子接口
ARP-Request
	source-mac            50f8-bc0b-0706(PC7的MAC地址)
	destination-mac       50f8-b2a5-0606 (PC6的MAC地址)
	source-ip             192.168.10.20 (PC7的IP地址)
	destination           192.168.10.10 (PC6的IP地址)
Ethernet
	source-mac            50f8-bc0b-0706(PC7的MAC地址)
	destination-mac       50f8-b2a5-0606 (PC6的MAC地址)

NOTE:此时也会进行学习,形成另一条MAC地址表

# 子接口再加上VLAN配置之后发出
ARP-Request
	source-mac            50f8-bc0b-0706(PC7的MAC地址)
	destination-mac       50f8-b2a5-0606 (PC6的MAC地址)
	source-ip             192.168.10.20 (PC7的IP地址)
	destination           192.168.10.10 (PC6的IP地址)
VLAN
	TAG                   10
Ethernet
	source-mac            50f8-bc0b-0706(PC7的MAC地址)
	destination-mac       50f8-b2a5-0606 (PC6的MAC地址)

最终PC6收到

ARP
	source-mac          50f8-bc0b-0706(PC7的MAC地址)
	destination-mac     50f8-b2a5-0606 (PC6的MAC地址)
	source-ip           192.168.10.20 (PC7的IP地址)
	destination         192.168.10.10 (PC6的IP地址)
Ethernet
	source-mac          50f8-bc0b-0706(PC7的MAC地址)
	destination-mac     50f8-b2a5-0606 (PC6的MAC地址)

数据转发流程-ICMP请求

PC6可以开始构建ICMP报文了

ICMP
IP
	source-ip          192.168.10.10
	destiantion-ip     192.168.10.20
Ethernet
	source-mac         50f8-b2a5-0606
	destination-mac    50f8-bc0b-0706

LSW1接收并发出

ICMP
IP
	source-ip          192.168.10.10
	destiantion-ip     192.168.10.20
VLAN 
	TAG                10
Ethernet
	source-mac         50f8-b2a5-0606
	destination-mac    50f8-bc0b-0706

VTPE1接收并发出

ICMP
IP
	source-ip          192.168.10.10
	destiantion-ip     192.168.10.20
Ethernet
	source-mac         50f8-b2a5-0606
	destination-mac    50f8-bc0b-0706
VXLAN
	VNI                10
UDP
	source-port        RANDOM
	destination-port   4789
IP(查MAC地址表,而非头端复制列表)
	source-ip          1.1.1.1
	destination-ip     3.3.3.3
Ethernet V2
	source-mac          50f8-1212-0106  (CE1 G1/0/1的MAC地址)
	destination-mac     50f8-5ffc-0305  (10.0.12.2,即AR2上的地址)
posted @ 2020-12-13 12:11  张贺贺呀  阅读(1879)  评论(0)    收藏  举报