[Course][Update/Refactor] Refactor Standford CS144 documentation + Add new resources (#704)
* [Course][Update/Refactor] Refactor Standford CS144 documentation; Add new resources; Update course introduction/description * update format for proper rendering
This commit is contained in:
parent
47a2815a7f
commit
bf7f675bc7
|
|
@ -10,10 +10,40 @@
|
|||
|
||||
One of the lecturers of this course is Professor [Nick McKeown](http://yuba.stanford.edu/~nickm/index.html), a giant in the field of Networking. At the end of each chapter of MOOC, he will interview an executive in the industry or an expert in the academia, which can certainly broaden your horizons.
|
||||
|
||||
In the projects, you will use C++ to build the entire TCP/IP protocol stack, the IP router, and the ARP protocol step by step from scratch. Finally, you will replace Linux Kernel's protocol stack with your own and use socket programming to communicate with your classmates, which is really amazing and exciting.
|
||||
In this course's project, you will incrementally build an entire TCP/IP protocol stack using C++.
|
||||
|
||||
- `checkpoint 0` serves as a warmup lab to familiarize you with the development environment. You'll experiment with network commands (e.g., `telnet`, `netcat`), write a basic web crawler webget using Linux Kernel's `tcp_socket` abstraction, and finally implement an (In-Memory) Reliable Byte Stream.
|
||||
- `checkpoint 1-3` will guide you through implementing a simplified yet core-semantics-preserving, (almost fully) standards-compliant TCP Protocol that can interoperate with industrial-grade TCP implementations.
|
||||
- In `checkpoint 4`, you'll replace the Linux Kernel's `tcp_socket` used by `webget` in `checkpoint 0` with your own TCP implementation via framework encapsulation (TCPMinnowSocket). You'll also analyze real-world network traffic patterns (i.e., with RTT ≥ ~100ms) and perform visualized data analysis using Python — I highly recommend diving deep into this analysis; it's genuinely fascinating.
|
||||
- After completing the first half, `checkpoint 5` takes you to the lowest layer of the TCP/IP stack. You'll implement a `NetworkInterface` that bridges IP Datagrams and Ethernet Frames using the ARP protocol.
|
||||
- `checkpoint 6` builds upon your "network card" (NetworkInterface), requiring you to implement an IP Router that forwards received IP Datagrams appropriately.
|
||||
- Mirroring `checkpoint 4`, `checkpoint 7` uses framework-provided glue code (`endtoend.cc`) to simulate underlying network infrastructure in memory via `network_thread`. This connects all previously implemented components through a relay server (`cs144.keithw.org`), enabling real-time communication between client and server endpoints using your custom TCP/IP stack.
|
||||
|
||||
This course feels less like a computer networking class and more like the best modern C++ primer for young developers.
|
||||
|
||||
If you merely "skim through" the 8 checkpoints (two of which don't even require coding! 😂😅), you'll miss most of its essence.
|
||||
|
||||
The true brilliance lies in the framework code. Without meticulously reading every line, many implementation details will remain shrouded in mystery—like magic!
|
||||
|
||||
- How exactly do we combine your implemented `TCPSender` and `TCPReceiver` into a (bi-directionally) reliable byte stream in `checkpoint 4`?
|
||||
- How does `TCPMinnowSocket` replace the kernel's default TCP implementation?
|
||||
- Where did the famed three-way handshake go?
|
||||
- How does multithreading work here?
|
||||
- Do you truly understand the final `endtoend.cc` provided in `checkpoint 7`?
|
||||
|
||||
I deeply resonate with [Prof. Yan-Yan Jiang](https://github.com/jiangyy)'s mantra: "**There's no magic in the computer world**." All these questions find answers in the framework code — if you study it closely.
|
||||
|
||||
For networking/system programming beginners, remember we now have LLMs like O1, Claude, and DeepSeek — far more efficient than the old "RTFM" approach!
|
||||
|
||||
There's no magic in the computer world. Go explore it!
|
||||
|
||||
## Resources
|
||||
|
||||
**A minor caveat**: As of January 2025, the course's [GitHub Repository](https://github.com/CS144/minnow) gets cleared completely every academic year. If you haven't forked a copy beforehand, you'll have to follow the current version.
|
||||
|
||||
The course website also appears to lack official archives—each year's iteration is entirely fresh. Through the Wayback Machine, I've found archived versions of the course site up to 2021. The link for the Winter 2024 version is preserved here:
|
||||
<https://web.archive.org/web/20241209004804/https://cs144.github.io/>.
|
||||
|
||||
- Course Website: <https://cs144.github.io/>
|
||||
- Video: <https://www.youtube.com/watch?v=r2WZNaFyrbQ&list=PL6RdenZrxrw9inR-IJv-erlOKRHjymxMN>
|
||||
- Textbook: None
|
||||
|
|
@ -21,6 +51,9 @@ In the projects, you will use C++ to build the entire TCP/IP protocol stack, the
|
|||
|
||||
## Reference
|
||||
|
||||
For relatively recent (post-2024) detailed walkthrough guides for this course, we recommend consulting [@xzhseh](https://github.com/xzhseh)'s comprehensive article (ps. you may need a translator to read it):
|
||||
[Stanford CS144 (Winter 2024) Computer Networks – Possibly the Best Modern C++ Primer for Young Developers](https://zhuanlan.zhihu.com/p/20551290958).
|
||||
|
||||
- [PKUFlyingPig](https://github.com/PKUFlyingPig/CS144-Computer-Network)
|
||||
- [Lexssama's Blogs](https://lexssama.github.io/tags/CS144/)
|
||||
- [huangrt01](https://github.com/huangrt01/CS-Notes/blob/master/Notes/Output/Computer-Networking-Lab-CS144-Stanford.md)
|
||||
|
|
|
|||
|
|
@ -8,12 +8,41 @@
|
|||
- 课程难度:🌟🌟🌟🌟🌟
|
||||
- 预计学时:100 小时
|
||||
|
||||
这门课的主讲人之一是网络领域的巨擘 [Nick McKeown](http://yuba.stanford.edu/~nickm/index.html) 教授。这位拥有自己创业公司的学界业界双巨佬会在他慕课每一章节的最后采访一位业界的高管或者学界的高人,非常开阔眼界。
|
||||
这门课 (开源版本视频) 的主讲人之一是网络领域的巨擘 [Nick McKeown](http://yuba.stanford.edu/~nickm/index.html) 教授。这位拥有自己创业公司的学界业界双巨佬会在他慕课每一章节的最后采访一位业界的高管或者学界的高人,非常开阔眼界。
|
||||
|
||||
在这门课的 Project 中,你将用 C++ 循序渐进地搭建出整个 TCP/IP 协议栈,实现 IP 路由以及 ARP 协议,最后利用你自己的协议栈代替 Linux Kernel 的网络协议栈和其他学生的计算机进行通信,非常 amazing!
|
||||
在这门课的 Project 中,你将用 C++ 循序渐进地搭建出整个 TCP/IP 协议栈。
|
||||
|
||||
- `checkpoint 0` 是让你熟悉一下开发环境的 warmup lab,简单玩一玩一些网络相关的命令 (e.g., `telnet`, `netcat`),借助 Linux Kernel 提供的 `tcp_socket` 抽象写一个基础的网络爬虫 `webget`,最后实现一个 (In-Memory) Reliable Byte Stream。
|
||||
- 接下来你会在 `checkpoint 1-3` 首先实现一个简易但保留了核心语义且 (almost fully) standards-compliant 的 TCP Protocol,可以与其他 (工业级的) TCP 实现相互通信。
|
||||
- 在 `checkpoint 4` 中你会通过框架代码的封装 (`TCPMinnowSocket`),将 `checkpoint 0` 中 `webget` 默认使用 Linux Kernel 的 `tcp_socket` 替换为你自己实现的 TCP Protocol;同时会实际分析真实网络 (i.e., RTT >= ~100ms) 的流量模式,需要自己用 python 等语言进行可视化数据分析 - 我很推荐大家认真的去进行数据分析,真的很有意思。
|
||||
- 过了课程的前半部分,我们会在 `checkpoint 5` 来到 TCP/IP 协议栈的最底层,你会亲自实现 `NetworkInterface`,通过 ARP 协议抹平 IP Datagram 和 Ethernet Frame 之间的沟壑。
|
||||
- 最后在 `checkpoint 6` 中,你会基于先前实现的“网卡”,也就是 `NetworkInterface`,实现 IP Router,对接收到的每一个 IP Datagram 进行相对应的转发。
|
||||
- 与 `checkpoint 4` 类似,`checkpoint 7` 会通过框架代码提供好的胶水 (`endtoend.cc`),在内存里通过 `network_thread` 模拟底层的网络设施 (Network Infrastructure/Service),把所有你前面实现过的组件串联起来,通过一个中继服务器 (`cs144.keithw.org`) 实现 Client 和 Server 之间的、每端使用自己实现的 TCP/IP 协议栈的实时通信。
|
||||
|
||||
这门课与其说是计算机网络课,我更愿意称其为一门年轻人最好的现代 C++ 入门课。
|
||||
|
||||
如果你只是 "浅尝辄止" 的写完 8 个 checkpoint (其中有两个 lab 你甚至不需要亲自写代码!😂😅),那么这门课大部分的精华你就错过了。
|
||||
|
||||
我认为这门课最精华的部分就在于提供给我们的框架代码,如果不自己深入一行行的阅读每个文件,你会发现很多细节的问题一直笼罩在迷雾里,就像魔法一样!
|
||||
|
||||
- 比如 `checkpoint 4` 中我们到底是如何将自己实现的 `TCPSender` 和 `TCPReceiver` 拼装使用成一个 (bi-directionally) reliable byte stream 的?
|
||||
- `TCPMinnowSocket` 到底是如何替换内核里默认的 TCP 实现的?
|
||||
- 我们常说的三次握手去哪里了?
|
||||
- 多线程的场景怎么办?
|
||||
- `checkpoint 7` 提供给你的 `endtoend.cc` 你真的理解了吗?
|
||||
|
||||
我很喜欢[蒋炎岩教授](https://github.com/jiangyy)一直强调的,“**计算机的世界里没有魔法**” 这条 quote,上面的这些问题,你仔细读过框架代码后肯定能找到答案。
|
||||
|
||||
如果你是计算机网络 (System Programming) 的初学者,别忘了我们还有 O1, Claude, DeepSeek 这些 LLM 的帮助,这比十几年前 RTFM 的效率和效果都好太多了!
|
||||
|
||||
计算机的世界里没有魔法,去试试吧!
|
||||
|
||||
## 课程资源
|
||||
|
||||
比较不幸的是,目前 (2025.1) 这门课的 [GitHub Repository](https://github.com/CS144/minnow) 会随着每一年的进度被**直接清空**,如果你没有先前自己 fork 一份,那就只能跟着现在的进度走了。
|
||||
|
||||
课程网站也似乎没有官方的 Archive,每一年都是全新的,我在 Wayback Machine 上找到了课程网站上至 2021 年所有版本的独立备份,24 Winter 的网站链接是:<https://web.archive.org/web/20241209004804/https://cs144.github.io/>。
|
||||
|
||||
- 课程网站:<https://cs144.github.io/>
|
||||
- 课程视频:<https://www.youtube.com/watch?v=r2WZNaFyrbQ&list=PL6RdenZrxrw9inR-IJv-erlOKRHjymxMN>
|
||||
- 课程教材:无
|
||||
|
|
@ -21,6 +50,8 @@
|
|||
|
||||
## 资源汇总
|
||||
|
||||
有关 2024 年以后相对较新的,这门课的详细入门/通关指南,可以参考 [@xzhseh](https://github.com/xzhseh) 的这篇 [Standford CS144 (24 Winter) Computer Network - 可能是年轻人最好的现代 C++ 入门课](https://zhuanlan.zhihu.com/p/20551290958)。
|
||||
|
||||
- [PKUFlyingPig](https://github.com/PKUFlyingPig/CS144-Computer-Network)
|
||||
- [Lexssama's Blogs](https://lexssama.github.io/tags/CS144/)
|
||||
- [huangrt01](https://github.com/huangrt01/CS-Notes/blob/master/Notes/Output/Computer-Networking-Lab-CS144-Stanford.md)
|
||||
|
|
|
|||
Loading…
Reference in New Issue