Improve Wi-Fi hand-off

When Wi-fi connects at L2 layer, the beacons reach and the device
can maintain a connection to the access point, but the application
connectivity can be flaky (due to bigger packet size exchange).

We now use Watchdog to monitor the quality of the last hop on
Wi-Fi using signal strength and ARP connectivity as indicators
to decide if the link is good enough to switch to Wi-Fi as the uplink.

ARP pings are useful for link validation but can still get through
when the application traffic fails to go through and thus not best indicator
real packet loss since they are tiny packets (28 bytes) and have
much low chance of packet corruption than the regular data
packets.

Signal strength and ARP used together ends up working well in tests.
The goal is to switch to Wi-Fi after validating ARP transfer
and RSSI and then switching out of Wi-Fi when we hit a low
signal strength threshold and waiting until the signal strength
improves and validating ARP transfer.

Change-Id: Ica593291ec7772da892f03cf45b649635b730c47
This commit is contained in:
Irfan Sheriff
2012-01-27 21:00:19 -08:00
parent 5b04a4566f
commit b9f329f633

View File

@@ -77,7 +77,9 @@ public class NetworkInfo implements Parcelable {
/** Attempt to connect failed. */ /** Attempt to connect failed. */
FAILED, FAILED,
/** Access to this network is blocked. */ /** Access to this network is blocked. */
BLOCKED BLOCKED,
/** Link has poor connectivity. */
VERIFYING_POOR_LINK
} }
/** /**
@@ -94,6 +96,7 @@ public class NetworkInfo implements Parcelable {
stateMap.put(DetailedState.CONNECTING, State.CONNECTING); stateMap.put(DetailedState.CONNECTING, State.CONNECTING);
stateMap.put(DetailedState.AUTHENTICATING, State.CONNECTING); stateMap.put(DetailedState.AUTHENTICATING, State.CONNECTING);
stateMap.put(DetailedState.OBTAINING_IPADDR, State.CONNECTING); stateMap.put(DetailedState.OBTAINING_IPADDR, State.CONNECTING);
stateMap.put(DetailedState.VERIFYING_POOR_LINK, State.CONNECTING);
stateMap.put(DetailedState.CONNECTED, State.CONNECTED); stateMap.put(DetailedState.CONNECTED, State.CONNECTED);
stateMap.put(DetailedState.SUSPENDED, State.SUSPENDED); stateMap.put(DetailedState.SUSPENDED, State.SUSPENDED);
stateMap.put(DetailedState.DISCONNECTING, State.DISCONNECTING); stateMap.put(DetailedState.DISCONNECTING, State.DISCONNECTING);