Opencontrail-Tungsten Fabric---VXLAN封装VM在同一网段通讯

通过 Orchestrator在Server上部署一个VM或者Docker:

1.首先给 VM/Docker POD分配IP地址,DNS 等等信息。在vRouter上创建 VRF/VSI, RT/RD等信息,上送回传到Contrail控制器。vRouter之间不需要协议通讯,vRouter仅仅跟Contrail 控制器进行控制平面的通信。

2.生成L3v*n/Ev*n转发表,控制器知道现存的多个vRouter可能要跟新创建的vRouter共享相同的VRF/VSI,并且需要互相通讯,就通过XMPP来下发转发表信息(BGP NLRI内嵌到XMPP消息里)到另一台服务器上vRouter。vRouter之间仅仅建立转发平面的动态隧道。这样Server之间的M/Dockers 就可以通讯了。

3.控制器通过BGP/Netconf来通知GW Router来自动发布VM/Docker的IP prefix。这样Openstack/vCenter创建的VM/Docker就可以被外界来使用了。

 

Opencontrail-Tungsten Fabric---VXLAN封装VM在同一网段通讯

 

http://www.opencontrail.org/a-journey-of-a-packet-within-opencontrail/

For the overlay, OpenContrail uses MPLS L3v*ns and MPLS Ev*ns in order to address both l3 overlay and l2 overlay.

For the control plane each controller acts as a BGP Route Reflector using the BGP and the XMPP protocols. BGP is used between the controllers and the physical routers. XMPP is used between the controllers and the vRouters. 

For the data plane, OpenContrail supports GRE/VXLAN/UDP for the tunneling. 

Opencontrail-Tungsten Fabric---VXLAN封装VM在同一网段通讯

 

packet journey:

Initiating a ping between vm1 and vm2

http://10.x.x.40:8085/agent.xml

根据vm1的网卡找到对应的ItfReq

docker exec -it kolla_toolbox bash

. /var/lib/kolla/config_files/admin-openrc.sh

VM1 port: 10a33065-aeb8-4003-a18d-3cc691dc57df

Opencontrail-Tungsten Fabric---VXLAN封装VM在同一网段通讯

进入vrf,

Opencontrail-Tungsten Fabric---VXLAN封装VM在同一网段通讯

由于是同一网段,所以查看l2index表项:(如果不同网段,查看ucindex (Unicast) 栏):

Opencontrail-Tungsten Fabric---VXLAN封装VM在同一网段通讯

上表可以看出报文以vxlan封装发往10.10.1.40(vhost0)

vm1所在host上:sudo tcpdump -n -i eth0 dst 10.10.1.40

在另一端10.10.1.40:http://10.240.230.40:8085/agent.xml#Snh_VxLanReq

go to host: 10.10.1.40

找到VxLanReq?vxlan_id=9999

Opencontrail-Tungsten Fabric---VXLAN封装VM在同一网段通讯

下一跳为114:找到NhListReq=114

Opencontrail-Tungsten Fabric---VXLAN封装VM在同一网段通讯

进入其对应的vrf:

Opencontrail-Tungsten Fabric---VXLAN封装VM在同一网段通讯

查看L2index:找到VM2对应的mac:

Opencontrail-Tungsten Fabric---VXLAN封装VM在同一网段通讯

NhListReq=97:

Opencontrail-Tungsten Fabric---VXLAN封装VM在同一网段通讯

报文接口VM2的网卡,完毕.