net: tcp: Increase default NET_TCP_TIME_WAIT_DELAY value

The current default of 250ms appears to be too low in case connection
teardown takes place in lossy networks - in case of FIN packet
retransmission, the connection on the Zephyr side could have already
been dismissed due to low TIME_WAIT state delay, resulting in ICMP
Destination Unreachable replies.

Increase the default value to 1500ms - this is still pretty low, but at
least gives the peer some time to retransmit the FIN packet.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2022-06-09 15:45:23 +02:00 committed by Carles Cufí
parent 2bd00e65ba
commit 5a05ac8fc9

View file

@ -357,7 +357,7 @@ endif # NET_TCP
config NET_TCP_TIME_WAIT_DELAY
int "How long to wait in TIME_WAIT state (in milliseconds)"
depends on NET_TCP
default 250
default 1500
help
To avoid a (low-probability) issue when delayed packets from
previous connection get delivered to next connection reusing
@ -371,7 +371,7 @@ config NET_TCP_TIME_WAIT_DELAY
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.
to this, Zephyr uses much lower value of 1500ms by default.
Value of 0 disables TIME_WAIT state completely.
config NET_TCP_ACK_TIMEOUT