-
Notifications
You must be signed in to change notification settings - Fork 9
Rework traffic-rules #55
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
base: master
Are you sure you want to change the base?
Conversation
|
||
|
||
def update_args_from_ovs(args): | ||
# get parent bridge to apply ruels to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo "ruels"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. You should probably update the README.md as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really hard to fully wrap the head around everything here, but given the thoroughness of the tests it looks good to me as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of care obviously went here, dudging by the tests and the commit message. Like Andriy, I can't follow all the reasonings, but itś obvious this is an improvement.
Previous implementation did not take how VLANs are configured into account, this lead to a pretty hefty change. VLANs use a fake bridge, which is then included in a parent bridge. While packets remain within this bridge, they are not tagged, so the vlanid cannot be used to match packets in the OVS datapath. The only workaround is to create rules for each port. However, this means that rules for untagged traffic, as previously implemented, will also apply to VLAN ports. Therefore, we must apply rules to each matching port in all cases, and create a rule on the uplink ports that matches accordingly. Changes summary: - Refactored to improve clarity and error handling - Added update_args_from_ovs() to dynamically gather bridge, VLAN, and port info from OVS. - Changed ip_range to ipRange that XO plugin is using - Replaced single rule building with per-port rule, as well as matching on VLAN for uplink ports - Updated tests to match the refactor - Added tests for update_args_from_ovs() - Mocked OVS command calls in tests for more accurate validation. Signed-off-by: David Morel <[email protected]>
ba5d447
to
24ad916
Compare
Previous implementation did not take how VLANs are configured into account, this lead to a pretty hefty change.
VLANs use a fake bridge, which is then included in a parent bridge. While packets remain within this bridge, they are not tagged, so the vlanid cannot be used to match packets in the OVS datapath. The only workaround is to create rules for each port. However, this means that rules for untagged traffic, as previously implemented, will also apply to VLAN ports. Therefore, we must apply rules to each matching port in all cases, and create a rule on the uplink ports that matches accordingly.
Changes summary: