This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
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)
Joined: Dec 30, 2007
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.
Joined: Mar 22, 2005
Did you try what I suggested? I'm pretty sure that is the solution.
Joined: Dec 30, 2007
Ya got it.Thanks.I am working around other issues.Thanks for your help.