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

UDP based transport #90

Open
lni opened this issue Jul 23, 2019 · 4 comments
Open

UDP based transport #90

lni opened this issue Jul 23, 2019 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@lni
Copy link
Owner

lni commented Jul 23, 2019

Dragonboat currently uses TCP based transport for exchanging Raft messages between NodeHost instances. Such strictly ordered reliable transport is not actually required.

The existing TCP based transport is pretty straight forward, it is implemented in a single .go file with only a couple hundred lines of code -
https://github.com/lni/dragonboat/blob/master/internal/transport/tcp.go

It will be very interesting to experiment whether UDP can be somehow used to achieve better performance. It might be done by using the UDP support in Go's stdlib or build on top of some 3rd party libraries/protocols, e.g. quic-go without HTTP/3.

Note that I've tried the UDP based kcp-go, sadly I failed to get higher bandwidth or lower latency.

@lni lni added enhancement New feature or request help wanted Extra attention is needed labels Jul 23, 2019
@lni lni changed the title UDP based transport layer UDP based transport Jul 23, 2019
@lni
Copy link
Owner Author

lni commented Jul 30, 2019

some guic-go benchmark results generated by github.com/marten-seemann/quic-go-benchmarks

Benchmark results:
+-----------------+-------------+-------------+
|                 |     TCP     |    QUIC     |
+-----------------+-------------+-------------+
| direct transfer | 0.01 ± 0.00 | 0.19 ± 0.01 |
| 5ms RTT         | 0.05 ± 0.00 | 0.17 ± 0.02 |
| 10ms RTT        | 0.09 ± 0.00 | 0.21 ± 0.04 |
| 25ms RTT        | 0.22 ± 0.01 | 0.32 ± 0.00 |
| 50ms RTT        | 0.44 ± 0.00 | 0.64 ± 0.01 |
| 100ms RTT       | 0.84 ± 0.00 | 1.31 ± 0.00 |
+-----------------+-------------+-------------+
Based on 3 samples (10 MB).

@vtolstov
Copy link

vtolstov commented Aug 9, 2019

can you compare also kcp ? and what implementation of go-kcp used?

@coufalja
Copy link
Contributor

I have a working Impl using https://github.com/lucas-clemente/quic-go (based on existing TCP implementation) do you fancy me doing a PR (I have no numbers yet to confirm if it really is or isn't in any way faster)? Should I add the impl under the plugins folder?

@lni
Copy link
Owner Author

lni commented Apr 28, 2021

@coufalja that sounds interesting

any quick benchmark data on such quic based transport? I looked into that quic go package in 2019 and the RTT latency was not on par with TCP, see the quic-go-benchmark results posted above. wondering anything changed in the last two years.

for the PR, yes, please put it in the plugin folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants