BGP++ is Meta's production BGP (Border Gateway Protocol) implementation, designed and built to run as part of the FBOSS network platform. It provides a high-performance BGP speaker with support for modern protocol extensions including ECMP, Graceful Restart, and Add-Path.
- Linux (tested on CentOS and Ubuntu)
- Compiler supporting C++17 or higher
- CMake 3.16+
BGP++ builds on top of several open-source libraries:
folly— Facebook's C++ library of reusable componentsfbthrift— Facebook's Thrift RPC frameworkfb303— Base service frameworkfboss— Facebook Open Switching Systemgflags,glog,gtest,fmt,re2,boost
bgp/
├── cpp/ # BGP++ runtime
│ ├── main/ # Entry points
│ ├── rib/ # RIB and best-path selection
│ ├── adjrib/ # Adj-RIB-In and Adj-RIB-Out
│ ├── peer/ # Peer management
│ ├── policy/ # Route policy engine
│ ├── fib/ # FIB programming interfaces
│ ├── config/ # Configuration parsing
│ ├── lib/ # Internal libraries (fibers, etc.)
│ └── service/ # Thrift service layer
├── docs/ # Documentation
├── if/ # Thrift IDL definitions
└── tests/ # Integration tests
BGP++ uses CMake and follows the same build pattern as FBOSS and OpenR:
# Install dependencies and build
bash ./build/build_bgppp.sh
# Or build manually with CMake
mkdir build && cd build
cmake ..
make -j$(nproc)
# Run tests
make testBGP++ implements the BGP-4 protocol (RFC 4271) with the following extensions:
- ECMP — Equal-Cost Multipath for load balancing across multiple next-hops (draft-lapukhov-bgp-ecmp-considerations)
- Graceful Restart — Maintains forwarding state during planned restarts (RFC 4724)
- Add-Path — Advertises multiple paths per prefix for improved convergence and traffic engineering (RFC 7911)
Peers ──► bgplib (parse) ──► AdjRibIn ──► Ingress Policy ──► RIB
│
Best Path Selection
│
┌─────┴─────┐
▼ ▼
FIB (FBOSS) Egress Policy
│
▼
AdjRibOut ──► Peers
See the CONTRIBUTING file for how to help out.
BGP++ is MIT licensed, as found in the LICENSE file.