Skip to content
All projects

Case study · Build · 2026

NetTracer

The developer side

A network lab in the browser. Packets cross a 3D network one frame at a time, and each hop shows which header fields changed.

NetTracer is a network lab in the browser. It follows one packet across a 3D network a frame at a time and shows which header fields change at each hop. It is built with React, Three.js, Tailwind CSS and Vite, and its 7 guided labs and sandbox are live with the code public.

NetTracer on lab 02, IP Routing and MAC Rewrite. A packet sits between the core router and the edge switch in a 3D network of 8 devices, beside a capture table and a byte diff where TTL 64 becomes 63
  • What it does

    A 3D network lab that walks packets hop by hop and shows which header fields change at each device.

    See the developer side
  1. 01

    The idea

    Follow one packet across a network and see how the network works. Every frame is on screen, along with the header fields that change at each hop.

  2. 02

    What I did

    Built an engine that turns a network and a traffic flow into a packet capture, then set it under a 3D scene with 7 guided labs and a sandbox.

  3. 03

    Where it stands

    Live, with the code public. It has no tests yet, and the header checksum it shows is a stand-in.

Seven guided labs and a sandbox run on one engine.

  1. Guided labs

    Seven labs, each with a storyline of steps. Three of them start broken, and the capture shows where the packet dies.

  2. 3D stage

    Laptops, switches, a router and rack servers on a floor grid. Packets travel the cables as capsules.

  3. Capture table

    Every frame in order, with its time, source, destination, protocol and size. Click a row to jump to it.

  4. Step narrative

    Each step says why the packet exists and what the device at this hop did with it.

  5. Byte diff

    The headers at each layer. A field that changed at this hop shows its old value struck through beside the new one.

  6. Explode OSI Layers

    Splits a packet on the stage into its L2, L3, L4 and L7 slabs.

  7. One-click fixes

    VLANs, gateway repair, HSRP, TLS and route restore. Each fix re-runs the simulation, so the capture shows what it changed.

  8. Sandbox

    Add laptops and servers, then click any device to edit its IP, mask, gateway, VLAN, uplink or power. A traffic generator runs a new capture from the host you pick.

Each lab answers one question.

  1. How does a frame reach a MAC address nobody has learned yet?

    Lab
    01 ARP & Switch Flooding
    In the capture
    SW1 floods the ARP broadcast and learns each sender’s port. After that the ping goes out one port
  2. What changes when a packet crosses a router?

    Lab
    02 IP Routing & MAC Rewrite
    In the capture
    R1 writes a new Ethernet frame and the IP addresses never change. Four fields differ after that hop, with TTL going from 64 to 63
  3. What has to happen before a web page loads?

    Lab
    03 HTTP + DNS + TCP Full Flow
    In the capture
    The DNS lookup and the TCP handshake come first. The GET and its 200 OK follow, 40 frames in all
  4. Why can’t PC-A open any website?

    Lab
    04 Broken Gateway Diagnosis
    In the capture
    Its gateway is 192.168.1.99, an address nobody on the LAN owns. Three ARP requests go unanswered and the packet is dropped
  5. What happens when the only router loses power?

    Lab
    05 Router Failure & HSRP
    In the capture
    ARP for the gateway times out and nothing leaves the LAN. The fix adds a standby router behind a shared virtual IP
  6. Where does a packet go when its route is missing?

    Lab
    06 Missing Route to 8.8.8.0/24
    In the capture
    R1 has no entry for 8.8.8.0/24, so the DNS query is dropped at the router
  7. How do two VLANs talk over one cable?

    Lab
    07 Inter-VLAN Routing on a Stick
    In the capture
    PC-A in VLAN 10 pings PC-C in VLAN 20 through one trunk to R1. The 802.1Q tag changes from 10 to 20 on the way back out

The engine is pure functions, so every edit re-runs the capture.

  1. 01

    Network and flow

    Each device’s IP, mask, gateway and VLAN

    One traffic flow, such as a ping

  2. 02

    Engine

    Pure functions

    ARP caches and switch MAC tables

    VLAN domains and HSRP election

    Longest-prefix routing

    Returns A list of frames, each with the fields that changed since the hop before

  3. 03

    Three.js stage

    Devices and cables built in code

    Packets as capsules on the floor

  4. 04

    React interface

    Capture table and step narrative

    Byte diff and fixes

    Keys Space plays or pauses, and the arrow keys step one frame

How a network on screen becomes a capture

The whole app is one React component, 2,960 lines long. The engine sits at the top of the file and needs nothing from the other two parts.

A switch records the sender’s MAC against the port a frame came in on. It floods a frame whenever it has no single port to send it to, which covers broadcasts and any MAC it hasn’t learned yet. A router picks the route with the longest matching prefix, and every one of those rules reads the device’s current settings.

The health score starts at 100 and loses points for each problem.

Health score

  • health score100 minus the penalty of every open issue, never below 0

The header shows the score in green from 85 and in amber from 60. Anything lower is red.

Points each issue takes off the health score
ItemPenalty
A gateway that no router owns30
The only router is down30
A router with no route to its own network25
Two hosts on one IP20
Plain HTTP on port 8015
A single router with no standby10
Every host in one broadcast domain10
A host that bypasses the HSRP virtual gateway8
A router down while the standby carries traffic5
Points each issue takes off the health score. The base network starts at 65, with 35 points lost across the issues it ships with. Apply every fix the panel offers and it reads 100.

Routing rules

  • same subnettwo addresses match once each is ANDed with the mask
  • route chosenthe matching route with the longest prefix
  • TTLstarts at 64 and drops by 1 at each router
  • ARP timeout3 requests with no answer

Lab devices start on /24 masks.

The three labs that start broken score lowest before any fix.

The engine runs on its own in Node, with no browser and no 3D scene. The figures below come from running it that way against all seven labs.

  1. 01 ARP & Switch Flooding (8)65
  2. 02 IP Routing & MAC Rewrite (16)65
  3. 03 HTTP + DNS + TCP Full Flow (40)65
  4. 04 Broken Gateway Diagnosis (7)35
  5. 05 Router Failure & HSRP (7)45
  6. 06 Missing Route to 8.8.8.0/24 (7)40
  7. 07 Inter-VLAN Routing on a Stick (16)75
Health score as each lab opens. Frames in each capture in parentheses. Labs 04 to 06 end in a drop, and each one delivers once its first suggested fix is applied. No lab opens in the green, which starts at 85.

The checksum on screen is a stand-in.

The Header checksum field shows a 16-bit slice of an FNV-1a hash over the source, destination, TTL and identification. It changes whenever TTL changes, which is the point lab 02 makes.

A real IPv4 checksum is a ones’ complement sum over the whole header, so the value here won’t match a real capture. The README says checksums are computed from live device config. That holds for the inputs, though the arithmetic is a hash.

What else is simplified

  1. UDP checksums

    On screen
    A checksum on DNS and HSRP datagrams
    Underneath
    The same hash, taken over the ports and the length
  2. Timing

    On screen
    A time on every frame, such as 0.015 s for lab 01
    Underneath
    Fixed delays. Each hop adds 2 ms or 6 ms, and an ARP request nobody answers adds 1 s
  3. TCP and TLS

    On screen
    A handshake, then data
    Underneath
    Scripted packets with fixed ports and sizes. The TLS payload is placeholder bytes
  4. A drop at a router

    On screen
    The capture ends where no route matches
    Underneath
    A real router would also send ICMP Destination Unreachable back. The step note says so
  5. HSRP failover

    On screen
    A Hello from the Active router, and a standby that takes over
    Underneath
    The powered router with the highest priority owns the virtual IP at once. No hold timer runs

The whole lab ships as one component.

  1. A pure engine

    It takes a network and a flow and returns a list of frames. Editing a device runs it again, so the capture always matches the settings on screen.

  2. Hardware built in code

    Laptops, switches, the router and the servers are Three.js geometry. The app loads no model files.

  3. One file

    All three parts live in one component, with the engine at the top.

  4. Pixel ratio capped at 2

    The renderer never draws more than 2 device pixels for each CSS pixel.

  5. Cleanup on exit

    Leaving the stage cancels its animation frame and removes its listeners. Geometries, materials, textures and the renderer are all freed.

  6. A note on small screens

    Under 1,024 px wide, the app says it was built for a desktop screen and offers an Open anyway button.

Each protocol keeps one color from the stage to the capture.

The interface is dark, with Inter for text and JetBrains Mono for labels and the capture table. Color carries the protocol.

  1. Protocol colors

    Eight of them. ARP is cyan, DNS is amber, TCP is blue, and a drop is always red. A packet on the stage and its row in the capture share the color.

  2. Device accents

    Each device type has its own accent, shown as the dot on its label.

  3. Camera

    A 28° camera looks down on the network like a diorama. Drag to orbit, right-drag to pan, scroll to zoom, and click a device to inspect it.

  4. Playback

    Four speeds from 0.5x to 4x, with a strip of ticks that marks every frame.

Live, with the code public and no tests yet.

Guided labs
7
Guided labs
Devices in the base network
8
Devices in the base network
Issues the health score checks for
9
Issues the health score checks for
Automated tests
0
Automated tests

What I’d change where NetTracer stops short.

Next

  1. Real checksums

    Swap the hash for real ones’ complement checksums on IPv4 and UDP. A real IPv4 checksum still changes with TTL, so lab 02 keeps its point.

  2. Tests and CI

    Turn the per-lab figures on this page into the engine’s first tests, and run them on every pull request. The engine already runs without a browser.

  3. A phone view

    Put a still of a lab above the Open anyway button, or build a layout for small screens.

  4. A check by hand

    Walk the capture rows by keyboard, then play a capture with reduced motion turned on.

Known limits

  1. Checksums

    The IP and UDP checksums are hash stand-ins. They won’t match a real capture.

  2. No tests

    Nothing checks the engine yet, and the repo has no CI. One pull request has merged since the first build on November 5, 2026, and it added no tests.

  3. Desktop only

    There is no phone layout. A small screen gets the note and the Open anyway button.

  4. Keyboard and motion

    Capture rows now take keyboard focus, and Up, Down, Home and End move between frames. With reduced motion on, a new capture waits for Play and packets move only when you play or step. The pull request notes list both changes as not checked.

  1. Built

    A network lab in the browser where packets cross a 3D network one frame at a time.

  2. Found

    The three broken labs open with the lowest health scores, 35 to 45, and each delivers after its first fix.

  3. By the numbers

    Guided labs
    7
    Issues the health score checks for
    9
    Automated tests
    0
  4. The catch

    Nothing checks the engine yet. These scores come from running it in Node, with 0 automated tests behind them.

  5. Next

    Swap the hash stand-ins for real ones’ complement checksums on IPv4 and UDP.