forked from quic-go/quic-go
implement a queue for 0-RTT packets
This commit is contained in:
@@ -12,7 +12,7 @@ const MaxPacketSizeIPv6 = 1232
|
||||
const MaxCongestionWindowPackets = 10000
|
||||
|
||||
// MaxUndecryptablePackets limits the number of undecryptable packets that are queued in the session.
|
||||
const MaxUndecryptablePackets = 10
|
||||
const MaxUndecryptablePackets = 33
|
||||
|
||||
// ConnectionFlowControlMultiplier determines how much larger the connection flow control windows needs to be relative to any stream's flow control window
|
||||
// This is the value that Chromium is using
|
||||
@@ -158,3 +158,12 @@ const MaxAckDelayInclGranularity = MaxAckDelay + TimerGranularity
|
||||
|
||||
// KeyUpdateInterval is the maximum number of packets we send or receive before initiating a key udpate.
|
||||
const KeyUpdateInterval = 100 * 1000
|
||||
|
||||
// Max0RTTQueues is the maximum number of connections that we buffer 0-RTT packets for.
|
||||
const Max0RTTQueues = 32
|
||||
|
||||
// Max0RTTQueueLen is the maximum number of 0-RTT packets that we buffer for each connection.
|
||||
// When a new session is created, all buffered packets are passed to the session immediately.
|
||||
// To avoid blocking, this value has to be smaller than MaxSessionUnprocessedPackets.
|
||||
// To avoid packets being dropped as undecryptable by the session, this value has to be smaller than MaxUndecryptablePackets.
|
||||
const Max0RTTQueueLen = 32
|
||||
|
||||
13
internal/protocol/params_test.go
Normal file
13
internal/protocol/params_test.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package protocol
|
||||
|
||||
import (
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
var _ = Describe("Parameters", func() {
|
||||
It("can queue more packets in the session than in the 0-RTT queue", func() {
|
||||
Expect(MaxSessionUnprocessedPackets).To(BeNumerically(">", Max0RTTQueueLen))
|
||||
Expect(MaxUndecryptablePackets).To(BeNumerically(">", Max0RTTQueueLen))
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user