protocol

package
v0.0.0-...-1e9be1c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ClientHelloMinimumSize = 1024

ClientHelloMinimumSize is the minimum size the server expectes an inchoate CHLO to have.

View Source
const CryptoMaxParams = 128

CryptoMaxParams is the upper limit for the number of parameters in a crypto message. Value taken from Chrome.

View Source
const CryptoParameterMaxLength = 2000

CryptoParameterMaxLength is the upper limit for the length of a parameter in a crypto message.

View Source
const DefaultRetransmissionTime = 500 * time.Millisecond

DefaultRetransmissionTime is the RTO time on new connections

View Source
const InitialIdleConnectionStateLifetime = 30 * time.Second

InitialIdleConnectionStateLifetime is the initial idle connection state lifetime

View Source
const MaxByteCount = math.MaxUint64

MaxByteCount is the maximum value of a ByteCount

View Source
const MaxFrameAndPublicHeaderSize = MaxPacketSize - 1 - 12 /*crypto signature*/

MaxFrameAndPublicHeaderSize is the maximum size of a QUIC frame plus PublicHeader

View Source
const MaxIdleConnectionStateLifetime = 60 * time.Second

MaxIdleConnectionStateLifetime is the maximum value accepted for the idle connection state lifetime TODO: set a reasonable value here

View Source
const MaxSessionUnprocessedPackets = 128

MaxSessionUnprocessedPackets is the max number of packets stored in each session that are not yet processed.

View Source
const MaxStreamFrameSorterGaps = 50

MaxStreamFrameSorterGaps is the maximum number of gaps between received StreamFrames prevents DOS attacks against the streamFrameSorter

View Source
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.

View Source
const MaxStreamsPerConnection uint32 = 100

MaxStreamsPerConnection is the maximum value accepted for the number of streams per connection

View Source
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

View Source
const MaxUndecryptablePackets = 10

MaxUndecryptablePackets limits the number of undecryptable packets that a session queues for later until it sends a public reset.

View Source
const MinRetransmissionTime = 200 * time.Millisecond

MinRetransmissionTime is the minimum RTO time

View Source
const RetransmissionThreshold uint8 = 3

RetransmissionThreshold + 1 is the number of times a packet has to be NACKed so that it gets retransmitted

View Source
const STKExpiryTimeSec = 24 * 60 * 60

STKExpiryTimeSec is the valid time of a source address token in seconds

View Source
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

View Source
const SmallPacketSendDelay = 50000 * time.Microsecond

SmallPacketSendDelay is the time delay applied to small packets

View Source
const WindowUpdateNumRepetitions uint8 = 2

WindowUpdateNumRepetitions is the number of times the same WindowUpdate frame will be sent to the client

Variables

View Source
var SupportedVersions = []VersionNumber{
	Version30, Version31, Version32, Version33,
}

SupportedVersions lists the versions that the server supports

View Source
var SupportedVersionsAsString string

SupportedVersionsAsString is needed for the Alt-Scv HTTP header

View Source
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 ConnectionID

type ConnectionID uint64

A ConnectionID in QUIC

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 StreamID

type StreamID uint32

A StreamID in QUIC

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()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL