主要内容

IEEE 802.15.4 - 异步CSMA MAC

此示例显示了如何模拟IEEE®802.15.4™异步CSMA MAC [1]使用ZigBee和UWB的Communications Toolbox™库。

背景

IEEE 802.15.4标准指定了苹果电脑PHY.低速率无线个人区域网络的层次(LR-WPANS.)[1].IEEE 802.15.4 MAC和PHY层提供了其他更高层标准的基础,例如无线个域网、WirelessHart®、6LoWPAN和MiWi。这些标准应用于家庭自动化和传感器网络,与物联网(IoT)趋势高度相关。

IEEE 802.15.4 MAC[详细信息]1]指定两个基本的MAC模式:(一世)启用非信标,和(2)非信标MAC是一个异步CSMA (Carrier-sense Multiple Access) MAC,与IEEE 802.11 MAC非常相似。信标MAC允许两个不同的MAC周期:(一世)同步-CSMA MAC期,和(2)一个时隙的、无争用的MAC周期。这个示例提供了对非信标支持的、异步的、基于csma的IEEE 802.15.4 MAC的广泛模拟。

网络设置

IEEE 802.15.4 PAN(个人局域网)是在终端设备和PAN coordinator之间通过一个标准的过程建立起来的。首先,想要加入网络的设备执行主动或被动操作扫描.主动扫描意味着设备首先发送一个信标请求后来它执行被动扫描。被动扫描意味着设备嗅探收集信标帧来自PAN协调员(在主动扫描的情况下可能已经收到了他们的信标请求)。在被动扫描期间的信标收集时,终端设备选择其希望与之关联的平底锅。然后它传输一个协会的要求向该PAN的协调者发出通知,并得到协调者的认可。

与ieee802.11相比,协调器不遵循确认关联请求的即时传输协会响应.相反,IEEE 802.15.4协调器首先将关联响应存储在本地;只有当终端设备发送一个数据请求协调员承认它。IEEE 802.15.4标准使用该术语间接传播请参阅此机制来传输帧。通常,该机制对于低业务网络的电池供电设备非常有用(例如,传感器网络)。这样的设备可以周期性地激活它们的无线电以检查任何帧是否正在审视它们,而不是连续地使用其无线电接收帧。

一旦接收到Association响应并确认,终端设备就与PAN相关联。在那个时候,数据帧可在协调器和终端设备之间任意方向进行交换。根据数据帧的“确认请求”指示,数据帧可以被确认。

异步介质访问控制(MAC)

异步CSMA IEEE 802.15.4 MAC与通用的CSMA操作和IEEE 802.11 MAC操作类似。在这种MAC方案中,确认帧无需使用CSMA方法即可立即发送。所有其他帧都使用CSMA传输。

具体来说,一旦设备有帧要传输,它就随机选择一个帧倒扣从范围[0 2^BE-1]的延迟(回退周期数),其中BE是回退指数。每个回退周期的持续时间为20个符号。对于2.4 GHz的OQPSK PHY,这个持续时间相当于640个芯片和0.32毫秒。一旦设备等待了选择的回退周期数,它就会执行载体传感.如果媒体是空闲的,设备开始传输它的帧,直到它被完全传输。

如果介质在载波侦听期间忙,则从新的[0 2 ^ be-1]范围中选择退避指数增量和新的退避周期。当回退计数器再次到期时,执行载波感测。如果在任何载波传感实例期间没有介质达到介质的最大数量,则设备终止其尝试发送帧。

网络仿真能力

该示例提供了所描述的网络设置过程和CSMA方法的实现lrwpan。苹果电脑FullFunctionDevicelrwpan。苹果电脑ReducedFunctionDevice类。具体来说,启用了以下功能:

  • 主动和被动扫描

  • 协会请求和协会响应交换

  • 使用数据请求的间接传输

  • 帧确认和帧重传,如果确认没有及时收到

  • 短而长的互联网间距(SIFS和LIFS)

  • 二进制指数退避

  • 载体传感

网络仿真

在本节中,我们创建了3个节点的IEEE 802.15.4网络:一个盘协调器和两个终端设备。网络模拟器配置为以单个退避持续时间(20个符号,0.32ms)的增量处理所有设备。

首先,以下代码说明了第一设备与网络的关联。

symbolsPerStep = 20;chipsPerSymbol = 32;samplesPerChip = 4;symbolRate = 65.5 e3;%符号/秒时间= 0;stopTime = 5;%交会%create pan协调员panCoordinator = lrwpan。MACFullFunctionDevice (“PANCoordinator”,真的,“SamplesPerChip”,4,“PANIdentifier”'7777'“ExtendedAddress”,[repmat(' 0 ',1,8)Repmat('7'1 8)),“ShortAddress”'1234');创建第一个终端设备:EndDevice1 = lrwpan.macreduceCuctionDevice(“SamplesPerChip”,4,“ShortAddress”'0001'“ExtendedAddress”,[repmat(' 0 ',1,8)Repmat('3'1 8)]);初始化设备输入received1 = 0 (samplesPerChip * chipsPerSymbol * symbolsPerStep/ 2,1); / /接收到的数据received2 = 0 (samplesPerChip * chipsPerSymbol * symbolsPerStep/ 2,1); / /接收到的数据时间< stopTime%将接收的信号传递给节点以进行处理。另外,取出什么他们必须传输的%:传输1 = pancoordinator(收到的1);发送2 = ENDDEVICE1(接收2);%理想的无线信道,其中两个节点都在范围内:收到的1 =发送2;%半双工无线电,发送时不接收received2 = transmitted1;time = time + symbolsPerStep/symbolRate;%更新时钟结尾
0001:*******将信标请求帧添加到队列0001:1584的被动扫描步骤0001:处理队列0001中的下一帧:初始化传输;退避延迟=1步骤0001:退避延迟=1步骤->0步骤0001:载波感应:介质空闲。0001:清除发送0001:发送信标请求0001:IFS偏移=0样本0001:发送2050年的1-1280发现OQPSK PHY的前导码。找到OQPSK PHY的帧分隔符(SFD)的开始。0001:IFS偏移=0样本0001:传输1281-2050个,共2050个0001:完成传输0001:需要等待SIFS(12)符号。偏移量=12,下一个IFS=4 0001:进入被动扫描1234:PHY解码IEEE 802.15.4帧MAC帧的CRC检查通过。1234:*********接收帧类型=MAC命令1234:*********接收MAC命令类型=信标请求1234:需要等待SIFS(12)符号。Offset=12,next IFS=4 1234:*******向队列1234添加信标帧:next IFS=4 1234:处理队列1234中的下一帧:初始化传输;退避延迟=7步1234:退避延迟=7步->6步1234:退避延迟=6步->5步1234:退避延迟=5步->4步1234:退避延迟=4步->3步1234:退避延迟=3步->2步1234:退避延迟=2步->1步1234:退避延迟=1步->0步1234:载波感应:介质为闲置的1234:清除以发送1234:IFS偏移=256个样本1234:发送2562中的1-1024个1234:IFS偏移=0个样本1234:发送OQPSK PHY中找到的2562前导码中的1025-2304个。找到OQPSK PHY的帧分隔符(SFD)的开始。1234:IFS offset=0样本1234:2562中的2305-2562发送1234:Finished transmission 1234:需要等待LIFS(40)符号。偏移量=4,下一个IFS=24 1234:将等待时间减少20个符号至4 0001:MAC帧的PHY解码IEEE 802.15.4帧CRC检查通过。0001:*********接收到的帧类型=信标0001:需要等待SIFS(12)符号。偏移量=4,下一个IFS=-4 0001:下一个IFS=0 0001:扫描完成0001:*******将关联请求帧添加到队列0001:处理队列0001中的下一帧:初始化传输;退避延迟=0步骤0001:载波感应:介质空闲。0001:清除以传输0001:IFS偏移=0样本0001:传输3458中的1-1280找到OQPSK PHY的前导码。找到OQPSK PHY的帧分隔符(SFD)的开始。0001:IFS偏移=0个样本0001:传输3458中的1281-2560个样本0001:IFS偏移=0个样本0001:传输3458中的2561-3458个样本0001:完成传输0001:将等待确认54个符号,以附加到IFS=0 1234:物理层解码的IEEE 802.15.4帧,MAC帧的CRC检查通过。1234:*********接收到的帧类型=MAC命令1234:*********接收到的MAC命令类型=关联请求1234:需要等待LIFS(40)符号。偏移量=14,下一个IFS=34 1234:**********直接发送确认帧(无CSMA/CA)1234:*******将数据响应帧添加到挂起队列1234:下一个IFS=34 0001:将ack等待持续时间减少20个符号至34 1234:IFS offset=896个样本1234:传输1410 0001中的1-384个:将ack等待持续时间减少20个符号至14 1234:IFS offset=0个样本1234:传输1410 1234中的385-1410个:完成传输1234:需要等待SIFS(12)符号。偏移量=16,下一个IFS=8 0001:将ack等待持续时间减少20个符号,以-6找到OQPSK PHY的前导码。找到OQPSK PHY的帧分隔符(SFD)的开始。0001:MAC帧的物理层解码IEEE 802.15.4帧CRC检查通过。0001:*********接收到的帧类型=确认0001:需要等待SIFS(12)符号。偏移量=16,next IFS=8 0001:**********将数据请求帧添加到队列0001:next IFS=1920 0001:将等待时间减少20个符号到1900 0001:将等待时间减少20个符号到1880 0001:将等待时间减少20个符号到1860 0001:将等待时间减少20个符号到1840 0001:将等待时间减少20个符号到1820 0001:减少等待时间减少20个符号至1800 0001:等待时间减少20个符号至1780 0001:等待时间减少20个符号至1760 0001:等待时间减少20个符号至1740 0001:等待时间减少20个符号至1720 0001:等待时间减少20个符号至1700 0001:等待时间减少20个符号至1680 0001:等待时间减少20个符号到1660 0001:将等待时间减少20个符号到1640 0001:将等待时间减少20个符号到1620 0001:将等待时间减少20个符号到1600 0001:将等待时间减少20个符号到1580 0001:将等待时间减少20个符号到1560 0001:将等待时间减少20个符号到1540 0001:将等待时间减少20个符号到1540 0001:将等待时间减少20个符号到1540 00011520 0001:将等待时间减少20个符号至1500 0001:将等待时间减少20个符号至1480 0001:将等待时间减少20个符号至1460 0001:将等待时间减少20个符号至1440 0001: Decreased wait time by 20 symbols to 1420 0001: Decreased wait time by 20 symbols to 1400 0001: Decreased wait time by 20 symbols to 1380 0001: Decreased wait time by 20 symbols to 1360 0001: Decreased wait time by 20 symbols to 1340 0001: Decreased wait time by 20 symbols to 1320 0001: Decreased wait time by 20 symbols to 1300 0001: Decreased wait time by 20 symbols to 1280 0001: Decreased wait time by 20 symbols to 1260 0001: Decreased wait time by 20 symbols to 1240 0001: Decreased wait time by 20 symbols to 1220 0001: Decreased wait time by 20 symbols to 1200 0001: Decreased wait time by 20 symbols to 1180 0001: Decreased wait time by 20 symbols to 1160 0001: Decreased wait time by 20 symbols to 1140 0001: Decreased wait time by 20 symbols to 1120 0001: Decreased wait time by 20 symbols to 1100 0001: Decreased wait time by 20 symbols to 1080 0001: Decreased wait time by 20 symbols to 1060 0001: Decreased wait time by 20 symbols to 1040 0001: Decreased wait time by 20 symbols to 1020 0001: Decreased wait time by 20 symbols to 1000 0001: Decreased wait time by 20 symbols to 980 0001: Decreased wait time by 20 symbols to 960 0001: Decreased wait time by 20 symbols to 940 0001: Decreased wait time by 20 symbols to 920 0001: Decreased wait time by 20 symbols to 900 0001: Decreased wait time by 20 symbols to 880 0001: Decreased wait time by 20 symbols to 860 0001: Decreased wait time by 20 symbols to 840 0001: Decreased wait time by 20 symbols to 820 0001: Decreased wait time by 20 symbols to 800 0001: Decreased wait time by 20 symbols to 780 0001: Decreased wait time by 20 symbols to 760 0001: Decreased wait time by 20 symbols to 740 0001: Decreased wait time by 20 symbols to 720 0001: Decreased wait time by 20 symbols to 700 0001: Decreased wait time by 20 symbols to 680 0001: Decreased wait time by 20 symbols to 660 0001: Decreased wait time by 20 symbols to 640 0001: Decreased wait time by 20 symbols to 620 0001: Decreased wait time by 20 symbols to 600 0001: Decreased wait time by 20 symbols to 580 0001: Decreased wait time by 20 symbols to 560 0001: Decreased wait time by 20 symbols to 540 0001: Decreased wait time by 20 symbols to 520 0001: Decreased wait time by 20 symbols to 500 0001: Decreased wait time by 20 symbols to 480 0001: Decreased wait time by 20 symbols to 460 0001: Decreased wait time by 20 symbols to 440 0001: Decreased wait time by 20 symbols to 420 0001: Decreased wait time by 20 symbols to 400 0001: Decreased wait time by 20 symbols to 380 0001: Decreased wait time by 20 symbols to 360 0001: Decreased wait time by 20 symbols to 340 0001: Decreased wait time by 20 symbols to 320 0001: Decreased wait time by 20 symbols to 300 0001: Decreased wait time by 20 symbols to 280 0001: Decreased wait time by 20 symbols to 260 0001: Decreased wait time by 20 symbols to 240 0001: Decreased wait time by 20 symbols to 220 0001: Decreased wait time by 20 symbols to 200 0001: Decreased wait time by 20 symbols to 180 0001: Decreased wait time by 20 symbols to 160 0001: Decreased wait time by 20 symbols to 140 0001: Decreased wait time by 20 symbols to 120 0001: Decreased wait time by 20 symbols to 100 0001: Decreased wait time by 20 symbols to 80 0001: Decreased wait time by 20 symbols to 60 0001: Decreased wait time by 20 symbols to 40 0001: Decreased wait time by 20 symbols to 20 0001: Decreased wait time by 20 symbols to 0 0001: Processing next frame from the queue 0001: Initializing transmission; backoff delay = 2 steps 0001: Backoff delay = 2 steps -> 1 steps 0001: Backoff delay = 1 steps -> 0 steps 0001: Carrier sensing: Medium is idle. 0001: Clear to transmit 0001: IFS offset = 0 samples 0001: Transmitting 1-1280 of 3074 Found preamble of OQPSK PHY. Found start-of-frame delimiter (SFD) of OQPSK PHY. 0001: IFS offset = 0 samples 0001: Transmitting 1281-2560 of 3074 0001: IFS offset = 0 samples 0001: Transmitting 2561-3074 of 3074 0001: Finished transmission 0001: will wait for ack for 54 symbols additional to IFS = 0 1234: PHY decoded IEEE 802.15.4 frame CRC check passed for the MAC frame. 1234: *********** Received frame type = MAC command 1234: *********** Received MAC Command type = Data request 1234: Need to wait for SIFS (12) symbols. Offset = 8, next IFS = 0 1234: ********** Directly transmitting acknowledgement frame (no CSMA/CA) 1234: Moving frame for 0000000033333333 from pending queue to the transmission queue 1234: next IFS = 0 1234: IFS offset = 0 samples 1234: Transmitting 1-1280 of 1410 0001: Decreasing ack wait durations by 20 symbols to 34 1234: IFS offset = 0 samples 1234: Transmitting 1281-1410 of 1410 1234: Finished transmission 1234: Need to wait for SIFS (12) symbols. Offset = 2, next IFS = -6 Found preamble of OQPSK PHY. Found start-of-frame delimiter (SFD) of OQPSK PHY. 0001: Decreasing ack wait durations by 20 symbols to 14 1234: Processing next frame from the queue 1234: Initializing transmission; backoff delay = 5 steps 1234: Backoff delay = 5 steps -> 4 steps 0001: PHY decoded IEEE 802.15.4 frame CRC check passed for the MAC frame. 0001: *********** Received frame type = Acknowledgment 0001: Need to wait for SIFS (12) symbols. Offset = 2, next IFS = -6 0001: next IFS = 0 1234: Backoff delay = 4 steps -> 3 steps 1234: Backoff delay = 3 steps -> 2 steps 1234: Backoff delay = 2 steps -> 1 steps 1234: Backoff delay = 1 steps -> 0 steps 1234: Carrier sensing: Medium is idle. 1234: Clear to transmit 1234: IFS offset = 0 samples 1234: Transmitting 1-1280 of 4226 1234: IFS offset = 0 samples 1234: Transmitting 1281-2560 of 4226 Found preamble of OQPSK PHY. Found start-of-frame delimiter (SFD) of OQPSK PHY. 1234: IFS offset = 0 samples 1234: Transmitting 2561-3840 of 4226 1234: IFS offset = 0 samples 1234: Transmitting 3841-4226 of 4226 1234: Finished transmission 1234: will wait for ack for 54 symbols additional to IFS = 0 1234: Decreasing ack wait durations by 20 symbols to 34 0001: PHY decoded IEEE 802.15.4 frame CRC check passed for the MAC frame. 0001: *********** Received frame type = MAC command 0001: *********** Received MAC Command type = Association response 0001: Need to wait for LIFS (40) symbols. Offset = 6, next IFS = 26 0001: *********** Association successful, changing short address to = 8CEC 8CEC: *********** Association successful, associated to PAN = 7777 8CEC: ********** Directly transmitting acknowledgement frame (no CSMA/CA) 8CEC: next IFS = 26 1234: Decreasing ack wait durations by 20 symbols to 14 8CEC: IFS offset = 384 samples 8CEC: Transmitting 1-896 of 1410 Found preamble of OQPSK PHY. Found start-of-frame delimiter (SFD) of OQPSK PHY. 1234: Decreasing ack wait durations by 20 symbols to -6 8CEC: IFS offset = 0 samples 8CEC: Transmitting 897-1410 of 1410 8CEC: Finished transmission 8CEC: Need to wait for SIFS (12) symbols. Offset = 8, next IFS = 0 1234: PHY decoded IEEE 802.15.4 frame CRC check passed for the MAC frame. 1234: *********** Received frame type = Acknowledgment 1234: Need to wait for SIFS (12) symbols. Offset = 8, next IFS = 0 1234: next IFS = 0 8CEC: ********* (t=4.079360) Injecting data frame to the queue. From: 8CEC -> To: 1234 8CEC: Processing next frame from the queue 8CEC: Initializing transmission; backoff delay = 6 steps 8CEC: Backoff delay = 6 steps -> 5 steps 8CEC: Backoff delay = 5 steps -> 4 steps 8CEC: Backoff delay = 4 steps -> 3 steps 8CEC: Backoff delay = 3 steps -> 2 steps 8CEC: Backoff delay = 2 steps -> 1 steps 8CEC: Backoff delay = 1 steps -> 0 steps 8CEC: Carrier sensing: Medium is idle. 8CEC: Clear to transmit 8CEC: IFS offset = 0 samples 8CEC: Transmitting 1-1280 of 8578 Found preamble of OQPSK PHY. Found start-of-frame delimiter (SFD) of OQPSK PHY. 8CEC: IFS offset = 0 samples 8CEC: Transmitting 1281-2560 of 8578 8CEC: IFS offset = 0 samples 8CEC: Transmitting 2561-3840 of 8578 8CEC: IFS offset = 0 samples 8CEC: Transmitting 3841-5120 of 8578 8CEC: IFS offset = 0 samples 8CEC: Transmitting 5121-6400 of 8578 8CEC: IFS offset = 0 samples 8CEC: Transmitting 6401-7680 of 8578 8CEC: IFS offset = 0 samples 8CEC: Transmitting 7681-8578 of 8578 8CEC: Finished transmission 8CEC: will wait for ack for 54 symbols additional to IFS = 0 1234: PHY decoded IEEE 802.15.4 frame CRC check passed for the MAC frame. 1234: *********** Received frame type = Data 1234: Need to wait for SIFS (12) symbols. Offset = 14, next IFS = 6 1234: ********** Directly transmitting acknowledgement frame (no CSMA/CA) 1234: next IFS = 6 1234: IFS offset = 384 samples 1234: Transmitting 1-896 of 1410 8CEC: Decreasing ack wait durations by 20 symbols to 34 1234: IFS offset = 0 samples 1234: Transmitting 897-1410 of 1410 1234: Finished transmission 1234: Need to wait for SIFS (12) symbols. Offset = 8, next IFS = 0 Found preamble of OQPSK PHY. Found start-of-frame delimiter (SFD) of OQPSK PHY. 8CEC: Decreasing ack wait durations by 20 symbols to 14 8CEC: PHY decoded IEEE 802.15.4 frame CRC check passed for the MAC frame. 8CEC: *********** Received frame type = Acknowledgment 8CEC: Need to wait for LIFS (40) symbols. Offset = 8, next IFS = 28 8CEC: next IFS = 28 8CEC: Decreased wait time by 20 symbols to 8 8CEC: ********* (t=4.795200) Injecting data frame to the queue. From: 8CEC -> To: 1234 8CEC: Processing next frame from the queue 8CEC: Initializing transmission; backoff delay = 6 steps 8CEC: Backoff delay = 6 steps -> 5 steps 8CEC: Backoff delay = 5 steps -> 4 steps 8CEC: Backoff delay = 4 steps -> 3 steps 8CEC: Backoff delay = 3 steps -> 2 steps 8CEC: Backoff delay = 2 steps -> 1 steps 8CEC: Backoff delay = 1 steps -> 0 steps 8CEC: Carrier sensing: Medium is idle. 8CEC: Clear to transmit 8CEC: IFS offset = 512 samples 8CEC: Transmitting 1-768 of 8578 Found preamble of OQPSK PHY. 8CEC: IFS offset = 0 samples 8CEC: Transmitting 769-2048 of 8578 Found preamble of OQPSK PHY. Found start-of-frame delimiter (SFD) of OQPSK PHY. 8CEC: IFS offset = 0 samples 8CEC: Transmitting 2049-3328 of 8578 8CEC: IFS offset = 0 samples 8CEC: Transmitting 3329-4608 of 8578 8CEC: IFS offset = 0 samples 8CEC: Transmitting 4609-5888 of 8578 8CEC: IFS offset = 0 samples 8CEC: Transmitting 5889-7168 of 8578 8CEC: IFS offset = 0 samples 8CEC: Transmitting 7169-8448 of 8578 8CEC: IFS offset = 0 samples 8CEC: Transmitting 8449-8578 of 8578 8CEC: Finished transmission 8CEC: will wait for ack for 54 symbols additional to IFS = 0 1234: PHY decoded IEEE 802.15.4 frame CRC check passed for the MAC frame. 1234: *********** Received frame type = Data 1234: Need to wait for SIFS (12) symbols. Offset = 2, next IFS = -6 1234: ********** Directly transmitting acknowledgement frame (no CSMA/CA) 1234: next IFS = 0 1234: IFS offset = 0 samples 1234: Transmitting 1-1280 of 1410 8CEC: Decreasing ack wait durations by 20 symbols to 34 1234: IFS offset = 0 samples 1234: Transmitting 1281-1410 of 1410 1234: Finished transmission 1234: Need to wait for SIFS (12) symbols. Offset = 2, next IFS = -6 Found preamble of OQPSK PHY. Found start-of-frame delimiter (SFD) of OQPSK PHY. 8CEC: Decreasing ack wait durations by 20 symbols to 14 8CEC: PHY decoded IEEE 802.15.4 frame CRC check passed for the MAC frame. 8CEC: *********** Received frame type = Acknowledgment 8CEC: Need to wait for LIFS (40) symbols. Offset = 2, next IFS = 22 8CEC: next IFS = 22 8CEC: Decreased wait time by 20 symbols to 2 1234: ********* (t=5.001280) Injecting data frame to the queue. From: 1234 -> To: 8CEC 1234: Processing next frame from the queue 1234: Initializing transmission; backoff delay = 1 steps 1234: Backoff delay = 1 steps -> 0 steps 1234: Carrier sensing: Medium is idle. 1234: Clear to transmit 1234: IFS offset = 0 samples 1234: Transmitting 1-1280 of 8578 1234: IFS offset = 0 samples 1234: Transmitting 1281-2560 of 8578 Found preamble of OQPSK PHY. Found start-of-frame delimiter (SFD) of OQPSK PHY. 1234: IFS offset = 0 samples 1234: Transmitting 2561-3840 of 8578 1234: IFS offset = 0 samples 1234: Transmitting 3841-5120 of 8578 1234: IFS offset = 0 samples 1234: Transmitting 5121-6400 of 8578 1234: IFS offset = 0 samples 1234: Transmitting 6401-7680 of 8578 1234: IFS offset = 0 samples 1234: Transmitting 7681-8578 of 8578 1234: Finished transmission 1234: will wait for ack for 54 symbols additional to IFS = 0 1234: Decreasing ack wait durations by 20 symbols to 34 8CEC: PHY decoded IEEE 802.15.4 frame CRC check passed for the MAC frame. 8CEC: *********** Received frame type = Data 8CEC: Need to wait for SIFS (12) symbols. Offset = 14, next IFS = 6 8CEC: ********** Directly transmitting acknowledgement frame (no CSMA/CA) 8CEC: next IFS = 6 8CEC: IFS offset = 384 samples 8CEC: Transmitting 1-896 of 1410 Found preamble of OQPSK PHY. Found start-of-frame delimiter (SFD) of OQPSK PHY. 1234: Decreasing ack wait durations by 20 symbols to 14 8CEC: IFS offset = 0 samples 8CEC: Transmitting 897-1410 of 1410 8CEC: Finished transmission 8CEC: Need to wait for SIFS (12) symbols. Offset = 8, next IFS = 0 1234: PHY decoded IEEE 802.15.4 frame CRC check passed for the MAC frame. 1234: *********** Received frame type = Acknowledgment 1234: Need to wait for LIFS (40) symbols. Offset = 8, next IFS = 28 1234: next IFS = 28 1234: Decreased wait time by 20 symbols to 8

一旦第一个结束设备已经关联,数据帧将被随机注入结束设备和平移协调器之间的链路中。

接下来,以星形拓扑方式(最终设备必须仅传输到协调器),在协调器和两个最终设备之间交换PAN和数据帧之间的第三设备连接和数据帧。在这种情况下,抑制了输出。

%创建第二个终端设备:EndDevice2 = lrwpan.macreduceedFunctionDevice(“SamplesPerChip”,4,“ShortAddress”“0002”“ExtendedAddress”,[repmat(' 0 ',1,8)Repmat('4'1 8)),“冗长”, 错误的);%抑制详细输出:enddevice1.verbosity = false;pancoordinator.ververy = false;%初始化输入收到了3 =零(SamplesPerchip * Chipspersymbol *符号集/ 2,1);停止= 10;%交会时间< stopTime%将接收的信号传递给节点以进行处理。另外,取出什么他们必须传输的%:传输1 = pancoordinator(收到的1);发送2 = ENDDEVICE1(接收2);发送3 = EndDevice2(接收3);%理想的无线信道,所有节点都在范围内:Received1 = transmitted2 + transmitted3;%半双工无线电,发送时不接收Received2 = transmitted1 + transmitted3;Received3 = transmitted1 + transmitted2;time = time + symbolsPerStep/symbolRate;%更新时钟结尾

可以将更多节点添加到网络,只要相应地建立了信道关系(即,作为发送信号的函数的接收信号)。

进一步的探索

您可以进一步研究以下生成器和解码函数,以及配置对象:

选定的参考书目

  1. IEEE 802.15.4-2011 - 本地和大都市地区网络的IEEE标准 - 第15.4部分:低利率无线个人面积网络(LR-WPANS)