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

178 Commits

Author SHA1 Message Date
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
Xiaoting Tang
33c5832ff3 Add probe timeout transport setting
Summary:
Similar to raise timeout, client can choose the probe timeout via transport
parameter. This timeout might not end up being useful because by the time the
recommended timeout (15s) expires, either:
i. the probe gets acked, d6d send a larger probe or sleeps if the upper bound
is found
ii. the probe is lost, then quic will likely determine its loss faster than
15s, upon which a PMTU blackhole is recognized

So adding this is mostly for mvfst to be compliant with the d6d spec, and
potentially useful if we want to control probe sending rate upon ack, e.g. send
the next probe after 1s upon ack instead of immediately.

Reviewed By: yangchi

Differential Revision: D23700182

fbshipit-source-id: 18b740d05343591d6afa086b9fae746e6c71aca5
2020-09-16 13:58:34 -07:00
Xiaoting Tang
485726f5d6 log error only when d6d transport parameters are present
Summary:
Currently it logs error even if transport parameters are not present, but in
that we should assume the client doesn't want d6d, so we should not log error at
all.

Reviewed By: yangchi

Differential Revision: D23681935

fbshipit-source-id: 6420ff3053cd6c7d2d0ddad854f481e4f422c992
2020-09-14 23:29:27 -07:00
Xiaoting Tang
9cdb922288 Special treatment to d6d probe in tx/rx path via isD6DProbe flag in OutstandingPacket
Summary:
According to the spec, loss of d6d probe packet should not affect congestion
control, but AFAIU its ack should be considered a normal ack and has all the
implications of an ack (e.g. sample srtt, increment largest ack num).

Additionally, although d6d probe uses ping frame, neither sending a d6d probe
nor receiving the ack should have any bearing on either pendingEvents.sendPing
or pendingEvents.cancelPingTimeout.

To differentiate a d6d probe from a normal packet in tx/rx path, the isD6DProbe
flag is added. I also added a new struct to store d6d specific states (1 field
in this diff, more to come in subsequent diffs). In updateConnection, we
identify a d6d probe by comparing the packet sequence num with the sequence num
stored in the lastProbe field of the d6d state.

Reviewed By: mjoras

Differential Revision: D22551400

fbshipit-source-id: 85ec30c185666c3d5cf827bf03b4f92e6f22d4ec
2020-09-14 16:06:21 -07:00
Matt Joras
ab381b319a Use TokenlessPacer for experimental
Summary: This enables the TokenlessPacer if the version is MVFST_EXPERIMENAL.

Reviewed By: yangchi

Differential Revision: D23600318

fbshipit-source-id: 22f2c702a0aa7f1219d3a84bb21a4ad6135240b5
2020-09-09 13:39:52 -07:00
Amaury Séchet
91525d80bf Make ServerHandshake's fields protected (#161)
Summary:
This will make migrating the fizz parts way easier.

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

Reviewed By: yangchi

Differential Revision: D23560257

Pulled By: xttjsn

fbshipit-source-id: 1f0f78f26d221f23542a9d900b23ba0bc4e60f6d
2020-09-09 09:26:43 -07:00
Xiaoting Tang
1ee77666b6 Re-introduce d6d configs
Summary:
As a second attempt to add d6d, I tried to be as non-intrusive as possible, by de-coupling all state that d6d needs from the existing transport state.

To reduce complexity, I made the assumption that, as a starter, only server does the probing. To make it easy to control d6d in different connection settings, both the server and the client has a toggle `enabled`. It is only when both the server and client are `enabled`, that server will do probing for a connection.

Among all the changes, this adds:
- Two transport parameters:
  - `d6d_base_pmtu`: this is the base PMTU client advertises to server during handshake. A valid presence of this value indicates that clients d6d module is `enabled`. Although this config value is not used by server, I kept it in `D6DConfig` to avoid complexity and make it possible for future extension where clients might also do probing.
  - `d6d_raise_timeout`: this is the raise timeout client advertises to server during handshake. It is the amount of time d6d "sleeps" after it finds an upper bond. It is optional. We want this because depending on the network conditions we might need to adjust this timeout.

Reviewed By: mjoras

Differential Revision: D23409623

fbshipit-source-id: bad6df443cc13dc4d69532342f182cb919c5a7dd
2020-09-02 15:40:12 -07:00