Linux Netfilter discussions
 help / color / mirror / Atom feed
* NAT performance + table processing
@ 2007-08-09 17:44 Július Bemš
  2007-08-09 18:26 ` Покотиленко Костик
  0 siblings, 1 reply; 2+ messages in thread
From: Július Bemš @ 2007-08-09 17:44 UTC (permalink / raw)
  To: netfilter

Hi,

I wrote some performance tests of NAT table. The main idea is, that I add
10000 random+senseless rules to the NAT table (snat, postrouting) and then I
add some rule to specific position which will stop traversing of NAT table.
I use UDP packets. 

When I insert my reasonable rule to position 2000 and  run my test, it shows
delay of packets cca 300ms. But when I run it more times, this delay is 2ms.
I don't understand why, because I use UDP(connectionless) - so I think, that
netfilter must process each packet and find appropriate rule. Is this true?
Or does netfilter do some optimalization? Because this behavior is expected
in TCP, but not UDP.

Thanks for replies



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: NAT performance + table processing
  2007-08-09 17:44 NAT performance + table processing Július Bemš
@ 2007-08-09 18:26 ` Покотиленко Костик
  0 siblings, 0 replies; 2+ messages in thread
From: Покотиленко Костик @ 2007-08-09 18:26 UTC (permalink / raw)
  To: Július Bemš; +Cc: netfilter

В Чтв, 09/08/2007 в 19:44 +0200, Július Bemš пишет:
> Hi,
> 
> I wrote some performance tests of NAT table. The main idea is, that I add
> 10000 random+senseless rules to the NAT table (snat, postrouting) and then I
> add some rule to specific position which will stop traversing of NAT table.
> I use UDP packets. 
> 
> When I insert my reasonable rule to position 2000 and  run my test, it shows
> delay of packets cca 300ms. But when I run it more times, this delay is 2ms.
> I don't understand why, because I use UDP(connectionless) - so I think, that
> netfilter must process each packet and find appropriate rule. Is this true?
> Or does netfilter do some optimalization? Because this behavior is expected
> in TCP, but not UDP.

UDP is connectionless, you are right. But conntrack thinks of it like of
connection-oriented. If several UDP packets have the same source IPs and
ports and same destination IPs and ports conntrack thinks those are
belonging to the same "connection".

-- 
Покотиленко Костик <casper@meteor.dp.ua>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-09 18:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-09 17:44 NAT performance + table processing Július Bemš
2007-08-09 18:26 ` Покотиленко Костик

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox