-
Notifications
You must be signed in to change notification settings - Fork 368
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
Can the unicast port number of dds be configured with a static port number? #2110
Comments
Yes, you can. You do it by configuring something called the "participant index":
and this N ultimately comes from the limits on port numbers (the resulting port numbers must be ≤ 65535) and way the port numbers get calculated using this number. With the default settings, N ≤ 120 IIRC. M is The mapping comes from the specification and can be configured using the elements under
With the defaults, for domain id 0, participant index 0 you get 7410/7411; participant index 1 you get 7412/7413; &c. The normal way to get a static port number is by putting a number in |
My configuration is as follows: I then run a test program that creates two participants with domains 0 and 1. Then I use the ss tool to detect that there are two more dynamically bound random port numbers.
|
Oy! I forgot about the sockets it creates for sending data. Those get a random port number and I don't think it can be configured otherwise currently ... There is not much use for separate sockets for sending data if there's only one network interface in use, which is the common case for Cyclone. It is not difficult to change that, but it is a bit fiddly because the multicast transmit interface needs to be set and it does not do that for the sockets it uses to receive data. I think it'll stop creating that extra socket and use the "unicast data" socket (i.e., the one at offset 11) if you change cyclonedds/src/core/ddsi/src/ddsi_init.c Line 1567 in 447912e
if (gv->n_interfaces == 1 || gv->config.many_sockets_mode == DDSI_MSM_NO_UNICAST) and you change: cyclonedds/src/core/ddsi/src/ddsi_udp.c Line 602 in 447912e
set_mc_xmit_options = true; but I haven't tried it ... If you decide to give it a go, please let me know whether it works or not |
I modified the code and it works on x64 linux VM, but on arm64 embedded system, Subscriber and Publisher don't discover each other, what needs to be adjusted in the configuration of the xml file? My configuration is as follows:
|
Also I have verified that it is indeed a configuration issue, if you use the default configuration, pub and sub can communicate normally, but still bind to dynamic random ports. |
One unicast port per domain participant it serves, chosen by the kernel from the list of anonymous ports, that is, >= 32768.
Can this unicast port number be configured with a static port number?
The text was updated successfully, but these errors were encountered: