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
Summary: Beside the beginning of a connection where we do handshake and have packets from all 3 spaces can possibly in the outstanding packet list, for most parf of the connection, this list only has packets from AppData space. That means the packet numbers are strictly ascending for most parf of a connection. Then linear search from back can potentially reduce the number of times we do the packet number compare.
Reviewed By: mjoras
Differential Revision: D17500221
fbshipit-source-id: 15eafa439e889e45d3e4a84d9e9dad0e2c743c9d
Summary:
We always generate a new std::function object for such header
builders. It's ok to move them.
Reviewed By: mjoras
Differential Revision: D17479758
fbshipit-source-id: 88fbdbc5c7b7403fffd642d8f1f84e1cd57115fa
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
Summary:
Implement sending stream limit updates in a windowed fashion, so that as a peer exhausts its streams we will grant it additional credit. This is implemented by having the stream manager check if an update is needed on removing streams, and the api layer potentially sending an update after it initiates the check for closed streams.
This also makes some driveby changes to use `std::lower_bound` instead of `std::find` for the sorted collections in the stream manager.
Reviewed By: yangchi
Differential Revision: D16808229
fbshipit-source-id: f6e3460d43e4d165e362164be00c0cec27cf1e79
Summary: These were changed to varints. To support this we need to do some extra horrible version plumbing. I don't want to keep this long term but it works for now.
Reviewed By: yangchi
Differential Revision: D16293568
fbshipit-source-id: a9ea9083be160aa3e6b338a7d70d7f00e44ec5ab
Summary:
This diff adds a DebugState in the QuicConnectionState to track the
reason we schedule transport WriteLooper to run, the reason we end up not
writing and the number of times such write happens consecutively. And when it
reaches a predefined limit, we trigger a callback on a loop detector interface.
Reviewed By: kvtsoy
Differential Revision: D15433881
fbshipit-source-id: d903342c00bc4dccf8d7320726368d23295bec66
Summary: Rename `add` to `addPacket`, since `add` is an ambiguous function name, especially as we include more events.
Reviewed By: sharma95
Differential Revision: D16102141
fbshipit-source-id: 73196a5f1bcc681e3bb0a26fd9edaf34f59bf710
Summary:
This ensure a lot of code do not depend on fizz anymore.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/26
Reviewed By: mjoras, JunqiWang
Differential Revision: D16030663
Pulled By: yangchi
fbshipit-source-id: a3cc34905a6afb657da194e2166434425e7e163c
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
Summary:
Current app-limited is defined as the connection doesn't have a no
non-control stream. I'm changing this to be app-idle. And app-limited will be
changed to a state in connection where app isn't sending bytes fast enough to
keep congestion controller probing higher bandwidth.
Reviewed By: mjoras
Differential Revision: D15456199
fbshipit-source-id: e084bc133284ae37ee6da8ebb3c12f505011521e
Summary:
There is a bug in how we decide if we should schedule a write loop due
to sending Acks. Currently if one PN space has needsToWriteAckImmediately to
true and another PN space has hasAcksToSchedule to true, but no PN space
actually has both to true, we will still schdeule a write loop. But that's
wrong. We won't be able to send anything in that case. This diff fixes that.
Reviewed By: JunqiWang
Differential Revision: D15446413
fbshipit-source-id: b7e49332dd7ac7f78fc3ea28f83dc49ccc758bb0
Summary: Just to make it consistent with other var names in quic
Reviewed By: siyengar
Differential Revision: D15415528
fbshipit-source-id: 917159d6ccf86cf34612386d128d6b6d5bf62de6
Summary:
Using FOLLY_MOBILE macro to be able to exclude
quic trace generation on mobile
Reviewed By: mjoras
Differential Revision: D14609755
fbshipit-source-id: 2d5d624703a5b58c28cb533e3c2cc20d3a5c3d45
Summary: To conform to the current specs.
Reviewed By: mjoras
Differential Revision: D15215018
fbshipit-source-id: 4dcc495aea1cd7cebf2bc84f7367cb2e4a55df19
Summary:
So this trace is shared by all CongestionControllers. This also
changes what we log into the trace.
Reviewed By: siyengar
Differential Revision: D15184916
fbshipit-source-id: 6cbeb02ee2d24a6bf8d705ff883f5a57603988e7
Summary:
This diff implements the handling of retry packets. As per the spec:
1. A client MUST accept and process at most one Retry packet for each connection attempt. After the client has received and processed an Initial or Retry packet from the server, it MUST discard any subsequent Retry packets that it receives.
2. Clients MUST discard Retry packets that contain an Original Destination Connection ID field that does not match the Destination Connection ID from its Initial packet. This prevents an off-path attacker from injecting a Retry packet.
3. The client responds to a Retry packet with an Initial packet that includes the provided Retry Token to continue connection establishment.
4. A client sets the Destination Connection ID field of this Initial packet to the value from the Source Connection ID in the Retry packet. Changing Destination Connection ID also results in a change to the keys used to protect the Initial packet. It also sets the Token field to the token provided in the Retry.
Reviewed By: mjoras
Differential Revision: D14464508
fbshipit-source-id: 212539a588378fb0d795caaec150959680172781
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