Documentation ¶
Index ¶
Constants ¶
const ClientHelloMinimumSize = 1024
ClientHelloMinimumSize is the minimum size the server expectes an inchoate CHLO to have.
const CryptoMaxParams = 128
CryptoMaxParams is the upper limit for the number of parameters in a crypto message. Value taken from Chrome.
const CryptoParameterMaxLength = 2000
CryptoParameterMaxLength is the upper limit for the length of a parameter in a crypto message.
const DefaultRetransmissionTime = 500 * time.Millisecond
DefaultRetransmissionTime is the RTO time on new connections
const InitialIdleConnectionStateLifetime = 30 * time.Second
InitialIdleConnectionStateLifetime is the initial idle connection state lifetime
const MaxByteCount = math.MaxUint64
MaxByteCount is the maximum value of a ByteCount
const MaxFrameAndPublicHeaderSize = MaxPacketSize - 1 - 12 /*crypto signature*/
MaxFrameAndPublicHeaderSize is the maximum size of a QUIC frame plus PublicHeader
const MaxIdleConnectionStateLifetime = 60 * time.Second
MaxIdleConnectionStateLifetime is the maximum value accepted for the idle connection state lifetime TODO: set a reasonable value here
const MaxSessionUnprocessedPackets = 128
MaxSessionUnprocessedPackets is the max number of packets stored in each session that are not yet processed.
const MaxStreamFrameSorterGaps = 50
MaxStreamFrameSorterGaps is the maximum number of gaps between received StreamFrames prevents DOS attacks against the streamFrameSorter
const MaxStreamsMultiplier = 1.1
MaxStreamsMultiplier is the slack the client is allowed for the maximum number of streams per connection, needed e.g. when packets are out of order or dropped.
const MaxStreamsPerConnection uint32 = 100
MaxStreamsPerConnection is the maximum value accepted for the number of streams per connection
const MaxTrackedSentPackets uint32 = 2000
MaxTrackedSentPackets is maximum number of sent packets saved for either later retransmission or entropy calculation TODO: find a reasonable value here TODO: decrease this value after dropping support for QUIC 33 and earlier
const MaxUndecryptablePackets = 10
MaxUndecryptablePackets limits the number of undecryptable packets that a session queues for later until it sends a public reset.
const MinRetransmissionTime = 200 * time.Millisecond
MinRetransmissionTime is the minimum RTO time
const RetransmissionThreshold uint8 = 3
RetransmissionThreshold + 1 is the number of times a packet has to be NACKed so that it gets retransmitted
const STKExpiryTimeSec = 24 * 60 * 60
STKExpiryTimeSec is the valid time of a source address token in seconds
const SmallPacketPayloadSizeThreshold = MaxPacketSize / 2
SmallPacketPayloadSizeThreshold defines a threshold for small packets if the packet payload size (i.e. the packet without public header and private header) is below SmallPacketSizeThreshold, sending will be delayed by SmallPacketSendDelay
const SmallPacketSendDelay = 50000 * time.Microsecond
SmallPacketSendDelay is the time delay applied to small packets
const WindowUpdateNumRepetitions uint8 = 2
WindowUpdateNumRepetitions is the number of times the same WindowUpdate frame will be sent to the client
Variables ¶
var SupportedVersions = []VersionNumber{ Version30, Version31, Version32, Version33, }
SupportedVersions lists the versions that the server supports
var SupportedVersionsAsString string
SupportedVersionsAsString is needed for the Alt-Scv HTTP header
var SupportedVersionsAsTags []byte
SupportedVersionsAsTags is needed for the SHLO crypto message
Functions ¶
func IsSupportedVersion ¶
func IsSupportedVersion(v VersionNumber) bool
IsSupportedVersion returns true if the server supports this version
func VersionNumberToTag ¶
func VersionNumberToTag(vn VersionNumber) uint32
VersionNumberToTag maps version numbers ('32') to tags ('Q032')
Types ¶
type ByteCount ¶
type ByteCount uint64
A ByteCount in QUIC
const DefaultTCPMSS ByteCount = 1460
DefaultTCPMSS is the default maximum packet size used in the Linux TCP implementation. Used in QUIC for congestion window computations in bytes.
const InitialConnectionFlowControlWindow ByteCount = (1 << 14) // 16 kB
InitialConnectionFlowControlWindow is the initial connection-level flow control window for sending
const InitialStreamFlowControlWindow ByteCount = (1 << 14) // 16 kB
InitialStreamFlowControlWindow is the initial stream-level flow control window for sending
const MaxPacketSize ByteCount = 1350
MaxPacketSize is the maximum packet size, including the public header This is the value used by Chromium for a QUIC packet sent using IPv6 (for IPv4 it would be 1370)
const ReceiveConnectionFlowControlWindow ByteCount = (1 << 20) * 1.5 // 1.5 MB
ReceiveConnectionFlowControlWindow is the stream-level flow control window for receiving data This is the value that Google servers are using
const ReceiveStreamFlowControlWindow ByteCount = (1 << 20) // 1 MB
ReceiveStreamFlowControlWindow is the stream-level flow control window for receiving data This is the value that Google servers are using
type PacketNumber ¶
type PacketNumber uint64
A PacketNumber in QUIC
const DefaultMaxCongestionWindow PacketNumber = 107
DefaultMaxCongestionWindow is the default for the max congestion window Taken from Chrome
const InitialCongestionWindow PacketNumber = 32
InitialCongestionWindow is the initial congestion window in QUIC packets
const MaxCongestionWindow PacketNumber = 200
MaxCongestionWindow is the maximum size of the CWND, in packets. TODO: Unused?
func InferPacketNumber ¶
func InferPacketNumber(packetNumberLength PacketNumberLen, lastPacketNumber PacketNumber, wirePacketNumber PacketNumber) PacketNumber
InferPacketNumber calculates the packet number based on the received packet number, its length and the last seen packet number
type PacketNumberLen ¶
type PacketNumberLen uint8
PacketNumberLen is the length of the packet number in bytes
const ( // PacketNumberLenInvalid is the default value and not a valid length for a packet number PacketNumberLenInvalid PacketNumberLen = 0 // PacketNumberLen1 is a packet number length of 1 byte PacketNumberLen1 PacketNumberLen = 1 // PacketNumberLen2 is a packet number length of 2 bytes PacketNumberLen2 PacketNumberLen = 2 // PacketNumberLen4 is a packet number length of 4 bytes PacketNumberLen4 PacketNumberLen = 4 // PacketNumberLen6 is a packet number length of 6 bytes PacketNumberLen6 PacketNumberLen = 6 )
func GetPacketNumberLength ¶
func GetPacketNumberLength(packetNumber PacketNumber) PacketNumberLen
GetPacketNumberLength gets the minimum length needed to fully represent the packet number
func GetPacketNumberLengthForPublicHeader ¶
func GetPacketNumberLengthForPublicHeader(packetNumber PacketNumber, highestAckedPacketNumber PacketNumber) PacketNumberLen
GetPacketNumberLengthForPublicHeader gets the length of the packet number for the public header
type VersionNumber ¶
type VersionNumber int
VersionNumber is a version number as int
const ( Version30 VersionNumber = 30 + iota Version31 Version32 Version33 )
The version numbers, making grepping easier
func VersionTagToNumber ¶
func VersionTagToNumber(v uint32) VersionNumber
VersionTagToNumber is built from VersionNumberToTag in init()