Skip to content
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

Implement UDP as a swarm protocol #58

Closed
whyrusleeping opened this issue Sep 12, 2014 · 27 comments
Closed

Implement UDP as a swarm protocol #58

whyrusleeping opened this issue Sep 12, 2014 · 27 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature

Comments

@whyrusleeping
Copy link
Member

Having UDP as a protocol for swarm to use will make ipfs MUCH more flexible.

Some considerations will need to be taken for packet loss though, in some cases lost packets are not okay. Implementing a basic packet-wise ACK system might be useful.

@whyrusleeping whyrusleeping added the kind/enhancement A net-new feature or improvement to an existing feature label Sep 12, 2014
@jbenet
Copy link
Member

jbenet commented Sep 12, 2014

uTP or SCTP/UDP might be the right thing to do. We don't need streams, but maybe easier than segregating our packets and writing our own reliable transport for things that really matter.—
Sent from Mailbox

On Fri, Sep 12, 2014 at 2:23 PM, Jeromy Johnson [email protected]
wrote:

Having UDP as a protocol for swarm to use will make ipfs MUCH more flexible.

Some considerations will need to be taken for packet loss though, in some cases lost packets are not okay. Implementing a basic packet-wise ACK system might be useful.

Reply to this email directly or view it on GitHub:
#58

@jbenet
Copy link
Member

jbenet commented Nov 8, 2014

I found https://github.com/h2so5/utp/ It has an alpha warning, and is currently slow (see https://github.com/h2so5/utp/pull/3) but a great start.

@jbenet
Copy link
Member

jbenet commented Nov 8, 2014

Also, two years ago, @cyberroadie implemented SCTP at https://bitbucket.org/cyberroadie/go-sctp -- it should be a library, as it probably won't go into golang's stdlib net. We can see about extracting it.

@whyrusleeping
Copy link
Member Author

Cool,I got myself more familiar with UDP in Go last night, so maybe I could take a look at whats making the utp package slow, and do some pull requests

@cyberroadie
Copy link

Hi, my SCTP addition to the Go net lib is a bit dated, don't think it will work with newer versions of Go. One thing to keep in mind is that it is dependent on the implementation of SCTP of the OS it is running on. My version only works on FreeBSD and OS X.

@jbenet
Copy link
Member

jbenet commented Nov 9, 2014

@cyberroadie ah, i see. So not actually an implementation in Go, but a binding to the kernel implementation? Have you found any of SCTP, uTP, UTD, DCCP, ... in Go?

@jbenet
Copy link
Member

jbenet commented Nov 9, 2014

@cyberroadie
Copy link

Yes indeed a binding. TCP and UDP do exactly the same in Go. The binding is abstracted away with a thin layer of assembly which you can use to call the different system calls: https://code.google.com/p/go/source/browse/#hg%2Fsrc%2Fsyscall

@cyberroadie
Copy link

Didn't know about UDT, interesting. I'm currently implementing a VoiP solution integrated in a game engine and I'm looking for a faster and more reliable solution then UDP/TCP. I definitely will have a look at this.

@jbenet
Copy link
Member

jbenet commented Nov 9, 2014

@cyberroadie is this in Go?

@cyberroadie
Copy link

The server side is. The client side will be in C# and C++.

@jbenet
Copy link
Member

jbenet commented Nov 9, 2014

@cyberroadie if you go for UDT, we should all collaborate on a Go implementation.

@cyberroadie
Copy link

@jbenet yes, that would be a cool project.

@jbenet
Copy link
Member

jbenet commented Nov 11, 2014

"Oh, I'll just make quick bindings for this C++ UDT lib. how hard can it be?"

12 hours later... Okay, I just finished making Go bindings for C++ UDT: https://github.com/jbenet/go-udtwrapper (can test it with go test, cd udtcat; make test -- warning: annoying installation due to the (currently) dylib).

Would love to see real benchmarks because (a) not clear how much faster the protocol is, (b) not clear how fast this c++ impl is, (c) not clear i didnt screw it all up and make it much slower than its supposed to be. (small benchmarks would be a plus).

Anyway, we can use this while the nascent utp implementation grows.

@whyrusleeping
Copy link
Member Author

👍

@btc btc added status/in-progress In progress and removed ready labels Nov 24, 2014
@jbenet
Copy link
Member

jbenet commented Jan 5, 2015

Update: #488 revealed that h2so5/utp (old "working" commit) was breaking as a transport. #490 removed it. We will have to get another udp reliable transport for nat:


@oxtoacart are you guys using go-udtwrapper*? (something else for udp reliability in go?) @whyrusleeping had trouble running it in his ARM chromebook, we determined it was some missing ARM assembly in the c++ udt lib. I haven't looked into this-- will soon-- but just thought you should know.

This was referenced Jan 5, 2015
@oxtoacart
Copy link

@jbenet Thanks for the heads up! We're not actually using go-udtwrapper yet. First we have to release a build that includes go-natty and collects some stats on how well nat-traversal is working. Actually proxying traffic over UDP will hopefully follow not too long thereafter.

@jbenet
Copy link
Member

jbenet commented Jan 5, 2015

@oxtoacart sounds good. I'm about to work on bundling go-natty into go-ipfs (at some point soon we should discuss making natty strip out only the relevant c++ from webrtc and either building a tiny binary, or link it in using cgo. currently natty adds ~10MB (or is it 40+MB if you bundle multiple archs together?))

@oxtoacart
Copy link

@jbenet The natty version for each architecture is compiled into the go build for that architecture, so you're looking at just one natty executable as overhead.

@oxtoacart
Copy link

BTW, I know that @atavism wants to work on decreasing the size of the binary, but he has his plate full with other stuff at the moment.

@jbenet
Copy link
Member

jbenet commented Jan 5, 2015

Ah okay, thanks! And no worries, this is lower priority stuff :)

@oxtoacart
Copy link

@jbenet Thank you! Hope you had a nice holiday season.

@jbenet
Copy link
Member

jbenet commented Jan 5, 2015

thanks! same to you all! btw, feel free to hang out with us in #ipfs on freenode

@whyrusleeping
Copy link
Member Author

we have UDT that works just needs to be wired in, I think this can be closed now

@jbenet
Copy link
Member

jbenet commented Jul 27, 2015

Update on uTP. anacrolix wrote to the go-nuts mailing list:

I ended up writing https://github.com/anacrolix/utp for this. I found h2so5/utp to be unstable and hard to work with. anacrolix/utp is at least very stable, and has been used in production for 8 months now. Its performance could be better, and some things in the spec could be clarified, but if you want to use uTP, this will get the job done.
From https://groups.google.com/d/msg/golang-nuts/Co8vQ0KkrLU/qeTcEgHvR9oJ

perhaps we should try it out :) -- i would be more comfortable if we had a large cross-internet test case.

@xaionaro
Copy link

xaionaro commented Jul 1, 2019

Well:

But the ticket is closed :). Can we reopen the ticket?

Reference: https://github.com/libp2p?utf8=%E2%9C%93&q=transport&type=&language=go

@Stebalien
Copy link
Member

This issue has a lot of outdated information. I've created a new UDP meta issue: #6481.

@aschmahmann aschmahmann mentioned this issue Sep 22, 2020
72 tasks
ariescodescream pushed a commit to ariescodescream/go-ipfs that referenced this issue Oct 23, 2021
@aschmahmann aschmahmann mentioned this issue Dec 1, 2021
80 tasks
ariescodescream pushed a commit to ariescodescream/go-ipfs that referenced this issue Apr 7, 2022
chore: add tests to verify allowable data layouts
@ajnavarro ajnavarro mentioned this issue Aug 24, 2022
72 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

7 participants