Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Sending Hop Limited UDP packets

Reply
Thread Tools

Sending Hop Limited UDP packets

 
 
Ashoka!
Guest
Posts: n/a
 
      04-10-2007
Is there a way to send a UDP packet with a specific TTL however it
must be a unicast address instead of multicast address. Any ideas?

regards
Usman Ismail

 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      04-10-2007
Ashoka! wrote:
> Is there a way to send a UDP packet with a specific TTL however it
> must be a unicast address instead of multicast address. Any ideas?
>
> regards
> Usman Ismail
>


I think you would have to write your own DatagramSocketImpl. But I'm
curious as to why you would want a TTL on a unicast UDP packet. Do you
not want it to get to it's address?

--

Knute Johnson
email s/nospam/knute/
 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      04-10-2007
On Tue, 10 Apr 2007 09:15:49 -0700, Knute Johnson wrote:
> I think you would have to write your own DatagramSocketImpl. But I'm
> curious as to why you would want a TTL on a unicast UDP packet. Do
> you not want it to get to it's address?


It's one way of implementing traceroute, but I can't think of any
other uses.

/gordon

--
 
Reply With Quote
 
Esmond Pitt
Guest
Posts: n/a
 
      04-11-2007
Ashoka! wrote:
> Is there a way to send a UDP packet with a specific TTL however it
> must be a unicast address instead of multicast address. Any ideas?


Use a MulticastSocket so you get the setTimeToLive() API and just send
to a unicast address.
 
Reply With Quote
 
Gordon Beaton
Guest
Posts: n/a
 
      04-11-2007
On Wed, 11 Apr 2007 09:09:12 GMT, Esmond Pitt wrote:
> Use a MulticastSocket so you get the setTimeToLive() API and just
> send to a unicast address.


Does that actually work?

I was going to make the same suggestion earlier, but tested first and
couldn't see (with Wireshark) that the setting had any effect on
unicast packets. The documentation seems to confirm this:

"Set the default time-to-live for *multicast* packets sent [...]"

/gordon

--
 
Reply With Quote
 
Esmond Pitt
Guest
Posts: n/a
 
      04-12-2007
Gordon Beaton wrote:
> On Wed, 11 Apr 2007 09:09:12 GMT, Esmond Pitt wrote:
>
>>Use a MulticastSocket so you get the setTimeToLive() API and just
>>send to a unicast address.

>
> Does that actually work?


oops, err, hmm, maybe not ... on investigation it turns out that there
are both IP_TTL and IP_MULTICAST_TTL, and
MulticastSocket.setTimeToLive() sets the latter, and the OP wants the
former ...

so you can't do it in Java.
 
Reply With Quote
 
Ashoka!
Guest
Posts: n/a
 
      04-26-2007
I am trying to implement the tailgating algorithm to measure internet
bandwidth.

On Apr 12, 5:21 am, Esmond Pitt <(E-Mail Removed)>
wrote:
> Gordon Beaton wrote:
> > On Wed, 11 Apr 2007 09:09:12 GMT, Esmond Pitt wrote:

>
> >>Use a MulticastSocket so you get the setTimeToLive() API and just
> >>send to a unicast address.

>
> > Does that actually work?

>
> oops, err, hmm, maybe not ... on investigation it turns out that there
> are both IP_TTL and IP_MULTICAST_TTL, and
> MulticastSocket.setTimeToLive() sets the latter, and the OP wants the
> former ...
>
> so you can't do it in Java.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDP packets to PC behind NAT Janto Dreijer Python 12 09-17-2006 12:48 AM
UDP Packets dropping asr Cisco 5 12-28-2005 05:05 PM
UDP Packets dropping asr Cisco 0 12-22-2005 09:50 PM
receive udp packets on windows xp Andrew Chin Java 3 12-08-2005 05:21 AM
What is win32sl.exe and why does my firewall keep detecting UDP packets to it? Steve Freides Computer Support 7 06-03-2004 12:36 AM



Advertisments