1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-09 20:42:44 +03:00
Commit Graph

16 Commits

Author SHA1 Message Date
Xiaoting Tang
2d00d56fbd Put outstanding packets, events and associated counters in one class
Summary: ^

Reviewed By: yangchi

Differential Revision: D21956286

fbshipit-source-id: 305b879ad11df23aae8e0c3aac4645c0136b3012
2020-06-10 12:45:28 -07:00
Matt Joras
49d552c3f4 Store unique_ptr<StreamBuffer> in retransmissionBuffer.
Summary:
As it turns out, the extra indirection from storing a unique_ptr is not worse than the gain from using an `F14ValueMap` versus an `F14VectorMap`.

This reduces the `find` cost measurably in profiles, and doesn't appear to have any real negative effects otherwise.

Reviewed By: yangchi

Differential Revision: D20923854

fbshipit-source-id: a75c4649ea3dbf0e6c89ebfe0d31d082bbdc31fd
2020-04-08 14:35:16 -07: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
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
Matt Joras
b6e134fdee Use F14FastMap as the retranmission buffer.
Summary:
The retransmission buffer tracks stream frame data we have sent that is currently unacked. We keep this as a sorted `deque`. This isn't so bad for performance, but we can do better if we break ourselves of the requirement that it be sorted (removing a binary search on ACK).

To do this we make the buffer a map of offset -> `StreamBuffer`.

There were two places that were dependent on the sorted nature of the list.

1. For partial reliablity we call `shrinkBuffers` to remove all unacked buffers less than an offset. For this we now have to do it with a full traversal of the retransmission buffer instead of only having to do an O(offset) search. In the future we could make this better by only lazily deleting from the retransmission buffer on ACK or packet loss.

2. We used the start of the retransmission buffer to determine if a delivery callback could be fired for a given offset. We need some new state to track this. Instead of tracking unacked buffers, we now track acked ranges using the existing `IntervalSet`. This set should be small for the typical case, as we think most ACKs will come in order and just cause existing ranges to merge.

Reviewed By: yangchi

Differential Revision: D18609467

fbshipit-source-id: 13cd2164352f1183362be9f675c1bdc686426698
2019-11-27 00:25:25 -08:00
Aman Sharma
69ac8aeb62 De-templatize stream state machine logic
Summary: The state machine logic is quite abstruse, this modifies it to make it more readable.

Reviewed By: siyengar

Differential Revision: D18488301

fbshipit-source-id: c6fd52973880931e34904713e8b147f56d0c4629
2019-11-19 20:18:11 -08:00
Yang Chi
fc71487c81 Reorder Quic StreamStateMachineTestCases
Summary:
No-op change; This is so that test cases of the same test classes are
together.

Reviewed By: sharma95

Differential Revision: D18000631

fbshipit-source-id: 84690509e66fa6e1279b978b8f665bdbf09492b1
2019-10-18 15:54:26 -07:00
Subodh Iyengar
68c332acb1 Use custom variant type for write frames
Summary:
Use the custom variant type for write frames as well, now that
we use them for read frames.

Reviewed By: mjoras

Differential Revision: D17776862

fbshipit-source-id: 47093146d0f1565c22e5393ed012c70e2e23d279
2019-10-07 22:43:31 -07:00
Yang Chi
f5ca7ef590 Add new retransmission buffer directly at the end of buffer list
Summary:
The retransmission buffer list is sorted by offset. New written
always has higher offset than existing ones. Thus the binary search isn't
necessary.

Reviewed By: mjoras

Differential Revision: D17477354

fbshipit-source-id: d413a5c84c3831b257d5c1e6375bec56a763926b
2019-09-24 15:15:54 -07:00
Viktor Chynarov
594a98be7a Stop setting clientConnId in ServerStateMachine [2/x]
Summary:
Removes clientConnId completely from ServerConnectionIdParams.

This diff first fixes an incorrect assumption; it calls
`shortHeader.getConnectionId()` which is actually the destination id (server)
not the client connection id.

Next, this entire block is unnecessary, because this will be called after
the transport is created, so the clientConnectionId will always be set.

This also setsconn.serverConnectionId earlier (shouldn't depend on
connClientId).

Reviewed By: yangchi

Differential Revision: D16792866

fbshipit-source-id: 537ba12baa9939c9d5512e46eb914c1d3a7a9aa2
2019-08-23 15:06:02 -07:00
Konstantin Tsoy
8e2b621f63 Match ack frames to retransmission buffers properly
Summary:
With partial reliability we adjust retransmission queue on skips; we need to account for that when we match buffers in retransmission queue.

In fully reliable mode an ack frame must always match a single buffer from re-tranmission queue (offset, length and eom).
In partially reliable mode we can run into two more scenarios in addition to the above:
* re-transmisison buffer for which the ack frame arrived has been removed fully
* re-transmisison buffer for which the ack frame arrived has been removed partially

If full buffer is missing - ignore the ack.
If part of the buffer is missing, make sure that the adjusted offset and length match to that found in the ack frame.

Reviewed By: yangchi

Differential Revision: D15301304

fbshipit-source-id: f281fa30957c1c13c42c05684984f9a1acaa4e34
2019-05-15 13:00:23 -07:00
Alan Frindell
6603c4f452 Stop sending rst on rst
Summary: This is no longer part of the spec.  It's up to the application how to handle reset

Reviewed By: lnicco

Differential Revision: D15107164

fbshipit-source-id: 2a1fe0c552bd7f054e84ef86a01a78c379b0a483
2019-05-06 14:05:31 -07:00
Alan Frindell
90e5e1b3f1 Split stream state machine into send and receive state machines
Summary: This is step 1 for removing reset on reset, since the send side may need to transition to waiting for a reset ack while the read side is an any state.

Reviewed By: lnicco

Differential Revision: D15075849

fbshipit-source-id: 1e094942a8a1ca9a01d4161cd6309b4136a9cfbf
2019-05-06 14:05:31 -07:00
Konstantin Tsoy
f5310e174c Retransmission buffer may be empty on ACK frame processing
Summary:
There is a race condition with min data frame (skip) and ack frame when it comes to retransmission buffer.
Sometimes, we receive both min data and ack frames, the min data frame gets processed first and it clears out retransmission buffer (expected), but then we get to process the ack frame and there is that CHECK that expects the retransmission buffer to have at least one unacked buffer in it - there is none and then the app crashes.

Reviewed By: siyengar

Differential Revision: D14908630

fbshipit-source-id: d8bcd70291e1fd3618065fdeb44bedc6ac66bcaa
2019-04-30 11:11:48 -07:00
udippant
79032c7b9b fbshipit-source-id: f498ac5e677b2931d937ba78edd4373ba04dca2a 2019-04-25 21:33:43 -07:00
udippant
50d4939e9e Initial commit of mvfst 2019-04-22 23:42:46 -07:00