Skip to content

Default TTL to 0 and allow setting with env variable#79

Closed
wjwwood wants to merge 2 commits intomasterfrom
configure_fastrtps_ttl
Closed

Default TTL to 0 and allow setting with env variable#79
wjwwood wants to merge 2 commits intomasterfrom
configure_fastrtps_ttl

Conversation

@wjwwood
Copy link
Copy Markdown
Member

@wjwwood wjwwood commented Dec 13, 2016

This pr will detect if Fast-RTPS has the feature that allows us to set the TTL for multicast UDP packets, and if it does it will default it to 0 (rather than 1 as it is now) and will allow users to control that setting using the RMW_FASTRTPS_TTL_LEVEL environment variable.

The idea behind making the default 0 instead of 1 is to avoid accidentally taking down WiFi networks when people run the camera demo. This will prevent people from using fast rtps across two computers unless they set the TTL to 1 on both machines using the environment variable.

In order for this pr to have any effect we need to either get this pr merged or carry the patch into a fork of Fast-RTPS which we use until it is merged: eProsima/Fast-DDS#68

it can be configured using an env variable for now
RMW_FASTRTPS_TTL_LEVEL
@wjwwood wjwwood added in review Waiting for review (Kanban column) in progress Actively being worked on (Kanban column) labels Dec 13, 2016
@wjwwood wjwwood self-assigned this Dec 13, 2016
@wjwwood wjwwood removed the in review Waiting for review (Kanban column) label Dec 13, 2016
@wjwwood wjwwood added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Dec 13, 2016
@codebot
Copy link
Copy Markdown
Member

codebot commented Dec 13, 2016

We need to investigate whether or not this affects multicast discovery or just the data packets. Ideally we'd want multicast discovery to have nonzero TTL but the data packets to have TTL zero for multicast and TTL nonzero for unicast.

In general, this needs to be tested a bit more to make sure this behaves as expected with respect to wireless network behavior and to obtain feedback from eProsima.

Let's try to change the locator list from rmw_fastrtps_cpp to just knock out the multicast locators for data. This is just a workaround until a future version of fastrtps which will be more judicious about when to multicast.

@wjwwood
Copy link
Copy Markdown
Member Author

wjwwood commented Dec 13, 2016

This comment is relevant:

By default a subscriber uses a multicast address and a unicast address. Right now writer writes samples to both addresses. Next release will be more clever and if it is possible only write to one. I configured the subscriber not to use the default addresses, and only use a multicast address. Then the writer will write samples only to that address.
-- #36 (comment)

I'll try to adapt the logic he provided there to do the opposite and disable multicast all together in favor of just unicast until we can better control it in a new pr.

@codebot
Copy link
Copy Markdown
Member

codebot commented Dec 13, 2016

That sounds great. Since unicast is the default behavior of ROS 1, I think that will be the expectation of users (for data, at least) unless there is a clear win that multicasting is better: for example, if >1 subscribers on the same subnet.

@codebot
Copy link
Copy Markdown
Member

codebot commented Dec 16, 2016

Holding until after Beta 1

@codebot codebot added ready Work is about to start (Kanban column) and removed in review Waiting for review (Kanban column) labels Dec 16, 2016
@wjwwood
Copy link
Copy Markdown
Member Author

wjwwood commented Apr 13, 2017

Since the current version of Fast-RTPS has multicast disabled by default, I'll close this for now. We can do a better fix in the future when Fast-RTPS can automatically select between unicast and multicast.

@wjwwood wjwwood closed this Apr 13, 2017
@wjwwood wjwwood deleted the configure_fastrtps_ttl branch April 13, 2017 00:21
@wjwwood wjwwood removed the ready Work is about to start (Kanban column) label Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants