Mininet中文使用教程Word格式.docx

上传人:b****4 文档编号:7753877 上传时间:2023-05-09 格式:DOCX 页数:25 大小:28.48KB
下载 相关 举报
Mininet中文使用教程Word格式.docx_第1页
第1页 / 共25页
Mininet中文使用教程Word格式.docx_第2页
第2页 / 共25页
Mininet中文使用教程Word格式.docx_第3页
第3页 / 共25页
Mininet中文使用教程Word格式.docx_第4页
第4页 / 共25页
Mininet中文使用教程Word格式.docx_第5页
第5页 / 共25页
Mininet中文使用教程Word格式.docx_第6页
第6页 / 共25页
Mininet中文使用教程Word格式.docx_第7页
第7页 / 共25页
Mininet中文使用教程Word格式.docx_第8页
第8页 / 共25页
Mininet中文使用教程Word格式.docx_第9页
第9页 / 共25页
Mininet中文使用教程Word格式.docx_第10页
第10页 / 共25页
Mininet中文使用教程Word格式.docx_第11页
第11页 / 共25页
Mininet中文使用教程Word格式.docx_第12页
第12页 / 共25页
Mininet中文使用教程Word格式.docx_第13页
第13页 / 共25页
Mininet中文使用教程Word格式.docx_第14页
第14页 / 共25页
Mininet中文使用教程Word格式.docx_第15页
第15页 / 共25页
Mininet中文使用教程Word格式.docx_第16页
第16页 / 共25页
Mininet中文使用教程Word格式.docx_第17页
第17页 / 共25页
Mininet中文使用教程Word格式.docx_第18页
第18页 / 共25页
Mininet中文使用教程Word格式.docx_第19页
第19页 / 共25页
Mininet中文使用教程Word格式.docx_第20页
第20页 / 共25页
亲,该文档总共25页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

Mininet中文使用教程Word格式.docx

《Mininet中文使用教程Word格式.docx》由会员分享,可在线阅读,更多相关《Mininet中文使用教程Word格式.docx(25页珍藏版)》请在冰点文库上搜索。

Mininet中文使用教程Word格式.docx

-*,--*termsspawn*termsforeachnode

-iIPBASE,--ipbase=IPBASE

baseIPaddressforhosts

--macautomaticallysethostMACs

--arpsetall-pairsARPentries

-vVERBOSITY,--verbosity=VERBOSITY

info|warning|critical|error|debug|output

--innamespaceswandctrlinnamespace"

--listenport=LISTENPORT

baseportforpassiveswitchlistening

--nolistenportdon'

tusepassivelisteningport

--pre=PRECLIscripttorunbeforetests

--post=POSTCLIscripttorunaftertests

--pinpinhoststoCPUcores(requires--hostcfsor--host

rt)

--version

如上所示,输出了mn的帮助信息。

StartWireshark

为了使用Wireshark来查看OpenFlow的控制信息,我们先翻开Wireshark并让他在后台运行。

$sudowireshark&

在Wireshark的过滤选项中,输入of,然后选择Apply。

InWireshark,clickCapture,thenInterfaces,thenselectStartontheloopbackinterface(lo).

现在窗口上暂时应该没有任何OpenFlow的数据包。

注:

在MininetVM镜像中Wireshark是默认已经安装的。

如果你的系统中没有Wireshark的和OpenFlow,您可以使用Mininet的install.sh脚本,按以下步骤安装:

$cd~

$gitclones:

//github./mininet/mininet#如果它尚不存在

$mininet/util/install.sh-w

如果已经安装了Wireshark,但是运行不了〔e.g.你得到一个类似$DISPLAYnotset之类的错误信息,可以参考FAQ,:

s:

//github./mininet/mininet/wiki/FAQ*wiki-*11-forwarding〕

设置好*11就可以正常运行GUI程序,并且使用*term之类的终端仿真器了,后面的演示中可以用到。

InteractwithHostsandSwitches

StartaminimaltopologyandentertheCLI:

$sudomn

默认的最小拓扑构造包含有两台主机〔h1,h2〕,还有一个OpenFlow的交换机,一个OpenFlow的控制器四台设备。

这种拓扑接口也可以使用--topo=minimal来指定。

当然我们也可以使用其他的拓扑构造,具体信息可以看--topo的信息。

现在四个实体〔h1,h2,c0,s1〕都在运行着。

c0作为控制器,是可以放在虚拟机外部的。

如果没有具体的测试作为参数传递时,我们可以使用Mininet交互。

在Wireshark的窗口中,你会看到核交换机连接到控制器。

显示MininetCLI命令:

mininet>

help

Documentedmands(typehelp<

topic>

):

========================================

EOFe*itintfslinknoechopingpairpysource*term

dpctlgtermiperfnetpingallpingpairfullquittime

dumphelpiperfudpnodespingallfullp*sh*

Youmayalsosendamandtoanodeusing:

<

node>

mand{args}

Fore*ample:

mininet>

h1ifconfig

TheinterpreterautomaticallysubstitutesIPaddresses

fornodenameswhenanodeisthefirstarg,somands

like

h2pingh3

shouldwork.

Somecharacter-orientedinteractivemandsrequire

noecho:

noechoh2vifoo.py

However,startingupan*term/gtermisgenerallybetter:

*termh2

显示节点:

nodes

availablenodesare:

c0h1h2s1

显示网络:

net

h1h1-eth0:

s1-eth1

h2h2-eth0:

s1-eth2

s1lo:

s1-eth1:

h1-eth0s1-eth2:

h2-eth0

c0

输出所有节点的信息:

dump

<

Hosth1:

h1-eth0:

10.0.0.1pid=3278>

Hosth2:

h2-eth0:

10.0.0.2pid=3279>

OVSSwitchs1:

lo:

127.0.0.1,s1-eth1:

None,s1-eth2:

Nonepid=3282>

OVSControllerc0:

127.0.0.1:

6633pid=3268>

从上面的输出中,你可以看到有一台交换机和两台主机。

在Mininet的CLI中第一个字符串是设备名,那后面的命令就在该设备上执行。

例如我们想在h1设备上执行ifconfig则输入如下命令:

h1ifconfig-a

h1-eth0Linkencap:

EthernetHWaddr3e:

94:

43:

b1:

ad:

48

inetaddr:

10.0.0.1Bcast:

10.255.255.255Mask:

255.0.0.0

inet6addr:

fe80:

:

3c94:

43ff:

feb1:

ad48/64Scope:

Link

UPBROADCASTRUNNINGMULTICASTMTU:

1500Metric:

1

R*packets:

22errors:

0dropped:

0overruns:

0frame:

T*packets:

8errors:

0carrier:

collisions:

0t*queuelen:

1000

R*bytes:

1764(1.7KB)T*bytes:

648(648.0B)

loLinkencap:

LocalLoopback

127.0.0.1Mask:

:

1/128Scope:

Host

UPLOOPBACKRUNNINGMTU:

65536Metric:

0errors:

0(0.0B)T*bytes:

0(0.0B)

上面的输出中,可以看见h1-eth0跟lo两个接口,需要注意的是,在Linu*系统的shell中运行ifconfig是看不到h1-eth0。

与h1-eth0相反的是,switch默认是跑在root的网络namespace上面,所以在switch上执行命令与在Linu*下的shell中是一样的。

s1ifconfig-a

eth0Linkencap:

EthernetHWaddr08:

00:

27:

98:

dc:

aa

10.0.2.15Bcast:

10.0.2.255Mask:

255.255.255.0

a00:

27ff:

fe98:

dcaa/64Scope:

46716errors:

40265errors:

10804203(10.8MB)T*bytes:

40122199(40.1MB)

43654errors:

37264504(37.2MB)T*bytes:

37264504(37.2MB)

l*cbr0Linkencap:

EthernetHWaddrfe:

5e:

f0:

f7:

a6:

f3

10.0.3.1Bcast:

10.0.3.255Mask:

a8c4:

b5ff:

fea6:

2809/64Scope:

52errors:

20errors:

4759(4.7KB)T*bytes:

2952(2.9KB)

ovs-systemLinkencap:

79:

59:

3d:

d9:

bb

BROADCASTMULTICASTMTU:

s1Linkencap:

EthernetHWaddr6e:

8c:

5d:

91:

d5:

44

fc47:

8aff:

fe6a:

4155/64Scope:

UPBROADCASTRUNNINGMTU:

13errors:

1026(1.0KB)T*bytes:

s1-eth1Linkencap:

EthernetHWaddr5e:

a2:

86:

f3:

b1

5ca2:

f7ff:

fe86:

f3b1/64Scope:

648(648.0B)T*bytes:

1764(1.7KB)

s1-eth2Linkencap:

EthernetHWaddrb2:

c6:

37:

e0:

61

b0c6:

37ff:

fee0:

d961/64Scope:

21errors:

1674(1.6KB)

veth14524JLinkencap:

ca:

13:

f5:

dd:

b4

fcca:

13ff:

fef5:

ddb4/64Scope:

40errors:

4190(4.1KB)

veth2K19CELinkencap:

f1:

e8:

49:

45

fcf1:

fee8:

4945/64Scope:

42errors:

4370(4.3KB)

veth9WSHRKLinkencap:

87:

1d:

33:

f6:

41

fc87:

1dff:

fe33:

f641/64Scope:

43errors:

4460(4.4KB)

vethH2K7R5Linkencap:

fc5e:

f0ff:

fef7:

a6f3/64Scope:

14errors:

48errors:

1776(1.7KB)T*bytes:

5030(5.0KB)

vethO99MI2Linkencap:

cf:

ee:

97:

fb:

7f

fccf:

eeff:

fe97:

fb7f/64Scope:

51errors:

1767(1.7KB)T*bytes:

5294(5.2KB)

上面的输出中包含交换机的虚拟网卡s1,以及主机的eth0。

为了区别显示host主机的网络是隔离的,我们可以通过arp与route命令来做演示,分别在s1与h1上面演示如下:

s1arp

AddressHWtypeHWaddressFlagsMaskIface

localhostether00:

16:

3e:

54:

9c:

03Cl*cbr0

localhostether52:

12:

35:

02Ceth0

03Ceth0

51:

24:

a7Cl*cbr0

s1route

KernelIProutingtable

DestinationGatewayGenmaskFlagsMetricRefUseIface

defaultlocalhost0.0.0.0UG000eth0

10.0.2.0*255.255.255.0U000eth0

10.0.3.0*255.255.255.0U000l*cbr0

172.17.0.0*255.255.0.0U000docker0

h1arp

h1route

10.0.0.0*255.0.0.0U000h1-eth0

这样可以做到将每一个主机,交换机,以及控制器都放到他自己的标准的networknamespace中,但是这种做法并没有什么特别的优势,除非你想复制一个非常复杂的网络。

Mininet不支持这种做法,你可以通过--innamespace参数来查看更多的信息。

感觉有点像L*C或者说想最近比拟火的Docker

注意:

只有网络是虚拟出来的,每一个主机里面的进程使用的都是同一套目录,可以看到一样的进程集合,我们打印不同主机下面的进程列表看看:

h1ps-a

PIDTTYTIMECMD

3899pts/300:

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 求职职场 > 简历

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2