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

378 Commits

Author SHA1 Message Date
Aman Sharma
1cc00f77a4 Move core functionality to QuicTransportBaseLite [24/n]
Summary:
There are many files in this diff, but the relevant ones are:
* quic/api/QuicSocket.h
* quic/api/QuicSocketLite.h
* quic/api/QuicTransportBase.h
* quic/api/QuicTransportBaseLite.cpp
* quic/observer/SocketObserverContainer.h

The purpose of this is to include the observer functionality within the Lite class. Ideally, we'd remove it from the Lite class, but that's going to require some more detailed changes to the interfaces we're using, because observers are used quite a lot within common code (for example, AckHandlers.cpp).

I'll make those changes some time after the QuicTransportBase split, as they're going to take a while.

Reviewed By: jbeshay, mjoras, kvtsoy

Differential Revision: D65685667

fbshipit-source-id: feb07bcf35d6af2e5c2b538ff463b01b67c6aff9
2024-11-14 13:02:10 -08:00
Crystal Jin
a5fd828b90 Move setPacingFunction to when pacer is set
Reviewed By: hanidamlaj

Differential Revision: D65845962

fbshipit-source-id: 9d14e9845c6232b9825c20c7c67e2f49ac2fed73
2024-11-13 10:39:16 -08:00
Aman Sharma
a4247ec4d5 Move core functionality to QuicTransportBaseLite [21/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D65282152

fbshipit-source-id: 273a2df9aca0aa84b2e1137d99a473e02de0953b
2024-11-01 11:46:43 -07:00
Aman Sharma
ae605980c5 Move core functionality to QuicTransportBaseLite [20/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64971971

fbshipit-source-id: 91c9fddcf77bbf26fa86bb00a1fa7f6c3b6f55dc
2024-10-30 10:53:30 -07:00
Aman Sharma
784bd91424 Move core functionality to QuicTransportBaseLite [19/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64771233

fbshipit-source-id: 3584af1ce77a4ca53de83a2fb6bf8f6d3f9ed999
2024-10-24 15:01:02 -07:00
Aman Sharma
6691c8dde2 Move core functionality to QuicTransportBaseLite [18/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64771210

fbshipit-source-id: 58e79264bfc2826ba0822f1bb51877d3d7c8d06d
2024-10-24 15:01:02 -07:00
Aman Sharma
384c39f862 Move core functionality to QuicTransportBaseLite [17/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64547922

fbshipit-source-id: fa1e7c22122062b468878a232f545ba1f2619925
2024-10-23 18:25:46 -07:00
Aman Sharma
6875e7cdf5 Move core functionality to QuicTransportBaseLite [16/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64546909

fbshipit-source-id: de8989a0c292dfa8ff05d943ffaee23f1e6923d3
2024-10-23 13:39:16 -07:00
Aman Sharma
520ae73630 Move core functionality to QuicTransportBaseLite [15/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64542784

fbshipit-source-id: a155c441b3d2cf0a8220e7ddebd94f0335cb9420
2024-10-23 10:02:08 -07:00
Aman Sharma
c1b9dcbb89 Move core functionality to QuicTransportBaseLite [14/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64342347

fbshipit-source-id: 721414fdca39f70d8902b3df5afb0fde0d171480
2024-10-16 12:40:37 -07:00
Aman Sharma
0882df9999 Move core functionality to QuicTransportBaseLite [13/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64342282

fbshipit-source-id: 93faad3e53b1aba27dae268fc690480acf27d705
2024-10-16 12:40:37 -07:00
Aman Sharma
40e0652725 Move core functionality to QuicTransportBaseLite [12/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64338559

fbshipit-source-id: 7c2c884e0c855c443874ab1b891bd285d24c4cf1
2024-10-16 12:40:37 -07:00
Aman Sharma
5c8a4463ea Move core functionality to QuicTransportBaseLite [11/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64185699

fbshipit-source-id: 7f79eeb4f1f1cf043b8e3e3a513f407c796dc51e
2024-10-14 11:58:31 -07:00
Aman Sharma
cfbdfda64b Move core functionality to QuicTransportBaseLite [10/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64065782

fbshipit-source-id: b0fb37e57b59ac6f28cf6f0b2d59d750a63398ca
2024-10-14 11:58:31 -07:00
Aman Sharma
9374a6b0e4 Move core functionality to QuicTransportBaseLite [9/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64065220

fbshipit-source-id: e027275d565ee8967de4eb4855475244bae334a0
2024-10-14 11:58:31 -07:00
Aman Sharma
b7169e3cf7 Move core functionality to QuicTransportBaseLite [8/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D64065153

fbshipit-source-id: 5c9515dcaba1ef1f30d49f701e366f715854527a
2024-10-09 17:37:33 -07:00
Aman Sharma
c62dac180e Move core functionality to QuicTransportBaseLite [7/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D64065113

fbshipit-source-id: 31f9a29a88bf763156d42c49df9db0f6f8e1a9d0
2024-10-09 17:37:33 -07:00
Aman Sharma
a253b7d782 Move core functionality to QuicTransportBaseLite [6/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63994476

fbshipit-source-id: 136e9ba9a972ac58b8a5fc6b336f6c3a4eaf38f5
2024-10-09 17:37:33 -07:00
Aman Sharma
7be7cfffb0 Move core functionality to QuicTransportBaseLite [5/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63986096

fbshipit-source-id: 5543b943acf5397db3951186f50181e1c31b7e0b
2024-10-08 11:12:03 -07:00
Aman Sharma
e0e445ff01 Move core functionality to QuicTransportBaseLite [4/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63984103

fbshipit-source-id: f21f3c4759dfa463319cefb7731c793c0fa9905d
2024-10-08 11:12:03 -07:00
Aman Sharma
5a9ebd333d Move core functionality to QuicTransportBaseLite [3/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63917728

fbshipit-source-id: 4e5389c1747b59cf30fea37ed9e5802007f2e49b
2024-10-08 11:12:03 -07:00
Aman Sharma
e5c822b9d4 Move core functionality to QuicTransportBaseLite [2/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63914228

fbshipit-source-id: 3860b33688a4efe99374a55dde226b7ceaab8d2f
2024-10-08 11:12:03 -07:00
Aman Sharma
0b2743fdae Move core functionality to QuicTransportBaseLite [1/n]
Summary: See title

Reviewed By: mjoras

Differential Revision: D63860679

fbshipit-source-id: b7116792c2bf99a98f62d719febddd133cce94d5
2024-10-04 17:28:20 -07:00
Riten Gupta
b4790c8429 change bbr2 parameters for testing in prod
Summary: Sim studies showed improved performance for some cases with experimental pacer false, no pacing of init cwnd, and increased startup pacing gain.

Reviewed By: mjoras

Differential Revision: D63723767

fbshipit-source-id: 7c54076510530ed4da65ce8f00027c2ed251ea32
2024-10-04 10:27:39 -07:00
Konstantin Tsoy
818757c454 Add inline write option for sending pings
Summary:
We originally added it for onNetworkDdata only e.g.
https://fburl.com/code/lub7h950, but we should do it on sending pings as well

Reviewed By: mjoras

Differential Revision: D63670960

fbshipit-source-id: ad6096ddc92f00669239bcbb37e65d48238020b9
2024-09-30 19:34:41 -07:00
Matt Joras
3f21e7130c Fix buffered data case for initial / handshake
Summary: This case was missing. If we don't do this then if we buffer a packet on EAGAIN while we don't have initia/handshake data to write, we will loop on the write callback and do empty write loops.

Reviewed By: kvtsoy

Differential Revision: D63492172

fbshipit-source-id: 94ac1c37b2015d38694b9aa3be2744c9bbbe6bee
2024-09-27 19:41:08 -07:00
Crystal Jin
0ed5f1c98a Log rtt variance and latest rtt
Summary: As title

Reviewed By: kvtsoy

Differential Revision: D62965330

fbshipit-source-id: 93f865633e589f97589a8b7b06609e8995abf53d
2024-09-19 12:38:49 -07:00
Hani Damlaj
07f2980f43 fix onBidirectionalStreamsAvailable
Summary:
fixes the arg passed to the ::onBidirectionalStreamsAvailable callback

#facebook:
i accidentally introduced a bad operator precedence bug in a refactor; this fixes that and the unit test

luckily HQSession doesn't consume the argument passed to the callback

Reviewed By: knekritz

Differential Revision: D62765762

fbshipit-source-id: 7ae206d5036fc744485736f92fd366ce99103d58
2024-09-17 00:11:53 -07:00
Konstantin Tsoy
4df319dee3 Delay writes when networkDataPerSocketRead=true until the read loop is done
Summary: Delay writes when networkDataPerSocketRead=true until the read loop is done

Reviewed By: mjoras

Differential Revision: D62302229

fbshipit-source-id: 858bed523b5a46bd52fe71f6f0e8b23f5dd4e46d
2024-09-10 11:13:55 -07:00
Matt Joras
e81c40b2f7 Add option to do an inline write after a read event.
Summary: Presently updateWriteLooper will always schedule a loop callback to do the write loop. Add an option to inline trigger the writes after the read event.

Reviewed By: kvtsoy, sharmafb

Differential Revision: D62192192

fbshipit-source-id: 30991608f57fbfa097a7522c0731d25b8e528345
2024-09-04 15:15:22 -07:00
Konstantin Tsoy
777bdabe21 Call invokeReadDataAndCallbacks() when processCallbacksPerPacket is set
Summary: Missed this call because processCallbacksAfterNetworkData() used to call it before

Reviewed By: mjoras

Differential Revision: D61891333

fbshipit-source-id: 078e9dce5e5f91f389bdb38b0a589a3256dd873b
2024-08-27 23:37:56 -07:00
Aman Sharma
a60a3a0aeb More readable delivery callback code
Summary: The prior `while (maxOffsetToDeliver.has_value()) {` was misleading because `maxOffsetToDeliver` doesn't change in the body of the while loop. I'm changing the structure so as to make it more intuitive as to what's happening here.

Reviewed By: hanidamlaj

Differential Revision: D61801508

fbshipit-source-id: fb91b183316b281cf74cbb33a67f7080e7d8a6f8
2024-08-27 19:18:35 -07:00
Aman Sharma
93bb817940 Fix flaxy test SendResetSyncOnAck
Summary: See title.

Reviewed By: mjoras

Differential Revision: D61634417

fbshipit-source-id: 644fce59d78cf97d0741fd30bd2f1a6e681b0768
2024-08-26 13:16:36 -07:00
Aman Sharma
ff3cc2d753 Add Software rx timestamp to PacketsReceivedEvent
Summary: I'm adding the software rx timestamp to `PacketsReceivedEvent` so that it's available in `SocketObserverInterface::packetsReceived`.

Reviewed By: mjoras

Differential Revision: D61485649

fbshipit-source-id: 05170acbcfd1fc8e6a2fce4d2cc8f3f2f7441134
2024-08-23 18:44:04 -07:00
Matt Joras
52c950293f Add option to process callbacks per received packet
Summary: This gives an option to process application callbacks per received and processed packet, rather than after a whole batch has been received.

Reviewed By: kvtsoy

Differential Revision: D61626616

fbshipit-source-id: cac434adff79eda738c2c4924a0080ecdaac1a25
2024-08-21 15:33:14 -07:00
Aman Sharma
bc386475e5 Integrate RangeChain into write path of QUIC stack
Summary: See title

Reviewed By: mjoras

Differential Revision: D58216871

fbshipit-source-id: 9afc08946a676ec967c998416a6470d4884af550
2024-08-15 05:46:08 -07:00
Konstantin Tsoy
b51ee87995 Add idle timer checker
Reviewed By: mjoras

Differential Revision: D60913168

fbshipit-source-id: 1b14a2e17545ba24f879e7212153eee19cfe9972
2024-08-07 18:55:45 -07:00
Konstantin Tsoy
0801517082 Expose ackTimerFactor in transport settings
Summary: to experiment with

Reviewed By: sharmafb

Differential Revision: D60845774

fbshipit-source-id: bb180bb2fd82b08b7c8af672da015276e12a29d6
2024-08-06 20:13:45 -07:00
Aman Sharma
55bf4a2d27 Move DSR-related APIs to QuicServerTransport
Reviewed By: mjoras

Differential Revision: D59768195

fbshipit-source-id: 8f0780019e5cd9bc3a3863fe30140b8da160c0bc
2024-07-31 10:48:06 -07:00
Matt Joras
e903f277da Introduce OptionalIntegral and OptionalMicros
Summary: We have a lot of optionals that are either integral values or std::chrono::microseconds. These end up wasting memory, where we can instead store sentinel values to encode whether the value is there or not. This reduces the effective range of the type by one value, but that is an acceptable tradeoff.

Reviewed By: kvtsoy

Differential Revision: D57684368

fbshipit-source-id: b406b86011f9b8169b6e5e925265f4829928cc63
2024-06-11 11:02:02 -07:00
Matt Joras
aefc9e369b Introduce quic::Optional
Summary:
The idea here is to make it so we can swap out the type we are using for optionality. In the near term we are going to try swapping towards one that more aggressively tries to save size.

For now there is no functional change and this is just a big aliasing diff.

Reviewed By: sharmafb

Differential Revision: D57633896

fbshipit-source-id: 6eae5953d47395b390016e59cf9d639f3b6c8cfe
2024-06-11 11:02:02 -07:00
Joseph Beshay
149dd723ac Support for setting a dscp value for outgoing packets
Summary:
Adds a transport setting for the dscp value. The transport combines this value with the ECN flags to enable ECT0/ECT1 marking.

Previous use-cases that are setting dscp values by overriding the whole ToS field should still work, but they will override the ECN bits. This is still the default behavior. Applications willing to use ECN, should use the dscp transport setting instead of applying the tos socket option directly.

Reviewed By: mjoras

Differential Revision: D58203586

fbshipit-source-id: 7dd83ca82273fadd4ae03b015387143e02101b6c
2024-06-07 19:26:28 -07:00
Ilango Purushothaman
67587db908 Convert Ack Rx timestamps disable list to allow list
Summary:
There are still some timestamps seen on dynamic content/connections and disabling timestamps per hostname doesn't scale well.
Instead, this diff will disable timestamps by default in Liger and enable only for static content connections based on a hostname filter (`scontent`, `video`, `cdninstagram`). The actual meat of the change is in `AdvancedHTTPSessionManager::shouldEnableQuicAckRxTimestamps` - everything else is mostly a replacement of disable to enable.

This is implemented for MNS in D58099124.

Reviewed By: jbeshay

Differential Revision: D58099125

fbshipit-source-id: 06118163fcc5d2e2ce90028810d6a9af5c7958a9
2024-06-05 17:21:55 -07:00
Hani Damlaj
ba4c80afbb elide unnecessary string constructors/copies
Summary: elides some string copies in QuicError

Reviewed By: sharmafb

Differential Revision: D57633227

fbshipit-source-id: 2de48895ae221e052438112371f10e50bf47353f
2024-05-26 11:58:55 -07:00
Hani Damlaj
d1f598e0dc elide unnecessary string contructors/copies
Summary: as title mentions, elides some unnecessary string constructors/copies

Reviewed By: sharmafb

Differential Revision: D57633229

fbshipit-source-id: 1a0e6128a4941b4aa1dbaec8d3d236a393f2a35f
2024-05-26 11:58:55 -07:00
Joseph Beshay
3b8782b4b2 Wire the EcnL4STracker to the QuicTransport when L4S is validated
Summary: As title.

Reviewed By: mjoras

Differential Revision: D56449545

fbshipit-source-id: daea00bb179b7f555e9386de5e4ee490be904f4a
2024-05-24 17:16:40 -07:00
Konstantin Tsoy
c34e6eb1e0 Check that transport is still open in maybeStopWriteLooperAndArmSocketWritableEvent();
Summary: We can throw in `writeSocketDataAndCatch()` and that would result in transport closure with drain (with drain keeping the socket alive), but the congestion controller would be reset in close: https://fburl.com/code/zxwfye5u and `maybeStopWriteLooperAndArmSocketWritableEvent()` trips over it later when executed in scope exit.

Reviewed By: mjoras

Differential Revision: D57728369

fbshipit-source-id: 51a4719ae97fab0e90e3ae093a3f56be5a096aff
2024-05-23 11:09:34 -07:00
Joseph Beshay
71b8af4b1a Add new batch writer SinglePacketBackpressureBatchWriter to retry failed writes
Summary:
The existing batch writers do not handle failed writes to the AsyncUDPSocket. A packet that fails to be written is detected as a packet loss later when feedback is received from the peer. This negatively impacts the congestion controller because of the fake loss signal, and artificially inflates the number of retransmitted packets/bytes.

This change adds a new batch writer (SinglePacketBackpressuretBatchWriter) that retains the buffers when a write fails. For subsequent writes, the writer retries the same buffer. No new packets are scheduled until the retried buffer succeeds.

Notes:
- To make sure that retry writes are scheduled, the write callback is installed on the socket when a buffer needs to be retried.
- The retries are for an already scheduled packet. The connection state reflects the timing of the first attempt. This could still have an impact on rtt samples, etc. but it this is a milder impact compared to fake losses/retranmissions.
- Any changes outside of the batch writer only impact the new batch writer. Existing batch writers do not use the fields and are not affected by the changes in this diff.

Reviewed By: kvtsoy

Differential Revision: D57597576

fbshipit-source-id: 9476d71ce52e383c5946466f64bb5eecd4f5d549
2024-05-22 15:35:32 -07:00
Konstantin Tsoy
bc6f00a4f0 Use writable events on the socket
Summary: Use writable events on the socket (disabled by default)

Reviewed By: jbeshay

Differential Revision: D56305786

fbshipit-source-id: f04dea326587268c96915f7a39338ff21dee4aec
2024-05-21 20:06:29 -07:00
Konstantin Tsoy
8aad008940 Use full class name for WRiteCallback to avoid ambiguity
Summary: Adding another WriteCallback in the next diff

Reviewed By: jbeshay

Differential Revision: D56371737

fbshipit-source-id: 4918ca2af3e49968ca0822d7a99309a05021fd10
2024-05-21 10:40:11 -07:00