GithubHelp home page GithubHelp logo

bgp's Introduction

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.

bgp's People

Contributors

induvsuresh avatar

Stargazers

steve ulrich avatar Alexis avatar Benoit avatar

Forkers

scm-repo-mirror

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.