Skip to main content

002 · Stanford CS144 — 手写 TCP / Build a TCP

项目 内容
学校 Stanford University
课程 Stanford CS144 Introduction to Computer Networking
方向 计算机网络 / Networking
语言 Python
难度 进阶 / Intermediate–advanced
预计耗时 4–8 天 / 4–8 days

为什么收录

从零构建可靠传输:分段、确认、重传、滑动窗口、拥塞控制。每一层都能用真实测试验证,是把网络课理论变成工程能力的经典项目。

Building reliable transport from scratch — segmentation, ACKs, retransmission, sliding window, congestion control. Every layer is testable, making it a classic bridge from networking theory to engineering skill.

English: CS144’s lab string is unusually well-scoped: each stage is independently testable, so students get fast feedback on subtle protocol logic.

实测结果

  • 6 项测试全部通过(重组、回绕、接收端、重传退避、滑动窗口、端到端)/ 6 tests pass
  • 端到端:4 个段完整送达 the quick brown fox(19 字节 + SYN/FIN)/ end-to-end delivery verified
  • 详见 05-调试与测试.md 中的真实输出与开发中修正的 3 个测试错误

七章解析

题目解读 · 设计思路 · 逐步实现 · 正确性与复杂度 · 调试与测试 · 踩坑清单 · 延伸练习

源码与测试

题目目录 · 参考实现 · 测试