diff --git a/writeups/lab6.md b/writeups/lab6.md index 1a19ca7..88b353f 100644 --- a/writeups/lab6.md +++ b/writeups/lab6.md @@ -1,24 +1,28 @@ Lab 6 Writeup ============= -My name: [your name here] +My name: Catfood -My SUNet ID: [your sunetid here] +My SUNet ID: 998244353 -I collaborated with: [list sunetids here] +I collaborated with: An orange cat -I would like to thank/reward these classmates for their help: [list sunetids here] - -This lab took me about [n] hours to do. I [did/did not] attend the lab session. +This lab took me about `1` hours to do. Program Structure and Design of the Router: -[] +这个就更没啥东西了,根本不需要理解什么东西,做一个 Longest-Preifx-Match 就结束了。 + +两个接口: +- `add_route`,就直接无脑塞进队列里面(如果不做什么 trie 优化的话) +- 另一个 `route_one_datagram`,遍历前面生成的路由表,然后做匹配,也不用考虑什么默认路由之类的东西,找不到就扔掉。匹配完了减少 datagram 的 TTL,无论当前是0还是剪完了到0,都一起扔掉。最后记得判断 `next_hop` 是不是空的,如果是的,那么网卡发送的 `next_hop` 就换成当前数据报的目标 IP 地址就行了。 Implementation Challenges: -[] + +VSCode 的 IntelliSense 炸了两次,然后换了个 clangd。也就写了个巨复杂无比的 decltype 而已啊。 Remaining Bugs: -[] + +测试太简单了,我也不知道。 - Optional: I had unexpected difficulty with: [describe]