Skip to content

Add two-tier transit detection algorithm for AS relationship inference#11

Merged
digizeph merged 3 commits intomainfrom
dev/as2rel-revisions
Mar 26, 2026
Merged

Add two-tier transit detection algorithm for AS relationship inference#11
digizeph merged 3 commits intomainfrom
dev/as2rel-revisions

Conversation

@digizeph
Copy link
Copy Markdown
Member

Summary

  • Refactor lib.rs into dedicated modules (as2rel, peer_stats, pfx2as) using a processor pattern (new()process_*()into_*())
  • Add TRUE_TIER1 (14 ASes) and CANDIDATE_TIER1_V4/CANDIDATE_TIER1_V6 constants; candidate ASes (Zayo AS 6461, Hurricane Electric AS 6939) are only valid transit points when their next hop is also a tier-1 AS
  • Reduces HE (AS 6939) downstream count by ~70% in IPv6 and Zayo (AS 6461) by 14–18%, fixing over-counting of transit relationships
  • Remove AS 1239 (Sprint) from tier-1 list to match bgp.tools definition; fix TIER1_V4 array (removed invalid ASN 0 placeholder)
  • Add 6 unit tests for find_transit_point covering all algorithm branches including HE and Zayo candidate behavior

- Add TRUE_TIER1 (14 ASes) and CANDIDATE_TIER1_V4/V6 constants
- Add find_transit_point() with candidate tier-1 validation: Zayo (6461)
  and Hurricane Electric (6939, IPv6 only) are only valid transit points
  when their next hop is also a tier-1 AS
- Reduces HE downstream count by ~70% and Zayo by 14-18% at tested collectors
- Fix As2RelCount.rel doc comment (remove undocumented rel=2 value)
- Add 6 unit tests for find_transit_point covering all algorithm branches
- Remove internal function re-exports from crate root (compile_as2rel_count,
  update_as2rel_map, find_transit_point)
- Remove #![allow(dead_code)] crate attribute
- Remove no-op drop(elem) call in parse_rib_file
- Add AGENTS.md with coding guidelines
- Add *.gz and *.json to .gitignore
- Remove deleted dev binary entries from Cargo.toml
@digizeph digizeph merged commit 2ba476c into main Mar 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant