GoBGP – A Control Plane Evolving Software Networking

GoBGP – A Control Plane Evolving Software Networking

Gobgp Purple

GoBGP – A Control Plane Evolving Software Networking

If I have talked to you over the past year or two about networking, odds are I have mentioned a project to you called GoBGP. If we have spoken a lot, you are probably sick of me talking to you about GoBGP 🙂 There is a reason, it’s because GoBGP is a missing link in networking that has been for a long time. GoBGP is a project from some really smart and just as importantly friendly, community minded folks at NTT Communications (largest telco in Japan). The software group that does the software is OSRG and the same organization that did RYU the SDN controller that was popular in OpenStack deployments. GoBGP is a BGP focused routing daemon that is incredibly flexible, written in Go and perfect for those both looking for practical control plane SDN solutions or network engineers looking to figure out what the hell their future will look like and where to start evolving in a software driven age. The tutorial will also instruct you how to install the Go programming language and environment in order to pull down and build the GoBGP binaries.

There are a few software router implementations, all useful in their own right. The first reason I prefer GoBGP is its written in Go, which gives you many of the benefits of C with a lower barrier to entry then C along with great concurrency support along with great native tooling. More on reasons to use Go here. GoBGP is also completely cross platform and does not have any hardware specific dependencies. Secondly, its architecture is outstanding and very modular unlike the monolithic alternatives. As an example, they implemented a draft I am huge fan of from Petr Lapukhov of Facebook named BGP for opaque signaling in a couple of days without needing to change anything internally. I see this level of modularity at work and recognize the level of experience required to design such nice architectures like the OSRG team have put together to seamlessly support EVPN, Opaque Flowspec, RRs, RPKI, BMP to name a few.

Download and Install GoBGP

The team does a great job with documentation so anything I write will duplicitous but I will dump my quick notes to get up and running. There is not a binary download for Mac/Linux/Windows explicitly so its a great chance for you to learn something new by installing the Go compiler if you haven’t before. Its fast and easy. If on a Mac or Linux box it is the same.

Pre-Requisites:

  • Windows or Mac there are installers found at Go Downloads.
  • Also Install git if you want to compile from source at the end of the post.

To install on Linux, paste the following or follow these instructions:

The next part of a Go install is the part that trips people up the most. Go uses a file structure for libraries that has to follow a convention because libraries are statically linked. The rational for this is because the compile time is incredibly fast because there is not any dynamic linking that eats up compile time searching for libraries.

Wherever you are going to store your Go project need to be contained in the exported to the $GOPATH directory. The docs use this example:

I store all of my Go projects in a directory in my home directory named, you guessed it, go. Im going to spell out full file paths to keep it as simple as possible. You want to add the export GOPATH= to your ~/.bash_profile startup file. If one doesn’t exist just create it in your home ~/ directory.

On a Linux box I use /home/brent/go:

All of your libraries are going to be installed into the $GOPATH directory path.

Now you should be ready to download GoBGP:

There are two binaries that should be in your file path now, gobgp (client cli) and gobgpd (daemon).

GoBGP Download and Run

Now run gobgp with an example config. The following toml formatted config points to another BGP instance both using AS: 65000. The source IP is 192.168.1.103 and the remote BGP peer is 192.168.1.249. Simply create a text file containing that config with your IP address swapped in.

Now start the daemon using the config file I saved as gobgp-conf-151.toml and using -l debug for debug logging so you can see the sausage factory go:

Assuming you have a router, another gobgp, quagga etc looking to peer with the the host you start gobgpd on view the neighbor adjacency with:

From there, the options are massive. Some of the highlights for example is, I want to monitor a route and do something when the route appears. It is super easy to integrate code with this project. A simple example is something I did just reading CLI output here to monitor when a container prefix appears to plumb routes. Note, that project currently is defunct but we have some cool stuff coming up.

GoBGP Example Commands

Here is my CLI cheatsheet. The OSRG folks have amazing docs so please use those but figured I would dump them here anyways to help you get an overview of how versatile this project is.

GoBGP Build from Source

For those new to Go, I figured I could add a bit of value for the OSRG project by explaining a bit more on pulling the Go source code and building a binary from them. The binaries for Go are stored in $GOPATH/bin which in my case is /home/brent/go/bin on a Linux OS. If you want to pull the GoBGP source code and build it locally do the following.

More Resources

This doesn’t even scratch the surface. There is plenty of valid reasons where a control plane belongs. L3 obviously scales further and is more reliable then large L2 domains. If you are looking to push routing closer to the edge, eventually you will consider where the L3 control belongs. Containers using Ipvlan L3 will require routes to be injected into the network. That could be a vendor HW integration installing routes or it could be the edge host signaling new routes. Either way, instead of announcing MAC addresses into a ToR, its just as reasonable to expect folks to want to announce routes into ToRs. If you want to eliminate L2, it requires pushing L3 further to the edge where the density is and will rapidly grow.

Thanks to the OSRG folks for being such good stewards in open source and the support from their parent company NTT in supporting them. Explore the github.com/osrg/gobgp project, there is a lot to learn there. The APIs for development are cutting edge with tons of opportunity for users, devs, vendors and those looking to evolve their skills in both NetOps and development, or both. They have a massive BGP network, they know it well, there is a lot everyone of all levels can learn there. Pretty reasonable to start expecting containerized control planes to bolt on top of any datapath sooner rather then later so why not get ahead of the curve. If you have any troubles use the project’s repo issues to get assistance as I am regrettably slow replying to comments here as time is not my friend atm 🙂

About the Author

Brent SalisburyI have over 20 years of experience wearing various hats from, network engineer, architect, ops and software engineer. More at Brent's LinkedInView all posts by Brent Salisbury →

  1. tamihirotamihiro03-29-2016


    Hey Brent, great post! It just looks like you’re so excited you’ve forgot to mention what I’ve just mentioned here 🙂
    Check out some client code examples, here and here.

    • Brent SalisburyBrent Salisbury03-29-2016


      Awesome! Thanks Tamihiro! Keep up the great work. I totally missed the PPN post. Thanks!

  2. AlexAlex03-29-2016


    I wonder how it compares to ExaBGP ? Which is the “go to” ATM.

    -Alex

  3. Joop KiefteJoop Kiefte04-12-2016


    for those now to > for those new to

    • Brent SalisburyBrent Salisbury04-12-2016


      Thanks Joop! Busted writing once, reading never 🙂