1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-25 15:43:13 +03:00
Commit Graph

127 Commits

Author SHA1 Message Date
Andrii Vasylevskyi
a804f26ff9 Extra logging for dropped packets
Summary: We have VLOG(3) for various dropped packet reasons, adding VLOG(3) for CANNOT_FORWARD_DATA and CONNECTION_NOT_FOUND cases.

Reviewed By: mjoras

Differential Revision: D43632936

fbshipit-source-id: 81c3eb69c6d84a9224646ded7042963af3f9b130
2023-02-28 09:32:54 -08:00
Luca Niccolini
24bf5288a3 restore ROUTING_ERROR_WRONG_HOST check
Reviewed By: avasylev

Differential Revision: D43520222

fbshipit-source-id: f4ba43ab014f44dc00879df1d90a553bb8d5ad70
2023-02-27 14:54:43 -08:00
Paul Farcasanu
2556adfc7f cleanup initCwnd experimentation
Summary:
**Context**
Perf wins:
 - https://fb.workplace.com/groups/750841812056515/permalink/1581186975688657/
 - https://fb.workplace.com/groups/750841812056515/permalink/1580000729140615/

now clean it up, since we are shipping via config

Reviewed By: hanidamlaj

Differential Revision: D43237402

fbshipit-source-id: abfa5df982668ee87afe24b3a2b88a3762bed12c
2023-02-16 00:59:16 -08:00
Fred Qiu
210f51981e Add socket create hook to QuicServerWorker::bind
Summary: Add the socket create hook to QuicServerWorker::bind in order for more applications to call this hook function.

Reviewed By: jbeshay

Differential Revision: D43130289

fbshipit-source-id: 76bdb2673eb51d11d216ca80c83aafeda86a21c4
2023-02-13 06:07:52 -08:00
Hani Damlaj
cc5bcd5609 QuicServerWorker
Summary: refactoring the slightly messy  `QuicServerWorker::dispatchPacketData(...)`

Reviewed By: jbeshay

Differential Revision: D42514330

fbshipit-source-id: 1745ea10f9dc510d4ad9fbea178b5ad25880aed8
2023-02-03 15:18:55 -08:00
Hani Damlaj
0e9f480daa QuicServerWorker
Summary: - readability improvements

Reviewed By: sharmafb

Differential Revision: D42792105

fbshipit-source-id: a52c1bfffd651442e228df7966a5979ca307ea4f
2023-02-03 15:18:55 -08:00
Hani Damlaj
4bae786443 QuicServerWorker
Summary: - refactor some code in `void QuicServerWorker::handleNetworkData()`

Reviewed By: sharmafb

Differential Revision: D42523140

fbshipit-source-id: e865857f2be028513bb4cd65d864dc72ea7850fd
2023-02-03 15:18:55 -08:00
Hani Damlaj
152b0c004f QuicServerWorker
Summary: - reduce some verbosity in `QuicServerWorker::logRoutingInfo(...)`

Reviewed By: jbeshay, mjoras

Differential Revision: D42514331

fbshipit-source-id: ab38b601edac7b24b97333e30c3aa5d13878d365
2023-02-03 15:18:55 -08:00
Paul Farcasanu
a68b59078f fix initial cwnd experiment
Summary: Perf testing.

Reviewed By: hanidamlaj

Differential Revision: D42352789

fbshipit-source-id: 4ca51153ce939f62e97d56b434cac6a5f06f0a87
2023-01-05 11:47:59 -08:00
Paul Farcasanu
da474a06b1 experiment with initialCwnd=20
Summary: Perf testing.

Reviewed By: mjoras

Differential Revision: D41654491

fbshipit-source-id: b356671c085da31ed6f0a7956e7ed1b3edfc0cf1
2022-12-02 13:17:08 -08:00
Joseph Beshay
772b47adaa Do not use LOG_EVERY_N
Summary:
Fixes build error from Github actions
```
D:\a\mvfst\mvfst\quic\server\QuicServerTransport.cpp(1072): error C3861:
'__sync_add_and_fetch': identifier not found

```

Reviewed By: hanidamlaj

Differential Revision: D40327603

fbshipit-source-id: afae1b661322e80156c7d69b577f35f41b67ee73
2022-11-10 16:17:32 -08:00
Duc Nguyen
e3d2b6b3ee Fix -Wmissing-prototypes error
Reviewed By: bschlinker

Differential Revision: D40363029

fbshipit-source-id: 27b41f99b5d279f4e204561b3e93b179345ec784
2022-10-18 09:30:47 -07:00
Joseph Beshay
227236ef85 Differentiate PacketDropReasons
Summary: The existing PacketDropReason values cover many branches in the code making it impossible to isolate the reason for a PARSE_ERROR, INVALID_PACKET, CONNECTION_NOT_FOUND. This change breaks them down into more values that are each used in a single branch.

Reviewed By: mjoras

Differential Revision: D39149490

fbshipit-source-id: 28cbe1ea6c4a06cf55960058edaa48c28ed4d2ef
2022-09-01 15:11:52 -07:00
Hani Damlaj
0ae79027df Issue Conn IDs As Needed
Summary:
- continually issuing new connection ids to peer as old connections ids are retired through RETIRE_CONN_ID frames
- add logic to parse and act on receiving RETIRE_CONN_ID frame

Reviewed By: mjoras

Differential Revision: D38443561

fbshipit-source-id: 82fb679f482fd69c7b3a3385693d2e5575e92703
2022-08-25 17:47:45 -07:00
Matt Joras
b94142135f Send VN packet when the transport factory returns nullptr
Summary: Returning nullptr indicates that it cannot support making a transport at the moment, so respond with a VN as a terminal signal.

Reviewed By: kvtsoy

Differential Revision: D37014231

fbshipit-source-id: e9905a97709cfcdb75d757b11258711c110077e9
2022-08-11 09:37:47 -07:00
Matt Joras
64f4331469 Add early check for CID size.
Summary: Correctly test initial CID sizes.

Reviewed By: kvtsoy

Differential Revision: D38172511

fbshipit-source-id: 1fce18181aeafadbb03eb0761a174fda93195649
2022-08-11 09:37:47 -07:00
Joseph Beshay
7271907eb5 Skip LOG_EVERY_N to fix build
Summary: Upgrading glog from 0.4.0 to 0.5.0 broke the windows build for some time. This change skips calling LOG_EVERY_N for Windows to restore the build. It is a stop-gap measure until logging is migrated to folly XLOG.

Reviewed By: kvtsoy

Differential Revision: D38371427

fbshipit-source-id: 9711607a348f0473e3e922d7f627217b3948c45d
2022-08-04 11:47:04 -07:00
Dylan Yudaken
df56654b0e quic: multishot recvmsg
Summary: support multishot recvmsg in quic worker

Differential Revision: D37921703

fbshipit-source-id: c8b749b40895fe961adc6b9929bbcc0345fff029
2022-08-02 04:55:59 -07:00
Adel Abouchaev
2325259aad Resolve static analysis complain about use-after-move.
Summary: Although there is no flaw in this code, the static analysis does not see that the remaining variable controls the flow path and considers the use of the data after move a failure.

Reviewed By: mjoras

Differential Revision: D37321326

fbshipit-source-id: 54c147f4e9840bd7e5c7a6122495be66044c7708
2022-06-22 14:03:15 -07:00
Alan Frindell
84e9563fee QuicServerWorker to hold a KeepAlive to EventBase
Summary: This prevents the EventBase from being destroyed before the QuicServerWorker

Reviewed By: mjoras

Differential Revision: D36713788

fbshipit-source-id: b91f85de3b0bc5e16c5903c162a2f9640401a0fb
2022-06-03 14:56:49 -07:00
Matt Joras
e2be4562a1 Use createCombined more frequently.
Summary: This is a pretty obvious thing to do. There's not really any reason to have the data and metadata separately since we don't need to reallocate.

Reviewed By: jbeshay

Differential Revision: D36237370

fbshipit-source-id: 093ad7fb2c54b596ea5cc327ffcc24de1748d362
2022-05-09 23:47:37 -07:00
Fred Qiu
366d44f69d Add code to store TLS version in socket option
Summary: Added a socket create hook in QUIC library.

Reviewed By: mingtaoy

Differential Revision: D35361439

fbshipit-source-id: 74438cf606893233f500082836d3a81c47c88cd4
2022-04-28 07:35:52 -07:00
Mingtao Yang
ddb3017a05 Manually pack key in SourceIdentityHash for portability
Summary:
The previous implementation defined a `struct SourceIdentityKey` which was
used as input to a hashing function. Consequently, we needed to be careful about
the internal layout of the struct to ensure that it had a unique object
representation. We included some `static_assert`s to ensure this.

Platform-specific differences on `struct sockaddr_storage` made this difficult
to enforce.

This diff changes the implementation of the source identity hash to manually
build a serialized representation of the previous SourceIdentityKey. We manually
pack the structure into a byte array.

Reviewed By: mjoras

Differential Revision: D35366081

fbshipit-source-id: ee07493d115094007bed6f6519d158f4587a272d
2022-04-06 13:47:14 -07:00
Omer Peleg
f7105e9c36 Remove siphash from public headers
Summary: Having it triggers clang's -Wimplicit-fallthrough warning for anyone compiling with quic and importing QuicServer.h, encapsulate it within the implementation

Reviewed By: mingtaoy

Differential Revision: D35347282

fbshipit-source-id: df9be870fb908c96e9e7d5bcc53515d95ad066dd
2022-04-05 04:09:39 -07:00
Hani Damlaj
c8bf098e5d Change Implementation of WritableBytesLimit
Summary: - updating usage of WritableBytesLimit

Reviewed By: mjoras

Differential Revision: D33079816

fbshipit-source-id: 1854f40a7b00526afb2167764aeddf55edb1771f
2022-04-04 16:18:52 -07:00
Luca Niccolini
8d3bdbda25 Fix connection close stats callback
Reviewed By: afrind

Differential Revision: D34489976

fbshipit-source-id: ccf2645da524b36ab0fdea2b4bc4d23136838081
2022-02-25 18:43:46 -08:00
Luca Niccolini
6535b5300f reduce log severity for CID not found
Reviewed By: hanidamlaj, mjoras

Differential Revision: D34479987

fbshipit-source-id: dffe0eebde243c8fa414b06a3d1f84b29d32cc5e
2022-02-25 12:30:53 -08:00
Hani Damlaj
045d1e6e25 Close Transport Upon Receiving Client Initial With Malformed DstCid
Summary: - as title :)

Reviewed By: mjoras

Differential Revision: D34124710

fbshipit-source-id: 3cee590d38abf395a09ca3a1d8632a5c4d8e3b64
2022-02-18 15:24:03 -08:00
Konstantin Tsoy
cecc1ba279 Introduce QuicError struct
Summary: Instead of using std::pair everywhere

Reviewed By: mjoras

Differential Revision: D34146686

fbshipit-source-id: dfe48f43775de868aba06a5b9b5a004e5793bdbb
2022-02-14 16:00:21 -08:00
Hani Damlaj
24779eb00a QuicStats For Connections Closing With Zero Bytes Written
Summary: - as title :)

Reviewed By: jbeshay

Differential Revision: D34161016

fbshipit-source-id: c12dd4ff2a488e09329dc09c18b87da26d13bada
2022-02-14 11:15:30 -08:00
Victor Zverovich
0ca3a603aa Fix compatibility with fmt 8.x
Summary:
In fmt 8.x the format string must be known at compile time by default.

Fixes:

```
quic/server/QuicServerWorker.cpp:1355:7: error: call to consteval function 'fmt::basic_format_string<char, std::basic_string<char>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned long, unsigned int, unsigned int, unsigned int, unsigned int>::basic_format_string<std::basic_string<char>, 0>' is not a constant expression
quic/server/QuicServerWorker.cpp:1344:9: error: call to consteval function 'fmt::basic_format_string<char, std::basic_string<char>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned long>::basic_format_string<std::basic_string<char>, 0>' is not a constant expression
quic/server/QuicServerWorker.cpp:1333:9: error: call to consteval function 'fmt::basic_format_string<char, std::basic_string<char>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned long>::basic_format_string<std::basic_string<char>, 0>' is not a constant expression
```

Reviewed By: meyering

Differential Revision: D33985541

fbshipit-source-id: 0dd579de292f58343c95a2b439536b79deae4efc
2022-02-03 15:43:39 -08:00
Hani Damlaj
00e67c1bf9 mvfst License Header Update
Reviewed By: lnicco

Differential Revision: D33587012

fbshipit-source-id: 972eb440f0156c9c04aa6e8787561b18295c1a97
2022-01-18 13:56:12 -08:00
Hani Damlaj
2660a288b3 Update Company Name
Summary: - as title

Reviewed By: lnicco

Differential Revision: D33513410

fbshipit-source-id: 282b6f512cf83b9abb7990402661135b658f7bd1
2022-01-13 12:07:48 -08:00
Hani Damlaj
7233c55d29 Issue NewTokenFrame To Clients
Summary:
- Issuing NewTokenFrames to clients, allowing them to verify their address in subsequent connections by including the token.
- add NewTokenFrame struct in the union type QuicSimpleFrame.
- Issued only once when the crypto handshake is complete.
- Testing includes validating token serialization & deserialization and asserting that the NewTokenFrame is only issued once on handshake completeness.

Reviewed By: mjoras

Differential Revision: D31673160

fbshipit-source-id: 9401ab1a4b878d8b4380d55afa531ec768f5f4cd
2021-12-10 20:35:49 -08:00
Matt Joras
e784fafb10 Global limit on unfinished handshakes.
Summary:
This implements a global (per process) limit on unfinished handshakes from unverified source addresses.

This limits the ability of an attacker to create connection state without also allocating connection state themselves. By default the limit is 1024.

Reviewed By: kvtsoy

Differential Revision: D32772165

fbshipit-source-id: 6c195169377a9f687c54bc9782cc58fe085e1275
2021-12-09 12:55:33 -08:00
Hani Damlaj
8c992d4666 Replace VLOG With ODS For Token Decryption Stats
Summary:
- Replacing VLOG with ODS counter for token decryption.
- Preparing for rollout of New Tokens

Reviewed By: lnicco

Differential Revision: D32780127

fbshipit-source-id: 6a947875e7f2d6ed88ce1e103a089fee5a295210
2021-12-02 00:57:27 -08:00
Luca Niccolini
bb0899fe67 folly::format --> fmt::format
Reviewed By: afrind

Differential Revision: D32239310

fbshipit-source-id: f13cd946164b7c1c60462ecfa53b9d39a2b88a53
2021-11-08 08:02:33 -08:00
Joseph Beshay
ef722626dd REVERT Set Mvfst Experimental to use an initial cwnd of 30 MSS
Summary: Revert the experimental change for the server to use an initial cwnd 30 MSS.

Reviewed By: hanidamlaj

Differential Revision: D32173456

fbshipit-source-id: 13ed4f4c1b11ab9c1dc0da1904be3eb5c564e2d8
2021-11-04 12:06:14 -07:00
Hani Damlaj
4609c8741b Slight Readability Improvements
Summary: - code refactoring

Reviewed By: lnicco

Differential Revision: D31832922

fbshipit-source-id: fac998330294407ac2bb5579d0d3a5e7d566a9cc
2021-10-22 10:53:21 -07:00
Nikhil Dixit Limaye
e403564b28 Add detailed quic RST_STREAM and CONNECTION_CLOSE ods counters
Summary: Add global counters for QUIC stream reset and connection close

Reviewed By: lnicco

Differential Revision: D30877776

fbshipit-source-id: 4ee7c3f7c3c1cf190f464e74d616e0b5f1539d3a
2021-10-18 17:16:26 -07:00
Joseph Beshay
c636afe71e Set Mvfst Experimental to use an initial cwnd of 30 MSS
Summary: Set the experimental version of Mvfst to use an initial cwnd of 30 MSS instead of 10.

Reviewed By: mjoras, lnicco

Differential Revision: D31553957

fbshipit-source-id: 8aa4f0596dbedbea0922afa13de0631c1b898f53
2021-10-12 10:11:38 -07:00
Hani Damlaj
9c1b93c27c Use JK To Allow Tuning Blocked Src Ports
Summary: - utilize JK to block source ports

Reviewed By: mjoras

Differential Revision: D30431799

fbshipit-source-id: d225c4002f77d6761415b4fdc0753a378e4a1d58
2021-08-26 13:09:05 -07:00
Joseph Beshay
719af99fc5 Upgrade QUIC to V1 and HTTP/3 to h3
Summary:
Update QUIC to V1 and HTTP/3 to h3. In order to support interop, hq-interop ALPN has been added too.

This change maintains support for draft-27 and draft-29 implementations.

Reviewed By: mjoras

Differential Revision: D29714556

fbshipit-source-id: 0685928ef4bede0b5511e59572e9c86ccc867320
2021-08-25 10:22:46 -07:00
Matt Joras
6879041661 Selectively block src ports.
Summary: We should not allow initials from known service ports.

Reviewed By: lnicco

Differential Revision: D30053174

fbshipit-source-id: a102ce694dc8b3c1e38587ab6d861ebbea2e2371
2021-08-16 15:47:26 -07:00
Matt Joras
cce2f2de3d Replace reject new connections bool with function.
Summary: It is useful to do this with a function instead of just a bool.

Reviewed By: kvtsoy

Differential Revision: D30074756

fbshipit-source-id: 7d8c477efb85179ca9410c47218456be19dd2a3e
2021-08-05 13:06:04 -07:00
Konstantin Tsoy
ceef3d0268 Add a new experimental version to turn on qlog
Summary: Add MVFST version alias.

Reviewed By: mjoras

Differential Revision: D30028325

fbshipit-source-id: 091882fc777ab0fcee484d6c235d59b4a9faf029
2021-08-04 09:59:37 -07:00
Luca Niccolini
6df5dfddf7 some log hygiene
Reviewed By: mjoras

Differential Revision: D30033300

fbshipit-source-id: 937a263b6a71be9bb4badc737beada8e98e1c49f
2021-08-01 15:08:38 -07:00
Matt Joras
003f012cb7 TODO comment cleanup.
Summary:
These are either no longer relevant, are unlikely to be done, or are spculative enough that they don't deserve code space.

Hope here is to make our search for TODOs higher signal.

Reviewed By: lnicco

Differential Revision: D29769792

fbshipit-source-id: 7cfa62cdc15e72d8b7b0cd5dbb5913ea3ca3dc5a
2021-07-20 10:27:32 -07:00
Matt Joras
bc51bf8f0e Buffer 0RTT packets at QuicServerWorker
Summary: If we receive 0RTT packets before an Initial then we will effectively drop them all on the floor. This is not ideal. Instead, buffer them with an EvictingCacheMap per thread and process them when we do receive an Initial.

Reviewed By: lnicco

Differential Revision: D28853189

fbshipit-source-id: c2272be52d548d48a04dec71dca25c728f7801ca
2021-06-06 20:10:59 -07:00
Alan Frindell
08b8adace4 Loosen restrictions for QuicServer startup/shutdown
Summary:
1) Allow calling QuicServer::initialize with evbs that are not yet running
2) Allow calling QuicServer::shutdown from within a worker EVB

Bonus:

Shut down the QuicServerWorker's pacing timer from shutdownAllConnections

Reviewed By: mjoras

Differential Revision: D28696428

fbshipit-source-id: 84b752caad662d2742db6948a6b8e1b8cbefe4e8
2021-05-26 17:37:14 -07:00