rudp

649 views
Skip to first unread message

Vasiliy Tolstov

unread,
Dec 10, 2014, 3:23:10 PM12/10/14
to golang-nuts
Hello, does go have library for reliabile udp? or how can i deal with
udp transport that needs quarantine packet delivery?

--
Vasiliy Tolstov,
e-mail: v.to...@selfip.ru
jabber: va...@selfip.ru

tomwilde

unread,
Dec 10, 2014, 3:28:13 PM12/10/14
to golan...@googlegroups.com
this might sound like a stupid answer but why not tcp?

Vasiliy Tolstov

unread,
Dec 10, 2014, 3:30:58 PM12/10/14
to tomwilde, golan...@googlegroups.com
2014-12-10 23:28 GMT+03:00 tomwilde <sedevel...@gmail.com>:
> this might sound like a stupid answer but why not tcp?


i have problems with tcp bandwidth (200Mbits/s) , but in case of udp
- 800 Mbits/s.

Dave Cheney

unread,
Dec 10, 2014, 5:20:55 PM12/10/14
to golan...@googlegroups.com
Can rudp be implemented in user space? I looked at it previously but it appeared you needed support from the kernel.

Defia Zhu

unread,
Dec 11, 2014, 2:15:45 AM12/11/14
to golan...@googlegroups.com
there are several packages already

this one is a pure go utp implementation

a go wrapper of udt

based on udt,but simplified



在 2014年12月11日星期四UTC+8上午4时23分10秒,Vasiliy Tolstov写道:

Manlio Perillo

unread,
Dec 11, 2014, 6:22:29 AM12/11/14
to golan...@googlegroups.com, sedevel...@gmail.com


Il giorno mercoledì 10 dicembre 2014 21:30:58 UTC+1, Vasiliy Tolstov ha scritto:
2014-12-10 23:28 GMT+03:00 tomwilde <sedevel...@gmail.com>:
> this might sound like a stupid answer but why not tcp?


i have problems with tcp bandwidth (200Mbits/s) ,  but in case of udp
- 800 Mbits/s.


What about SCTP ?

Regards  Manlio Perillo 

Vasiliy Tolstov

unread,
Dec 11, 2014, 6:45:44 AM12/11/14
to Dave Cheney, golan...@googlegroups.com
2014-12-11 1:20 GMT+03:00 Dave Cheney <da...@cheney.net>:
> Can rudp be implemented in user space? I looked at it previously but it appeared you needed support from the kernel.


If app use raw socket it can format needed udp/rudp packet

Vasiliy Tolstov

unread,
Dec 11, 2014, 6:45:52 AM12/11/14
to Defia Zhu, golan...@googlegroups.com
2014-12-11 10:15 GMT+03:00 Defia Zhu <def...@gmail.com>:
> there are several packages already
>
> https://github.com/h2so5/utp
> this one is a pure go utp implementation
>
> https://github.com/jbenet/go-udtwrapper
> a go wrapper of udt
>
> https://github.com/calmh/dst
> based on udt,but simplified


Thanks for links!

Vasiliy Tolstov

unread,
Dec 11, 2014, 6:46:22 AM12/11/14
to Manlio Perillo, golan...@googlegroups.com, sedevel...@gmail.com
2014-12-11 14:22 GMT+03:00 Manlio Perillo <manlio....@gmail.com>:
> What about SCTP ?


SCTP benefits only if you use two links in the same time (or i miss
something) also as i know - go does not have sctp support.

tomwilde

unread,
Dec 11, 2014, 7:18:11 AM12/11/14
to golan...@googlegroups.com
On Wednesday, December 10, 2014 11:20:55 PM UTC+1, Dave Cheney wrote:
Can rudp be implemented in user space? I looked at it previously but it appeared you needed support from the kernel.

You could. The blocker is efficiency; you will never be able to write anything remotely as fast as a heavily optimized kernel-space implementation assisted by special scheduling heuristics. Throughput is an economics figure.

Manlio Perillo

unread,
Dec 11, 2014, 8:25:01 AM12/11/14
to Vasiliy Tolstov, golan...@googlegroups.com, sedevel...@gmail.com
On Thu, Dec 11, 2014 at 12:45 PM, Vasiliy Tolstov <v.to...@selfip.ru> wrote:
2014-12-11 14:22 GMT+03:00 Manlio Perillo <manlio....@gmail.com>:
> What about SCTP ?


SCTP benefits only if you use two links in the same time (or i miss
something) also as i know - go does not have sctp support.


But, as far as I know, go does not support rudp, either.
Since SCTP is an internet standard, available in some operating systems,
implementing and using SCTP *may* be a better decision.


Regards  Manlio Perillo

Vasiliy Tolstov

unread,
Dec 11, 2014, 7:58:26 PM12/11/14
to Manlio Perillo, golan...@googlegroups.com, sedevel...@gmail.com
2014-12-11 16:24 GMT+03:00 Manlio Perillo <manlio....@gmail.com>:
> But, as far as I know, go does not support rudp, either.
> Since SCTP is an internet standard, available in some operating systems,
> implementing and using SCTP *may* be a better decision.
>
>
> Regards Manlio Perillo


I'm try to use utp, but have a problems - utp package does not resend
missed udp packets automatic.
Also can somebody check my ugly code and suggest for some good ways to
optimize it.
code located at github.com/vtolstov/go-nbd/client and
github.com/vtolstov/go-nbd/server
Also what is the best way to control that packet sended from server
received by client with minimal overhead?

bronze man

unread,
Dec 12, 2014, 3:33:58 AM12/12/14
to golan...@googlegroups.com
I just tested all three.
https://github.com/h2so5/utp is not stable right now.
https://github.com/calmh/dst is stable,but a little slower than tcp.

Defia Zhu

unread,
Dec 12, 2014, 3:49:22 AM12/12/14
to bronze man, golan...@googlegroups.com
actually, yes
i've tried all three too.
in my enviroment, none of these are as fast as tcp

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/qCT_1TDSQd8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jakob Borg

unread,
Dec 12, 2014, 7:46:46 AM12/12/14
to bronze man, golang-nuts
2014-12-12 9:33 GMT+01:00 bronze man <bronz...@gmail.com>:
https://github.com/calmh/dst is stable,but a little slower than tcp.


I dispute that! :)

It's the exact opposite of stable, as there are bunch of changes I need to do. It should get there in the end. It's slower than TCP for sure, a lot due to the syscall overhead for each packet as it seems.

//jb

Vasiliy Tolstov

unread,
Dec 12, 2014, 8:20:26 AM12/12/14
to bronze man, golan...@googlegroups.com
2014-12-12 11:33 GMT+03:00 bronze man <bronz...@gmail.com>:
> I just tested all three.
> https://github.com/h2so5/utp is not stable right now.
> https://github.com/jbenet/go-udtwrapper is difficult to build.
> https://github.com/calmh/dst is stable,but a little slower than tcp.


You check all of this when link is stable, than link is unstable tcp
very slow and depends on congestion control algo...

Vasiliy Tolstov

unread,
Dec 12, 2014, 11:10:41 AM12/12/14
to Vasiliy Tolstov, bronze man, golan...@googlegroups.com
2014-12-12 16:19 GMT+03:00 Vasiliy Tolstov <v.to...@selfip.ru>:
>> https://github.com/calmh/dst is stable,but a little slower than tcp.


I'm test it with localhost and get very poor results =
2014/12/12 19:15:02 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
2014/12/12 19:15:03 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 16.9 MB, 17199.4 KB/s
2014/12/12 19:15:04 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 17.6 MB, 15359.7 KB/s
2014/12/12 19:15:05 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 19.9 MB, 17456.7 KB/s
2014/12/12 19:15:06 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 18.4 MB, 16697.6 KB/s
2014/12/12 19:15:07 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 17.1 MB, 17048.9 KB/s
2014/12/12 19:15:08 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 19.1 MB, 19464.7 KB/s
2014/12/12 19:15:10 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 7.2 MB, 6239.3 KB/s
2014/12/12 19:15:11 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 9.1 MB, 4971.8 KB/s
2014/12/12 19:15:12 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 18.8 MB, 19187.2 KB/s
2014/12/12 19:15:14 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 2.5 MB, 1920.8 KB/s
2014/12/12 19:15:15 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 7.8 MB, 4839.0 KB/s
2014/12/12 19:15:16 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 12.7 MB, 12923.6 KB/s
2014/12/12 19:15:18 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 2.2 MB, 2023.2 KB/s
2014/12/12 19:15:19 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 16.4 MB, 16715.7 KB/s
2014/12/12 19:15:20 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 1.5 MB, 1444.0 KB/s
2014/12/12 19:15:21 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 12.3 MB, 12587.0 KB/s
2014/12/12 19:15:22 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 0.2 MB, 230.3 KB/s
2014/12/12 19:15:23 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 17.4 MB, 15795.1 KB/s
2014/12/12 19:15:24 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 17.8 MB, 18235.7 KB/s
2014/12/12 19:15:25 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 16.4 MB, 14608.0 KB/s
2014/12/12 19:15:26 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 18.2 MB, 18167.3 KB/s
2014/12/12 19:15:27 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 15.1 MB, 15465.1 KB/s
2014/12/12 19:15:29 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 8.2 MB, 3799.7 KB/s
2014/12/12 19:15:30 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 12.0 MB, 12226.6 KB/s
2014/12/12 19:15:31 Connection-00db7e4d/[::]:49759/127.0.0.1:56114
send 14.2 MB, 13346.1 KB/s
2014/12/12 19:15:32 PktsIn: 378089, PktsOut: 2306, BytesIn: 536702380,
BytesOut: 27672, PktsResent: 0, PktsDropped: 14382, PktsOutOfOrder:
104556

Jakob Borg

unread,
Dec 12, 2014, 11:27:28 AM12/12/14
to Vasiliy Tolstov, bronze man, golan...@googlegroups.com
Like I said, very far from stable. There is no working congestion control / flow control. Not for general use

(Sent from my phone - please excuse brevity and typos.)
> --
> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

bronze man

unread,
Dec 12, 2014, 11:53:57 AM12/12/14
to golan...@googlegroups.com, bronz...@gmail.com
https://github.com/calmh/dst is more stable than https://github.com/h2so5/utp which can not do right on a stable link.
I had tested on a stable link ,https://github.com/h2so5/utp have some unexpected EOF, https://github.com/calmh/dst do not have any errors .
Thanks for your work.It works.
Reply all
Reply to author
Forward
0 new messages