5

When I send a HTTPS request from Windows7/Vista to Linux Red Hat 4 the netstat -an <my_ip> command shows FIN_WAIT1 OR SYNC_RECV status.

Why do these statuses appear instead of ESTABLISHED?

Ruslan
  • 18,162
  • 8
  • 67
  • 136
Zeeshan
  • 1,173
  • 5
  • 19
  • 26

2 Answers2

5

The TCP connection is closing, see http://www.freesoft.org/CIE/Course/Section4/11.htm

wich
  • 16,709
  • 6
  • 47
  • 72
  • Thanks, actually The request comes with support for TLS which is not supported by our server. You post directs in right direction. – Zeeshan May 06 '11 at 16:13
0

What does FIN_WAIT1 mean?: The TCP connection is closing

I have a Python example to show the flow:

  1. I put my server to listen for connections:
>>> import sys, socket
>>> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> sock.bind(('172.31.35.6', 6677))
>>> sock.listen()
>>> conn, client_address = sock.accept()
  1. I connect the client to the server
>>> import sys, socket
>>> conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> conn.connect(('3.19.54.89', 6677))
  1. Connection is ESTABLISHED
root@ip-172-31-35-6:/home/ubuntu# netstat | grep 6677
tcp        0      0 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:54944 ESTABLISHED
  1. Log the netstat status while closing the connection:
root@ip-172-31-35-6:/home/ubuntu# while true; do netstat | grep 6677; done > ~/tmp
  1. Close the connection
>>> conn.close()
  1. Look at the netstat log created in step 4:
tcp        0      0 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 ESTABLISHED
tcp        0      0 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 ESTABLISHED
tcp        0      1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1  
tcp        0      1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1  
tcp        0      1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1  
tcp        0      1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1  
tcp        0      1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1  
tcp        0      1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1  
tcp        0      1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1  
tcp        0      1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1  
tcp        0      1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1  
tcp        0      1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1  
tcp        0      0 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT2 
Cesar Celis
  • 166
  • 1
  • 4
  • 8