openthread / ot-reference-release

BSD 3-Clause "New" or "Revised" License
11 stars 27 forks source link

Command to change DNS Server Port at Runtime Not Available #47

Closed shouvik-grl closed 1 year ago

shouvik-grl commented 1 year ago

We are writing test scripts for duckhorn based on the 1.3 Duckhorn Test Plan. While going through the DuckHorn 3.2 test case (3.2. [COMPONENT] Re-register service with active SRP server - Multiple BRs - With AIL) and 3.2b test case (3.2b. [PRODUCT] Re-register service with active SRP server - Multiple BRs - With AIL - Thread Product DUT) , we came across a requirement.

In Step 4 (for both the test cases Step 4) it is advised to configure the BR "to advertise its DNS/SRP Unicast Dataset at an available port value, P, different from 53." In step 8 (3.2b) it is advised to again change the port "BR to advertise its DNS/SRP Unicast Dataset at a new port value, P2."

We could not found a suitable command for that.

Is it possible to change this port at the runtime?

abtink commented 1 year ago

Disabling the SRP server and enable it again will do this. SRP server will pick a new port number upon restart. CLI command srp server disable and then srp server enable (which map to otSrpServerSetEnabled() API).

librasungirl commented 1 year ago

One supplement is only when there are SRP services registered, the DNS/SRP port that is registered into the Thread Network Data will be stored into non-volatile storage and increase in next stack restart or srp server disable/enable

The default SRP port for OTBR reference is 53535 (different from 53 as step4 requires) and there is DUT's SRP service registered before step8, with srp server disable/enable on BR, the port will increase as the test requires.

shouvik-grl commented 1 year ago

Thanks @abtink and @librasungirl for your support.

I tried the same i.e: disabling the SRP server (srp server disable) and then again enabling it (srp server enable)

But its looking like not working for me SRPPortNotChangingSS

Am I doing something wrong?

librasungirl commented 1 year ago

@shouvik-grl as mentioned above, you need to bring up one thread device and let it register some SRP service to the BR. then disable and enable srp server, you will find the port increases.

shouvik-grl commented 1 year ago

Thanks for your support @librasungirl

Yes with the thread device register some SRP service to the BR SRP port change is working. srp port change working

Again thanks @abtink and @librasungirl for your sopport.