主要内容

蓝牙网状网络中的估计数据包传递比率

该示例通过使用用于Bluetooth®协议的Communications Toolbox™库来模拟多节点Bluetooth®网状网络离散事件仿真(DES)。DES是模拟系统的行为作为在时域中发生的明确定义的事件的有序和离散序列的过程。DES允许您在微秒粒度下发生的系统中模拟事件。此外,DES还导致低模拟时间,从而使得支持大规模的系统级模拟可行。金宝app在此示例中模拟的多节点网格网络模拟了广告承载上的完整蓝牙网格堆栈。该示例旨在通过使用des准确地模拟异步传输。仿真结果包括分组传递比(PDR),与节点相关的统计信息以及显示网状网络的视觉表示的绘图。

蓝牙网格堆栈

蓝牙核心规范[1]包括用于低速无线个人面积网络的低能量版本,称为蓝牙低能量(BLE)或蓝牙智能。BLE堆栈包括:通用属性配置文件(GATT),属性协议(ATT),安全管理器协议(SMP),逻辑链路控制和适配协议(L2CAP),链路层(LL)和物理层(PHY)。添加到低能量设备标准的标准,生成少量数据,例如家庭自动化,医疗保健,健身和物联网(物联网)等应用中使用的通知警报。

这蓝牙Mesh Profile [2] defines the fundamental requirements to implement mesh networking solutions for BLE. The mesh stack is located on top of the Bluetooth Core Specification and consists of the: model layer, foundation model layer, access layer, upper transport layer, lower transport layer, network layer and bearer layer. Bluetooth mesh networking enables end-to-end communication in large-scale networks to support applications like smart lighting, industrial automation, sensor networking, asset tracking, and many other IoT solutions.

网格堆栈

该图显示了广告承载上的蓝牙网格堆栈。

  • 模型层:此图层定义了创建用户方案所需的型号,消息和状态。例如,要将光的状态更改为开启或关闭,请使用“通用onofooff”模型中的“通用滚轮集”消息。

  • 基础模型层:此图层定义配置和管理网状网络所需的型​​号,消息和状态。此图层配置元素,发布和节点的订阅地址。

  • 访问层:此图层定义了上传输层的接口和应用程序数据的格式。该层还控制上传输层中的应用程序数据的加密和解密。

  • 上传输层:上传输层的功能包括对应用数据的加密,解密和认证,并提供访问消息的机密性。该层还生成传输控制消息(友谊和心跳),并将它们传输到对等传输层。

  • 下传输层:下传输层的功能包括分段和将上部传输层消息重新组装到多个下传输层消息中。该层有助于向网络中的其他节点提供大型上部传输层消息。它还定义了朋友节点使用的朋友队列,以存储低功率节点的较低传输层消息。

  • Network layer: This layer defines encryption, decryption, and authentication of the lower transport layer messages. It transmits the lower transport layer messages over the bearer layer and relays the mesh messages when the 'Relay' feature is enabled. It also defines the message cache containing all the recently seen network messages. If the received message is in the cache, then it is discarded. The message cache is used by the relay nodes (nodes in which the 'Relay' feature is enabled).

  • 承载层:此图层是蓝牙网格堆栈和BLE核心堆栈之间的接口。该层还负责通过配置设备来创建网状网络。在这里,配置意味着对设备进行身份验证和向基本信息提供基本信息。必须配置设备以成为节点。此示例假定已将所有节点配置为网状网络。蓝牙网格支持的两种类型的承载是广告承载和GATT持金宝app票人。此示例仅使用广告持票人。

核心堆栈

This example models these layers of the BLE core stack:

  • Generic access profile: This profile defines advertising data (AD) types for carrying mesh messages over the advertising bearer. This example supports 'Mesh message' AD type, which is used for exchanging network layer messages between mesh nodes.

  • 链接层: This layer defines Broadcaster and Observer roles for message exchange between the nodes within the Bluetooth mesh network. In a Broadcaster role, a node always advertises. Whereas in an Observer role, the node always scans for the advertisers. Each node in the mesh network switches between these two roles to serve as a Bluetooth mesh node.

  • 物理层:该层发送和接收用于在蓝牙网状网络内的节点之间交换消息的波形。该层模型频道损伤,例如自由空间路径损耗,范围传播损耗和干扰。

离散事件仿真

DES是一种模拟模拟系统的功能作为时域中的离散事件序列。每个事件发生在特定时间时代,随后标记系统中的状态。结果,模拟可以在时域中直接从事件跳转到事件。在此示例中使用DES的基本优势是:

  • 其灵活性地处理抑制或扩展,允许模拟加速或减速调查的现象。DES的此属性用于在多节点蓝牙网络中模拟异步传输,从而精确建模碰撞。

  • DES提高了模拟时间性能,从而使得支持大规模的系统级模拟可行。金宝app为了在MATLAB实现中准确建模,模拟可能需要以微秒步骤运行。这不仅会增加模拟时间,而且会影响网络可扩展性。步骤时间的增加可能不允许您捕获或安排在微秒粒度中发生的事件。DES使您能够通过在离散点中建模事件来解决此问题。

检查支持包安装金宝app

%检查'蓝牙协议的“通信工具箱库”% support package is installed or not.comm金宝appsupportpackagecheck('蓝牙');

多节点蓝牙网状网模型

此示例模拟蓝牙网状网络,具有21个节点。该模型输出网络的PDR以及物理,链路和网络层的发送,接收和丢包等不同的统计数据,以及可视化网络方案的绘图。建模包括:

  • 多个节点,其中每个节点包含蓝牙网格分组生成器和接收器(网状分组包括模型,访问和传输层编码和解码),网络层,链路层和物理层

  • 共享频道,这些通道是用这些频道损伤选项进行模拟:范围传播丢失,自由空间路径损耗和干扰

  • Packets transmitted over the shared channel

  • 节点位置分配器(NPA)配置网络中的节点位置。NPA支金宝app持线性,网格和列表分配策略

  • 可视化网状网络方案的可视化器

要配置特定方案,请执行以下操作之一:

  • 更新前面模型中每个节点的默认配置参数

蓝牙节点

每个节点都被建模为具有网络堆栈的子系统,该网络堆栈包括蓝牙网格分组生成器和接收器,网络层,LL和PHY。

  • 应用层通过使用该数据包Entity Generator(Simevents)block

  • MATLAB离散事件系统(Simevents)块用于建模网络层,LL和PHY

  • 在每个节点中,共享通道在接收路径中建模

应用层

实现应用层以生成和接收应用程序流量。它分为两个子块:

  • 蓝牙mesh packet generator该块使用SimEvents实体生成器块生成下传输数据协议数据单元(PDU)。生成的PDU包含附加具有更高层报头的“未确认的”类型的“通用滚轮集”的模型层消息。此PDU传递给网络层。您可以配置目标节点(开/关),目的节点的名称,源速率(在数据包/秒中)以及可以使用此块从源传输到目的地的最大数据包数。一旦生成配置的最大数据包,块就会停止生成数据包。

  • 蓝牙网状包接收器此块使用Simevents实体终结器块从网络层接收输出

Network layer

这network layer is modeled as a DES block. This block is responsible for transmitting the lower transport layer messages over the advertising bearer and relaying the mesh messages when the 'Relay' feature is enabled. When a network PDU is received, this block decodes the received PDU. If the PDU is decoded successfully, then the decoded information is passed to the lower transport layer.

您可以使用网络层块的掩模参数配置中继功能,网络发送间隔,网络传输计数,继电传输间隔和继电器重传计数。

链接层

链路层被建模为des块。此块维护用于LL广播公司和观察者角色的状态机。该块负责通过使用传输和接收网格广告数据包BlelladvertisingChannelpdu.andBlelladvertisingChannelpdu.Decode职能。

您可以使用链路层块的掩码参数配置扫描和广告间隔。

Physical layer

PHY功能包括:

  • 传输链

会启动包传输通过发送一个你packet and Tx indication to the PHY Tx block. This block generates a waveform for the received LL packet by using thebleWaveformGenerator功能。它还使用配置的TX功率(假设TX增益为0)来缩放BLE波形的样本。产生的BLE波形通过共享信道发送。共享通道是通过使用Simevents组播队列建模的。

您可以使用PHY TX块的蒙版参数配置TX功率(DBM)。

  • 渠道障碍建模

这free-space path loss model is added to the transmitted BLE waveform as channel impairments. You can choose to enable or disable this impairment. In addition to this impairment model, the signal reception range can also be limited by using an optional range propagation loss model. To model any of these channel impairment options, the channel model must contain the position of both the sender and the receiver. The channel is modeled inside each receiving node, before passing the BLE waveform to the PHY Rx block.

You can configure channel impairments by using mask parameters of the BLE channel block.

  • 接收链条

该块对接收的BLE波形(假设RX增益为0)施加热噪声和干扰。热噪声通过使用使用Comm.Thermalnoise.函数噪声系数的配置值。通过添加干扰和实际信号的IQ样本来建模干扰。在施加热噪声和干扰后,PHY RX块解码得到的波形。如果LL数据包已成功解码,则将其传递给LL。

You can configure the noise figure (in dB) using mask parameters of the PHY Rx block.

Node position allocator (NPA)为网状网络分配节点的位置。此块支持线性,网格和列金宝app表位置分配策略。

  • 线性位置分配将节点均匀地放在2D网格上的直线上

  • Grid position allocation以网格属性指定的网格格式放置节点

  • 列出位置分配Assigns node positions from a list [[x1, y1, z1] [x2, y2, z2] ... [xn, yn, zn]] such that (xk, yk, zk) is the position of the kth node for all k in (1, 2, ..., n)

VisualizerThis block is used to visualize the mesh network scenario in the simulation. You can configure this block to visualize the specified configuration. You can enable or disable visualization by using the mask parameters of this block.

仿真结果

这results obtained in this simulation are:

  • Packet delivery ratio (PDR)

这PDR.is the ratio of number of received packets at the destination to the number of packets transmitted by the source and is given by:

此模型输出此多节点网状网络的PDR,并将其保存到名为的基础工作区变量PDR.

  • Statistics at each node

This model outputs statistics of each node in the workspace variablestatisticsAtEachNode。每个节点捕获的统计数据是:

  • PHY的传输和接收消息的数量

  • LL上传输和接收消息的数量

  • 使用CRC故障收到的消息数

  • 网络层上传输,接收和丢弃消息的数量

  • 在网络层中继的消息数

  • 网络层的接收应用消息数

  • 网络可视化

一个可视化表示的网格netw的阴谋ork scenario is shown in the simulation. You can see the statistics of each node by placing your cursor over it.

This example shows how to configure and simulate a multi-node Bluetooth mesh network by using DES. The mesh network model in this example outputs PDR as a workspace variable with a visual representation of the mesh network.

Further Exploration

要观察网络PDR中的变体,可以在网格包生成器,网络层,LL和PHY上改变配置参数。在这些仿真结果中,您可以看到网络层重复(NLR)对网络PDR的影响。

这NLR includes the repetitions of both the network messages and the relayed messages. The working principle of flood-based networks ensures that the message reaches the destination node. Therefore, it is important to retransmit the network and the relay messages. The number of NLR is dependent on the network configuration of the given network topology. Increasing the number of NLR ensures that the likelihood of the messages reaching the desired destination node is high. However, specifying a high value of the NLR can have adverse effects on the network performance parameters such as the overhead, energy consumption, and the duty cycle. As a result, it is essential to tune the value of NLR for a given network topology and achieve an efficient tradeoff between the PDR and network performance.

In the preceding figure you can see that the PDR increases with the NLR and decreases with the number of source nodes in the network. For a specific value of the NLR, the PDR value reaches 1 and thereafter it stabilizes. This specific value of the NLR might vary based on the network configuration parameters such as the total number of nodes, location of the nodes, number of source nodes, number of relay nodes, and so on. You can runHelperBerleshDespdrcalculation.通过使用三个源节点来重现这些结果。将源节点的数量设置为2和5以获取相应的结果。您可以为任何自定义网络场景运行模拟,并获得NLR的最佳值。

Apart from the NLR, the PDR varies with respect to multiple configuration parameters stated inHelperBerleshDespdrcalculation.。您可以通过改变任何这些参数来进一步探索网状网络模型。

附录

该示例使用这些功能:

该示例使用这些帮助程序:

References

  1. 蓝牙特殊兴趣组(SIG)。“蓝牙核心规范”。版本5.0。https://www.bluetooth.com/

  2. 蓝牙特殊兴趣组(SIG)。“蓝牙网格配置文件”。版本1.0。https://www.bluetooth.com/

Related Topics