Networking Forums

Networking Forums > Computer Networking > Linux Networking > Packet socket vs. kernel networking stack

Reply
Thread Tools Display Modes

Packet socket vs. kernel networking stack

 
 
ticmanis@gmx.de
Guest
Posts: n/a

 
      11-08-2006, 12:23 PM
Hello,

I'm currently using the raw packet socket interface (i.e. PF_PACKET,
SOCK_RAW) to feed a user space application with network packets. The
purpose is porting of a (given) bunch of code implementing a bunch of
(partially nonstandard) low-level protocols. The code comes from
dedicated hardware where it had to do everything (read: a whole TCP/IP
stack plus some more) by itself in fairly little memory, so that it
doesn't have a nice separation of OSI layers.

The problem is, I want the kernel networking stack to see those packets
that I can't handle in the application (so that http, ssh, telnet etc.
continue to work), but not those I can handle myself.

It seems like every packet that gets captured in the packet socket also
goes into the kernel stack. Good for tcpdump and other
monitoring/debugging apps, not so good if you actually want to do work
on the packets in user space.

So, is it possible to
1.) Capture all packets through the packet socket
2.) Forward only those to the kernel networking stack that I deem
worthy of forwarding.

Of course I can filter packets with iptables, but the point is that the
application should be able to forward or not forward packets to the
kernel stack, with the decision made on-the-fly.

--
Linards Ticmanis

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get data in kernel SEND buffer for a TCP socket from a netfilter based kernel module Rohit Linux Networking 0 05-10-2007 11:27 AM
Help: What's the raw packet socket? bg2aw@126.com Linux Networking 1 06-30-2006 09:22 AM
Packet socket: mmapped IO cone Linux Networking 1 03-28-2006 04:50 PM
linux kernel 2.6 packet travel Giacomo Linux Networking 1 07-01-2005 03:47 PM
What is MAX size allocated to packet in kernel??? linux.lover Linux Networking 0 01-10-2005 01:56 PM



1 2 3 4 5 6 7 8 9 10 11