On 7/23/20 5:38 AM, Nadav Har'El wrote:
On Thu, Jul 23, 2020 at 12:05 PM Rick Payne <[email protected]
<mailto:[email protected]>> wrote:
Another alternative (for me and maybe others) would be to have a
standard way to hook packets direct from the virtio interface.
We did have something like that in the past, and I remember Vlad used
it to write
some sort of super-efficient HTTP server or something like that -
Vlad, do you remember
where it is? I can't recall now :-(
Me neither. Sorry. Too long ago... ;)
We also had until recently something more general, "assigned virtio",
where the application
gets access directly to the viritio rings (and needs to work with them
- the kernel doesn't
touch them any more). Waldek recently removed it but I guess you can
see how it worked
before that, and if needed we can bring it back.
Especially if we could ensure that we don't dhcp on that interface.
For instance, setup 2 interfaces from the host - 1 for OSv-y
stuff, and
one just for an application which takes over the interface at a very
low level.
Rick
On Mon, 2020-07-20 at 21:32 -0700, Waldek Kozaczuk wrote:
> Honestly, I am not familiar enough in this subject domain so I
cannot
> give any authoritative advice. But it seems to me that the latter
> idea of introducing and supporting LINUX_AF_PACKET may be less
effort
> and more in line with what Charles did. I am not familiar with
BPF so
> I do not know if it would even make sense for OSv nor how much
effort
> it would be to support it.
>
> Waldek
>
> On Thursday, July 16, 2020 at 9:43:14 AM UTC-4
[email protected] <mailto:[email protected]>
> wrote:
> > Hi,
> >
> > I think that the type of raw sockets (SOCK_RAW) works well in
OSv,
> > it is possible to hook L3 packets (assuming an INET domain)
with no
> > problems. I guess that BSD does not support the PACKET domain,
thus
> > the OSv does not support too. If I remember well, we can hook
> > frames in BSD by using libpcap, which in turn uses bpf
> > (alternatively, we can use bpf directly). However, the bsd/sys/net
> > in OSv does not have the FreeBSD's bpf implementation. Maybe one
> > interesting way to enable L2 packet hooking is by migrating
the bpf
> > from sys/net of FreeBSD to the bsd/sys/net of OSv (what do you
> > think about that guys?). Another possibility is to create a
kind of
> > PACKET domain support (similar to NETLINK support provided by
> > Charles Meyers in the Spirent fork), but in that case, we will
need
> > to hook the bytes of frames straightforward from the mbuffs.
> >
> > Regards,
> > Vinicius
> >
> > Em quinta-feira, 16 de julho de 2020 às 02:57:52 UTC-3, Pekka
> > Enberg escreveu:
> > > Hi,
> > >
> > > On Wed, Jul 15, 2020 at 6:13 PM Waldek Kozaczuk <
> > > [email protected] <mailto:[email protected]>> wrote:
> > > > Hi,
> > > >
> > > > Unfortunately, I have no idea what it would take to add raw
> > > > sockets support. Please be aware that we maintain another IPV6
> > > > branch - https://github.com/cloudius-systems/osv/tree/ipv6 -
> > > > which besides IPV6 might have better networking support but I
> > > > doubt it supports raw sockets.
> > > >
> > > > I am also adding Charles Meyers from Spirent who wrote
original
> > > > IPV6 support to this thread. He may have some thoughts on this
> > > > matter. Also, Spirent has also its own OSv fork -
> > > > https://github.com/SpirentOrion/osv - which has extra
> > > > stuff/fixes to networking stack (I would like to port some of
> > > > those to the mainline OSv at some point).
> > > >
> > >
> > > The TCP/IP stack supports raw sockets (it's the FreeBSD stack
> > > after all).
> > >
> > > One potential issue is that the Linux socket()
> > > compatibility layer is incorrect. I see that linux_socket()
> > > (called by socket() function) has some support for raw sockets:
> > >
> > >
https://github.com/cloudius-systems/osv/blob/master/bsd/sys/compat/linux/linux_socket.cc#L619
> > >
> > > However, it's bit picky on the "domain" and "protocol" and will
> > > ignore what Frederic attempted to do:
> > >
> > > fd=socket(AF_PACKET,SOCK_RAW,htons(ETH_P_ALL));
> > >
> > > I assume if you fix up linux_socket() to do what Linux does,
> > > things will work fine.
> > >
> > > - Pekka
>
> --
> You received this message because you are subscribed to the Google
> Groups "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to [email protected]
<mailto:osv-dev%[email protected]>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/osv-dev/397b053e-b06b-467e-89b8-75d9dd6d117an%40googlegroups.com
> .
--
You received this message because you are subscribed to the Google
Groups "OSv Development" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to [email protected]
<mailto:osv-dev%[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/osv-dev/6a3ce5daecbcb84bcdee0738242937e11d2f9d33.camel%40rossfell.co.uk.
--
You received this message because you are subscribed to the Google Groups "OSv
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/osv-dev/7e325570-1c5d-cd4b-1d2f-c71ccf4daad8%40scylladb.com.