Commit Graph

959 Commits

Author SHA1 Message Date
Marten Seemann
f1c6421845 introduce an interface for the send queue, use a mock in session tests 2021-01-17 16:18:17 +08:00
Marten Seemann
219ced5437 allow receiving of multiple packets before sending a packet
By draining the channel holding received packets, we reduce the number
of spurious ACKs we send. We also make sure that sending and receiving
packets is balanced, as we allow sending of a large number of packets
(if we have cwnd available and the pacing frequency is high enough).
2021-01-17 14:26:12 +08:00
Marten Seemann
4bdccca0cf Merge pull request #2980 from lucas-clemente/fix-pacing-deadline-interpretation
fix interpretation of time.Time{} as a pacing deadline
2021-01-16 14:08:27 +08:00
Marten Seemann
33d058f4ee fix interpretation of time.Time{} as a pacing deadline
The pacer returns the zero value of time.Time when a packet can be sent
immediately. The session uses the zero value to unset the pacing
deadline.
2021-01-16 13:35:21 +08:00
Marten Seemann
26565b023b introduce a separate queue for undecryptable packets
We should prioritize the decryption of previously undecryptable packets,
every time a new encryption level becomes available. This is achieved
by introducing a separate queue instead of just putting the packets back
into the receivedPackets channel.
This also allows us to only count every received packet once for the
amplification limit.
2021-01-07 12:58:17 +08:00
Marten Seemann
53c8e33323 Merge pull request #2944 from lucas-clemente/tp-max-streams-error
move the transport parameter stream limit check to the parser
2020-12-22 16:48:45 +07:00
Marten Seemann
fdc2b91e03 Merge pull request #2946 from lucas-clemente/remove-initial-version
remove unused initialVersion variable in session
2020-12-22 16:48:30 +07:00
Marten Seemann
c7d3aeea3d move the transport parameter stream limit check to the parser 2020-12-18 13:00:33 +07:00
Marten Seemann
19ddefd1d9 remove unneeded check for the peer's transport parameters
We create a new flow controller when opening a new streams. This can only
happen after the session is returned, in which case we should have already
received the transport parameters.
2020-12-18 12:16:07 +07:00
Marten Seemann
ad7d90779a remove unused initialVersion variable in session 2020-12-18 12:00:17 +07:00
Marten Seemann
9693a46d31 Merge pull request #2162 from lucas-clemente/datagram
implement the datagram draft
2020-12-17 11:22:40 +07:00
Marten Seemann
7c2e938684 trace when a packet is dropped because the receivedPackets chan is full 2020-12-15 15:20:13 +07:00
Marten Seemann
4c0f0c47eb Merge pull request #2930 from lucas-clemente/handshake-idle-timeout
introduce a quic.Config.HandshakeIdleTimeout, remove HandshakeTimeout
2020-12-15 08:35:44 +07:00
Marten Seemann
c8626d89e5 assert that no undecryptable packets are queueud after the handshake 2020-12-11 12:17:04 +07:00
Marten Seemann
02139a4743 delete the slice of undecrytable packets when the handshake completes 2020-12-11 12:13:21 +07:00
Marten Seemann
736af5698a don't preallocate a slice for undecryptable packets
Under normal conditions, we don't expect to receive any undecryptable
packets. We expect to receive a few when there's packet loss and / or
reordering during the handshake, but even in that case the number will
most likely be smaller than protocol.MaxUndecryptablePackets.
2020-12-11 12:12:17 +07:00
Marten Seemann
98145368cd implement receiving of DATAGRAM frames 2020-12-09 15:31:23 +07:00
Marten Seemann
791f896f80 implement sending of datagrams 2020-12-09 15:31:23 +07:00
Marten Seemann
fdaac4f32e send the max_datagram_frame_size transport parameter 2020-12-09 15:31:23 +07:00
Marten Seemann
fd41e8fa62 reject DATAGRAM frames if datagram support is not enabled 2020-12-09 15:31:23 +07:00
Marten Seemann
231bc918d4 implement packing of DATAGRAM frames 2020-12-09 15:31:23 +07:00
Marten Seemann
e951646fb6 tell if a peer supports DATAGRAM frames in the ConnectionState 2020-12-09 15:31:23 +07:00
Marten Seemann
356c69944e return a quic.ConnectionState from Session.ConnectionState() 2020-12-09 15:31:23 +07:00
Marten Seemann
021f70aac5 implement the max_datagram_frame_size transport parameter 2020-12-09 15:31:23 +07:00
Marten Seemann
595f6f814a introduce a quic.Config.HandshakeIdleTimeout, remove HandshakeTimeout 2020-12-08 16:12:39 +07:00
Marten Seemann
ca671ac325 remove unnecessary call to time.Now() when sending a packet 2020-12-06 09:25:19 +07:00
Marten Seemann
02b700804f remove support for quic-trace 2020-12-05 23:13:45 +07:00
Marten Seemann
afe287e1e0 Merge pull request #2897 from lucas-clemente/immediately-delete-stateless-reset-tokens
immediately remove reset tokens when retiring a connection ID
2020-12-04 10:14:28 +07:00
Marten Seemann
33e818f5e9 log sent packet before logging its congestion / loss recovery effects 2020-11-29 12:30:01 +07:00
Marten Seemann
05066ae877 immediately remove reset tokens when retiring a connection ID 2020-11-22 10:21:20 +07:00
Marten Seemann
0d5de40d45 only trace dropped 0-RTT packets when a tracer is set 2020-11-11 17:13:56 +07:00
Marten Seemann
3cd8b30ea6 Merge pull request #2856 from lucas-clemente/conn-id-update-handshake-completion
wait until the handshake is complete before updating the connection ID
2020-11-10 20:52:09 +07:00
Marten Seemann
e8a9888f25 Merge pull request #2857 from lucas-clemente/fix-spa-conn-id-handling
only check the SCID for Initial packets
2020-11-10 20:51:28 +07:00
Marten Seemann
0c2f562411 allow an amplification factor of 3.x 2020-11-06 14:16:11 +07:00
Marten Seemann
337e2171ef only check the SCID for Initial packets
There's no risk that Handshake packets could be injected by an attacker.
2020-11-02 16:24:02 +07:00
Marten Seemann
80534c0944 wait until the handshake is complete before updating the connection ID 2020-11-02 16:21:38 +07:00
Marten Seemann
676d43a5e9 remove incorrect log line about retirement of preferred address conn ID 2020-11-02 16:08:12 +07:00
Marten Seemann
c968b18a21 select the H3 ALPN based on the QUIC version in use (for the H3 server) 2020-10-29 13:44:23 +07:00
Marten Seemann
8752576f26 run gofumpt, enable the gofumpt linter 2020-10-26 09:33:35 +07:00
Marten Seemann
e1f56127df only use the conn ID backwards compatibility mode with draft-29 2020-10-22 20:33:17 +07:00
Marten Seemann
145e7b10d0 Merge pull request #2811 from lucas-clemente/fix-first-key-update
allow the first key update immediately after handshake confirmation
2020-10-06 20:23:19 +07:00
Marten Seemann
55a07c34ee add the exhaustive linter 2020-10-05 13:47:57 +07:00
Marten Seemann
b9090d71ae rename cryptoSetup.DropHandshakeKeys() to SetHandshakeConfirmed() 2020-09-30 12:14:16 +07:00
Marten Seemann
b4636469fa refactor confirmation of the handshake 2020-09-30 12:05:33 +07:00
Marten Seemann
e0cfbd86d5 fix logging of received Retry packets 2020-09-25 15:23:40 +07:00
Marten Seemann
9d4b4f6bf0 check that the peer updated its keys when acknowledging a key update 2020-09-15 13:37:48 +07:00
Marten Seemann
ea3d32394d read the ECN bits 2020-09-15 10:51:22 +07:00
Marten Seemann
fa4f0a9e7a keep track of ECN counts on received packets 2020-09-14 17:01:34 +07:00
Marten Seemann
a528c4c4da close session on errors unpacking errors other than decryption errors 2020-09-09 23:59:24 +07:00
Marten Seemann
89417ab5ca simplify the connection, rename it to sendConn 2020-08-09 19:24:04 +07:00