1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-05 11:21:09 +03:00

18 Commits

Author SHA1 Message Date
Nicholas Ormrod
484898f61b facebook-unused-include-check in fbcode/quic
Summary:
Remove headers flagged by facebook-unused-include-check over fbcode.quic.

+ format and autodeps

This is a codemod. It was automatically generated and will be landed once it is approved and tests are passing in sandcastle.
You have been added as a reviewer by Sentinel or Butterfly.

Autodiff project: uiq
Autodiff partition: fbcode.quic
Autodiff bookmark: ad.uiq.fbcode.quic

Reviewed By: hanidamlaj

Differential Revision: D69864370

fbshipit-source-id: fb8f85599e1e12429f00dc2817dfc5ecf55bc482
2025-02-20 10:03:44 -08:00
Nicholas Ormrod
37cf3495d8 namespace-concat in fbcode/quic
Summary:
Concatenate adjacent namespaces + format

This is a codemod. It was automatically generated and will be landed once it is approved and tests are passing in sandcastle.
You have been added as a reviewer by Sentinel or Butterfly.

Autodiff project: nc
Autodiff partition: fbcode.quic
Autodiff bookmark: ad.nc.fbcode.quic

Reviewed By: hanidamlaj

Differential Revision: D65365244

fbshipit-source-id: 0bbaa7684d03caf8fc8eff3439a0865940398220
2024-11-01 18:34:56 -07:00
Joseph Beshay
ead139adef Move all mvfst use-cases to the new Eventbase, Timer, and Socket interfaces
Summary:
This is the major transition that updates mvfst code to use the new interfaces. The new Folly implementations of the interfaces maintain all the existing behavior of folly types so this should not introduce any functional change. The core changes are:
- Update the BatchWriters to use the new interfaces.
- Update the FunctionLooper to use the new interfaces.
- Change QuicServerTransport to take the folly types and wrap them in the new types for use in the QuicTransportBase.

The rest of the diff is for updating all the existing uses of the QuicTrasnport to initialize the necessary types and pass them to the QUIC transport instead of directly passing folly types.

Reviewed By: mjoras

Differential Revision: D51413481

fbshipit-source-id: 5ed607e12b9a52b96148ad9b4f8f43899655d936
2023-12-14 00:24:12 -08:00
Joseph Beshay
cc9ccc8f99 Remove ThreadLocalBatchWriter
Summary: Remove ThreadLocalBatchWriter since it's not being used.

Reviewed By: mjoras

Differential Revision: D50809221

fbshipit-source-id: 3754e64320518165654217b1e368429c69a944c5
2023-11-07 14:51:15 -08:00
Brandon Schlinker
ad3dd0ec01 Cleanup and modularize receive path, improve timestamp support [7/x]
Summary:
This diff:
- Adds `QuicAsyncUDPSocketWrapperImpl` and changes existing instantiatons of `QuicAsyncUDPSocketWrapper` to instead instantiate `QuicAsyncUDPSocketWrapperImpl`. In follow up diffs, pure virtual functions will be added to `QuicAsyncUDPSocketWrapper` and implemented in `QuicAsyncUDPSocketWrapperImpl`. See D48717388 for more information.

--

This diff is part of a larger stack focused on the following:

- **Cleaning up client and server UDP packet receive paths while improving testability.** We currently have multiple receive paths for client and server. Capabilities vary significantly and there are few tests. For instance:
  - The server receive path supports socket RX timestamps, abet incorrectly in that it does not store timestamp per packet. In comparison, the client receive path does not currently support socket RX timestamps, although the code in `QuicClientTransport::recvmsg` and `QuicClientTransport::recvmmsg` makes reference to socket RX timestamps, making it confusing to understand the capabilities available when tracing through the code. This complicates the tests in `QuicTypedTransportTests`, as we have to disable test logic that depends on socket RX timestamps for client tests.
  - The client currently has three receive paths, and none of them are well tested.

- **Modularize and abstract components in the receive path.** This will make it easier to mock/fake the UDP socket and network layers.
  - `QuicClientTransport` and `QuicServerTransport` currently contain UDP socket handling logic that operates over lower layer primitives such `cmsg` and `io_vec` (see `QuicClientTransport::recvmmsg` and `...::recvmsg` as examples).
  - Because this UDP socket handling logic is inside of the mvfst transport implementations, it is difficult to test this logic in isolation and mock/fake the underlying socket and network layers. For instance, injecting a user space network emulator that operates at the socket layer would require faking `folly::AsyncUDPSocket`, which is non-trivial given that `AsyncUDPSocket` does not abstract away intricacies arising from the aforementioned lower layer primitives.
  - By shifting this logic into an intermediate layer between the transport and the underlying UDP socket, it will be easier to mock out the UDP socket layer when testing functionality at higher layers, and inject fake components when we want to emulate the network between a mvfst client and server. It will also be easier for us to have unit tests focused on testing interactions between the UDP socket implementation and this intermediate layer.

- **Improving receive path timestamping.** We only record a single timestamp per `NetworkData` at the moment, but (1) it is possible for a `NetworkData` to have multiple packets, each with their own timestamps, and (2) we should be able to record both userspace and socket timestamps.

Reviewed By: jbeshay, mjoras

Differential Revision: D48717592

fbshipit-source-id: e21368f5c1f3b37608fc1c88617e96b93a02f6e0
2023-09-21 07:57:58 -07:00
Brandon Schlinker
a1445434b0 Cleanup and modularize receive path, improve timestamp support [5/x]
Summary:
This diff changes `QuicAsyncUDPSocketWrapper` so that it is an abstraction layer that inherits from `QuicAsyncUDPSocketType`, instead of simply being a container with aliases.
- Key changes in `QuicAsyncUDPSocketWrapper.h`, the rest of the updates switch us from using `QuicAsyncUDPSocketType` to `QuicAsyncUDPSocketWrapper`.
- It's difficult to mock the UDP socket today given that we expose the entire `folly::AsyncUDPSocket` type to the higher layers of the QUIC stack. This complicates testing and emulation because any mock / fake has to implement low level primitives like `recvmmsg`, and because the `folly::AsyncUDPSocket` interface can change over time.
- Pure virtual functions will be defined in `QuicAsyncUDPSocketWrapper` in a follow up diff to start creating an interface between the higher layers of the mvfst QUIC stack and the UDP socket, and this interface will abstract away lower layer details such as `cmsgs` and `io_vec`, and instead focus on populating higher layer structures such as `NetworkData` and `ReceivedPacket` (D48714615). This will make it easier for us to mock or fake the UDP socket.

This diff relies on changes to `folly::MockAsyncUDPSocket` introduced in D48717389.

--

This diff is part of a larger stack focused on the following:

- **Cleaning up client and server UDP packet receive paths while improving testability.** We currently have multiple receive paths for client and server. Capabilities vary significantly and there are few tests. For instance:
  - The server receive path supports socket RX timestamps, abet incorrectly in that it does not store timestamp per packet. In comparison, the client receive path does not currently support socket RX timestamps, although the code in `QuicClientTransport::recvmsg` and `QuicClientTransport::recvmmsg` makes reference to socket RX timestamps, making it confusing to understand the capabilities available when tracing through the code. This complicates the tests in `QuicTypedTransportTests`, as we have to disable test logic that depends on socket RX timestamps for client tests.
  - The client currently has three receive paths, and none of them are well tested.

- **Modularize and abstract components in the receive path.** This will make it easier to mock/fake the UDP socket and network layers.
  - `QuicClientTransport` and `QuicServerTransport` currently contain UDP socket handling logic that operates over lower layer primitives such `cmsg` and `io_vec` (see `QuicClientTransport::recvmmsg` and `...::recvmsg` as examples).
  - Because this UDP socket handling logic is inside of the mvfst transport implementations, it is difficult to test this logic in isolation and mock/fake the underlying socket and network layers. For instance, injecting a user space network emulator that operates at the socket layer would require faking `folly::AsyncUDPSocket`, which is non-trivial given that `AsyncUDPSocket` does not abstract away intricacies arising from the aforementioned lower layer primitives.
  - By shifting this logic into an intermediate layer between the transport and the underlying UDP socket, it will be easier to mock out the UDP socket layer when testing functionality at higher layers, and inject fake components when we want to emulate the network between a mvfst client and server. It will also be easier for us to have unit tests focused on testing interactions between the UDP socket implementation and this intermediate layer.

- **Improving receive path timestamping.** We only record a single timestamp per `NetworkData` at the moment, but (1) it is possible for a `NetworkData` to have multiple packets, each with their own timestamps, and (2) we should be able to record both userspace and socket timestamps.

Reviewed By: jbeshay, hanidamlaj

Differential Revision: D48717388

fbshipit-source-id: 4f34182a69ab1e619e454da19e357a6a2ee2b9ab
2023-09-21 07:57:58 -07:00
Konstantin Tsoy
4a0dd1e2a4 QuicAsyncUDPSocketWrapper
Reviewed By: jbeshay

Differential Revision: D46379200

fbshipit-source-id: f6a7c1cf68108872e05e6fd8adb7f00aae22b2ed
2023-07-11 15:21:15 -07: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
Matt Joras
612a00c3f9 Move happy eyeballs state to client state.
Summary: This doesn't belong in the generic state. Untangling it is a little difficult, but I think this solution is cleaner than having it in the generic state.

Reviewed By: JunqiWang

Differential Revision: D29856391

fbshipit-source-id: 1042109ed29cd1d20d139e08548d187b469c8398
2021-07-23 14:21:16 -07:00
Yang Chi
fd554e17ff Move TestPacketBatchWriter to QUIC TestUtils
Summary:
will be used in other test cases too

(Note: this ignores all push blocking failures!)

Reviewed By: mjoras

Differential Revision: D27786212

fbshipit-source-id: 2e21073962f20bd69ba1d16ae6d5752c9ee75b74
2021-04-29 08:42:56 -07:00
Yang Chi
efa466158e QUIC IoBufQuicBatch no need to have a ref to connection state
Summary:
all it wants is just a pointer to the statsCallback member

(Note: this ignores all push blocking failures!)

Reviewed By: mjoras

Differential Revision: D27786211

fbshipit-source-id: 3364681348ee01684d6cb8d2837bee9549f64e3a
2021-04-28 08:06:27 -07:00
Dan Melnic
55443f2b16 Add support for thread local batch writers
Summary: Add support for thread local batch writers

Reviewed By: mjoras

Differential Revision: D21004810

fbshipit-source-id: 907a25f95afeab78fdc7e83cbab87b4f51adc3d3
2020-04-23 18:39:09 -07:00
Amaury Séchet
fb0b6b1cc4 Move fizz specific part of the client in quic/fizz/client (#120)
Summary:
This create a separate library for the fizz client. This allows complete separation of the fizz part of the client, and make it swapable for something else.

Depends on https://github.com/facebookincubator/mvfst/issues/118
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/120

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

 ---
## Proxygen Canary
Traffic Canary: https://our.intern.facebook.com/intern/traffic/canary?fbid=528194164778784
* elb.prod.muc2c01 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/ywntlz9n
* flb.prod.fceb2c02 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/ns1vzm1j
* olb.prod.ratn0c01.p2 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/0vxebqop
* slb.prod_regional.rnao0c00 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/a8syav0w
* slb.regional.rvll0c01.p2 - binary - 2020-04-05 14:59 - https://fburl.com/dyndash/igneyshj
 ---

Reviewed By: mjoras

Differential Revision: D20769060

Pulled By: yangchi

fbshipit-source-id: ad5d66c23b3a9723ad3f8c8091981df99339761e
2020-04-06 11:43:31 -07:00
Amaury Séchet
ccf9ca475e Move the management of the certificate verifier and the fizz::client::FizzClientContext object to FizzClientContext (#63)
Summary:
This allows to remove various fizz specific parts of the API.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/63

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

 ---
## Proxygen Canary
Traffic Canary: https://our.intern.facebook.com/intern/traffic/canary?fbid=2326668697645016
* elb.prod.sju1c01 - binary - 2019-11-14 15:00 - https://fburl.com/dyndash/7m8qfbm6
* flb.prod.flhe2c01 - binary - 2019-11-14 15:00 - https://fburl.com/dyndash/alba0iv1
* olb.prod.rpnb0c01 - binary - 2019-11-14 15:00 - https://fburl.com/dyndash/f5eogqg5
* slb.prod_regional.rodn0c00 - binary - 2019-11-14 15:00 - https://fburl.com/dyndash/vtit218f
 ---

Reviewed By: yangchi

Differential Revision: D18303967

Pulled By: mjoras

fbshipit-source-id: 9bb7ed6ab608f9c2d1e8d5b0b533bda69f5d9a71
2019-11-18 09:27:42 -08:00
Amaury Séchet
6d19c622b2 Use a factory to create ClientHandshake (#59)
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
2019-11-04 16:06:18 -08:00
Junqi Wang
2c701de030 Continue on network unreachable with timeout
Summary:
Previously we tried continue on network down and it showed good
improvement. But there was a problem: it hurts UX for airplane mode users, it
didn't return error back to user immediately but after 30/60 seconds timeout.
This adds a timer for this feature and it only allows the transport to ignore
network unreachable error for 200ms. After 200ms, it throws and reports to user
if the error persists.

Reviewed By: siyengar

Differential Revision: D15089442

fbshipit-source-id: dd87f4f579187c4b45244a7ee0477d2a0cf1b5d7
2019-04-26 10:08:35 -07:00
udippant
50d4939e9e Initial commit of mvfst 2019-04-22 23:42:46 -07:00