This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes Traceroute using Jpcap problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Traceroute using Jpcap problem" Watch "Traceroute using Jpcap problem" New topic

Traceroute using Jpcap problem

rosy Jovita
Ranch Hand

Joined: Jan 05, 2010
Posts: 45
Hi all,

I'm using Jpcap to run a traceroute program. It works well on Ubuntu but in windows, it keep on showing me the first 2hops.
Anybody know what is going on? here's my code

here is the sample output in windows:

please help
thanks for any replies.
him jain
Ranch Hand

Joined: Feb 05, 2010
Posts: 56
have you run the program as an administrator?
I would like you to check this :

Can you tell me what output are you getting in ubuntu?

What your output is showing is: that request is not going out of localhost.

--Himanshu Jain
rosy Jovita
Ranch Hand

Joined: Jan 05, 2010
Posts: 45
yeah, i'm the administrator of this computer.
In Ubuntu, it works pretty well.
It shows me all the hops.
I really don't know why it does not works on Windows XP.

him jain
Ranch Hand

Joined: Feb 05, 2010
Posts: 56
I can only let you know what's happening here:
Your request is not able to go outside your PC.
So, it keeps on pinging inside only.
What I can suggest is:
1) Make sure you have connected to correct interface (means to the interface from which packet is going outside).
So, check out for the interfaces first and connect to the correct interface.
2) in your code I am not able to find the server you're pinging/sending packet to (like google, yahoo etc).

See, your program is working. So, there's only a small alteration need to be done. So, carefully analyze each step. You'll get to know.
I agree. Here's the link:
subject: Traceroute using Jpcap problem
It's not a secret anymore!