wip
Signed-off-by: Benjamin Hesmans <benjamin.hesmans@uclouvain.be>
This commit is contained in:
commit
0974ce2afc
9
src/conf/topo/0_para_2
Normal file
9
src/conf/topo/0_para_2
Normal file
@ -0,0 +1,9 @@
|
||||
desc:Simple configuration with two para link
|
||||
leftSubnet:xxx
|
||||
rightSubnet:yyy
|
||||
midSubnet:zzz
|
||||
#path_x:delay,queueSize(may be calc),bw
|
||||
error
|
||||
path_0:10,15,5
|
||||
path_1:40,10,5
|
||||
topoType:MultiIf
|
10
src/conf/topo/1_para_3
Normal file
10
src/conf/topo/1_para_3
Normal file
@ -0,0 +1,10 @@
|
||||
desc:Simple configuration with two para link
|
||||
leftSubnet:xxx
|
||||
rightSubnet:yyy
|
||||
midSubnet:zzz
|
||||
#path_x:delay,queueSize(may be calc),bw
|
||||
error
|
||||
path_0:10,15,5
|
||||
path_1:40,10,5
|
||||
path_2:40,10,5
|
||||
topoType:MultiIf
|
0
src/mpECMPSingleInterfaceTopo.py
Normal file
0
src/mpECMPSingleInterfaceTopo.py
Normal file
17
src/mpLinkCharacteristics.py
Normal file
17
src/mpLinkCharacteristics.py
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
|
||||
class MpLinkCharacteristics:
|
||||
def __init__(self, id, delay, queueSize, bandwidth):
|
||||
self.id = id
|
||||
self.delay = delay
|
||||
self.queueSize = queueSize
|
||||
self.bandwidth = bandwidth
|
||||
|
||||
def __str__(self):
|
||||
s = "Link id : " + str(self.id) + "\n"
|
||||
s = s + "\tDelay : " + str(self.delay) + "\n"
|
||||
s = s + "\tQueue Size : " + str(self.queueSize) + "\n"
|
||||
s = s + "\tBandwidth : " + str(self.bandwidth)
|
||||
return s
|
||||
|
5
src/mpMininetBuilder.py
Normal file
5
src/mpMininetBuilder.py
Normal file
@ -0,0 +1,5 @@
|
||||
from mininet.topo import Topo
|
||||
|
||||
class MpMininetBuilder(Topo):
|
||||
def __init__(self):
|
||||
Topo.__init__( self )
|
31
src/mpMultiInterfaceTopo.py
Normal file
31
src/mpMultiInterfaceTopo.py
Normal file
@ -0,0 +1,31 @@
|
||||
from mpTopo import MpTopo
|
||||
|
||||
class MpMultiInterfaceTopo(MpTopo):
|
||||
def __init__(self, topoBuilder, parameterFile):
|
||||
MpTopo.__init__(self,topoBuilder, parameterFile)
|
||||
print("Hello from topo multi if")
|
||||
self.addHost("Client")
|
||||
self.addHost("Server")
|
||||
for l in self.topoParam.linkCharacteristics:
|
||||
self.addOneSwitchPerLink(l)
|
||||
|
||||
def addOneSwitchPerLink(self, link):
|
||||
self.addSwitch("sw" + str(link.id))
|
||||
|
||||
def __str__(self):
|
||||
s = "Simple multiple interface topolgy \n"
|
||||
i = 0
|
||||
n = len(self.topoParam.linkCharacteristics)
|
||||
for p in self.topoParam.linkCharacteristics:
|
||||
if i == n // 2:
|
||||
if n % 2 == 0:
|
||||
s = s + "c r-----s\n"
|
||||
s = s + "|-----sw-----|\n"
|
||||
else:
|
||||
s = s + "c-----sw-----r-----s\n"
|
||||
else:
|
||||
s = s + "|-----sw-----|\n"
|
||||
|
||||
i = i + 1
|
||||
return s
|
||||
|
55
src/mpParamTopo.py
Normal file
55
src/mpParamTopo.py
Normal file
@ -0,0 +1,55 @@
|
||||
from mpLinkCharacteristics import MpLinkCharacteristics
|
||||
|
||||
|
||||
class MpParamTopo:
|
||||
def __init__(self, paramFile):
|
||||
self.paramDic = {}
|
||||
self.linkCharacteristics = []
|
||||
print("Create the param Object")
|
||||
self.loadParamFile(paramFile)
|
||||
self.loadLinkCharacteristics()
|
||||
|
||||
def loadParamFile(self, paramFile):
|
||||
f = open(paramFile)
|
||||
i = 0
|
||||
for l in f:
|
||||
i = i + 1
|
||||
if l.startswith("#"):
|
||||
continue
|
||||
|
||||
tab = l.split(":")
|
||||
if len(tab) == 2:
|
||||
self.paramDic[tab[0]] = tab[1][:-1]
|
||||
else:
|
||||
print("Ignored Line " + str(i))
|
||||
print(l),
|
||||
print("In file " + paramFile)
|
||||
f.close()
|
||||
|
||||
def loadLinkCharacteristics(self):
|
||||
i = 0
|
||||
for k in self.paramDic:
|
||||
if k.startswith("path"):
|
||||
tab = self.paramDic[k].split(",")
|
||||
if len(tab) == 3:
|
||||
i = i + 1
|
||||
path = MpLinkCharacteristics(i,tab[0],
|
||||
tab[1], tab[2])
|
||||
self.linkCharacteristics.append(path)
|
||||
else:
|
||||
print("Ignored path :")
|
||||
print(self.paramDic[k])
|
||||
|
||||
def getParam(self, key):
|
||||
if key in self.paramDic:
|
||||
return self.paramDic[key]
|
||||
else:
|
||||
raise Exception("Param not found " + key)
|
||||
|
||||
def __str__(self):
|
||||
s = self.paramDic.__str__()
|
||||
s = s + "\n"
|
||||
for p in self.linkCharacteristics[:-1]:
|
||||
s = s + p.__str__() + "\n"
|
||||
s = s + self.linkCharacteristics[-1].__str__()
|
||||
return s
|
44
src/mpPerf.py
Executable file
44
src/mpPerf.py
Executable file
@ -0,0 +1,44 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import sys, getopt
|
||||
from mpParamTopo import MpParamTopo
|
||||
from mpMultiInterfaceTopo import MpMultiInterfaceTopo
|
||||
from mpMininetBuilder import MpMininetBuilder
|
||||
|
||||
topoParamFile = None
|
||||
topoType = "mininet"
|
||||
|
||||
def printHelp():
|
||||
print("Help Menu")
|
||||
|
||||
def parseArgs(argv):
|
||||
global topoParamFile
|
||||
try:
|
||||
opts, args = getopt.getopt(argv, "hf:", ["topoParam="])
|
||||
except getopt.GetoptError:
|
||||
printHelp()
|
||||
sys.exit(1)
|
||||
for opt, arg in opts:
|
||||
if opt == "-h":
|
||||
printHelp()
|
||||
sys.exit(1)
|
||||
elif opt in ("-f","--topoParam"):
|
||||
print("hllo", arg);
|
||||
topoParamFile = arg
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parseArgs(sys.argv[1:])
|
||||
if topoParamFile is None:
|
||||
print("Use command line param")
|
||||
else:
|
||||
param = MpParamTopo(topoParamFile)
|
||||
|
||||
if topoType == "mininet":
|
||||
if param.getParam('topoType') == "MultiIf":
|
||||
mpTopo = MpMultiInterfaceTopo(MpMininetBuilder(), param)
|
||||
|
||||
else:
|
||||
print("Unrecognized topo type")
|
||||
print(mpTopo)
|
28
src/mpTopo.py
Normal file
28
src/mpTopo.py
Normal file
@ -0,0 +1,28 @@
|
||||
class MpTopo:
|
||||
"""Simple MpTopo"""
|
||||
def __init__(self, topoBuilder, topoParam):
|
||||
self.topoBuilder = topoBuilder
|
||||
self.topoParam = topoParam
|
||||
|
||||
def commandTo(self, who, cmd):
|
||||
pass
|
||||
|
||||
def getHost(self, who):
|
||||
pass
|
||||
|
||||
def addHost(self, host):
|
||||
print("TODO, add host " + host)
|
||||
self.topoBuilder.addHost(host)
|
||||
pass
|
||||
|
||||
def addSwitch(self, switch):
|
||||
print("TODO, add switchi " + switch)
|
||||
self.topoBuilder.addSwitch(switch)
|
||||
pass
|
||||
|
||||
def addLink(self, fromA, toB, **kwargs):
|
||||
#todo check syntax for **kwargs
|
||||
self.topoBuilder.addLink(fromA,toB,**kwargs)
|
||||
pass
|
||||
|
||||
|
9
tex/Makefile
Normal file
9
tex/Makefile
Normal file
@ -0,0 +1,9 @@
|
||||
MAINDOC=main.pdf
|
||||
MAINDOCSRC= $(MAINDOC:.pdf=.tex)
|
||||
TEX_FILES= main.tex include/why.tex include/goals.tex
|
||||
PDFLATEX=pdflatex
|
||||
|
||||
all: $(MAINDOC)
|
||||
|
||||
$(MAINDOC): $(TEX_FILES)
|
||||
$(PDFLATEX) $(MAINDOCSRC)
|
26
tex/include/goals.tex
Normal file
26
tex/include/goals.tex
Normal file
@ -0,0 +1,26 @@
|
||||
\section{Goals}
|
||||
|
||||
\subsection{Glob}
|
||||
It should be easy to test a specific version of MPTCP.
|
||||
|
||||
By specific version we mean :
|
||||
|
||||
* We should be able to pick a commit
|
||||
* We should be able to select path manager
|
||||
* we should be able to express the environment to be tested
|
||||
- All of them
|
||||
- a subpart
|
||||
- just one
|
||||
- ...
|
||||
|
||||
Results should be easy to access without any modifications.
|
||||
Results should be reproducible : meaning : even configuration and so one should
|
||||
be some how saved on the repository.
|
||||
|
||||
Example of execution
|
||||
|
||||
./mpTest --mpCommit xxx --pm yy --pmCommit yyy --conf all
|
||||
./mpTest --mpCommit xxx --pm yy --pmCommit yyy --conf 42
|
||||
|
||||
|
||||
|
2
tex/include/why.tex
Normal file
2
tex/include/why.tex
Normal file
@ -0,0 +1,2 @@
|
||||
\section{Why are we doing this ?}
|
||||
|
20
tex/main.tex
Normal file
20
tex/main.tex
Normal file
@ -0,0 +1,20 @@
|
||||
\documentclass[a4paper,10pt]{article}
|
||||
\usepackage[utf8]{inputenc}
|
||||
|
||||
|
||||
\title{Tools documentations for MPTCP experiments}
|
||||
\author{}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
|
||||
\begin{abstract}
|
||||
|
||||
\end{abstract}
|
||||
|
||||
\input{include/why}
|
||||
\input{include/goals}
|
||||
|
||||
|
||||
\end{document}
|
Loading…
Reference in New Issue
Block a user