Lag: Difference between revisions

1,818 bytes added ,  11 months ago
added packet loss issues section
(add the ping section)
 
(added packet loss issues section)
Line 38:
 
== Packet loss issues ==
To convey your network packets over internet, there are two big protocols encapsulating your data: TCP and UDP. TCP is used when an application must transmit data with integrity (packet ordering, reemision of lost packets, etc), and UDP is used when an application must transmit data as fast as possible (streaming for instance). Minecraft uses TCP, because the game requires to process correct information and in the correct order to synchronise the client with the server.
 
 
A packet can be lost because of external reasons (router going down, etc), but also on purpose by the routers. In networking, equipments must be as fast as possible, so this translates into doing the least work possible. If the input buffer or the output buffer is full but a packet is incomming, instead of waiting, or asking for a resend of the packet to the previous router, the router will do the least work possible, which is trashing the packet. The integrity checks are delegated to client and server.
 
 
Packet loss does not impact your ping per se, but a too high rate of packet loss will cause you to feel a bigger latency than what the ping displays. And this is normal. Let's assume a ping to a server of 50 ms. The client initiate a TCP connection with the server, and start sending data to the server. After each block of data sent, the client will ask if the server got them, if not, the client reemit the packet, and ask again if the server got it. The client will keep emiting the packet until the server tells the client it got it. But each time, the data took 50 ms to be transmitted, so the higher is the amount of reemission, the bigger will be the difference between the latency displayed by the ping and the perceived latency in game.
 
 
In short, packet loss can increase your latency, no matter how good your ping is.
 
== CPU load issues ==