51学通信技术论坛

 找回密码
 立即注册
搜索
查看: 3713|回复: 4
打印 上一主题 下一主题

协议理解 [复制链接]

Rank: 2Rank: 2

跳转到指定楼层
楼主
发表于 2013-8-27 11:55:37 |只看该作者 |倒序浏览
一键分享 一键分享
在3gpp协议中,描述ie的length的时候有这么一句话:
For all the length fields, bit 8 of the lowest numbered octet is the most significant bit and bit 1 of the highest numbered octet is the least significant bit.
这个是大致是啥含义?

Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7

版主

沙发
发表于 2013-8-27 13:21:47 |只看该作者
信息元素的长度,8个字节是最大的有效位,1字节是最低有效位。

点评

hycl5410  bit=比特。。。0或者1  发表于 2013-8-27 13:28:29

使用道具 举报

Rank: 8

VIP 论坛核心会员 特殊贡献奖

板凳
发表于 2013-8-27 13:57:22 |只看该作者
以下来自百度知道:
最低有效位  (LSB: Least Significant Bit)   最低有效位(LSB)是给这些单元值的一个二进制整数位位置,就是,决定是否这个数字是偶数或奇数。LSB有时候是指最右边的位,因为写较不重要的数字到右边位置符号的协定。它类似于一个十进制整数的最不重要的数字,它是在一个(最右边)位置的数字。   LSB(Least Significant Bit),意思为最低有效位;MSB(Most Significant Bit),即最高有效位,若MSB=1,则表示数据为负值,若MSB=0,则表示数据为正。MSB是Most Significant Bit的缩写,最高有效位。在二进制数中,MSB是最高加权位。与十进制数字中最左边的一位类似。通常,MSB位于二进制数的最左侧,LSB位于二进制数的最右侧。

http://zhidao.baidu.com/link?url ... FCNA-odIpOS-CDNLWjK

以下来自个人理解:
正如上述所说,一般情况下MSB位于最左侧(bit 8)而LSB位于最右侧(bit 1)。而这里还涉及多个octets,建议楼主找一个专门描述IE编码的章节,看一下octets和bits是如何排列的,应该就可以明白这个描述到底说的是什么事情了。
我们假设一共有4个octets,那就是4*8=32 bit,一般来说bit 8是最左边而bit 1是最右边(具体一定要看编码),那么这32个bit的第一个(也就是octet 1的bit8)就是MSB,最后一个(也就是octet 4的bit1)就是LSB。
至于MSB和LSB在该协议中的具体含义及用法,还是建议参考协议原文而不要以百度知道中的描述为准。

另外一个建议:这类问题最好把相关协议号和段落都描述一下,否则实在是难以清楚楼主问的东西是什么,很容易片面和答非所问。

使用道具 举报

Rank: 2Rank: 2

地板
发表于 2013-8-27 14:59:06 |只看该作者
附带协议TS29060:
7.7.0 General
A GTP Signalling message may contain several information elements. The TLV (Type, Length, Value) or TV (Type,
Value) encoding format shall be used for the GTP information elements. The information elements shall be sorted, with
the Type fields in ascending order, in the signalling messages. The Length field contains the length of the information
element excluding the Type and Length field.
For all the length fields, bit 8 of the lowest numbered octet is the most significant bit and bit 1 of the highest numbered
octet is the least significant bit.
Within information elements, certain fields may be described as spare. These bits shall be transmitted with the value
defined for them. To allow for future features, the receiver shall not evaluate these bits.
The most significant bit in the Type field is set to 0 when the TV format is used and set to 1 for the TLV format.

使用道具 举报

Rank: 8

VIP 论坛核心会员 特殊贡献奖

5#
发表于 2013-8-27 16:11:22 |只看该作者
5        Transmission Order and Bit Definitions
The messages in this document shall be transmitted in network octet order starting with octet 1. Where information elements are repeated within a message the order shall be determined by the order of appearance in the table defining the information elements in the message.
The most significant bit of an octet in a GTP message is bit 8. If a value in a GTP message spans several octets and nothing else is stated, the most significant bit is bit 8 of the octet with the lowest number.

按照这个说明,我之前举的例子是适用于29.060的。但是针对length field的MSB和LSB用法我没有在29.060里找到。考虑到length field定义的一定是一个数字,那么貌似可以参考一下百度知道的说明。

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

站长邮箱|Archiver|51学通信 ( 粤ICP备11025688 )

GMT+8, 2024-5-3 02:27 , Processed in 0.025528 second(s), 13 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部