-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Update protocol examples to support all network types #13249 (IDFGH-12196) #13250
Update protocol examples to support all network types #13249 (IDFGH-12196) #13250
Conversation
👋 Hello sgryphon, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
9341632
to
67e5c6f
Compare
67e5c6f
to
495183a
Compare
2b88b53
to
df60cc4
Compare
Based on feedback for my other PR, I used |
@sgryphon Thanks, for your contribution. We saw the PR and will need some time to evaluate it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sgryphon, thank you for preparing detailed documentation!
examples/common_components/protocol_examples_common/Kconfig.projbuild
Outdated
Show resolved
Hide resolved
examples/common_components/protocol_examples_common/Kconfig.projbuild
Outdated
Show resolved
Hide resolved
df60cc4
to
60a5fec
Compare
If we have an IPv6 global scope address (on any interface), then check IPv6 first, and if that fails fall back to IPv4. Global scope includes ULA (if ULA is configured, similar to private address ranges, DNS is expected). If we don't have a global IPv6, then only check IPv4.
… address Enable full IPv6 networking (SLAAC, RDNSS, DHCPv6), so that the example will work properly with IPv6 (and IPv4) if available. However by default wait for any (either IPv4 or IPv6) global address, not both, so the example runs on the first address received. This allows the example to run in IPv4-only, IPv6-only, and dual-stack networks, as we have no way to know which network the user will run the example in we need to support all of them. Config settings can still be used so these defaults can be turned off if you want to run single stack, e.g. Matter devices only require IPv6 so you can save space and effort by using IPv6-only.
The ppp_set_usepeerdns macro is only defined if both flags are enabled, so breaks compilation trying to call it if not. Fix is to add the same flags around the call, so the code now compiles.
60a5fec
to
55880ab
Compare
Code / documentation has been updated based on feedback received. |
@espressif-abhikroy |
Hi @sgryphon Thank you for the comprehensive work and the PR with detailed description. We appreciate the effort you've put into enhancing the protocol examples to demonstrate handling DNS in IPv6/only network types. I apologize that it has taken this much time to process -- it fell behind the radar due to its complexity and the potential impact on other components and other code owners. After careful consideration, I have some concerns regarding the default configurations, particularly with backward compatibility and the fact that not all users are on IPv6 networks, especially IPv6-only networks; and as the common connect component is widely used in our protocol tests (where we require the mandatory aspect of waiting for addresses) and, at the same time this component is not a good fit for connecting in real life applications: esp-idf/examples/protocols/README.md Line 13 in d7ca8b9
To maintain the current stability and ensure a smoother experience for all users, I would suggest the following approach:
Such a change would make about 100 lines in one example only with no impact to other components/tests, thus much easier for us to accept. That would also cover 99.9% of the usecases (with the default common connect config, i.e. waiting for IPv4 and LL IPv6, so people with global address capabilities would first get an IPv4 and continue with the example, while getting the global address later -- exactly the same behavior as the 'ANY' option you've introduced). PS: Here's my feedback to the commits:
esp-idf/components/esp_netif/lwip/esp_netif_lwip_ppp.c Lines 234 to 236 in d7ca8b9
|
The This issue has been addressed in commit e2ae81a. However, the feature is currently disabled by default. |
Closing as the problem's been addressed differently in #13250 (comment) |
This updates the protocol examples to support all network types, without any reconfiguration.
See related issue for details: #13249
The default configuration now supports IPv4-only, IPv6-only, and dual-stack networks (either with or without DNS64). This means it works without needing to know the target network (the examples could be run by anyone).
Both IPv4 and IPv6 are enabled, with IPv6 fully enabled for SLAAC, RDNSS, and DHCPv6, however neither IPv4 nor IPv6 are mandatory (the old example treated enable as meaning also mandatory, so required reconfiguration based on the network, so would not necessarily work out of the box).
The default behaviour for each network type is explained in the readme.
The change has been tested using ESP32 with WiFi for:
The change is broken up into the following commits:
Assistance required
I have made corresponding changes to the Ethernet connect, but I only have WiFi so have not been able to test. I have checked the code compiles, but can't deploy and run. PPP did not require any changes, it was already configured to wait for ANY (optional), not ALL (mandatory), but still needs testing.
If there is someone who could assist with verifying the branch on Ethernet and PPP that would be appreciated.