Skip to content

Commit

Permalink
Make "allow multicast" per-interface
Browse files Browse the repository at this point in the history
This adds an "allow_multicast" attribute to the network interface
configuration and uses the old General/AllowMulticast as the default
value.  This way, both backwards compatibility and easy global
configuration are supported.

This incidentally addresses a slew of bugs in multi-network
configurations, but it does make things rather more complicated.

Signed-off-by: Erik Boasson <[email protected]>
  • Loading branch information
eboasson committed Mar 20, 2024
1 parent 7bd1ac4 commit 15ea833
Show file tree
Hide file tree
Showing 18 changed files with 612 additions and 212 deletions.
67 changes: 56 additions & 11 deletions docs/manual/config/config_file_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,41 @@ This element specifies the DDSI participant index used by this instance of the C

* a non-negative integer, or

* none: which causes it to use arbitrary port numbers for unicast sockets which entirely removes the constraints on the participant index but makes unicast discovery impossible.
* none: which causes it to use arbitrary port numbers for unicast sockets which entirely removes the constraints on the participant index but makes unicast discovery impossible, or
* default: use none if multicast discovery is used on all selected network interfaces, else auto.


The default value is: ``none``
The default value is: ``default``


.. _`//CycloneDDS/Domain/Discovery/Peers`:

//CycloneDDS/Domain/Discovery/Peers
-----------------------------------

Attributes: :ref:`AddLocalhost<//CycloneDDS/Domain/Discovery/Peers[@AddLocalhost]>`
Children: :ref:`Peer<//CycloneDDS/Domain/Discovery/Peers/Peer>`

This element statically configures addresses for discovery.


.. _`//CycloneDDS/Domain/Discovery/Peers[@AddLocalhost]`:

//CycloneDDS/Domain/Discovery/Peers[@AddLocalhost]
--------------------------------------------------

Boolean

This attribute determines controls the localhost will automatically be added to the list of peers:.
* false: never

* true: always

* default: if multicast discovery is unavailable *

The default value is: ``default``


.. _`//CycloneDDS/Domain/Discovery/Peers/Peer`:

//CycloneDDS/Domain/Discovery/Peers/Peer
Expand Down Expand Up @@ -391,9 +410,9 @@ The General element specifies overall Cyclone DDS service settings.

One of:
* Keyword: default
* Comma-separated list of: false, spdp, asm, ssm, true
* Comma-separated list of: false, spdp, asm, ssm, true, default

This element controls whether Cyclone DDS uses multicasts for data traffic.
This element controls the default for the per-network interface setting whether Cyclone DDS uses multicasts for discovery and data traffic.

It is a comma-separated list of some of the following keywords: "spdp", "asm", "ssm", or either of "false" or "true", or "default".

Expand All @@ -404,10 +423,9 @@ It is a comma-separated list of some of the following keywords: "spdp", "asm", "
* ssm: enables the use of SSM (source-specific multicast) for all non-SPDP traffic (if supported)


When set to "false" all multicasting is disabled; "true"enables the full use of multicasts. Listening for multicasts can be controlled by General/MulticastRecvNetworkInterfaceAddresses.

When set to "false" all multicasting is disabled. The default, "true" enables the full use of multicasts. Listening for multicasts can be controlled by General/MulticastRecvNetworkInterfaceAddresses.

"default" maps on spdp if the network is a WiFi network, on true if it is a wired network
The special value "default" maps on spdp if the network is a WiFi network, on true if it is a wired network

The default value is: ``default``

Expand Down Expand Up @@ -515,7 +533,7 @@ This element specifies the network interfaces for use by Cyclone DDS. Multiple i
//CycloneDDS/Domain/General/Interfaces/NetworkInterface
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Attributes: :ref:`address<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@address]>`, :ref:`autodetermine<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@autodetermine]>`, :ref:`multicast<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@multicast]>`, :ref:`name<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@name]>`, :ref:`prefer_multicast<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@prefer_multicast]>`, :ref:`presence_required<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@presence_required]>`, :ref:`priority<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@priority]>`
Attributes: :ref:`address<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@address]>`, :ref:`allow_multicast<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@allow_multicast]>`, :ref:`autodetermine<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@autodetermine]>`, :ref:`multicast<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@multicast]>`, :ref:`name<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@name]>`, :ref:`prefer_multicast<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@prefer_multicast]>`, :ref:`presence_required<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@presence_required]>`, :ref:`priority<//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@priority]>`

This element defines a network interface. You can set autodetermine="true" to autoselect the interface CycloneDDS considers the highest quality. If autodetermine="false" (the default), you must specify the name and/or address attribute. If you specify both, they must match the same interface.

Expand All @@ -532,6 +550,33 @@ This attribute specifies the address of the interface. With ipv4 allows matchin
The default value is: ``<empty>``


.. _`//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@allow_multicast]`:

//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@allow_multicast]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

One of:
* Keyword: default
* Comma-separated list of: false, spdp, asm, ssm, true, default

This element controls whether Cyclone DDS uses multicasts for data traffic on this interface.

It is a comma-separated list of some of the following keywords: "spdp", "asm", "ssm", or either of "false" or "true", or "default".

* spdp: enables the use of ASM (any-source multicast) for participant discovery, joining the multicast group on the discovery socket, transmitting SPDP messages to this group, but never advertising nor using any multicast address in any discovery message, thus forcing unicast communications for all endpoint discovery and user data.

* asm: enables the use of ASM for all traffic, including receiving SPDP but not transmitting SPDP messages via multicast

* ssm: enables the use of SSM (source-specific multicast) for all non-SPDP traffic (if supported)


When set to "false" all multicasting is disabled; "true"enables the full use of multicasts. Listening for multicasts can be controlled by General/MulticastRecvNetworkInterfaceAddresses.

The special value "default" takes the value from the globalGeneral/AllowMulticast setting.

The default value is: ``default``


.. _`//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@autodetermine]`:

//CycloneDDS/Domain/General/Interfaces/NetworkInterface[@autodetermine]
Expand Down Expand Up @@ -2654,10 +2699,10 @@ The categorisation of tracing output is incomplete and hence most of the verbosi
The default value is: ``none``

..
generated from ddsi_config.h[7a2ea305c6a2eab7fe285734641fe60da41874b6]
generated from ddsi_config.h[9f834d377bdea61bea6507feed2fc4a8924dc02e]
generated from ddsi__cfgunits.h[bd22f0c0ed210501d0ecd3b07c992eca549ef5aa]
generated from ddsi__cfgelems.h[bf5f0d9b9265e4b6f3f61e7624325af68eb276bf]
generated from ddsi_config.c[2d8c4ee6633a21fb69c3f7cb0bf685c1ca9e5132]
generated from ddsi__cfgelems.h[f10059d775cf2e4961a2e9520bb1a4da6a124778]
generated from ddsi_config.c[0a59324bd889637ea7d04765da9b76bbe74997c1]
generated from _confgen.h[e32eabfc35e9f3a7dcb63b19ed148c0d17c6e5fc]
generated from _confgen.c[237308acd53897a34e8c643e16e05a61d73ffd65]
generated from generate_rnc.c[b50e4b7ab1d04b2bc1d361a0811247c337b74934]
Expand Down
57 changes: 46 additions & 11 deletions docs/manual/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,31 @@ This element specifies the DDSI participant index used by this instance of the C

* a non-negative integer, or

* none: which causes it to use arbitrary port numbers for unicast sockets which entirely removes the constraints on the participant index but makes unicast discovery impossible.
* none: which causes it to use arbitrary port numbers for unicast sockets which entirely removes the constraints on the participant index but makes unicast discovery impossible, or
* default: use none if multicast discovery is used on all selected network interfaces, else auto.

The default value is: `none`
The default value is: `default`


#### //CycloneDDS/Domain/Discovery/Peers
Attributes: [AddLocalhost](#cycloneddsdomaindiscoverypeersaddlocalhost)
Children: [Peer](#cycloneddsdomaindiscoverypeerspeer)

This element statically configures addresses for discovery.


#### //CycloneDDS/Domain/Discovery/Peers[@AddLocalhost]
Boolean

This attribute determines controls the localhost will automatically be added to the list of peers:.
* false: never

* true: always

* default: if multicast discovery is unavailable *
The default value is: `default`


##### //CycloneDDS/Domain/Discovery/Peers/Peer
Attributes: [Address](#cycloneddsdomaindiscoverypeerspeeraddress)

Expand Down Expand Up @@ -253,9 +267,9 @@ The General element specifies overall Cyclone DDS service settings.
#### //CycloneDDS/Domain/General/AllowMulticast
One of:
* Keyword: default
* Comma-separated list of: false, spdp, asm, ssm, true
* Comma-separated list of: false, spdp, asm, ssm, true, default

This element controls whether Cyclone DDS uses multicasts for data traffic.
This element controls the default for the per-network interface setting whether Cyclone DDS uses multicasts for discovery and data traffic.

It is a comma-separated list of some of the following keywords: "spdp", "asm", "ssm", or either of "false" or "true", or "default".

Expand All @@ -265,10 +279,9 @@ It is a comma-separated list of some of the following keywords: "spdp", "asm", "

* ssm: enables the use of SSM (source-specific multicast) for all non-SPDP traffic (if supported)

When set to "false" all multicasting is disabled; "true"enables the full use of multicasts. Listening for multicasts can be controlled by General/MulticastRecvNetworkInterfaceAddresses.

When set to "false" all multicasting is disabled. The default, "true" enables the full use of multicasts. Listening for multicasts can be controlled by General/MulticastRecvNetworkInterfaceAddresses.

"default" maps on spdp if the network is a WiFi network, on true if it is a wired network
The special value "default" maps on spdp if the network is a WiFi network, on true if it is a wired network

The default value is: `default`

Expand Down Expand Up @@ -340,7 +353,7 @@ This element specifies the network interfaces for use by Cyclone DDS. Multiple i


##### //CycloneDDS/Domain/General/Interfaces/NetworkInterface
Attributes: [address](#cycloneddsdomaingeneralinterfacesnetworkinterfaceaddress), [autodetermine](#cycloneddsdomaingeneralinterfacesnetworkinterfaceautodetermine), [multicast](#cycloneddsdomaingeneralinterfacesnetworkinterfacemulticast), [name](#cycloneddsdomaingeneralinterfacesnetworkinterfacename), [prefer_multicast](#cycloneddsdomaingeneralinterfacesnetworkinterfaceprefermulticast), [presence_required](#cycloneddsdomaingeneralinterfacesnetworkinterfacepresencerequired), [priority](#cycloneddsdomaingeneralinterfacesnetworkinterfacepriority)
Attributes: [address](#cycloneddsdomaingeneralinterfacesnetworkinterfaceaddress), [allow_multicast](#cycloneddsdomaingeneralinterfacesnetworkinterfaceallowmulticast), [autodetermine](#cycloneddsdomaingeneralinterfacesnetworkinterfaceautodetermine), [multicast](#cycloneddsdomaingeneralinterfacesnetworkinterfacemulticast), [name](#cycloneddsdomaingeneralinterfacesnetworkinterfacename), [prefer_multicast](#cycloneddsdomaingeneralinterfacesnetworkinterfaceprefermulticast), [presence_required](#cycloneddsdomaingeneralinterfacesnetworkinterfacepresencerequired), [priority](#cycloneddsdomaingeneralinterfacesnetworkinterfacepriority)

This element defines a network interface. You can set autodetermine="true" to autoselect the interface CycloneDDS considers the highest quality. If autodetermine="false" (the default), you must specify the name and/or address attribute. If you specify both, they must match the same interface.

Expand All @@ -353,6 +366,28 @@ This attribute specifies the address of the interface. With ipv4 allows matchin
The default value is: `<empty>`


##### //CycloneDDS/Domain/General/Interfaces/NetworkInterface[@allow_multicast]
One of:
* Keyword: default
* Comma-separated list of: false, spdp, asm, ssm, true, default

This element controls whether Cyclone DDS uses multicasts for data traffic on this interface.

It is a comma-separated list of some of the following keywords: "spdp", "asm", "ssm", or either of "false" or "true", or "default".

* spdp: enables the use of ASM (any-source multicast) for participant discovery, joining the multicast group on the discovery socket, transmitting SPDP messages to this group, but never advertising nor using any multicast address in any discovery message, thus forcing unicast communications for all endpoint discovery and user data.

* asm: enables the use of ASM for all traffic, including receiving SPDP but not transmitting SPDP messages via multicast

* ssm: enables the use of SSM (source-specific multicast) for all non-SPDP traffic (if supported)

When set to "false" all multicasting is disabled; "true"enables the full use of multicasts. Listening for multicasts can be controlled by General/MulticastRecvNetworkInterfaceAddresses.

The special value "default" takes the value from the globalGeneral/AllowMulticast setting.

The default value is: `default`


##### //CycloneDDS/Domain/General/Interfaces/NetworkInterface[@autodetermine]
Text

Expand Down Expand Up @@ -1854,10 +1889,10 @@ While none prevents any message from being written to a DDSI2 log file.
The categorisation of tracing output is incomplete and hence most of the verbosity levels and categories are not of much use in the current release. This is an ongoing process and here we describe the target situation rather than the current situation. Currently, the most useful verbosity levels are config, fine and finest.

The default value is: `none`
<!--- generated from ddsi_config.h[7a2ea305c6a2eab7fe285734641fe60da41874b6] -->
<!--- generated from ddsi_config.h[9f834d377bdea61bea6507feed2fc4a8924dc02e] -->
<!--- generated from ddsi__cfgunits.h[bd22f0c0ed210501d0ecd3b07c992eca549ef5aa] -->
<!--- generated from ddsi__cfgelems.h[bf5f0d9b9265e4b6f3f61e7624325af68eb276bf] -->
<!--- generated from ddsi_config.c[2d8c4ee6633a21fb69c3f7cb0bf685c1ca9e5132] -->
<!--- generated from ddsi__cfgelems.h[f10059d775cf2e4961a2e9520bb1a4da6a124778] -->
<!--- generated from ddsi_config.c[0a59324bd889637ea7d04765da9b76bbe74997c1] -->
<!--- generated from _confgen.h[e32eabfc35e9f3a7dcb63b19ed148c0d17c6e5fc] -->
<!--- generated from _confgen.c[237308acd53897a34e8c643e16e05a61d73ffd65] -->
<!--- generated from generate_rnc.c[b50e4b7ab1d04b2bc1d361a0811247c337b74934] -->
Expand Down
Loading

0 comments on commit 15ea833

Please sign in to comment.