Skip to content
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

[BUG] minimal mDNS responses / announcements for unique records (A, AAAA, SRV, TXT) don't set the cache-flush bit #23918

Closed
ksperling-apple opened this issue Dec 6, 2022 · 0 comments · Fixed by #23933
Labels

Comments

@ksperling-apple
Copy link
Contributor

ksperling-apple commented Dec 6, 2022

Reproduction steps

  1. Run e.g. all-clusters-app on ESP32/M5Stack (with CONFIG_USE_MINIMAL_MDNS=1)
  2. Observe mDNS packets on the network

E.g.

Multicast Domain Name System (response)
    Transaction ID: 0x0000
    Flags: 0x8400 Standard query response, No error
    Questions: 0
    Answer RRs: 4
    Authority RRs: 0
    Additional RRs: 3
    Answers
        _services._dns-sd._udp.local: type PTR, class IN, _matter._tcp.local
        _services._dns-sd._udp.local: type PTR, class IN, _I49897676B257FAF4._sub._matter._tcp.local
        _matter._tcp.local: type PTR, class IN, 49897676B257FAF4-000000000000022B._matter._tcp.local
        _I49897676B257FAF4._sub._matter._tcp.local: type PTR, class IN, 49897676B257FAF4-000000000000022B._matter._tcp.local
    Additional records
        49897676B257FAF4-000000000000022B._matter._tcp.local: type SRV, class IN, priority 0, weight 0, port 5540, target 782184957AAC.local
        49897676B257FAF4-000000000000022B._matter._tcp.local: type TXT, class IN
        782184957AAC.local: type AAAA, class IN, addr fe80::7a21:84ff:fe95:7aac
    [Unsolicited: True]

In this example, the SRV, TXT, and AAAA records should be considered part of "unique" RR set and hence have the cache-flush bit set. Note that as per RFC 6762 advertising unique RR sets also requires probing which appears to not currently be implemented in the minimal mDNS implementation.

One practical scenario where we've seen this have an impact is when retrying a commissioning flow that brings the device onto the network. It's often the case that the IPv6 LL address becomes available some seconds before a routable IPv6 address with a prefix announced by the router. In this case the device will send an announcement (without cache-flush) containing it's IPv6 LL address, but the commissioner may still have a previous AAAA record with a routable address cached, and prefer it to the valid LL address. The commissioner then ends up retransmitting the CASE Sigma1 message until the ULA actually becomes available or the CASE establishment times out.



### Bug prevalence

100% reproducible

### GitHub hash of the SDK that was being used

0b8ecc84

### Platform

esp32, other

### Platform Version(s)

_No response_

### Anything else?

_No response_
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Dec 6, 2022
There should only be one entity around with a given Matter instance name or
Matter hostname, so all records which have those as the QName are part of the
unique set.

Fixes project-chip#23918
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Dec 6, 2022
There should only be one entity around with a given Matter instance name or
Matter hostname, so all records which have those as the QName are part of the
unique set.

Fixes project-chip#23918
andy31415 pushed a commit that referenced this issue Dec 6, 2022
* Set the cache-flush bit for "unique" records in minimal mdns.

There should only be one entity around with a given Matter instance name or
Matter hostname, so all records which have those as the QName are part of the
unique set.

Fixes #23918

* Fix build issue.
cliffamzn pushed a commit to sharadb-amazon/connectedhomeip that referenced this issue Feb 23, 2023
…t-chip#23933)

* Set the cache-flush bit for "unique" records in minimal mdns.

There should only be one entity around with a given Matter instance name or
Matter hostname, so all records which have those as the QName are part of the
unique set.

Fixes project-chip#23918

* Fix build issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants