資源簡介
#!/usr/bin/python
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.util import irange,dumpNodeConnections
from mininet.log import setLogLevel
class LinearTopo(Topo):
"Linear topology of k switches, with one host per seitch"
def __init__(self, k=2, **opts):
代碼片段和文件信息
#!/usr/bin/python
from?mininet.topo?import?Topo
from?mininet.net?import?Mininet
from?mininet.util?import?irangedumpNodeConnections
from?mininet.log?import?setLogLevel
class?LinearTopo(Topo):
????“Linear?topology?of?k?switches?with?one?host?per?seitch“
????def?__init__(self?k=2?**opts):
????????“““Init.
????????k:?number?of?switches?(and?hosts)
????????hconf:?host?configuration?options
????????lconf:?ling?configuration?options“““
????????super(LinearTopo?self).__init__(**opts)
????????self.k?=?k
????????“““creates?7?switchs“““
????????switch1?=?self.addSwitch(‘s1‘)
????????switch2?=?self.addSwitch(‘s2‘)
????????switch3?=?self.addSwitch(‘s3‘)
????????switch4?=?self.addSwitch(‘s4‘)
????????switch5?=?self.addSwitch(‘s5‘)
????????switch6?=?self.addSwitch(‘s6‘)
??
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-05-02?09:37??實(shí)驗(yàn)2\
?????文件????????2791??2013-11-26?20:00??實(shí)驗(yàn)2\datacenter.py
?????文件??????212992??2014-03-26?08:57??實(shí)驗(yàn)2\實(shí)驗(yàn)報告.doc
評論
共有 條評論