Skip to content

Spine-Leaf Network Topology: The Data Center Network Diagram Explained

How a spine-leaf fabric works: why every leaf links to every spine, oversubscription math, super-spines, an eBGP underlay and a VXLAN EVPN overlay.

· Founder & developer

Published

Network diagram: four spine switches in a top row and five leaf switches below, each leaf linked to every spine. Racks of 48 servers hang off Leaf 1 to Leaf 4, and a border leaf connects to the WAN. An orange path runs Rack 1, Leaf 1, Spine 2, Leaf 3, Rack 3.

Your data center grew the classic way: top-of-rack switches feed a pair of aggregation switches, and those feed a core. Then applications split into services that call each other, storage moved onto the network, and more and more traffic ran sideways from rack to rack, up and down a tree in which spanning tree keeps the spare links switched off.

Spine-leaf, a folded Clos topology, is the common answer. This post covers how it is wired, the oversubscription math, scaling, the eBGP underlay, the VXLAN and EVPN overlay and border leaves, with a diagram you can copy.

Why the three-tier design ran out of room

RFC 7938, which describes BGP routing in large data centers, rules the classic tree out for large sites: you cannot buy top-tier switches with enough ports, and every growth step replaces the largest boxes. Smaller sites hit other limits first: spanning tree blocks redundant links you paid for, path length depends on where servers sit, and the 12-bit VLAN ID caps you at 4,094 VLANs.

Three-tier Spine-leaf
Redundant links Blocked by spanning tree, or paired with MLAG All active, shared by ECMP
Switches between two racks 3 in the same pod, 5 across pods Always 3: leaf, spine, leaf
How it grows Bigger aggregation and core switches More leaves and spines of the same kind
One upper switch fails Up to half of a pod's uplinks 1/N of each leaf's uplinks, with N spines

How a spine-leaf fabric is wired

Leaves are the top-of-rack switches: servers, storage, firewalls and WAN routers plug into them. Spines connect only to leaves. Every leaf has one link to every spine, and spines never link to each other. The shape is a folded Clos network, after Charles Clos's 1953 study of non-blocking telephone switching: the spine is the middle stage, and the leaf serves as both input and output stage.

Two properties follow:

  • Every path between racks has the same length: leaf, spine, leaf. Latency is predictable, and workloads can run anywhere.
  • There are as many equal-cost paths as spines. With four spines, each leaf has four paths to every other leaf, and equal-cost multipath (ECMP) routing uses all of them.

ECMP hashes header fields such as addresses and ports, so each flow stays on one path and arrives in order; a few huge elephant flows can still collide on one link. If a spine fails, ECMP moves its flows to the other three. For load balancing at the application layer, see the load balancer diagram.

Oversubscription math

Oversubscription is a leaf's server-facing bandwidth divided by its uplink bandwidth; RFC 7938 calls a leaf with N downlinks and M equal-speed uplinks non-blocking when M is at least N. The leaf in the diagram has 48 server ports at 25 Gbps and four 100 Gbps uplinks, one per spine:

  1. Server-facing: 48 × 25 Gbps = 1,200 Gbps.
  2. Uplinks: 4 × 100 Gbps = 400 Gbps.
  3. Ratio: 1,200 ÷ 400 = 3:1.

If every server sends off-rack at full speed at once, each gets about 8.3 Gbps. Traffic inside the rack never touches the uplinks.

Leaf design Server-facing Uplinks Ratio
48 × 25G, 4 × 100G up 1,200 Gbps 400 Gbps 3:1
48 × 25G, 8 × 100G up 1,200 Gbps 800 Gbps 1.5:1
32 × 100G, 8 × 400G up 3,200 Gbps 3,200 Gbps 1:1
48 × 25G, one of four spines down 1,200 Gbps 300 Gbps 4:1

Oversubscribe in one place: RFC 7938 introduces it only at the top of the rack, so the layers above stay non-blocking. Check the ratio with one spine down, because that is your network during every spine upgrade.

Scaling: leaves, spines, then a super-spine

You need Add Limited by
More server ports Leaves Free ports on every spine
More bandwidth between racks Spines Free uplinks on every leaf
More leaves than a spine has ports A super-spine tier and pods Ports on the super-spines

With 64-port spines, the fabric tops out at 64 leaves, or 3,072 server ports at 48 per leaf, minus border and service leaves. Past that, RFC 7938 adds a stage: each group of leaves and spines becomes a cluster, or pod, and the pod spines connect up to a super-spine tier. Facebook's 2014 fabric used pods of 48 racks with four fabric switches each, under four planes of up to 48 spine switches. It started at 4:1 from rack to rack with 12 of 48 spines per plane, and could reach 2:1 or 1:1 just by adding spines. Its fabric switches are the spines of this post; its spines are the super-spine tier.

The underlay: eBGP and ECMP

RFC 7938 uses eBGP as the only routing protocol: one session per physical link, no IGP, no multihop or loopback sessions. Its ASN plan uses private ASNs (64512 to 65534, or 4200000000 to 4294967294 in four-byte form), with one ASN shared by all spines and one per leaf.

The shared spine ASN prevents bad paths: a BGP router drops routes whose AS path contains its own ASN, so a route can never go leaf, spine, leaf, spine. It also makes the four paths to a leaf identical, so ECMP uses all of them. If one prefix comes from several leaves, such as an anycast service, enable "multipath relax" (RFC 7938, section 6.2).

For fast failover, tear sessions down on link-down, which fiber reports in milliseconds, and add BFD for sub-second detection; keepalives alone take seconds, since many implementations cannot set a hold time below three seconds. Here is a leaf in FRR; no bgp ebgp-requires-policy stands in for the route maps you would use in production:

router bgp 65001
 bgp router-id 10.0.0.11
 no bgp ebgp-requires-policy
 bgp bestpath as-path multipath-relax
 neighbor FABRIC peer-group
 neighbor FABRIC remote-as external
 neighbor eth1 interface peer-group FABRIC
 neighbor eth2 interface peer-group FABRIC
 neighbor eth3 interface peer-group FABRIC
 neighbor eth4 interface peer-group FABRIC
 !
 address-family ipv4 unicast
  network 10.0.0.11/32
  maximum-paths 64
 exit-address-family
 !
 address-family l2vpn evpn
  neighbor FABRIC activate
  advertise-all-vni
 exit-address-family

The overlay: VXLAN and EVPN

A routed underlay has no stretched VLANs. When virtual machines move or tenants need their own segments across racks, VXLAN rebuilds layer 2 on top: each leaf is a tunnel endpoint (VTEP) that wraps Ethernet frames in UDP and IP, and the spines route the outer packets without knowing about tenants.

  • A 24-bit VXLAN network identifier (VNI) allows about 16 million segments, against 4,094 VLANs.
  • The destination port is UDP 4789; the source port is usually a hash of the inner headers, so ECMP can spread tunnels across spines.
  • Encapsulation adds 50 bytes over IPv4 (14 inner Ethernet, 8 VXLAN, 8 UDP, 20 IP), so 1,500-byte packets need an underlay MTU of at least 1,550 (1,570 over IPv6). VTEPs must not fragment, and Kubernetes pod overlays that use VXLAN pay the same 50 bytes.

EVPN replaces VXLAN's flood-and-learn with BGP: each leaf advertises the addresses it learns locally, and RFC 8365 applies this to VXLAN.

EVPN route type Carries
2, MAC/IP Advertisement A host's MAC and IP address and its VTEP
3, Inclusive Multicast Ethernet Tag The VTEPs in a segment, for broadcast and unknown traffic
1 and 4, Auto-Discovery and Ethernet Segment Servers attached to several leaves
5, IP Prefix (RFC 9136) Subnets, and external routes from border leaves

With an anycast gateway (RFC 9135), every leaf answers for the same gateway address, so hosts always route through their own leaf.

Border leaves

Border leaves connect the WAN, the internet edge, another data center or a site-to-site VPN to a cloud VPC, and link to every spine like any other leaf. RFC 7938 gives them three jobs: strip the private ASNs before advertising to the WAN, originate or relay the fabric's only default route (summarizing inside a Clos fabric is risky), and connect to every WAN router so one failed link cannot black-hole traffic. Use at least two. Firewalls often hang off service leaves the same way; the DMZ network diagram shows that edge. Border spines save leaf ports but make some spines special.

The spine-leaf diagram

Network diagram: four spine switches in a top row and five leaf switches below, each leaf linked to every spine. Racks of 48 servers hang off Leaf 1 to Leaf 4, and a border leaf connects to the WAN. An orange path runs Rack 1, Leaf 1, Spine 2, Leaf 3, Rack 3.

17 components · 25 connections

Open in Archboard
Diagram contents
  • Spine 1
  • Spine 2
  • Spine 3
  • Spine 4
  • Leaf 1
  • Leaf 2
  • Leaf 3
  • Leaf 4
  • Border leaf
  • Rack 1: 48 servers
  • Rack 2: 48 servers
  • Rack 3: 48 servers
  • Rack 4: 48 servers
  • WAN / Internet
  • 48 × 25G
  • eBGP, default route in
A three-stage spine-leaf fabric. Every leaf links to all four spines, so traffic between any two racks crosses exactly one spine, over four equal-cost paths. A border leaf connects the WAN, and the notes show the 3:1 oversubscription math.

How to read it:

  • Top row: four spines that connect only to leaves and share ASN 65000.
  • Middle row: five leaves, each with one 100G link to every spine, 20 links in all. The purple border leaf connects the WAN over eBGP (use two in production).
  • Orange path: one flow from Rack 1 to Rack 3 through Leaf 1, Spine 2 and Leaf 3. ECMP could have picked any spine; every path is the same length.
  • Bottom row: a rack of 48 servers at 25G under each green leaf.
  • Notes on the right: the 3:1 math, the one-spine-down case, scaling rules, ASNs and overlay numbers.

Drawing spine-leaf diagrams clearly

  • Use rows: spines on top, leaves in the middle, endpoints below. A free layout hides the point that every leaf touches every spine.
  • Spread attach points in order along each spine's bottom and each leaf's top, so the mesh fans out evenly.
  • Draw a slice of a big fabric: four leaves plus the border pair, every spine, and the real counts in a note.
  • Label the decisions: link speeds, uplinks per leaf, the ratio, the ASN plan, and a color for border and service leaves.
  • Separate underlay and overlay: physical links and ASNs in one diagram, VNIs and VRFs in another. The network topology diagram guide covers the physical and logical split.

Common mistakes are spine-to-spine links, external links on a random spine, a missing oversubscription ratio and VLANs with no VNI mapping. In the cloud, the provider runs the fabric and you draw routing between virtual networks instead, often hub and spoke.

Build it in Archboard

  1. Sign in with Google or GitHub and create a diagram.
  2. From the Network pack, add four Switch nodes in a row, named Spine 1 to Spine 4, with a blue accent.
  3. Below them, add five more Switch nodes: Leaf 1 to Leaf 4 in green and Border leaf in purple.
  4. Connect every spine to every leaf, 20 links in all.
  5. Under each green leaf, add a Server node from the Network pack for its rack and label the link 48 × 25G. Under the border leaf, add an Internet node and label its link eBGP, default route in.
  6. Color the path Rack 1, Leaf 1, Spine 2, Leaf 3, Rack 3 orange, with arrows, to show one flow.
  7. Add a Markdown block from the Core pack with the math, ASNs and overlay numbers, and two Core Text notes for the mesh rule and the orange path.

If your topology lives in a Mermaid flowchart, the Mermaid converter turns it into a first draft; the network use case shows the rest of the pack. The example uses 15 diagram nodes, the most the Free plan allows in one diagram. For the path from the internet down to the servers, see the data center network example.

FAQ

What is a spine-leaf topology? A two-layer data center network where every leaf switch connects to every spine switch. Devices attach to leaves, and traffic between racks crosses exactly one spine.

Is spine-leaf the same as a Clos network? Yes, it is a folded three-stage Clos network. Large fabrics add a super-spine tier and become five-stage Clos networks.

How many spine switches do I need? At least two. For bandwidth, divide a leaf's server-facing bandwidth by your target ratio and the uplink speed: 1,200 Gbps at 3:1 over 100G links needs four.

What is a good oversubscription ratio for a leaf? It depends on how much traffic leaves the rack: 3:1 can suit general-purpose racks, while storage and distributed training push toward 1:1.

Do I need VXLAN and EVPN with spine-leaf? Only for layer 2 segments across racks, many tenants or hosts that move. A pure layer 3 fabric with one subnet per rack needs no overlay.

Start free — one seat, no credit card.

Related posts

← Back to blog

Open a canvas in a minute

Sign in with Google or GitHub. Free for a single seat. Upgrade when the team joins.