1833553 Members
3280 Online
110061 Solutions
New Discussion

Re: netstat doubt

 
SOLVED
Go to solution
Marco Camacho_1
Frequent Advisor

netstat doubt

Hi folks.
the netstat -a command returns in the last field "fin_wait_2", whats the meanning of this?. how can i fix to convert to "established" . Thanks for your time and help.
Mark-ito
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor
Solution

Re: netstat doubt

Hi Marco:

The 'fin_wait_2' state is a normal, final state transition for a TCP connection before it is closed. The time for which a connection stays in this state is governed by 'tcp_keepalive_detached_interval' which has a default value of 120,000 milliseconds.

Have a look at Technical Knowledge Base document #KBRC00015727 for more information.

Regards!

...JRF...
Sameer_Nirmal
Honored Contributor

Re: netstat doubt

Hi,

The state FIN_WAIT_2 represents the wait for a final connection termination request from the remote TCP. If an application opened a socket, but never closed it properly, it can leave the socket in this state. FIN_WAIT_2 may also be caused by an abnormal termination of an application using sockets.

Before 11.00, the only way to get rid of this socket or the entry in the netstat -a output is to reboot the node. In 11.00( with a patch ) and in 11i ( in-built), a separate timer was introduced for it whose timer value is set using ndd "tcp_fin_wait_2_timeout" parameter.
The default for tcp_fin_wait_2_timeout is 0, which allows the connection to live forever, as long as the far side continues to answer keepalives. Thus the timeout value for such connection would be the tcp keepalive timeout as said above.

You need to know the application behaviour and need to monitor such connections. If they remain there inspite the application who opened them is exited and the keepalive value set as upper limit for their disconnection looks undesirable , then the
"tcp_fin_wait_2_timeout" value could be set to an appropriate value.

IMPORTANT :
****Extreme caution should be taken for changing its value from default 0 as it may cause loss of data******

Refer following docs for details

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000080078355

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000081572963

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000081572963

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063620093
Muthukumar_5
Honored Contributor

Re: netstat doubt

fin_wait_2 means,

after the client is closing with close() but not sending the acknowledgement to server and server is waiting for that ack signal.

Refer this for tuning:

http://docs.hp.com/en/B2355-90748/pr04.html
http://unix.derkeiler.com/Mailing-Lists/HP-UX-Admin/2003-07/0111.html

-Muthu
Easy to suggest when don't know about the problem!
Marco Camacho_1
Frequent Advisor

Re: netstat doubt

Thanks a lot for your help, i understand the topic now and i will review some programs. Regards!
Mark-ito