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

129 Commits

Author SHA1 Message Date
Matt Joras
2176f080ff Set upper limits on max_packet_size from the peer.
Summary: This will limit us to standard Ethernet MTU (1500) for now, but I think that is fine. This will allow us to experiment with packet size from the client more easily.

Reviewed By: yangchi

Differential Revision: D20709146

fbshipit-source-id: 608463de53d4520a257052491683263e14fc9682
2020-03-27 17:22:44 -07:00
Amaury Séchet
8efe70e953 Move getPsk uses down to FizzClientHandshake (#114)
Summary:
This is fizz dependent so it belong there.

Depends on https://github.com/facebookincubator/mvfst/issues/109 , https://github.com/facebookincubator/mvfst/issues/111 and https://github.com/facebookincubator/mvfst/issues/117
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/114

Reviewed By: mjoras

Differential Revision: D20535928

Pulled By: yangchi

fbshipit-source-id: b2b99aed45e05014f24664f9e14b57241492da19
2020-03-25 08:48:50 -07:00
Matt Joras
b52f2d97f4 Fixup test.
Summary: The error code is actually expected to be transport here.

Reviewed By: yangchi

Differential Revision: D20553042

fbshipit-source-id: 82eb5dd51b5b0ccddebe6a5eb9c5c723f2caa95a
2020-03-23 10:24:15 -07:00
Matt Joras
68e7f055b3 Fix onConnectionError case for NO_ERROR application errors.
Summary:
This somewhat contrains what applications using mvfst can do with their errors, as it makes the semantics of onConnectionEnd vs onConnectionError tied to the value of GenericApplicationError::NO_ERROR.

For now, we believe this is fine, and fixes a case of connection close mis classification by HQSession.

Reviewed By: yangchi

Differential Revision: D20550139

fbshipit-source-id: eec7d90c33141bfa7f1280bf5b569818890d1130
2020-03-19 18:58:58 -07:00
Matt Joras
42e49bb262 Translate API closes to Application closes on the wire.
Summary: Previously we would end up writing a non-application close when the application calls close(folly::none). This isn't correct, as those cases should be an application error with no error.

Reviewed By: afrind

Differential Revision: D20518529

fbshipit-source-id: fe069cccc32bd550fb3ec599694110955816993f
2020-03-18 19:48:23 -07:00
Amaury Séchet
bfadaf4985 Use the PskCache from the context rather than the transport (#111)
Summary:
The cache is obviously dependent on the crypto that is used. It's management needs to be moved down to part of the code that are specific to the crypto used. As a first step, we remove the cache from the transport, and use the one from the fizz context - if available - through the handshake.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/111

Reviewed By: mjoras

Differential Revision: D20463307

Pulled By: yangchi

fbshipit-source-id: c14908a10c80a977096f1ec145359f60899f8777
2020-03-18 02:58:49 -07:00
Yedidya Feldblum
ace2cc78a6 Unqualify uses of folly::AsyncUDPSocket::ReadCallback::OnDataAvailableParams
Summary: Unqualify nearly all uses of `folly::AsyncUDPSocket::ReadCallback::OnDataAvailableParams` since nearly all uses already have `OnDataAvailableParams` in scope.

Differential Revision: D20450063

fbshipit-source-id: c0fd49a7eace44a6edc8086762c44753224788dd
2020-03-16 02:57:30 -07:00
Amaury Séchet
9f91bb4b95 Move the caching of server parameters to ClientStateMachine (#109)
Summary:
All the state already moved there anyways, and this is closely related to the Psk cache management, which is also moving away from QuicClientTransport.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/109

Reviewed By: mjoras

Differential Revision: D20463300

Pulled By: yangchi

fbshipit-source-id: e9f0dc6285ccc6fd8cdc98d0e3579e6af8b00306
2020-03-15 23:57:24 -07:00
Amaury Séchet
9bb6772e69 Use a template method pattern for ClientHandshake::connect (#110)
Summary:
This ensures we have a place to plug things into the connect method that do not depend on the actual handshake implementation.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/110

Reviewed By: mjoras

Differential Revision: D20463305

Pulled By: yangchi

fbshipit-source-id: a46c23871ec1021712641fbef98399cd5036001a
2020-03-15 23:19:33 -07:00
Amaury Séchet
050a584a14 Move 1RTT write cipher to the handshake. (#102)
Summary:
This is a continuation of https://github.com/facebookincubator/mvfst/issues/101
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/102

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

 ---
## Proxygen Canary
Traffic Canary: https://our.intern.facebook.com/intern/traffic/canary?fbid=3593373427403977
* elb.prod.bom1c01 - binary - 2020-03-14 13:18 - https://fburl.com/dyndash/yv327msu
* flb.prod.flhe3c01 - binary - 2020-03-14 13:18 - https://fburl.com/dyndash/h8l2uq4z
* slb.prod_regional.rash0c00 - binary - 2020-03-14 13:18 - https://fburl.com/dyndash/s44dmkr4
 ---

Differential Revision: D20398160

Pulled By: mjoras

fbshipit-source-id: d9e07fce83ba14c56f2dae217dea1b8f67bffa1f
2020-03-14 16:40:17 -07:00
Amaury Séchet
b35727dc76 Add QuicPskCache to FizzClientQuicHandshakeContext (#103)
Summary:
This is a first step toward moving the psk cache handling in the handshake rather than the transport layer.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/103

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

 ---
## Proxygen Canary
Traffic Canary: https://our.intern.facebook.com/intern/traffic/canary?fbid=2611199355779104
* elb.prod.xsp1c01 - binary - 2020-03-13 08:22 - https://fburl.com/dyndash/ihs2l5q9
* flb.prod.frba2c02 - binary - 2020-03-13 08:22 - https://fburl.com/dyndash/kec85l1f
* olb.prod.ratn0c01.p2 - binary - 2020-03-13 08:22 - https://fburl.com/dyndash/sautomfe
* slb.prod_regional.ratn0c00 - binary - 2020-03-13 08:22 - https://fburl.com/dyndash/n6v9ulnm
* slb.regional.rftw0c01.p2 - binary - 2020-03-13 08:22 - https://fburl.com/dyndash/ir4oc0rn
 ---

Differential Revision: D20250804

Pulled By: mjoras

fbshipit-source-id: a96862ffb00578ea55e45a3fd7807bef16458cbf
2020-03-13 11:05:56 -07:00
Dan Melnic
ba5ef797a5 Add UDP GRO support
Summary: Add UDP GRO support

Reviewed By: mjoras

Differential Revision: D20347326

fbshipit-source-id: be3c31f070c4f2c1ef84f9e2df60f49a5fcabd93
2020-03-13 10:12:22 -07:00
Amaury Séchet
3c5a3a2420 Populate QuicReadCodec's cipher from the client's handshake directly (#101)
Summary:
This is a continuation of https://github.com/facebookincubator/mvfst/issues/98 and depends on it.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/101

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

 ---
## Proxygen Canary
Traffic Canary: https://our.intern.facebook.com/intern/traffic/canary?fbid=1081862622194120
* elb.prod.eze1c01 - binary - 2020-03-12 08:37 - https://fburl.com/dyndash/7zk4wokz
* flb.prod.fgdl5c03 - binary - 2020-03-12 08:37 - https://fburl.com/dyndash/cp8fkdkc
* slb.prod_regional.rprn0c00 - binary - 2020-03-12 08:37 - https://fburl.com/dyndash/j1cfe45e
 ---

Differential Revision: D20398127

Pulled By: mjoras

fbshipit-source-id: 16a7f5fab193edb25c7d241ce34fa6e710cc014f
2020-03-12 16:05:35 -07:00
Amaury Séchet
6654b307d9 Move peer advertised transport parameter to QuicClientConnectionState (#104)
Summary:
Some of these parameters are already there. The other need to be move so that the can be accessed when caching new public keys.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/104

Differential Revision: D20250783

Pulled By: mjoras

fbshipit-source-id: 3e8b6c9e8945fb5ae1ea71a8af1512bfe0616736
2020-03-12 15:17:06 -07:00
Zachary Weinberger
88e3fdadc0 Add streaming option for FileQLogger
Summary: In the constructor of FileQlogger adds a bool that sets streaming mode. If it's set it creates a thread that reads events from the log and immediatly outputs them to an output file.

Reviewed By: mjoras

Differential Revision: D20250881

fbshipit-source-id: 2af3ff0aeaa5b62f90b0c01570c96c92fdab4412
2020-03-12 13:47:35 -07:00
Amaury Séchet
ef5d39152f Move handshake write cipher to the handshake. (#98)
Summary:
This is similar to https://github.com/facebookincubator/mvfst/issues/97 and depends on it.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/98

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

 ---
## Proxygen Canary
* elb.prod.hkg3c01 - binary - 2020-03-09 20:15 - https://fburl.com/dyndash/in7s8dml
* flb.prod.fbsb8c02 - binary - 2020-03-09 20:15 - https://fburl.com/dyndash/cr6myln4
* slb.prod_regional.rvll0c00 - binary - 2020-03-09 20:15 - https://fburl.com/dyndash/jaj9flmq
* slb.regional.rcln0c01.p2 - binary - 2020-03-09 20:15 - https://fburl.com/dyndash/5ezx6w63
 ---

Reviewed By: mjoras

Differential Revision: D19873742

Pulled By: sharmafb

fbshipit-source-id: 1469e36781eb7d8a0b1bf74eca45864cf208dcbd
2020-03-11 11:34:42 -07:00
Amaury Séchet
63e9b70ce6 Move 0RTT cipher management to the handshake. (#97)
Summary:
Make sure that trigger on error is performed when running connect.

This avoids some bucket brigading around the connect function and helps to isolate QuicClientTransport pskCache management, reduce the memory footprint of the handhsake and reduce temporal coupling.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/97

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

 ---
## Proxygen Canary
Traffic Canary: https://our.intern.facebook.com/intern/traffic/canary?fbid=212582886632633
* elb.prod.sof1c01 - binary - 2020-03-04 10:31 - https://fburl.com/dyndash/cu6glbvv
* flb.prod.fisb3c02 - binary - 2020-03-04 10:31 - https://fburl.com/dyndash/qaozda7o
* olb.prod.rlla0c01.p2 - binary - 2020-03-04 10:31 - https://fburl.com/dyndash/m7des08a
* slb.prod_regional.rfrc0c00 - binary - 2020-03-04 10:31 - https://fburl.com/dyndash/j2ftlr65
* slb.regional.rlla0c01.p2 - binary - 2020-03-04 10:31 - https://fburl.com/dyndash/98by8k4u
 ---

Reviewed By: mjoras

Differential Revision: D19873714

Pulled By: sharmafb

fbshipit-source-id: 7b0980e9d2590227bec5426560f5dd5d6a34ae85
2020-03-10 11:46:19 -07:00
Matt Joras
d1a3652a4c Iterate QuicVersion::MVFST
Summary:
This iterates the mvfst version to be semantically equivalent to draft-27, and leaves support for the old mvfst version.

The client will not yet be moved to draft-27 by default.

Reviewed By: lnicco

Differential Revision: D20182452

fbshipit-source-id: 1e11ad7296a6cd8d15ca5ed359d9ed82af79bb17
2020-03-04 22:08:34 -08:00
Yang Chi
fa1fae0d26 Introduce empty read loop detection callback in Quic
Summary:
Similar to the exiting empty write loop callback. The new API will
trigger when we read from socket but back with empty hands.

Reviewed By: lnicco

Differential Revision: D20130432

fbshipit-source-id: 9b61310b4ea4c5c7999742c5a8761a831f20f7b7
2020-03-03 18:52:17 -08: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
Luca Niccolini
39db4700c0 allow custom socket options
Summary: generic API for setting socket Options on both client and server

Reviewed By: yangchi

Differential Revision: D19763928

fbshipit-source-id: 7078eb8738aebc192bbace2498aaf9489526efff
2020-02-21 22:11:40 -08:00
Matt Joras
6827637d45 Use NiceMock in more tests
Summary: When we don't use NiceMock we end up with a ton of spam in failing tests for every callback that we didn't EXPECT. This makes failed test output extremely noisy.

Reviewed By: sharmafb

Differential Revision: D19977113

fbshipit-source-id: 1a083fba13308cd3f2859da364c8106e349775bb
2020-02-19 21:46:46 -08:00
Yang Chi
5f51f4436f Exception-free Quic ConnIdAlgo
Summary: no more surprises in upper layer

Reviewed By: mjoras

Differential Revision: D19976510

fbshipit-source-id: 3487e9aa2cb28d7bc748f13bc2bbc393216b4a8a
2020-02-19 15:54:11 -08:00
Amaury Séchet
9fc727fb96 Pass QuicClientConnectionState down to ClientHandshake (#95)
Summary:
This is similar to https://github.com/facebookincubator/mvfst/issues/88 except that in this case, QuicClientConnectionState is actually needed to move forward.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/95

Reviewed By: yangchi

Differential Revision: D19816034

Pulled By: mjoras

fbshipit-source-id: a57b7a4732e3d7918369f8febbf63bce40d18a6c
2020-02-11 09:23:43 -08:00
Amaury Séchet
822b3eacbf Make QuicClientTransportIntegrationTest use SetUp (#91)
Summary:
Doing the setup in the constructor disallow leveraging virtual functions, which I intend to do.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/91

Reviewed By: mjoras

Differential Revision: D19622583

Pulled By: yangchi

fbshipit-source-id: a234256b8f631e15be052ce1683c2414b07aab25
2020-02-10 11:25:32 -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
Matt Joras
46e9228420 Use inplace encryption from fizz.
Summary:
The fizz `encrypt` API will opportunistically use inplace encryption if the `IOBuf` you pass it is correctly sized. If it is not it will manually create the output buffer.

It turns out doing inplace versus encrypting with a given target output is a bit faster in microbenchmarks, and it will also allow experimenting with caching `IOBuf`s on the send path.

Reviewed By: knekritz

Differential Revision: D19506291

fbshipit-source-id: 3ef41290538ceac34a344114badbd167e2c25a50
2020-01-29 15:07:26 -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
Yang Chi
fb999ff34b Back out "New TransportSetting option to let client deliver onTransportReady at first Ack"
Summary: Original commit changeset: 6714630c5a49

Reviewed By: mjoras

Differential Revision: D19432294

fbshipit-source-id: d756413eeed2bc50e8124abbbe750580e396e216
2020-01-17 01:45:12 -08:00
Matt Joras
431acc838f Optimize ACK frame writing
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
2020-01-16 10:40:40 -08:00
Subodh Iyengar
2745a85505 receive multiple recvmsg in one loop
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
2020-01-16 10:14:56 -08:00
Subodh Iyengar
83314206a6 Add socket to notifyDataAvailable
Summary: add the socket to the callback parameter

Reviewed By: yangchi

Differential Revision: D19192549

fbshipit-source-id: 068bdb560273ab3203a1b7eaefa5b01c4e4e9968
2020-01-16 10:14:55 -08:00
Yang Chi
eacaa4f35d New TransportSetting option to let client deliver onTransportReady at first Ack
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
2020-01-15 15:54:11 -08:00
Matt Joras
066796b52d Pings are allowed in non-protected packets
Summary: As in title.

Reviewed By: yangchi

Differential Revision: D19411304

fbshipit-source-id: 674fb4ccb428badefe28b6ffe11a3b55b92afe6c
2020-01-15 13:17:43 -08:00
Luca Niccolini
5bffffea4b allow client bind to a specified socket
Summary: rather than always binding to INADDR_ANY

Differential Revision: D19361477

fbshipit-source-id: 4a6d400529833a5b3356564ea2220c77180b5700
2020-01-14 11:22:05 -08:00
Udip Pant
74f98d4604 Move the fizz code into its own package
Summary:
This moves the fizz specific part of the handshake into its own folder and library.

There is a bit of smurf naming going on as a result, not sure it is worth fixing or not at this stage. Maybe this code should be a in namespace named quic::fizz .

This should be doable with the client as well as soon as the key cache situation is figured out.
 ---
## Proxygen Canary

Reviewed By: yangchi

Differential Revision: D19290919

fbshipit-source-id: 48d7f7c70db42c65f7dffe3256805c268a481198
2020-01-09 20:59:54 -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
403562276b Remove InvalidConnectionId test
Summary:
This test tries to construct a bad packet by using server CID as the
dest CID in a server to client packet. It hopes to verify client will fail
parsing and throw. It used to work fine.

Then a couple month ago, our client code switched to use 0-len client CID. Now
client always read 0 bytes out as Dest CID on received packet. But in this test
case server writes a >0 len CID into the packet as Dest CID since the test case
tries to construct a bad packet. Then client treats these bytes as frame bytes
since it assumes 0 len DestCID. Then it parse frames from there. Now sometimes
parsing fails and we throw from parsing. Sometimes parsing accidentally goes
through, then we may or may not throwing when we process the parsed frames.
For example, if we parse out a stream frame successfully with a local stream ID
that's not open, we throw from there. But sometimes, nothing gets throw, since
we can potentially, for example, parse out a stream frame with a remote stream
ID and just simply create it. Sometime the test just hangs, since the stream ID
is huge and we create thousands of streams.

It's hard to fix this test case and keep it unflaky. For example, I figured by
using (0, 5, 3) instead of (0, 0, 0) as the CID encoding params, the test always
passes. That's because the server generates a CID that will definitely fail
parsing on client side. But if some day draft changes the frame type ID values
again, the test will fail again. And someone else will have to go through this
debugging process all over again.

I think we can just remove this test case altogether.

Reviewed By: mjoras

Differential Revision: D19268239

fbshipit-source-id: 66930d6e9044c863a26e29be1dbad683abc6c96c
2020-01-03 10:52:24 -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
60240e3f08 partially revert multiple recvmsg
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
2019-12-19 13:07:22 -08:00
Amaury Séchet
2daf89c1dd Split fizz specific ClientTransportParametersExtension into FizzClientExtensions (#76)
Summary:
That ensure the connect API from ClientHandshake doesn't depend on fizz specific things anymore.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/76

Reviewed By: yangchi

Differential Revision: D18888115

Pulled By: mjoras

fbshipit-source-id: 00103d629708796b73787b3dabb6f8d3815ff976
2019-12-12 14:31:38 -08:00
Yang Chi
d7d19c74b5 Stop tracking pure ack packets in Quic
Summary:
Previously we track them since we thought we can get some additional
RTT samples. But these are bad RTT samples since peer can delays the acking of
pure acks. Now we no longer trust such RTT samples, there is no reason to keep
tracking pure ack packets.

Reviewed By: mjoras

Differential Revision: D18946081

fbshipit-source-id: 0a92d88e709edf8475d67791ba064c3e8b7f627a
2019-12-12 13:20:09 -08:00
Matt Joras
f041ec17ef Use folly::small_vector for ack blocks
Summary: By modifying `IntervalSet` a bit we can make it so it takes a `folly::small_vector` as the container. We expect that for real traffic there will not generally be a lot of ACK blocks per frame, so optimize for that.

Reviewed By: siyengar

Differential Revision: D18919975

fbshipit-source-id: 199a2ea9ba5003382e2d7d99fc7a6de7e8aafdca
2019-12-12 12:06:31 -08:00
Subodh Iyengar
e524c0c069 iobufqueue diediedie
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
2019-12-06 12:06:44 -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
Subodh Iyengar
02d473e8ec use recvmsg on client
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
2019-12-04 12:04:10 -08:00
Raghu Nallamothu
e06de27550 Merge Application Close Frame and Connection Close Frame
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
2019-12-03 15:02:06 -08:00