Detecting the state of the network