Skip to content
/ openr Public

Distributed platform for building autonomic network functions.


MIT, Unknown licenses found

Licenses found

Notifications You must be signed in to change notification settings


OpenR: Open Routing

Support Ukraine Build Status Documentation Status

Open Routing, OpenR, is Facebook's internally designed and developed Interior Routing Protocol/Platform. OpenR was originally designed and built for performing routing on the Terragraph mesh network. OpenR's flexible design has led to its adoption in other networks, including Facebook's new WAN network, Express Backbone.


Please refer to our extensive Documentation to get started with OpenR.

Library Examples

Please refer to the examples directory to see some useful ways to leverage the libraries to build software to run with OpenR.



Take a look at Developer Guide and to get started contributing. The Developer Guide outlines best practices for code contribution and testing. Any single change should be well tested for regressions and version compatibility.

Code of Conduct

The code of conduct is described in


We have tried OpenR on Ubuntu-16.04, Ubuntu-18.04 and CentOS 7/8. OpenR should work on all Linux based platforms.

  • Compiler supporting C++17 or higher


Repo Directory Structure

At the top level of this repo are the build and openr directories. Under the former is a tool, gen, that contains scripts for building the project. The openr directory contains the source for the project.


OpenR requires these dependencies for your system and follows the traditional cmake build steps below.

  • cmake
  • gflags
  • gtest
  • libsodium
  • zstd
  • folly
  • fbthrift
  • re2-devel

One Step Build - Ubuntu

We've provided a script, build/, tested on Ubuntu LTS releases. It uses to install all necessary dependencies, compile OpenR and install C++ binaries as well as python tools. Please modify the script as needed for your platform. Also, note that some library dependencies require a newer version than provided by the default package manager on the system and hence we are compiling them from source instead of installing via the package manager. Please see the script for those instances and the required versions.

Build Steps

# Install dependencies and build openr
bash ./build/

# To Run tests (some tests requires sudo privileges)
python3 build/fbcode_builder/ test \
  --src-dir=. \
  --project-install-prefix openr:/opt/facebook \

If you make any changes you can run cmake ../openr and make from the build directory to build openr with your changes.


openr builds both static and dynamic libraries and the install step installs libraries and all header files to /opt/facebook/openr/lib and /opt/facebook/openr/include/ along with python modules in your Python's site-packages directory. Note: the script will run this step for you

  • Manually you can drive to install elsewhere
    • refer to

Installing Python Libraries + CLI

You will need python pip or setuptools to build and install python modules. All library dependencies will be automatically installed except the fbthrift-python module which you will need to install manually using steps similar to those described below. This will install breeze, a cli tool to interact with OpenR.

  • Python install requires a fbthrift / thrift1 compiler to be installed and in PATH
cd openr/openr/py
python build
sudo python install

Docker Building / Usage

OpenR now has a Dockerfile. It uses to build all dependencies + OpenR.

docker build --network host .


You can specify a config file by bind mount a directory with a openr.cfg file in /config

docker run --name openr --network host openr_ubuntu
  • To use a custom config bind mount /config into the container
    • OpenR binary will look for /config/openr.conf


OpenR is MIT licensed.