1. 利用mininet创建如下拓扑,要求拓扑支持OpenFlow 1.3协议,主机名、交换机名以及端口对应正确,请给出拓扑Mininet执行结果,展示端口连接情况
- 进入miniedit在线创建拓扑
![](https://img2018.cnblogs.com/blog/1330691/201911/1330691-20191108215019396-593519987.png)
![](https://img2018.cnblogs.com/blog/1330691/201911/1330691-20191108215145613-1467659200.png)
- 支持OpenFlow1.3协议
![](https://img2018.cnblogs.com/blog/1330691/201911/1330691-20191108215106045-191033237.png)
- 拓扑执行结果
![](https://img2018.cnblogs.com/blog/1330691/201911/1330691-20191108215205621-1619302538.png)
- 端口连接情况
![](https://img2018.cnblogs.com/blog/1330691/201911/1330691-20191108215221818-1128582976.png)
2. 直接在Open vSwitch下发流表,用vlan得到下列虚拟网段,请逐条说明所下发的流表含义
- 将来自h1,h2,h3的包打上vlan tag,从s1的端口4转发
ovs-ofctl add-flow -O OpenFlow13 s1 in_port=1,actions=push_vlan:0x8100,set_field:4096->vlan_vid,output:4
ovs-ofctl add-flow -O OpenFlow13 s1 in_port=2,actions=push_vlan:0x8100,set_field:4097->vlan_vid,output:4
ovs-ofctl add-flow -O OpenFlow13 s1 in_port=3,actions=push_vlan:0x8100,set_field:4098->vlan_vid,output:4
- s1接收端口4的包,并去除vlan tag,从端口1/2/3分别转发到h1/h2/h3
sudo ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,dl_vlan=0,actions=pop_vlan,output:1
sudo ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,dl_vlan=1,actions=pop_vlan,output:2
sudo ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,dl_vlan=2,actions=pop_vlan,output:3
![](https://img2018.cnblogs.com/blog/1330691/201911/1330691-20191108213711286-1219942281.png)
- 将来自h1,h2,h3的包打上vlan tag,从s2的端口4转发
sudo ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,in_port=1,actions=push_vlan:0x8100,set_field:4096->vlan_vid,output:4
sudo ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,in_port=2,actions=push_vlan:0x8100,set_field:4097->vlan_vid,output:4
sudo ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,in_port=3,actions=push_vlan:0x8100,set_field:4098->vlan_vid,output:4
- s2接收端口4的包,并去除vlan tag,从端口1/2/3分别转发到h1/h2/h3
sudo ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,dl_vlan=0,actions=pop_vlan,output:1
sudo ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,dl_vlan=1,actions=pop_vlan,output:2
sudo ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,dl_vlan=2,actions=pop_vlan,output:3
![](https://img2018.cnblogs.com/blog/1330691/201911/1330691-20191108214829106-1160678244.png)
3. 直接在Open vSwitch查看流表,提交OVS命令执行结果
sudo ovs-ofctl -O OpenFlow13 dump-flows s1
![](https://img2018.cnblogs.com/blog/1330691/201911/1330691-20191108215437113-842944651.png)
sudo ovs-ofctl -O OpenFlow13 dump-flows s2
![](https://img2018.cnblogs.com/blog/1330691/201911/1330691-20191108215533996-1998354714.png)
4. 提交主机连通性测试结果,验证流表的有效性
pingall
![](https://img2018.cnblogs.com/blog/1330691/201911/1330691-20191108215800776-1778055886.png)
5. 利用Wireshark抓包,分析验证特定报文
![](https://img2018.cnblogs.com/blog/1330691/201911/1330691-20191108220703501-1872949799.png)