05/06/2024 | Press release | Distributed by Public on 05/05/2024 16:57
BGPKIT is a command-line utility program that helps users quickly pull Internet routing-related information from publicly available sources and is available on GitHub.
In BGPKIT version V0.5, we added support for querying Cloudflare Radar 's new BGP routing statistics and prefix-to-origin mapping APIs, the same APIs that power the Cloudflare Radar routing section. users can now quickly glance at routing stats for any given Autonomous System Number (ASN), economy, or the whole Internet. Users can also quickly look up prefix origins and examine their RPKI validation status as well as prefix visibility on the global routing tables.
Using
We added a new command group in V0.5, which contains the following subcommands:
Cloudflare API token needed
Since the command relies on querying data using the Cloudflare Radar public API, we also need to specify a user API token as the environment variable . Obtaining an API token is free and only needs a Cloudflare account. Interested users can follow their official tutorial to obtain a token. The environment variable can be set in a file in the current directory, or set in ~ or , and so on.
Users can query the routing statistics for a given economy or ASN. For example, returns the routing stats for the United States, while returns the stats for Cogent (AS174) (Figure 1).
The displayed table is further divided into three rows, one for overall counting, and one for IPv4 and IPv6-specific counting. For each row, we show the following fields:
Users can query the prefix-to-origin API to get the mapping of origin ASes and their originated prefixes on the global routing table.
In Figure 2's example, , we ask for all the prefixes originated by with the RPKI validation status to be invalid. This command returns the list of RPKI invalid prefixes originated by at the time of generating the dataset.
Questions it can answer now (more in the future)
Here is a selected list of questions the command can answer you:
Powered by Cloudflare Radar free API
Cloudflare Radar is a hub that showcases global Internet traffic, attack, and technology trends and insights.
About Cloudflare RadarWhere Cloudflare Radar shines is its data openness. Everything you see on the Cloudflare Radar website is powered by their free publicly available APIs. It's a treasure trove, and all users need is a free API token to access everything.
At BGPKIT, we think we can further improve the usability of the APIs by exposing them as a proper Rust SDK: . This is our (unofficial) effort to bring Cloudflare Radar's rich data to Rust developers. For example, is powered by this SDK.
Mingwei Zhang (Twitter, Mastodon) PhD is a senior systems engineer at Cloudflare, building complex high-throughput data pipelines and conducting data analysis on significant Internet routing events. He is the founder of open source BGP data analysis toolkit BGPKIT.
This was originally published on the BGPKIT blog.
The views expressed by the authors of this blog are their own and do not necessarily reflect the views of APNIC. Please note a Code of Conduct applies to this blog.