-
CONFIG_NET_TCP_TIME_WAIT_DELAY
¶
How long to wait in TIME_WAIT state (in milliseconds)
Type: int
Help¶
To avoid a (low-probability) issue when delayed packets from previous connection get delivered to next connection reusing the same local/remote ports, RFC 793 (TCP) suggests to keep an old, closed connection in a special “TIME_WAIT” state for the duration of 2*MSL (Maximum Segment Lifetime). The RFC suggests to use MSL of 2 minutes, but notes “This is an engineering choice, and may be changed if experience indicates it is desirable to do so.” For low-resource systems, having large MSL may lead to quick resource exhaustion (and related DoS attacks). At the same time, the issue of packet misdelivery is largely alleviated in the modern TCP stacks by using random, non-repeating port numbers and initial sequence numbers. Due to this, Zephyr uses much lower value of 250ms by default. Value of 0 disables TIME_WAIT state completely.
Direct dependencies¶
NET_TCP
&& !NET_RAW_MODE
&& NETWORKING
(Includes any dependencies from if’s and menus.)
Defaults¶
- 250 if
NET_TCP
&& !NET_RAW_MODE
&&NETWORKING
Kconfig definition¶
At subsys/net/ip/Kconfig:235
Included via Kconfig:10
→ Kconfig.zephyr:39
→ subsys/Kconfig:24
→ subsys/net/Kconfig:82
Menu path: (top menu) → Networking → IP stack
config NET_TCP_TIME_WAIT_DELAY int prompt "How long to wait in TIME_WAIT state (in milliseconds)" ifNET_TCP
&& !NET_RAW_MODE
&&NETWORKING
default 250 ifNET_TCP
&& !NET_RAW_MODE
&&NETWORKING
depends onNET_TCP
&& !NET_RAW_MODE
&&NETWORKING
help To avoid a (low-probability) issue when delayed packets from previous connection get delivered to next connection reusing the same local/remote ports, RFC 793 (TCP) suggests to keep an old, closed connection in a special "TIME_WAIT" state for the duration of 2*MSL (Maximum Segment Lifetime). The RFC suggests to use MSL of 2 minutes, but notes "This is an engineering choice, and may be changed if experience indicates it is desirable to do so." For low-resource systems, having large MSL may lead to quick resource exhaustion (and related DoS attacks). At the same time, the issue of packet misdelivery is largely alleviated in the modern TCP stacks by using random, non-repeating port numbers and initial sequence numbers. Due to this, Zephyr uses much lower value of 250ms by default. Value of 0 disables TIME_WAIT state completely.
(Definitions include propagated dependencies, including from if’s and menus.)