APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.internal.net.http.quic

public Class QuicRttEstimator

extends Object
Class Inheritance
Imports
java.time.Duration, java.time.temporal.ChronoUnit, java.util.concurrent.TimeUnit, jdk.internal.net.http.common.Deadline, .Utils

Estimator for quic connection round trip time. Defined in RFC 9002 section 5. Takes RTT samples as input (max 1 sample per ACK frame) Produces: - minimum RTT over a period of time (minRtt) for internal use - exponentially weighted moving average (smoothedRtt) - mean deviation / variation in the observed samples (rttVar)
External Specification
https://www.rfc-editor.org/info/rfc9000, https://www.rfc-editor.org/info/rfc9002

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static record

Field Summary

Modifier and TypeField and Description
private Deadline
private static final long
private static final long
private long
public static final long
public static final Duration
public static final Duration
private long
private long
private long
private long
private long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public synchronized void
consumeRttSample(long
time between when packet was sent and ack was received, in microseconds
latestRttMicros
,
long
ack delay received in ack frame, decoded to microseconds
ackDelayMicros
,
Deadline
time at which latestRttMicros was calculated
now
)

Update the estimator with latest RTT sample.

public synchronized Duration

Returns:

the amount of time to wait for acknowledgement of a sent packet, excluding max ack delay
getBasePtoDuration
()

Returns the amount of time to wait for acknowledgement of a sent packet, excluding max ack delay.

public synchronized Duration

Returns:

time threshold for time-based loss detection
getLossThreshold
()

Returns time threshold for time-based loss detection.

public synchronized long
public synchronized long
public synchronized boolean
public synchronized void
public synchronized QuicRttEstimator.QuicRttEstimatorState
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

firstSampleback to summary
private Deadline firstSample
GRANULARITY_MICROSback to summary
private static final long GRANULARITY_MICROS
INITIAL_RTTback to summary
private static final long INITIAL_RTT
latestRttMicrosback to summary
private long latestRttMicros
MAX_PTO_BACKOFFback to summary
public static final long MAX_PTO_BACKOFF
MAX_PTO_BACKOFF_TIMEOUTback to summary
public static final Duration MAX_PTO_BACKOFF_TIMEOUT
MIN_PTO_BACKOFF_TIMEOUTback to summary
public static final Duration MIN_PTO_BACKOFF_TIMEOUT
minRttMicrosback to summary
private long minRttMicros
ptoBackoffFactorback to summary
private long ptoBackoffFactor
rttSampleCountback to summary
private long rttSampleCount
rttVarMicrosback to summary
private long rttVarMicros
smoothedRttMicrosback to summary
private long smoothedRttMicros

Constructor Detail

QuicRttEstimatorback to summary
public QuicRttEstimator()

Method Detail

consumeRttSampleback to summary
public synchronized void consumeRttSample(long latestRttMicros, long ackDelayMicros, Deadline now)

Update the estimator with latest RTT sample. Use only samples where: - the largest acknowledged PN is newly acknowledged - at least one of the newly acked packets is ack-eliciting

Parameters
latestRttMicros:long

time between when packet was sent and ack was received, in microseconds

ackDelayMicros:long

ack delay received in ack frame, decoded to microseconds

now:Deadline

time at which latestRttMicros was calculated

getBasePtoDurationback to summary
public synchronized Duration getBasePtoDuration()

Returns the amount of time to wait for acknowledgement of a sent packet, excluding max ack delay. See RFC 9002 section 6.1.2

Returns:Duration

the amount of time to wait for acknowledgement of a sent packet, excluding max ack delay

getLossThresholdback to summary
public synchronized Duration getLossThreshold()

Returns time threshold for time-based loss detection. See RFC 9002 section 6.1.2

Returns:Duration

time threshold for time-based loss detection

getPtoBackoffback to summary
public synchronized long getPtoBackoff()
increasePtoBackoffback to summary
public synchronized long increasePtoBackoff()
isMinBackoffTimeoutExceededback to summary
public synchronized boolean isMinBackoffTimeoutExceeded()
resetPtoBackoffback to summary
public synchronized void resetPtoBackoff()
stateback to summary
public synchronized QuicRttEstimator.QuicRttEstimatorState state()
jdk.internal.net.http.quic back to summary

public final Record QuicRttEstimator.QuicRttEstimatorState

extends Record
Class Inheritance
Record Components
latestRttMicros:long 
minRttMicros:long 
smoothedRttMicros:long 
rttVarMicros:long 
rttSampleCount:long 

Field Summary

Modifier and TypeField and Description
private final long
latestRttMicros

Record Component accessed by latestRttMicros().

private final long
minRttMicros

Record Component accessed by minRttMicros().

private final long
rttSampleCount

Record Component accessed by rttSampleCount().

private final long
rttVarMicros

Record Component accessed by rttVarMicros().

private final long
smoothedRttMicros

Record Component accessed by smoothedRttMicros().

Constructor Summary

AccessConstructor and Description
public
QuicRttEstimatorState(long latestRttMicros, long minRttMicros, long smoothedRttMicros, long rttVarMicros, long rttSampleCount)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public long
latestRttMicros()

Record Component getter of latestRttMicros.

public long
minRttMicros()

Record Component getter of minRttMicros.

public long
rttSampleCount()

Record Component getter of rttSampleCount.

public long
rttVarMicros()

Record Component getter of rttVarMicros.

public long
smoothedRttMicros()

Record Component getter of smoothedRttMicros.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

latestRttMicrosback to summary
private final long latestRttMicros

Record Component accessed by latestRttMicros().

minRttMicrosback to summary
private final long minRttMicros

Record Component accessed by minRttMicros().

rttSampleCountback to summary
private final long rttSampleCount

Record Component accessed by rttSampleCount().

rttVarMicrosback to summary
private final long rttVarMicros

Record Component accessed by rttVarMicros().

smoothedRttMicrosback to summary
private final long smoothedRttMicros

Record Component accessed by smoothedRttMicros().

Constructor Detail

QuicRttEstimatorStateback to summary
public QuicRttEstimatorState(long latestRttMicros, long minRttMicros, long smoothedRttMicros, long rttVarMicros, long rttSampleCount)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

latestRttMicrosback to summary
public long latestRttMicros()

Record Component getter of latestRttMicros.

minRttMicrosback to summary
public long minRttMicros()

Record Component getter of minRttMicros.

rttSampleCountback to summary
public long rttSampleCount()

Record Component getter of rttSampleCount.

rttVarMicrosback to summary
public long rttVarMicros()

Record Component getter of rttVarMicros.

smoothedRttMicrosback to summary
public long smoothedRttMicros()

Record Component getter of smoothedRttMicros.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.