.. include:: ../../03-exports/aliases.include .. include:: ../../03-exports/aliases-api.include .. include:: ../../03-exports/roles.include .. _transportdescriptors: Transport descriptors --------------------- This section defines the XML elements available for configuring the transport layer parameters in *Fast DDS*. These elements are defined within the XML tag ````. The ```` can contain one or more ```` XML elements. Each ```` element defines a configuration for a specific type of transport protocol. Each of these ```` elements are uniquely identified by a transport ID with the ```` XML tag. Once the user defines a valid ````, i.e. defines the transport layer parameters, these can be loaded into the XML profile of the DomainParticipant using the ```` XML tag. An example of how to load the ```` into the XML profile of the DomainParticipant is found in :ref:`participantprofiles`. The following table lists all the available XML elements that can be defined within the ```` element for the configuration of the transport layer. A more detailed explanation of each of these elements can be found in :ref:`comm-transports-configuration`. .. list-table:: :header-rows: 1 :align: left * - Name - Description - Values - Default * - ```` - Unique name to identify each transport descriptor. - ``string`` - * - ```` - Type of the transport descriptor. - ``UDPv4``, ``UDPv6``, ``TCPv4``, ``TCPv6``, ``SHM`` - ``UDPv4`` * - ```` - Size in bytes of the send socket buffer. If the value is zero, *Fast DDS* will use the system default socket size. - ``uint32_t`` - ``0`` * - ```` - Size in bytes of the reception socket buffer. If the value is zero, *Fast DDS* will use the system default socket size. - ``uint32_t`` - ``0`` * - ```` - The maximum size in bytes of the transport's message buffer. - ``uint32_t`` - ``65500`` * - ```` - Number of channels opened with each initial remote peer. - ``uint32_t`` - ``4`` * - ```` - Transport's :ref:`netmask_filtering` configuration. - ``string`` - ``AUTO`` * - ```` - Allows defining an :ref:`ifaces_config`. - ``string`` - * - ```` - Allows defining an interfaces |whitelist|. - ``string`` - * - ```` - Time To Live (UDP only). See :ref:`transport_udp_udp`. - ``uint8_t`` - ``1`` * - ```` - Whether to set the non-blocking send mode on the socket (NOT available for SHM type). See :ref:`transport_udp_transportDescriptor` and :ref:`transport_tcp_transportDescriptor`. - ``bool`` - ``false`` * - ```` - Port used for output bound. If this field isn't defined, the output port will be random (UDP only). - ``uint16_t`` - ``0`` * - ```` - Public WAN address when using TCPv4 transports. This field is optional if the transport doesn't need to define a WAN address (TCPv4 only). - ``string`` - * - ```` - Frequency in milliseconds for sending :ref:`RTCP ` keep-alive requests (TCP only). - ``uint32_t`` - ``50000`` * - ```` - Time in milliseconds since the last keep-alive request was sent to consider a connection as broken (TCP only). - ``uint32_t`` - ``10000`` * - ```` - The maximum number of logical ports to try during :ref:`RTCP ` negotiations (TCP only). - ``uint16_t`` - ``100`` * - ```` - The maximum number of logical ports per request to try during :ref:`RTCP ` negotiations (TCP only). - ``uint16_t`` - ``20`` * - ```` - Increment between logical ports to try during :ref:`RTCP ` negotiation (TCP only). - ``uint16_t`` - ``2`` * - ```` - Local port to work as TCP acceptor for input connections. If not set, the transport will work as TCP client only. If set to 0, an available port will be automatically assigned (TCP only). - ``List`` - * - ```` - Allows to define TLS related parameters and options (TCP only). - :ref:`tcp-tls` - * - ```` - Calculates the Cyclic Redundancy Code (CRC) for error control (TCP only). - ``bool`` - ``true`` * - ```` - Check the CRC for error control (TCP only). - ``bool`` - ``true`` * - ```` - Socket option for disabling the Nagle algorithm (TCP only). - ``bool`` - ``false`` * - ```` - Time to wait for logical port negotiation (in ms) (TCP only). - ``uint32_t`` - ``0`` * - ```` - Settings for the keep-alive thread. - |ThreadSettings| - * - ```` - Settings for the accept thread. - |ThreadSettings| - * - ```` - Size (in bytes) of the shared-memory segment (Optional, SHM only). - ``uint32_t`` - ``262144`` * - ```` - Capacity (in number of messages) available to every Listener (Optional, SHM only). - ``uint32_t`` - ``512`` * - ```` - Maximum time-out (in milliseconds) used when checking whether a Listener is alive (Optional, SHM only). - ``uint32_t`` - ``1000`` * - ```` - Complete path (including file) where RTPS messages will be stored for debugging purposes. An empty string indicates no trace will be performed (Optional, SHM only). - ``string`` - ``Empty`` * - ```` - Default |ThreadSettings| for the reception threads. - |ThreadSettings| - * - ```` - |ThreadSettings| for the reception threads on specific ports. - ``std::map`` - * - ```` - |ThreadSettings| for the SHM dump thread. - |ThreadSettings| - The following XML code shows an example of transport protocol configuration using all configurable parameters. More examples of transports descriptors can be found in the :ref:`comm-transports-configuration` section. .. literalinclude:: /../code/XMLTester.xml :language: xml :start-after: :end-before: <--> :lines: 2-4, 6-70, 72-73 .. _rtcpdefinition: .. note:: The Real-time Transport Control Protocol (`RTCP `_) is the control protocol for communications with RTPS over TCP/IP connections. .. _tcp-tls: TLS Configuration ^^^^^^^^^^^^^^^^^ *Fast DDS* provides mechanisms to configure the Transport Layer Security (TLS) protocol parameters through the ```` XML element of its ````. Please, refer to :ref:`transport_tcp_tls` for a detailed explanation of the entire TLS configuration in *Fast DDS*. More information on how to set up secure communication in *Fast DDS* can be found in the :ref:`security` section. .. warning:: For the full understanding of this section, a basic knowledge of network security in terms of SSL/TLS, Certificate Authority (CA), Public Key Infrastructure (PKI), and Diffie-Hellman is required; encryption protocols are not explained in detail. The full list of available XML elements that can be defined within the ```` element to configure the TLS protocol are listed in the following table: .. |DEFconc| replace:: :cpp:concept:`DEFAULT` .. |VERIFY_FAIL_IF_NO_PEER_CERT| replace:: :cpp:concept:`VERIFY_FAIL_IF_NO_PEER_CERT` +---------------------------+-----------------------------------+----------------------------------------+-------------+ | Name | Description | Values | Default | +===========================+===================================+========================================+=============+ | ```` | Password of the | ``string`` | | | | ```` | | | | | or |br| | | | | | ```` | | | | | if provided. | | | +---------------------------+-----------------------------------+----------------------------------------+-------------+ | ```` | Path to the private key | ``string`` | | | | certificate file. | | | +---------------------------+-----------------------------------+----------------------------------------+-------------+ | ````| Path to the private key | ``string`` | | | | RSA certificate file. | | | +---------------------------+-----------------------------------+----------------------------------------+-------------+ | ```` | Path to the public certificate | ``string`` | | | | chain file. | | | +---------------------------+-----------------------------------+----------------------------------------+-------------+ | ```` | Path to the Diffie-Hellman | ``string`` | | | | parameters file | | | +---------------------------+-----------------------------------+----------------------------------------+-------------+ | ```` | Path to the Certification | ``string`` | | | | Authority (CA) file. | | | +---------------------------+-----------------------------------+----------------------------------------+-------------+ | ```` | Establishes the verification | :cpp:concept:`VERIFY_NONE` | | | | mode mask. Several |br| +----------------------------------------+ | | | verification options can be | :cpp:concept:`VERIFY_PEER` | | | | combined in the same |br| +----------------------------------------+ | | | ````. | |VERIFY_FAIL_IF_NO_PEER_CERT| | | | | +----------------------------------------+ | | | | :cpp:concept:`VERIFY_CLIENT_ONCE` | | +---------------------------+-----------------------------------+----------------------------------------+-------------+ | ```` | Establishes the SSL Context | :cpp:concept:`DEFAULT_WORKAROUNDS` | | | | options mask. Several |br| +----------------------------------------+ | | | options can be combined in the | :cpp:concept:`NO_COMPRESSION` | | | | same |br| +----------------------------------------+ | | | ````. | :cpp:concept:`NO_SSLV2` | | | | +----------------------------------------+ | | | | :cpp:concept:`NO_SSLV3` | | | | +----------------------------------------+ | | | | :cpp:concept:`NO_TLSV1` | | | | +----------------------------------------+ | | | | :cpp:concept:`NO_TLSV1_1` | | | | +----------------------------------------+ | | | | :cpp:concept:`NO_TLSV1_2` | | | | +----------------------------------------+ | | | | :cpp:concept:`NO_TLSV1_3` | | | | +----------------------------------------+ | | | | :cpp:concept:`SINGLE_DH_USE` | | +---------------------------+-----------------------------------+----------------------------------------+-------------+ | ```` | Paths where the system will | ``List `` | | | | look for verification |br| files. | | | +---------------------------+-----------------------------------+----------------------------------------+-------------+ | ```` | Maximum allowed depth to | ``uint32_t`` | | | | verify intermediate |br| | | | | | certificates. | | | +---------------------------+-----------------------------------+----------------------------------------+-------------+ | ```` | Specifies whether the system | ``bool`` | ``false`` | | | will look on the |br| | | | | | default paths for the | | | | | verification files. | | | +---------------------------+-----------------------------------+----------------------------------------+-------------+ | ```` | Role that the transport will | :cpp:concept:`DEFAULT` | |DEFconc| | | | take on handshaking. |br| +----------------------------------------+ | | | On default, the acceptors act | :cpp:concept:`SERVER` | | | | as :cpp:concept:`SERVER` and the +----------------------------------------+ | | | |br| connectors as | :cpp:concept:`CLIENT` | | | | :cpp:concept:`CLIENT`. | | | +---------------------------+-----------------------------------+----------------------------------------+-------------+ | ```` | server name or host name required | ``string`` | | | | in case Server Name Indication | | | | | (SNI) is used. | | | +---------------------------+-----------------------------------+----------------------------------------+-------------+ An example of TLS protocol parameter configuration is shown below. .. literalinclude:: /../code/XMLTester.xml :language: xml :start-after: XML-TCP-TLS<--> :end-before: <--> :lines: 2-4, 6-34, 36-37