openthread icon indicating copy to clipboard operation
openthread copied to clipboard

[address-resolver] add new API `otThreadUpdateSnoopedCacheEntry()`

Open abtink opened this issue 1 year ago • 4 comments

This commit adds a new public API to add/update a snoop optimization entry in the address cache table. This is done by inspecting a received message and using an application-specific mechanism to determine the RLOC16 of the sender.

abtink avatar Oct 23 '24 10:10 abtink

Size Report of OpenThread

Merging #10861 into main(7bd3abd67b2443263ca04c1416bb4ee6228e3048).

name branch text data bss total
ot-cli-ftd main 473128 856 66220 540204
#10861 473128 856 66220 540204
+/- 0 0 0 0
ot-ncp-ftd main 441628 760 61440 503828
#10861 441628 760 61440 503828
+/- 0 0 0 0
libopenthread-ftd.a main 240077 95 39998 280170
#10861 240091 95 39998 280184
+/- +14 0 0 +14
libopenthread-cli-ftd.a main 59137 0 8083 67220
#10861 59137 0 8083 67220
+/- 0 0 0 0
libopenthread-ncp-ftd.a main 32787 0 5924 38711
#10861 32787 0 5924 38711
+/- 0 0 0 0
ot-cli-mtd main 367944 760 50828 419532
#10861 367944 760 50828 419532
+/- 0 0 0 0
ot-ncp-mtd main 350652 760 46072 397484
#10861 350652 760 46072 397484
+/- 0 0 0 0
libopenthread-mtd.a main 160163 0 24630 184793
#10861 160163 0 24630 184793
+/- 0 0 0 0
libopenthread-cli-mtd.a main 40113 0 8059 48172
#10861 40113 0 8059 48172
+/- 0 0 0 0
libopenthread-ncp-mtd.a main 25561 0 5924 31485
#10861 25561 0 5924 31485
+/- 0 0 0 0
ot-cli-ftd-br main 559896 864 131100 691860
#10861 559896 864 131100 691860
+/- 0 0 0 0
libopenthread-ftd-br.a main 331664 100 104846 436610
#10861 331680 100 104846 436626
+/- +16 0 0 +16
libopenthread-cli-ftd-br.a main 73334 0 8115 81449
#10861 73334 0 8115 81449
+/- 0 0 0 0
ot-rcp main 63040 564 20804 84408
#10861 63040 564 20804 84408
+/- 0 0 0 0
libopenthread-rcp.a main 9920 0 5060 14980
#10861 9920 0 5060 14980
+/- 0 0 0 0
libopenthread-radio.a main 19121 0 238 19359
#10861 19121 0 238 19359
+/- 0 0 0 0

size-report[bot] avatar Oct 23 '24 10:10 size-report[bot]

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.88%. Comparing base (7bd3abd) to head (5da9bb3).

Files with missing lines Patch % Lines
src/core/api/thread_ftd_api.cpp 0.00% 3 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10861      +/-   ##
==========================================
+ Coverage   75.93%   77.88%   +1.94%     
==========================================
  Files         622      624       +2     
  Lines       92227    88177    -4050     
==========================================
- Hits        70036    68679    -1357     
+ Misses      22191    19498    -2693     
Files with missing lines Coverage Δ
src/core/api/thread_ftd_api.cpp 59.35% <0.00%> (-21.57%) :arrow_down:

... and 148 files with indirect coverage changes

codecov[bot] avatar Oct 23 '24 11:10 codecov[bot]

Closing this PR.

@arnulfrupp, I recall we discussed adding such an API in the last Thread MM, but we also talked about other (maybe) better solutions (e.g., using a service ALOC address to avoid the need for Address Query). 

If you are still interested in this API, let us know, and we can reopen this PR.

abtink avatar Jan 08 '25 18:01 abtink

@abtink: Yes I'm still interested in that commit. There is to use-cases for this API:

  1. Efficient multicast discovery (from any device)
  2. Proactively informing nodes about a role change (RLOC change) of an application controller.

For 2) an ALOC may be the better solution if the controller sits on the same Thread network. For 1) ALOC would not make sense. I believe EID -> RLOC address resolution queries already update the snoop cache for the same reason. Making the same available to application level discovery requests would be great.

arnulfrupp avatar Jan 10 '25 17:01 arnulfrupp