Knifing a sniper is not a good idea. It's the standard approach of many people, but it is bad for the snipe hunter. The other snipers will see that a sniper got knifed, scope in on that position, and take a shot at you. It's better to use explosives on a sniper. Grenades, satchell charges or RPGs will cause a loud boom in their headphones, and then they turn down the volume. That makes your next approach easier. A mean trick is to drop a claymore at the center of their body, take a few steps back and fire your pistol. The sniper jumps at the sound, and triggers the claymore. Always good for a laugh or two.
Counter sniping is not a way to end up in first place at the end of the game, but the rush of stopping the opponent's snipers is more than worth it. As you get closer to the sniper, and then drop a satchel charge on them, pull back to a safe viewing distance, detonate and watch the explosion surround them, it gives you the satisfaction of knowing that one more sniper is going to be stuck in the morph for a while.