Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due
CS 168 Spring 2025
Project 3: Transport
In this project, you will implement a subset of the TCP protocol. Your implementation will provide reliability, though it wonʼt include congestion control.
Lectures needed for this project: Lecture 11 (Reliability), 12 (TCP Implementation).
You can work on this project alone, or with one partner. You can keep the same partner from an earlire project, or choose a different partner. Reminder: Our course policies page has a collaboration policy that you must follow.
This project has been tested to work on Linux and Mac.
If youʼre on Windows, we recommend using WSL.
This project has been tested to work on Python 3.7. (It probably works on newer versions of Python as well, but use at your own risk.)
Download a copy of the starter code here.
To check that your setup works, in your terminal, run:
If you see this message, everything should be set up correctly:
- Donʼt modify any other files.
- Donʼt add any new files.
- Donʼt add any imports.
- Donʼt edit any code outside the sections indicated by the comments.
- Donʼt add any hard-coded global variables.
- Adding helper methods is fine.
- In general, if we havenʼt told you to use something, you probably donʼt need it. Our goal is not to trick you!
Note: This spec has been rewritten for Fall 2024 to be clearer and provide a few extra hints. It may contain bugs.
Project Overview
This project is split into 9 stages.
- In Project 3A, youʼll need to complete Stages 1–5.
- In Project 3B, youʼll need to complete Stages 6–9.
Each stage has its own unit tests, provided to you locally. Your grade will be determined only by these unit tests (no hidden tests).
- python autograder.py s5 # Runs unit tests for Stage 5.
- python autograder.py all # Runs all unit tests.
- python autograder.py all 5 # Runs all unit tests up to and including Stage 5.
If a test fails, youʼll see some output like this:
Running test: ./tests/s1_t1.cfg
To see nicely-formatted output for that specific test, take the last line, just before the “FAIL,” drop the --filename argument, and run that command in your terminal:
Code Overview
Modular Arithmetic
Sequence numbers are 32 bits long, and they can wrap around (e.g. 0xFFFFFFFF + 1 = 0x00000000).