Re: [core] Designs to resolve streaming issues in SenML

Christian Amsüss <c.amsuess@energyharvesting.at> Sat, 16 January 2016 13:27 UTC

Return-Path: <c.amsuess@energyharvesting.at>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D8D7C1A8851 for <core@ietfa.amsl.com>; Sat, 16 Jan 2016 05:27:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.299
X-Spam-Level:
X-Spam-Status: No, score=0.299 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, MIME_8BIT_HEADER=0.3] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SBOr5SOREj1I for <core@ietfa.amsl.com>; Sat, 16 Jan 2016 05:27:56 -0800 (PST)
Received: from prometheus.amsuess.com (prometheus.amsuess.com [IPv6:2a01:4f8:190:3064::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0221C1A884F for <core@ietf.org>; Sat, 16 Jan 2016 05:27:55 -0800 (PST)
Received: from poseidon-mailhub.amsuess.com (095129206250.cust.akis.net [95.129.206.250]) by prometheus.amsuess.com (Postfix) with ESMTPS id D7A0B41880; Sat, 16 Jan 2016 14:27:52 +0100 (CET)
Received: from poseidon-mailbox.amsuess.com (poseidon-mailbox.amsuess.com [10.13.13.231]) by poseidon-mailhub.amsuess.com (Postfix) with ESMTP id 096912D; Sat, 16 Jan 2016 14:27:52 +0100 (CET)
Received: from hephaistos.amsuess.com (hephaistos.amsuess.com [10.13.13.129]) by poseidon-mailbox.amsuess.com (Postfix) with ESMTPSA id CC9582E; Sat, 16 Jan 2016 14:27:51 +0100 (CET)
Received: (nullmailer pid 3812 invoked by uid 1000); Sat, 16 Jan 2016 13:27:51 -0000
Date: Sat, 16 Jan 2016 14:27:51 +0100
From: Christian Amsüss <c.amsuess@energyharvesting.at>
To: "Cullen Jennings (fluffy)" <fluffy@cisco.com>
Message-ID: <20160116132751.GB18563@hephaistos.amsuess.com>
References: <175A1806-ACB0-4FC7-A318-2A58FF66CDD2@cisco.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="5/uDoXvLw7AC5HRs"
Content-Disposition: inline
In-Reply-To: <175A1806-ACB0-4FC7-A318-2A58FF66CDD2@cisco.com>
User-Agent: Mutt/1.5.24 (2015-08-30)
Archived-At: <http://mailarchive.ietf.org/arch/msg/core/jiEqU0THnJjWlFNNK7Y4TbB8cG4>
Cc: core <core@ietf.org>
Subject: Re: [core] Designs to resolve streaming issues in SenML
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 16 Jan 2016 13:27:58 -0000

Hello Cullen,

On Wed, Jan 13, 2016 at 01:57:02PM +0000, Cullen Jennings (fluffy) wrote:
> The objects can also have the base values right in the object and the
> base values apply to all the things in the object and any future
> objects in the array. 
>
> Appreciate any thoughts people have on pro / cons of the -03 design vs -04 design.

The -03 draft is parsable with minimum RAM: I've assembled a crude
demo[1] that shows that given a list of known integer-valued resources
on a device, it is possible to parse incoming SenML-03 with less than 30
bytes of state, with support for arbitrary SenML extensions, all legal
JSON number representations and full URL concatenation semantics.

With the -04 draft, one would have to allocate a buffer for the "n"
value, because before the object finishes, the "bn" might change later
in the same object, and change the context in which it needs to be
interpreted. This could be remedied by making base and entry updates
mutually exclusive (arguably a less straight-forward design), but as
things are, I'd prefer -03.

Best regards
Christian

[1] https://gitlab.com/c.amsuess-energyharvesting/senml-03-streaming-parser-demo/tree/master

-- 
Christian Amsüss                      | Energy Harvesting Solutions GmbH
founder, system architect             | headquarter:
mailto:c.amsuess@energyharvesting.at  | Arbeitergasse 15, A-4400 Steyr
tel:+43-664-97-90-6-39                | http://www.energyharvesting.at/
                                      | ATU68476614