]>
Commit | Line | Data |
---|---|---|
891b6393 TM |
1 | Congestion control API design |
2 | ============================= | |
3 | ||
90699176 HL |
4 | We use an abstract interface for the QUIC congestion controller to facilitate |
5 | use of pluggable QUIC congestion controllers in the future. The interface is | |
6 | based on interfaces suggested by RFC 9002 and MSQUIC's congestion control APIs. | |
7 | ||
8 | `OSSL_CC_METHOD` provides a vtable of function pointers to congestion controller | |
9 | methods. `OSSL_CC_DATA` is an opaque type representing a congestion controller | |
10 | instance. | |
11 | ||
12 | For details on the API, see the comments in `include/internal/quic_cc.h`. | |
13 | ||
14 | Congestion controllers are not thread safe; the caller is responsible for | |
15 | synchronisation. | |
16 | ||
17 | Congestion controllers may vary their state with respect to time. This is | |
eb4129e1 | 18 | facilitated via the `get_wakeup_deadline` method and the `now` argument to the |
90699176 HL |
19 | `new` method, which provides access to a clock. While no current congestion |
20 | controller makes use of this facility, it can be used by future congestion | |
21 | controllers to implement packet pacing. | |
22 | ||
1c44ed7b HL |
23 | Congestion controllers may expose arbitrary configuration parameters via the |
24 | `set_input_params` method. Equally, congestion controllers may expose diagnostic | |
25 | outputs via the `bind_diagnostics` and `unbind_diagnostics` methods. The | |
26 | configuration parameters and diagnostics supported may be specific to the | |
27 | congestion controller method, although there are some well known ones intended | |
28 | to be common to all congestion controllers. | |
90699176 HL |
29 | |
30 | Currently, the only dependency injected to a congestion controller is access to | |
31 | a clock. In the future it is likely that access at least to the statistics | |
32 | manager will be provided. Excessive futureproofing of the congestion controller | |
33 | interface has been avoided as this is currently an internal API for which no API | |
34 | stability guarantees are required; for example, no currently implemented | |
35 | congestion control algorithm requires access to the statistics manager, but such | |
36 | access can readily be added later as needed. | |
37 | ||
38 | QUIC congestion control state is per-path, per-connection. Currently we support | |
39 | only a single path per connection, so there is one congestion control instance | |
40 | per connection. This may change in future. | |
41 | ||
42 | While the congestion control API is roughly based around the arrangement of | |
eb4129e1 | 43 | functions as described by the congestion control pseudocode in RFC 9002, there |
90699176 HL |
44 | are some deliberate changes in order to obtain cleaner separation between the |
45 | loss detection and congestion control functions. Where a literal option of RFC | |
eb4129e1 | 46 | 9002 pseudocode would require a congestion controller to access the ACK |
90699176 HL |
47 | manager's internal state directly, the interface between the two has been |
48 | changed to avoid this. This involves some small amounts of functionality which | |
49 | RFC 9002 considers part of the congestion controller being part of the ACK | |
50 | manager in our implementation. See the comments in `include/internal/quic_cc.h` | |
51 | and `ssl/quic/quic_ackm.c` for more information. | |
1c44ed7b HL |
52 | |
53 | The congestion control API may be revised to allow pluggable congestion | |
54 | controllers via a provider-based interface in the future. |