Netfilter Queue
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I have written a UDP packet processing kernel module that registers itself to the PREROUTING hook of the Netfilter architecture. Now, each UDP packet that arrives at this hook is passed to my module.
And this is the point!
What exactly does this mean?
As far as I understand it: there are module-specific queues, in which the packets are inserted?
If so, is there a possibility to influence the lengths of these queues?
I would like to realize a means to adapt the queue length respectively the amount of packets waiting to be processed by a module according the current traffic load. (high traffic load -> short queue length).
Is such a thing possible?
Thanks muchly for your time
Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAHi+r68eBr8WIgcgRApAfAJ49XWvaqKUA5Grc+Xm9XufnN+NKdACgiSMd X1aJF7qTk8PmtW5Wb/Y1t74=
=Wkb1
-----END PGP SIGNATURE-----
Quoted 3 lines · Andreas Hess
I have written a UDP packet processing kernel module that registers itself to the PREROUTING hook of the Netfilter architecture. Now, each UDP packet that arrives at this hook is passed to my module.
Ok.
Quoted 2 lines
As far as I understand it: there are module-specific queues, in which the packets are inserted?
What queues?
Netfilter modules are called inline in the normal packet forwarding of the Linux kernel. If your system receives packets faster than it can process then packets are dropped.
In most Ethernet drivers there is a relatively small queue between the interrupt handler and the rest of the kernel. This queue is not related to Netfilter but part of how the specific drivers work.
The only queue mechanism in netfilter is if your hook function returns NF_QUEUE as verdict, in which case the packet will be sent to userspace via ip_queue. I am not sure if there is a queue size limitation or not when using NF_QUEUE.
Regards
Henrik
Quoted 8 lines · Andreas Hess
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Hi,
I have written a UDP packet processing kernel module that registers itself to the PREROUTING hook of the Netfilter architecture. Now, each UDP packet that arrives at this hook is passed to my module.
this is exactly what you wanted to do. If you register to a hook in the stack, you will get all packets traversing that point in the stack.
This is what netfilter is all about!!
I think you might have a general misconception about what netfilter is.
Quoted 2 lines
As far as I understand it: there are module-specific queues, in which the packets are inserted?
no, why should there be any queues?
Quoted 5 lines
I would like to realize a means to adapt the queue length respectively the amount of packets waiting to be processed by a module according the current traffic load. (high traffic load -> short queue length).
Is such a thing possible?
no, you are called inline in the network RX softirq. There is only a single backlog queue between hardirq and softirq in front of you.
Quoted 1 line
Andreas
Signature · 5 lines
- Harald Welte <[email protected]> http://www.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