Summary: no more surprises in upper layer
Reviewed By: mjoras
Differential Revision: D19976510
fbshipit-source-id: 3487e9aa2cb28d7bc748f13bc2bbc393216b4a8a
Summary:
The current shedding APIs in the transport would accept a new
connection and then immediately close it. This will fail the request and waste server resources.
This diff
removes all the Shedding functions from transport and let upper layer handle
it.
Reviewed By: udippant
Differential Revision: D19729902
fbshipit-source-id: 6daab5902235b6daa8d059b51cc1229d1042f892
Summary:
New QUIC draft no longer has this limitation for connection-id, and allows
connid of len 0 -> 20.
This diff removes the constraints. I still kept the requirement for
*server-chosen* conn-id
Reviewed By: mjoras, lnicco
Differential Revision: D19507366
fbshipit-source-id: 4c73f45617f40b29d47d2d86b7598f6c95588d0a
Summary:
rejectNewConnections() runs asynchronously. As such, it is not guaranteed to complete before the next line where client writes packets. As a result,
server sometimes rejects the connection
Reviewed By: lnicco
Differential Revision: D19356730
fbshipit-source-id: 6e2e6571937737f30da1a1ffdcefdb759a0e9a73
Summary:
The async nature of the set up results in flakiness in unit tests.
For example, in QuicServerTest::TakeoverTest, clients send packets to server
right after setup, such as start / stop packetForwarding or pauseReads()
On the other hand, making them synchronous should be fine, since these are
called only during startup
Reviewed By: yangchi
Differential Revision: D19343423
fbshipit-source-id: 43cc169983d7f764b74c87f2188a9f8372007d84
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
Summary:
If we are on the evb, process the packet on the evb immediately.
Previously evb would schedule a runInLoop in another event loop.
This saves 1 event loop to be able to process a packet in the common
case.
Reviewed By: mjoras
Differential Revision: D18897493
fbshipit-source-id: 91c073ae0aef58e999f001e64f13612c3788869f
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
Summary:
This adds checks for forwarded data on all the possible branches that lead to
forwarding of packets to another process
Reviewed By: mjoras
Differential Revision: D18416971
fbshipit-source-id: 22dc3fd63de615904a411f90164a138bf0ef56e0
Summary:
Before any CID is available, the source address routing
table might be the only owner of the transport. Removing the transport from
there deletes the transport. connectionIdData param is a const ref to a member
of the connection state owned by the transport. So deleting transport also
deletes this vector, which makes the const ref invalidated.
Reviewed By: vchynarov
Differential Revision: D18253200
fbshipit-source-id: 728b15d0872164ba6549a32e10a5a3611e808f27
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
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
Summary:
If the server connection is never generated, source address map may
have the only shared_ptr to the transport. Erase from the map then use the
transport is clearly a use-after-free bug.
Reviewed By: udippant, lnicco
Differential Revision: D17733297
fbshipit-source-id: 80d141293458920a0ba6c5eaed14dcbeec17d3ff
Summary: remove the variant for codec result and replace it with a custom variant type
Reviewed By: yangchi
Differential Revision: D17247099
fbshipit-source-id: 19e24c14732eb6e8496aee7064f20c48bdf254e0
Summary:
mvfst will need to handle pmtu in an app specific way. So just set DF bits but
not pmtu.
Reviewed By: siyengar
Differential Revision: D17624134
fbshipit-source-id: 14f445bbb6a971efb8a3d550c84c3d4af53f8517
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
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
Summary:
Remove the variant type for RegularQuicPacket and VersionNegotiationPacket.
This allows us to move version negotiation parsing to be only used on the client and only done explicitly
before a version is negotiated.
Reviewed By: yangchi
Differential Revision: D17242788
fbshipit-source-id: 502caf6849f0b7e6778f1470dc160d01f17a33af
Summary:
Make a custom variant type for PacketHeader. By not relying on boost::variant
this reduces the code size of the implementation.
This uses a combination of a union type as well as a enum type to emulate a variant
Reviewed By: yangchi
Differential Revision: D17187589
fbshipit-source-id: 00c2b9b8dd3f3e73af766d84888b13b9d867165a
Summary:
*Motivation*:
I realize there's a bit of duplication with packet parsing code, for instance,
`QuicHeaderCodec.cpp` is used in only one place, but it should be possible
to de-dupe some code.
First step, get rid of this unnecessary wrapper class.
Reviewed By: JunqiWang
Differential Revision: D17192229
fbshipit-source-id: c831abb05ae56e3ece4affd368d0f180e14fa133
Summary:
Prior to this diff we would clone out an entire flow control's worth of data from the writebuffer and then clone out a smaller portion of that to write into the packet builder. This is extremely wasteful when we have a large flow control window.
Additionally we would always write the stream data length field even when we are going to fill the remainder of the packet with the current stream frame. By first calculating the amount of data that needs to can be written and writing the header, we can now omit the data length field when we can fill the whole packet.
Reviewed By: yangchi
Differential Revision: D15769514
fbshipit-source-id: 95ac74eebcde87dd06de54405d7f69c42362e29c
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
Summary:
if OnDataAvailable() gets called before the readOne(), then `bufPromise_` would
be null, and thus the available buffer (buf_) wouldn't get appended to the
bufPromise_.
Reviewed By: sharma95
Differential Revision: D15960463
fbshipit-source-id: b48df104a021a9e89e863d09a0124c6b19228113
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