felix: ensure vxlan udp flows are not tracked in conntrack#8977
felix: ensure vxlan udp flows are not tracked in conntrack#8977caseydavenport merged 1 commit intoprojectcalico:masterfrom
Conversation
fasaxc
left a comment
There was a problem hiding this comment.
Thanks for the contribution @cyclinder! I spotted one issue (there's a dedicated action for NOTRACK)
felix/rules/static.go
Outdated
| // we're policing. | ||
| } | ||
|
|
||
| // ensure VXLAN UDP Flows are not tracked in conntrack |
There was a problem hiding this comment.
| // ensure VXLAN UDP Flows are not tracked in conntrack | |
| // Ensure VXLAN UDP Flows are not tracked in conntrack. |
fe77f9f to
44ad905
Compare
|
All the unit tests are green. |
|
/sem-approve |
adkafka
left a comment
There was a problem hiding this comment.
Nice! Looks great to me, thanks for making the PR @cyclinder.
|
Tests are failing due to a typo in the iptables rule... should be |
felix/iptables/match_builder.go
Outdated
| } | ||
|
|
||
| func (m MatchCriteria) DestPort(port uint16) MatchCriteria { | ||
| return append(m, fmt.Sprintf("-dport %v", port)) |
There was a problem hiding this comment.
| return append(m, fmt.Sprintf("-dport %v", port)) | |
| return append(m, fmt.Sprintf("--dport %v", port)) |
|
Sorry @cyclinder , a big refactor PR just landed to add nftables support to Felix so this will need to be rebased on top of that. The biggest change that'll affect you is that the match criteria builder is now abstracted to support iptables or nftables so you'll need to add the new port match to both. |
|
hi @fasaxc, I'm not sure we need to add such a vxlan notrack rule for nftables as well. |
I believe it is needed for nftables as well. |
|
Yes, nftables works the same way as iptables at least in our "v1". Later we may take advantage of some more advanced nftables features. |
bda6d31 to
740089e
Compare
|
Thanks for the explanation! I just fixed the conflicts, and all the tests have passed. please recheck it. |
|
/sem-approve |
fasaxc
left a comment
There was a problem hiding this comment.
One suggestion. We should probably only write the rules if we're rendering the right IP tables version. For example,. user might have VXLAN v4 enabled, but not v6. In which case we don't want VXLAN rules for v6 since the user may be using VXLANv6 outside of Calico.
Signed-off-by: cyclinder <[email protected]>
|
/sem-approve |
|
LGTM, thanks @cyclinder ! |
|
@fasaxc @cyclinder I'm excited to get this PR out; thanks both for the work! Anything blocking us from merging this PR? I'd love to have it in the next Calico release. My apologies if I'm jumping the gun here and missing some process. My understanding is that the next step is merging, based on these docs: Line 45 in 6c9f455 |
VXLAN traffic tends to create a lot of `conntrack` entries (> 100k), because each node needs to open connections to every node in the cluster. Also, VXLAN doesn't operate with stateful flows (i.e. nodes send traffic to port 8472, they don't "reply" to packets based on the other node's source port), so each entry is in the `UNREPLIED` state, making them useless in the context of a stateful firewall. This commit adds `iptables` rules to prevent VXLAN traffic from being added to `conntrack`. This doesn't remove any functionality, but avoids overflowing `conntrack` with useless entries. For what it's worth, Calico is doing the same in projectcalico/calico#8977. Signed-off-by: Benoît Knecht <[email protected]>
VXLAN traffic tends to create a lot of `conntrack` entries (> 100k), because each node needs to open connections to every node in the cluster. Also, VXLAN doesn't operate with stateful flows (i.e. nodes send traffic to port 8472, they don't "reply" to packets based on the other node's source port), so each entry is in the `UNREPLIED` state, making them useless in the context of a stateful firewall. This commit adds `iptables` rules to prevent VXLAN traffic from being added to `conntrack`. This doesn't remove any functionality, but avoids overflowing `conntrack` with useless entries. For what it's worth, Calico is doing the same in projectcalico/calico#8977. Signed-off-by: Benoît Knecht <[email protected]>
VXLAN traffic tends to create a lot of `conntrack` entries (> 100k), because each node needs to open connections to every node in the cluster. Also, VXLAN doesn't operate with stateful flows (i.e. nodes send traffic to port 8472, they don't "reply" to packets based on the other node's source port), so each entry is in the `UNREPLIED` state, making them useless in the context of a stateful firewall. This commit adds `iptables` rules to prevent VXLAN traffic from being added to `conntrack`. This doesn't remove any functionality, but avoids overflowing `conntrack` with useless entries. For what it's worth, Calico is doing the same in projectcalico/calico#8977. Signed-off-by: Benoît Knecht <[email protected]>
VXLAN traffic tends to create a lot of `conntrack` entries (> 100k), because each node needs to open connections to every node in the cluster. Also, VXLAN doesn't operate with stateful flows (i.e. nodes send traffic to port 8472, they don't "reply" to packets based on the other node's source port), so each entry is in the `UNREPLIED` state, making them useless in the context of a stateful firewall. This commit adds `iptables` rules to prevent VXLAN traffic from being added to `conntrack`. This doesn't remove any functionality, but avoids overflowing `conntrack` with useless entries. For what it's worth, Calico is doing the same in projectcalico/calico#8977. Signed-off-by: Benoît Knecht <[email protected]>
Tunnel traffic tends to create a lot of `conntrack` entries (> 100k), because each node needs to open connections to every node in the cluster. Also, VXLAN/Geneve don't operate with stateful flows (i.e. nodes send traffic to port 8472/6081, they don't "reply" to packets based on the other node's source port), so each entry is in the `UNREPLIED` state, making them useless in the context of a stateful firewall. This commit adds `iptables` rules to prevent tunnel traffic from being added to `conntrack`. This doesn't remove any functionality, but avoids overflowing `conntrack` with useless entries. For what it's worth, Calico is doing the same in projectcalico/calico#8977. Signed-off-by: Benoît Knecht <[email protected]>
Tunnel traffic tends to create a lot of `conntrack` entries (> 100k), because each node needs to open connections to every node in the cluster. Also, VXLAN/Geneve don't operate with stateful flows (i.e. nodes send traffic to port 8472/6081, they don't "reply" to packets based on the other node's source port), so each entry is in the `UNREPLIED` state, making them useless in the context of a stateful firewall. This commit adds `iptables` rules to prevent tunnel traffic from being added to `conntrack`. This doesn't remove any functionality, but avoids overflowing `conntrack` with useless entries. For what it's worth, Calico is doing the same in projectcalico/calico#8977. Signed-off-by: Benoît Knecht <[email protected]>
Tunnel traffic tends to create a lot of `conntrack` entries (> 100k), because each node needs to open connections to every node in the cluster. Also, VXLAN/Geneve don't operate with stateful flows (i.e. nodes send traffic to port 8472/6081, they don't "reply" to packets based on the other node's source port), so each entry is in the `UNREPLIED` state, making them useless in the context of a stateful firewall. This commit adds `iptables` rules to prevent tunnel traffic from being added to `conntrack`. This doesn't remove any functionality, but avoids overflowing `conntrack` with useless entries. For what it's worth, Calico is doing the same in projectcalico/calico#8977. Signed-off-by: Benoît Knecht <[email protected]>
Description
felix: ensure vxlan udp flows are not tracked in conntrack
Related issues/PRs
fixes #8934
Todos
Release Note
Reminder for the reviewer
Make sure that this PR has the correct labels and milestone set.
Every PR needs one
docs-*label.docs-pr-required: This change requires a change to the documentation that has not been completed yet.docs-completed: This change has all necessary documentation completed.docs-not-required: This change has no user-facing impact and requires no docs.Every PR needs one
release-note-*label.release-note-required: This PR has user-facing changes. Most PRs should have this label.release-note-not-required: This PR has no user-facing changes.Other optional labels:
cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.