BroadbandForum / obuspa

OB-USP-AGENT is a system daemon providing a User Services Platform (USP) Agent. https://github.com/BroadbandForum/obuspa/wiki
BSD 3-Clause "New" or "Revised" License
88 stars 61 forks source link

Enabling IPV6 for USP Agent MQTT communication #94

Closed shanthakumarks closed 1 year ago

shanthakumarks commented 1 year ago

Hi ,

What would it take to tell the USP Agent to establish MQTT Communication with USP Controller over IPv6. We see that the parameter "Internal.DualStackPreference" allows to enable IPv6 in STOMP. But this doesn't seem be enabling IPv6 connection in the case of MQTT communication. In core/mqtt.c , we could see that selecting the MQTT version as v3.1.1 makes the code to use mosquitto_connect which supports IPv6 but we couldnt find the code where the host "client->conn_params.host" is resolved to IPv6 address. Could you please give us some pointer to enable us to use IPv6 for the USP Agent and USP Controller MQTT communication ?

holme-r commented 1 year ago

The DualStackPreference parameter selects between connecting to an IPv4 hosted server or an IPv6 hosted server if the DNS response for the server has entries for both. The MQTT MTP does not make use of it because libmosquitto performs the DNS lookup and connect. As such libmosquitto is in charge of the policy if the DNS response contains IPv4 and IPv6 entries.

Please check that the DNS response for the Controller that you're trying to connect to contains only an IPv6 record. OBUSPA just passes the hostname configured in the BrokerAddress data model parameter directly through to libmosquitto and does not set the bind_address argument. So I would expect that if DNS indicates only IPv6, and that the device has an IPv6 address on the interface upon which the Controller can be reached, and that routing table and firewall settings are not preventing it, that libmosquitto would be able to connect to the Controller successfully.

johnblackford commented 1 year ago

Closing as addressed.