Build a TCP/IP Stack from Scratch · Module 01

Checkpoint and Cleanup

Checkpoint and Cleanup

Nice work — your mini network is officially alive! You've now got two containers chatting over a private subnet, and you've watched real packets move between them. This setup is the foundation for everything we'll build from here.

Let's lock in this progress and keep your workspace clean.

Save your work with Git

We'll tag this exact working environment so you can always roll back to it later. From the root of your netstack repo (not inside lab/):

git add .
git commit -m "Module 1 – Lab environment setup complete"
git tag v01_setup

That tag marks the version where the network works but before we start replacing the kernel stack with our own code.

Later, if you ever need to return here:

git checkout v01_setup

and your containers, Dockerfiles, and network setup will be exactly as they were at this stage.

Stopping and cleaning up the lab

When you're done experimenting, stop the containers:

docker compose down

This removes the containers but keeps the images and network definition, so the next time you run

docker compose up -d

everything springs back to life.

If you ever want a completely fresh start:

docker system prune -f

(be careful — this deletes unused images and networks system-wide).

You've now completed the base environment every future module will build on. From here, we'll start taking over control of the packets — first by reading and parsing them ourselves.