mininet学习记录之walkthrough

接下来要看的教程:walkthrough

拓扑编程语句

youtubu视频也不错~

sudo mn -h展示help

sudo mn: one OpenFlow kernel switch connected to two hosts,plus the OpenFlow reference controller

它相当于sudo mn --topo=minimal

help可查看在mininet下可执行的所有命令

lo指的是loopback

s1 ifconfig -a会显示s1的interface

名字会自动被替换为IP

job control (&jobskill)???

在h1上启动HTTP服务

在h2上向它请求 

wget -O,  --output-document=FILE    将文档写入 FILE。

如果mininet意外崩溃,clean it up

sudo mn -c

Part 2: Advanced Startup Options

 

sudo mn --topo single,3 建立了一个switch三个host的拓扑结构,三个host都链接到switch

sudo mn --topo linear,4 4个switch线性相连,每个switch链接一个host

Parametrized topologies are one of Mininet’s most useful and powerful features!

可以在命令行中自动设置属性

sudo mn -v debug会输出很多冗余信息

sudo mn -v output屏幕上什么也没有就进入了mininet

每次进入mininet都会随机分配MAC地址,可以用mac选项

The --mac option is super-useful, and sets the host MAC and IP addrs to small, unique, easy-to-read IDs.

sudo mn --mac 但是switch的MAC还是非常随机的,因为可以用openflow修改它。

sudo mn -x 能给启动所有nodes的窗口

已经杀干净了但不知道为什么不对

switch分为openflow核,user,和OVS

https://github.com/mininet/mininet/wiki/Installing-new-version-of-Open-vSwitch

To record the time to set up and tear down a topology, use test ‘none’:

默认情况下,主机是在自己的命名空间里,交换机和控制器在root,要想将交换机放在自己的命名空间下

sudo mn --innamespace --switch user

这种情况下,不使用本地回环,而是与控制器桥接,这种方式隔绝了交换机(不是很懂)

可以用py输出,查看可访问的本地变量,dir命令查找node可以使用的方法和属性

具体怎么用用py help(h1)来显示

查看IP可以,赋值好像不行

可以拆链,也可以建立链接

/usr/lib/python2.7/dist-packages/mininet/examples/sshd.py

在每个host上运行ssh daemon,报错 Could not find a default OpenFlow controller

Using a Remote Controller

Note: this step is not part of the default walkthrough; it is primarily useful if you have a controller running outside of the VM, such as on the VM host, or a different physical PC. The OpenFlow tutorial uses controller --remote for starting up a simple learning switch that you create using a controller framework like POX, NOX, Beacon or Floodlight.

When you start a Mininet network, each switch can be connected to a remote controller - which could be in the VM, outside the VM and on your local machine, or anywhere in the world.

This setup may be convenient if you already have a custom version of a controller framework and development tools (such as Eclipse) installed on the local machine, or you want to test a controller running on a different physical machine (maybe even in the cloud).

If you want to try this, fill in the host IP and/or listening port:

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

For example, to run POX’s sample learning switch, you could do something like

$ cd ~/pox
$ ./pox.py forwarding.l2_learning

in one window, and in another window, start up Mininet to connect to the “remote” controller (which is actually running locally, but outside of Mininet’s control):

$ sudo mn --controller=remote,ip=127.0.0.1,port=6633

Note these are actually the default IP address and port values.

If you generate some traffic (e.g. h1 ping h2) you should be able to observe some output in the POX window showing that the switch has connected and that some flow table entries have been installed.

A number of OpenFlow controller frameworks are readily available and should work readily with Mininet as long as you start them up and specify the remote controller option with the correct IP address of the machine where your controller is runing and the correct port that it is listening on.

意思是只要IP地址和端口设对了,就OKK 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值