Frenetic Python实验(二)

本文介绍使用Frenetic进行的两项网络实验:实验一通过控制器实现简单的双端口中继器,并观察PacketOut活动;实验二则记录并展示端口上的数据包计数变化。

实验3 packet_in_out

目的:模拟一个普通的双端口中继器.

This application implements a very simple 2 port repeater where all the traffic goes through the controller.

1.终端1启动控制器。

2.终端2执行mininet命令:

sudo mn --topo=single,2 --controller=remote

885822-20161130183840615-355724304.png

3.终端3执行应用脚本:

$ python -m frenetic.examples.packet_in_out

885822-20161130183854552-1737871082.png

控制器信息:
885822-20161130184036740-621997907.png

4.终端2中mininet执行pingall:

mininet> pingall

885822-20161130184104896-2064668150.png

控制器终端出现大量packet_out信息:
885822-20161130184126599-815965686.png

pingall in the Mininet window should yield 100% successfully sent packets. There will be a lot of Packet Out activity.

注意:虽然原文说会达到100%的pingall成功率,但是实际操作往往成功率比较低,大概是因为长时间没有更新。

实验4 port_count

目的:记录经过端口的包的数目。

This application polls for port statistics and prints them every five seconds. It implements a simple switch-based repeater for a single switch and an arbitrary number of ports.

在终端3每个5s打印一次端口信息。

1.运行控制器。

2.终端2创建mininet拓扑:

sudo mn --topo=single,10 --controller=remote

885822-20161130184904115-789497061.png

3.终端3运行应用脚本:

$ python -m frenetic.examples.port_count

885822-20161130184950724-2093018554.png

控制器端信息:
885822-20161130185038974-85172328.png

由于bug,h4的信息没有更新:
885822-20161130185103849-563780711.png

4.终端2执行pingall:

mininet> pingall

885822-20161130185206302-779674069.png

应用终端打印端口信息:
885822-20161130185228631-252407912.png

控制器端:
885822-20161130185305771-1997302179.png

pingall in the Mininet window should yield 100% successfully sent packets. Port counts should keep climbing as ping traffic gets forwarded.

同样,虽然它说100%成功,但是实际并不是这样子的,h4的流表信息没有更新。

2016/11/30

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值