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 IPv6
minimumChange - the step below which the search stops; 20 by default
blackHoleCooldown - 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 Details

    • MAX_UDP_PAYLOAD

      public static final int MAX_UDP_PAYLOAD
      The largest UDP payload over IPv6, 65527 bytes.
      See Also:
    • DEFAULT

      public static final MtuDiscoveryConfig DEFAULT
      The defaults.
  • Constructor Details

    • MtuDiscoveryConfig

      public MtuDiscoveryConfig(long interval, int upperBound, int minimumChange, long blackHoleCooldown)
      A configuration; upperBound is clamped to MAX_UDP_PAYLOAD.
      Parameters:
      interval - the time between runs, in nanoseconds
      upperBound - the largest payload to search for
      minimumChange - the step that stops the search, positive
      blackHoleCooldown - the wait after a black hole, in nanoseconds
  • Method Details

    • withUpperBound

      public MtuDiscoveryConfig withUpperBound(int value)
      This configuration with another upper bound.
      Parameters:
      value - the largest payload to search for
      Returns:
      the new configuration
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • interval

      public long interval()
      Returns the value of the interval record component.
      Returns:
      the value of the interval record component
    • upperBound

      public int upperBound()
      Returns the value of the upperBound record component.
      Returns:
      the value of the upperBound record component
    • minimumChange

      public int minimumChange()
      Returns the value of the minimumChange record component.
      Returns:
      the value of the minimumChange record component
    • blackHoleCooldown

      public long blackHoleCooldown()
      Returns the value of the blackHoleCooldown record component.
      Returns:
      the value of the blackHoleCooldown record component