Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Choosing Ethernet Switches & Speeds for AI Data Centers

· 5 min read · Home Networking

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Selecting the right Ethernet switches and link speeds for an AI data center is critical because AI workloads—especially distributed training—generate massive, bursty east-west traffic that stresses the network fabric. This guide walks you through the key decisions: matching switch types to your GPU cluster, choosing between 100G, 400G, or 800G links, and avoiding common pitfalls that cause congestion or wasted budget. You'll need a basic understanding of your AI cluster's size, the number of GPUs, and the typical traffic patterns (e.g., all-to-all vs. pipeline parallelism).

What You'll Need

  • Number of GPU servers (or NPUs/TPUs) to be interconnected
  • Per-server network interface count and speed (e.g., 8x100G or 4x400G)
  • Traffic pattern: mostly all-to-all (e.g., data parallel) or more localized (e.g., pipeline parallel)
  • Budget and power/cooling constraints
  • Existing cabling type (fiber, copper) and distance between racks

Step-by-Step

  1. Estimate your bandwidth needs per server. For AI training, a common rule of thumb is to match the network bandwidth to the GPU-to-GPU interconnect bandwidth (e.g., NVLink). If your GPU server has 8 GPUs with 400 GB/s NVLink, you need at least 400 Gb/s of network bandwidth per server—often achieved with 8x100G or 4x200G NICs. For inference, you can often use lower speeds (e.g., 25G or 100G per server).
  2. Decide on the switching architecture. For clusters up to a few hundred GPUs, a two-tier leaf-spine (also called CLOS) is standard. For larger clusters (thousands of GPUs), you may need a three-tier or even a rail-optimized design. The key is to ensure the spine switches have enough capacity to handle the aggregate leaf uplink bandwidth without oversubscription. Aim for 1:1 oversubscription for training, but 1:2 or 1:4 may be acceptable for inference.
  3. Choose the switch port speed and count. For AI, 400G (QSFP-DD or OSFP) is the current sweet spot for spine links, while 100G or 200G per server port is common. If you're building a new data center, consider 800G-ready switches to future-proof. Count the total number of server-facing ports needed (one per NIC) and the number of spine-to-leaf links (leaf ports × number of spines).
  4. Select the switch type: fixed vs. modular. Fixed switches (e.g., 32x400G or 64x400G) are simpler and cheaper for leaf roles. Modular chassis switches (with line cards) offer higher port density and are often used as spine switches for large fabrics. For AI, latency matters more than port density, so choose switches with low, consistent latency (typically under 1 microsecond).
  5. Check for congestion control features. AI traffic is bursty, so look for switches that support RDMA over Converged Ethernet (RoCEv2) with PFC (Priority Flow Control) and ECN (Explicit Congestion Notification). These features prevent packet loss, which can severely degrade training performance.
  6. Plan the cabling and optics. For distances under 100 meters, use multimode fiber with SR8 or SR4 optics (e.g., 400G-SR8). For longer runs, use single-mode fiber with DR4 or FR4 optics. Ensure your cable plant supports the required speeds—OM4/OM5 for SR, OS2 for DR/FR. Copper DACs (Direct Attach Cables) are fine for short rack-to-rack runs (up to 5 meters) but are heavier and less flexible.
  7. Validate with a proof-of-concept. Before committing to a full deployment, test a small fabric (e.g., 4 servers, 2 switches) with your actual AI workload. Measure throughput, latency, and packet loss. Use tools like iperf or NCCL tests to simulate training traffic.
  8. Scale and monitor. Once validated, roll out the full fabric. Implement monitoring for buffer utilization, ECN marking, and PFC pauses. These metrics help you adjust thresholds and avoid congestion.

Common Mistakes

  • Oversubscribing the spine: Using too few spine switches or low-speed uplinks creates a bottleneck. For all-to-all traffic, 1:1 oversubscription is essential.
  • Ignoring buffer size: AI traffic bursts can cause buffer overflow. Choose switches with large, shared buffers (e.g., 16 MB or more per port) to absorb microbursts.
  • Mixing speeds without proper QSFP-DD/OSFP adapters: For example, using a 400G port with a 100G breakout cable requires the switch to support breakout mode—not all do.
  • Underestimating power and cooling: High-speed optics (especially 400G-ZR) consume significant power. Ensure your racks have adequate power and cooling.
  • Choosing copper DACs for long runs: DACs are limited to short distances; using them for inter-rack runs can cause signal degradation.

Tips

  • For large clusters, consider a rail-optimized design where each GPU server connects to a specific spine switch to reduce the number of hops.
  • Use a network simulation tool (e.g., ns-3) to model your traffic before buying hardware.
  • Check if your switch supports RoCEv2 and whether it has a dedicated ASIC for congestion management—this can make a huge difference in performance.
  • Plan for future growth: choose switches that support 800G upgrades (e.g., via OSFP) even if you start with 400G.
  • Always enable jumbo frames (9000 MTU) for AI traffic to reduce CPU overhead.

Troubleshooting

  • High latency or packet loss: Check for PFC pauses—if they are frequent, your network is congested. Increase ECN marking thresholds or add more spine links.
  • Performance worse than expected: Verify that RoCEv2 is enabled on both the NICs and switches. Also, ensure the NICs are configured with the correct MTU and flow control settings.
  • Link flapping: This often indicates a faulty optic or cable. Reseat the optic, clean the fiber ends, or swap the cable.
  • Incompatible optics: Some switches are vendor-locked; you may need to use approved optics or enable unsupported transceiver mode (if allowed).
  • Switch CPU spikes: If using a management interface, ensure it's not handling data traffic. Use dedicated management VLANs.

Frequently Asked Questions

Q: What speed should I use for AI training?
A: For distributed training, 400G per server is common, but 800G is emerging. For inference, 100G per server is often enough.

Q: Can I use standard data center switches for AI?
A: Yes, but look for low latency, large buffers, and RoCEv2 support. Some AI-specific switches have enhanced congestion control.

Q: What is oversubscription and why does it matter?
A: Oversubscription is the ratio of server bandwidth to uplink bandwidth. For AI, 1:1 means no oversubscription, which is ideal but costly. Higher ratios reduce cost but can hurt performance.

Q: Should I use fiber or copper cables?
A: For speeds above 100G and distances over 5 meters, fiber is preferred. Copper DACs are cheaper but limited in distance and speed.

Q: How many spine switches do I need?
A: A minimum of two for redundancy, but often more to achieve the desired oversubscription. For 1:1, you need enough spine ports to match all leaf uplinks.

Q: What is the difference between leaf and spine switches?
A: Leaf switches connect to servers and spine switches; spine switches interconnect leaves. This forms a non-blocking fabric when oversubscription is 1:1.