Number of Packets & Fairness
This goes for network connections, GPU speed, mouse responsiveness, player skill, ...
That being said, I think "choking" the connection is the wrong answer. If the connection can't keep up, then it can't keep up, and you'd better tell the player what the problem is and then drop the connection.
But I still have to keep track of the number of packets a client sends each second, right? So that noone sends more than he should. Of course the client will try to send only 30 packets per second ( when using my client ), but you can never trust them. And a problem with that is, that it's hard to say he is allowed exactly 30 packets per second, because the slight time differences in sending packets may lead to sending 29 ( or even less ) or 31 ( or even more ) packets per second. Is this the right understanding?
Thank you for your answer, really appreciated!
I presume that your packets contain time-stamped input commands. If the client sends more packets, it will just replace whatever the previous commands were for the given time-step.
If someone is sending packets at a slightly higher rate than others, I don't see it as a big deal. Some people are on min-spec machines on dialup, other people have high-spec machines with Google Fiber. A well-written game will have fairly consistent communication patterns.
But let's imagine for some game a typical player sends around 10-20 updates per second. This is the same rate for everyone, and it is pretty steady across a large number of games. Suddenly you note one network client is sending 80 or 100 updates per second. I might not do anything differently, but if I did, I would consider it potentially a cheater or an indirect attack on the server.
I would consider it potentially a cheater or an indirect attack on the server.
Or, perhaps even more likely, a bug in your clock/timing implementation that only manifests on certain laptops with certain CPUs and chipsets.
Not that I would know anything about any specifics... (cough)
But in any event, minor variations in traffic are probably nothing. Major variations can be flagged and investigated if someone has the time and inclination.
The server should validate the commands the players send. If they move a distance farther than what they are allow to, then the cheat detection alarm goes off. A lower spec machine/connection might send fewer packets and command count, but those commands should reflect the full movement the player is seeing on their client (and pressing the buttons for) ---- one guy sends single move steps in more packets, and the slow machine guy perhaps sends 2 steps per packet and half as many packets within the same time interval. The players both then update with effectively the same world map speed..