FCF中地址控制域设定值对帧中所包含地址的影响

来源:互联网 发布:淘宝客服找不到人 编辑:程序博客网 时间:2024/04/30 09:37

本文讨论的是FCF中相关的地址控制域的设定值对帧中所包含地址的影响。

一.概述

FCF涉及地址控制的域包括PAN ID Compression、destination address mode和source address mode。
destination address mode和source address mode的值对地址包含的影响是比较清晰的,
即如果它们的值为0,即不存在相应的地址和PAN ID。
但这里重点讨论的是PAN ID Compression域对PAN ID是否存在的影响。
帧中的PAN ID是否存在不仅受PAN ID Compression域的控制,还受相应地址模式域的控制。
当地址模式域为0时,是不存在相对应的PAN ID。但当地址模式为2或3时,
相对应的PAN ID是否存在就有些复杂了。
这里的源地址为发送方的地址,目的地址为预期接收方的地址。

二. 地址模式值对地址域和PAND ID的影响(见IEEE 802.15.4-2006 7.2.1.1--7.2.1.6):
1. 目的的地址和目的PAND ID:
如果目的地址模式为非0值,MAC帧就应该包括目的地址。
如果目的地址模式为非0值,MAC帧就应该包括目的PAND ID。
此时不考虑PAN ID Compression的值(IEEE 802.15.4-2006 7.2.1.3)。

2. 源的地址和源PAND ID:
如果源的地址模为非0值,MAC帧就应该包括源地址。
如果源地址模式为非0值,且PAND ID Compression域为0---即不在同一个PAND,
所以必须指定源PAND ID。MAC帧就应该包括源PAND ID(IEEE 802.15.4-2006 7.2.1.5)。

三. IEEE 802.15.4-2006 中关于7.2.1.1.5 PAN ID Compression subfield的描述:
The PAN ID Compression subfield is 1 bit in length and specifies whether 
the MAC frame is to be sent containing only one of the PAN identifier fields 
when both source and destination addresses are present. 
1. If this subfield is set to one and both the source and destination addresses 
   are present, the frame shall contain only the Destination PAN Identifier field, 
   and the Source PAN Identifier field shall be assumed equal to that of the destination.    
2. If this subfield is set to zero and both the source and destination addresses are present, 
   the frame shall contain both the Source PAN Identifier and Destination PAN Identifier fields. 
3. If only one of the addresses is present, this subfield shall be set to zero, 
   and the frame shall contain the PAN identifier field  corresponding to the address. 
4. If neither address is present, this subfield shall be set to zero, and the frame 
   shall not contain either PAN identifier field.
PAN ID压缩子字段的长度为1位,指示当源地址和目的地址都存在时,MAC帧是否仅包含一个PAN标识符字段。
见下面1和2的差别。
1.如果该域设置为1,且源地址和目的地址都存在,那么帧中必须包含目的PAN ID,源PAN ID假定和目的PAN ID相同。
2.如果该域设置为0,且源地址和目的地址都存在,那么帧中必须包含源PAN ID和目的PAN ID。
3.如果源地址和目的地址只有一个存在,那么该域必须设置为0,此时只包含存在的地址对应的PAN ID。比如帧中只包含
  源地址,那么就只有相应的源PAN ID存在。
4.如果源地址和目的地址都不存在,则该域必须设置为0。帧中不包含源PAN ID 和目的PAN ID。此时地址模式为0,
  所以源地址和源PAN ID,目的地址和目的PAN ID都不存在。

源和目的地址总的来说包括以下组合模式:
源和目的地址都存在,这时,如果PAN ID Compression为1,可忽略源PAN ID,即源PAN ID等于目的PAN ID,
两者一致,即为一个PAN。
源和目的地址都存在,这时,如果PAN ID Compression为0。此时,为不同的PAN,所以源PAN ID和目的PAN ID都必须指定。
源和目的地址只有一个存在。此时PAN ID Compression需为0。因为此时PAN ID Compression为1没有意义,
因为有一个地址未指定,无法指定源PAN ID和目的PAN ID在为同一值。此时,由于PAN ID Compression为0,
相应地址的PAN ID也存在。

综上所述,目的地址模式和源地址模式指明相应的地址是否存在。如果目的地址模式或源地址模式的值为0,
则表明相应的地址和PAN ID都不存在。如果两者为非0值,那么还需PAN ID Compression subfield进一步
指明其PAN ID是否存在。
PAN ID Compression subfield表明如果两个地址都同时存在时,两者的一致性。
阅读全文
0 0
原创粉丝点击