Skip to contentSkip to conversation

separation of sysctl and tcp-window-tracking patch?

DISCUSSION Brian J. Murrell 3 participants 4 messages Dec 12, 2002 – Dec 13, 2002 netfilter

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines · Jozsef Kadlecsik
Quoted 4 lines · James Ralston

(My specific need is related to DNS service: namely, in many cases, 30 seconds to establish a UDP session simply isn't enough time to permit a reply to an outstanding DNS query. I want to be able to up that timeout to something closer to 60 or 120 seconds.)

I had this problem with the Amanda protocol, but it was with the UDP streaming timeout. It was not long enough to allow an Amanda client to go do it's work and still respond to the server when it was done.

Fortunately (for this situation), the Amanda protocol requires a helper, so I just upped the timeout on the connection in the helper. But this led me to think about UDP timeouts in general.

You might want to refer to this message:

http://lists.netfilter.org/pipermail/netfilter-devel/2002-September/009259.html

Quoted 3 lines

Please note, that the timeout settings via /proc introduced in the tcp-window-tracking patch are global. You cannot raise the UDP timeout values just for DNS.

Indeed. I had thought about this when I was doing my Amanda modification for the UDP streaming timeout on it's connection. For UDP timeouts in general I had originally thought of doing this with load-time module parameters. Something along the lines of:

# insmod ip_conntrack.o udp_timeouts="53=60,123=10"

which would be added to a table already defined in ip_conntrack_proto_udp.c with a set of common defaults.

This could be done via proc too however. Maybe something like:

# cat /proc/sys/net/ipv4/netfilter/udp_timeout
default=30
53=60
123=10

to see the current timeout table and

# echo "default=45,520=30" > /proc/sys/net/ipv4/netfilter/udp_timeout

to set/modify entries in the table.

Of course we have two udp timeouts to deal with, initial UDP connection setup timeout and the UDP streaming timeout. Perhaps two different /proc nodes.

Quoted 3 lines

Also, we have to handle the backward compatibility issue of /proc/sys/net/ipv4/ip_conntrack_max, if the introduction of /proc/sys/net/ipv4/netfilter/ is accepted.

Right. But let's not let this be a lone issue holding-up on moving forward with general netfilter tunables via proc.

b.

Signature · 1 line
Brian J. Murrell <[email protected]>
#1 lore raw
Quoted 7 lines · Brian J. Murrell

I had this problem with the Amanda protocol, but it was with the UDP streaming timeout. It was not long enough to allow an Amanda client to go do it's work and still respond to the server when it was done.

Fortunately (for this situation), the Amanda protocol requires a helper, so I just upped the timeout on the connection in the helper. But this led me to think about UDP timeouts in general.

Well, the best way to solve this particular problem for DNS traffic would be to use a helper. Have the helper use a table to track the state of DNS queries and replies via the 16-bit identifiers. That way, a DNS response that took more than 30 seconds could still be permitted as RELATED traffic, by matching the ID of reply to the ID of the query.

Quoted 11 lines
# insmod ip_conntrack.o udp_timeouts="53=60,123=10"

[...]

This could be done via proc too however. Maybe something like:

# cat /proc/sys/net/ipv4/netfilter/udp_timeout
default=30
53=60
123=10
Quoted 5 lines

[...]

Of course we have two udp timeouts to deal with, initial UDP connection setup timeout and the UDP streaming timeout. Perhaps two different /proc nodes.

While this will work, I suspect that a fair number of protocols could be adequately supported by using helpers.

Failing a helper, I'm unable to come up with anything better than adjusting timeouts on a per-port basis...

Signature · 3 lines
James Ralston, Information Technology
Software Engineering Institute
Carnegie Mellon University, Pittsburgh, PA, USA
#2 lore raw
Quoted 2 lines

Failing a helper, I'm unable to come up with anything better than adjusting timeouts on a per-port basis...

What about a single new target, CTTIMEOUT or something, having a single parameter, a relative timeout in seconds. Whenever that target hits, and we have a connection hanging off our skb, the connection's timeout will be refreshed to now+the_given_timeout.

This could be equally used to lower TCP ESTABLISHED timeouts for certain uses, and for extending the UDP timeouts discussed here. You would use normal, arbitrary matches to select _which_ packets should receive the treatment.

I have not thought about the interplay with the current automatic timeout selection. Anybody?

best regards
Patrick

#3 lore raw
Quoted 7 lines · Patrick Schaaf
Quoted 2 lines

Failing a helper, I'm unable to come up with anything better than adjusting timeouts on a per-port basis...

What about a single new target, CTTIMEOUT or something, having a single parameter, a relative timeout in seconds. Whenever that target hits, and we have a connection hanging off our skb, the connection's timeout will be refreshed to now+the_given_timeout.

I guess because the idea of a parameter to set the timeout has been floated before (by me and by others before me) and turned down (by Rusty) in favour of a (tunable) table in the UDP conntracker. This would be to further autoconfiguration which Rusty is a great fan of.

Quoted 2 lines

I have not thought about the interplay with the current automatic timeout selection. Anybody?

Which is probably why doing it in the udp conntracker, in a tunable table is the current way of thinking. Should not be too difficult in fact. I would attempt it myself if I could get a decent stretch of hacking time.

b.

Signature · 1 line
Brian J. Murrell <[email protected]>