Skip to content

Implementation Details

Adianto Wibisono edited this page Dec 9, 2019 · 7 revisions

Model

Each input files (from RIRs or IANA file) is represented as Records data structure. These records essentially are containers for asns, ipv4s, and ipv6s lines.

Each of these line is in turn represented as a Record, which mainly represent the internet resource range, and other information (registry, country, type, etc).

We rely on Guava's RangeMap to map each resource's range with a Record, and performs range overlaps detection with underlying Guava range operations. This is in contrast with previous attempt that uses internal Red Black Tree to deal with this.

Main processing

Main logic for generating stats is in main.Stats file, which operates on Records abstraction. After all fetching, parsing, and representing each RIRs, IANA and previous result as Records, stats generation proceed as follows:

  • IANA records is partitioned between RIR allocated ranges, and others i.e special purpose ranges/resources reserved for IETF/IANA.
  • RIRs Records, IANA non RIRs data and are then combined. The detailed logic of how we combine and resolve conflict can be seen in combineResources.
  • Records of previous results, are used to resolve conflict while performing above combination. At this stage we have combined RIRs data and also detected conflicts.
  • Unclaimed resources are calculated by subtracting what IANA allocates for RIR with the combined result above.
  • Overclaimed is calculated by subtracting what is on the combined result, but not specified in IANA file.
  • Ianapool is calculated from subtracting /0 with what we've combined and the ones unclaimed.
  • The end results of combined delegated stats is obtained by appending previous combined results with unclaimed and ianapool.
Clone this wiki locally