eProsima / Fast-DDS

The most complete DDS - Proven: Plenty of success cases. Looking for commercial support? Contact info@eprosima.com
https://eprosima.com
Apache License 2.0
2.12k stars 757 forks source link

UDPv6 needs default IPv6 address [11564] #1928

Closed RFRIEDM-Trimble closed 2 years ago

RFRIEDM-Trimble commented 3 years ago

The DDS 2.3 standard only dictates what the IPv4 UDP default address is in section 9.6.1.4. FastDDS does not currently implement a standard IPv6 address.

Thus, I don't think there is a right way to initialize a default IPv6 address multicast locators, but there should be two requirements.

  1. It is an IPv6 address
  2. It is a multicast address

Currently, one address is used here and another here, the latter not being a valid IPv6 address. This ticket is to address that problem.

For IPv4, the standard is correctly followed in the code here

A proposal would be this.

  1. Change the above IPv6 defaults to be a valid IPv6 multicast address
  2. Use an IPv4 to IPv6 mapped address of FF1E::FFFF:239.255.0.1 to follow RFC4291 for the default IPv6 address for Fast-DDS
    • FF at the beginning is multicast
    • flgs T is set to 1 to transient multicast address
    • flgs P is also set to 1 to indicate multicast address assigned based on the network prefix following RFC3306
    • scop is set to Global Scope E
    • flgs R is set to 0
    • Note: The above mapped address representation isn't supported within the Fast-DDS locator constructor, so it will need to be reformatted.
  3. Take the hard-coded addresses for both IPv4 and IPv6 and put them in a header file for users to access if needed

While you're at it, might as well put that address in a header file so other applications can use it.

I'm happy to do the PR; just want feedback on the above.

_Originally posted by @RFRIEDMTrimble in https://github.com/eProsima/Fast-DDS/issues/1640#issuecomment-776184596

EduPonz commented 3 years ago

Hi @RFRIEDM-Trimble ,

Thanks for your detailed report! We have take a look at it and everything seems alright with it. Just a couple of things:

A PR on your part would indeed be most welcome!

Again, thanks for the interest and the thorough report.

RFRIEDM-Trimble commented 3 years ago

No problem.

Yep; I'll adjust the address format to be compatible the API's and submit a PR soon.

RFRIEDM-Trimble commented 3 years ago

I created it with FF1E::FFFF:239.255.0.1 which expands to ff1e:0000:0000:0000:0000:ffff:efff:0001 and compresses back down to FF1E::FFFF:EFFF:1

JLBuenoLopez commented 2 years ago

I will proceed and close this issue as the related PR #1959 was merged several months ago (May 2021) and it was also backported to previous branches (from 2.0.x onward)