Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Regression] FlowMod delete with cookie but without match fields is matching incorrectly #38

Closed
viniarck opened this issue Nov 3, 2021 · 0 comments · Fixed by #39
Closed
Assignees
Labels
2022.1 Kytos-ng 2022.1

Comments

@viniarck
Copy link
Member

viniarck commented Nov 3, 2021

Issue

If you send a FlowMod delete with cookie set but without any match fields, which is exactly the kind of match that mef_eline sends when removing EVCs, it was matching more entries since I messed up an order of an early return on this PR #25.

How to reproduce

  • Run mininet:
    sudo mn -c && sudo mn --controller=remote,ip=127.0.0.1,port=6653 --switch=ovsk,protocols=OpenFlow13 --topo=linear,5

  • Start kytos, with mef_eline and of_lldp, installed as well:
    kytosd -f -E

  • Double check the current existing installed flows:

mininet> sh ovs-ofctl dump-flows s1 -O OpenFlow13 --rsort=priority
 cookie=0x0, duration=64.805s, table=0, n_packets=20, n_bytes=840, send_flow_rem priority=1000,dl_vlan=3799,dl_type=0x88cc actions=CONTROLLER:65535
mininet>

  • Request an EVC EPL on mef_eline with this payload:
{
    "name": "evc1",
    "dynamic_backup_path": true,
    "uni_a": {
        "interface_id": "00:00:00:00:00:00:00:01:1"
    },
    "uni_z": {
       "interface_id": "00:00:00:00:00:00:00:02:1"
    }
}
  • Notice the flows will be installed:
mininet> sh ovs-ofctl dump-flows s1 -O OpenFlow13 --rsort=priority
 cookie=0xaa67c174903df944, duration=5.006s, table=0, n_packets=0, n_bytes=0, send_flow_rem in_port="s1-eth1" actions=push_vlan:0x88a8,set_field:4416->vlan_vid,output:"s1-eth2"
 cookie=0xaa67c174903df944, duration=5.003s, table=0, n_packets=0, n_bytes=0, send_flow_rem in_port="s1-eth2",dl_vlan=320 actions=pop_vlan,output:"s1-eth1"
 cookie=0x0, duration=132.803s, table=0, n_packets=42, n_bytes=1764, send_flow_rem priority=1000,dl_vlan=3799,dl_type=0x88cc actions=CONTROLLER:65535
mininet>

  • After some time, when the consistency check again, it'll remove the of_lldp, dl_vlan=3799,dl_type=0x88cc actions=CONTROLLER:65535 entry, since mef_eline under the hood will send a delete, which our matching function is incorrectly matching incorrectly and deleting entries that aren't supposed to (this was an issue of a wrong order of an early return in the code):
mininet> sh ovs-ofctl dump-flows s1 -O OpenFlow13 --rsort=priority
 cookie=0xaa67c174903df944, duration=59.788s, table=0, n_packets=0, n_bytes=0, send_flow_rem in_port="s1-eth1" actions=push_vlan:0x88a8,set_field:4416->vlan_vid,output:"s1-eth2"
 cookie=0xaa67c174903df944, duration=59.785s, table=0, n_packets=0, n_bytes=0, send_flow_rem in_port="s1-eth2",dl_vlan=320 actions=pop_vlan,output:"s1-eth1"
mininet>

@viniarck viniarck self-assigned this Nov 3, 2021
@viniarck viniarck mentioned this issue Nov 3, 2021
@viniarck viniarck added the 2022.1 Kytos-ng 2022.1 label Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2022.1 Kytos-ng 2022.1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant