How to Build a Leaf-Spine Network Architecture — Complete Guide (2026)

Step-by-step guide to designing and building a leaf-spine network from scratch — hardware selection, cabling, BGP underlay routing, and EVPN/VXLAN overlay configuration.

Topics: Leaf-Spine, Data Center Networking, BGP, EVPN, VXLAN, Network Design

What Is a Leaf-Spine Architecture?

Leaf-spine is a two-tier, non-blocking network fabric built for east-west traffic — server-to-server communication that dominates modern virtualized, containerized, and cloud-native environments.

The two layers:

  • Leaf switches sit at the edge, connecting servers, storage, and endpoints
  • Spine switches sit in the middle, connecting only to leaf switches — never to each other

The defining rule: every leaf connects to every spine. Any leaf can reach any other leaf in exactly two hops — leaf to spine to leaf. Traffic is load-balanced via ECMP across all spine links simultaneously.

This is why leaf-spine replaced the traditional three-tier model (access, distribution, core) for data center use. In a three-tier design, east-west traffic between two servers on different access switches had to travel up to the distribution tier and back down. In a leaf-spine fabric, it takes exactly two hops regardless of which racks the servers are in.

Step 1 — Size Your Fabric

Before selecting hardware, answer three questions:

How many servers? Each leaf typically has 48 downlink ports. Plan for 20 to 30 percent growth in your initial design.

What speed do your servers need?

  • 10G NICs → 10G leaf downlinks (SFP+)
  • 25G NICs → 25G leaf downlinks (SFP28)
  • 100G NICs → 100G leaf downlinks (QSFP28)

What oversubscription ratio is acceptable? Formula: total downlink bandwidth divided by total uplink bandwidth to spine.

A 48x10G leaf with 6x40G uplinks: 480G downlink / 240G uplink = 2:1 oversubscription. For most enterprise workloads, 3:1 to 4:1 is acceptable. For storage replication and AI training, target 2:1 or below.

Step 2 — Select Your Spine Switches

Spine switches do one thing: forward traffic between leaves at line rate with minimal latency.

Key selection criteria:

  • Port count must accommodate one port per leaf switch, times two (always deploy two spines minimum)
  • Speed must match or exceed leaf uplink speed
  • Latency: target sub-1 microsecond cut-through forwarding
  • Buffer depth: shallow for HFT/HPC, deep for mixed storage and compute

Recommended spine platforms:

EnvironmentSwitchPortsSpeed
SMB / mid-marketArista 7050QX-32S3240G
EnterpriseCisco Nexus 9332PQ3240G
Modern cloud-nativeArista 7050CX3-32S32100G
AI/ML optimizedNVIDIA SN270032100G

Step 3 — Select Your Leaf Switches

Leaf switches connect directly to servers, storage, firewalls, and load balancers.

Standard leaf configuration:

  • 48 downlink ports matching server NIC speed (SFP+, SFP28, or QSFP28)
  • 6 to 8 uplink ports to spine at higher speed (QSFP+ or QSFP28)
  • 1RU form factor

Recommended leaf platforms:

Server SpeedLeaf SwitchNotes
10GCisco Nexus 93180YC-FX48x10G SFP+ + 6x100G QSFP28
25GArista 7050CX3-48YC1248x25G SFP28 + 12x100G QSFP28
25GJuniper QFX5100-48S48x10G + 6x40G QSFP+

Step 4 — Select Transceivers and Cables

Leaf-to-spine uplinks:

  • Same cabinet row → QSFP+ or QSFP28 DAC passive (cheapest, lowest latency)
  • Cross-row under 30m → QSFP+ or QSFP28 AOC
  • Longer runs → QSFP+ SR4 or QSFP28 SR4 over OM4 fiber

Leaf-to-server downlinks:

  • Same cabinet → SFP+ or SFP28 DAC passive
  • Cross-cabinet → SFP+ SR or SFP28 SR over OM4 fiber

Structured cabling:

  • SFP+/SFP28 fiber connections → LC/LC OM4 duplex patch cables
  • SR4 transceivers → MPO-12 OM4 trunk cables

Step 5 — Design IP Addressing

Leaf-spine uses Layer 3 routing at the leaf. Each leaf is a Layer 3 boundary:

  • Spine-to-leaf links: /31 point-to-point subnets (e.g. 10.0.0.0/31 per link pair)
  • Leaf loopbacks: /32 per device (e.g. 10.255.0.1/32 per leaf)
  • Server subnets: /24 or /25 per leaf
  • Spine loopbacks: /32 per spine

Step 6 — Configure BGP Underlay

BGP is the routing protocol of choice for leaf-spine. It is vendor-neutral, scales to thousands of nodes, and provides fine-grained path control.

eBGP model (recommended):

  • Each leaf has a unique AS number
  • All spines share one AS number (or each spine has its own)
  • Each leaf peers eBGP with every spine over point-to-point /31 links
  • Leaves advertise loopbacks and server subnets
  • Spines advertise loopbacks only
  • ECMP is automatic — every path to a destination has equal cost

Example AS scheme:

  • Spine 1: AS 65000, Spine 2: AS 65001
  • Leaf 1: AS 65100, Leaf 2: AS 65101, and so on

Step 7 — Deploy EVPN/VXLAN Overlay (Optional)

Pure Layer 3 fabric works for native-IP workloads. For environments needing Layer 2 extension (VMotion, clustered applications, legacy systems), add VXLAN with an EVPN control plane.

Key concepts:

  • VTEP (VXLAN Tunnel Endpoint) — one per leaf, hosted on the loopback interface
  • VNI (VXLAN Network Identifier) — maps to a VLAN (L2) or VRF (L3)
  • Anycast Gateway — all leaves share the same virtual gateway IP/MAC, eliminating first-hop routing latency

EVPN/VXLAN configuration syntax differs between NX-OS, EOS, Junos, and AOS-CX — the RFC behavior is consistent but the CLI is not. Plan your NOS choice before starting configuration.

Step 8 — Physical Cabling Best Practices

  1. Label every cable on both ends before installing
  2. Use color coding by spine — blue for spine 1, green for spine 2
  3. Document the topology in a DCIM tool before you start cabling
  4. Install horizontal cable managers between every switch pair in the rack
  5. Verify with LLDP after cabling — show lldp neighbors on every switch

Common Mistakes to Avoid

Connecting spines to each other: Spines connect only to leaves. Spine-to-spine links violate the design and create forwarding loops.

Under-sizing spine port count: Every leaf must connect to every spine. Plan spine port count for your 3-year growth projection.

Mixing OM3 and OM4 in SR4 links: OM3 limits 40G SR4 to 100m. OM4 extends to 150m. Verify your installed fiber grade before ordering transceivers.

Ignoring ECMP hashing: Most platforms hash traffic flows across ECMP paths using source/destination IP, protocol, and port. Large single-flow transfers (backup jobs, single TCP streams) cannot be distributed. Design with this limitation in mind.

Key Takeaway: A well-built leaf-spine fabric with two spines, six leaves, and proper ECMP delivers 2.4Tbps of bisectional bandwidth at 40G — enough for 240 servers at full 10G utilization. The math scales linearly as you add spines.

Part of

Enterprise Networking Hub

View all 128 pages →

Network switches, routers, firewalls, NICs, SFP and QSFP transceivers, DAC cables, wireless access points.