Record Class InitialPacketShape
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.connection.InitialPacketShape
- Record Components:
firstPacketNumber- the number of the first Initial packet, when notrandomFirstPacketNumberpadToDatagramSize- whether Initial datagrams are padded to the datagram size (the transport'sinitialMtu), not only to the 1200 bytes RFC 9000 requireschaosProtection- whether CRYPTO data is cut up and shuffled with PING and PADDING frames (ChaosProtector, Chrome's "chaos protection")randomFirstPacketNumber- whether the first packet number is random, as neqo (Firefox) makes it: 1 to 32, and one time in eight up to 1024 moresniSlicing- whether the ClientHello is cut in two at the middle of its server name and the halves sent in reverse order, spread over packets of about equal size (neqo's "SNI slicing")padAfterPacket- whether an Initial datagram is padded with zero bytes after its packets, as neqo pads it, rather than with PADDING frames inside the packet
public record InitialPacketShape(long firstPacketNumber, boolean padToDatagramSize, boolean chaosProtection, boolean randomFirstPacketNumber, boolean sniSlicing, boolean padAfterPacket)
extends Record
How a client's Initial packets look on the wire, the parts of a browser's QUIC fingerprint they
make: the first packet number, how an Initial datagram is padded, and how the ClientHello's
CRYPTO data is laid out.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final InitialPacketShapeChrome 156's, as captured: packet numbers from 1, datagrams padded to their size (1250 bytes with the transport's initial MTU set to 1250, as Chrome's is), chaos protection on.static final InitialPacketShapeFirefox 159's (neqo), as captured: a random first packet number, SNI slicing, and datagrams padded to their size (1252 bytes over IPv4) with zero bytes after the packet. -
Constructor Summary
ConstructorsConstructorDescriptionInitialPacketShape(long firstPacketNumber, boolean padToDatagramSize, boolean chaosProtection) A shape with a fixed first packet number, padded with PADDING frames, without SNI slicing.InitialPacketShape(long firstPacketNumber, boolean padToDatagramSize, boolean chaosProtection, boolean randomFirstPacketNumber, boolean sniSlicing, boolean padAfterPacket) Creates an instance of aInitialPacketShaperecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thechaosProtectionrecord component.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of thefirstPacketNumberrecord component.longfirstPacketNumber(RandomGenerator random) The number of a connection's first Initial packet.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thepadAfterPacketrecord component.booleanReturns the value of thepadToDatagramSizerecord component.booleanReturns the value of therandomFirstPacketNumberrecord component.booleanReturns the value of thesniSlicingrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CHROME
Chrome 156's, as captured: packet numbers from 1, datagrams padded to their size (1250 bytes with the transport's initial MTU set to 1250, as Chrome's is), chaos protection on. -
FIREFOX
Firefox 159's (neqo), as captured: a random first packet number, SNI slicing, and datagrams padded to their size (1252 bytes over IPv4) with zero bytes after the packet.
-
-
Constructor Details
-
InitialPacketShape
public InitialPacketShape(long firstPacketNumber, boolean padToDatagramSize, boolean chaosProtection, boolean randomFirstPacketNumber, boolean sniSlicing, boolean padAfterPacket) Creates an instance of aInitialPacketShaperecord class.- Parameters:
firstPacketNumber- the value for thefirstPacketNumberrecord componentpadToDatagramSize- the value for thepadToDatagramSizerecord componentchaosProtection- the value for thechaosProtectionrecord componentrandomFirstPacketNumber- the value for therandomFirstPacketNumberrecord componentsniSlicing- the value for thesniSlicingrecord componentpadAfterPacket- the value for thepadAfterPacketrecord component
-
InitialPacketShape
public InitialPacketShape(long firstPacketNumber, boolean padToDatagramSize, boolean chaosProtection) A shape with a fixed first packet number, padded with PADDING frames, without SNI slicing.
-
-
Method Details
-
firstPacketNumber
The number of a connection's first Initial packet.- Parameters:
random- the source of a random one- Returns:
- the number
-
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 '=='. -
firstPacketNumber
public long firstPacketNumber()Returns the value of thefirstPacketNumberrecord component.- Returns:
- the value of the
firstPacketNumberrecord component
-
padToDatagramSize
public boolean padToDatagramSize()Returns the value of thepadToDatagramSizerecord component.- Returns:
- the value of the
padToDatagramSizerecord component
-
chaosProtection
public boolean chaosProtection()Returns the value of thechaosProtectionrecord component.- Returns:
- the value of the
chaosProtectionrecord component
-
randomFirstPacketNumber
public boolean randomFirstPacketNumber()Returns the value of therandomFirstPacketNumberrecord component.- Returns:
- the value of the
randomFirstPacketNumberrecord component
-
sniSlicing
public boolean sniSlicing()Returns the value of thesniSlicingrecord component.- Returns:
- the value of the
sniSlicingrecord component
-
padAfterPacket
public boolean padAfterPacket()Returns the value of thepadAfterPacketrecord component.- Returns:
- the value of the
padAfterPacketrecord component
-