Investigate options for ack delay and gap
@@ -1910,6 +1910,15 @@ uint64_t picoquic_compute_ack_gap(picoquic_cnx_t* cnx, uint64_t data_rate)
uint64_t packet_rate_times_1M = (data_rate * 1000000) / cnx->path[0]->send_mtu;
nb_packets = packet_rate_times_1M / cnx->path[0]->smoothed_rtt;
}
+#if 1
+ if (cnx->path[0]->smoothed_rtt < 4 * PICOQUIC_ACK_DELAY_MIN) {
+ uint64_t mult = 4;
+ if (cnx->path[0]->smoothed_rtt > PICOQUIC_ACK_DELAY_MIN) {
+ mult = ((uint64_t)(4 * PICOQUIC_ACK_DELAY_MIN)) / cnx->path[0]->smoothed_rtt;
+ }
+ nb_packets *= mult;
+ }
+#endif
ack_gap = (nb_packets + 3) / 4;
@@ -1925,9 +1934,28 @@ uint64_t picoquic_compute_ack_gap(picoquic_cnx_t* cnx, uint64_t data_rate)
if (ack_gap < ack_gap_min) {
ack_gap = ack_gap_min;
}
+#if 0
else if (ack_gap > 32) {
ack_gap = 32;
}
+#else
+ else if (ack_gap > 32) {
+#if 0
+ ack_gap = 32 +((nb_packets - 128) / 16);
+#else
+ ack_gap = 32 + ((nb_packets - 128) / 8);
+#endif
+#if 1
+ if (ack_gap > 64) {
+ ack_gap = 64;
+ }
+#else
+ if (ack_gap > 128) {
+ ack_gap = 128;
+ }
+#endif
+ }
+#endif
return ack_gap;
}
