本文整理汇总了Python中mininet.net.Mininet.pingPairFull方法的典型用法代码示例。如果您正苦于以下问题:Python Mininet.pingPairFull方法的具体用法?Python Mininet.pingPairFull怎么用?Python Mininet.pingPairFull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mininet.net.Mininet
的用法示例。
在下文中一共展示了Mininet.pingPairFull方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import pingPairFull [as 别名]
def test():
topo = DssTopo()
net = Mininet(topo, link=TCLink)
net.start()
with open("pause.test","a") as myfile:
for x in range(0,2000):
st1 = net.pingPairFull()
#print 'pausing'
time.sleep(0.01)
pause()
myfile.write( repr(st1[0][2][3]))
myfile.write('\n')
with open("noPause.test","a") as myffile:
for x in range(0,2000):
st1 = net.pingPairFull()
#print 'pausing'
time.sleep(0.01)
#pause()
myffile.write( repr(st1[0][2][3]))
myffile.write('\n')
net.stop()
示例2: intfOptions
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import pingPairFull [as 别名]
def intfOptions():
"run various traffic control commands on a single interface"
net = Mininet( autoStaticArp=True )
net.addController( 'c0' )
h1 = net.addHost( 'h1' )
h2 = net.addHost( 'h2' )
s1 = net.addSwitch( 's1' )
link1 = net.addLink( h1, s1, cls=TCLink )
net.addLink( h2, s1 )
net.start()
# flush out latency from reactive forwarding delay
net.pingAll()
info( '\n*** Configuring one intf with bandwidth of 5 Mb\n' )
link1.intf1.config( bw=5 )
info( '\n*** Running iperf to test\n' )
net.iperf()
info( '\n*** Configuring one intf with loss of 50%\n' )
link1.intf1.config( loss=50 )
info( '\n' )
net.iperf( ( h1, h2 ), l4Type='UDP' )
info( '\n*** Configuring one intf with delay of 15ms\n' )
link1.intf1.config( delay='15ms' )
info( '\n*** Run a ping to confirm delay\n' )
net.pingPairFull()
info( '\n*** Done testing\n' )
net.stop()
示例3: SingleSwitchTopo
# 需要导入模块: from mininet.net import Mininet [as 别名]
# 或者: from mininet.net.Mininet import pingPairFull [as 别名]
topo = SingleSwitchTopo(3)
try:
net = Mininet(topo=topo)
except:
cleanup()
net = Mininet(topo=topo)
print('Starting single switch network with three hosts')
net.start()
print('\nNetwork started. Press ctrl+d to close CLI.\n')
print('--Nodes--\n' + ' '.join(net.keys()))
s = net.get('h1')
a = net.get('h2')
b = net.get('h3')
for bw in [0.01, 0.1, 0.5, 1, 5]:
print('********* ' + str(bw) + ' **************')
for h in net.hosts:
h.intfs[0].config(**{ 'bw' : bw, 'delay' : '1ms' })
for cw in [3, 5, 8, 10]:
s.cmd('ip route change 10.0.0.0/8 dev h1-eth0 proto kernel scope link src 10.0.0.1 initcwnd ' + str(cw))
net.pingPairFull()
CLI(net)
print('Stopping network')
net.stop()
cleanup()