Re: [core] Designs to resolve streaming issues in SenML
Michael Koster <michaeljohnkoster@gmail.com> Sat, 16 January 2016 15:24 UTC
Return-Path: <michaeljohnkoster@gmail.com>
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 745F21A8998 for <core@ietfa.amsl.com>; Sat, 16 Jan 2016 07:24:46 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.099
X-Spam-Level:
X-Spam-Status: No, score=-1.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, J_CHICKENPOX_54=0.6, MIME_8BIT_HEADER=0.3, SPF_PASS=-0.001] 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 a6kbNOCUyGxd for <core@ietfa.amsl.com>; Sat, 16 Jan 2016 07:24:44 -0800 (PST)
Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2DE451A8997 for <core@ietf.org>; Sat, 16 Jan 2016 07:24:44 -0800 (PST)
Received: by mail-pf0-x231.google.com with SMTP id n128so133298620pfn.3 for <core@ietf.org>; Sat, 16 Jan 2016 07:24:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=h30q72Hf6su1MAvzSTBglqtxvBzgDVM+5MBLiVbXetA=; b=lkSHNdhzF2F2JR5k6l4Kp8nOv5ZULid7nxZ0OLGBxPm0PD4DTps2OVSeJ7qiA12648 DW2F5sOXYVsG81l4JidhZUn6UvifJBBPpPxA1nEMtAyKD2WXF4+rPU7DOmLBw4KTUBF6 Ibu4iPftb2junxZPHATn+m6Zi1TNnA8WE6Ap4dY6uVY5NHhxI8MwstlH0/mcVVn3BpEs n29lLC20zYvejtes4LYH3yCAebv0bK5U0AFALz4+YDxqqFAkmuL224Vxj6jM2qD/wQs0 9FsBpB74qzKe2ZEFxipo/+RvaMC27qETeYDkyG7Bo9uyEutGWTSFGs8zJZUrSBGwOQ/T ZKlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=h30q72Hf6su1MAvzSTBglqtxvBzgDVM+5MBLiVbXetA=; b=FvJ0hMa8hnnn0R2Ap09Rphfq9b9Mu52+2GmkyIr/KzYiAj13iQM8BFlEnOs3QiBDGK jXLK1Rp0Y4Pah93+6L6Mj3wdB4fuXW99T6qvfrbBtpj9W8jWeNOH+vyfQgFTFK5/HQtk uIgCUnvolPOAC4XHRFQy/dw5Bg0IvdjJWrUQCRO1wAgsL6VhwtDqI26KZ8svWv5kB93X rjtWmKzv0u9Eojl0gieBJ0WoYQZ2WoZyfP5qmV7nWFfAz99IxEIPtPRNRGDCswbN3GdG blD9EbNmmyndTNfu0lz2wKZGKqom9V651QAFh/QURc1cCNtBlHyZzwYsE5RxwwkoDBpJ mQ+Q==
X-Gm-Message-State: ALoCoQmqNcvzTKiPedZ283oIj4d04pJb1Qm6n4vCxa2PGmZ4P5yUuyYNx253sp+xaxDPF5h300xUh/EK4pCJlpMqtPEBSirtNQ==
X-Received: by 10.98.10.81 with SMTP id s78mr21030151pfi.119.1452957883822; Sat, 16 Jan 2016 07:24:43 -0800 (PST)
Received: from [10.0.0.21] (108-201-184-41.lightspeed.sntcca.sbcglobal.net. [108.201.184.41]) by smtp.gmail.com with ESMTPSA id e82sm22538962pfb.76.2016.01.16.07.24.42 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 16 Jan 2016 07:24:42 -0800 (PST)
Content-Type: multipart/alternative; boundary="Apple-Mail=_592F1A71-5F12-43F7-80F2-470CD99AB5BB"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
From: Michael Koster <michaeljohnkoster@gmail.com>
In-Reply-To: <20160116132751.GB18563@hephaistos.amsuess.com>
Date: Sat, 16 Jan 2016 07:24:41 -0800
Message-Id: <CC28D44A-DBC0-446D-90A8-3E329FC3F0AF@gmail.com>
References: <175A1806-ACB0-4FC7-A318-2A58FF66CDD2@cisco.com> <20160116132751.GB18563@hephaistos.amsuess.com>
To: Christian Amsüss <c.amsuess@energyharvesting.at>
X-Mailer: Apple Mail (2.2104)
Archived-At: <http://mailarchive.ietf.org/arch/msg/core/tZFqfbdDAUdCOavXlhwOCXJkPbk>
Cc: "Cullen Jennings (fluffy)" <fluffy@cisco.com>, 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 15:24:46 -0000
Hi Christian, 1. Thanks for the code example! It seems well optimized indeed. It also serves to highlight one of the points. It’s more than just a matter of me liking my own favorite language (actually library) internal representation of JSON. Most modern libraries produce dictionary and array representations for parsed JSON that work more or less the same way. The optimizations you recommend require a new string input parser, where I am using the JSON parser that comes with the library. My point was that I will need to either make my own string parser for SenML or make a re-parser with the state machine I described in order to use -02 + but there is another issue anyway: One of the big advantages of using JSON is connecting the embedded world to the web world. To do this in a low-friction way, it’s good to be able to use well known tools and patterns. Streaming JSON 2. Thanks also for looking into my code. I could easily use the -02 or -03 in the senml processing as you show. What is missing still from everything after -01 is the element tag that I am re-using to indicate links and forms in the document: { "bn":"/3300/1/", "e":[ {"n":"5700","v":"31.3"}, {"n":"5602","v":"37.1"}, {"n":"5601","v":"18.3"}, {"n":"5605"}, {"n":"5603","v":"0"}, {"n":"5604","v":"100"}, {"n":"5750","sv":"Inboard Bearing"} ], "l":[ {"href":"","rel":"self","rt":"temperature","u":"C"}, {"href":"5700","rt":"currentValue","u":"C"}, {"href":"5602","rt":"maxValue","u":"C"}, {"href":"5601","rt":"minValue","u":"C"}, {"href":"5605","rt":"resetMaxMin"}, {"href":"5603","rt":"minScale","u":"C"}, {"href":"5604","rt":"maxScale","u":"C"}, {"href":"5750","rt":"appType"} ] } I will think about other designs that do not depend on entity tags in the representation; maybe there is a better design for the content format in general. But I would still like to use SenML. Maybe not extend it but embed it in another new format… In the meantime, I don’t have a good alternative yet. Best regards, Michael PS Can we succinctly describe the use case for ordered serial processing of senml+json elements being important? From reading the draft, it seems like the important bit is saving the buffer memory for large responses. Is it a bigger deal with CBOR encoding or less important. Is the most important consideration being able to know the base values ahead of the data? Also, where is -03? there doesn’t seem to be a version -03 that you all are talking about on the IETF website: https://tools.ietf.org/html/draft-jennings-core-senml-04 <https://tools.ietf.org/html/draft-jennings-core-senml-04> > On Jan 16, 2016, at 5:27 AM, Christian Amsüss <c.amsuess@energyharvesting.at> wrote: > > 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 > _______________________________________________ > core mailing list > core@ietf.org > https://www.ietf.org/mailman/listinfo/core
- Re: [core] Designs to resolve streaming issues in… Carsten Bormann
- [core] Designs to resolve streaming issues in Sen… Cullen Jennings (fluffy)
- Re: [core] Designs to resolve streaming issues in… Michael Koster
- Re: [core] Designs to resolve streaming issues in… Michael Koster
- Re: [core] Designs to resolve streaming issues in… Christian Amsüss
- Re: [core] Designs to resolve streaming issues in… Carsten Bormann
- Re: [core] Designs to resolve streaming issues in… Christian Amsüss
- Re: [core] Designs to resolve streaming issues in… Michael Koster
- Re: [core] Designs to resolve streaming issues in… Carsten Bormann
- Re: [core] Designs to resolve streaming issues in… Michael Koster
- Re: [core] Designs to resolve streaming issues in… Michael Koster
- Re: [core] Designs to resolve streaming issues in… Michael Koster
- Re: [core] Designs to resolve streaming issues in… Carsten Bormann
- Re: [core] Designs to resolve streaming issues in… Michael Koster
- Re: [core] Designs to resolve streaming issues in… Michael Koster
- Re: [core] Designs to resolve streaming issues in… Michael Koster
- Re: [core] Designs to resolve streaming issues in… Christian Amsüss
- Re: [core] Designs to resolve streaming issues in… Michael Koster
- Re: [core] Designs to resolve streaming issues in… Michael Koster
- Re: [core] Designs to resolve streaming issues in… Christian Amsüss
- Re: [core] Designs to resolve streaming issues in… Christian Amsüss
- Re: [core] Designs to resolve streaming issues in… Michael Koster
- Re: [core] Designs to resolve streaming issues in… Cullen Jennings (fluffy)
- Re: [core] Designs to resolve streaming issues in… Cullen Jennings (fluffy)
- [core] privacy issues (was: Re: Designs to resolv… Stephen Farrell
- Re: [core] Designs to resolve streaming issues in… Christian Amsüss
- Re: [core] Designs to resolve streaming issues in… Carsten Bormann
- Re: [core] Designs to resolve streaming issues in… Christian Amsüss
- Re: [core] Designs to resolve streaming issues in… Michael Koster
- [core] SenML and link-format in RDF (was: Re: Des… Christian Amsüss
- Re: [core] SenML and link-format in RDF (was: Re:… Michael Koster
- Re: [core] SenML and link-format in RDF (was: Re:… Christian Amsüss
- Re: [core] SenML and link-format in RDF (was: Re:… Michael Koster
- Re: [core] SenML and link-format in RDF (was: Re:… Christian Amsüss
- Re: [core] SenML and link-format in RDF (was: Re:… Michael Koster
- Re: [core] SenML and link-format in RDF (was: Re:… Michael Koster
- Re: [core] SenML and link-format in RDF Carsten Bormann
- Re: [core] SenML and link-format in RDF (was: Re:… Michael Koster