Record Class MtuDiscoveryConfig
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.connection.MtuDiscoveryConfig
- Record Components:
interval- the time between discovery runs, in nanoseconds; 600 s by default (RFC 8899)upperBound- the largest UDP payload to search for, at most 65527; 1452 by default, which fits Ethernet with IPv4 or IPv6minimumChange- the step below which the search stops; 20 by defaultblackHoleCooldown- the wait after a black hole before searching again, in nanoseconds; 60 s by default
public record MtuDiscoveryConfig(long interval, int upperBound, int minimumChange, long blackHoleCooldown)
extends Record
Configuration of DPLPMTUD, packetization layer path MTU discovery (RFC 8899, RFC 9000 section
14.3). Discovery runs right after the handshake and again every
interval; it binary
searches between the current MTU and the smaller of upperBound and the peer's
max_udp_payload_size. A black hole (lost packets above the minimum MTU) drops the MTU to the
minimum and restarts discovery after blackHoleCooldown.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MtuDiscoveryConfigThe defaults.static final intThe largest UDP payload over IPv6, 65527 bytes. -
Constructor Summary
ConstructorsConstructorDescriptionMtuDiscoveryConfig(long interval, int upperBound, int minimumChange, long blackHoleCooldown) A configuration;upperBoundis clamped toMAX_UDP_PAYLOAD. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of theblackHoleCooldownrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longinterval()Returns the value of theintervalrecord component.intReturns the value of theminimumChangerecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of theupperBoundrecord component.withUpperBound(int value) This configuration with another upper bound.
-
Field Details
-
MAX_UDP_PAYLOAD
public static final int MAX_UDP_PAYLOADThe largest UDP payload over IPv6, 65527 bytes.- See Also:
-
DEFAULT
The defaults.
-
-
Constructor Details
-
MtuDiscoveryConfig
public MtuDiscoveryConfig(long interval, int upperBound, int minimumChange, long blackHoleCooldown) A configuration;upperBoundis clamped toMAX_UDP_PAYLOAD.- Parameters:
interval- the time between runs, in nanosecondsupperBound- the largest payload to search forminimumChange- the step that stops the search, positiveblackHoleCooldown- the wait after a black hole, in nanoseconds
-
-
Method Details
-
withUpperBound
This configuration with another upper bound.- Parameters:
value- the largest payload to search for- Returns:
- the new configuration
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
interval
public long interval()Returns the value of theintervalrecord component.- Returns:
- the value of the
intervalrecord component
-
upperBound
public int upperBound()Returns the value of theupperBoundrecord component.- Returns:
- the value of the
upperBoundrecord component
-
minimumChange
public int minimumChange()Returns the value of theminimumChangerecord component.- Returns:
- the value of the
minimumChangerecord component
-
blackHoleCooldown
public long blackHoleCooldown()Returns the value of theblackHoleCooldownrecord component.- Returns:
- the value of the
blackHoleCooldownrecord component
-