mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* kenel level packet capturing
@ 2011-10-18 15:19 raviraj joshi
  2011-10-18 20:41 ` Bruno Prémont
  0 siblings, 1 reply; 2+ messages in thread
From: raviraj joshi @ 2011-10-18 15:19 UTC (permalink / raw)
  To: linux-kernel

We are making a kernel level packet capture module as a part of our BE project .
We are finding it difficult to understand kenel networking code.
We studied structures and functions like sk_buff, netif_rx(),dev_alloc_skb.
How ever we were not able to trace the actual path a simple packet follows.
Moreover we tried to count the no of times netif_rx function was
called it was much much lower than amount of packets actually being
received.
Can anyone please let us know the reason for this and how to approach
the problem of writing a kernel level packet capture module.

regards,
Raviraj Joshi
PICT,Pune.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: kenel level packet capturing
  2011-10-18 15:19 kenel level packet capturing raviraj joshi
@ 2011-10-18 20:41 ` Bruno Prémont
  0 siblings, 0 replies; 2+ messages in thread
From: Bruno Prémont @ 2011-10-18 20:41 UTC (permalink / raw)
  To: raviraj joshi; +Cc: linux-kernel

Hi,

You would probably have more/better replies if you asked netdev <netdev@vger.kernel.org>.

On Tue, 18 October 2011 raviraj joshi <raviraj.j1991@gmail.com> wrote:
> We are making a kernel level packet capture module as a part of our BE project .
> We are finding it difficult to understand kenel networking code.
> We studied structures and functions like sk_buff, netif_rx(),dev_alloc_skb.
> How ever we were not able to trace the actual path a simple packet follows.
> Moreover we tried to count the no of times netif_rx function was
> called it was much much lower than amount of packets actually being
> received.

netif_rx may fetch more than a single packet from the network interface
controller in order to improve performance.

> Can anyone please let us know the reason for this and how to approach
> the problem of writing a kernel level packet capture module.

The better place to capture packets is probably by hooking somewhere into
netfilter code as all packets traverse it (assuming it is loaded/enabled).

Bruno


> regards,
> Raviraj Joshi
> PICT,Pune.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-18 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-18 15:19 kenel level packet capturing raviraj joshi
2011-10-18 20:41 ` Bruno Prémont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®