Network connectivity detection