Skip to main content

Crate originet

Crate originet 

Source
Expand description

Map IP addresses to origin ASNs with CAIDA’s RouteViews prefix-to-AS snapshots.

The crate is a thin library under the originet binary:

  • pfx2as parses the pfx2as text format CAIDA publishes;
  • table holds a longest-prefix-match table for IPv4 and IPv6;
  • caida knows the dataset layout on publicdata.caida.org and picks a snapshot by date;
  • fetch downloads the index and the snapshots into a local cache;
  • cache lists what the cache holds and prunes it;
  • load fills a table from a local file or from CAIDA and records where it came from;
  • input reads and validates the addresses to look up;
  • output serializes results as JSON, JSON Lines, CSV, TSV or Parquet.

Modules§

cache
Inventory and pruning of the local cache.
caida
Layout of CAIDA’s RouteViews prefix-to-AS datasets and snapshot selection.
fetch
Downloads CAIDA’s index and snapshots into a local cache.
input
Reading and validating the addresses to look up.
load
Filling a Table from a local file or from CAIDA, with the provenance of each load.
output
Result records and the output formats.
pfx2as
Parser for CAIDA’s pfx2as format.
table
Longest-prefix-match table built from pfx2as entries.

Constants§

USER_AGENT
The User-Agent sent to CAIDA, so the data host can tell who is downloading.
VERSION
The crate version, as compiled into the binary.