private-octopus / picoquic

Minimal implementation of the QUIC protocol
MIT License
527 stars 156 forks source link

Add CWIN_MAX API and test. #1506

Closed huitema closed 1 year ago

huitema commented 1 year ago

Add a new API:

/* set a maximum value for the congestion window (default: UINT64_MAX) */
void picoquic_set_cwin_max(picoquic_quic_t* quic, uint64_t cwin_max);

This is meant to limit the memory used by QUIC connections, at the cost of limiting the maximum data-rate of these connections. The default value is UINT64_MAX. If an application wants to limit the memory, it should compute the maximum BDP using the formula:

bandwidth_delay_product = RTT_in_seconds * data_rate_in_bits_per_second / 8

And then set the BDP to that value. Or, set the BDP to a lower value if that's too much memory, but accept some lower data rates.

This is meant to mitigate issue #1499.