Skip to content

mrt analysis

Thomas Mangin edited this page May 17, 2026 · 4 revisions

Pre-Alpha. This page describes behavior that may change.

Ze ships a standalone tool, ze-analyse, for processing real-world BGP data from the public route collectors (RIPE RIS, RouteViews). It reads MRT dump files and extracts the statistics that inform Ze's internal buffer sizing, caching strategies, and congestion handling. It is not a runtime component: it is the offline tool used to make design decisions about the runtime, and to sanity-check changes against real-world traffic.

If you are hunting a specific bug against an MRT capture, this is also the tool that feeds ze bgp decode through a pipe.

Building it

make analyse

This produces bin/ze-analyse. The target is independent from make ze, so you can build it without building the daemon.

Fetching the data

ze-analyse download grabs MRT files from two public BGP collectors. Files land in test/internet/ (gitignored).

bin/ze-analyse download                     # Today's data at 00:00 UTC
bin/ze-analyse download 20260324            # Specific date
bin/ze-analyse download 20260324 1200       # Specific date and time
bin/ze-analyse download -o /tmp/mrt         # Custom output directory
Source Type Interval Size
RIPE RIS rrc00 (Amsterdam) BGP4MP updates 5 min ~5 MB per file
RIPE RIS rrc00 TABLE_DUMP_V2 RIB Latest ~400 MB
RouteViews route-views2 BGP4MP updates 15 min ~2 MB per file
RouteViews route-views2 TABLE_DUMP_V2 RIB 2-hour intervals ~100 MB

RouteViews bz2 files are converted to gzip on download for Go stdlib compatibility.

Commands

density

Measures how many NLRIs each UPDATE carries and how many UPDATEs arrive per second. Separates traffic into setup (table dumps, convergence) and maintenance (steady-state churn) using per-source-peer burst detection.

bin/ze-analyse density test/internet/ripe-updates.*.gz

Output sections: NLRIs per UPDATE distribution (announced, withdrawn, total); UPDATEs per active second distribution; setup vs maintenance classification per source peer; per-peer maintenance rate distribution; channel-sizing recommendation with empirical P50, P95, and P99.

The output feeds the per-peer forward pool channel sizing. Results are documented in the in-tree Update Density Analysis.

attributes

Analyses attribute repetition across routes to guide caching decisions. Measures per-attribute cache hit rates, bundle deduplication effectiveness, and temporal locality (consecutive identical bundles).

bin/ze-analyse attributes test/internet/latest-bview.gz 2>/dev/null | jq .
bin/ze-analyse attributes test/internet/latest-bview.gz >/dev/null          # summary only

JSON on stdout, human summary on stderr, which is the combination you want for a run that writes the JSON to a file while you watch the summary scroll by.

communities

Identifies per-ASN community defaults: communities that appear in nearly every route from a given ASN. Those defaults can be assumed present in a cache, encoding only exceptions to save wire bytes.

bin/ze-analyse communities test/internet/latest-bview.gz
bin/ze-analyse communities --threshold 0.90 --format json test/internet/latest-bview.gz
bin/ze-analyse communities --post-policy test/internet/latest-bview.gz
Flag Default Description
--threshold 0.95 Minimum frequency to be considered a default.
--min-routes 1000 Minimum routes from an ASN to generate defaults.
--format yaml yaml or json.
--post-policy off Strip action communities to simulate a route server post-policy view.

aspath

Builds a reversed trie over AS_PATHs from MRT dumps to measure suffix sharing. Reports compression ratio, path length distribution, trie depth stats, fanout, and top origin ASNs.

bin/ze-analyse aspath test/internet/latest-bview.gz
bin/ze-analyse aspath test/internet/latest-bview.gz 2>/dev/null | jq .

JSON on stdout, human summary on stderr.

count-attrs

Counts how many path attributes each route carries, and produces a distribution table showing the typical attribute-set size.

bin/ze-analyse count-attrs test/internet/latest-bview.gz

mrt-dump

Dumps MRT records as BGP UPDATE hex, one per line. Useful for piping into ze bgp decode or any other tool that takes hex UPDATEs on stdin.

bin/ze-analyse mrt-dump test/internet/ripe-updates.*.gz | head -5
bin/ze-analyse mrt-dump test/internet/latest-bview.gz | bin/ze bgp decode -

MRT formats

ze-analyse handles two MRT record types from RFC 6396.

Type Content Used by
TABLE_DUMP_V2 RIB snapshots (one entry per route per peer). attributes, aspath, communities, count-attrs, mrt-dump.
BGP4MP Live UPDATE messages with timestamps. density, attributes, aspath, communities, mrt-dump.

Both .gz and .bz2 compressed files are supported.

See also

Adapted from main/docs/guide/mrt-analysis.md.

Home

About

First Steps

Configuration

Operation

Interfaces

Plugins

Plugin Development

Chaos Testing

Blueprints

Development

Reference

Clone this wiki locally