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

28 Commits

Author SHA1 Message Date
Yang Chi
d7d19c74b5 Stop tracking pure ack packets in Quic
Summary:
Previously we track them since we thought we can get some additional
RTT samples. But these are bad RTT samples since peer can delays the acking of
pure acks. Now we no longer trust such RTT samples, there is no reason to keep
tracking pure ack packets.

Reviewed By: mjoras

Differential Revision: D18946081

fbshipit-source-id: 0a92d88e709edf8475d67791ba064c3e8b7f627a
2019-12-12 13:20:09 -08:00
Matt Joras
cc73527122 Store stream state in F14FastMap
Summary: `F14FastMap` is faster than `F14NodeMap` as it requires one fewer allocations. We don't need the reference stability of `F14NodeMap`. We need to make the `QuicStreamLike` movable to use it.

Reviewed By: siyengar

Differential Revision: D18681242

fbshipit-source-id: e155d0bdec905c6a2f42d7169741c130bc9cc86d
2019-11-27 00:25:25 -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
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
Yang Chi
fc828aa32b make it possible to set Quic initial RTT via TransportSettings
Summary: as title

Reviewed By: sharma95

Differential Revision: D18225812

fbshipit-source-id: 4ce0561fd7fbc31b61818d42f9f7efa31ad0b191
2019-10-31 21:51:55 -07:00
Viktor Chynarov
3dd52b323a Create helper to generate server-side connection id [1/x]
Summary:
My goal in this stack is to properly support the functionality of issuing new
connection ids.

There are at least three cases in which this is done (server-side):
* generate initial server connection id based on host id parameters
* provide several NewConnectionId frames to the client (for use with
   migration) after handshake
* responding to RetireConnectionIdFrame and issuing more NewConnectionId frames
  as needed

**Changes**:
* move connIdAlgo away from parent ConnectionStateBase to just
  QuicServerConnectionState
* create virtual function in ConnectionStateBase to generate
  folly::none ConnectionIdData by default,
  and server subclass will generate a new server id
* add unit tests to test this behaviour.

Intended for Junqi's diff of server issuing 7 new connection ids
to be rebased on this (D15178642)

Reviewed By: yangchi

Differential Revision: D17840780

fbshipit-source-id: 1a01077742d01d058eb0a726c4c9c44e39eafb24
2019-10-28 17:46:58 -07:00
Matt Joras
88aec617ba Drop loss buffer when canceling retransmission and handshake retx.
Summary: This is just an oversight. By the time we do this things could be moved to the loss buffer if the packets were marked as lost before we got our first 1-rtt ACKs. Without this we will retransmit a lost initial indefinitely.

Reviewed By: siyengar

Differential Revision: D17989236

fbshipit-source-id: 5215bf71517f019162b307f72221877e2145e2cb
2019-10-23 12:44:53 -07:00
Yang Chi
9247b8f49b Change Quic qlogger vantage point to enum
Summary: To prevent adhoc string passed in

Reviewed By: sharma95

Differential Revision: D18013615

fbshipit-source-id: 6f5512468755c2b1ecbba3ba42188fa22f4e94b9
2019-10-23 10:16:58 -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
Subodh Iyengar
04baa15a04 Custom variant type for packetheader
Summary:
Make a custom variant type for PacketHeader. By not relying on boost::variant
this reduces the code size of the implementation.

This uses a combination of a union type as well as a enum type to emulate a variant

Reviewed By: yangchi

Differential Revision: D17187589

fbshipit-source-id: 00c2b9b8dd3f3e73af766d84888b13b9d867165a
2019-09-19 17:31:47 -07:00
Luca Niccolini
cf842aab47 cleanup some unused includes and using
Reviewed By: yangchi

Differential Revision: D16976466

fbshipit-source-id: c1fc2ee0795997f498ac7431542bbfbf1f0d2fb2
2019-08-24 02:03:39 -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
Bonnie Xu
db349541f2 Update qlog format to be more complete
Summary: Update qlog format to be more complete. Adding the summary section (with extra fields like title, description, etc). This diff is just to make the format more on par with Robin's schema.

Reviewed By: mjoras

Differential Revision: D16499808

fbshipit-source-id: 56cfbb95404f7e3c6638bffda18b53f7d83048a1
2019-07-30 12:48:57 -07:00
Bonnie Xu
fe9c160620 Add packetAck event
Summary: Add packetAck event for qlog.

Reviewed By: sharma95

Differential Revision: D16423098

fbshipit-source-id: 708adf8a888f6abb5b565c5a8920ccfed889b611
2019-07-25 13:51:24 -07:00
Bonnie Xu
10f1b6c2a3 Add packetsLost event
Summary: Add packetsLost event for qlog.

Reviewed By: yangchi

Differential Revision: D16293237

fbshipit-source-id: 9eb33e29f9f5aa944d6452cd85b93c98ba40831d
2019-07-18 14:11:21 -07:00
Bonnie Xu
d25b0b86b5 Add lossAlarm event
Summary: Add lossAlarm event for qlog.

Reviewed By: yangchi

Differential Revision: D16287997

fbshipit-source-id: e2ab925b5abf4ea85ad08749432b85ee675a93a8
2019-07-18 11:28:33 -07:00
Yang Chi
42b2617e44 Handle lossTime before crypto timer in Quic
Summary:
Currently we handle crypto timer before loss timer. And currently loss
time is for AppData only since for the other two Packet Number spaces, crypto
timer will take care of it. This diff extends loss times to 3 loss times, and
handle them before handle crypto timer. The rational here is that loss time is
shorter than crypto timer, so this will make retransmission during crypto
handshake more aggressive. For app data, this diff doesn't change anything.

Reviewed By: sharma95

Differential Revision: D15552405

fbshipit-source-id: bd5c24b0622c72325ffdea36d0802d4939bae854
2019-06-17 18:07:28 -07:00
Yang Chi
e94511a924 Fix quic persistent congestion condition
Summary:
This was a bug in draft-19. PR #2557 fixed
that: https://github.com/quicwg/base-drafts/pull/2557/files.

Reviewed By: sharma95

Differential Revision: D15609122

fbshipit-source-id: 16d73e3af80185858e00dbfc2d6ebef4f867970c
2019-06-06 22:22:05 -07:00
Amaury Séchet
f26cd1f62d Add a bridge to fizz::Aead (#12)
Summary:
This introduce quic::Aead as a simple typedef to fizz::Aead and update the codebase to use quic::Aead . This should not impact the functionality of the code in any way.

This is a first step toward introducing an interface that is specific for mvfst so that mvfst can swap fizz for something else.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/12

Reviewed By: JunqiWang

Differential Revision: D15335324

Pulled By: mjoras

fbshipit-source-id: fef166a9a5c2cbae08ad9511d0abd749f330c221
2019-05-29 11:54:08 -07:00
Bonnie Xu
f4ae0a1efd Updated files to change syntax.
Summary: Changed existing chrono syntax to chrono_literals syntax.

Reviewed By: mjoras, sharma95

Differential Revision: D15374649

fbshipit-source-id: 40033e90cca226266ef85e4fec629f290bc5dae6
2019-05-20 12:10:46 -07:00
Yang Chi
ca31b43564 rename timeoutBasedRetxCount to timeoutBasedRtxCount
Summary: Just to make it consistent with other var names in quic

Reviewed By: siyengar

Differential Revision: D15415528

fbshipit-source-id: 917159d6ccf86cf34612386d128d6b6d5bf62de6
2019-05-20 11:22:24 -07:00
Yang Chi
c35e3d6e84 Rename RTO to PTO
Summary: To conform to the current specs.

Reviewed By: mjoras

Differential Revision: D15215018

fbshipit-source-id: 4dcc495aea1cd7cebf2bc84f7367cb2e4a55df19
2019-05-06 18:50:35 -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
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