Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Nikolay S." <nowhere@hakkenden.ath.cx>
To: Erik Schweigert <ejschweigert@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: Netfilter TCP Established Timeout
Date: Thu, 20 Oct 2011 07:36:51 +0400	[thread overview]
Message-ID: <1319081811.26694.2.camel@hakkenden.homenet> (raw)
In-Reply-To: <CADVVA4-XORAyHOLxx-x9RGxEDWmpP=5hxqwxqCaHXv-13WXqaw@mail.gmail.com>

В Срд, 19/10/2011 в 12:03 -0700, Erik Schweigert пишет:
> Hi all,
> 
> I have noticed an oddity in the timeout values of a TCP Established
> connection.  I currently have the
> "nf_conntrack_tcp_timeout_established = 1800".
> 
> # cat /proc/net/nf_conntrack  | grep EST
> ipv4     2 tcp      6 1385 ESTABLISHED src=192.168.10.25
> dst=192.168.10.134 sport=2513 dport=1217 packets=71 bytes=10154
> src=192.168.10.134 dst=192.168.10.25 sport=1217 dport=2513 pac1
> ----> ipv4     2 tcp      6 1799 ESTABLISHED src=192.168.10.25
> dst=192.168.10.134 sport=2550 dport=1217 packets=1142 bytes=121874
> src=192.168.10.134 dst=192.168.10.25 sport=1217 dport=2550 1
> ipv4     2 tcp      6 1413 ESTABLISHED src=192.168.10.25
> dst=192.168.10.134 sport=2515 dport=1217 packets=824 bytes=101370
> src=192.168.10.134 dst=192.168.10.25 sport=1217 dport=2515 p1
> ipv4     2 tcp      6 263 ESTABLISHED src=192.168.10.25
> dst=192.168.10.134 sport=2440 dport=1101 packets=41 bytes=6458
> src=192.168.10.134 dst=192.168.10.25 sport=1101 dport=2440 packe1
> ipv4     2 tcp      6 1221 ESTABLISHED src=192.168.10.25
> dst=192.168.10.134 sport=2512 dport=1101 packets=79 bytes=13578
> src=192.168.10.134 dst=192.168.10.25 sport=1101 dport=2512 pac1
> # cat /proc/net/nf_conntrack  | grep EST
> ipv4     2 tcp      6 1369 ESTABLISHED src=192.168.10.25
> dst=192.168.10.134 sport=2513 dport=1217 packets=71 bytes=10154
> src=192.168.10.134 dst=192.168.10.25 sport=1217 dport=2513 pac1
> ----> ipv4     2 tcp      6 296 ESTABLISHED src=192.168.10.25
> dst=192.168.10.134 sport=2550 dport=1217 packets=1166 bytes=124610
> src=192.168.10.134 dst=192.168.10.25 sport=1217 dport=2550 p1
> ipv4     2 tcp      6 1396 ESTABLISHED src=192.168.10.25
> dst=192.168.10.134 sport=2515 dport=1217 packets=824 bytes=101370
> src=192.168.10.134 dst=192.168.10.25 sport=1217 dport=2515 p1
> ipv4     2 tcp      6 247 ESTABLISHED src=192.168.10.25
> dst=192.168.10.134 sport=2440 dport=1101 packets=41 bytes=6458
> src=192.168.10.134 dst=192.168.10.25 sport=1101 dport=2440 packe1
> ipv4     2 tcp      6 1205 ESTABLISHED src=192.168.10.25
> dst=192.168.10.134 sport=2512 dport=1101 packets=79 bytes=13578
> src=192.168.10.134 dst=192.168.10.25 sport=1101 dport=2512 pac1
> 
> You will notice in the two iterations I have marked above, the timeout
> values goes from 1799 to 296 within a 16 second span.  Is this a bug
> or something inherent to the connection tracking system that I unaware
> of.

TCP conntrack allows 5 minutes (300 seconds) for hosts to send the
acknowledge. Once connection has no unacknowledged segments, timeout
will revert to 1800 seconds.

> 
> I am running kernel 2.6.26.5. My current settings of the tunable
> conntrack features are:
> 
> nf_conntrack_tcp_be_liberal = 0
> nf_conntrack_tcp_loose = 1
> nf_conntrack_tcp_max_retrans = 3
> nf_conntrack_tcp_timeout_close = 10
> nf_conntrack_tcp_timeout_close_wait  = 60
> nf_conntrack_tcp_timeout_established = 1800
> nf_conntrack_tcp_timeout_fin_wait = 120
> nf_conntrack_tcp_timeout_last_ack = 30
> nf_conntrack_tcp_timeout_max_retrans = 300
> nf_conntrack_tcp_timeout_syn_recv = 60
> nf_conntrack_tcp_timeout_syn_sent = 120
> nf_conntrack_tcp_timeout_time_wait = 120
> 
> Any help or suggestions is appreciated,
> Erik
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



  reply	other threads:[~2011-10-20  3:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-19 19:03 Netfilter TCP Established Timeout Erik Schweigert
2011-10-20  3:36 ` Nikolay S. [this message]
2011-10-20 19:10   ` Erik Schweigert
2011-10-23 19:22     ` Nikolay S.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1319081811.26694.2.camel@hakkenden.homenet \
    --to=nowhere@hakkenden.ath.cx \
    --cc=ejschweigert@gmail.com \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox