New Target: ipt_ACCOUNT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi there ...
we've developed a new target for iptables: ipt_ACCOUNT. This Target accounts Traffik on a packet-base on source and target ip using netfilter (similar to nacctd - but using iptables).
It's in use on our routers (app. 60MBit/s Bandwitdh) since three month (app.) without any trouble and was tested with some DDoS-Tools before use ;)
Now we release it under GPL for public use.
Regard's
Thomas Wieske Rolf Würdemann
Wieske's Crew KG Wieske's Crew KG
(Chairman) (Developer)
PS: We've developed it 'cause nacctd was
a) to much use of cpu
b) looses packets during kernel-problems with PF_PACKET
- --
Security is an illusion - Datasecurity twice
Rolf Wuerdemann - Privat: [email protected] - Office: [email protected] GnuPG-Key fingerprint: 7383 348F 67D1 CD27 C90F DDD0 86A3 31B6 67F0 D02F
RSA-Key fingerprint: CEBB 5086 9154 E8D8 7D0E CC4F 0F5E B9CC
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE9/g8WhqMxtmfw0C8RApfoAJ9TJuhjlEJE5uUc/GeRxDu2p/HXmwCglYzV MsetA5QQXj39KfcSFQnILAk=
=Ls7V
-----END PGP SIGNATURE-----
Quoted 1 line · Rolf Wuerdemann
Hi there ...
Hi, sorry for my late reply.
Quoted 7 lines
we've developed a new target for iptables:
ipt_ACCOUNT. This Target accounts Traffik on a packet-base on source and target ip using netfilter (similar to nacctd - but using iptables).It's in use on our routers (app. 60MBit/s Bandwitdh) since three month (app.) without any trouble and was tested with some DDoS-Tools before use ;)
great news. A couple of comments:
I think this is the wrong approach, there are way too much data
strucctures in non-swappable kernel momory allocated. And kernel-OOM is not something we should provoke. A better architecture from my point of view was: - use ULOG to copy the IP+TCP header of all packets to userspace [it is very efficient in doing so!!!] and then do all the accounting in userspace
Leaving this personal view aside, I still dislike a couple of issues with your patch
- It doesn't adhere to the kernel CodingStyle
- german variables
- C++ style comments
- more than 80chars per line
- the kernel/userspace interface using a socket option
So if you want to contribute it into patch-o-matic, you will have to at least conform to the coding style, sorry.
Quoted 3 lines
PS: We've developed it 'cause nacctd was
a) to much use of cpu
b) looses packets during kernel-problems withPF_PACKET
I am (as a long time nacctd user and hacker) aware of those issues. But this doesn't mean that moving everything into the kernel is the right thing..
Signature · 4 lines
- Harald Welte / [email protected] http://www.gnumonks.org/ ============================================================================ "If this were a dictatorship, it'd be a heck of a lot easier, just so long as I'm the dictator." -- George W. Bush Dec 18, 2000
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am Montag, 6. Januar 2003 14:24 schrieb Harald Welte:
Quoted 4 lines · Rolf Wuerdemann
Quoted 1 line
Hi there ...
Hi, sorry for my late reply.
Hi Harald (hope first name is o.k. ;) - no prob ;)
Quoted 10 lines
Quoted 8 lines
we've developed a new target for iptables:
ipt_ACCOUNT. This Target accounts Traffik on a packet-base on source and target ip using netfilter (similar to nacctd - but using iptables).It's in use on our routers (app. 60MBit/s Bandwitdh) since three month (app.) without any trouble and was tested with some DDoS-Tools before use ;)
great news. A couple of comments:
Thank you ;)
Quoted 7 lines
I think this is the wrong approach, there are way too much data
strucctures in non-swappable kernel momory allocated. And kernel-OOM is not something we should provoke. A better architecture from my point of view was: - use ULOG to copy the IP+TCP header of all packets to userspace [it is very efficient in doing so!!!] and then do all the accounting in userspace
I was aware of the OOM-Problem (so DDoS can kill your Router!), and thought about something like acctrack_max (simmilar to contrack_max) so you can set an maximum of tracked connections. This is not an solve for the root of the problem (to much data structures) - but an solve if you're afraid of running OOM from this side. - Perhaps I'll do some tests using ULOG, but from work with nacctd I know that copying packets from Kernel to User-Space takes much time (and time/speed was something I want to save ;)
Quoted 8 lines
Leaving this personal view aside, I still dislike a couple of issues with your patch
- It doesn't adhere to the kernel CodingStyle
- german variables
- C++ style comments
- more than 80chars per line
*G* - no problem to fix (like some debug-messages, etc ;) - I've posted the source before "cleanup" - so I can work in suggestions/comments with the cleanup ;)
Quoted 1 line
- the kernel/userspace interface using a socket option
Yes - thinking about using /dev/accouning (fs i/o) to get the data from kernel-space - /proc-fs seems to be unlikely (approx 2M filesize) - any opinions?
Quoted 3 lines
So if you want to contribute it into patch-o-matic, you will have to at least conform to the coding style, sorry.
Nothing to sorry ;) - Hwo should I post the changed version? Complete, diff, link to ftp/cvs?
Quoted 8 lines
Quoted 4 lines
PS: We've developed it 'cause nacctd was
a) to much use of cpu
b) looses packets during kernel-problems withPF_PACKETI am (as a long time nacctd user and hacker) aware of those issues. But this doesn't mean that moving everything into the kernel is the right thing..
Hmmm ... If you want to gain speed it's one of the best solutions - account the packets at the lowest possible level ;)
Regard's
Rolf Würdemann
Wieske's Crew KG
- --
Security is an illusion - Datasecurity twice
Rolf Wuerdemann - Privat: [email protected] - Office: [email protected] GnuPG-Key fingerprint: 7383 348F 67D1 CD27 C90F DDD0 86A3 31B6 67F0 D02F
RSA-Key fingerprint: CEBB 5086 9154 E8D8 7D0E CC4F 0F5E B9CC
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE+GbtphqMxtmfw0C8RAsOHAJ9FNK1xJ6NLuSJkCYJwEh+cMJ0dLgCgqcPK ehEfBQq8aavZ5KoyTMciqUk=
=TLx/
-----END PGP SIGNATURE-----
Quoted 1 line · Rolf Wuerdemann
Hi Harald (hope first name is o.k. ;) - no prob ;)
Klar doch.
Quoted 13 lines
Quoted 6 lines
I think this is the wrong approach, there are way too much data
strucctures in non-swappable kernel momory allocated. And kernel-OOM is not something we should provoke. A better architecture from my point of view was: - use ULOG to copy the IP+TCP header of all packets to userspace [it is very efficient in doing so!!!] and then do all the accounting in userspaceI was aware of the OOM-Problem (so DDoS can kill your Router!), and thought about something like
acctrack_max(simmilar tocontrack_max) so you can set an maximum of tracked connections. This is not an solve for the root of the problem (to much data structures) - but an solve if you're afraid of running OOM from this side. -
Quoted 3 lines
Perhaps I'll do some tests using ULOG, but
from work with nacctd I know that copying packets from Kernel to User-Space takes much time (and time/speed was something I want to save ;)
Don't even start to compare the two. The method used is totally different. With ULOG you can have a in-kernel buffer of let's say 64k and fill this buffer with the first 40 bytes per packet. Then if 1638 packets have accumulated, the buffer is flushed via a netlink socket. Several optimizations compared to a packet socket (what tcpdump does)
- you only copy the header of the packets (if you want)
- you have way less kernel/userspace transitions (and thus context switches) because of the buffered concept
- you filter the packets before you send them to userspace as opposed to dumping everything and then
I have reports from people who are dumping 100MBit under full load to userspace on 400-500MHz boxes from more than a year ago.
I'd love if you would give it a try, although it would mean developing yet another implementation of what you have already working ;)
Quoted 3 lines
*G* - no problem to fix (like some debug-messages, etc ;) - I've posted the source before "cleanup" - so I can work in suggestions/comments with the cleanup ;)
Ok, great. Thanks for taking care.
Quoted 5 lines
Quoted 1 line
- the kernel/userspace interface using a socket option
Yes - thinking about using
/dev/accouning(fs i/o) to get the data from kernel-space - /proc-fs seems to be unlikely (approx 2M filesize) - any opinions?
Well, I haven't suggested an alternative because I didn't have one which was looking better than the socket option...
This is a generic problem for everything (like ippool, the condition match, ...) inside netfilter/iptables that wants to transport some data from kernel to userspace.
Quoted 2 lines
Nothing to sorry ;) - Hwo should I post the changed version? Complete, diff, link to ftp/cvs?
maybe post one more version, then convert it to patch-o-matic and submit a patch against recent CVS.
Quoted 2 lines
Hmmm ... If you want to gain speed it's one of the best solutions - account the packets at the lowest possible level ;)
Yes. But then why do we use a multi purpose, multi user, multi tasking operating system instead of a realtime OS?
Either we do want high efficiency and compromise security, layering, etc. - or we want security, layering, abstraction... and will loose some performance.
Quoted 1 line
Regard's
Signature · 4 lines
- Harald Welte / [email protected] http://www.gnumonks.org/ ============================================================================ "If this were a dictatorship, it'd be a heck of a lot easier, just so long as I'm the dictator." -- George W. Bush Dec 18, 2000