From: "Timo Teräs" <ext-timo.teras@nokia.com>
To: netfilter-devel@lists.netfilter.org
Subject: IDLEDETECT target
Date: Mon, 16 Aug 2004 18:04:20 +0300 [thread overview]
Message-ID: <4120CCF4.60003@nokia.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1594 bytes --]
Hi all,
I'm currently planning to write a new target to detect when ever a
network interface has been idle for a configurable amount of time.
First some background:
Usually this sort of thing can be accomplished by ppp modules
PPPIOCGIDLE ioctl. However I need this sort of "IDLE detection" for
interfaces other than ppp too. And usage of PPIOCGIDLE needs polling
which I consider bad.
I came up with a couple of choices:
1. Use PF_PACKET and filter all packets that will be considered to reset
the IDLE timer
2. Use iptables and QUEUE all packets as above
3. Poll match count of some iptable rule
4. Write a custom iptables target to send notification when interface
goes to idle
Options 1 and 2 involve great amounts of kernel to userland traffic. And
option 3 would require polling with relatively small interval to be
accurate enough.
So looks like the option four is ideal for my situation. I'd propably
use netlink to send the events when interface seems to be idle. Other
possibility is to use d-bus if it gets included in vanilla kernel (see
http://vrfy.org/projects/kdbusd/).
Basically when ever a packet matches the IDLEDETECT target it would
reset the interfaces idle timer. When the timer would expire a netlink
message would be sent.
Now I'm asking if this is a good idea? And has anyone tried to do such a
thing before?
If this approach seems to be okay I'd be willing to implement it
(assuming no one has done this yet). In this case would this be useful
enough to be included in the patch-o-matic (and possibly even mainstream
kernel)?
Cheers,
Timo
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
next reply other threads:[~2004-08-16 15:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-16 15:04 Timo Teräs [this message]
2004-08-19 10:29 ` IDLEDETECT target Harald Welte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4120CCF4.60003@nokia.com \
--to=ext-timo.teras@nokia.com \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.