MEDIUM: quic: Send ACK frames asap

Due to a erroneous interpretation of the RFC 9000 (quic-transport), ACKs frames
were always sent only after having received two ack-eliciting packets.
This could trigger useless retransmissions for tail packets on the peer side.
For now on, we send as soon as possible ACK frames as soon as we have ACK to send,
in the same packets as the ack-eliciting frame packets, and we also send ACK
frames after having received 2 ack-eliciting packets since the last time we sent
an ACK frame with other ack-eliciting frames.
This commit is contained in:
Frédéric Lécaille
2022-03-29 11:42:03 +02:00
committed by Amaury Denoyelle
parent 205e4f359e
commit b002145e9f
3 changed files with 67 additions and 58 deletions

View File

@@ -420,6 +420,7 @@ struct quic_pktns {
/* Largest acked sent packet. */
int64_t largest_acked_pn;
struct quic_arngs arngs;
unsigned int nb_aepkts_since_last_ack;
} rx;
unsigned int flags;
};
@@ -443,6 +444,10 @@ struct quic_dgram {
/* Default QUIC connection transport parameters */
extern struct quic_transport_params quic_dflt_transport_params;
/* Maximum number of ack-eliciting received packets since the last
* ACK frame was sent
*/
#define QUIC_MAX_RX_AEPKTS_SINCE_LAST_ACK 2
/* Flag a received packet as being an ack-eliciting packet. */
#define QUIC_FL_RX_PACKET_ACK_ELICITING (1UL << 0)
@@ -508,6 +513,8 @@ struct quic_rx_strm_frm {
#define QUIC_FL_TX_PACKET_PADDING (1UL << 1)
/* Flag a sent packet as being in flight. */
#define QUIC_FL_TX_PACKET_IN_FLIGHT (QUIC_FL_TX_PACKET_ACK_ELICITING | QUIC_FL_TX_PACKET_PADDING)
/* Flag a sent packet as containg an ACK frame */
#define QUIC_FL_TX_PACKET_ACK (1UL << 2)
/* Structure to store enough information about TX QUIC packets. */
struct quic_tx_packet {
@@ -716,8 +723,6 @@ struct quic_conn {
struct {
/* Number of received bytes. */
uint64_t bytes;
/* Number of ack-eliciting received packets. */
size_t nb_ack_eliciting;
/* Transport parameters the peer will receive */
struct quic_transport_params params;
/* RX buffer */

View File

@@ -987,6 +987,7 @@ static inline void quic_pktns_init(struct quic_pktns *pktns)
pktns->rx.arngs.root = EB_ROOT_UNIQUE;
pktns->rx.arngs.sz = 0;
pktns->rx.arngs.enc_sz = 0;
pktns->rx.nb_aepkts_since_last_ack = 0;
pktns->flags = 0;
}