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

25 Commits

Author SHA1 Message Date
Amaury Séchet
7a1b58e5e8 Move early app data params getter and validator to QuicConnectionStateBase (#117)
Summary:
This ensures they are available to the whole stack rather than the transport only. The validator needs it in the server case, and will soon need it in the client case, so that seems appropriate to make it available.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/117

Reviewed By: yangchi

Differential Revision: D20536366

Pulled By: mjoras

fbshipit-source-id: a76d369c0a82b9be1f985aed1f33f7a6b338a2ae
2020-03-23 10:55:01 -07:00
Yang Chi
fc41c9964f New QuicSocket API to unregister stream WriteCallback
Summary:
Currnetly there isn't a way for apps to unregister a pending
WriteCallbacks for a stream. resetStream() does that if the transport isn't in
Closed state. This diff adds such support even if transport is already in
Closed state. This solves the problem where app has a class that's both stream
ReadCallback and stream WriteCallback and readError would kill the callback
object itself. The new API gives such class a chance to remove itself from the
transport.

Reviewed By: mjoras

Differential Revision: D20545067

fbshipit-source-id: 81d9f025310769aadef062711a49adc47a0639d0
2020-03-19 22:25:18 -07:00
Amaury Séchet
e6e6196c86 Move the delayed destruction from Handshake to QuicConnectionStateBase
Summary: Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/88

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

 ---
## Proxygen Canary
Traffic Canary: https://our.intern.facebook.com/intern/traffic/canary?fbid=224323975233396
* elb.prod.ham3c01 - binary_asan - 2020-02-05 02:00 - https://fburl.com/dyndash/u2q12hwq
* elb.prod.mia3c02 - binary - 2020-01-31 09:40 - https://fburl.com/dyndash/vmv34rpa
* elb.prod.otp1c01 - binary - 2020-02-05 02:26 - https://fburl.com/dyndash/0zttm61b
* flb.prod.fath4c02 - binary - 2020-02-05 02:26 - https://fburl.com/dyndash/6o1nqsti
* flb.prod.fgye3c01 - binary - 2020-01-31 09:40 - https://fburl.com/dyndash/nu3i5ahw
* olb.prod.rfrc0c01.p2 - binary - 2020-01-31 09:40 - https://fburl.com/dyndash/c1o6hpqw
* olb.prod.rftw0c01.p2 - binary - 2020-02-05 02:26 - https://fburl.com/dyndash/xg6qbyru
* slb.prod_regional.rcln0c00 - binary - 2020-02-05 02:26 - https://fburl.com/dyndash/e4qkbzcz
* slb.prod_regional.rfrc0c00 - binary - 2020-01-31 09:40 - https://fburl.com/dyndash/j0yxofty
* slb.prod_regional.rrva0c00 - binary_asan - 2020-02-05 02:00 - https://fburl.com/dyndash/4hsg02uj
* slb.regional.rfrc0c01.p2 - binary - 2020-01-31 09:40 - https://fburl.com/dyndash/1njxzbgf
* slb.regional.rvll0c01.p2 - binary - 2020-02-05 02:26 - https://fburl.com/dyndash/056xdmzn
 ---

Reviewed By: lnicco

Differential Revision: D19551142

Pulled By: mjoras

fbshipit-source-id: b0d14146d14384b8c37887b3e9d8fed7d6181d88
2020-02-05 06:13:33 -08:00
Mirko Andjic
3f419b2eb2 Add vantage point to qlog.
Summary: Landing an outstanding diff

Reviewed By: yangchi

Differential Revision: D19261395

fbshipit-source-id: 437461222ff04f5c3271567d3bb064bceaf80029
2020-01-07 11:19:13 -08:00
Yang Chi
332b3c340c Use original server cid chosen by client for source addr based routing
Summary:
Currently, before server generate the destination CID, we route packets with client's address, port and client's source connection ID. But now that client can use 0-len source connection ID, the different connections from the same client address and port will be routed to the same server connections.

This diff changes it to use client's initial destination connection ID as part of the routing key.

Reviewed By: udippant

Differential Revision: D19268354

fbshipit-source-id: 837f5bd2f1e3a74957afacf7aabad922b1719219
2020-01-06 08:58:12 -08:00
Ammar Malik
98224facb6 Changing toString functions in QuicExceptions to return folly::StringPiece to avoid extra copy
Summary:
In QuicExceptions, in the case where the toString method was able to statically determine the response strings, we simply return the string literals in a folly::StringPiece instead of unnecessarily copying them into std::string.

Some toString methods had some dynamically generated responses and thus could not be updated. Added a TODO explaining the fact.

Reviewed By: mjoras

Differential Revision: D19192117

fbshipit-source-id: d9e5f202f9bf240009e8b8fd16f337b0506fbeb0
2020-01-02 14:30:48 -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
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
Konstantin Tsoy
4cf5ea0c1a Expose setCongestionControl() in QuicSocket interface
Summary: Expose setCongestionControl() in QuicSocket interface

Differential Revision: D18209094

fbshipit-source-id: 0b1336e92a032dce464ee559d2559cf132d700e3
2019-11-11 12:26:22 -08: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
Yang Chi
61a3c68470 Automatically set dcid into qlogger on client transports
Summary:
I think not doing this, and throw an error at the point of output to
files is kinda surprising to users

Reviewed By: sharma95

Differential Revision: D18016183

fbshipit-source-id: b16881b365ea82b75842f89dc364054804808116
2019-10-23 10:16:58 -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
Viktor Chynarov
ac053567e3 NewConnectionId frame handling
Summary:
Mainly based on Junqi's changes in D15230415

Added the start of several error checking. Section 19.15
of d-23
(https://tools.ietf.org/html/draft-ietf-quic-transport-23#section-19.15)
specifies 2 cases where PROTOCOL_VIOLATION should be thrown during processing:
* retire_prior_to is larger than sequence number
* new_connection_id is sent by peer using 0-len conn id (will handle later)

I don't think it was specified what happens if we get a NEW_CONN_ID frame
after the the endpoint already has enough of the peer's conn ids - just ignore
the frame.

Reviewed By: sharma95

Differential Revision: D17578167

fbshipit-source-id: 6e410b6110970a6e52970576ac3ff2b1c7d5c06a
2019-10-11 14:56:29 -07:00
Matt Joras
15fbe5106c Explicit stream frame types
Summary:
Prior to this we had an incorrect check for something being a stream frame. It technically should have worked for minimally encoded frame types, but would not work for a spec-incompliant frame type.

Instead of using a mask this makes it so each stream frame type is explicitly enumerated. This isn't as clean looking but is easier to validate as correct.

This also revealed some places where we were not correctly plumbing through the version for unit tests, so fixing those as a driveby.

Reviewed By: yangchi

Differential Revision: D16676631

fbshipit-source-id: 835dcc6e1f431bbe3fa4a5c6b8e616863c126155
2019-08-08 09:02:03 -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
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
Bonnie Xu
a6606f2a52 Setup logging in Quic based on QLogger
Summary: Setup logging in Quic based on QLogger.

Reviewed By: mjoras

Differential Revision: D15818340

fbshipit-source-id: 553aaedc6043a7f079c597ef0647c5b91f3033df
2019-06-24 09:45:45 -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
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
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
Konstantin Tsoy
6b49f4e42a Cancel delivery callbacks on skip
Summary:
For the sender, upon egress or ingress skip we must check registered
delivery callbacks and invoke `onCancel()` for each offset below the skipped
offset.

Reviewed By: mjoras

Differential Revision: D15113113

fbshipit-source-id: 221badce8e92abde48e8ab2c8f3c1da9e506f54e
2019-05-06 10:29:42 -07:00
udippant
50d4939e9e Initial commit of mvfst 2019-04-22 23:42:46 -07:00