Luleå University of Technology
This repository contains ns-3 simulation scripts and lab questions for 6 labs covering Chapters 2–6 and 8 of Kurose & Ross, Computer Networking: A Top-Down Approach (8th edition). Each lab generates PCAP files that you analyze in Wireshark to answer questions about network protocol behavior.
To complete these labs, you will need:
- 📖 Textbook: Kurose & Ross, Computer Networking: A Top-Down Approach, 8th edition. (Chapter numbers may vary between editions)
- 🦈 Wireshark: Free packet analyzer. Download here.
- 🛠️ ns-3.46: Network simulator. (Setup instructions below)
Tip
Windows users:
If you are on Windows, we heavily recommend using WSL with Ubuntu and running ns-3 inside WSL.
This is the recommended setup because these labs are Linux-based, but the generated .pcap files still open perfectly in your native Windows Wireshark.
🐧 Linux is required. Ubuntu 22.04 or 24.04 are recommended and known to work flawlessly.
Open your terminal and install the required tools:
sudo apt update
sudo apt install g++ python3 cmake ninja-build git wgetDownload and extract the ns-3.46.1 source, then build the simulator:
# Download and extract ns-allinone-3.46.1
wget https://www.nsnam.org/releases/ns-allinone-3.46.1.tar.bz2
tar xvf ns-allinone-3.46.1.tar.bz2
cd ns-allinone-3.46.1/ns-3.46.1
# Configure and build
./ns3 configure --enable-examples
./ns3 buildClone this repository directly into the scratch/d0002e/ directory inside your ns-3 tree.
# From the ns-3 root (ns-allinone-3.46.1/ns-3.46.1/):
git clone https://github.com/eislab-cps/D0002E.git scratch/d0002eAfter cloning, your structure should look like this:
ns-3.46.1/scratch/d0002e/
├── CMakeLists.txt
├── lab1-http-dns/
├── lab2-tcp-udp/
├── lab3-ip-dataplane/
├── lab4-ip-controlplane/
├── lab5-link-layer/
└── lab6-tls/
Then rebuild ns-3 so it registers the new examples:
./ns3 configure --enable-examples
./ns3 buildRun a default ns-3 example to ensure everything works:
./ns3 run firstThen try running the first lab simulation:
./ns3 run "scratch/d0002e/lab1-with-guidance --scenario=basic"- 💻 Run
ns-3strictly from Linux or WSL, not native Windows. - 📁 WSL Users: Keep the project under your Linux home directory (
/home/<user>/...), not under the mounted Windows drive (/mnt/c/...). - 🛑 Generated output folders and PCAP files are local artifacts. Do not commit them back to the repository.
- 🎲 The lab scripts use reproducible seeds and write captures under seed-specific output folders (e.g.,
scratch/d0002e/lab 2 output/seed42/). - 🎥 Labs 2, 3, 5, and 6 write
netanim.xmlfiles alongside the PCAP captures. This requires anns-3build with thenetanimmodule enabled. - 🔒 Lab 6 Note: Uses the executable name
lab6-with-guidance, but its TLS capture output is written underscratch/d0002e/lab 7 output/.
README.md ← This file
WSL_SETUP.md ← Windows + WSL setup guide
CMakeLists.txt ← ns-3 build configuration for all labs
.gitignore
lab1-http-dns/
README.md ← Lab 1 instructions and questions
lab1-with-guidance.cc ← Lab 1 simulation source
lab2-tcp-udp/
README.md ← Lab 2 instructions and questions
lab2-with-guidance.cc ← Lab 2 simulation source
lab3-ip-dataplane/
README.md ← Lab 3 instructions and questions
lab3-with-guidance.cc ← Lab 3 simulation source
lab4-ip-controlplane/
README.md ← Lab 4 instructions and questions
lab4-with-guidance.cc ← Lab 4 simulation source
lab5-link-layer/
README.md ← Lab 5 instructions and questions
lab5-with-guidance.cc ← Lab 5 simulation source
lab6-tls/
README.md ← Lab 6 instructions and questions
lab6-with-guidance.cc ← Lab 6 simulation source
| Lab | Topic | Chapter | Questions |
|---|---|---|---|
| 1 | 🌐 HTTP and DNS | 2 | 25 |
| 2 | 🔄 TCP and UDP | 3 | 19 |
| 3 | 🔀 IP Data Plane | 4 | 10 |
| 4 | 🗺️ IP Control Plane | 5 | 12 |
| 5 | 🔗 Link Layer and LANs | 6 | 16 |
| 6 | 🔒 Transport Layer Security | 8 | 13 |
| Total | 95 |
Each question in the labs is tagged to indicate how you should approach answering it:
| Tag | Methodology |
|---|---|
[W] |
🦈 Answer using Wireshark capture analysis |
[C] |
💻 Answer by reading the simulation source code (labN-with-guidance.cc) |
[B] |
🦈+💻 Answer using both Wireshark and source code |
[T] |
📖 Answer from textbook theory |
[V] |
✅ Verify Wireshark observations against textbook explanations |
[_+X] |
🧪 Experiment! In addition to what is instructed at "_", experiment with different input parameters |
- 📖 Read the lab
README.mdin the corresponding directory. - 🔍 Examine the
.ccsource file — the top comments describe the network topology, available scenarios, and expected output. - 🏗️ Build and run the simulation using the commands provided in the lab README.
- 🦈 Open the generated
.pcapfiles in Wireshark. - ✍️ Answer the questions applying the technique indicated by each question's tag.