LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-06-2009, 01:32 AM   #1
dodo76
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Rep: Reputation: 0
sniffing AND stealing packets


Hello!

If you add a PF_PACKET socket then you will be sniffing all packets that is received on your interface. But your sniffing packets are only copies of the packet which will also be heading up the normal IP stack and maybe processed in other packet handlers too.

Is there a way to "steal" the original packet? I.e. to stop it from being processed by other packet handlers?

Thanks
BR
Robert
 
Old 11-06-2009, 11:11 AM   #2
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
To put another comp between and process the traffic.
 
Old 11-08-2009, 02:29 PM   #3
dodo76
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nimnull22 View Post
To put another comp between and process the traffic.
Thanks for answering but this was not what I meant.

I want to process the packet, but I want to do it at kernel level and NOT involve the usual network processing that exist in the kernel.

To be more frank:
I want to optimize the packet handling in the kernel, by writing the code myself. But I do not want to touch the kernel. Preferably I just want to write a module which I later can export to "any" linux distro (i.e. a portable solution).

Thanks
BR
Robert
 
Old 11-08-2009, 02:45 PM   #4
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Quote:
Originally Posted by dodo76 View Post

Is there a way to "steal" the original packet? I.e. to stop it from being processed by other packet handlers?
This is not the packets processing, this is stealing.

Quote:
Originally Posted by dodo76 View Post
I want to optimize the packet handling in the kernel...
What is wrong with it now. Kernel has a lot of different modules to process traffic.
 
Old 11-09-2009, 12:31 AM   #5
dodo76
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nimnull22 View Post
This is not the packets processing, this is stealing.
I used the word "steal" since I wanted to know if there was a way to stop the kernel from making a copy to each of the packet handlers. I have seen that there is this mechanism called NETPOLL. It can "consume" the packet and essentially "steal" it from the packet handlers. But NETPOLL seems to have been developed for faulty situations (more like a network debug tool).

Quote:
Originally Posted by nimnull22 View Post
What is wrong with it now. Kernel has a lot of different modules to process traffic.
I do suspect that the kernel does more than I want to do. I was hoping that I were going to be able to reduce the processing time of each packet by writing the processing code myself. It seems you can easily do this by just adding a PF_PACKET handler (like sniff tools do). But since the packet will still be copied to the ordinary IP stack I assume that there will be at least some overhead (even if I have no socket connected for that packets port).

BR
Robert
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hijacking/stealing packets eddchr Linux - Networking 5 10-08-2008 01:32 AM
What is the pupose of sniffing network packets? LinuxCrazy Linux - Security 3 06-09-2007 01:30 PM
Sniffing Packets - Outside my LAN Palula Linux - Software 2 09-20-2005 12:31 PM
algorithm for sniffing IP packets? shrike_912 Programming 2 06-08-2004 02:48 PM
Sniffing: tcpdump gets some initial packets merlin-themage Linux - Networking 0 05-28-2004 07:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration