Subject: Re: [core] #5: Header improvements

From: "core issue tracker" <[email-masked]>
Date: Fri, 02 Jul 2010 08:00:35 -0000

#5: Header improvements
--------------------------------+-------------------------------------------
 Reporter:  zach@…              |        Owner:  zach@…            
     Type:  enhancement         |       Status:  closed            
 Priority:  minor               |    Milestone:                    
Component:  coap                |      Version:                    
 Severity:  -                   |   Resolution:  fixed             
 Keywords:                      |  
--------------------------------+-------------------------------------------
Changes (by zach@…):

  * status:  new => closed
  * resolution:  => fixed

Comment:

 The coap-01 includes an improved and simplified header structure, was not
 able to integrate all ideas though. The goal is to absolutely NOT change
 the base and option header anymore after coap-01.

 - Single byte for indicating methods or response codes. Requires less
 memory to hold a header structure.
 - Improved option TLV header as per coap-misc.
 - The consensus earlier in the WG was to have flexible options for future
 extensibility. Thus we chose to keep URIs and content-type as options. The
 other extreme would have been to remove options almost alltogether.
 - The number,size and complexity of options was reduced.

 The new header looks like this:

 {{{

      0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |Ver| T |  OC   |      Code     |        Transaction ID         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   Options (if any) ...
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   Payload (if any) ...
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

    Header Fields:

       Ver:  Version. 2-bit unsigned integer.  Indicates the version of
          CoAP.  Implementations of this specification MUST set this
          field to 1.  Other values are reserved for future versions.

       T: 2-bit unsigned integer Transaction Type field.  Indicates if
          this message is a CoAP Confirmable (0), Non-Confirmable (1),
          Acknowledgement (2) or Reset (3).

       OC:  4-bit unsigned integer Number of Options field.  Indicates if
          there are Option Headers following the base header.  If set to
          0 the payload (if any) immediately follows the base header.  If
          greater than zero the field indicates the number of options to
          immediately follow the header.  See Section 3.2 below.

       Code:  8-bit unsigned integer.  This field indicates the Method or
          Response Code of a message.  The value 0 indicates no code.
          The values 1-10 are used for Method Codes as defined in
          Table 1.  The values 11-39 are reserved for future use.  The
          values 40-255 are used for Response Codes as defined in
          Section 11.1.

       Transaction ID:  16-bit unsigned integer.  A unique Transaction ID
          assigned by the source and used to match responses.  The
          Transaction ID MUST be changed for each new request (regardless
          of the end-point) and MUST NOT be changed when retransmitting a
          request.

       _: This field is unused.  It MUST be initialized to zero by the
          sender and MUST be ignored by the receiver.

                              +--------+------+
                              | Method | Code |
                              +--------+------+
                              | GET    | 1    |
                              | POST   | 2    |
                              | PUT    | 3    |
                              | DELETE | 4    |
                              +--------+------+

                            Table 1: Method Codes

 }}}

-- 
Ticket URL: <http://tools.ietf.org/wg/core/trac/ticket/5#comment:1>
core <http://tools.ietf.org/core/>