logo       

Re: multicast ping: msg#00033

java.javagroups.general

Subject: Re: multicast ping

Note that InetAddress.isReachable() may or may not use ICMP, on Windows
(SUN's JDK 5), it tries to connect via *TCP* to the echo service (port 9
IIRC) !! So this is basically unusable.

Robert Bowen wrote:
> Well, in my case if the service isn't running I simply return a
> "false" and keep looking for another machine. If after 3 tries I can't
> find one (or of there are less than 3 machines) it just dies.
>
> The problem I am seeing is that since I can't depend on all machines
> having 124.0.0.1 open, and even if they do, I can't install a listener
> program on them. So it looks like I'll have to either use ICMP or a
> simple INetAddress.isReachable() program. But in both cases it would
> have to be multi-threaded I suppose. That way I can wake up all the
> threads that run this program at the same time and grab the ip (or id
> or whatever) of the thread that comes back the quickest ...
>
> This is getting complicated! And to think, I thought it was a simple
> matter of PINGing ...
>
> Bob
>
> ----- Original Message ----
> From: Bela Ban <belaban@xxxxxxxxx>
> To: Robert Bowen <syg6@xxxxxxxxx>
> Cc: javagroups-users@xxxxxxxxxxxxxxxxxxxxx
> Sent: Wednesday, September 13, 2006 2:12:32 PM
> Subject: Re: [javagroups-users] multicast ping
>
> 224.0.0.1/2 are IANA defined addresses, for multicast discovery. But
> most hosts discard packets anyway. Yes, if you know you have a service
> running, you can of course probe its port, e.g. 8080 for JBoss. But what
> if you service (e.g. echo service on port 9) is not running ?
>
> Robert Bowen wrote:
> > Hmmm. I don't know much about ICMP. Would you mind elaborating a bit
> > on what you mean by "use ICMP"? I did find a Java implementation of it
> > over at koders.com, but I'm still poking around ...
> >
> > I read in the java forums that it probably makes more sense to query a
> > particular service on a machine rather than try to send a PING. After
> > all, if the machine is up but Tomcat or our servlet is down, it's of
> > no use to the app.
> >
> > But regardless, if I want to send a multicast message, using Java's
> > MulticastSocket or JGroups, the machines have to have port 124.0.0.1
> > open and some kind of Multicast client listening, otherwise they won't
> > get the message, correct?
> >
> > Is there no way to define an Array (or Vector, like JGroups) of ips
> > and send a multicast message to all of them, *without* them having a
> > client running? If I were able to create a Java class that sends an
> > ICMP message to each ip in my list (assuming each machine responds to
> > ICMP) that would be the way to go, no? The "client" on each machine
> > would be an ICMP listener.
> >
> > Perhaps I can make this a requirement, that all machines that want be
> > be clients have to listen for ICMP packets. I have to look into this
> > some more ...
> >
> > Many thanks!
> > Bob
> >
> > ----- Original Message ----
> > From: Bela Ban <belaban@xxxxxxxxx>
> > To: Robert Bowen <syg6@xxxxxxxxx>
> > Cc: javagroups-users@xxxxxxxxxxxxxxxxxxxxx
> > Sent: Wednesday, September 13, 2006 12:38:45 PM
> > Subject: Re: [javagroups-users] multicast ping
> >
> > I think your only hope then is to use ICMP. However, machines are not
> > obliged to respond to ICMP. The official ping address for hosts is
> > 224.0.0.1 and for routers 224.0.0.2 IIRC.
> >
> > Robert Bowen wrote:
> > > Thanks for your responses. There's a little detail I left out of my
> > > last email (because I didn't know it ...) -- these machines that I
> > > want to PING are *not* ours. They are machines that our app will send
> > > requests to but we don't have any control over them. Which means I
> > > can't put a JGroups client on each machine that listens for PINGs and
> > > responds.
> > >
> > > So I guess I am stuck with Bela's recommendation, to make some "simple
> > > multicasting code", without JGroups, because the other recommendations
> > > -- using MessageDispatcher.castMessage() or using JGroups with
> > > bare-bones.xml -- both require a JGroups client listening on each
> > machine.
> > >
> > > So I guess I'll just start searching for plain-old java.net code. :(
> > >
> > > This is the second time I've tried to work JGroups into this project
> > > and each time, because of project specs, we haven't used it. Bummer.
> > >
> > > Thanks,
> > > Bob
> > >
> > > ----- Original Message ----
> > > From: Bela Ban <belaban@xxxxxxxxx>
> > > To: Robert Bowen <syg6@xxxxxxxxx>
> > > Cc: javagroups-users@xxxxxxxxxxxxxxxxxxxxx
> > > Sent: Tuesday, September 12, 2006 10:10:41 PM
> > > Subject: Re: [javagroups-users] multicast ping
> > >
> > > You could do this with simple multicasting code, or you could use
> > > JGroups (with the bare-bones.xml config) to simply send out a
> multicast
> > > and wait for the first reply. So, no, you don't need to rip out some
> > > JGroups-internal code and use it in your project, but you could simply
> > > use a JChannel to do that.
> > >
> > > Robert Bowen wrote:
> > > > Hello all.
> > > >
> > > > I've been out of the JGroups loop for a while but diligently
> perusing
> > > > the mailing list.
> > > >
> > > > I had a question about an app I need to write. What I need to do is,
> > > > in a given moment send out a multicast "ping" and return the ip
> of the
> > > > first machine that answers. I know that internally this is what
> > > > JGroups does to keep an updated list of "alive" machines. My
> question
> > > > is, can I use the same internal mechanism JGroups uses? I don't
> think
> > > > so, not without deconstructing the code.
> > > >
> > > > The other option is to send out my own multicast message, but if I'm
> > > > not mistaken, multicast messages don't send back responses.
> > > >
> > > > Any thoughts?
> > >
> > > --
> > > Bela Ban
> > > Lead JGroups / Manager JBoss Clustering Group
> > > JBoss - a division of Red Hat
> > >
> > >
> >
> -------------------------------------------------------------------------
> > > Using Tomcat but need to do more? Need to support web services,
> > security?
> > > Get stuff done quickly with pre-integrated technology to make your job
> > > easier
> > > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> > Geronimo
> > >
> >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>
> >
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>>
>
> >
> > >
> >
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>
> >
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>>>
> > > _______________________________________________
> > > javagroups-users mailing list
> > > javagroups-users@xxxxxxxxxxxxxxxxxxxxx
> > > https://lists.sourceforge.net/lists/listinfo/javagroups-users
> > >
> > >
> ------------------------------------------------------------------------
> > >
> > >
> >
> -------------------------------------------------------------------------
> > > Using Tomcat but need to do more? Need to support web services,
> > security?
> > > Get stuff done quickly with pre-integrated technology to make your
> > job easier
> > > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> > Geronimo
> > >
> >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>
> >
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>>
> > >
> ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > javagroups-users mailing list
> > > javagroups-users@xxxxxxxxxxxxxxxxxxxxx
> > > https://lists.sourceforge.net/lists/listinfo/javagroups-users
> > >
> >
> > --
> > Bela Ban
> > Lead JGroups / Manager JBoss Clustering Group
> > JBoss - a division of Red Hat
> >
> >
> >
> -------------------------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services,
> security?
> > Get stuff done quickly with pre-integrated technology to make your job
> > easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>
> >
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>>
> > _______________________________________________
> > javagroups-users mailing list
> > javagroups-users@xxxxxxxxxxxxxxxxxxxxx
> > https://lists.sourceforge.net/lists/listinfo/javagroups-users
> >
> > ------------------------------------------------------------------------
> >
> >
> -------------------------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services,
> security?
> > Get stuff done quickly with pre-integrated technology to make your
> job easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > javagroups-users mailing list
> > javagroups-users@xxxxxxxxxxxxxxxxxxxxx
> > https://lists.sourceforge.net/lists/listinfo/javagroups-users
> >
>
> --
> Bela Ban
> Lead JGroups / Manager JBoss Clustering Group
> JBoss - a division of Red Hat
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
> _______________________________________________
> javagroups-users mailing list
> javagroups-users@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/javagroups-users
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ------------------------------------------------------------------------
>
> _______________________________________________
> javagroups-users mailing list
> javagroups-users@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/javagroups-users
>

--
Bela Ban
Lead JGroups / Manager JBoss Clustering Group
JBoss - a division of Red Hat


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise