Class ConnectionConfig.Builder
- Enclosing class:
- ConnectionConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract ConnectionConfig.Builder
activeOpen
(boolean activeOpen) If enabled, a handshake will be issued onChannelInboundHandler.channelActive(ChannelHandlerContext)
.abstract ConnectionConfig.Builder
alpha
(double alpha) The ALPHA smoothing factor used for congestion control algorithm to calculate the current congestion window size.abstract ConnectionConfig.Builder
beta
(double beta) The BETA delay variance factor is used in congestion control algorithm.build()
abstract ConnectionConfig.Builder
clock
(ConnectionConfig.Clock clock) Defines the clock used as time source.abstract ConnectionConfig.Builder
fs
(double fs) A constant used by the Nagle algorithm.abstract ConnectionConfig.Builder
issSupplier
(LongSupplier issSupplier) Used to choose an initial send sequence number.abstract ConnectionConfig.Builder
k
(int k) The K constant is used to scale the RTT variance to calculate the retransmission timeout.abstract ConnectionConfig.Builder
The minimum value allowed for the retransmission timeout.abstract ConnectionConfig.Builder
mmsR
(int mmsR) The maximum size for a drasyl-layer message that can be received.abstract ConnectionConfig.Builder
mmsS
(int mmsS) The maximum segment size for a drasyl-layer message that a connection may send.abstract ConnectionConfig.Builder
The maximum segment lifetime, the time a segment can exist in the network.abstract ConnectionConfig.Builder
noDelay
(boolean noDelay) If enabled, small data packets are sent without delay, instead of waiting for larger packets to be filled.abstract ConnectionConfig.Builder
overrideTimeout
(Duration overrideTimeout) Defines how long small data packets are delayed at most.abstract ConnectionConfig.Builder
rcfBufSupplier
(Supplier<ReceiveBuffer> rcfBufSupplier) Used to create theReceiveBuffer
.abstract ConnectionConfig.Builder
rmem
(int rmem) Defines the receive buffer size (rmem).abstract ConnectionConfig.Builder
rtnsQSupplier
(Function<io.netty.channel.Channel, RetransmissionQueue> rtnsQSupplier) Used to create theRetransmissionQueue
.abstract ConnectionConfig.Builder
The retransmission timeout (RTO) is the amount of time that a connection waits before retransmitting a packet that has not been acknowledged.abstract ConnectionConfig.Builder
sndBufSupplier
(Function<io.netty.channel.Channel, SendBuffer> sndBufSupplier) Used to create theSendBuffer
.abstract ConnectionConfig.Builder
tcbSupplier
(BiFunction<ConnectionConfig, io.netty.channel.Channel, TransmissionControlBlock> tcbProvider) Used to create theTransmissionControlBlock
.abstract ConnectionConfig.Builder
timestamps
(boolean timestamps) Enables the Timestamps option which is used for round-trip time measurements.abstract ConnectionConfig.Builder
The maximum value allowed for the retransmission timeout.abstract ConnectionConfig.Builder
unusedPortSupplier
(IntSupplier unusedPortSupplier) abstract ConnectionConfig.Builder
userTimeout
(Duration userTimeout) Defines the duration how long a connection waits for sent data to be acknowledged before the connection is closed.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
unusedPortSupplier
-
issSupplier
Used to choose an initial send sequence number. A random number within [0,4294967296] is chosen by default. -
sndBufSupplier
public abstract ConnectionConfig.Builder sndBufSupplier(Function<io.netty.channel.Channel, SendBuffer> sndBufSupplier) Used to create theSendBuffer
. -
rtnsQSupplier
public abstract ConnectionConfig.Builder rtnsQSupplier(Function<io.netty.channel.Channel, RetransmissionQueue> rtnsQSupplier) Used to create theRetransmissionQueue
. -
rcfBufSupplier
Used to create theReceiveBuffer
. -
tcbSupplier
public abstract ConnectionConfig.Builder tcbSupplier(BiFunction<ConnectionConfig, io.netty.channel.Channel, TransmissionControlBlock> tcbProvider) Used to create theTransmissionControlBlock
. -
activeOpen
If enabled, a handshake will be issued onChannelInboundHandler.channelActive(ChannelHandlerContext)
. Otherwise, the remote peer must initiate the handshake. -
rmem
Defines the receive buffer size (rmem). Refers to the amount of memory allocated on the receiving side of a connection to temporarily store incoming data before it's processed by the application. Increasing the buffer size can improve network performance by reducing the likelihood of packet loss due to buffer overflow. However, it can also increase memory usage on the receiving side and may not always result in significant performance gains. Set to65535
bytes by default. -
msl
The maximum segment lifetime, the time a segment can exist in the network. According to RFC 9293, arbitrarily defined to be 2 minutes by default. -
noDelay
If enabled, small data packets are sent without delay, instead of waiting for larger packets to be filled. Disabling can reduce latency and improve the responsiveness of real-time applications, but may increase the overall network traffic. -
overrideTimeout
Defines how long small data packets are delayed at most. According to RFC 9293, the override timeout should be in the range 0.1 - 1.0 seconds. Default value is 0.1 seconds.- See Also:
-
fs
A constant used by the Nagle algorithm. Recommended value is 1/2. The default is set to this recommendation- See Also:
-
userTimeout
Defines the duration how long a connection waits for sent data to be acknowledged before the connection is closed. -
timestamps
Enables the Timestamps option which is used for round-trip time measurements. Used to arrive a reasonable value for the retransmission timeout. If disabled, the timeout specified byrto(Duration)
is used. Enabled by default.- See Also:
-
rto
The retransmission timeout (RTO) is the amount of time that a connection waits before retransmitting a packet that has not been acknowledged. -
lBound
The minimum value allowed for the retransmission timeout. This is 1 second by default. Iftimestamps(boolean)
is disabled, this value is used as static retransmission timeout. -
uBound
The maximum value allowed for the retransmission timeout. This is 1 minute by default. -
alpha
The ALPHA smoothing factor used for congestion control algorithm to calculate the current congestion window size. It determines the weight given to new data when estimating the network's bandwidth.A higher value for the ALPHA parameter leads to more aggressive growth of the congestion window and can result in higher throughput but may also cause more congestion in the network. A lower value for the ALPHA parameter can help to reduce congestion but may also lead to lower throughput.
According to RFC 6298, a value of 1/8 is suggested. The default is set to this suggestion.
- See Also:
-
beta
The BETA delay variance factor is used in congestion control algorithm. It's used to adjust the rate at which the congestion window size is decreased when packets are lost or delayed.A higher value for the BETA parameter can cause the connection to be more aggressive in reducing the congestion window, which can help to prevent congestion but may also lead to reduced throughput. A lower value for the BETA parameter can result in less aggressive reduction of the congestion window, which can lead to higher throughput but may also cause more congestion in the network.
According to RFC 6298, a value of 1/4 is suggested. The default is set to this suggestion.
- See Also:
-
k
The K constant is used to scale the RTT variance to calculate the retransmission timeout.According to RFC 6298, a value of 4 is suggested. The default is set to this suggestion.
- See Also:
-
clock
Defines the clock used as time source. -
mmsS
The maximum segment size for a drasyl-layer message that a connection may send. This value is the IP layer MTU (drasyl assumes a MTU of 1460) minus the drasyl header size. So this value specifies the segment size sent to the wire (including header).- See Also:
-
mmsR
The maximum size for a drasyl-layer message that can be received. This value is the IP layer MTU (drasyl assumes a MTU of 1460) minus the drasyl header size. So this value specifies the segment size sent to the wire (including header).- See Also:
-
build
-