network connection detection

detect if connected to a network.