Search code examples
network-programmingtcptcpclienttcpserver

Will TCP Server retransmit SYN+ACK if Client is not reachable?


Assume the scenario that TCP client(A) sent SYN to the TCP Sever(B) and then TCP Client disconnected from the network, here TCP Server will be in the state SYN-RCVD how that TCP Server will know that Client is not reachable??

will TCP Server retransmit SYN+ACK ??

(Aif yes, How many times Server will retransmit SYN+ACK??

if no, How much time Server will remain in SYN-RCVD state?? enter image description here


Solution

  • will TCP Server retransmit SYN+ACK ??

    Yes

    How many times Server will retransmit SYN+ACK??

    Depends on OS configuration.

    In Linux:
    /proc/sys/net/ipv4/tcp_synack_retries

    In windows: HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\TcpMaxConnectResponseRetransmissions

    How much time Server will remain in SYN-RCVD state??

    Until the last retransmit of SYN-ACK timeouts. Usually over 3 minutes.