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

153 Commits

Author SHA1 Message Date
Konstantin Tsoy
377260f704 Remove d6d code
Summary: we're not using it

Reviewed By: mjoras

Differential Revision: D43482344

fbshipit-source-id: 05ac6792848e32e7c1bcf53a2df172852b5def62
2023-02-23 20:11:24 -08:00
Joseph Beshay
001e32e888 Fix variable name typo: s/dataPlain/dataPlane
Summary: Just fixes the typo!

Reviewed By: nikhildl12

Differential Revision: D43291768

fbshipit-source-id: 970b4ffd2294ac79988c53d5904f2a8d70a59b82
2023-02-15 11:41:11 -08:00
Konstantin Tsoy
360962fd45 Bail early on empty scheduler when writing
Reviewed By: jbeshay

Differential Revision: D42645293

fbshipit-source-id: 5e73ca2ad462b8a7edae287cefe12a6260c0030d
2023-01-27 16:43:07 -08:00
Matt Joras
1275798146 Make the AckState for Initial/Handshake a unique_ptr
Summary:
We don't need to carry these states after the handshake is confirmed, so make them pointers instead. This will facilitate adding a structure to the AckState for tracking duplicate packets.

(Note: this ignores all push blocking failures!)

Reviewed By: hanidamlaj

Differential Revision: D41626895

fbshipit-source-id: d8ac960b3672b9bb9adaaececa53a1203ec801e0
2022-12-20 11:08:43 -08:00
Brandon Schlinker
eb3009484a Application limited time in packet metadata
Summary:
Track the total (cumulative) amount of time that the connection has been application limited and store this information in `OutstandingPacketMetadata`. If this value is the same for two `OutstandingPacketMetadata` then we know that the transport did not become application limited between when those two packets were sent (or, less likely, the transport was application limited for less than one microsecond given the microsecond resolution of the timestamp).

We store the amount of time spent application limited instead of a count of the number of application limited events because the implications of being application limited are time dependent.

Tests show that we need to be able to inject a mockable clock. That's been an issue for some time; will work on in a subsequent diff.

Differential Revision: D41714879

fbshipit-source-id: 9fd4fe321d85639dc9fb5c2cd51713c481cbeb22
2022-12-08 18:55:22 -08:00
Joseph Beshay
772b47adaa Do not use LOG_EVERY_N
Summary:
Fixes build error from Github actions
```
D:\a\mvfst\mvfst\quic\server\QuicServerTransport.cpp(1072): error C3861:
'__sync_add_and_fetch': identifier not found

```

Reviewed By: hanidamlaj

Differential Revision: D40327603

fbshipit-source-id: afae1b661322e80156c7d69b577f35f41b67ee73
2022-11-10 16:17:32 -08:00
Konstantin Tsoy
c6d9731247 Switch to chained memory data path if GSO is not supported
Summary:
Check for GSO support once before the first write, cache the value and use it throughout the conn lifetime.
If GSO is not supported, ensure we use chained memory write path.

Reviewed By: mjoras

Differential Revision: D40240513

fbshipit-source-id: b699b4633246f3c15d2be7b39580686e44c2aab3
2022-10-11 14:43:12 -07:00
Joseph Beshay
abee1d8387 Add IMMEDIATE_ACK frame
Summary: Add the new IMMEDIATE_ACK frame from the ack frequency draft.

Reviewed By: mjoras

Differential Revision: D38523438

fbshipit-source-id: 79f4a26160ccf4333fb79897ab4ace2ed262fa01
2022-08-24 11:11:33 -07:00
Joseph Beshay
7271907eb5 Skip LOG_EVERY_N to fix build
Summary: Upgrading glog from 0.4.0 to 0.5.0 broke the windows build for some time. This change skips calling LOG_EVERY_N for Windows to restore the build. It is a stop-gap measure until logging is migrated to folly XLOG.

Reviewed By: kvtsoy

Differential Revision: D38371427

fbshipit-source-id: 9711607a348f0473e3e922d7f627217b3948c45d
2022-08-04 11:47:04 -07:00
Ashkan Nikravesh
8419469204 Create a PacketProcessor abstract class
Summary: PacketProcessors process the packets that we send and their corresponding ack and loss events. We store a vector of packet processors inside `QuicConnectionStateBase` and we call `onPacketSent` and `onPacketAck` whenever their corresponding functions in `CongestionController` class are called. The plan is to make `CongestionController` class extend `PacketProcessor`.

Reviewed By: bschlinker

Differential Revision: D36404668

fbshipit-source-id: 52d63a6a74bfa2031131d31047da25a5e2be12aa
2022-07-05 11:09:03 -07:00
Konstantin Tsoy
003c12fb22 Move setCustomTransportParameter() to free functions
Summary: Move setCustomTransportParameter() to free functions

Reviewed By: mjoras

Differential Revision: D36204576

fbshipit-source-id: 513c11852a339d441af9f3fc948679814da98900
2022-05-19 20:01:28 -07:00
Matt Joras
e2be4562a1 Use createCombined more frequently.
Summary: This is a pretty obvious thing to do. There's not really any reason to have the data and metadata separately since we don't need to reallocate.

Reviewed By: jbeshay

Differential Revision: D36237370

fbshipit-source-id: 093ad7fb2c54b596ea5cc327ffcc24de1748d362
2022-05-09 23:47:37 -07:00
Hani Damlaj
747c41c30d Fix Probing Bytes Limit
Summary:
- PTOs should not be subject to congestion control limits
- Quickly recover from PTOs being writableBytesLimited by calling onPTOAlarm() as soon as we become unblocked

Reviewed By: mjoras

Differential Revision: D35480409

fbshipit-source-id: 51500db6fff17a7badefea8bda7f63141e97f746
2022-04-19 00:50:36 -07:00
Hani Damlaj
61deaef637 Revert To UnlimitedWritableBytes for Probes
Summary: - as title; ninja landing this because jf land doesn't work

Reviewed By: mjoras

Differential Revision: D35446781

fbshipit-source-id: 73cfbd19da3922a9b3471a95006b817ea495768b
2022-04-07 08:10:55 -07:00
Hani Damlaj
c8bf098e5d Change Implementation of WritableBytesLimit
Summary: - updating usage of WritableBytesLimit

Reviewed By: mjoras

Differential Revision: D33079816

fbshipit-source-id: 1854f40a7b00526afb2167764aeddf55edb1771f
2022-04-04 16:18:52 -07:00
Brandon Schlinker
b243d2bdd8 Number bytes written in packets written event
Summary: Report all bytes written in observer packets written events.

Reviewed By: jbeshay

Differential Revision: D33086404

fbshipit-source-id: 1456cf23a420abd025f047f190cb2b8a9868826e
2022-03-23 08:50:12 -07:00
Liang Zhou
b2c91ae10e add stats for dsr egress bytes in proxygen side
Summary: add more instrument info for the dsr egressed counts and bytes

Reviewed By: mjoras, shodoco

Differential Revision: D34192441

fbshipit-source-id: 2b3567b7bec0748ab99ad042742d7823a52da568
2022-03-03 10:58:53 -08:00
Konstantin Tsoy
cecc1ba279 Introduce QuicError struct
Summary: Instead of using std::pair everywhere

Reviewed By: mjoras

Differential Revision: D34146686

fbshipit-source-id: dfe48f43775de868aba06a5b9b5a004e5793bdbb
2022-02-14 16:00:21 -08:00
Hani Damlaj
00e67c1bf9 mvfst License Header Update
Reviewed By: lnicco

Differential Revision: D33587012

fbshipit-source-id: 972eb440f0156c9c04aa6e8787561b18295c1a97
2022-01-18 13:56:12 -08:00
Hani Damlaj
2660a288b3 Update Company Name
Summary: - as title

Reviewed By: lnicco

Differential Revision: D33513410

fbshipit-source-id: 282b6f512cf83b9abb7990402661135b658f7bd1
2022-01-13 12:07:48 -08:00
Hani Damlaj
f60c254c49 Log Server Handshake Size
Summary: - logging number of bytes the server sent during the handshake for insight.

Reviewed By: mjoras

Differential Revision: D33069800

fbshipit-source-id: e7e8f25183ee30de99e2971bae3c6b93882f6e63
2022-01-06 10:34:06 -08:00
Matt Joras
ca4705af0b If there's lost data, we have data to write, take 2.
Summary:
This is a bug that could prevent us from writing data if we ran out of connection flow control while we had lost data.

The last attempt missed a mistake in the scheduling of sequential priority streams.

Reviewed By: kvtsoy

Differential Revision: D33030784

fbshipit-source-id: e1b82234346a604875a9ffe9ab7bc5fb398450ed
2021-12-14 09:18:01 -08:00
Brandon Schlinker
bdd073a7fd Throw if start offset of written frame > stream.currentWriteOffset
Summary: As titled. Simple logic to prevent confusion when writing tests.

Reviewed By: jbeshay

Differential Revision: D31916968

fbshipit-source-id: 6f4fb84402b6fe2f5f9af9f57ff8a1d2f1838464
2021-12-11 22:40:44 -08:00
Matt Joras
5b9a9705a0 Back out "If there's lost data, we have data to write."
Summary: This is causing empty write loops for some reason.

Reviewed By: jbeshay, lnicco

Differential Revision: D32990291

fbshipit-source-id: 2a183d591de54c7fe0ca54aea828a697a4cd9af0
2021-12-09 14:35:24 -08:00
Matt Joras
d6a876f201 If there's lost data, we have data to write.
Summary: This is an edge case we weren't handling properly. This can lead to situations where we run out of conn flow control, the peer hasn't received all data, and then we never write the data to trigger a flow control update.

Reviewed By: afrind

Differential Revision: D32887140

fbshipit-source-id: df5dfad8e0775ef43e5ca6ab98b8ca6b5987ce31
2021-12-07 18:19:58 -08:00
Matt Joras
6afecccd25 Track loop limit time across functions.
Summary: Otherwise we can end up in a situation where the non-DSR scheduler was limited by the loop time while the DSR scheduler is not, leading to an inconsistency.

Reviewed By: lnicco

Differential Revision: D32570027

fbshipit-source-id: f43d2517589c22bac0f2bb76626cc55c2a21fa5d
2021-11-19 19:04:37 -08:00
Matt Joras
612a00c3f9 Move happy eyeballs state to client state.
Summary: This doesn't belong in the generic state. Untangling it is a little difficult, but I think this solution is cleaner than having it in the generic state.

Reviewed By: JunqiWang

Differential Revision: D29856391

fbshipit-source-id: 1042109ed29cd1d20d139e08548d187b469c8398
2021-07-23 14:21:16 -07:00
Matt Joras
7402dbe6c9 Move zero RTT ciphers to client state.
Summary: As in title, this doesn't need to be in the base state.

Reviewed By: JunqiWang

Differential Revision: D29855140

fbshipit-source-id: 8d3a4b12fd6b93b2277020d56862915e084f1c05
2021-07-23 14:21:16 -07:00
Matt Joras
003f012cb7 TODO comment cleanup.
Summary:
These are either no longer relevant, are unlikely to be done, or are spculative enough that they don't deserve code space.

Hope here is to make our search for TODOs higher signal.

Reviewed By: lnicco

Differential Revision: D29769792

fbshipit-source-id: 7cfa62cdc15e72d8b7b0cd5dbb5913ea3ca3dc5a
2021-07-20 10:27:32 -07:00
Luca Niccolini
5dd53e6e2c Datagram frames are not rtx-able
Summary: We are now adding them to the outstanding packet list, for not good reason.

Reviewed By: mjoras

Differential Revision: D29469128

fbshipit-source-id: b279774b6ef5bbb436b3c9d7bcdad39eea8f1079
2021-07-01 19:45:37 -07:00
Matt Joras
e848899795 Fix accounting bug in closes.
Summary:
We didn't actually ensure there was enough room for the tag here, which means we'd fail to encrypt the close.

(Note: this ignores all push blocking failures!)

Reviewed By: yangchi, lnicco

Differential Revision: D29187670

fbshipit-source-id: 97e4f60feaf6b1998ffafe3b1289df94586e9c5e
2021-06-17 19:57:43 -07:00
Luca Niccolini
dc3b4dded0 Write DATAGRAM frames when available
Summary:
Right now we are waiting for another write event to write datagrams.
Introduced a Write Reason for the case when only DATAGRAMS are pending

Reviewed By: mjoras

Differential Revision: D29091822

fbshipit-source-id: 0de6b88d93acae0ba240b9cdf9dbc8e74feaf5ac
2021-06-13 21:13:19 -07:00
Yang Chi
0e6a998e05 Fix QUIC EOF sending when DSR is used
Summary:
This is a bug fix. When a stream finished sending all it's BufMetas, it can
send EOF from frontend QUIC host. In that case, it will use
currentWriteOffset value which is wrong.

This diff changes it so that (1) frontend can only write FIN only frame if
writeBufMeta's offset is <= finalWriteOffset; (2) When it writes such frame
it will use finalWriteOffset as the offset value in the frame.

Reviewed By: lnicco

Differential Revision: D28727029

fbshipit-source-id: 8f963c2e2d66f921f8a9704ed4671ec4f7c04df7
2021-06-01 13:16:20 -07:00
Sridhar Srinivasan
7246cd5e3c Record stream details in packet metadata
Summary:
Introruced a new DetailsPerStream struct inside the outstanding packet metadata
so we can easily track all streams carrying app data within a packet and each
stream's bytes sent (both new and total).

With this, consumers can easily deduce the number of retransmitted bytes per
stream using the StreamDetails members:
newStreamBytesSent - streamBytesSent.

Reviewed By: bschlinker

Differential Revision: D28063916

fbshipit-source-id: d915514f85f24f4889cfac2f7a66bfd2d6b0a4af
2021-05-14 11:55:17 -07:00
Luca Niccolini
f778cfb945 Quic Socket: Datagram APIs
Summary: quic socket API to send and receive datagrams

Reviewed By: mjoras, yangchi

Differential Revision: D20983884

fbshipit-source-id: 70332c5fb9c37c88150fc2f623521e7b0c991eae
2021-05-11 08:24:03 -07:00
Yang Chi
38c903ba2f Remove all QUIC_TRACEs
Summary: no longer used

Reviewed By: lnicco

Differential Revision: D28141008

fbshipit-source-id: 870d6574cc1657914a08f1ef5ee581cfef96aad1
2021-05-10 12:46:08 -07:00
Brandon Schlinker
5590b9f573 Track stream bytes written
Summary:
Track the number of stream bytes written to the wire and expose in `quic::TransportInfo`.

Implemented as two counters:
- `totalStreamBytesSent` is a count of all stream bytes written to the wire; the sum of the lengths of stream frames in all packets sent
- `totalNewStreamBytesSent` is a count of all *new* stream bytes written to the wire -- a stream byte is new if it has not been transmitted before; the sum of the lengths of stream frames that have never been transmitted before in all packets sent

We can derive the total number of stream bytes retransmitted as `totalStreamBytesSent - totalNewStreamBytesSent`. We may want to deprecate the existing `totalBytesRetransmitted` counter because the name of that counter does not make it clear that it is stream bytes, and because only includes some types of retransmissions.

While `totalNewStreamBytesSent` is already captured as `flowControlState.sumCurWriteOffset`, I am not reusing that counter here to avoid having a dependency on the information we track for flow control, and to allow all relevant information to be captured in `LossState` (where other relevant fields already exist).

Reviewed By: yangchi

Differential Revision: D28061085

fbshipit-source-id: 73486a4ba3fc8f12959f68702dc58e61fdc21b65
2021-05-04 23:24:06 -07:00
Yang Chi
64eb5991e3 Add isDSRPacket into the updateConnection logline
Summary: for debug purpose

Reviewed By: mjoras

Differential Revision: D27940904

fbshipit-source-id: 973b882ab05f8770999e3bc54f9d06957d62a2b0
2021-05-04 18:38:59 -07:00
Yang Chi
cdacec015a QuicServerTransport write DSR packetization requests
Summary:
This diff hooks the DSR write function into QuicServerTransport's
write path.

Reviewed By: mjoras

Differential Revision: D27890711

fbshipit-source-id: ac4452373c0baafe091f93fb54fccf87be604a9c
2021-05-04 01:08:16 -07:00
Yang Chi
efa466158e QUIC IoBufQuicBatch no need to have a ref to connection state
Summary:
all it wants is just a pointer to the statsCallback member

(Note: this ignores all push blocking failures!)

Reviewed By: mjoras

Differential Revision: D27786211

fbshipit-source-id: 3364681348ee01684d6cb8d2837bee9549f64e3a
2021-04-28 08:06:27 -07:00
Yang Chi
da8a74d427 Move QUIC WriteBufferMeta related members to QuicStreamState
Summary: QuicStreamLike can crypto streams which won't support DSR

Reviewed By: mjoras

Differential Revision: D27668524

fbshipit-source-id: 3ae5e11618a5be08a1ba20092293b80f61ce89eb
2021-04-20 20:09:10 -07:00
Yang Chi
4ab385c216 Do not use the regular CloningScheduler to clone DSR packet
Summary: For now let it fallback to ping.

Reviewed By: mjoras

Differential Revision: D27481741

fbshipit-source-id: 874529a06ab882d9651e06f615bc82505c1c2872
2021-04-19 11:08:26 -07:00
Matt Joras
b16c3b306b Clean up initial/handshake ciphers a little more intelligently.
Summary: Right now we are running the handshakeConfirmed code a lot on the client. This is excessive. We only need to run the code if we haven't already dropped the cipher.

Reviewed By: yangchi

Differential Revision: D27725974

fbshipit-source-id: ca325c132debdd280e447ca30876488b879ff13c
2021-04-13 10:11:47 -07:00
Matt Joras
55e0fa070e Send probes on all spaces take 2.
Summary:
As before we will now aggressively send probes on all spaces with probes available when the PTO timer fires.

This time with more unit tests and some bug fixes.

Reviewed By: yangchi

Differential Revision: D27338523

fbshipit-source-id: 8a9ccb90ed691e996fab4afa2f132c0f99044fbc
2021-04-02 14:59:57 -07:00
Sridhar Srinivasan
f7a08066ce Track body bytes sent and acked
Summary:
Previously, we maintained state and counters to count both, header and body
bytes together. This commit introduces additional counters and state to keep
track of just the body bytes that were sent and acked etc. Body bytes received
will be implemented later.

Reviewed By: bschlinker

Differential Revision: D27312049

fbshipit-source-id: 33f169c9168dfda625e86de45df7c00d1897ba7e
2021-03-29 16:58:04 -07:00
Matt Joras
a92a24bdd5 Back out "Send probes for all spaces."
Summary: As in title. There's a bug here somewhere with empty write loops we need to find.

Reviewed By: yangchi

Differential Revision: D27279100

fbshipit-source-id: e1d26fbf8d6df1590d464a6504a8b940b46794e0
2021-03-23 16:10:12 -07:00
Matt Joras
bceb00346b Send probes for all spaces.
Summary:
Previously we would only send probes for the first space which had one available, i.e. Initial before Handshake before AppData. Since we only have one PTO timer this can lead to situations where we perpetually probe with only Initials, which can significantly delay the handshake if we should have probed with Handshakes.

With this diff we will keep the single PTO timer but aggressively write more probes from all spaces if they are available.

Additionally this refactors some counters into EnumArrays

Reviewed By: yangchi

Differential Revision: D27235199

fbshipit-source-id: ef3614a833bf0f02f5806846a1335fa7ac2a4dc8
2021-03-23 12:51:36 -07:00
Yang Chi
2d061aa464 Mark DSR outstanding packets in QUIC outstanding packets queue
Summary: as title

Reviewed By: mjoras

Differential Revision: D26986163

fbshipit-source-id: 2a90689650e6dfab1a88830188ae76fcddb894da
2021-03-19 08:48:14 -07:00
Yang Chi
abfafda50f Write SendInstruction to DSRPacketizationRequestSender
Summary:
(1) Check if stream has DSR data
(2) Write them to the packet builder
(3) Guard against flow control and congestion control limit
(4) Add the instruction to the DSRPacketizationRequestSender
(5) Flush
(6) update connection state

Reviewed By: mjoras

Differential Revision: D26851557

fbshipit-source-id: 850958995ef10744826ee892fdea211ac441b078
2021-03-19 08:48:14 -07:00
Yang Chi
cf4f6f8d1d Make Quic Write loop time limit helper lambda into a function
Summary: as title

Reviewed By: yairgott

Differential Revision: D26851411

fbshipit-source-id: 37a5573d7d3c6a4320ec15e437312a3bb82ba75a
2021-03-12 08:16:34 -08:00