ping is a command line tool that comes with Windows and other OS's. It just sends a special message to a server of your choice (the 'ping'), and hopefully the server will send a reply ('pong') back. Then it prints how long it took. It's like the ping column in q3.
But if you haven't noticed this problem in other games, using ping might not be of any help. But you can always try.
Open a command line window and run 'ping -t google.com', or ping some reliable server close to where you live. I use the local university's web server. You can also use the ip address of a wq3 server (without the port), but whether the reply comes from the actual server machine or not will vary.
You can also ping your ISP's gateway, using the address in your router's config. Or you can ping your router to see if that is the problem.
The point is to look for timeouts, or pings that are suddenly a lot higher than the rest. I also get this kind of lag, but not as often as you seem to do.
This was probably a bit confusing, but I hope you can figure something out.