Commit Graph

1437 Commits

Author SHA1 Message Date
Marten Seemann
7fbcbf7ac6 update QUIC v2 support to draft-ietf-quic-v2-08 (#3631) 2023-01-04 07:07:06 +13:00
Marten Seemann
d2512193da qerr: include role (remote / local) in error string representations (#3629) 2022-12-08 19:58:52 +13:00
cliffc-spirent
b8447041bb limit the exponential PTO backoff to 60s (#3595) 2022-11-15 15:42:35 -08:00
kixelated
9540d0fed2 use go run for mockgen, goimports and ginkgo (#3616) 2022-11-11 02:11:41 -08:00
Toby
5fe9f9bd89 chore: fix multiple typos in comments (#3612)
* chore: fix multiple typos I run into

* Update conn_id_generator_test.go

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

* Update internal/ackhandler/sent_packet_handler_test.go

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

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2022-11-06 10:59:16 -08:00
Marten Seemann
870fbe7ab0 migrate to Ginkgo v2 2022-10-11 16:38:44 +04:00
Marten Seemann
ee013d9d23 use a monotonous timer for the connection (#3570)
There's no point in having the timer fire multiple times for the same
timestamp. By using a monotonuos timer we avoid busy-looping in cases where the
timer fires, but we can't actually send a packet.
2022-10-11 05:36:10 -07:00
Marten Seemann
fe277dc663 log the size of buffered packets (#3571) 2022-10-11 02:27:26 -07:00
Marten Seemann
438942b888 ackhandler: reject duplicate packets in ReceivedPacket (#3568)
Before we process a packet, IsPotentiallyDuplicate is called.
This should filter out all duplicates before the reach ReceivedPacket.
2022-10-11 02:27:10 -07:00
Marten Seemann
d03f9c2a4f reduce max DATAGRAM frame size, so that DATAGRAMs fit in IPv6 packets (#3581) 2022-10-11 02:26:10 -07:00
Marten Seemann
63764c429c use a sync.Pool for ACK frames 2022-09-06 14:41:13 +03:00
Marten Seemann
c3289188d1 append ACK ranges instead of allocating a new slice 2022-09-05 20:15:35 +03:00
Marten Seemann
dfd35cb071 use a single bytes.Reader for frame parsing (#3536) 2022-09-01 01:06:50 -07:00
Marten Seemann
656f3d2d7d remove the wire.ShortHeader in favor of more return values (#3535) 2022-08-30 04:37:36 -07:00
Marten Seemann
0b26365dae Merge pull request #3534 from lucas-clemente/header-parsing
introduce a separate code paths for Short Header packet handling
2022-08-30 14:09:38 +03:00
Marten Seemann
80c3afed34 fix usage of ackhandler.Packet pool for non-ack-eliciting packets (#3538) 2022-08-30 04:09:11 -07:00
Marten Seemann
31995601a9 return an error when parsing a too long connection ID from a header (#3533) 2022-08-30 04:08:41 -07:00
Marten Seemann
7023b52e13 speed up marshaling of transport parameters (#3531)
The speedup comes from multiple sources:
1. We now preallocate a byte slice, instead of appending multiple times.
2. Marshaling into a byte slice is faster than using a bytes.Buffer.
3. quicvarint.Write allocates, while quicvarint.Append doesn't.
2022-08-29 23:05:52 +03:00
Marten Seemann
ed15a94703 split the tracing function for received short and long header packets 2022-08-29 15:32:27 +03:00
Marten Seemann
3a12a898a5 add a wire.ShortHeader, implement short header parsing
The new parsing function is vastly faster than the combination of header
and extended header parsing:

BenchmarkShortHeaderParsing-10          44192314                26.79 ns/op           48 B/op          1 allocs/op
BenchmarkShortHeaderParsingOld-10       12627363                99.99 ns/op          228 B/op          3 allocs/op
2022-08-29 15:06:34 +03:00
Marten Seemann
42cec84221 extend ByteOrder interface to allow converting from a byte slice 2022-08-29 13:11:58 +03:00
Marten Seemann
f41772c43c return an error when parsing a too long connection ID from a header 2022-08-29 13:05:24 +03:00
Marten Seemann
3f1adfd822 Merge pull request #3529 from lucas-clemente/conn-id-array
use a struct containing an array to represent Connection IDs
2022-08-29 12:24:15 +03:00
Marten Seemann
15945e3190 Merge pull request #3525 from lucas-clemente/ackhandler-linked-list-allocs
reduce allocations of ackhandler.Packet
2022-08-29 12:07:12 +03:00
Marten Seemann
a3b91cf683 use a sync.Pool to avoid allocations of ackhandler.Packet 2022-08-29 11:45:28 +03:00
Marten Seemann
4cbb4f8114 remove ConnectionID.Equal function
Connection IDs can now be compared with ==.
2022-08-29 11:30:32 +03:00
Marten Seemann
1aced95d41 use an array instead of a byte slice for Connection IDs 2022-08-29 11:30:31 +03:00
Marten Seemann
9e0f9e62ff parse arbitrary length Connection IDs in Version Negotiation packets 2022-08-29 10:58:33 +03:00
Marten Seemann
53412e9ba3 trace arbitrary length Connection IDs for Version Negotiation packets 2022-08-29 10:58:33 +03:00
Marten Seemann
ecc8320c2c add a tracer function to trace sending of Version Negotiation packets 2022-08-29 10:58:33 +03:00
Marten Seemann
21b9ef03be add a type for arbitrary length Connection IDs, and parsing function
RFC 8999 allows Connection IDs of up to 255 bytes. Current QUIC versions
only use up to 20 bytes.
2022-08-29 10:58:33 +03:00
Marten Seemann
d7097d74f0 implement a function to parse the version number of a Long Header packet 2022-08-29 10:58:33 +03:00
Marten Seemann
ab6d664b43 rename frame.Write to frame.Append 2022-08-28 23:18:24 +03:00
Marten Seemann
3ca1001951 append to a byte slice instead of a bytes.Buffer when serializing frames 2022-08-28 23:18:06 +03:00
Marten Seemann
fd38fe4a9a avoid allocations when adding packets to the sent packet history 2022-08-27 18:22:46 +03:00
João Oliveirinha
66f6fe0b71 add support for providing a custom Connection ID generator via Config (#3452)
* Add support for providing a custom ConnectionID generator via Config

This work makes it possible for servers or clients to control how
ConnectionIDs are generated, which in turn will force peers in the
connection to use those ConnectionIDs as destination connection IDs  when sending packets.

This is useful for scenarios where we want to perform some kind
selection on the QUIC packets at the L4 level.

* add more doc

* refactor populate config to not use provided config

* add an integration test for custom connection ID generators

* fix linter warnings

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2022-08-24 04:06:16 -07:00
Benedikt Spies
7da024da5a Disable anti-amplification limit by address validation token (#3326) 2022-08-20 08:02:17 -07:00
Marten Seemann
f2fa98c0dd implement a more intuitive address validation API 2022-08-12 13:13:29 +03:00
Marten Seemann
bea5de0221 Merge pull request #3483 from lucas-clemente/generic-min-max
use generic Min and Max functions
2022-08-12 12:09:30 +04:00
Marten Seemann
80fd1b57c8 add a function to distinguish between long and short header packets (#3498) 2022-08-11 07:35:01 -07:00
Marten Seemann
498475fa60 update golangci-lint action to v3, golangci-lint to v1.48.0 (#3499)
* run gofmt -s -w

* stop using the deprecated io/ioutil package

* update golangci-lint action to v3, golangci-lint to v1.48.0
2022-08-10 09:50:48 -07:00
Marten Seemann
7ebe1430ef use a generic linked list (#3487) 2022-08-10 09:50:21 -07:00
Marten Seemann
43bde14cf7 implement generic Min and Max functions 2022-08-10 14:59:05 +02:00
Marten Seemann
424325af58 rename utils.Min to utils.MinInt 2022-08-10 14:59:05 +02:00
Marten Seemann
2ea21b7b16 rename utils.Max to utils.MaxInt 2022-08-10 14:59:05 +02:00
Marten Seemann
ea9de26ed5 drop support for Go 1.16 and 1.17 (#3482) 2022-08-10 03:42:14 -07:00
Toby
d5efd340c7 optimize FirstOutstanding in the sent packet history (#3467)
* optimize FirstOutstanding

* fix variable naming

* bug fix

* minor code improvements

* add a test to make sure that `Iterate` iterates in the right order

* add comment
2022-07-24 12:50:41 -07:00
Marten Seemann
f29dd273b4 update for Go 1.19beta1 (#3460) 2022-06-28 01:12:44 -07:00
Marten Seemann
f3744f6535 implement parsing and writing of QUIC v2 packet headers 2022-05-26 12:57:45 +02:00
Marten Seemann
909a3a9093 remove unneeded version constant in wire tests 2022-05-25 16:12:11 +02:00