GithubHelp home page GithubHelp logo

fgbgp's Introduction

FGBGP

This is a BGP library in Go.

Features

  • Decode/encode BGP messages
  • Maintain a connexion with peers
  • RIB data structure (add/remove IPv4/IPv6)
  • Event-based API
  • Encode/decode MRT format

Why use this library?

It was developped to have a flexible BGP server running on a cluster with load-balanced IPs and ready for scale. A full-table will use around 300MB of RAM.

This is not a fully integrated BGP daemon: it does not filter routes or automatically send BGP updates on the routes learned.

The behavior has to be implemented using the event-based API:

  • Peer status change
  • Update received

This library can also be used for standalone BGP Messages decoding, reading MRT files or storing updates into a RIB and perform lookups.

Supported BGP features

  • Add-path (decode/encode only, not storing into the RIB)
  • Route-refresh
  • Basic BGP attributes (Origin, MED...)
  • Aggregator

Supported MRT features

  • TABLEDUMPV2
  • MRT update
  • Status

Example

import (
    "fmt"
    server "fgbgp/server"
)

type Collector struct {

}

func (col *Collector) Notification(msg *messages.BGPMessageNotification, n *server.Neighbor) (bool) {
    return true
}

func (col *Collector) ProcessReceived(v interface{}, n *server.Neighbor) (bool, error) {
    return true, nil
}

func (col *Collector) ProcessSend(v interface{}, n *server.Neighbor) (bool, error) {
    return true, nil
}

func (col *Collector) ProcessUpdateEvent(e *messages.BGPMessageUpdate, n *server.Neighbor) (add bool) {

}

func main() {
    m := server.NewManager(65001, net.ParseIP("10.0.0.1"), false, false)
    m.UseDefaultUpdateHandler(10)
    col := &Collector{}
    m.SetEventHandler(&col)
    m.SetUpdateEventHandler(&col)
    err := m.NewServer(*BgpAddr)
    if err != nil {
        log.Fatal(err)
    } 
}

fgbgp's People

Contributors

lspgn avatar

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.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • 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.