Summary: This implements the handshake done signal and also cipher dropping.
Reviewed By: yangchi
Differential Revision: D19584922
fbshipit-source-id: a98bec8f1076393b051ff65a2d8aae7d572b42f5
Summary: generic API for setting socket Options on both client and server
Reviewed By: yangchi
Differential Revision: D19763928
fbshipit-source-id: 7078eb8738aebc192bbace2498aaf9489526efff
Summary:
Remove all the stream events, packet/udp recv event and ack event.
They are >40% of the events.
Reviewed By: mjoras
Differential Revision: D19466165
fbshipit-source-id: 3a20b201e630527e6d25d1a14f0f520728190d50
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:
Previously we stored an `IntervalSet` in each `WriteAckFrame`. We don't need to do this, as by the time we are writing an `ACK` the `IntervalSet` is complete. Instead of bothering with the `IntervalSet` operations, we can simply serialize it to a reverse-sorted `vector.`
Additionally this has some micro-optimizations for filling the ACK frame, with a new function for getting varint size.
Reviewed By: yangchi
Differential Revision: D19397728
fbshipit-source-id: ba6958fb36a4681edaa8394b1bcbbec3472e177d
Summary:
Retry the original multiple recvmsg diff.
This has a few changes from the original:
1. Fixes happy eyeballs behavior by using the socket directly from the callback.
2. Fixes an error condition to make sure we unregister the callback on error
3. Makes the default to use the basic 1 message recv.
Reviewed By: yangchi
Differential Revision: D19192548
fbshipit-source-id: cd441a8bd448d2ae7d4b1add61aae0eeb7d0e840
Summary:
This diff adds an new setting to allow the client callbacks
onTransportReady slightly earlier during handshake: first ack instead of cipher
ready.
Reviewed By: mjoras
Differential Revision: D19414177
fbshipit-source-id: 6714630c5a49b3ed8e81b79da2af81b50ad828a1
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
Summary:
Revert back to using getReadBUffer for reading from the udp socket.
There are a few issues we found while testing, so reverting for now, we can fix them later.
Reviewed By: yangchi
Differential Revision: D19055438
fbshipit-source-id: 2288e94e0aeab95a5cc6ade39f744b5d98062281
Summary:
Don't use IOBufQueue for most operations in mvfst and use BufQueue instead. Since BufQueue did not support a splitAtMost, added it in instead.
The only place that we still use IOBufQueue is in crypto because fizz still requires it
Reviewed By: mjoras
Differential Revision: D18846960
fbshipit-source-id: 4320b7f8614f8d2c75f6de0e6b786d33650e9656
Summary:
Just use create instead of create combined. This allows
iobuf to decide whether it wants to be created combined or not.
createcombined invoked cmpexchg during descruction.
create() simply calls free()
Reviewed By: mjoras
Differential Revision: D18838402
fbshipit-source-id: 08748429adfe36584c63155d8fc882e5d3b0ba6f
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:
Use the new recvmsg api on the client to receive a packet
from AsyncUDPSocket
Reviewed By: mjoras
Differential Revision: D18797963
fbshipit-source-id: 319d5c41f3a868e7b78947fdbcf2c411b6d7fbf0
Summary: As a part of Draft 17, application close frame has been removed, we use connection close frame to represent both application close and connection close.
Reviewed By: mjoras
Differential Revision: D18580856
fbshipit-source-id: d274fa2d3dbc59b926bca5a2b8a20328ae582703
Summary:
Client will set their active_connection_id_limit to the server as 7 (so it will
have 8 conn ids in total).
Reviewed By: JunqiWang
Differential Revision: D18532441
fbshipit-source-id: b0be65cec9f7c483469b0b4a2810bc370a6945c3
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
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
Summary:
This will allow to be able to create different kind of handshake going forward.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/59
Reviewed By: siyengar
Differential Revision: D18088574
Pulled By: mjoras
fbshipit-source-id: 0732bb63a9e243fef77cdaf4f76e711fcb09ecdc
Summary:
Support migration by default on HQServer.
Allow configurable setting to initiate client migration. If client migration is
enabled, we switch sockets on the second request.
We cannot switch sockets right away on connectSuccess, because even though the
1RTT clientWriteCipher is available, the handshake is still not fully complete.
The server would then receive a packet from a different peer address, but it
wouldn't be in the app data packet space, causing check in ServerStateMachine
to fail.
Reviewed By: JunqiWang
Differential Revision: D18246022
fbshipit-source-id: 21cfa9080a703ae09574711206b8f026282b6a34
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
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
Summary:
This will treat incoming ping frames as retransmittable frames and
update ack state accordingly.
Reviewed By: siyengar
Differential Revision: D17832707
fbshipit-source-id: 69e4a95a62bf86a707bac94399588df61c947bd3
Summary:
They are strongly coupled, which indicate this is probably better to do it as one class.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/44
Reviewed By: mjoras
Differential Revision: D17590918
Pulled By: yangchi
fbshipit-source-id: 2eaca079fd760107eefd2b74fa612d7a0c8b3001
Summary:
Use the custom variant type for write frames as well, now that
we use them for read frames.
Reviewed By: mjoras
Differential Revision: D17776862
fbshipit-source-id: 47093146d0f1565c22e5393ed012c70e2e23d279
Summary:
It looks like under some compiler flags, type alias follows a very
different rule of name shadowing. This diff adds a trailing "_E" to generated
enum names to unbreak builds. I will send another diff to make it less ugly
later. And eventually the QuicSimpleFrame won't be a type alias once it's no
longer a boost_variant.
Reviewed By: siyengar
Differential Revision: D17766330
fbshipit-source-id: 7b3c5847fd2c1eae10757bfbf9558a38f3085f10
Summary:
Create a custom type for read frame types. This allows us to reduce size of code.
We use a macro to generate new variant types whenever we need to.
Reviewed By: yangchi
Differential Revision: D17266468
fbshipit-source-id: 59a1183dce728e71f0924f39f95a7b78449642b0
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:
Allow the client to set zero-length id for itself.
If enabled, saves 8 bytes (if packet isn't padded to minimum).
However, will be disabled if connection migration is enabled.
Main changes include updating the short header parsing to pass
in the connection id length, since unlike long headers,
short header's dst conn id isn't preceeded by length.
Created a new `QuicClientTransportAfterStartTestBase` class
to move `testing::WithParamInterface<>` inheritance to subclasses.
(Only one parameter per test class).
Reviewed By: JunqiWang
Differential Revision: D17188777
fbshipit-source-id: f60a7f3c07da1a8c83cec5b518075d23daedbe44
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:
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
Summary: When happy eyeballs timer fires, declare all outstanding 0-RTT data as lost, so that they will be retransmitted to the second socket
Reviewed By: siyengar
Differential Revision: D17124225
fbshipit-source-id: af2f45f11a5f6eb567f626d577db2634693f67ab
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
Summary:
The CryptoFactory is extended with makePacketNumberCipher . In order to support that feature, FizzCryptoFactory now explicitly takes a QuicFizzFactory as argument instead of a generic fizz::Factory, which is the only type that is used in practice anyways.
The cypher argument was removed because:
1/ Only one cypher is used at all. Fizz also supports ChaCha20, but using it in mvfst will throw an exception.
2/ it seems like the factory should know what cypher it is dealing with.
If a choice of cypher needs to be supported going forward, it can be done by adding state to FizzCryptoFactory.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/40
Reviewed By: mjoras
Differential Revision: D16785274
Pulled By: yangchi
fbshipit-source-id: a1c490e34c5ddd107e8e068d8b127c1ed00a59ec
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
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
Summary:
This introduce the CryptoFactory abstraction that compute keys and AEAD to be used by most of mvfst.
The fizz specific parts are abstracted into a subclass, FizzCryptoFactory, and accessed using virtual methods.
Next step is to introduce QuicFizzFactory 's features into this abstraction.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/30
Reviewed By: JunqiWang
Differential Revision: D16459633
Pulled By: yangchi
fbshipit-source-id: 7fe2d3037ac604bfd5b002e6d25c1763e91e9472
Summary: Add transportStateUpdate event so it can be part of qlog.
Reviewed By: mjoras
Differential Revision: D16342467
fbshipit-source-id: 109189275d44996850b82646bab4a733a3a4c7a1