Commit Graph

938 Commits

Author SHA1 Message Date
Ari Mattila
e098ccd2b3 fix calculation of the time for the next keep alive 2021-03-26 16:28:13 +07:00
Marten Seemann
7ea53e6c2c rename the Config values for Max{Stream, Connection}ReceiveWindow 2021-03-16 23:15:18 +08:00
Marten Seemann
354bbb0e2e rename the Config values for Initial{Stream, Connection}ReceiveWindow 2021-03-16 23:15:18 +08:00
Marten Seemann
f51eff48e9 Merge pull request #3093 from lucas-clemente/improve-packet-info
cache the serialized OOB in the conn, not in the packet info
2021-03-16 22:18:25 +08:00
Marten Seemann
5073e300a6 Merge pull request #3092 from lucas-clemente/version-negotiation-failure-logging
make it possible to detect version negotiation failures in logging, fix qlogging of those
2021-03-16 22:17:34 +08:00
Marten Seemann
59eb3ed2fb Merge pull request #3083 from lucas-clemente/configure-initial-flow-control-window
make the initial stream / connection flow control windows configurable
2021-03-16 22:17:08 +08:00
Marten Seemann
1d2756f9f7 Merge pull request #3085 from lucas-clemente/client-hold-tp-until-handshake-completion
only apply server's transport parameters after handshake completion
2021-03-16 22:16:46 +08:00
Marten Seemann
6102a9b308 Merge pull request #3088 from lucas-clemente/update-flow-control-for-0rtt-streams
update the flow control windows of streams opened in 0-RTT
2021-03-16 22:15:53 +08:00
Marten Seemann
162cb16b31 cache the serialized OOB in the conn, not in the packet info
We're allocating a lot of packetInfo structs during the lifetime of a
connection. It's better to keep that struct as small as possible.
2021-03-16 14:04:15 +08:00
Olivier Poitrey
eb6bdfdfc1 Use the correct source IP when binding multiple IPs
When the server is listening on multiple interfaces or interfaces with
multiple IPs, the outgoing datagrams are sometime delivered with the
wrong source IP address.

In order to fix that, each quic connection needs to extract the
destination IP (and optionally interface id) of the received datagrams,
and set it as source IP (and interface) on the sent datagrams.

On most platforms, this can be done using ancillary data with recvmsg()
and sendmsg(). Some of the machinery for this is already there for ECN,
this change extends it to read the destination IP info and write it to
the outgoing packets.

Fix #1736
2021-03-16 00:50:05 +01:00
Marten Seemann
5208845191 introduce a logging.CloseReason for version negotiation errors 2021-03-15 13:36:45 +08:00
Marten Seemann
c27f5a55b3 rename sendStream.handleMaxStreamDataFrame to updateSendWindow 2021-03-12 13:36:23 +08:00
Marten Seemann
d970a1027d only apply server's transport parameters after handshake completion
On the client side, 0-RTT packets have to be sent using the old
transport parameters. We're only allowed to use the updated values for
1-RTT packets.
2021-03-11 18:58:22 +08:00
Marten Seemann
a15cfd6871 make the initial connection flow control window configurable 2021-03-10 15:04:38 +08:00
Marten Seemann
d9434f523e make the initial stream flow control window configurable 2021-03-10 14:58:15 +08:00
Marten Seemann
f8313d868f return an Err0RTTRejected when the server rejects a 0-RTT connection 2021-03-09 18:02:12 +08:00
Marten Seemann
8b63039664 add a function to reset the streams map after 0-RTT rejection 2021-03-09 17:59:49 +08:00
Marten Seemann
f58b4560a3 Merge pull request #3072 from lucas-clemente/max-streams-frame-error
remove unused error return value from HandleMaxStreamsFrame
2021-03-09 15:45:32 +08:00
Marten Seemann
8a0b1dd78d remove unused error return value from HandleMaxStreamsFrame 2021-03-07 12:36:50 +08:00
Yingrong Zhao
4e1cca5d76 remove incorrect logging for client side retry packet 2021-03-05 09:49:56 -05:00
Marten Seemann
f513437854 Merge pull request #3062 from lucas-clemente/fix-retry-draft-34
fix retry key and nonce for draft-34
2021-03-04 11:13:34 +08:00
Marten Seemann
bd172b2a5a fix retry key and nonce for draft-34 2021-03-03 23:01:42 +08:00
Marten Seemann
ac87292e87 start path MTU discovery when the handshake completes 2021-03-03 12:00:51 +08:00
Marten Seemann
53270dde9e only read multiple packets at a time after handshake completion
It's more important that acknowledge packets in a timely manner before
handshake completion. On the server side, we should send out the HANDSHAKE_DONE
frame as soon as possible.
2021-03-03 11:33:00 +08:00
Marten Seemann
b98882d748 Merge pull request #3015 from lucas-clemente/prioritize-receiving-packets
prioritize receiving packets over sending out more packets
2021-01-23 19:39:40 +08:00
Marten Seemann
281e8ca7c0 prioritize receiving packets over sending out more packets 2021-01-20 12:47:56 +08:00
Marten Seemann
ccf8f6c0f4 check for errors after handling each previously undecryptable packet 2021-01-20 10:37:04 +08:00
Marten Seemann
2c2b758dee allow sending of ACKs when pacing limited
An endpoint that is only receiving data won't have an accurate estimate
of the congestion window, and therefore derive a very low pacing
frequency.
In this situation it still needs to be able to send frequent ACKs to the
peer in order to allow full utilization of the bandwidth. We therefore
need to allow ACKs even when pacing-limited.
2021-01-19 11:49:31 +08:00
Marten Seemann
b81a6f875b don't generate new packets when the send queue is full 2021-01-17 16:18:17 +08:00
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