From: zrm <zrm@trustiosity.com>
To: "André Paulsberg-Csibi (IBM Consultant)"
<Andre.Paulsberg-Csibi@evry.com>,
"netfilter@vger.kernel.org" <netfilter@vger.kernel.org>
Subject: Re: nf_conntrack_max
Date: Mon, 5 Sep 2016 12:21:56 -0400 [thread overview]
Message-ID: <8510b15b-c4db-e9a5-eebb-90c9fff6e59f@trustiosity.com> (raw)
In-Reply-To: <818666f75b724e62b6427878c4ba59c5@CCDEX021.corp.corpcommon.com>
The default conntrack timeout for UDP streams is 180 seconds, which is
within that range. The protocols that need that are streams rather than
transactional protocols like DNS. (Although the other suggestion to
remove DNS immediately on reply would even cause trouble for DNS,
because some clients send multiple DNS queries at the same time using
the same ports, e.g. IPv6 (AAAA) and IPv4 (A) queries, and immediate
removal would cause the other replies to be lost. One second timeouts
could do the same.)
The main problem with very short global UDP stream timeouts is for IPsec
tunnel mode, OpenVPN, or anything else that encapsulates traffic in UDP
or otherwise needs the UDP entry to continue to exist indefinitely. If
the app's keepalive interval is shorter than the timeout then packets
that arrive between the timeout and the keepalive packet go to the bit
bucket.
Some applications will try to detect that and then shorten the keepalive
interval (but not all, and generally only after several packets are lost
with user-visible consequences). And even then the result is more
deadweight keepalive packets consuming network resources and requiring
power-expensive radio wakeups on battery-powered user devices.
On 09/05/2016 04:40 AM, André Paulsberg-Csibi (IBM Consultant) wrote:
> I have yet to see any implementation of any FW in 2014 - 2016 that has UDP timeouts in the 2-5 minutes range , as described in RFC 4787 .
>
> IF I remember UDP implementations from a lot of todays firewalls is typically set default timeout to about 30-40 seconds ,
> and despite RFC4787 I would rather recommend having lower timeouts for UDP and higher ones for just those
> protocols that require this than to have 2-5 minutes for UDP which in most cases never last more then 2-4 seconds .
>
> That seems like an unreasonable reverse logic and use of resources , looking at today vs 10-20 years ago's most common UDP traffic patterns .
>
> But yes , I agree on increasing connection table in either case as this was clearly low for such current level of sessions
> and find the root cause for the high amounts of sessions and fix that if possible ...
>
>
>
> Best regards
> André Paulsberg-Csibi
> Senior Network Engineer
> Fault Handling
> IBM Services AS
> andre.paulsberg-csibi@evry.com
> M +47 9070 5988
>
>
>
>
> -----Original Message-----
> From: netfilter-owner@vger.kernel.org [mailto:netfilter-owner@vger.kernel.org] On Behalf Of zrm
> Sent: 2. september 2016 16:48
> To: André Paulsberg-Csibi (IBM Consultant) <Andre.Paulsberg-Csibi@evry.com>; John Ratliff <jratliff@bluemarble.net>; netfilter@vger.kernel.org
> Subject: Re: nf_conntrack_max
>
>
>
> On 09/02/2016 02:27 AM, André Paulsberg-Csibi (IBM Consultant) wrote:
>
>> In the meantime there is no real issues increasing you the connection table while you figure that out ,
>> and you can also GLOBALY fix the UDP timeouts if you so desire as most likely this can be lowered significantly from
>> the defaults , here you can see one example from a smaller FW then yours ( but still applicable ) :
>>
>> zotac:~ # grep netfilter /etc/sysctl.conf
>> net.netfilter.nf_conntrack_max = 10000
>> net.netfilter.nf_conntrack_tcp_timeout_established = 3600
>> net.netfilter.nf_conntrack_tcp_timeout_close_wait = 40
>> net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 40
>> net.netfilter.nf_conntrack_tcp_timeout_syn_recv = 40
>> net.netfilter.nf_conntrack_tcp_timeout_syn_sent = 40
>> net.netfilter.nf_conntrack_tcp_timeout_time_wait = 40
>> net.netfilter.nf_conntrack_udp_timeout_stream = 60
>> net.netfilter.nf_conntrack_udp_timeout = 10
>
> Global timeouts that short can cause other trouble though. See RFC4787
> Section 4.3 and RFC5382 Section 5. Outside of reducing the timeout only
> for DNS, the best choice is probably just increasing the maximum number
> of conntrack entries (and buying more memory if necessary).
> --
> 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
>
prev parent reply other threads:[~2016-09-05 16:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-31 22:15 nf_conntrack_max John Ratliff
2016-08-31 22:47 ` nf_conntrack_max /dev/rob0
2016-09-01 10:59 ` nf_conntrack_max Pablo Neira Ayuso
2016-09-01 15:18 ` nf_conntrack_max zrm
2016-09-01 17:05 ` nf_conntrack_max /dev/rob0
2016-09-02 15:05 ` nf_conntrack_max John Ratliff
2016-09-03 18:47 ` nf_conntrack_max John Ratliff
2016-09-05 9:33 ` nf_conntrack_max Pablo Neira Ayuso
2016-09-05 13:28 ` nf_conntrack_max /dev/rob0
2016-09-02 6:27 ` nf_conntrack_max André Paulsberg-Csibi (IBM Consultant)
2016-09-02 14:47 ` nf_conntrack_max zrm
2016-09-05 8:40 ` nf_conntrack_max André Paulsberg-Csibi (IBM Consultant)
2016-09-05 16:21 ` zrm [this message]
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=8510b15b-c4db-e9a5-eebb-90c9fff6e59f@trustiosity.com \
--to=zrm@trustiosity.com \
--cc=Andre.Paulsberg-Csibi@evry.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