TCP-HandShake를 통해 연결이 되면 해당 세션은 연결이 유지되어집니다.
하지만, 일정 시간동안 Connection에 대해 실제 통신이 없는 경우 Session관리를 위해
특정 시간이 지나면 해당 Session을 OS에서 끊게 됩니다.
NT에서 해당 역활을 해주는 것은 KeepAliveInterval에 설정되어진 값에 의해 결정되게 됩니다.
KeepAliveTime을 통해 해당 시간만큼 ACK(응답)이 없는 경우 Session이 종료되어집니다.
Windows 2000의 경우 해당 시간은 2시간입니다.
설정값은 아래 값을 참고 바랍니다.
a) KeepAliveInterval
Key: Tcpip\Parameters
Value Type: REG_DWORD-time in milliseconds
Valid Range: 1-0xFFFFFFFF
Default: 1000 (one second)
Description: This parameter determines the interval between TCP keep-alive
retransmissions until a response is received. Once a response is received, the
delay until the next keep-alive transmission is again controlled by the value of
KeepAliveTime. The connection is aborted after the number of retransmissions
specified by TcpMaxDataRetransmissions have gone unanswered.
Notes:
TCPIP driver waits for a TCP Keepalive ACK for the duration of time specified in this registry entry.
b) KeepAliveTime
Key: Tcpip\Parameters
Value Type: REG_DWORD-time in milliseconds
Valid Range: 1-0xFFFFFFFF
Default: 7,200,000 (two hours)
Description: The parameter controls how often TCP attempts to verify that an idle
connection is still intact by sending a keep-alive packet. If the remote system is
still reachable and functioning, it acknowledges the keep-alive transmission.
Keep-alive packets are not sent by default. This feature may be enabled on a
connection by an application
Notes:
In order for a TCP session to stay idle, there should be no data sent or received.
만일, OS가 Windows XP/2003 이라면 아래 키에 적용됩니다:
TcpMaxDataRetransmissions
Key: Tcpip\Parameters
Value Type: REG_DWORD-number
Valid Range: 0-0xFFFFFFFF
Default: 5
Description: This parameter controls the number of times that TCP retransmits an
individual data segment (not connection request segments) before aborting the
connection. The retransmission time-out is doubled with each successive
retransmission on a connection. It is reset when responses resume. The
Retransmission Timeout (RTO) value is dynamically adjusted, using the historical
measured round-trip time (Smoothed Round Trip Time) on each connection. The
starting RTO on a new connection is controlled by the TcpInitialRtt registry
value.
Notes:
This registry entry determines the number of TCP retransmissions for an individual
TCP segment. There's no special registry entry to determine the retransmission
behavior of TCP Keepalives and this registry entry is also used for the TCP
keepalive scenario.
만일 OS가 Windows Vista/2008 이라면 TCP keepalive 시도에 대한 횟수는 hardcoded되어 10 회이며 이는 조정할 수 없습니다.