forked from quic-go/quic-go
use actually used datagram size for congestion controller calculations
This commit is contained in:
@@ -10,12 +10,12 @@ import (
|
|||||||
const (
|
const (
|
||||||
// maxDatagramSize is the default maximum packet size used in the Linux TCP implementation.
|
// maxDatagramSize is the default maximum packet size used in the Linux TCP implementation.
|
||||||
// Used in QUIC for congestion window computations in bytes.
|
// Used in QUIC for congestion window computations in bytes.
|
||||||
maxDatagramSize protocol.ByteCount = 1460
|
maxDatagramSize = protocol.ByteCount(protocol.MaxPacketSizeIPv4)
|
||||||
maxBurstBytes = 3 * maxDatagramSize
|
maxBurstBytes = 3 * maxDatagramSize
|
||||||
renoBeta float32 = 0.7 // Reno backoff factor.
|
renoBeta float32 = 0.7 // Reno backoff factor.
|
||||||
maxCongestionWindow = protocol.MaxCongestionWindowPackets * maxDatagramSize
|
maxCongestionWindow = protocol.MaxCongestionWindowPackets * maxDatagramSize
|
||||||
minCongestionWindow = 2 * maxDatagramSize
|
minCongestionWindow = 2 * maxDatagramSize
|
||||||
initialCongestionWindow = 32 * maxDatagramSize
|
initialCongestionWindow = 32 * maxDatagramSize
|
||||||
)
|
)
|
||||||
|
|
||||||
type cubicSender struct {
|
type cubicSender struct {
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ var _ = Describe("Cubic", func() {
|
|||||||
clock.Advance(100 * time.Millisecond)
|
clock.Advance(100 * time.Millisecond)
|
||||||
currentCwnd = cubic.CongestionWindowAfterAck(maxDatagramSize, currentCwnd, rttMin, clock.Now())
|
currentCwnd = cubic.CongestionWindowAfterAck(maxDatagramSize, currentCwnd, rttMin, clock.Now())
|
||||||
}
|
}
|
||||||
expectedCwnd = 553632
|
expectedCwnd = 553632 * maxDatagramSize / 1460
|
||||||
Expect(currentCwnd).To(Equal(expectedCwnd))
|
Expect(currentCwnd).To(Equal(expectedCwnd))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user