BGPCommunityWatch can be used for the analysis of historical or real-time BGP data to detect routing events based on changes on the values of the BGP Commuinities attribute.
Usage:
java BGPCommunitiesMon.jar [options...] arguments...
--collectors VAL : Comma-separated list of BGP Collectors. (default: all)
--communities VAL : Comma-separated list of 32-bit BGP Community values.
--outdir VAL : Path to the output directory. (default: .)
--period VAL : Time period for which BGP data will be collected.
Format: YYYYMMDD.hhmm,YYYYMMDD.hhmm
--facilities VAL : Comma-separated list of facility names to restrict the
scope of the analyzed AS links. (default: all)
Example: java BGPCommunityWatch.jar --collectors rrc00 --communities 2914:1201 --outdir path/to/dir/ --period 20180407.0000,20180410.0001
BGPCommunityWatch uses BGPReader v2.0 to obtain a stream of BGP data, therefore you need to install BGPStream.
The parsing of the BGP paths requires the following CAIDA datasets as input:
- AS relationships. Both serial-1 and serial-2 can be used, but serial-2 is more complete and therefore preferred.
- IXPs Dataset, in particular the
ixs.jsonl
andix-asns.jsonl
files.
Sample files are included already in the data/
directory of this repository,
but you should update them depending on the measurement period of your choice.
Once you install BGPstream and download the required datasets,
edit the resources/config.properties
file to define the following properties:
bgpreader_bin
: Filepath to the BGPReader binaryrelationships_file
: Filepath to the bzip'd AS relationships fileix_dataset
: Filepath to theixs.jsonl
fileix_asn_dataset
: Filepath to theix-asns_201802.jsonl
pdb_netfac_url
: The URL to the endpoint of the PeeringDB API that returns the AS-to-Facility memberships.pdb_rsasn_url
: The URL to the endpoint of the PeeringDB API that returns the ASNs of type Route Server.euroix_url
: The URL to the Euro-IX IXP Service Matrix. Note: At the moment the Euro-IX service matrix is not publicly available, so this property is more of a future placeholder.stability_hours
: The number of consecutive hours during which BGPCommunityWatch should not observe any change in the path between a given (BGP peer IP, prefix) pair, in order to consider the path 'stable'.
The default values in the resources/config.properties
should work out-of-the-box,
if you cloned this repository and didn't change the default BGPStream configuration.
To compile the code you need to download three external libraries:
After you download the jar files, go to the src/main/java
directory and compile the code specifying the classpath to the download jars:
javac -cp .:/<download_path>/args4j-2.33.jar:/<download_path>/json-simple-1.1.1.jar:/<download_path>/commons-compress-1.16.1.jar vgiotsas/Main.java
You can then execute the compiled code, including again the classpath to the jar files:
java -cp .:/<download_path>/args4j-2.33.jar:/<download_path>/json-simple-1.1.1.jar:/<download_path>/commons-compress-1.16.1.jar vgiotsas/Main --outdir output --collectors rrc00 --communities 2914:1201 --period 20180407.0000,20180410.0000 --facilities "Interxion Frankfurt (FRA1-12)"