Jump to content
News Ticker
  • Developer applications are still open
  • Helper applications are still open
  • ba-rp.net:7777
Targus

Server ping and SA:MP for dummies

Recommended Posts

Targus

I highly recommend readers to understand these terms before going through the rest of this thread.

 

"ping" = a signal sent from one computer to another.  When a computer pings a server, the server will respond to the computer's ping with its own ping.  It cannot be used as a noun as is a verb, since ping normally goes along with an object. Examples include "I pinged this server," "the computer sent a ping to server XYZ," or "350 ms ping." The "Ping" column in the SA:MP client refers to the responding ping sent by the server to the game client.

 

Latency = the time it takes for the responding ping to be received by the computer that sent the initial ping. When using latency in a sentence, it is referred towards the quality of the connection.

 

Lag = a direct result of high latency. High latency = high ping = experiencing noticeable/large delays in viewing player/vehicle/object/text movement. Whereas, low latency = low ping = can see other player/vehicle/object/text movement clearly without any noticeable delay.

 

---------------

 

It is a norm for us to desire for a lower ping when playing on our favourite roleplay or deathmatch servers, where every player movement counts during a critical scene. If there is a delay, it may affect a player's contribution towards the whole scenario. Should the delay be extremely bad, it may have the potential to ruin the moment for other players and the player in question. Because of this, players who have bad pings resort to various (dubious?) methods involved in reducing one's ping. 

 

Q: Is it possible to reduce the latency (ping) between the SA:MP client and a server?

A: It depends on two situation.

  • The ping is bad - the computer is close to the server's location.
    • Yes, the latency can be reduced based on trial-and-error.
  • The ping is bad - the computer is NOT close to the server's location.
    • No, the latency cannot be reduced. No matter what, the ping will always be high if the distance between the computer and the server is long.

 

Q: How do I know the location of a server?

A:

  1. Get the IP address of the server.
  2. Put the IP address in a IP tracking website that provides location details, i.e., ip-tracker.org
  3. Voila! You will see the entire location details of the server within x miles radius. For this purpose, it should be accurate enough.

 

1. The ping is bad - the computer is close to the server's location.

 

This could be a tricky situation. There is never a single solution for this problem, except that every possible solution must be implemented in tracking down the cause behind the issue.

 

  • Move the computer closer to the router. To determine whether the computer is closer or far away to/from the router, there are multiple applications offered in both Android and iOS stores that allow mobile phones to determine if the signal strength at a certain area is strong enough.
  • Use an ethernet connection instead of Wi-Fi. Ethernet connection provides download/upload speed that is near the actual speed set by your ISP. There could be objects that can interfere between your computer and the Wi-Fi router, thus degrading the network quality when using Wi-Fi.
  • Close any program running on Windows you think that takes up a lot of bandwidth in downloading something. If Windows Update is running, then you can either wait for it to stop or cancel its operations temporarily. You can use a software called NetBalancer in checking all incoming/outgoing traffic on your computer.
  • Check if nobody else is using the Wi-Fi to download a large file, watch a movie on Netflix or a third party online streaming website, or do anything else that is bandwidth-hungry. The more devices connected to a network, the poorer the network quality would be. You can monitor the devices connected to the router through its administration panel/page.
  • Turn off the router and wait for a while before turning it back on. Maybe the router has overheated or the firmware in it is clogged due to not being periodically restarted.
  • Call your ISP.
  • In terms of technical solutions, readers can refer towards this website (web.archive.org link if original website is down) on various solutions and tips 'n tricks designed to improve connection speed. Another website that can be used is Riot Games' diagnosis page on improving connection speed.
  • Worst case scenario, get a new router that can deliver the speeds that you're paying your ISP for, while providing a healthy number of options and features for you to benefit from.

 

2. The ping is bad - the computer is NOT close to the server's location.

 

As defined previously, latency is referred to as the time it takes for the responding ping to be received by the computer that sent the initial ping. Suppose the location of the server is far away from where you live currently, it will take quite a while for the computer to send a ping and for the server to send a responding ping back to the computer. This situation is exactly similar to two people talking with each other.

 

 

ttsuEIV.png

Person A and Person B are close to each other. When they talk, they are able to hear each other loud and clear because the distance between them is short. Sound waves are propagated through air molecules. External factors also play a part in the clarity of the message, like noise interference/disturbance which are expected to have medium-less effect due to the short distance between both persons.

 

l5q0p6h.png

 

Person A and Person B are far away from each other. When they talk, their voice may not be clear or loud because the distance between them is long. Sound waves are propagated through air molecules. External factors also play a part in the clarity of the message, like noise interference/disturbance which are expected to have a huge effect due to the long distance between both persons.

 

The same logic applies to the latency between a computer and a server on the Internet, albeit on a more complex and technical scale.

 

 

C---x---x---x---x---x---P---x---x---x---x---x---x

|    |    |     |     |     |    |    |    |     |     |     |    |

|    |    |     |     |     |    |    |    |     |     |     |    |

|    |    |     |     |     |    |    |    |     |     |     |    |

x---x----x---x---x---x---x---x---x---S---x---x---x

C = Computer (Person A) / S = Server (Person B) / P = Proxy / x = hops/node/routers (air molecules) / | = network line/fibre / ASCII diagram credits go to this post.

 

 

Computer C (Person A) wants to communicate with Server S (Person B). C sends a message to S through the nodes (air molecules) available between C and S. The nodes are known as hops, and are basically enterprise grade routers. C determines which nodes its request should go through, and the message begins propagating along said nodes until it reaches S. Depending on the location of S, the message may have to travel through a large or short amount of nodes.

 

The more nodes a message has to travel through, the longer the response ping time would be. The amount of nodes required for the message to travel through depends if the location of S is in a different area, worst come worst in a different continent.

 

Q: If I were to use a VPN/game ping booster/proxy/x marketing name, will my ping be lower? Will the lag go away?

A: Yes, the ping will be lower. Though, there is a chance that the lag may still persist.

 

Enter P, a proxy/VPN/game booster/whatever you want to call it. C is connected to that, so all outgoing traffic are supposed to go to P, which will send the message to S. The message has to be propagated through multiple nodes in order to reach P, and then the message has to travel through another set of nodes in order to reach S. It is basically double the work of sending a request instead of doing it in one shot from C to S directly without a middleman interference.

 

Even though the responding ping would be lesser because the actual message/request is sent from the proxy server (since the SA:MP client would show the responding ping results from S to P), there is a high possibility that the combined response ping from C to S with P in between as the proxy would theoretically be more than the ping from a direct connection from C to S. Another high possibility is also the fact that the game lag may also persist in most cases. Then again, this is on a case-to-case basis depending on many factors like server network quality/bandwidth congestion/etc, network congestion for the proxy server, etc. Though, since this is SA:MP and BA:RP we are talking about, the probabilities of the aforementioned happening should be very high.

 

Though, if you still persist about having a lower ping, I recommend using mudfish.net + full VPN mode. Go and test it out, see if it lags or not.

 

---------------

 

Q: Does packet loss affect all players, irrespective of their ping?

A: Yes.

 

Packet loss can be a very tricky issue to deal with. It refers to certain data that is stored in a container (known as a "packet") which fails to reach its destination. When we talk about this game, this means that some parts of a certain data that the SA:MP client generates doesn't get sent completely to a game server the client is connected to. This is because some of these "packets" tend to get dropped/missing along the way through the network due to various reasons. For example, a player shooting and killing another player won't get registered in the server even though the player's ping is stable at 75 ms~. Here is a perfect video example of the described issue.

 

SA:MP uses the UDP protocol for transmitting data, which has a higher risk of having packet loss compared to TCP transmission (this doesn't mean that TCP > UDP, though this is for another topic to be talked upon in another day). Packet loss is normally caused by three factors:

  1. Network/Bandwidth congestion [core]
  2. High latency
  3. Network connectivity
  4. Damaged hardware
  5. Server performance
  6. Software issues

 

1. Network/Bandwidth Congestion

 

Sometimes, the ISP's network can be congested in a certain air. In other words, a lot of people are using the Internet bandwidth allocated in a certain region and thus the data packets sent will take a while to reach the game server. Bandwidth is referred to the amount of internet traffic that a network connection can handle at a certain time. Besides bandwidth allocation in a certain region, overusing the allocated bandwidth for a subscribed data plan can also lead towards packet loss, where ISPs automatically restrict certain data from passing through in an effort to get the customers to pay for top-ups for their bandwidth or subscribe for a new plan. It is advised to call the ISP first if packet loss is being experienced, so that you can know if the Internet in your area is being congested or if it is just you.

 

2. High latency

 

If there is a high ping when connecting to a server, the slower network can cause difficulties in delivering data packets towards the server in a consistent manner. This is extremely crucial towards situations where a large amount of movement is required, i.e., shootouts, cop car chases, etc.

 

3. Network connectivity

 

Network connectivity can also play a big issue at times. Using Wi-FI can also lead to packet loss at times, because the wireless transmission can drop some packets due to interference/blocking from certain objects. It is highly recommended to use Ethernet connectivity over Wi-Fi if having a top-notch network is given special priority.

 

4. Damaged/Old hardware

 

This is related to processing and sending the data packets from the server to the client, and/or vice versa. For example, the network card in a server can be damaged. This prevents the card from processing and sending/receiving complete data packets. Instead, it will send malformed (incomplete) data packets that can affect the user experience in a server. Besides that, certain hardware parts of a server may be old or outdated. This means that these parts are not able to handle large amounts of data in an more efficient manner, in accordance with today's standards.

 

5. Server performance

 

Sometimes, the server performance can also lead to packet loss. Heavy usage of server resources (CPU/RAM) hinders the server's ability to receive/send complete data packets. Indirect causes include unoptimized scripts.

 

6. Software issues

 

Inefficient coding within the SA:MP client/server's source code can also lead to unnecessary packet loss. This is relevant to improper development of the networking aspect of SA:MP's core libraries.

 

---------------

 

That's all for this guide, thank you for reading it! If you do not understand a certain part or require clarification, feel free to reply in this thread or send me a private message. Please do not hesitate to leave feedback or criticism, along with pointing out on any mistakes that I may have potentially done.

 

Edited by Targus
Packet loss explanation included
  • Like 4

Share this post


Link to post
Share on other sites
Giga

Seems neat. I would suggest discussing packet loss as well, as it is a term that is actually vital to connections yet not a lot of people understands what it means. Just because one has a high (or "bad") ping does not mean they are "laggers", packet loss should also be taken note.

Share this post


Link to post
Share on other sites
west.
5 minutes ago, Giga said:

Seems neat. I would suggest discussing packet loss as well, as it is a term that is actually vital to connections yet not a lot of people understands what it means. Just because one has a high (or "bad") ping does not mean they are "laggers", packet loss should also be taken note.

What he said. Good job, gonna try and understand as much as possible.

Share this post


Link to post
Share on other sites
Targus
3 minutes ago, Giga said:

Seems neat. I would suggest discussing packet loss as well, as it is a term that is actually vital to connections yet no one understand what it means. Just because one has a high (or "bad") ping does not mean they are horrible "laggers". People should also take note of their packet loss as well.

 

I actually intended to discuss about packet loss, not sure how I forgot to explain about that. Will be included in the next revision, thanks!

Share this post


Link to post
Share on other sites
goldencandy610

Very nice job my man. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×