-
Notifications
You must be signed in to change notification settings - Fork 988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add gvisor based service library #965
Conversation
Thanks for the contribution! Before we can merge this, we need @d4l3k to sign the Salesforce Inc. Contributor License Agreement. |
41cfc97
to
b1fce0c
Compare
c7cfed0
to
2cde07c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only a couple minor comments from what I saw. I think we can land this PR and update it as needed with future PRs.
Other thoughts (which I don't think should be required for the PR to land)
- It'd be fun to write some performance tests
- I expect the io.Pipe used doesn't scale up, but this can be updated in a future PR (along with performance tests that can verify or disprove my suspicion.)
My bad...apparently context.AfterFunc in go 1.21.0, but Nebula isn't on that golang version yet; it reduces Windows supported O/S's. Sorry! Will need to implement that functionality without that context function... |
AfterFunc() introduced in a future Go version
I believe this PR would close #538. |
I'm curious to try this out, but would be helpful to know the current state of play. It says only handles TCP and ipv4 connections, presumably referring to between hosts? I think ipv4 is only supported between hosts anyway? So the main difference right now it is doesn't support UDP connections between hosts? Then it's just a question of performance pending benchmarks? |
@maggie44 I'm currently using this for my own (limited) use and it's been working just fine. You're right that ipv6 isn't supported by Nebula currently so that's just behavior as usual so just UDP isn't supported. I've been using this for SSH and HTTP connections without any issues |
This adds a gvisor based service library which allows for using a user space TCP stack instead of a native tun device.
This is an initial implementation and only handles TCP and ipv4 connections. This implementation is a bit rough so feedback is welcome 🙂
This refactors the Main function to take in a DeviceFactory -- so any users that require tunFd need to use NewFdDeviceFromConfig(tunFd) as the factory instead
See examples/go_service/main.go for how this might be used
Test plan:
Manual