ImageVerifierCode 换一换
格式:DOCX , 页数:21 ,大小:29.42KB ,
资源ID:3119048      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/3119048.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(mininet使用教程.docx)为本站会员(b****4)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

mininet使用教程.docx

1、mininet使用教程第1部分:Everyday Mininet Usage首先是是命令语法$这个符号代表现在处于 Linux 的shell 交互下,需要使用的是 Linux 命令mininet这个符号表示现在处于 Mininet 交互下,需要使用的是 Mininet 的命令这个符号表示的是现在处于 Linux 的 root 权限下。以上相应的状态下下属于对应的命令,就能够得到正常的输出。需要注意的是mininet的情况比较特殊,需要使用 minient 的命令来进行交互。Display Startup Options我们首先来启动 Mininet。键入以下命令来显示Mininet的帮助信息:

2、$ sudo mn -hUsage: mn options(type mn -h for details)The mn utility creates Mininet network from the command line. It can createparametrized topologies, invoke the Mininet CLI, and run tests.Options:-h, -help show this help message and exit-switch=SWITCH ivs|ovsk|ovsl|user,param=value.-host=HOST cfs

3、|proc|rt,param=value.-controller=CONTROLLERnone|nox|ovsc|ref|remote,param=value.-link=LINK default|tc,param=value.-topo=TOPO linear|minimal|reversed|single|tree,param=value.-c, -clean clean and exit-custom=CUSTOM read custom topo and node params from .pyfile-test=TEST cli|build|pingall|pingpair|iper

4、f|all|iperfudp|none-x, -xterms spawn xterms for each node-i IPBASE, -ipbase=IPBASEbase IP address for hosts-mac automatically set host MACs-arp set all-pairs ARP entries-v VERBOSITY, -verbosity=VERBOSITYinfo|warning|critical|error|debug|output-innamespace sw and ctrl in namespace?-listenport=LISTENP

5、ORTbase port for passive switch listening-nolistenport dont use passive listening port-pre=PRE CLI script to run before tests-post=POST CLI script to run after tests-pin pin hosts to CPU cores (requires -host cfs or -hostrt)-version如上所示,输出了 mn 的帮助信息。Start Wireshark为了使用 Wireshark 来查看 OpenFlow 的控制信息,我

6、们先打开 Wireshark 并让他在后台运行。$ sudo wireshark &在 Wireshark 的过滤选项中,输入of,然后选择 Apply。In Wireshark, click Capture, then Interfaces, then select Start on the loopback interface (lo).现在窗口上暂时应该没有任何 OpenFlow 的数据包。注:在Mininet VM镜像中Wireshark是默认已经安装的。如果你的系统中没有Wireshark的和OpenFlow,您可以使用Mininet的install.sh脚本,按以下步骤安装:$ c

7、d $ git clone $ mininet/util/install.sh -w如果已经安装了 Wireshark,但是运行不了(e.g. 你得到一个类似$DISPLAY not set之类的错误信息,可以参考 FAQ,:设置好 X11就可以正常运行 GUI 程序,并且使用 xterm 之类的终端仿真器了,后面的演示中可以用到。Interact with Hosts and SwitchesStart a minimal topology and enter the CLI:$ sudo mn默认的最小拓扑结构包含有两台主机(h1,h2),还有一个 OpenFlow 的交换机,一个 Ope

8、nFlow 的控制器四台设备。这种拓扑接口也可以使用-topo=minimal来指定。当然我们也可以使用其他的拓扑结构,具体信息可以看-topo的信息。现在四个实体(h1,h2,c0,s1)都在运行着。c0作为控制器,是可以放在虚拟机外部的。如果没有具体的测试作为参数传递时,我们可以使用 Mininet 交互。在Wireshark的窗口中,你会看到内核交换机连接到控制器。显示Mininet CLI命令:mininet helpDocumented commands (type help ):=EOF exit intfs link noecho pingpair py source xterm

9、dpctl gterm iperf net pingall pingpairfull quit timedump help iperfudp nodes pingallfull px sh xYou may also send a command to a node using: command argsFor example: mininet h1 ifconfigThe interpreter automatically substitutes IP addressesfor node names when a node is the first arg, so commandslike

10、mininet h2 ping h3should work.Some character-oriented interactive commands requirenoecho: mininet noecho h2 vi foo.pyHowever, starting up an xterm/gterm is generally better: mininet xterm h2显示节点:mininet nodesavailable nodes are:c0 h1 h2 s1显示网络链接:mininet neth1 h1-eth0:s1-eth1h2 h2-eth0:s1-eth2s1 lo:

11、s1-eth1:h1-eth0 s1-eth2:h2-eth0c0输出所有节点的信息:mininet dump从上面的输出中,你可以看到有一台交换机和两台主机。在 Mininet 的CLI 中第一个字符串是设备名,那后面的命令就在该设备上执行。例如我们想在h1设备上执行ifconfig则输入如下命令:mininet h1 ifconfig -ah1-eth0 Link encap:Ethernet HWaddr 3e:94:43:b1:ad:48 inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.0.0.0 inet6 addr: fe80:3c

12、94:43ff:feb1:ad48/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:22 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1764 (1.7 KB) TX bytes:648 (648.0 B)lo Link encap:Local Loopback inet addr:1

13、27.0.0.1 Mask:255.0.0.0 inet6 addr: :1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)上面的输出中,可以看见h1-eth0跟lo两个接口,需要注意的是,在 Linux

14、 系统的 shell 中运行ifconfig是看不到h1-eth0。与h1-eth0相反的是,switch默认是跑在 root 的网络namespace上面,所以在switch上执行命令与在 Linux 下的 shell 中是一样的。mininet s1 ifconfig-aeth0 Link encap:Ethernet HWaddr 08:00:27:98:dc:aa inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0 inet6 addr: fe80:a00:27ff:fe98:dcaa/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:46716 errors:0 dropped:0 overruns:0 frame:0 TX packets:40265 errors:0 dropped:0

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1