1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-09 20:42:44 +03:00
Commit Graph

55 Commits

Author SHA1 Message Date
Yang Chi
d7d19c74b5 Stop tracking pure ack packets in Quic
Summary:
Previously we track them since we thought we can get some additional
RTT samples. But these are bad RTT samples since peer can delays the acking of
pure acks. Now we no longer trust such RTT samples, there is no reason to keep
tracking pure ack packets.

Reviewed By: mjoras

Differential Revision: D18946081

fbshipit-source-id: 0a92d88e709edf8475d67791ba064c3e8b7f627a
2019-12-12 13:20:09 -08:00
Subodh Iyengar
d2fa2cbcd6 process multiple packets on recvmsg
Summary:
In the current client code we read one packet, go back to epoll, and then read
another packet. This is not very efficient.

This changes it so that we can read multiple packets in one go from an epoll
callback.

This only performs changes on the client

Reviewed By: mjoras

Differential Revision: D18797962

fbshipit-source-id: 81be82111064ade4fe3a07b1d9d3d01e180f29f5
2019-12-04 12:04:10 -08:00
Aman Sharma
69ac8aeb62 De-templatize stream state machine logic
Summary: The state machine logic is quite abstruse, this modifies it to make it more readable.

Reviewed By: siyengar

Differential Revision: D18488301

fbshipit-source-id: c6fd52973880931e34904713e8b147f56d0c4629
2019-11-19 20:18:11 -08:00
Matt Joras
61004ba72c Move some maps/sets structures to F14 maps and sets.
Summary:
F14 should be faster and have lower memory urilization for near-empty sets and maps. For most H3 connections these are mosotly going to be near-empty, so CPU wins will likely be minimal.

For usecases that have extremely high numbers of streams, there are likely going to be CPU wins.

Reviewed By: yangchi

Differential Revision: D18484047

fbshipit-source-id: 7f5616d6d6c8651ca5b03468d7d8895d1f51cb53
2019-11-18 10:29:58 -08:00
Viktor Chynarov
45e71f737a Add QLog events for ConnMigration, PathValidation
Summary:
QLogConnectionMigrationEvent:
Allow observing client-side ConnectionMigration attempts (replacing the
socket), and observing the server-side changing the peer address it
is writing to.

QLogPathValidationEvent:
Allow observing successful/failed path validation attempts.
Success is considered as a correct PathResponse being returned.
A Failure is only published on the timeout expiring, not an invalid
PathChallenge frame being returned (we do not cancel this).

There are already QlogEvents for PathChallenge/PathResponse that
can be observed.

Reviewed By: JunqiWang

Differential Revision: D18340999

fbshipit-source-id: 512108f82a6e082021c0bd3254f108c128b17ba3
2019-11-08 08:39:36 -08:00
Huzefa Zakir
42bfa9dc4a Limit Quic PacketNumber to 2^62 -1
Summary: inspect PN, and when it reaches 2^62 -2 trigger a transport close through a pending event.

Reviewed By: yangchi

Differential Revision: D18239661

fbshipit-source-id: 1a218678099016693149e12ff121e2a39b95aecc
2019-11-06 19:35:45 -08:00
Yang Chi
fc828aa32b make it possible to set Quic initial RTT via TransportSettings
Summary: as title

Reviewed By: sharma95

Differential Revision: D18225812

fbshipit-source-id: 4ce0561fd7fbc31b61818d42f9f7efa31ad0b191
2019-10-31 21:51:55 -07:00
Konstantin Tsoy
0221421c3d Enable pacing when CC is changed to BBR
Summary: Enable pacing when CC is changed to BBR

Reviewed By: yangchi

Differential Revision: D18231888

fbshipit-source-id: a54b6313d089c2ae24ce6bf6ee56c4fe0d6b4722
2019-10-31 11:19:17 -07:00
Alan Frindell
8b8131450e Remove pause/resume on session level buffer
Summary:
We currently pause all producers if the sum of the egress buffers of all transactions exceeds the write buffer limit.  This turns out to be deterimental to prioritization.

Now, we pass the underlying transport pause state or connection flow control state back to the handlers.  The previous diff in this stack introduces a per-stream buffer limit (64kb default).  To limit total session buffer size, limit the number of concurrent streams or lower the per-stream limit.

Reviewed By: lnicco

Differential Revision: D17097138

fbshipit-source-id: 9025c5be8b318963311c3aaad9ee9a03c0e2265e
2019-10-28 16:46:20 -07:00
Raghu Nallamothu
e06c0848e0 T24905463 - [quic][ping] Implement ping in Quic
Summary: Implement ping functionality in ping

Reviewed By: yangchi

Differential Revision: D17885286

fbshipit-source-id: 4c328d14a023057d6889818250c0129c06e60874
2019-10-21 17:07:12 -07:00
Subodh Iyengar
8ad7d05693 use custom variant type for errors
Summary: Use the custom variant type for errors.

Reviewed By: yangchi

Differential Revision: D17826935

fbshipit-source-id: 2bf0c3e1cc8ca84b504d201fd6c2a4266878b715
2019-10-09 22:37:40 -07:00
Nitin Garg
95d02afb2b Expose CC type in transport info
Summary:
CC Type is not exposed anywhere else. This could be the source of truth and will be useful for logging.
Also added a helper to convert the enum to string.

Reviewed By: yangchi

Differential Revision: D17566664

fbshipit-source-id: 1e0e887a7c23617b174b240f5c636f6dcdfd42c4
2019-10-01 15:46:52 -07:00
Yang Chi
e9fa2d05f3 Guard QuicConnectionStateBase::DebugState value updates with
Summary: Only update DebugState values when LoopDetectorCallback is present.

Reviewed By: mjoras

Differential Revision: D17486165

fbshipit-source-id: ce88fc66318b9d603fe4b93d865ba307fe9b9d2b
2019-09-23 21:38:34 -07:00
Yang Chi
0597c7bf18 Replace kMinAckTimeout with timer tick interval
Summary:
Currently the lower bound of ack timeout is kMinAckTimeout which is
10ms. This diff changes to use timer's tick interval as lower bound. For the
timer we use today (the default HHWheelTimer), this is a no-op change since the
tick interval is also 10ms.

Reviewed By: mjoras

Differential Revision: D17421600

fbshipit-source-id: 073ac6a8e5d84dbdfc00e8e95ff13be26adb1684
2019-09-21 07:44:04 -07:00
Matt Joras
72e677df33 Send windowed stream limit updates
Summary:
Implement sending stream limit updates in a windowed fashion, so that as a peer exhausts its streams we will grant it additional credit. This is implemented by having the stream manager check if an update is needed on removing streams, and the api layer potentially sending an update after it initiates the check for closed streams.

This also makes some driveby changes to use `std::lower_bound` instead of `std::find` for the sorted collections in the stream manager.

Reviewed By: yangchi

Differential Revision: D16808229

fbshipit-source-id: f6e3460d43e4d165e362164be00c0cec27cf1e79
2019-09-18 11:33:03 -07:00
Luca Niccolini
6efcef720f export current mss in transportinfo
Summary:
we were not setting the MSS.
populate it from the transport, compute the cwnd appropriately and check the netquality header

Reviewed By: yangchi

Differential Revision: D17385975

fbshipit-source-id: 3666728c48d3fc7a65827d526fbdd546449b2e1f
2019-09-16 10:41:36 -07:00
Luca Niccolini
9349ce935a Allow overriding the transport drain on close
Summary:
This is important in production, but not necessarily for standalone clients.
The transport drain feature is functionally similar to tcp TIME_WAIT, with the
difference that with a userspace transport implementation that forces a client
application to wait for that timeout before it can shutdown

Reviewed By: mjoras

Differential Revision: D17271443

fbshipit-source-id: db5d9e79f175aa86cd9ca8a8a2181b5e80c1d0e8
2019-09-09 16:26:00 -07:00
Yang Chi
a0a4ba3c9b Add a pure getter function to retrieve most recent Pacer write batch size
Summary:
When apps interested in such info retrieve it, it would be bad if we
update the value and mess up the timer drift. So this diff adds a pure getter
function.

Reviewed By: mjoras

Differential Revision: D16918673

fbshipit-source-id: c4954b2f7e3a1d53ec0e6491ef1a25e8f53f1744
2019-08-30 19:30:44 -07:00
Yang Chi
c0a659a30a Replace pacing related callsites with new Pacer interface
Summary:
Use the new Pacer interface in the transport where we currently
directly use CongestinoController interrace for paciner related APIs.

Reviewed By: mjoras

Differential Revision: D16918672

fbshipit-source-id: 410f72d567e71bdd3279e344f6e9abf5e132518e
2019-08-30 19:30:44 -07:00
Yang Chi
a4878434b6 Remove minimal pacing interval tracking in Quic congestion controllers
Summary:
Second try of this diff. This time after the fix of uninitizlied
default constructed std::chrono::duration values in BBR and Copa.

Currently each conegstion controller maintains this value while
TransportSettings also has this value. But currently there is no way they are
in sync. The timer uses the value in TransportSettings. So the value maintained
by each congestion controller isn't used except for tracing, but that also make
tracing wrong.

Reviewed By: oesh

Differential Revision: D16985568

fbshipit-source-id: 5fbd9fee4deec5177b92c733a159e0ba9bfd2289
2019-08-29 13:46:41 -07:00
Andrew Krieger
ea1a33b903 Misc fixes for building on Windows
Summary:
Mostly need a bunch of folly::assume_unreachable() (sometimes
replacing __builtin_unreachable()). One place using designated initializers
that had to get commented out. Some headers replaced with folly portability ones.

Reviewed By: mzlee, phoad

Differential Revision: D16970520

fbshipit-source-id: 1b8a36ecb1975e2dc0869b66c4ea5439baf7575d
2019-08-26 22:56:55 -07:00
Bonnie Xu
851c374518 Small fixes
Summary: Small fixes to qlog.

Reviewed By: sharma95

Differential Revision: D16966786

fbshipit-source-id: 7b85a85c218e3a827794c53352acd33cdf96af92
2019-08-22 17:52:20 -07:00
Yang Chi
a4b15010dc Back out "Remove minimal pacing interval tracking in Quic congestion controllers"
Summary: Original commit changeset: 71800e5dc1f9

Reviewed By: lnicco

Differential Revision: D16951701

fbshipit-source-id: 9f6b339bbcc7f1236a62ec842acfc6c8676a751d
2019-08-22 09:06:47 -07:00
Yang Chi
a9305ebbe1 Remove minimal pacing interval tracking in Quic congestion controllers
Summary:
Currently each conegstion controller maintains this value while
TransportSettings also has this value. But currently there is no way they are
in sync. The timer uses the value in TransportSettings. So the value maintained
by each congestion controller isn't used except for tracing, but that also make
tracing wrong.

Reviewed By: mjoras

Differential Revision: D16772744

fbshipit-source-id: 71800e5dc1f9fce8df4b1f72ce5aa5cfd15fbc89
2019-08-19 09:14:08 -07:00
Bonnie Xu
db349541f2 Update qlog format to be more complete
Summary: Update qlog format to be more complete. Adding the summary section (with extra fields like title, description, etc). This diff is just to make the format more on par with Robin's schema.

Reviewed By: mjoras

Differential Revision: D16499808

fbshipit-source-id: 56cfbb95404f7e3c6638bffda18b53f7d83048a1
2019-07-30 12:48:57 -07:00
Bonnie Xu
0929100b18 Add transportStateUpdate event
Summary: Add transportStateUpdate event so it can be part of qlog.

Reviewed By: mjoras

Differential Revision: D16342467

fbshipit-source-id: 109189275d44996850b82646bab4a733a3a4c7a1
2019-07-25 11:52:19 -07:00
Junqi Wang
228b80b1a8 Make AppTokenValidator::validate const
Summary: prevent application from changing state

Reviewed By: knekritz

Differential Revision: D16448292

fbshipit-source-id: f1c065eec8556a5dd6ef75b2466b761beee82a40
2019-07-25 11:52:18 -07:00
Junqi Wang
e92672d7ee Stateless API for APP to validate/write 0-RTT params
Summary:
Previously we tried to put this API in connectionCallback, but that has
some lifecycle problem. So we decided to make this API independent of mvfst's
state. Application (e.g. HTTP/3, QPACK) will have to either make the 2 functions
stateless or maintain the lifecycle of any captured objects.

Reviewed By: afrind, lnicco

Differential Revision: D16074471

fbshipit-source-id: b0a3baa6870bee56372797754972ab5c2c1f2232
2019-07-19 08:54:37 -07:00
Yang Chi
2a97d4533c Quic busy write loop detector
Summary:
This diff adds a DebugState in the QuicConnectionState to track the
reason we schedule transport WriteLooper to run, the reason we end up not
writing and the number of times such write happens consecutively. And when it
reaches a predefined limit, we trigger a callback on a loop detector interface.

Reviewed By: kvtsoy

Differential Revision: D15433881

fbshipit-source-id: d903342c00bc4dccf8d7320726368d23295bec66
2019-07-17 15:18:57 -07:00
Bonnie Xu
e63322df0a Add TransportSummary event to Quic
Summary: Add TransportSummary event to Quic, so it can be logged as part of qlog.

Reviewed By: mjoras

Differential Revision: D16116127

fbshipit-source-id: ddfecac5b5452fe9b2e3df87b152561eab903188
2019-07-12 09:43:46 -07:00
Bonnie Xu
ff1c36c25a Added ConnectionClose event to Quic
Summary: Added ConnectionClose event to Quic.

Reviewed By: sharma95

Differential Revision: D16097522

fbshipit-source-id: c46d63ac75246ad93a3c617383f1b9a26d0e0b4f
2019-07-12 07:05:40 -07:00
Bonnie Xu
0e6d95e910 Outputting QLogs to a file for HQClient.
Summary: Send stored QLogger logs to a file [for the client].

Reviewed By: sharma95

Differential Revision: D15837102

fbshipit-source-id: e61dac2b17bd488ac35202764d8ec64353330f26
2019-06-26 08:46:14 -07:00
Nitin Garg (MPK, Infra)
92a68aa968 Add pacing information to QUIC TransportInfo
Summary: This is useful information for the application to know about

Reviewed By: yangchi

Differential Revision: D15599964

fbshipit-source-id: da451f46238f68fe701d6f433701c569cfe2f47d
2019-06-07 22:02:58 -07:00
Akshay Narayan
7d58058b8f QuicTransportBase: Allow notifyPendingWriteOnStream (#18)
Summary:
When a write callback x is already defined for a stream
and notifyPendingWriteOnStream is called with the same callback x,
it is safe to not return an error.

Building on master is currently broken due to 2040a13e40 (diff-ddd35d436da215e41b89fd5afe4acebbR11), but this commit builds when rebased before that.

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

Reviewed By: yangchi

Differential Revision: D15562893

Pulled By: afrind

fbshipit-source-id: 44e62bb9bb0002508257acdc419f20bcb973ca64
2019-06-05 16:55:25 -07:00
Nitin Garg (MPK, Infra)
559103f399 Add bytesAcked to QUIC
Summary: bytesAcked is a very useful stat for apps to know. Bytes written only tells me that data was written to socket but it may not have been acked.

Differential Revision: D15507105

fbshipit-source-id: 656ee45418a78c7e05d8e7979afa2c9a41976e85
2019-05-25 11:55:17 -07:00
Yang Chi
1dbe39fd76 Separate app-limited and app-idle
Summary:
Current app-limited is defined as the connection doesn't have a no
non-control stream. I'm changing this to be app-idle. And app-limited will be
changed to a state in connection where app isn't sending bytes fast enough to
keep congestion controller probing higher bandwidth.

Reviewed By: mjoras

Differential Revision: D15456199

fbshipit-source-id: e084bc133284ae37ee6da8ebb3c12f505011521e
2019-05-24 12:16:09 -07:00
Omer Shapira
3099d621af fix to peek API
Reviewed By: lnicco

Differential Revision: D15415966

fbshipit-source-id: 50363c4d6289d27e772cab5000bb387926c96db0
2019-05-22 20:02:09 -07:00
Bonnie Xu
f4ae0a1efd Updated files to change syntax.
Summary: Changed existing chrono syntax to chrono_literals syntax.

Reviewed By: mjoras, sharma95

Differential Revision: D15374649

fbshipit-source-id: 40033e90cca226266ef85e4fec629f290bc5dae6
2019-05-20 12:10:46 -07:00
Yang Chi
ca31b43564 rename timeoutBasedRetxCount to timeoutBasedRtxCount
Summary: Just to make it consistent with other var names in quic

Reviewed By: siyengar

Differential Revision: D15415528

fbshipit-source-id: 917159d6ccf86cf34612386d128d6b6d5bf62de6
2019-05-20 11:22:24 -07:00
Junqi Wang
48b3490455 Move path validation canceled VLOG inside if block
Summary: better logging

Reviewed By: udippant

Differential Revision: D15412201

fbshipit-source-id: 8ef8d5f18b9dccd1d3180772f4599f37e332344d
2019-05-20 03:34:26 -07:00
Luca Niccolini
03d1efac7d Revert D14757064: [quic] Fix peek callback
Differential Revision:
D14757064

Original commit changeset: bb1e43762f54

fbshipit-source-id: 9855ea175179b9652e0ec9e0a649769a60268600
2019-05-16 18:36:52 -07:00
Konstantin Tsoy
ea0fb07be1 Fix peek callback
Summary:
Peek callback wasn't raised on data arrival. The fix is to:
* always update peek looper before read looper
* always update `peekableList` together with `readableList`

Differential Revision: D14757064

fbshipit-source-id: bb1e43762f54d024050eced425351f03a0cffd9f
2019-05-16 12:22:14 -07:00
Subodh Iyengar
408a2b8a09 Gate QuicLogger to server only
Summary:
Using FOLLY_MOBILE macro to be able to exclude
quic trace generation on mobile

Reviewed By: mjoras

Differential Revision: D14609755

fbshipit-source-id: 2d5d624703a5b58c28cb533e3c2cc20d3a5c3d45
2019-05-10 15:59:11 -07:00
Matt Joras
b2e1eedfd3 Mostly remove version negotiation
Summary:
Draft-19 onwards effectively punted version negotiation to QUICv2. Now receiving version negotiation on clients is treated as an immediate termination of the connection.

The transport parameter format has also changed to no longer include any reference to the QUIC version. To avoid us (Facebook) having to turn off QUIC traffic in production, our server needs to be able to parse these transport parameters from our older clients. To achieve this when parsing the transport parameters we will, as a temporary measure, check for the Facebook QUIC version to determine which transport parameter format we are parsing. Luckily for us the version we chose maps nicely to an implausible length for the transport parameters (0xface).

Note that this diff still has the client send the old transport parameter format, so that the rollout can be staged.

Reviewed By: yangchi

Differential Revision: D15203481

fbshipit-source-id: dfaaddc3acc76434461b04430b82a0902138c060
2019-05-10 12:55:28 -07:00
Subodh Iyengar
0509b068b4 Use find instead of count for readable streams
Summary:
Use find instead of count. We just need to know whether one exists, count will go through
all the elements instead which is a waste

Reviewed By: sharma95

Differential Revision: D15270589

fbshipit-source-id: f85780f524f6534b0b240162b60b7c7d72c0df85
2019-05-08 19:16:40 -07:00
Yang Chi
c35e3d6e84 Rename RTO to PTO
Summary: To conform to the current specs.

Reviewed By: mjoras

Differential Revision: D15215018

fbshipit-source-id: 4dcc495aea1cd7cebf2bc84f7367cb2e4a55df19
2019-05-06 18:50:35 -07:00
Subodh Iyengar
1d9e4034c9 Fix app limited to account for peer created streams
Summary:
Previously updateAppLimited was not accounting for peer created streams.
This moves app limited accounting into the stream manager

This also makes a subtle change to the applimited callback. We assume that
we start off as not app limited now, so if we create a stream we will not call
the congestion controller app limited callback.

Reviewed By: mjoras

Differential Revision: D15166114

fbshipit-source-id: 1a8d573533861f53bb1bd9fdc605dfefe68902dc
2019-05-06 15:58:49 -07:00
Alan Frindell
a122063d22 Add helper to send a reset from a readError
Summary: The previous diff removed automatically sending a rst stream when receiving a reset stream.  This adds a helper to do that from the application layer.

Reviewed By: mjoras, pkir

Differential Revision: D15208997

fbshipit-source-id: b8d3898e85537e97df61cc66854299698a48c825
2019-05-06 14:05:32 -07:00
Alan Frindell
90e5e1b3f1 Split stream state machine into send and receive state machines
Summary: This is step 1 for removing reset on reset, since the send side may need to transition to waiting for a reset ack while the read side is an any state.

Reviewed By: lnicco

Differential Revision: D15075849

fbshipit-source-id: 1e094942a8a1ca9a01d4161cd6309b4136a9cfbf
2019-05-06 14:05:31 -07:00
Aman Sharma
85fc503506 TRIP logging QUIC fields
Reviewed By: udippant

Differential Revision: D14627382

fbshipit-source-id: 573582a2936ffce31b12648c4ecea09ed59befbf
2019-05-06 12:15:38 -07:00