Subject: Re: [Suit] Which type of devices? CBOR "parser"

From: Martin Pagel <[email-masked]>
Date: Fri, 9 Nov 2018 01:59:51 +0000

Thanks, Carsten, for the explanation, good to know, may be I should call it "transformation" rather than "parser". 

But you still need a buffer to receive the CBOR manifest and transform it into a format which the application (update agent, status tracker, communicator...) can use, which means you approximately need twice the memory plus some "transformation" code.

Martin

-----Original Message-----
From: Carsten Bormann <[email-masked]> 
Sent: Thursday, November 8, 2018 4:47 AM
To: Martin Pagel <[email-masked]>
Cc: Alexander Pelov <[email-masked]>; Hannes Tschofenig <[email-masked]>; [email-masked]; Matthias Waehlisch <[email-masked]>
Subject: Re: [Suit] Which type of devices? C Struct

On Nov 8, 2018, at 13:11, Martin Pagel <Martin.Pagel=[email-masked]> wrote:
> 
> a format which doesn’t require a parser

CBOR does not require a “parser” (this is not a text format).

It does use variable length encoding, so that requires something like

  uint64_t val = ai;
  switch (ai) {
  case AI_1: val = ntoh8p(pos); pos += 1; break;
  case AI_2: val = ntoh16p(pos); pos += 2 ; break;
  case AI_4: val = ntoh32p(pos); pos += 4 ; break;
  case AI_8: val = ntoh64p(pos); pos += 8 ; break; /* Well, if you need that… */
  }

(Pasted and macro-expanded out of cn_cbor.) That is all.

What CBOR does NOT give you is 4-byte alignment, so you may want to use it within something that provides that if you want to include the actual firmware on the side.

Grüße, Carsten

---

From: Carsten Bormann <[email-masked]>
Date: Fri, 9 Nov 2018 14:34:35 +0700

> But you still need a buffer to receive the CBOR manifest and transform it into a format which the application (update agent, status tracker, communicator…) can use, which means you approximately need twice the memory plus some "transformation" code.

You don’t need another format.  Why not work on the CBOR right away?

Grüße, Carsten

---

From: Brendan Moran <[email-masked]>
Date: Fri, 9 Nov 2018 11:17:19 +0000

I agree, Carsten. I am working on a specialised parser (similar in nature to the one you described above) for a minimal instance of the draft-moran-suit-manifest and hope to share my results shortly.

Best regards,
Brendan

> On 9 Nov 2018, at 07:34, Carsten Bormann <[email-masked]> wrote:
>
> _______________________________________________
> Suit mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/suit

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

---

From: Martin Pagel <[email-masked]>
Date: Fri, 9 Nov 2018 14:50:31 +0000

Carsten, 
I don't understand...  
With CBOR I need a Receive Buffer to load the manifest in CBOR format and then apply the parser to store it somewhere else in MCU-native format (such as a regular Int without the CBOR flags at the beginning). With the binary format you can skip that and load it straight in MCU-native format and work on it. 

Brendan, 
I assume your parser will be smaller, but would still use a Receive Buffer, correct?

Martin

-----Original Message-----
From: Brendan Moran <[email-masked]> 
Sent: Friday, November 9, 2018 3:17 AM
To: Carsten Bormann <[email-masked]>
Cc: Martin Pagel <[email-masked]>; Hannes Tschofenig <[email-masked]>; [email-masked]; Alexander Pelov <[email-masked]>; Matthias Waehlisch <[email-masked]>
Subject: Re: [Suit] Which type of devices? CBOR "parser"

Best regards,
Brendan

> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Fsuit&amp;data=02%7C01%7CMartin.Pagel%40microsoft.com%7C6e72d6b8d5004bbaceb808d64634f0bb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636773590535842589&amp;sdata=%2FMwjmYd77bydmIcSxHfrr0XvvFLRSiUdCzND1gAA1Lc%3D&amp;reserved=0

---

From: Brendan Moran <[email-masked]>
Date: Fri, 9 Nov 2018 16:02:16 +0000

Hi Martin,
That likely won’t be necessary with a pull parser. Let’s see how it works out.

Thanks,
Brendan

On 9 Nov 2018, at 14:50, Martin Pagel <[email-masked]<mailto:[email-masked]>> wrote:

Carsten,
I don't understand...

Brendan,

Martin

-----Original Message-----
From: Brendan Moran <[email-masked]<mailto:[email-masked]>>
Sent: Friday, November 9, 2018 3:17 AM
To: Carsten Bormann <[email-masked]<mailto:[email-masked]>>
Cc: Martin Pagel <[email-masked]<mailto:[email-masked]>>; Hannes Tschofenig <[email-masked]<mailto:[email-masked]>>; [email-masked]<mailto:[email-masked]>; Alexander Pelov <[email-masked]<mailto:[email-masked]>>; Matthias Waehlisch <[email-masked]<mailto:[email-masked]>>
Subject: Re: [Suit] Which type of devices? CBOR "parser"

Best regards,
Brendan

On 9 Nov 2018, at 07:34, Carsten Bormann <[email-masked]<mailto:[email-masked]>> wrote:

Grüße, Carsten

_______________________________________________
Suit mailing list
[email-masked]<mailto:[email-masked]>
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Fsuit&amp;data=02%7C01%7CMartin.Pagel%40microsoft.com%7C6e72d6b8d5004bbaceb808d64634f0bb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636773590535842589&amp;sdata=%2FMwjmYd77bydmIcSxHfrr0XvvFLRSiUdCzND1gAA1Lc%3D&amp;reserved=0