Skip to content
aalbataPublic

About

Code and data for the letter "Anytime-Valid Alarms for BGP Incident Detection via Conformal e-CUSUM Monitors": online conformal p-values and betting-based e-CUSUM monitors for BGP incident alarms, with seven incidents, ordinary-day baselines and a one-command reproduction.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

VIGIL: anytime-valid BGP incident alarms

Code and data for the letter "Anytime-Valid Alarms for BGP Incident Detection via Conformal e-CUSUM Monitors."

VIGIL monitors one per-minute statistic, the BGP update activity scoped to an origin AS, converts each minute into an online conformal p-value, which is exactly uniform when the stream is exchangeable, and feeds it to a betting-based e-CUSUM. The only parameter is delta. Under exchangeability the probability of any alarm in m monitored minutes is at most 2 m delta, at every stopping time. The per-minute cost is one sorted insertion.

Results

Seven incidents on RouteViews route-views2 (delta = 1e-4, 10 smoothing seeds, five-hour sessions with a one-hour warmup):

incident date origin onset (UTC) detected median delay
Google route leak via MainOne 2018-11-12 AS15169 21:12 10/10 5 min
Cloudflare route leak via Verizon 2019-06-24 AS13335 10:34 10/10 1 min
CenturyLink / Level 3 outage 2020-08-30 AS3356 10:04 10/10 4 min
Facebook outage 2021-10-04 AS32934 15:39 10/10 2 min
Rogers outage 2022-07-08 AS812 08:44 10/10 2 min
Azure outage 2023-01-25 AS8075 07:08 10/10 12.5 min
Optus outage 2023-11-07 AS4804 17:05 10/10 0 min

Permutation control (null true by construction): 2 alarms in 880 streams. Ordinary days: 154 streams (22 ordinary sessions, every origin scored on every session); VIGIL raises 22.3 alarms on average over seeds. Classical charts and two learning-based detectors calibrated on held-out ordinary days to the same alarm budget: see results/results.json, key calibrated. Every seed-0 ordinary-day alarm is traced to the raw feed and classified in results/alarm_audit.json.

Reproduce

Fast path (uses the per-minute CSVs shipped in data/, no downloads, a few minutes):

pip install -r requirements.txt
python reproduce.py

The alarm audit and the per-peer breakdown replay the raw MRT files, which are not shipped (data/raw/ is ignored by git), so the fast path keeps the shipped results/alarm_audit.json and results/linx_leak_peers.json and regenerates everything else.

Full path (downloads about 3.8 GB of MRT update archives from archive.routeviews.org, rebuilds every per-minute CSV with pybgpkit-parser, then runs the experiments, the alarm audit, the per-peer breakdown, and the figures):

python reproduce.py --full

No external binaries are needed. The pipeline runs on Windows, Linux, and macOS with Python 3.12. The results in the letter were produced on Windows 11 (Intel Core Ultra 7 155U, 16 GB RAM) with Python 3.12.10 and the package versions pinned in requirements.txt.

Layout

  • src/monitor.py the monitor: online conformal p-values, power-mixture betting, two one-sided e-CUSUMs with re-arm; CUSUM, EWMA, and z-score charts
  • src/learned.py Isolation Forest and autoencoder baselines on the same stream
  • src/sessions.py monitored origins, sessions, incident periods
  • src/pipeline.py MRT download and per-minute counting
  • src/run_experiments.py every experiment, writes results/results.json
  • src/audit_alarms.py traces each ordinary-day alarm to the raw feed and classifies it, writes results/alarm_audit.json
  • src/peer_breakdown.py per-peer shares of origin-scoped announcements in one session, writes results/linx_leak_peers.json
  • src/make_figures.py the figures in the letter
  • data/route-views2/counts_*.csv, data/route-views.linx/counts_*.csv per-minute counts for every session (300 rows each)

Data columns

Each CSV has one row per minute. The first column, minute_utc, is the start of the minute in seconds since the Unix epoch (UTC); every session file has 300 rows 60 s apart, and the t0 and minute_epoch fields in results/ use the same units. Collector-wide columns: ann, wdr (announcements and withdrawals), novel (announcements carrying an AS path not seen earlier in the session). For each monitored origin O:

  • scoped_O announcements originated by O plus withdrawals of prefixes seen earlier in the session with origin O (the monitored statistic)
  • a_O, w_O the announcement and withdrawal parts of scoped_O
  • pfx_O distinct prefixes touched by those updates in the minute
  • peers_O distinct collector peers reporting them
  • newpath_O announcements whose AS path had not been seen for O earlier in the session
  • ochg_O announcements of a prefix learned with origin O that carry a different origin

Sessions

Every session is five hours of 15-minute update files. Incident sessions place the public onset between 150 and 230 minutes after the session start. Ordinary-day sessions use the same hours on days from the adjacent weeks, screened against public incident records for the monitored origin. The second collector, route-views.linx, covers every incident session and the first ordinary day of each period.

License

MIT

About

Code and data for the letter "Anytime-Valid Alarms for BGP Incident Detection via Conformal e-CUSUM Monitors": online conformal p-values and betting-based e-CUSUM monitors for BGP incident alarms, with seven incidents, ordinary-day baselines and a one-command reproduction.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages