netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bad nat connection tracking performance with ip_gre
@ 2009-08-18 10:14 Timo Teräs
  2009-08-18 10:38 ` Patrick McHardy
  0 siblings, 1 reply; 9+ messages in thread
From: Timo Teräs @ 2009-08-18 10:14 UTC (permalink / raw)
  To: netfilter-devel; +Cc: netdev

Hi,

I noticed (in relation to my nbma gre multicast testing) that
the nat connection tracking code does not cache flows for
locally originating traffic that is routed to gre tunnel
(forwarded traffic is ok).

I basically have a router box with nbma gre tunnel. It gets
10/8 traffic. And is routed to internet interface. An ipsec
xfrm is applied.

Now, if the router box is forwarding traffic from some
physical interface, everything works as expected.

However, if a local process on the router box is sending
packets that go to gre tunnel, each packet causes a new
lookup on nat table OUTPUT chain. This is easily verified
by doing flood ping on router box on private IP and the
counters on nat table OUTPUT chain default policy start
to get incremented wildly.

I tried to oprofile this and it says most of the time is
spent in ipt_do_table(). I would suppose that the place
where netfilter hook is called is
ip_gre.c:ipgre_tunnel_xmit() when it invokes macro
IPTUNNEL_XMIT() calling ip_local_out().

Monitoring the connection tracking stats, it looks like
all packets are reusing the proper connection tracking
cache entry. But somehow the nat target still gets
called for the locally originating packets to gre.

Any ideas how to fix this?

Thanks,
 Timo

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

end of thread, other threads:[~2009-08-19  8:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-18 10:14 bad nat connection tracking performance with ip_gre Timo Teräs
2009-08-18 10:38 ` Patrick McHardy
2009-08-18 12:45   ` Timo Teräs
2009-08-18 13:01     ` Patrick McHardy
2009-08-18 13:53       ` Timo Teräs
2009-08-18 14:58         ` Patrick McHardy
2009-08-18 17:39           ` Timo Teräs
2009-08-18 19:36             ` Timo Teräs
2009-08-19  8:40               ` Timo Teräs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).