1.安装mininet
参考链接:http://www.sdnlab.com/15138.html
2.用字符命令生成拓扑,并测试连通性,截图
参考链接:http://www.sdnlab.com/15077.html
拓扑图如下:
- 用字符命令生成拓扑
- 并测试连通性
3.用可视化界面生成拓扑,并测试连通性,截图
参考链接:http://www.sdnlab.com/15096.html
- 用字符命令打开mininet
- 生成拓扑图
- 设置IP,协议;测试连通性
4.用Python脚本生成一个Fat-tree型的拓扑,截图
参考链接:http://www.sdnlab.com/15128.html
拓扑图如下:
- 安装floodlight
安装参考链接http://blog.csdn.net/damontive/article/details/48972353 - 写好Python脚本:fattree.py代码:
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import RemoteController,CPULimitedHost
from mininet.link import TCLink
from mininet.util import dumpNodeConnections
class MyTopo( Topo ):
def __init__( self ):
"Create custom topo."
# Initialize topology
Topo.__init__( self )
L1 = 2
L2 = L1*2
L3 = L2
s = []
a = []
e = []
for i in range(L1):
sw = self.addSwitch('s{}'.format(i+1))
s.append(sw)
for i in range(L2):
sw = self.addSwitch('a{}'.format(i+1))
a.append(sw)
for i in range(L3):
sw = self.addSwitch('e{}'.format(i+1))
e.append(sw)
for i in range(L1):
sw1 = s[i]
for sw2 in a[0:]:
self.addLink(sw2,sw1)
for i in range(0,L2,2):
for sw1 in a[i:i+2]:
for sw2 in e[i:i+2]:
self.addLink(sw2,sw1)
count = 1
for sw1 in e:
for i in range(2):
host = self.addHost('h{}'.format(count))
self.addLink(sw1,host)
count +=1
topos = { 'mytopo': ( lambda: MyTopo() ) }
- 启动Mininet,生成测试拓扑结构
输入# sudo mn --custom fattree.py --topo mytopo --controller=remote,ip=10.211.55.4,port=6653 --switch ovsk,protocols=OpenFlow10
- 测试连通性:
遇到的问题:
1.Floodlight的安装问题。
2.由于我装的是双系统,做实践过程中发生wifi用一会就莫名断开,一断开就连不上,只能重启来解决。