Whenever I access Team Fortress 2 and play on ANY server, I get very unplayable lag. I even used command prompt's ping command to determine if my network connection was causing a problem, and I found out that playing Team Fortress 2 while on server actually prevented proper pinging, resulting in large latency times and packet loss. As such, web pages take long times to load and usually hang on the "requesting" part.
What I Have Done:
I can determine that Team Fortress 2 is the only program that causes this problem, because other Steam applications (Altitude), Source Games (Garrys Mod, Counter Strike: Source) do not cause this problem.
I tested for a program to internet conflict by running Team Fortress 2 on another computer on the network, which Team Fortress 2 ran without any noticable lag. This rules out internet problems.
I have defragmented TF2 using Steam, uninstalled and reinstalled TF2, and removed all personal files from the /team fortress 2/tf folder, with no change in performance.
I recently used programs such as Ad-Aware and PeerBlock, but have uninstalled PeerBlock and Ad-Aware had not caused any apparent problems, even when it was turned off.
I have used netsh in the command prompt to clear the Winsock catalog, but does not help this problem.
I have disabled Windows Firewall and ran TF2, with no change.
TF2 has a "Rate" command to tweak bandwidth. Being that it's an FPS game, it uses UDP which means it has no congestion control. If your rate is set too high, the game will attempt to send more data than your pipe can handle.
I have the same problem as you describe. I'll save you the background information but after several re-installs of Win7, Steam and TF2 it's clear there's a software conflict. I worked with Valve for awhile on the issue and they thought the same.
After my most recent install of Win7 I played several rounds of TF2 without issue. As time passed I reinstalled a flood of my regular programs and unfortunately I stopped playing TF2 for awhile. The point being after installing something TF2 again began to become unplayable just as you've described.
I can tell you it's not my AV or a firewall issue. Nor is it related to the network. It's likely going to take ages for me to discover the root cause. If you're still following this thread I thought we could work together. With that in mind are you using any of the following:
Haali Media Splitter
Newsbin Pro v6
Koepi's Xvid Video Codec.
If you say no to the above I'll make a complete list of that which is installed on my system and see if we can find some similarities.