This toolkit includes two Python scripts designed to facilitate the retrieval and analysis of Border Gateway Protocol (BGP) announcements from a range of collectors. Using using CAIDA's PyBGPStream library, these toolkit is aimed at detecting routing anomalies and understanding global internet routing dynamics.
- Basic Query: Perform general queries to retrieve BGP announcements.
- Prefix Search: Specifically retrieve BGP announcements filtered by IP prefix.
- Support for multiple collectors from RouteViews and RIPE RIS.
- Configurable for fetching either updates or RIBs (Routing Information Base).
- Python 3.6+
- pybgpstream
Ensure Python is installed on your system and install pybgpstream
via pip:
pip install pybgpstream
This script performs basic queries to retrieve BGP announcements for a specified time range from a given list of collectors. It can be configured to fetch either updates or RIBs.
Edit the script to include your desired time range and collectors, then run:
python bgp_collector_basic_query.py
This script is developed for retrieving BGP announcements filtered by a specific IP prefix, from all available collectors, within a specified time range.
Configure the script with the desired time range, collectors, and IP prefix, then execute:
python bgp_collector_prefix_search.py
- Time Range: Define the start and end times within the scripts to specify the period for retrieving BGP announcements.
- Collectors: Modify the list of collectors as required. A comprehensive list is included, but can be adjusted to fit your needs.
- Prefix Filter (for
bgp_collector_prefix_search.py
): Adjust theprefix
variable to filter announcements for a specific IP prefix.
We welcome contributions to improve the BGP Data Retrieval Toolkit. Feel free to submit pull requests or create issues for bugs and feature requests.
This project is licensed under the MIT License - see the LICENSE file for details.