From 5b29157583832f57b01871ae08a20cc1559295d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ferreira=20Gonz=C3=A1lez?= Date: Wed, 3 Jul 2024 08:56:33 +0200 Subject: [PATCH] Discovery Server refactor (#751) * Refs #20629: Modify DS main page Signed-off-by: cferreiragonz * Refs #20629: Update CLI and examples Signed-off-by: cferreiragonz * Refs #20629: Update env.var. without positional arguments Signed-off-by: cferreiragonz * Refs #20629: Update XML tags Signed-off-by: cferreiragonz * Refs #20629: Update DS XML examples Signed-off-by: cferreiragonz * Refs #20629: Update ROS 2 Use case Signed-off-by: cferreiragonz * Refs #20629: Review Signed-off-by: cferreiragonz * Refs #20629: Review - Make ServerAttributes private Signed-off-by: cferreiragonz --------- Signed-off-by: cferreiragonz --- code/DDSCodeTester.cpp | 115 +---- code/XMLTester.xml | 294 ++++------- code/XMLTesterExample.xml | 60 +-- docs/03-exports/aliases-api.include | 4 - .../attributes/RemoteServerAttributes.rst | 8 - .../rtps/attributes/RemoteServerList_t.rst | 7 - .../rtps/attributes/attributes.rst | 2 - docs/fastdds/discovery/discovery_server.rst | 467 +++++++++--------- docs/fastdds/env_vars/env_vars.rst | 21 +- .../ros2_discovery_server.rst | 40 +- .../super_client_configuration_file.xml | 16 +- docs/fastdds/transport/transport_api.rst | 2 +- .../tcp/tcp_with_discovery_server.rst | 6 +- .../wifi/discovery_server_use_case.rst | 258 +++++----- .../xml_configuration/domainparticipant.rst | 74 +-- docs/fastddscli/cli/cli.rst | 147 +++--- 16 files changed, 615 insertions(+), 906 deletions(-) delete mode 100644 docs/fastdds/api_reference/rtps/attributes/RemoteServerAttributes.rst delete mode 100644 docs/fastdds/api_reference/rtps/attributes/RemoteServerList_t.rst diff --git a/code/DDSCodeTester.cpp b/code/DDSCodeTester.cpp index 6800c1459..5be898bd8 100644 --- a/code/DDSCodeTester.cpp +++ b/code/DDSCodeTester.cpp @@ -1159,7 +1159,6 @@ class RemoteDiscoveryDomainParticipantListener : public DomainParticipantListene void dds_discovery_examples() { using Locator_t = eprosima::fastdds::rtps::Locator_t; - using RemoteServerAttributes = eprosima::fastdds::rtps::RemoteServerAttributes; using IPLocator = eprosima::fastdds::rtps::IPLocator; using DiscoveryProtocol = eprosima::fastdds::rtps::DiscoveryProtocol; using ParticipantFilteringFlags = eprosima::fastdds::rtps::ParticipantFilteringFlags; @@ -1277,6 +1276,14 @@ void dds_discovery_examples() } { //CONF_SERVER_SERVER_GUIDPREFIX_OPTION_1 + // Using the ``>>`` operator and the ``std::istringstream`` type. + DomainParticipantQos serverQos; + std::istringstream("44.53.00.5f.45.50.52.4f.53.49.4d.41") >> serverQos.wire_protocol().prefix; + //!-- + } + { + //CONF_SERVER_SERVER_GUIDPREFIX_OPTION_2 + // Manual setting of the ``unsigned char`` in ASCII format. eprosima::fastdds::rtps::GuidPrefix_t serverGuidPrefix; serverGuidPrefix.value[0] = eprosima::fastdds::rtps::octet(0x44); serverGuidPrefix.value[1] = eprosima::fastdds::rtps::octet(0x53); @@ -1295,37 +1302,24 @@ void dds_discovery_examples() serverQos.wire_protocol().prefix = serverGuidPrefix; //!-- } - { - //CONF_SERVER_SERVER_GUIDPREFIX_OPTION_2 - DomainParticipantQos serverQos; - std::istringstream("44.53.00.5f.45.50.52.4f.53.49.4d.41") >> serverQos.wire_protocol().prefix; - //!-- - } - { - //CONF_SERVER_CLIENT_GUIDPREFIX - RemoteServerAttributes server; - server.ReadguidPrefix("44.53.00.5f.45.50.52.4f.53.49.4d.41"); - - DomainParticipantQos clientQos; - clientQos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(server); - //!-- - } { //CONF_SERVER_CLIENT_LOCATORS Locator_t locator; + // The default locator kind is UDPv4 + locator.kind = LOCATOR_KIND_UDPv4; IPLocator::setIPv4(locator, 192, 168, 1, 133); locator.port = 64863; - RemoteServerAttributes server; - server.metatrafficUnicastLocatorList.push_back(locator); DomainParticipantQos clientQos; - clientQos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(server); + clientQos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(locator); //!-- } { //CONF_SERVER_SERVER_LOCATORS Locator_t locator; + // The default locator kind is UDPv4 + locator.kind = LOCATOR_KIND_UDPv4; IPLocator::setIPv4(locator, 192, 168, 1, 133); locator.port = 64863; @@ -1350,19 +1344,13 @@ void dds_discovery_examples() client_or_server->get_qos(client_or_server_qos); /* Create a new server entry to which the client or server should connect */ - RemoteServerAttributes remote_server_att; - - // Set server's GUID prefix - remote_server_att.ReadguidPrefix("44.53.00.5f.45.50.52.4f.53.49.4d.42"); - // Set server's listening locator for PDP Locator_t locator; IPLocator::setIPv4(locator, 127, 0, 0, 1); locator.port = 11812; - remote_server_att.metatrafficUnicastLocatorList.push_back(locator); /* Update list of remote servers for this client or server */ - client_or_server_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_att); + client_or_server_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(locator); if (RETCODE_OK != client_or_server->set_qos(client_or_server_qos)) { // Error @@ -1394,9 +1382,6 @@ void dds_discovery_examples() server_qos.wire_protocol().builtin.discovery_config.discoveryProtocol = DiscoveryProtocol::SERVER; - // Set SERVER's GUID prefix - std::istringstream("44.53.00.5f.45.50.52.4f.53.49.4d.41") >> server_qos.wire_protocol().prefix; - // Set SERVER's listening locator for PDP Locator_t locator; IPLocator::setIPv4(locator, 127, 0, 0, 1); @@ -1404,18 +1389,13 @@ void dds_discovery_examples() server_qos.wire_protocol().builtin.metatrafficUnicastLocatorList.push_back(locator); /* Add a remote serve to which this server will connect */ - // Set remote SERVER's GUID prefix - RemoteServerAttributes remote_server_att; - remote_server_att.ReadguidPrefix("44.53.01.5f.45.50.52.4f.53.49.4d.41"); - // Set remote SERVER's listening locator for PDP Locator_t remote_locator; IPLocator::setIPv4(remote_locator, 127, 0, 0, 1); remote_locator.port = 11812; - remote_server_att.metatrafficUnicastLocatorList.push_back(remote_locator); // Add remote SERVER to SERVER's list of SERVERs - server_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_att); + server_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_locator); // Create SERVER DomainParticipant* server = @@ -1437,18 +1417,13 @@ void dds_discovery_examples() client_qos.wire_protocol().builtin.discovery_config.discoveryProtocol = DiscoveryProtocol::CLIENT; - // Set SERVER's GUID prefix - RemoteServerAttributes remote_server_att; - remote_server_att.ReadguidPrefix("44.53.00.5f.45.50.52.4f.53.49.4d.41"); - // Set SERVER's listening locator for PDP Locator_t locator; IPLocator::setIPv4(locator, 127, 0, 0, 1); locator.port = 11811; - remote_server_att.metatrafficUnicastLocatorList.push_back(locator); // Add remote SERVER to CLIENT's list of SERVERs - client_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_att); + client_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(locator); // Set ping period to 250 ms client_qos.wire_protocol().builtin.discovery_config.discoveryServer_client_syncperiod = @@ -6242,7 +6217,6 @@ void dds_transport_examples () void dds_usecase_examples() { using Locator_t = eprosima::fastdds::rtps::Locator_t; - using RemoteServerAttributes = eprosima::fastdds::rtps::RemoteServerAttributes; using IPLocator = eprosima::fastdds::rtps::IPLocator; using DiscoveryProtocol = eprosima::fastdds::rtps::DiscoveryProtocol; @@ -6285,9 +6259,6 @@ void dds_usecase_examples() IPLocator::setIPv4(server_locator, "192.168.10.57"); server_locator.port = 56542; qos.wire_protocol().builtin.metatrafficUnicastLocatorList.push_back(server_locator); - - // Set the GUID prefix to identify this server - std::istringstream("72.61.73.70.66.61.72.6d.74.65.73.74") >> qos.wire_protocol().prefix; //!-- } @@ -6303,14 +6274,8 @@ void dds_usecase_examples() IPLocator::setIPv4(remote_server_locator, "192.168.10.57"); remote_server_locator.port = 56542; - RemoteServerAttributes remote_server_attr; - remote_server_attr.metatrafficUnicastLocatorList.push_back(remote_server_locator); - - // Set the GUID prefix to identify the remote server - remote_server_attr.ReadguidPrefix("72.61.73.70.66.61.72.6d.74.65.73.74"); - // Connect to the SERVER at the previous locator - qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_attr); + qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_locator); //!-- } @@ -6324,6 +6289,7 @@ void dds_usecase_examples() // Configure participant_1 as SERVER listening on the previous locator DomainParticipantQos server_1_qos; server_1_qos.wire_protocol().builtin.discovery_config.discoveryProtocol = DiscoveryProtocol::SERVER; + // Optional GUID std::istringstream("75.63.2D.73.76.72.63.6C.6E.74.2D.31") >> server_1_qos.wire_protocol().prefix; server_1_qos.wire_protocol().builtin.metatrafficUnicastLocatorList.push_back(server_locator_1); @@ -6335,6 +6301,7 @@ void dds_usecase_examples() // Configure participant_2 as SERVER listening on the previous locator DomainParticipantQos server_2_qos; server_2_qos.wire_protocol().builtin.discovery_config.discoveryProtocol = DiscoveryProtocol::SERVER; + // Optional GUID std::istringstream("75.63.2D.73.76.72.63.6C.6E.74.2D.32") >> server_2_qos.wire_protocol().prefix; server_2_qos.wire_protocol().builtin.metatrafficUnicastLocatorList.push_back(server_locator_2); //!-- @@ -6347,24 +6314,16 @@ void dds_usecase_examples() IPLocator::setIPv4(remote_server_locator_1, "192.168.10.57"); remote_server_locator_1.port = 56542; - RemoteServerAttributes remote_server_attr_1; - remote_server_attr_1.ReadguidPrefix("75.63.2D.73.76.72.63.6C.6E.74.2D.31"); - remote_server_attr_1.metatrafficUnicastLocatorList.push_back(remote_server_locator_1); - // Define a locator for the second SERVER Participant Locator_t remote_server_locator_2; IPLocator::setIPv4(remote_server_locator_2, "192.168.10.60"); remote_server_locator_2.port = 56543; - RemoteServerAttributes remote_server_attr_2; - remote_server_attr_2.ReadguidPrefix("75.63.2D.73.76.72.63.6C.6E.74.2D.32"); - remote_server_attr_2.metatrafficUnicastLocatorList.push_back(remote_server_locator_2); - // Configure the current participant as CLIENT connecting to the SERVERS at the previous locators DomainParticipantQos client_qos; client_qos.wire_protocol().builtin.discovery_config.discoveryProtocol = DiscoveryProtocol::CLIENT; - client_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_attr_1); - client_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_attr_2); + client_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_locator_1); + client_qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_locator_2); //!-- } @@ -6378,6 +6337,7 @@ void dds_usecase_examples() server_locator.port = 56543; qos.wire_protocol().builtin.discovery_config.discoveryProtocol = DiscoveryProtocol::SERVER; + // Optional GUID std::istringstream("75.63.2D.73.76.72.63.6C.6E.74.2D.31") >> qos.wire_protocol().prefix; qos.wire_protocol().builtin.metatrafficUnicastLocatorList.push_back(server_locator); @@ -6386,11 +6346,7 @@ void dds_usecase_examples() IPLocator::setIPv4(remote_server_locator, "192.168.10.57"); remote_server_locator.port = 56542; - RemoteServerAttributes remote_server_attr; - remote_server_attr.ReadguidPrefix("75.63.2D.73.76.72.63.6C.6E.74.2D.32"); - remote_server_attr.metatrafficUnicastLocatorList.push_back(remote_server_locator); - - qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_attr); + qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_locator); //!-- } @@ -6404,6 +6360,7 @@ void dds_usecase_examples() server_locator.port = 56541; qos.wire_protocol().builtin.discovery_config.discoveryProtocol = DiscoveryProtocol::SERVER; + // Optional GUID std::istringstream("75.63.2D.73.76.72.63.6C.6E.74.2D.33") >> qos.wire_protocol().prefix; qos.wire_protocol().builtin.metatrafficUnicastLocatorList.push_back(server_locator); @@ -6412,22 +6369,14 @@ void dds_usecase_examples() IPLocator::setIPv4(remote_server_locator_A, "192.168.10.60"); remote_server_locator_A.port = 56543; - RemoteServerAttributes remote_server_attr_A; - remote_server_attr_A.ReadguidPrefix("75.63.2D.73.76.72.63.6C.6E.74.2D.31"); - remote_server_attr_A.metatrafficUnicastLocatorList.push_back(remote_server_locator_A); - - qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_attr_A); + qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_locator_A); // Add the connection attributes to the remote server B. Locator_t remote_server_locator_B; IPLocator::setIPv4(remote_server_locator_B, "192.168.10.57"); remote_server_locator_B.port = 56542; - RemoteServerAttributes remote_server_attr_B; - remote_server_attr_B.ReadguidPrefix("75.63.2D.73.76.72.63.6C.6E.74.2D.32"); - remote_server_attr_B.metatrafficUnicastLocatorList.push_back(remote_server_locator_B); - - qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_attr_B); + qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_locator_B); //!-- } @@ -7542,9 +7491,6 @@ void tcp_use_cases() eprosima::fastdds::rtps::IPLocator::setPhysicalPort(listening_locator, tcp_listening_port); eprosima::fastdds::rtps::IPLocator::setLogicalPort(listening_locator, tcp_listening_port); qos.wire_protocol().builtin.metatrafficUnicastLocatorList.push_back(listening_locator); - - // Set the GUID prefix to identify this server - std::istringstream("44.53.00.5f.45.50.52.4f.53.49.4d.41") >> qos.wire_protocol().prefix; //!-- } @@ -7568,15 +7514,8 @@ void tcp_use_cases() eprosima::fastdds::rtps::IPLocator::setPhysicalPort(server_locator, server_port); eprosima::fastdds::rtps::IPLocator::setLogicalPort(server_locator, server_port); - // Define the server attributes - eprosima::fastdds::rtps::RemoteServerAttributes remote_server_att; - remote_server_att.metatrafficUnicastLocatorList.push_back(server_locator); - - // Set the GUID prefix to identify this server - std::istringstream("44.53.00.5f.45.50.52.4f.53.49.4d.41") >> remote_server_att.guidPrefix; - // Add the server - qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_att); + qos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(server_locator); //!-- } } diff --git a/code/XMLTester.xml b/code/XMLTester.xml index b71957f08..09e0c13b0 100644 --- a/code/XMLTester.xml +++ b/code/XMLTester.xml @@ -879,7 +879,6 @@ XML-DS-CLI-XML-CONF<--> - 44.53.01.5f.45.50.52.4f.53.49.4d.41 SERVER @@ -898,7 +897,6 @@ - 44.53.02.5f.45.50.52.4f.53.49.4d.41 SERVER @@ -923,7 +921,6 @@ - 44.53.00.5f.45.50.52.4f.53.49.4d.41 SERVER @@ -1591,24 +1588,18 @@ CLIENT - - - - -
192.168.10.57
- 56542 -
-
-
- - - -
192.168.10.58
- 24565 -
-
-
-
+ + +
192.168.10.57
+ 56542 +
+
+ + +
192.168.10.58
+ 24565 +
+
FILTER_DIFFERENT_HOST @@ -2411,7 +2402,6 @@
- 72.61.73.70.66.61.72.6d.74.65.73.74
<--> @@ -2427,24 +2417,12 @@ CLIENT - - - - -
192.168.10.57
- 56542 -
-
-
- - - -
192.168.10.58
- 24565 -
-
-
-
+ + +
192.168.10.57
+ 56542 +
+
@@ -2459,6 +2437,7 @@ --> + 75.63.2D.73.76.72.63.6C.6E.74.2D.31 @@ -2478,6 +2457,7 @@ + 75.63.2D.73.76.72.63.6C.6E.74.2D.32 @@ -2507,26 +2487,18 @@ CLIENT - - - - -
192.168.10.57
- 56542 -
-
-
-
- - - - -
192.168.10.60
- 56543 -
-
-
-
+ + +
192.168.10.57
+ 56542 +
+
+ + +
192.168.10.60
+ 56543 +
+
@@ -2541,21 +2513,18 @@ --> + 75.63.2D.73.76.72.63.6C.6E.74.2D.31 SERVER - - - - -
192.168.10.57
- 56542 -
-
-
-
+ + +
192.168.10.57
+ 56542 +
+
@@ -2578,31 +2547,24 @@ --> + 75.63.2D.73.76.72.63.6C.6E.74.2D.33 SERVER - - - - -
192.168.10.57
- 56542 -
-
-
-
- - - - -
192.168.10.60
- 56543 -
-
-
-
+ + +
192.168.10.57
+ 56542 +
+
+ + +
192.168.10.60
+ 56543 +
+
@@ -2906,17 +2868,13 @@ - - - - - -
192.168.1.113
- 64863 -
-
-
-
+ + + +
192.168.1.113
+ 64863 +
+
@@ -2969,18 +2927,14 @@ - - - CONF_SERVER_DNS_LOCATORS<--> - - - 11811 -
localhost
-
-
- <--> -
-
+ CONF_SERVER_DNS_LOCATORS<--> + + + 11811 +
localhost
+
+
+ <-->
@@ -2994,36 +2948,25 @@ --> - - 44.53.00.5f.45.50.52.4f.53.49.4d.41 SERVER - - - - - - -
127.0.0.1
- 11812 -
-
-
-
+ + + +
127.0.0.1
+ 11812 +
+
- + @@ -3049,26 +2992,17 @@ CLIENT - - - - - - -
127.0.0.1
- 11811 -
-
-
-
+ + + +
127.0.0.1
+ 11811 +
+
@@ -4055,37 +3989,6 @@ <--> -CONF-SERVER-CLIENT-PREFIX<--> - - - - - - - - - - - -
192.168.10.57
- 56542 -
-
-
-
-
-
-
-
-
- -<--> - LARGE_DATA_BUILTIN_TRANSPORTS<--> - - - -
192.168.10.57
- 12345 - 12345 -
-
-
- + + + +
192.168.10.57
+ 12345 + 12345 +
+
diff --git a/code/XMLTesterExample.xml b/code/XMLTesterExample.xml index eae536db0..dc259bdfc 100644 --- a/code/XMLTesterExample.xml +++ b/code/XMLTesterExample.xml @@ -228,42 +228,30 @@ NONE - - - - -
192.168.10.57
- 56542 -
-
-
- - - -
192.168.10.58
- 24565 -
-
-
-
- - - - -
192.168.10.59
- 56543 -
-
-
- - - -
192.168.10.60
- 34565 -
-
-
-
+ + +
192.168.10.57
+ 56542 +
+
+ + +
192.168.10.58
+ 24565 +
+
+ + +
192.168.10.59
+ 56543 +
+
+ + +
192.168.10.60
+ 34565 +
+
FILTER_DIFFERENT_PROCESS|FILTER_SAME_PROCESS SIMPLE diff --git a/docs/03-exports/aliases-api.include b/docs/03-exports/aliases-api.include index a20c10ad7..c36554d81 100644 --- a/docs/03-exports/aliases-api.include +++ b/docs/03-exports/aliases-api.include @@ -885,10 +885,6 @@ .. |EntityId_t-api| replace:: :cpp:struct:`EntityId_t` .. |InitialAnnouncementConfig-api| replace:: :cpp:struct:`InitialAnnouncementConfig` .. |InitialAnnouncementConfig::period-api| replace:: :cpp:member:`period` -.. |RemoteServerAttributes-api| replace:: :cpp:class:`RemoteServerAttributes` -.. |RemoteServerAttributes::metatrafficUnicastLocatorList-api| replace:: :cpp:member:`metatrafficUnicastLocatorList` -.. |RemoteServerAttributes::metatrafficMulticastLocatorList-api| replace:: :cpp:member:`metatrafficMulticastLocatorList` -.. |RemoteServerAttributes::guidPrefix-api| replace:: :cpp:member:`guidPrefix` .. |BuiltinAttributes-api| replace:: :cpp:class:`BuiltinAttributes` .. |BuiltinAttributes::discovery_config-api| replace:: :cpp:member:`discovery_config` .. |BuiltinAttributes::metatrafficUnicastLocatorList-api| replace:: :cpp:member:`metatrafficUnicastLocatorList` diff --git a/docs/fastdds/api_reference/rtps/attributes/RemoteServerAttributes.rst b/docs/fastdds/api_reference/rtps/attributes/RemoteServerAttributes.rst deleted file mode 100644 index bb908c8d3..000000000 --- a/docs/fastdds/api_reference/rtps/attributes/RemoteServerAttributes.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. rst-class:: api-ref - -RemoteServerAttributes --------------------------------- - -.. doxygenclass:: eprosima::fastdds::rtps::RemoteServerAttributes - :project: FastDDS - :members: diff --git a/docs/fastdds/api_reference/rtps/attributes/RemoteServerList_t.rst b/docs/fastdds/api_reference/rtps/attributes/RemoteServerList_t.rst deleted file mode 100644 index a9a8b3085..000000000 --- a/docs/fastdds/api_reference/rtps/attributes/RemoteServerList_t.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. rst-class:: api-ref - -RemoteServerList_t ------------------------- - -.. doxygentypedef:: eprosima::fastdds::rtps::RemoteServerList_t - :project: FastDDS diff --git a/docs/fastdds/api_reference/rtps/attributes/attributes.rst b/docs/fastdds/api_reference/rtps/attributes/attributes.rst index 1927fd789..ed74309dd 100644 --- a/docs/fastdds/api_reference/rtps/attributes/attributes.rst +++ b/docs/fastdds/api_reference/rtps/attributes/attributes.rst @@ -20,8 +20,6 @@ Attributes /fastdds/api_reference/rtps/attributes/ReaderAttributes /fastdds/api_reference/rtps/attributes/ReaderTimes /fastdds/api_reference/rtps/attributes/RemoteLocatorsAllocationAttributes - /fastdds/api_reference/rtps/attributes/RemoteServerAttributes - /fastdds/api_reference/rtps/attributes/RemoteServerList_t /fastdds/api_reference/rtps/attributes/RTPSParticipantAllocationAttributes /fastdds/api_reference/rtps/attributes/RTPSParticipantAttributes /fastdds/api_reference/rtps/attributes/RTPSWriterPublishMode diff --git a/docs/fastdds/discovery/discovery_server.rst b/docs/fastdds/discovery/discovery_server.rst index 4f2ba6e5d..d0e1f5efe 100644 --- a/docs/fastdds/discovery/discovery_server.rst +++ b/docs/fastdds/discovery/discovery_server.rst @@ -43,41 +43,37 @@ In this architecture there are several key concepts to understand: The only difference between them is how they handle discovery traffic. The user traffic, that is, the traffic among the DataWriters and DataReaders they create, is role-independent. -- All *server* and *client* discovery information will be shared with linked *clients*. - Note that a *server* may act as a *client* for other *servers*. - - A |SERVER| is a participant to which the *clients* (and maybe other *servers*) send their discovery information. - The role of the *server* is to re-distribute the *clients* (and *servers*) discovery information to their known - *clients* and *servers*. - A *server* may connect to other *servers* to receive information about their *clients*. - Known *servers* will receive all the information known by the *server*. - Known *clients* will only receive the information they need to establish communication, i.e. the information about the - DomainParticipants, DataWriters, and DataReaders to which they match. - This means that the *server* runs a "matching" algorithm to sort out which information is required by which *client*. + + * The role of the *server* is to redistribute its *clients* discovery information to its known + *clients* and *servers*. + * A *server* also announces the existence of a new *server* to its known *servers*, and vice versa. + In this way, a new server can connect to every other existing *server* in the network by just knowing the + existence of one of them. + * The discovery information that is redistributed might come from a **direct** *client* connected to the |SERVER|, + or from another *server* that is redirecting the discovery data from **its** *clients*. + * Known *servers* will receive all the information from the **direct** *clients* known by the *server* and the + participant information of other *servers* (to announce a new server). + * Known *clients* will only receive the information they need to establish communication, i.e. the information + about the DomainParticipants, DataWriters, and DataReaders to which they match. + This means that the *server* runs a "matching" algorithm to sort out which information is required by which + *client*. - A |BACKUP| *server* is a *server* that persists its discovery database into a file. - This type of *server* can load the network graph from a file on start-up without the need of receiving any *client's* - information. - It can be used to persist the *server* knowledge about the network between runs, thus securing the *server's* - information in case of unexpected shutdowns. - It is important to note that the discovery times will be negatively affected when using this type of *server*, since - periodically writing to a file is an expensive operation. + + * This type of *server* can load the network graph from a file on start-up without the need of receiving any + *client's* information. + * It can be used to persist the *server* knowledge about the network between runs, thus securing the *server's* + information in case of unexpected shutdowns. + * It is important to note that the discovery times will be negatively affected when using this type of *server*, + since periodically writing to a file is an expensive operation. - A |CLIENT| is a participant that connects to one or more *servers* from which it receives only the discovery information they require to establish communication with matching endpoints. -- *Clients* require prior knowledge of the *servers* to which they want to link. - Basically it is reduced to the *servers* identity (henceforth called |GuidPrefix_t-api|) and a list of locators - where the *servers* are listening. - These locators also define the transport protocol (UDP or TCP) the client will use to contact the *server*. - - - The |GuidPrefix_t-api| is the RTPS standard RTPSParticipant unique identifier, a 12-byte chain. - This identifier allows *clients* to assess whether they are receiving messages from the right *server*, as each - standard RTPS message contains this piece of information. - - The |GuidPrefix_t-api| is used because the *server's* IP address may not be a reliable enough server identifier, - since several *servers* can be hosted in the same machine, thus having the same IP, and also because multicast - addresses are acceptable addresses. + * *Clients* require prior knowledge of the *servers* to which they want to link. + Basically, it consists of a list of locators where the *servers* are listening, namely, an IP address and a port. + These locators also define the transport protocol (UDP or TCP) the client will use to contact the *server*. - A |SUPER_CLIENT| is a *client* that receives the discovery information known by the *server*, in opposition to *clients*, which only receive the information they need. @@ -86,10 +82,11 @@ In this architecture there are several key concepts to understand: A |SUPER_CLIENT| does not behave as a *Server* as it only receives the discovery information through the *Server* to which it is connected. + It will not connect to other servers, and it will not redistribute the information it receives. Any DomainParticipant discovered by the *Server* with no endpoints will not be known by the |SUPER_CLIENT|. -- *Servers* do not require any prior knowledge of their *clients*, but their |GuidPrefix_t-api| and locator list - (where they are listening) must match the one provided to the *clients*. +- *Servers* do not require any prior knowledge of their *clients*, but they must listen in the address specified + by the locator provided to the *clients*. *Clients* send discovery messages to the *servers* at regular intervals (ping period) until they receive message reception acknowledgement. From then on, the *server* knows about the *client* and will inform it of the relevant discovery information. @@ -105,109 +102,24 @@ A participant can only play one role (despite the fact that a *server* may conne It is mandatory to fill this value because it defaults to |SIMPLE|. The examples below shows how to set this parameter both programmatically and using XML. -+----------------------------------------------------------------------------------------------------------------------+ -| **C++** | -+----------------------------------------------------------------------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_SERVER_DISCOVERY_PROTOCOL | -| :end-before: //!-- | -| :dedent: 8 | -+----------------------------------------------------------------------------------------------------------------------+ -| **XML** | -+----------------------------------------------------------------------------------------------------------------------+ -| .. literalinclude:: /../code/XMLTester.xml | -| :language: xml | -| :start-after: CONF-SERVER-DISCOVERY-PROTOCOL<--> | -| :end-before: <--> | -| :lines: 2-3,5-18 | -| :append: | -+----------------------------------------------------------------------------------------------------------------------+ - -.. _DS_guidPrefix: - -The GuidPrefix as the server unique identifier -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The |GuidPrefix_t-api| attribute belongs to the RTPS specification and univocally identifies each RTPSParticipant. -It consists on 12 bytes, and in Fast DDS is a key for the DomainParticipant used in the DDS domain. -Fast DDS defines the DomainParticipant |GuidPrefix_t-api| as a public data member of the -|WireProtocolConfigQos-api| class. -In the Discovery Server, it has the purpose to link a *server* to its *clients*. -It must be specified in *server* and *client* setups. +.. tabs:: -Server side setup -""""""""""""""""" + .. tab:: **C++** -The examples below show how to manage the corresponding enum data member and XML tag. + .. literalinclude:: /../code/DDSCodeTester.cpp + :language: c++ + :start-after: //CONF_SERVER_DISCOVERY_PROTOCOL + :end-before: //!-- + :dedent: 8 -+----------------------------------------------------------------------------------------------------------------------+ -| **C++** - Option 1: Manual setting of the ``unsigned char`` in ASCII format. | -+----------------------------------------------------------------------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_SERVER_SERVER_GUIDPREFIX_OPTION_1 | -| :end-before: //!-- | -| :dedent: 8 | -+----------------------------------------------------------------------------------------------------------------------+ -| **C++** - Option 2: Using the ``>>`` operator and the ``std::istringstream`` type. | -+----------------------------------------------------------------------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_SERVER_SERVER_GUIDPREFIX_OPTION_2 | -| :end-before: //!-- | -| :dedent: 8 | -+----------------------------------------------------------------------------------------------------------------------+ -| **XML** | -+----------------------------------------------------------------------------------------------------------------------+ -| .. literalinclude:: /../code/XMLTester.xml | -| :language: xml | -| :start-after: CONF-SERVER-SERVER-PREFIX<--> | -| :end-before: <--> | -| :lines: 2-3,5- | -| :append: | -+----------------------------------------------------------------------------------------------------------------------+ - -Note that a *server* can connect to other *servers*. -Thus, the following section may also apply. + .. tab:: **XML** -.. important:: - When selecting a GUID prefix for the *server*, it is important to take into account that Fast DDS also uses this - parameter to identify participants in the same process and enable intra-process communications. - Setting two DomainParticipant GUID prefixes as intra-process compatible will result in no communication if the - DomainParticipants run in separate processes. - For more information, please refer to :ref:`intraprocess_delivery_guids`. - -.. warning:: - Launching more than one server using the same GUID prefix is undefined behavior. - -Client side setup -""""""""""""""""" - -Each *client* must keep a list of the *servers* to which it wants to link. -Each single element represents an individual server, and a |GuidPrefix_t-api| must be provided. -The *server* list must be populated with |RemoteServerAttributes-api| objects with a valid |GuidPrefix_t-api| data -member. -In XML the server list and its elements are simultaneously specified. -Note that ``prefix`` is an element of the ``RemoteServer`` tag. - -+----------------------------------------------------------------------------------------------------------------------+ -| **C++** | -+----------------------------------------------------------------------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_SERVER_CLIENT_GUIDPREFIX | -| :end-before: //!-- | -| :dedent: 8 | -+----------------------------------------------------------------------------------------------------------------------+ -| **XML** | -+----------------------------------------------------------------------------------------------------------------------+ -| .. literalinclude:: /../code/XMLTester.xml | -| :language: xml | -| :start-after: CONF-SERVER-CLIENT-PREFIX<--> | -| :end-before: <--> | -| :lines: 2-3,5-11,20-25,27 | -+----------------------------------------------------------------------------------------------------------------------+ + .. literalinclude:: /../code/XMLTester.xml + :language: xml + :start-after: CONF-SERVER-DISCOVERY-PROTOCOL<--> + :end-before: <--> + :lines: 2-3,5-18 + :append: .. _DS_locators: @@ -216,31 +128,36 @@ The server locator list Each *server* must specify valid locators where it can be reached. Any *client* must be given proper locators to reach each of its *servers*. -As in the :ref:`above section `, here there is a *server* and a *client* side setup. +Below are two examples of a *server* and a *client* side setup. Server side setup """"""""""""""""" The examples below show how to setup the server locator list and XML tag. +Each locator must contain: + +- IP address. +- Port. +- Transport protocol (UDPv4/6 or TCPv4/6). + +.. tabs:: + + .. tab:: **C++** + + .. literalinclude:: /../code/DDSCodeTester.cpp + :language: c++ + :start-after: //CONF_SERVER_SERVER_LOCATORS + :end-before: //!-- + :dedent: 8 + + .. tab:: **XML** -+----------------------------------------------------------------------------------------------------------------------+ -| **C++** | -+----------------------------------------------------------------------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_SERVER_SERVER_LOCATORS | -| :end-before: //!-- | -| :dedent: 8 | -+----------------------------------------------------------------------------------------------------------------------+ -| **XML** | -+----------------------------------------------------------------------------------------------------------------------+ -| .. literalinclude:: /../code/XMLTester.xml | -| :language: xml | -| :start-after: CONF-SERVER-SERVER-LOCATORS<--> | -| :end-before: <--> | -| :lines: 2-3,5-19 | -| :append: | -+----------------------------------------------------------------------------------------------------------------------+ + .. literalinclude:: /../code/XMLTester.xml + :language: xml + :start-after: CONF-SERVER-SERVER-LOCATORS<--> + :end-before: <--> + :lines: 2-3,5-19 + :append: Note that a *server* can connect to other *servers*, thus, the following section may also apply. @@ -248,30 +165,36 @@ Client side setup """"""""""""""""" Each *client* must keep a list of locators associated to the *servers* to which it wants to link. -Each *server* specifies its own locator list which must be populated with |RemoteServerAttributes-api| objects with a -valid ``metatrafficUnicastLocatorList`` or ``metatrafficMulticastLocatorList``. -In XML the server list and its elements are simultaneously specified. -Note the ``metatrafficUnicastLocatorList`` or ``metatrafficMulticastLocatorList`` are elements of the ``RemoteServer`` -tag. - -+----------------------------------------------------------------------------------------------------------------------+ -| **C++** | -+----------------------------------------------------------------------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_SERVER_CLIENT_LOCATORS | -| :end-before: //!-- | -| :dedent: 8 | -+----------------------------------------------------------------------------------------------------------------------+ -| **XML** | -+----------------------------------------------------------------------------------------------------------------------+ -| .. literalinclude:: /../code/XMLTester.xml | -| :language: xml | -| :start-after: CONF-SERVER-CLIENT-LOCATORS<--> | -| :end-before: <--> | -| :lines: 2-3,5-25 | -| :append: | -+----------------------------------------------------------------------------------------------------------------------+ + +Note that providing an unreachable locator will result in the *client* sending ping messages to that direction at +regular intervals until it is connected to the same amount of servers that has been configured in the locator list. + +.. tabs:: + + .. tab:: **C++** + + .. literalinclude:: /../code/DDSCodeTester.cpp + :language: c++ + :start-after: //CONF_SERVER_CLIENT_LOCATORS + :end-before: //!-- + :dedent: 8 + + .. tab:: **XML** + + .. literalinclude:: /../code/XMLTester.xml + :language: xml + :start-after: CONF-SERVER-CLIENT-LOCATORS<--> + :end-before: <--> + :lines: 2-3,5-21 + :append: + +.. note:: + + Additionally, a logical port can be specified in the locator. + If this parameters is left empty, Fast DDS will automatically assign a logical port equal to the physical + port whenever it is needed. + This behavior is coherent with the logic implemented in the :ref:`env_vars_ros_discovery_server` environment + variable and the :ref:`Fast DDS CLI` tool. .. _DS_ping_period: @@ -279,28 +202,87 @@ Fine tuning discovery server handshake ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ As explained :ref:`above ` the *clients* send discovery messages to the *servers* at regular -intervals (ping period) until they receive message reception acknowledgement. +intervals (ping period) until they receive as many message reception acknowledgement as remote locators +(server addresses) were specified. Mind that this period also applies for those *servers* which connect to other *servers*. -The default value for this period is 450 ms. - -+----------------------------------------------------------------------------------------------------------------------+ -| **C++** | -+----------------------------------------------------------------------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_SERVER_CLIENT_PING | -| :end-before: //!-- | -| :dedent: 8 | -+----------------------------------------------------------------------------------------------------------------------+ -| **XML** | -+----------------------------------------------------------------------------------------------------------------------+ -| .. literalinclude:: /../code/XMLTester.xml | -| :language: xml | -| :start-after: CONF-SERVER-CLIENT-PING<--> | -| :end-before: <--> | -| :lines: 2-3,5-16 | -| :append: | -+----------------------------------------------------------------------------------------------------------------------+ +The default value for this period is 450 ms, but it can be configured to a different value. + +.. tabs:: + + .. tab:: **C++** + + .. literalinclude:: /../code/DDSCodeTester.cpp + :language: c++ + :start-after: //CONF_SERVER_CLIENT_PING + :end-before: //!-- + :dedent: 8 + + .. tab:: **XML** + + .. literalinclude:: /../code/XMLTester.xml + :language: xml + :start-after: CONF-SERVER-CLIENT-PING<--> + :end-before: <--> + :lines: 2-3,5-16 + :append: + +.. _DS_guidPrefix: + +The GuidPrefix as an optional server unique identifier +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The |GuidPrefix_t-api| attribute belongs to the RTPS specification and univocally identifies each RTPSParticipant. +It consists on 12 bytes, and in Fast DDS is a key for the DomainParticipant used in the DDS domain. +Fast DDS defines the DomainParticipant |GuidPrefix_t-api| as a public data member of the +|WireProtocolConfigQos-api| class. +In the new Discovery Server mechanism, it is a completely optional parameter. +However, it might be required in specific scenarios to operate with Discovery Server entities of Fast DDS v2.x or +older, where the |GuidPrefix_t-api| was mandatory. + +Server side setup +""""""""""""""""" + +The examples below show how to manage the corresponding enum data member and XML tag. + +.. tabs:: + + .. tab:: **C++** - Option 1 + + .. literalinclude:: /../code/DDSCodeTester.cpp + :language: c++ + :start-after: //CONF_SERVER_SERVER_GUIDPREFIX_OPTION_1 + :end-before: //!-- + :dedent: 8 + + .. tab:: **C++** - Option 2 + + .. literalinclude:: /../code/DDSCodeTester.cpp + :language: c++ + :start-after: //CONF_SERVER_SERVER_GUIDPREFIX_OPTION_2 + :end-before: //!-- + :dedent: 8 + + .. tab:: **XML** + + .. literalinclude:: /../code/XMLTester.xml + :language: xml + :start-after: CONF-SERVER-SERVER-PREFIX<--> + :end-before: <--> + :lines: 2-3,5- + :append: + +.. important:: + When selecting a GUID prefix for the *server*, it is important to take into account that Fast DDS also uses this + parameter to identify participants in the same host or process and translate locators to localhost or enable + intra-process communications. + It is recommended to let Fast DDS to automatically generate the GUID prefix to guarantee the correct behavior of + these features. + Setting two DomainParticipant GUID prefixes as intra-process compatible will result in no communication if the + DomainParticipants run in separate processes. + For more information, please refer to :ref:`intraprocess_delivery_guids`. + +.. warning:: + Launching more than one server using the same GUID prefix is undefined behavior. .. _DS_modify_server_list: @@ -315,9 +297,10 @@ This feature allows to include a new remote server into the Discovery Server net in case that the remote server is relaunched with a different listening locator. .. important:: - The list of remote *servers* can only be modified to either add more *servers*, or modify the remote server - locator, but not to remove any of the existing ones. - This means that the new list passed to |DomainParticipant::set_qos-api| must be a superset of the existing one. + The updated list of remote *servers* will modify the ping routine of a *client* or *server*, but it will not + affect the already established connections. + Hence, deleting a locator from the list will not disconnect the *server* or *client* from the remote server. + However, it will impede reconnection if the connection is lost. .. note:: The remote server list can also be modified using the ``ROS_DISCOVERY_SERVER`` environment variable. @@ -327,16 +310,15 @@ in case that the remote server is relaunched with a different listening locator. It is strongly advised to use either the API or the environment file. Using both at the same time may cause undefined behavior. -+---------------------------------------------------------------------+ -| **C++** | -+---------------------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_SERVER_ADD_SERVERS | -| :end-before: //!-- | -| :dedent: 8 | -| | -+---------------------------------------------------------------------+ +.. tabs:: + + .. tab:: **C++** + + .. literalinclude:: /../code/DDSCodeTester.cpp + :language: c++ + :start-after: //CONF_SERVER_ADD_SERVERS + :end-before: //!-- + :dedent: 8 .. _DS_dns_name: @@ -358,49 +340,46 @@ similar to the one discussed in this section, as well as multiple other examples Server side setup """"""""""""""""" -+---------------------------------------------------------------------+ -| **C++** | -+---------------------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_SERVER_FULL_EXAMPLE | -| :end-before: //!-- | -| :dedent: 8 | -| | -+---------------------------------------------------------------------+ -| **XML** | -+---------------------------------------------------------------------+ -| .. literalinclude:: /../code/XMLTester.xml | -| :language: xml | -| :start-after: CONF_SERVER_FULL_EXAMPLE<--> | -| :end-before: <--> | -| :lines: 2-3,5-47 | -| :append: | -+---------------------------------------------------------------------+ +.. tabs:: + + .. tab:: **C++** + + .. literalinclude:: /../code/DDSCodeTester.cpp + :language: c++ + :start-after: //CONF_SERVER_FULL_EXAMPLE + :end-before: //!-- + :dedent: 8 + .. tab:: XML + + .. literalinclude:: /../code/XMLTester.xml + :language: xml + :start-after: CONF_SERVER_FULL_EXAMPLE<--> + :end-before: <--> + :lines: 2-3,5-36 + :append: Client side setup """"""""""""""""" -+---------------------------------------------------------------------+ -| **C++** | -+---------------------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_CLIENT_FULL_EXAMPLE | -| :end-before: //!-- | -| :dedent: 8 | -| | -+---------------------------------------------------------------------+ -| **XML** | -+---------------------------------------------------------------------+ -| .. literalinclude:: /../code/XMLTester.xml | -| :language: xml | -| :start-after: CONF_CLIENT_FULL_EXAMPLE<--> | -| :end-before: <--> | -| :lines: 2-3,5-40 | -| :append: | -+---------------------------------------------------------------------+ +.. tabs:: + + .. tab:: **C++** + + .. literalinclude:: /../code/DDSCodeTester.cpp + :language: c++ + :start-after: //CONF_CLIENT_FULL_EXAMPLE + :end-before: //!-- + :dedent: 8 + + .. tab:: **XML** + + .. literalinclude:: /../code/XMLTester.xml + :language: xml + :start-after: CONF_CLIENT_FULL_EXAMPLE<--> + :end-before: <--> + :lines: 2-3,5-31 + :append: .. _DS_security: diff --git a/docs/fastdds/env_vars/env_vars.rst b/docs/fastdds/env_vars/env_vars.rst index d17ba975d..874db737c 100644 --- a/docs/fastdds/env_vars/env_vars.rst +++ b/docs/fastdds/env_vars/env_vars.rst @@ -221,45 +221,32 @@ Setting this variable configures the :ref:`DomainParticipant*) must be able to resolve to an IPv6 address. Otherwise an error will be raised. The following example shows how to set the address of two remote discovery servers with addresses -'84.22.259.329:8888' and 'localhost:1234' and IDs 0 and 2 respectively. +'84.22.259.329:8888' and 'localhost:1234'. +----------------------------------------------------------------------------+ | **Linux** | +----------------------------------------------------------------------------+ | .. code-block:: bash | | | - | export ROS_DISCOVERY_SERVER="84.22.259.329:8888;;localhost:1234" | + | export ROS_DISCOVERY_SERVER="84.22.259.329:8888;localhost:1234" | +----------------------------------------------------------------------------+ | **Windows** | +----------------------------------------------------------------------------+ | .. code-block:: bash | | | - | set ROS_DISCOVERY_SERVER=84.22.259.329:8888;;localhost:1234 | + | set ROS_DISCOVERY_SERVER=84.22.259.329:8888;localhost:1234 | +----------------------------------------------------------------------------+ .. important:: IP addresses specified in ``ROS_DISCOVERY_SERVER`` must be either valid IPv4/IPv6 addresses or domain names. If a name can be resolved into several addresses, it is possible to either use them all or restrict the selection to - the first IPv4 using the `UDPv4:` or `TCPv4` prefixes or to the first IPv6 address using the `UDPv6:` or `TCPv6` + the first IPv4 using the `UDPv4` or `TCPv4` prefixes or to the first IPv6 address using the `UDPv6` or `TCPv6` prefixes. -.. important:: - This environment variable is meant to be used in combination with :ref:`Fast DDS discovery CLI`. - The *server*'s ID is used by *Fast DDS* to derived the |GuidPrefix_t-api| of the *server*. - If the *server* is not instantiated using the CLI, the *server*'s GUID prefix should adhere to the same schema - as the one generated from the CLI. - Else, the *clients* configured with this environment variable will not be able to establish a connection with - the *server*, thus not being able to connect to other *clients* either. - The *server*'s GUID prefixes generated by the CLI comply with the following schema: - ``44.53..5f.45.50.52.4f.53.49.4d.41``. - This prefix schema has been chosen for its ASCII translation: ``DS_EPROSIMA``. - .. important:: This environment variable can be changed at runtime adding new remote servers to a |SERVER|, |BACKUP| or |CLIENT| (that has been initialized with this environment variable previously) if loaded from an environment file using diff --git a/docs/fastdds/ros2/discovery_server/ros2_discovery_server.rst b/docs/fastdds/ros2/discovery_server/ros2_discovery_server.rst index 223f15ca7..8418020d3 100644 --- a/docs/fastdds/ros2/discovery_server/ros2_discovery_server.rst +++ b/docs/fastdds/ros2/discovery_server/ros2_discovery_server.rst @@ -107,13 +107,14 @@ which allows to launch a server. This server will manage the discovery process f Setup Discovery Server ^^^^^^^^^^^^^^^^^^^^^^^ -Start by launching a server with id 0, with port 11811 and listening on all available interfaces. +Start by launching a server with port 11811 and listening on all available interfaces, which is the default +configuration for the ``fastdds`` :ref:`CLI tool `. Open a new terminal and run: .. code-block:: console - fastdds discovery -i 0 + fastdds discovery Launch node listener @@ -126,7 +127,7 @@ In a new terminal, set the environment variable ``ROS_DISCOVERY_SERVER`` to use .. code-block:: console - export ROS_DISCOVERY_SERVER="127.0.0.1:11811" + export ROS_DISCOVERY_SERVER=127.0.0.1:11811 Afterwards, launch the listener node. Use the argument ``--remap __node:=listener_discovery_server`` to change the node's name for future purpose. @@ -146,7 +147,7 @@ Open a new terminal and set the environment variable as before, so the node rais .. code-block:: console - export ROS_DISCOVERY_SERVER="127.0.0.1:11811" + export ROS_DISCOVERY_SERVER=127.0.0.1:11811 ros2 run demo_nodes_cpp talker --ros-args --remap __node:=talker_discovery_server Now, we should see the talker publishing *Hello World* messages, and the listener receiving these messages. @@ -199,14 +200,11 @@ In different terminals, run the next code to establish a communication over redu .. code-block:: console - fastdds discovery -i 0 -l 127.0.0.1 -p 11811 + fastdds discovery -l 127.0.0.1 -p 11811 .. code-block:: console - fastdds discovery -i 1 -l 127.0.0.1 -p 11888 - -``-i N`` means server with id N. When referencing the servers with ``ROS_DISCOVERY_SERVER``, -server ``0`` must be in first place and server ``1`` in second place. + fastdds discovery -l 127.0.0.1 -p 11888 .. code-block:: console @@ -234,7 +232,7 @@ In different terminals, run the next code to establish a communication over a ba .. code-block:: console - fastdds discovery -i 0 -l 127.0.0.1 -p 11811 -b + fastdds discovery -l 127.0.0.1 -p 11811 -b .. code-block:: console @@ -271,20 +269,20 @@ share *Server 1*. But *Listener 2* will not hear the messages from *Talker 2* because they do not share any server or servers' network that connect them. -Run the first server listening in localhost in default port 11811. +Run the first server listening in localhost on default port 11811. .. code-block:: console - fastdds discovery -i 0 -l 127.0.0.1 -p 11811 + fastdds discovery -l 127.0.0.1 -p 11811 -In another terminal run the second server listening in localhost in port another port, in this case 11888. +In another terminal run the second server listening in localhost on another port, in this case 11888. .. code-block:: console - fastdds discovery -i 1 -l 127.0.0.1 -p 11888 + fastdds discovery -l 127.0.0.1 -p 11888 Now, run each node in a different terminal. Use the *environment variable* ``ROS_DISCOVERY_SERVER`` to decide which -server they are connected to. Be aware that the ids must match (:ref:`env_vars`). +server they are connected to. .. code-block:: console @@ -360,19 +358,19 @@ First of all, instantiate a Discovery Server using :ref:`Fast DDS CLI SUPER_CLIENT - - - - -
127.0.0.1
- 11811 -
-
-
-
+ + +
127.0.0.1
+ 11811 +
+
diff --git a/docs/fastdds/transport/transport_api.rst b/docs/fastdds/transport/transport_api.rst index d272aafbc..f3fe84364 100644 --- a/docs/fastdds/transport/transport_api.rst +++ b/docs/fastdds/transport/transport_api.rst @@ -260,7 +260,7 @@ remote *server* in the case of *clients* (and *servers* that connect to other *s :language: xml :start-after: CONF_SERVER_DNS_LOCATORS<--> :end-before: <--> - :dedent: 28 + :dedent: 20 .. warning:: diff --git a/docs/fastdds/use_cases/tcp/tcp_with_discovery_server.rst b/docs/fastdds/use_cases/tcp/tcp_with_discovery_server.rst index 6d6af1d93..dd7d2dd5f 100644 --- a/docs/fastdds/use_cases/tcp/tcp_with_discovery_server.rst +++ b/docs/fastdds/use_cases/tcp/tcp_with_discovery_server.rst @@ -25,7 +25,7 @@ need to use custom user transports. There exists several ways of configuring the .. code-block:: bash - fastdds discovery -i 0 -t 127.0.0.1 -q 12345 + fastdds discovery -t 127.0.0.1 -q 12345 .. tab:: C++ @@ -45,7 +45,7 @@ need to use custom user transports. There exists several ways of configuring the :language: xml :start-after: TCP-AND-DISCOVERY-SERVER-SERVER<--> :end-before: <--> - :lines: 2-4, 6-41, 43-44 + :lines: 2-4, 6-40, 42-43 .. tab:: Fast DDS Discovery Server Example @@ -95,4 +95,4 @@ The client participant can be configured by either using the ``ROS_DISCOVERY_SER :language: xml :start-after: TCP-AND-DISCOVERY-SERVER-CLIENT<--> :end-before: <--> - :lines: 2-4, 6-47, 49-50 + :lines: 2-4, 6-43, 45-46 diff --git a/docs/fastdds/use_cases/wifi/discovery_server_use_case.rst b/docs/fastdds/use_cases/wifi/discovery_server_use_case.rst index 2ee07696b..b9e4e7c4d 100644 --- a/docs/fastdds/use_cases/wifi/discovery_server_use_case.rst +++ b/docs/fastdds/use_cases/wifi/discovery_server_use_case.rst @@ -32,54 +32,59 @@ UDPv4 basic example setup To configure the Discovery Server scenario, two types of participants are created: the server participant and the client participant. -Two parameters to be configured in this type of implementation are outlined: +Only one parameter needs be configured in this type of implementation: -+ **Server GUID Prefix**: This is the unique identifier of the server. + **Server Address-port pair**: Specifies the IP address and port of the machine that implements the server. Any free random port can be used. However, using :ref:`RTPS standard ports` is discouraged. -+--------------------------------------------------------+ -| **SERVER** | -+========================================================+ -| **C++** | -+--------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_DS_MAIN_SCENARIO_SERVER | -| :end-before: //!-- | -| :dedent: 8 | -+--------------------------------------------------------+ -| **XML** | -+--------------------------------------------------------+ -| .. literalinclude:: /../code/XMLTester.xml | -| :language: xml | -| :start-after: CONF_DS_MAIN_SCENARIO_SERVER<--> | -| :end-before: <--> | -| :lines: 2-3,5- | -| :append: | -+--------------------------------------------------------+ - -+--------------------------------------------------------+ -| **CLIENT** | -+========================================================+ -| **C++** | -+--------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_DS_MAIN_SCENARIO_CLIENT | -| :end-before: //!-- | -| :dedent: 8 | -+--------------------------------------------------------+ -| **XML** | -+--------------------------------------------------------+ -| .. literalinclude:: /../code/XMLTester.xml | -| :language: xml | -| :start-after: CONF_DS_MAIN_SCENARIO_CLIENT<--> | -| :end-before: <--> | -| :lines: 2-3,5- | -| :append: | -+--------------------------------------------------------+ ++-------------------------------------------------------------+ +| **SERVER** | ++=============================================================+ +| | +|.. tabs:: | +| | +| .. tab:: **C++** | +| | +| .. literalinclude:: /../code/DDSCodeTester.cpp | +| :language: c++ | +| :start-after: //CONF_DS_MAIN_SCENARIO_SERVER | +| :end-before: //!-- | +| :dedent: 8 | +| | +| .. tab:: **XML** | +| | +| .. literalinclude:: /../code/XMLTester.xml | +| :language: xml | +| :start-after: CONF_DS_MAIN_SCENARIO_SERVER<--> | +| :end-before: <--> | +| :lines: 2-3,5- | +| :append: | ++-------------------------------------------------------------+ + ++-------------------------------------------------------------+ +| **CLIENT** | ++=============================================================+ +| | +|.. tabs:: | +| | +| .. tab:: **C++** | +| | +| .. literalinclude:: /../code/DDSCodeTester.cpp | +| :language: c++ | +| :start-after: //CONF_DS_MAIN_SCENARIO_CLIENT | +| :end-before: //!-- | +| :dedent: 8 | +| | +| .. tab:: **XML** | +| | +| .. literalinclude:: /../code/XMLTester.xml | +| :language: xml | +| :start-after: CONF_DS_MAIN_SCENARIO_CLIENT<--> | +| :end-before: <--> | +| :lines: 2-3,5- | +| :append: | ++-------------------------------------------------------------+ .. _discovery_server_redundancy_scenario_setup: @@ -91,7 +96,7 @@ That is, if the server fails the clients are not able to perform the discovery. To prevent this, several servers could be linked to each client. Then, a discovery failure only takes place if *all servers* fail, which is a more unlikely event. -In the example below, the values have been chosen to ensure each server has a unique *GUID Prefix* and +In the example below, the values have been chosen to ensure each server has a unique *unicast address-port pair*. Note that several servers can share the same IP address but their port numbers should be different. Likewise, several servers can share the same port if their IP addresses are different. @@ -147,47 +152,53 @@ Likewise, several servers can share the same port if their IP addresses are diff .. | @enduml -+--------------------------------------------------------+ -| **SERVER** | -+========================================================+ -| **C++** | -+--------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_DS_REDUNDANCY_SCENARIO_SERVER | -| :end-before: //!-- | -| :dedent: 8 | -+--------------------------------------------------------+ -| **XML** | -+--------------------------------------------------------+ -| .. literalinclude:: /../code/XMLTester.xml | -| :language: xml | -| :start-after: CONF_DS_RDNCY_SCENARIO_SERVER<-->| -| :end-before: <--> | -| :lines: 2-3,5- | -| :append: | -+--------------------------------------------------------+ - -+--------------------------------------------------------+ -| **CLIENT** | -+========================================================+ -| **C++** | -+--------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_DS_REDUNDANCY_SCENARIO_CLIENT | -| :end-before: //!-- | -| :dedent: 8 | -+--------------------------------------------------------+ -| **XML** | -+--------------------------------------------------------+ -| .. literalinclude:: /../code/XMLTester.xml | -| :language: xml | -| :start-after: CONF_DS_RDNCY_SCENARIO_CLIENT<-->| -| :end-before: <--> | -| :lines: 2-3,5- | -| :append: | -+--------------------------------------------------------+ ++-------------------------------------------------------------+ +| **SERVER** | ++=============================================================+ +| | +|.. tabs:: | +| | +| .. tab:: **C++** | +| | +| .. literalinclude:: /../code/DDSCodeTester.cpp | +| :language: c++ | +| :start-after: //CONF_DS_REDUNDANCY_SCENARIO_SERVER | +| :end-before: //!-- | +| :dedent: 8 | +| | +| .. tab:: **XML** | +| | +| .. literalinclude:: /../code/XMLTester.xml | +| :language: xml | +| :start-after: CONF_DS_RDNCY_SCENARIO_SERVER<-->| +| :end-before: <--> | +| :lines: 2-3,5- | +| :append: | ++-------------------------------------------------------------+ + ++-------------------------------------------------------------+ +| **CLIENT** | ++=============================================================+ +| | +|.. tabs:: | +| | +| .. tab:: **C++** | +| | +| .. literalinclude:: /../code/DDSCodeTester.cpp | +| :language: c++ | +| :start-after: //CONF_DS_REDUNDANCY_SCENARIO_CLIENT | +| :end-before: //!-- | +| :dedent: 8 | +| | +| .. tab:: **XML** | +| | +| .. literalinclude:: /../code/XMLTester.xml | +| :language: xml | +| :start-after: CONF_DS_RDNCY_SCENARIO_CLIENT<-->| +| :end-before: <--> | +| :lines: 2-3,5- | +| :append: | ++-------------------------------------------------------------+ .. _discovery_server_persistency_scenario_setup: @@ -352,24 +363,24 @@ Consider two servers, each one managing an isolated network: In order to communicate both networks we can set server A to act as a client of server B: -+--------------------------------------------------------+ -| **C++** | -+--------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_DS_PARTITION_2 | -| :end-before: //!-- | -| :dedent: 8 | -+--------------------------------------------------------+ -| **XML** | -+--------------------------------------------------------+ -| .. literalinclude:: /../code/XMLTester.xml | -| :language: xml | -| :start-after: CONF_DS_PARTITION_2<--> | -| :end-before: <--> | -| :lines: 2-3,5- | -| :append: | -+--------------------------------------------------------+ +.. tabs:: + + .. tab:: **C++** + + .. literalinclude:: /../code/DDSCodeTester.cpp + :language: c++ + :start-after: //CONF_DS_PARTITION_2 + :end-before: //!-- + :dedent: 8 + + .. tab:: **XML** + + .. literalinclude:: /../code/XMLTester.xml + :language: xml + :start-after: CONF_DS_PARTITION_2<--> + :end-before: <--> + :lines: 2-3,5- + :append: .. _discovery_server_partitioning_option3: @@ -391,22 +402,27 @@ server (C) that will be used to connect the first two: In order to communicate both networks we can setup server C to act as client of servers A and B as follows: -+--------------------------------------------------------+ -| **C++** | -+--------------------------------------------------------+ -| .. literalinclude:: /../code/DDSCodeTester.cpp | -| :language: c++ | -| :start-after: //CONF_DS_PARTITION_3 | -| :end-before: //!-- | -| :dedent: 8 | -+--------------------------------------------------------+ -| **XML** | -+--------------------------------------------------------+ -| .. literalinclude:: /../code/XMLTester.xml | -| :language: xml | -| :start-after: CONF_DS_PARTITION_3<--> | -| :end-before: <--> | -| :lines: 2-3,5- | -| :append: | -+--------------------------------------------------------+ +.. tabs:: + + .. tab:: **C++** + + .. literalinclude:: /../code/DDSCodeTester.cpp + :language: c++ + :start-after: //CONF_DS_PARTITION_3 + :end-before: //!-- + :dedent: 8 + + .. tab:: **XML** + + .. literalinclude:: /../code/XMLTester.xml + :language: xml + :start-after: CONF_DS_PARTITION_3<--> + :end-before: <--> + :lines: 2-3,5- + :append: +.. note:: + GUID Prefixes are used in these examples to identify the *servers* and help to understand each scenario. + However, they are not mandatory and can be omitted. + Note that in the *clients* configuration, the GUID Prefix is always missing, as it is not needed in + order to connect to the *servers*. diff --git a/docs/fastdds/xml_configuration/domainparticipant.rst b/docs/fastdds/xml_configuration/domainparticipant.rst index 14d1fe226..6b3054e11 100644 --- a/docs/fastdds/xml_configuration/domainparticipant.rst +++ b/docs/fastdds/xml_configuration/domainparticipant.rst @@ -356,19 +356,22 @@ configurable settings. +=================================+================================================+=====================+=============+ | ```` | Indicates which discovery protocol |br| | |SIMPLE| | |SIMPLE| | | | the DomainParticipant will use. |br| +---------------------+ | -| | See :ref:`disc_mechanisms`. If set to |br| | |CLIENT| | | -| | |CLIENT|, ```` |br| +---------------------+ | +| | See :ref:`disc_mechanisms`. If not set to |br| | |CLIENT| | | +| | |SIMPLE| or |NONE|, +---------------------+ | +| | ```` |br| | | | | | element would be used. | |SERVER| | | | | +---------------------+ | | | | |BACKUP| | | | | +---------------------+ | +| | | |SUPER_CLIENT| | | +| | +---------------------+ | | | | |NONE| | | +---------------------------------+------------------------------------------------+---------------------+-------------+ -| ```` | Describes servers from which it receives |br| | :ref:`discserverlst`| | -| | only the discovery information they |br| | | | -| | require to establish communication with |br| | | | -| | matching endpoints. |br| | | | -| | See :ref:`discovery_server` | | | +| ```` | Describes locators of servers from which |br| | ```` | | +| | it receives only the discovery information |br|| | | +| | they require to establish communication |br| | | | +| | with matching endpoints. |br| | | | +| | It expects a :ref:`LocatorListType`. | | | +---------------------------------+------------------------------------------------+---------------------+-------------+ | ```` | Restricts metatraffic using several |br| | :ref:`partfiltering`| |NO_FILTER| | | | filtering criteria. | | | @@ -411,63 +414,6 @@ configurable settings. | | ``STATIC``. See :ref:`discovery_static`. | | | +---------------------------------+------------------------------------------------+---------------------+-------------+ - -.. _discserverlst: - -discoveryServersList -#################### - -Contains a list of ```` (*server*) elements, which are defined by the |GuidPrefix_t-api| and their own -locator list which must be populated with |RemoteServerAttributes-api|. -The DomainParticipant set as *client* would discover the *servers* described in this section. - - -**Server attributes** - -The ```` element has a mandatory attribute defined: ``prefix``. - -.. list-table:: - :header-rows: 1 - :align: left - - * - Name - - Description - - Use - * - ``prefix`` - - RTPS standard participant unique identifier, a 12-byte chain. |br| - This identifier allows clients to assess whether they are |br| - receiving messages from the right server. - - Mandatory - -**RemoteServer configuration** - -Each *client* (or a *server* connecting to another *server*) must keep a list of locators associated to the *servers* -to which it wants to link. -Those locator would be defined as ``metatrafficUnicastLocatorList`` or ``metatrafficMulticastLocatorList``. - -.. list-table:: - :header-rows: 1 - :align: left - - * - Name - - Description - - Values - * - ```` - - Metatraffic Unicast Locator List. - - A set of ```` members. |br| See :ref:`LocatorListType` - * - ```` - - Metatraffic Multicast Locator List. - - A set of ```` members. |br| See :ref:`LocatorListType` - -**Example** - -.. literalinclude:: /../code/XMLTester.xml - :language: xml - :start-after: CONF_DS_MAIN_SCENARIO_CLIENT<--> - :end-before: <--> - :lines: 2-3,5- - :append: - .. _partfiltering: ignoreParticipantFlags diff --git a/docs/fastddscli/cli/cli.rst b/docs/fastddscli/cli/cli.rst index 8d76e89fc..b9cf01c11 100644 --- a/docs/fastddscli/cli/cli.rst +++ b/docs/fastddscli/cli/cli.rst @@ -51,9 +51,9 @@ discovery This command launches a |SERVER| (or |BACKUP|) for :ref:`Discovery Server `. This *server* will manage the discovery phases of the |CLIENTS| which are connected to it. -*Clients* must know how to reach the *server*, which is accomplished by specifying an IP address, the *servers* GUID -prefix, and a transport protocol like UDP or TCP. -*Servers* do not need any prior knowledge of their *clients*, but require a GUID prefix, and the listening IP address +*Clients* must know how to reach the *server*, which is accomplished by specifying an IP address, a port and +a transport protocol like UDP or TCP. +*Servers* do not need any prior knowledge of their *clients*, but require the listening IP address and port where they may be reached. For more information on the different *Fast DDS* discovery mechanisms and how to configure them, please refer to :ref:`discovery`. @@ -72,29 +72,26 @@ On a shell, execute: .. code-block:: bash - fastdds discovery -i {0-255} [optional parameters] + fastdds discovery [optional parameters] Where the parameters are: +--------------------------+-------------------------------------------------------------------------------------------+ | Option | Description | +==========================+===========================================================================================+ -| ``-h -help`` | Produce help message. | -+--------------------------+-------------------------------------------------------------------------------------------+ -| ``-i --server-id`` | Unique server identifier. Specifies zero based server position in |br| | -| | ``ROS_DISCOVERY_SERVER`` environment variable. Must be an integer in range [0, 255] |br| | -| | If not specified, it must be defined using a XML configuration file. | +| ``-h --help`` | Produce help message with examples. | +--------------------------+-------------------------------------------------------------------------------------------+ | ``-l --udp-address`` | IPv4/IPv6 address chosen to listen the clients using UDP transport. Defaults to any |br| | | | (0.0.0.0/::0). Instead of an address, a DNS domain name can be specified. | +--------------------------+-------------------------------------------------------------------------------------------+ -| ``-p --udp-port`` | UDP port chosen to listen the clients. Defaults to '11811'. | +| ``-p --udp-port`` | UDP port chosen to listen the clients. Defaults to '11811'. Only one server can be |br| | +| | configured using the default UDP port. | +--------------------------+-------------------------------------------------------------------------------------------+ | ``-t --tcp-address`` | IPv4/IPv6 address chosen to listen the clients using TCP transport. Instead of an |br| | -| | address, a DNS domain name can be specified. Defaults to localhost (127.0.0.1). | +| | address, a DNS domain name can be specified. Defaults to any (0.0.0.0). | +--------------------------+-------------------------------------------------------------------------------------------+ | ``-q --tcp-port`` | TCP port chosen to listen the clients. Defaults to '42100'. Only one server can be |br| | -| | configured using the default port. | +| | configured using the default TCP port. | +--------------------------+-------------------------------------------------------------------------------------------+ | ``-b --backup`` | Creates a BACKUP *server* (see :ref:`discovery_protocol`) | +--------------------------+-------------------------------------------------------------------------------------------+ @@ -103,6 +100,11 @@ Where the parameters are: | | that specific parameter. The default profile in the XML file is loaded except if |br| | | | a specific profile name is specified: ``profile_name@xml_file`` | +--------------------------+-------------------------------------------------------------------------------------------+ +| ``-i --server-id`` | Unique server identifier. Its functionality its deprecated. It can be used to select |br| | +| | a fixed GUID in the form shown below. Must be an integer in range [0, 255]. | ++--------------------------+-------------------------------------------------------------------------------------------+ + +Executing the command without parameters will launch a *server* with default UDP values. The output is: @@ -111,8 +113,7 @@ The output is: ### Server is running ### Participant Type: Security: - Server ID: - Server GUID prefix: 44.53..5f.45.50.52.4f.53.49.4d.41 + Server GUID prefix: |44.53..5f.45.50.52.4f.53.49.4d.41 Server Addresses: UDPv4:[]: UDPv6:[]: TCPv4:[]:- @@ -131,13 +132,12 @@ Once the *server* is instantiated, the *clients* can be configured either progra Examples ^^^^^^^^ -1. Launch a **default server** with id 0 (first on ``ROS_DISCOVERY_SERVER``) - listening on all available interfaces on UDP port '11811'. Only one - server can use default values per machine. +1. Launch a **default server** listening on all available interfaces on UDP port '11811'. + Only one server can use default values per machine. .. code-block:: bash - fastdds discovery -i 0 + fastdds discovery Output: @@ -146,17 +146,15 @@ Examples ### Server is running ### Participant Type: SERVER Security: NO - Server ID: 0 - Server GUID prefix: 44.53.00.5f.45.50.52.4f.53.49.4d.41 + Server GUID prefix: Server Addresses: UDPv4:[0.0.0.0]:11811 -2. Launch a default server with id 1 (second on ``ROS_DISCOVERY_SERVER``) - listening on localhost with UDP port 14520. Only localhost clients - can reach the server defining as `ROS_DISCOVERY_SERVER=;127.0.0.1:14520` . +2. Launch a default server listening on localhost with UDP port 14520. + Only localhost clients can reach the server defining as `ROS_DISCOVERY_SERVER=127.0.0.1:14520`. .. code-block:: bash - fastdds discovery -i 1 -l 127.0.0.1 -p 14520 + fastdds discovery -l 127.0.0.1 -p 14520 Output: @@ -165,8 +163,7 @@ Examples ### Server is running ### Participant Type: SERVER Security: NO - Server ID: 1 - Server GUID prefix: 44.53.01.5f.45.50.52.4f.53.49.4d.41 + Server GUID prefix: Server Addresses: UDPv4:[127.0.0.1]:14520 This same output can be obtained loading the following XML configuration file ``DiscoveryServerCLI.xml``: @@ -180,12 +177,31 @@ Examples fastdds discovery -x [PATH_TO_FILE]/DiscoveryServerCLI.xml -3. Launch a default server with id 1 (second on ``ROS_DISCOVERY_SERVER``) +3. Launch a default server listening on all available interfaces on TCP port '42100'. + Only one server can use default values per machine. + + .. code-block:: bash + + fastdds discovery -t + + Output: + + .. code-block:: bash + + ### Server is running ### + Participant Type: SERVER + Security: NO + Server GUID prefix: + Server Addresses: TCPv4:[0.0.0.0]:42100 + +.. _Deprecated_CLI: https://fast-dds.docs.eprosima.com/en/v2.14.0/fastddscli/cli/cli.html + +4. Launch a default server with GUID corresponding to id 1 (see `Deprecated_CLI`_) listening on IPv6 address ``2a02:ec80:600:ed1a::3`` with UDP port 14520. .. code-block:: bash - fast-discovery-serverd-1.0.1.exe -i 1 -l 2a02:ec80:600:ed1a::3 -p 14520 + fastdds discovery -i 1 -l 2a02:ec80:600:ed1a::3 -p 14520 Output: @@ -194,18 +210,16 @@ Examples ### Server is running ### Participant Type: SERVER Security: NO - Server ID: 1 Server GUID prefix: 44.53.01.5f.45.50.52.4f.53.49.4d.41 Server Addresses: UDPv6:[2a02:ec80:600:ed1a::3]:14520 -4. Launch a default server with id 2 (third on ``ROS_DISCOVERY_SERVER``) - listening on WiFi (192.168.36.34) and Ethernet (172.20.96.1) local - interfaces with UDP ports 8783 and 51083 respectively +5. Launch a default server listening on WiFi (192.168.36.34) and Ethernet (172.20.96.1) + local interfaces with UDP ports 8783 and 51083 respectively (addresses and ports are made up for the example). .. code-block:: bash - fastdds discovery -i 2 -l 192.168.36.34 -p 8783 -l 172.20.96.1 -p 51083 + fastdds discovery -l 192.168.36.34 -p 8783 -l 172.20.96.1 -p 51083 Output: @@ -214,8 +228,7 @@ Examples ### Server is running ### Participant Type SERVER Security: NO - Server ID: 2 - Server GUID prefix: 44.53.02.5f.45.50.52.4f.53.49.4d.41 + Server GUID prefix: Server Addresses: UDPv4:[192.168.36.34]:8783 UDPv4:[172.20.96.1]:51083 @@ -226,14 +239,12 @@ Examples fastdds discovery -x second_participant_profile_discovery_server_cli@[PATH_TO_FILE]/DiscoveryServerCLI.xml -5. Launch a default server with id 3 (fourth on ``ROS_DISCOVERY_SERVER``) - listening on 172.30.144.1 with UDP port 12345 and provided with a - backup file. If the server crashes it will automatically restore its - previous state when re-enacted. +6. Launch a default server listening on 172.30.144.1 with UDP port 12345 and provided with a + backup file. If the server crashes it will automatically restore its previous state when re-enacted. .. code-block:: bash - fastdds discovery -i 3 -l 172.30.144.1 -p 12345 -b + fastdds discovery -l 172.30.144.1 -p 12345 -b Output: @@ -242,31 +253,10 @@ Examples ### Server is running ### Participant Type BACKUP Security: NO - Server ID: 3 - Server GUID prefix: 44.53.03.5f.45.50.52.4f.53.49.4d.41 + Server GUID prefix: Server Addresses: UDPv4:[172.30.144.1]:12345 -6. Launch a default server with id 0 (first on ``ROS_DISCOVERY_SERVER``) - listening on localhost with UDP port 14520. Only localhost clients - can reach the server defining as `ROS_DISCOVERY_SERVER=localhost:14520`. - - .. code-block:: bash - - fastdds discovery -i 0 -l localhost -p 14520 - - Output: - - .. code-block:: bash - - ### Server is running ### - Participant Type: SERVER - Security: NO - Server ID: 0 - Server GUID prefix: 44.53.00.5f.45.50.52.4f.53.49.4d.41 - Server Addresses: UDPv4:[127.0.0.1]:14520 - -7. Launch a secure server with id 0 (first on ``ROS_DISCOVERY_SERVER``) - listening on all available interfaces on UDP port '11811'. +7. Launch a secure server listening on all available interfaces on UDP port '11811'. .. code-block:: bash @@ -279,16 +269,14 @@ Examples ### Server is running ### Participant Type: SERVER Security: YES - Server ID: 0 - Server GUID prefix: 44.53.00.5f.45.50.52.4f.53.49.4d.41 + Server GUID prefix: Server Addresses: UDPv4:[0.0.0.0]:11811 -8. Launch a server with id 0 (first on ``ROS_DISCOVERY_SERVER``) reading - specific `profile_name` configuration from XML file. +8. Launch a server reading specific `profile_name` configuration from XML file. .. code-block:: bash - fastdds discovery -i 0 -x profile_name@[PATH_TO_FILE]/config.xml + fastdds discovery -x profile_name@[PATH_TO_FILE]/config.xml Output: @@ -297,16 +285,14 @@ Examples ### Server is running ### Participant Type: SERVER Security: NO - Server ID: 0 - Server GUID prefix: 44.53.00.5f.45.50.52.4f.53.49.4d.41 + Server GUID prefix: Server Addresses: UDPv4:[127.0.0.1]:56542 -9. Launch a server with id 0 (first on ``ROS_DISCOVERY_SERVER``) listening - on localhost on default TCP port '42100'. +9. Launch a server listening on localhost on default TCP port '42100'. .. code-block:: bash - fastdds discovery -i 0 -t 127.0.0.1 + fastdds discovery -t 127.0.0.1 Output: @@ -315,17 +301,15 @@ Examples ### Server is running ### Participant Type: SERVER Security: NO - Server ID: 0 - Server GUID prefix: 44.53.00.5f.45.50.52.4f.53.49.4d.41 + Server GUID prefix: Server Addresses: TCPv4:[127.0.0.1]:42100-42100 -10. Launch a server with id 0 (first on ``ROS_DISCOVERY_SERVER``) listening - on localhost and WiFi (192.163.6.34). Two TCP ports need to be - specified because TCP transports cannot share ports. +10. Launch a server listening on localhost and WiFi (192.163.6.34). Two TCP ports need to be + specified because transports cannot share ports. .. code-block:: bash - fastdds discovery -i 0 -t 127.0.0.1 -q 42100 -t 192.163.6.34 -q 42101 + fastdds discovery -t 127.0.0.1 -q 42100 -t 192.163.6.34 -q 42101 Output: @@ -334,8 +318,7 @@ Examples ### Server is running ### Participant Type: SERVER Security: NO - Server ID: 0 - Server GUID prefix: 44.53.00.5f.45.50.52.4f.53.49.4d.41 + Server GUID prefix: Server Addresses: TCPv4:[127.0.0.1]:42100-42100 TCPv4:[192.163.6.34]:42101-42101 @@ -347,7 +330,7 @@ Examples .. note:: A server can be instantiated just by passing the port arguments ``-p`` and ``-q``. Fast DDS CLI will use the default values of the IP addresses, - that is, ``0.0.0.0`` for UDP and ``127.0.0.1`` for TCP. + that is, ``0.0.0.0`` for UDP and ``0.0.0.0`` for TCP. .. _cli_shm: