Skip to content

Repository files navigation

AS Tagging Python Toolkit

This repository contains the AS Tagging Python Toolkit, an open-source artifact from the paper Rethinking and Facilitating How We Classify Autonomous Systems by Network Properties (IMC '26).

Autonomous Systems (ASes) form the backbone of the Internet's routing infrastructure. This toolkit provides an open, flexible, and extensible way to assign, retrieve, and customize tags for ASes using feature snapshots.

Please open an issue to report bugs or request features!

Installation

Local/dev install (recommended for internal users)

# Clone and enter repo
git clone https://github.com/InetIntel/as-tagging.git
cd as-tagging

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate

# Upgrade packaging tools
pip install -U pip setuptools wheel

# Install package in editable mode
pip install -e .

# If you need ML tagging features:
pip install -e ".[ml]"

Jupyter kernel setup for the local venv

If you do not see your local venv in the notebook kernel selector, install and register an IPython kernel from the same virtual environment:

source .venv/bin/activate
python -m pip install -U ipykernel
python -m ipykernel install --user --name as-tagging-venv --display-name "Python (as-tagging-venv)"

Then reopen the notebook and select Python (as-tagging-venv) as the kernel. If the kernel still does not appear, run Command Palette -> Developer: Reload Window, then select the kernel again.

Quick start

1) Load snapshot data

from as_tagging import ASTagging, OfflineSnapshotProvider

DATA_PATH = "/path/to/as_feature_snapshots"
DATE = "2024-08"

provider = OfflineSnapshotProvider(DATA_PATH)
tagger = ASTagging(snapshot_provider=provider, date=DATE)

2) Query and inspect tags

# List tags for one ASN
tagger.list_tags(asn="12345")

# Get tag description
tagger.help(tag_name="Domestic")

# Fetch one tag for one or many ASNs
tagger.fetch_tag(tag_name="Domestic", asns="12345")
tagger.fetch_tag(tag_name="Domestic", asns=["12345", "67890"])

3) Define a custom composite tag

tagger.assign_tag(
    tag_name="Has IPv6 and Anycast",
    expression=lambda tags: bool(tags.get("IPv6 Only")) and bool(tags.get("Anycast")),
)

Notebooks and data

  • manual_tagging_example.ipynb: manual tag definition workflows.
  • ml_tagging_example.ipynb: supervised ML tagging workflows.
  • semi_supervised_ml_tagging_example.ipynb: semi-supervised ML tagging workflows.
  • Snapshot dataset: Dataset-AS-feature-snapshots (also mirrored on Zenodo and HuggingFace).

Citation

If you use this toolkit, please cite:

@inproceedings{chen2026rethinking,
  title        = {Rethinking and Facilitating How We Classify Autonomous Systems by Network Properties},
  author       = {Chen, Zhiyi and Bischof, Zachary and Testart, Cecilia and Dainotti, Alberto},
  booktitle    = {Proceedings of the 2026 ACM Internet Measurement Conference (IMC '26)},
  year         = {2026},
  address      = {Karlsruhe, Germany},
  publisher    = {ACM},
  isbn         = {979-8-4007-2327-8/2026/10},
  doi          = {10.1145/3777912.3839831},
  url          = {https://doi.org/10.1145/3777912.3839831},
}

If you use the AS feature snapshots, please also cite the Zenodo concept DOI: https://doi.org/10.5281/zenodo.22052392 (see Dataset-AS-feature-snapshots for the full citation, including per-version DOIs).

LICENSE

This toolkit is released under the MIT License. See the LICENSE file for details.

Note: the toolkit's code license (MIT) is separate from the AS feature snapshot data, which is distributed under Georgia Tech's Acceptable Use Agreement — see the Dataset-AS-feature-snapshots LICENSE for the data terms.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages