feat(srv6): SRv6-native NAT-less (DSR) ClusterIP services#10
Open
ryskn wants to merge 1 commit into
Open
Conversation
Owner
Author
|
Follow-up for F-DSR-2 (pod-backed endpoint detection / cnat fallback for host-network services) tracked in ryskn/vpp-dataplane-research#32. |
Replace cnat DNAT/un-DNAT with Direct Server Return for pod-backed ClusterIP services in the SRv6 data path. Traffic keeps dst=VIP end to end; backend pods accept the VIP on lo and reply from it, so no reverse translation is needed and the cross-node SRv6 un-DNAT failure disappears. Source IP is preserved (no SNAT). - config: SRv6NativeServicesEnabled feature gate + vppSRv6Native annotation - services: classify eligible ClusterIP services (gate + annotation + ClusterIP + port==targetPort), skip cnat, publish DSRService events, reconcile-based diff/withdraw - connectivity/SRv6: per-service ECMP SR policy over backend nodes' End.DT6 SIDs + steering; decap into PodVRF via sw_if_index; reconcile with retain-on-failure retry and periodic re-reconcile - cni: bind VIP on local backend pods (lo) + uRPF allow + PodVRF ECMP delivery route; per-pod cleanup tracking; reconcile on pod add/del Experimental; requires SRv6Enabled. Other services (NodePort/External, port-remapped, host-network backed) keep the cnat path. Signed-off-by: Ryosuke Nakayama <ryosuke.nakayama@ryskn.com>
21328a5 to
5fdf983
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Experimental SRv6-native data path for pod-backed ClusterIP services that replaces cnat DNAT/un-DNAT with Direct Server Return (DSR).
With SRv6 as the pod transport, the cnat-based service path does not compose: on a cross-node pod-backed ClusterIP the reverse cnat session lives in fib 0 and the cnat input arc never runs on the SRv6-decapped inner packet, so the reply is never un-DNAT'd (SYN-ACK keeps the backend pod IP → client RST). Instead of patching cnat×SRv6, this steers the VIP over SRv6 and lets the backend accept the VIP directly (DSR): the inner packet keeps dst=VIP end to end, the backend replies with src=VIP, so no reverse translation is needed and the failure class disappears. Source IP is preserved (no SNAT).
How it works
srv6NativeServicesEnabled+ per-service annotationcni.projectcalico.org/vppSRv6Native: "true". Eligible = ClusterIP type, all portsport==targetPort, no ExternalIP/LB. Everything else keeps the cnat path.DSRServiceevents; reconcile-based diff/withdraw.Verification
End-to-end on an IPv6 single-stack cluster: cross-node client → annotated ClusterIP reaches the backend with no cnat translation, no RST, and the client source IP preserved;
vppctl traceshows SRv6 decap → delivery with no cnat-output session lookup.Security review (spec-anchored)
Addressed here:
Follow-up (separate): pod-backed endpoint detection so a mis-annotated host-network service falls back to cnat instead of silently breaking.
Scope / future work
First cut: pod-backed ClusterIP,
port==targetPortonly. Future: port remapping (stateless L4), host-network/NodePort/External, per-pod End.DX6 service SIDs (RFC 9256 single-tier weighted LB), and making DSR the default when SRv6 is enabled.