File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Traceroute in Java

 
Andy James
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to implement Traceroute in Java, since Java does not suppoorts low level networking.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the jpcap library (on SourceForge). It's a JNI wrapper around some functionality of the native TCP/IP stack that allows you to do this in Java. Here's example code that does that: http://netresearch.ics.uci.edu/kfujii/jpcap/sample/Traceroute.java
 
Andy James
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

JPCap requires a user to install c/c++/c# libraries to execute the Traceroute code.

However, The following "seems" to execute the Traceroute using a Java Applet (only Java) because it does not requires a user to download any libraries/ files to display the traceroute from their server to the user's machine.

My queries:
1) Is it possible to implement Traceroute using (only) Java?
2) Is it possible to implement the Traceroute in Java as an Applet?

Am I missing something here?

Andy
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you mean by "the following" (did you mean to add a link?), but traceroute can't be implemented in Java w/o using native libraries, because Java does not support the low-level ICMP protocol used by traceroute.
 
Andy James
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf

I apologize for the missing link. Here it is:

http://visualroute.visualware.com/

The above links displays an applet, which performs the traceroute and displays the result on the web page. Since it did not prompt me to download and install any file to use it, I assume it is done in Java (not sure)

Thanks.
Andy
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andy -- if you look carefully at that applet, you'll see that by default it offers to run a traceroute from "This Server". You can also use the popup menu to choose "My Computer". If you run the traceroute from "This Server", then it runs from the web server, and of course you don't know what kind of code is located there. If you pick "My Computer", it does indeed ask you to download something first.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you do want to go the applet route, note that it's possible to ship native libraries with an applet, as long as all involved files are digitally signed. You'd have to supply versions for all client OSes you want to support, though (Windows, OS X, Linux, etc.).
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic