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

83 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
9cea11f2bd QuicServerWorker rejects CID already present in CID Map
Summary:
The CID Algo can possibly generate a CID that's already in the map.
This diff adds a mechanism to reject such CID and try another one.
ServerStateMachine will loop encoding CIDs until either QuicServerWorker no
longer rejects, or encode fails

Reviewed By: udippant, vchynarov

Differential Revision: D20251043

fbshipit-source-id: a38e4e8b33007779a9710c32057d47f32f7d1774
2020-03-09 16:06:22 -07:00
Matt Joras
61cd1a7289 Back out "Implement handshake done and cipher dropping."
Summary: This caused an increase in client errors.

Reviewed By: yangchi, lnicco

Differential Revision: D20186386

fbshipit-source-id: 737122a94c97498efba61292a6c292cfe482925c
2020-03-01 18:31:40 -08:00
Matt Joras
2b3b76cc4d Remove support for MVFST_OLD.
Summary:
This eliminatees some tech debt by completely removing the notion of version from the core transport parameters structure and the app token for zero rtt.

Note that for the draft-27 changes we will need to temporarily re-introduce it, but to a different layer (the extension encoding itself).

Reviewed By: JunqiWang

Differential Revision: D20073578

fbshipit-source-id: 2b55af621566bf1c20e21dd17251116de1788fa0
2020-02-28 09:52:34 -08:00
Matt Joras
472e40a902 Implement handshake done and cipher dropping.
Summary: This implements the handshake done signal and also cipher dropping.

Reviewed By: yangchi

Differential Revision: D19584922

fbshipit-source-id: a98bec8f1076393b051ff65a2d8aae7d572b42f5
2020-02-27 12:25:52 -08:00
TJ Yin
a396f62335 Replace folly::Optional::hasValue() by has_value()
Differential Revision: D19882830

fbshipit-source-id: 031217f9890351022bc8d171f0ccd7e045dd6972
2020-02-26 08:40:44 -08: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
Luca Niccolini
90f0aa9665 add advertisedInitialMaxStreamsBidi and advertisedInitialMaxStreamsUni to transport params
Reviewed By: JunqiWang

Differential Revision: D19718461

fbshipit-source-id: 2a51f8e6c88663deb3a0d85402b53a9e3c1ffe61
2020-02-04 09:24:34 -08:00
Yang Chi
2405111e88 New QuicSocket::ConnectionCallback for first peer packet processed
Summary: as title

Reviewed By: JunqiWang

Differential Revision: D19434037

fbshipit-source-id: 7f2b6491fcce68840dc6ff57f99657dd5d535e9f
2020-01-18 13:36:04 -08:00
Anton Frolov
1482011db5 Remove UNLIKELY and LIKELY calls from mvfst
Summary:
All instancesi of LIKELY and UNLIKELY probably should be removed. We will
add them back in if we see pathologies in performance profiles.

Reviewed By: mjoras

Differential Revision: D19163441

fbshipit-source-id: c4c2494d18ecfd28f00af1e68ecaf1e85c1a2e10
2020-01-06 17:44:07 -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
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
Viktor Chynarov
3a6dfb73c3 Fix naming of self/peer active_connection_id_limit parameters [1/2]
Summary:
It was hard to understand which names refer to which limits.

This diff makes it simple:
* conn.transportSettings.selfActiveConnectionIdLimit
represents how many of its peer's connection ids it will hold. It sends this to
the peer as the active_connection_id_limit
* conn.peerActiveConnectionIdLimit represents the value the peer sends as its
active_connection_id_limit. This should be defaulted to 0 and only changed
when we receive the transport parameters

Reviewed By: udippant

Differential Revision: D18531733

fbshipit-source-id: 53709ccaa58f835fd654ac28cdd740be46e65289
2019-11-20 08:46:56 -08:00
Viktor Chynarov
f2e09a4ab8 Server to issue up to 7 more conn ids on handshake finish [3/x]
Summary:
Use the helper function from earlier to create new connection id with sequence
number, and stateless reset token.

Add each of those new connection ids to the routing callback. Add a CHECK()
for routingCallback, because it should be set.

Add a new parametrized set of tests, to test the value of the
active_connection_id_limit transport parameter sent from client.

Reviewed By: yangchi

Differential Revision: D15178642

fbshipit-source-id: 37b4879b09a47d371100c7ac0ab4f01130245715
2019-10-28 17:46:59 -07:00
Viktor Chynarov
fb39e9c520 Issue initial server conn id using helper [2/x]
Summary:
Using the helper introduced in the previous diff, we replace generating the
initial server connection id, adding it to the selfConnectionIds, and
generating the initial stateless reset token.

Reviewed By: yangchi

Differential Revision: D18066595

fbshipit-source-id: f37450eecf0926ec145bc7a7194f2a1651cae024
2019-10-28 17:46:58 -07:00
Viktor Chynarov
3dd52b323a Create helper to generate server-side connection id [1/x]
Summary:
My goal in this stack is to properly support the functionality of issuing new
connection ids.

There are at least three cases in which this is done (server-side):
* generate initial server connection id based on host id parameters
* provide several NewConnectionId frames to the client (for use with
   migration) after handshake
* responding to RetireConnectionIdFrame and issuing more NewConnectionId frames
  as needed

**Changes**:
* move connIdAlgo away from parent ConnectionStateBase to just
  QuicServerConnectionState
* create virtual function in ConnectionStateBase to generate
  folly::none ConnectionIdData by default,
  and server subclass will generate a new server id
* add unit tests to test this behaviour.

Intended for Junqi's diff of server issuing 7 new connection ids
to be rebased on this (D15178642)

Reviewed By: yangchi

Differential Revision: D17840780

fbshipit-source-id: 1a01077742d01d058eb0a726c4c9c44e39eafb24
2019-10-28 17:46:58 -07:00
Viktor Chynarov
0ba3b6517b Ensure server/client conn ids are synced to self/peer connIdData
Summary:
Everytime a client/server sets a client/server conn id, it adds it to the
respective self/peer connection id data collections.

Reviewed By: sharma95

Differential Revision: D17577333

fbshipit-source-id: de8b887c1f3acb142c070727fb98ca0841337369
2019-10-11 14:56:29 -07:00
Viktor Chynarov
27536bc1e4 Delete all transport connIds from server connIdMap on unbound [3/3]
Summary:
This diff is the one that introduces+passes the test of multiple server conn
ids routing to a single transport.

Currently, there is still only one time in non-test code that more than one
server connection id is added. This diff ensures when we call connectionUnbound
we remove all associated connection ids.

Reviewed By: udippant

Differential Revision: D17479563

fbshipit-source-id: 8d0ebbf26251f7bef44cdea53dfd4ff93ab465ae
2019-10-09 08:25:07 -07:00
Viktor Chynarov
2bd01800f3 Use set of transports instead of connIdMap for server shutdown [2/x]
Summary:
Currently, there is a 1:1 relationship between conn Id and transports. So for
all connections with a bound connection id, we iterate over all
connectionIdMap_ entries and delete the associate transport.

This won't work if connectionIdMap_ will map multiple conn ids to a single
transport.

Reviewed By: JunqiWang

Differential Revision: D17456965

fbshipit-source-id: 8923540abf205cfd10ad09d637e8c05790b4acf9
2019-09-27 07:57:44 -07:00
Viktor Chynarov
0c836629cf Support for server routing multiple conn ids [1/x]
Summary:
Add new data structure, `ConnectionIdInfo` which is will store
ConnectionId, folly::SocketAddress, and uint64_t sequenceNumber.

Add `addConnectionId()` method to QuicServerTransport, which will both
create+add a `ConnectionIdData` object to `ServerConnectionIds` and
call `routingCb_->onConnectionIdAvailable`.

Add a matching-source address check in QuicServerWorker when matching
based on ConnectionId.

Update QuicServerTest to test for change of address on one conn id.

Right now the semantics (apart from dropping mismatched source addresses
on the same connection id) are the same. Only one conn id can ever be added.

After this, we need to allow the QuicServerWorker to
hold a list of transports. Right now, `shutdownAllConnections()` works
because the mapping of conn Id<->transport is 1:1.

Reviewed By: JunqiWang

Differential Revision: D17427573

fbshipit-source-id: 47b34d722fce8b48a5e185b0aeb05624a4fb8e94
2019-09-26 14:37:27 -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
Viktor Chynarov
b9bbc0d858 Remove clientConnId from ServerConnIdParams
Summary:
This parameter duplicates the one in the QuicConnectionStateBase.

It is set everywhere the canonical one is, and it isn't used directly in any
manner that is separate from QuicConnectionStateBase::clientConnId.

This diff changes the following:

 * removed clientConnId from ServerConnIdParams
 * add setter to directly initialize clientConnId on the transport from the
   connection
 * update tests

Reviewed By: udippant

Differential Revision: D16711180

fbshipit-source-id: 63e667aa0df8a79757f18fb3ffc178c7c9613e1a
2019-08-19 15:04:14 -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
d780af1a67 Use new API to validate app params
Summary: validate app params (H3) with new API, server side

Reviewed By: mjoras

Differential Revision: D16228821

fbshipit-source-id: e97e4425e9ca7316c92f0e646902c63dd46374f8
2019-07-19 08:54:38 -07:00
Junqi Wang
5fc6ddec84 Use new API to read app params for NewSessionTicket
Summary: Use the new static API

Reviewed By: lnicco

Differential Revision: D16226829

fbshipit-source-id: 11f79ea2a2866bfbd85f2f1e344c80ca65120dd8
2019-07-19 08:54:38 -07:00
Matt Joras
2f528e68c0 Draft-22 invariants change
Summary:
Draft-22 onwards uses two one byte length fields to encode connection ID length instead of one one byte length field.

To support this without disrupting existing clients we need to make our parsing version dependent. This diff accomplishes it by special casing the existing Facebook client QUIC version (0xfaceb000), and changing the default Facebook client version going forward to 0xfaceb001.

Note that this diff also changes the behavior of the ticket transport parameters. When we changed from draft-18 to draft-19 transport parameters I apparently forgot to update the ticket transport parameters to the new format.

Reviewed By: yangchi

Differential Revision: D16205090

fbshipit-source-id: e74a92fa959d308f4bb43bad76e58d4b58d07322
2019-07-16 17:59:58 -07:00
Amaury Séchet
f4e90017a3 Add mvfst specific encryption level (#26)
Summary:
This ensure a lot of code do not depend on fizz anymore.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/26

Reviewed By: mjoras, JunqiWang

Differential Revision: D16030663

Pulled By: yangchi

fbshipit-source-id: a3cc34905a6afb657da194e2166434425e7e163c
2019-06-27 14:09:04 -07:00
Bonnie Xu
2762cc1597 Setup stateless reset token
Summary: Replace hard coded stateless reset token with a token from the stateless reset token generator.

Reviewed By: yangchi

Differential Revision: D15481858

fbshipit-source-id: 30c96843c38c616600466b2fabb6defd5fcc5799
2019-06-13 08:44:53 -07:00
Junqi Wang
92b8876ebf Update 0-rtt ticket transport params to d-20
Reviewed By: mjoras

Differential Revision: D15293208

fbshipit-source-id: 4ea5bf6c2c335a5c034341086f9348451bed827e
2019-05-10 16:19:43 -07:00
Subodh Iyengar
166d881316 avoid copy with destination connid
Summary:
value_or seems to copy the connectionid. This changes it so that we avoid the
copy in frequently called places.

Reviewed By: yangchi

Differential Revision: D15300395

fbshipit-source-id: 4b2098cf624b748c5c3158f27777fd7435a823d0
2019-05-10 15:59:11 -07:00
Udip Pant
f6e5cb9e14 T43271780 - Remove state machine from ServerStateMachine-inl.h
Summary:
1. removed ServerStateMachine-inl.h
2. Changed ServerState to enum
3. Removed QuicServerStateMachine
4. Introduced onServerReadData and on onServerClose which replace the state machine handlers

Reviewed By: siyengar

Differential Revision: D15042529

fbshipit-source-id: a34f841a8e6b17e625506fd9b4ccad81d9c04891
2019-04-30 18:34:38 -07:00
udippant
50d4939e9e Initial commit of mvfst 2019-04-22 23:42:46 -07:00