Sam Gilson

Packet Alley

Classroom tool

Packet Alley is a browser game that teaches TCP/IP by letting you watch packets move. You are handed a small network in a cartoon city — computers, printers, a noodle shop's server, hubs, switches and routers — and a job: address a packet so it arrives, swap a hub for a switch to stop collisions, break a switching loop, give a host its gateway, fix a routing table, point a packet away from a loop before its hops run out, find a neighbour's hardware address, open a connection the TCP way, and finish a transfer over a line that drops frames. You change the network on the map itself — click a device to swap it for another, click a waiting packet and point at the machine to send it to, click a cable to block it — then press Run, and the run plays out: every frame rides its cable at a speed you set, and a log in words says what each device did and why anything was lost. Every change is a click, never typed text, and the setups are written to motivate each one with a real-world case — default gateways, spanning tree, the TCP handshake behind every page load, a denial-of-service as demand outrunning a server's weakest link.

It was built for an instructor teaching TCP/IP who asked, on the lab Slack, for a game with networking challenges that visualises packets moving on a network. Like the BT Lab, it is meant to be both a teaching tool and a game: each level pairs a challenge with the one idea it teaches, a question for a third star, and a device inspector that shows what a switch or router actually knows at that moment. The levels come in four chapters, roughly one layer of the stack at a time — Frames on the Block (link layer: addressing, hub versus switch, a switching loop), Routes Across Town (network layer: gateways, the routing table, the hop count that stops a routing loop), Handshakes (transport layer: ARP, the three-way handshake, and go-back-N over a lossy link), and When Too Much Arrives (a single watch-only explainer of a server overwhelmed by a flood of ordinary requests). Each teaching chapter opens with short one- or two-choice missions and then a harder follow-up set of three, where you configure a whole larger network — more machines, more hops, more loops — ramping so only the last mission of each chapter gets genuinely technical. Nineteen levels in all.

Every packet carries a letter and is named in a list beside the map, and every map mark is a symbol, so nothing is told apart by colour alone; the status colours are the Okabe–Ito set, which stay distinct for colour-blind readers. The map has a zoom slider — with plus, minus and reset — and scrolls when enlarged, so a crowded network can be read up close, and overlapping cables curve apart so each one is visible.

Every rule runs in a Rust core in integer maths — the address arithmetic, the whole network simulation, the scoring — compiled to WebAssembly, and the page draws what the core returns. The simulated network is values in the core, which performs no input or output, so it cannot reach a real network. Every picture is drawn in TikZ, after the city in Sam_Comm_final.png.

Playing it

Pick a level and make its changes on the map — click a device, a waiting packet or a cable to open a chooser right there, or point at a glowing machine to send a packet to it; the same choices sit in a side panel you can hide. Early levels of each chapter ask for one or two changes; the advanced ones ask for several at once, and getting any wrong fails the run. Press Run and watch it play. The buttons under the map set the speed, pause, skip to the end or replay; the zoom slider enlarges the map; click a moving packet to open it header by header, or a device to see its table. Pass a level to unlock the next and answer one question for a third star. Your stars are kept in the browser you played in.

Open the project · Source code

All tools and games