Thread (7 messages) 7 messages, 4 authors, 2016-08-16

Send packets from userspace program to kernel interface

From: Bhaskar Upadhyayula <hidden>
Date: 2016-08-16 06:30:56

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help