Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_int-load-balancer-l4

Layer 4 Load Balancer (Maglev / NLB) Internals (ECMP, Maglev Hash & DSR)

7 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Layer 4 Load Balancer (Maglev / NLB) Internals (ECMP, Maglev Hash & DSR) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_int-load-balancer-l4/opengraph-image)](https://archos.sageideas.dev/d/dgm_int-load-balancer-l4)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_int-load-balancer-l4)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_int-load-balancer-l4" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Layer 4 Load Balancer (Maglev / NLB) Internals (ECMP, Maglev Hash & DSR) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["TCP/UDP Packets"]
  bgp_1["BGP ECMP Routers"]
  mag_2[("L4 Maglev / XDP Node")]
  con_3[("Connection Track Table")]
  be_4["L7 Proxy / App Fleet"]
  dsr_5["Direct Server Return"]
  downstream_6["Downstream & OTel"]
  client_0 -->|"1. Anycast · BGP/ECMP"| bgp_1
  bgp_1 -->|"2. ECMP hash · IP"| mag_2
  mag_2 -->|"3a. Lookup · eBPF Map"| con_3
  mag_2 -->|"3b. Encap · L4 Tunne"| be_4
  dsr_5 -->|"Direct · DSR"| be_4
  be_4 -.->|"4. Emit / · OTLP/API"| downstream_6

COMPONENT STACK (7)

  • TCP/UDP PacketsSTATELESS
    10M+ PPS Anycast VIP
  • BGP ECMP RoutersSTATELESS
    Equal-cost multipath to L4 fleet
  • L4 Maglev / XDP NodeSTATEFUL
    eBPF/DPDK 5-tuple consistent hash
  • Connection Track TableSTATEFUL
    Preserves flows across rehashes
  • L7 Proxy / App FleetSTATELESS
    Decapsulates GRE/Geneve packet
  • Direct Server ReturnSTATELESS
    Replies bypass L4 straight to NIC
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. TCP/UDP Packets → BGP ECMP Routers (Anycast)[BGP/ECMP]
  2. BGP ECMP Routers → L4 Maglev / XDP Node (ECMP hash)[IP]
  3. L4 Maglev / XDP Node → Connection Track Table (Lookup)[eBPF Map]
  4. L4 Maglev / XDP Node → L7 Proxy / App Fleet (Encap)[L4 Tunne]
  5. Direct Server Return → L7 Proxy / App Fleet (Direct)[DSR]
  6. L7 Proxy / App Fleet → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →