login
Header Space

 
 

In what situations does Linux kernel send RST/ACK as respond to SYN ?

April 20, 2008 - 9:17am
Submitted by xsanch on April 20, 2008 - 9:17am.
Linux

Hi,

I have a problem with one application (Tomcat) which does not accept some new connections. From tcpdump i can see that linux box responds with RST/ACK to the SYN request.

I don't know whether this is a good place to ask but I would like to know in what situations does Linux kernel send the RST/ACK.

I have taken a look into tcp_ipv4.c namely tcp_v4_send_reset and tcp_v4_do_rcv where the tcp_v4_send_reset is called but I am not a linux kernel hacker so please give me some ideas how this is done..

Many thanks,

Jorge Sanchez

..

April 21, 2008 - 6:06am
gat3way (not verified)

this could happen if:

1) the number of incoming, not accepted conections reaches the backlog limit provided to listen()
2) some firewall in between is rejecting the connections (e.g pix)
3) the linux box has an iptables REJECT rule with tcp-reset option and your connection attempt matches the rule.

Basically (according to the TCP/IP specs), when a SYN packet is sent to a port with no listening socket, the linux kernel sends RST+ACK. Cisco devices usually reject TCP connections with RST tcp packets, not ICMP errors when the appropriate acl rules are set.

Did you run tcpdump on the linux box with tomcat? Are there any SYN packets sent from your client?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
speck-geostationary