Skip to content

Upgrading from ESP-IDF 5.1 to 5.3; breaking changes? (TZ-1396) #112

@motters

Description

@motters

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate.
  • Provided a clear description of your suggestion.
  • Included any relevant context or examples.

Issue or Suggestion Description

Hi,

Summary

Are there any API changes that could break routing data from the NAT to the backbone when migrating from IDF 5.1 to 5.3?

Details

We were having issues with the ESP BR crashing during high bursts of data, (https://github.com/orgs/openthread/discussions/11038). @chshu suggested we upgraded to IDF 5.3 which fixed a bug around this issue.

We have updated ESP-IDF to 5.3 and everything is working, except the BR is not passing requests from the NAT to the backbone.

For example, when a node tries to perform a DNS request using the BR's NAT, there is no reply. Below shows the BR log where fd6e:266c:4da0:1:7d59:1874:de24:c55e is the node.

I(727307) OPENTHREAD:[I] MeshForwarder-: Received IPv6 UDP msg, len:94, chksum:6b09, ecn:no, from:0x5c00, sec:yes, prio:normal, rss:-45.0
I(727320) OPENTHREAD:[I] MeshForwarder-:     src:[fd6e:266c:4da0:1:7d59:1874:de24:c55e]:41620
I(727322) OPENTHREAD:[I] MeshForwarder-:     dst:[fd6e:266c:4da0:2:0:0:808:808]:53
I(727338) OPENTHREAD:[I] Mac-----------: Frame rx failed, error:Duplicated, len:101, seqnum:227, type:Data, src:0x5c00, dst:0x3c00, sec:yes, ackreq:yes
I(727354) OPENTHREAD:[I] MeshForwarder-: Sent IPv6 UDP msg, len:199, chksum:fe68, ecn:no, to:0xffff, sec:yes, prio:net
I(727357) OPENTHREAD:[I] MeshForwarder-:     src:[fe80:0:0:0:2c81:3eaf:10a9:1e40]:19788
I(727369) OPENTHREAD:[I] MeshForwarder-:     dst:[ff02:0:0:0:0:0:0:1]:19788
I(727408) OPENTHREAD:[I] MeshForwarder-: Received IPv6 UDP msg, len:199, chksum:1aea, ecn:no, from:42e2345cff43d991, sec:yes, prio:net, rss:-45.5
I(727421) OPENTHREAD:[I] MeshForwarder-:     src:[fe80:0:0:0:40e2:345c:ff43:d991]:19788
I(727423) OPENTHREAD:[I] MeshForwarder-:     dst:[ff02:0:0:0:0:0:0:1]:19788
I(727436) OPENTHREAD:[I] Mle-----------: Receive Data Response (fe80:0:0:0:40e2:345c:ff43:d991)
I(728184) OPENTHREAD:[I] RoutingManager: Evaluating routing policy
I(728186) OPENTHREAD:[I] RoutingManager: Evaluating NAT64 prefix
I(728188) OPENTHREAD:[I] RoutingManager: Preparing RA
I(728199) OPENTHREAD:[I] RoutingManager: - RA Header - flags - M:0 O:0 S:1
I(728210) OPENTHREAD:[I] RoutingManager: - RA Header - default route - lifetime:0
I(728220) OPENTHREAD:[I] RoutingManager: - PIO fd00:0:0:0::/64 (valid:1800, preferred:1800)
I(728223) OPENTHREAD:[I] RoutingManager: - RIO fd6e:266c:4da0:1::/64 (lifetime:1800, prf:medium)
I(728237) OPENTHREAD:[I] RoutingManager: Sent RA on infra netif 2
I(728240) OPENTHREAD:[I] RoutingManager: Will evaluate routing policy in 03:02.308 (182308 msec)
I(728253) OPENTHREAD:[I] RoutingManager: Received RA from fe80:0:0:0:66b7:8ff:fe3d:d6ac on infra netif 2 (this BR routing-manager)
I(731700) OPENTHREAD:[I] Mle-----------: Send Advertisement (ff02:0:0:0:0:0:0:1)
I(731740) OPENTHREAD:[I] MeshForwarder-: Sent IPv6 UDP msg, len:91, chksum:d99d, ecn:no, to:0xffff, sec:no, prio:net
I(731742) OPENTHREAD:[I] MeshForwarder-:     src:[fe80:0:0:0:2c81:3eaf:10a9:1e40]:19788
I(731753) OPENTHREAD:[I] MeshForwarder-:     dst:[ff02:0:0:0:0:0:0:1]:19788
I(741371) OPENTHREAD:[I] Mle-----------: Send Announce on channel 13
I(741399) OPENTHREAD:[I] MeshForwarder-: Sent IPv6 UDP msg, len:83, chksum:c9bf, ecn:no, to:0xffff, sec:yes, prio:net
I(741401) OPENTHREAD:[I] MeshForwarder-:     src:[fe80:0:0:0:2c81:3eaf:10a9:1e40]:19788
I(741413) OPENTHREAD:[I] MeshForwarder-:     dst:[ff02:0:0:0:0:0:0:1]:19788
I(744228) OPENTHREAD:[I] Mle-----------: Send Advertisement (ff02:0:0:0:0:0:0:1)
I(744249) OPENTHREAD:[I] MeshForwarder-: Sent IPv6 UDP msg, len:91, chksum:d541, ecn:no, to:0xffff, sec:no, prio:net
I(744251) OPENTHREAD:[I] MeshForwarder-:     src:[fe80:0:0:0:2c81:3eaf:10a9:1e40]:19788
I(744263) OPENTHREAD:[I] MeshForwarder-:     dst:[ff02:0:0:0:0:0:0:1]:19788
I(749409) OPENTHREAD:[I] MeshForwarder-: Received IPv6 UDP msg, len:91, chksum:382c, ecn:no, from:42e2345cff43d991, sec:no, prio:net, rss:-46.0

The BR can contact the node:

> ping fd6e:266c:4da0:1:7d59:1874:de24:c55e

I(868590) OPENTHREAD:[I] Icmp6---------: Sent echo request: (seq = 3)
I(868609) OPENTHREAD:[I] MeshForwarder-: Sent IPv6 ICMP6 msg, len:56, chksum:2217, ecn:no, to:0x5c00, sec:yes, prio:normal
I(868612) OPENTHREAD:[I] MeshForwarder-:     src:[fd6e:266c:4da0:1:167e:fa1f:76f2:7ec7]
I(868624) OPENTHREAD:[I] MeshForwarder-:     dst:[fd6e:266c:4da0:1:7d59:1874:de24:c55e]
I(868645) OPENTHREAD:[I] MeshForwarder-: Received IPv6 ICMP6 msg, len:56, chksum:2117, ecn:no, from:0x5c00, sec:yes, prio:normal, rss:-43.0
I(868658) OPENTHREAD:[I] MeshForwarder-:     src:[fd6e:266c:4da0:1:7d59:1874:de24:c55e]
I(868660) OPENTHREAD:[I] MeshForwarder-:     dst:[fd6e:266c:4da0:1:167e:fa1f:76f2:7ec7]
16 bytes from fd6e:266c:4da0:1:7d59:1874:de24:c55e: icmp_seq=3 hlim=64 time=85ms
1 packets transmitted, 1 packets received. Packet loss = 0.0%. Round-trip min/avg/max = 85/85.0/85 ms.

The BR's NAT is active:

> nat64 state

PrefixManager: Active
Done

The BR has an internet connection as we are running other libraries that use the same network. However OT cannot ping any external ip addresses:

> ping 8.8.8.8

Pinging synthesized IPv6 address: fd6e:266c:4da0:2:0:0:808:808
1 packets transmitted, 0 packets received. Packet loss = 100.0%.
Done

The BR's openthread stack can also not perform DNS requests

> dns resolve google.com 8.8.8.8

Synthesized IPv6 DNS server address: fd6e:266c:4da0:2:0:0:808:808
E (2195814) OPENTHREAD: Failed to Send UDP message, err: -12
E (2201814) OPENTHREAD: Failed to Send UDP message, err: -12
E (2207815) OPENTHREAD: Failed to Send UDP message, err: -12
DNS response for google.com. - 
Error 28: ResponseTimeout

The nodes use OT SRP and these services are registered to the building's router through the BR successfully. Hence proving the backbone is registered correctly. See the below output from a computer on the same network.

user@mac folder %  dns-sd -B _XXX._udp
Browsing for _XXX._udp
DATE: ---Tue 17 Dec 2024---
10:41:41.122  ...STARTING...
Timestamp     A/R    Flags  if Domain               Service Type         Instance Name
10:41:41.122  Add        2  11 local.               _XXX._udp.    f4ce36dc0e4c1111

Some BR logs that may help:

> bbr stateI

Primary
Done

> br state

running
Done

> netstat

| Local Address                                   | Peer Address                                    |
+-------------------------------------------------+-------------------------------------------------+
| [0:0:0:0:0:0:0:0]:1000                          | [0:0:0:0:0:0:0:0]:0                             |
| [0:0:0:0:0:0:0:0]:0                             | [0:0:0:0:0:0:0:0]:0                             |
| [0:0:0:0:0:0:0:0]:49156                         | [fda7:56f4:942:ab5e:4490:7063:15ef:77bf]:53549  |
| [0:0:0:0:0:0:0:0]:53549                         | [0:0:0:0:0:0:0:0]:0                             |
| [0:0:0:0:0:0:0:0]:49153                         | [0:0:0:0:0:0:0:0]:0                             |
| [0:0:0:0:0:0:0:0]:53                            | [0:0:0:0:0:0:0:0]:0                             |
| [0:0:0:0:0:0:0:0]:61631                         | [0:0:0:0:0:0:0:0]:0                             |
| [0:0:0:0:0:0:0:0]:19788                         | [0:0:0:0:0:0:0:0]:0                             |
| [0:0:0:0:0:0:0:0]:61631                         | [0:0:0:0:0:0:0:0]:0                             |
Done

> router table

| ID | RLOC16 | Next Hop | Path Cost | LQ In | LQ Out | Age | Extended MAC     | Link |
+----+--------+----------+-----------+-------+--------+-----+------------------+------+
| 15 | 0x3c00 |       63 |         0 |     0 |      0 |   0 | 0000000000000000 |    0 |
| 23 | 0x5c00 |       63 |         0 |     3 |      3 |   1 | 42e2345cff43d991 |    1 |

> netdata show

Prefixes:
fd6e:266c:4da0:1::/64 paos low 3c00
Routes:
fc00::/7 sa med 3c00
fd6e:266c:4da0:2:0:0::/96 sn low 3c00
Services:
44970 01 68000500000e10 s 3c00 0
44970 5d fda756f40942ab5e4490706315ef77bfd12d s 3c00 1
Contexts:
fd6e:266c:4da0:1::/64 1 c
Commissioning:
19608 3c00 - ff
Done

> domainname

DefaultDomain
Done

> ifconfig

up
Done

> ipaddr

fda7:56f4:942:ab5e:0:ff:fe00:fc30
fda7:56f4:942:ab5e:0:ff:fe00:fc11
fda7:56f4:942:ab5e:0:ff:fe00:fc38
fd6e:266c:4da0:1:167e:fa1f:76f2:7ec7
fda7:56f4:942:ab5e:0:ff:fe00:fc10
fda7:56f4:942:ab5e:0:ff:fe00:fc00
fda7:56f4:942:ab5e:0:ff:fe00:3c00
fda7:56f4:942:ab5e:4490:7063:15ef:77bf
fe80:0:0:0:2c81:3eaf:10a9:1e40
Done

> ipmaddr

ff33:40:fda7:56f4:942:ab5e:0:1
ff32:40:fda7:56f4:942:ab5e:0:1
ff02:0:0:0:0:0:0:2
ff03:0:0:0:0:0:0:2
ff02:0:0:0:0:0:0:1
ff03:0:0:0:0:0:0:1
ff03:0:0:0:0:0:0:fc
Done

> leaderdata

Partition ID: 1373084161
Weighting: 65
Data Version: 230
Stable Data Version: 103
Leader Router ID: 15
Done

Do you have any suggestion?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions