Record Class NewRenoConfig

java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.congestion.NewRenoConfig
Record Components:
initialWindow - the initial congestion window in bytes; RFC 9002 recommends min(10 * max_datagram_size, max(2 * max_datagram_size, 14720))
lossReductionFactor - the factor the window is multiplied by on a congestion event, 0.5 in RFC 9002
All Implemented Interfaces:
ControllerFactory

public record NewRenoConfig(long initialWindow, double lossReductionFactor) extends Record implements ControllerFactory
Configuration of the NewReno controller.
  • Field Details

    • DEFAULT

      public static final NewRenoConfig DEFAULT
      The RFC 9002 defaults: a 12000-byte initial window and a loss reduction factor of 0.5.
  • Constructor Details

    • NewRenoConfig

      public NewRenoConfig(long initialWindow, double lossReductionFactor)
      A configuration.
      Parameters:
      initialWindow - the initial window, positive
      lossReductionFactor - the reduction factor, in (0, 1]
  • Method Details

    • build

      public Controller build(long now, int currentMtu)
      Description copied from interface: ControllerFactory
      A new controller.
      Specified by:
      build in interface ControllerFactory
      Parameters:
      now - the current time, in nanoseconds
      currentMtu - the path's current maximum UDP payload size
      Returns:
      the controller
    • 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.
    • initialWindow

      public long initialWindow()
      Returns the value of the initialWindow record component.
      Returns:
      the value of the initialWindow record component
    • lossReductionFactor

      public double lossReductionFactor()
      Returns the value of the lossReductionFactor record component.
      Returns:
      the value of the lossReductionFactor record component