51学通信技术论坛

标题: 关于Alignment octets的作用解释 [打印本页]

作者: iscehsj    时间: 2012-2-23 20:51:48     标题: 关于Alignment octets的作用解释

本帖最后由 iscehsj 于 2012-2-23 20:51 编辑

有些BSSGP消息中, Alignment octets是有的,有些是没有带的。请问它的作用是什么?


作者: iscehsj    时间: 2012-2-23 20:52:57

补充它的定义:
11.3.1        Alignment octets
The Alignment Octets are used to align a subsequent IEI onto a 32 bit boundary. The element coding is:
Table 11.3.1: Alignment octets IE
        8        7        6        5        4        3        2        1
octet 1        IEI
octet 2, 2a        Length Indicator (note)
octet 3-5        spare octet
NOTE:        The Length Indicator may indicate that from 0 to 3 spare octets are present.

作者: 爱卫生    时间: 2012-2-23 22:39:56

回复 iscehsj 的帖子

  正如你贴出来的那样,这个IEI就是用来做4字节对齐的。
  在TS48.018前面介绍Downlink UNITDATA 和Uplink UNITDATA PDU的时候,都提到了这个Alignment octets是一个可选的字节。并且都提到"The LLC-PDU shall always be the last information element in the DL-UNITDATA PDU, and shall be aligned on a 32 bit boundary for efficient processing"。也就是说LLC-PDU(通常包含的就是上层的GMM/SM消息)如果有的话,一定是最后一个IEI。那这个Alignment octets按照这个说明,是为了后续的IEI的32 bit对齐。那它后面肯定就有这个LLC PDU IEI。就要保证这些Alignment octets的后续IEI的总字节长度是4字节的倍数。
  个人理解。在网上搜索“字节对齐”可以找到一些编程的方法论,说明字节对齐的好处。

作者: iscehsj    时间: 2012-2-23 23:02:10

回复 爱卫生 的帖子

首先非常感谢你的回复!

根据你的解释,我想再问一下:那么alignment octets是为了跟LLC-PDU中的IEI(Information Element Identifer)形成4字节对齐呢,还是为了跟整个LLC-PDU(包括IEI、length和LLC-PDU的具体内容)形成4字节对齐?

因为关于alignment octets的定义为:The Alignment Octets are used to align a subsequent IEI onto a 32 bit boundary。


作者: 爱卫生    时间: 2012-2-23 23:15:25

不好意思。这个真不确定。但个人理解,应该不包括LLC DATA部分。因为这部分应该不能叫做IEI了,属于上层的payload。并且通过抓包来看,除data 部分LLC DATA外的LLC PDU都是2个字节,而alignment octets在包里也都是2个字节,这样就正好4个字节了。
作者: iscehsj    时间: 2012-2-23 23:28:09

我倾向的理解也跟你一样。但是,根据Alignment octets的定义,其长度可能存在5~7个字节(包括IEI和length 之后)。那除了alignment octets为2个字节刚好与LLC-PDU IEI凑成4个字节的情况,还有其他可能的情况吗?




欢迎光临 51学通信技术论坛 (http://www.51xuetongxin.com/bbs/) Powered by Discuz! X2