Leaf-Spine vs Three-Tier: Data Center Architecture - 夜莺博客

Leaf-Spine vs Three-Tier: Data Center Architecture

Traditional three-tier data center networks (core, distribution, access) were designed for north-south traffic, but modern applications generate mostly east-west traffic between servers, which exposes the three-tier model's blocked redundant links and unpredictable latency. Leaf-spine - a two-tier Clos topology where every leaf connects to every spine - fixes both problems with deterministic two-hop paths and ECMP-based load balancing. This article compares the two designs and explains when each still makes sense.

The Traditional Three-Tier Model

Three-tier networks organize switches as core, distribution and access. Core switches are large modular chassis with high throughput; distribution adds services like load balancing and firewalls; access switches (ToR) connect servers at 1G or 10G. Traffic flows north-south: server - access - distribution - core - distribution - access, up to five hops between two servers in different pods, with spanning tree blocking redundant uplinks and leaving up to half of the paid bandwidth idle.

Each tier exists for a reason. Access provides port density and Layer 2 adjacency for servers in a rack. Distribution is where policy lives: VLANs are terminated, inter-VLAN routing happens, firewalls and load balancers are inserted, and route summarisation keeps the campus routing table small. The core is deliberately dumb - it switches or routes between distribution blocks at very high speed and holds almost no policy. That separation of concerns scales well for a campus of thousands of users where the majority of traffic leaves through the core towards the internet or a central data centre, which is exactly the traffic pattern the model was designed around.

Why Three-Tier Fails in Modern Data Centers

Server-to-server traffic (VM migration, big data, microservices) is the new norm. East-west flows in a three-tier design cross multiple oversubscribed tiers, adding latency and bottleneck risk, and STP convergence remains a notorious outage source. When 80% of traffic is east-west, the core becomes a concrete wall.

The numbers explain the rest. Suppose a distribution block has four uplinks to a pair of core switches at 40G. Spanning tree permits one or two of them, depending on the topology and whether you deploy features like VSS or FabricPath to work around it - so half or more of the purchased uplink capacity is idle by design. Add the classic tier oversubscription ratios (access to distribution often 20:1 in older build standards) and a pair of servers in adjacent racks can traverse both tiers only to contend for a link that has been sized for the aggregate traffic of the whole pod.

Worse, the failure domain is the topology. A distribution switch pair, or an STP root, is on the path of a large fraction of the fabric. Loop prevention and load balancing are the same mechanism - one blocks, the other forwards - so you cannot have both. Every optimisation that recovers the blocked links (vPC, MLAG, VSS) adds a peer link that itself becomes a critical dependency, which is why so much of the troubleshooting literature on this site is about peer links and dual-primary states.

Leaf-Spine Fundamentals

Spine-leaf flattens the data center to two tiers: leaf switches (ToR, connecting servers) are directly cabled to every spine switch (the backbone). No leaf-to-leaf and no spine-to-spine links. Any two servers communicate over exactly two hops (leaf - spine - leaf), giving deterministic latency regardless of rack placement. Loop prevention comes from Layer 3 routing with Equal-Cost Multi-Path (ECMP) instead of STP, so all uplinks are active and bandwidth utilization approaches 100%.

The architecture is a Clos network, described in the 1950s for telephone exchanges and now the standard packet switching fabric. Its defining property is that the number of spines can be increased to add bandwidth without touching the leaves, and the number of leaves can be increased to add ports without touching the spines. Latency between any two endpoints is fixed at two hops regardless of whether the pods sit in the same row or on opposite sides of the hall, because every leaf sees every spine as one equal-cost path.

ECMP does the load balancing that STP refused to do. A leaf hashes each flow across its spine uplinks using a five-tuple hash, so a fabric with four healthy uplinks uses all four for different conversations. When a spine or uplink fails, the routing protocol reconverges and removes that path; traffic continues over the remaining equal-cost paths, and the only visible symptom is a shorter list of next-hops. Nothing is blocked, and nothing depends on a spanning-tree topology change.

Sizing the Fabric: Spine Port Maths

The design question in a leaf-spine fabric is how many spines you need, and it is arithmetic, not opinion:

spines = ceil( leaf_uplink_ports_per_switch / ports_per_spine_available_for_leaves )
radix example: 32-port spine, leaf uses 4 uplinks
  spines needed = 32 / 4 = 8  (32-port spines)  ->  8 * 4 = 32 leaf uplinks
total leaf ports = (spines * ports_per_spine) - (leaf_oversubscription slack)

With 32-port leaf switches using four uplinks each, a leaf exposes 28 server-facing ports. With 8 spines of 32 ports you can cable 64 leaves and 1792 server ports. Change the uplinks to eight per leaf and the same spines support 32 leaves with 24 server ports each - fewer servers, more bandwidth per server. That trade is the entire capacity planning exercise: uplink count sets the oversubscription ratio, and spine port count sets the ceiling on how many leaves the fabric can hold.

Head-to-Head Comparison

Property Three-tier Leaf-spine
Primary traffic focus North-south East-west
Hops between servers Up to 5, variable 2, always
Loop prevention STP/RSTP (blocks links) L3 routing + ECMP / VXLAN
Bandwidth utilization ~50% (blocked links) ~100% (all active)
Scaling bandwidth Upgrade core (disruptive) Add a spine (non-disruptive)
Scaling ports Add distribution + access Add a leaf
Failure domain Core/distribution pair on many paths One leaf or one spine, paths remain via others
Convergence Seconds (STP timers, reconvergence) Milliseconds to sub-second (routing/ECMP)
Cabling cost Lower - no full mesh Higher - every leaf to every spine

The Layer 2 Problem and the VXLAN Overlay

A pure L3 leaf-spine underlay breaks the assumptions many applications still make: vMotion and live migration, clustering heartbeats over the same subnet, and any workload that assumes it can reach a peer by MAC address across racks. The answer is not to stretch VLANs across the fabric with the underlay, but to build an overlay.

VXLAN encapsulates Layer 2 frames inside UDP and carries them over the routed underlay, with an EVPN control plane distributing MAC and IP reachability. The result is the best of both: the underlay stays a simple, loop-free ECMP fabric, and tenants or application clusters still get Layer 2 adjacency wherever their virtual machines land. That is why the modern reference design is usually described as "L3 underlay, VXLAN/EVPN overlay". The overlay has its own design questions - anycast gateways, multi-site border gateways, MTU overhead - covered in our VXLAN EVPN multi-site border gateway design and VXLAN MTU and fragmentation guide.

Oversubscription and Bandwidth Planning

Leaf-spine does not eliminate oversubscription; it makes it a number you choose instead of an accident of topology. The ratio is server-facing bandwidth divided by uplink bandwidth per leaf:

  • 3:1 to 4:1 - a general-purpose enterprise pod. 48 x 10G servers to 4 x 40G or 4 x 100G uplinks. Fine for most virtualised workloads with moderate east-west chatter.
  • 2:1 or lower - storage-heavy or HPC pods, distributed databases, and anything using RoCEv2 where microbursts matter more than averages.
  • 1:1 (non-blocking) - every server port has a dedicated uplink share. Expensive in optics and spine ports, and rarely justified outside AI training clusters and dedicated storage fabrics.

Remember that an oversubscribed leaf is only oversubscribed for traffic that has to cross it. Two servers on the same leaf talk at full speed regardless of the uplink ratio, so placing chatty neighbours in the same rack is still the cheapest optimisation available.

When to Keep Three-Tier

Campus networks with heavy north-south traffic (users at the access edge reaching central servers or the internet) still map naturally to a three-tier or collapsed-core design, as do very small deployments and legacy environments with flat-L2 application requirements. In the data center itself, leaf-spine is the recommended architecture for new builds.

Two more cases justify the older model. If the budget cannot absorb a full mesh of optics and cabling, a two-tier collapsed core in a small server room with fewer than a hundred ports is cheaper and simpler than a fabric. And if the environment is genuinely static - a small branch, an industrial control cabinet, a few racks - the operational maturity of spanning tree, which every engineer and every monitoring template already understands, has real value.

Migration Considerations

  • Every leaf must connect to every spine - expect significant recabling and optics cost.
  • Watch the oversubscription ratio: aim for 3:1 to 4:1 between leaf server ports and spine uplinks.
  • For Layer 2 adjacency across racks (vMotion, clusters), extend L2 with VXLAN over the L3 underlay.
  • Never add leaf-to-leaf or spine-to-spine links - they break ECMP and create loops.
  • Decide the routing protocol before the first cable: eBGP between leaf and spine scales cleanly and gives you per-link failure isolation, while OSPF is familiar but flatter.
  • Migrate pod by pod. A fabric and a three-tier pod can co-exist during the transition with a temporary routing boundary between them.
  • Update monitoring before cutover - ECMP path health, BGP neighbour state and VXLAN tunnel status replace the spanning-tree alerts your team is used to.

Operational Differences You Feel After Migration

The first month of leaf-spine operation is usually quieter than the last month of three-tier, and the difference is structural:

  • Failures get boring. Losing a spine degrades bandwidth across the fabric but does not take anything down, because no single device is transit for everyone.
  • Troubleshooting shifts upwards. Instead of chasing STP topology changes, you look at routing adjacency state, ECMP hashing (a flow pinned to one path) and overlay tunnel endpoints.
  • Adding capacity is a maintenance-free operation. New spine, cable it to every leaf, advertise it - traffic joins the ECMP set without a topology change.
  • Documentation matters more. In a Clos fabric the physical cabling plan is the design. If the spreadsheet that maps leaf-to-spine links is wrong, nobody can tell by looking at a show command alone.

Teams moving deliberately through this transition can follow our spine-leaf vs traditional 3-tier migration guide, and the bandwidth argument specifically is quantified in STP blocking and bandwidth in two-tier vs three-tier networks.

Frequently Asked Questions

Can I run leaf-spine with only two spines? Yes, and it is the smallest useful fabric: each leaf has two uplinks, one per spine, with no single point of failure and full ECMP in the steady state. Three or four spines are common once you want maintenance without losing capacity, since with two spines taking one down halves the fabric bandwidth.

Do spine switches need to be bigger than leaf switches? No. Port count matters more than throughput per port, because the spine only has to hold one link to every leaf plus one to every upstream or border device. Many production fabrics use identical hardware in both roles, which simplifies sparing.

Is a spine-to-spine link ever acceptable? Only if the two spines are a single logical switch (a stack or MLAG pair) and the link is that pair's peer link. As a path in the fabric, a spine-to-spine link adds a third hop and breaks the two-hop guarantee.

Related articles: Spine-leaf vs traditional 3-tier migration guide, 园区网络 Leaf/Spine 架构指南, and Data center ToR switch selection.

原文链接:https://www.wwt.com/article/comparing-two-tier-three-tier-data-center-networks