From 33dc3758db9c10ceba4240a5f826c4bfa43bcf14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ferreira=20Gonz=C3=A1lez?= Date: Fri, 9 Jan 2026 12:10:51 +0100 Subject: [PATCH 1/3] Refs #24015: Update keep alive docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Carlos Ferreira González --- code/DDSCodeTester.cpp | 17 +++++++ code/XMLTester.xml | 15 ++++++ docs/fastdds/transport/tcp/tcp.rst | 8 ++-- .../use_cases/ip_mobility/ip_mobility.rst | 46 +++++++++++++++++++ docs/fastdds/use_cases/use_cases.rst | 6 +++ docs/fastdds/xml_configuration/transports.rst | 8 ++-- 6 files changed, 92 insertions(+), 8 deletions(-) diff --git a/code/DDSCodeTester.cpp b/code/DDSCodeTester.cpp index cf472f97f..1ed290221 100644 --- a/code/DDSCodeTester.cpp +++ b/code/DDSCodeTester.cpp @@ -6521,6 +6521,23 @@ void dds_transport_examples () //!-- } + { + //CONF-TCP-KEEP-ALIVE + DomainParticipantQos qos; + + // Create a descriptor for the new transport. + auto tcp_transport = std::make_shared(); + + // Configure keep alive options + tcp_transport->keep_alive_frequency_ms = 5000; // Send a keep-alive message every 5 seconds when connection is idle + tcp_transport->keep_alive_timeout_ms = 2000; // Consider connection lost if no response is received within 2 seconds + tcp_transport->keep_alive_thread = eprosima::fastdds::rtps::ThreadSettings{-1, 0, 0, -1}; // Configure thread settings + + // Link the Transport Layer to the Participant. + qos.transport().user_transports.push_back(tcp_transport); + //!-- + } + { //TRANSPORT-DESCRIPTORS DomainParticipantQos qos; diff --git a/code/XMLTester.xml b/code/XMLTester.xml index be156d0b7..ac32940a6 100644 --- a/code/XMLTester.xml +++ b/code/XMLTester.xml @@ -796,6 +796,21 @@ <--> +CONF-TCP-KEEP-ALIVE<--> + + + + keep_alive_transport + TCPv4 + 5000 + 25000 + + +<--> + CONF-DISABLE-MULTICAST<--> CONF-TCP-KEEP-ALIVE<--> + :end-before: <--> + :lines: 2-3, 6- + :append: + + .. tab-item:: C++ + :sync: cpp + + .. literalinclude:: ../../../../code/DDSCodeTester.cpp + :language: c++ + :dedent: 8 + :start-after: //CONF-TCP-KEEP-ALIVE + :end-before: //! + +.. note:: + + This feature is intended for TCP transports and only applies to connected TCP channels. diff --git a/docs/fastdds/use_cases/use_cases.rst b/docs/fastdds/use_cases/use_cases.rst index 008f136af..ee311ae9f 100644 --- a/docs/fastdds/use_cases/use_cases.rst +++ b/docs/fastdds/use_cases/use_cases.rst @@ -21,6 +21,12 @@ with distributed systems: If the network interfaces are expected to change while the application is running, *Fast DDS Pro* provides an automatic way of re-scanning the available interfaces and including them. ++ :ref:`TCP Keep Alive ` |Pro|. + In the same line as :ref:`IP mobility `, TCP Keep Alive feature allows to automatically detect + broken TCP connections by sending periodic keep-alive messages at application level when the connection is idle. + This feature is essential in TCP scenarios with dynamic IP changes or unstable network conditions, + ensuring that stale connections are identified and re-established promptly. + + :ref:`use-case-tcp`. Describes how to configure *Fast DDS* to use the ``LARGE_DATA`` builtin transports mode. This mode enables efficient utilization of TCP transport without the need for constant reconfiguration diff --git a/docs/fastdds/xml_configuration/transports.rst b/docs/fastdds/xml_configuration/transports.rst index 70c46df5c..06f25cf77 100644 --- a/docs/fastdds/xml_configuration/transports.rst +++ b/docs/fastdds/xml_configuration/transports.rst @@ -84,13 +84,13 @@ A more detailed explanation of each of these elements can be found in :ref:`comm - ``string`` - * - ```` - - Frequency in milliseconds for sending :ref:`RTCP ` keep-alive requests (TCP only). + - |Pro| Frequency in milliseconds for sending :ref:`RTCP ` keep-alive requests (TCP only). - ``uint32_t`` - - ``50000`` + - ``0`` * - ```` - - Time in milliseconds since the last keep-alive request was sent to consider a connection as broken (TCP only). + - |Pro| Time in milliseconds since the last keep-alive request was sent to consider a connection as broken (TCP only). - ``uint32_t`` - - ``10000`` + - ``0`` * - ```` - The maximum number of logical ports to try during :ref:`RTCP ` negotiations (TCP only). - ``uint16_t`` From b565f54eb63944f929a6a31620582c7e1ef9a0a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ferreira=20Gonz=C3=A1lez?= Date: Mon, 12 Jan 2026 08:33:24 +0100 Subject: [PATCH 2/3] Refs #24015: Fix doc8 tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Carlos Ferreira González --- docs/fastdds/use_cases/ip_mobility/ip_mobility.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/fastdds/use_cases/ip_mobility/ip_mobility.rst b/docs/fastdds/use_cases/ip_mobility/ip_mobility.rst index 0e38d70c0..63c5129e4 100644 --- a/docs/fastdds/use_cases/ip_mobility/ip_mobility.rst +++ b/docs/fastdds/use_cases/ip_mobility/ip_mobility.rst @@ -54,8 +54,8 @@ Please refer to :ref:`dds_layer_domainParticipantQos` for more information about TCP Keep Alive |Pro| ==================== -Fast DDS Pro additionally provides a TCP keep-alive mechanism to detect stalled TCP connections and recover from link failures -more reliably. +Fast DDS Pro additionally provides a TCP keep-alive mechanism to detect stalled TCP connections and recover +from link failures more reliably. When enabled, the TCP transport periodically sends keep-alive requests on established TCP channels, and monitors activity to determine whether a connection is still responsive. Keep alive requests are sent only when no incoming data has been received for a specified interval. From 7aeceb7252f470d061b9a826862f85ce5e2be215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ferreira=20Gonz=C3=A1lez?= Date: Fri, 6 Mar 2026 13:31:12 +0100 Subject: [PATCH 3/3] Refs #24015: Downgrade title section level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Carlos Ferreira González --- docs/fastdds/use_cases/ip_mobility/ip_mobility.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fastdds/use_cases/ip_mobility/ip_mobility.rst b/docs/fastdds/use_cases/ip_mobility/ip_mobility.rst index 63c5129e4..f615572f3 100644 --- a/docs/fastdds/use_cases/ip_mobility/ip_mobility.rst +++ b/docs/fastdds/use_cases/ip_mobility/ip_mobility.rst @@ -52,7 +52,7 @@ Please refer to :ref:`dds_layer_domainParticipantQos` for more information about .. _tcp-keep-alive: TCP Keep Alive |Pro| -==================== +-------------------- Fast DDS Pro additionally provides a TCP keep-alive mechanism to detect stalled TCP connections and recover from link failures more reliably.