Detecting network status