Skip to content
LinkState
Go back

Distributed Gateway or Central Firewall First

Design Review: Distributed Gateways and Stateful Inspection in EVPN Fabrics with Asymmetric Host‑to‑Host Paths

Author: Nadia Kareem – Routing Architect & Control‑Plane Specialist


Introduction to EVPN Fabrics

Overview of EVPN Technology

Ethernet VPN (EVPN) (RFC 7432) carries MAC/IP reachability and Ethernet segment information over BGP. Key NLRI types:

NLRI TypePurposeKey Fields
Type‑1 (Ethernet Segment)ESI for multi‑homingESI, Ethernet Tag, MPLS label
Type‑2 (MAC/IP Advertisement)Host MAC/IP binding to an ESIMAC, IP (optional), Ethernet Tag, MPLS label
Type‑3 (Inclusive Multicast Ethernet Tag)BUM traffic distributionEthernet Tag, IP‑multicast group
Type‑4 (Ethernet Segment)ES‑to‑ES reachability for DF electionESI, Ethernet Tag, MPLS label
Type‑5 (IP Prefix)IP prefix reachability (inter‑subnet routing)IP prefix, Ethernet Tag, Gateway IP, MPLS label
Type‑6 (Multicast)PIM‑based multicast (optional)

EVPN uses BGP for route distribution; data‑plane encapsulation can be VXLAN, MPLS, or SR‑v6.

Benefits of EVPN Fabrics


Distributed Gateway Requirements

Gateway Functionality in EVPN Fabrics

A distributed (anycast) gateway provides Layer 3 routing between VNIs or VLAN‑based VRFs. Each leaf runs an IRB interface with the same anycast IP and MAC. Packet flow:

  1. Host ARP/ND for the gateway IP.
  2. Any leaf owning the anycast MAC replies.
  3. Packet is encapsulated (VXLAN) toward the replying leaf (ingress).
  4. Ingress leaf performs a VRF lookup, determines egress VNI/VLAN, and forwards to the egress leaf that owns the destination host’s MAC/IP (learned via EVPN Type‑2).

Thus, split across planes:

Stateful Inspection and Distributed Gateways

Stateful functions (firewall, NAT) require per‑flow state. In a distributed model the state must be present on the leaf that first sees the packet or be synchronized to the leaf that will see the return traffic.

Asymmetric Host‑to‑Host Paths in EVPN Fabrics

Asymmetry is normal when:

Consequently, forward path may be Leaf A → Spine X → Leaf B while reverse path is Leaf C → Spine Y → Leaf A. Unsynchronized stateful functions see only one direction, causing drops or NAT mis‑bindings.


NAT and Firewall State Placement

Placement Options

PlacementDescriptionProsCons
Centralized (stateful service chain)All traffic redirected to a dedicated firewall/NAT cluster (VRF‑import/export, SGT‑based insertion, inline service nodes). State resides only on the cluster.Simpler state management; single troubleshooting point; independent scaling of cluster.Requires traffic steering (adds latency, possible hair‑pinning); creates bottleneck/failure domain; asymmetric paths complicate steering.
Distributed (leaf‑resident)Each leaf runs its own NAT/firewall instance, maintaining state for flows that ingress/egress that leaf; state may be replicated via sync protocol.No service‑chain hair‑pin; processing at ingress/egress; better scalability with leaf count.State synchronization complexity; split‑brain risk if sync fails; increased per‑leaf resource consumption (memory, TCAM).
HybridStateless NAT (deterministic source‑NAT using IP+port hash) + distributed stateless ACLs; stateful inspection centralized.Eliminates per‑flow state on leaves; retains deep inspection where needed.Deterministic NAT limits overlapping address spaces; still requires steering for inspection.

Impact of Asymmetric Paths

Comparison of State Placement Approaches

CriterionCentralized NAT/FWDistributed NAT/FWHybrid (Stateless NAT + Centralized Inspection)
State synchronization neededNo (state only in cluster)Yes (inter‑leaf sync)No for NAT; yes for inspection if asymmetric
Impact of asymmetric pathsRequires symmetric steering or flow‑affinityRequires state mirroring or flow affinity to same leafNAT unaffected; inspection needs symmetric steering
Failure domainService cluster failure = total lossLeaf failure = loss of state for flows anchored there (mitigated by sync)Inspection cluster failure = loss of deep inspection; NAT remains
Scalability (leaf count)Limited by cluster throughput & uplink bandwidthScales with leaf count (state per leaf) but limited by sync bandwidthScales similarly to distributed for NAT; inspection limited as centralized
Operational complexityLow (single point of config)Higher (sync protocols, conflict resolution)Medium (stateless NAT config + inspection steering)
Typical use‑caseSmall‑to‑medium fabrics, strict compliance, centralized loggingLarge‑scale fabrics, low latency, tenant‑isolated servicesEnvironments needing address translation but can offload deep inspection to a service chain

Design Considerations for Distributed Gateways

Gateway Deployment Models

  1. Anycast IRB (Symmetric) – Each leaf configures the same anycast gateway IP/MAC. Hosts ARP to the nearest leaf (underlay ECMP). Forward/reverse paths may differ, but gateway function is identical on all leaves.
  2. Optimized IRB (Asymmetric) – Leaf advertises a distinct gateway IP per VRF (or per ESI) while still advertising the anycast MAC for L2 forwarding. Ingress leaf chosen by source host; egress leaf selected by destination location (often reduces tromboning).
  3. Centralized GW – A pair of spine/super‑spine nodes hosts the IRB; leaves perform only L2 bridging. Eliminates per‑leaf routing tables but introduces hair‑pin for all inter‑subnet traffic.

For stateful services, anycast IRB is most common because it keeps the gateway function locally available, though it amplifies asymmetry. Optimized IRB can reduce asymmetry if the fabric ensures the same leaf is chosen for both directions (e.g., source‑and‑destination hash symmetry in the underlay).

State Synchronization and Consistency

Scalability and Performance Considerations


Troubleshooting Distributed Gateway Issues

Common Issues

SymptomLikely Root CauseControl‑Plane Trace
Host ARP resolves to anycast MAC but traffic dropped after first hopLeaf lacks local route for destination VNI (missing EVPN Type‑5) or VRF not imported1. Host sends ARP → Leaf replies with anycast MAC (control‑plane: EVPN Type‑2 host route). 2. Data‑plane: packet encapsulated, VXLAN lookup fails → drop.
Asymmetric flow: forward works, reverse droppedStateful firewall/NAT state only present on ingress leaf; return path hits different leaf without stateVerify state sync between leaves; check for asymmetric ECMP hash causing different egress leaf.
Spurious NAT translations (e.g., source address changed incorrectly)Duplicate NAT allocations due to lack of deterministic allocation or owner electionReview NAT algorithm; ensure deterministic hash or owner election is configured.
High latency on inter‑subnet trafficTraffic hair‑pinning via centralized service chain or suboptimal IRB choiceExamine routing tables; confirm anycast IRB vs. optimized IRB; check service‑chain steering policies.

End of review.


Share this post on:

Previous Post
SYN seen, SYN-ACK missing, root cause still unclear
Next Post
ECMP hash polarization or true loss