Skip to content

Instantly share code, notes, and snippets.

View jianzzha's full-sized avatar

Jianzhu Zhang jianzzha

  • Red Hat
  • Raleigh, North Carolina
  • 02:33 (UTC -04:00)
View GitHub Profile
@jianzzha
jianzzha / flat-provider-network-flow-table
Created May 7, 2018 18:19
flat network no packets received on guest
[root@compute-0 heat-admin]# ovs-ofctl dump-flows br-int -Oopenflow13
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x8000000, duration=6752.718s, table=0, n_packets=433, n_bytes=46598, priority=4,in_port=4,vlan_tci=0x0000/0x1fff actions=write_metadata:0x40000000000/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=6752.718s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=3,vlan_tci=0x0000/0x1fff actions=write_metadata:0x60000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=6752.718s, table=0, n_packets=294, n_bytes=37363, priority=10,in_port=3,dl_vlan=200 actions=pop_vlan,write_metadata:0x50000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=6749.906s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=5,vlan_tci=0x0000/0x1fff actions=write_metadata:0x70000000000/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=6747.234s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=6,vlan_tci=0x0000/0x1fff actions=write_metadata:0x80000000000/0xffffff00
@jianzzha
jianzzha / explicit-table-entry
Created March 20, 2018 16:38
after garp is disabled, explict enty in the flow table
[root@compute-0 ~]# ovs-ofctl dump-flows br-int -O openflow13
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x8000000, duration=5926.081s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=2,vlan_tci=0x0000/0x1fff actions=write_metadata:0x50000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=5922.311s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=3,vlan_tci=0x0000/0x1fff actions=write_metadata:0x80000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=5918.697s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=1,vlan_tci=0x0000/0x1fff actions=write_metadata:0xc0000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=1064.142s, table=0, n_packets=10544, n_bytes=831042, priority=4,in_port=7,vlan_tci=0x0000/0x1fff actions=write_metadata:0x60000000000/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=1064.138s, table=0, n_packets=56822, n_bytes=83431431, priority=10,in_port=2,dl_vlan=200 actions=pop_vlan,write_metadata:0x90000000001/0xffffff00
@jianzzha
jianzzha / no-explicit-entry
Created March 20, 2018 16:34
trafficgen started but no explicit entry created
[root@compute-0 ~]# ovs-ofctl dump-flows br-int -O openflow13
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x8000000, duration=5735.306s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=2,vlan_tci=0x0000/0x1fff actions=write_metadata:0x50000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=5731.536s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=3,vlan_tci=0x0000/0x1fff actions=write_metadata:0x80000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=5727.922s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=1,vlan_tci=0x0000/0x1fff actions=write_metadata:0xc0000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=873.367s, table=0, n_packets=10500, n_bytes=822248, priority=4,in_port=7,vlan_tci=0x0000/0x1fff actions=write_metadata:0x60000000000/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=873.363s, table=0, n_packets=56779, n_bytes=83422731, priority=10,in_port=2,dl_vlan=200 actions=pop_vlan,write_metadata:0x90000000001/0xffffff0000
@jianzzha
jianzzha / after-ovs-restarted
Created March 20, 2018 02:27
after openvswitch restarted
[root@compute-0 heat-admin]# systemctl restart openvswitch
[root@compute-0 heat-admin]# ovs-ofctl dump-flows br-int -O openflow13
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x8000000, duration=27.366s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=4,vlan_tci=0x0000/0x1fff actions=write_metadata:0x40000000000/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=27.366s, table=0, n_packets=0, n_bytes=0, priority=10,in_port=1,dl_vlan=200 actions=pop_vlan,write_metadata:0x50000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=27.366s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=2,vlan_tci=0x0000/0x1fff actions=write_metadata:0xc0000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=27.366s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=3,vlan_tci=0x0000/0x1fff actions=write_metadata:0x80000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=27.366s, table=0, n_packets=0, n_bytes=0, priority=10,in_port=2,dl_vlan=301 actions=pop_vlan,w
@jianzzha
jianzzha / flow-table-no-explicit-entry
Created March 20, 2018 02:21
This is the flow table with traffic started but no explicit entry created for the trafficgen mac address
[root@compute-0 heat-admin]# ovs-ofctl dump-flows br-int -O openflow13
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x8000000, duration=727.507s, table=0, n_packets=11368, n_bytes=1282581, priority=4,in_port=4,vlan_tci=0x0000/0x1fff actions=write_metadata:0x40000000000/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=727.501s, table=0, n_packets=139, n_bytes=15429, priority=4,in_port=1,vlan_tci=0x0000/0x1fff actions=write_metadata:0x60000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=727.501s, table=0, n_packets=56879, n_bytes=83432121, priority=10,in_port=1,dl_vlan=200 actions=pop_vlan,write_metadata:0x50000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=725.578s, table=0, n_packets=83, n_bytes=9213, priority=4,in_port=5,vlan_tci=0x0000/0x1fff actions=write_metadata:0x70000000000/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=725.577s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=3,vlan_tci=0x0000/0x1fff actions=write_metadata:0x800000
@jianzzha
jianzzha / ovs-initial-flow-table
Created March 20, 2018 02:10
this is the ovs table before trafficgen sends traffic
[root@compute-0 heat-admin]# ovs-ofctl dump-flows br-int -O openflow13
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x8000000, duration=87.505s, table=0, n_packets=271, n_bytes=24649, priority=4,in_port=4,vlan_tci=0x0000/0x1fff actions=write_metadata:0x40000000000/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=87.499s, table=0, n_packets=11, n_bytes=1221, priority=4,in_port=1,vlan_tci=0x0000/0x1fff actions=write_metadata:0x60000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=87.499s, table=0, n_packets=165, n_bytes=21505, priority=10,in_port=1,dl_vlan=200 actions=pop_vlan,write_metadata:0x50000000001/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=85.576s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=5,vlan_tci=0x0000/0x1fff actions=write_metadata:0x70000000000/0xffffff0000000001,goto_table:17
cookie=0x8000000, duration=85.575s, table=0, n_packets=0, n_bytes=0, priority=4,in_port=3,vlan_tci=0x0000/0x1fff actions=write_metadata:0x80000000001/0xffffff0000000
The data ports of the VM are on port 35 and port 36 on br-int, VM also has a port we use for access and is on port 34.
each of the two VM data ports is on its own provider network, with vlan 300 and 301; there is another VM port (port 34 on br-int) is for VM access with vlan 200 and not used for data traffic. The VM simply switch the packets between its data ports.
The traffic generator has two ports, with mac address ec:f4:bb:dc:93:98 on port 1, ec:f4:bb:dc:93:9a on port 2. port1 send udp traffic destined to port2's mac and vice versa.
We expect the traffic from its port1 to reach the br-int port 35 and then switched by the VM and come back on port 36 and go to
port 2 of the trafficgen.
[root@compute-0 ~]# sudo ovs-ofctl dump-groups -O OpenFlow13 br-int
OFPST_GROUP_DESC reply (OF1.3) (xid=0x2):