Class NewReno
java.lang.Object
io.github.mahmoudimus.quic.congestion.NewReno
- All Implemented Interfaces:
Controller
The NewReno congestion controller of RFC 9002 section 7: slow start, then congestion avoidance
growing the window by one datagram per window acknowledged (Appropriate Byte Counting, RFC
3465), and a multiplicative decrease once per recovery period.
Threads. Not thread-safe; owned by one connection.
-
Field Summary
Fields inherited from interface io.github.mahmoudimus.quic.congestion.Controller
BASE_DATAGRAM_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionNewReno(NewRenoConfig config, long now, int currentMtu) A controller in slow start. -
Method Summary
Modifier and TypeMethodDescriptioncopy()A copy of the controller's state, for a new path that starts from this one.longThe initial window.metrics()Metrics for statistics and tracing.voidonAck(long now, long sent, long bytes, boolean appLimited, RttEstimator rtt) A packet's delivery was confirmed.voidonCongestionEvent(long now, long sent, boolean persistentCongestion, boolean ecn, long lostBytes) Packets were deemed lost, or marked with ECN congestion experienced.voidonMtuUpdate(int newMtu) The path's MTU changed.longThe slow start threshold.longwindow()The congestion window.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.mahmoudimus.quic.congestion.Controller
onEndAcks, onRateSample, onSent, onSpuriousCongestionEvent, pacingRate
-
Constructor Details
-
NewReno
A controller in slow start.- Parameters:
config- the configurationnow- the current time, in nanosecondscurrentMtu- the path's maximum UDP payload size
-
-
Method Details
-
onAck
Description copied from interface:ControllerA packet's delivery was confirmed.- Specified by:
onAckin interfaceController- Parameters:
now- the current timesent- when the packet was sentbytes- the packet's sizeappLimited- whether the connection was limited by the application, not the window, before these acknowledgementsrtt- the path's RTT estimate
-
onCongestionEvent
public void onCongestionEvent(long now, long sent, boolean persistentCongestion, boolean ecn, long lostBytes) Description copied from interface:ControllerPackets were deemed lost, or marked with ECN congestion experienced.- Specified by:
onCongestionEventin interfaceController- Parameters:
now- the current timesent- when the most recent lost packet was sentpersistentCongestion- whether every packet in the persistent congestion period ending with that packet was lost (RFC 9002 section 7.6)ecn- whether this is an ECN signal rather than losslostBytes- the bytes lost, zero for ECN
-
onMtuUpdate
public void onMtuUpdate(int newMtu) Description copied from interface:ControllerThe path's MTU changed.- Specified by:
onMtuUpdatein interfaceController- Parameters:
newMtu- the new maximum UDP payload size
-
window
public long window()Description copied from interface:ControllerThe congestion window.- Specified by:
windowin interfaceController- Returns:
- the ack-eliciting bytes that may be in flight
-
slowStartThreshold
public long slowStartThreshold()The slow start threshold.- Returns:
- bytes,
Long.MAX_VALUEbefore the first congestion event
-
metrics
Description copied from interface:ControllerMetrics for statistics and tracing.- Specified by:
metricsin interfaceController- Returns:
- the window and, where known, the slow start threshold
-
copy
Description copied from interface:ControllerA copy of the controller's state, for a new path that starts from this one.- Specified by:
copyin interfaceController- Returns:
- an independent copy
-
initialWindow
public long initialWindow()Description copied from interface:ControllerThe initial window.- Specified by:
initialWindowin interfaceController- Returns:
- bytes
-