[Slirp] gvisor netstack as an alternative to slirp

Marek Majkowski majek04 at gmail.com
Fri Jan 3 08:38:46 UTC 2020


(resent to slirp at lists.freedesktop.org mailing list)

Good morning!

There seem to be a wider discussion about the future of libslirp. Some
suggest to use smoltcp [1]. I tried a different approach. I drafted a
slirp4netns-alike code using gvisor netstack:
https://gist.github.com/majek/778021e4f95f3e77ada5afcecacbd819

The code is very rough, but shows the potential of netstack. The
biggest problem I had with netstack is the routing setup.

A) I wasn't able to get routing right, so opted out for assigning 0/0
onto the tun interface internally in netstack. This results in ping's
being accepted by netstack. Ping _anything_ from guest will always be
responded by netstack. I'm not sure how to work around it. Perhaps
extend netstack to have IcmpForwarder, just like we have
tcp.Forwarder?

B) I'm not sure how to do connection forwarding going from host to
guest. This is again, mostly related to routing configuration.

Let me know what you think.

Cheers,
    Marek

[1] https://github.com/rootless-containers/slirp4netns/issues/171


More information about the Slirp mailing list