Re: [core] COOL SID representation

Michel Veillette <Michel.Veillette@trilliantinc.com> Fri, 01 April 2016 14:04 UTC

Return-Path: <Michel.Veillette@trilliantinc.com>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 787F912D5EF for <core@ietfa.amsl.com>; Fri, 1 Apr 2016 07:04:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.902
X-Spam-Level:
X-Spam-Status: No, score=-1.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=trilliant.onmicrosoft.com
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 kiRHE84QoxW0 for <core@ietfa.amsl.com>; Fri, 1 Apr 2016 07:04:09 -0700 (PDT)
Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0759.outbound.protection.outlook.com [IPv6:2a01:111:f400:fc10::759]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8FC5512D59D for <core@ietf.org>; Fri, 1 Apr 2016 07:04:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Trilliant.onmicrosoft.com; s=selector1-trilliantinc-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=eZuqAhoPNOB0NZckojhF/jgFBJGPMDctjH6SvEp7E7s=; b=xBteevq+cJNWKp8gMFxOzlIqLBlj4FZ8e+wxgLQpzpMKt25SN5bwjD2PXdTSNV5/teJP0IVJpsrtu0IIBkzyt739W62H/2MCd/1RHJz/f+OQeksbJcdVKyh6ADZ3g7oq82RxYv+uLLRcYrSVoYxtxHF4173Rpa5fBNFYMeTwJbA=
Received: from BLUPR06MB1763.namprd06.prod.outlook.com (10.162.224.149) by BLUPR06MB1764.namprd06.prod.outlook.com (10.162.224.150) with Microsoft SMTP Server (TLS) id 15.1.447.15; Fri, 1 Apr 2016 14:03:50 +0000
Received: from BLUPR06MB1763.namprd06.prod.outlook.com ([10.162.224.149]) by BLUPR06MB1763.namprd06.prod.outlook.com ([10.162.224.149]) with mapi id 15.01.0447.026; Fri, 1 Apr 2016 14:03:50 +0000
From: Michel Veillette <Michel.Veillette@trilliantinc.com>
To: "consultancy@vanderstok.org" <consultancy@vanderstok.org>, Core <core@ietf.org>
Thread-Topic: [core] COOL SID representation
Thread-Index: AQHRioLe9YC4kcsTek+wcq535Vsfz591H9Dg
Date: Fri, 01 Apr 2016 14:03:49 +0000
Message-ID: <BLUPR06MB17633FE1267AC709CC089262FE9A0@BLUPR06MB1763.namprd06.prod.outlook.com>
References: <eaa4ff16bba5555e8aa3560fe428378b@xs4all.nl>
In-Reply-To: <eaa4ff16bba5555e8aa3560fe428378b@xs4all.nl>
Accept-Language: fr-CA, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: vanderstok.org; dkim=none (message not signed) header.d=none;vanderstok.org; dmarc=none action=none header.from=trilliantinc.com;
x-originating-ip: [207.96.192.122]
x-ms-office365-filtering-correlation-id: e60fa9c7-c565-4bd8-c434-08d35a367382
x-microsoft-exchange-diagnostics: 1; BLUPR06MB1764; 5:F44kXofWWFZPsh30UD8vtbnw7I4Z4NmxMok3kZJixq3AAryvY9nxrep2YNMlAgYneR03mR0QehfNxpmr5yb2is4N4kN/Foxm+AjQDM7aP4YxLTDW915JlbvSpDnBqc6KkBk37LnUPURKKGHlgSYFig==; 24:NLVNt3tm1g0pBHB/kfJO18Shec2O9Fy+ISGId7XvcAlCR9glqCVV2jEzhISQnJI9ElNkvpXNP3gyxn+UiHDl9XmdBWr6ieWrnYu0XDfa+gA=
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR06MB1764;
x-microsoft-antispam-prvs: <BLUPR06MB1764F3B10AF6D803BAADE073FE9A0@BLUPR06MB1764.namprd06.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:;
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:BLUPR06MB1764; BCL:0; PCL:0; RULEID:; SRVR:BLUPR06MB1764;
x-forefront-prvs: 0899B47777
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(13464003)(377454003)(11100500001)(107886002)(15975445007)(92566002)(87936001)(10400500002)(122556002)(5001770100001)(106116001)(19580405001)(19580395003)(189998001)(3280700002)(99286002)(5008740100001)(2950100001)(76576001)(77096005)(66066001)(2906002)(2501003)(2900100001)(74316001)(5003600100002)(3660700001)(5004730100002)(586003)(81166005)(102836003)(6116002)(3846002)(86362001)(50986999)(5002640100001)(33656002)(1220700001)(15395725005)(54356999)(1096002)(76176999)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR06MB1764; H:BLUPR06MB1763.namprd06.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en;
spamdiagnosticoutput: 1:23
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: trilliantinc.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2016 14:03:49.8305 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 4f6fbd13-0dfb-4150-85c3-d43260c04309
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR06MB1764
Archived-At: <http://mailarchive.ietf.org/arch/msg/core/zw2H9VShjxUup54DLkScvyF5fhs>
Subject: Re: [core] COOL SID representation
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.17
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: Fri, 01 Apr 2016 14:04:14 -0000

Hi Peter

I like your suggestion to show delta SIDs in the CBOR diagnostic notation using the "+" sign.
This syntax is supported by the CBOR diagnostic notation and tools like http://cbor.me/

I did the modification in our working document, see:
https://core-wg.github.io/yang-cbor/draft-veillette-core-yang-cbor-mapping-latest.html#container
https://core-wg.github.io/yang-cbor/draft-veillette-core-yang-cbor-mapping-latest.html#list

For example:
{
  1708 : {                              # clock
    +2 : "2015-10-02T14:47:24Z-05:00",  # current-datetime, SID 1710
    +1 : "2015-09-15T09:12:58Z-05:00"   # boot-datetime, SID 1709
  }
}

About PUT and PATCH methods in CoOL, it's important to understand that the payload contain a list of data nodes encoded using a CBOR array.
This list implements previous sibling delta SID (instead of the parent delta SID implemented in containers and list instances).
This list is defined in the intro of section 5.3 and 5.4:
(https://core-wg.github.io/yang-cbor/draft-veillette-core-cool-latest.html#put-updating-all-data-nodes-of-a-datastore)

   The payload of the PUT request MUST carry a CBOR array containing the new content of the datastore.
   The CBOR array MUST contain a list of pairs of delta and associated value. A delta represents the
   different between the current SID and the SID of the previous pair within the CBOR array. Each
   value is encoded using the rules defined by [I-D.veillette-core-yang-cbor-mapping].

About the example you are referencing, the +15 is a previous sibling delta SID within the CBOR array. (Top level list of data node)
The value +3 for example is a parent delta SID within the CBOR map (YANG container)
I understand that this encoding is confusing for peoples but not very complex for a computer.
The alternate methods proposed to be as concise (such the Order Preserved Multi-Maps - OPMM) was a lot more complex. 

https://core-wg.github.io/yang-cbor/draft-veillette-core-cool-latest.html#put-updating-all-data-nodes-of-a-datastore

PUT /c/r Content-Format(application/cool+cbor)
[
  1727, 540,                     # timezone-utc-offset (SID 1727)
  +15, true,                     # enabled (SID 1742)
  +1, [                          # server (SID 1743)
    {
      +3 : "tic.nrc.ca",         # name (SID 1746)
      +4 : true,                 # prefer (SID 1747)
      +5 : {                     # udp (SID 1748)
        +6 : "132.246.11.231",   # address (SID 1749)
        +7 : 123                 # port (SID 1750)
      }
    },
    {
      +3 : "tac.nrc.ca",         # name (SID 1746)
      +4 : false,                # prefer (SID 1747)
      +5 : {                     # udp (SID 1748)
        +6 : "132.246.11.232"    # address (SID 1749)
      }
    }
  ] 
]

Regards,
Michel

-----Original Message-----
From: core [mailto:core-bounces@ietf.org] On Behalf Of peter van der Stok
Sent: March-30-16 8:40 AM
To: Core <core@ietf.org>
Subject: [core] COOL SID representation

Hi Michel et al,

I find the current representation of the SID rather confusing, both within the examples as the CBOR encoding.
The numeric values serving as YANG identifier are represented as differences with respect to a hierarchical higher value.
It would be more clear if the operator aspect was shown in the examples: 
e.g. +15 instead of 15.
  It is not clear to me why the operation is with respect to the parent schema node.
Could it not just be the former identifier? Efficiency considerations may then indicate a reordering of the nodes, but that is not prohibitive for the handling of the contents.

 From the above you may understand that I do not like misusing the "integer" type in CBOR to annotate Delta's.
It makes the interpretation of the CBOR types application dependent, and I don't think that is a good direction to go.
My recommendation is to develop a new CBOR element to denote the deltas.

Greetings, Peter

_______________________________________________
core mailing list
core@ietf.org
https://www.ietf.org/mailman/listinfo/core