Skip to contentSkip to conversation

netfilter performance question

DISCUSSION Marcin Szczepaniak 3 participants 3 messages Mar 22, 2005 – Apr 2, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

Hi !

I am working on ethernet bridge device based on embedded linux and ADM5120 chip. I want basic firewall funcionality in my kernel, but i dont need most of netfilter advanced features. Simply filtering based on source and dst ip address, source and dst port number and protocol type is everything what i need.

I've tested two configurations of kernel (i am using 2.6 kernel tree):
first - no netfilter enabled - my device was able to bridge 70 Mbit of traffic.
second - netfilter compiled in, but no rules applied - traffic is only 20 Mbit :( Adding some test rules has minor affect to traffic. Simply existence of netfiler makes maximal possible traffic to be equal one third of that when only routing exists in kernel.

Then I found ebtables. As much simplier than netfilter it should be also much faster. But there is no way to use only ebtables. Netfilter must be enabled in .config if you want use ebtables.

So i have two questions:

1. Is it possible to simplify netfilter somehow ? I need only very basic filtering (no statefull inspection, only IP header based packet filtering) ? I need it to be much faster and much simplier than it is now. Maybe there is any 'light' version of netfiler ?

2. Is it possible to use only ebtables, without netfilter ?

#1 lore raw
Quoted 6 lines · Marcin Szczepaniak

I've tested two configurations of kernel (i am using 2.6 kernel tree):
first - no netfilter enabled - my device was able to bridge 70 Mbit of traffic. second - netfilter compiled in, but no rules applied - traffic is only 20 Mbit :( Adding some test rules has minor affect to traffic. Simply existence of netfiler makes maximal possible traffic to be equal one third of that when only routing exists in kernel.

what are you referring to as 'existance of netfilter'. netfilter is
something different than iptables.

If you want to nail this down, please check

1) performance with CONFIG_NETFILER == n
2) performance with CONFIG_NETFILTER == y but CONFIG_IP_NF_IPTABLES == n
3) performance with an empty module attached to the netfilter hook, i.e. something that registers to all five hooks and returns NF_ACCEPT
4) performanec with CONFIG_NETFILTER == y, CONFIG_IP_NF_IPTABLES == y and CONFIG_IP_NF_FILTER ==y, but no rules loaded.

Please send the numbers to netfilter-devel and Cc me personally.

Quoted 1 line

2. Is it possible to use only ebtables, without netfilter ?

ebtables is based on netfilter, but not on iptables.

Signature · 5 lines
- Harald Welte <[email protected]>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie
#2 lore raw
In reply to Marcin Szczepaniak

Op di, 22-03-2005 te 12:42 +0000, schreef Marcin Szczepaniak:

Quoted 7 lines

I've tested two configurations of kernel (i am using 2.6 kernel tree):
first - no netfilter enabled - my device was able to bridge 70 Mbit of traffic.
second - netfilter compiled in, but no rules applied - traffic is only 20 Mbit :( Adding some test rules has minor affect to traffic. Simply existence of netfiler makes maximal possible traffic to be equal one third of that when only routing exists in kernel.

Are you using connection tracking? Then try to minimize the overload of it, see
http://ebtables.sourceforge.net/brnf-faq.html#quiz1

Quoted 3 lines

Then I found ebtables. As much simplier than netfilter it should be also much faster. But there is no way to use only ebtables. Netfilter must be enabled in .config if you want use ebtables.

Ebtables with simple rules won't be faster than iptables with simple rules and connection tracking disabled.

cheers,
Bart