Results 1 to 4 of 4
|
Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
-
07-02-2010 #1
- Join Date
- Jul 2010
- Posts
- 5
Network traffic analysis - Kernel level - please help
I´m actually carrying an internship and I would like to make some traffic analysis on a Kernel level. My first goal is to build a loadable module to count how many packets go throught eth0 during a short time and to save this packets somewhere (maybe in a created /proc/<my_folder> folder). I read about net_device and net_device stat but I can´t find any .c to see how it works. So I´ve two questions:
[1]Do you think net_device is the good way to do it?
[2]Do you know where I could find any examples?
/* Config */
2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux
Thank you for helping!
-
07-05-2010 #2
- Join Date
- Jul 2010
- Posts
- 5
Anybody? No idea?
-
07-14-2010 #3
- Join Date
- Jul 2010
- Posts
- 3
You probably want to look at the NETFILTER post-routing hook. It is a built in interception point where you could check the intended destination interface of a packet by inspecting skb->dev.
Shouldn't be a concern for this particular task but I recently found out there was a significant change in 2.6.31+ in the way the kernel uses net_device. Much of the funtionality (callbacks etc) is now in net_device_ops.
I strongly suggest the books "Linux Device Drivers" and "Linux Network Internals" (both O'Reilly books)
-
07-16-2010 #4
- Join Date
- Jul 2010
- Posts
- 5
Thank you for your answer.
I have the first book but I don´t know the second one, i´ll tri to find it.