<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.43 (Ruby 3.4.9) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ageneau-ccwg-ndtc-03" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.34.1 -->
  <front>
    <title abbrev="NDTC">Network Delivery Time Control</title>
    <seriesInfo name="Internet-Draft" value="draft-ageneau-ccwg-ndtc-03"/>
    <author fullname="Paul-Louis Ageneau">
      <organization>Netflix</organization>
      <address>
        <email>pageneau@netflix.com</email>
      </address>
    </author>
    <author fullname="Grenville Armitage">
      <organization>Independent</organization>
      <address>
        <email>gja.ietf@gmail.com</email>
      </address>
    </author>
    <author fullname="Scott Danahy">
      <organization>Netflix</organization>
      <address>
        <email>sdanahy@netflix.com</email>
      </address>
    </author>
    <date year="2026" month="November" day="02"/>
    <area>Web and Internet Transport</area>
    <workgroup>Congestion Control Working Group</workgroup>
    <keyword>rate adaptation</keyword>
    <keyword>real-time</keyword>
    <keyword>low-latency video</keyword>
    <abstract>
      <?line 85?>

<t>This document describes Network Delivery Time Control (NDTC), a rate
adaptation algorithm for real-time video streaming suited for
interactive applications like cloud gaming. NDTC leverages the Frame
Dithering Available Capacity Estimation (FDACE) heuristic, which
estimates available path capacity without inducing congestion.
The algorithm dynamically adjusts frame sizes and transmission
times to ensure timely delivery, while also responding to
conventional congestion signals.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://paullouisageneau.github.io/draft-ageneau-ccwg-ndtc/draft-ageneau-ccwg-ndtc.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-ageneau-ccwg-ndtc/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        Congestion Control Working Group Working Group mailing list (<eref target="mailto:ccwg@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/ccwg/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/ccwg/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/paullouisageneau/draft-ageneau-ccwg-ndtc"/>.</t>
    </note>
  </front>
  <middle>
    <?line 96?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>This document specifies implementation details and considerations for
Network Delivery Time Control (NDTC) <xref target="NDTC-LCN"/>, a rate
adaptation and congestion control algorithm for real-time, interactive video flows
which adapts the target frame size to fit within the available
path capacity, proactively minimizing self-induced congestion.
NDTC also reacts to traditional packet loss signals and is compatible
with networks that implement the Low Latency, Low Loss, and Scalable Throughput (L4S)
Internet Service.</t>
      <t>NDTC's characteristics make it ideal for high-bitrate, real-time,
interactive applications:</t>
      <ul spacing="normal">
        <li>
          <t>It does not self-induce congestion, keeping queueing delays and
packet loss to a minimum,</t>
        </li>
        <li>
          <t>Ramp up is fast with no risk of overshoot, even at high bitrates,</t>
        </li>
        <li>
          <t>The encoded video is not required to closely follow the target bitrate,
and there is no need to send filler data.</t>
        </li>
      </ul>
      <t>These properties make it particularly suited for interactive
cloud gaming applications, and (potentially) for bitrate ladder rung
selection in low-latency video applications.</t>
      <t>At a very high level, when NDTC is applied to cloud gaming it continuously
runs the following loop:</t>
      <ul spacing="normal">
        <li>
          <t>Pace each video frame's packets at a rate between 1x and 2x (on average)
our current estimate of available path capacity, in order to probe the
network path for additional capacity while minimizing burst load on network
bottlenecks.</t>
        </li>
        <li>
          <t>Set the target frame size of the video encoder to a fraction of the
available capacity estimate, thus keeping frame delivery latencies low.</t>
        </li>
      </ul>
      <t>Each frame's paced packet train is a probe to test and update our
estimate of available capacity, and thus continuously update our
upper bound on the next encoded video frame's size.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      <?line -18?>

</section>
    <section anchor="general-principle">
      <name>General Principle</name>
      <t>A key requirement for real-time video is ensuring
each frame arrives on time to be presented. Consequently,
NDTC focuses on timely frame delivery rather than attempting to maximize throughput.
NDTC aims to ensure each frame reception duration is shorter than a frame period,
providing sufficient headroom to ensure high probability of each frame arriving in time.
In practice, the control loop of the algorithm stabilizes the frame reception
duration by dynamically setting the target frame size to a fraction of the
estimated path capacity.</t>
      <t>NDTC introduces and relies on Frame Dithering Available Capacity Estimation (FDACE),
a heuristic that paces packetized frames over a dithered send duration and
estimates available path capacity from the relationship between send
durations and observed receive durations. Importantly, capacity estimation is performed
without injecting additional traffic (beyond the video stream we wish to deliver)
or filling the path bottleneck to capacity. We then ensure that the flow uses only a
fraction of the measured capacity to prevent risks of self-induced congestion.</t>
      <t>This process is combined with an
AIMD (Additive Increase Multiplicative Decrease) congestion control process
for compatibility with both packet loss congestion signals and ECN (Explicit
Congestion Notification) <xref target="RFC9331"/> for the L4S (Low Latency, Low Loss, and
Scalable Throughput) Internet Service <xref target="RFC9330"/>.</t>
      <t>For the rest of this document we describe NDTC based on the following mental model:</t>
      <ul spacing="normal">
        <li>
          <t>The server is encoding video on-the-fly at a frame rate <tt>1/TFRAME</tt> (where <tt>TFRAME</tt>
is the frame period), while capping each frame to a video frame size target <tt>TARGET</tt>.</t>
        </li>
        <li>
          <t>The server forms a path capacity probe by pacing the frame's constituent packets
out over target send duration <tt>TSEND</tt>.</t>
        </li>
        <li>
          <t>The path's estimated available capacity <tt>AVAILABLE</tt> is continuously updated using
each frame's actual send and receive durations (<tt>SEND</tt> and <tt>RECV</tt> respectively).</t>
        </li>
        <li>
          <t><tt>TARGET</tt> is recalculated whenever <tt>AVAILABLE</tt> changes to ensure the next <tt>RECV</tt> is
stabilized around target reception duration <tt>TRECV</tt>.</t>
        </li>
        <li>
          <t>Additionally, <tt>TARGET</tt> is capped by a combined AIMD process reacting to congestion
signals like packet loss and ECN.</t>
        </li>
      </ul>
      <t>To properly probe the path, <tt>TSEND</tt> <bcp14>MUST</bcp14> be a fraction of <tt>TRECV</tt>, and to minimize on-path
congestion, <tt>TRECV</tt> <bcp14>MUST</bcp14> be a fraction of <tt>TFRAME</tt>.
We RECOMMEND that <tt>TRECV = 0.6 * TFRAME</tt> and <tt>TSEND = 0.5 * TRECV</tt>.
(For example, sending at 30fps would result in <tt>TFRAME = 33ms</tt>, <tt>TRECV = 20ms</tt>
and <tt>TSEND = 10ms</tt>.)</t>
      <t>Note: NDTC focuses on uncovering <em>enough</em> available capacity to meet the application's
needs, it is not trying to instantly discover <em>all</em> the available
capacity on a path. Specifically, choosing <tt>TSEND = 0.5 * TRECV</tt> limits FDACE to
probing up to <tt>2.0 * AVAILABLE</tt> in any single iteration of the FDACE heuristic.</t>
      <t>NDTC initializes <tt>TARGET</tt> to <tt>INIT_TARGET</tt>, and whenever <tt>TARGET</tt> is recalculated
the result is constrained to <tt>MIN_TARGET &lt;= TARGET &lt;= MAX_TARGET</tt>. Actual values
for the <tt>INIT_TARGET</tt>, <tt>MIN_TARGET</tt> and <tt>MAX_TARGET</tt> parameters are application-specific.</t>
    </section>
    <section anchor="algorithm-overview">
      <name>Algorithm Overview</name>
      <t>This section details implementation of the whole NDTC feedback loop
using variable and parameter names summarized
in section <xref target="variables-and-parameters"/> (rather than the more
mathematically-oriented names used in NDTC's conference paper <xref target="NDTC-LCN"/>).</t>
      <section anchor="illustrating-using-rtprtcp">
        <name>Illustrating using RTP/RTCP</name>
        <t>Although NDTC can be implemented for various real-time video transport
protocols, this document illustrates the use of NDTC to support
applications using RTP/RTCP <xref target="RFC3550"/>.</t>
        <t>In particular, NDTC operates on a single video stream and it is frame-oriented.
References to a "frame" in the rest of this document mean a sequence of
consecutive RTP packets having the same SSRC and RTP timestamp and ending
with a packet whose RTP marker bit is set.</t>
        <t>Defining a frame when NDTC is used for non-RTP flows
is currently outside the scope of this document.</t>
        <t>NDTC can be generalized to transports with multiple video streams by running
an instance of the algorithm for each video stream. This is currently outside
the scope of this document.</t>
      </section>
      <section anchor="architecture-considerations">
        <name>Architecture Considerations</name>
        <t>NDTC can be implemented either sender-side or receiver-side depending on the
application's needs.</t>
        <t>In the following discussion, the "agent" refers to the entity running the NDTC algorithm.
A core requirement to execute FDACE is that, for every frame, the agent
learns the precise durations over which a given frame was sent (<tt>SEND</tt>)
and received (<tt>RECV</tt>). Recommendations for transmitting this timing information between
senders and receivers are discussed in subsequent sections.</t>
        <t>If the agent is the sender, the algorithm runs on every frame feedback. If the
agent is the receiver, the algorithm runs as soon as a frame is received and
sends the updated target frame size (<tt>TARGET</tt>) to the server.</t>
        <section anchor="sender-side-agent">
          <name>Sender-side Agent</name>
          <t>Sender-side NDTC can be instantiated by having receivers
pass <tt>RECV</tt> back to the sender inside existing
RTCP-based Feedback for Congestion Control <xref target="RFC8888"/> or
Transport-wide Congestion Control (TWCC) <xref target="draft-holmer-rmcat-transport-wide-cc-extensions"/>
reports. Alternatively, an implementor might introduce application-specific
RTCP feedback to make messages smaller and achieve better precision.</t>
          <t>The receiver is also required to report which packets have not been received
(as described in <xref target="loss"/>) and <bcp14>SHOULD</bcp14> also reflect Explicit Congestion Notification (ECN)
markings of received packets (if support for L4S is desired).</t>
          <t>In this scenario, the agent has local control of the underlying
packet pacer and video encoder.</t>
        </section>
        <section anchor="receiver-side-agent">
          <name>Receiver-side Agent</name>
          <t>Receiver-side NDTC requires the receiver to regularly pass back updates
to <tt>TARGET</tt> (to properly control the video encoder) and <tt>SLOPE</tt>
(section <xref target="fdace"/>) to properly control the packet pacer. This may
be achieved with e.g. RTCP messages like Receiver Estimated Maximum Bitrate (REMB)
<xref target="draft-alvestrand-rmcat-remb"/>.</t>
          <t>Note: if the receiver agent cannot pass back <tt>SLOPE</tt> information, the sender's
pacing heuristic <bcp14>SHOULD</bcp14> assume <tt>SLOPE = 1</tt>.</t>
        </section>
        <section anchor="timing-and-timestamping">
          <name>Timing and Timestamping</name>
          <t>The precision with which <tt>SEND</tt> and <tt>RECV</tt> are measured and reported
<bcp14>MUST</bcp14> be 1ms or better, because the durations are typically around a few
milliseconds only, and a lower precision would not be sufficient to obtain a
consistent estimate, even by averaging multiple samples.
We RECOMMEND a precision of 0.1ms.</t>
          <t>If the agent is implemented sender-side, we assume the agent derives <tt>SEND</tt>
from local knowledge (e.g. timestamps generated low in the networking stack),
and learns <tt>RECV</tt> from reports passed back by the receiver.</t>
          <t>If the agent is implemented receiver-side, we assume the agent derives <tt>RECV</tt>
from local knowledge (e.g. kernel timestamps from the underlying network
interface) and learns <tt>SEND</tt> via in-band messages from the sender. For instance,
the sender can write the effective send time on each packet just before it goes
out using the <xref target="abs-send-time"/> RTP extension.</t>
        </section>
      </section>
      <section anchor="fdace">
        <name>Frame Dithering Available Capacity Estimation (FDACE)</name>
        <t>FDACE calculates an estimated available capacity <tt>AVAILABLE</tt> and a slope <tt>SLOPE</tt>
given send and receive durations for a frame.</t>
        <t>Frame size <tt>LENGTH</tt> is calculated by summing up packet payload sizes for the frame
according to <xref target="framesize"/>.
Therefore <tt>AVAILABLE</tt> will actually refer to application-layer
capacity expressed in terms of video bitrate.</t>
        <t>If the frame consists of a single packet, if <tt>LENGTH</tt> is strictly less than
<tt>MIN_LENGTH</tt>, or if the frame suffered packet loss in the sense of <xref target="loss"/>,
the agent does not run FDACE.
Instead, it retains the <tt>TARGET</tt> and <tt>SLOPE</tt> values from the most recent frame
for which FDACE ran and immediately jumps to the AIMD congestion control
described in <xref target="congestion"/>.</t>
        <t>If the frame was packetized as 2 packets or more and suffered no packet loss,
the agent first calculates the normalized send duration <tt>NSEND</tt> and the
normalized reception duration <tt>NRECV</tt> for the frame by respectively dividing
frame send duration <tt>SEND</tt> and frame receive duration <tt>RECV</tt> by frame size
<tt>LENGTH</tt>.</t>
        <artwork><![CDATA[
NSEND = SEND / LENGTH
NRECV = RECV / LENGTH
]]></artwork>
        <t>Send duration <tt>SEND</tt> corresponds to the elapsed time between sending the first
packet and sending the last packet of the frame (i.e. the one with the RTP marker).
<tt>SEND</tt> <bcp14>MUST</bcp14> be the actual duration over which the pacer sent the frame,
not the calculated target duration from <xref target="pacer"/>.
Packet send times <bcp14>SHOULD</bcp14> be measured as close to socket send calls as possible.</t>
        <t>Receive duration <tt>RECV</tt> corresponds to the elapsed time between reception of
the first packet and reception of the last packet of the frame (i.e. the one
with the RTP marker). Note there is no need for sender and receiver clock
synchronization.
In practice, packet reception times <bcp14>SHOULD</bcp14> be measured using kernel timestamps
for enhanced precision, as the application might take significant time to
receive packets in userspace.
The agent <bcp14>SHOULD</bcp14> cap <tt>RECV</tt> to a small multiple of the frame period in order to
mitigate outliers caused by transient adverse network events while still
allowing the value to grow large enough to capture bursts of cross-traffic
and reflect sudden path capacity reductions.
The <bcp14>RECOMMENDED</bcp14> maximum value for <tt>RECV</tt> is <tt>3*TFRAME</tt>.</t>
        <t>A dual-variable EWMA process is updated with the new sample <tt>(NSEND, NRECV)</tt>.
The process calculates the averages <tt>AVG_NSEND</tt>, <tt>AVG_NRECV</tt>, the variances
<tt>VAR_NSEND</tt> and <tt>VAR_NRECV</tt>, and the covariance <tt>COVAR</tt>.
The <bcp14>RECOMMENDED</bcp14> weight is <tt>LAMBDA = 0.04</tt>.
A suitable implementation of the dual-variable EWMA process is detailed
in <xref target="ewma-implementation"/>.</t>
        <t>The agent now derives the linear regression parameters from the output of the
EWMA process. The slope <tt>SLOPE</tt> and y-intercept <tt>INTERCEPT</tt> of the linear
equation <tt>NRECV = SLOPE * NSEND + INTERCEPT</tt> are calculated as follows:</t>
        <artwork><![CDATA[
if (VAR_NSEND > 0.0 && COVAR > 0.0) {
    SLOPE = min(COVAR / VAR_NSEND, 1.0)
} else {
    SLOPE = 0.0
}
INTERCEPT = max(AVG_NRECV - SLOPE * AVG_NSEND, 0.0)
]]></artwork>
        <t><tt>SLOPE</tt> reflects how pacing frames changes their reception as they go through
the path bottleneck and intercept more or less cross-traffic. The relationship
is locally linear because we observe normalized times and not rates, and network
path components behave linearly in terms of processing time per byte to a good
approximation.</t>
        <t>If the path is not constraining, for instance during ramp-up, receive duration
is always equal to send duration, and <tt>SLOPE = 1</tt>, which can be interpreted as
the path capacity looking infinite.</t>
        <t>If there is no visible cross-traffic and the flow is alone at
bottleneck, the slope <tt>SLOPE</tt> is 0, the send rate does not matter as we always
receive at bottleneck rate.
If cross-traffic takes most of the bottleneck capacity, <tt>SLOPE</tt> is close to 1.
More generally, we can calculate that in a single FIFO bottleneck scenario
with constant-rate cross traffic, <tt>SLOPE</tt> is the fraction of the bottleneck
capacity occupied by cross-traffic. However, this statement does not hold
true in all scenarios. FDACE does not require such a simple scenario and
performs correctly in more complex network setups, for instance with more
advanced AQM (Active Queue Management) disciplines (see <xref target="aqm"/>).</t>
        <t>The y-intercept <tt>INTERCEPT</tt> reflects the normalized receive duration that we
would measure if the frame was sent as an unpaced burst, reflecting total path
capacity.</t>
        <t>The agent extrapolates <tt>ESTIMATE</tt>, the normalized reception duration that we
would measure if the frame was sent at receive rate, reflecting available
capacity on the path. It corresponds to the ordinate of intersection with
the identity line <tt>NRECV = NSEND</tt>.</t>
        <t>In order to be robust when <tt>SLOPE</tt> is close or equal to 1, <tt>ESTIMATE</tt> is
approximated with successive iterations from <tt>AVG_NRECV</tt> and converging to the
intersection.
The <bcp14>RECOMMENDED</bcp14> number of iterations is <tt>ITERATIONS = 3</tt>. If <tt>ITERATIONS</tt> is
too low, NDTC will overestimate the available capacity in the presence of
cross-traffic. If <tt>ITERATIONS</tt> is higher, NDTC yields more easily against
elastic cross-traffic.</t>
        <artwork><![CDATA[
ESTIMATE = AVG_NRECV
for (i = 0; i < ITERATIONS; i++) {
    ESTIMATE = SLOPE * ESTIMATE + INTERCEPT
}
]]></artwork>
        <t>This means that when the flow is not constrained and <tt>SLOPE = 1</tt>,
<tt>ESTIMATE = AVG_NRECV</tt>, which is a conservative estimate for the capacity.</t>
        <t>For increased simplicity and performance in CPU-constrained environments,
the loop <bcp14>MAY</bcp14> be unrolled as noted in <xref target="estimate-implementation"/>.</t>
        <t>The agent <bcp14>SHOULD</bcp14> add a conservative margin <tt>MARGIN</tt> to <tt>ESTIMATE</tt>, increasing
with the linear regression error. The idea is that when the model fits poorly,
the agent should add a higher margin as a safety buffer.
The <bcp14>RECOMMENDED</bcp14> formula to calculate <tt>MARGIN</tt> is to multiply a constant
<tt>KMARGIN</tt> by the standard deviation of <tt>NRECV</tt> and <tt>1-R2</tt> where <tt>R2</tt> is the
coefficient of determination representing the proportion of variation in
<tt>NRECV</tt> explained by the linear regression. The <bcp14>RECOMMENDED</bcp14> value for <tt>KMARGIN</tt>
is 0.25. A value too close to 0 makes the algorithm react slower to abrupt
changes. A value too high for <tt>KMARGIN</tt> makes the algorithm significantly underestimate
the capacity in the presence of bursty cross traffic.</t>
        <artwork><![CDATA[
if (VAR_NSEND > 0.0 && VAR_NRECV > 0.0) {
    R2 = COVAR^2 / (VAR_NSEND * VAR_NRECV)
    MARGIN = KMARGIN * sqrt(VAR_NRECV) * (1-R2)
} else {
    MARGIN = 0.0
}
]]></artwork>
        <t>Available capacity <tt>AVAILABLE</tt> is calculated by taking the reciprocal of
the sum <tt>ESTIMATE + MARGIN</tt>:</t>
        <artwork><![CDATA[
AVAILABLE = 1.0 / (ESTIMATE + MARGIN)
]]></artwork>
      </section>
      <section anchor="target">
        <name>Target Frame Size from Available Capacity</name>
        <t>Before FDACE and the combined congestion control run for the first time,
<tt>TARGET</tt> is initialized to <tt>INIT_TARGET</tt> and <tt>SLOPE</tt> is initialized to 1.0.</t>
        <t>Each time FDACE runs and updates the available capacity, the agent now derives
the new target frame size <tt>TARGET</tt> from <tt>TRECV</tt> and <tt>AVAILABLE</tt> and caps it to
<tt>MAX_TARGET</tt>.</t>
        <artwork><![CDATA[
TARGET = min(TRECV * AVAILABLE, MAX_TARGET)
]]></artwork>
        <t>The agent <bcp14>MUST</bcp14> cap <tt>TARGET</tt> to <tt>MAX_TARGET</tt> even if the encoder has its own internal
maximum frame size to prevent a runaway feedback loop in case the path capacity
is very large. Without capping, NDTC would continue increasing the target frame
size until it matches the available path capacity even if the encoded video can't
follow it, pacing over shorter and shorter durations in the process.
Frames would be sent as very short bursts, increasing the risk of packet loss.
<tt>MAX_TARGET</tt> <bcp14>SHOULD</bcp14> be a sensible frame size that the video content can
realistically reach.</t>
      </section>
      <section anchor="congestion">
        <name>Combined AIMD Congestion Control</name>
        <t>Even if FDACE can successfully run on its own most of the time, it doesn't react
to conventional indications of network congestion, in particular packet loss,
whereas reacting to packet loss is essential in the presence of a policer on the
path. Therefore, NDTC combines an AIMD (Additive Increase Multiplicative
Decrease) process with FDACE to also adjust the frame size and send duration in
response to conventional congestion feedback. It allows the algorithm to
seamlessly transition between capacity estimation and congestion signals,
following the path evolution.</t>
        <t>The AIMD process computes a congestion target frame size <tt>CTARGET</tt> and a
pseudo-slope <tt>CSLOPE</tt> to respectively cap <tt>TARGET</tt> and <tt>SLOPE</tt>, in order to limit
the effective pacer rate. See <xref target="pacer"/> for details about how the pacer adapts
the sending duration according to the slope.</t>
        <ul spacing="normal">
          <li>
            <t>When <tt>CTARGET &lt; TARGET</tt>, the flow is congestion-limited, therefore <tt>TARGET</tt>
is set to <tt>CTARGET</tt> and <tt>CSLOPE</tt> is set to 0.0 so the pacer sends at rate
<tt>CTARGET / TRECV</tt>.</t>
          </li>
          <li>
            <t>When <tt>CTARGET &gt;= TARGET</tt>, the flow is not congestion limited, therefore
<tt>TARGET</tt> is unchanged and <tt>CSLOPE</tt> is set so that the pacer send duration
results in a send rate around <tt>CTARGET / TRECV</tt>.</t>
          </li>
          <li>
            <t>When <tt>CTARGET</tt> reaches <tt>TARGET * TRECV / TSEND</tt>, <tt>CSLOPE</tt> reaches 1.0 and
the pacer reaches its minimum send duration and maximum send rate around
<tt>TARGET/TRECV</tt>.</t>
          </li>
        </ul>
        <t>Therefore, the maximum congestion frame size for the AIMD logic is defined to
correspond to the maximum send rate:</t>
        <artwork><![CDATA[
CMAX = TARGET * TRECV / TSEND
]]></artwork>
        <t>For each transmitted frame, the agent identifies whether packets of the frame were
lost as described in <xref target="loss"/>, and runs the AIMD logic to update a congestion
frame size <tt>CSIZE</tt>. <tt>CSIZE</tt> <bcp14>SHOULD</bcp14> be initialized to <tt>MAX_TARGET</tt> as in most
cases FDACE should be self-sufficient.</t>
        <t>If one or more packets were lost, the agent performs a decrease by capping
<tt>CSIZE</tt> to <tt>CMAX</tt> and multiplying it by <tt>BETA</tt>. If no packets were lost
and <tt>CSIZE</tt> is less than <tt>CMAX</tt>, the agent increases <tt>CSIZE</tt> by adding
<tt>ALPHA</tt>, then caps the result to <tt>CMAX</tt>.
The <bcp14>RECOMMENDED</bcp14> values are <tt>ALPHA=40 bytes</tt> and <tt>BETA=0.7</tt> to make increase
and decrease relatively conservative and minimize QoE reduction.</t>
        <t>The AIMD logic <bcp14>SHOULD NOT</bcp14> feature a slow start phase and both decrease and
increase <bcp14>SHOULD</bcp14> be suppressed for one round-trip after a loss event.
In order to support L4S <xref target="RFC9330"/>, the agent <bcp14>SHOULD</bcp14> also react similarly
to Prague congestion control <xref target="draft-briscoe-iccrg-prague-congestion-control"/>,
which requires supporting ECN <xref target="RFC9331"/>, and if the agent is the sender, it also
requires compatible feedback like <xref target="RFC8888"/>. If the last ECN decrease is
more recent than the last packet loss event, the increase <bcp14>SHOULD</bcp14> be performed
by adding a larger <tt>EALPHA</tt> instead of <tt>ALPHA</tt> for the flow to compete more
fairly with other flows. The <bcp14>RECOMMENDED</bcp14> value is <tt>EALPHA=400 bytes</tt>.</t>
        <t>The <bcp14>RECOMMENDED</bcp14> algorithm is described in <xref target="aimd-implementation"/>.</t>
        <t>If the agent is the sender, it <bcp14>SHOULD</bcp14> also perform the decrease in case it
does not get any feedback for a significant duration after sending a frame.
In any case, the sender <bcp14>SHOULD</bcp14> implement a circuit breaker to stop sending
after it stops receiving feedback for a significant duration, following the
recommendations in <xref target="RFC8083"/>.</t>
        <t>The congestion frame size <tt>CTARGET</tt> is calculated as the minimum of
<tt>CSIZE</tt> and <tt>CMAX</tt>:</t>
        <artwork><![CDATA[
CTARGET = min(CSIZE, CMAX)
]]></artwork>
        <t>Then, <tt>CSLOPE</tt> is calculated such that the average pacing rate is
<tt>CTARGET/TRECV</tt>. This is obtained by solving for <tt>CSLOPE</tt> in the pacer
equation in <xref target="pacer"/> such that when <tt>LENGTH = TARGET</tt>, the send
duration results in an effective send rate of <tt>CTARGET/TRECV</tt>:</t>
        <artwork><![CDATA[
CSLOPE = max(1 - (TSEND/TRECV) * (CMAX/CTARGET), 0) / (1 - TSEND/TRECV)
]]></artwork>
      </section>
      <section anchor="encoder">
        <name>Encoder Target Frame Size</name>
        <t>The agent caps the target frame size <tt>TARGET</tt> and the slope <tt>SLOPE</tt>
with <tt>CTARGET</tt> and <tt>CSLOPE</tt> respectively to take into account the most
conservative estimate:</t>
        <artwork><![CDATA[
TARGET = min(TARGET, CTARGET)
SLOPE = min(SLOPE, CSLOPE)
]]></artwork>
        <t>The agent <                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            