Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Question about keep state and TCP state table timing
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kevin Hoffman  
View profile  
 More options Mar 11 2012, 1:16 am
Newsgroups: mailing.unix.ipfilter
From: khoff...@efolder.net (Kevin Hoffman)
Date: Sun, 11 Mar 2012 06:16:25 +0000
Local: Sun, Mar 11 2012 1:16 am
Subject: Question about keep state and TCP state table timing
Hello,

We're using IPfilter v4.1.9 on Solaris 10 amd64 (installed as part of the Solaris OS package for ipfilter). IPfilter has been working really well for us, it's fast and easy to use!

We have a rule setup like:

pass in quick proto tcp from 172.25.0.0/16 to any port = 2049 keep state

TCP port 2049 is the NFSv4 port. Under normal circumstances, this passes traffic just fine. We have some Linux computers (3.2.x kernel) connecting to the Solaris box mounting some NFSv4 shares hosted on the Solaris box.

If the TCP connection between the Linux machine and the Solaris machine gets interrupted, the Linux machine will try to reconnect to the Solaris box by opening a new TCP connection with destination port 2049.

However, here's the interesting part: Linux will re-use the same TCP *source* port when trying to reconnect. So what we see is that the Solaris box running ipfilter will have the existing TCP connection timeout. The linux box will then attempt to re-connect. However, because Linux is re-using the same source port the entry in the TCP state table for the prior connection has not yet expired. ipfilter thus ignores the new SYN packet from the Linux machine, and the new TCP connection does not get re-established (we can see the TCP connection on linux in the "SYN_SENT" state, and no record of a new TCP connection on the Solaris box, yet establishing a new TCP connection with telnet to 2049 from Linux works just fine (because the source port is different).

From what we understand (we've read the man/howto), we could remove the "keep state" rule option and it would pass all traffic to port 2049 (including SYN packets sent from the same source port as a recently closed TCP connection)? (is this the case?) However, keep state does have some nice security properties to not allow meddling with established TCP connections in progress. Also it has been mentioned that performance can be better when you're keeping state because it avoids a check on the inbound/outbound rule table

Is there any way to adjust the timeouts of the TCP state table so that it forgets the previously established connection more quickly? Ideally we could adjust the timeout only for connections that match this rule (e.g., something like "keep state lifetime-timeout 60"). If not, unless we can tell Linux to always use a different source port for the TCP connection, we probably will just have to avoid using "keep state" for that rule?

Thanks,
Kevin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.