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

WG tunneling #29000

Merged
merged 3 commits into from
Nov 7, 2023
Merged

WG tunneling #29000

merged 3 commits into from
Nov 7, 2023

Conversation

brb
Copy link
Member

@brb brb commented Nov 6, 2023

Forward port of #28917 (minus the optional flag and the strict mode removal).

When tunneling is enabled, a packet will be encapsulated by Cilium's tunnel netdev before encrypting with WireGuard.

@brb brb added kind/enhancement This would improve or streamline existing functionality. release-note/minor This PR changes functionality that users may find relevant to operating Cilium. area/encryption Impacts encryption support such as IPSec, WireGuard, or kTLS. labels Nov 6, 2023
@brb brb requested a review from gandro November 6, 2023 09:37
@brb
Copy link
Member Author

brb commented Nov 6, 2023

/test

@brb
Copy link
Member Author

brb commented Nov 6, 2023

/test

So that a src security ID can be transferred to a remote node (e.g., for
netpol checks).

This commit changes a pkt path when WireGuard + tunneling are enabled
AND the newly introduced --wireguard-encapsulate is set.

Previously, we had the following:

  ┌──────┐     1.       ┌──────┐   4.
  │ lxc0 ├──────────────► eth0 ├──────►
  └──────┘              └─┬───▲┘
                          │   │
                          │   │
                        2.│   │ 3.
                          │   │
┌───────────────┐     ┌───▼───┴────┐
│ cilium_vxlan  │     │cilium_wg0  │
└───────────────┘     └────────────┘

With this change:

  ┌──────┐              ┌──────┐
  │ lxc0 │   ┌──────────► eth0 ├─────►
  └───┬──┘   │          └─┬───▲┘  5.
      │      │            │   │
      │      │            │   │
    1.│    2.│         3. │   │ 4.
      │      │            │   │
┌─────▼──────┴──┐     ┌───▼───┴────┐
│ cilium_vxlan  │     │cilium_wg0  │
└───────────────┘     └────────────┘

A side effect of this change is that host-to-remote-pod traffic is going
to be encrypted (previously it was not).

The change was first made available in v1.14 [1] (controlled w/
--wireguard-encapsulate, which defaults to false). To avoid breaking
connections during an upgrade from v1.14 to v1.15 (due to missing node
IPs within allowed-ips), in v1.14 we populate those IPs regardless
whether the feature is enabled.

[1]: #28917

Signed-off-by: Martynas Pumputis <m@lambda.lt>
@brb
Copy link
Member Author

brb commented Nov 6, 2023

/ci-e2e

brb added a commit to cilium/cilium-cli that referenced this pull request Nov 6, 2023
It's going to be enabled on Cilium >= 1.15 [1].

[1]: cilium/cilium#29000

Signed-off-by: Martynas Pumputis <m@lambda.lt>
@brb
Copy link
Member Author

brb commented Nov 6, 2023

/test

@brb
Copy link
Member Author

brb commented Nov 6, 2023

/test

@brb brb marked this pull request as ready for review November 6, 2023 18:44
@brb brb requested review from a team as code owners November 6, 2023 18:44
pchaigno pushed a commit to cilium/cilium-cli that referenced this pull request Nov 6, 2023
It's going to be enabled on Cilium >= 1.15 [1].

[1]: cilium/cilium#29000

Signed-off-by: Martynas Pumputis <m@lambda.lt>
To include the encryption suite changes [1] [2]

[1]: cilium/cilium-cli#2055
[2]: cilium/cilium-cli#2089

Signed-off-by: Martynas Pumputis <m@lambda.lt>
Previously, the strict encrypt check [1] was running in bpf_overlay (in
addition to bpf_host). That particular check was assuming that no
pod-to-pod unencrypted packet should be seen by bpf_overlay.

However, after the previous commit it's no longer the case. So, remove
the check, and only keep the one in bpf_host.

A nice side-effect of the previous commit is that for WG+tunnel we
automatically enforce the strict mode w/o relying on strict_allow().
I.e., any tunnel encaped traffic is going to be dropped until
cilium-agent has propogated destination node's IP addr into
WG's allowed-ips list for that node.

This commit also drops the WG strict mode test case for tunneling, as
the test configuration is no longer applicable, and the test is going to
be migrated to the CLI connectivity suite.

[1]: #21856

Signed-off-by: Martynas Pumputis <m@lambda.lt>
@brb
Copy link
Member Author

brb commented Nov 7, 2023

/test

@aanm aanm merged commit 81c45d2 into main Nov 7, 2023
220 checks passed
@aanm aanm deleted the pr/brb/wg-tunnel branch November 7, 2023 10:09
@maintainer-s-little-helper maintainer-s-little-helper bot removed ready-to-merge This PR has passed all tests and received consensus from code owners to merge. labels Nov 7, 2023
3u13r added a commit to edgelesssys/cilium that referenced this pull request Jan 18, 2024
Since cilium#29000 packets are always encapsulated before they are encrypted with WireGuard. Therefore, we also need to take the tunnel overhead for the route MTU into account.

This fixes a performance regression. Before this commit WireGuard encrypted pod-to-pod traffic  the iperf3 bandwidth was ~102 Mbits/sec. With this patch the bandwidth increases to 656 Mbits/sec. Without encryption the bandwidth is ~2 Gbits/sec.

Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
3u13r added a commit to edgelesssys/cilium that referenced this pull request Jan 18, 2024
Since cilium#29000 packets are always encapsulated before they are encrypted with WireGuard.
Therefore, we also need to take the tunnel overhead for the route MTU into account.

This fixes a performance regression. Before this commit WireGuard encrypted
pod-to-pod traffic the iperf3 bandwidth was ~102 Mbits/sec. With this patch
the bandwidth increases to 656 Mbits/sec. Without encryption the bandwidth
is ~2 Gbits/sec.

Fixes: b67291f
Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
3u13r added a commit to edgelesssys/cilium that referenced this pull request Jan 18, 2024
Since cilium#29000 packets are always encapsulated before they are encrypted with WireGuard.
Therefore, we also need to take the tunnel overhead for the route MTU into account.

This fixes a performance regression. Before this commit WireGuard encrypted
pod-to-pod traffic the iperf3 bandwidth was ~102 Mbits/sec. With this patch
the bandwidth increases to 656 Mbits/sec. Without encryption the bandwidth
is ~2 Gbits/sec.

Fixes: b67291f
Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
3u13r added a commit to edgelesssys/cilium that referenced this pull request Jan 23, 2024
Since cilium#29000 packets are always encapsulated before they are encrypted with WireGuard.
Therefore, we also need to take the tunnel overhead for the route MTU into account.

This fixes a performance regression. Before this commit WireGuard encrypted
pod-to-pod traffic the iperf3 bandwidth was ~102 Mbits/sec. With this patch
the bandwidth increases to 656 Mbits/sec. Without encryption the bandwidth
is ~2 Gbits/sec.

Fixes: b67291f
Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
burgerdev pushed a commit to edgelesssys/cilium that referenced this pull request Jan 24, 2024
Since cilium#29000 packets are always encapsulated before they are encrypted with WireGuard.
Therefore, we also need to take the tunnel overhead for the route MTU into account.

This fixes a performance regression. Before this commit WireGuard encrypted
pod-to-pod traffic the iperf3 bandwidth was ~102 Mbits/sec. With this patch
the bandwidth increases to 656 Mbits/sec. Without encryption the bandwidth
is ~2 Gbits/sec.

Fixes: b67291f
Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
burgerdev pushed a commit to edgelesssys/cilium that referenced this pull request Jan 24, 2024
Since cilium#29000 packets are always encapsulated before they are encrypted with WireGuard.
Therefore, we also need to take the tunnel overhead for the route MTU into account.

This fixes a performance regression. Before this commit WireGuard encrypted
pod-to-pod traffic the iperf3 bandwidth was ~102 Mbits/sec. With this patch
the bandwidth increases to 656 Mbits/sec. Without encryption the bandwidth
is ~2 Gbits/sec.

Fixes: b67291f
Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
burgerdev pushed a commit to edgelesssys/cilium that referenced this pull request Jan 24, 2024
Since cilium#29000 packets are always encapsulated before they are encrypted with WireGuard.
Therefore, we also need to take the tunnel overhead for the route MTU into account.

This fixes a performance regression. Before this commit WireGuard encrypted
pod-to-pod traffic the iperf3 bandwidth was ~102 Mbits/sec. With this patch
the bandwidth increases to 656 Mbits/sec. Without encryption the bandwidth
is ~2 Gbits/sec.

Fixes: b67291f
Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
github-merge-queue bot pushed a commit that referenced this pull request Jan 30, 2024
Since #29000 packets are always encapsulated before they are encrypted with WireGuard.
Therefore, we also need to take the tunnel overhead for the route MTU into account.

This fixes a performance regression. Before this commit WireGuard encrypted
pod-to-pod traffic the iperf3 bandwidth was ~102 Mbits/sec. With this patch
the bandwidth increases to 656 Mbits/sec. Without encryption the bandwidth
is ~2 Gbits/sec.

Fixes: b67291f
Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
joamaki pushed a commit that referenced this pull request Jan 30, 2024
[ upstream commit 44c3dd0 ]

Since #29000 packets are always encapsulated before they are encrypted with WireGuard.
Therefore, we also need to take the tunnel overhead for the route MTU into account.

This fixes a performance regression. Before this commit WireGuard encrypted
pod-to-pod traffic the iperf3 bandwidth was ~102 Mbits/sec. With this patch
the bandwidth increases to 656 Mbits/sec. Without encryption the bandwidth
is ~2 Gbits/sec.

Fixes: b67291f
Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
Signed-off-by: Jussi Maki <jussi@isovalent.com>
aanm pushed a commit that referenced this pull request Jan 31, 2024
[ upstream commit 44c3dd0 ]

Since #29000 packets are always encapsulated before they are encrypted with WireGuard.
Therefore, we also need to take the tunnel overhead for the route MTU into account.

This fixes a performance regression. Before this commit WireGuard encrypted
pod-to-pod traffic the iperf3 bandwidth was ~102 Mbits/sec. With this patch
the bandwidth increases to 656 Mbits/sec. Without encryption the bandwidth
is ~2 Gbits/sec.

Fixes: b67291f
Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
Signed-off-by: Jussi Maki <jussi@isovalent.com>
joamaki pushed a commit that referenced this pull request Jan 31, 2024
[ upstream commit 44c3dd0 ]

Since #29000 packets are always encapsulated before they are encrypted with WireGuard.
Therefore, we also need to take the tunnel overhead for the route MTU into account.

This fixes a performance regression. Before this commit WireGuard encrypted
pod-to-pod traffic the iperf3 bandwidth was ~102 Mbits/sec. With this patch
the bandwidth increases to 656 Mbits/sec. Without encryption the bandwidth
is ~2 Gbits/sec.

Fixes: b67291f
Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
Signed-off-by: Jussi Maki <jussi@isovalent.com>
joamaki pushed a commit that referenced this pull request Jan 31, 2024
[ upstream commit 44c3dd0 ]

Since #29000 packets are always encapsulated before they are encrypted with WireGuard.
Therefore, we also need to take the tunnel overhead for the route MTU into account.

This fixes a performance regression. Before this commit WireGuard encrypted
pod-to-pod traffic the iperf3 bandwidth was ~102 Mbits/sec. With this patch
the bandwidth increases to 656 Mbits/sec. Without encryption the bandwidth
is ~2 Gbits/sec.

Fixes: b67291f
Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
Signed-off-by: Jussi Maki <jussi@isovalent.com>
joamaki pushed a commit that referenced this pull request Feb 7, 2024
[ upstream commit 44c3dd0 ]

Since #29000 packets are always encapsulated before they are encrypted with WireGuard.
Therefore, we also need to take the tunnel overhead for the route MTU into account.

This fixes a performance regression. Before this commit WireGuard encrypted
pod-to-pod traffic the iperf3 bandwidth was ~102 Mbits/sec. With this patch
the bandwidth increases to 656 Mbits/sec. Without encryption the bandwidth
is ~2 Gbits/sec.

Fixes: b67291f
Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
Signed-off-by: Jussi Maki <jussi@isovalent.com>
@julianwiedmann julianwiedmann added the feature/wireguard Relates to Cilium's Wireguard feature label Mar 1, 2024
julianwiedmann added a commit to julianwiedmann/cilium that referenced this pull request Mar 1, 2024
cilium#29000 changed how we mix WireGuard
with VXLAN / Geneve tunneling. Reflect this in the docs.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
github-merge-queue bot pushed a commit that referenced this pull request Mar 4, 2024
#29000 changed how we mix WireGuard
with VXLAN / Geneve tunneling. Reflect this in the docs.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
pippolo84 pushed a commit to pippolo84/cilium that referenced this pull request Mar 5, 2024
[ upstream commit f604ce2 ]

cilium#29000 changed how we mix WireGuard
with VXLAN / Geneve tunneling. Reflect this in the docs.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
@julianwiedmann
Copy link
Member

Adding backport-label to account for #28917.

@julianwiedmann julianwiedmann added the backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. label Mar 6, 2024
jrajahalme pushed a commit that referenced this pull request Mar 11, 2024
[ upstream commit f604ce2 ]

#29000 changed how we mix WireGuard
with VXLAN / Geneve tunneling. Reflect this in the docs.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/encryption Impacts encryption support such as IPSec, WireGuard, or kTLS. backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. feature/wireguard Relates to Cilium's Wireguard feature kind/enhancement This would improve or streamline existing functionality. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants