# TCP options # Copyright (c) 2016 Intel Corporation. # Copyright (c) 2021 Nordic Semiconductor # Copyright (c) 2023 Arm Limited (or its affiliates). All rights reserved. # SPDX-License-Identifier: Apache-2.0 menuconfig NET_TCP bool "TCP" depends on NET_IP help The value depends on your network needs. if NET_TCP if NET_TCP module = NET_TCP module-dep = NET_LOG module-str = Log level for TCP module-help = Enables TCP handler output debug messages source "subsys/net/Kconfig.template.log_config.net" endif # NET_TCP config NET_TCP_WORKQ_STACK_SIZE int "TCP work queue thread stack size" default 1200 if X86 default 1024 depends on NET_TCP help Set the TCP work queue thread stack size in bytes. config NET_TCP_WORKER_PRIO int "Priority of the TCP work queue" default 2 depends on NET_TCP help Set the priority of the TCP worker queue, that handles all transmission and maintenance within the TCP stack. Value 0 = highest priortity. When CONFIG_NET_TC_THREAD_COOPERATIVE = y, lowest priority is CONFIG_NUM_COOP_PRIORITIES-1 else lowest priority is CONFIG_NUM_PREEMPT_PRIORITIES-1. Make sure the priority is lower than lower layer TX threads to avoid the TCP stack consume all net_bufs before transferring execution to the lower layer network stack, with a high risk of running out of net_bufs. config NET_TCP_TIME_WAIT_DELAY int "How long to wait in TIME_WAIT state (in milliseconds)" depends on NET_TCP default 1500 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 1500ms by default. Value of 0 disables TIME_WAIT state completely. config NET_TCP_ACK_TIMEOUT int "[DEPRECATED] How long to wait for ACK (in milliseconds)" depends on NET_TCP default 1000 range 1 $(INT32_MAX) help Deprecated. Use CONFIG_NET_TCP_INIT_RETRANSMISSION_TIMEOUT and CONFIG_NET_TCP_RETRY_COUNT to control the total timeout at the TCP level. config NET_TCP_INIT_RETRANSMISSION_TIMEOUT int "Initial value of Retransmission Timeout (RTO) (in milliseconds)" depends on NET_TCP default 200 range 100 60000 help This value affects the timeout between initial retransmission of TCP data packets. The value is in milliseconds. config NET_TCP_RANDOMIZED_RTO bool "Use a randomized retransmission time" default y depends on NET_TCP help It can happen that two similar stacks enter a retransmission cycle due to a packet collision. If the transmission timeout is the same both stacks will retry at the same moment resulting in another collision. By introducing a randomized retry timeout, the chance of a second collision is reduced and it reduces further the more retransmissions occur. config NET_TCP_RETRY_COUNT int "Maximum number of TCP segment retransmissions" depends on NET_TCP default 9 help The following formula can be used to determine the time (in ms) that a segment will be be buffered awaiting retransmission: n=NET_TCP_RETRY_COUNT Sum((1<