# Functions
ChooseSupportedVersion finds the best version in the overlap of ours and theirs ours is a slice of versions that we support, sorted by our preference (descending) theirs is a slice of versions offered by the peer.
GenerateConnectionID generates a connection ID using cryptographic random.
GenerateConnectionIDForInitial generates a connection ID for the Initial packet.
GetGreasedVersions adds one reserved version number to a slice of version numbers, at a random position.
GetPacketNumberLength gets the minimum length needed to fully represent the packet number.
GetPacketNumberLengthForHeader gets the length of the packet number for the public header it never chooses a PacketNumberLen of 1 byte, since this is too short under certain circumstances.
InferPacketNumber calculates the packet number based on the received packet number, its length and the last seen packet number.
IsSupportedVersion returns true if the server supports this version.
IsValidVersion says if the version is known to quic-go.
MaxBidiStreamID is the highest stream ID that the peer is allowed to open, when it is allowed to open numStreams bidirectional streams.
MaxUniStreamID is the highest stream ID that the peer is allowed to open, when it is allowed to open numStreams unidirectional streams.
ReadConnectionID reads a connection ID of length len from the given io.Reader.
StripGreasedVersions strips all greased versions from a slice of versions.
# Constants
ClosedSessionDeleteTimeout the server ignores packets arriving on a connection that is already closed after this time all information about the old connection will be deleted.
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.
ConnectionIDLenGQUIC is the length of the source Connection ID used on gQUIC QUIC packets.
CookieExpiryTime is the valid time of a cookie.
CryptoMaxParams is the upper limit for the number of parameters in a crypto message.
CryptoParameterMaxLength is the upper limit for the length of a parameter in a crypto message.
DefaultConnectionIDLength is the connection ID length that is used for multiplexed connections if no other value is configured.
DefaultHandshakeTimeout is the default timeout for a connection until the crypto handshake succeeds.
DefaultIdleTimeout is the default idle timeout.
DefaultMaxCongestionWindow is the default for the max congestion window.
DefaultMaxIncomingStreams is the maximum number of streams that a peer may open.
DefaultMaxIncomingUniStreams is the maximum number of unidirectional streams that a peer may open.
15 MB.
1.5 MB.
6 MB.
1 MB.
DefaultTCPMSS is the default maximum packet size used in the Linux TCP implementation.
EncryptionForwardSecure is forward secure.
EncryptionSecure is encrypted, but not forward secure.
EncryptionUnencrypted is not encrypted.
EncryptionUnspecified is a not specified encryption level.
EphermalKeyLifetime is the lifetime of the ephermal key during the handshake, see handshake.getEphermalKEX.
InitialCongestionWindow is the initial congestion window in QUIC packets.
MaxAckFrameSize is the maximum size for an (IETF QUIC) ACK frame that we write Due to the varint encoding, ACK frames can grow (almost) indefinitely large.
MaxByteCount is the maximum value of a ByteCount.
MaxClientHellos is the maximum number of times we'll send a client hello The value 3 accounts for: * one failure due to an incorrect or missing source-address token * one failure due the server's certificate chain being unavailable and the server being unwilling to send it without a valid source-address token.
MaxNonRetransmittableAcks is the maximum number of packets containing an ACK, but no retransmittable frames, that we send in a row.
MaxOutstandingSentPackets is maximum number of packets saved for retransmission.
MaxPacketSizeIPv4 is the maximum packet size that we use for sending IPv4 packets.
MaxPacketSizeIPv6 is the maximum packet size that we use for sending IPv6 packets.
MaxReceivePacketSize maximum packet size of any QUIC packet, based on ethernet's max size, minus the IP and UDP headers.
MaxRetries is the maximum number of Retries a client will do before failing the connection.
MaxSessionUnprocessedPackets is the max number of packets stored in each session that are not yet processed.
MaxStreamFrameSorterGaps is the maximum number of gaps between received StreamFrames prevents DoS attacks against the streamFrameSorter.
MaxStreamsMinimumIncrement is the slack the client is allowed for the maximum number of streams per connection, needed e.g.
MaxStreamsMultiplier is the slack the client is allowed for the maximum number of streams per connection, needed e.g.
MaxTrackedReceivedAckRanges is the maximum number of ACK ranges tracked.
MaxTrackedSentPackets is maximum number of sent packets saved for retransmission.
MaxTrackedSkippedPackets is the maximum number of skipped packet numbers the SentPacketHandler keep track of for Optimistic ACK attack mitigation.
MaxUndecryptablePackets limits the number of undecryptable packets that a session queues for later until it sends a public reset.
MinClientHelloSize is the minimum size the server expects an inchoate CHLO to have (in gQUIC).
MinConnectionIDLenInitial is the minimum length of the destination connection ID on an Initial packet.
MinInitialPacketSize is the minimum size an Initial packet (in IETF QUIC) is required to have.
MinPacingDelay is the minimum duration that is used for packet pacing If the packet packing frequency is higher, multiple packets might be sent at once.
MinRemoteIdleTimeout is the minimum value that we accept for the remote idle timeout.
MinStreamFrameSize is the minimum size that has to be left in a packet, so that we add another STREAM frame.
NonForwardSecurePacketSizeReduction is the number of bytes a non forward-secure packet has to be smaller than a forward-secure packet This makes sure that those packets can always be retransmitted without splitting the contained StreamFrames.
NumCachedCertificates is the number of cached compressed certificate chains, each taking ~1K space.
PacketNumberLen1 is a packet number length of 1 byte.
PacketNumberLen2 is a packet number length of 2 bytes.
PacketNumberLen4 is a packet number length of 4 bytes.
PacketNumberLen6 is a packet number length of 6 bytes.
PacketNumberLenInvalid is the default value and not a valid length for a packet number.
PacketType0RTT is the packet type of a 0-RTT packet.
PacketTypeHandshake is the packet type of a Handshake packet.
PacketTypeInitial is the packet type of an Initial packet.
PacketTypeRetry is the packet type of a Retry packet.
the perspectives.
the perspectives.
PublicResetTimeout is the time to wait before sending a Public Reset when receiving too many undecryptable packets during the handshake This timeout allows the Go scheduler to switch to the Go rountine that reads the crypto stream and to escalate the crypto.
48 kB.
32 kB.
SkipPacketAveragePeriodLength is the average period length in which one packet number is skipped to prevent an Optimistic ACK attack.
The version numbers, making grepping easier.
The version numbers, making grepping easier.
The version numbers, making grepping easier.
The version numbers, making grepping easier.
The version numbers, making grepping easier.
The version numbers, making grepping easier.
for when the version doesn't matter.
WindowUpdateThreshold is the fraction of the receive window that has to be consumed before an higher offset is advertised to the client.
# Variables
SupportedVersions lists the versions that the server supports must be in sorted descending order.
# Type aliases
An ApplicationErrorCode is an application-defined error code.
A ByteCount in QUIC.
A ConnectionID in QUIC.
EncryptionLevel is the encryption level Default value is Unencrypted.
A PacketNumber in QUIC.
PacketNumberLen is the length of the packet number in bytes.
The PacketType is the Long Header Type (only used for the IETF draft header format).
Perspective determines if we're acting as a server or a client.
A StreamID in QUIC.
VersionNumber is a version number as int.