Date post: | 08-Feb-2017 |
Category: | Technology |
View: | 1,146 times |
Download: | 0 times |
RED HAT ENTERPISE LINUX 1
Understanding Open Vswitch Open Stack
YONG-KI, [email protected] Hat Korea
RED HAT ENTERPISE LINUX 2
Session Objective
Open Vswitch
1. role of OVS in Open Stack
2. Working process of OVS
3. Various IP Interfaces TAP, TUN, veth-Pair
RED HAT ENTERPISE LINUX 3
Base Network Knowledge
TCP/IP Model
Layer 1
Layer 2
Layer 3
Layer 4
Layer 5
Layer 6
Layer 7
RED HAT ENTERPISE LINUX4
TCP/IP
Switch covers TCP/IP but Bridge works on only L2
L2: Mac based communication- bridge, L2 Switch
L3: IP based communication- router, L3 Switch
L4: TCP Port based communication- L4 Switch, Load Balancer
RED HAT ENTERPISE LINUX5
Network Diagram host alone
Basic Network topology
eth0
External
Internal
eth1
VM1
eth0
OVS
VM2
eth0
br-int vtap1
vtap2
IP stack(192.168.0.1/24)
br-int/internal
vtap1
vtap2
Host1
172.16.0.1
RED HAT ENTERPISE LINUX6
Network Diagram - tunneling
Basic Network topology
eth0
External
Internal
eth1
VM1
eth0
OVS
VM2
eth0
br-int vtap1
vtap2
IP stack(192.168.0.1/24)
br-int/internal
vtap1
vtap2
Host1
eth0
eth1
VM3
eth0
OVS
VM4
eth0
br-int vtap1
vtap2
IP stack(192.168.0.2/24)
br-int/internal
vtap1
vtap2
Host2
172.16.0.1 172.16.0.2
RED HAT ENTERPISE LINUX7
Network Diagram complete picture
Basic Network topology
eth0
External
Internal
eth1
VM1
eth0OVS
VM2
eth0
br-int vtap1
vtap2
IP stack(192.168.0.1/24)
br-int/internal
vtap1
vtap2
Host1
eth0
eth1
VM3
eth0
OVS
VM4
eth0
br-int vtap1
vtap2
IP stack(192.168.0.2/24)
br-int/internal
vtap1
vtap2
Host2
br-tun
veth1 veth0
172.16.0.1br-tun
/internal eth1
br-tun
veth1
eth1
veth0
172.16.0.2br-tun
/internal
RED HAT ENTERPISE LINUX8
OVS how to OVS Service
1. OVS start
eth0
eth1
OVS
IP stack(192.168.0.1/24)
Host1
host1#systemctl stop firewalld; setenforce 0 host1#service openvswitch start
[[email protected] ~]# ovs-vsctl showda8683f3-e1c1-4c9a-9587-2e3e860f9f82 ovs_version: "2.3.2"
172.16.0.1
RED HAT ENTERPISE LINUX9
OVS how to - br
2. Create Bridge
eth0
eth1
OVS
br-int
IP stack(192.168.0.1/24)
br-int/internal
Host1
host1#ovs-vsctl add-br br-inthost1#ip link set dev br-int up
[[email protected] ~]# ovs-vsctl showda8683f3-e1c1-4c9a-9587-2e3e860f9f82 Bridge br-int Port br-int Interface br-int type: internal ovs_version: "2.3.2"
172.16.0.1
RED HAT ENTERPISE LINUX10
OVS how to br-internal
3. assign IP addr to br-int
eth0
eth1
OVS
br-int
IP stack(192.168.0.1/24)
br-int/internal
Host1
host1#ip addr add 192.168.0.100/24 dev br-int
[[email protected] ~]# ovs-vsctl showda8683f3-e1c1-4c9a-9587-2e3e860f9f82 Bridge br-int Port br-int Interface br-int type: internal ovs_version: "2.3.2"
172.16.0.1
RED HAT ENTERPISE LINUX11
OVS how to
4. Create tap device vtap1, vtap2
eth0
eth1
OVS
br-int
IP stack(192.168.0.1/24)
br-int/internal
vtap1
vtap2
Host1
host1#ip tuntap add mode tap vtap{1,2}host1#ovs-vsctl add-port br-int vtap1 - add-port br-int vtap2host1#ip link set dev vtap{1,2} up
[[email protected] ~]# ovs-vsctl showda8683f3-e1c1-4c9a-9587-2e3e860f9f82 Bridge br-int
Port vtap1Interface vtap1
Port vtap2Interface vtap2
Port br-int Interface br-int type: internal ovs_version: "2.3.2"
vtap1
vtap2
172.16.0.1
RED HAT ENTERPISE LINUX12
OVS how to Config for VM with TAP
5. create VM and configure to use manual TAP device
virt-manager mactap manual tap 1. vi /etc/libvirt/qemu/host1.xml2. vi /etc/libvirt/qemu.conf (&& selinux disable)3. service libvirtd restart
RED HAT ENTERPISE LINUX13
OVS how to VM IP
4. allocate IP addr to VM's eth0
eth0
eth1
OVS
br-int
IP stack(192.168.0.1/24)
br-int/internal
vtap1
vtap2
Host1
[email protected]#ip addr add 192.168.0.101/24 dev [email protected]#ip addr add 192.168.0.102/24 dev eth0
VM1#ping 192.168.0.1[success]
VM2#ping 192.168.0.1[success]
vtap1
vtap2
VM1
eth0
VM2
eth0
192.168.0.101
192.168.0.102
172.16.0.1
RED HAT ENTERPISE LINUX14
OVS how to - Monitor
5. monitor ovs status
eth0
eth1
OVS
br-int
IP stack(192.168.0.1/24)
br-int/internal
vtap1
vtap2
Host1
host1#ovs-vsctl showhost1#ovs-ofctl show br-inthost1#ovs-appctl fdb/show br-int
host1#ovs-ofctl show br-int 1(eth1): addr:00:1a:4a:36:66:10 config: 0 state: 0 speed: 0 Mbps now, 0 Mbps max 2(vtap1): addr:96:34:e5:61:0a:ca config: PORT_DOWN state: LINK_DOWN current: 10MB-FD COPPER speed: 10 Mbps now, 0 Mbps max 3(vtap2): addr:f2:18:36:6c:d6:62 config: PORT_DOWN state: LINK_DOWN current: 10MB-FD COPPER speed: 10 Mbps now, 0 Mbps max LOCAL(br-int): addr:00:1a:4a:36:66:10 config: PORT_DOWN state: LINK_DOWN speed: 0 Mbps now, 0 Mbps maxOFPT_GET_CONFIG_REPLY (xid=0x4): frags=normalmiss_send_len=0
vtap1
vtap2
VM1
eth0
VM2
eth0
192.168.0.101
192.168.0.102
172.16.0.1
RED HAT ENTERPISE LINUX15
OVS how to Test Connection
6. ping test between vm1 on host1 and vm2 host2
eth0
eth1
OVS
br-int
IP stack(192.168.0.1/24)
br-int/internal
vtap1
vtap2
Host1
VM1# ping 192.168.0.102 [success]VM1#ping 192.168.0.103 [failed]
vtap1
vtap2
VM1
eth0
VM2
eth0
192.168.0.101
192.168.0.102
eth0
eth1
OVS
br-int
IP stack(192.168.0.2/24)
br-int/internal
vtap1
vtap2
Host1
vtap1
vtap2
VM3
eth0
VM4
eth0
192.168.0.103
192.168.0.104
172.16.0.1 172.16.0.2
RED HAT ENTERPISE LINUX16
OVS how to Tun(VXLAN)
7. create vxlan TUN for connection between VM1 and MV3
eth0
eth1
OVS
br-int
IP stack(192.168.0.1/24)
br-int/internal
vtap1
vtap2
Host1
host1# ovs-vsctl add-port br-int vxlan0 -- set interface vxlan0type=vxlan options:key=100 options:remote_ip=172.16.0.2]host2#ovs-vsctl add-port br-int vxlan0 -- set interface vxlan0type=vxlan options:key=100 options:remote_ip=172.16.0.1
vtap1
vtap2
VM1
eth0
VM2
eth0
192.168.0.101
192.168.0.102
eth0
eth1
OVS
br-int
IP stack(192.168.0.2/24)
br-int/internal
vtap1
vtap2
Host1
vtap1
vtap2
VM3
eth0
VM4
eth0
192.168.0.103
192.168.0.104
172.16.0.1 172.16.0.2
vxlan1VNI=100
vxlan1VNI=100
RED HAT ENTERPISE LINUX17
OVS how to - Monitor
8. current ovs status
host1#ovs-vsctl showhost1#ovs-ofctl ip a
[[email protected] ~]# ovs-vsctl show84c282c9-b992-4673-a715-2d2e46f0c175 Bridge br-int Port br-int Interface br-int type: internal Port "vtap1" Interface "vtap1" Port "vtap2" Interface "vtap2" Port "vxlan0" Interface "vxlan0" type: vxlan options: {key="100",remote_ip="172.16.0.2"} ovs_version: "2.3.2"
eth0: mtu 1500 link/ether 00:1a:4a:36:66:0d brdff:ff:ff:ff:ff:ff inet 10.64.168.146/24 eth1: mtu 1500 link/ether 00:1a:4a:36:66:0e brdff:ff:ff:ff:ff:ff inet 172.16.0.1/24 vtap1: mtu1500 link/ether 16:07:a0:03:15:ac brdff:ff:ff:ff:ff:ffvtap2: mtu1500 link/ether e2:05:f1:38:5d:21 brdff:ff:ff:ff:ff:ffbr-int: mtu 1500 link/ether 46:8c:72:ee:f0:4b brdff:ff:ff:ff:ff:ff inet 192.168.0.1/24 scope global br-int
RED HAT ENTERPISE LINUX18
OVS how to veth pair
9. connection between bridges.
host1#ip link add veth0 type veth peer name veth1host1# ovs-vsctl add-br br-tunhost1#ovs-vsctl add-port br-int veth0host1#ovs-vsctl add-port br-tun veth1host1#ovs-vsctl add-port eth1host1#ip link set dev veth{0,1} up
RED HAT ENTERPISE LINUX19
OVS how to veth pair
10. connection between bridges.
host1#ovs-vsctl showhost1# ip addr
[[email protected] ~]# ovs-vsctl show84c282c9-b992-4673-a715-2d2e46f0c175 Bridge br-int Port "veth0" Interface "veth0" Port br-int Interface br-int type: internal Port "vtap1" Interface "vtap1" Port "vtap2" Interface "vtap2" Port "vxlan0" Interface "vxlan0" type: vxlan options: {key="100", remote_ip="172.16.0.2"} Bridge br-tun Port br-tun Interface br-tun type: internal Port "veth1" Interface "veth1" Port "eth1"
Click here to load reader