Marten Seemann
57e46f8a4c
split SNI and ECH extensions in the ClientHello ( #5107 )
...
* create a new type for crypto stream used for Initial data
This currently the exact same implementation as the other
streams, thus no functional change is expected.
* handshake: implement a function to find the SNI and the ECH extension
* move the SNI parsing logic to the quic package
* implement splitting logic
* generalize cutting logic
* introduce QUIC_GO_DISABLE_CLIENTHELLO_SCRAMBLING
* improve testing
2025-05-05 13:04:10 +02:00
Marten Seemann
d7b8447e0e
fix dequeuing logic for tiny CRYPTO frames ( #5104 )
...
For very small sizes, cryptoStream.PopCryptoStream could
have returned CRYPTO frames larger than the requested size.
Instead, it should return a nil frame.
2025-05-01 18:35:11 +02:00
Marten Seemann
02fea84c12
simplify the API of the retransmission queue ( #4793 )
2025-04-19 10:35:16 +02:00
Marten Seemann
e3f1b7c410
switch packet packer to math/rand/v2 ( #5044 )
2025-04-14 12:12:48 +02:00
Marten Seemann
848c355079
simplify path probe PING frame packing logic ( #5028 )
...
* simplify path probe PING frame packing logic
* also pack PTO probe packets for Initial and Handshake
2025-04-14 05:47:58 +02:00
Marten Seemann
6fe46d6253
send PATH_RESPONSEs on the same path ( #4991 )
...
* make it possible to pack path probes with multiple frames
* simplify function signature of pathManager.HandlePacket
* simplify connection short header packet handling logic
No functional change expected.
* make server send PATH_RESPONSEs on the same path
This makes sure that we’re actually testing for return routability.
2025-03-16 04:28:53 +01:00
Marten Seemann
b098a75cf3
add a packet packer method to pack path probe packets ( #4932 )
2025-01-26 14:28:16 +01:00
Marten Seemann
92dc1970ec
ackhandler: avoid calling time.Now() when generating ACK frame ( #4886 )
2025-01-18 17:16:30 +08:00
Marten Seemann
3cb5f3e104
optimize packing of STREAM_DATA_BLOCKED frames ( #4801 )
...
* refactor the framer to pack both control and STREAM frames
* refactor framer STREAM frame packing logic
* pack STREAM_DATA_BLOCKED in the same packet as the STREAM frame
This makes debugging easier (and is slightly more efficient). In the
pathological case where there is not enough space remaning in the packet
to pack the STREAM_DATA_BLOCKED frame, it is queued for the next packet.
* add an integration test
2025-01-07 12:06:00 +08:00
Marten Seemann
e653d54b21
migrate the packet packer tests away from Ginkgo ( #4788 )
2024-12-27 11:53:40 +08:00
Marten Seemann
40a768e77b
flowcontrol: avoid calling time.Now(), pass time as a function parameter ( #4731 )
2024-11-28 17:46:22 +08:00
Marten Seemann
46fc42d0da
only declare send stream completed when RESET_STREAM is acknowledged ( #4613 )
2024-08-06 16:55:36 -07:00
Marten Seemann
931166bb8e
remove unneeded cryptoStream interface ( #4617 )
2024-08-03 17:16:02 -07:00
Marten Seemann
f54a32ec28
don't preallocate the slice for STREAM frames when composing a packet ( #4314 )
...
The slice will be allocated when STREAM frames are appended. By not
preallocating it is made sure that the slice is only created in cases
where STREAM frames are actually sent in this packet.
2024-02-08 20:53:24 -08:00
Marten Seemann
fbaa941ea1
protocol: rename VersionNumber to Version ( #4295 )
2024-01-31 21:57:33 -08:00
Marten Seemann
7f080dd54b
discard DATAGRAM frames that don't fit into packets without an ACK ( #4221 )
...
If the packet doesn't contain an ACK (i.e. the payload is empty),
there's no point retrying to pack it later. It's extremely unlikely that
the available packet size will suddenly increase.
2023-12-31 19:17:25 -08:00
Marten Seemann
ff6d575ee3
don't retransmit PATH_CHALLENGE and PATH_RESPONSE frames ( #4200 )
2023-12-12 20:22:13 -08:00
Marten Seemann
bed8ebbd4c
distinguish coalesced and 1-RTT packets when determining ECN mode
2023-09-11 20:31:50 +07:00
Marten Seemann
a7f807856c
randomize the serialization order of control frames ( #4069 )
...
* randomize the serialization order of control frames
* add comment for packetPacker.appendPacketPayload
2023-09-10 21:49:29 -07:00
Marten Seemann
da55dfaabd
ackhandler: unexport Packet
2023-06-05 21:06:58 +03:00
Marten Seemann
e1bcedc78c
ackhandler: use a frame handler interface for OnAcked / OnLost of all frame types ( #3888 )
2023-06-04 13:04:28 -07:00
Marten Seemann
bde283640b
ackhandler: be explicit about skipping packet numbers ( #3886 )
2023-06-04 12:45:43 -07:00
Marten Seemann
591ab1ab5e
packer: reduce number of calls to time.Now() when packing packets ( #3815 )
2023-06-02 23:58:41 -07:00
Marten Seemann
628ba87727
append to a given buffer when packing a packet
2023-06-03 09:21:54 +03:00
Marten Seemann
b0524c1241
split code paths for packing normal and ACK-only packets
2023-06-02 18:35:02 +03:00
Marten Seemann
bef0f3d31a
pass the maximum packet size from MTU discoverer to packet packer
2023-06-02 18:35:02 +03:00
Marten Seemann
0438eada95
use ackhandler.Frame directly, not as a pointer, remove its sync.Pool ( #3835 )
2023-06-02 04:56:18 -07:00
Marten Seemann
f8d24ef1e9
don't use closures for passing OnLost and OnAcked STREAM frame callbacks ( #3833 )
2023-06-02 04:14:04 -07:00
Marten Seemann
762d5c2c9c
packet packer: don't try packing a 0-RTT packet with only an ACK ( #3849 )
...
0-RTT packets can't contain ACK frames. This was correctly reflected in the
code path for packing a 0-RTT packet, but we would ignore the ACK-only flag
when packing the coalesced packet, leading to a full-size 0-RTT packet being
sent out when we're only allowed to send an ACK-only packet.
2023-05-28 17:35:32 +03:00
Marten Seemann
58cedf7a4f
rename module, adjust import paths to quic-go/quic-go ( #3680 )
2023-01-21 19:53:57 -08:00
Marten Seemann
00624f623d
refactor the framer to remove the version param from the constructor
2023-01-18 21:49:27 +13:00
Marten Seemann
4bb9f29b55
refactor the packet packer to remove the version param from constructor
2023-01-18 21:35:01 +13:00
Marten Seemann
582edae63d
refactor retransmissionQueue to remove version param from constructor
2023-01-18 20:50:17 +13:00
Marten Seemann
2aa71ff76b
use a sync.Pool for ackhandler.Frames ( #3656 )
2023-01-17 23:15:02 -08:00
Marten Seemann
b77d8570df
pass payload around by value in the packet packer ( #3648 )
2023-01-17 22:53:05 -08:00
Marten Seemann
c20b541dbb
avoid allocating a shortHeaderPacket struct in the PackPacket path ( #3647 )
2023-01-18 10:04:35 +13:00
Marten Seemann
c24fbb094c
refactor header writing to append to a byte slice ( #3646 )
...
This avoids having to allocate a bytes.Buffer.
2023-01-17 01:56:06 -08:00
Marten Seemann
86edf7fd4b
remove the LongHeader field from the wire.Header
2023-01-17 21:53:39 +13:00
Marten Seemann
384ad9b2ae
don't allocate a wire.ExtendedHeader for short header packets
2023-01-17 21:53:39 +13:00
Marten Seemann
518fd1c877
separate long and short header packets in the coalescedPacket
2023-01-17 21:53:39 +13:00
Marten Seemann
87f51d33dc
move the packet buffer out of the shortHeaderPacket struct
2023-01-17 21:53:39 +13:00
Marten Seemann
ec9a6e7a99
introduce a shortHeaderPacket type and use it in packet packer
2023-01-17 21:53:39 +13:00
Marten Seemann
3e7bad5efc
use separate append functions for long and short header packets
2023-01-17 21:53:39 +13:00
Marten Seemann
108f152181
split the packet packing function
2023-01-17 21:53:39 +13:00
Marten Seemann
54d8ab39bd
refactor slice handling when encrypting a packet
2023-01-17 21:53:39 +13:00
Marten Seemann
9e5f92b561
return a coalesced packet when packing a probe packet
...
The coalesced packet will only consist of a single packet, but this will
make the refactoring easier.
2023-01-17 21:53:04 +13:00
Marten Seemann
1f6a9ecafd
use a Peek / Pop API for the datagram queue ( #3582 )
2022-10-11 02:25:17 -07:00
Marten Seemann
818768df38
remove the MaybePackAckPacket from the packet packer
2022-09-09 11:39:25 +03:00
Marten Seemann
7bc2ba6b81
simplify packing of long header ACK-only packets
2022-09-09 11:39:25 +03:00
Marten Seemann
2873125c15
move packing of ACK-only short header packets to composeNextPacket
2022-09-09 11:39:25 +03:00