Commit Graph

391 Commits

Author SHA1 Message Date
Marten Seemann
03a99447fd ackhandler: fix qlogging of alarm timer expiration time (#5363) 2025-10-09 10:21:06 +02:00
Marten Seemann
c2131eb595 qlog: split serializiation and event definitions, remove logging abstraction (#5356)
* qlog: implement a Trace and a Writer struct

* qlog: rename Trace to FileSeq

* split qlog trace writer and QUIC qlog events into separate packages

* use the new qlog.Recorder instead of the logging.ConnectionTracer
2025-10-08 05:53:02 +02:00
Marten Seemann
7c1ce0efe2 ackhandler: track lost packets and detect spurious losses (#5355)
* ackhandler: implement a lost packet tracker

* logging: add ConnectionTracer.DetectedSpuriousLoss event

* ackhandler: detect spurious losses

* qlog: add support for logging spurious packet loss

* ackhandler: delete lost packets after detecting spurios loss

* guard against slice index underflow
2025-10-03 09:59:50 +02:00
Marten Seemann
adc13be540 implement a memory-optimized time.Time replacement (#5334)
* implement a memory-optimized time.Time replacement

* monotime: properly handle systems with bad timer resolution (Windows)

* monotime: simplify Since
2025-09-14 08:12:10 +02:00
Marten Seemann
f61188b8ff ackhandler: add a benchmark for sending and acknowledging packets (#5333)
* ackhandler: add a benchmark for sending and acknowledging packets

* report allocs, improve benchmark names
2025-09-14 07:00:13 +02:00
Marten Seemann
357f679072 ackhandler: store the last four skipped packets (#5322)
This allows for more accurate packet number difference calculations,
which is especially important once we attempt to detect spurious loss
detection events.
2025-08-30 08:05:59 +02:00
Marten Seemann
0bef51ec76 ackhandler: account for skipped packets in packet threshold calculation (#5316) 2025-08-29 05:39:41 +02:00
Marten Seemann
9cd98f48bf ackhandler: store skipped packet numbers separately (#5314) 2025-08-29 05:09:46 +02:00
Marten Seemann
5bb2146b47 ackhandler: avoid storing packet number in packet struct (#5312)
* ackhandler: optimize memory layout of packet struct

The packet number can be derived from the position that this packet is
stored at in the packets slice in the sent packet history. There is no
need to store the packet number, saving 8 bytes per packet.

* ackhandler: avoid copying the packet struct
2025-08-29 04:18:45 +02:00
Marten Seemann
c8e7cd66e3 ackhandler: immediately clear ackedPacket slice after processing ACK (#5313)
* ackhandler: immediately clear ackedPacket slice after processing ACK

* ackhandler: add defensive check for empty ackedPackets slice
2025-08-28 16:12:20 +02:00
Marten Seemann
168889f283 ackhandler: use a typed mock for the ECNHandler (#5311)
No functional change expected.
2025-08-28 13:39:42 +02:00
Marten Seemann
0cd4bd940b ackhandler: use an iterator to process received packet ranges (#5309)
* ackhandler: use an interator to track received packet ranges

* use slices.Collect

* naming convention
2025-08-28 10:32:26 +02:00
Marten Seemann
cead8cfbd6 ackhandler: fix resetting of packet.isPathProbePacket (#5310) 2025-08-28 10:18:49 +02:00
Marten Seemann
8c062ae604 use testing.B.Loop in all benchmark tests (#5285)
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -category=bloop -fix -test ./...
was used as a starting point.
2025-08-16 12:44:56 +02:00
Marten Seemann
fea19fc3ec update to Go 1.25, drop Go 1.23, use go tool for gomock (#5283)
* update to Go 1.25, drop support for Go 1.23

* ci: update golangci-lint to v2.4.0

* use new go tool command for gomock / mockgen

* also update Go version used for oss-fuzz
2025-08-16 06:14:01 +02:00
Marten Seemann
fee90a89ef ackhandler: generalize check for missing packets below threshold (#5260)
* ackhandler: check for missing packets below reordering treshold

No functional change expected.

With the Acknowledgement Frequency extension, the reordering threshold
will become configurable. With this change, it will be easy to use the
peer-requested value instead of the predefined constant.

* improve documentation

* call HighestMissingUpTo in randomized test
2025-08-14 16:51:24 +02:00
Marten Seemann
da27fcf33f expose basic connection stats via Conn.ConnectionStats (#5281)
* Add ConnectionStats

* remove for loop

* Add comments

* Update comments

---------

Co-authored-by: Marco Munizaga <git@marcopolo.io>
2025-08-13 16:45:14 +02:00
Marten Seemann
5422e4c68c ackhandler: remove unused time from receivedPacketHandler.ReceivedPacket (#5277)
* ackhandler: remove unused time from receivedPacketHandler.ReceivedPacket

No functional change expected.

* fix typo

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* also fix typo in tests

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-05 06:03:02 +02:00
Marten Seemann
b69abbaf11 wire: implement parsing and writing of the IMMEDIATE_ACK frame (#5265) 2025-07-21 15:56:04 +02:00
Marten Seemann
06e31852cb wire: implement parsing and writing of the ACK_FREQUENCY frame (#5264)
* implement parsing and writing of the ACK_FREQUENCY frame

* prevent overflows of Request Max Ack Delay

* fix fuzzer
2025-07-21 15:35:06 +02:00
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
Marten Seemann
488ba91262 ackhandler: migrate the ECN tests away from Ginkgo (#5084) 2025-06-01 06:40:58 +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
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
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
9f704c72cf ackhandler: fix handling of lost path probes on loss timer (#4956) 2025-02-14 15:29:42 +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
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
79003d1618 ackhandler: remove unneeded error return from packet history iterator (#4917)
No functional change expected.
2025-01-24 04:45:38 +01: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
d87e2bb649 ackhandler: remove error return value of SentPacketHandler.ResetForRetry (#4834) 2025-01-06 15:05:19 +08:00
Marten Seemann
5dbb46dcc1 utils: remove unused now parameter from RTTStats.UpdateRTT (#4780) 2024-12-22 14:50:31 +08:00
Marten Seemann
95998056d5 update GoMock to v0.5.0 (#4776) 2024-12-21 10:56:18 +08:00
Marten Seemann
7a10ed602d utils: remove unused methods and constructor from RTTStats (#4672) 2024-09-12 00:55:57 -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
047cc90f42 ackhandler: reduce allocations for tracking sent packets (#4602) 2024-07-31 16:37:05 -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
Marten Seemann
e90a0d4e03 increase initial packet size to 1280 bytes (for both IPv4 and IPv6) (#4500) 2024-05-08 20:55:19 -07:00