Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Oct : How reliable is this Ping/Echo app

www.cryer.info
Managed Newsgroup Archive

How reliable is this Ping/Echo app

Subject:How reliable is this Ping/Echo app
Posted by:"Tog" (someo..@microsoft.com)
Date:Fri, 14 Oct 2005 01:52:05

I want to ping point B from point A to determine if point B is reachable
and online (internet enabled).

Scenario:
Ping/echo routine in my app reports a failure to reach point B, my app
doesn't care about where or why, only that point B is unreachable.

Possible failure points and solutions:

Problem: Packet gets lost in some router along the way to point B,
meaning B is actually online, but from my app point of view it's not
reachable.

Problem: Point B is actually offline.

Problem: Point A's internet connection is down.

Problem: Point B blocks ping in firewall (this isn't really a problem
because the person who sets up the application would have to know wether
point B accepts ping or not and enable this feature based on that)

Solution: Implement a fail-safe routine where for instance the ping/echo
would have to fail 5 times in a row (each ping would be on a 30 second
interval, meaning it would have to fail for a total of 2.5 minutes)
before the app reports an actual failure, this would eliminiate a lost
packet every now and then making my app go into defcon 5 :D

Of course, this would not work if point A's internet connection is down.
To battle this it is of utmost importance that point A and B is not
connected through the same ISP because that would render point A unable
to report failure to tech person 1 if point B fails.

I've been unable to find any reliable solution to find out wether your
own computer is actually connected to internet or not using API calls etc.

So the only solution I can think of is putting up a fail safe point
which we call point C, point C is also on a different ISP than point A
and B.

If my app reports 5 failures, it would try to connect to point C, if
this fails, it could "safely" assume that point A's internet connection
is down, if point C does not fail, it would know point B has failed.

I know this isn't a 100% reliable solution, but it's the closest I can
think of. I can't imagine that creating a 100% realible application is
even possible.

Of course, to strengthen the odds even more, one could set up a second
point A on a 4th ISP, who pings/echoes the same point B, but again has a
different point C on a 5th ISP, should there be a power failure or
application crash on the first point A, the second point A would still
be running...

The number of failures and interval timers is of course configurable so
that it's possible to fine tune the app more to your own liking.

Am I heading the right direction or are there different approaches to
this that would create more reliable results?

Replies:

www.cryer.info
Managed Newsgroup Archive