CS168 SP25 Project2 Distance-Vector Routing Notes

Last updated on April 1, 2026 pm

This article is currently an experimental machine translation and may contain errors. If anything is unclear, please refer to original Chinese version. I am continuously working to improve the translation.

Preface

Since my course schedule this semester includes Computer Networks, and my winter break plan to study networking (originally CS144) fell through due to my own laziness, after the semester started I found this course on csdiy to study. First, let me summarize my experience and impressions of the course so far:

  1. The course is taught very well. I watched the Spring 2025 version on Bilibili. Peyrin Kao is also a classic UCB CS lecturer, and among the few open courses I've gone through, he is the clearest and most easy-to-understand instructor I've found. I'm actually not someone who likes watching online lectures, because I feel the absorption efficiency of video lectures is not as fast as directly reading the Textbook / documentation, but this lecturer's skill won me over. His English is also very clear and easy to understand—I could even follow along at 2x speed without subtitles. Highly recommended in this respect.
  2. The course is organized around the Internet, which is quite different from the bottom-up approach used by most universities in China. The Intro chapter gives an overview of computer networks as a whole, Chapter 2 covers the network layer (mainly the principles of Routing), and Chapter 3 covers the transport layer. After that, it doesn't strictly follow the layered structure, but instead intersperses many miscellaneous topics—you can get a feel from the table of contents of the [course textbook](Home | CS 168 Textbook).
  3. The course only has 3 Python Projects to work on. I didn't do Project1B because there is no public Gradescope for it, and it's not really possible to run the full tests locally. Also, the difficulty of the Projects is relatively low. I plan to go do the CS144 Labs after finishing learning the computer networking material here.
  4. To evaluate the Projects again: the workload is very small, and I feel that finishing them doesn't really allow you to fully review the knowledge points—you mostly have to summarize things on your own. In this respect, I don't think it's that successful.
  5. Combining the two points above, I think this course is very well suited for speedrunning through the knowledge points of computer networks and forming a rough mental map of the subject.

Project Review

This Project gave me the same feeling as doing the CS61A Projects (especially Scheme): the project's file directory is relatively large, but what students need to complete is just a few TODO functions in a single file—in short, it's a fill-in-the-blank exercise. Actually, I quite prefer projects like Gitlet, where you basically build the whole thing from scratch yourself.

Through this project, you can review some knowledge points from the Routing chapter, such as Distance-Vector Protocols. However, you don't need to implement the Bellman-Ford algorithm yourself; it's more about reviewing some core elements, such as the Five Rules, and especially core features like Resending, Expiring, Split Horizon, Poison Reverse, and so on.

But I feel that's about the extent of it, because the workload is really small—it's basically fill-in-the-blank, divided into 10 Stages, with each Stage requiring at most six or seven lines of code. The focus is still on reviewing and consolidating the mental map of the many intricate concepts in computer networking.

Tasks

Since it really isn't hard—asking an LLM can basically solve it instantly—I'll just mention a few easily-mistaken points here.

  1. The examples given in the Lecture and Textbook are all "my destination is xx router," but in this Project, it's more about "my destination is xx port."
  2. Be sure to clearly distinguish between "port link latency" and "total route entry latency."
  3. Figure out how to get the set of ports for all neighbors, and how that differs from the ports in self.table.
  4. In Stage 4, when handling Advertisements, you must distinguish between the cases—specifically, first consider whether route_dst exists.
  5. Think carefully about the meaning of expire_time.
  6. Whether to "poison the entry" or "delete the entry" needs to be examined carefully.

CS168 SP25 Project2 Distance-Vector Routing Notes
https://blog.wendain.ing/en/posts/cs168-proj2-note/
Author
wendaining
Posted on
April 1, 2026
Updated on
April 1, 2026
Licensed under