What is Leaf and Spine Architecture
Leaf and spine architecture is a two-tier network topology widely used in data centers. It consists of two layers of switches: leaf switches, which connect to servers, storage, and other endpoints, and spine switches, which interconnect all the leaf switches. Every leaf switch has a link to every spine switch, so the fabric forms a full mesh between the two layers.
The design was created to handle the way data center traffic has changed. Applications built on virtualization, containers, and distributed computing spend much of their time exchanging data between servers inside the data center, known as east-west traffic. The older three-tier design was built mainly for north-south traffic, which flows between clients outside the data center and servers inside it. Leaf and spine give east-west traffic short, uniform, and high-capacity paths.
Components
Leaf switches: The access layer. Leaf switches connect to servers, storage systems, and external links such as WAN and internet gateways. Each leaf switch uses downlink ports to reach endpoints and uplink ports to reach the spine.
Spine switches: The backbone layer. Spine switches do not connect to endpoints directly. Their job is to move traffic at high speed between leaf switches.
Links: The connections between leaf and spine. Together they form the fabric. Their number and speed determine the fabric's total bandwidth.
How Leaf and Spine Architecture Works
The topology follows a few simple rules:
Each leaf switch connects to every spine switch, using one link or several parallel links.
Leaf switches do not connect to other leaf switches, and spine switches do not connect to other spine switches.
Endpoints attach only to leaf switches.
Because of these rules, traffic between two servers on different leaf switches always takes the same path shape: up from the source leaf to a spine, then down to the destination leaf. That is two switch-to-switch hops, regardless of which servers are talking, so latency is low and predictable. Traffic between two servers on the same leaf switch is switched locally and never reaches the spine.
Leaf and spine fabrics are typically built as Layer 3 networks, with routing between leaf and spine instead of Layer 2 switching. Equal-Cost Multipath (ECMP) routing spreads traffic across all spine switches at the same time, so every link carries traffic and no path sits idle as a standby. When a workload needs Layer 2 connectivity across different leaf switches, an overlay technology such as VXLAN is commonly used to stretch Layer 2 segments over the Layer 3 fabric.
Leaf and Spine vs. Three-Tier Architecture
Three-Tier | Leaf and Spine | |
|---|---|---|
Layers | Access, aggregation, and core | Leaf and spine |
Optimized for | North-south traffic | East-west traffic |
Hops between servers | Varies with where the servers sit | Consistent: two hops across leaf switches |
Loop prevention | Spanning Tree Protocol (STP), which blocks redundant links | Layer 3 routing with ECMP, with all links active |
Scaling model | Scale up: replace with larger devices | Scale out: add more switches |
Cabling | Fewer links | More links, because every leaf connects to every spine |
Capacity Planning
The size of a leaf and spine fabric follows from port counts and link speeds at each layer. Let P be the number of ports on a spine switch, S the number of spine switches, U the number of uplink ports on a leaf switch, and D the number of downlink links on a leaf switch.
Maximum number of leaf switches = (P × S) ÷ U. The total number of spine ports, divided by the uplinks each leaf switch needs. When each leaf has exactly one link to each spine (U = S), this simplifies to P.
Maximum number of spine switches = U ÷ links per leaf-spine pair. With one link to each spine, a leaf switch with four uplinks supports up to four spine switches. With two parallel links to each spine, it supports two.
Endpoint connections = D × number of leaf switches. Count links, not physical ports: when a port is split by breakout, such as an 800G port into two 400G links, each resulting link counts as one downlink. To get the number of servers, divide by the number of leaf switches each server connects to, which is two for a typical redundant pair.
Oversubscription ratio = total downlink bandwidth ÷ total uplink bandwidth on a leaf switch. A lower ratio means more headroom for east-west traffic, and latency-sensitive or data-intensive workloads generally call for ratios closer to 1:1.
For example, take 4 spine switches with 64 × 800G ports each, and leaf switches of the same size. Each leaf switch uses 32 of its ports as uplinks, 8 to each spine, and splits the other 32 ports into 64 × 400G downlinks. Each server has one 400G link to every leaf switch, and the fabric has 8 leaf switches:
Maximum leaf switches: (64 × 4) ÷ 32 = 8
Maximum spine switches: 32 uplinks ÷ 8 links per spine = 4
Endpoint connections: 64 × 8 = 512, which is 64 servers, because each server connects to all 8 leaf switches (512 ÷ 8)
Oversubscription ratio: (64 × 400G) ÷ (32 × 800G) = 25.6T ÷ 25.6T = 1:1
Capacity and oversubscription trade off against each other. If each leaf used only 16 uplinks (4 to each spine) with the same 64 × 400G downlinks, the ratio would rise to 2:1, but the same spines could support twice as many leaf switches: (64 × 4) ÷ 16 = 16.
When a fabric runs out of ports or bandwidth, operators grow it in two ways: add leaf switches for more endpoints, or add spine switches for more bandwidth between leaf switches. To go beyond the limits of a single two-tier fabric, designers add a further layer above the spine, often called a super-spine.
Why Leaf and Spine Architecture is Beneficial
Predictable, low latency: Every leaf-to-leaf path has the same number of hops, which makes performance consistent for applications.
High bandwidth: With ECMP, all uplinks carry traffic, and bandwidth grows as links are added.
Easy scaling: Adding a leaf or a spine does not require redesigning the network or taking it offline.
Built-in resilience: Each leaf has several paths to every other leaf. If a spine switch or link fails, traffic shifts to the remaining spines, and the fabric loses some capacity instead of connectivity.
Uniform design: Because the building blocks repeat, the fabric is simpler to plan, automate, and operate.
Challenges
Cabling volume: Every leaf connects to every spine, so link count and cable management grow with the size of the fabric.
Routing expertise: A Layer 3 fabric with ECMP and overlays needs more planning than a basic Layer 2 network, and benefits from automation tools.
Layer 2 dependencies: Some applications, such as clusters and first-hop redundancy setups like VRRP, expect their nodes to share the same Layer 2 segment. In a routed fabric, those nodes need to sit under the same leaf, or an overlay has to provide the Layer 2 connectivity. Services such as DHCP also need relay on each routed segment.
Port limits: The port count on spine switches caps the size of a two-tier fabric, so growth plans should account for it.
Use Cases
Leaf and spine is the standard design for modern data centers. Common uses include cloud and virtualized environments, containerized and microservices applications, big data analytics, distributed storage including NVMe over fabrics, and AI and machine learning clusters where many servers must exchange large volumes of data with low latency.