PoC collection of scripts and modules that perform the following
- Connects via gRPC to a running GoBGP instance and submits a query for the contents of the BGP-LS table
- or, loads from file a cached BGP-LS table (To dump,
proto.GoBGPQueryWrapper.debug()
)
- or, loads from file a cached BGP-LS table (To dump,
- Filters the returned structured data for only those values which are useful and required
- Builds a NetworkX graph object representative of the NLRI extracted
- Draws visual representation of said NetworkX graph object to screen or file
# RPC tools
from proto import GoBGPQueryWrapper
# Graphing tools
import graphing
gobgp_target = {"target_ipv4_address": "172.20.10.2", "target_rpc_port": 50051}
rpc = GoBGPQueryWrapper(**gobgp_target)
lsdb = rpc.get_lsdb()
graph = graphing.build_nx_from_lsdb(lsdb)
graphing.draw_pyplot_graph(graph)
pip install -r requirements.txt
- NetworkX + matplotlib (
graphing.draw_pyplot_graph
)
pip3 install networkx matplotlib
To get pygraphviz working ...
Requires:
redhat: graphviz-devel python3-dev graphviz pkg-config
debian: python3-dev graphviz libgraphviz-dev pkg-config
You may need to prepare your own gRPC python interfaces if ours dont work. This process is described in the GoBGP guide on interfacing from your favourite language.
- https://www.grpc.io/docs/languages/python/quickstart/
python3 -m pip install grpcio
python3 -m pip install grpcio-tools
- Clone the gobgp repo and prep the rpc interface to python
gobgp\api> python -m grpc_tools.protoc -I./ --python_out=. --grpc_python_out=. *.proto
Because we can, and it's fun
Testing topologies are running ISIS, and 1 node peers with BGP-LS to the Ubuntu guest running GoBGP.
- Clouds are a breakout for the virtual environment, allowing RPC calls from the real-world.
- All nodes must support ISIS, but only the node peering to the GoBGP systems needs to support and peer BGP-LS
- e.g Only R2 has an iBGP peering for
address-family link-state link-state
(BGP-LS) to the GoBGP instance.
- e.g Only R2 has an iBGP peering for
This topology is described under tests/lab_topology_definitions/lab_topology.yaml
This topology is described under tests/lab_topology_definitions/18-node-topology.yaml
GoBGP configuration file is defined by the following YAML
global:
config:
as: 65001
router-id: 10.2.9.9
neighbors:
- config:
neighbor-address: 10.2.9.2
peer-as: 65001
transport:
config:
local-address: 10.2.9.9
afi-safis:
- config:
afi-safi-name: ls
- Supports loading BGP-LS table dumps from file, an alternative to RPC connections
- Resolves ISIS TLV 137 for actual hostnames
- Supports Psuedonodes
graphing.draw_pyplot_graph
for BGP-LS table dump tests/junos_bgpls_nopsn.yml
draws the following
graphing.draw_pyplot_graph
for BGP-LS table dump tests/18-node-isis-w-bcast-segment.yaml
draws the following
- YungTimAllen
- FlyingScotsman