Protocols, Layers, and Abstraction

Unraveling the Network Stack

Thursday, January 8, 2026

Lesson Objectives

  1. Explain the role of each layer in the TCP/IP model
  2. Describe the protocol stack and its layers - TCP/IP model
  3. Discuss protocol design principles - Abstraction, Modularity, and Encapsulation
  4. Why abstraction fails under attack or congestion
  5. Identify network traffic using Wireshark / Wireview

Preparation

  1. Textbook section \(1.2\). The Network Edge
  2. Textbook section \(1.5\). Protocol Layers and Service Models
  3. Textbook section \(1.6\). Networks Under Attack

Protocols and Encapsulation

Install and configure WSL (2 points)

From a Windows Terminal-

winget install Microsoft.VisualStudioCode # if needed
winget install Docker.DockerDesktop
winget install Git.Git
winget install WiresharkFoundation.Wireshark
code --install-extension ms-vscode-remote.remote-wsl

wsl --update
wsl --list
wsl --list --online
wsl --install ubuntu

# now enter wsl
wsl

Connect vscode to Linux (WSL) (2 points)

From within WSL environment-

sudo apt install tcpdump tshark bind9-dnsutils traceroute # network tools
sudo apt install python-is-python3 fish # quality of life upgrades

Create your class directory, navigate the filesystem, list contents to confirm-

mkdir cy350
cd cy350
ls
pwd

Finally, launch vscode from your current directory in Linux-

code .

Run python “hello world” on Linux (2 points)

  1. Create a new file named hello.py
  2. Add the following code to it:
print("Hello, CY350!")
  1. Save the file and run it in the Linux terminal-
python hello.py

Capture packets on Linux (2 points)

In a terminal-

sudo tcpdump -i eth0 -c 20 --print -w lab2.pcap

Run man tcpdump or tcpdump --help for an explanation of these command line flags.

In another terminal-

curl -v -i httpforever.com

Here, -v will ensure verbose output and -i will display HTTP headers in addition to the content.

Now return to the first terminal and press Ctrl+C to stop the packet capture process. Type ls to ensure that the captured packets were written to

Bring up your packet capture in Wireshark or Wireview (2 points)

  • Locate the PCAP file you created in the previous step (lab2.pcap)
  • Open it in Wireshark or Wireview (wireview.github.io)
  • Identify the HTTP GET request to httpforever.com and the corresponding HTTP response.

Hide AI features in vscode

Features > Chat > Disable AI Features to protect yourself from unintentional AI completions!

Alternatively:

  • Press Ctrl + Shift + P
  • Search for “Hide AI Features”
  • Under setting, check the “Disable” box

Next Lesson

  • Assessing Network Performance

Preparation

  • Textbook section \(1.3\). The Network Core
  • Textbook section \(1.4\). Delay, Loss, and Throughput in Packet-switched Networks