Commit 1ab5c2af authored by Alejandro Blanco's avatar Alejandro Blanco
Browse files

Uploading the files from the private git

parent 08cd2f8a
# Config files to assess performance of CUBIC TPC and TCP BBR
import unittest
import sys
import time
import os
import random
import subprocess
sys.path.append('.')
from time import sleep
from mininet.net import Mininet
from mininet.node import Ryu, OVSSwitch
from mininet.node import Host
from mininet.clean import cleanup
from mininet.link import TCLink
from mininet.cli import CLI
from datacenter_mptcp import MyTopo
from mininet.term import cleanUpScreens, makeTerms
class testSwitchTopo(object):
"Test ping with the specified topology"
topoClass = None # Override with topology
ryuParams = ['ryu.app.simple_switch_13']
mayDrop = 0
top=MyTopo(2, 2, 4, 2)
# This is to enable the RYU controller, which enables loop-free routes that the standard SDN controller doesn't enable
def controller(self, name, **params):
return Ryu(name, *self.ryuParams, **params)
@staticmethod
def tearDown():
"Clean up the network"
if sys.exc_info != (None, None, None):
cleanup()
def testPing(self):
"Create the network and run a ping test"
#
net = Mininet(topo=self.topoClass(2, 4, 8, 2), controller=self.controller, host=Host,
switch=OVSSwitch, link=TCLink, waitConnected=True)
#net.link.bw=10000
net.addNAT().configDefault()
net.addLink(net.hosts[-1],net.switches[1])
net.hosts[0].cmd('sysctl net.ipv4.ip_forward=1')
print net.hosts[-1]
for i in range (len(net.hosts)-2):
print(net.hosts[i+1])
net.hosts[1+i].cmd('sudo ip route add 10.16.0.0/12 via 10.0.0.1')
#net.hosts[-1].cmd('iptables -t nat -A POSTROUTING -j MASQUERADE')
net.hosts[0].cmd('iptables -t nat -A POSTROUTING -j MASQUERADE')
net.start()
CLI(net)
# set path manager
#os.system('sysctl -w net.mptcp.mptcp_path_manager=fullmesh')
# set scheduler
#os.system('sysctl -w net.mptcp.mptcp_scheduler=default')
client=[]
server=[]
for i in range ((len(net.hosts)-2)/2):
client.append(net.hosts[2*(i+1)])
server.append(net.hosts[2*(i)+1])
b= server[:]
random.shuffle(b)
for i in range (len(net.hosts)-1):
net.hosts[i].cmd('wireshark &')
# This open the mininet terminal and it allows to launch Mininet's commands
CLI(net)
puerto = 3000
n=0
m=0
n1=0
u=0
v=0
r=0
t_trafico=time.time()
t_UE=time.time()
t_ciclo=0
for i in range(5250):
r+=1
t_ciclo=time.time()
trafico1=random.randint(0, len(client)-1)
trafico2=random.randint(0, len(net.hosts)-1)
x1= random.random()
x2= random.random()
random.shuffle(b)
tempo_trafico=random.expovariate(0.01)/1000
tempo_UE=random.expovariate(0.01)/1000
b[trafico1].cmd('iperf -s -p ' + str(puerto) + ' & ')
ip= str(b[trafico1].IP).split('-eth0:')
aux= ip[1].find(',')
ip=ip[1][0:aux]
if(time.time()-t_UE>=tempo_UE and m<100 and u>20):
m=m+1
v=v+1
if (x2<0.8 and n1<80):
y= random.randint(100, 10000)
net.hosts[trafico2].cmd('iperf -c 10.16.0.2' + ' -n'+ str(y)+ ' -M 1400 &')
n1+=1
t_UE=time.time()
else:
y=random.randint(10000, 10000000)
net.hosts[trafico2].cmd('iperf -c 10.16.0.2'+ ' -n '+ str(y)+ '-M 1400 &')
t=UE=time.time()
if (time.time()-t_trafico>=tempo_trafico):
u=u+1
if (x1<0.8 and n<900):
y= random.randint(100, 10000)
client[trafico1].cmd('iperf -c '+ str(ip) + ' -n '+ str(y)+ ' -p '+ str(puerto)+ ' &')
puerto+=1
n+=1
t_trafico=time.time()
else:
y=random.randint(10000, 10000000)
client[trafico1].cmd('iperf -c '+ str(ip) + ' -n '+ str(y)+ ' -p '+ str(puerto)+ ' &')
puerto+=1
t_trafico=time.time()
time.sleep(0.003)
print('u ' +str(u)+ ' v ' + str(v)+ 'r' +str(r))
print(n1)
print(n)
print(u)
print(v)
CLI(net)
net.stop()
class TestDatacenter_tier3(testSwitchTopo, unittest.TestCase):
"Test the HA Root datacenter topolog"
topoClass= MyTopo
ryuParams= ['ryu.app.simple_switch_stp']
mayDrop = 15
# enable MPTCP
#os.system('sysctl -w net.mptcp.mptcp_enabled=0')
#enable debug output, execute "dmesg" to read output
#os.system('sysctl -w net.mptcp.mptcp_debug=0')
if __name__ == '__main__':
unittest.main()
import unittest
import sys
import time
import os
import random
import subprocess
sys.path.append('.')
from time import sleep
from mininet.net import Mininet
from mininet.node import Ryu, OVSSwitch
from mininet.node import Host
from mininet.clean import cleanup
from mininet.link import TCLink
from mininet.cli import CLI
from datacenter_mptcp import MyTopo
from mininet.term import cleanUpScreens, makeTerms
class testSwitchTopo(object):
"Test ping with the specified topology"
topoClass = None # Override with topology
ryuParams = ['ryu.app.simple_switch_13']
mayDrop = 0
top=MyTopo(2, 2, 4, 2)
# This is to enable the RYU controller, which enables loop-free routes that the standard SDN controller doesn't enable
def controller(self, name, **params):
return Ryu(name, *self.ryuParams, **params)
@staticmethod
def tearDown():
"Clean up the network"
if sys.exc_info != (None, None, None):
cleanup()
def testPing(self):
"Create the network and run a ping test"
#
net = Mininet(topo=self.topoClass(2, 4, 8, 2), controller=self.controller, host=Host,
switch=OVSSwitch, link=TCLink, waitConnected=True)
#net.link.bw=10000
net.addNAT().configDefault()
net.addLink(net.hosts[-1],net.switches[1])
net.hosts[0].cmd('sysctl net.ipv4.ip_forward=1')
print net.hosts[-1]
for i in range (len(net.hosts)-2):
print(net.hosts[i+1])
net.hosts[1+i].cmd('sudo ip route add 10.16.0.0/12 via 10.0.0.1')
#net.hosts[-1].cmd('iptables -t nat -A POSTROUTING -j MASQUERADE')
net.hosts[0].cmd('iptables -t nat -A POSTROUTING -j MASQUERADE')
net.start()
CLI(net)
# set path manager
#os.system('sysctl -w net.mptcp.mptcp_path_manager=fullmesh')
# set scheduler
#os.system('sysctl -w net.mptcp.mptcp_scheduler=default')
client=[]
server=[]
for i in range ((len(net.hosts)-2)/2):
client.append(net.hosts[2*(i+1)])
server.append(net.hosts[2*(i)+1])
b= server[:]
random.shuffle(b)
for i in range (len(net.hosts)-1):
net.hosts[i].cmd('wireshark &')
# This open the mininet terminal and it allows to launch Mininet's commands
CLI(net)
puerto = 3000
n=0
m=0
n1=0
u=0
v=0
r=0
t_trafico=time.time()
t_UE=time.time()
t_ciclo=0
for i in range(5250):
r+=1
t_ciclo=time.time()
trafico1=random.randint(0, len(client)-1)
trafico2=random.randint(0, len(net.hosts)-1)
x1= random.random()
x2= random.random()
random.shuffle(b)
tempo_trafico=random.expovariate(0.01)/1000
tempo_UE=random.expovariate(0.01)/1000
b[trafico1].cmd('iperf -s -p ' + str(puerto) + ' & ')
ip= str(b[trafico1].IP).split('-eth0:')
aux= ip[1].find(',')
ip=ip[1][0:aux]
if(time.time()-t_UE>=tempo_UE and m<100 and u>20):
m=m+1
v=v+1
if (x2<0.8 and n1<80):
y= random.randint(100, 10000)
net.hosts[trafico2].cmd('iperf -c 10.16.0.2' + ' -n'+ str(y)+ ' -M 1400 &')
n1+=1
t_UE=time.time()
else:
y=random.randint(10000, 10000000)
net.hosts[trafico2].cmd('iperf -c 10.16.0.2'+ ' -n '+ str(y)+ '-M 1400 &')
t=UE=time.time()
if (time.time()-t_trafico>=tempo_trafico):
u=u+1
if (x1<0.8 and n<900):
y= random.randint(100, 10000)
client[trafico1].cmd('iperf -c '+ str(ip) + ' -n '+ str(y)+ ' -p '+ str(puerto)+ ' &')
puerto+=1
n+=1
t_trafico=time.time()
else:
y=random.randint(10000, 10000000)
client[trafico1].cmd('iperf -c '+ str(ip) + ' -n '+ str(y)+ ' -p '+ str(puerto)+ ' &')
puerto+=1
t_trafico=time.time()
time.sleep(0.003)
print('u ' +str(u)+ ' v ' + str(v)+ 'r' +str(r))
print(n1)
print(n)
print(u)
print(v)
CLI(net)
net.stop()
class TestDatacenter_tier3(testSwitchTopo, unittest.TestCase):
"Test the HA Root datacenter topolog"
topoClass= MyTopo
ryuParams= ['ryu.app.simple_switch_stp']
mayDrop = 15
# enable MPTCP
#os.system('sysctl -w net.mptcp.mptcp_enabled=0')
#enable debug output, execute "dmesg" to read output
#os.system('sysctl -w net.mptcp.mptcp_debug=0')
if __name__ == '__main__':
unittest.main()
# This is a test example
import unittest
import sys
import time
import os
import random
import subprocess
sys.path.append('.')
from time import sleep
from mininet.net import Mininet
from mininet.node import Ryu, OVSSwitch
from mininet.node import Host
from mininet.clean import cleanup
from mininet.link import TCLink
from mininet.cli import CLI
from datacenter_tier3 import MyTopo
from mininet.term import cleanUpScreens, makeTerms
class testSwitchTopo(object):
"Test ping with the specified topology"
topoClass = None # Override with topology
ryuParams = ['ryu.app.simple_switch_13']
mayDrop = 0
top=MyTopo(2, 2, 4, 2)
# This is to enable the RYU controller, which enables loop-free routes that the standard SDN controller doesn't enable
def controller(self, name, **params):
return Ryu(name, *self.ryuParams, **params)
@staticmethod
def tearDown():
"Clean up the network"
if sys.exc_info != (None, None, None):
cleanup()
def testPing(self):
"Create the network and run a ping test"
#
net = Mininet(topo=self.topoClass(2, 4, 8, 8), controller=self.controller, host=Host,
switch=OVSSwitch, link=TCLink, waitConnected=True)
#net.link.bw=10000
net.addNAT().configDefault()
net.hosts[0].cmd('sysctl net.ipv4.ip_forward=1')
print net.hosts[-1]
for i in range (len(net.hosts)-1):
print(net.hosts[i+1])
net.hosts[1+i].cmd('sudo ip route add 10.16.0.0/12 via 10.0.0.1')
#net.hosts[-1].cmd('sudo ip route add 10.16.0.0/12 via 10.0.0.1')
net.hosts[0].cmd('iptables -t nat -A POSTROUTING -j MASQUERADE')
#net.hosts[-1].cmd('sudo ip route add 10.0.0.8 via 10.0.0.1')
net.start()
client=[]
server=[]
for i in range ((len(net.hosts)-1)/2):
client.append(net.hosts[2*(i)])
server.append(net.hosts[2*(i)+1])
b= server[:]
b_shuffle = [x for x in range(0, len(server))]
random.shuffle(b)
#print b
#print b_shuffle
CLI(net)
# This open the mininet terminal and it allows to launch Mininet's commands
"""for i in range (len(client)):
b[i].cmd('iperf -s -u &')
client[i].cmd('iperf -c ' + b[i].IP() + ' -t 10000 -i 1 -u -b 10M &')
net.hosts[0].cmd('wireshark')"""
"""sleep(10)
net.hosts[0].cmd('iperf -s &')
net.hosts[1].cmd('iperf -c 10.0.0.1 -t 10000 -i 1 -u -b 50M &')
net.hosts[2].cmd('iperf -s &')
net.hosts[3].cmd('iperf -c 10.0.0.1 -t 10000 -i 1 -u -b 50M &')"""
net.stop()
#net.ping()
#net.myiperf(net.hosts,10)
class TestDatacenter_tier3(testSwitchTopo, unittest.TestCase):
"Test the HA Root datacenter topolog"
topoClass= MyTopo
ryuParams= ['ryu.app.simple_switch_stp']
mayDrop = 15
if __name__ == '__main__':
unittest.main()
# This file modifies the 3-tier data center topology
# in order for the hosts to have multiple interfaces towards
# ToR switches making MP-TCP working
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.link import TCLink
from mininet.log import setLogLevel
from mininet.node import CPULimitedHost
from mininet.node import Controller
from mininet.nodelib import NAT
class MyTopo( Topo ):
"Simple topology example."
def __init__( self, core=2, aggregation=4, edge=8, h=1, **opts):
"Create custom topo."
Core= [core]
Aggr= [aggregation]
Edge=[edge]
self.Host=[edge*h]
"Topo.__init__(self)"
super(MyTopo, self).__init__(**opts)
# Add hosts and switches
"Creating Core Switches"
for i in range(core):
Core.append(self.addSwitch('s%s' % i))
print(Core[i+1])
"Creating Aggregation Switches"
for i in range(aggregation):
Aggr.append(self.addSwitch('s%s' % (i+core)))
"Creating Edge Switches"
for i in range(edge):
Edge.append(self.addSwitch('s%s' % (i+core+aggregation)))
"Creating Hosts"
for i in range (h*edge):
self.Host.append(self.addHost('h%s' % i))
# Add links
"Links between Core and Aggregation Switches: All connected"
for i in range (core):
for j in range (aggregation):
self.addLink( Core[i+1], Aggr[j+1], bw=10000)
"""LInks between Aggregation and Edge Switches: We make groups depending on
the number of core switches"""
n=0
m=0
for k in range (core):
for i in range(n,aggregation/core+n):
for j in range (m, edge/core+m):
self.addLink(Aggr[i+1], Edge[j+1], bw=1000)
n=n+aggregation/core
m=m+edge/core
n=0
m=0
"""Links between Edge Switches and hosts: h hosts for each Switch"""
for k in range (core):
for i in range(n,edge/core+n):
for j in range (m, edge*h/core+m):
self.addLink(Edge[i+1], self.Host[j+1], bw=1000)
n=n+edge/core
m=m+edge*h/core
topos = { 'mytopo': MyTopo }
print("Ha terminado")
# This file creates a 3-tier data center topology
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.link import TCLink
from mininet.log import setLogLevel
from mininet.node import CPULimitedHost
from mininet.node import Controller
from mininet.nodelib import NAT
class MyTopo( Topo ):
"Simple topology example."
def __init__( self, core=3, aggregation=6, edge=9, h=2, **opts):
"Create custom topo."
Core= [core]
Aggr= [aggregation]
Edge=[edge]
self.Host=[edge*h]
"Topo.__init__(self)"
super(MyTopo, self).__init__(**opts)
# Add hosts and switches
"Creating Core Switches"
for i in range(core):
Core.append(self.addSwitch('s%s' % i))
print(Core[i+1])
"Creating Aggregation Switches"
for i in range(aggregation):
Aggr.append(self.addSwitch('s%s' % (i+core)))
"Creating Edge Switches"
for i in range(edge):
Edge.append(self.addSwitch('s%s' % (i+core+aggregation)))
"Creating Hosts"
for i in range (h*edge):
self.Host.append(self.addHost('h%s' % i))
# Add links
"Links between Core and Aggregation Switches: All connected"
for i in range (core):
for j in range (aggregation):
self.addLink( Core[i+1], Aggr[j+1], bw=10000)
"""LInks between Aggregation and Edge Switches: We make groups depending on
the number of core switches"""
n=0
m=0
for k in range (core):
for i in range(n,aggregation/core+n):
for j in range (m, edge/core+m):
self.addLink(Aggr[i+1], Edge[j+1], bw=1000)
n=n+aggregation/core
m=m+edge/core
n=0
"""Links between Edge Switches and hosts: h hosts for each Swith"""
for i in range (edge):
for j in range(n,h+n):
self.addLink(Edge[i+1], self.Host[j+1], bw=1000)
n=n+h
def hosts(n=1):
return self.Host[n]
topos = { 'mytopo': MyTopo }
print("Finished")
# openLEON: an open source muLti-access Edge cOmputiNg emulator
**openLEON** is an open source muLti-access Edge cOmputiNg end-to-end emulator that operates from the edge data center to the mobile users.
**openLEON** bridges the functionalities of existing emulators for data centers and mobile networks, i.e., Mininet and srsLTE, and makes it possible to evaluate and validate research ideas on all the components of an end-to-end mobile edge architecture.
The presentation of the work at [ACM WiNTECH](https://sigmobile.org/mobicom/2018/workshops/wintech/index.html) can be found on [SlideShare](https://www.slideshare.net/cfiandra/openleon/cfiandra/openleon).
### Installation and Set-up
For installation, please consult our [wiki page](https://gitlab.networks.imdea.org/claudio_fiandrino/openLEON/wikis/installation). A detailed pdf version that explains step by step how to set-up
**openLEON** with code snippets and recommendations can be found in the documentation folder of the repo. See the [openLEON website downloads page](https://openleon.networks.imdea.org/downloads) for downloading a VM image containing Mininet, the EPC applications and the scripts used for routing.
### Reference
We kindly ask you to use this article as reference when citing the platform in your research articles:
> Carlos Andrés Ramiro, Claudio Fiandrino, Alejandro Blanco Pizarro, Pablo Jiménez Mateo, Norbert Ludant, and Joerg Widmer. 2018. OpenLEON: An End-to-End Emulator from the Edge Data Center to the Mobile Users. In Proceedings of the 12th International Workshop on Wireless Network Testbeds, Experimental Evaluation \& Characterization (WiNTECH '18). ACM, New York, NY, USA, 19-27. DOI: https://doi.org/10.1145/3267204.3267210
```
@inproceedings{AndresRamiro:2018:OEE:3267204.3267210,
author = {Andr{\'e}s Ramiro, Carlos and Fiandrino, Claudio and Blanco Pizarro, Alejandro and Jim{\'e}nez Mateo, Pablo and Ludant, Norbert and Widmer, Joerg},
title = {OpenLEON: An End-to-End Emulator from the Edge Data Center to the Mobile Users},
booktitle = {Proceedings of the 12th International Workshop on Wireless Network Testbeds, Experimental Evaluation \& Characterization},
series = {WiNTECH '18},
year = {2018},
isbn = {978-1-4503-5930-6},
location = {New Delhi, India},
pages = {19--27},
numpages = {9},
url = {http://doi.acm.org/10.1145/3267204.3267210},