• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Developing a traceroute clone

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am currently trying to develop a traceroute clone.Can you please tell me how to receive a UDP packet(i know to recieve and send using the default DatagramSocket and DatagramPacket Classes) but they dont allow me to edit the TTL fields.Whats the feasibility in doing this is in Java.
I want to edit the TTL fields :send and receive the packets.

Without using 3rd party libraries like JPCAP

Thanks in advance
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Traceroute doesn't use UDP; it uses a lower level IP protocol called ICMP. J2SE doesn't support ICMP, nor does it support much else in the way of low-level networking. A traceroute clone, while trivial in C, is going to be a difficult mess in Java.
 
Dishpal Bhaluja
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No solution to get around this.Please anyone help.Im ready to mess with this
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Ernest pointed out, Java doesn't have the functionality you require.
Is there a reason you can't use 3rd party libraries or a more suitable language like C?
[ March 19, 2008: Message edited by: Joe Ess ]
 
Dishpal Bhaluja
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im now using JPCap.Following errors occuring.Help me please
Environment
Installed Winpcap and jpcap
IDe:Eclipse 3.2
In new java project added jpcap.jar and added their default traceroute.java
Succesfully compiled and got the result saying traceroute syntax is:
traceroute [device number 0,1,2][device name]
When i tried running frm cmd prompt
cmd>java traceroute 0 localhost
It gave me packet/DatalinkPacket Class not found.

Im stuck.How can I get rid of this error.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


cmd>java traceroute 0 localhost
It gave me packet/DatalinkPacket Class not found.


How are you adding the "packet" package to your classpath? I'm guessing this should read

(or ; instead of : if you're using Windows)
 
Dishpal Bhaluja
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ya Netbeans/Eclipse builds it correctly without any error.
I am the prompt where class files have been generated for the project(Def for netbeans)
and frm cmd
prjct/class>java traceroute.java 0 localhost

and then the error pops up.
Any solutions.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you try what I suggested? I'm pretty sure that is the solution.
 
Dishpal Bhaluja
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ya got it.Thanks.I am working around other issues.Thanks for your help.

More doubts on the ways,I know you will help me
 
reply
    Bookmark Topic Watch Topic
  • New Topic