12.2 CoAP选项码注册(CoAP Option Number Registry)

这篇文档为CoAP options中“CoRE Parameters”注册表中的option编号定义了一个sub-registry。这个sub-registry的名字是“CoAP Option Number”。

每个sub-registry必须包含这个option编号,option的名称,还有option文档参考。

初始化进入这个sub-registry如下:

             +--------+------------------+-----------+ 
             | Number | Name             | Reference | 
             +--------+------------------+-----------+ 
             |      0 | (Reserved)       | [RFC7252] | 
             |      1 | If-Match         | [RFC7252] |
             |      3 | Uri-Host         | [RFC7252] | 
             |      4 | ETag             | [RFC7252] |  
             |      5 | If-None-Match    | [RFC7252] |  
             |      7 | Uri-Port         | [RFC7252] |  
             |      8 | Location-Path    | [RFC7252] | 
             |     11 | Uri-Path         | [RFC7252] |
             |     12 | Content-Format   | [RFC7252] |
             |     14 | Max-Age          | [RFC7252] | 
             |     15 | Uri-Query        | [RFC7252] |  
             |     17 | Accept           | [RFC7252] |   
             |     20 | Location-Query   | [RFC7252] |   
             |     35 | Proxy-Uri        | [RFC7252] |  
             |     39 | Proxy-Scheme     | [RFC7252] | 
             |     60 | Size1            | [RFC7252] |
             |    128 | (Reserved)       | [RFC7252] | 
             |    132 | (Reserved)       | [RFC7252] |  
             |    136 | (Reserved)       | [RFC7252] |   
             |    140 | (Reserved)       | [RFC7252] |    
             +--------+------------------+-----------+ 
                   表 7: CoAP Option Numbers

互联网号码分配政策为这个sub-registry以后额外的定义分为了如下3层。0..255是为option保留,在IETF有被定义(IETF Review or IESG Approval)。256..2047是为普通使用的包含公开规格(Specification Required)的options保留的。2048..64999是为了所有其他options,包含私人的或者赞助商规格的,这些需要经过一个特定的专家审核来确定这个option语法是定义正确的。在6500和65535之间的Option编号是保留下来用于实验。他们不是给赞助商使用,而且是禁止用于操作部署。

这个option编号的文档应该指定这个option和它的编号,包含以下属性:

  • option在请求中的意义。

  • option在响应中的意义。

  • 这个option是critical还是elective,由option编号决定。

  • 这个option是否是safe-to-forward,如果是,是否是cache-key的一部分,这些由option编号决定(见5.4.2节)

  • option值的格式和长度。

  • 是否option只一次出现,还是它能出现很多次。

  • 默认值。对于一个有默认值的critical option,存在这样的讨论,默认值如何能处理通过实施,而这个实施又不支持critical option(见5.4.4节)

最后更新于