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

[Multicast] add Multicast networkpolicy support #3660

Merged
merged 1 commit into from
Jun 9, 2022

Conversation

liu4480
Copy link
Contributor

@liu4480 liu4480 commented Apr 19, 2022

implement network policy for multicast

  1. For multicast traffic, we support ingress rules for IGMP, and egress rules for multicast data traffic.
    And apply NetworkPolicy to real traffic for both. Ingress for multicast traffic is not supported now.

  2. While egress for IGMP only supports IGMP report, which is handled by packetIn. This patch
    maintains a rule map for each group address to fetch the rule which matches the member and also
    has the highest priority. And packetIn will decide to allow or drop the IGMP report traffic
    based on the matched rule.

@liu4480 liu4480 mentioned this pull request Apr 19, 2022
12 tasks
@liu4480 liu4480 changed the title WIP: Multicast np [WIP Multicast]: add Multicast networkpolicy support Apr 19, 2022
@liu4480 liu4480 force-pushed the multicast_flexible_pipeline_np branch from 34f8bb0 to 54591a5 Compare April 19, 2022 07:52
@liu4480 liu4480 force-pushed the multicast_flexible_pipeline_np branch 2 times, most recently from 0320e30 to fc991e9 Compare May 4, 2022 06:23
@lgtm-com
Copy link

lgtm-com bot commented May 4, 2022

This pull request introduces 2 alerts when merging fc991e9 into f08aecd - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

@liu4480 liu4480 changed the title [WIP Multicast]: add Multicast networkpolicy support add Multicast networkpolicy support May 5, 2022
@liu4480 liu4480 changed the title add Multicast networkpolicy support [Multicast] add Multicast networkpolicy support May 5, 2022
@liu4480 liu4480 requested review from wenyingd, tnqn, ceclinux, hongliangl and Dyanngg and removed request for ceclinux, wenyingd, tnqn, Dyanngg and hongliangl May 5, 2022 01:53
@lgtm-com
Copy link

lgtm-com bot commented May 5, 2022

This pull request introduces 2 alerts when merging 8d29a75 into 8f451f7 - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

@lgtm-com
Copy link

lgtm-com bot commented May 5, 2022

This pull request introduces 2 alerts when merging 089d394 into 8f451f7 - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

@codecov-commenter
Copy link

codecov-commenter commented May 5, 2022

Codecov Report

Merging #3660 (faae27b) into main (8c9ba64) will increase coverage by 28.73%.
The diff coverage is 40.03%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #3660       +/-   ##
===========================================
+ Coverage   35.72%   64.46%   +28.73%     
===========================================
  Files         121      288      +167     
  Lines       16894    41710    +24816     
===========================================
+ Hits         6035    26887    +20852     
- Misses      10366    12665     +2299     
- Partials      493     2158     +1665     
Flag Coverage Δ
e2e-tests 44.85% <16.88%> (?)
integration-tests ?
kind-e2e-tests 51.26% <18.21%> (?)
unit-tests 44.19% <38.02%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/agent/openflow/multicast.go 0.00% <0.00%> (ø)
pkg/agent/route/route_linux.go 48.08% <0.00%> (ø)
pkg/agent/types/networkpolicy.go 81.08% <ø> (ø)
pkg/apis/controlplane/types.go 0.00% <ø> (ø)
pkg/util/ip/ip.go 78.76% <0.00%> (ø)
pkg/agent/openflow/client.go 70.12% <14.28%> (ø)
pkg/controller/networkpolicy/validate.go 48.84% <17.39%> (ø)
pkg/agent/openflow/network_policy.go 83.74% <20.00%> (ø)
pkg/agent/openflow/pipeline.go 72.28% <22.58%> (ø)
pkg/agent/controller/networkpolicy/reconciler.go 68.90% <29.54%> (ø)
... and 417 more

@lgtm-com
Copy link

lgtm-com bot commented May 5, 2022

This pull request introduces 2 alerts when merging f96b372 into 8f451f7 - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

@liu4480 liu4480 changed the title [Multicast] add Multicast networkpolicy support WIP: [Multicast] add Multicast networkpolicy support May 5, 2022
@liu4480 liu4480 force-pushed the multicast_flexible_pipeline_np branch 2 times, most recently from 3ab626e to 18b52b9 Compare May 5, 2022 14:27
@lgtm-com
Copy link

lgtm-com bot commented May 5, 2022

This pull request introduces 2 alerts when merging 18b52b9 into 09d11e9 - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

@liu4480 liu4480 force-pushed the multicast_flexible_pipeline_np branch 3 times, most recently from cc2c9cd to 60eb770 Compare May 6, 2022 06:50
@lgtm-com
Copy link

lgtm-com bot commented May 6, 2022

This pull request introduces 2 alerts when merging 60eb770 into 50d33be - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

@liu4480
Copy link
Contributor Author

liu4480 commented Jun 2, 2022

/test-conformance
/test-e2e
/test-networkpolicy
/test-multicast-e2e

@liu4480
Copy link
Contributor Author

liu4480 commented Jun 3, 2022

/test-multicast-e2e

@liu4480 liu4480 requested review from wenyingd and tnqn June 4, 2022 04:47
wenyingd
wenyingd previously approved these changes Jun 6, 2022
Copy link
Contributor

@wenyingd wenyingd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

pkg/agent/multicast/mcast_discovery.go Outdated Show resolved Hide resolved
pkg/agent/multicast/mcast_discovery.go Outdated Show resolved Hide resolved
pkg/agent/openflow/pipeline.go Outdated Show resolved Hide resolved
pkg/agent/openflow/client.go Outdated Show resolved Hide resolved
pkg/agent/openflow/pipeline.go Outdated Show resolved Hide resolved
pkg/agent/openflow/pipeline.go Outdated Show resolved Hide resolved
@liu4480
Copy link
Contributor Author

liu4480 commented Jun 7, 2022

/test-conformance
/test-e2e
/test-networkpolicy
/test-multicast-e2e

@liu4480 liu4480 requested a review from tnqn June 7, 2022 07:03
@liu4480 liu4480 force-pushed the multicast_flexible_pipeline_np branch from dc24b07 to a69eb21 Compare June 7, 2022 12:39
pkg/agent/controller/networkpolicy/cache.go Outdated Show resolved Hide resolved
pkg/agent/controller/networkpolicy/cache.go Outdated Show resolved Hide resolved
pkg/agent/controller/networkpolicy/cache.go Outdated Show resolved Hide resolved
pkg/agent/multicast/mcast_controller.go Outdated Show resolved Hide resolved
pkg/agent/openflow/pipeline.go Outdated Show resolved Hide resolved
pkg/agent/openflow/pipeline.go Outdated Show resolved Hide resolved
pkg/controller/networkpolicy/validate.go Show resolved Hide resolved
@liu4480 liu4480 force-pushed the multicast_flexible_pipeline_np branch from a69eb21 to 20b0d80 Compare June 8, 2022 01:05
@liu4480 liu4480 requested review from tnqn and ceclinux June 8, 2022 01:55
pkg/agent/openflow/client.go Outdated Show resolved Hide resolved
pkg/controller/networkpolicy/validate.go Show resolved Hide resolved
1. For multicast traffic, we support ingress rules for IGMP, and egress rules for multicast data traffic.
 And apply NetworkPolicy to real traffic for both. Ingress for multicast traffic is not supported now.

2. While egress for IGMP only supports IGMP report, which is handled by packetIn. This patch
maintainsvrule map for each group address to fetch the rule which matches the member and also
has the highest priority. And packetIn will decide to allow or drop the IGMP report traffic
based on the matched rule.

Signed-off-by: Bin Liu <[email protected]>
@liu4480 liu4480 force-pushed the multicast_flexible_pipeline_np branch from 20b0d80 to faae27b Compare June 8, 2022 06:22
@liu4480 liu4480 requested a review from tnqn June 8, 2022 09:36
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@liu4480
Copy link
Contributor Author

liu4480 commented Jun 8, 2022

/test-conformance
/test-e2e
/test-networkpolicy
/test-multicast-e2e

@tnqn
Copy link
Member

tnqn commented Jun 9, 2022

/test-ipv6-e2e
/test-ipv6-only-e2e

@tnqn
Copy link
Member

tnqn commented Jun 9, 2022

/test-ipv6-e2e

@tnqn
Copy link
Member

tnqn commented Jun 9, 2022

In commit message:

This patch maintainsvrule map for each group address

I suppose you want to say "This patch maintains a rule map for each group address", right? If yes, please update PR description directly. I will update commit message when merging.

@tnqn tnqn merged commit 5a7e5c3 into antrea-io:main Jun 9, 2022
@liu4480 liu4480 deleted the multicast_flexible_pipeline_np branch June 10, 2022 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/release-note Indicates a PR that should be included in release notes. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants