Increase RA default lifetime.
Currently we have 300s..600s RA interval, so ~450 seconds,
and a 6 * 600s, ie. 3600s (1h) lifetime.
This means on average about 8 RAs during the lifetime.
APF's FRACTION_OF_LIFETIME_TO_FILTER is 6, so the first
3600s / 6 = 600s of RAs are filtered out by a hotspot client
Android device. This means we really only get 3600s - 600s = 3000s
worth of RAs (after the initial one).
Hence, the client will get approximately 3000s / 450s = 6.666 RAs.
Thus, assuming a clientside DTIM multiplier of just 2, the client
phone only needs to fail a 50/50 coin toss 6 times in a row to
lose all 6 of those RAs.
That's a 1 in 2**6 = 64 chance, and it gets rerolled every ~450s.
Per https://www.codechef.com/wiki/tutorial-expectation
expected number of coin flips for getting N consecutive heads is:
2**(N+1) - 2
N=6 --> 2**7-2 = 126
126 * ~450s = 56700s = 15.75h
This means failure is expected roughly on the order of 16 hours.
By doubling the lifetime from 1h to 2h, we effectively double
the number of RAs, and lower the failure chance from 1 in 2**6,
to 1 in 2**13, which is 1 in 8K and thus much less failure prone.
N=13 -> 2**14-2 = 16382 --> failure expected after ~85 days
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I70db3096db5666bca0c248f2d49f801f333514b3
1 file changed