Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDS refactor #21

Merged
merged 5 commits into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed docs/01-figures/LAN_settings_options.png
Binary file not shown.
Binary file removed docs/01-figures/WAN_settings_options.png
Binary file not shown.
Binary file added docs/01-figures/participant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/01-figures/preferences.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/01-figures/tcp_client_options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/01-figures/tcp_lan_server_options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/01-figures/tcp_wan_server_options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/01-figures/test10_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/01-figures/test9_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 30 additions & 16 deletions docs/examples/tcp_LAN_WAN_transport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,27 @@ TCP over LAN can be tested in a scenario where several machines share the same L
nevertheless, UDP performs better and is the advisable choice in practical situations.
For this configuration example, one of the machines set up eProsima Shapes Demo as a server and all the others as
clients.
Assume that the server LAN IP address is ``192.168.2.49``, then
Assume that the server LAN IP address is ``192.168.1.75``, then
JLBuenoLopez marked this conversation as resolved.
Show resolved Hide resolved
all clients instances of eProsima Shapes Demo deployed on other machines must specify this IP Server address.
In this case, the 5100 port is selected as TCP port, but any other available TCP port is valid.

.. warning::

The server firewall must allow inbound traffic on the selected port.

Server TCP side:

.. image:: /01-figures/LAN_settings_options.png
.. image:: /01-figures/tcp_lan_server_options.png
:scale: 100 %
:alt: LAN settings options
:alt: LAN Server settings options
:align: center

Client TCP side:

.. image:: /01-figures/tcp_client_options.png
JLBuenoLopez marked this conversation as resolved.
Show resolved Hide resolved
:scale: 100 %
:alt: LAN Client settings options
:align: center

WAN configuration
-----------------
Expand All @@ -41,15 +48,15 @@ This may happen if the server and clients are in a different LANs of the same WA
To test this scenario we used the network architecture shown in the figure below.
It contains the following elements:

* A Main Router which simulates the WAN network.
In this network Router C has address ``192.168.1.74`` and Router S has address ``192.168.1.75``.
* A client LAN network managed by Router C.
* A server LAN network managed by Router S.
The Router S NAT settings relay any inbound TCP traffic to port 5100 towards Sever machine.
The TCP port 5100 was arbitrarily chosen, any available port will do.
* An eProsima Shapes Demo client running in the machine with IPv4 address ``192.168.2.17``.
* An eProsima Shapes Demo server running in the machine with IPv4 address ``192.168.3.49``.
The Server machine firewall settings allow inbound TCP traffic to port 5100.
- A Main Router which simulates the WAN network.
In this network Router C has address ``192.168.1.74`` and Router S has address ``192.168.1.75``.
- A client LAN network managed by Router C.
- A server LAN network managed by Router S.
The Router S NAT settings relay any inbound TCP traffic to port 5100 towards Sever machine.
The TCP port 5100 was arbitrarily chosen, any available port will do.
- An eProsima Shapes Demo client running in the machine with IPv4 address ``192.168.2.17``.
- An eProsima Shapes Demo server running in the machine with IPv4 address ``192.168.3.49``.
The Server machine firewall settings allow inbound TCP traffic to port 5100.

.. figure:: /01-figures/WAN_network_layout.png
:alt: WAN test layout
Expand All @@ -63,10 +70,17 @@ The following image shows server and client settings:
* On the client side, the *server IP* field contains the server's router IP address, i.e. the Router S IP address
(``192.168.1.75``).
The client's router can understand this address and properly lead the outbound traffic.
* On the server side, the *WAN IP* field contains the server's router IP address, i.e. i.e. the Router S IP address
* On the server side, the *WAN IP* field contains the server's router IP address, i.e. the Router S IP address
(``192.168.1.75``) since Router S NAT settings relay inbound traffic to server's TCP port towards Server computer.

.. figure:: /01-figures/WAN_settings_options.png
:alt: WAN settings options
:align: center
Client TCP side:

.. figure:: /01-figures/tcp_client_options.png
:alt: WAN Client settings options
:align: center

Server TCP side:

.. figure:: /01-figures/tcp_wan_server_options.png
:alt: WAN Server settings options
:align: center
95 changes: 60 additions & 35 deletions docs/first_steps/first_steps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,63 +110,88 @@ has additional elements:

Using Lifespan QoS will not have any visual effect.

Other Options
-------------
Participant configuration
-------------------------

The eProsima Shapes Demo application allows the user to define additional options.
To see the Options window, please go to *Options->Preferences* in the main bar.
The eProsima Shapes Demo application allows the user to define Participant policies.
To see the Options window, please go to *Options->Participant Configuration* in the main bar.
The following image shows the Options Menu.

.. image:: /01-figures/options.png
.. image:: /01-figures/participant.png
:scale: 75 %
:alt: Options Window
:align: center

The user can customize several aspects of Shapes Demo operation:
- **Transport Protocol:** You can select between UDP protocol, TCP LAN Server, TCP WAN Server or TCP Client,
and Shared Memory protocol.

- **Transport Protocol:** UDP is the default transport protocol for *Fast DDS* but TCP protocol is also available
(see
`Fast DDS Transports Documentation <https://fast-dds.docs.eprosima.com/en/latest/fastdds/transport/transport.html>`_).
- **UDP:** With UDP Protocol the applicacion will work sending multicast packets to communicate with other apps.
(See
`Fast DDS UDP Transport Documentation <https://fast-dds.docs.eprosima.com/en/latest/fastdds/transport/udp/udp.html#transport-udp-udp>`_).

.. warning::
- **TCP:** TCP protocol needs a minimal configuration to create the connection between the machines:
(See
`Fast DDS TCP Transport Documentation <https://fast-dds.docs.eprosima.com/en/latest/fastdds/transport/tcp/tcp.html#transport-tcp-tcp>`_).

In order to use the TCP its point-to-point connection nature must be well known: one of the Shapes Demo instance
must be a TCP server and all the others must be TCP clients.
- If the applicacion is going to run as a *LAN server*, it only needs to set the listening port where it is going to
accept connections (note that firewall must be configured to allow inbound traffic).

To use TCP follow the next steps:
- If the applicacion is going to run as a *WAN server*, it needs to set the listening port where it is going to
accept connections and the server WAN address (note that firewall must be configured to allow inbound traffic
and router must relay listening port traffic to server machine).

+ Push the *Stop* button in order to end UDP use. This will automatically remove all publishers and subscribers
from this instance.
- If the applicacion is going to run as a *client* it needs to know the IP address of the server (or its WAN address
if both instances don't share network) and the port where the server is listening for connections.

+ To create a TCP LAN server push ``TCP LAN Server`` button and fill the *Server Port* input field with an available
port. It is the port where the application will be listening for incoming connections.
- **Shared Memory (SHM):** Activating Shared Memory protocol will use the Shared Memory Transport, a *Fast DDS*
feature that allows a faster and more efficient communication for Participants running in the same host.
(See
`Fast DDS Shared Memory Transport Documentation <https://fast-dds.docs.eprosima.com/en/latest/fastdds/transport/shared_memory/shared_memory.html#transport-sharedmemory-sharedmemory>`_).

+ To create a TCP WAN server push the ``TCP WAN Server`` button:
- **Default** In case no transport has been activated, *Fast DDS* default transports will be used (UDP + SHM)
(See
`Fast DDS Transports Documentation <https://fast-dds.docs.eprosima.com/en/latest/fastdds/transport/transport.html>`_).

- Fill the *WAN IP* input field with the public IPv4 router address.
- Fill the *Server Port* input field with an available TCP port where the application will be listening for
incoming connections.
- **Same host delivery:** *Fast DDS* has some features that allow Participants running in the same host or process
to share resources in order to improve the communication:

.. warning::
- **Intraprocess:** Allow using Intraprocess delivery when both Endpoints are running in the same process.
(See
`Fast DDS Intraprocess Documentation <https://fast-dds.docs.eprosima.com/en/latest/fastdds/transport/intraprocess.html#intraprocess-delivery>`_).

The router NAT and computer firewall settings must allow external connections to the server port.
- **Data Sharing:** Allow using Data Sharing delivery when both Endpoints are running in the same host.
(See
`Fast DDS Data Sharing Documentation <https://fast-dds.docs.eprosima.com/en/latest/fastdds/transport/datasharing.html#datasharing-delivery>`_).

+ To create a TCP client push the ``TCP Client`` button:
- **Domain:** The user can select different Domain IDs.
Shapes Demo instances using different Domain IDs will not communicate.
To modify the Domain ID the user needs to stop the participant (thus removing all existing publishers and
subscribers) and start a new one with the new Domain ID.
(See
`Fast DDS Domain Documentation <https://fast-dds.docs.eprosima.com/en/latest/fastdds/dds_layer/domain/domain.html>`_).

- Fill the *Server IP* input field with the IP address of the server.
- If client and server do not share the same network because the server is behind a NAT, the WAN IP address of
the server gateway must be specified.
- Fill the *Server port* input field with the corresponding server listening port.
- **Statistics:** The user can activate *Fast DDS Statistics module* so different instrumentation data could be
collected and analyzed by the *Fast DDS Statistics Backend*, or be represented by *Fast DDS Monitor*.
This module requires to have compiled *Fast DDS* with Statistics Module ON.
(See
`Fast DDS Statistics Module Documentation <https://fast-dds.docs.eprosima.com/en/latest/fastdds/statistics/statistics.html>`_).

+ Push the *Start* button in order to resume Shapes Demo operation.
In case that the Participant is already running, it should be stopped in order to change its configuration.
This will drop every endpoint already created.

Preferences
-----------

- **Domain ID:** The user can select different Domain IDs.
Shapes Demo instances using different Domain IDs will not communicate.
To modify the Domain ID the user needs to stop the participant (thus removing all existing publishers and
subscribers) and start a new one with the new Domain ID.
See
`Fast DDS Domain Documentation <https://fast-dds.docs.eprosima.com/en/latest/fastdds/dds_layer/domain/domain.html>`_.
The eProsima Shapes Demo application allows the user to define additional options.
To see the Options window, please go to *Options->Preferences* in the main bar.
The following image shows the Options Menu.

.. image:: /01-figures/preferences.png
:scale: 75 %
:alt: Options Window
:align: center

The user can customize several aspects of Shapes Demo operation:

- **Update interval:** This value changes the publication period for all the publishers.

Expand Down