Skip to content

Integrate NAT66 and NAT64 with Local and Fabric shard delivery #1437

Open

Description

@privateip

Parent: Deliver Galactic Worker with Local and Fabric delivery for tenant services

Deliverable

Ordered and hashed NAT66 and NAT64 egress selects a ready colocated shard through Local and keeps remote shard delivery through Fabric. It satisfies the NAT part of the "Deliver service consumers" phase exit.

Today ShardCandidate.Local in internal/plumbing/ebpf/egressroutemap/shardgroup.go excludes a node's own shard: it is never alive for tenants on that node. This Task replaces that exclusion with readiness-gated local selection.

References:

  • Selection: ShardGroupTable.Apply, GroupPolicy, TranslationClass and NAT64Class.
  • Node driver: internal/installer/egressgroup.go (egressShardCandidates, spec.drain, spec.nat64Standby).
  • Datapath: internal/plumbing/ebpf/natprog/nat.c (nat_ingress, nat66_*, nat64_*, nat_conn_table) and internal/plumbing/ebpf/natmap/conntable.go.
  • Service: cmd/galactic-nat/nat.go (setupNatDatapath).

Work items

  • Add shard destination resolution to Worker. Implement Worker reconciliation and its authenticated service API #1433 ships the shard destination kind as Resolved=False/DestinationKindUnsupported; this Task replaces that with resolution from NAT's trusted shard identity and locator, and documents the source in docs/worker/contract.md.
  • Make initial selection and refresh respect local readiness, class eligibility, drain, pins and standby.
  • Carry tenant identity from TAP ingress across the internal receive pair. Use one shard-owned session table at both the internal and the public XDP entries.
  • Return using the saved backend SID and physical locator. Route public masquerade addresses to their owning shard. Keep the shard locator distinct from the tenant-router locator.
  • Limit a pair failure to the affected eligibility, and document which established sessions survive it.
  • Expose NAT's Worker capability state and failure reasons through existing NAT diagnostics and go.miloapis.com/instrumentation metrics.

Dependencies

Blocked by #1434, #1435 and #1436. Runs in parallel with #1438, #1439 and #1440.

Acceptance

Run in the #1432 topology with one local and one remote shard path:

  • Both translations work for TCP, UDP and supported ICMP, with overlapping guest addresses and ports. Each guest sees the right external source and reverse delivery, including NAT64 IPv4 replies.
  • After the pair is recreated, NAT restarts and a shard drains, pins hold and state is reused as the contract says, and captures show no underlay hairpin.
  • task test:unit covers the selection changes, and the lab checks verify:nat-sharding, verify:nat-egress and verify:nat-return-route still pass.
  • The delivering PR targets integration/galactic-worker, carries this evidence and says Fixes datum-cloud/galactic#1437. GitHub does not auto-close from a non-default base, so close this issue explicitly when the PR merges and record the PR and merged SHA.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions