Here's a simple way to get a window (borrowed from TCP):
When receiving
new_connection_quality = old_connection_quality*X + current_measurement * (1-X)
current_measurement is 1 (packet successfully transfered) or 0 (packet dropped).
TCP uses 0.8 for X.
The connection_quality gets initialized with 1 (good).
Since a disconnect is stronger than the "reduce" of TCP, I'd suggest using 0.9 for X and disconnecting when the connection quality drops below 0.3 (I added simulation code to SVN; needs pyxplot so i attached an image of the algo in operation).
These settings disconnect people who have an average drop rate of 30% when they have a burst of drops, anything below is fine. 60% drop rate gets dropped quickly.
The attached images are
- 30% drop rate with X = 0.9
- 60% drop rate with X = 0.9
- 10% drop rate with X = 0.9 |