转发角色

在 Thread 网络中,节点分成两种转发角色:Router 和 End Device。

Router

Router 节点的行为如下:

  • 为网络设备转发数据包
  • 为尝试加入网络的设备提供安全的 commissioning 服务
  • 始终打开它的收发器

End Device

End Device 节点的行为如下:

  • 主要与单个 Router 进行通信
  • 不会为其他网络设备转发数据包
  • 可以关闭它的收发器来降低功耗

Key Point: Router 和 End Device 之间的关系称为父子关系。End Device 正确地依附到一个 Router 上,其中 Router 始终作为父节点,End Device 则始终是子节点。

设备类型

此外,节点有许多种类型。

Full Thread Device

一个 FTD(Full Thread Device)总是打开它的射频收发器,它订阅所有 Router 的多播地址,并维护 IPv6 地址映射。FTD 有三种类型:

  • Router
  • REED(Router Eligible End Device)— 可以升级为 Router
  • FED(Full End Device)— 无法升级为 Router

FTD 可以作为 Router(父)或 End Device(子)。

Minimal Thread Device

MTD(Minimal Thread Device)不会订阅 all-routers 多播地址,并且它会将它的所有消息发送给它的父节点。MTD 有两种类型:

  • MED(Minimal End Device)— 始终打开自身的收发器,无需从父节点中轮询消息
  • SED(Sleepy End Device)— 通常会关闭自身的收发器(睡眠),偶然会打开收发器(唤醒)以从父节点中轮询消息

MTD 只能作为 End Device(子)。

升级和降级

当待加入设备仅能与某个 REED 通信时, 则该 REED 可以升级成为 Router:

相反,当一个 Router 没有子节点时,它可以降级成 End Device:

其他角色和类型

Thread Leader

Thread Leader 是一个 Router,它负责管理 Thread 网络中的 Router。Thread Leader 是动态自选的(提高容错率),它负责汇总和分发全网络的配置信息。

Note: 每个 Thread 网络分区中总是只有一个 Leader。

Border Router

Border Router 是一种可以在 Thread 网络和其他网络(如 Wi-Fi)之间转发信息的设备。它还为外部连接配置 Thread 网络。

任何设备都可以充当 Border Router。

Note: 一个 Thread 网络中可以有多个 Border Router。

分区

一个 Thread 网络可能由多个分区组成。当一组 Thread 设备不能再与另一组 Thread 设备通信时,会发生这种情况。每个分区在逻辑上均作为独立的 Thread 网络来运行,它们具有各自的 Leader、Router ID 分配和网络数据,同时分区前相同的安全凭证都将被保留下来。

当分区之间可以连通时,它们会自动合并。

Key Point: 安全凭证(security credentials)定义了 Thread 网络。物理无线电的连通性定义了该 Thread 网络中的分区。

设备限制

单个 Thread 网络所支持的设备类型数量是有限制的。

角色限制
Leader1
Router32
End Device511(每个 Router)

Thread 会尝试将 Router 的数量保持在 16 ~ 23 之间。如果一个 REED 作为 End Device 加入,并且网络中的 Router 数量低于 16,那么它将自动升级为 Router。

Copyright (c) 2021, The OpenThread Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.