2015-01-08 18:52:45 +00:00
|
|
|
from mpParam import MpParam
|
|
|
|
|
|
|
|
class MpParamXp(MpParam):
|
|
|
|
|
|
|
|
RMEM = "rmem"
|
2015-01-21 10:34:29 +00:00
|
|
|
SCHED = "sched"
|
2015-01-14 14:19:39 +00:00
|
|
|
KERNELPM = "kpm"
|
2015-02-23 10:32:22 +00:00
|
|
|
KERNELPMC = "kpmc" #kernel path manager client / server
|
|
|
|
KERNELPMS = "kpms"
|
2015-01-08 18:52:45 +00:00
|
|
|
CLIENTPCAP = "clientPcap"
|
|
|
|
SERVERPCAP = "serverPcap"
|
|
|
|
XPTYPE = "xpType"
|
|
|
|
PINGCOUNT = "pingCount"
|
2015-01-12 15:34:41 +00:00
|
|
|
DDIBS = "ddIBS"
|
|
|
|
DDOBS = "ddIBS"
|
|
|
|
DDCOUNT = "ddCount"
|
|
|
|
PVRATELIMIT= "pvRateLimit"
|
|
|
|
PVG = "pvG" #patched version of pv
|
|
|
|
PVZ = "pvZ"
|
|
|
|
NCSERVERPORT = "ncServerPort"
|
|
|
|
NCCLIENTPORT = "ncClientPort"
|
2015-02-10 10:03:21 +00:00
|
|
|
CHANGEPV = "changePv"
|
|
|
|
CHANGEPVAT = "changePvAt"
|
2015-01-08 18:52:45 +00:00
|
|
|
|
2015-01-14 14:19:39 +00:00
|
|
|
# global sysctl
|
|
|
|
sysctlKey = {}
|
|
|
|
sysctlKey[RMEM] = "net.ipv4.tcp_rmem"
|
|
|
|
sysctlKey[KERNELPM] = "net.mptcp.mptcp_path_manager"
|
2015-01-21 10:34:29 +00:00
|
|
|
sysctlKey[SCHED] = "net.mptcp.mptcp_scheduler"
|
2015-01-14 14:19:39 +00:00
|
|
|
|
2015-02-23 10:32:22 +00:00
|
|
|
sysctlKeyClient = {}
|
|
|
|
sysctlKeyClient[KERNELPMC] = "net.mptcp.mptcp_path_manager"
|
|
|
|
sysctlKeyServer = {}
|
|
|
|
sysctlKeyServer[KERNELPMS] = "net.mptcp.mptcp_path_manager"
|
2015-01-14 14:19:39 +00:00
|
|
|
|
2015-01-08 18:52:45 +00:00
|
|
|
defaultValue = {}
|
|
|
|
|
2015-01-14 14:19:39 +00:00
|
|
|
defaultValue[RMEM] = "10240 87380 16777216"
|
|
|
|
defaultValue[KERNELPM] = "fullmesh"
|
2015-02-23 10:32:22 +00:00
|
|
|
defaultValue[KERNELPMC] = "fullmesh"
|
|
|
|
defaultValue[KERNELPMS] = "fullmesh"
|
2015-01-21 10:34:29 +00:00
|
|
|
defaultValue[SCHED] = "default"
|
2015-01-14 14:19:39 +00:00
|
|
|
|
2015-01-08 18:52:45 +00:00
|
|
|
defaultValue[CLIENTPCAP] = "no"
|
|
|
|
defaultValue[SERVERPCAP] = "no"
|
|
|
|
defaultValue[XPTYPE] = "ping"
|
|
|
|
defaultValue[PINGCOUNT] = "5"
|
2015-01-12 15:34:41 +00:00
|
|
|
defaultValue[DDIBS] = "1k"
|
|
|
|
defaultValue[DDOBS] = "1k"
|
|
|
|
defaultValue[DDCOUNT] = "5000" #5k * 1k = 5m
|
|
|
|
defaultValue[PVRATELIMIT] = "400k"
|
|
|
|
defaultValue[PVZ] = "10000"
|
|
|
|
defaultValue[PVG] = "10000"
|
|
|
|
defaultValue[NCSERVERPORT] = "33666"
|
|
|
|
defaultValue[NCCLIENTPORT] = "33555"
|
2015-02-10 10:03:21 +00:00
|
|
|
defaultValue[CHANGEPV] = "no"
|
2015-01-08 18:52:45 +00:00
|
|
|
|
|
|
|
def __init__(self, paramFile):
|
|
|
|
MpParam.__init__(self, paramFile)
|
|
|
|
|
|
|
|
def getParam(self, key):
|
|
|
|
val = MpParam.getParam(self, key)
|
|
|
|
if val is None:
|
|
|
|
if key in MpParamXp.defaultValue:
|
|
|
|
return MpParamXp.defaultValue[key]
|
|
|
|
else:
|
|
|
|
raise Exception("Param not found " + key)
|
|
|
|
else:
|
|
|
|
return val
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
s = MpParam.__str__(self)
|
|
|
|
return s
|