Repository navigation
test(edge): Prove remote gateway VIP delivery to provider pods - #1515
Conversation
The reference provider answered only UDP on its pod VRF socket. A listener backend has to serve TCP as well, and the Phase 0 listener proof needs a TCP socket in the pod VRF to test it. Echo now listens on TCP on the same address and port, bound to the pod VRF the same way, so it still needs no privilege. Each read on a connection is answered with the identity and the bytes read, as UDP datagrams are. Closing the server ends open connections.
Phase 0 of the Edge public listener design asks whether the gateway can deliver a VIP to a provider's SocketAccess attachment and whether replies leave with the VIP as their source. Nothing tested that path. TestListenerBackend, run by task verify:edge-listener, wires one backend by hand with no controller change: a dedicated ingress VPC, a stand-in VPCAttachment naming the edge attachment's address, the attachment's /128 BGPAdvertisement with its VRF ID and End.DT46, and one gateway-namespace NetworkService per protocol. It pins the VIP on the transit router to each dfw gateway in turn and sends UDP and TCP over both families from the off-fabric host. Remote delivery must pass, including the client address the backend sees. Local delivery, where the receiving gateway holds the backend, is recorded with the gateway's drop counters rather than asserted. Teardown waits for router GC to release the ingress VPC's node state.
The lab proof answered the two questions the design left to Phase 0. Remote delivery works for UDP and TCP over IPv6 and IPv4, and the existing host link registration already applies the VIP reply translation, so Phase 3 needs no reply-translation work. Local delivery fails: the gateway drops every packet for a backend on its own node as fib_unreachable. The LocalBackendsExcluded exclusion therefore stays until the gateway gains a local-delivery branch. Fixes: #1507
The Phase 0 edits lengthened two paragraphs of the reference provider README past the file's 80-column wrap. Re-wrap them. The wording is unchanged.
The provider module's lint refuses context-free net.Listen and net.Dial and unchecked Close errors. Use a ListenConfig and a Dialer with a context, and discard the deferred Close errors explicitly.
|
Review record for 3e7685c. First pass on 488f433:
The author decided that this PR lands first. #1514 then rebases and keeps both edits to the design's status line. The author confirmed the lab result.
Since then, the branch changed only the README wrap and a lint fix in the echo unit test. Second pass on 3e7685c:
|
scotwells
left a comment
There was a problem hiding this comment.
This runs the Phase 0 lab proof for the public listener design and records the results. Through a second gateway, UDP and TCP reach a provider pod socket over IPv6 and IPv4, and replies come back from the public address, so no reply-translation work is needed. A backend on the receiving gateway's own node drops every flow, so the design now treats excluding those backends as required. The example provider gains a TCP echo for the test. No API or production behavior changes, and all checks pass.
ecv
left a comment
There was a problem hiding this comment.
Approve.
The test asserts delivery and replies, not setup: each flow must return the provider's echo through the VIP, the backend must see the client's real address, and the pinned gateway's rule-packet counter must rise, so it cannot pass on another node's traffic. CI only compiles, lints and unit-tests the echo change; the lab test itself is not in any check and ran by hand (author's record: 8/8 flows per protocol and family remote, 0/8 local on head 488f433).
- Delivery is not vacuous:
requestfails on any reply that is notlistener-proof/... probe, the connected socat only accepts a reply from the VIP, andeventuallyis used only for the first flow per protocol. TherulePacketscheck (after <= beforefails) proves the gateway under test served the VIP. - The local-delivery case only records its outcome and never fails. The design now says "local delivery fails, so the exclusion is required", but nothing in the repo notices if that stops being true or if the drop reason changes from
fib_unreachable. - Design edits are consistent with #1514 apart from the status line, which both PRs rewrite (this one says nothing else is implemented, #1514 says the API is). Whichever lands second must keep both statements; the PR record already says #1514 rebases.
- The TCP listener makes
Echofail as a whole if the TCP bind fails, where it used to be UDP-only. The other conformance tests that deploy the example provider now depend on the TCP bind too; acceptable, but note it if a conformance run turns red on a port clash.
Follow-ups:
- Assert the local-delivery drop (counter
fib_unreachablerose, no flow answered) so the design's exclusion stays tied to a check, and a gateway local-delivery change flips the test on purpose. - Add the health-check case (a stand-in with
hostInterface) when phase 4 lands, as the design's limits section says.
Summary
The Edge public listener design needs proof that the gateway can deliver internet traffic to a provider's pod socket and send replies from the public address. A new lab test wires one provider backend by hand and sends UDP and TCP to it over IPv6 and IPv4.
Delivery through another gateway works, including the reply path, so the design needs no new reply translation. Delivery from a gateway to a backend on its own node fails, so the design keeps excluding those backends.
Test plan
Fixes #1507