目录

BGP++: Meta’s BGP Implementation

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.

Requirements

  • Linux (tested on CentOS and Ubuntu)
  • Compiler supporting C++17 or higher
  • CMake 3.16+

Dependencies

BGP++ builds on top of several open-source libraries:

  • folly — Facebook’s C++ library of reusable components
  • fbthrift — Facebook’s Thrift RPC framework
  • fb303 — Base service framework
  • fboss — Facebook Open Switching System
  • gflags, glog, gtest, fmt, re2, boost

Building BGP++

Repo Directory Structure

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

Build Steps

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 test

How BGP++ Works

BGP++ 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)

Data Flow

Peers ──► bgplib (parse) ──► AdjRibIn ──► Ingress Policy ──► RIB
                                                               │
                                                         Best Path Selection
                                                               │
                                                         ┌─────┴─────┐
                                                         ▼           ▼
                                                    FIB (FBOSS)   Egress Policy
                                                                     │
                                                                     ▼
                                                              AdjRibOut ──► Peers

Contributing

See the CONTRIBUTING file for how to help out.

License

BGP++ is MIT licensed, as found in the LICENSE file.

关于
35.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号