Uploaded image for project: 'Mynewt'
  1. Mynewt
  2. MYNEWT-647

Changes to NMP over OIC scheme

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • v1_0_0_rel
    • Newtmgr
    • Security Level: Public (Viewable by anyone)
    • None

    Description

      This ticket was created to address the following three issues with NMP over OIC (OMP):

      1. Parts of NMP header missing from OMP responses. This causes problems when multiplexing OMP among many target devices.
      2. Parts of the NMP header are scattered in a few different places. This works, but it makes it difficult to debug packet traces.
      3. NMP errors get lost in translation. Instead of an NMP message with an error code, the OMP server sends back a generic "Bad Request" OICmessage.

      Current Scheme

      Requests

      The NMP op is indicated by the OIC op:
      NMP read <=> OIC get
      NMP write <=> OIC put

      The NMP group and ID are indicated as CoAP URI Query options:

      • gr=<group>
      • id=<id>

      The remaining NMP header fields, seq and flags, are not present.

      The NMP payload is the entire CoAP request body. This is identical to the body of a plain NMP request.

      Responses

      The NMP header is not present. The NMP op is indicated in the payload (see below), but other header fields cannot be inferred.

      Payload consists of a single CBOR key-value pair. For read responses, the key is "r"; for write responses, the key is "w". The value is a second CBOR map containing the actual NMP response fields.

      Errors encountered during processing of NMP requests are reported via OIC error responses (bad request, internal server error).

      Proposed Scheme

      Requests
      1. The OIC op is always the same: put.
      2. No URI Query CoAP options.
      3. The NMP header is included in the payload as a key-value pair (key="_h"). This pair is in the root map of the request and is a sibling of the other request fields. The value of this pair is the big-endian eight-byte NMP header with a length field of 0.
      Responses
      • As with requests, the NMP header is included in the payload as a key-value pair (key="_h").
      • No "r" or "w" field. The response fields are inserted into the root map as a sibling of the "_h" pair.
      • Errors encountered during processing of NMP requests are reported identically to other NMP responses (embedded NMP response).
      Notes
      • Keys that start with an underscore are reserved to the OIC manager protocol (e.g., "_h"). NMP requests and responses must not name any of their fields with a leading underscore.

      Attachments

        Issue Links

          Activity

            People

              ccollins476 Christopher Collins
              ccollins476 Christopher Collins
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m