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

20 Commits

Author SHA1 Message Date
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