commit 0974ce2afc5b0de351717f33773fa8f6b1cb4fb8 Author: Benjamin Hesmans Date: Tue Jan 6 15:47:15 2015 +0100 wip Signed-off-by: Benjamin Hesmans diff --git a/src/conf/topo/0_para_2 b/src/conf/topo/0_para_2 new file mode 100644 index 0000000..b5f67c6 --- /dev/null +++ b/src/conf/topo/0_para_2 @@ -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 diff --git a/src/conf/topo/1_para_3 b/src/conf/topo/1_para_3 new file mode 100644 index 0000000..c1e03eb --- /dev/null +++ b/src/conf/topo/1_para_3 @@ -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 diff --git a/src/mpECMPSingleInterfaceTopo.py b/src/mpECMPSingleInterfaceTopo.py new file mode 100644 index 0000000..e69de29 diff --git a/src/mpLinkCharacteristics.py b/src/mpLinkCharacteristics.py new file mode 100644 index 0000000..4f6dc0b --- /dev/null +++ b/src/mpLinkCharacteristics.py @@ -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 + diff --git a/src/mpMininetBuilder.py b/src/mpMininetBuilder.py new file mode 100644 index 0000000..08be38d --- /dev/null +++ b/src/mpMininetBuilder.py @@ -0,0 +1,5 @@ +from mininet.topo import Topo + +class MpMininetBuilder(Topo): + def __init__(self): + Topo.__init__( self ) diff --git a/src/mpMultiInterfaceTopo.py b/src/mpMultiInterfaceTopo.py new file mode 100644 index 0000000..227dcf3 --- /dev/null +++ b/src/mpMultiInterfaceTopo.py @@ -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 + diff --git a/src/mpParamTopo.py b/src/mpParamTopo.py new file mode 100644 index 0000000..d9e00c4 --- /dev/null +++ b/src/mpParamTopo.py @@ -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 diff --git a/src/mpPerf.py b/src/mpPerf.py new file mode 100755 index 0000000..d87a17e --- /dev/null +++ b/src/mpPerf.py @@ -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) diff --git a/src/mpTopo.py b/src/mpTopo.py new file mode 100644 index 0000000..f8c6ad4 --- /dev/null +++ b/src/mpTopo.py @@ -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 + + diff --git a/tex/Makefile b/tex/Makefile new file mode 100644 index 0000000..7a9cb32 --- /dev/null +++ b/tex/Makefile @@ -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) diff --git a/tex/include/goals.tex b/tex/include/goals.tex new file mode 100644 index 0000000..8c174f6 --- /dev/null +++ b/tex/include/goals.tex @@ -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 + + + diff --git a/tex/include/why.tex b/tex/include/why.tex new file mode 100644 index 0000000..1f90c15 --- /dev/null +++ b/tex/include/why.tex @@ -0,0 +1,2 @@ +\section{Why are we doing this ?} + diff --git a/tex/main.tex b/tex/main.tex new file mode 100644 index 0000000..8b2ea5e --- /dev/null +++ b/tex/main.tex @@ -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}