Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] IPv6

Hi,

 

I'm currently using mosquitto (as a client) for one of my projects.

It’s working great, but I discovered the following issue:

 

The mosquitto broker I use (AWS IoT) resolves to both IPv6 and IPv4 addresses.

I noticed that in some occasions, the underling OS (linux) will think the IPv6 address is reachable, but due to routing issues further down the line is actually unreachable and the connection will time-out.

The problem is that when the application tries to reconnect, mosquitto will keep selecting an IPv6 address and the connection can never be established.

 

Obviously, the ideal solution is to fix the IPv6 routing issues. However, as this is not always under our control and IPv6 networks across the world are not always reliable, I’ve patched

mosquito (1.4.12) to work around this issue (see attachment).

Basically, this patch will make sure that if a connection is setup towards an IPv6 address, and it fails to connect, then on the next attempt it will try and connect over IPv4. It’s not the perfect solution, but it gets the job done.

 

Probably a better solution would be to implement something like the ‘Happy Eyeballs’ algorithm, which was published by IETF specifically to solve these kind of issues (and which is also implemented by cURL)

https://en.wikipedia.org/wiki/Happy_Eyeballs

https://tools.ietf.org/html/rfc6555

 

Are you aware of this issue and/or is there already a different solution available for this problem (that I overlooked)?

If not, do you think this patch could be integrated and/or could a better solution be implemented in future mosquitto version?

 

Your feedback is highly appreciated.

 

Thanks,

Kevin

Attachment: ignore-ipv6-on-fail.patch
Description: Binary data


Back to the top