Warnings displayed when trying to create UDP socket

4 posts / 0 new
Last post
asanchez's picture
Offline
Last seen: 4 years 5 months ago
Joined: 11/16/2011
Posts: 50
Warnings displayed when trying to create UDP socket

Hi all,

Sometimes I visualize this message warning(s) in my DDS application:

[D0000|ENABLE]RTINetioConfigurator_populateUnicastLocators:"" ignoring excess locators > capacity 4
[D0000|ENABLE]DDS_DiscoveryQosPolicy_to_unicast_locators:too many (> 4) unicast transport locators, ignoring some; transports = "", enabled_transports = ""
[D0000|ENABLE]NDDS_Transport_UDPv4_Socket_bindWithIp:0X1CF2 in use
[D0000|ENABLE]NDDS_Transport_UDPv4_SocketFactory_create_receive_socket:invalid port 7410
[D0000|ENABLE]NDDS_Transport_UDPv4_create_recvresource_rrEA:!create socket

Sometimes these messages are showed for different port numbers. Nonentheless everything is created correctly and data is being sent and received. My question is, which socket are these message sreferring to??

Thanks,

Antonio

Gerardo Pardo's picture
Offline
Last seen: 3 weeks 15 hours ago
Joined: 06/02/2010
Posts: 602

Hello Antonio,

The messages you see are informative and it does not necessarily indicate there is anything wrong.

I think you are seeing this because you have configured RTI Connext DDS with Logging verbosity of WARNING or higher. In other words you must have directly or indirectly called NDDSConfigLogger::set_verbosity and specified  NDDS_CONFIG_LOG_VERBOSITY_WARNING or higher.

Regarding the first message:

[D0000|ENABLE]RTINetioConfigurator_populateUnicastLocators:"" ignoring excess locators > capacity 4
[D0000|ENABLE]DDS_DiscoveryQosPolicy_to_unicast_locators:too many (> 4) unicast transport locators, ignoring some; transports = "", enabled_transports = ""

These messages indicate that RTI  Connext DDS has detected more than 4 IP addresses in your computer. This can be due to you having multiple active NIC cards (e.g LAN, wireless, etc.), or it could also be caused by virtual Network Interface Adapters.  Applications can create this. For example hypervisors such as VmWare, VirtualBox, etc. create them and also VPN programs such as OpenVPN.

For any one transport (e.g. UDP) RTI Connext DDS only uses the 4 first active network interfaces for communication. This complies with the OMG DDS-RTPS Interoperability Wire protocol.  So any interfaces beyond the 4th will be ignored as far as DDS communications. This should not cause a problem as long as the interfaces you need to use for communications are among the first 4.  If this is not the case, then you need to tell RTI DDS which interfaces to use explicitly (or which not to use).  This can be done via QoS. See this HOWTO:  http://community.rti.com/content/forum-topic/control-or-restrict-network...

Depending on the platform, you can use one of this commands to see the active network interfaces in your computer:

On Windows you can use:  ipconfig

On Unix (Linux or MacOSX) you can use ifconfig.

For example in my Mac I currently have 5 active interfaces:

annapurna:ndds.5.0.0 gerardo$ ifconfig
lo0: flags=8049 mtu 16384
	inet6 ::1 prefixlen 128 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
	inet 127.0.0.1 netmask 0xff000000 
gif0: flags=8010 mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863 mtu 1500
	ether 58:b0:35:fe:09:22 
	media: autoselect (none)
	status: inactive
en1: flags=8863 mtu 1500
	ether 90:27:e4:e8:f1:e8 
	inet6 fe80::9227:e4ff:fee8:f1e8%en1 prefixlen 64 scopeid 0x5 
	inet 192.168.1.41 netmask 0xffffff00 broadcast 192.168.1.255
	media: autoselect
	status: active
fw0: flags=8863 mtu 4078
	lladdr e8:06:88:ff:fe:b6:8b:e6 
	media: autoselect 
	status: inactive
vnic0: flags=8843 mtu 1500
	ether 00:1c:42:00:00:08 
	inet 10.211.55.2 netmask 0xffffff00 broadcast 10.211.55.255
	media: autoselect
	status: active
vnic1: flags=8843 mtu 1500
	ether 00:1c:42:00:00:09 
	inet 10.37.129.2 netmask 0xffffff00 broadcast 10.37.129.255
	media: autoselect
	status: active
tun0: flags=8851 mtu 1500
	inet 10.50.2.34 --> 10.50.2.33 netmask 0xffffffff 
	open (pid 2750)

So if I start an application with verbosity 2 or higher I get the error you describe:

annapurna:ndds.5.0.0 gerardo$ ./scripts/rtiddsspy -verbosity 2

RTI Data Distribution Service Spy built with NDDS version 1.6a.00--C1.6a.00--C++1.6a.00
Copyright 2012 Real-Time Innovations, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Running RTI Data Distribution Service Spy with the following options:
    Verbosity..............: 2 (Warning)
    Domain.................: 0
    Participant index......: -1 (auto pick)
    AppId..................: 00000000 (auto pick)
    DiscoveryTTL...........: -1 (use default)
    Peer Host list.........: 
    Transport mask.........: 3 (default)
    Max message size.......: -1 (use default)
    Shmem receive size.......: -1 (use default)
    Type code max size.......: 4096 (use default)
    deadline...............: -1.000000 (no deadline)
    time based filter......: +0.000000 (no time-based filter)
    topic regex............: *
    topic regex............: *
    Partition list.........: * (unless overwritten with qosProfile)

DDS_DomainParticipantFactory_initializeI:Welcome to NDDS nddscore1.6a.rev00-nddsc1.6a.rev00-nddscpp1.6a.rev00
loading QoS ...
Creating domain participant...
[D0000|ENABLE]RTINetioConfigurator_populateUnicastLocators:"" ignoring excess locators > capacity 4
[D0000|ENABLE]DDS_DiscoveryQosPolicy_to_unicast_locators:too many (> 4) unicast transport locators, ignoring some; transports = "", enabled_transports = ""
[D0000|ENABLE]RTINetioConfigurator_populateUnicastLocators:"" ignoring excess locators > capacity 4
[D0000|ENABLE]DDS_TransportUnicastQosPolicy_to_default_locators:too many (> 4) unicast transport locators, ignoring some; transports = "", enabled_transports = ""
[D0000|ENABLE]RTINetioConfigurator_populateUnicastLocators:"" ignoring excess locators > capacity 4
[D0000|ENABLE]DDS_TransportUnicastQosPolicy_to_default_locators:too many (> 4) unicast transport locators, ignoring some; transports = "", enabled_transports = ""
[D0000|ENABLE]RTINetioConfigurator_populateUnicastLocators:"" ignoring excess locators > capacity 4
[D0000|ENABLE]DDS_DiscoveryQosPolicy_to_unicast_locators:too many (> 4) unicast transport locators, ignoring some; transports = "", enabled_transports = ""
Creating subscriber...
NddsSpy is listening for data, press CTRL+C to stop it.

source_timestamp   Info  Src HostId  topic               type              
-----------------  ----  ----------  ------------------  ------------------  

Regarding the second message:

[D0000|ENABLE]NDDS_Transport_UDPv4_Socket_bindWithIp:0X1CF2 in use
[D0000|ENABLE]NDDS_Transport_UDPv4_SocketFactory_create_receive_socket:invalid port 7410
[D0000|ENABLE]NDDS_Transport_UDPv4_create_recvresource_rrEA:!create socket
These messages are caused by the automatic port assignment algorithm used by RTI Connext DDS. According to the OMG DDS-RTPS Interoperability Wire protocol the ports that a DomainParticipant shall use are obtained from an algorithm based on the participantIndex. The participantIndex uniquely identifies each DomainParticipant running on a computer on a given domainId. So for example if your participants are running on domainId=0, then you can have at most one DomainParticipant with participantId=0, at most another  DomainParticipant with participantId=1, and so on.
RTI Connext DDS allows you to configure explicitly the participantId via QoS so that you can indirectly specify with ports it will use on a deterministic fashion. However this means you would have to know a-priory what other DomainParticipant would be running on the same computer which is inconvenient. For this reason the out-of-the-box setting is an "auto-search" mechanism that tries to assign the first participantId that is free. To do this , applications always try to first assign paticipantId and test whether the corresponding unicast ports, which are 7410 (0X1CF2 in hexadecimal) and 7411 are free.  If the ports are not free, the attempt to bind it will report the warning you see. But this has no consequence as the  "auto-search" mechanism will just try the next one and so on until it finds a free one.  
This means that depending what else is running on your computer you may see no such warnings if nothing was running on that domainId, or perhaps one or more if other applications were already running on the same domainId.

If you are curious to see which ports RTI Connext DDS will use for a given domainId and participantId you can use this spreadsheet.

Gerardo
asanchez's picture
Offline
Last seen: 4 years 5 months ago
Joined: 11/16/2011
Posts: 50

Hi Gerardo

Thanks so much for the answer! Now I understand better the network interfaces interaction with DDS and that those messages are just mere informative.

Antonio

rose's picture
Offline
Last seen: 3 years 4 months ago
Joined: 08/22/2011
Posts: 148

Hello Antonio,

I would like to add one more comment: If you are using Windows, it may reorder your interfaces after a reboot.  If this happens, and the first four interfaces are no longer the NICs that RTI should be using, you may find that discovery no longer works.  This will appear random, since it is not obvious that Windows made the change that caused discovery to stop working.

The safest thing to do is to use the HOWTO that Gerardo posted, or just keep this in mind if you ever see problems.

Thank you!

Rose