There is a portable api below ethereal. It uses
libpcap, a packet capturing api. It puts the
nic card in promiscuous mode and reads raw frames.
It is available on many platforms and used by
many traffic analyser guis.

But: libpcap is not only for icmp but for any
(raw) packet, and it only listens to traffic,
for ping you've got to _generate_ icmp packets.

So it is good if you want to build a kind of traffic
analysis mbean.

The integration problem stands:

o do you want to integrate it using jni and run the
  jboss jvm as root, or
o do you want to run it in a separate process and
  interface (with simple udp encaps. as I proposed)
  or e.g. with corba.

Regards,
Michael Bartmann

Scott M Stark wrote:
If anything has a portable ICMP layer I would expect it in the Ethereal
protocol analyzer : http://www.ethereal.com/
I'm interested in getting this an other network topology tools working
in JBoss to better support cluster configuration issues so I'll help get
something going here.

xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx

----- Original Message ----- From: "Michael Bartmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 22, 2002 4:22 AM
Subject: [JBoss-dev] jboss and icmp sockets (any use?)



Hi socket programmers,

While writing mbeans to interface with legacy tcp/ip hosts,
I often thought it would be really usefull to be able to "ping" them.

[[
As you surely know "ping" is icmp based, and jdks up to 1.4 don't
support icmp sockets. Even if you write some jni code you are urged
to run the whole jvm as root if running under unix, which you might
not prefer to do; these security nightmares are probably the main
reason for sun not to include icmp in the standard.
(OTOH: there exists a jni icmp implementation for winsocks.)

Now you could work around this by exec()-ing the ping utility of your
favourite os. This is:
1) not so cheap (ressource wise, at least an exec() per ping)
2) quite slow (most ping utilities can only ping one host at a time
   and only once per second)
3) not so portable, you'll have to setup arguments and parse results
   in a way depending on your "ping" variant.
]]

I came up with this solution: I wrote a very small C programm which
acts as a gateway between a special udp socket and an icmp raw socket.
So the java thread sends udp packets to that port, they get resend as
icmp packets, the remote side responds, the response is translated back to
udp and the java thread can read them.

This is quite cheep and the C programm is very lightweight, but it is
sort of system specific anyway (at the moment I only have a linux version,
which should work under other unices - but probably not under winsocks).

At least the java side is of course the same for every platform; this might
be the only thing to go into the jboss distribution, so we don't pollute
the build system with C.

All this is not exactly jboss-specific, but I wondered if other jboss
services could use icmp access?

Is there a more simple icmp solution around, which works at least under win2k
_and_ linux?

(I heard there is something planned for jdk 1.5; I'd like to see how sun works
around the "root-only" problem under unix...)

Regards,
Michael



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to