[Guide] Latency, Bufferbloat and Jitter

Started by Spiller, Jan 20, 2021, 10:40 AM

Previous topic - Next topic

Spiller

Hey everyone,

I don't seem to be having a rationale to why I'm writing this, just in hopes that it might help a few people. Although a big chunk of this thread is from something I posted back in 2016 at some other community, I've tried to update it and make it relevant to VCMP.

This thread entails about basic overview of Latency, Bufferbloat & its impact and a few advices/methods that can be devised to resolve the discussed issues.



— Jibber-Jabber

I'll throw in a few definitions here to reference them in other parts. Most of you might know about them already but anyway,

(a) Bandwidth
It is the maximum rate of data transfer. It can be seen as the "width" of a pipe, the narrower the pipe, the less material can be transferred across it.

(b) Latency
It is "response speed" of your network, measured as the round trip from your game client to the server. It is measured as Ping. The higher the latency, the higher will be the delay between your client and the server or otherwise known as "Lag".

(c) Jitter
This is the measurement of how much your ping is spiking / fluctuating over an average period of time. This can be caused by an inconsistent network or high usage of bandwidth. Higher jitter results into stuttering of your packets, degrading both your and your opponent's gameplay.



— Factors affecting lag

It is a common misconception that only ping has an impact on an individual's lag, while it depends upon a number of other factors, such as jitter, bufferbloat, quality, speed, routing, yadda yadda. Let's discuss a few before we can mitigate them.

(a) Ping
This is obviously the primary factor but not the only. Higher ping means higher delay on all of your actions requiring you to lead your aim on your opponent and also harder for your opponent to hit you.

There are not a lot of ways you can reduce your base ping except changing/upgrading your connection.
(The best would moving closer to the host but it can only be assessed theoretically)

(b) Instability
This causes jitters, stuttering and UDP packets getting lost often. This might vary on strength and bandwidth of your connection.

You might be able to control your network and mildly optimize your connection but in the end its completely dependent upon the architecture of your ISP.

(c) Higher Usage
There might be unwanted processes running in the background consuming your internet such as updates. And there can be a lot of devices connected to your network leeching off bandwidth and making you lag.

(d) Routing
There is a fair chance of misconfiguration by your ISP or at the server which can lead to higher latency. However, these are often temporary.

Another case can occur where the host server is not well optimized in terms of code, there might be a lot of resource consumption due to, for instance, a large number of timers causing the server to not operate at optimum performance. Client side processes can also rupture connectivity.

(e) Speed
I would not rank it as an important factor, because most (urban) connections can meet the basic requirement. However, yes it is a factor, without adequate speed, you're only getting a minimal amount of throughput.



— Bufferbloat & Jitter

This is a factor I'd like to separately highlight in this thread.

What is bufferbloat?
Bufferbloat.net defines it as "the undesirable latency that comes from a router or other network equipment buffering too much data" i.e there are way too many packets sent and they get queued which leads to ping spikes, stuttering and packet loss.

This page right here gives a neat illustration of how data accumulates as buffer.

How do I know if I have this problem?
You can test on DSL Reports, here. Anything below B in Buffer Bloat and we are talking unhittability, which can nowhere be condoned.

Can this be fixed?
Yes, the easiest method to fix it is the rate limit method. However, you'd require a router which allows you to limit bandwidth for a specific device (or total bandwidth). Otherwise you might want to buy switches or other equipment which provide that interface.

Below is a result without capping my bandwidth:
[spoiler][/spoiler]

After I limited bandwidth for my PC
[spoiler]



[/spoiler]

A test in-game
[spoiler]

20 checks over 40 seconds, Client Response calculated with a threshold of 30ms.[/spoiler]

Lower rate, lower bloat
[spoiler][/spoiler]

Notes:
A lower rate might result into a low bloat, but you need to maintain a balance at a point where your data is getting through at just fine speed while not getting buffering your network at the same time.

You also need to limit other devices on the network otherwise its not a significant change.

Some routers already come with QoS features, you can use them instead to let the router automatically manage bloat.



— Advices to reduce lag

As I said, lag does not depend on a single factor, and there is more than just bufferbloat or ping. So here are some advices that might result into a better gameplay experience.

(a) Wired Connection
If possible, always play on an ethernet connection, it is infinitely better than WiFi, especially 2.4 Ghz band. Mobile networks have a very high packet loss, devoid them from online gaming.

Moreover, there is less bloat, with minimum limit on rate.
[spoiler][/spoiler]

(b) Disable Windows Update
Updates in background are outright annoying while gaming, your ping will spike like crazy. You can either disable updates entirely, (DO NOT DO THIS! This is incredibly stupid and a security risk! Updates are required to maintain system stability and security.) or set your network as metered in network settings (Windows 10).

* Game Mode in Windows 10 restricts background internet activity.

(c) Using a game booster
You can use a game booster such as Razer Cortex which not only optimizes your rig for maximum performance but also shuts down background processes which might be consuming internet.

If you don't want to install one, you can still manually close any background process. To find out what is consuming your internet you can use the Task Manager (Win 8+) or Resource Monitor in 7.

(d) Wireless Advices
If you still plan to choose WiFi, or can not use a wired connection, you can atleast improve your wireless connection.

Choosing the best channel
[spoiler]Your router automatically chooses a wifi channel for you to broadcast the signal on. However, it might not the best one.

To figure out which is the best one depending on other networks around you, you can use a WiFi tool such as WifiInfoView by NirSoft.

You have to select the least common channel in your area so it does not clash with any other.
[/spoiler]

Getting the best out of it
[spoiler]Make sure you have disabled power saving for your network cards in network settings.

For this, go to Network and Sharing Center > Adapter Settings > WiFi > Properties > Configure > Power Management and uncheck "Allow the computer to turn off this device"


You might also reach there from device manager.

You also need to put your WiFi cards in full performance.

For this, go to Power Options > Change Plan Settings > Change Advanced Power Settings > Wireless Adapter Settings and set it to Max Performance

[/spoiler]

(e) DNS
Your ISP provides you with a DNS which is used to look up and resolve IP addresses. However you might change to public DNS by Google or Cloudflare which are faster.

(f) Flush the Network Profile
Sometimes you need to reset your network config.

Here's how
[spoiler]Open Command Prompt as admin.
Type in the following one by one.

ipconfig /flushdns
ipconfig /registerdns
ipconfig /release
ipconfig /renew
netsh winsock reset


and restart your computer[/spoiler]

(g) Change ISP?
You might require to change your ISP if you are not getting the ping you expect to get even after doing everything you could.

You can head over to Global Ping Stats, and check for the ping from your closest source to server location. If your ping is not around the ping calculated there, its time to upgrade or change.

[spoiler][/spoiler]



     - These advices are for Windows.
     - There is only so much you can damage in your router, however, be careful.
     - If I got anything wrong or something can be improved/added, feel free to contact or correct me.


DizzasTeR

Point c, e and f in 'Advices to reduce lag' are completely unnecessary and play no role in helping your ping, don't even bother. Other than that, useful information I guess.