Lowest Latency small size data Internet transfer protocol? c#

前端 未结 3 851
梦毁少年i
梦毁少年i 2021-01-22 08:59

I am doing a Internet Gaming project which involving keeping sending small size of data (between 1K to 50K) over the Internet between two normal home PCs. The key I care about i

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-22 09:18

    A TCP header is 32 bytes, while a UDP header is only 16 bytes. In addition, since UDP lacks flow control there will never be a case where the client asks the server to slow down. UDP is almost definitely going to be the fastest. An ICMP packet has a header that is 20 bytes, and is probably going to be slightly slower than UDP.

    My official recommendation is to use UDP, with some "dropped packet" detection at the receiving end. This is how all of the Quake games and all of the Half-Life/Source games work.

    On the topic of pinging between UK and Japan, the latency is going to be near identical for any protocol used. Most of that is dictated by the speed of light and the congestion of the edge-routers.

提交回复
热议问题