Testing to find out if a cable or DSL modem is online or not

Marcus Brubaker marcus.brubaker-H217xnMUJC0sA/PxXw9srA at public.gmane.org
Fri Apr 30 19:45:24 UTC 2004


On Fri, 2004-04-30 at 13:48, Kerry Panchoo wrote:
> heres the current scenario:
> 
> within our application we see can see if one of our machines hast 
> checked in, we now have to determine the problem- it could be one of two 
> things:
> - The machine has stopped functioning
> - The internet at the location is down and the machine is still in 
> operation but cannot connect to our server
> 
> so we need to determine what the problem is. A ping with a pong only 
> tells you that the internet is fine and the machine is still in operation.
> 
> On the other hand a ping with no reply would not tell you where the 
> problem is. If i could determine if the cable modem is running, then i 
> know that our machine has gone down etc. If there is no response from 
> the cable modem then I know that there is an internet problem OR it may 
> be unplugged etc.
> 
> I did a search online and found stuff on how to DOS a cable modem haha; 
> not exactly what i was looking for.

I think the ping failure may be different depending on whether the
machine is down, at least in terms of power.  For instance if the
machine is powered down it should return "Destination host unreachable"
whereas if the machine is powered up but ignoring ICMP packets (e.g. it
froze) then the pings will (probably) simply time out.  If you're using
a newer cable modem and its connected to the machine via USB this is
likely what will happen as well.  There may even be some magic you can
do with the MAC address.

You could also check the status of the various hops to the host,
particularly those close to the host.  If those are unresponsive then
there is almost certainly a connection problem.  Plus, with the
exception of trouble with the modem itself or local line problems, it's
doubtful that there would be connection interruptions without one of the
gateways being down.  In other words, assuming the cable modem is ok and
there are no local line problems, the internet connection is down if and
only if its closest gateway is also down.

Also, unless the IP is static, you'd probably need to do some kind of
fingerprinting on successful pings in case the machine lost its IP
address and a different machine took the old IP.

You should dig through something like TCP/IP Illustrated for other
ideas.

Regards,
-- 
Marcus Brubaker <marcus.brubaker-H217xnMUJC0sA/PxXw9srA at public.gmane.org>

--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list