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

19 Commits

Author SHA1 Message Date
Joseph Beshay
688d0ed31e Use adaptive thresholds for loss-detection through reordering and timeout
Summary:
Experiment with using adaptive thresholds for detecting packet losses through reordering or timeouts. When transportSettings.useAdaptiveLossThresholds is set to true, every time a spurious loss is detected, the thresholds will be updated to avoid marking similar packets as losses. In cases with a high degree of packet reordering, this improves bandwidth utilization significantly.

The useAdaptiveLossThresholds setting can be set using a new transport knob.

This was verified by transferring a 5 MB object across 50 Mbps link with high random packet reordering (emulated using netem)
```
+ tc -s qdisc replace dev veth7 root handle 1:0 netem rate 50Mbit limit 1250
+ tc -s qdisc add dev veth7 parent 1:0 handle 2: netem delay 15ms 5ms distribution normal limit 1250
```

Without adaptive thresholds, ~43% of sent bytes are retransmissions. Goodput is 2 Mbps.
With adaptive thresholds, ~3% of sent bytes are retransmissions. Goodput is ~17.5 Mbps.

Reviewed By: mjoras

Differential Revision: D33354584

fbshipit-source-id: 390bfb3398d499fcdf97a5cfd5654da3eeabed17
2022-01-07 18:42:12 -08:00
Brandon Schlinker
c051ff1299 AcksProcessedEvent observer event
Summary:
Providers observers with insight into ACKs received. Works for both client and server transport.

Attempts to prevent wasted memory by removing any allocated memory for ACK events if no packets in flight. In tandem, reduces allocs by _not_ removing allocated memory when packets are in flight (as this means more ACK events will occur soon...).

Reviewed By: jbeshay

Differential Revision: D31221280

fbshipit-source-id: 64b73aa74c757ebbfc27bb9c2a047d08dc7a77ca
2021-12-08 08:16:28 -08:00
Brandon Schlinker
20c17a882b PacketsWrittenEvent observer event
Summary:
Currently the `packetsWritten` observer event is only triggered when ACK-eliciting packets are written to the network. This change makes it so that the event is triggered even when non ACK-eliciting packets are written. In addition, this change increases the information provided in the observer event to reduce the processing that must be performed by observers.

More specifically, this diff makes the following changes:
- It creates two new structs — `WriteEvent` and `PacketsWrittenEvent` — and makes `PacketsWrittenEvent` and `AppLimitedEvent` inherit from `WriteEvent`, which contains the base set of fields that appear in both derived events. The base set of fields includes `writeCount` and the reference to the list of `OutstandingPackets`.
- A `PacketsWrittenEvent` is generated after each write loop during which packets are written.
  - The `PacketsWrittenEvent` records the total number of packets written (the sum of ACK-eliciting and non ACK-eliciting packets written) and the total number of ACK-eliciting packets written during the last loop. By exposing this information, observers can determine whether there is value in inspecting the list of `OutstandingPackets` before doing so.
  - In the future, I'll extend this event to also report the number of stream bytes written.
- It adopts a new builder pattern for observer events to make it easier to create instances of these structures:
  - We use this approach instead of aggregate initialization (specifically designated initializers via aggregate initialization), because designated initializers (C++20 feature, although supported by some compilers long before) is not yet supported on all platforms for which we need this code to compile.
  - I intend to change the other observer events to use this pattern as the number of arguments in some of their constructors makes them increasingly difficult to deal with.

Reviewed By: mjoras

Differential Revision: D31216724

fbshipit-source-id: 42ceb922d46ab0e0dc356f8726c2d0467a219587
2021-12-03 11:17:14 -08:00
Brandon Schlinker
d89e8d344e Observer stream events
Summary: Provide observers with visibility into stream events triggered by local and peer (e.g., new stream opened locally or by peer).

Reviewed By: mjoras

Differential Revision: D31886978

fbshipit-source-id: 7556fef0f336bd0f190b4474f1a7b0120aae6ef1
2021-12-03 11:17:14 -08:00
Sridhar Srinivasan
3a4783713a Use separate flags to enable app data sent callbacks
Summary:
Previously we were using a single flag appDataSentEvents to enable 3 callbacks
(startWritingFromAppLimited, packetsWritten and appRateLimited). This commit
creates separate flags to enable each of these callbacks, we have use-cases
where Observers might want only packetsWritten events and not the others.

Also, this commit refactors the logic to deliver these 3 callbacks to all
observers into a separate method so they can be unit tested easily.

Reviewed By: bschlinker

Differential Revision: D27925011

fbshipit-source-id: 7f7436dfc3d50c3abcb8ec121b221d20e30b0c4b
2021-05-02 23:07:47 -07:00
Sridhar Srinivasan
d2f005dc00 Add support for detecting start and stop of app rate limited scenarios
Summary:
Previously, we only had support for notifying observers when a QUIC socket
became application rate limited.

This change adds a similar notification when a socket does not become
application rate limited, i.e when the application *starts* writing data to the
socket - either for the first time on a newly established socket or after a
previous block of writes were written and the app had no more to write.
In addition, we include the number of outstanding packets (only those that are
carrying app data in them) so that observers can use this data to timestamp the
start and end of periods where the socket performs app data writes.

Reviewed By: yangchi

Differential Revision: D26559598

fbshipit-source-id: 0a8df7082b83e2ffad9b5addceca29cc03897243
2021-03-10 13:05:10 -08:00
Duc Nguyen
a38156a83d Add knob frame event to Observer
Summary: Extend the Observer to record events for all knob frame received.

Reviewed By: bschlinker

Differential Revision: D26325312

fbshipit-source-id: 810589d08be3614c8c091cccb7bb9fbdb5c65402
2021-03-03 07:26:27 -08:00
vaz985
3625d9e7af Adding spurious loss to instrumentationObserver (#186)
Summary:
Extended instrumentationObserver to record packets that were spuriously lost due to reordering or timeout.

Depends on https://github.com/facebookincubator/mvfst/issues/185

Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/186

Test Plan:
buck test //quic/api/test/...
buck test //quic/loss/test/...
buck test //quic/state/test/...

Proxygen canary on ELB and FLB

Reviewed By: bschlinker

Differential Revision: D24072374

Pulled By: sridharsrinivasan86

fbshipit-source-id: 2a22eeae7eb5c1bab405e8c5b7f4b96dff5afb59
2021-01-21 11:53:00 -08:00
Sridhar Srinivasan
bd1ed4b7c0 Make the important Observer callbacks configurable
Summary:
Given the large number of callbacks that are being triggered from the Observer
this change makes it possible to enable through a simple config, just the
subset of callbacks that a consumer is interested in receiving.

Observer and Socket Lifecycle callbacks are enabled by default, they are not
configurable.

Reviewed By: bschlinker

Differential Revision: D25879382

fbshipit-source-id: abe79ed92e958ddc96475c347f8ec7204400cdfa
2021-01-13 15:35:06 -08:00
Sridhar Srinivasan
53a29b86f9 Deprecate LifecycleObserver and InstrumentationObserver classes in favor of unified Observer class
Summary:
As titled. This is t he final diff that comples the migration to a unified
Observer interface.

Reviewed By: bschlinker

Differential Revision: D25850627

fbshipit-source-id: a9b9d83a6f6d0ba17d2aac8dbf3bacf74c8e16cb
2021-01-13 15:35:06 -08:00
Sridhar Srinivasan
27fe474171 Migrate the QUIC and TransportMonitor libraries to use the new unified Observer callback class
Summary:
We were using the LifecycleObserver and InstrumentationObserver classes
separately, to generate and receive callbacks.

This change migrates both these to use the unified Observer callback class and
adjusts the unit tests.

Reviewed By: bschlinker

Differential Revision: D25845845

fbshipit-source-id: c489400f5d70bccadbcc1d957136c5ade36b65ff
2021-01-13 15:35:06 -08:00
Sridhar Srinivasan
c29f98abae Create a unified Observer callback class, merge LifecycleObserver and InstrumentationObserver into it
Summary:
Here, we introduce a new Observer class that is a container for all the
callbacks that the QUIC Socket layer will invoke when interesting events happen
during the lifetime of the socket.

This class contains a union of all callbacks that are present in the
LifecycleObserver and InstrumentationObserver classes.

This is done in an effort to merge both the callback classes into one,
for easier maintainability. LifecycleObserver and InstrumentationObserver
are left behind temporarily, they will be deprecated in a future diff (up the stack).

Reviewed By: bschlinker

Differential Revision: D25845835

fbshipit-source-id: 425c865146ca061063cf6e463f8da92395f119f2
2021-01-13 15:35:06 -08:00
Sridhar Srinivasan
de8ec06a4b Invoke life cycle observer callbacks during event base attach and
Summary: Inform LifecycleObservers when an EventBase is attached or detached from a QuicSocket.

Reviewed By: bschlinker

Differential Revision: D24294254

fbshipit-source-id: a606ad5ae4d4cbe3095e6ae32d6c74713325ad08
2020-10-23 12:01:33 -07:00
Xiaoting Tang
6a782bda39 Add pmtuProbingStarted event to instrumentation observer
Summary: ^

Reviewed By: bschlinker

Differential Revision: D24464391

fbshipit-source-id: c976b9496031290cb4b6c3f29862c1f7d4ebf065
2020-10-22 10:18:57 -07:00
Xiaoting Tang
6a5be457ab Add instrumentation callback for pmtu blackhole and upperbound
Summary:
This adds two events that we care mostly about d6d's perf: detecting blackhole
and detecting upperbound.

Reviewed By: bschlinker

Differential Revision: D23972141

fbshipit-source-id: bb6db6d1548ecddc9b255149e04a4c4844e9ec54
2020-09-30 17:14:41 -07:00
vaz985
185a6730b6 Exposing quicSocket to observers (#185)
Summary:
Giving more access to the current state of the connection by exposing the socket.

Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/185

Reviewed By: yangchi

Differential Revision: D23924861

Pulled By: bschlinker

fbshipit-source-id: 16866a93e58b6544e25d474a51ca17fab9ffdc55
2020-09-29 23:24:24 -07:00
vaz985
5007e87d42 Reverting LostPacket to save packet (#184)
Summary:
In https://github.com/facebookincubator/mvfst/issues/178 we actually want to get the original packet. Reverting to expose the packet.

Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/184

Differential Revision: D23860183

Pulled By: bschlinker

fbshipit-source-id: 1ae94f04f3bf10469bb59def30cb45454223e116
2020-09-23 08:51:47 -07:00
vaz985
a8d5c156a1 Adding packet rtt sampling to instrumentationObserver (#178)
Summary:
Due to high number of RTT samples I refactored the OutstandingPacket to
split the packet data and packet metrics. We know have access to metrics
without the need of saving the packet data.

Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/178

Reviewed By: mjoras

Differential Revision: D23711641

Pulled By: bschlinker

fbshipit-source-id: 53791f1f6f6e184f37afca991a873af05909fbd2
2020-09-22 18:39:00 -07:00
Kanthi Nagaraj
327af996e2 Adding packet loss event detection to instrumentationobserver
Summary:
`InstrumentationObserver` is owned by `QuicSocket` now. However, to capture packet loss signal, we need it in `QuicConnectionState`. So, I refactored the code a little bit to make this easy. Changes in this code:
(a)  Moved the definition of `InstrumentationObserver` and `LifeCycleObserver` to
 a separate header `Observer.h`.
(b) Moved the vector of `InstrumentationObserver`s from `QuicSocket` to `QuicConnectionState`.
(c) Added a callback in `conn->pendingCallbacks` when a packet loss is detected

Reviewed By: bschlinker

Differential Revision: D23018569

fbshipit-source-id: e70d954839bdb70679ecd52d2bd1a6a6841f6778
2020-09-11 17:54:58 -07:00