Aravind Prabhakar

Systems Engineer | Networking | Security | PreSales | Cloud | Devops | AIOps

View on GitHub Linkedin Blogs Tags
4 August 2022

BMP and BMPaaS

By Aravind

Advantages of BMP

Connection establishment

life cycle

  1. configure
  2. successful TCP connection and determine session is UP
  3. router to send BMP messages
    • Initiation message
    • Peer up message for each of its peer that is in established state
    • Send ADJ_RIB_IN (pre/post/both policies)
    • once the above is sent, send END_OF_RIB for each monitored peer
    • send any incremental updates encapsulated in route monitoring messages4. Send stats message
  4. BMP session ends when TCP session is closed for any reason. Router may send Termination message prior to closing the session

Read RFC 7854 for more details and exact message formats and types.

Configure BMP

To configure and use BMP, there are 2 parts.

BMP Station config

root@crpd-749558787c-jmzmf> show configuration routing-options
bmp {
    traceoptions {
        file bmp.log size 3g;
        flag event;
    }
    station SC-DISCOVERY {
        local-port 17002;
        station-address 10.244.0.0;
        bmp-server;
        kafka {
            broker-address kafka:9092;
        }
    }
}

Here the kafka stanza is not mandatory. This is used if one needs to publish msgs on kafka to use BMPaaS. In this example, the station is running on a k8s cluster. The 10.244.0.0 is the flannel CNI subnet and all pods run on that. If you notice the next section where client config is mentioned, we would connect to the station using the nodePort exposed. This can also be simplified using a service IP (ingress VIP, metalLB VIP) The local-port 17002 is exposed on the node as 31002.

BMP Client config

root@ob1> show configuration routing-options
autonomous-system 65500;
bmp {
    station SC-DISCOVERY {
        connection-mode active;
        route-monitoring {
            rib-out;
        }
        station-address 10.85.47.166;
        station-port 31002;
    }
}

Verify

root@crpd-749558787c-jmzmf> show bgp bmp
Station name: SC-DISCOVERY
  Local address/port: -/17002, Station address/port: 10.244.0.0/-, passive
  State: listening
  Last state change: 1d 8:35:57
  Hold-down: 600, flaps 3, period 300
  Priority: low
  BMP server: enabled
  Clients count (current/max): 3/20
  Version: 3
  Routing Instance: default
  Trace options: event
  Trace file: /var/log//bmp.log size 3221225472 files 10
  Kafka broker address: kafka:9092, status: Up, elapsed time: 17:22:18
  BMP server connected clients:
    Remote sysname: pe2 address/port: 10.244.1.1+50344, up time: 1d 8:35:47
    Remote sysname: ob1 address/port: 10.244.1.1+17901, up time: 1d 8:35:44
    Remote sysname: pe1 address/port: 10.244.1.1+44253, up time: 1d 8:35:42

BMP as a service

Sometimes you may want to use the BMP information for various purposes.

One example is to discover service chains. How can one use BGP as a means to discover service chains? The idea is to use BMP to advertise the service IPs of the service chain element based on a community value to the BMP station. The BMP station would further process this data and store them in a database. Finally a webUI or the controller can query this DB to fetch the details. The data stored consists of location of the BMP client and the service IP associated. Take a look at this repo for more information

[ crpd  junos  mx  ] tags: crpd - junos - mx