第五章 iSNSP消息格式(iSNSP Message Format)-- 二-五

二、iSNSP消息的分割和重组
        iSNS消息可能在一个或多个PDU中传输。如果一个iSNS消息只在一个PDU中发送,那么FLAGS的Bit21(First PDU)和bit20(Last PDU)应该( SHALL)都被设成1。如果一个iSNS消息分为多个PDU发送,那么第一个PDU的FLAGS的第21Bit(First PDU)应该设1,最后一个PDU的FLAGS的第20Bit(Last PDU)应该设1。
        同一个消息的所有PDU都应该有一样的FUNCTION ID和TRANSACTION ID。一个消息的所有PDU都应该有唯一的SEQUENCE ID。
三、iSNSP PDU Payload
        iSNSP PDU PAYLOAD的长度可变,其中包含了注册的属性和查询的操作。属性的数据格式类似于其他协议,比如DHCP[ RFC2131]。每一个PDU中的iSNS属性都使用Tag-Length-Value (TLV)格式,具体如下:
   Byte   MSb                                        LSb
Offset 0 31
+--------------------------------------------+
0 | Attribute Tag | 4 Bytes
+--------------------------------------------+
4 | Attribute Length (N) | 4 Bytes
+--------------------------------------------+
8 | |
| Attribute Value | N Bytes
| |
+--------------------------------------------+
Total Length = 8 + N
        Attribute Tag:一个4字节的字段,值在Section6.1中定义。
        Attribute Length:一个4字节的字段,指出TLV格式中Value的字节数。对于一个可变长的属性,这个字段的值需要包含填充的字节,如果必须应该4字节对 齐。一个“长度为0的TLV”只包含Attribute Tag和Length字段。
        Attrbute Value:一个可变长的字段,包含了属性的值和可能的填充字节。
        以上的格式用来在PDU Payload中识别属性。TLV的边界需要和PDU的边检对齐;PDU可以包含一个或多个TLV,or any fraction thereof。应答的PDU Payload中的应答状态码(Response Status Code)在下面定义,它不是TLV格式的。不包含iSNS属性的消息(如:Name Service HeartBear),不使用TLV格式。
    1、Attribute Value 4-Byte Alignment
        所有属性的值都以4字节对齐。对于可变长的属性,如果有必要必须( MUST)以0填充至下一个4字节长度。如果一个属性的值被填充过,那么Tag和属性值被结合起来以确定时间的值的长度,和填充的格式。TLV不直接提供填充的数目。
四、iSNSP Response Status Codes
        所有iSNSP应答消息的iSNSP PDU PAYLOAD的第一个字段就是4字节长的Status Code。如果原消息被iSNS服务器正常处理,或iSNS客户端正常了ESI、SCN消息,那么这个字段就应该( SHALL)包含一个0(Successful)。一个非0的值表示拒绝了iSNS客户端的请求消息。
          Status Code      Status Description
----------- -----------------
0 Successful
1 Unknown Error
2 Message Format Error
3 Invalid Registration
4 RESERVED
5 Invalid Query
6 Source Unknown
7 Source Absent
8 Source Unauthorized
9 No Such Entry
10 Version Not Supported
11 Internal Error
12 Busy
13 Option Not Understood
14 Invalid Update
15 Message (FUNCTION_ID) Not Supported
16 SCN Event Rejected
17 SCN Registration Rejected
18 Attribute Not Implemented
19 FC_DOMAIN_ID Not Available
20 FC_DOMAIN_ID Not Allocated
21 ESI Not Available
22 Invalid Deregistration
23 Registration Feature Not Supported
24 and above RESERVED
五、Authentication for iSNS Multicast and Broadcast Messages
        对于iSNS Multicast和Broadcast消息(Section 2.9.3),iSNSP提供了认证的功能。下面的这一节消息介绍了iSNS认证模块,它能够识别SLP认证模块[ RFC2608]。iSNS单路(Unicast)消息不应该( SHOULD NOT)包含认证模块,而是依赖IPSec安全机制。
        如果一个消息保护了一个认证模块,那么iSNSP PDU Header FLAGS中的“Authentication Block Present”Bit应该设1。
        如果PKI利用了[X.509] Certificate Authority (CA),那么iSNS服务器可以使用public key authentication。 The  authentication block leverages the DSA with SHA-1 algorithm, which can easily integrate into a public key infrastructure。
        Multicast消息的认证模块中包含了数字签名。数字签名针对每一个PDU计算。认证模块包含以下信息:
   1.  A time stamp, to prevent replay attacks.
2.  A structured authenticator containing a signature calculated over
the time stamp and the message being secured.
3. An indicator of the cryptographic algorithm that was used to
calculate the signature.
4. An indicator of the keying material and algorithm parameters,
used to calculate the signature.
        认证模块的具体模式:
      Byte   MSb                              LSb
Offset 0 31
+----------------------------------+
0 | BLOCK STRUCTURE DESCRIPTOR | 4 Bytes
+----------------------------------+
4 | AUTHENTICATION BLOCK LENGTH | 4 Bytes
+----------------------------------+
8 | TIMESTAMP | 8 Bytes
+----------------------------------+
16 | SPI STRING LENGTH | 4 Bytes
+----------------------------------+
20 | SPI STRING | N Bytes
+----------------------------------+
20 + N | STRUCTURED AUTHENTICATOR | M Bytes
+----------------------------------+
Total Length = 20 + N + M
        BLOCK STRUCTURE DESCRIPTOR(BSD):定义了使用STRUCTURED AUTHENTICATOR的结构和算法。0x00000000 - 0x00007FFF由IANA分配,0x00008000 - 0x00008FFF可以自用。
        AUTHENTICATION BLOCK LENGTH:定义了从BSD到STRUCTURED AUTHENTICATOR之间的认证模块的长度。
        TIMESTAMP:这是一个8字节,无符号定点整数,记录了从1970/1/1的GMT00:00:00到现在的秒数。
        SPI STRING LENGTH:SPI STRING字段的长度。
        SPI STRING(Security Parameters Index):索引了消息使用的STRUCTURED AUTHENTICATOR的编码Key和算法。
        STRUCTURED AUTHENTICATOR:包含了数字签名。For the default BSD value of 0x0002, this field SHALL contain the binary ASN.1 encoding of output values from the DSA with SHA-1 signature calculation as specified in Section 2.2.2 of [ RFC3279].  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值