Technical Questions - Understanding lag and lagometer

What is LAG, how to use the lagometer?
The lagometer is a tool provided to diagnose the condition of your connection, and to let you know when things are proceeding normally and when they are not. The following is a brief explanation in text and pictures of what the lagometer does and what it indicates.
First, you need to turn it on. In the console, type:
cg_lagometer 1
When you close the console, you should see this:
This is a one-quarter-size shot of my screen at 1024 x 768. The inset is the lagometer rendered full-size as it appears to me in-game.
"Very nice," you say, "but what the heck am I looking at, and what does it mean?"
Glad you asked! The lagometer is a graphical representation of the interaction between the server and your "client," which is the game running on your computer.
The server "serves" data representing the "gamestate" (the "world" that the server is simulating mathematically) by sending it to all clients (every player connected to the server) simultaneously 20 times per second (every 50 milliseconds). These "snapshots" (as they are officially known) are then "rendered" by your client and its video system to display the part of the gameworld and its events which are visible to you from your gameworld viewpoint.
Of course, despite the fact that every client gets a gamestate snapshot for the entire gameworld 20 times a second, your client only needs to render the part of the world it can logically "see." The other data is there, but not rendered (except in the case of cheating, which is why it is possible to "see through walls," etc. with cheats.)
But if the snapshots are coming in only 20 times a second, and your client is rendering many more frames per second (typically about 80, or 4 times the snapshot rate), where does the information for the extra frames come from? Clearly, the client is not rendering each snapshot 4 times, since that would make a very choppy "slideshow" kind of presentation. Instead, each client calculates and "interpolates" its own data between the "real" data contained in successive snapshots, and renders these "interpolated" frames so you get a smooth animation of moving objects (primarily other players) in the game.
This system works out pretty well, since it is reasonable to assume that if a player is moving due north in 2 successive snapshots that his position will follow a smooth linear progression in the interpolated frames.
When you look at the lagometer display, you see that it is divided horizontally by a dashed white line, like the one painted on a highway where it is okay to pass. This is the divider between the upper "your client's rendered frames" area, and the lower "snapshots your client got from the server" area. (comment by BoonDock: this devider is not exisiting in ET!)
The display above the white lines advances one pixel for every frame your client renders. The lower display advances one pixel for each snapshot that your client receives. This is why the upper display always moves faster than the lower one.
Below is a series of lagometer screenshots from my client connected to the AWITS server. (or ET) Let's examine them in detail to see what information they contain:
Number 1 is a normal, stable lagometer display, with a narrow, flat green line at the bottom, which reflects a fairly low (50) and stable ping. The upper blue line has only a tiny bit of yellow in it. Yellow above the blue line is undesirable, since these are frames that are extrapolated by your client, which means that it is making a kind of educated guess about where moving objects are, in the absence of "real" snapshot data from the server.
Number 2 contains many yellow triangles above the blue, but there is still blue in between them. The blue indicates frames that are interpolated between valid snapshots, but the yellow means that the client is extrapolating outside of valid snapshot data. The height of the yellow indicates the time since the last valid snapshot, which is why triangles form. The longer the time without a valid snapshot, the higher the yellow line, until valid snapshot data is again rendered and the yellow suddenly disappears. When this happens, the client will put players back where the server says they should be, which may not be where the client had extrapolated their movements. The game would appear choppy as the cycle of extrapolate/correct/extrapolate/correct continued.
Number 3 shows a large yellow triangle forming at the edge of the lagometer. As time passes without a valid snapshot having been rendered, the height of the triangle grows accordingly. This is a graphic representation of the phenomenon of lag. Note that there are spikes in the green, showing that the client's ping is momentarily climbing.
Number 4 shows red spikes, which mean that snapshots have been dropped by the network, either in transmission (packet loss) or because the client can't handle them (cpu tied up by other tasks, like taking repeated screenshots.) CoD and all Quake-engine games use UDP packets because they are fast and easy to handle, but they have no retransmission or error-correction capability. The server sends them and forgets about them. Once lost, they are lost for good. Red spikes like these occur from time to time, and occasional red spikes are not necessarily bad unless they are wide (each pixel in width is one snapshot lost) or frequent. During DoS attacks on our host, the lagometer will show almost solid red. (Red spikes will always be this height. There is no meaning associated with the height, which is purely arbitrary.)
Number 5 shows a big yellow triangle, which would manifest in-game as a brief freeze, followed by players "teleporting" to nearby locations as the client gets correct information from the server. Remember, any yellow means the client is trying to guess where players should be in the absence of proper information from the server.
Number 6 shows a long string of connected yellow. With no blue in sight, any movement by the player will result in the "skating" or "rubber-band" effect, where the player is "snapped back" to where the server last put him. This shot is not really typical of that effect, since it was the result of taking many back-to-back screenshots. When this happens spontaneously in the game, a triangle will form that grows to the top of the lagometer, so what you really see is a yellow bar all the way to the top.
Remember, the only thing that is "really" happening in-game is what the server is calculating. If the server cannot get this information to the client, the client will render a guess about what is going on. Since players move at about 10 feet per second in the game, one missed snapshot can make a difference of 6 inches in location.
Four missed snapshots (one-fifth of a second in duration) can make a difference of two feet! This is why your client sometimes appears to show a sure hit, but the server may register a clean miss. Playing with the lagometer on can help you understand what is "really" going on in the game.
The Lagometer tutorial above is © 2004 by wadiano productions. It's written by Ron "Pair O' Noyas" Reposh, and was originally posted at http://awits.com/Community. All Images and trademarks are property of Activision.
Is there a cure against LAG?
Yep.. most of the time there sure is, but the cure depends on what information the lagometer shows.
If you get green spikes, or the server wont let you connect because your ping is to high try to:
1 Stop all applications that uses the internet, such as Internet browsers, downloads, ICQ, Teamspeak, skype ect.
2. If you are using a shared internet connection, step one applies to ALL the computers on the connection. Brother, Sister, mom, dad or neighbor I don't care. How to stop them is your problem
3. Scan your computer for spy ware & Virus, sometimes these buggers eat alot of bandwidth. I prefer to use Spybot SD to get rid of the spy ware, but you can use whatever you like. remember to update your virus killer and do a full system scan as well, When the scan is complete, reboot your computer.
If you get yellow spikes, you should try to:
1. Lower your graphic settings in the game, such as Video Mode, Character textures, General textures texture filter.
But I just bought this x-brand display adaptor with 3.6GB DDR ram and dual 4.7Ghz processors?
I don't care, lower your settings.. If the problem is solved, you can gradually increase the settings step by step until the problem re-occur. Another good idea could be to update the driver for your display adaptor, chipset, BIOS etc.
2. lower your sound settings.