You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by themitchy <mi...@sophos.com> on 2009/09/24 01:57:08 UTC

multicast 'timeToLive' doesn't seem to work

This is how I'm setting timeToLive:

<transportConnector name="openwire" uri="tcp://0.0.0.0:61616"
discoveryUri="multicast://default?timeToLive=20"/>

When I check on the packets with Wireshark the TTL is still 1.

That setting does seem to be doing _something_ since if I set it too high it
won't even start.

Anyone ever used this successfully?  Maybe it just doesn't do what I think
it should (Like so many things in life)...

 - mitch


-- 
View this message in context: http://www.nabble.com/multicast-%27timeToLive%27-doesn%27t-seem-to-work-tp25531334p25531334.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: multicast 'timeToLive' doesn't seem to work

Posted by Bruce Snyder <br...@gmail.com>.
On Thu, Sep 24, 2009 at 11:05 AM, Mitch Granger
<mi...@sophos.com> wrote:
>
>
> Bruce Snyder wrote:
>>
>> On Wed, Sep 23, 2009 at 5:57 PM, themitchy <mi...@sophos.com>
>> wrote:
>>>
>>> This is how I'm setting timeToLive:
>>>
>>> <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"
>>> discoveryUri="multicast://default?timeToLive=20"/>
>>>
>>> When I check on the packets with Wireshark the TTL is still 1.
>>>
>>> That setting does seem to be doing _something_ since if I set it too high
>>> it
>>> won't even start.
>>>
>>> Anyone ever used this successfully?  Maybe it just doesn't do what I
>>> think
>>> it should (Like so many things in life)...
>>
>> That particular timeToLive property applies to the
>> java.net.MulticastSocket:
>>
>>
>> http://java.sun.com/j2se/1.5.0/docs/api/java/net/MulticastSocket.html#setTimeToLive(int)
>>
>> A value of 1 for the timeToLive on a MulticastSocket means keep
>> packets on the local network. Anything higher than that will cause
>> packets to expand their range beyond the local network.
>>
>> What is it that you're trying to do exactly?
>
> We are trying to get packets beyond the local network.
>
> Turns out java.net.MulticastSocket prefers ipv6 if it is installed.  So we
> added
>
>  -Djava.net.preferIPv4Stack=true
>
> To the java opts when starting AMQ and it worked just fine.

Thanks for getting back to me. I've added a note to the wiki and it
should be exported to the website soon.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder

Re: multicast 'timeToLive' doesn't seem to work

Posted by Mitch Granger <mi...@sophos.com>.

Bruce Snyder wrote:
> On Wed, Sep 23, 2009 at 5:57 PM, themitchy <mi...@sophos.com> wrote:
>> This is how I'm setting timeToLive:
>>
>> <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"
>> discoveryUri="multicast://default?timeToLive=20"/>
>>
>> When I check on the packets with Wireshark the TTL is still 1.
>>
>> That setting does seem to be doing _something_ since if I set it too high it
>> won't even start.
>>
>> Anyone ever used this successfully?  Maybe it just doesn't do what I think
>> it should (Like so many things in life)...
> 
> That particular timeToLive property applies to the java.net.MulticastSocket:
> 
> http://java.sun.com/j2se/1.5.0/docs/api/java/net/MulticastSocket.html#setTimeToLive(int)
> 
> A value of 1 for the timeToLive on a MulticastSocket means keep
> packets on the local network. Anything higher than that will cause
> packets to expand their range beyond the local network.
> 
> What is it that you're trying to do exactly?

We are trying to get packets beyond the local network.

Turns out java.net.MulticastSocket prefers ipv6 if it is installed.  So 
we added

  -Djava.net.preferIPv4Stack=true

To the java opts when starting AMQ and it worked just fine.

> 
> Bruce
> --
> perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> ActiveMQ in Action: http://bit.ly/2je6cQ
> Blog: http://bruceblog.org/
> Twitter: http://twitter.com/brucesnyder

Re: multicast 'timeToLive' doesn't seem to work

Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Sep 23, 2009 at 5:57 PM, themitchy <mi...@sophos.com> wrote:
>
> This is how I'm setting timeToLive:
>
> <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"
> discoveryUri="multicast://default?timeToLive=20"/>
>
> When I check on the packets with Wireshark the TTL is still 1.
>
> That setting does seem to be doing _something_ since if I set it too high it
> won't even start.
>
> Anyone ever used this successfully?  Maybe it just doesn't do what I think
> it should (Like so many things in life)...

That particular timeToLive property applies to the java.net.MulticastSocket:

http://java.sun.com/j2se/1.5.0/docs/api/java/net/MulticastSocket.html#setTimeToLive(int)

A value of 1 for the timeToLive on a MulticastSocket means keep
packets on the local network. Anything higher than that will cause
packets to expand their range beyond the local network.

What is it that you're trying to do exactly?

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder