* Optimizing tc filters
@ 2011-12-10 18:16 John A. Sullivan III
2011-12-10 19:41 ` Eric Dumazet
0 siblings, 1 reply; 5+ messages in thread
From: John A. Sullivan III @ 2011-12-10 18:16 UTC (permalink / raw)
To: netdev
Hello, all. Given that there are several ways to direct packets into
the appropriate queue, I was wondering which ways are generally more
efficient. There seem to be a number of email discussions but nothing
authoritative. From those discussions, it would seem that for most
corporate usage (as in more traffic than a home user) we would have from
most efficient to least efficient:
1) Mark the connection with CONNMARK and us --restore-mark to mark all
packets in the connection for classification via an fw filter
2) Use the iptables CLASSIFY target
3) u32 filter
4) Mark individual packets and use an fw filter - one email thread says
this is more efficient than #3
Is this correct?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Optimizing tc filters
2011-12-10 18:16 Optimizing tc filters John A. Sullivan III
@ 2011-12-10 19:41 ` Eric Dumazet
2011-12-10 19:58 ` John A. Sullivan III
0 siblings, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2011-12-10 19:41 UTC (permalink / raw)
To: John A. Sullivan III; +Cc: netdev
Le samedi 10 décembre 2011 à 13:16 -0500, John A. Sullivan III a écrit :
> Hello, all. Given that there are several ways to direct packets into
> the appropriate queue, I was wondering which ways are generally more
> efficient. There seem to be a number of email discussions but nothing
> authoritative. From those discussions, it would seem that for most
> corporate usage (as in more traffic than a home user) we would have from
> most efficient to least efficient:
>
> 1) Mark the connection with CONNMARK and us --restore-mark to mark all
> packets in the connection for classification via an fw filter
>
> 2) Use the iptables CLASSIFY target
>
> 3) u32 filter
>
> 4) Mark individual packets and use an fw filter - one email thread says
> this is more efficient than #3
>
> Is this correct?
Unfortunately CONNTRACK is a bit expensive...
If you control applications, you also can use SO_MARK from them.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Optimizing tc filters
2011-12-10 19:41 ` Eric Dumazet
@ 2011-12-10 19:58 ` John A. Sullivan III
2011-12-10 20:10 ` Eric Dumazet
0 siblings, 1 reply; 5+ messages in thread
From: John A. Sullivan III @ 2011-12-10 19:58 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
On Sat, 2011-12-10 at 20:41 +0100, Eric Dumazet wrote:
> Le samedi 10 décembre 2011 à 13:16 -0500, John A. Sullivan III a écrit :
> > Hello, all. Given that there are several ways to direct packets into
> > the appropriate queue, I was wondering which ways are generally more
> > efficient. There seem to be a number of email discussions but nothing
> > authoritative. From those discussions, it would seem that for most
> > corporate usage (as in more traffic than a home user) we would have from
> > most efficient to least efficient:
> >
> > 1) Mark the connection with CONNMARK and us --restore-mark to mark all
> > packets in the connection for classification via an fw filter
> >
> > 2) Use the iptables CLASSIFY target
> >
> > 3) u32 filter
> >
> > 4) Mark individual packets and use an fw filter - one email thread says
> > this is more efficient than #3
> >
> > Is this correct?
>
> Unfortunately CONNTRACK is a bit expensive...
>
> If you control applications, you also can use SO_MARK from them.
>
>
>
OK. Does that mean that #1 is actually #4?
If we are using connection tracking in general to produce a "stateful"
firewall (let's just say we are - I certainly don't want to set off a
debate :) ), does that put #1 back on top as the most efficient since we
are incurring the conntrack overhead anyway or does the CONNMARK target
itself add considerable overhead? Thanks - John
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Optimizing tc filters
2011-12-10 19:58 ` John A. Sullivan III
@ 2011-12-10 20:10 ` Eric Dumazet
2011-12-10 21:01 ` John A. Sullivan III
0 siblings, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2011-12-10 20:10 UTC (permalink / raw)
To: John A. Sullivan III; +Cc: netdev
Le samedi 10 décembre 2011 à 14:58 -0500, John A. Sullivan III a écrit :
> If we are using connection tracking in general to produce a "stateful"
> firewall (let's just say we are - I certainly don't want to set off a
> debate :) ), does that put #1 back on top as the most efficient since we
> are incurring the conntrack overhead anyway or does the CONNMARK target
> itself add considerable overhead? Thanks - John
>
CONNMARK is very cheap, no extra overhead.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Optimizing tc filters
2011-12-10 20:10 ` Eric Dumazet
@ 2011-12-10 21:01 ` John A. Sullivan III
0 siblings, 0 replies; 5+ messages in thread
From: John A. Sullivan III @ 2011-12-10 21:01 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
On Sat, 2011-12-10 at 21:10 +0100, Eric Dumazet wrote:
> Le samedi 10 décembre 2011 à 14:58 -0500, John A. Sullivan III a écrit :
>
> > If we are using connection tracking in general to produce a "stateful"
> > firewall (let's just say we are - I certainly don't want to set off a
> > debate :) ), does that put #1 back on top as the most efficient since we
> > are incurring the conntrack overhead anyway or does the CONNMARK target
> > itself add considerable overhead? Thanks - John
> >
>
> CONNMARK is very cheap, no extra overhead.
>
>
OK - so I'll assume that, if using conntrac anyway, the order of
efficiency is as I outlined and, if not, #1 sinks to the bottom. If
that's not accurate, please let me know. Thanks for your help - John
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-12-10 21:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-10 18:16 Optimizing tc filters John A. Sullivan III
2011-12-10 19:41 ` Eric Dumazet
2011-12-10 19:58 ` John A. Sullivan III
2011-12-10 20:10 ` Eric Dumazet
2011-12-10 21:01 ` John A. Sullivan III
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox