experience QUIC adapted to congestion

This commit is contained in:
Quentin De Coninck 2017-06-12 10:45:40 +02:00
parent 839abb9ed5
commit 2aa1957c51

View File

@ -1,10 +1,12 @@
from mpExperience import MpExperience from mpExperience import MpExperience
from mpMultiInterfaceCongConfig import MpMultiInterfaceCongConfig
from mpParamXp import MpParamXp from mpParamXp import MpParamXp
import os import os
class MpExperienceQUIC(MpExperience): class MpExperienceQUIC(MpExperience):
GO_BIN = "/usr/local/go/bin/go" GO_BIN = "/usr/local/go/bin/go"
WGET = "~/git/wget/src/wget"
SERVER_LOG = "quic_server.log" SERVER_LOG = "quic_server.log"
CLIENT_LOG = "quic_client.log" CLIENT_LOG = "quic_client.log"
CLIENT_GO_FILE = "~/go/src/github.com/lucas-clemente/quic-go/example/client_benchmarker/main.go" CLIENT_GO_FILE = "~/go/src/github.com/lucas-clemente/quic-go/example/client_benchmarker/main.go"
@ -67,6 +69,18 @@ class MpExperienceQUIC(MpExperience):
print(s) print(s)
return s return s
def getCongServerCmd(self, congID):
s = "python " + os.path.dirname(os.path.abspath(__file__)) + \
"/https.py &> https_server" + str(congID) + ".log &"
print(s)
return s
def getCongClientCmd(self, congID):
s = "(time " + MpExperienceQUIC.WGET + " https://" + self.mpConfig.getServerCongIP(congID) +\
"/" + self.file + " --no-check-certificate --disable-mptcp) &> https_client" + str(congID) + ".log &"
print(s)
return s
def clean(self): def clean(self):
MpExperience.clean(self) MpExperience.clean(self)
if self.file == "random": if self.file == "random":
@ -80,13 +94,38 @@ class MpExperienceQUIC(MpExperience):
self.mpTopo.commandTo(self.mpConfig.server, "netstat -sn > netstat_server_before") self.mpTopo.commandTo(self.mpConfig.server, "netstat -sn > netstat_server_before")
self.mpTopo.commandTo(self.mpConfig.server, cmd) self.mpTopo.commandTo(self.mpConfig.server, cmd)
if isinstance(self.mpConfig, MpMultiInterfaceCongConfig):
i = 0
for cs in self.mpConfig.cong_servers:
cmd = self.getCongServerCmd(i)
self.mpTopo.commandTo(cs, cmd)
i = i + 1
self.mpTopo.commandTo(self.mpConfig.client, "sleep 2") self.mpTopo.commandTo(self.mpConfig.client, "sleep 2")
cmd = self.getQUICClientCmd()
self.mpTopo.commandTo(self.mpConfig.client, "netstat -sn > netstat_client_before") self.mpTopo.commandTo(self.mpConfig.client, "netstat -sn > netstat_client_before")
# First run congestion clients, then the main one
if isinstance(self.mpConfig, MpMultiInterfaceCongConfig):
i = 0
for cc in self.mpConfig.cong_clients:
cmd = self.getCongClientCmd(i)
self.mpTopo.commandTo(cc, cmd)
i = i + 1
cmd = self.getQUICClientCmd()
self.mpTopo.commandTo(self.mpConfig.client, cmd) self.mpTopo.commandTo(self.mpConfig.client, cmd)
self.mpTopo.commandTo(self.mpConfig.server, "netstat -sn > netstat_server_after") self.mpTopo.commandTo(self.mpConfig.server, "netstat -sn > netstat_server_after")
self.mpTopo.commandTo(self.mpConfig.client, "netstat -sn > netstat_client_after") self.mpTopo.commandTo(self.mpConfig.client, "netstat -sn > netstat_client_after")
# Wait for congestion traffic to end
if isinstance(self.mpConfig, MpMultiInterfaceCongConfig):
for cc in self.mpConfig.cong_clients:
self.mpTopo.commandTo(cc, "while pkill -f wget -0; do sleep 0.5; done")
self.mpTopo.commandTo(self.mpConfig.server, "pkill -f " + MpExperienceQUIC.SERVER_GO_FILE) self.mpTopo.commandTo(self.mpConfig.server, "pkill -f " + MpExperienceQUIC.SERVER_GO_FILE)
if isinstance(self.mpConfig, MpMultiInterfaceCongConfig):
for cs in self.mpConfig.cong_servers:
self.mpTopo.commandTo(cs, "pkill -f https.py")
self.mpTopo.commandTo(self.mpConfig.client, "sleep 2") self.mpTopo.commandTo(self.mpConfig.client, "sleep 2")
# Need to delete the go-build directory in tmp; could lead to no more space left error # Need to delete the go-build directory in tmp; could lead to no more space left error
self.mpTopo.commandTo(self.mpConfig.client, "rm -r /tmp/go-build*") self.mpTopo.commandTo(self.mpConfig.client, "rm -r /tmp/go-build*")