Академический Документы
Профессиональный Документы
Культура Документы
Paul Sim
Cloud Consultant
paul.sim@canonical.com
Index
Nova-network
VM VM VM VM VM VM
G/W G/W
Bridge dnsmasq
eth0 eth0
* Network NameSpace
Address
Network NameSpace provides isolation of the system resources associated with networking. Thus, each network
namespace has its own network devices, IP addresses, IP routing tables, /proc/net directory, port numbers, and so on.
- http://lwn.net/Articles/531114/
Installation - OpenvSwitch plugin VLAN, GRE
Management 192.168.20.0/24
Data 192.168.10.0/24
Network Topology
br-int int-br-eth1
int-br-eth1 br-int
eth0
OVS port
qg~~~ : external gateway interface
OVS Bridge
qr~~~ : virtual router interface
Neutron OVS plugin VLAN - Compute node
OpenStack Havana OpenvSwitch plug-in VLAN mode
- LibvirtGenericVIFDriver
Compute node - 1
VM VM VM VM
br-eth1
veth pair
phy-br-eth1 int-br-eth1 br-int
Packet conversion
mod_vlan_vid
Packet conversion
janghoon@compute-1:~$ sudo ovs-ofctl dump-flows br-eth1
NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=90455.716s, table=0, n_packets=6, n_bytes=468, priority=2,in_port=2 actions=drop
cookie=0x0, duration=89606.096s, table=0, n_packets=9484, n_bytes=2312018, priority=4,in_port=2,dl_vlan=1
actions=mod_vlan_vid:1024,NORMAL
cookie=0x0, duration=90456.248s, table=0, n_packets=6813, n_bytes=1325511, priority=1 actions=NORMAL
openvswitch-agent.log
Command: ['sudo', 'neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ovs-ofctl', 'add-flow', 'br-int', 'hard_timeout=0,
idle_timeout=0,priority=3,in_port=1,dl_vlan=1024,actions=mod_vl
an_vid:1,normal']
Command: ['sudo', 'neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ovs-ofctl', 'add-flow', 'br-eth1', 'hard_timeout=0,
idle_timeout=0,priority=4,in_port=2,dl_vlan=1,actions=mod_vlan
_vid:1024,normal']
Neutron OVS plugin VLAN - Network node
OpenStack Havana OpenvSwitch plug-in VLAN mode
- LibvirtGenericVIFDriver
Network node
tap~ tap~ tap~
br-eth1
eth1
qg~ qg~ qg~
veth pair
br-ex
eth0
net_proj_one Packet conversion
mod_vlan_id
net_proj_two
Floating-IP(NAT) mod_vlan_id
net_proj_new
Neutron OVS plugin VLAN - Network node
Packet conversion
janghoon@Network-node:~$ sudo ovs-ofctl dump-flows br-int
NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=7370.307s, table=0, n_packets=6, n_bytes=468, priority=2,in_port=6 actions=drop
cookie=0x0, duration=7368.424s, table=0, n_packets=0, n_bytes=0, priority=3,in_port=6,dl_vlan=2048 actions=mod_vlan_vid:2,NORMAL
cookie=0x0, duration=7367.991s, table=0, n_packets=764, n_bytes=191460, priority=3,in_port=6,dl_vlan=1024 actions=mod_vlan_vid:3,
NORMAL
cookie=0x0, duration=7369.073s, table=0, n_packets=0, n_bytes=0, priority=3,in_port=6,dl_vlan=500 actions=mod_vlan_vid:1,NORMAL
cookie=0x0, duration=7370.924s, table=0, n_packets=549, n_bytes=104066, priority=1 actions=NORMAL
libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
Big picture - Neutron OVS plugin GRE
OpenStack Havana OpenvSwitch plug-in GRE tunneling
- LibvirtGenericVIFDriver
br-tun
br-tun tap~ tap~
gre~
gre~
tag: 1 tag:2
patch
br-int patch
patch
patch br-int
qg~ qg~ qg~
br-ex
eth0
OVS port
qg~~~ : external gateway interface
OVS Bridge
qr~~~ : virtual router interface
Neutron OVS plugin GRE - Compute node
OpenStack Havana OpenvSwitch plug-in GRE tunneling
- LibvirtGenericVIFDriver
Compute node - 1
VM VM VM VM
Tunnel
br-tun
gre~
Packet conversion
mod_vlan_vid
Security Group[1]
set_tunnel id
Neutron OVS plugin GRE - Compute node
Packet conversion
br-tun
gre~
qg~ qg~ qg~
patch
br-int patch
br-ex
eth0
net_proj_one Packet conversion
set_tunnel id
net_proj_two
Floating-IP(NAT) mod_vlan_id
net_proj_new
Neutron OVS plugin GRE - Network node
Packet conversion
janghoon@Network-node:~$ sudo ovs-ofctl dump-flows br-tun
NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=474674.446s, table=0, n_packets=7899, n_bytes=2572502, priority=3,tun_id=0x3,dl_dst=01:00:00:00:00:00/01:00:00:00:00:
00 actions=mod_vlan_vid:2,output:1
cookie=0x0, duration=473163.123s, table=0, n_packets=7876, n_bytes=2565284, priority=3,tun_id=0x4,dl_dst=01:00:00:00:00:00/01:00:00:00:00:
00 actions=mod_vlan_vid:3,output:1
cookie=0x0, duration=633937.826s, table=0, n_packets=10543, n_bytes=3426814, priority=3,tun_id=0x1,dl_dst=01:00:00:00:00:00/01:00:00:00:00:
00 actions=mod_vlan_vid:1,output:1
cookie=0x0, duration=473163.329s, table=0, n_packets=16484, n_bytes=3348666, priority=4,in_port=1,dl_vlan=3 actions=set_tunnel:0x4,
NORMAL
cookie=0x0, duration=474674.541s, table=0, n_packets=16864, n_bytes=3389132, priority=4,in_port=1,dl_vlan=2 actions=set_tunnel:0x3,
NORMAL
cookie=0x0, duration=633937.905s, table=0, n_packets=62044, n_bytes=37320316, priority=4,in_port=1,dl_vlan=1 actions=set_tunnel:0x1,
NORMAL
cookie=0x0, duration=472911.069s, table=0, n_packets=16335, n_bytes=3551350, priority=3,tun_id=0x4,dl_dst=fa:16:3e:89:fd:ce
actions=mod_vlan_vid:3,NORMAL
cookie=0x0, duration=474336.184s, table=0, n_packets=16360, n_bytes=3560332, priority=3,tun_id=0x3,dl_dst=fa:16:3e:d8:d5:29
actions=mod_vlan_vid:2,NORMAL
cookie=0x0, duration=474674.351s, table=0, n_packets=525, n_bytes=52427, priority=3,tun_id=0x3,dl_dst=fa:16:3e:69:ca:97
actions=mod_vlan_vid:2,NORMAL
cookie=0x0, duration=473162.912s, table=0, n_packets=197, n_bytes=19365, priority=3,tun_id=0x4,dl_dst=fa:16:3e:d6:b8:07
actions=mod_vlan_vid:3,NORMAL
cookie=0x0, duration=633937.746s, table=0, n_packets=6207, n_bytes=630043, priority=3,tun_id=0x1,dl_dst=fa:16:3e:c7:ec:bd
actions=mod_vlan_vid:1,NORMAL
cookie=0x0, duration=474794.912s, table=0, n_packets=36912, n_bytes=7440964, priority=3,tun_id=0x1,dl_dst=fa:16:3e:8b:a6:d7
actions=mod_vlan_vid:1,NORMAL
cookie=0x0, duration=636252.069s, table=0, n_packets=163, n_bytes=36046, priority=1 actions=drop
Neutron OVS plugin Security Group - VLAN, GRE
FORWARD
neutron-filter-top
neutron-openvswi-local
Security group is applied here
neutron-openvswi-FORWARD
neutron-openvswi-sg-chain
neutron-openvswi-iTAP_NUMBER
neutron-openvswi-sg-fallback
neutron-openvswi-oTAP_NUMBER
neutron-openvswi-sg-fallback
Neutron OVS plugin Security Group - VLAN, GRE
Chain neutron-openvswi-sg-chain (4 references)
target prot opt source destination
neutron-openvswi-i21767f1f-4 all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-out tap21767f1f-45 --physdev-is-bridged
neutron-openvswi-o21767f1f-4 all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in tap21767f1f-45 --physdev-is-bridged
neutron-openvswi-i7903fd30-7 all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-out tap7903fd30-74 --physdev-is-bridged
neutron-openvswi-o7903fd30-7 all -- 0.0.0.0/0 0.0.0.0/0 PHYSDEV match --physdev-in tap7903fd30-74 --physdev-is-bridged
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
[1] Note, OpenStack uses iptables rules on the TAP devices such as tap~~ to implement security groups.
However, Open vSwitch is not compatible with iptables rules that are applied directly on TAP devices that are connected to an
Open vSwitch port.
Neutron OVS plugin NameSpace - VLAN, GRE
NameSpace
janghoon@Network-node:~$ sudo ip netns show
qdhcp-4c2f2346-ffaa-41a0-ab76-34cadf0163f5
qrouter-e1b88ce4-51e9-4744-be80-d70d04c6a59b
qdhcp-c19e22a0-1700-4b3b-91e5-2c961ef0a353
qrouter-244fff3f-f935-4bdd-949d-739f1ce81dd0
qdhcp-f37b681a-4be8-47b8-8063-3d17d24ee1ae
qrouter-cf5fe7b7-8fab-45de-ab1c-c0cd404ebed0
Floating-IP(NAT)
janghoon@Network-node:~$ sudo ip netns exec qrouter-cf5fe7b7-8fab-45de-ab1c-c0cd404ebed0 iptables -L -n -t nat
Chain neutron-l3-agent-PREROUTING (1 references)
target prot opt source destination
REDIRECT tcp -- 0.0.0.0/0 169.254.169.254 tcp dpt:80 redir ports 9697
DNAT all -- 0.0.0.0/0 192.168.122.51 to:50.50.1.2
Management 192.168.20.0/24
Data 192.168.10.0/24
Overview
AMQP
REST API
ovs-vswitchd ovs-vswitchd
Big picture - Neutron Ryu plugin
OpenStack Grizzly Ryu plugin GRE tunneling
gre~
gre~
br-int br-int
br-ex
eth0
OVS port
qg~~~ : external gateway interface
OVS Bridge
qr~~~ : virtual router interface
Neutron Ryu plugin - Compute node
OpenStack Grizzly Ryu plugin GRE tunneling
Compute node - 1
VM VM VM VM
Tunnel
gre~
br-int
Packet conversion
set_tunnel id
Security Group[1]
Neutron Ryu plugin - Compute node
Flow table
janghoon@compute-1:~$ sudo ovs-ofctl dump-flows br-int
NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=90146.068s, table=0, n_packets=0, n_bytes=0, priority=16384,in_port=3 actions=drop
cookie=0x0, duration=90146.989s, table=0, n_packets=0, n_bytes=0, priority=16384,in_port=4 actions=drop
cookie=0x0, duration=90146.068s, table=0, n_packets=3273, n_bytes=643066, tun_id=0x2,in_port=4
actions=resubmit(,2)
cookie=0x0, duration=90146.068s, table=0, n_packets=4720, n_bytes=1164172, in_port=3,dl_src=fa:16:3e:cf:dc:42
actions=set_tunnel:0x2,resubmit(,1)
cookie=0x0, duration=90146.068s, table=1, n_packets=6, n_bytes=468, priority=8192,tun_id=0x2 actions=resubmit(,2)
cookie=0x0, duration=90146.068s, table=1, n_packets=1504, n_bytes=483460, priority=16384,tun_id=0x2,dl_dst=ff:ff:ff:
ff:ff:ff actions=output:4,resubmit(,2)
cookie=0x0, duration=90146.068s, table=1, n_packets=3000, n_bytes=659756, tun_id=0x2,dl_dst=fa:16:3e:a2:0e:f1
actions=output:4,resubmit(,2)
cookie=0x0, duration=90146.068s, table=1, n_packets=210, n_bytes=20488, tun_id=0x2,dl_dst=fa:16:3e:ee:aa:8c
actions=output:4,resubmit(,2)
cookie=0x0, duration=90146.068s, table=2, n_packets=3216, n_bytes=680712, priority=8192,tun_id=0x2 actions=drop
cookie=0x0, duration=90146.068s, table=2, n_packets=1610, n_bytes=487912, priority=16384,tun_id=0x2,dl_dst=ff:ff:ff:
ff:ff:ff actions=output:3
cookie=0x0, duration=90146.068s, table=2, n_packets=3167, n_bytes=638614, tun_id=0x2,dl_dst=fa:16:3e:cf:dc:42
actions=output:3
Neutron Ryu plugin - Network node
OpenStack Grizzly Ryu plugin GRE tunneling
Network node
Namespace Namespace
Namespace
ns~ ns~
ns~
qr~ qr~ qr~
veth pair
gre~
br-int
br-ex
eth0
net_proj_one Packet conversion
set_tunnel id
net_proj_two
Floating-IP(NAT)
net_proj_new
Neutron Ryu plugin - Network node
Flow table
janghoon@network:~$ sudo ovs-ofctl dump-flows br-int
NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=144003.213s, table=0, n_packets=0, n_bytes=0, priority=16384,in_port=3 actions=drop
cookie=0x0, duration=142257.013s, table=0, n_packets=0, n_bytes=0, priority=16384,in_port=4 actions=drop
cookie=0x0, duration=144003.261s, table=0, n_packets=0, n_bytes=0, priority=16384,in_port=2 actions=drop
cookie=0x0, duration=142256.093s, table=0, n_packets=7335, n_bytes=1825414, tun_id=0x2,in_port=4
actions=resubmit(,2)
cookie=0x0, duration=144003.261s, table=0, n_packets=4748, n_bytes=977976, in_port=2,dl_src=fa:16:3e:a2:0e:f1
actions=set_tunnel:0x2,resubmit(,1)
cookie=0x0, duration=144003.213s, table=0, n_packets=544, n_bytes=58344, in_port=3,dl_src=fa:16:3e:ee:aa:8c
actions=set_tunnel:0x2,resubmit(,1)
cookie=0x0, duration=144003.261s, table=1, n_packets=27, n_bytes=5010, priority=8192,tun_id=0x2 actions=resubmit(,2)
cookie=0x0, duration=142256.093s, table=1, n_packets=113, n_bytes=4746, priority=16384,tun_id=0x2,dl_dst=ff:ff:ff:ff:
ff:ff actions=output:4,resubmit(,2)
cookie=0x0, duration=142256.093s, table=1, n_packets=4914, n_bytes=998000, tun_id=0x2,dl_dst=fa:16:3e:cf:dc:42
actions=output:4,resubmit(,2)
cookie=0x0, duration=144003.261s, table=2, n_packets=5177, n_bytes=1031490, priority=8192,tun_id=0x2 actions=drop
cookie=0x0, duration=144003.253s, table=2, n_packets=504, n_bytes=49439, tun_id=0x2,dl_dst=fa:16:3e:ee:aa:8c
actions=output:3
cookie=0x0, duration=144003.261s, table=2, n_packets=4733, n_bytes=1041550, tun_id=0x2,dl_dst=fa:16:3e:a2:0e:f1
actions=output:2
cookie=0x0, duration=144003.261s, table=2, n_packets=2495, n_bytes=769266, priority=16384,tun_id=0x2,dl_dst=ff:ff:ff:
ff:ff:ff actions=output:2,output:3
Neutron Ryu plugin Security Group
FORWARD
quantum-filter-top
quantum-ryu-agen-local
Security group is applied here
quantum-ryu-agen-FORWARD
quantum-ryu-agen-sg-chain
quantum-ryu-agen-iTAP_NUMBER
quantum-ryu-agen-sg-fallback
quantum-ryu-agen-oTAP_NUMBER
quantum-ryu-agen-sg-fallback
Neutron Ryu plugin Security Group
[1] Note, OpenStack uses iptables rules on the TAP devices such as tap~~ to implement security groups,.
However, Open vSwitch is not compatible with iptables rules that are applied directly on TAP devices that are connected to an
Open vSwitch port.
Neutron Ryu plugin NameSpace
Floating-IP(NAT)
janghoon@network:~$ sudo ip netns exec qrouter-f7f07d55-4fd6-4f95-a45f-d6b1f0cf8d18 iptables -L -n -t nat
Chain quantum-l3-agent-PREROUTING (1 references)
target prot opt source destination
REDIRECT tcp -- 0.0.0.0/0 169.254.169.254 tcp dpt:80 redir ports 9697
DNAT all -- 0.0.0.0/0 192.168.122.51 to:50.50.2.4
Configuration - ryu.conf
[DEFAULT]
app_lists = ryu.app.gre_tunnel,ryu.app.quantum_adapter,ryu.app.rest,ryu.app.rest_conf_switch,ryu.app.rest_quantum,ryu.app.
rest_tunnel,ryu.app.tunnel_port_updater
wsapi_host = 0.0.0.0
wsapi_port = 8080
ofp_listen_host = 0.0.0.0
ofp_tcp_listen_port = 6633
quantum_url=http://192.168.20.10:9696
quantum_admin_username=quantum
quantum_admin_password=*********
quantum_admin_tenant_name=service
quantum_admin_auth_url=http://192.168.20.10:35357/v2.0
quantum_auth_strategy=keystone
quantum_controller_addr = tcp:192.168.20.11:6633
Neutron ML2
The Modular Layer 2 (ML2) plugin is a framework allowing OpenStack Networking to simultaneously utilize the variety
of layer 2 networking technologies found in complex real-world data centers. It currently works with the existing
openvswitch, linuxbridge, and hyperv L2 agents, and is intended to replace and deprecate the monolithic plugins
associated with those L2 agents.
Neutron
ML2 Plugin
TypeDriver MechanismDriver
Arista
Cisco Nexus
OpenDaylight
OpenvSwitch
Hyper-V
VLAN GRE VxLAN Flat
pSwitch
TypeDriver : TypeDrivers maintain any needed type-specific network state, and perform provider network validation
and tenant network allocation.
MechanismDriver : The MechanismDriver is responsible for taking the information established by the TypeDriver and
ensuring that it is properly applied given the specific networking mechanisms that have been enabled.
https://wiki.openstack.org/wiki/Neutron/ML2
Neutron ML2
http://www.cisco.
com/c/en/us/products/collateral/switches/nexu
s-1000v-kvm/solution-overview-c22-730808.
html