kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: bu.kernel@gmail.com (Bhaskar Upadhyayula)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Send packets from userspace program to kernel interface
Date: Mon, 15 Aug 2016 23:30:56 -0700	[thread overview]
Message-ID: <CADmdLE8a0e7FXtmRiUGVKSP=y8dkJ9rLepQvP2WP3KoVK01iKw@mail.gmail.com> (raw)

Hello All,

Summary:
===
If a userspace program has a well crafted packet (ethernet or IPv4 or
other protocol packet), is there a way for it to send the packet to
kernel's network interface, simulating the behavior that the packet
ingress'ed on that interface? Is this possible?


Detailed Problem Description:
===
I am working on packet sampling feature (sFlow) on OpenSwitch
(www.openswitch.net) Network OS. Currently, this OS is supported on
few Accton switches that has Broadcom's Trident2 chipset. When we
enable packet sampling, the sampled packets are sent to a userspace
program, by passing the kernel network stack. This is a problem if the
packet was supposed to go up the network stack.

I am investigating options to re-send the packet back to kernel
interface on which packet arrived on the switch. Hence this question.

A colleague suggested looking at Tuntap interfaces. I did a quick
research and it did not appear that can be done.

Any suggestions or pointers for further reading will be very helpful.


Thanks.

             reply	other threads:[~2016-08-16  6:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16  6:30 Bhaskar Upadhyayula [this message]
2016-08-16  9:11 ` Send packets from userspace program to kernel interface Alan Liddell
2016-08-16  9:39   ` Gadre Nayan
2016-08-16 17:45     ` Bhaskar Upadhyayula
2016-08-16 17:42   ` Bhaskar Upadhyayula
2016-08-16 19:56     ` Alan Liddell
2016-08-16  9:39 ` François

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='CADmdLE8a0e7FXtmRiUGVKSP=y8dkJ9rLepQvP2WP3KoVK01iKw@mail.gmail.com' \
    --to=bu.kernel@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).