---
title: "Running Border Gateway Protocol in large-scale data centers"
description: "Facebook runs BGP as the routing foundation of its data centers, and found it works well only when co-designed with the topology, configuration, switch software and fleet-wide operations pipeline."
url: "https://swe.quest/articles/running-border-gateway-protocol-in-large-scale-data-centers-d93bb3d6d3d281ee"
canonical: "https://engineering.fb.com/2021/05/13/data-center-engineering/bgp/"
source: "Meta Engineering"
published: "2021-05-13"
difficulty: "hard"
kind: "Research"
reading_minutes: 3
tags: ["networking","datacenters","deployment","testing"]
---

# Running Border Gateway Protocol in large-scale data centers

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2021-05-13, 3 min read, Research. Original: [https://engineering.fb.com/2021/05/13/data-center-engineering/bgp/](https://engineering.fb.com/2021/05/13/data-center-engineering/bgp/)

## Summary

Facebook runs BGP as the routing foundation of its data centers, and found it works well only when co-designed with the topology, configuration, switch software and fleet-wide operations pipeline. The design reuses a uniform AS numbering scheme with BGP confederations across fabrics and applies hierarchical route summarization at every level to keep hardware forwarding tables small. Routing policies set propagation scopes, predefine backup paths, and allow graceful traffic draining from faulty devices. A minimal in-house BGP agent is shipped through unit testing, emulation, canary testing and multi-phase deployment so it can be updated frequently.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Networking](https://swe.quest/tags/networking.md) (Infrastructure)
- [Datacenters](https://swe.quest/tags/datacenters.md) (Infrastructure)
- [Deployment](https://swe.quest/tags/deployment.md) (Reliability & operations)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)

## Prerequisites

- BGP fundamentals ([easy posts on Networking](https://swe.quest/tags/networking.md?difficulty=easy))
- Clos/fabric data center topologies ([easy posts on Datacenters](https://swe.quest/tags/datacenters.md?difficulty=easy))
- Autonomous system numbering

## Keywords

BGP, Facebook, NSDI 2021, BGP confederation

## Related posts

- [Building Prometheus: How Backend Aggregation Enables Gigawatt-Scale AI Clusters](https://swe.quest/articles/building-prometheus-how-backend-aggregation-enables-gigawatt-scale-ai-clusters-e59c9bd7f678b229.md): Meta Engineering · 2026-02-09 · Hard · 4 min read · Networking, Datacenters, Hardware, Model training
  Meta's backend aggregation (BAG) is an Ethernet super-spine layer that connects multiple L2 spine fabrics across data center buildings and regions, making it possible to build the 1-gigawatt Prometheus AI cluster spanning tens of thousands of GPUs.
- [So You Want to Build Your Own Data Center](https://swe.quest/articles/so-you-want-to-build-your-own-data-center-cabbea522c183df6.md): Railway · 2025-01-17 · Medium · 11 min read · Datacenters, Networking, Hardware, Cloud platforms
  Railway moved off Google Cloud by building its own colocation cages, going from project kickoff to first live site in California in about eight months.
- [Reinventing Facebook’s data center network](https://swe.quest/articles/reinventing-facebook-s-data-center-network-52806faff968da9a.md): Meta Engineering · 2019-03-14 · Hard · 21 min read · Networking, Datacenters, Hardware, Scaling
  Meta redesigned its data center network around F16, a fabric with 16 single-chip planes of 128x100G switches built on Broadcom Tomahawk 3.
- [Throwing Out The Phonebook](https://swe.quest/articles/throwing-out-the-phonebook-38542538ac98046f.md): Fly.io · 2026-11-13 · Hard · 10 min read · Networking, Linux, Distributed systems, Deployment, System design
  Fly.io rebuilt 6PN, its private IPv6 network between Fly Machines, replacing a fleet-wide eBPF map of every migrated Machine's location (hundreds of thousands of entries kept in sync from Corrosion's gossip-replicated SQLite) with lazy, on-demand routes.
- [OCP Summit 2026: Powering AI with Open Innovations in Scale-Up, Scale-Out, and Scale-Across Networks](https://swe.quest/articles/ocp-summit-2026-powering-ai-with-open-innovations-in-scale-up-scale-out-and-f66a1a8efcb6358b.md): Meta Engineering · 2026-10-12 · Hard · 11 min read · Networking, Datacenters, Hardware, Distributed systems, Model training
  Meta's OCP 2026 networking lineup centers on IcePack, its first liquid-cooled network rack, and IceCube 102.4T switch blades (128×800G, Tomahawk6C or Spectrum-6, running FBOSS on SAI).

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
