otbr posix don't have srp server function

469 views
Skip to first unread message

Wang Haoran

unread,
Jul 19, 2021, 3:42:08 AM7/19/21
to openthread-users
Hi Developers,
      I'm trying to play the OTBR codelab from: https://openthread.io/codelabs/openthread-border-router 
    
      The environment is:
      OpenThread end device: RPi 4B with Ubuntu LTS 20.04 joined the OpenThread network as child
      OTBR device: ARM64 based SoC running compatible posix Linux

       The OpenThread end device can join the network formed by the OTBR. ping6 works between the OTBR and end device via IPV6.
        But when I try to setup the SRP in the client end, found its status always the "ToAdd" and not the "Registered".
        The instruction to enable SRP service of the SRP client are as below:
> dataset set active 0e080000000000010000000300000f35060004001fffe0020811111111222222220708fdd40f8e526c8ed8051000112233445566778899aabbccddeeff030e4f70656e54687265616444656
d6f01021234041061e1206d2c2b46e079eb775f41fc72190c0302a0ff
Done
> ifconfig up
Done
> thread start
Done
> state
detached
Done
> state
child
Done
> srp client autostart enable
Done
> srp client host name ot-host
Done
> ipaddr
fdd4:f8e:526c:8ed8:0:ff:fe00:f800
fd11:22:0:0:c3bb:8443:3bea:5980
fdd4:f8e:526c:8ed8:d15e:ef6f:e224:f139
fe80:0:0:0:e0af:aff2:f310:b27b
Done
> srp client host address fd11:22:0:0:c3bb:8443:3bea:5980
Done
> srp client service add ot-service _ipps._tcp 12345
Done
> srp client service
instance:"ot-service", name:"_ipps._tcp", state:ToAdd, port:12345, priority:0, weight:0
Done
> srp client service
instance:"ot-service", name:"_ipps._tcp", state:ToAdd, port:12345, priority:0, weight:0
Done
> netdata show
Prefixes:
fd11:22:0:0::/64 paros med ec00
Routes:
Services:
Done

    In the OTBR, I run ot-ctl command, but not found any SRP command like "SRP server". I think the reason why the client service registered pending is because that no SRP server running.
    Try to build OTBR with "$./scripts/cmake-build -DOT_SRP_SERVER=ON", it will report the build error due the default CMake config of the OTBR will mark OT_SRP_SERVER:OFF.

    To play the OTBR codelab, is there anything I missed?

    Very appreciate for you!


Kangping Dong

unread,
Jul 19, 2021, 4:04:08 AM7/19/21
to Wang Haoran, openthread-users
Can you share the commands you used to build OTBR?

BRs,
Kangping

--
You received this message because you are subscribed to the Google Groups "openthread-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/bad2c7ef-a066-460a-b517-6c09a531c5cdn%40googlegroups.com.

Wang Haoran

unread,
Jul 19, 2021, 4:12:19 AM7/19/21
to openthread-users
Actually I'm using the cross-compile to build the OTBR. I replaced the toolchain in CMake.

For the commands, I'm using:
"$./script/cmake-build -DOT_THREAD_VERSION=1.1"
This can make the build pass and the BroaderRouter basic function work well like ping6 I mention in the original post, and found the OT_SRP_SERVER is set to be OFF:
$grep SRP_SERVER build/otbr/CMakeCache.txt
$OT_SRP_SERVER:BOOL=OFF

If I append "-DOT_SRP_SERVER=ON" in the build command:
"$./script/cmake-build -DOT_SRP_SERVER=ON" it will report the error which depends on  "OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE".

Anything wrong with my build instructions?

Thanks.

Wang Haoran

unread,
Jul 19, 2021, 4:28:11 AM7/19/21
to openthread-users
Hi Kanping,
    Thank you for the clue. Seems my build parameter is incorrect.

    I need to append more arguments to enable the SRP Server:
    "./scripts/cmake-build -DBUILD_TESTING=OFF -DOTBR_DBUS=ON -DOTBR_DNSSD_DISCOVERY_PROXY=ON -DOTBR_SRP_ADVERTISING_PROXY=ON -DOT_THREAD_VERSION=1.1"

    And this will make the SRP client register the information successfully to the OTBR:
     > srp client service
instance:"ot-service", name:"_ipps._tcp", state:Registered, port:12345, priority:0, weight:0
Done

    Very appreciate for your help!

Kangping Dong

unread,
Jul 19, 2021, 4:38:51 AM7/19/21
to Wang Haoran, openthread-users
Cool!

As you are cross-compiling OTBR (but not building OTBR on the device with `./script/setup`), I want to warn you that there may
be IPv6 connectivity issues when you try to ping the address obtained from DNS services.

`./script/setup` sets up system configurations for solving connectivity issues and you may want to run it at least once on the OTBR device.

BRs,
kangping

Wang Haoran

unread,
Jul 19, 2021, 4:50:57 AM7/19/21
to openthread-users
Thank you for the information.
I picked some commands from the  "./script/setup" like:
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 2 > /proc/sys/net/ipv6/conf/all/accept_ra

And I also use the radvd to support IPv6 DHCP for WiFi subnetwork device.
The WiFi subnetwork device will have IPv6 addrsss in: fd11:33::1/64

Then in the OTBR, I setup the route table as to forward the frame dst to WiFi subnetwork device back to wlan0 interface
sudo ip -6 route add fd11:33::1/64 dev wlan0 

In the OpenThread end device, I setup the route table to forward the frame dest to WiFi subnetwork device back to wpan0 interface:
sudo ip -6 route add fd11:33::1/64 dev wpan0

Now in OpenThread end device, I can ping my mobile (WiFi subnetwork device) successfully:
ubuntu@ubuntu:~/test$ ping6 fd11:33::a486:1665:98ac:f52e
PING fd11:33::a486:1665:98ac:f52e(fd11:33::a486:1665:98ac:f52e) 56 data bytes
64 bytes from fd11:33::a486:1665:98ac:f52e: icmp_seq=1 ttl=63 time=136 ms
64 bytes from fd11:33::a486:1665:98ac:f52e: icmp_seq=2 ttl=63 time=152 ms
64 bytes from fd11:33::a486:1665:98ac:f52e: icmp_seq=3 ttl=63 time=276 ms

And in my mobile, ping6 works to reach the OpenThread device:
bonito:/ $ ping6 fd11:22::cce6:7238:207c:70f3
PING fd11:22::cce6:7238:207c:70f3(fd11:22::cce6:7238:207c:70f3) 56 data bytes
64 bytes from fd11:22::cce6:7238:207c:70f3: icmp_seq=1 ttl=63 time=135 ms
64 bytes from fd11:22::cce6:7238:207c:70f3: icmp_seq=2 ttl=63 time=161 ms
64 bytes from fd11:22::cce6:7238:207c:70f3: icmp_seq=3 ttl=63 time=124 ms
64 bytes from fd11:22::cce6:7238:207c:70f3: icmp_seq=4 ttl=63 time=155 ms

Also in the Android mobile, with the WiFi network, the "Service Browser" App can detected the "_ipps._tcp." service which I registered by SRP command in OpenThread end device.
With the Android App "Network Analyzer", I can ping the OpenThread end device via IPv6 address come from "Service Browser" successfully.

So can I say that my OTBR already have basic function works and it can be used to play the Codelab well?

Thanks.

Kangping Dong

unread,
Jul 19, 2021, 5:06:44 AM7/19/21
to Wang Haoran, openthread-users
The codelab doesn't use radvd, instead we have a feature `OTBR_BORDER_ROUTING` that enables
automatic routing management on your Wi-Fi/Ethernet link, you just need to
1. Build with `-DOTBR_BORDER_ROUTING=ON`
2. specify your Wi-Fi or Ethernet interface with the `-B` option passed to OTBR;

BTW, you can learn more necessary feature flags in `./script/_otbr`.

BRs,
Kangping

Reply all
Reply to author
Forward
0 new messages