remove unwanted processing

This commit is contained in:
Quentin De Coninck 2019-12-03 14:24:41 +01:00
parent 3a654e0a67
commit 8471b169d2

View File

@ -17,15 +17,15 @@ class MpLinkCharacteristics:
return (1500.0 * self.bandwidthDelayProductDividedByMTU()) + (float(self.bandwidth) * 1000.0 * float(self.queuingDelay) / 8) return (1500.0 * self.bandwidthDelayProductDividedByMTU()) + (float(self.bandwidth) * 1000.0 * float(self.queuingDelay) / 8)
def extractQueuingDelay(self, queueSize, bandwidth, delay, mtu=1500): def extractQueuingDelay(self, queueSize, bandwidth, delay, mtu=1500):
rtt = 2 * float(delay) # rtt = 2 * float(delay)
bdp_queue_size = int((float(rtt) * float(bandwidth) * 1024 * 1024) / (int(mtu) * 8 * 1000)) # bdp_queue_size = int((float(rtt) * float(bandwidth) * 1024 * 1024) / (int(mtu) * 8 * 1000))
if int(queueSize) <= bdp_queue_size: # if int(queueSize) <= bdp_queue_size:
# Returning 0 seems to bypass everything, then only limited by CPU. # Returning 0 seems to bypass everything, then only limited by CPU.
# This is not what we want... # This is not what we want...
return 1 # return 1
queuingQueueSize = int(queueSize) - bdp_queue_size # queuingQueueSize = int(queueSize) - bdp_queue_size
queuingDelay = (queuingQueueSize * int(mtu) * 8 * 1000) / (float(bandwidth) * 1024 * 1024) queuingDelay = (int(queueSize) * int(mtu) * 8.0 * 1000.0) / (float(bandwidth) * 1024 * 1024)
return max(int(queuingDelay), 1) return max(int(queuingDelay), 1)
def __init__(self, id, delay, queueSize, bandwidth, loss, back_up=False): def __init__(self, id, delay, queueSize, bandwidth, loss, back_up=False):