Summary:
This should be safe, as by the time we have successfully decrypted a handshake packet there's no more initial data.
The caveat here, I suppose, is that we are now relying on an implicit ACK of the initial instead of an explicit RTT signal.
Reviewed By: yangchi
Differential Revision: D22667820
fbshipit-source-id: 8d34e063d4bf4bb435db09694153fbaa0f061be1
Summary: set this to be default behavior
Reviewed By: vchynarov
Differential Revision: D22432915
fbshipit-source-id: 3ac527b206ccb798d63336bf559f7d164e2959c7
Summary:
The problem with Ping being a simple frame:
(1) All SimpleFrames are in the same scheduler. So sending ping means we may
also send other frames which can be problematic if we send in Initial or
Handshake space
(2) Ping isn't retranmisttable. But other Simple frames are. So we are
certainly setting this wrong when we send pure Ping packet today.
That being said, there are cases where we need to treat Ping as retransmittable.
One is when it comes to update ack state: If peer sends us Ping, we may want to
Ack early rather than late. so it makes sense to treat Ping as retransmittable.
Another place is insertion into OutstandingPackets list. When our API user sends
Ping, then also add a Ping timeout. Without adding pure Ping packets into OP list,
we won't be able to track the acks to our Pings.
Reviewed By: mjoras
Differential Revision: D21763935
fbshipit-source-id: a04e97b50cf4dd4e3974320a4d2cc16eda48eef9
Summary:
On loss timer, currently we knock all handshake packets out of the OP
list and resend everything. This means miss RTT sampling opportunities during
handshake if loss timer fires, and given our initial loss timer is likely not a
good fit for many networks, it probably fires a lot.
This diff keeps handshake packets in the OP list, and add packet cloning
support to handshake packets so we can clone them and send as probes.
With this, the handshake alarm is finally removed. PTO will take care of all
packet number space.
The diff also fixes a bug in the CloningScheduler where we missed cipher
overhead setting. That broke a few unit tests once we started to clone
handshake packets.
The writeProbingDataToSocket API is also changed to support passing a token to
it so when we clone Initial, token is added correctly. This is because during
packet cloning, we only clone frames. Headers are fresh built.
The diff also changed the cloning behavior when there is only one outstanding
packet. Currently we clone it twice and send two packets. There is no point of
doing that. Now when loss timer fires and when there is only one outstanding
packet, we only clone once.
The PacketEvent, which was an alias of PacketNumber, is now a real type that
has both PacketNumber and PacketNumberSpace to support cloning of handshake
packets. I think in the long term we should refactor PacketNumber itself into a
real type.
Reviewed By: mjoras
Differential Revision: D19863693
fbshipit-source-id: e427bb392021445a9388c15e7ea807852ddcbd08
Summary:
This implements the connection ID validation via transport parameters. Note we don't do anything with the retry transport parameter yet.
This will probably require further surgery to tests when we want the MVFST version to do this, but for now I'm punting on that test plumbing.
This retains support for h3-27.
Reviewed By: yangchi
Differential Revision: D22045631
fbshipit-source-id: e93841e734c0683655c751d808fd90b3b391eb3e
Summary: Additionally, it's not actually valid to have an initial CID < 8 in length.
Reviewed By: lnicco
Differential Revision: D22008057
fbshipit-source-id: 4e65c8f939705d116b252199bf048da43269a663
Summary: I think this is still within specs requirement
Reviewed By: mjoras
Differential Revision: D21648049
fbshipit-source-id: 990e84740e1022955d7dd8957ce9131602536a63
Summary:
Now we won't have a zero PTO and we will properly clear out the outstanding packets.
Note that this cipher dropping is not what the draft prescribes, instead dropping both the initial and handshake ciphers when we know 1-rtt communication is functioning.
Reviewed By: yangchi
Differential Revision: D20388737
fbshipit-source-id: 0b89eb80c8faa796ab09eda3eaa10a00dcf7bae9
Summary: We may have a bug in recvmmsg usage, so keep this around.
Reviewed By: lnicco
Differential Revision: D21246413
fbshipit-source-id: e39d74b8e856339d0022ba403969b83dc29ff63f
Summary:
When we can recvmmsg, we have to provide the full number of buffers we could potentially receive. This could be fewer than are actually returned. Without this diff those buffers are immediately freed. Instead store them in a vector, and reuse them the next time.
Additionally move the storage to be per-QuicClientTransport, as there is no need to recreate these each time wee call recvmmsg.
Reviewed By: yangchi
Differential Revision: D21158571
fbshipit-source-id: 21daa3d06e58b0156cc785e1ec0013773aeb4360
Summary: This is essentially duplicated code, as if recvmmsg is not available the netops wrapper will simulate it with multiple calls.
Reviewed By: yangchi
Differential Revision: D21150890
fbshipit-source-id: 0e48e8a80f4ddc90df69c3e57cecc96dbc3f0913
Summary:
This adds a QLog event for Retry packets. There are three fields:
- packetType: This is always "RETRY"
- packetSize: The size of the entire packet
- tokenSize: The size of the retry token
Reviewed By: mjoras
Differential Revision: D20910017
fbshipit-source-id: feb4abbf0d15ff7b24fd11f00634e9da84bf8333
Summary: The other two receive paths already do this. Our packet parsing code assumes we don't have a zero length payload.
Reviewed By: yangchi
Differential Revision: D20987674
fbshipit-source-id: d4c23b5575c64e9ef436fa9f3695d08d493a1a5a
Summary: This makes the change for the client to use stateless retries
Reviewed By: mjoras
Differential Revision: D19657433
fbshipit-source-id: d4b34087d15e49153860a7833ed54e28c6cd6777
Summary:
When read error happens, the QuicClientTransport currently ignore it,
which means we may have a un-readable transport and keep reusnig it. This diff
close it without draining. This is behind a transprot setting flag.
Reviewed By: mjoras
Differential Revision: D20678062
fbshipit-source-id: 5253940c973dfedf8cb02fe0e4cb331ee7ce4539
Summary:
The cache entry contains the key itself, which is fizz dependent and crypto agnostic infos. We are moving the crypto agnostic infos to the Handshake. Next step is to move the crypto specific infos to the proper handshake subclass.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/113
Reviewed By: mjoras
Differential Revision: D20469126
Pulled By: yangchi
fbshipit-source-id: 25db463ef8d0e982ef5e47ef147e7e9b6c859cb5
Summary:
This ensures they are available to the whole stack rather than the transport only. The validator needs it in the server case, and will soon need it in the client case, so that seems appropriate to make it available.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/117
Reviewed By: yangchi
Differential Revision: D20536366
Pulled By: mjoras
fbshipit-source-id: a76d369c0a82b9be1f985aed1f33f7a6b338a2ae
Summary:
The cache is obviously dependent on the crypto that is used. It's management needs to be moved down to part of the code that are specific to the crypto used. As a first step, we remove the cache from the transport, and use the one from the fizz context - if available - through the handshake.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/111
Reviewed By: mjoras
Differential Revision: D20463307
Pulled By: yangchi
fbshipit-source-id: c14908a10c80a977096f1ec145359f60899f8777
Summary: Unqualify nearly all uses of `folly::AsyncUDPSocket::ReadCallback::OnDataAvailableParams` since nearly all uses already have `OnDataAvailableParams` in scope.
Differential Revision: D20450063
fbshipit-source-id: c0fd49a7eace44a6edc8086762c44753224788dd
Summary:
All the state already moved there anyways, and this is closely related to the Psk cache management, which is also moving away from QuicClientTransport.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/109
Reviewed By: mjoras
Differential Revision: D20463300
Pulled By: yangchi
fbshipit-source-id: e9f0dc6285ccc6fd8cdc98d0e3579e6af8b00306
Summary:
Some of these parameters are already there. The other need to be move so that the can be accessed when caching new public keys.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/104
Differential Revision: D20250783
Pulled By: mjoras
fbshipit-source-id: 3e8b6c9e8945fb5ae1ea71a8af1512bfe0616736
Summary: In the constructor of FileQlogger adds a bool that sets streaming mode. If it's set it creates a thread that reads events from the log and immediatly outputs them to an output file.
Reviewed By: mjoras
Differential Revision: D20250881
fbshipit-source-id: 2af3ff0aeaa5b62f90b0c01570c96c92fdab4412
Summary:
The result of `errnoStr` is often converted to `std::string` so returning `fbstring` adds an extra copy. Make it return `std::string` instead. This will also allow removing dependency between `String.h` and `FBString.h`.
(Note: this ignores all push blocking failures!)
Reviewed By: yfeldblum
Differential Revision: D20195395
fbshipit-source-id: 0dc65f1566911156be3fcb715dd105c58f2a8822
Summary:
The transport parameters format changed in draft 27. It is now self describing via varints.
This diff retains support for the old encoding and does not iterate the mvfst version.
Reviewed By: lnicco
Differential Revision: D20149977
fbshipit-source-id: c6fa9c226f859ed81ca83ada5a8bc5832b4a3388
Summary:
Similar to the exiting empty write loop callback. The new API will
trigger when we read from socket but back with empty hands.
Reviewed By: lnicco
Differential Revision: D20130432
fbshipit-source-id: 9b61310b4ea4c5c7999742c5a8761a831f20f7b7
Summary:
This eliminatees some tech debt by completely removing the notion of version from the core transport parameters structure and the app token for zero rtt.
Note that for the draft-27 changes we will need to temporarily re-introduce it, but to a different layer (the extension encoding itself).
Reviewed By: JunqiWang
Differential Revision: D20073578
fbshipit-source-id: 2b55af621566bf1c20e21dd17251116de1788fa0
Summary: This implements the handshake done signal and also cipher dropping.
Reviewed By: yangchi
Differential Revision: D19584922
fbshipit-source-id: a98bec8f1076393b051ff65a2d8aae7d572b42f5
Summary: generic API for setting socket Options on both client and server
Reviewed By: yangchi
Differential Revision: D19763928
fbshipit-source-id: 7078eb8738aebc192bbace2498aaf9489526efff
Summary:
Remove all the stream events, packet/udp recv event and ack event.
They are >40% of the events.
Reviewed By: mjoras
Differential Revision: D19466165
fbshipit-source-id: 3a20b201e630527e6d25d1a14f0f520728190d50
Summary:
New QUIC draft no longer has this limitation for connection-id, and allows
connid of len 0 -> 20.
This diff removes the constraints. I still kept the requirement for
*server-chosen* conn-id
Reviewed By: mjoras, lnicco
Differential Revision: D19507366
fbshipit-source-id: 4c73f45617f40b29d47d2d86b7598f6c95588d0a