อ้างอิงจาก scenario_legacy_ovs
โดย default install openstack จะกำหนดให้การต่อระหว่าง compute กับ network จะใช้ GRE TUNNEL แต่ตัวอย่างนี้จะใช้ vlan ซึ่งตัว compute และ network node สามารถต่อ switch ที่ทำ trunking ได้ แต่
DHCP ยังแจกจาก network node และ INTERNET ยังต้อง nat บน Network node
Network Layout
Service Layout
จะเห็นว่า neutron-server จะไม่มี service บน network node
Network Overview
Network Node Components
ใช้ openvswitch ในการเขียน Flow เพื่อทำการ modify vlan หรือ strip vlan
Openvswitch command. show port number
Dump flows
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
%ovs-ofctl dump-flows br-vlan NXST_FLOW reply (xid=0x4): cookie=0x0, duration=81192.504s, table=0, n_packets=40816, n_bytes=2457827, idle_age=0, hard_age=65534, priority=1 actions=NORMAL cookie=0x0, duration=81186.461s, table=0, n_packets=143, n_bytes=15800, idle_age=11117, hard_age=65534, priority=4,in_port=2,dl_vlan=1 actions=mod_vlan_vid:100,NORMAL cookie=0x0, duration=81191.319s, table=0, n_packets=0, n_bytes=0, idle_age=65534, hard_age=65534, priority=2,in_port=2 actions=drop ---- %ovs-ofctl dump-flows br-int NXST_FLOW reply (xid=0x4): cookie=0x0, duration=81214.123s, table=0, n_packets=143, n_bytes=15800, idle_age=11138, hard_age=65534, priority=1 actions=NORMAL cookie=0x0, duration=81207.324s, table=0, n_packets=219, n_bytes=22007, idle_age=11138, hard_age=65534, priority=3,in_port=1,dl_vlan=100 actions=mod_vlan_vid:1,NORMAL cookie=0x0, duration=81212.468s, table=0, n_packets=0, n_bytes=0, idle_age=65534, hard_age=65534, priority=2,in_port=1 actions=drop cookie=0x0, duration=81210.737s, table=0, n_packets=0, n_bytes=0, idle_age=65534, hard_age=65534, priority=2,in_port=2 actions=drop cookie=0x0, duration=81204.131s, table=0, n_packets=0, n_bytes=0, idle_age=65534, hard_age=65534, priority=3,in_port=2,vlan_tci=0x0000 actions=mod_vlan_vid:3,NORMAL cookie=0x0, duration=81213.984s, table=23, n_packets=0, n_bytes=0, idle_age=65534, hard_age=65534, priority=0 actions=drop -- %ovs-ofctl dump-flows br-ex NXST_FLOW reply (xid=0x4): cookie=0x0, duration=81227.273s, table=0, n_packets=40614, n_bytes=2436840, idle_age=0, hard_age=65534, priority=1 actions=NORMAL cookie=0x0, duration=81219.785s, table=0, n_packets=0, n_bytes=0, idle_age=65534, hard_age=65534, priority=4,in_port=1,dl_vlan=3 actions=strip_vlan,NORMAL cookie=0x0, duration=81226.093s, table=0, n_packets=25, n_bytes=2930, idle_age=11158, hard_age=65534, priority=2,in_port=1 actions=drop |
namespace
Namespace Routing
1 2 3 4 5 6 7 |
% ip netns exec qrouter-4eb18658-d7f9-4d67-9db2-e11e8a01b8b0 ip route show default via 203.0.113.1 dev qg-bd2c79d2-27 192.168.1.0/24 dev qr-2f4ed990-e6 proto kernel scope link src 192.168.1.1 203.0.113.0/24 dev qg-bd2c79d2-27 proto kernel scope link src 203.0.113.101 |
ตัวอย่าง iptables ใน namespace บน network node.
neml2vnwnode-iptables
Compute Node Components
ใช้ openvswitch ในการ mod vlan และสร้าง patch interface เชื่อมต่อระหว่าง switch , port eth1 เป็น port trunk สามารถนำไปต่อกับ physical switch , และ port ระหว่าง openvswitch กับ bridge Linux
ใช้ interface veth peer
Bridge Linux กับ openvswitch จะใช้ veth peer ในการเชื่อมต่อ
iptables on bridge switch
ml2-vlan_compute-iptable