Commit Graph

1705 Commits

Author SHA1 Message Date
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
Marten Seemann
f18d42fd23 ackhandler: migrate ack-elicitng and send mode tests away from Ginkgo (#4862) 2025-01-12 21:09:37 +08:00
Marten Seemann
5a6187c870 reliably queue MAX_DATA frames (#4844) 2025-01-08 09:53:23 +08:00
Marten Seemann
d87e2bb649 ackhandler: remove error return value of SentPacketHandler.ResetForRetry (#4834) 2025-01-06 15:05:19 +08:00
Marten Seemann
a32d31288e remove hardcoded maximum keep-alive period (#4827)
The keep-alive period can be set using Config.KeepAlivePeriod. While
very large values will likely make keep-alives ineffective (depending on
the NATs in the path), there's no good reason to hardcode a maximum
value.
2024-12-31 11:26:40 +08:00
Marten Seemann
46546ce497 qerr: fix errors.Is for TransportError and ApplicationError (#4824) 2024-12-29 16:42:24 +08:00
Marten Seemann
484c0ba7b4 wire: don't allocate an empty data slice for empty STREAM frames (#4794)
Minor optimization, but it simplifies testing in some cases.
2024-12-24 13:16:32 +08:00
Marten Seemann
5dbb46dcc1 utils: remove unused now parameter from RTTStats.UpdateRTT (#4780) 2024-12-22 14:50:31 +08:00
Marten Seemann
a584e58099 flowcontrol: reset the connection send window when 0-RTT is rejected (#4764) 2024-12-22 11:36:14 +08:00
Marten Seemann
95998056d5 update GoMock to v0.5.0 (#4776) 2024-12-21 10:56:18 +08:00
Marten Seemann
363533dc7a remove the Token field from the StatelessResetError (#4740)
There's nothing the application could possibly do with this value.
2024-12-02 13:57:46 +08:00
Marten Seemann
aed4d8df0c ci: disable the unparam linter for tests (#4738) 2024-12-01 12:27:32 +08:00
Marten Seemann
2e4cef10ab flowcontrol: rewrite tests, use require instead of Ginkgo (#4734) 2024-11-30 14:27:57 +08:00
Marten Seemann
36ed693996 flowcontrol: fix timestamp used for receive window auto-tuning (#4735) 2024-11-29 13:59:22 +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
90a824a849 flowcontrol: fix start of the flow-control auto-tuning period (#4730)
The period should start when the first frame is received, not when the data is
first read. This makes a difference when the first STREAM frame is received
out of order.
2024-11-28 15:48:42 +08:00
Marten Seemann
8754d28a6a handshake: migrate tests away from Ginkgo (#4667) 2024-10-11 21:44:30 -07:00
Marten Seemann
3258060b48 utils: migrate tests away from Ginkgo (#4675) 2024-09-13 23:36:08 -07:00
Marten Seemann
672f906a40 wire: migrate tests away from Ginkgo (#4643)
* wire: translate ACK frame tests

* wire: translate CONNECTION_CLOSE frame tests

* wire: translate DATA_BLOCKED frame tests

* wire: translate DATAGRAM frame tests

* wire: translate HANDSHAKE_DONE frame tests

* wire: translate MAX_DATA frame tests

* wire: translate MAX_STREAM_DATA frame tests

* wire: translate MAX_STREAMS frame tests

* wire: translate NEW_CONNECTION_ID frame tests

* wire: translate NEW_TOKEN frame tests

* wire: translate PATH_CHALLENGE frame tests

* wire: translate PATH_RESPONSE frame tests

* wire: translate PING frame test

* wire: translate RESET_STREAM frame tests

* wire: translate RETIRE_CONNECTION_ID frame tests

* wire: translate STOP_SENDING frame tests

* wire: translate STREAM_DATA_BLOCKED frame tests

* wire: translate STREAMS_BLOCKED frame tests

* wire: translate CRYPTO frame tests

* wire: translate STREAM frame tests

* wire: translate version negotiation tests

* wire: translate header tests

* wire: translate pool tests

* wire: translate frame logging tests

* wire: translate short header tests

* wire: translate framer parser tests

* wire: translate transport parameter tests
2024-09-12 19:27:39 -07:00
Marten Seemann
7a10ed602d utils: remove unused methods and constructor from RTTStats (#4672) 2024-09-12 00:55:57 -07:00
Marten Seemann
5247a8ee42 testdata: migrate tests away from Ginkgo (#4670) 2024-09-12 00:42:29 -07:00
Marten Seemann
06cfeb1034 ringbuffer: migrate test away from Ginkgo (#4671) 2024-09-12 00:26:02 -07:00
Marten Seemann
196c4bb16b protocol: move away from Ginkgo (#4650) 2024-09-11 21:39:03 -07:00
Marten Seemann
889dc81333 qtls: migrate tests away from Ginkgo (#4642)
* qtls: migrate tests away from Ginkgo

* qtls: simplify the quic.EncryptionLevel <-> tls.EncryptionLevel test

* qtls: improve naming of tests
2024-09-11 20:40:26 -07:00
Marten Seemann
a21f6c1c41 qerr: move away from Ginkgo (#4649) 2024-09-11 00:50:06 -07:00
Marten Seemann
4be70e0146 protocol: use the packet number decoding / encoding logic from the RFC (#4661) 2024-09-05 09:54:44 -07:00
Marten Seemann
d067fe4156 bump Go version in go.mod, stop testing on Go 1.21 (#4633)
* bump Go version in go.mod, stop testing on Go 1.21

* ci: update golangci-lint to v1.60.1

* ignore Go 1.23 0-RTT events in exhaustive linter
2024-08-17 00:30:03 -07:00
Marten Seemann
f96923b5b2 logging: rename VersionNumber to Version (#4621) 2024-08-03 19:32:11 -07:00
Marten Seemann
f5ceb73171 handshake: generate CRYPTO_ERRORs for internal_error TLS alerts (#4601)
* handshake: generate CRYPTO_ERRORs for internal_error TLS alerts

* remove stray comment
2024-08-03 17:04:03 -07:00
Marten Seemann
e737d4a40e wire: speed up parsing of headers with arbitrary length connection IDs (#4618)
This is significantly faster:
name                                          old time/op    new time/op    delta
ArbitraryHeaderParsing/dest_8/_src_10-16        53.8ns ± 2%    27.4ns ± 2%  -49.01%  (p=0.008 n=5+5)
ArbitraryHeaderParsing/dest_20_/_src_20-16      61.6ns ± 1%    33.3ns ± 3%  -46.00%  (p=0.008 n=5+5)
ArbitraryHeaderParsing/dest_100_/_src_150-16    90.0ns ± 3%    54.8ns ± 5%  -39.09%  (p=0.008 n=5+5)

name                                          old alloc/op   new alloc/op   delta
ArbitraryHeaderParsing/dest_8/_src_10-16         72.0B ± 0%     24.0B ± 0%  -66.67%  (p=0.008 n=5+5)
ArbitraryHeaderParsing/dest_20_/_src_20-16       96.0B ± 0%     48.0B ± 0%  -50.00%  (p=0.008 n=5+5)
ArbitraryHeaderParsing/dest_100_/_src_150-16      320B ± 0%      272B ± 0%  -15.00%  (p=0.008 n=5+5)

name                                          old allocs/op  new allocs/op  delta
ArbitraryHeaderParsing/dest_8/_src_10-16          3.00 ± 0%      2.00 ± 0%  -33.33%  (p=0.008 n=5+5)
ArbitraryHeaderParsing/dest_20_/_src_20-16        3.00 ± 0%      2.00 ± 0%  -33.33%  (p=0.008 n=5+5)
ArbitraryHeaderParsing/dest_100_/_src_150-16      3.00 ± 0%      2.00 ± 0%  -33.33%  (p=0.008 n=5+5)
2024-08-03 16:50:42 -07:00
Marten Seemann
87f2894af5 handshake: remove gomock tls.ClientSessionCache implementation (#4619) 2024-08-03 16:43:30 -07:00
Marten Seemann
b8ea5c7981 simplify generation of STREAM_DATA_BLOCKED frames (#4608)
The stream always gets blocked at the current write offset. There's no
need to return this offset from the flow controller.
2024-08-01 13:08:09 -07:00
Marten Seemann
047cc90f42 ackhandler: reduce allocations for tracking sent packets (#4602) 2024-07-31 16:37:05 -07:00
Marten Seemann
42f04d4e02 refactor frame packing to logic to not access the streams map (#4596)
* avoid accessing the streams map when packing stream data

* avoid accessing the streams map when packing flow control frames

* remove streamGetter interface
2024-07-28 12:32:54 -07:00
Marten Seemann
8451b0afd7 utils: remove scarcely used time helper functions (#4593) 2024-07-23 14:16:12 -07:00
Marten Seemann
e179048526 wire: simplify packet number parsing, remove utils.ByteOrder interface (#4590) 2024-07-21 14:50:21 -07:00
Marten Seemann
29550811b4 remove trivial IPv4 helper function (#4591) 2024-07-21 14:50:03 -07:00
Marten Seemann
5f8d146836 wire: optimize parsing of long header packets (#4589) 2024-07-21 14:22:32 -07:00
Marten Seemann
72092fbc29 move connection logging to a separate file, absorb logutils package (#4586)
No functional change expected.
2024-07-21 11:31:32 -07:00
Marten Seemann
c40d4ccb7f ackhandler: optimize received packet tracking (#4584)
* ackhandler: use slice instead of linked list to track received packets

* ackhandler: add benchmark test for received packet history

* ackhandler: use the slices package for slice manipulations
2024-07-20 08:14:26 -07:00