test ip is valid or not