mininet学习笔记——如何使用mininet创建自己的拓扑图

学习资料:

详细安装教程    http://mininet.org/download/

workthrough   http://mininet.org/walkthrough/

1.mininet的几个常见基本查询命令

Display Mininet CLI commands:

mininet> help

Display nodes:

mininet> nodes

Display links:

mininet> net

Dump information about all nodes:

mininet> dump

2.host之间的互ping命令

mininet> h1 ping -c 1 h2

3.测试命令

$ sudo mn --test pingpair

This command created a minimal topology, started up the OpenFlow reference controller, ran an all-pairs-ping test, and tore down both the topology and the controller.

$ sudo mn --test iperf

This command created the same Mininet, ran an iperf server on one host, ran an iperf client on the second host, and parsed the bandwidth achieved.

4.以上用到的都是自定义拓扑,使用--topo选项可以更改拓扑结构

$ sudo mn --test pingall --topo single,3

$ sudo mn --test pingall --topo linear,4

5.自定义拓扑结构

自定义拓扑结构需要自己编写一小段简单的Python代码实现,在 mininet/custom 中有一个示例文件topo-2sw-2host.py.。可以按照该文件的内容进行相应地修改,定义自己的拓扑结构。

修改完成后执行以下命令建立拓扑:

sudo mn --custom ~/mininet/custom/topo-2sw-2host.py. --topo mytopo --mac--switch ovsk --controller remote,ip=127.0.0.1,port=6633

该命令中包含了mininet命令中其他一些重要的选项及参数,在此一起说明:

(1)--custom ~/mininet/custom/topo1.py --topomytopo

define CustomTopologies

(2)--mac:

The --mac optionis super-useful, and sets the host MAC and IP addrs to small, unique,easy-to-read IDs.例如将host1的mac地址设置为00:00:00:00:00:01

(3)--switch:

指定交换机类型,如the user-space switch: --switch user;或者Open vSwitch (OVS): --switch ovsk

(4)--controller remote,ip=127.0.0.1,port=6633:

Using a RemoteController and fill in the host IP and/or listening port

sudo mn--controller=remote,ip=[controller IP],port=[controller listening port]




  • 4
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值