Week 39 September
CSCI 4431 / 6431
Lab 1
Run a client and a server. Then watch them talk.
Office hours
Office hours
Tue/Thu —
12–1 pm
SEH, 4th floor couches — or remotely, link on Discord.
Today
Today, in three parts
- 1 Some recap, Classroom 50, prerequisites
- 2 Project 1, which starts next week
- 3 The lab — Parts A, B, C
Everything you need to hear comes first. Once the lab starts,
leave whenever you're done — but don't forget to submit.
PrerequisitesA quick check
Before we start
Setup form
do this first
Discord
#help lives here
Course website
schedule & syllabus
On your laptop
Wireshark·
Python 3·
Git
You have done this already
Classroom 50
classroom50.org — every assignment,
all semester.
Hello, Classroom was the rehearsal. Similar three steps
every time.
- 1 Accept → you get a private repo
- 2 Clone it, do the work, push
- 3 Tag it — that's what submits
Follow the README step by step. New to
git? It's explained in there.
Next week
100 points
Project 1 — Design your own
application layer protocol
Project 14 milestones
Four phases
| Phase | What | When | Weight |
| 1 | Spec, written with your teammate | Week 5 | 25% |
| 2 | Merged spec, with the other group | Week 5, in class | 15% |
| 3 | Client + server | Week 8 | 20% |
| 4 | Reflection after interop | Week 8, in class | 30% |
The reflection is worth more than the code.
Project 1one repo per group
One of you accepts. Then adds the other.
- 1One of you accepts. The repo is named
after them.
- 2Go to classroom50.org →
Manage Group.
- 3Add your teammate's username →
Save collaborators.
- 4Both of you clone the same repo.
Two or three people per group. The one who accepts,
plus one or two teammates.
Project 1this week
Claim your protocol on the board
PROTOCOL GROUP 1 GROUP 2
Key–value store @you + @teammate @someone + @else
One row per protocol. Two groups per row.
Joining a row that already has a group guarantees you a
partner group.
Pick your protocol and form your groups by next week —
Chapter 3, and Project 1 begins.
Recaplast week
Where sockets sit
Application
HTTP · SMTP · DNS — and your program today
Sockets
the door between the two
Transport
TCP or UDP — you chose between these last week
Network · Link
later in the semester
Today: a tiny client and server, in Python.
Context
What is Wireshark?
It records every packet your laptop sends or receives.
- 1Packet list — one line each.
- 2Packet detail — split into layers.
- 3Packet bytes — and the text inside.
udp.port == 9000 ← the filter box, at the top. ==, not =.
Contextwhat you see when you open it
Starting a capture
- 1Pick your interface — then
double-click to start recording.
- 2Leave this box empty. It's the
capture filter, not the display filter.
While it's running, nothing is saved. Stop the capture,
then File → Save As → captures/part-a.pcapng, inside your
repository.
Contextthe same tool, no window
tshark — Wireshark from the terminal
tshark -D list interfaces
tshark -i lo -w captures/part-a.pcapng capture — ctrl-c to stop
tshark -r captures/part-a.pcapng read it back
tshark -r captures/part-a.pcapng -Y "udp.port == 9000" filter, with -Y
-w writes straight to that path as it captures.
No Save As step — it's already where you need it.
Context
Lab 1
| Part | What | Pts |
| A | Your client ↔ your server | 9 |
| B | Your client ↔ my server | 9 |
| C | Questions about a real HTTP trace | 7 |
We're going to finish all three in class today.
Step 1
Accept the assignment
Open the link. Sign in. Click the blue button.
- Link is in #labs on Discord — and on the course
website.
- Your repos live at classroom50.org.
you get:
csci4431-lab1-wireshark-<you>
Step 2
Clone your repository
git clone https://github.com/gw-computer-networks-f26/csci4431-lab1-wireshark-<you>
cd csci4431-lab1-wireshark-<you>
src/server.py · src/client.py — for Part A and B
answers.txt — where written answers go
README.md — everything I say today, in writing, and more
The codetwo files, ten lines that matter
What the programs actually do
src/server.py
sock = socket.socket(AF_INET, SOCK_DGRAM)
sock.bind((host, 9000))
while True:
data, addr = sock.recvfrom(65535)
sock.sendto(data.upper(), addr)
src/client.py
sock = socket.socket(AF_INET, SOCK_DGRAM)
sock.sendto(payload, (host, 9000))
reply, _ = sock.recvfrom(65535)
SOCK_DGRAM is the only word that says UDP.
- Only the server
binds — the client's port is whatever the OS spares.
- No connection, so every datagram carries its own address.
Part A9 points
Your own client and server
# 1 python3 src/server.py leave it running
# 2 capture on loopback lo / lo0 / "Adapter for loopback"
filter udp.port == 9000
# 3 python3 src/client.py --student your_github_username
Capture before you run the client. Not after.
Part Acheck yourself
Six packets
sent 'octocat:hello' -> 'OCTOCAT:HELLO'
Three requests, three replies. That's the whole protocol.
Stop the capture → Save As →
captures/part-a.pcapng
Part B9 points
Now talk to my server
My server’s IP
161.253.78.154
Same client. Same code. My server does not speak your
protocol.
Part BSupposed to fail
Run it anyway
capture on Wi-Fi this time
python3 src/client.py --student your_github_username --host <my address>
-> 'ERR ······························'
The reply is a sentence. It tells you what this server wants.
I've hidden the rest on purpose. Go read it.
Part B
Read it. Change it. Send it again.
- 1 Read the reply — bottom pane, or
Follow → UDP Stream
- 2 Send what it asked for, with
--raw
python3 src/client.py --student your_github_username --host <my address> \
--raw --message "?"
You'll know. The reply says OK, not ERR.
Part Bhand in
Save both
captures/part-b.pcapng — the failure and the fix
- B1 and B2 in
answers.txt
You were never given the specification, but you figured it out.
Part C7 points
A trace from the textbook's authors
Real HTTP, captured by Kurose & Ross.
traces/http-wireshark-trace1-1.pcapng ← open this
answers.txt ← C1 … C7
Exact match. Write 200, not status code 200.
Step 4
Submit your work
git add -A
git commit -m "Lab 1"
git push
git tag submit/1 ← this is what hands it in
git push origin submit/1
The tag is the one that hands your work in — a
git push on its own does not submit.
Submit before you leave. That's one of your three
— the next two are submit/2 and submit/3.
Before you go#help on Discord
If it's broken, say so
No interfaces
ChmodBPF on macOS. Npcap on Windows.
Log out and back in on Linux.
No packets in A
Wrong interface, or a typo in the filter.
Nothing at all in B
Not even an ERR? UDP may be
blocked. Tell me.
Not finished? Office hours Thursday.
Then it's due Friday 11 Sept, 11:59 pm.