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.
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.
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 ]
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.
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
Marshal
Joined: Mar 22, 2005
Posts: 35428
9
posted
0
Did you try what I suggested? I'm pretty sure that is the solution.
Dishpal Bhaluja
Ranch Hand
Joined: Dec 30, 2007
Posts: 96
posted
0
Ya got it.Thanks.I am working around other issues.Thanks for your help.