rename MaxPacketSizeIPv{4,6} to InitialPacketSizeIPv{4,6}

This commit is contained in:
Marten Seemann
2021-01-23 11:44:13 +08:00
parent 2c45f2b11d
commit eea0b1eacd
5 changed files with 12 additions and 12 deletions

View File

@@ -11,7 +11,7 @@ import (
const (
// maxDatagramSize is the default maximum packet size used in the Linux TCP implementation.
// Used in QUIC for congestion window computations in bytes.
maxDatagramSize = protocol.ByteCount(protocol.MaxPacketSizeIPv4)
maxDatagramSize = protocol.ByteCount(protocol.InitialPacketSizeIPv4)
maxBurstBytes = 3 * maxDatagramSize
renoBeta = 0.7 // Reno backoff factor.
maxCongestionWindow = protocol.MaxCongestionWindowPackets * maxDatagramSize

View File

@@ -5,11 +5,11 @@ import "time"
// DesiredReceiveBufferSize is the kernel UDP receive buffer size that we'd like to use.
const DesiredReceiveBufferSize = (1 << 20) * 2 // 2 MB
// MaxPacketSizeIPv4 is the maximum packet size that we use for sending IPv4 packets.
const MaxPacketSizeIPv4 = 1252
// InitialPacketSizeIPv4 is the maximum packet size that we use for sending IPv4 packets.
const InitialPacketSizeIPv4 = 1252
// MaxPacketSizeIPv6 is the maximum packet size that we use for sending IPv6 packets.
const MaxPacketSizeIPv6 = 1232
// InitialPacketSizeIPv6 is the maximum packet size that we use for sending IPv6 packets.
const InitialPacketSizeIPv6 = 1232
// MaxCongestionWindowPackets is the maximum congestion window in packet.
const MaxCongestionWindowPackets = 10000

View File

@@ -34,7 +34,7 @@ var _ = Describe("Header", func() {
DestConnectionID: protocol.ConnectionID{0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe},
SrcConnectionID: protocol.ConnectionID{0xde, 0xca, 0xfb, 0xad, 0x0, 0x0, 0x13, 0x37},
Version: 0x1020304,
Length: protocol.MaxPacketSizeIPv4,
Length: protocol.InitialPacketSizeIPv4,
},
PacketNumber: 0xdecaf,
PacketNumberLen: protocol.PacketNumberLen3,
@@ -47,8 +47,8 @@ var _ = Describe("Header", func() {
0x8, // src connection ID length
0xde, 0xca, 0xfb, 0xad, 0x0, 0x0, 0x13, 0x37, // source connection ID
}
expected = append(expected, encodeVarInt(protocol.MaxPacketSizeIPv4)...) // length
expected = append(expected, []byte{0xd, 0xec, 0xaf}...) // packet number
expected = append(expected, encodeVarInt(protocol.InitialPacketSizeIPv4)...) // length
expected = append(expected, []byte{0xd, 0xec, 0xaf}...) // packet number
Expect(buf.Bytes()).To(Equal(expected))
})