标签:markdown 技术分享 ini blog code pos 生成 example init
1、安装floodlight
2、生成拓扑并连接控制器floodlight,利用控制器floodlight查看图形拓扑
(1)代码:
from mininet.topo import Topo
class MyTopo( Topo ):
"Simple topology example."
def __init__( self ):
# Initialize topology
Topo.__init__( self )
s1 = self.addSwitch(‘s1‘)
s2 = self.addSwitch(‘s2‘)
s3 = self.addSwitch(‘s3‘)
s4 = self.addSwitch(‘s4‘)
h1 = self.addHost(‘h1‘)
h2 = self.addHost(‘h2‘)
h3 = self.addHost(‘h3‘)
self.addLink(h1,s2,1,1)
self.addLink(h2,s3,1,1)
self.addLink(s2,s1,2,1)
self.addLink(s3,s1,2,2)
self.addLink(s1,s4,3,1)
self.addLink(s4,h3,2,1)
topos = { ‘mytopo‘: ( lambda: MyTopo() ) }
(2)命令行
(3)floodlight生成的拓扑结构
标签:markdown 技术分享 ini blog code pos 生成 example init
原文地址:http://www.cnblogs.com/bingrui/p/8001395.html