Foreword
It so happens that when analyzing the reasons for the degradation of network services, you want to have a time machine. Well, or at least something that would record the history of route measurements ... If you have ever found yourself in such a situation, then perhaps it will be interesting.
Modern networks based on routing IP packets, or rather the services they provide, are in fact controlled by BGP. This protocol was designed in the late 1980s on three napkins. Yes, since then a lot of features have been added to this protocol, including the exchange of VPN routing information, traffic filtering rules and other useful things, but the basis there remains the same, described on three napkins. And this has its own plus, because this protocol is very simple in its essence.
But I wanted to talk not about its simplicity, but about "waving fists after a fight", which is often faced by any network operation service, or NOC - network operation center (and maybe center).
" ", " -, 5 ". 5 . ? . , "" 5 , ? , - , , . - . ( ) . - , . , bgplay. . , , , .
. ( , ). , - ? , .
. , , BGP - exabgp. . , , - python. , . , . python (, GIL), , . ( ) , . BGP (, golang!). ? , , bgp- . . .
Rust — . BGP . exabgp BGP FSM , Rust API, std , . zettabgp, — bgpexplorer.
. Bgpexplorer bgp-, ( route reflector) bgp-, . RIB (Routing Information Database) , . -. - , .
- . , () .
, git rust.
$ git clone https://github.com/wladwm/bgpexplorer
...
$ cd bgpexplorer
$ cargo build
...
. .
Cisco, :
! 65535 ,
router bgp 65535
! , IBGP
neighbor 10.1.1.1 remote-as 65535
!
neighbor 10.1.1.1 update-source Loopback0
!
neighbor 10.1.1.1 transport connection-mode passive
address-family ipv4
!
neighbor 10.1.1.1 activate
!
neighbor 10.1.1.1 route-reflector-client
! ipv4 labeled-unicast
neighbor 10.1.1.1 send-label
address-family vpnv4
! VPNv4
neighbor 10.1.1.1 activate
neighbor 10.1.1.1 send-community extended
$ cat > bgpexplorer.ini <<EOF
[main]
httplisten=0.0.0.0:8080
httproot=contrib
session=s0
whoisjsonconfig=whois.json
[s0]
mode=bmpactive
bgppeer=10.0.0.1
peeras=65535
EOF
main :
httplisten — http
httproot — . index.html .
Whoisjsonconfig whois
Session – , bgp, s0
(s0 ) :
bgppeer — BGP
Peeras —
protolisten — :, BGP BMP
Mode —
mode :
bgppassive —
bgpactive —
bmpactive — BMP
bmppassive — BMP
ini- bgpexplorer, ,
cargo run
.
RIB - IPv4, IPv6, VPN ..
, - .
. , .
community, aspath, nexthop, route-target, route-distinguisher.
When you hover over ASn, the address of the routers, a query to whois or DNS will be performed, and the information received will be displayed in the popup. Sometimes it is long, but it can be useful.
I would be glad if this tool is useful to someone else. Found problems, wishes, ideas, constructive criticism are welcome.