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

206 Commits

Author SHA1 Message Date
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
Hani Damlaj
2660a288b3 Update Company Name
Summary: - as title

Reviewed By: lnicco

Differential Revision: D33513410

fbshipit-source-id: 282b6f512cf83b9abb7990402661135b658f7bd1
2022-01-13 12:07:48 -08:00
Hani Damlaj
58192de447 NewTokenFrame Encoding Fix
Summary:
- Wrap the TokenLength in a QuicInteger
- Validate token written by server equals token parsed by client codec

Reviewed By: mjoras

Differential Revision: D33134186

fbshipit-source-id: fc003979d9bacdb9ab9bb563a300cedd7a99d58a
2022-01-06 11:46:49 -08:00
Matt Joras
ade5f5f5f8 TransportSetting to enable issuing new tokens.
Summary: As in title.

Reviewed By: hanidamlaj

Differential Revision: D33108786

fbshipit-source-id: 174a4ad9105f8aacc7a58d9a88c6e1979b6e2185
2021-12-14 16:02:16 -08:00
Hani Damlaj
7233c55d29 Issue NewTokenFrame To Clients
Summary:
- Issuing NewTokenFrames to clients, allowing them to verify their address in subsequent connections by including the token.
- add NewTokenFrame struct in the union type QuicSimpleFrame.
- Issued only once when the crypto handshake is complete.
- Testing includes validating token serialization & deserialization and asserting that the NewTokenFrame is only issued once on handshake completeness.

Reviewed By: mjoras

Differential Revision: D31673160

fbshipit-source-id: 9401ab1a4b878d8b4380d55afa531ec768f5f4cd
2021-12-10 20:35:49 -08:00
Brandon Schlinker
c051ff1299 AcksProcessedEvent observer event
Summary:
Providers observers with insight into ACKs received. Works for both client and server transport.

Attempts to prevent wasted memory by removing any allocated memory for ACK events if no packets in flight. In tandem, reduces allocs by _not_ removing allocated memory when packets are in flight (as this means more ACK events will occur soon...).

Reviewed By: jbeshay

Differential Revision: D31221280

fbshipit-source-id: 64b73aa74c757ebbfc27bb9c2a047d08dc7a77ca
2021-12-08 08:16:28 -08:00
Hani Damlaj
fd32adc85f Skip ACK-Only Initial Crypto
Summary:
- Skip ACK-only response to initial crypto data from client
- Enabled through experimental transport settings

Reviewed By: mjoras

Differential Revision: D31863653

fbshipit-source-id: b290db0399dd7a3be41078c4a839b484da864f2f
2021-12-07 13:12:05 -08:00
Joseph Beshay
ef722626dd REVERT Set Mvfst Experimental to use an initial cwnd of 30 MSS
Summary: Revert the experimental change for the server to use an initial cwnd 30 MSS.

Reviewed By: hanidamlaj

Differential Revision: D32173456

fbshipit-source-id: 13ed4f4c1b11ab9c1dc0da1904be3eb5c564e2d8
2021-11-04 12:06:14 -07:00
Joseph Beshay
c636afe71e Set Mvfst Experimental to use an initial cwnd of 30 MSS
Summary: Set the experimental version of Mvfst to use an initial cwnd of 30 MSS instead of 10.

Reviewed By: mjoras, lnicco

Differential Revision: D31553957

fbshipit-source-id: 8aa4f0596dbedbea0922afa13de0631c1b898f53
2021-10-12 10:11:38 -07:00
Hani Damlaj
a0d81894b5 Set ExperimentalCongestion As Default
Summary: - Set the experimental persistent congestion logic (D30117835 (2caf2ff49d)) as the default implementation.

Reviewed By: mjoras, lnicco

Differential Revision: D31347778

fbshipit-source-id: ab74359896f8f57cf4d8c3065de4c658f65b9769
2021-10-06 11:33:52 -07:00
Joseph Beshay
dbdcdcdf0c QUIC v1 - Add missed references to V1 for stats and parsing transport settings and other tools
Summary:
- Count QUIC v1 stats separately so they don't end up in the UNKNOWN bucket. This was missing after v1 was introduced.
- Add three references to QUIC_V1 that were missing while verifying the transport settings.

Reviewed By: mjoras, lnicco

Differential Revision: D30934880

fbshipit-source-id: 9a0e0793fbd37f12f5d756022f4ac809d8dc14d4
2021-09-15 20:33:27 -07:00
Hani Damlaj
2caf2ff49d Persistent Congestion
Summary:
- The current mvsft implementation only checks against the duration threshold to establish persistent congestion. However, according to the spec, persistent congestion should only be established if both the threshold duration is exceeded and there are no acked packets between the send times of the lost packets.

- In addition to the logic already present in `isPersistentCongestion()`, `isPersistentCongestionExperimental()` validates that no acked packet exists between the send times of the two lost ack-eliciting packets.

Reviewed By: mjoras

Differential Revision: D30117835

fbshipit-source-id: 8809ccda761fe67b4cf51abbf2d5c0d5a4ed2b38
2021-08-16 12:42:37 -07:00
Hani Damlaj
da36437098 Remove packetNum From CipherUnavailable
Summary:
- Removed packetNum field from CipherUnavailable struct.

- Removed all instances referring to the field and fixed tests accordingly.

Reviewed By: mjoras

Differential Revision: D29968168

fbshipit-source-id: 9802b8cd66f43f2a8d54340f2d00639ee4679aaf
2021-08-04 12:13:21 -07:00
Konstantin Tsoy
9a17694dca Use always reject 0-rtt option
Summary: Use always reject 0-rtt option

Reviewed By: mjoras

Differential Revision: D29805759

fbshipit-source-id: 4a57a923a8d8df35648125b1ac29c52990bfe753
2021-07-24 14:25:42 -07:00
Joseph Beshay
5e2f5719b7 Remove all remaining references to QuicVersion::MVFST_D24
Summary:
- Remove QuicVersion::MVFST_D24 (3625d9e7af) constant
- Remove all references in QUIC code
- Remove external references
- Change Liger defaults that referred to the removed constant value

Reviewed By: mjoras

Differential Revision: D29767833

fbshipit-source-id: 980b3c4a7f190442577c3dede14127e77ce472fa
2021-07-20 13:31:10 -07:00
Matt Joras
003f012cb7 TODO comment cleanup.
Summary:
These are either no longer relevant, are unlikely to be done, or are spculative enough that they don't deserve code space.

Hope here is to make our search for TODOs higher signal.

Reviewed By: lnicco

Differential Revision: D29769792

fbshipit-source-id: 7cfa62cdc15e72d8b7b0cd5dbb5913ea3ca3dc5a
2021-07-20 10:27:32 -07:00
Luca Niccolini
9d3883e341 do not barf if the peer advertises max_datagram_frame_size=0
Summary: ^

Reviewed By: jbeshay

Differential Revision: D29698252

fbshipit-source-id: 8bf20fb749ba76155bd71899dafc095d9e864bc2
2021-07-14 10:30:37 -07:00
Matt Joras
1d85d30b39 Experiment with a lower max num PTOs.
Summary: The default we are using, 11, is probably excessive.

Reviewed By: yangchi

Differential Revision: D29273970

fbshipit-source-id: 24605e7d8feec43ee9b53880e8c510d1ca376d75
2021-06-21 16:08:29 -07:00
Luca Niccolini
99110ccf83 consider max packet header and datagram frame payload
Summary:
make getDatagramSizeLimit return the maximum datagram payload size that the
peer can accept.
This is currently the most conservative length, considering the maximum length
of a QUIC short header packet and a datagram frame header

Reviewed By: mjoras

Differential Revision: D28784866

fbshipit-source-id: cce8944a77f6f7b2d3535758c3c29ad88382710f
2021-06-13 21:13:19 -07:00
Luca Niccolini
026568e692 max_datagram_frame_size transport setting
Summary:
conditionally enable datagram support and communicate it to the peer via max_datagram_frame_size transport setting

https://quicwg.org/datagram/draft-ietf-quic-datagram.html#name-transport-parameter

Reviewed By: mjoras

Differential Revision: D27385012

fbshipit-source-id: 8c61765b6e044105409b0c638a8d6d16319ca21b
2021-05-11 08:24:03 -07:00
Yang Chi
38c903ba2f Remove all QUIC_TRACEs
Summary: no longer used

Reviewed By: lnicco

Differential Revision: D28141008

fbshipit-source-id: 870d6574cc1657914a08f1ef5ee581cfef96aad1
2021-05-10 12:46:08 -07:00
Arvind Srinivasan
6683325105 Add additional transport parameters validation
Summary:
Added code for remaining transport parameter validation. These errors are covered by these changes
  MUST send TRANSPORT_PARAMETER_ERROR if original_destination_connection_id is received [Transport 18.2] FAILED [2]
  MUST send TRANSPORT_PARAMETER_ERROR if preferred_address, is received [Transport 18.2] FAILED [3]
  MUST send TRANSPORT_PARAMETER_ERROR if retry_source_connection_id is received [Transport 18.2] FAILED [4]
  MUST send TRANSPORT_PARAMETER_ERROR if stateless_reset_token is received [Transport 18.2] FAILED [5]
  MUST send TRANSPORT_PARAMETER_ERROR if max_ack_delay >= 2^14 [Transport 7.4 and 18.2] FAILED [6]

Reviewed By: yangchi

Differential Revision: D28266216

fbshipit-source-id: f0e935f9158554c4a5b6922a8ee1453ebabfab25
2021-05-08 09:26:53 -07:00
Luca Niccolini
ec9c10f635 handle receiving datagram
Summary:
receive datagrams.
And add some tests

Reviewed By: mjoras

Differential Revision: D26244066

fbshipit-source-id: f794dfce9feb08040afbda84b1c2adf3994a0993
2021-05-04 10:53:00 -07:00
Luca Niccolini
e39bf5f447 parse and write DATAGRAM Frames
Summary: This diff is the encode and decode support of Datagram frame.

Reviewed By: mjoras, yangchi

Differential Revision: D20983883

fbshipit-source-id: 1a72a87e6ce3601b71fececca872a9d20bf7820e
2021-05-04 10:53:00 -07:00
Matt Joras
98298496a2 Add some more info to transport summary qlog
Summary: Same as before!

Reviewed By: lnicco

Differential Revision: D27785992

fbshipit-source-id: 0160fb1572c8afc3dbbcf1dac50fc73ddbfbad83
2021-04-14 20:05:53 -07:00
Chetan Ambekar
cd754c2499 Revert D27768829: Add some more info to transport summary qlog
Differential Revision:
D27768829 (3ed777d04f)

Original commit changeset: 43cbf88f38ce

fbshipit-source-id: 4c678ebccbb7c9c33b1c7ab9ed98f6bdbc9c7e49
2021-04-14 18:45:06 -07:00
Matt Joras
3ed777d04f Add some more info to transport summary qlog
Summary: Specifically interested in seeing whether 0RTT was used, writable bytes, and conn flow control.

Reviewed By: yangchi

Differential Revision: D27768829

fbshipit-source-id: 43cbf88f38ce56065cad785344dedc279a0af7d1
2021-04-14 18:08:13 -07:00
Joseph Beshay
9300daea87 End the connection on receiving packets without frames and report a protocol violation.
Summary:
On receiving a QUIC packet, if the packet has no frames we should end the connection with PROTOCOL_VIOLATION.

This fixes the error reported by h3spec test `/QUIC servers/MUST send PROTOCOL_VIOLATION on no frames [Transport 12.4]/`

This change adds the check right after a packet is successfully parsed for both the client and server.

Reviewed By: mjoras

Differential Revision: D27483874

fbshipit-source-id: 9b648709e6985f151ba0ffc973aa05c28683fbe9
2021-04-06 18:59:01 -07:00
Matt Joras
382c1cdcc6 Remove partial reliability from mvfst.
Summary: As in title.

Reviewed By: yangchi

Differential Revision: D26701886

fbshipit-source-id: c7b36c616200b17fbf697eff4ba0d18695effb45
2021-03-03 15:30:21 -08:00