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

Can integrated KCP protocol? #97

Closed
andyhebear opened this issue Sep 13, 2017 · 6 comments
Closed

Can integrated KCP protocol? #97

andyhebear opened this issue Sep 13, 2017 · 6 comments

Comments

@andyhebear
Copy link

Can integrated KCP protocol?
KCP - A Fast and Reliable ARQ Protocol for mobile client
c: https://github.com/skywind3000/kcp
csharp: https://github.com/limpo1989/kcp-csharp

@RevenantX
Copy link
Owner

Hi! Why you need this if there already exists C# implementation?

@andyhebear
Copy link
Author

andyhebear commented Sep 15, 2017

A network library wants to include different solutions that can be applied between the server and the server, or between the client and the client. like p2p with mobile 4g zhe KCP protocol is better , and in model with client->server or server->client use other ARQ protocol is better.

@andyhebear
Copy link
Author

andyhebear commented Sep 15, 2017

The KCP protocol has only two source files, ikcp.h and ikcp.c, which can be easily integrated into the user's own protocol stack. You may realize a P2P, or a UDP based protocol, and the lack of a comprehensive and reliable ARQ protocol, then simply copy the two files to the existing project, a written two lines of code, you can use.
some has do evaluating:

ASIO-KCP has good performace in wifi and phone network(3G, 4G).
The kcp is the first choice for realtime pvp game.
The lag is less than 1 second when network lag happen. 3 times better than enet when lag happen.
The enet is a good choice if your game allow 2 second lag.
UDT is a bad idea. It always sink into badly situation of more than serval seconds lag. And the recovery is not expected.
enet has the problem of lack of doc. And it has lots of functions that you may intrest.
kcp's doc is chinese. Good thing is the function detail which is writen in code is english. And you can use asio_kcp which is a good wrap.
The kcp is a simple thing. You will write more code if you want more feature.
UDT has a perfect doc. UDT may has more bug than others as I feeling.

@RevenantX
Copy link
Owner

@andyhebear maybe better will be create some benchmark to compare LitenetLib and KCP?

@andyhebear
Copy link
Author

andyhebear commented Sep 15, 2017

@sgf
Copy link

sgf commented Aug 1, 2020

Hi! Why you need this if there already exists C# implementation?

The advantage of KCP is not only reliable transmission, the most important thing is to reduce network delay and jitter. Especially in the long distance (physically) all over the world, it has better performance in the environment of high packet loss rate.

The following is the comparison result with raknet and TCP protocol in terms of delay time:
image

Of course, it does not manage connections, nor does it handle UDP. It is just an intermediate layer. If compared with this repo,the current project is more specific,more powerful.

If the current project wants to reduce the delay, you can refer to it.Otherwise, ignore it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants