Downloading Paths

Downloading paths is accomplished with the bgpobs.py python program provided in source code. Data is downloaded in batches determined by a start and end date. The observations are stored in a data format called a positive graph record or PGR. The PGRs are graph databases representing the union of all edges observed in all paths during data collection. An example execution to collect data from the first day of 2022 is shown here:

python bgpobs.py --start 1640995200 --end 1641081600 --dir 2022_01_01_pgrs/0/ --name 2022_01_01

It is useful to make a directory structure for your output PGR files as datasetName/timePeriodIndex where the time period index indicates a distinct time period of sampling the route collectors. Using this convention we can use the helper program pgr_to_bin.py can be used to merge all of the PGR files into a single binary dataset which is useful as it is the input format for the edge counting algorithm in the next chapter of this documentation. If we wanted to convert the PGR files we can run the following command:

python pgr_to_bin.py --dir 2022_01_01_pgrs --output_file 2022_01_01_pgrs.bin --T 1

The --T parameter indicates the number of time periods collected.

Requirements

bgpobs.py requires the pybgpstream library. The method for installing BGPStream and the python extension is available at BGP Stream.