Commit Graph

1694 Commits

Author SHA1 Message Date
Jannis Seemann
c2e784aaf2 wire: optimize parsing logic for STREAM, DATAGRAM and ACK frames (#5227)
ParseOtherFrames-16       148ns ± 4%     150ns ± 3%     ~     (p=0.223 n=8+8)
ParseAckFrame-16          302ns ± 2%     298ns ± 3%     ~     (p=0.246 n=8+8)
ParseStreamFrame-16       262ns ± 3%     213ns ± 2%  -18.61%  (p=0.000 n=8+8)
ParseDatagramFrame-16     561ns ± 5%     547ns ± 4%     ~     (p=0.105 n=8+8)
2025-07-20 13:14:38 +02:00
Jannis Seemann
893a5941fb wire: improve frame parsing benchmarks (#5263)
* Add master-style frame handling benchmarks using type switches

* Fixing styling issue.

* put STREAM frame back

* remove BenchmarkParseStreamAndACK

* use random data for STREAM and DATAGRAM

* improve comment

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2025-07-18 18:33:04 +02:00
Marten Seemann
92aa7b41d5 handshake: store key update interval in an atomic (#5234)
* handshake: store key update interval in an atomic

We recently changed the way the key update interval is set in tests to
use an environment variable. This resolved a race condition that existed
in the earlier logic, however, parsing of the environment variable now
shows up in benchmark tests.

Using an atomic variable should have a negligible performance impact.

* use an atomic swap
2025-06-21 12:14:07 +02:00
Marten Seemann
d33d293fd2 ci: enable the usetesting linter (#5222)
This linter is useful to detect the creation of temporary directories
and the setting of environment variables in tests.
2025-06-11 09:39:07 +02:00
Marten Seemann
aa22706d78 ci: enable the nolintlint linter (#5221)
This linter helps us find unneeded nolint statements.
2025-06-11 06:52:21 +02:00
Marten Seemann
4f23ac2752 remove connection flow controller mock (#5213)
No functional change expected.
2025-06-09 09:26:23 +02:00
Marten Seemann
576aa1747f simplify stream ID handling in the incoming streams map (#5207)
* simplify stream ID handling in the incoming streams map

No functional change expected.

* protocol: move stream ID constant definition
2025-06-08 12:25:36 +02:00
Marten Seemann
f41858edc9 mocks: simplify mockgen command to generate MockCryptoSetup (#5197)
No functional change expected.
2025-06-07 06:49:49 +02:00
Marten Seemann
3eb8a134cb congestion: migrate tests away from Ginkgo (#5193) 2025-06-01 09:52:47 +02:00
Marten Seemann
488ba91262 ackhandler: migrate the ECN tests away from Ginkgo (#5084) 2025-06-01 06:40:58 +02:00
Marten Seemann
4dd059522f mockquic: remove package (#5171) 2025-05-30 08:10:16 +02:00
Marten Seemann
5d7ee61f5f wire: add support for the reset_stream_at transport parameter (#5158) 2025-05-28 06:30:02 +02:00
Marten Seemann
cb5c3f2aad implement parsing and writing of RESET_STREAM_AT frames (#5155)
* implement parsing and writing of RESET_STREAM_AT frames

* wire: add support for parsing RESET_STREAM_AT frames
2025-05-28 05:49:54 +02:00
Ameame
8ef0a71581 store the RTT in the token, not in the session ticket (#5065)
* remove RTT from session ticket

* save RTT in token

* use mus as rtt unit in token

* move RTT from session state to token on client side

* Rename the rtt variables

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Update internal/handshake/token_generator.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Update token_generator.go

* Update connection.go

* Update token_generator.go

* correct slice  access in fuzz.go

* rearrange connection constructor parameters

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2025-05-16 12:25:58 +02:00
Marten Seemann
8474eddd3a use the slices package to simply QUIC version comparisons (#5130)
No functional change expected.
2025-05-09 06:24:45 +02:00
Marten Seemann
cfc6c16f36 fix race condition in tests when setting the key update interval (#5121)
* fix race conditions in tests when setting the key update interval

* remove test for running transports and handshakes
2025-05-06 04:45:27 +02:00
Marten Seemann
9b3ff059fc delete closed connections after 3 PTOs (#5117)
In most cases, this should be earlier than the current
timeout value of 5s.
2025-05-04 12:51:39 +02:00
Marten Seemann
597fee0b34 ackhandler: migrate the packet number generator tests away from Ginkgo (#5081) 2025-04-27 11:27:28 +02:00
Marten Seemann
b3f55bb7b7 use assert.AnError consistently in tests (#5066)
No functional change expected.
2025-04-21 03:52:08 +02:00
Marten Seemann
d35b5ac187 use ed25519 instead of RSA in tests and examples (#5050)
Also adds a golangci-lint depguard rules that forbids
importing crypto/rsa.
2025-04-20 05:55:08 +02:00
Marten Seemann
7548cc069a protocol: fix flaky TestVersionGreasing (#5051) 2025-04-19 10:19:00 +02:00
Marten Seemann
267cca773b switch from math/rand to math/rand/v2 (#5045)
* switch from math/rand to math/rand/v2

* switch away from golang.org/x/exp/rand
2025-04-19 09:01:22 +02:00
Marten Seemann
0894931c64 protocol: use math/rand/v2 to generate greased versions (#5046) 2025-04-14 14:30:04 +02:00
Marten Seemann
ef2b87f5d5 detect stateless resets for zero-length connection IDs (#5027) 2025-04-11 15:23:53 +02:00
Marten Seemann
1d8f3f281a ci: update golangci-lint to v2 (#5007) 2025-03-30 07:16:14 +02:00
Marten Seemann
623e59b2a2 ackhandler: fix qlogging of path probe timer resets and cancellations (#5003) 2025-03-23 16:02:30 +01:00
Marten Seemann
017ed984f3 ackhandler: fix panic in probe packet tracking logic (#4998)
Under certain circumstances (loss and acknowledgment patterns), the
probe packet tracking logic could run into a nil-pointer dereference.
2025-03-21 06:28:19 +01:00
Marten Seemann
9ca74c7049 wire: correctly handle undefined IPv4 / IPv6 preferred address values (#4985)
* wire: correctly handle undefined IPv4 / IPv6 preferred address values

* make use of the netip.AddrPort zero value
2025-03-15 05:27:28 +01:00
Marten Seemann
24acc54ef1 add support for connection migration (#4960) 2025-03-12 06:11:11 +01:00
Marten Seemann
9f704c72cf ackhandler: fix handling of lost path probes on loss timer (#4956) 2025-02-14 15:29:42 +01:00
Marten Seemann
bf28da8346 handshake: use new crypto/tls 0-RTT API (#4953)
* handshake: simplify method signature of cryptoSetup.handleEvent

* use the new crypto/tls 0-RTT API
2025-02-14 03:17:01 +01:00
Marten Seemann
b32f1fa0e4 ackhandler: use Go iterators to iterate over sent packets (#4952) 2025-02-13 13:53:25 +01:00
Marten Seemann
12f2be058b bump go.mod version to Go 1.23, run 1.23 and 1.24 on CI (#4880) 2025-02-13 12:49:54 +01:00
Marten Seemann
108b6603c8 ackhandler: implement timer logic for path probe packets (#4940)
* remove unused bool return value from sentPacketHandler.getPTOTimeAndSpace

* ackhandler: implement timer logic for path probing packets

Path probe packets are treated differently from regular packets: The new
path might have a vastly different RTT than the original path.

Path probe packets are declared lost 1s after they are sent. This value
can be reduced, once implement proper retransmission logic for lost path
probes.

* ackhandler: declare path probes lost on OnLossDetectionTimeout
2025-01-28 06:10:44 +01:00
Marten Seemann
895faf6dc9 ackhandler: add path probe tracking logic to sent packet history (#4934) 2025-01-26 15:14:55 +01:00
Marten Seemann
9765f54dd2 utils: add a method to reset RTTStats for connection migration (#4930) 2025-01-26 09:37:31 +01:00
Marten Seemann
c63c4e6990 congestion: migrate the pacer tests away from Ginkgo (#4929) 2025-01-26 09:14:03 +01:00
Marten Seemann
79003d1618 ackhandler: remove unneeded error return from packet history iterator (#4917)
No functional change expected.
2025-01-24 04:45:38 +01:00
Julien Salleyron
c385cd10f1 handshake: lazily create the AEAD used for Retry (#4916)
* Change init to sync.Once to handle fips-only setup.

* review.

* use the mutex instead of the sync.Once

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2025-01-23 13:36:29 +01:00
Marten Seemann
202dddd51e wire: implement frame classification into probing / non-probing (#4901)
* wire: implement frame classification into probing / non-probing

* wire: consolidate files

* check if frame is ack eliciting and path probing in frames fuzz test
2025-01-21 14:26:04 +08:00
Marten Seemann
33fd4d1d16 ackhandler: fix ack of packet number ranges in sent packet handler tests (#4897)
The packet number generator for the application data packet number
space randomly skips packet numbers. We need to be careful to not
acknowledge a skipped packet when acknowledging a range of packets in
the sent packet handler tests.
2025-01-21 12:52:57 +08:00
Marten Seemann
bf3ccd1fb3 ackhandler: refactor loss detection timer reset logic (#4893) 2025-01-21 11:09:32 +08:00
Marten Seemann
88501cc02a ackhandler: migrate sentPacketHandler tests away from Ginkgo (#4881) 2025-01-20 14:04:37 +08:00
Marten Seemann
2d2538d790 ackhandler: remove unneeded SetHandshakeConfirmed from SentPacketHandler (#4890)
According to section 4.9.2 of RFC 9001, dropping the Handshake packet
number spaces happens when the handshake is confirmed.
2025-01-20 12:59:27 +08:00
Marten Seemann
92dc1970ec ackhandler: avoid calling time.Now() when generating ACK frame (#4886) 2025-01-18 17:16:30 +08:00
Marten Seemann
29f98a296c ackhandler: avoid calling time.Now() when setting loss detection timer (#4885) 2025-01-18 15:40:30 +08:00
Marten Seemann
516220b0c5 ackhandler: migrate sent packet history tests away from Ginkgo (#4869) 2025-01-13 10:27:12 +08:00
Marten Seemann
e448aefdf0 ackhandler: migrate received packet handler tests away from Ginkgo (#4865) 2025-01-12 21:40:55 +08:00
Marten Seemann
3f0f399540 ackhandler: migrate received packet tracker tests away from Ginkgo (#4864) 2025-01-12 21:28:26 +08:00
Marten Seemann
9d1c1d4e7f ackhandler: migrate received packet history tests away from Ginkgo (#4863) 2025-01-12 21:18:53 +08:00