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

42 Commits

Author SHA1 Message Date
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
cb0a4d34a9 Fix CongestionControlRecreatedWithNewFactory test
Summary: The new controller happens to be the exact same address

Reviewed By: lnicco

Differential Revision: D26566423

fbshipit-source-id: 88fa04d2cf8b02ef20e7979f0055ee84903d33e9
2021-02-20 12:08:05 -08:00
Andrii Vasylevskyi
10a6feed49 Reset congestion controller after setting factory
Summary:
Before the change, there's no good way to recreate Cubic CC instance with custom CC factory, because Cubic is created by default.

On client side this requires calling setCongestionControl() or setTransportSettings() after calling setCongestionControllerFactory(), which is normally the case.

Reviewed By: yangchi

Differential Revision: D26401996

fbshipit-source-id: dfda39be835c67b9db42f726b3ac64c7b3d37c2f
2021-02-19 17:55:10 -08:00
Yang Chi
7c23fc75cc remove the unsupported cork param from QUIC writeChain interface
Summary: this param is passed to transport then ignored

Reviewed By: avasylev

Differential Revision: D26133327

fbshipit-source-id: 459dd0132185513215ba034f213d4137d7b56ba1
2021-01-29 10:50:45 -08:00
Yang Chi
79bdfab8c5 Move QuicStreamManager::writableContains to TestUtil
Summary: This is a test only API

Reviewed By: lnicco

Differential Revision: D25981669

fbshipit-source-id: 37163f6792ea6fa261bf9ab586cc335c7c95d6bd
2021-01-20 18:49:51 -08:00
Yang Chi
72eeeb8a4f QUIC Retry + HappyEyeballs fix on client transport
Summary:
(1) Receiving a valid retry packet is a HappyEyeballs signal. We should
use that to update the happy eyeballs state.

(2) HappyEyeballs state should also be preserved when we undo client connection
state for retry.

Reviewed By: mjoras

Differential Revision: D25728713

fbshipit-source-id: 4ff06879f5a05e6fb4faeb1e9f330e251d3dbcb6
2021-01-04 15:28:19 -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
a4ec325df8 Fix QuicClientTransportIntegrationTests.TestStatelessResetToken flakyness
Summary:
The test case relies on the client transport hits max PTO within 10s
to trigger a read error callback. Sometimes, it takes longer than 10s to hit
max PTO under stress runs

Reviewed By: mjoras

Differential Revision: D25065653

fbshipit-source-id: c728084178126452d0c7c885cb7215878cf4e3b7
2020-11-18 19:04:34 -08:00
Yang Chi
000a0e23ca Add stream prioritization
Summary: Adds a top level API to set stream priorities, mirroring what is currently proposed in httpbis.  For now, default all streams to the highest urgency, round-robin, which mirrors the current behavior in mvfst.

Reviewed By: mjoras

Differential Revision: D20318260

fbshipit-source-id: eec625e2ab641f7fa6266517776a2ca9798e8f89
2020-11-10 20:08:13 -08:00
Aman Sharma
2560e174a9 Make client keep track of originalDestinationConnectionId
Summary:
When I tested against picoquic, I found that an exception was thrown here: https://fburl.com/diffusion/qsnzingx.

The reason is that we modify `conn.initialDestinationConnectionId` in the event of a retry, so it's no longer the original destination connection id. By separately keeping track of the original destination connection id, we can solve this issue.

Reviewed By: mjoras

Differential Revision: D23722127

fbshipit-source-id: 94be08812e675feaf46f5af86e7304af84c1910c
2020-11-06 16:26:02 -08:00
Aman Sharma
0b548c4140 Change client handshake to use FizzRetryIntegrityTagGenerator and PseudoRetryPacketBuilder
Summary: This switches the client to use the FizzRetryIntegrityTagGenerator and the PseudoRetryPacketBuilder, to avoid duplication of a lot of the work.

Reviewed By: mjoras

Differential Revision: D21489881

fbshipit-source-id: 8aa3af26f1090eeb9f2f04eb4defd785ad555df1
2020-11-05 21:24:44 -08:00
Matt Joras
75df36f4bd Allow disabling of IPV6_ONLY for AsyncUDPSocket
Summary: It's useful to be able to use the v4-mapped addresses sometimes.

Reviewed By: avasylev

Differential Revision: D24371807

fbshipit-source-id: 74fe13fa4bef9c77cc51a18137559facda9bdbeb
2020-10-30 09:53:50 -07:00
Xiaoting Tang
bcb7a8f08a Fix flaky d6d test
Summary: The D6DEnabled integration test was flaky because of a race condition between stats callback and client's transportReady callback. Simple fix by ~~send some data and wait for echo~~ calling terminateLoopSoon in onConnectionD6DStarted. Still, it makes sense to make transportReady the last callback in server so I switched the order.

Reviewed By: yangchi

Differential Revision: D24198017

fbshipit-source-id: 36a7b6377c970b2f2f5d072f03d8bc8b0837fd79
2020-10-08 15:14:24 -07:00
Xiaoting Tang
6157952380 Correctify d6d transport parameter id and xmit them during handshake
Summary: We need to increase those parameter Ids above 0xFF00, and xmit them.

Reviewed By: mjoras

Differential Revision: D24115117

fbshipit-source-id: cf8b4970ba8640a83bde22c1f9fdfa1d3e53e3f9
2020-10-06 00:28:39 -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
Amaury Séchet
1d4d67c075 Add belt and suspender for the client crypto implementation (#182)
Summary:
There is a pretty tight coupling between ClientHandshake and FizzClientHandshake . The later can mess up pretty bad with the former's state, especially since th code has quite a lot of temporal dependencies and is very stateful.

This constraint he API through which the subclass can interact with the parent class and prevent some obviously bad misuses. It also make it clear when something is to made available for testing exclusively.

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

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

 ---
## Traffic Canary
https://our.intern.facebook.com/intern/traffic/canary?fbid=119893296332660
* elb.prod.hel3c01 - binary - 2020-09-24 23:01 - https://fburl.com/dyndash/q948xh5b
* flb.prod.fgdl1c03 - binary - 2020-09-24 23:01 - https://fburl.com/dyndash/1p582qcv
* olb.prod.rftw0c01.p2 - binary - 2020-09-24 23:01 - https://fburl.com/dyndash/h23ldteg
* slb.prod_regional.rash0c00 - binary - 2020-09-24 23:01 - https://fburl.com/dyndash/6cjn5fxn
* slb.regional.rash0c01.p2 - binary - 2020-09-24 23:01 - https://fburl.com/dyndash/kadbkkdf
 ---

Reviewed By: mjoras

Differential Revision: D23816801

Pulled By: bschlinker

fbshipit-source-id: 52c7fa3e3f436d3317f2a13bef8ae4d596f6a25b
2020-09-25 09:01:12 -07:00
Matt Joras
43a0b7e02d Always update max packet size after 0-rtt.
Summary: This is a temporary hack until we properly implement 0-rtt transport parameter updating. Now after 0-rtt we will use the packet size from the peer as the max packet size, if the can ignore setting is set.

Reviewed By: xttjsn

Differential Revision: D23690019

fbshipit-source-id: b4dbf5702e81e52ccd437e0fa68f4d156c7123be
2020-09-15 08:36:59 -07:00
Luca Niccolini
bf4d216763 fix test build
Summary: fixes #172

Reviewed By: bschlinker

Differential Revision: D23680415

fbshipit-source-id: 1abb47a4e8569723fc1abcb5fa94bdbc972d3bbc
2020-09-14 08:02:13 -07:00
Matt Joras
325a6465ec Always send flow control updates again when lost.
Summary: This was probably a premature optimization and introduces complexity for dubious gain. Additionally a sequence of losses could potentially cause multiple updates to be delayed.

Reviewed By: yangchi

Differential Revision: D23628058

fbshipit-source-id: d6cf70baec8c34f0209ea791dadc724795fe0c21
2020-09-10 14:58:59 -07:00
Luca Niccolini
ed9d1bc3e1 correctly start/stop qlog collection when setQlogger is called multiple times
Reviewed By: yangchi

Differential Revision: D23579772

fbshipit-source-id: abe8e5dac3ba46fdccba2b39055e5589179cb8a1
2020-09-09 00:20:09 -07:00
Luca Niccolini
c47c3cf5c6 Revert PMTU and size-enforced packet builder
Differential Revision: D23283619

fbshipit-source-id: b7fe31871dad5711016234a2d10ae84edc4fd24c
2020-08-22 16:55:54 -07:00
Xiaoting Tang
4762cfb927 Introduce PMTU as a variable
Summary:
First step towards d6d. Semantically we need to separate the old `udpSendPacketLen` into `peerMaxPacketSize` as well as `currPMTU`. The former is directly tied to the peer's max_packet_size transport parameter whereas the second is controlled by d6d. To get the actual udp mss, call `conn_->getUdpSendPacketLen()`, which will use the minimum of the two if d6d is enabled, otherwise it will fallback to use `peerMaxPacketSize` only.

During processClientInitialParams and processServerInitialParams, we no longer need to check whether `canIgnorePathMTU` is set because that logic is moved to `setUdpSendPacketLen`. If d6d is enabled, we set both `peerMaxPacketSize` and `currPMTU` to `packetSize` because receiving an initial packet of size x indicates both that the peer accepts x-sized packet and that the PMTU is at least x.

Many call sites and tests are changed.

Faebook:
For now, d6d is considered enabled if `canIgnorePathMTU==false` and `turnoffPMTUD==true`. Down the road, from semantic & practical POV at least one of them should be renamed to something like `enableD6D`, since enabling d6d implies turning off PMTUD and that we should not ignore PMTU. We can keep one for the sake of testing.

Reviewed By: mjoras

Differential Revision: D22049806

fbshipit-source-id: 7a9b30b7e2519c132101509be56a9e63b803dc93
2020-08-17 16:15:24 -07:00
Yang Chi
06083595e3 Do not enable pacing if transport doesn't have pacing timer
Summary:
LOG an error and fallback to no pacing. This diff also stops
supporting automaticaly set pacingEnabled to true when BBR is enabled.

Reviewed By: mjoras

Differential Revision: D22875904

fbshipit-source-id: f8c8c9ea252f6e5e86f83174309b159ce93b3919
2020-08-03 10:38:39 -07:00
Yang Chi
5d74a54259 refactor setCipherOverhead -> accountForCipherOverhead
Summary: as title

Reviewed By: mjoras

Differential Revision: D22640467

fbshipit-source-id: 063dbd6aebd323ab6396d5e408057ce16aaf51b9
2020-07-22 15:16:12 -07:00
Yang Chi
344e028687 Close quic client connection upon read error
Summary: set this to be default behavior

Reviewed By: vchynarov

Differential Revision: D22432915

fbshipit-source-id: 3ac527b206ccb798d63336bf559f7d164e2959c7
2020-07-08 13:01:34 -07:00
Junqi Wang
499b5fb0ce Remove continueOnNetworkUnreachable
Reviewed By: yangchi

Differential Revision: D22333283

fbshipit-source-id: b35fb9e6ba31e88faf2c92805edc2738cfde93f1
2020-07-01 19:35:26 -07:00
Yang Chi
51b917b0b3 PingFrame is not a simple frame
Summary:
The problem with Ping being a simple frame:
(1) All SimpleFrames are in the same scheduler. So sending ping means we may
also send other frames which can be problematic if we send in Initial or
Handshake space
(2) Ping isn't retranmisttable. But other Simple frames are. So we are
certainly setting this wrong when we send pure Ping packet today.

That being said, there are cases where we need to treat Ping as retransmittable.
One is when it comes to update ack state: If peer sends us Ping, we may want to
Ack early rather than late. so it makes sense to treat Ping as retransmittable.
Another place is insertion into OutstandingPackets list. When our API user sends
Ping, then also add a Ping timeout. Without adding pure Ping packets into OP list,
we won't be able to track the acks to our Pings.

Reviewed By: mjoras

Differential Revision: D21763935

fbshipit-source-id: a04e97b50cf4dd4e3974320a4d2cc16eda48eef9
2020-06-18 15:30:44 -07:00
Yang Chi
b8fef40c6d Clone Quic handshake packets
Summary:
On loss timer, currently we knock all handshake packets out of the OP
list and resend everything. This means miss RTT sampling opportunities during
handshake if loss timer fires, and given our initial loss timer is likely not a
good fit for many networks, it probably fires a lot.

This diff keeps handshake packets in the OP list, and add packet cloning
support to handshake packets so we can clone them and send as probes.

With this, the handshake alarm is finally removed. PTO will take care of all
packet number space.

The diff also fixes a bug in the CloningScheduler where we missed cipher
overhead setting. That broke a few unit tests once we started to clone
handshake packets.

The writeProbingDataToSocket API is also changed to support passing a token to
it so when we clone Initial, token is added correctly. This is because during
packet cloning, we only clone frames. Headers are fresh built.

The diff also changed the cloning behavior when there is only one outstanding
packet. Currently we clone it twice and send two packets. There is no point of
doing that. Now when loss timer fires and when there is only one outstanding
packet, we only clone once.

The PacketEvent, which was an alias of PacketNumber, is now a real type that
has both PacketNumber and PacketNumberSpace to support cloning of handshake
packets. I think in the long term we should refactor PacketNumber itself into a
real type.

Reviewed By: mjoras

Differential Revision: D19863693

fbshipit-source-id: e427bb392021445a9388c15e7ea807852ddcbd08
2020-06-18 15:30:44 -07:00
Andrii Vasylevskyi
adb48de101 Add client side packet drop stats bumps
Summary:
^

(Note: this ignores all push blocking failures!)

Differential Revision: D22042953

fbshipit-source-id: e435065210e5f21dd2c8d4a1e1c9ac3013c9d41e
2020-06-18 09:51:24 -07:00
Matt Joras
42bba01005 Draft-29 support.
Summary:
This implements the connection ID validation via transport parameters. Note we don't do anything with the retry transport parameter yet.

This will probably require further surgery to tests when we want the MVFST version to do this, but for now I'm punting on that test plumbing.

This retains support for h3-27.

Reviewed By: yangchi

Differential Revision: D22045631

fbshipit-source-id: e93841e734c0683655c751d808fd90b3b391eb3e
2020-06-16 17:05:41 -07:00
Xiaoting Tang
2d00d56fbd Put outstanding packets, events and associated counters in one class
Summary: ^

Reviewed By: yangchi

Differential Revision: D21956286

fbshipit-source-id: 305b879ad11df23aae8e0c3aac4645c0136b3012
2020-06-10 12:45:28 -07:00
Andrii Vasylevskyi
5d89358075 Add client side onRead/onPacketReceived stats callbacks
Summary: Invoking callbacks onRead and onPacketReceived in QuicClientTransport when reading UDP packets.

Reviewed By: mjoras

Differential Revision: D21904927

fbshipit-source-id: b2bdee6330a0ddebbdbe677a6779b14d36b15f07
2020-06-09 12:14:52 -07:00
Yang Chi
b18ffd1b6a Limit Quic Client close to be one close per RTT
Summary: I think this is still within specs requirement

Reviewed By: mjoras

Differential Revision: D21648049

fbshipit-source-id: 990e84740e1022955d7dd8957ce9131602536a63
2020-05-19 19:37:57 -07:00
Yang Chi
cd7339e454 Give caller some control over if writeStreamFrameHeader should write length
Summary:
Becuase when we clone an existing packet, the logic inside the current
writetStreamFrameHeader is no longer correct.

Reviewed By: mjoras

Differential Revision: D21383828

fbshipit-source-id: 8e6bbb048eefd97ca7cf17b89edc2f395f274a73
2020-05-07 10:56:26 -07:00
Matt Joras
50d5c29346 Cipher dropping take 2
Summary:
Now we won't have a zero PTO and we will properly clear out the outstanding packets.

Note that this cipher dropping is not what the draft prescribes, instead dropping both the initial and handshake ciphers when we know 1-rtt communication is functioning.

Reviewed By: yangchi

Differential Revision: D20388737

fbshipit-source-id: 0b89eb80c8faa796ab09eda3eaa10a00dcf7bae9
2020-05-06 11:14:20 -07:00
Matt Joras
d83d7f3024 Change default zero rtt matching policy
Summary:
This is a safer default than allowing limited on the source address not matching.

While here, also change the attemptEarlyData setting to false, since 0-rtt should be opt-in.

Reviewed By: yangchi, JunqiWang

Differential Revision: D21383402

fbshipit-source-id: b60fbbbe9438861eea894cb11ccb8bae2243a174
2020-05-04 14:45:47 -07:00
Yang Chi
2a1529068d Move Quic packet header encoding out of builder constructor
Summary:
Currently the packet builder contructor will encode the packet
builder. This is fine when the builder creates its own output buffer. If later
on we decides not to use this builder, or it fails to build packet, the buffer
will be thrown away. But once the builder uses a buffer provided by caller, and
will be reused, we can no longer just throw it away if we decide not to use
this builder. So we have to delay the header encoding until we know we will use
the builder.

This is still not enough to solve the case where we want to use this builder,
it builds, then it fails . For that, we will need to retreat the tail position
of the IOBuf.

Reviewed By: mjoras

Differential Revision: D21000658

fbshipit-source-id: 4d758b3e260463b17c870618ba68bd4b898a7d4c
2020-04-28 22:14:21 -07:00
Matt Joras
f795324507 Manually backout remove recvmsg polling.
Summary: We may have a bug in recvmmsg usage, so keep this around.

Reviewed By: lnicco

Differential Revision: D21246413

fbshipit-source-id: e39d74b8e856339d0022ba403969b83dc29ff63f
2020-04-25 15:29:45 -07:00
Matt Joras
fcc6efe68d Remove recvmsg polling.
Summary: This is essentially duplicated code, as if recvmmsg is not available the netops wrapper will simulate it with multiple calls.

Reviewed By: yangchi

Differential Revision: D21150890

fbshipit-source-id: 0e48e8a80f4ddc90df69c3e57cecc96dbc3f0913
2020-04-21 23:29:04 -07:00
Aman Sharma
a84d2e5fcb Make client use new stateless retry
Summary: This makes the change for the client to use stateless retries

Reviewed By: mjoras

Differential Revision: D19657433

fbshipit-source-id: d4b34087d15e49153860a7833ed54e28c6cd6777
2020-04-08 20:58:41 -07:00
Aman Sharma
918574c6eb Functionality to verify retry integrity token
Summary: This adds the ability to verify the integrity token present in a retry packet, as per section 5.8 of the QUIC-TLS draft (https://fburl.com/kw9l8dvu). This doesn't change any existing functionality.

Reviewed By: mjoras

Differential Revision: D19631864

fbshipit-source-id: 2ff8288986b3e27c85fe885b132ab6753fed3be8
2020-04-08 13:07:14 -07:00
Amaury Séchet
fb0b6b1cc4 Move fizz specific part of the client in quic/fizz/client (#120)
Summary:
This create a separate library for the fizz client. This allows complete separation of the fizz part of the client, and make it swapable for something else.

Depends on https://github.com/facebookincubator/mvfst/issues/118
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/120

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

 ---
## Proxygen Canary
Traffic Canary: https://our.intern.facebook.com/intern/traffic/canary?fbid=528194164778784
* elb.prod.muc2c01 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/ywntlz9n
* flb.prod.fceb2c02 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/ns1vzm1j
* olb.prod.ratn0c01.p2 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/0vxebqop
* slb.prod_regional.rnao0c00 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/a8syav0w
* slb.regional.rvll0c01.p2 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/igneyshj
 ---

Reviewed By: mjoras

Differential Revision: D20769060

Pulled By: yangchi

fbshipit-source-id: ad5d66c23b3a9723ad3f8c8091981df99339761e
2020-04-06 11:43:31 -07:00