Class TransportParameterProfile

java.lang.Object
io.github.mahmoudimus.quic.params.TransportParameterProfile

public final class TransportParameterProfile extends Object
Which transport parameters a client's quic_transport_parameters carries, in what order, and what it adds that QUIC does not need: the parts of a browser's QUIC fingerprint the parameters make. The values of the parameters that configure the connection come from the connection's own TransportParameters, so what is advertised is what the connection does; a parameter the profile leaves out is advertised as its default, which the connection must then hold to (for ack_delay_exponent, max_ack_delay and active_connection_id_limit).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    In ids: a GREASE parameter (RFC 9000 section 18.1), its id and value random.
    static final long
    In ids: version_information as neqo (Firefox) sends it, the chosen version, then a GREASE version, QUIC version 2 and version 1 as the available ones.
    static final long
    version_information (RFC 9368), with a GREASE version among the available ones.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TransportParameterProfile(String name, List<Long> ids, boolean shuffle, Map<Long,byte[]> fixed)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    availableVersions(int version)
    The QUIC versions a version_information the profile sends lists as available, besides GREASE: what a server may switch the connection to (RFC 9368 compatible version negotiation).
    Chrome 156's, as captured over HTTP/3: max_idle_timeout, max_udp_payload_size, the four flow-control limits, both stream limits, an empty initial_source_connection_id, version_information with a GREASE version, max_datagram_frame_size 65536, google_connection_options ORIG (0x3128) and a GREASE parameter, shuffled per connection.
    byte[]
    encode(TransportParameters actual, int version, RandomGenerator random)
    The quic_transport_parameters body for a connection.
    Firefox 159's (neqo), as captured over HTTP/3, in its fixed order and without a GREASE parameter: max_idle_timeout, the four flow-control limits (the windows of streams the server opens, 1 MiB, smaller than the client's own), both stream limits, max_ack_delay, active_connection_id_limit, initial_source_connection_id, version_information in neqo's form, an empty reset_stream_at, min_ack_delay 1000 microseconds and max_datagram_frame_size.
    Returns the profile's name.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • GREASE

      public static final long GREASE
      In ids: a GREASE parameter (RFC 9000 section 18.1), its id and value random.
      See Also:
    • VERSION_INFORMATION

      public static final long VERSION_INFORMATION
      version_information (RFC 9368), with a GREASE version among the available ones.
      See Also:
    • NEQO_VERSION_INFORMATION

      public static final long NEQO_VERSION_INFORMATION
      In ids: version_information as neqo (Firefox) sends it, the chosen version, then a GREASE version, QUIC version 2 and version 1 as the available ones.
      See Also:
  • Constructor Details

    • TransportParameterProfile

      public TransportParameterProfile(String name, List<Long> ids, boolean shuffle, Map<Long,byte[]> fixed)
      Parameters:
      name - the profile's name
      ids - the parameters, in order: ids the connection sets, GREASE, VERSION_INFORMATION, or ids of fixed
      shuffle - whether each connection sends them in a random order
      fixed - values sent as they are, by id, such as Google's google_connection_options
  • Method Details

    • chrome156

      public static TransportParameterProfile chrome156()
      Chrome 156's, as captured over HTTP/3: max_idle_timeout, max_udp_payload_size, the four flow-control limits, both stream limits, an empty initial_source_connection_id, version_information with a GREASE version, max_datagram_frame_size 65536, google_connection_options ORIG (0x3128) and a GREASE parameter, shuffled per connection.
      Returns:
      the profile
    • firefox159

      public static TransportParameterProfile firefox159()
      Firefox 159's (neqo), as captured over HTTP/3, in its fixed order and without a GREASE parameter: max_idle_timeout, the four flow-control limits (the windows of streams the server opens, 1 MiB, smaller than the client's own), both stream limits, max_ack_delay, active_connection_id_limit, initial_source_connection_id, version_information in neqo's form, an empty reset_stream_at, min_ack_delay 1000 microseconds and max_datagram_frame_size.
      Returns:
      the profile
    • name

      public String name()
      Returns the profile's name.
      Returns:
      the profile's name
    • encode

      public byte[] encode(TransportParameters actual, int version, RandomGenerator random)
      The quic_transport_parameters body for a connection.
      Parameters:
      actual - the connection's parameters, whose values the profile's ids take
      version - the connection's QUIC version, for version_information
      random - the source of the order and the GREASE values
      Returns:
      the encoded parameters
    • availableVersions

      public List<Integer> availableVersions(int version)
      The QUIC versions a version_information the profile sends lists as available, besides GREASE: what a server may switch the connection to (RFC 9368 compatible version negotiation).
      Parameters:
      version - the connection's version
      Returns:
      the versions, in the profile's order
    • toString

      public String toString()
      Overrides:
      toString in class Object