How to make NCP as a Border Router

1,025 views
Skip to first unread message

mad...@pathpartnertech.com

unread,
Mar 6, 2017, 9:41:28 AM3/6/17
to openthread-users, Jonathan Hui

Hi ,

 I am Running NCP on Wpantund-Linux.(following the Open-thread simulator tutorial).

 

 Can you tell me how to make NCP as a border router.


 I tried, but the NCP is not able to join more than one Network at a time.

 When i try to join NCP with 2nd network , it is throwing an error join failed with error 10. Already.


 Please tell me that , is it right procedure ?


 Is there any procedure to create a network with boarder router and interact with other networks?


 My Requirement is like to collect the data from end-device and Boarder router should send it to the cloud.


Thanks
Madhu Raj.

Shahabuddin Mohammed

unread,
Mar 6, 2017, 11:42:52 PM3/6/17
to openthread-users, jon...@nestlabs.com
Hi Madhu,

Thread Border Router (BR) will only join to a single Thread network that's the reason it throws an error, if you try to join to another Thread network.

BR will have two interfaces one is Thread, which you have managed to get connected, while the other one is an interface on the host pc created by WPANTUND as wpan0 (or utun6 or whatever you've configured), the packets received by Thread BR will be routed to this interface.

You can have a UDP server receiving data on this interface for a given port number, collect the data and send it to the cloud in a way you like.

Hope it helps!

Thanks,
Shahab

mad...@pathpartnertech.com

unread,
Mar 6, 2017, 11:50:51 PM3/6/17
to openthread-users, jon...@nestlabs.com
Thanks Mr.Mohammed,

                    Now its given me an clear idea to start it. and i hope you will help me further if i am getting any doubts.

Thanks
Madhu Raj. 

mad...@pathpartnertech.com

unread,
Mar 9, 2017, 8:45:56 AM3/9/17
to openthread-users, shahabud...@gmail.com
HI Mohammed,
                      
                       Can you give me more inputs on how to route the packets from the BR to host pc and to internet.
I am seeing "config-gateway", "add-route" commands in NCP appliction. Can you suggest me how to use this commands? and also how to integrate with UDP and their communication.

Please suggest me any tutorials/ documents related to above routing techniques.
(Actually i'm fresher so i am finding it difficult to start with).

Thanks
Madhu Raj.

  On Tuesday, March 7, 2017 at 10:12:52 AM UTC+5:30, Shahabuddin Mohammed wrote:Hi Madhu,

Martin Turon

unread,
Mar 9, 2017, 10:55:19 AM3/9/17
to mad...@pathpartnertech.com, openthread-users, Shahabuddin Mohammed
Hi Madhu,

You want to take a look at wpantund:  https://github.com/openthread/wpantund

The steps are basically as follows:

1) Flash NCP firmware to your NCP chip.  Note how NCP chip is connected to host (UART or SPI).

2) Build and install wpantund for your host using the standard process:

cd wpantund
./bootstrap.sh
./configure
make
sudo make install


3) Start wpantund on your host.  Be sure to pass flags appropriate to connect wpantund to your NCP connection type.  You can also name the network interface at this time or let wpantund automatically assign a name (wpan0):

sudo /usr/local/sbin/wpantund -o NCPSocketName /dev/ttyUSB0 -o SyslogMask all -I wpan0

4) Start wpanctl to access the command line management interface for controlling Thread features on your device.  This is similar to the Thread cli interface conceptually but with slightly different command syntax:

sudo /usr/local/bin/wpanctl -I wpan0

5) Confirm your network interface has started and is operational by running standard IP commands such `ifconfig` and `ping6`.

Martin

_____________________________
Martin Turon  |  Nest Labs

This message contains confidential information and is intended only for the individual(s) named. If you are not the intended recipient, you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this mail and attached file/s is strictly prohibited. Please notify the sender immediately and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secured or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to openthread-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/c3b9c204-53c8-447a-837b-3d18db0a3415%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jonathan Hui

unread,
Mar 9, 2017, 11:49:32 AM3/9/17
to Martin Turon, mad...@pathpartnertech.com, openthread-users, Shahabuddin Mohammed
Madhu,

It seems you already have wpantund compiled, installed, and running with a (possibly simulated) Thread network and just need to figure out how to configure wpantund and the Thread network to support global prefixes and routing.

You were correct to guess that `config-gateway` is what you want to use to provide an "on-mesh" prefix to Thread via wpanctl.  The command is actually quite simple:

    $ config-gateway -d <prefix>

The `-d` flag indicates that the NCP should serve as a default route for the given prefix.  For example, if you wanted to configure `2001:dead:beef:cafe::/64`, you simply provide:

    $ config-gateway -d 2001:dead:beef:cafe::

After you do that, you will notice that your linux wpan0 interface will have a new IPv6 address which you can view via `ifconfig`.  If you have a CLI node attached, you will also see it configure a new IPv6 address which you can view via `ipaddr`.  From linux, you should be able to ping the 2001:: address on the CLI node.  If you setup IPv6 forwarding and configure routes properly on linux, you should be able to have linux route between different network interfaces.

Hope that helps.

--
Jonathan Hui

mad...@pathpartnertech.com

unread,
Mar 10, 2017, 7:48:32 AM3/10/17
to openthread-users, mad...@pathpartnertech.com, mtu...@nestlabs.com
Thanks Martin for your clear step by step procedures.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-use...@googlegroups.com.
To post to this group, send email to openthre...@googlegroups.com.

mad...@pathpartnertech.com

unread,
Mar 10, 2017, 7:57:17 AM3/10/17
to openthread-users, mtu...@nestlabs.com, mad...@pathpartnertech.com, shahabud...@gmail.com, jon...@nestlabs.com
HI Jonathan,
       
                   I was successfull in configuring gate way on NCP , and I saw the new address added in the ip list of cli node. I tried pinging from Linux terminal and it is working well.

Can you give me a brief idea about how to configure my Linux PC to forward the IPv6  packets to internet. My Internet connection is IPv4 based one.

Thank you .
R Madhu.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-use...@googlegroups.com.
To post to this group, send email to openthre...@googlegroups.com.

--
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 post to this group, send email to openthre...@googlegroups.com.

Jonathan Hui

unread,
Mar 10, 2017, 12:12:28 PM3/10/17
to mad...@pathpartnertech.com, openthread-users
Great to hear your progress!

If you are trying to get your Thread device to communicate with another device across an IPv4 connection, you will need to utilize an IPv6 Transition mechanism.  RIPE NCC has published some good tutorials on IPv6 Transmission mechanisms.

Ubuntu also has some useful tutorials on IPv6 connectivity, along with enabling forwarding and routing.

Hope that helps.

--
Jonathan Hui

mad...@pathpartnertech.com

unread,
Mar 14, 2017, 9:25:49 AM3/14/17
to openthread-users, mad...@pathpartnertech.com, jon...@nestlabs.com
Hi Jonathan,
       
                      I created a IPv6 over IPv4 tunnel (miredo-teredo) on my ubuntu. I'm able to ping with Ipv6 server (ex: ipv6.google.com) from my PC.

Now , can you please tell me how to interconnect NCP with cloud through the tunnel.
I'm expecting like which ip address is to be configured as Default-gateway and what commands.?
and from the cloud end, how to synchronize with NCP ? which cloud would be easier to connect?

Thanks
R Madhu.

Jonathan Hui

unread,
Mar 14, 2017, 4:28:32 PM3/14/17
to mad...@pathpartnertech.com, openthread-users
One limitation of Teredo is that it only provides a single IPv6 address per tunnel endpoint.  As a result, it is not possible to use a Teredo tunnel to connect multiple IPv6 hosts.

Are the "Hurricane Electric" or "SixXS" options described in the Ubuntu wiki workable for you?  Both of those options support the IPv6 router configuration instructions towards the end of the wiki page.

--
Jonathan Hui

Krzysztof Loska

unread,
Mar 15, 2017, 10:12:45 AM3/15/17
to openthread-users, jon...@nestlabs.com
Hi,

Nordic Semiconductor provides Thread Border Router for demo and development purposes as part of the nRF5 Software Development Kit for Thread. The solution is based on OpenThread stack (NCP example) running on Nordic Semiconductor nRF52840 and Raspberry Pi 3B running OpenWRT with wpantund. If you would like to create a Border Router with distro different than OpenWRT, all code for Nordic's Thread Border Router is open-sourced so you can look into it for education or even base your new project on it.


Best regards,
Krzysztof Loska

Purushottam Pawar

unread,
Jan 4, 2018, 10:09:04 AM1/4/18
to openthread-users
Hi Jonathan and Madhu,

It's been some time since any activity on this thread. I hope you guys are around. 
I'm trying to achieve the same thing and got stuck at the same problem of routing the packets from the BR to host pc and then to the internet.
However, my internal network runs on IPv6.
Do I still need to connect to the external tunnel for routing my packets from BR to the end node?
Also, I'm not sure where to find "on mesh" prefix for configuring the gateway through wpanctl.
Please do respond when you get a chance.
 
Thanks,
Purush

Madhu R

unread,
Jan 5, 2018, 12:00:29 AM1/5/18
to Purushottam Pawar, openthread-users
Hi Purush,
          I tested on the Nordic boards, and the examples provided in the nordic website. That worked fine for me in the IPv4 Environment. I haven't tested with IPv6 directly.

I Guess you already checked this, which may help you
http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.threadsdk.v0.11.0%2Fexamples_thread.html

Thanks and Regards,
Madhu R

--
You received this message because you are subscribed to a topic in the Google Groups "openthread-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openthread-users/SI-BsREqQ0s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openthread-users+unsubscribe@googlegroups.com.
To post to this group, send email to openthread-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/258cf2ea-47c7-4e57-86c1-2bc5ddd439ea%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks and Regards,
R Madhu.
Reply all
Reply to author
Forward
0 new messages