1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-09 10:00:57 +03:00
Commit Graph

184 Commits

Author SHA1 Message Date
Joseph Beshay
c3ea605df1 Store tokens in new token frames as IoBuf and hexlify when including in qlogger
Summary:
As title. This changes the NewTokenFrame (for writing) to hold the toke as an IOBuf instead of a string. This makes it consistent with the read side.

In the same change, the qlogger now hexlifies this buffer when writing the token to the qlog.

Reviewed By: hanidamlaj, mjoras

Differential Revision: D46955172

fbshipit-source-id: 8f5f575ad2f0a4ec3b4c01cb67defa1f4425cd74
2023-06-27 13:12:10 -07:00
Hani Damlaj
c88d675119 fix gcc warnings
Summary: - add folly::unreachable() statements where applicable

Reviewed By: mjoras

Differential Revision: D46911632

fbshipit-source-id: 22b337f4c255e973da19cc15cc928c847091472b
2023-06-26 18:59:24 -07:00
Fei Chen
ad6f14e93e increase connid encoding retry limit from 16 to 32
Summary: also add a counter to monitor the actual number of connid encoding retries

Reviewed By: mjoras

Differential Revision: D46227574

fbshipit-source-id: c6c063ee45c7e8a9bd3af994f67755336720a740
2023-06-08 09:34:05 -07:00
Matt Joras
b257b1fe24 Unify and move receive timestamp config
Summary: We shouldn't have config in the codec types. Instead solve the plumbing problem more explicitly, and only define the config in one place.

Reviewed By: jbeshay

Differential Revision: D45881730

fbshipit-source-id: fab6c967a38172f16e57a8978b10460fd196902e
2023-05-17 11:59:53 -07:00
Matt Joras
e41ea339f8 Don't close via exception on receiving a close.
Summary: This is a dumb shortcut. Just check whether it's happened after reading data and call close that way.

Reviewed By: kvtsoy

Differential Revision: D45205285

fbshipit-source-id: 57edafc50f5e5e9cdaf9ac7e46781b762acd30d8
2023-04-24 13:59:02 -07:00
Matt Joras
5fb246b019 Implement duplicate packet stat.
Summary:
Somehow we never implemented this stat despite having it for ages.

It's relatively easy to do, we just need to check whether an entry was inserted to the IntervalSet we are already using for tracking what to ACK.

Note that this has the limitation that when the ACK interval set is cleared out (on ACK of ACK), we will no longer be able to detect duplicates. This is something we can tune later.

Reviewed By: kvtsoy

Differential Revision: D45131856

fbshipit-source-id: aad4e07e1a9cd5b2dc5dec60424f7cee15906c7e
2023-04-20 11:48:45 -07:00
Joseph Beshay
b6c657fd23 Allow the server to indicate that it supports minAckDelay to the client
Summary: When the server transport settings has a minAckDelay set, send the minAckDelay parameter to the client to allow the client to send ACK_FREQUENCY frames.

Reviewed By: mjoras

Differential Revision: D44765256

fbshipit-source-id: 05c3c2da8e8a93dddb12260e13f218d560a410d6
2023-04-07 12:10:50 -07:00
Luca Niccolini
b1e0def2ea restore max datagram size transport param
Reviewed By: jalopezsilva, hanidamlaj

Differential Revision: D44230239

fbshipit-source-id: 3137f8639d263cd6d0944923e2cdc7976e1137fb
2023-03-20 16:20:22 -07:00
Hani Damlaj
104b9848bc fix connection migration deadlock
Summary: Currently, we can enter a deadlock situation where a client rx's a PathChallenge frame, but the packet containing its respective PathResposne frame is lost/delayed. Clients should re-tx the PathResponse frame upon PTO/loss.

Reviewed By: jbeshay

Differential Revision: D43718357

fbshipit-source-id: 26b4bc64dbf48417558eda02744f321f1cb73148
2023-03-17 20:36:56 -07:00
Hani Damlaj
6cd4f47735 elide malloc calls
Summary: - optimizing `setSupportedExtensionTransportParameters()` to elide invocations to malloc()

Reviewed By: mjoras

Differential Revision: D43844018

fbshipit-source-id: 38da5c62786f795a3a79e7592d06d4da1d7487ba
2023-03-15 15:58:02 -07:00
Ilango Purushothaman
e1fd9c7880 Create OutstandingPacket wrapper
Summary:
To get reliable packet destruction events, created a `OutstandingPacketWrapper` wrapper that wraps the current `OutstandingPacket` class, so callback functions can be added to the wrapper instead of the underlying object itself.

#### Why do we need this wrapper?

`std::deque::erase` does not guarantee that appropriate object destructors will be called (only that the number of destructions = number of objects erased). This is a real problem as packet destruction events are then no longer reliable (OutstandingPacket object is wrong!). The wrapper class handles this condition by detecting it in the move assignment constructor (called during erase) and calls the appropriate packet destruction callback before packets are moved. If we did the same fix in the old OutstandingPacket, we have to make sure the callback is called before all the fields of OutstandingPacket are moved - this is not scaleable. Hence a wrapper with the underlying object and a destruction callback function.
I also disabled copy construction for OutstandingPacket (otherwise we will get duplicate OnPacketDestroyed callbacks and cannot track packets reliably). Removing packet copies also improves performance. Some code changes (in tests mostly) are mostly in service of this particular change.

Reviewed By: bschlinker

Differential Revision: D43896148

fbshipit-source-id: c295d3c4dba2368aa66f06df5fc82b473a03fb4d
2023-03-15 03:10:18 -07:00
Hani Damlaj
a0e456bc03 migrate folly::none assignment operator to .reset()
Summary: - .reset() is probably fractionally less costly than the assignment operator?

Reviewed By: sharmafb

Differential Revision: D43579041

fbshipit-source-id: 4838b6c21e94197782cf56866950be1dbf65b106
2023-03-03 05:39:57 -08:00
Konstantin Tsoy
377260f704 Remove d6d code
Summary: we're not using it

Reviewed By: mjoras

Differential Revision: D43482344

fbshipit-source-id: 05ac6792848e32e7c1bcf53a2df172852b5def62
2023-02-23 20:11:24 -08:00
Paul Farcasanu
2556adfc7f cleanup initCwnd experimentation
Summary:
**Context**
Perf wins:
 - https://fb.workplace.com/groups/750841812056515/permalink/1581186975688657/
 - https://fb.workplace.com/groups/750841812056515/permalink/1580000729140615/

now clean it up, since we are shipping via config

Reviewed By: hanidamlaj

Differential Revision: D43237402

fbshipit-source-id: abfa5df982668ee87afe24b3a2b88a3762bed12c
2023-02-16 00:59:16 -08:00
Hani Damlaj
d2e3bc36bf peer address changed
Summary: - add stats counter for when we detect peer address has changed

Reviewed By: jbeshay

Differential Revision: D43012530

fbshipit-source-id: 84f026e8094219b62643449002c97cef6e1a59e5
2023-02-06 12:30:13 -08:00
Joseph Beshay
239f2b5b55 Add transport parameter for knob frame support
Summary: Decide if knob frames are supported based upon a transport parameter instead of relying on the QUIC version. This is a cleaner approach, at the cost of an additional transport parameter.

Reviewed By: mjoras

Differential Revision: D42465442

fbshipit-source-id: bfd1d177bdbe198e5eb47e63113410b5738dcede
2023-01-26 12:22:38 -08:00
Joseph Beshay
b801d9b61d Update naming of maxStreamGroupsAdvertized to match that of similar variables
Summary: This is a cosmetic change to make the naming consistent for all the advertised* variables in the transport settings.

Reviewed By: sharmafb

Differential Revision: D42465443

fbshipit-source-id: d570cbb1a2ca017105ac335b8efc404cb73f3c57
2023-01-26 12:22:38 -08:00
Joseph Beshay
a0a319d58b Consolidate stream groups enabled transport parameter into the TransportParameterId enum
Summary: Use TransportParameterId enum as the source of truth for all the parameter ids. This basically moved the stream groups enabled parameter to the enum.

Reviewed By: kvtsoy

Differential Revision: D42465425

fbshipit-source-id: 94f9968326ac61f92587ef380a7288dd8ab38eef
2023-01-17 21:10:12 -08:00
Matt Joras
1275798146 Make the AckState for Initial/Handshake a unique_ptr
Summary:
We don't need to carry these states after the handshake is confirmed, so make them pointers instead. This will facilitate adding a structure to the AckState for tracking duplicate packets.

(Note: this ignores all push blocking failures!)

Reviewed By: hanidamlaj

Differential Revision: D41626895

fbshipit-source-id: d8ac960b3672b9bb9adaaececa53a1203ec801e0
2022-12-20 11:08:43 -08:00
Paul Farcasanu
da474a06b1 experiment with initialCwnd=20
Summary: Perf testing.

Reviewed By: mjoras

Differential Revision: D41654491

fbshipit-source-id: b356671c085da31ed6f0a7956e7ed1b3edfc0cf1
2022-12-02 13:17:08 -08:00
Sharad Jaiswal (Eng)
96abc8160d Codec changes to support ACK_RECEIVE_TIMESTAMPS
Summary: Create a new ACK_RECEIVE_TIMESTAMPS frame, as outlined in https://www.ietf.org/archive/id/draft-smith-quic-receive-ts-00.html#name-ack_receive_timestamps-fram

Reviewed By: mjoras

Differential Revision: D37799050

fbshipit-source-id: 0157c7fa7c4e489bb310f7c9cd6c0c1877e4967f
2022-11-16 13:02:27 -08:00
Sharad Jaiswal (Eng)
328c78d0e2 Add received packets timestamps to AckState
Summary:
Store timestamps/packet numbers of recently received packets in AckState.

 - The maximum number of packets stored is controlled by kMaxReceivedPktsTimestampsStored.
- The packet number of entries in the deque is guarenteed to increase
   monotonically because an entry is only added for a received packet
  if the packet number is greater than the packet number of the last
  element in the deque (e.g., entries are not added for packets that
  arrive out of order relative to previously received packets).

Reviewed By: bschlinker

Differential Revision: D37799023

fbshipit-source-id: 3b6bf2ba8ea15219a87bbdc2724fe23eebe66b70
2022-11-15 20:14:57 -08:00
Hani Damlaj
729623ca26 MaxNumMigrationsAllowed Transport Setting
Summary: - add configurable `maxNumMigrationsAllowed` to transport settings

Reviewed By: kvtsoy

Differential Revision: D41137450

fbshipit-source-id: a82c97e0b58c13f5df3c4cd075d3f17702eca009
2022-11-10 16:55:07 -08:00
Mitch Campbell
1335937f74 converted PacketDropReason to better_enum and moved into QuicConstants.h
Summary: PacketDropReason was converted to a Better_Enum

Reviewed By: jbeshay

Differential Revision: D40350056

fbshipit-source-id: a6af9ccf0fc7c4358a0481de5cca6f69d1beb438
2022-10-18 11:51:44 -07:00
Duc Nguyen
e3d2b6b3ee Fix -Wmissing-prototypes error
Reviewed By: bschlinker

Differential Revision: D40363029

fbshipit-source-id: 27b41f99b5d279f4e204561b3e93b179345ec784
2022-10-18 09:30:47 -07:00
Hani Damlaj
a3d9e3d650 Enable Skip Ack-Only Initial
Summary: - enable skip ack-only initial feature by default

Reviewed By: mjoras

Differential Revision: D40185260

fbshipit-source-id: 6429c50fe9f6edff9e945f15c0d44cb54aa9e460
2022-10-13 15:48:38 -07:00
Joseph Beshay
bd56a9bd4e Fix logic for handling the ACK_FREQUENCY frame reorder threshold
Summary:
The current logic for handling the ACK_FREQUENCY frame mistakenly uses the frame's reorderThreshold for deciding losses, rather than triggering immediate acknowledgements.

This change fixes the logic by tracking the out-of-order distance and comparing that against the reorderThreshold.

Reviewed By: mjoras

Differential Revision: D39331920

fbshipit-source-id: 125fd99dce9b2725ea0d5b26236f48f72db53c48
2022-09-08 11:15:23 -07:00
Hani Damlaj
254a44aea0 Reject Migrating Peer
Summary: - refactor code path that drops packet when rejecting a migrating peer

Reviewed By: mjoras

Differential Revision: D38959058

fbshipit-source-id: e9e04a0cd433f4618721827612e40511f0c8ba5e
2022-09-06 13:42:26 -07:00
Joseph Beshay
227236ef85 Differentiate PacketDropReasons
Summary: The existing PacketDropReason values cover many branches in the code making it impossible to isolate the reason for a PARSE_ERROR, INVALID_PACKET, CONNECTION_NOT_FOUND. This change breaks them down into more values that are each used in a single branch.

Reviewed By: mjoras

Differential Revision: D39149490

fbshipit-source-id: 28cbe1ea6c4a06cf55960058edaa48c28ed4d2ef
2022-09-01 15:11:52 -07:00
Hani Damlaj
6bb7a10159 Skip Ack-Only Initial
Summary: - enable skipping ack-only initial in experimental version

Reviewed By: mjoras

Differential Revision: D38948128

fbshipit-source-id: c1fca60cdb5cc76c214aa693bd56776ab5924e51
2022-08-30 20:45:39 -07:00
Hani Damlaj
0ae79027df Issue Conn IDs As Needed
Summary:
- continually issuing new connection ids to peer as old connections ids are retired through RETIRE_CONN_ID frames
- add logic to parse and act on receiving RETIRE_CONN_ID frame

Reviewed By: mjoras

Differential Revision: D38443561

fbshipit-source-id: 82fb679f482fd69c7b3a3385693d2e5575e92703
2022-08-25 17:47:45 -07:00
Joseph Beshay
abee1d8387 Add IMMEDIATE_ACK frame
Summary: Add the new IMMEDIATE_ACK frame from the ack frequency draft.

Reviewed By: mjoras

Differential Revision: D38523438

fbshipit-source-id: 79f4a26160ccf4333fb79897ab4ace2ed262fa01
2022-08-24 11:11:33 -07:00
Hani Damlaj
f14da46a30 Frame Restrictions For 0-RTT Packets
Summary:
From [RFC9000](https://datatracker.ietf.org/doc/html/rfc9000)

```
   Note that it is not possible to send the following frames in 0-RTT
   packets for various reasons: ACK, CRYPTO, HANDSHAKE_DONE, NEW_TOKEN,
   PATH_RESPONSE, and RETIRE_CONNECTION_ID.  A server MAY treat receipt
   of these frames in 0-RTT packets as a connection error of type
   PROTOCOL_VIOLATION.
```

Reviewed By: jbeshay, mjoras

Differential Revision: D38642380

fbshipit-source-id: a1a7167c06fa68037758ce5395c3798479c26b42
2022-08-18 11:20:16 -07:00
Hani Damlaj
86a66febb0 Experiment WritableBytesLimit
Summary: - gate `enableWritableBytesLimit` behind experimental QUIC version

Reviewed By: jbeshay, lnicco

Differential Revision: D38395741

fbshipit-source-id: 0e348edb2c35e7a2afcda82a9856ac2a4c24ff08
2022-08-05 12:59:33 -07:00
Junqi Wang
1a82cd8325 Add experimental QUIC V1 alias version
Reviewed By: kvtsoy

Differential Revision: D34421598

fbshipit-source-id: b0cc2e77e3186be1e9390cd6e8bd30b9f32dc797
2022-08-03 17:26:56 -07:00
Hani Damlaj
6144ea1ded No-op Experimental Versions
Summary: - no-op all quic experimental versions

Reviewed By: kvtsoy

Differential Revision: D37146498

fbshipit-source-id: d199c108520789e85131142036c6c4c116d1bfbe
2022-06-14 14:11:34 -07:00
Hani Damlaj
32067dd7de Remap Experimental Setting
Summary: - move side-effects of `MVFST_EXPERIMENTAL3` to `MVFST_EXPERIMENTAL2`

Reviewed By: mjoras

Differential Revision: D37011661

fbshipit-source-id: b33901c0536aa5cc199ca5064894e7cf3d6bc686
2022-06-08 14:53:21 -07:00
Konstantin Tsoy
e208ceffdd Implement group streams receiver api in transport
Summary: Implement group streams receiver api in transport

Reviewed By: mjoras

Differential Revision: D36419901

fbshipit-source-id: 98bfefa1a4205fde8764f2e4300f51156667e024
2022-06-06 17:11:39 -07:00
Konstantin Tsoy
9e016a0ec3 Pass max stream group parameter on handshake
Summary:
Pass max stream group parameter on handshake

The parameter conveys max number of stream groups a peer wishes to support. Note that the number/param is exchanged during handshake and currently there is now way to bump it later in connection. We can add something like MAX_STREAM_GROUP frame later.

Reviewed By: mjoras

Differential Revision: D36415454

fbshipit-source-id: 9d1c8fca7efa4adfb67fdeef859c47a3f50a67ef
2022-06-03 15:47:17 -07:00
Hani Damlaj
747c41c30d Fix Probing Bytes Limit
Summary:
- PTOs should not be subject to congestion control limits
- Quickly recover from PTOs being writableBytesLimited by calling onPTOAlarm() as soon as we become unblocked

Reviewed By: mjoras

Differential Revision: D35480409

fbshipit-source-id: 51500db6fff17a7badefea8bda7f63141e97f746
2022-04-19 00:50:36 -07:00
Hani Damlaj
c8bf098e5d Change Implementation of WritableBytesLimit
Summary: - updating usage of WritableBytesLimit

Reviewed By: mjoras

Differential Revision: D33079816

fbshipit-source-id: 1854f40a7b00526afb2167764aeddf55edb1771f
2022-04-04 16:18:52 -07:00
Hani Damlaj
045d1e6e25 Close Transport Upon Receiving Client Initial With Malformed DstCid
Summary: - as title :)

Reviewed By: mjoras

Differential Revision: D34124710

fbshipit-source-id: 3cee590d38abf395a09ca3a1d8632a5c4d8e3b64
2022-02-18 15:24:03 -08:00
Joseph Beshay
d87f85f627 Use MVFST_EXPERIMENTAL to set experimental CC and pacer on both server and client
Summary: Use MVFST_EXPERIMENTAL to set experimental CC and pacer on both server and client

Reviewed By: mjoras

Differential Revision: D34246752

fbshipit-source-id: 72a037d99f1a3d3cb9e9f4b407710ddf08eaf235
2022-02-17 13:06:16 -08:00
Konstantin Tsoy
cecc1ba279 Introduce QuicError struct
Summary: Instead of using std::pair everywhere

Reviewed By: mjoras

Differential Revision: D34146686

fbshipit-source-id: dfe48f43775de868aba06a5b9b5a004e5793bdbb
2022-02-14 16:00:21 -08:00
Elijah Staple
b57802721e Add ReadDatagram struct and update readDatagrams callback
Summary: In order to provide more information about datagrams when we receive them, I'm adding a wrapper around the BufQueue that we currently hold so we can include receiveTimePoint and any other metadata we might want to expose for the Datagram API.

Reviewed By: mjoras

Differential Revision: D33994358

fbshipit-source-id: 805f182cd350908320639bc07eb6f3b7349bbc05
2022-02-10 16:47:06 -08:00
Luca Niccolini
3898b5a9d3 QUIC/HTTP3: reset idle timeout on ping
Summary:
Adds a transport callback for ping received.
Uses the callback in the HTTP3 session to reset the timeout
Also now invokes the ping callbacks synchronously to avoid issues during connection shutdown

Reviewed By: mjoras

Differential Revision: D33753068

fbshipit-source-id: 99ac14d0e4b9539f3a20c5c55bb5241351bf1c57
2022-01-26 17:29:53 -08:00
Luca Niccolini
60ad67ffff Back out "QUIC/HTTP3: reset idle timeout on ping"
Summary:
Original commit changeset: d6fcecd22cbd

Original Phabricator Diff: D33101180 (15390c732a)

Reviewed By: afrind, kvtsoy

Differential Revision: D33743341

fbshipit-source-id: 3abf82db83125659a447f1c95330c85f21eed9b6
2022-01-24 08:52:37 -08:00
Luca Niccolini
15390c732a QUIC/HTTP3: reset idle timeout on ping
Summary:
Adds a transport callback for ping received.
Uses the callback in the HTTP3 session to reset the timeout

Reviewed By: mjoras

Differential Revision: D33101180

fbshipit-source-id: d6fcecd22cbd5c311674dd9421c0c54eb04728a0
2022-01-21 16:43:27 -08:00
Hani Damlaj
fec4289d46 Skip Crypto Ack Initial
Summary: - shipping skip crypto ack initial

Reviewed By: mjoras

Differential Revision: D33173043

fbshipit-source-id: 5add8a7355b1e06b8aa28a809fa0f621ff11f027
2022-01-19 17:06:04 -08:00
Hani Damlaj
00e67c1bf9 mvfst License Header Update
Reviewed By: lnicco

Differential Revision: D33587012

fbshipit-source-id: 972eb440f0156c9c04aa6e8787561b18295c1a97
2022-01-18 13:56:12 -08:00