This project simulates the real system every internet provider uses to find the best path for data — called BGP. Think of it like a massive, automated GPS for the entire internet.
Every company, university, or internet provider that owns a chunk of the internet is called an Autonomous System (AS)A company or organization that controls a block of IP addresses and has its own routing policy. There are ~70,000 ASes on the internet today.. They're like towns on a map, each with their own roads.
When you send a message, it doesn't magically jump from you to the destination. It hops through dozens of these "towns," and each one has to decide: which way should I forward this?
BGPBorder Gateway Protocol — the routing protocol that glues the internet together. It's been running since 1994 and handles over 900,000 routes today. is the system all these towns use to talk to each other about the best routes. This simulator recreates that exact system from scratch, using real internet data.
Built on real data from CAIDA — the organization that maps the actual internet's structure. These are real internet relationships, not made up.
Tap to reveal the analogy →
Each AS is like a city with its own roads. Big cities (Tier-1s) connect to everything. Small ones sit at the edges. Your data travels city to city.
Tap to reveal the analogy →
A town broadcasts: "Hey! I own these addresses. Here's how to reach me!" Every neighbour hears it and updates their map.
Tap to reveal the analogy →
Some towns pay others for access (providers). Some swap routes for free (peers). BGP always picks the route that makes the most business sense.
No computer science background needed. Press play and we'll walk you through it.
Like gossip spreading through a school — first up to teachers, then between teachers, then back down to students — BGP follows a strict three-phase order.
The smallest providers tell their upstream neighbours what they own. Think of it like students passing notes up to the teacher — rank by rank, until the headmaster (core) knows everything.
Providers at the same level swap route tables all at once — like everyone in a room turning to their neighbour simultaneously. This "atomic" swap stops routes from sliding more than one hop sideways.
The core now has a complete map and pushes it back down — like a teacher returning corrected homework to every student. By the end, every AS on earth knows the best path to every address.
Each file has one clear job. Clean separation — that's good engineering.
Every engineering decision has a reason. Here's the thinking behind the key ones — in plain English.
"8.8.8.0/24" get converted to simple integers at the start. Looking up a number is much faster than a string.relationship field is recorded from whoever received the route — customer beats peer beats provider.Upload your files, enter a target ASN, and watch the BGP simulation run entirely client-side via WebAssembly — no server, no uploads, no waiting.
asn|asn|rel per line123|456|-1seed_asn,prefix,rov_invalid| ASN | Prefix | AS Path |
|---|
Get the full C++ source code for the BGP Simulator. Click any file to download individually, or grab them all at once.