Skip to content

test(edge): Prove remote gateway VIP delivery to provider pods - #1515

Merged
privateip merged 5 commits into
mainfrom
fix/issue-1507
Nov 28, 2026
Merged

privateip merged 5 commits into
mainfrom
fix/issue-1507

Conversation

@privateip

Copy link
Copy Markdown
Contributor

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

  • Lab: every flow through the other gateway answered over both protocols and families, with the client's real address seen by the backend
  • Lab: every flow to a backend on the receiving gateway's node dropped by that gateway, as recorded in the design
  • The lab's gateway ingress check passes before and after the test, and the test leaves nothing behind; its single-flow losses during the session are Lab cross-site checks occasionally lose one probe and pass on rerun #1483
  • Lint, build, unit tests and docs checks pass

Fixes #1507

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
@privateip privateip self-assigned this Nov 28, 2026
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.
@privateip privateip changed the title test(edge): Prove provider pods can serve a gateway VIP test(edge): Prove remote gateway VIP delivery to provider pods Nov 28, 2026
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.
@privateip
privateip marked this pull request as ready for review November 28, 2026 15:18
@privateip
privateip requested a review from a team as a code owner November 28, 2026 15:18
@privateip
privateip enabled auto-merge November 28, 2026 15:18
@privateip

Copy link
Copy Markdown
Contributor Author

Review record for 3e7685c.

First pass on 488f433:

  • Adversarial review: merge. It re-ran the echo tests under the race detector and vetted both packages. It could not reach the lab, so it asked for the lab result to be confirmed.
  • Conventions review: hold, only on merge order with feat(edge): Add public listeners for Edge providers #1514, which edits the same design file. Two nits followed: the README wrap and the title.

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. task verify:edge-listener ran on head 488f433 under the shared lab reservation, with a clean tree:

  • Delivery through the other gateway answered 8 of 8 UDP and TCP flows for each family.
  • Delivery to a backend on the receiving gateway's node answered 0 of 8, and that gateway dropped each packet as fib_unreachable.
  • Teardown left nothing behind, and the lab's gateway ingress check passed before and after.

Since then, the branch changed only the README wrap and a lint fix in the echo unit test.

Second pass on 3e7685c:

  • Re-review: merge. Both nits were fixed, and the lint fix broke nothing (lint reported 0 issues and the tests passed).
  • Conventions review: hold, on the same merge-order question, which is now decided. It also suggested a second title rewording, which the author declined.

@scotwells scotwells left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@privateip
privateip merged commit 698c2a7 into main Nov 28, 2026
28 checks passed
@privateip
privateip deleted the fix/issue-1507 branch November 28, 2026 15:25

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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: request fails on any reply that is not listener-proof/... probe, the connected socat only accepts a reply from the VIP, and eventually is used only for the first flow per protocol. The rulePackets check (after <= before fails) 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 Echo fail 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_unreachable rose, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prove edge attachments as gateway backends

3 participants