Open andriidovhan opened 4 years ago
Actual result: System allow traffic through the defaultFlow with VLAN.
Steps to reproduce:
[ { "flow_id": "flow1", "source": { "switch_id": "00:00:00:00:00:00:00:02", "port_number": 10, "vlan_id": 10, "inner_vlan_id": 15 }, "destination": { "switch_id": "00:00:00:00:00:00:00:09", "port_number": 10, "vlan_id": 0, "inner_vlan_id": 0 }, "status": "Up", "maximum_bandwidth": 1000, }, { "flow_id": "flow2", "source": { "switch_id": "00:00:00:00:00:00:00:02", "port_number": 10, "vlan_id": 0, "inner_vlan_id": 0 }, "destination": { "switch_id": "00:00:00:00:00:00:00:09", "port_number": 10, "vlan_id": 23, "inner_vlan_id": 123 }, "status": "Up", "maximum_bandwidth": 1000, } ]
generate traffic with lab_service-{number}
Req:
curl --location --request POST 'localhost:8288/api/1/traffgen/tg2/address' --header 'Content-Type: application/json' --data-raw '{
"address": "192.168.1.4/30",
"vlan": 10
}'
Res:
{"address": {"prefix": 30, "address": "192.168.1.4", "idnr": "90bb8ffc-b23a-11ed-adc8-0242ac110002", "vlan": [10]}}
Req:
curl --location --request PUT 'localhost:8288/api/1/traffgen/tg2/address/90bb8ffc-b23a-11ed-adc8-0242ac110002/lldp' --header 'Content-Type: application/json' --data-raw '{ "mac_address": "e4:1d:2d:a5:f3:ac", "port_number": "e4:1d:2d:a5:f3:ac", "chassis_id": "00:02:03:04:05:00", "time_to_live": 100 }'
Res:
{"lldp_push": {"sent_packets": 1}
There are two ways to check, first way is to use console:
Go to the lab_service container :
docker exec -it lab_service-{number} bash
show flow table:
ovs-ofctl -O OpenFlow13 dump-flows ofsw2
cookie=0x800000000a000a, duration=2812.993s, table=1, **n_packets=1**, n_bytes=64, priority=24576,in_port="ofsw2-10",**dl_vlan=10 actions=pop_vlan**,write_metadata:0x100000a8/0xf000fff8,goto_table:2
cookie=0x810000000a000d, duration=2812.993s, table=1, n_packets=0, n_bytes=0, priority=24576,in_port=13,dl_vlan=10 actions=pop_vlan,write_metadata:0x100000a8/0xf000fff8,goto_table:2
cookie=0x8000000000000008, duration=109933.389s, table=1, n_packets=0, n_bytes=0, priority=1 actions=goto_table:2
cookie=0x400000000001c2c9, duration=2812.993s, table=2, n_packets=0, n_bytes=0, reset_counts priority=24586,metadata=0x100000a8/0xf000fff8,in_port="ofsw2-10",dl_vlan=15 actions=meter:278,set_field:4698->vlan_vid,output:"ofsw2-3",goto_table:3
cookie=0x40c000000001c2c9, duration=2812.993s, table=2, n_packets=0, n_bytes=0, reset_counts priority=24586,metadata=0x100a00a8/0xfffffff8,in_port=13,dl_vlan=15 actions=set_field:00:00:00:00:00:02->eth_src,set_field:00:00:00:00:00:09->eth_dst,set_field:4698->vlan_vid,output:"ofsw2-3"
cookie=0x400000000000fb91, duration=2314.868s, table=2, **n_packets=1**, n_bytes=64, reset_counts priority=24575**,in_port="ofsw2-10"** actions=meter:2000,push_vlan:0x8100,set_field:4498->vlan_vid,output:"ofsw2-3",goto_table:3
cookie=0x40c000000000fb91, duration=2314.868s, table=2, n_packets=0, n_bytes=0, reset_counts priority=24566,metadata=0x100a0000/0xffff0000,in_port=13 actions=set_field:00:00:00:00:00:02->eth_src,set_field:00:00:00:00:00:09->eth_dst,push_vlan:0x8100,set_field:4498->vlan_vid,output:"ofsw2-3"
cookie=0x8000000000000009, duration=109933.390s, table=2, n_packets=0, n_bytes=0, priority=1 actions=drop
Second way: use openTSB (http://172.19.123.246:4242/) set the right filters:
There is no traffic for flow1:
There is some traffic for flow2, which is our default flow.
The best way to test it and I assume the way it was tested originally is by using regular 'traffExam' procedure available in traffgens. Where instead of just sending lldp it would start a complete 'iperf' session on both ends of the flow. There's should be someone who has postman steps on how to do that. If not let me know I'll look for it
Thank you @rtretyak ! Also we can uncomment this test https://github.com/telstra/open-kilda/commit/dfbd1c26ba5e1c54719ef22c2b70dee02586528f#diff-dd9386e8e52860c5fe035095b97a3e3f85643ffd008cbe9bc064cc9ea3d1ae6aR140
@IvanChupin the behaviour of the bug is still actual
Steps to reproduce:
Actual result: System is not allowing traffic through the defaultFlow with VLAN