The Bottleneck How much bandwith is needed?
|
The true over lag and DFLW
To make it easy, we can say lag is the delay bertween the action you do (on your pc you hit the firebutton for example) and the responding (you see your opponent get hit and die). What will happends by this (in a very simple and easy way)? Ok you hit the firebutton and and your pc (now named as client) will send some data to the host (the server). This will take some time (remember ping?). The server will check this data ( pos where you shot i.e. with the pos of the other players). If the server founds your bullet has hit an opponent it will send some data to this opponent (for make him death) and some data to you (for display the hit and die of your target). On a normal connection this data will need between 120 and 300 ms (milliseconds, 1000ms = 1) to travel from the client to server and back. We all handle with this delay in the same manner as in real life. You shot somewhere in front of your moving target so that your bullet and the target meet at same time on the same position. The internet connections for the DFLW base on the UDP protocol. That means little pieces of data (UDP-Datagrams) will be send from a sender to a receiver without any control of delievery. The bottleneck for all that is the internet connection of the server. This connection has a limited bandwith (usually measured in Bits per second bps). You can think on it as a kind of pipe, and if to much packets want go through this pipe they must wait for a free space. And this waiting time may cause some lag. Some more reasons for lag can occured too, loss of packets etc. Conclusion: Lag is the delay caused by waiting for packet to transfer. Why is the internet connection of the server the bottleneck? 1 Server , one remote player or (client) also 2 player game (non-dedicated host). S means the server, the pc which host
the game, its also player one. S =========SC1===========> C1 We see that this results in 2 connections, SC1 for the infos send from the Server(S) to the client (C1). And a connection from the client (C1) to the server (S). S means the server, the pc which host
the game, its also player one. S =========SC1===========> C1 S =========SC2===========> C2 We see that this results in 4 connections, But this is not all! The infos from C1
must send to C2 and vice versa. This happends
by sending the infos from C1 from the server
to C2 as connection C1SC2. And so the diagram for the connections look as follow:
S <========C2S============ C2 We have also 2 receiving connection and 4 sending connections for 3
players! The sending bandwith is more used as the receiving bandwith,
Or with other words, the number of sending connections is equal to n*n with n is the number of clients. S means the server, the pc which host
the game, its also player one.
S <========C2S============ C2 S <========C3S============ C3 We see that this results in 3 receiving and 9 sending connections. Remember as fact with any client comes an important increase for sending (or upload) bandwith! The number of sending connections is n*n! I try to solve this problem by the following approximations and facts: 1) I can host a game for 6 players (5 clients) over my 1 B channel
ISDN line without lag! The bandwith for the ISDN 1 B channel is theoretical 64Kbps (64000 bits per second). And i have done my calculations first on this value. That was wrong! I learned that the real bandwith of my connection is between 54 and 61 Kbps without changing anything on my side. So i think the lag i see sometimes on 7 players happends if the bandwith goes down. With the lowest value for the bandwith (54Kbps) and 6 players we must be on the sure side. With 6 players (means 5) clients we have 25 outgoing connections (remember n*n, 5*5 = 25). This 25 connection need lesser as the 54Kbps because there is never
lag. Sometimes it runs without lag for 7 players (6 clients) so i guess this happends with a good bandwith near 60Kbps. 60000 bits per second / 6*6 = 1666 bits per second. The needed (upload) bandwith must also > 1666 and < 2160 bits
per second and sending connection. So i will use the value 2000 bits per second and sending connection.
We calculate the needed bandwith with the following equation : bandwith = (n-1) * (n-1) * 2000 bit per second or the number of players you can host n = sqrt (bandwith / 2000 bps)+1
Needed bandwith for numbers of players: 6 player : (5*5) * 2000pbs = 50000 bps Or as example for a 128 Kbps line (2 B-channel or T-ADSL) n= sqrt(128 000 bps / 2000bps)+1 = sqrt (64)+1 = 8+1 = 9 player
|