1

I am using a linux machine.
I want to set the number of TCP retransmits to zero. I am using below command to modify:

sudo sysctl -w net.ipv4.tcp_syn_retries=0

The above command dont work and gives me below error:

error: "Invalid argument" setting key "net.ipv4.tcp_syn_retries"

However, this command works -> sudo sysctl -w net.ipv4.tcp_syn_retries=1
According to the documentation -> man tcp :

tcp_syn_retries (integer; default: 5; since Linux 2.2) The maximum number of times initial SYNs for an active TCP connection attempt will be retransmitted. This value should not be higher than 255. The default value is 5, which corresponds to approximately 180 seconds.

Does setting sudo sysctl -w net.ipv4.tcp_syn_retries=0 means disabling syn or syn retries. I am unclear after reading the documentation.

ojas
  • 2,150
  • 5
  • 22
  • 37
  • 'I want to set the number of TCP retransmits to zero'. No you don't. Everything will break. Off topic. – user207421 May 02 '18 at 04:29
  • 1
    tcp_syn_retries only change retries for initial SYN (i.e. SYN sent but not receiving SYN/ACK). You may simply assume that retransmission happens when a TCP packet was sent but no corresponding ACK received, which I wonder there's really a TCP stack allows you to stop the retransmission. For a full picture you need to study the TCP protocol state diagram. – Ken Cheung May 02 '18 at 04:36

0 Answers0