diff --git a/src/mpLinkCharacteristics.py b/src/mpLinkCharacteristics.py index 40b512d..06ec0ed 100644 --- a/src/mpLinkCharacteristics.py +++ b/src/mpLinkCharacteristics.py @@ -17,11 +17,13 @@ class MpLinkCharacteristics: rtt = 2 * float(delay) bdp_queue_size = int((float(rtt) * float(bandwidth) * 1024 * 1024) / (int(mtu) * 8 * 1000)) if int(queueSize) <= bdp_queue_size: - return 0 + # Returning 0 seems to bypass everything, then only limited by CPU. + # This is not what we want... + return 1 queuingQueueSize = int(queueSize) - bdp_queue_size queuingDelay = (queuingQueueSize * int(mtu) * 8 * 1000) / (float(bandwidth) * 1024 * 1024) - return int(queuingDelay) + return max(int(queuingDelay), 1) def __init__(self, id, delay, queueSize, bandwidth, loss, back_up=False): self.id = id