Lag

From GT New Horizons
Revision as of 17:04, 7 August 2023 by Boubou19 (talk | contribs) (add the ping section)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Lag is something everyone has experienced in minecraft. This page will help you to understand it better and to diagnose it.

Here is a breakdown in possible sources of lag:

  • bad ping
  • packet loss
  • CPU load (TPS)
  • bugs in mods

Ping issues

Ping is a metric giving info about how long it takes for a network packet to go from your computer to the server, or vice versa. It is expressed in miliseconds (ms), and the lower it is, the faster it is to talk with the server. (or you are getting closer if the propagating medium didn't change).

Before digging more into networking stuff, let's talk about how is structured internet as a whole. It's mainly composed of:

  • routers (or nodes)
  • endpoints (servers or clients)
  • connections between all those equipments (or links). The place where you plug a link to a router or an endpoint is called an interface.

A sub network of internet with the same policy for routing is called an Autonomous System (AS).

A ping measure follows these steps:

  1. measuring the time just before sending a "hello" packet
  2. sending a "hello" packet to the server
  3. waiting for a "hello" packet from the server
  4. measuring the time at the arrival of the packet
  5. computing the delta and dividing it by 2 (because of the round trip)

Inside a router, here are the following source of delays

  1. delay of arrival (time of propagation through the medium in the input link)
  2. delay of buffering in the input buffer (fixed by hardware)
  3. delay of processing (influenced by the global load of the router, such as other services or other interfaces being busy too)
  4. delay of buffering in the output buffer (fixed by hardware)
  5. delay of departure (time of propagation through the medium in the output link)

Also, a router is supposed to find the fastest path for routing your packets. For that, some routing algorithms are used, and usually, the route with the least amount of hops is prefered (a hop is a jump to one node to another). The issue is that between 2 AS, there can be what is called an administrative distance. It's simply a faked metric for routing algorithms, and it can impact greatly the routing. It is done by companies or governments for various reasons. Due to that, the fastest route will sometimes appear as the slowest route, causing your traffic to go through a longer route, increasing your ping.

There is also the fact that routers can sometimes become unavailiable (broken link, overloaded router, power failure, etc). When a router did not contacted its neighbors after some times, the neighboors will remove the faulty router from their routing table, which causes your route to be deviated.

To sum thing up, your route is evolving over time, and can be impacted, independantly from you, the server, or your ISP.

Packet loss issues

CPU load issues

bug in mods