RTPS locator port calculation

Locator used for discovery traffic

Discovery traffic is the traffic generated by the Participant and Endpoint Discovery Protocols(SPDP and SEDP). Discovery traffic is the traffic exchanged between the built-in topics. [1][2][3]

Ports used by the built-in endpoints

traffic type default port number expression
Multicast PB+DG×domainID+d0
Unicast PB+DG×domainID+d1+PG×participantId
where:

The domain_id and participant_id are used to avoid conflicts among Participants on the same node. Each Participant on the same node and in the same domain must use a unique participant_id.

Locator used for user traffic

User traffic is the traffic exchanged between user-defined endpoints (e.g. non built-in endpoints).

Ports used by the user-defined endpoints

traffic type default port number expression
Multicast PB+DG×domainID+d2
Unicast PB+DG×domainID+d3+PG×participantId
where:
Given UDP port numbers are limited to 64K, the above default enables the use of about 230 domains with up to 120 participants per node per domain.


  1. https://cyclonedds.io/docs/cyclonedds/latest/config/port_numbers.html?highlight=port ↩︎

  2. https://docs.ros.org/en/galactic/Concepts/About-Domain-ID.html ↩︎

  3. https://arc.net/l/quote/eqzbqfeq ↩︎