Mininet的示例代码教会你用python API

该博客介绍了如何使用Mininet 2.2.1d2的Python API进行网络实验,提供了一系列示例代码,包括ssh服务、私有目录、集群配置等,帮助初学者快速上手并理解API的用法。
摘要由CSDN通过智能技术生成

在使用mininet2.2.1d2时,必须要会使用python API来编辑实验!
初学者可以通过搜索示例代码(mininet/examples/下的一些python脚本代码) 来找到适合自己实验用的接口.

搜索代码: 用grep命令, 例如要看怎么设置链路带宽,

username@server:~/mininet/examples$ grep -r bandwidth
linearbandwidth.py:Test bandwidth (using iperf) on linear networks of varying size,
linearbandwidth.py:In addition to testing the bandwidth across varying numbers
linearbandwidth.py:    "Check bandwidth at various lengths along a switch chain."
linearbandwidth.py:        print "*** testing bandwidth"
linearbandwidth.py:            bandwidth = net.iperf( [ src, dst ], seconds=10 )
linearbandwidth.py:            print bandwidth
linearbandwidth.py:            results[ datapath ] += [ ( n, bandwidth ) ]
linearbandwidth.py:        for switchCount, bandwidth in result:
linearbandwidth.py:            print bandwidth[ 0 ], 'server, ', bandwidth[ 1 ], 'client'
cpu.py:cpu.py: test iperf bandwidth for varying cpu limits
cpu.py:    """Example/test of link and CPU bandwidth limits
cpu.py:        print '*** Testing with', sched, 'bandwidth limiting'
test/test_linearbandwidth.py:Test for linearbandwidth.py
test/test_linearbandwidth.py:        "Verify that bandwidth is monotonically decreasing as # of hops increases"
test/test_linearbandwidth.py:   
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值