Skip to content

Commit ab275ee

Browse files
htiboschHein TiboschAniruddhaKanhere
authored
IPv4/single: TCP minimum time for retransmissions (#387)
* IPv4/multi: TCP minimum time for retransmissions * Corrected typo in a comment Co-authored-by: Hein Tibosch <[email protected]> Co-authored-by: Aniruddha Kanhere <[email protected]>
1 parent 918e9bb commit ab275ee

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

FreeRTOS_TCP_WIN.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@
5050
#if ( ipconfigUSE_TCP == 1 )
5151

5252
/* Constants used for Smoothed Round Trip Time (SRTT). */
53-
#define winSRTT_INCREMENT_NEW 2 /**< New increment for the smoothed RTT. */
54-
#define winSRTT_INCREMENT_CURRENT 6 /**< Current increment for the smoothed RTT. */
55-
#define winSRTT_DECREMENT_NEW 1 /**< New decrement for the smoothed RTT. */
56-
#define winSRTT_DECREMENT_CURRENT 7 /**< Current decrement for the smoothed RTT. */
57-
#define winSRTT_CAP_mS 50 /**< Cap in milliseconds. */
53+
#define winSRTT_INCREMENT_NEW 2 /**< New increment for the smoothed RTT. */
54+
#define winSRTT_INCREMENT_CURRENT 6 /**< Current increment for the smoothed RTT. */
55+
#define winSRTT_DECREMENT_NEW 1 /**< New decrement for the smoothed RTT. */
56+
#define winSRTT_DECREMENT_CURRENT 7 /**< Current decrement for the smoothed RTT. */
57+
#define winSRTT_CAP_mS ( ipconfigTCP_SRTT_MINIMUM_VALUE_MS ) /**< Cap in milliseconds. */
58+
5859

5960
/**
6061
* @brief Utility function to cast pointer of a type to pointer of type TCPSegment_t.

include/FreeRTOSIPConfigDefaults.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,16 @@
373373
#define ipconfigICMP_TIME_TO_LIVE 64
374374
#endif
375375

376+
#ifndef ipconfigTCP_SRTT_MINIMUM_VALUE_MS
377+
378+
/* TCP only: when measuring the Smoothed Round Trip Time (SRTT),
379+
* the result will be rounded up to a minimum value.
380+
* The default has always been 50, but a value of 1000
381+
* is recommended (see RFC6298) because hosts often delay the
382+
* sending of ACK packets with 200 ms. */
383+
#define ipconfigTCP_SRTT_MINIMUM_VALUE_MS 50U
384+
#endif
385+
376386
#ifndef ipconfigUDP_MAX_RX_PACKETS
377387

378388
/* Make positive to define the maximum number of packets which will be buffered

0 commit comments

Comments
 (0)