唐子涵 2021013540 [email protected]
无参考和引用
sudo bash setup.sh
由于不可抗力,setup.sh 中的 sudo git clone -b eel http://github.com/noxrepo/pox /opt/pox
会失败,用配置网络、手动拷贝等方法代替
最好按照下面的顺序运行,否则可能出现问题
./pox.sh
或
python /opt/pox/pox.py --verbose ucla_cs118
./router.sh
或
sudo make clean
make -j4
./router
./mininet.sh
或
sudo python run.py
mininet 用 exit
退出,其他用 ctrl+C
状态:已解决
路由器会接收到目的 ip 为 224.0.0.251 的包。这个 ip 不是任何主机的 ip,而是一个广播 ip
接收到这个 ip 的包应该直接抛弃
状态:已解决
运行 pox.py 时,注意用 ucla_cs118
而不是 ucla-cs118
,虽然 pip install ucla-cs118
确实用了短横线而不是下划线。
原因未知,可能是 --verbose
的偏好
状态:已解决
在 ethernet_hdr
中,MAC 地址用 uint8_t [6]
表示,而在 Interface
中,MAC 地址用 vector<unsigned_char>
表示
实际上,unsigned_char
和 uint8_t
等价,可以认为 Interface
没有限制 MAC 地址的位数
状态:已解决,修改程序时需要注意
主机上的数字写入网络数据包时,需要考虑转换字节序
htons
用于 uint16_t
,htonl
用于 uint32_t
+----------------+ server1-eth0
| 192.168.2.2/24
+ +-----------+
192.168.2.1/24 | |
sw0-eth1 | server1 |
+----------+ +------------------+ | |
| | | | +-----------+
| client | | SimpleRouter |
| | | (sw0) |
+----------+ | |
client-eth0 +------------------+ +-----------+
10.0.1.100/8 sw0-eth3 sw0-eth2 | |
+ 10.0.1.1/8 172.64.3.1/16 | server2 |
| + + | |
| | | +-----------+
| | | server2-eth0
+----------------------+ +----------------+ 172.64.3.10/16