Detailed Description

Calculating RTO

To calculate retransmission timeout (RTO), Round Trip Time (RTT) needs to be taken into account. SRTT (smoothed round-trip time) and RTTVAR (round-trip time variation) are hence calculated as follows:

RTTVAR <- (1 - beta) * RTTVAR + beta * |SRTT - R'|
SRTT <- (1 - alpha) * SRTT + alpha * R'

where alpha ( 1 / CONFIG_GNRC_TCP_RTO_A_DIV ) and beta ( 1 / CONFIG_GNRC_TCP_RTO_B_DIV) are constants, and R' is the instantaneous RTT value.

RTO is then calculated as :

RTO <- SRTT + max (G, K*RTTVAR)

where K is a constant, and G is clock granularity in seconds ( CONFIG_GNRC_TCP_RTO_GRANULARITY_MS). For more information refer to https://tools.ietf.org/html/rfc6298

#define CONFIG_GNRC_TCP_CONNECTION_TIMEOUT_DURATION_MS   (120U * MS_PER_SEC)
 Timeout duration in milliseconds for user calls. More...
 
#define CONFIG_GNRC_TCP_MSL_MS   (30U * MS_PER_SEC)
 Maximum segment lifetime (MSL) in milliseconds. More...
 
#define CONFIG_GNRC_TCP_MSS   (1220U)
 Maximum Segment Size (MSS). More...
 
#define CONFIG_GNRC_TCP_MSS_MULTIPLICATOR   (1U)
 MSS Multiplicator = Number of MSS sized packets stored in receive buffer.
 
#define CONFIG_GNRC_TCP_DEFAULT_WINDOW   (CONFIG_GNRC_TCP_MSS * CONFIG_GNRC_TCP_MSS_MULTIPLICATOR)
 Default receive window size.
 
#define CONFIG_GNRC_TCP_RCV_BUFFERS   (1U)
 Number of preallocated receive buffers. More...
 
#define GNRC_TCP_RCV_BUF_SIZE   (CONFIG_GNRC_TCP_DEFAULT_WINDOW)
 Default receive buffer size.
 
#define CONFIG_GNRC_TCP_RTO_LOWER_BOUND_MS   (1U * MS_PER_SEC)
 Lower bound for RTO in milliseconds. More...
 
#define CONFIG_GNRC_TCP_RTO_UPPER_BOUND_MS   (60U * MS_PER_SEC)
 Upper bound for RTO in milliseconds. More...
 
#define CONFIG_GNRC_TCP_RTO_GRANULARITY_MS   (10U)
 Clock granularity for TCP in milliseconds. More...
 
#define CONFIG_GNRC_TCP_RTO_A_DIV   (8U)
 Alpha value for RTO calculation, default is 1/8.
 
#define CONFIG_GNRC_TCP_RTO_B_DIV   (4U)
 Beta value for RTO calculation, default is 1/4.
 
#define CONFIG_GNRC_TCP_RTO_K   (4U)
 K value for RTO calculation, default is 4.
 
#define CONFIG_GNRC_TCP_PROBE_LOWER_BOUND_MS   (1U * MS_PER_SEC)
 Lower bound for the duration between probes in milliseconds. More...
 
#define CONFIG_GNRC_TCP_PROBE_UPPER_BOUND_MS   (60U * MS_PER_SEC)
 Upper bound for the duration between probes in milliseconds. More...
 
#define CONFIG_GNRC_TCP_MSG_QUEUE_SIZE_EXP   (2U)
 Message queue size for TCP API internal messaging. More...
 
#define CONFIG_GNRC_TCP_EVENTLOOP_MSG_QUEUE_SIZE_EXP   (3U)
 Message queue size for the TCP eventloop. More...
 

Macro Definition Documentation

◆ CONFIG_GNRC_TCP_CONNECTION_TIMEOUT_DURATION_MS

#define CONFIG_GNRC_TCP_CONNECTION_TIMEOUT_DURATION_MS   (120U * MS_PER_SEC)

Timeout duration in milliseconds for user calls.

Default is 2 minutes.

Definition at line 59 of file config.h.

◆ CONFIG_GNRC_TCP_EVENTLOOP_MSG_QUEUE_SIZE_EXP

#define CONFIG_GNRC_TCP_EVENTLOOP_MSG_QUEUE_SIZE_EXP   (3U)

Message queue size for the TCP eventloop.

Note
The number of elements in a message queue must be a power of two. This value defines the exponent of 2^n.

Definition at line 186 of file config.h.

◆ CONFIG_GNRC_TCP_MSG_QUEUE_SIZE_EXP

#define CONFIG_GNRC_TCP_MSG_QUEUE_SIZE_EXP   (2U)

Message queue size for TCP API internal messaging.

Note
The number of elements in a message queue must be a power of two. This value defines the exponent of 2^n.

Definition at line 177 of file config.h.

◆ CONFIG_GNRC_TCP_MSL_MS

#define CONFIG_GNRC_TCP_MSL_MS   (30U * MS_PER_SEC)

Maximum segment lifetime (MSL) in milliseconds.

Default is 30 seconds.

Definition at line 66 of file config.h.

◆ CONFIG_GNRC_TCP_MSS

#define CONFIG_GNRC_TCP_MSS   (1220U)

Maximum Segment Size (MSS).

If IPv6 is used. Get MSS = 1280 - IPv6 Hdr - TCP Hdr = 1220

Definition at line 74 of file config.h.

◆ CONFIG_GNRC_TCP_PROBE_LOWER_BOUND_MS

#define CONFIG_GNRC_TCP_PROBE_LOWER_BOUND_MS   (1U * MS_PER_SEC)

Lower bound for the duration between probes in milliseconds.

Default is 1 seconds

Definition at line 161 of file config.h.

◆ CONFIG_GNRC_TCP_PROBE_UPPER_BOUND_MS

#define CONFIG_GNRC_TCP_PROBE_UPPER_BOUND_MS   (60U * MS_PER_SEC)

Upper bound for the duration between probes in milliseconds.

Default is 60 seconds

Definition at line 168 of file config.h.

◆ CONFIG_GNRC_TCP_RCV_BUFFERS

#define CONFIG_GNRC_TCP_RCV_BUFFERS   (1U)

Number of preallocated receive buffers.

This value determines how many parallel TCP connections can be active at the same time.

Definition at line 101 of file config.h.

◆ CONFIG_GNRC_TCP_RTO_GRANULARITY_MS

#define CONFIG_GNRC_TCP_RTO_GRANULARITY_MS   (10U)

Clock granularity for TCP in milliseconds.

Default is 10 milliseconds (see RFC 6298)

Definition at line 133 of file config.h.

◆ CONFIG_GNRC_TCP_RTO_LOWER_BOUND_MS

#define CONFIG_GNRC_TCP_RTO_LOWER_BOUND_MS   (1U * MS_PER_SEC)

Lower bound for RTO in milliseconds.

Default is 1 sec (see RFC 6298)

Note
Retransmission Timeout (RTO) determines how long TCP waits for acknowledgment (ACK) of transmitted segment. If the acknowledgment isn't received within this time it is considered lost.

Definition at line 119 of file config.h.

◆ CONFIG_GNRC_TCP_RTO_UPPER_BOUND_MS

#define CONFIG_GNRC_TCP_RTO_UPPER_BOUND_MS   (60U * MS_PER_SEC)

Upper bound for RTO in milliseconds.

Default is 60 sec (see RFC 6298)

Definition at line 126 of file config.h.