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
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
Yang Chi
a67083ff4b Close connection if we derive an extra 1-rtt write cipher
Summary: Fixes CVE-2021-24029

Reviewed By: mjoras, lnicco

Differential Revision: D26613890

fbshipit-source-id: 19bb2be2c731808144e1a074ece313fba11f1945
2021-03-03 07:26:26 -08:00
Matt Joras
21f190220e Implement basic ACK_FREQUENCY support.
Summary: As in title. This doesn't actually send any frames, but implements basic support for the transport parameter and responding to the frames.

Reviewed By: yangchi

Differential Revision: D26134787

fbshipit-source-id: 2c48e01084034317c8f36f89c69d172e3cb42278
2021-02-02 19:02:40 -08:00
Yang Chi
5d6d9c5ae2 Increase QUIC connection flow control blocked closing connection log
Summary: as title

Reviewed By: lnicco

Differential Revision: D25860869

fbshipit-source-id: 6c83621d3c01b625bf5d63d4aa4cbcd72df91646
2021-01-09 13:43:42 -08:00
Yang Chi
8fcb4805f5 Only logs the client giving up FC blocked stream/conn log if stream/conn has
Summary:
as title

(Note: this ignores all push blocking failures!)

Reviewed By: mjoras

Differential Revision: D25772188

fbshipit-source-id: aa466539d301ba913ceb78d717f53ca31dbd4644
2021-01-06 07:39:33 -08:00
Yang Chi
ee71bf229e Reduce the amount of client giving up FC Blocked stream logging
Summary: as title

Reviewed By: mjoras, lnicco

Differential Revision: D25771697

fbshipit-source-id: 71498c0cad7cecca08f3481461ed425e3a56c9fa
2021-01-04 18:28:56 -08:00
Yang Chi
8657b5e1ac Log QUIC stream receives stop_sending from peer when it's flow control blocked
Summary:
well, the previously added log was wrong in the reset path. it should
be in the stop sending path

Reviewed By: avasylev

Differential Revision: D25724136

fbshipit-source-id: e6cec3c225e066d16c09da895356578cd6ec6808
2020-12-29 14:01:51 -08:00
Yang Chi
9faa4544f3 A couple easy code hygiene in QUIC
Summary:
(1) Stop moving integral types (2) stop copying
ClientTransportParameters

Reviewed By: lnicco, avasylev

Differential Revision: D25724204

fbshipit-source-id: 624ff097f7ea7595e122904c84f6f12a3324e1e9
2020-12-29 11:00:56 -08:00
Yang Chi
c1223a2f78 Remove trailing _E from QUIC variant type
Summary:
I think this should just work without the trailing `_E`. It was added
when we mixed up our own union based variant and boost::variant. Some compiler
flags didn't like that. Now we no longer have mixed up cases, this should be
fine

Reviewed By: lnicco

Differential Revision: D25589393

fbshipit-source-id: 6430dc20f8e81af0329d89e6990c16826da168b8
2020-12-16 18:03:05 -08:00
Yang Chi
1160b9594c Vlog when QUIC stream/connection is closed while flow control blocked
Summary: as title

Reviewed By: avasylev

Differential Revision: D25587900

fbshipit-source-id: 07b7796a9ad60db71c1ea0497d80cde8187631f4
2020-12-16 10:02:49 -08:00
Xiaoting Tang
a30b49b914 turn off blackhole detection
Summary: Speed up the experiment by disabling blackhole detection all together temporarily.

Reviewed By: mjoras

Differential Revision: D24997566

fbshipit-source-id: 2781e586f5ba9896633ab0716e78cfc49e0e34a4
2020-11-16 20:40:50 -08:00
Xiaoting Tang
d985a8fcc1 Add transport knob to enforce udp payload size
Summary: Adds another knob param to enforce udp payload size. This is basically a "canIgnorePathMTU" knob that client has.

Reviewed By: mjoras

Differential Revision: D24586165

fbshipit-source-id: befb265a24fae8f450f323cf2d652a8b448e698c
2020-11-05 12:45:18 -08:00
Matt Joras
a1b70eb5f7 Experiment with disabling reordering threshold.
Summary: Accomplished by setting it very high.

Reviewed By: yangchi

Differential Revision: D24656684

fbshipit-source-id: 97120b867b659f1ef6ff46ea23de0db672e36948
2020-11-02 10:43:04 -08:00
Matt Joras
e8208baa3d TokenlessPacer default.
Summary: As in title.

Reviewed By: yangchi

Differential Revision: D24495623

fbshipit-source-id: f0cb39bc3e1d680cd9a1639e4a25ecaebc27952a
2020-10-23 21:02:36 -07:00
Matt Joras
3961235618 1ms pacing timer tick for experimental
Summary: This is potentially a better min interval for the TokenlessPacer, as event loops can often take > 200us.

Reviewed By: yangchi

Differential Revision: D24123176

fbshipit-source-id: 21b023925d331b196676a71a3a2eb3bc8e62df6c
2020-10-07 11:53:20 -07:00
Xiaoting Tang
f4086dc092 Make commonly-used d6d types individual target
Summary: This reduces dependencies for both testing and instrumentation.

Reviewed By: mjoras

Differential Revision: D23997313

fbshipit-source-id: 5eb3a790c7bb2569dc1e941e3911ad4aac4e9258
2020-09-30 09:32:50 -07:00
Matt Joras
f16d60e922 Use initial CID as DCID in the qlogger.
Summary: Since the DCID is often empty for clients, this is otherwise not a very useful field.

Reviewed By: yangchi

Differential Revision: D23998639

fbshipit-source-id: b8949ca6913ed270e5ebd0a0c5335b224f817774
2020-09-29 16:59:13 -07:00
Xiaoting Tang
f9e916c194 Prepare metadata
Summary:
Here are some of the questions I guess we'd like to answer regarding d6d:
- How long, and how many probes does d6d take to find the PMTU upper bound for a
  given connection?
- If PMTU blackhole is detected, what's the packet size that triggers the
  signal? And what's the state of d6d when that happens? Also, if there's issue
  with the PMTU stability in the path, in what frequency does it oscillate?

This adds some meta data in d6d's lifecycle in order to provide info when those
events happen.

Reviewed By: mjoras

Differential Revision: D23972069

fbshipit-source-id: f6a2d1d656b33d94b41ecfbb0c06bdaf299caa8b
2020-09-29 11:47:20 -07:00
Matt Joras
af3a408cf7 Increment out of order QUIC_STATS
Summary: We have this counter but don't increment it, might as well.

Reviewed By: yangchi

Differential Revision: D23916621

fbshipit-source-id: 0a8cb947f1941e04789a0144a4fec87239caef50
2020-09-25 12:12:02 -07:00
Amaury Séchet
71c88def3d Assing hanshake cipher directly in the conn object (#174)
Summary:
This reduce the amount of state overall.

Depends on https://github.com/facebookincubator/mvfst/issues/173

Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/174

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

 ---
## Traffic Canary
https://our.intern.facebook.com/intern/traffic/canary?fbid=1410439575823198
* elb.prod.msp1c01 - binary - 2020-09-21 11:33 - https://fburl.com/dyndash/uq2r8ruc
* slb.prod_regional.rrva0c00 - binary - 2020-09-21 11:33 - https://fburl.com/dyndash/aq7vnb1e
* slb.regional.rcln0c01 - binary - 2020-09-21 11:33 - https://fburl.com/dyndash/t2oc8ll3
 ---

Reviewed By: yangchi

Differential Revision: D23681965

Pulled By: mjoras

fbshipit-source-id: 15cad0dd807720f3f6d000aade9368fe4608b832
2020-09-24 10:31:13 -07:00
vaz985
a8d5c156a1 Adding packet rtt sampling to instrumentationObserver (#178)
Summary:
Due to high number of RTT samples I refactored the OutstandingPacket to
split the packet data and packet metrics. We know have access to metrics
without the need of saving the packet data.

Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/178

Reviewed By: mjoras

Differential Revision: D23711641

Pulled By: bschlinker

fbshipit-source-id: 53791f1f6f6e184f37afca991a873af05909fbd2
2020-09-22 18:39:00 -07:00
Xiaoting Tang
5317134c84 Timeouts that drive d6d lifecycle
Summary:
This glues together the d6d lifecycle via probe timeout and raise timeout.
Had to put these two timeouts in the base transport because it has all the
necessary accountings (e.g. check close state, process callbacks) that should
happen before scheduling timeouts.

Other notable changes (included here because code is simple):
- Keep track of d6d probes in loss state. Upon second thought, it makes more
sense because we are reducing the available bandwidth as a result of sending
probes anyway. And not tracking them imposes a delay on congestion controller.
I think this does not violate the d6d spec's point of not penalizing congestion
window for d6d probes, because
    - 1. we don't put losses of d6d probes in loss event. Therefore from the POV of
congestion controller, d6d probes never get lost.
    - there will be at most kDefaultD6DMaxOutstandingProbes losses (i.e.  2)
that we don't tell congestion controller about. Even if those are actually
caused by congestion, it should have minimal impact because 2 is small and if there's really a congestion, the loss of normal packets should provide the signal.
- Pacing d6d probes
- Kick off d6d after a delay of 1s. This should filter out short-lived connections where probing is relatively expensive and less useful.

Reviewed By: mjoras

Differential Revision: D23736656

fbshipit-source-id: 8121fa8bcebab10a56a4e046c32c4e99ed6c3013
2020-09-22 08:44:25 -07:00
Xiaoting Tang
ffc434ab11 Refactor server handling of max_recv_pkt_size to prepare a larger probing upper limit
Summary:
This should be a noop in our current set up. I added some comments to clarify
the logic. Put it in another way,
- `udpSendPacketLen = f(max_packet_size, kDefaultMaxUDPPayload, canIgnorePathMTU)`
- `d6d.maxPMTU = g(max_packet_size, kDefaultMaxUDPPayload, d6dConfig.enabled)`

`f` and `g` are what the code does.

Reviewed By: mjoras

Differential Revision: D23745844

fbshipit-source-id: bc8c38a8a9086fe31e5f367d01737f360c403353
2020-09-22 08:44:25 -07:00