Re: Send packets from userspace program to kernel interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 16 August 2016 10:42:13 A.M. IST Bhaskar Upadhyayula wrote:
> Hi Alan,
> 
> I am not sure how this will achieve what I want. Can you please
> explain a bit more?
> 
> Thanks.

Well, if you're truly sampling and not just capturing every packet, then in theory there's a nonzero probability that sending the packet back out, addressed to 127.0.0.1 but otherwise unchanged, will not be captured again and then traverse up the kernel's networking stack as usual. Is this not what you want?

> 
> On Tue, Aug 16, 2016 at 2:11 AM, Alan Liddell <alan.c.liddell@xxxxxxxxx> wrote:
> > Would sending the packet back out through the loopback address accomplish
> > what you're looking to do?
> >
> >
> > On Aug 16, 2016 7:51 AM, "Bhaskar Upadhyayula" <bu.kernel@xxxxxxxxx> wrote:
> >>
> >> 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.
> >>
> >> _______________________________________________
> >> Kernelnewbies mailing list
> >> Kernelnewbies@xxxxxxxxxxxxxxxxx
> >> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> 
-- 
--ACL

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux