
From nobody Wed Oct  1 12:08:20 2014
Return-Path: <yang.r.yang@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 34BB81A1A8F; Wed,  1 Oct 2014 12:08:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.277
X-Spam-Level: 
X-Spam-Status: No, score=-1.277 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 tHoJsRuU_Nt6; Wed,  1 Oct 2014 12:08:10 -0700 (PDT)
Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E6B091A8029; Wed,  1 Oct 2014 12:08:08 -0700 (PDT)
Received: by mail-wi0-f181.google.com with SMTP id hi2so1722523wib.8 for <multiple recipients>; Wed, 01 Oct 2014 12:08:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=P81s8Vncmdnf7EBbuzkuJJH7r8j/KQ7TDz71Za/nMSw=; b=yMjDgsDM6BASJZVA5JQLTSaK9jMnja9xmpmCR3qoakALwge5a/UpIqqRPUNNL0VzOA EklXAlZ+BF+mZ76HwUCoeFeAAEGS6vyyAGqgAkp+S0HjQf+XwlSUnPWRkF7OOKk5UbXU aFq7dEq2qlMyE32yMSQq4kAVzv2ca9rAoScWd2Mbjg135X6N2okkDAlPXtdGz66bKLb9 tSEpnLSlc8zUps5cWFEsKzv3Rv9BsWVeqQOv29RZxJvpHKgxwq/fKyQJRRn0EQEzvQHg YLvrsiavWdeDsjP/el8Be59zRT7APIzZ5GbRrifQK2OPmp6UOcvwuS+YmeZeqdIx91MB hw3g==
MIME-Version: 1.0
X-Received: by 10.180.79.34 with SMTP id g2mr16850712wix.10.1412190487596; Wed, 01 Oct 2014 12:08:07 -0700 (PDT)
Sender: yang.r.yang@gmail.com
Received: by 10.27.178.161 with HTTP; Wed, 1 Oct 2014 12:08:07 -0700 (PDT)
In-Reply-To: <6882466.1412133800694.JavaMail.root@mswamui-chipeau.atl.sa.earthlink.net>
References: <6882466.1412133800694.JavaMail.root@mswamui-chipeau.atl.sa.earthlink.net>
Date: Wed, 1 Oct 2014 15:08:07 -0400
X-Google-Sender-Auth: vyDGg_DNeDCoEGjvF41YBywQjvU
Message-ID: <CANUuoLqLvSQK56qxMMjNSDyVwc4D5bpy1i0xyTROfjBUiQVv2g@mail.gmail.com>
From: "Y. Richard Yang" <yry@cs.yale.edu>
To: Randy Presuhn <randy_presuhn@mindspring.com>
Content-Type: multipart/alternative; boundary=f46d041825d85e55d405046138b9
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/uPFO2meYzUM86YrBdnewGlCcNho
Cc: IETF ALTO <alto@ietf.org>, netmod@ietf.org
Subject: Re: [alto] [netmod] Key-value data structures in YANG/JSON encoding
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 01 Oct 2014 19:08:12 -0000

--f46d041825d85e55d405046138b9
Content-Type: text/plain; charset=UTF-8

On Tue, Sep 30, 2014 at 11:23 PM, Randy Presuhn <
randy_presuhn@mindspring.com> wrote:

> Hi -
>
> >From: "Y. Richard Yang" <yry@cs.yale.edu>
> >Sent: Sep 30, 2014 2:48 PM
> >To: Andy Bierman <andy@yumaworks.com>
> >Cc: IETF ALTO <alto@ietf.org>, netmod@ietf.org
> >Subject: Re: [netmod] Key-value data structures in YANG/JSON encoding
> ...
> >more general issue regarding completeness of data types in YANG:
> >
> >- list is an ordered array
> >
> >- container is a static, heterogeneous associate array
> ...
>
> Why do you say "static"?
>
>
It is my relative aspect, comparing list and container. The additional
substatements to list (key, max-, min-elements, ordered-by, and unique)
appear to me to enable more dynamic operations (the introduction of key
allows insert first, last, before, after) and provide more consistency
during and post dynamics (max-, min- check size, unique check duplicate,
resort if ordered by). As a contrast, container is more like a (static)
class definition in C++/java to provide simpler bundling. Of course, it
still supports basic edit-config operations, and hence in this sense is not
static at all.

I am curious on if there were discussions during the design on introducing
these two different types of interior nodes.

In the context of key-value store example, we need the key substatement to
indicate the key, and hence need to use list, but then need to implement
the additional APIs such as insert first/last/before/after which have no
meaning for a key value store. In other words,  the key-value store appears
to be a setting that may not need the helping-with-dynamic part.

Richard

--f46d041825d85e55d405046138b9
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">=
On Tue, Sep 30, 2014 at 11:23 PM, Randy Presuhn <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:randy_presuhn@mindspring.com" target=3D"_blank">randy_presuhn@=
mindspring.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rg=
b(204,204,204);border-left-style:solid;padding-left:1ex">Hi -<br>
<span class=3D""><br>
&gt;From: &quot;Y. Richard Yang&quot; &lt;<a href=3D"mailto:yry@cs.yale.edu=
">yry@cs.yale.edu</a>&gt;<br>
</span>&gt;Sent: Sep 30, 2014 2:48 PM<br>
&gt;To: Andy Bierman &lt;<a href=3D"mailto:andy@yumaworks.com">andy@yumawor=
ks.com</a>&gt;<br>
&gt;Cc: IETF ALTO &lt;<a href=3D"mailto:alto@ietf.org">alto@ietf.org</a>&gt=
;, <a href=3D"mailto:netmod@ietf.org">netmod@ietf.org</a><br>
&gt;Subject: Re: [netmod] Key-value data structures in YANG/JSON encoding<b=
r>
...<br>
<span class=3D"">&gt;more general issue regarding completeness of data type=
s in YANG:<br>
&gt;<br>
&gt;- list is an ordered array<br>
&gt;<br>
&gt;- container is a static, heterogeneous associate array<br>
</span>...<br>
<br>
Why do you say &quot;static&quot;?<br>
<span class=3D""><font color=3D"#888888"><br></font></span></blockquote><di=
v><br></div><div>It is my relative aspect, comparing list and container. Th=
e additional substatements to list (key, max-, min-elements, ordered-by, an=
d unique) appear to me to enable more dynamic operations (the introduction =
of key allows insert first, last, before, after) and provide more consisten=
cy during and post dynamics (max-, min- check size, unique check duplicate,=
 resort if ordered by). As a contrast, container is more like a (static) cl=
ass definition in C++/java to provide simpler bundling. Of course, it still=
 supports basic edit-config operations, and hence in this sense is not stat=
ic at all.</div><div><br></div><div>I am curious on if there were discussio=
ns during the design on introducing these two different types of interior n=
odes.=C2=A0</div><div><br></div><div>In the context of key-value store exam=
ple, we need the key substatement to indicate the key, and hence need to us=
e list, but then need to implement the additional APIs such as insert first=
/last/before/after which have no meaning for a key value store. In other wo=
rds, =C2=A0the key-value store appears to be a setting that may not need th=
e helping-with-dynamic part.</div><div><br></div><div>Richard</div></div><b=
r><br>
</div></div>

--f46d041825d85e55d405046138b9--


From nobody Wed Oct  1 12:24:07 2014
Return-Path: <yang.r.yang@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 92D161A701E; Wed,  1 Oct 2014 12:23:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.276
X-Spam-Level: 
X-Spam-Status: No, score=-1.276 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, NORMAL_HTTP_TO_IP=0.001, 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 KxehRJSse9YQ; Wed,  1 Oct 2014 12:23:51 -0700 (PDT)
Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8BA871A7005; Wed,  1 Oct 2014 12:23:50 -0700 (PDT)
Received: by mail-wi0-f171.google.com with SMTP id ho1so1713797wib.10 for <multiple recipients>; Wed, 01 Oct 2014 12:23:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=0R260bKPwJ5cGSyBD2utdymzFH0iB3TA32IHjqyuTCU=; b=TAEnrvlbc6jaAdPdveZ6V8lq/vincd+4kpZTdnbuPyKfNxRrUxbK3DCIkzjHKz6yV1 sPjrCiJSiIN60GhvchzOoBSU5IUv8YwbNvd1sJOg6bQmJ6Gz5EZ+xC5xWgKUe8zcmAhD MI05ddgBEAxmcDo5LxwK+TEkzVPQwGH34U5SFvttN1cljp5xc6SkVC521zkWzsLwdx7e aJdPUOFrqtr+5hlSvIX7TEA9nZKEmR6XOv0SvVm1pNCnH/eU43AtcigkSgf3129/B4ys fN0p9NCWdnWFjJRxX7LLpyya1mctGD51olXOwrCSb5L25MEg6mAidqkWnGhJbHq9N7D4 qTIw==
MIME-Version: 1.0
X-Received: by 10.194.110.33 with SMTP id hx1mr66274230wjb.12.1412191429095; Wed, 01 Oct 2014 12:23:49 -0700 (PDT)
Sender: yang.r.yang@gmail.com
Received: by 10.27.178.161 with HTTP; Wed, 1 Oct 2014 12:23:49 -0700 (PDT)
In-Reply-To: <20141001070809.GA37068@elstar.local>
References: <CANUuoLpNjAqPP0-rbVLf2j+ZJEGOABz7CfmkWY5gGcVMrAu-Xw@mail.gmail.com> <20141001070809.GA37068@elstar.local>
Date: Wed, 1 Oct 2014 15:23:49 -0400
X-Google-Sender-Auth: _A7r2FpZ78cOg2NKAh8gubnP3WE
Message-ID: <CANUuoLpuGHO-NhO347k_Z34OKm47KL8viZf-kdsVzEHM=r-UZg@mail.gmail.com>
From: "Y. Richard Yang" <yry@cs.yale.edu>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>,  "Y. Richard Yang" <yry@cs.yale.edu>, netmod@ietf.org, IETF ALTO <alto@ietf.org>
Content-Type: multipart/alternative; boundary=089e010d861a7c793c05046170e2
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/hX4TY6CqF88fdAd7zPzXFbrugP8
Subject: Re: [alto] [netmod] Key-value data structures in YANG/JSON encoding
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 01 Oct 2014 19:23:52 -0000

--089e010d861a7c793c05046170e2
Content-Type: text/plain; charset=UTF-8

On Wed, Oct 1, 2014 at 3:08 AM, Juergen Schoenwaelder <
j.schoenwaelder@jacobs-university.de> wrote:

> On Tue, Sep 30, 2014 at 04:31:03PM -0400, Y. Richard Yang wrote:
>
> > A particular example of using key-value map is the network-map, which is
> > defined as a key-value store to enforce that each named endpoint address
> > group has a unique name. A specific example is in Section 11.2.1.7 of RFC
> > 7285 (http://www.rfc-editor.org/rfc/rfc7285.txt):
> >
> >          "network-map" : {
> >            "PID1" : {
> >              "ipv4" : [
> >                "192.0.2.0/24",
> >                "198.51.100.0/25"
> >              ]
> >            },
> >            "PID2" : {
> >              "ipv4" : [
> >                "198.51.100.128/25"
> >              ]
> >            },
> >            "PID3" : {
> >              "ipv4" : [
> >                "0.0.0.0/0"
> >              ],
> >              "ipv6" : [
> >                "::/0"
> >              ]
> >            }
>
> Since YANG's native encoding is XML, how would you represent this in
> XML with the restriction that XML element names are defined by the
> data model and all values are in XML elements?
>

Would you consider this as a limitation of the restriction?

With the restriction, if we have the YANG data type to introduce key-value
store, for XML, the Mapping Rule may still be that of using two elements
with name and value: pid-name = (or just key as name), pid-value = (or
value). But for json and languages that support maps, the mapping does not.
Make sense?

Richard




>
> /js
>
> --
> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587         Campus Ring 1, 28759 Bremen, Germany
> Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>

--089e010d861a7c793c05046170e2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On W=
ed, Oct 1, 2014 at 3:08 AM, Juergen Schoenwaelder <span dir=3D"ltr">&lt;<a =
href=3D"mailto:j.schoenwaelder@jacobs-university.de" target=3D"_blank">j.sc=
hoenwaelder@jacobs-university.de</a>&gt;</span> wrote:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><span class=3D"">On Tue, Sep 30, 2014 at 04:31:03PM -0400, Y.=
 Richard Yang wrote:<br>
<br>
&gt; A particular example of using key-value map is the network-map, which =
is<br>
&gt; defined as a key-value store to enforce that each named endpoint addre=
ss<br>
&gt; group has a unique name. A specific example is in Section 11.2.1.7 of =
RFC<br>
&gt; 7285 (<a href=3D"http://www.rfc-editor.org/rfc/rfc7285.txt" target=3D"=
_blank">http://www.rfc-editor.org/rfc/rfc7285.txt</a>):<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;network-map&quot; : {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;PID1&quot; : {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;ipv4&quot; : [<b=
r>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;<a href=
=3D"http://192.0.2.0/24" target=3D"_blank">192.0.2.0/24</a>&quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;<a href=
=3D"http://198.51.100.0/25" target=3D"_blank">198.51.100.0/25</a>&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ]<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 },<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;PID2&quot; : {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;ipv4&quot; : [<b=
r>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;<a href=
=3D"http://198.51.100.128/25" target=3D"_blank">198.51.100.128/25</a>&quot;=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ]<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 },<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;PID3&quot; : {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;ipv4&quot; : [<b=
r>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;<a href=
=3D"http://0.0.0.0/0" target=3D"_blank">0.0.0.0/0</a>&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ],<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;ipv6&quot; : [<b=
r>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;::/0&quot=
;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ]<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
<br>
</span>Since YANG&#39;s native encoding is XML, how would you represent thi=
s in<br>
XML with the restriction that XML element names are defined by the<br>
data model and all values are in XML elements?<br></blockquote><div><br></d=
iv><div>Would you consider this as a limitation of the restriction?</div><d=
iv><br></div><div>With the restriction, if we have the YANG data type to in=
troduce key-value store, for XML, the Mapping Rule may still be that of usi=
ng two elements with name and value: pid-name =3D (or just key as name), pi=
d-value =3D (or value). But for json and languages that support maps, the m=
apping does not. Make sense?</div><div><br></div><div>Richard</div><div><br=
></div><div><br></div><div>=C2=A0<br></div><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
/js<br>
<br>
--<br>
Juergen Schoenwaelder=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Jacobs Univer=
sity Bremen gGmbH<br>
Phone: <a href=3D"tel:%2B49%20421%20200%203587" value=3D"+494212003587">+49=
 421 200 3587</a>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Campus Ring 1, 28759 Bre=
men, Germany<br>
Fax:=C2=A0 =C2=A0<a href=3D"tel:%2B49%20421%20200%203103" value=3D"+4942120=
03103">+49 421 200 3103</a>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;<a href=3D=
"http://www.jacobs-university.de/" target=3D"_blank">http://www.jacobs-univ=
ersity.de/</a>&gt;</font></span></blockquote></div>
</div></div>

--089e010d861a7c793c05046170e2--


From nobody Thu Oct  2 11:25:31 2014
Return-Path: <yang.r.yang@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3DE091A1A79; Thu,  2 Oct 2014 11:25:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.277
X-Spam-Level: 
X-Spam-Status: No, score=-1.277 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 DKS2TR1ypC_R; Thu,  2 Oct 2014 11:25:26 -0700 (PDT)
Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6E7DE1A1A81; Thu,  2 Oct 2014 11:25:26 -0700 (PDT)
Received: by mail-wg0-f49.google.com with SMTP id x12so4000275wgg.32 for <multiple recipients>; Thu, 02 Oct 2014 11:25:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=p4VIBTdtM5GJecanyhJnzFPhR2xLdY5a6JJAwTjvljQ=; b=NPnrfMe0Dr65frDvugqfnHr3bJtFQm1zdoskbLMAtnB4H6yPkS4u1F2wthXxKVK+75 mI3rEqDMeHHqWjXB+mlvsGUB4M9elrLNp261QP4VtszSVHRtAmHcpXchEJn45KnI91k4 Gmc1SL64AZt45bPK1UZuhvDFxUGtWNs4o9OHaq+sqa3WwOhmjQCohxtb/0Mq15yJwP34 KOmRY5h9X0/IDagPBe8Ishf/RD4jXEVx+WC57Cboeb3eXIbmKzgPCpNsefPqwtDepCpC okynnhXHsrXZtPQEaUeYel24MKNFQE6RqoggnNGqYWlLrPKcOA58Pas35entHXi5vXax PFag==
MIME-Version: 1.0
X-Received: by 10.180.198.10 with SMTP id iy10mr6384070wic.10.1412274324836; Thu, 02 Oct 2014 11:25:24 -0700 (PDT)
Sender: yang.r.yang@gmail.com
Received: by 10.27.178.161 with HTTP; Thu, 2 Oct 2014 11:25:24 -0700 (PDT)
In-Reply-To: <20141002071522.GA40160@elstar.local>
References: <CANUuoLpNjAqPP0-rbVLf2j+ZJEGOABz7CfmkWY5gGcVMrAu-Xw@mail.gmail.com> <20141001070809.GA37068@elstar.local> <CANUuoLpuGHO-NhO347k_Z34OKm47KL8viZf-kdsVzEHM=r-UZg@mail.gmail.com> <20141002071522.GA40160@elstar.local>
Date: Thu, 2 Oct 2014 14:25:24 -0400
X-Google-Sender-Auth: lu5RkfMUQHBjBfODLdvzt8I15xA
Message-ID: <CANUuoLrK_Qtu4Xdsa6_1VpRuSRpMaWiWP0qA-F0WmdEDSTcLLA@mail.gmail.com>
From: "Y. Richard Yang" <yry@cs.yale.edu>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>,  "Y. Richard Yang" <yry@cs.yale.edu>, netmod@ietf.org, IETF ALTO <alto@ietf.org>
Content-Type: multipart/alternative; boundary=047d7b6226d075188c050474bda7
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/9D8LjvvkDoaRi4dIQLx_H_zWpfE
Subject: Re: [alto] [netmod] Key-value data structures in YANG/JSON encoding
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 02 Oct 2014 18:25:28 -0000

--047d7b6226d075188c050474bda7
Content-Type: text/plain; charset=UTF-8

Hi Juergen,

On Thu, Oct 2, 2014 at 3:15 AM, Juergen Schoenwaelder <
j.schoenwaelder@jacobs-university.de> wrote:

>
>
> I am saying that YANG was designed to model data carried by NETCONF
> (check the title of RFC 6020) and NETCONF uses XML as its data
> encoding with a set of restrictions that were found useful to simplify
> things (all data in XML elements, no mixed content, ...). Several
> details of the YANG language are related to XML (e.g., much of the
> type system, the usage of xpath in must/when expressions, instance
> identifier as a subset of xpath, ...).
>
>
Yes. The binding of YANG as a data description language to XML is clear.


> Alternate _encodings_ are proposed (such as JSON) but the question
> raised here seems to be whether we want to start an effort to turn
> YANG into a schema language for JSON (which it is not today and this
> is by design and not by accident).
>
>
Good comment. My personal opinion, JSON is widely used enough to justify
this effort.

Richard



> /js
>
> --
> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587         Campus Ring 1, 28759 Bremen, Germany
> Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>
>

--047d7b6226d075188c050474bda7
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Juergen,<br><div class=3D"gmail_extra"><br><div class=
=3D"gmail_quote">On Thu, Oct 2, 2014 at 3:15 AM, Juergen Schoenwaelder <spa=
n dir=3D"ltr">&lt;<a href=3D"mailto:j.schoenwaelder@jacobs-university.de" t=
arget=3D"_blank">j.schoenwaelder@jacobs-university.de</a>&gt;</span> wrote:=
<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-lef=
t:1px #ccc solid;padding-left:1ex"><div class=3D"HOEnZb"><div class=3D"h5">=
<br>
<br>
</div></div>I am saying that YANG was designed to model data carried by NET=
CONF<br>
(check the title of RFC 6020) and NETCONF uses XML as its data<br>
encoding with a set of restrictions that were found useful to simplify<br>
things (all data in XML elements, no mixed content, ...). Several<br>
details of the YANG language are related to XML (e.g., much of the<br>
type system, the usage of xpath in must/when expressions, instance<br>
identifier as a subset of xpath, ...).<br>
<br></blockquote><div><br></div><div>Yes. The binding of YANG as a data des=
cription language to XML is clear.=C2=A0</div><div>=C2=A0</div><blockquote =
class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid=
;padding-left:1ex">
Alternate _encodings_ are proposed (such as JSON) but the question<br>
raised here seems to be whether we want to start an effort to turn<br>
YANG into a schema language for JSON (which it is not today and this<br>
is by design and not by accident).<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br></div></div></blockquote><div><=
br></div><div>Good comment. My personal opinion, JSON is widely used enough=
 to justify this effort.=C2=A0</div><div><br></div><div>Richard</div><div><=
br></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin=
:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=3D"HOEn=
Zb"><div class=3D"h5">
/js<br>
<br>
--<br>
Juergen Schoenwaelder=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Jacobs Univer=
sity Bremen gGmbH<br>
Phone: <a href=3D"tel:%2B49%20421%20200%203587" value=3D"+494212003587">+49=
 421 200 3587</a>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Campus Ring 1, 28759 Bre=
men, Germany<br>
Fax:=C2=A0 =C2=A0<a href=3D"tel:%2B49%20421%20200%203103" value=3D"+4942120=
03103">+49 421 200 3103</a>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;<a href=3D=
"http://www.jacobs-university.de/" target=3D"_blank">http://www.jacobs-univ=
ersity.de/</a>&gt;</div></div></blockquote></div>
</div></div>

--047d7b6226d075188c050474bda7--


From nobody Fri Oct  3 08:05:58 2014
Return-Path: <tnadeau@lucidvision.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A013A1A8A45; Tue, 30 Sep 2014 13:55:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.686
X-Spam-Level: 
X-Spam-Status: No, score=-2.686 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, NORMAL_HTTP_TO_IP=0.001, RP_MATCHES_RCVD=-0.786, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 3al0pbq4adDS; Tue, 30 Sep 2014 13:55:28 -0700 (PDT)
Received: from lucidvision.com (lucidvision.com [72.71.250.34]) by ietfa.amsl.com (Postfix) with ESMTP id A2B961A8A42; Tue, 30 Sep 2014 13:55:27 -0700 (PDT)
Received: from [10.110.1.6] (static-72-71-250-37.cncdnh.fast04.myfairpoint.net [72.71.250.37]) by lucidvision.com (Postfix) with ESMTP id 28B7228A95B5; Tue, 30 Sep 2014 16:55:24 -0400 (EDT)
Content-Type: multipart/signed; boundary="Apple-Mail=_4BCEF824-88AF-4D39-8954-C0D157E7DC72"; protocol="application/pgp-signature"; micalg=pgp-sha512
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
From: "Thomas D. Nadeau" <tnadeau@lucidvision.com>
In-Reply-To: <CANUuoLpNjAqPP0-rbVLf2j+ZJEGOABz7CfmkWY5gGcVMrAu-Xw@mail.gmail.com>
Date: Tue, 30 Sep 2014 13:55:20 -0700
Message-Id: <1FBF3FB2-BB27-4940-BE99-2F9B75D6563A@lucidvision.com>
References: <CANUuoLpNjAqPP0-rbVLf2j+ZJEGOABz7CfmkWY5gGcVMrAu-Xw@mail.gmail.com>
To: "Y. Richard Yang" <yry@cs.yale.edu>
X-Mailer: Apple Mail (2.1878.6)
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/5Va5y8GfzgjJtF5Enx5mXRreATM
X-Mailman-Approved-At: Fri, 03 Oct 2014 08:05:53 -0700
Cc: IETF ALTO <alto@ietf.org>, NETMOD Working Group <netmod@ietf.org>
Subject: Re: [alto] [netmod] Key-value data structures in YANG/JSON encoding
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 30 Sep 2014 20:55:29 -0000

--Apple-Mail=_4BCEF824-88AF-4D39-8954-C0D157E7DC72
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_5726FC3E-0930-4202-949C-4B20402B4B80"


--Apple-Mail=_5726FC3E-0930-4202-949C-4B20402B4B80
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

=09
	I was discussing this very same issue here at the ODL Yangathon =
yesterday.  Others are stumbling onto this same issue.

	--Tom


> Hi all,
>=20
> A few of us are doing an exercise of defining a YANG module to express =
the ALTO protocol (RFC7285). Multiple problems come up and here is one =
problem we encounter.=20
>=20
> First, the context. A design decision of the ALTO protocol is to use =
key-value stores (maps), which are different from lists or containers. =
Many large-scale systems are designed based on key-value stores, and =
many programming frameworks provide hash maps.
>=20
> A particular example of using key-value map is the network-map, which =
is defined as a key-value store to enforce that each named endpoint =
address group has a unique name. A specific example is in Section =
11.2.1.7 of RFC 7285 (http://www.rfc-editor.org/rfc/rfc7285.txt):
>=20
>          "network-map" : {
>            "PID1" : {
>              "ipv4" : [
>                "192.0.2.0/24",
>                "198.51.100.0/25"
>              ]
>            },
>            "PID2" : {
>              "ipv4" : [
>                "198.51.100.128/25"
>              ]
>            },
>            "PID3" : {
>              "ipv4" : [
>                "0.0.0.0/0"
>              ],
>              "ipv6" : [
>                "::/0"
>              ]
>            }
>=20
> One way to express this in YANG is the following:
> =3D=3D=3Dexample YANG=3D=3D=3D
> list network-map {
>   key "pid";
>   leaf pid {
>     type string;
>   }
>   leaf endpoint-address-group ... {
>     // ...
>   }
> }
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> Following the currently defined json encoding, the output will be:
> {
>   "network-map" : [
>     {
>       "pid" : "PID1",
>        // ...
>     },
>     {
>       "pid" : "PID2",
>       // ...
>     },
>     {
>       "pid" : "PID3",
>       // ...
>     }
>   ]
> }=20
>=20
> But this not what we want, because it is using an array, not a map. =
One does not have to use an array to store the map.
>=20
> We see two possibilities, if to produce the output. One is in the =
encoding process: define such outputs on matching a template:
>=20
> list MyList {
>   key x;
>   leaf x {
>     type string;
>   }
>   leaf y {=20
>    ...
>   }
> }
>=20
> The second is that maybe this should be resolved in YANG; i.e., =
introducing a new data type (beyond list, container), but something like =
key-value store, say named map:
>=20
> map MyMap {
>   key my-key {
>     ...
>   };
>   value my-value {
>   }
> }
>=20
> Note that the second mapping involves work if the key type is not a =
simple type (say string or numbers). A typical approach in some software =
framework is to define a hash function on key.=20
>=20
> We have discussed the issue with Lada, and now take the issue to the =
mailing list. If anyone else has encountered similar problems, please =
let us know. We also want to get a sense of any interest in introducing =
the data type in YANG. Any comments will be appreciated.
>=20
> Thanks!
>=20
> Richard
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod


--Apple-Mail=_5726FC3E-0930-4202-949C-4B20402B4B80
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span><br><div><div><span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span>I was discussing this very same =
issue here at the ODL Yangathon yesterday. &nbsp;Others are stumbling =
onto this same issue.</div><div><br></div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>--Tom</div><div><br></div><br =
class=3D"Apple-interchange-newline"><blockquote type=3D"cite"><div =
dir=3D"ltr">Hi all,<div><br></div><div>A few of us are doing an exercise =
of defining a YANG module to express the ALTO protocol (RFC7285). =
Multiple problems come up and here is one problem we =
encounter.&nbsp;</div><div><br></div><div><span =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">First,=
 the context. A design decision of the ALTO protocol is to use key-value =
stores (maps), which are different from lists or containers. Many =
large-scale systems are designed based on key-value stores, and many =
programming frameworks provide hash maps.</span><br></div><div><span =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><br></=
span></div><div><span =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">A =
particular example of using key-value map is the network-map, which is =
defined as a key-value store to enforce that each named endpoint address =
group has a unique name. A specific example is&nbsp;</span><font =
face=3D"arial, sans-serif">in Section 11.2.1.7 of RFC 7285 (<a =
href=3D"http://www.rfc-editor.org/rfc/rfc7285.txt">http://www.rfc-editor.o=
rg/rfc/rfc7285.txt</a>):</font></div><div><font face=3D"arial, =
sans-serif"><br></font></div><div><font face=3D"arial, =
sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"network-map" : =
{</font></div><div><font face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp;"PID1" : {</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"ipv4" : =
[</font></div><div><font face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"<a =
href=3D"http://192.0.2.0/24">192.0.2.0/24</a>",</font></div><div><font =
face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;"<a =
href=3D"http://198.51.100.0/25">198.51.100.0/25</a>"</font></div><div><fon=
t face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;]</font></div><div><font face=3D"arial, sans-serif">&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;},</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"PID2" : =
{</font></div><div><font face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;"ipv4" : [</font></div><div><font =
face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;"<a =
href=3D"http://198.51.100.128/25">198.51.100.128/25</a>"</font></div><div>=
<font face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;]</font></div><div><font face=3D"arial, sans-serif">&nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},</font></div><div><font face=3D"arial,=
 sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"PID3" : =
{</font></div><div><font face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;"ipv4" : [</font></div><div><font =
face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;"<a =
href=3D"http://0.0.0.0/0">0.0.0.0/0</a>"</font></div><div><font =
face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;],</font></div><div><font face=3D"arial, sans-serif">&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"ipv6" : [</font></div><div><font =
face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;"::/0"</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;]</font></div><div><font face=3D"arial, sans-serif">&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;}</font></div><div><br></div><div>One way to =
express this in YANG is the following:</div><div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">=3D=3D=
=3Dexample YANG=3D=3D=3D</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">list =
network-map {</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 key "pid";</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 leaf pid {</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; type string;</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 }</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 leaf endpoint-address-group ... {</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; // ...</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 }</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">}</div=
><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</div></div><div><br></div=
><div>Following the currently defined json encoding, the output will =
be:</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">{</div=
><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 "network-map" : [</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; {</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; &nbsp; "pid" : "PID1",</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; &nbsp; &nbsp;// ...</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; },</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; {</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; &nbsp; "pid" : "PID2",</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; &nbsp; // ...</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; },</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; {</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; &nbsp; "pid" : "PID3",</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; &nbsp; // ...</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; }</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 ]</div><div><span =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">}</spa=
n>&nbsp;</div><div><br></div><div>But this not what we want, because it =
is using an array, not a map. One does not have to use an array to store =
the map.</div><div><br></div><div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><span =
style=3D"font-size:12.8000001907349px">We see two possibilities, if to =
produce the output. One is in the encoding process:</span><span =
style=3D"font-size:12.8000001907349px">&nbsp;define such outputs on =
matching a template:</span></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><div><=
font face=3D"arial, sans-serif"><br></font></div><div><font face=3D"arial,=
 sans-serif">list MyList {</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; key x;</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; leaf x {</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; &nbsp; type string;</font></div><div><font =
face=3D"arial, sans-serif">&nbsp; }</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; leaf y {&nbsp;</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; &nbsp;...</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; }</font></div><div><font face=3D"arial, =
sans-serif">}</font></div></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><br></=
div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">The second is that maybe this should be =
resolved in YANG; i.e., introducing a new data type (beyond list, =
container), but something like key-value store, say named =
map:</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif"><br></font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">map MyMap {</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">&nbsp; key my-key {</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">&nbsp; &nbsp; ...</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">&nbsp; };</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">&nbsp; value my-value {</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">&nbsp; }</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">}</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif"><br></font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">Note that the second mapping involves work if =
the key type is not a simple type (say string or numbers). A typical =
approach in some software framework is to define a hash function on =
key.&nbsp;</font></div></div><div><br></div><div>We have discussed the =
issue with Lada, and now take the issue to the mailing list. If anyone =
else has encountered similar problems, please let us know. We also want =
to get a sense of any interest in introducing the data type in YANG. Any =
comments will be =
appreciated.</div><div><br></div><div>Thanks!</div><div><br></div><div>Ric=
hard</div><div>
</div></div>
_______________________________________________<br>netmod mailing =
list<br><a =
href=3D"mailto:netmod@ietf.org">netmod@ietf.org</a><br>https://www.ietf.or=
g/mailman/listinfo/netmod<br></blockquote></div><br></body></html>=

--Apple-Mail=_5726FC3E-0930-4202-949C-4B20402B4B80--

--Apple-Mail=_4BCEF824-88AF-4D39-8954-C0D157E7DC72
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJUKxi4AAoJEPcO+I7eiUJZE2QQAJlMBHSAUUvN8Pt+i3floNmt
2EBiArpQIgpCZkDL1asTb6SMXQ//x6+4HU1zIMM4/P24WbfohWGJEsf+lS4eQuuZ
SEO21y8OqHMBOuA/bkM4nnE1gz73nR2HeHxsuEFGmcYzLqkjObaBJV5AmvMredI8
v6EgBWpdwwDbVEzbSU/qqFBEYl64m56VKgeizFUUXZHGqag+/61Hom5nHfNcnWmZ
5N8AD+g04eFnQCCL3L1yY/4SaQVrlK8Hwk1R+U3h7ovr7hr3ZU0jCU7ceKkamwBf
XH4+nB7FJuz8LHjO5a6sXtu0JdmZNqevpMxe6mVwLfuFiD7cMnww+DQ/SdppjODn
i6n6E8AOxenTWPTxu4vX6jHqQVASG2EVHCXsCfJ88mpyS3Laew8XPHjpSb9iwGX5
yLDq+7gQthMDG9xB+exLGWJKJGYPEWHnw9xfJbHL2IkwdrlJQsFnWMKM9fyz3d0A
knLH7CtEJg3KjcTKWvUJxsFb2ZQF/v8wzFGIAHiwCXr/WeqqgBUW7lvS4+l+EARZ
2A7zVbesR+IVcAYSt16YzZBA7HyTqn+25AHKh2oMmSPG7xwUU/s8l6QNYSAmsDMy
XybqZdS9/pfI/NfLgS87jBGjHW6bFdADFAKDmeCEa5ypXmWpa99XHVif6Pbp1DN9
+VjD8abWWNKlIfrUy0Z0
=AQHE
-----END PGP SIGNATURE-----

--Apple-Mail=_4BCEF824-88AF-4D39-8954-C0D157E7DC72--


From nobody Fri Oct  3 08:06:03 2014
Return-Path: <andy@yumaworks.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 649A41A9149 for <alto@ietfa.amsl.com>; Tue, 30 Sep 2014 14:16:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level: 
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, NORMAL_HTTP_TO_IP=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham
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 vVBheQAYgY2F for <alto@ietfa.amsl.com>; Tue, 30 Sep 2014 14:16:55 -0700 (PDT)
Received: from mail-qa0-f48.google.com (mail-qa0-f48.google.com [209.85.216.48]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7EB941A911B for <alto@ietf.org>; Tue, 30 Sep 2014 14:16:55 -0700 (PDT)
Received: by mail-qa0-f48.google.com with SMTP id f12so3414788qad.35 for <alto@ietf.org>; Tue, 30 Sep 2014 14:16:54 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=3f4vqoZ5MlpQEENg4mLp7a3pKi4fzRnawQ7GFGu2Fus=; b=LzhDdcO+nrI2wSzxu+9Qm4mST5BkAOZxf8sbsGC+rsVLawUSn+35ppEE/H9sMA1S+w Bn5WGYg12Ddgu2ork7X334zQ7i5LLZKUfouqcc2bd6ntBSRFrQNmM1Ld1BBTEQYtuLRZ l47eSeeA860QwAzjkgh601aIF3HuDEboBiBDRPaoLmMD3M5Tf/ExlUizC+cpD7ssr0kV dS6RC2/vWc7rM23m+zpfPlNxgv3V1wm3FKssz1oWskt9ZJ8v93PgMc3WM8dGOSkoYroO oHv9M0aZWEXbXcbBm24241wXKoVq0dP9i8W1yD22g/nqM/AtQJ133fn1qovFfbNt/9sA 7CYA==
X-Gm-Message-State: ALoCoQl0yyZe7JUF1OgRKtxgEvsihFQoVS4y6C1sG1SbeB0kN1puzoXB4vARLQsvUf1tBO/etUmL
MIME-Version: 1.0
X-Received: by 10.224.28.68 with SMTP id l4mr64328066qac.16.1412111814610; Tue, 30 Sep 2014 14:16:54 -0700 (PDT)
Received: by 10.140.37.52 with HTTP; Tue, 30 Sep 2014 14:16:54 -0700 (PDT)
In-Reply-To: <1FBF3FB2-BB27-4940-BE99-2F9B75D6563A@lucidvision.com>
References: <CANUuoLpNjAqPP0-rbVLf2j+ZJEGOABz7CfmkWY5gGcVMrAu-Xw@mail.gmail.com> <1FBF3FB2-BB27-4940-BE99-2F9B75D6563A@lucidvision.com>
Date: Tue, 30 Sep 2014 14:16:54 -0700
Message-ID: <CABCOCHRLSXzev4x0_G8-XeunrJkzXXZqaD12fyBXhVfd6J-SjQ@mail.gmail.com>
From: Andy Bierman <andy@yumaworks.com>
To: "Thomas D. Nadeau" <tnadeau@lucidvision.com>
Content-Type: multipart/alternative; boundary=001a11c2c3ce18270705044ee7cd
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/W99IrtZegkZcn3wG7obyd4NIyVI
X-Mailman-Approved-At: Fri, 03 Oct 2014 08:05:54 -0700
Cc: IETF ALTO <alto@ietf.org>, NETMOD Working Group <netmod@ietf.org>
Subject: Re: [alto] [netmod] Key-value data structures in YANG/JSON encoding
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 30 Sep 2014 21:16:59 -0000

--001a11c2c3ce18270705044ee7cd
Content-Type: text/plain; charset=ISO-8859-1

Hi,


On Tue, Sep 30, 2014 at 1:55 PM, Thomas D. Nadeau <tnadeau@lucidvision.com>
wrote:

>
> I was discussing this very same issue here at the ODL Yangathon
> yesterday.  Others are stumbling onto this same issue.
>
>
Do you mean you want control over the YANG to JSON mapping?
IMO, YANG needs to be independent of the protocol message encoding.
The implementation burden on servers is already too high.
There should only be 1 mapping for each encoding format.

How would you change YANG to get this JSON encoding?



--Tom
>
>
>
Andy


> Hi all,
>
> A few of us are doing an exercise of defining a YANG module to express the
> ALTO protocol (RFC7285). Multiple problems come up and here is one problem
> we encounter.
>
> First, the context. A design decision of the ALTO protocol is to use
> key-value stores (maps), which are different from lists or containers. Many
> large-scale systems are designed based on key-value stores, and many
> programming frameworks provide hash maps.
>
> A particular example of using key-value map is the network-map, which is
> defined as a key-value store to enforce that each named endpoint address
> group has a unique name. A specific example is in Section 11.2.1.7 of RFC
> 7285 (http://www.rfc-editor.org/rfc/rfc7285.txt):
>
>          "network-map" : {
>            "PID1" : {
>              "ipv4" : [
>                "192.0.2.0/24",
>                "198.51.100.0/25"
>              ]
>            },
>            "PID2" : {
>              "ipv4" : [
>                "198.51.100.128/25"
>              ]
>            },
>            "PID3" : {
>              "ipv4" : [
>                "0.0.0.0/0"
>              ],
>              "ipv6" : [
>                "::/0"
>              ]
>            }
>
> One way to express this in YANG is the following:
> ===example YANG===
> list network-map {
>   key "pid";
>   leaf pid {
>     type string;
>   }
>   leaf endpoint-address-group ... {
>     // ...
>   }
> }
> ==================
>
> Following the currently defined json encoding, the output will be:
> {
>   "network-map" : [
>     {
>       "pid" : "PID1",
>        // ...
>     },
>     {
>       "pid" : "PID2",
>       // ...
>     },
>     {
>       "pid" : "PID3",
>       // ...
>     }
>   ]
> }
>
> But this not what we want, because it is using an array, not a map. One
> does not have to use an array to store the map.
>
> We see two possibilities, if to produce the output. One is in the encoding
> process: define such outputs on matching a template:
>
> list MyList {
>   key x;
>   leaf x {
>     type string;
>   }
>   leaf y {
>    ...
>   }
> }
>
> The second is that maybe this should be resolved in YANG; i.e.,
> introducing a new data type (beyond list, container), but something like
> key-value store, say named map:
>
> map MyMap {
>   key my-key {
>     ...
>   };
>   value my-value {
>   }
> }
>
> Note that the second mapping involves work if the key type is not a simple
> type (say string or numbers). A typical approach in some software framework
> is to define a hash function on key.
>
> We have discussed the issue with Lada, and now take the issue to the
> mailing list. If anyone else has encountered similar problems, please let
> us know. We also want to get a sense of any interest in introducing the
> data type in YANG. Any comments will be appreciated.
>
> Thanks!
>
> Richard
>  _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>
>
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>
>

--001a11c2c3ce18270705044ee7cd
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<div><br><div class=3D"gmail_extra"><br><div class=3D"g=
mail_quote">On Tue, Sep 30, 2014 at 1:55 PM, Thomas D. Nadeau <span dir=3D"=
ltr">&lt;<a href=3D"mailto:tnadeau@lucidvision.com" target=3D"_blank">tnade=
au@lucidvision.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">=
<div style=3D"word-wrap:break-word"><span style=3D"white-space:pre-wrap">	<=
/span><br><div><div><span style=3D"white-space:pre-wrap">	</span>I was disc=
ussing this very same issue here at the ODL Yangathon yesterday.=A0 Others =
are stumbling onto this same issue.</div><div><br></div></div></div></block=
quote><div><br></div><div>Do you mean you want control over the YANG to JSO=
N mapping?</div><div>IMO, YANG needs to be independent of the protocol mess=
age encoding.</div><div>The implementation burden on servers is already too=
 high.</div><div>There should only be 1 mapping for each encoding format.</=
div><div><br></div><div>How would you change YANG to get this JSON encoding=
?</div><div><br></div><div><br></div><div><br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-le=
ft:1ex"><div style=3D"word-wrap:break-word"><div><div></div><div><span styl=
e=3D"white-space:pre-wrap">	</span>--Tom</div><div><br></div><br></div></di=
v></blockquote><div><br></div><div>Andy</div><div>=A0</div><blockquote clas=
s=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pad=
ding-left:1ex"><div style=3D"word-wrap:break-word"><div><blockquote type=3D=
"cite"><div dir=3D"ltr">Hi all,<div><br></div><div>A few of us are doing an=
 exercise of defining a YANG module to express the ALTO protocol (RFC7285).=
 Multiple problems come up and here is one problem we encounter.=A0</div><d=
iv><br></div><div><span style=3D"font-family:arial,sans-serif;font-size:12.=
8000001907349px">First, the context. A design decision of the ALTO protocol=
 is to use key-value stores (maps), which are different from lists or conta=
iners. Many large-scale systems are designed based on key-value stores, and=
 many programming frameworks provide hash maps.</span><br></div><div><span =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><br></s=
pan></div><div><span style=3D"font-family:arial,sans-serif;font-size:12.800=
0001907349px">A particular example of using key-value map is the network-ma=
p, which is defined as a key-value store to enforce that each named endpoin=
t address group has a unique name. A specific example is=A0</span><font fac=
e=3D"arial, sans-serif">in Section 11.2.1.7 of RFC 7285 (<a href=3D"http://=
www.rfc-editor.org/rfc/rfc7285.txt" target=3D"_blank">http://www.rfc-editor=
.org/rfc/rfc7285.txt</a>):</font></div><div><font face=3D"arial, sans-serif=
"><br></font></div><div><font face=3D"arial, sans-serif">=A0 =A0 =A0 =A0 =
=A0&quot;network-map&quot; : {</font></div><div><font face=3D"arial, sans-s=
erif">=A0 =A0 =A0 =A0 =A0 =A0&quot;PID1&quot; : {</font></div><div><font fa=
ce=3D"arial, sans-serif">=A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;ipv4&quot; : [</f=
ont></div><div><font face=3D"arial, sans-serif">=A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0&quot;<a href=3D"http://192.0.2.0/24" target=3D"_blank">192.0.2.0/24</a=
>&quot;,</font></div><div><font face=3D"arial, sans-serif">=A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0&quot;<a href=3D"http://198.51.100.0/25" target=3D"_blank">1=
98.51.100.0/25</a>&quot;</font></div><div><font face=3D"arial, sans-serif">=
=A0 =A0 =A0 =A0 =A0 =A0 =A0]</font></div><div><font face=3D"arial, sans-ser=
if">=A0 =A0 =A0 =A0 =A0 =A0},</font></div><div><font face=3D"arial, sans-se=
rif">=A0 =A0 =A0 =A0 =A0 =A0&quot;PID2&quot; : {</font></div><div><font fac=
e=3D"arial, sans-serif">=A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;ipv4&quot; : [</fo=
nt></div><div><font face=3D"arial, sans-serif">=A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0&quot;<a href=3D"http://198.51.100.128/25" target=3D"_blank">198.51.100.=
128/25</a>&quot;</font></div><div><font face=3D"arial, sans-serif">=A0 =A0 =
=A0 =A0 =A0 =A0 =A0]</font></div><div><font face=3D"arial, sans-serif">=A0 =
=A0 =A0 =A0 =A0 =A0},</font></div><div><font face=3D"arial, sans-serif">=A0=
 =A0 =A0 =A0 =A0 =A0&quot;PID3&quot; : {</font></div><div><font face=3D"ari=
al, sans-serif">=A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;ipv4&quot; : [</font></div=
><div><font face=3D"arial, sans-serif">=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot=
;<a href=3D"http://0.0.0.0/0" target=3D"_blank">0.0.0.0/0</a>&quot;</font><=
/div><div><font face=3D"arial, sans-serif">=A0 =A0 =A0 =A0 =A0 =A0 =A0],</f=
ont></div><div><font face=3D"arial, sans-serif">=A0 =A0 =A0 =A0 =A0 =A0 =A0=
&quot;ipv6&quot; : [</font></div><div><font face=3D"arial, sans-serif">=A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;::/0&quot;</font></div><div><font face=3D"=
arial, sans-serif">=A0 =A0 =A0 =A0 =A0 =A0 =A0]</font></div><div><font face=
=3D"arial, sans-serif">=A0 =A0 =A0 =A0 =A0 =A0}</font></div><div><br></div>=
<div>One way to express this in YANG is the following:</div><div><div style=
=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">=3D=3D=3Dexa=
mple YANG=3D=3D=3D</div><div style=3D"font-family:arial,sans-serif;font-siz=
e:12.8000001907349px">list network-map {</div><div style=3D"font-family:ari=
al,sans-serif;font-size:12.8000001907349px">=A0 key &quot;pid&quot;;</div><=
div style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">=A0=
 leaf pid {</div><div style=3D"font-family:arial,sans-serif;font-size:12.80=
00001907349px">=A0 =A0 type string;</div><div style=3D"font-family:arial,sa=
ns-serif;font-size:12.8000001907349px">=A0 }</div><div style=3D"font-family=
:arial,sans-serif;font-size:12.8000001907349px">=A0 leaf endpoint-address-g=
roup ... {</div><div style=3D"font-family:arial,sans-serif;font-size:12.800=
0001907349px">=A0 =A0 // ...</div><div style=3D"font-family:arial,sans-seri=
f;font-size:12.8000001907349px">=A0 }</div><div style=3D"font-family:arial,=
sans-serif;font-size:12.8000001907349px">}</div><div style=3D"font-family:a=
rial,sans-serif;font-size:12.8000001907349px">=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D</div></div><div><br></div><div>Following the cu=
rrently defined json encoding, the output will be:</div><div style=3D"font-=
family:arial,sans-serif;font-size:12.8000001907349px">{</div><div style=3D"=
font-family:arial,sans-serif;font-size:12.8000001907349px">=A0 &quot;networ=
k-map&quot; : [</div><div style=3D"font-family:arial,sans-serif;font-size:1=
2.8000001907349px">=A0 =A0 {</div><div style=3D"font-family:arial,sans-seri=
f;font-size:12.8000001907349px">=A0 =A0 =A0 &quot;pid&quot; : &quot;PID1&qu=
ot;,</div><div style=3D"font-family:arial,sans-serif;font-size:12.800000190=
7349px">=A0 =A0 =A0 =A0// ...</div><div style=3D"font-family:arial,sans-ser=
if;font-size:12.8000001907349px">=A0 =A0 },</div><div style=3D"font-family:=
arial,sans-serif;font-size:12.8000001907349px">=A0 =A0 {</div><div style=3D=
"font-family:arial,sans-serif;font-size:12.8000001907349px">=A0 =A0 =A0 &qu=
ot;pid&quot; : &quot;PID2&quot;,</div><div style=3D"font-family:arial,sans-=
serif;font-size:12.8000001907349px">=A0 =A0 =A0 // ...</div><div style=3D"f=
ont-family:arial,sans-serif;font-size:12.8000001907349px">=A0 =A0 },</div><=
div style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">=A0=
 =A0 {</div><div style=3D"font-family:arial,sans-serif;font-size:12.8000001=
907349px">=A0 =A0 =A0 &quot;pid&quot; : &quot;PID3&quot;,</div><div style=
=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">=A0 =A0 =A0 =
// ...</div><div style=3D"font-family:arial,sans-serif;font-size:12.8000001=
907349px">=A0 =A0 }</div><div style=3D"font-family:arial,sans-serif;font-si=
ze:12.8000001907349px">=A0 ]</div><div><span style=3D"font-family:arial,san=
s-serif;font-size:12.8000001907349px">}</span>=A0</div><div><br></div><div>=
But this not what we want, because it is using an array, not a map. One doe=
s not have to use an array to store the map.</div><div><br></div><div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><span s=
tyle=3D"font-size:12.8000001907349px">We see two possibilities, if to produ=
ce the output. One is in the encoding process:</span><span style=3D"font-si=
ze:12.8000001907349px">=A0define such outputs on matching a template:</span=
></div><div style=3D"font-family:arial,sans-serif;font-size:12.800000190734=
9px"><div><font face=3D"arial, sans-serif"><br></font></div><div><font face=
=3D"arial, sans-serif">list MyList {</font></div><div><font face=3D"arial, =
sans-serif">=A0 key x;</font></div><div><font face=3D"arial, sans-serif">=
=A0 leaf x {</font></div><div><font face=3D"arial, sans-serif">=A0 =A0 type=
 string;</font></div><div><font face=3D"arial, sans-serif">=A0 }</font></di=
v><div><font face=3D"arial, sans-serif">=A0 leaf y {=A0</font></div><div><f=
ont face=3D"arial, sans-serif">=A0 =A0...</font></div><div><font face=3D"ar=
ial, sans-serif">=A0 }</font></div><div><font face=3D"arial, sans-serif">}<=
/font></div></div><div style=3D"font-family:arial,sans-serif;font-size:12.8=
000001907349px"><br></div><div style=3D"font-family:arial,sans-serif;font-s=
ize:12.8000001907349px"><font face=3D"arial, sans-serif">The second is that=
 maybe this should be resolved in YANG; i.e., introducing a new data type (=
beyond list, container), but something like key-value store, say named map:=
</font></div><div style=3D"font-family:arial,sans-serif;font-size:12.800000=
1907349px"><font face=3D"arial, sans-serif"><br></font></div><div style=3D"=
font-family:arial,sans-serif;font-size:12.8000001907349px"><font face=3D"ar=
ial, sans-serif">map MyMap {</font></div><div style=3D"font-family:arial,sa=
ns-serif;font-size:12.8000001907349px"><font face=3D"arial, sans-serif">=A0=
 key my-key {</font></div><div style=3D"font-family:arial,sans-serif;font-s=
ize:12.8000001907349px"><font face=3D"arial, sans-serif">=A0 =A0 ...</font>=
</div><div style=3D"font-family:arial,sans-serif;font-size:12.8000001907349=
px"><font face=3D"arial, sans-serif">=A0 };</font></div><div style=3D"font-=
family:arial,sans-serif;font-size:12.8000001907349px"><font face=3D"arial, =
sans-serif">=A0 value my-value {</font></div><div style=3D"font-family:aria=
l,sans-serif;font-size:12.8000001907349px"><font face=3D"arial, sans-serif"=
>=A0 }</font></div><div style=3D"font-family:arial,sans-serif;font-size:12.=
8000001907349px"><font face=3D"arial, sans-serif">}</font></div><div style=
=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font face=
=3D"arial, sans-serif"><br></font></div><div style=3D"font-family:arial,san=
s-serif;font-size:12.8000001907349px"><font face=3D"arial, sans-serif">Note=
 that the second mapping involves work if the key type is not a simple type=
 (say string or numbers). A typical approach in some software framework is =
to define a hash function on key.=A0</font></div></div><div><br></div><div>=
We have discussed the issue with Lada, and now take the issue to the mailin=
g list. If anyone else has encountered similar problems, please let us know=
. We also want to get a sense of any interest in introducing the data type =
in YANG. Any comments will be appreciated.</div><div><br></div><div>Thanks!=
</div><div><br></div><div>Richard</div><div>
</div></div>
_______________________________________________<br>netmod mailing list<br><=
a href=3D"mailto:netmod@ietf.org" target=3D"_blank">netmod@ietf.org</a><br>=
<a href=3D"https://www.ietf.org/mailman/listinfo/netmod" target=3D"_blank">=
https://www.ietf.org/mailman/listinfo/netmod</a><br></blockquote></div><br>=
</div><br>_______________________________________________<br>
netmod mailing list<br>
<a href=3D"mailto:netmod@ietf.org" target=3D"_blank">netmod@ietf.org</a><br=
>
<a href=3D"https://www.ietf.org/mailman/listinfo/netmod" target=3D"_blank">=
https://www.ietf.org/mailman/listinfo/netmod</a><br>
<br></blockquote></div><br></div></div></div>

--001a11c2c3ce18270705044ee7cd--


From nobody Fri Oct  3 08:06:05 2014
Return-Path: <tnadeau@lucidvision.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3D04B1A9245; Tue, 30 Sep 2014 15:00:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.686
X-Spam-Level: 
X-Spam-Status: No, score=-2.686 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, NORMAL_HTTP_TO_IP=0.001, RP_MATCHES_RCVD=-0.786, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 wQ_GrEkuoLY9; Tue, 30 Sep 2014 15:00:15 -0700 (PDT)
Received: from lucidvision.com (lucidvision.com [72.71.250.34]) by ietfa.amsl.com (Postfix) with ESMTP id A2AD71ACC81; Tue, 30 Sep 2014 15:00:12 -0700 (PDT)
Received: from [172.20.40.235] (unknown [12.199.206.2]) by lucidvision.com (Postfix) with ESMTP id DA40528A9797; Tue, 30 Sep 2014 18:00:10 -0400 (EDT)
Content-Type: multipart/signed; boundary="Apple-Mail=_76DD145F-A893-41FC-A733-4A3DBBDBF532"; protocol="application/pgp-signature"; micalg=pgp-sha512
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
From: "Thomas D. Nadeau" <tnadeau@lucidvision.com>
In-Reply-To: <CABCOCHRLSXzev4x0_G8-XeunrJkzXXZqaD12fyBXhVfd6J-SjQ@mail.gmail.com>
Date: Tue, 30 Sep 2014 15:00:06 -0700
Message-Id: <AD6B6EC1-A953-475E-A0E1-54A47960274C@lucidvision.com>
References: <CANUuoLpNjAqPP0-rbVLf2j+ZJEGOABz7CfmkWY5gGcVMrAu-Xw@mail.gmail.com> <1FBF3FB2-BB27-4940-BE99-2F9B75D6563A@lucidvision.com> <CABCOCHRLSXzev4x0_G8-XeunrJkzXXZqaD12fyBXhVfd6J-SjQ@mail.gmail.com>
To: Andy Bierman <andy@yumaworks.com>
X-Mailer: Apple Mail (2.1878.6)
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/a_3QYqQdoLToZWo8m8dzPIOL-bo
X-Mailman-Approved-At: Fri, 03 Oct 2014 08:05:53 -0700
Cc: IETF ALTO <alto@ietf.org>, NETMOD Working Group <netmod@ietf.org>
Subject: Re: [alto] [netmod] Key-value data structures in YANG/JSON encoding
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 30 Sep 2014 22:00:22 -0000

--Apple-Mail=_76DD145F-A893-41FC-A733-4A3DBBDBF532
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_E3CBC1A5-5D44-48B2-85A7-D5BB6DD896EF"


--Apple-Mail=_E3CBC1A5-5D44-48B2-85A7-D5BB6DD896EF
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=iso-8859-1


On Sep 30, 2014:2:16 PM, at 2:16 PM, Andy Bierman <andy@yumaworks.com> =
wrote:

> Hi,
>=20
>=20
> On Tue, Sep 30, 2014 at 1:55 PM, Thomas D. Nadeau =
<tnadeau@lucidvision.com> wrote:
> =09
> 	I was discussing this very same issue here at the ODL Yangathon =
yesterday.  Others are stumbling onto this same issue.
>=20
>=20
> Do you mean you want control over the YANG to JSON mapping?
> IMO, YANG needs to be independent of the protocol message encoding.
> The implementation burden on servers is already too high.
> There should only be 1 mapping for each encoding format.
>=20
> How would you change YANG to get this JSON encoding?

	That isn't what I was getting at - the key-value pair =
representation was asked about. It is a pain representing this as a =
list.

	--Tom



>=20
>=20
>=20
> 	--Tom
>=20
>=20
>=20
> Andy
> =20
>> Hi all,
>>=20
>> A few of us are doing an exercise of defining a YANG module to =
express the ALTO protocol (RFC7285). Multiple problems come up and here =
is one problem we encounter.=20
>>=20
>> First, the context. A design decision of the ALTO protocol is to use =
key-value stores (maps), which are different from lists or containers. =
Many large-scale systems are designed based on key-value stores, and =
many programming frameworks provide hash maps.
>>=20
>> A particular example of using key-value map is the network-map, which =
is defined as a key-value store to enforce that each named endpoint =
address group has a unique name. A specific example is in Section =
11.2.1.7 of RFC 7285 (http://www.rfc-editor.org/rfc/rfc7285.txt):
>>=20
>>          "network-map" : {
>>            "PID1" : {
>>              "ipv4" : [
>>                "192.0.2.0/24",
>>                "198.51.100.0/25"
>>              ]
>>            },
>>            "PID2" : {
>>              "ipv4" : [
>>                "198.51.100.128/25"
>>              ]
>>            },
>>            "PID3" : {
>>              "ipv4" : [
>>                "0.0.0.0/0"
>>              ],
>>              "ipv6" : [
>>                "::/0"
>>              ]
>>            }
>>=20
>> One way to express this in YANG is the following:
>> =3D=3D=3Dexample YANG=3D=3D=3D
>> list network-map {
>>   key "pid";
>>   leaf pid {
>>     type string;
>>   }
>>   leaf endpoint-address-group ... {
>>     // ...
>>   }
>> }
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>=20
>> Following the currently defined json encoding, the output will be:
>> {
>>   "network-map" : [
>>     {
>>       "pid" : "PID1",
>>        // ...
>>     },
>>     {
>>       "pid" : "PID2",
>>       // ...
>>     },
>>     {
>>       "pid" : "PID3",
>>       // ...
>>     }
>>   ]
>> }=20
>>=20
>> But this not what we want, because it is using an array, not a map. =
One does not have to use an array to store the map.
>>=20
>> We see two possibilities, if to produce the output. One is in the =
encoding process: define such outputs on matching a template:
>>=20
>> list MyList {
>>   key x;
>>   leaf x {
>>     type string;
>>   }
>>   leaf y {=20
>>    ...
>>   }
>> }
>>=20
>> The second is that maybe this should be resolved in YANG; i.e., =
introducing a new data type (beyond list, container), but something like =
key-value store, say named map:
>>=20
>> map MyMap {
>>   key my-key {
>>     ...
>>   };
>>   value my-value {
>>   }
>> }
>>=20
>> Note that the second mapping involves work if the key type is not a =
simple type (say string or numbers). A typical approach in some software =
framework is to define a hash function on key.=20
>>=20
>> We have discussed the issue with Lada, and now take the issue to the =
mailing list. If anyone else has encountered similar problems, please =
let us know. We also want to get a sense of any interest in introducing =
the data type in YANG. Any comments will be appreciated.
>>=20
>> Thanks!
>>=20
>> Richard
>> _______________________________________________
>> netmod mailing list
>> netmod@ietf.org
>> https://www.ietf.org/mailman/listinfo/netmod
>=20
>=20
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>=20
>=20


--Apple-Mail=_E3CBC1A5-5D44-48B2-85A7-D5BB6DD896EF
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=iso-8859-1

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Diso-8859-1"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space;"><br><div><div>On Sep 30, 2014:2:16 PM, at 2:16 PM, =
Andy Bierman &lt;<a =
href=3D"mailto:andy@yumaworks.com">andy@yumaworks.com</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><blockquote =
type=3D"cite"><div dir=3D"ltr">Hi,<div><br><div =
class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Tue, Sep 30, =
2014 at 1:55 PM, Thomas D. Nadeau <span dir=3D"ltr">&lt;<a =
href=3D"mailto:tnadeau@lucidvision.com" =
target=3D"_blank">tnadeau@lucidvision.com</a>&gt;</span> =
wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 =
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div =
style=3D"word-wrap:break-word"><span style=3D"white-space:pre-wrap">	=
</span><br><div><div><span style=3D"white-space:pre-wrap">	</span>I =
was discussing this very same issue here at the ODL Yangathon =
yesterday.&nbsp; Others are stumbling onto this same =
issue.</div><div><br></div></div></div></blockquote><div><br></div><div>Do=
 you mean you want control over the YANG to JSON mapping?</div><div>IMO, =
YANG needs to be independent of the protocol message =
encoding.</div><div>The implementation burden on servers is already too =
high.</div><div>There should only be 1 mapping for each encoding =
format.</div><div><br></div><div>How would you change YANG to get this =
JSON =
encoding?</div></div></div></div></div></blockquote><div><br></div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>That =
isn't what I was getting at - the key-value pair representation was =
asked about. It is a pain representing this as a =
list.</div><div><br></div><div><span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	=
</span>--Tom</div><div><br></div><div><br></div><div><br><blockquote =
type=3D"cite"><div dir=3D"ltr"><div><div class=3D"gmail_extra"><div =
class=3D"gmail_quote"><div><br></div><div><br></div><div><br></div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px =
#ccc solid;padding-left:1ex"><div =
style=3D"word-wrap:break-word"><div></div><div><span =
style=3D"white-space:pre-wrap">	=
</span>--Tom</div><div><br></div><br></div></blockquote><div><br></div><di=
v>Andy</div><div>&nbsp;</div><blockquote class=3D"gmail_quote" =
style=3D"margin: 0px 0px 0px 0.8ex; border-left-width: 1px; =
border-left-color: rgb(204, 204, 204); border-left-style: solid; =
padding-left: 1ex; position: static; z-index: auto;"><div =
style=3D"word-wrap:break-word"><div><blockquote type=3D"cite"><div =
dir=3D"ltr">Hi all,<div><br></div><div>A few of us are doing an exercise =
of defining a YANG module to express the ALTO protocol (RFC7285). =
Multiple problems come up and here is one problem we =
encounter.&nbsp;</div><div><br></div><div><span =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">First,=
 the context. A design decision of the ALTO protocol is to use key-value =
stores (maps), which are different from lists or containers. Many =
large-scale systems are designed based on key-value stores, and many =
programming frameworks provide hash maps.</span><br></div><div><span =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><br></=
span></div><div><span =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">A =
particular example of using key-value map is the network-map, which is =
defined as a key-value store to enforce that each named endpoint address =
group has a unique name. A specific example is&nbsp;</span><font =
face=3D"arial, sans-serif">in Section 11.2.1.7 of RFC 7285 (<a =
href=3D"http://www.rfc-editor.org/rfc/rfc7285.txt" =
target=3D"_blank">http://www.rfc-editor.org/rfc/rfc7285.txt</a>):</font></=
div><div><font face=3D"arial, sans-serif"><br></font></div><div><font =
face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;"network-map" : {</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"PID1" : =
{</font></div><div><font face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;"ipv4" : [</font></div><div><font =
face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;"<a href=3D"http://192.0.2.0/24" =
target=3D"_blank">192.0.2.0/24</a>",</font></div><div><font face=3D"arial,=
 sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"<a =
href=3D"http://198.51.100.0/25" =
target=3D"_blank">198.51.100.0/25</a>"</font></div><div><font =
face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;]</font></div><div><font face=3D"arial, sans-serif">&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;},</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"PID2" : =
{</font></div><div><font face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;"ipv4" : [</font></div><div><font =
face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;"<a href=3D"http://198.51.100.128/25" =
target=3D"_blank">198.51.100.128/25</a>"</font></div><div><font =
face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;]</font></div><div><font face=3D"arial, sans-serif">&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;},</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"PID3" : =
{</font></div><div><font face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;"ipv4" : [</font></div><div><font =
face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;"<a href=3D"http://0.0.0.0/0" =
target=3D"_blank">0.0.0.0/0</a>"</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;],</font></div><div><font face=3D"arial, sans-serif">&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"ipv6" : [</font></div><div><font =
face=3D"arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;"::/0"</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;]</font></div><div><font face=3D"arial, sans-serif">&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;}</font></div><div><br></div><div>One way to =
express this in YANG is the following:</div><div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">=3D=3D=
=3Dexample YANG=3D=3D=3D</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">list =
network-map {</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 key "pid";</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 leaf pid {</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; type string;</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 }</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 leaf endpoint-address-group ... {</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; // ...</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 }</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">}</div=
><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</div></div><div><br></div=
><div>Following the currently defined json encoding, the output will =
be:</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">{</div=
><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 "network-map" : [</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; {</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; &nbsp; "pid" : "PID1",</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; &nbsp; &nbsp;// ...</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; },</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; {</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; &nbsp; "pid" : "PID2",</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; &nbsp; // ...</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; },</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; {</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; &nbsp; "pid" : "PID3",</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; &nbsp; // ...</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 &nbsp; }</div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">&nbsp;=
 ]</div><div><span =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">}</spa=
n>&nbsp;</div><div><br></div><div>But this not what we want, because it =
is using an array, not a map. One does not have to use an array to store =
the map.</div><div><br></div><div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><span =
style=3D"font-size:12.8000001907349px">We see two possibilities, if to =
produce the output. One is in the encoding process:</span><span =
style=3D"font-size:12.8000001907349px">&nbsp;define such outputs on =
matching a template:</span></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><div><=
font face=3D"arial, sans-serif"><br></font></div><div><font face=3D"arial,=
 sans-serif">list MyList {</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; key x;</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; leaf x {</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; &nbsp; type string;</font></div><div><font =
face=3D"arial, sans-serif">&nbsp; }</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; leaf y {&nbsp;</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; &nbsp;...</font></div><div><font face=3D"arial, =
sans-serif">&nbsp; }</font></div><div><font face=3D"arial, =
sans-serif">}</font></div></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><br></=
div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">The second is that maybe this should be =
resolved in YANG; i.e., introducing a new data type (beyond list, =
container), but something like key-value store, say named =
map:</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif"><br></font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">map MyMap {</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">&nbsp; key my-key {</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">&nbsp; &nbsp; ...</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">&nbsp; };</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">&nbsp; value my-value {</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">&nbsp; }</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">}</font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif"><br></font></div><div =
style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><font =
face=3D"arial, sans-serif">Note that the second mapping involves work if =
the key type is not a simple type (say string or numbers). A typical =
approach in some software framework is to define a hash function on =
key.&nbsp;</font></div></div><div><br></div><div>We have discussed the =
issue with Lada, and now take the issue to the mailing list. If anyone =
else has encountered similar problems, please let us know. We also want =
to get a sense of any interest in introducing the data type in YANG. Any =
comments will be =
appreciated.</div><div><br></div><div>Thanks!</div><div><br></div><div>Ric=
hard</div><div>
</div></div>
_______________________________________________<br>netmod mailing =
list<br><a href=3D"mailto:netmod@ietf.org" =
target=3D"_blank">netmod@ietf.org</a><br><a =
href=3D"https://www.ietf.org/mailman/listinfo/netmod" =
target=3D"_blank">https://www.ietf.org/mailman/listinfo/netmod</a><br></bl=
ockquote></div><br></div><br>_____________________________________________=
__<br>
netmod mailing list<br>
<a href=3D"mailto:netmod@ietf.org" =
target=3D"_blank">netmod@ietf.org</a><br>
<a href=3D"https://www.ietf.org/mailman/listinfo/netmod" =
target=3D"_blank">https://www.ietf.org/mailman/listinfo/netmod</a><br>
<br></blockquote></div><br></div></div></div>
</blockquote></div><br></body></html>=

--Apple-Mail=_E3CBC1A5-5D44-48B2-85A7-D5BB6DD896EF--

--Apple-Mail=_76DD145F-A893-41FC-A733-4A3DBBDBF532
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJUKyfmAAoJEPcO+I7eiUJZgQUP/2r4OIn2GGaVvUJ19SFoshIB
M5qhfcUYYoABExRnfGDuW9aiFziOgtXSeZ4AC6qfkB1eHUTIppxIcX789je8ZcVM
jMVu9JMyuPOdwEECVnFrKhydPhEb3tCj4/nqYIDDnBCuAdRhtoLAkeiGMZ3gdno8
pEznCScYrkd/gx6lFcXfNDpSZ4EnFImxqaFLLnNfxqDM46j2abu7tfQMUQbQt81y
bXKjeGXcy79HQqW2f/qZKu6LXHh27s+3rh0u5EL9Ix/09r+1p83E8t7aq8bjQVXq
nLrNam6mkhAfe2YWcB52hAN04SQ40xY+d/cSstHnDmG7iG7b8j1HFA8u+cXb/nbw
2nK996Y9mWUqwB/le2Jqsqi6sf3rGMlsnpyFhtQ4+g+c6g0p42CX0+AHHcF2EvxV
SnzEK2sMBRqf8qcSN7QVIGMsu+NAfUqJ9fywMTmA66D50mm+OKsiQDS9dhCpZVWw
ldOPtM480yr+2ZRDHmCH+bEe7JfkTa1f+kPNc/VhhZvDqvY4tYqdmCH1j68DFysC
n2NTHM/1ot3oio2mKING0WWIvqtdel2Jfsxbm9jwYljF6IwPfgeBj3nS4q6RifeC
Uxnsf4qFK2iZzjm8MGHu5Goe2qhO2bYW+wzlFX78Ky5+PzIYrKwe9O5ecBr9gfvL
RqBthLHxZvCCbUG7Ci0g
=VrCm
-----END PGP SIGNATURE-----

--Apple-Mail=_76DD145F-A893-41FC-A733-4A3DBBDBF532--


From nobody Fri Oct  3 08:06:07 2014
Return-Path: <kwatsen@juniper.net>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 476421ACD54; Tue, 30 Sep 2014 18:37:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level: 
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, NORMAL_HTTP_TO_IP=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 opSWXiDl24vV; Tue, 30 Sep 2014 18:37:39 -0700 (PDT)
Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0105.outbound.protection.outlook.com [65.55.169.105]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6658E1ACD67; Tue, 30 Sep 2014 18:37:39 -0700 (PDT)
Received: from CO1PR05MB458.namprd05.prod.outlook.com (10.141.72.140) by CO1PR05MB459.namprd05.prod.outlook.com (10.141.72.146) with Microsoft SMTP Server (TLS) id 15.0.1039.15; Wed, 1 Oct 2014 01:37:36 +0000
Received: from CO1PR05MB458.namprd05.prod.outlook.com ([169.254.10.194]) by CO1PR05MB458.namprd05.prod.outlook.com ([169.254.10.194]) with mapi id 15.00.1039.011; Wed, 1 Oct 2014 01:37:36 +0000
From: Kent Watsen <kwatsen@juniper.net>
To: "Y. Richard Yang" <yry@cs.yale.edu>, "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] Key-value data structures in YANG/JSON encoding
Thread-Index: AQHP3O19TPFlivkdt0aXryQhIzUulJwaAVgA
Date: Wed, 1 Oct 2014 01:37:36 +0000
Message-ID: <D050993D.8364E%kwatsen@juniper.net>
References: <CANUuoLpNjAqPP0-rbVLf2j+ZJEGOABz7CfmkWY5gGcVMrAu-Xw@mail.gmail.com>
In-Reply-To: <CANUuoLpNjAqPP0-rbVLf2j+ZJEGOABz7CfmkWY5gGcVMrAu-Xw@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
user-agent: Microsoft-MacOutlook/14.4.4.140807
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [66.129.239.14]
x-microsoft-antispam: BCL:0;PCL:0;RULEID:;SRVR:CO1PR05MB459;
x-forefront-prvs: 0351D213B3
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(6019001)(41574002)(53754006)(377454003)(199003)(189002)(15975445006)(10300001)(4396001)(50986999)(120916001)(76482002)(99936001)(15202345003)(101416001)(46102003)(97736003)(86362001)(64706001)(54356999)(66066001)(99396003)(19580395003)(2656002)(80022003)(106356001)(19580405001)(92726001)(76176999)(92566001)(105586002)(31966008)(107046002)(106116001)(77096002)(85306004)(95666004)(2501002)(21056001)(2171001)(20776003)(83506001)(87936001)(99286002)(36756003)(85852003)(16193025007); DIR:OUT; SFP:1102; SCL:1; SRVR:CO1PR05MB459; H:CO1PR05MB458.namprd05.prod.outlook.com; FPR:; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en; 
Content-Type: multipart/mixed; boundary="_002_D050993D8364Ekwatsenjunipernet_"
MIME-Version: 1.0
X-OriginatorOrg: juniper.net
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/9TFYkRSR5GCfGFnDad53CX5npiI
X-Mailman-Approved-At: Fri, 03 Oct 2014 08:05:54 -0700
Cc: IETF ALTO <alto@ietf.org>
Subject: Re: [alto] [netmod] Key-value data structures in YANG/JSON encoding
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 01 Oct 2014 01:37:42 -0000

--_002_D050993D8364Ekwatsenjunipernet_
Content-Type: text/plain; charset="us-ascii"
Content-ID: <9FEDB7C92D48DD419B036EEF876F707B@namprd05.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable


>From a data-modeling perspective, it makes sense to be able to define
maps.  For instance, one can envision said information being used during
code-generation for in-memory and persisted datastores.

*If* it is not required that the JSON encoding be a JSON map, your yang
module could create a derived type:

    typedef map {
      type list;
    }

    container network-map {
      map entry {
        key "pid";
        leaf pid {
          type string;
        }
        leaf-list ipv4 {
          type inet:ipv4-prefix;
        }
        leaf-list ipv6 {
          type inet:ipv6-prefix;
        }
      }
    }



I actually just tried this (see attached file), but pyang complains:

  pyang --strict alto-test.yang

  alto-test.yang:7: warning: imported module ietf-inet-types not used
  alto-test.yang:25: error: type "list" not found in module alto-test
  alto-test.yang:30: error: unexpected keyword "map"


RFC 6020 doesn't limit which types can be used in a typedef statement, so
this might be a bug in pyang...



Kent




=20


From:  "Y. Richard Yang" <yry@cs.yale.edu>
Date:  Tuesday, September 30, 2014 at 1:31 PM
To:  "netmod@ietf.org" <netmod@ietf.org>
Cc:  IETF ALTO <alto@ietf.org>
Subject:  [netmod] Key-value data structures in YANG/JSON encoding


Hi all,

A few of us are doing an exercise of defining a YANG module to express the
ALTO protocol (RFC7285). Multiple problems come up and here is one problem
we encounter.=20

First, the context. A design decision of the ALTO protocol is to use
key-value stores (maps), which are different from lists or containers.
Many large-scale systems are designed based
 on key-value stores, and many programming frameworks provide hash maps.


A particular example of using key-value map is the network-map, which is
defined as a key-value store to enforce that each named endpoint address
group has a unique name. A specific
 example is in Section 11.2.1.7 of RFC 7285
(http://www.rfc-editor.org/rfc/rfc7285.txt):

         "network-map" : {
           "PID1" : {
             "ipv4" : [
               "192.0.2.0/24 <http://192.0.2.0/24>",
               "198.51.100.0/25 <http://198.51.100.0/25>"
             ]
           },
           "PID2" : {
             "ipv4" : [
               "198.51.100.128/25 <http://198.51.100.128/25>"
             ]
           },
           "PID3" : {
             "ipv4" : [
               "0.0.0.0/0 <http://0.0.0.0/0>"
             ],
             "ipv6" : [
               "::/0"
             ]
           }

One way to express this in YANG is the following:
=3D=3D=3Dexample YANG=3D=3D=3D
list network-map {
  key "pid";
  leaf pid {
    type string;
  }
  leaf endpoint-address-group ... {
    // ...
  }
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D


Following the currently defined json encoding, the output will be:
{
  "network-map" : [
    {
      "pid" : "PID1",
       // ...
    },
    {
      "pid" : "PID2",
      // ...
    },
    {
      "pid" : "PID3",
      // ...
    }
  ]
}=20

But this not what we want, because it is using an array, not a map. One
does not have to use an array to store the map.

We see two possibilities, if to produce the output. One is in the encoding
process: define such
 outputs on matching a template:

list MyList {
  key x;
  leaf x {
    type string;
  }
  leaf y {=20
   ...
  }
}


The second is that maybe this should be resolved in YANG; i.e.,
introducing a new data type (beyond list, container), but something like
key-value store, say
 named map:

map MyMap {
  key my-key {
    ...
  };
  value my-value {
  }
}

Note that the second mapping involves work if the key type is not a simple
type (say string or numbers). A typical approach in some software
framework is to
 define a hash function on key.


We have discussed the issue with Lada, and now take the issue to the
mailing list. If anyone else has encountered similar problems, please let
us know. We also want to get a sense of any interest in introducing the
data type in YANG. Any comments will
 be appreciated.

Thanks!

Richard


--_002_D050993D8364Ekwatsenjunipernet_
Content-Type: application/octet-stream; name="alto-test.yang"
Content-Description: alto-test.yang
Content-Disposition: attachment; filename="alto-test.yang"; size=724;
	creation-date="Wed, 01 Oct 2014 01:37:36 GMT";
	modification-date="Wed, 01 Oct 2014 01:37:36 GMT"
Content-ID: <4F91A7407D209D4AB7065FE54E2699F5@namprd05.prod.outlook.com>
Content-Transfer-Encoding: base64

bW9kdWxlIGFsdG8tdGVzdCB7CgogIHlhbmctdmVyc2lvbiAxOwogIG5hbWVzcGFjZSAiaHR0cDov
L2Zvb2Jhci5jb20vYWx0by10ZXN0IjsKICBwcmVmaXggdG9hc3Q7CgogIGltcG9ydCBpZXRmLWlu
ZXQtdHlwZXMgewogICAgIHByZWZpeCAiaW5ldCI7ICAgIAogIH0KCiAgb3JnYW5pemF0aW9uICJO
ZXRjb25mIENlbnRyYWwiOwoKICBjb250YWN0CiAgICAiQW5keSBCaWVybWFuIDxhbmR5QG5ldGNv
bmZjZW50cmFsLm9yZz4iOwoKICBkZXNjcmlwdGlvbgogICAgIllBTkcgdmVyc2lvbiBvZiB0aGUg
VE9BU1RFUi1NSUIuIjsKCiAgcmV2aXNpb24gIjIwMDktMTEtMjAiIHsKICAgIGRlc2NyaXB0aW9u
CiAgICAgICJUb2FzdGVyIG1vZHVsZSBpbiBwcm9ncmVzcy4iOwogIH0KCiAgdHlwZWRlZiBtYXAg
ewogICAgICB0eXBlIGxpc3Q7CiAgfQoKICBjb250YWluZXIgYWx0by10ZXN0IHsKICAgIGNvbnRh
aW5lciBuZXR3b3JrLW1hcCB7CiAgICAgIG1hcCBlbnRyeSB7CiAgICAgICAga2V5ICJwaWQiOwog
ICAgICAgIGxlYWYgcGlkIHsKICAgICAgICAgIHR5cGUgc3RyaW5nOwogICAgICAgIH0KICAgICAg
ICBsZWFmLWxpc3QgaXB2NCB7CiAgICAgICAgICB0eXBlIGluZXQ6aXB2NC1wcmVmaXg7CiAgICAg
ICAgfQogICAgICAgIGxlYWYtbGlzdCBpcHY2IHsKICAgICAgICAgIHR5cGUgaW5ldDppcHY2LXBy
ZWZpeDsKICAgICAgICB9CiAgICAgIH0KICAgIH0KICB9Cgp9CgoKCg==

--_002_D050993D8364Ekwatsenjunipernet_--


From nobody Fri Oct  3 08:06:08 2014
Return-Path: <kwatsen@juniper.net>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C67A91A007D; Tue, 30 Sep 2014 19:31:44 -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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 hWEr5gkWCcCJ; Tue, 30 Sep 2014 19:31:43 -0700 (PDT)
Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0120.outbound.protection.outlook.com [207.46.100.120]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4C0121A0081; Tue, 30 Sep 2014 19:31:43 -0700 (PDT)
Received: from CO1PR05MB458.namprd05.prod.outlook.com (10.141.72.140) by CO1PR05MB460.namprd05.prod.outlook.com (10.141.72.152) with Microsoft SMTP Server (TLS) id 15.0.1039.15; Wed, 1 Oct 2014 02:31:41 +0000
Received: from CO1PR05MB458.namprd05.prod.outlook.com ([169.254.10.194]) by CO1PR05MB458.namprd05.prod.outlook.com ([169.254.10.194]) with mapi id 15.00.1039.011; Wed, 1 Oct 2014 02:31:41 +0000
From: Kent Watsen <kwatsen@juniper.net>
To: Xiao SHI <xiao.shi@yale.edu>
Thread-Topic: [netmod] Key-value data structures in YANG/JSON encoding
Thread-Index: AQHP3O19TPFlivkdt0aXryQhIzUulJwaAVgAgAB7XoCAAAkZZA==
Date: Wed, 1 Oct 2014 02:31:40 +0000
Message-ID: <DA386336-9E2C-460A-914F-FB795B4124C6@juniper.net>
References: <CANUuoLpNjAqPP0-rbVLf2j+ZJEGOABz7CfmkWY5gGcVMrAu-Xw@mail.gmail.com> <D050993D.8364E%kwatsen@juniper.net>, <CAFwJzZmSW8dDqT2PMwDz_wF8c_27q3mg+oJxKHhzHvAjsnrCNQ@mail.gmail.com>
In-Reply-To: <CAFwJzZmSW8dDqT2PMwDz_wF8c_27q3mg+oJxKHhzHvAjsnrCNQ@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [166.170.38.213]
x-microsoft-antispam: BCL:0;PCL:0;RULEID:;SRVR:CO1PR05MB460;
x-forefront-prvs: 0351D213B3
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(189002)(164054003)(199003)(10300001)(2656002)(99396003)(80022003)(76482002)(92726001)(64706001)(33656002)(92566001)(46102003)(85852003)(2171001)(4396001)(83716003)(87936001)(85306004)(54356999)(50986999)(95666004)(101416001)(36756003)(99286002)(105586002)(106116001)(21056001)(97736003)(110136001)(82746002)(66066001)(20776003)(31966008)(107046002)(86362001)(76176999)(120916001)(106356001)(77096002)(104396001); DIR:OUT; SFP:1102; SCL:1; SRVR:CO1PR05MB460; H:CO1PR05MB458.namprd05.prod.outlook.com; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; 
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: juniper.net
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/5tNXGT5rsusTjyaO4eYka7LzjiE
X-Mailman-Approved-At: Fri, 03 Oct 2014 08:05:54 -0700
Cc: IETF ALTO <alto@ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [alto] [netmod] Key-value data structures in YANG/JSON encoding
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 01 Oct 2014 02:31:44 -0000

> In RFC6020 Sec. 7.4, the type statement takes an argument that's a built-=
in type or derived type (which are all based in built-in types), but in Sec=
. 4.2.4 Built-in types do not include "list."
> I think "list" is handled as a statement rather than a type in YANG.

Ah, yes, that explains it - good catch.  So a new statement would be needed=
 after all...

Thanks,
Kent=


From nobody Fri Oct  3 08:06:10 2014
Return-Path: <tnadeau@lucidvision.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1433D1A0087; Tue, 30 Sep 2014 19:37:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.688
X-Spam-Level: 
X-Spam-Status: No, score=-2.688 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.786, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 Dg8aI6s8h8k2; Tue, 30 Sep 2014 19:37:13 -0700 (PDT)
Received: from lucidvision.com (lucidvision.com [72.71.250.34]) by ietfa.amsl.com (Postfix) with ESMTP id 31CA61A008F; Tue, 30 Sep 2014 19:37:12 -0700 (PDT)
Received: from [10.228.143.65] (unknown [166.170.39.10]) by lucidvision.com (Postfix) with ESMTP id 605A428A9CDF; Tue, 30 Sep 2014 22:37:11 -0400 (EDT)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (1.0)
From: Thomas Nadeau <tnadeau@lucidvision.com>
X-Mailer: iPhone Mail (12A405)
In-Reply-To: <DA386336-9E2C-460A-914F-FB795B4124C6@juniper.net>
Date: Tue, 30 Sep 2014 19:37:09 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <D36B2041-FDC4-4C15-9D3D-5CB59AFE55FE@lucidvision.com>
References: <CANUuoLpNjAqPP0-rbVLf2j+ZJEGOABz7CfmkWY5gGcVMrAu-Xw@mail.gmail.com> <D050993D.8364E%kwatsen@juniper.net> <CAFwJzZmSW8dDqT2PMwDz_wF8c_27q3mg+oJxKHhzHvAjsnrCNQ@mail.gmail.com> <DA386336-9E2C-460A-914F-FB795B4124C6@juniper.net>
To: Kent Watsen <kwatsen@juniper.net>
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/uJTXMhj8NJVLwGEpl5QQmltxgDA
X-Mailman-Approved-At: Fri, 03 Oct 2014 08:05:53 -0700
Cc: Xiao SHI <xiao.shi@yale.edu>, IETF ALTO <alto@ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [alto] [netmod] Key-value data structures in YANG/JSON encoding
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 01 Oct 2014 02:37:14 -0000

Please note this as an issue for a future version of yang.=20

Tom=20




> On Sep 30, 2014, at 7:31 PM, Kent Watsen <kwatsen@juniper.net> wrote:
>=20
>=20
>> In RFC6020 Sec. 7.4, the type statement takes an argument that's a built-=
in type or derived type (which are all based in built-in types), but in Sec.=
 4.2.4 Built-in types do not include "list."
>> I think "list" is handled as a statement rather than a type in YANG.
>=20
> Ah, yes, that explains it - good catch.  So a new statement would be neede=
d after all...
>=20
> Thanks,
> Kent
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>=20


From nobody Fri Oct  3 08:06:14 2014
Return-Path: <randy_presuhn@mindspring.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 20CE51A00E1; Tue, 30 Sep 2014 20:23:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level: 
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9,  DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham
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 l282Cke2OhOX; Tue, 30 Sep 2014 20:23:22 -0700 (PDT)
Received: from elasmtp-spurfowl.atl.sa.earthlink.net (elasmtp-spurfowl.atl.sa.earthlink.net [209.86.89.66]) by ietfa.amsl.com (Postfix) with ESMTP id 1B3A71A00D0; Tue, 30 Sep 2014 20:23:21 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=mindspring.com; b=QEw9YP6n1Fu1jlEz6UCMgcNOtuVJhiDYHEwy1oEkdvtImZrfLzGexSYeUeUF3z6M; h=Message-ID:Date:From:Reply-To:To:Subject:Cc:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:X-ELNK-Trace:X-Originating-IP;
Received: from [209.86.224.30] (helo=mswamui-chipeau.atl.sa.earthlink.net) by elasmtp-spurfowl.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from <randy_presuhn@mindspring.com>) id 1XZAVc-0003Ol-P6; Tue, 30 Sep 2014 23:23:20 -0400
Received: from 76.254.52.49 by webmail.earthlink.net with HTTP; Tue, 30 Sep 2014 23:23:20 -0400
Message-ID: <6882466.1412133800694.JavaMail.root@mswamui-chipeau.atl.sa.earthlink.net>
Date: Tue, 30 Sep 2014 20:23:20 -0700 (GMT-07:00)
From: Randy Presuhn <randy_presuhn@mindspring.com>
To: "Y. Richard Yang" <yry@cs.yale.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Mailer: EarthLink Zoo Mail 1.0
X-ELNK-Trace: 4488c18417c9426da92b9037bc8bcf44d4c20f6b8d69d88825aa8a2065c9591f3c8a8a29ec0a8ddb21a0b3208149454d350badd9bab72f9c350badd9bab72f9c
X-Originating-IP: 209.86.224.30
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/3t0AAz77X_C5C3VngQKbKn7O7e8
X-Mailman-Approved-At: Fri, 03 Oct 2014 08:05:54 -0700
Cc: IETF ALTO <alto@ietf.org>, netmod@ietf.org
Subject: Re: [alto] [netmod] Key-value data structures in YANG/JSON encoding
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Randy Presuhn <randy_presuhn@mindspring.com>
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 01 Oct 2014 03:23:24 -0000

Hi -

>From: "Y. Richard Yang" <yry@cs.yale.edu>
>Sent: Sep 30, 2014 2:48 PM
>To: Andy Bierman <andy@yumaworks.com>
>Cc: IETF ALTO <alto@ietf.org>, netmod@ietf.org
>Subject: Re: [netmod] Key-value data structures in YANG/JSON encoding
...
>more general issue regarding completeness of data types in YANG:
>
>- list is an ordered array
>
>- container is a static, heterogeneous associate array
...

Why do you say "static"?

Randy


From nobody Fri Oct  3 08:06:25 2014
Return-Path: <j.schoenwaelder@jacobs-university.de>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9F7B01A880E; Wed,  1 Oct 2014 00:08:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.336
X-Spam-Level: 
X-Spam-Status: No, score=-2.336 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, RP_MATCHES_RCVD=-0.786] autolearn=ham
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 L-yjdWXesJyg; Wed,  1 Oct 2014 00:08:14 -0700 (PDT)
Received: from atlas3.jacobs-university.de (atlas3.jacobs-university.de [212.201.44.18]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 817761A884A; Wed,  1 Oct 2014 00:08:14 -0700 (PDT)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas3.jacobs-university.de (Postfix) with ESMTP id 53D66F71; Wed,  1 Oct 2014 09:08:13 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas3.jacobs-university.de ([10.70.0.220]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10030) with ESMTP id EsFg58FVEIVT; Wed,  1 Oct 2014 09:08:12 +0200 (CEST)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "Jacobs University CA - G01" (verified OK)) by atlas3.jacobs-university.de (Postfix) with ESMTPS; Wed,  1 Oct 2014 09:08:12 +0200 (CEST)
Received: from localhost (demetrius1.jacobs-university.de [212.201.44.46]) by hermes.jacobs-university.de (Postfix) with ESMTP id CA93320036; Wed,  1 Oct 2014 09:08:12 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius1.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id nf_Q8XkiAmzK; Wed,  1 Oct 2014 09:08:12 +0200 (CEST)
Received: from elstar.local (elstar.jacobs.jacobs-university.de [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id CE27520035; Wed,  1 Oct 2014 09:08:11 +0200 (CEST)
Received: by elstar.local (Postfix, from userid 501) id A72712EBD548; Wed,  1 Oct 2014 09:08:10 +0200 (CEST)
Date: Wed, 1 Oct 2014 09:08:09 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: "Y. Richard Yang" <yry@cs.yale.edu>
Message-ID: <20141001070809.GA37068@elstar.local>
Mail-Followup-To: "Y. Richard Yang" <yry@cs.yale.edu>, netmod@ietf.org, IETF ALTO <alto@ietf.org>
References: <CANUuoLpNjAqPP0-rbVLf2j+ZJEGOABz7CfmkWY5gGcVMrAu-Xw@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CANUuoLpNjAqPP0-rbVLf2j+ZJEGOABz7CfmkWY5gGcVMrAu-Xw@mail.gmail.com>
User-Agent: Mutt/1.4.2.3i
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/K5S_OSu6BWcikwdmDqmm-LepYDM
X-Mailman-Approved-At: Fri, 03 Oct 2014 08:05:54 -0700
Cc: IETF ALTO <alto@ietf.org>, netmod@ietf.org
Subject: Re: [alto] [netmod] Key-value data structures in YANG/JSON encoding
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 01 Oct 2014 07:08:22 -0000

On Tue, Sep 30, 2014 at 04:31:03PM -0400, Y. Richard Yang wrote:
 
> A particular example of using key-value map is the network-map, which is
> defined as a key-value store to enforce that each named endpoint address
> group has a unique name. A specific example is in Section 11.2.1.7 of RFC
> 7285 (http://www.rfc-editor.org/rfc/rfc7285.txt):
> 
>          "network-map" : {
>            "PID1" : {
>              "ipv4" : [
>                "192.0.2.0/24",
>                "198.51.100.0/25"
>              ]
>            },
>            "PID2" : {
>              "ipv4" : [
>                "198.51.100.128/25"
>              ]
>            },
>            "PID3" : {
>              "ipv4" : [
>                "0.0.0.0/0"
>              ],
>              "ipv6" : [
>                "::/0"
>              ]
>            }

Since YANG's native encoding is XML, how would you represent this in
XML with the restriction that XML element names are defined by the
data model and all values are in XML elements?

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1, 28759 Bremen, Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>


From nobody Fri Oct  3 08:06:31 2014
Return-Path: <j.schoenwaelder@jacobs-university.de>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D89201A0107; Thu,  2 Oct 2014 00:15:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.336
X-Spam-Level: 
X-Spam-Status: No, score=-2.336 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, RP_MATCHES_RCVD=-0.786] autolearn=ham
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 4v_M8v96dEVn; Thu,  2 Oct 2014 00:15:30 -0700 (PDT)
Received: from atlas3.jacobs-university.de (atlas3.jacobs-university.de [212.201.44.18]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 195531A00FE; Thu,  2 Oct 2014 00:15:30 -0700 (PDT)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas3.jacobs-university.de (Postfix) with ESMTP id 90E32FA4; Thu,  2 Oct 2014 09:15:28 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas3.jacobs-university.de ([10.70.0.220]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10030) with ESMTP id esuT-HtRvpHE; Thu,  2 Oct 2014 09:15:26 +0200 (CEST)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "Jacobs University CA - G01" (verified OK)) by atlas3.jacobs-university.de (Postfix) with ESMTPS; Thu,  2 Oct 2014 09:15:27 +0200 (CEST)
Received: from localhost (demetrius3.jacobs-university.de [212.201.44.48]) by hermes.jacobs-university.de (Postfix) with ESMTP id 575E920037; Thu,  2 Oct 2014 09:15:26 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius3.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id zNmGiMtTT4Rw; Thu,  2 Oct 2014 09:15:25 +0200 (CEST)
Received: from elstar.local (elstar.jacobs.jacobs-university.de [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id 3D01320036; Thu,  2 Oct 2014 09:15:24 +0200 (CEST)
Received: by elstar.local (Postfix, from userid 501) id 2B9BC2EBFA8A; Thu,  2 Oct 2014 09:15:23 +0200 (CEST)
Date: Thu, 2 Oct 2014 09:15:23 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: "Y. Richard Yang" <yry@cs.yale.edu>
Message-ID: <20141002071522.GA40160@elstar.local>
Mail-Followup-To: "Y. Richard Yang" <yry@cs.yale.edu>, netmod@ietf.org, IETF ALTO <alto@ietf.org>
References: <CANUuoLpNjAqPP0-rbVLf2j+ZJEGOABz7CfmkWY5gGcVMrAu-Xw@mail.gmail.com> <20141001070809.GA37068@elstar.local> <CANUuoLpuGHO-NhO347k_Z34OKm47KL8viZf-kdsVzEHM=r-UZg@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CANUuoLpuGHO-NhO347k_Z34OKm47KL8viZf-kdsVzEHM=r-UZg@mail.gmail.com>
User-Agent: Mutt/1.4.2.3i
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/wT4TQ257jrJhlT91mlNO1FdcoJg
X-Mailman-Approved-At: Fri, 03 Oct 2014 08:05:54 -0700
Cc: IETF ALTO <alto@ietf.org>, netmod@ietf.org
Subject: Re: [alto] [netmod] Key-value data structures in YANG/JSON encoding
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 02 Oct 2014 07:15:33 -0000

On Wed, Oct 01, 2014 at 03:23:49PM -0400, Y. Richard Yang wrote:
> On Wed, Oct 1, 2014 at 3:08 AM, Juergen Schoenwaelder <
> j.schoenwaelder@jacobs-university.de> wrote:
> 
> > On Tue, Sep 30, 2014 at 04:31:03PM -0400, Y. Richard Yang wrote:
> >
> > > A particular example of using key-value map is the network-map, which is
> > > defined as a key-value store to enforce that each named endpoint address
> > > group has a unique name. A specific example is in Section 11.2.1.7 of RFC
> > > 7285 (http://www.rfc-editor.org/rfc/rfc7285.txt):
> > >
> > >          "network-map" : {
> > >            "PID1" : {
> > >              "ipv4" : [
> > >                "192.0.2.0/24",
> > >                "198.51.100.0/25"
> > >              ]
> > >            },
> > >            "PID2" : {
> > >              "ipv4" : [
> > >                "198.51.100.128/25"
> > >              ]
> > >            },
> > >            "PID3" : {
> > >              "ipv4" : [
> > >                "0.0.0.0/0"
> > >              ],
> > >              "ipv6" : [
> > >                "::/0"
> > >              ]
> > >            }
> >
> > Since YANG's native encoding is XML, how would you represent this in
> > XML with the restriction that XML element names are defined by the
> > data model and all values are in XML elements?
> >
> 
> Would you consider this as a limitation of the restriction?
> 
> With the restriction, if we have the YANG data type to introduce key-value
> store, for XML, the Mapping Rule may still be that of using two elements
> with name and value: pid-name = (or just key as name), pid-value = (or
> value). But for json and languages that support maps, the mapping does not.
> Make sense?
> 

I am saying that YANG was designed to model data carried by NETCONF
(check the title of RFC 6020) and NETCONF uses XML as its data
encoding with a set of restrictions that were found useful to simplify
things (all data in XML elements, no mixed content, ...). Several
details of the YANG language are related to XML (e.g., much of the
type system, the usage of xpath in must/when expressions, instance
identifier as a subset of xpath, ...).

Alternate _encodings_ are proposed (such as JSON) but the question
raised here seems to be whether we want to start an effort to turn
YANG into a schema language for JSON (which it is not today and this
is by design and not by accident).

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1, 28759 Bremen, Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>


From nobody Fri Oct  3 08:06:33 2014
Return-Path: <mbj@tail-f.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EC3941A002D; Thu,  2 Oct 2014 01:46:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.687
X-Spam-Level: 
X-Spam-Status: No, score=-2.687 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.786, SPF_PASS=-0.001] autolearn=ham
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 terIytZfbtNi; Thu,  2 Oct 2014 01:46:04 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [83.241.162.140]) by ietfa.amsl.com (Postfix) with ESMTP id C5EFE1A0211; Thu,  2 Oct 2014 01:46:03 -0700 (PDT)
Received: from localhost (x15.tail-f.com [192.168.1.60]) by mail.tail-f.com (Postfix) with ESMTPSA id 153EC128097C; Thu,  2 Oct 2014 10:46:03 +0200 (CEST)
Date: Thu, 02 Oct 2014 10:46:02 +0200 (CEST)
Message-Id: <20141002.104602.316004437093709527.mbj@tail-f.com>
To: j.schoenwaelder@jacobs-university.de
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <20141002071522.GA40160@elstar.local>
References: <20141001070809.GA37068@elstar.local> <CANUuoLpuGHO-NhO347k_Z34OKm47KL8viZf-kdsVzEHM=r-UZg@mail.gmail.com> <20141002071522.GA40160@elstar.local>
X-Mailer: Mew version 6.5 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/5AStF34jFWPufvZLatpLYJs0Xd4
X-Mailman-Approved-At: Fri, 03 Oct 2014 08:05:54 -0700
Cc: alto@ietf.org, netmod@ietf.org
Subject: Re: [alto] [netmod] Key-value data structures in YANG/JSON encoding
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 02 Oct 2014 08:46:06 -0000

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote:
> On Wed, Oct 01, 2014 at 03:23:49PM -0400, Y. Richard Yang wrote:
> > On Wed, Oct 1, 2014 at 3:08 AM, Juergen Schoenwaelder <
> > j.schoenwaelder@jacobs-university.de> wrote:
> > 
> > > On Tue, Sep 30, 2014 at 04:31:03PM -0400, Y. Richard Yang wrote:
> > >
> > > > A particular example of using key-value map is the network-map, which is
> > > > defined as a key-value store to enforce that each named endpoint address
> > > > group has a unique name. A specific example is in Section 11.2.1.7 of RFC
> > > > 7285 (http://www.rfc-editor.org/rfc/rfc7285.txt):
> > > >
> > > >          "network-map" : {
> > > >            "PID1" : {
> > > >              "ipv4" : [
> > > >                "192.0.2.0/24",
> > > >                "198.51.100.0/25"
> > > >              ]
> > > >            },
> > > >            "PID2" : {
> > > >              "ipv4" : [
> > > >                "198.51.100.128/25"
> > > >              ]
> > > >            },
> > > >            "PID3" : {
> > > >              "ipv4" : [
> > > >                "0.0.0.0/0"
> > > >              ],
> > > >              "ipv6" : [
> > > >                "::/0"
> > > >              ]
> > > >            }
> > >
> > > Since YANG's native encoding is XML, how would you represent this in
> > > XML with the restriction that XML element names are defined by the
> > > data model and all values are in XML elements?
> > >
> > 
> > Would you consider this as a limitation of the restriction?
> > 
> > With the restriction, if we have the YANG data type to introduce key-value
> > store, for XML, the Mapping Rule may still be that of using two elements
> > with name and value: pid-name = (or just key as name), pid-value = (or
> > value). But for json and languages that support maps, the mapping does not.
> > Make sense?
> > 
> 
> I am saying that YANG was designed to model data carried by NETCONF
> (check the title of RFC 6020) and NETCONF uses XML as its data
> encoding with a set of restrictions that were found useful to simplify
> things (all data in XML elements, no mixed content, ...). Several
> details of the YANG language are related to XML (e.g., much of the
> type system, the usage of xpath in must/when expressions, instance
> identifier as a subset of xpath, ...).
> 
> Alternate _encodings_ are proposed (such as JSON) but the question
> raised here seems to be whether we want to start an effort to turn
> YANG into a schema language for JSON (which it is not today and this
> is by design and not by accident).

I think the question is if it would be a good idea to add a "map"
keyword to YANG.  Then, if we have "map", we can decide how to encode
it in XML and JSON.

For the record, I do not think we should add this.  I am not sure when
it is a good idea to model an open-ended map (i.e., with keys that are
not formally defined).  In many cases I think it is better with
something like:

  list my-map {
    key "key";
    leaf key {
      type identityref { ... } // this means all keys are
                               // formally defined in YANG
    }
    leaf value {
      type string;
    }
  }


/martin


From nobody Fri Oct  3 08:06:34 2014
Return-Path: <lhotka@nic.cz>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3EF951A86DE; Thu,  2 Oct 2014 06:04:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham
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 Nl6Z77O1M_nI; Thu,  2 Oct 2014 06:04:45 -0700 (PDT)
Received: from trail.lhotka.name (trail.lhotka.name [77.48.224.143]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 32F511A6FB1; Thu,  2 Oct 2014 06:04:44 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by trail.lhotka.name (Postfix) with ESMTP id 0583D5409F1; Thu,  2 Oct 2014 15:04:42 +0200 (CEST)
Received: from trail.lhotka.name ([127.0.0.1]) by localhost (trail.lhotka.name [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lEnSwfPygH6N; Thu,  2 Oct 2014 15:04:37 +0200 (CEST)
Received: from localhost (cst-prg-119-246.cust.vodafone.cz [46.135.119.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by trail.lhotka.name (Postfix) with ESMTPSA id 36F325403AA; Thu,  2 Oct 2014 15:04:19 +0200 (CEST)
From: Ladislav Lhotka <lhotka@nic.cz>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, "Y. Richard Yang" <yry@cs.yale.edu>
In-Reply-To: <20141001070809.GA37068@elstar.local>
References: <CANUuoLpNjAqPP0-rbVLf2j+ZJEGOABz7CfmkWY5gGcVMrAu-Xw@mail.gmail.com> <20141001070809.GA37068@elstar.local>
User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.50.2 (x86_64-apple-darwin13.0.0)
Date: Thu, 02 Oct 2014 15:03:50 +0200
Message-ID: <m261g2zkqx.fsf@nic.cz>
MIME-Version: 1.0
Content-Type: text/plain
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/q551rJjDKSx4D7Hb9SmycYEIOpE
X-Mailman-Approved-At: Fri, 03 Oct 2014 08:05:54 -0700
Cc: IETF ALTO <alto@ietf.org>, netmod@ietf.org
Subject: Re: [alto] [netmod] Key-value data structures in YANG/JSON encoding
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 02 Oct 2014 13:04:52 -0000

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> writes:

> On Tue, Sep 30, 2014 at 04:31:03PM -0400, Y. Richard Yang wrote:
>  
>> A particular example of using key-value map is the network-map, which is
>> defined as a key-value store to enforce that each named endpoint address
>> group has a unique name. A specific example is in Section 11.2.1.7 of RFC
>> 7285 (http://www.rfc-editor.org/rfc/rfc7285.txt):
>> 
>>          "network-map" : {
>>            "PID1" : {
>>              "ipv4" : [
>>                "192.0.2.0/24",
>>                "198.51.100.0/25"
>>              ]
>>            },
>>            "PID2" : {
>>              "ipv4" : [
>>                "198.51.100.128/25"
>>              ]
>>            },
>>            "PID3" : {
>>              "ipv4" : [
>>                "0.0.0.0/0"
>>              ],
>>              "ipv6" : [
>>                "::/0"
>>              ]
>>            }
>
> Since YANG's native encoding is XML, how would you represent this in
> XML with the restriction that XML element names are defined by the
> data model and all values are in XML elements?

Moreover, even in JSON we have to work with essentially the same schema
as in XML, so as to be able to interpret XPath expressions in the data
model.

So indeed, a new data node type would be needed for this.

Lada

>
> /js
>
> -- 
> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587         Campus Ring 1, 28759 Bremen, Germany
> Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

-- 
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C


From nobody Wed Oct  8 12:32:15 2014
Return-Path: <w.roome@alcatel-lucent.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1DD0A1A0147 for <alto@ietfa.amsl.com>; Wed,  8 Oct 2014 12:32:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.686
X-Spam-Level: 
X-Spam-Status: No, score=-2.686 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.786] autolearn=ham
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 L_yCYQnwBm_e for <alto@ietfa.amsl.com>; Wed,  8 Oct 2014 12:32:02 -0700 (PDT)
Received: from smtp-us.alcatel-lucent.com (us-hpswa-esg-02.alcatel-lucent.com [135.245.18.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 445DE1A016D for <alto@ietf.org>; Wed,  8 Oct 2014 12:32:02 -0700 (PDT)
Received: from us70tusmtp2.zam.alcatel-lucent.com (unknown [135.5.2.64]) by Websense Email Security Gateway with ESMTPS id 6B39A395E959A for <alto@ietf.org>; Wed,  8 Oct 2014 19:31:58 +0000 (GMT)
Received: from usnavsmail2.ndc.alcatel-lucent.com (usnavsmail2.ndc.alcatel-lucent.com [135.3.39.10]) by us70tusmtp2.zam.alcatel-lucent.com (GMO) with ESMTP id s98JW0C6018484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for <alto@ietf.org>; Wed, 8 Oct 2014 15:32:00 -0400
Received: from umail.lucent.com (umail.ndc.lucent.com [135.3.40.61]) by usnavsmail2.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id s98JVxmr017454 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for <alto@ietf.org>; Wed, 8 Oct 2014 14:32:00 -0500
Received: from [135.222.152.71] (wdr-i7mbp2.mh.lucent.com [135.222.152.71]) by umail.lucent.com (8.13.8/TPES) with ESMTP id s98JVvYS029006 for <alto@ietf.org>; Wed, 8 Oct 2014 14:31:59 -0500 (CDT)
User-Agent: Microsoft-MacOutlook/14.4.4.140807
Date: Wed, 08 Oct 2014 15:32:05 -0400
From: Wendy Roome <w.roome@alcatel-lucent.com>
To: IETF ALTO <alto@ietf.org>
Message-ID: <D05B0975.176DD4%w.roome@alcatel-lucent.com>
Thread-Topic: Resource Attributes -- new draft
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
X-Scanned-By: MIMEDefang 2.64 on 135.3.39.10
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/jEGrkri-PHaCXJuJ4-U5zWcC__Q
Subject: [alto] Resource Attributes -- new draft
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 08 Oct 2014 19:32:05 -0000

I just submitted a draft proposal
(https://datatracker.ietf.org/doc/draft-roome-alto-resource-attr/) for
providing additional descriptive information for ALTO services. The draft
defines both the mechanism and an initial set of attributes. While
capabilities tell you want kind of resource this is, and what optional
features it supports, attributes tell you how this resource differs from
other resources of the same type.

Hopefully we can discuss this in November.

	- Wendy Roome




From nobody Thu Oct  9 22:34:04 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E21131A01EF for <alto@ietfa.amsl.com>; Thu,  9 Oct 2014 22:34:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.377
X-Spam-Level: 
X-Spam-Status: No, score=-1.377 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 SuNQuqCf8pAR for <alto@ietfa.amsl.com>; Thu,  9 Oct 2014 22:34:02 -0700 (PDT)
Received: from mail-yk0-x233.google.com (mail-yk0-x233.google.com [IPv6:2607:f8b0:4002:c07::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6A4A51A0123 for <alto@ietf.org>; Thu,  9 Oct 2014 22:34:02 -0700 (PDT)
Received: by mail-yk0-f179.google.com with SMTP id 200so1323743ykr.24 for <alto@ietf.org>; Thu, 09 Oct 2014 22:34:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:from:date:message-id:subject:to:cc:content-type;  bh=uWi5c2q3oPQ7XmT3CNrPubET0zLZsA/1rj1dC+cI7LQ=; b=VTBvY93g3tg6W/HawSUpjYyWE3e7BlBTcyxAOfUDMsumggsyPRaBNauW/JxNMpBR26 YDc8LmdbABEnsIWpUs0FcQ/C3vkt9T/FwUMyBsP6Xypq8MgqeCoPwkI5Cuc9Gq3faba6 4lzirxsd3djDIRKoN/4SkA3qgQlm4EXO7PnJAWt0u3Vr4TLY4FsqlHrS1i87bAMyy1GV w7UajNoamBGYUPVjusMeTvOeJnM7fGNFlLkBMFyZDO7fQRuvcnS3MzDH4aYW+2rTu05t 6Eb8el7i14oCiqBaKVRVWtFmPunbiw3XxjVyD1IsHyXFzVkRnFfWpC/wAvt2LRH+de8T Qr3Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:from:date:message-id:subject:to:cc:content-type;  bh=uWi5c2q3oPQ7XmT3CNrPubET0zLZsA/1rj1dC+cI7LQ=; b=RrQzIvX4je0o6WOp3ovmeYthFf4z5Tm6SMFdARCsZw1lsxsWZw9bKh9IOYhHDE6tvH FxROVj6GqJ42y0JPHuTxLCe+nilU5mke3A6HfNbZ1xHjtex2zoHekEMA78H9s7DUcowE K4zmFMsjK/VxRtNUG93I8A2IQrE4l7H9hl340=
X-Received: by 10.236.132.231 with SMTP id o67mr4221563yhi.146.1412919241743;  Thu, 09 Oct 2014 22:34:01 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.97.10 with HTTP; Thu, 9 Oct 2014 22:33:41 -0700 (PDT)
From: Xiao SHI <xiao.shi@yale.edu>
Date: Fri, 10 Oct 2014 01:33:41 -0400
X-Google-Sender-Auth: kEKdSs1uxdZCHlaJT05LKxiyeaw
Message-ID: <CAFwJzZm3Vm1Fyc6ZyJdGdo4W6wE_4f8WX1_s4P7Cm-H1QoA6DQ@mail.gmail.com>
To: IETF ALTO <alto@ietf.org>
Content-Type: multipart/alternative; boundary=20cf301af95180248405050ae55a
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/p56Y16gJf62UFs2mtoNJvlvI0-k
Cc: Wendy Roome <w.roome@alcatel-lucent.com>
Subject: [alto] YANG Model for ALTO Protocol
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Oct 2014 05:34:04 -0000

--20cf301af95180248405050ae55a
Content-Type: text/plain; charset=UTF-8

Hi all,

Several of us (Michael, Jon, Richard, Wendy) are working on producing a
YANG module specification for the ALTO base protocol (RFC 7285). Some of
our goals include:

(1) What a semantically equivalent YANG module of the ALTO protocol looks
like;

(2) What issues we may encounter;

(3) How we may generate running code based on either YANG or direct JSON
tools.

Our current YANG model can be found at
https://github.com/alto-ietf/ALTO/blob/master/alto-service.yang. It is
still a work-in-progress.

We would like to post the code early to get some feedback from you, and
will submit an internet-draft to document the YANG spec, our experiences
using YANG (and the related tools), and comparisons related to the goals
above.

Your comments will be much appreciated! Thank you so much!

Best,
Xiao

--20cf301af95180248405050ae55a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi all,</div><div><br></div><div>Several of us (Micha=
el, Jon, Richard, Wendy) are working on producing a YANG module specificati=
on for the ALTO base protocol (RFC 7285). Some of our goals include:</div><=
div><br></div><div>(1) What a semantically equivalent YANG module of the AL=
TO protocol looks like;</div><div><br></div><div>(2) What issues we may enc=
ounter;</div><div><br></div><div>(3) How we may generate running code based=
 on either YANG or direct JSON tools.</div><div><br></div><div>Our current =
YANG model can be found at <a href=3D"https://github.com/alto-ietf/ALTO/blo=
b/master/alto-service.yang">https://github.com/alto-ietf/ALTO/blob/master/a=
lto-service.yang</a>. It is still a work-in-progress.</div><div><br></div><=
div>We would like to post the code early to get some feedback from you, and=
 will submit an internet-draft to document the YANG spec, our experiences u=
sing YANG (and the related tools), and comparisons related to the goals abo=
ve.</div><div><br></div><div>Your comments will be much appreciated! Thank =
you so much!</div><div><br></div><div>Best,</div><div>Xiao</div></div>

--20cf301af95180248405050ae55a--


From nobody Fri Oct 10 08:12:57 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1CBDE1A01F7 for <alto@ietfa.amsl.com>; Thu,  9 Oct 2014 22:23:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.018
X-Spam-Level: 
X-Spam-Status: No, score=-1.018 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_FONT_FACE_BAD=0.981, HTML_MESSAGE=0.001, 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 4_SetZdM8dSn for <alto@ietfa.amsl.com>; Thu,  9 Oct 2014 22:23:56 -0700 (PDT)
Received: from mail-yk0-x231.google.com (mail-yk0-x231.google.com [IPv6:2607:f8b0:4002:c07::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E0B161A01EF for <alto@ietf.org>; Thu,  9 Oct 2014 22:23:55 -0700 (PDT)
Received: by mail-yk0-f177.google.com with SMTP id q200so1328832ykb.22 for <alto@ietf.org>; Thu, 09 Oct 2014 22:23:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:from:date:message-id:subject:to:cc:content-type;  bh=nJDS+oNp4fdKEguJFQ7zlO6626anI0VnuZ2OrB21S44=; b=vFtVGO5+9DzPgfAGImB10uo1GyFoK1auoEnJdrVzvlGgpGMuZjNk4KUnd0mezjHRXQ plSIyKjfBIX381IBdLowuttZHYT0qD9hjhG6JGriOCs5tJoAKVrplQ0UxBOZoZ+5uDKA zQZUvVP7hxTg2eLYmxwNUDDAvajg9ImmUMCwnDn8eKUgp50gpj3jiw2+YKr3hy9Qe7WI 1YOnXsGgLBUNU0XDUoVjJx0F1wh4vI7UlRJBeliyn9MWtEOzd5zZ+CXmubJz9AeHeY69 bKtpUhtKwscdwcvCn7l+jvvp309sKQY5CFdEPmhlx3nBu1VQxbA6miJca1Dy11fg2D+8 Ld9g==
X-Received: by 10.236.207.194 with SMTP id n42mr3883006yho.21.1412918635290; Thu, 09 Oct 2014 22:23:55 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.170.97.10 with HTTP; Thu, 9 Oct 2014 22:23:35 -0700 (PDT)
From: Xiao SHI <boxs.jq@gmail.com>
Date: Fri, 10 Oct 2014 01:23:35 -0400
Message-ID: <CAFwJzZnqjiwSUmdMwR6CGSqRy1bNbfd8d9ZfbU--vaWkuUjocQ@mail.gmail.com>
To: IETF ALTO <alto@ietf.org>
Content-Type: multipart/alternative; boundary=089e0163387a5a68e205050ac1a3
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/Lp8-_wXfX4puBKFHScvIFgTbHsA
X-Mailman-Approved-At: Fri, 10 Oct 2014 08:12:56 -0700
Cc: Wendy Roome <w.roome@alcatel-lucent.com>
Subject: [alto] YANG Model for ALTO protocol
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Oct 2014 05:23:57 -0000

--089e0163387a5a68e205050ac1a3
Content-Type: text/plain; charset=UTF-8

Hi all,

Several of us (Michael, Jon, Richard, Wendy) are working on producing a
YANG module specification for the ALTO base protocol (RFC 7285). Some of
our goals include:

(1) What a semantically equivalent YANG module of the ALTO protocol looks
like;

(2) What issues we may encounter;

(3) How we may generate running code based on either YANG or direct JSON
tools.

Our current YANG model can be found at
https://github.com/alto-ietf/ALTO/blob/master/alto-service.yang. It is
still a work-in-progress.

We would like to post the code early to get some feedback from you, and
will submit an internet-draft to document the YANG spec, our experiences
using YANG (and the related tools), and comparisons related to the goals
above.

Your comments will be much appreciated! Thank you so much!

Best,
Xiao

--089e0163387a5a68e205050ac1a3
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div>Hi all,</div><div><br></div><div>Sev=
eral of us (Michael, Jon, Richard, Wendy) are working on producing a YANG m=
odule specification for the ALTO base protocol (RFC 7285). Some of our goal=
s include:</div><div><br></div><div>(1) What a semantically equivalent YANG=
 module of the ALTO protocol looks like;</div><div><br></div><div>(2) What =
issues we may encounter;</div><div><br></div><div>(3) How we may generate r=
unning code based on either YANG or direct JSON tools.</div><div><br></div>=
<div>Our current YANG model can be found at <a href=3D"https://github.com/a=
lto-ietf/ALTO/blob/master/alto-service.yang">https://github.com/alto-ietf/A=
LTO/blob/master/alto-service.yang</a>. It is still a work-in-progress.</div=
><div><br></div><div>We would like to post the code early to get some feedb=
ack from you, and will submit an internet-draft to document the YANG spec, =
our experiences using YANG (and the related tools), and comparisons related=
 to the goals above.</div><div><br></div><div>Your comments will be much ap=
preciated! Thank you so much!</div><div><br></div><div>Best,</div><div>Xiao=
</div></div><font face=3D"&#39;courier new&#39;, monospace"><br></font>
</div>

--089e0163387a5a68e205050ac1a3--


From nobody Fri Oct 10 10:39:25 2014
Return-Path: <sabine.randriamasy@alcatel-lucent.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DC61B1A906D for <alto@ietfa.amsl.com>; Fri, 10 Oct 2014 10:39:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.686
X-Spam-Level: 
X-Spam-Status: No, score=-2.686 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.786] autolearn=ham
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 aPgZLmI1YUH9 for <alto@ietfa.amsl.com>; Fri, 10 Oct 2014 10:39:22 -0700 (PDT)
Received: from smtp-fr.alcatel-lucent.com (fr-hpida-esg-02.alcatel-lucent.com [135.245.210.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2BEFF1A9070 for <alto@ietf.org>; Fri, 10 Oct 2014 10:39:22 -0700 (PDT)
Received: from fr712usmtp2.zeu.alcatel-lucent.com (unknown [135.239.2.42]) by Websense Email Security Gateway with ESMTPS id 01C0FC7963C2F for <alto@ietf.org>; Fri, 10 Oct 2014 17:39:17 +0000 (GMT)
Received: from FR711WXCHHUB01.zeu.alcatel-lucent.com (fr711wxchhub01.zeu.alcatel-lucent.com [135.239.2.111]) by fr712usmtp2.zeu.alcatel-lucent.com (GMO) with ESMTP id s9AHdKgi022132 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Fri, 10 Oct 2014 19:39:20 +0200
Received: from FR711WXCHMBA01.zeu.alcatel-lucent.com ([169.254.1.91]) by FR711WXCHHUB01.zeu.alcatel-lucent.com ([135.239.2.111]) with mapi id 14.03.0195.001; Fri, 10 Oct 2014 19:39:20 +0200
From: "RANDRIAMASY, SABINE (SABINE)" <sabine.randriamasy@alcatel-lucent.com>
To: "ROOME, Wendy D (Wendy)" <w.roome@alcatel-lucent.com>, IETF ALTO <alto@ietf.org>
Thread-Topic: Resource Attributes -- new draft
Thread-Index: AQHP4y6ehJ+kaUvMV02S6d8988HiVZwpmyIQ
Date: Fri, 10 Oct 2014 17:39:19 +0000
Message-ID: <A7A5844EB93EB94AB22C2068B10AD65A6ADD97EF@FR711WXCHMBA01.zeu.alcatel-lucent.com>
References: <D05B0975.176DD4%w.roome@alcatel-lucent.com>
In-Reply-To: <D05B0975.176DD4%w.roome@alcatel-lucent.com>
Accept-Language: fr-FR, en-US
Content-Language: fr-FR
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [135.239.27.41]
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/GwoNsjzF20bOIKrYlv6KPF_bfCg
Subject: Re: [alto] Resource Attributes -- new draft
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Oct 2014 17:39:24 -0000

Hi Wendy,


I find this proposal very useful and agree with the simplicity of having at=
tributes rather than capabilities.=20

Here are some questions hoping they're clear:

- section 1.1: I didn't get the meaning of  "A client deduce attributes by =
using the resource. Capabilities cannot be deduced"

- In the example IRD and sections 3.3 there are 2 terms: "authoritative-pre=
fixes" and "authoritative-exclusions" that are sets of prefixes.  In Sectio=
n 3.4 they are characterized by 3 points (i.e. more detail). Section 3.4 th=
en  "define the authoritative set with two sets of prefixes, one  inclusive=
, the other exclusive".  Does this mean that the "inclusive" set is the "au=
thoritative-prefixes" set?=20

- section 5:=20
* I'm fine with using "attributes" as I understand this term expresses that=
 there is additional information on the resource object  e.g. "xxx-map"
** w.r.t. the term authoritative, then how about integrating the term "prov=
ider" in the attribute to form something like "provider-prefixes-incl" or "=
provider-documented"? =20

- in general: if we take the set of "authoritative-prefixes": is it possibl=
e one of these sets, say "1.2.0.0/16",  a specific level of detail is provi=
ded, that is not provided on another set of the "authoritative prefixes", s=
ay a particular endpoint cost on metric or property. If yes, can the IRD ad=
vertise a resource "numerical-metricX-cost-map" available on some custom su=
b-domain that would have an attribute like "authoritative prefixes" : "1.2.=
0.0/16". This would offer flexibility and scalability to the provider of th=
e ALTO Server and allow the client to get directly to the focused informati=
on instead of having to download and cross-match large  cost-maps.=20

Thanks,
Sabine

>>-----Message d'origine-----
>>De=A0: alto [mailto:alto-bounces@ietf.org] De la part de Wendy Roome
>>Envoy=E9=A0: mercredi 8 octobre 2014 21:32
>>=C0=A0: IETF ALTO
>>Objet=A0: [alto] Resource Attributes -- new draft
>>
>>I just submitted a draft proposal
>>(https://datatracker.ietf.org/doc/draft-roome-alto-resource-attr/) for
>>providing additional descriptive information for ALTO services. The
>>draft defines both the mechanism and an initial set of attributes.
>>While capabilities tell you want kind of resource this is, and what
>>optional features it supports, attributes tell you how this resource
>>differs from other resources of the same type.
>>
>>Hopefully we can discuss this in November.
>>
>>	- Wendy Roome
>>
>>
>>
>>_______________________________________________
>>alto mailing list
>>alto@ietf.org
>>https://www.ietf.org/mailman/listinfo/alto


From nobody Fri Oct 10 13:56:13 2014
Return-Path: <w.roome@alcatel-lucent.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CED621AD388 for <alto@ietfa.amsl.com>; Fri, 10 Oct 2014 13:56:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.685
X-Spam-Level: 
X-Spam-Status: No, score=-2.685 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, MIME_QP_LONG_LINE=0.001, RP_MATCHES_RCVD=-0.786] autolearn=ham
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 MQHRFt9eI4xb for <alto@ietfa.amsl.com>; Fri, 10 Oct 2014 13:56:08 -0700 (PDT)
Received: from smtp-us.alcatel-lucent.com (us-hpatc-esg-01.alcatel-lucent.com [135.245.18.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E87671AD387 for <alto@ietf.org>; Fri, 10 Oct 2014 13:56:03 -0700 (PDT)
Received: from us70uusmtp3.zam.alcatel-lucent.com (unknown [135.5.2.65]) by Websense Email Security Gateway with ESMTPS id 9FDEF751A11C7 for <alto@ietf.org>; Fri, 10 Oct 2014 20:55:59 +0000 (GMT)
Received: from usnavsmail3.ndc.alcatel-lucent.com (usnavsmail3.ndc.alcatel-lucent.com [135.3.39.11]) by us70uusmtp3.zam.alcatel-lucent.com (GMO) with ESMTP id s9AKu2NP019410 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for <alto@ietf.org>; Fri, 10 Oct 2014 16:56:02 -0400
Received: from umail.lucent.com (umail.ndc.lucent.com [135.3.40.61]) by usnavsmail3.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id s9AKu2Jd011408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for <alto@ietf.org>; Fri, 10 Oct 2014 15:56:02 -0500
Received: from [135.222.152.71] (wdr-i7mbp2.mh.lucent.com [135.222.152.71]) by umail.lucent.com (8.13.8/TPES) with ESMTP id s9AKu08p016250 for <alto@ietf.org>; Fri, 10 Oct 2014 15:56:01 -0500 (CDT)
User-Agent: Microsoft-MacOutlook/14.4.4.140807
Date: Fri, 10 Oct 2014 16:56:13 -0400
From: Wendy Roome <w.roome@alcatel-lucent.com>
To: <alto@ietf.org>
Message-ID: <D05DBA7A.17A004%w.roome@alcatel-lucent.com>
Thread-Topic: [alto] Resource Attributes -- new draft
Mime-version: 1.0
Content-type: text/plain; charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable
X-Scanned-By: MIMEDefang 2.64 on 135.3.39.11
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/W2aID02M9UChLI7Nnf2uXLQEO5o
Subject: Re: [alto] Resource Attributes -- new draft
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Oct 2014 20:56:11 -0000

See inline.

On 10/10/2014, 15:00, "alto-request@ietf.org" <alto-request@ietf.org>
wrote:

>Date: Fri, 10 Oct 2014 17:39:19 +0000
>From: "RANDRIAMASY, SABINE (SABINE)"
>	<sabine.randriamasy@alcatel-lucent.com>
>Subject: Re: [alto] Resource Attributes -- new draft
>Message-ID:
>	<A7A5844EB93EB94AB22C2068B10AD65A6ADD97EF@FR711WXCHMBA01.zeu.alcatel-luce
>nt.com>
>
>Hi Wendy,
>
>
>I find this proposal very useful and agree with the simplicity of having
>attributes rather than capabilities.

Thanks!  And thanks for the comments. They were very helpful.

>
>Here are some questions hoping they're clear:
>
>- section 1.1: I didn't get the meaning of  "A client deduce attributes
>by using the resource. Capabilities cannot be deduced"

I was trying to say the a client could figure out the attributes from the
data (perhaps with some work). But that=B9s not really true. And a client
could deduce some capabilities from the data.

So I=B9ll drop that paragraph.


>- In the example IRD and sections 3.3 there are 2 terms:
>"authoritative-prefixes" and "authoritative-exclusions" that are sets of
>prefixes.  In Section 3.4 they are characterized by 3 points (i.e. more
>detail). Section 3.4 then  "define the authoritative set with two sets of
>prefixes, one  inclusive, the other exclusive".  Does this mean that the
>"inclusive" set is the "authoritative-prefixes" set?

Yes.  I=B9ll rewrite that to make it clearer.

>- section 5:
>* I'm fine with using "attributes" as I understand this term expresses
>that there is additional information on the resource object  e.g.
>"xxx-map"
>** w.r.t. the term authoritative, then how about integrating the term
>"provider" in the attribute to form something like
>"provider-prefixes-incl" or "provider-documented"?

I=B9m reluctant to use =B3provider=B2, because while it probably will be an ISP,
that is not a requirement. Anyone else care to comment?

>- in general: if we take the set of "authoritative-prefixes": is it
>possible one of these sets, say "1.2.0.0/16",  a specific level of detail
>is provided, that is not provided on another set of the "authoritative
>prefixes", say a particular endpoint cost on metric or property. If yes,
>can the IRD advertise a resource "numerical-metricX-cost-map" available
>on some custom sub-domain that would have an attribute like
>"authoritative prefixes" : "1.2.0.0/16". This would offer flexibility and
>scalability to the provider of the ALTO Server and allow the client to
>get directly to the focused information instead of having to download and
>cross-match large  cost-maps.
>
>Thanks,
>Sabine

Are you asking if an ALTO server could define one network map, for say
1.0.0.0/8, with a large number of PIDs and a lot of detail for that entire
space, plus a separate network map for (say) just 1.3.0.0/16, with a
subset of the big map? The second Network Map (and associated Cost Maps)
would have the same level of detail for that 1.3.0.0/16 subset, but less
detail for the rest of the ISP=B9s space. But because those maps are
smaller, clients who are only interested in that /16 subset would prefer
them.

If so, yes. I hadn=B9t thought of that, but that=B9s a good idea.

On the other hand, my proposal does tie the =B3authoritative set=B2 notion to
the Network Map, not the Cost Maps. Thus I assume that all Cost Maps
associated with a Network Map are authoritative for all addresses in the
Network Map=B9s authoritative set. In particular, every Cost Map has costs
for all addresses in the Network Map=B9s authoritative set.

We could handle Cost Maps with different authoritative sets by allowing
Cost Maps to have authoritative sets as well as Network Maps. However, I=B9m
reluctant to add that level of complexity unless there=B9s a real need.
Particularly because a server can accomplish that by defining a new
Network Map.

	- Wendy Roome



From nobody Sat Oct 11 22:43:52 2014
Return-Path: <xinwang2014@hotmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 378551A8895 for <alto@ietfa.amsl.com>; Sat, 11 Oct 2014 22:43:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.236
X-Spam-Level: 
X-Spam-Status: No, score=-0.236 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, MIME_8BIT_HEADER=0.3, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.786, SPF_PASS=-0.001] autolearn=ham
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 9wgK6-_94QRA for <alto@ietfa.amsl.com>; Sat, 11 Oct 2014 22:43:50 -0700 (PDT)
Received: from SNT004-OMC2S39.hotmail.com (snt004-omc2s39.hotmail.com [65.54.61.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1A3DD1A8894 for <alto@ietf.org>; Sat, 11 Oct 2014 22:43:50 -0700 (PDT)
Received: from SNT150-W38 ([65.55.90.71]) by SNT004-OMC2S39.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751);  Sat, 11 Oct 2014 22:43:49 -0700
X-TMN: [tATGKLEoeB87s5mvty41hot+VZq4n3F/]
X-Originating-Email: [xinwang2014@hotmail.com]
Message-ID: <SNT150-W38AB1609BB9A009C758124A8AF0@phx.gbl>
Content-Type: multipart/alternative; boundary="_74f460af-be37-4a5d-af7a-f116022244d4_"
From: wangxin <xinwang2014@hotmail.com>
To: "alto@ietf.org" <alto@ietf.org>
Date: Sun, 12 Oct 2014 05:43:49 +0000
Importance: Normal
MIME-Version: 1.0
X-OriginalArrivalTime: 12 Oct 2014 05:43:49.0710 (UTC) FILETIME=[7F87AEE0:01CFE5DF]
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/iBKlJ191PagrfX_YGR7C4dSBMzM
Subject: Re: [alto] =?cp1256?q?YANG_Model_for_ALTO_Protocol=FE?=
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 12 Oct 2014 05:43:51 -0000

--_74f460af-be37-4a5d-af7a-f116022244d4_
Content-Type: text/plain; charset="windows-1256"
Content-Transfer-Encoding: base64

SGVyZSBJIGhhdmUgc2V2ZXJhbCBxdWVzdGlvbnM6IDEuICAgICAgIEkgdGhpbmsgdGhlcmUgYXJl
IHNvbWUgZGVwZW5kZW5jaWVzIGJldHdlZW4gY29uc3RyYWlucyBhbmQgY2FwYWJpbGl0aWVzLCBh
cyBSRkM3Mjg1IHNheXMgk1RoaXMgcGFyYW1ldGVyIE1VU1QgTk9UIGJlIHNwZWNpZmllZCBpZiB0
aGlzIHJlc291cmNlJ3MgImNhcGFiaWxpdGllcyIgZmllbGQgKFNlY3Rpb24gMTEuMy4yLjQpIGlu
ZGljYXRlIHRoYXQgY29uc3RyYWludCBzdXBwb3J0IGlzIG5vdCBhdmFpbGFibGUulCBTbywgaG93
IHRvIGltcGx5IHRoaXMgZGVwZW5kZW5jeSBpbiBZQU5HIG1vZGVsPyBJbiBsaW5lIDg2OSwgaXQg
c2VlbXMgdGhhdCB0aGVyZSBpcyBub3QgYSBjaGVjayB3aGV0aGVyIHJlc291cmNlJ3MgImNhcGFi
aWxpdGllcyIgZmllbGQgaXMgYXZhaWxhYmxlLg0KMi4gICAgICAgSW4gbGluZSAzOTUsIGl0IHNl
ZW1zIHRoYXQgdGhlcmUgaXMgYWx3YXlzIHZlcnNpb24gdGFnIGluIG1ldGEgZmllbGQsIGJ1dCBJ
IHRoaW5rIElSRCByZXNwb25zZSBkb2VzIG5vdCBuZWVkIHZlcnNpb24gdGFnIGluIGl0cyBoZWFk
ZXIuDQozLiAgICAgICBJbiBsaW5lIDczNywgZG9lcyB0aGVyZSBuZWVkIGNhcGFiaWxpdGllcyBm
aWVsZCBmb3IgdGhlIG91dHB1dCBvZiBlbmRwb2ludC1wcm9wZXJ0eS1zZXJ2aWNlIGFuZCBmaWx0
ZXJlZC1jb3N0LW1hcC1zZXJ2aWNlKGxpbmUgNzUwKT8gSSB0aGluayBjYXBhYmlsaXRpZXMgaXMg
Zm9yIElSRCByZXNwb25zZS4gSSBhbSBhIGJlZ2lubmVyIG9mIGFsdG8gYW5kIFlBTkcsIHNvIGlm
IHRoZXJlIGlzIGFueSBiYXNpYyBtaXN1bmRlcnN0YW5kaW5nLCBwbGVhc2UgZm9yZ2l2ZSBtZS4N
ClRoYW5rcyFYaW4KCgoKIAkJIAkgICAJCSAg

--_74f460af-be37-4a5d-af7a-f116022244d4_
Content-Type: text/html; charset="windows-1256"
Content-Transfer-Encoding: base64

PGh0bWw+DQo8aGVhZD4NCjxzdHlsZT48IS0tDQouaG1tZXNzYWdlIFANCnsNCm1hcmdpbjowcHg7
DQpwYWRkaW5nOjBweA0KfQ0KYm9keS5obW1lc3NhZ2UNCnsNCmZvbnQtc2l6ZTogMTJwdDsNCmZv
bnQtZmFtaWx5Oj8/Pz8NCn0NCi0tPjwvc3R5bGU+PC9oZWFkPg0KPGJvZHkgY2xhc3M9J2htbWVz
c2FnZSc+PGRpdiBkaXI9J2x0cic+PHAgY2xhc3M9ImVjeE1zb05vcm1hbCIgc3R5bGU9ImxpbmUt
aGVpZ2h0OiAyMS4yOTk5OTkyMzcwNjA1NDdweDsgbWFyZ2luLWJvdHRvbTogMS4zNWVtOyBjb2xv
cjogcmdiKDY4LCA2OCwgNjgpOyBmb250LWZhbWlseTogJ01pY3Jvc29mdCBZYUhlaSBVSScsICdN
aWNyb3NvZnQgWWFIZWknLCA/PywgQ2FsaWJyaSwgc2Fucy1zZXJpZjsgZm9udC1zaXplOiAxNXB4
OyBiYWNrZ3JvdW5kLWNvbG9yOiByZ2IoMjU1LCAyNTUsIDI1NSk7Ij48c3BhbiBsYW5nPSJFTi1V
UyI+SGVyZSBJIGhhdmUgc2V2ZXJhbCBxdWVzdGlvbnM6PC9zcGFuPjwvcD48cCBjbGFzcz0iZWN4
TXNvTm9ybWFsIiBzdHlsZT0ibGluZS1oZWlnaHQ6IDIxLjI5OTk5OTIzNzA2MDU0N3B4OyBtYXJn
aW4tYm90dG9tOiAxLjM1ZW07IGNvbG9yOiByZ2IoNjgsIDY4LCA2OCk7IGZvbnQtZmFtaWx5OiAn
TWljcm9zb2Z0IFlhSGVpIFVJJywgJ01pY3Jvc29mdCBZYUhlaScsID8/LCBDYWxpYnJpLCBzYW5z
LXNlcmlmOyBmb250LXNpemU6IDE1cHg7IGJhY2tncm91bmQtY29sb3I6IHJnYigyNTUsIDI1NSwg
MjU1KTsiPjxzcGFuIGxhbmc9IkVOLVVTIj4mbmJzcDs8L3NwYW4+PC9wPjxwIGNsYXNzPSJlY3hN
c29MaXN0UGFyYWdyYXBoIiBzdHlsZT0ibGluZS1oZWlnaHQ6IDIxLjI5OTk5OTIzNzA2MDU0N3B4
OyBtYXJnaW4tYm90dG9tOiAxLjM1ZW07IGNvbG9yOiByZ2IoNjgsIDY4LCA2OCk7IGZvbnQtZmFt
aWx5OiAnTWljcm9zb2Z0IFlhSGVpIFVJJywgJ01pY3Jvc29mdCBZYUhlaScsID8/LCBDYWxpYnJp
LCBzYW5zLXNlcmlmOyBmb250LXNpemU6IDE1cHg7IGJhY2tncm91bmQtY29sb3I6IHJnYigyNTUs
IDI1NSwgMjU1KTsgdGV4dC1pbmRlbnQ6IC0xOHB0OyI+PHNwYW4gbGFuZz0iRU4tVVMiPjEuPHNw
YW4gc3R5bGU9ImxpbmUtaGVpZ2h0OiAxNy4wNDAwMDA5MTU1MjczNDRweDsgZm9udC1zaXplOiA3
cHQ7IGZvbnQtZmFtaWx5OiAnVGltZXMgTmV3IFJvbWFuJzsiPiZuYnNwOyZuYnNwOyZuYnNwOyZu
YnNwOyZuYnNwOyZuYnNwOyZuYnNwOzwvc3Bhbj48L3NwYW4+PHNwYW4gbGFuZz0iRU4tVVMiPkkg
dGhpbmsgdGhlcmUgYXJlIHNvbWUgZGVwZW5kZW5jaWVzIGJldHdlZW4gY29uc3RyYWlucyBhbmQg
Y2FwYWJpbGl0aWVzLCBhcyBSRkM3Mjg1IHNheXMgk1RoaXMgcGFyYW1ldGVyIE1VU1QgTk9UIGJl
IHNwZWNpZmllZCBpZiB0aGlzIHJlc291cmNlJ3MgImNhcGFiaWxpdGllcyIgZmllbGQgKFNlY3Rp
b24gMTEuMy4yLjQpIGluZGljYXRlIHRoYXQgY29uc3RyYWludCBzdXBwb3J0IGlzIG5vdCBhdmFp
bGFibGUulCBTbywgaG93IHRvIGltcGx5IHRoaXMgZGVwZW5kZW5jeSBpbiBZQU5HIG1vZGVsPyBJ
biBsaW5lIDg2OSwgaXQgc2VlbXMgdGhhdCB0aGVyZSBpcyBub3QgYSBjaGVjayB3aGV0aGVyIHJl
c291cmNlJ3MgImNhcGFiaWxpdGllcyIgZmllbGQgaXMgYXZhaWxhYmxlLjwvc3Bhbj48L3A+PHAg
Y2xhc3M9ImVjeE1zb0xpc3RQYXJhZ3JhcGgiIHN0eWxlPSJsaW5lLWhlaWdodDogMjEuMjk5OTk5
MjM3MDYwNTQ3cHg7IG1hcmdpbi1ib3R0b206IDEuMzVlbTsgY29sb3I6IHJnYig2OCwgNjgsIDY4
KTsgZm9udC1mYW1pbHk6ICdNaWNyb3NvZnQgWWFIZWkgVUknLCAnTWljcm9zb2Z0IFlhSGVpJywg
Pz8sIENhbGlicmksIHNhbnMtc2VyaWY7IGZvbnQtc2l6ZTogMTVweDsgYmFja2dyb3VuZC1jb2xv
cjogcmdiKDI1NSwgMjU1LCAyNTUpOyB0ZXh0LWluZGVudDogLTE4cHQ7Ij48c3BhbiBsYW5nPSJF
Ti1VUyI+PGJyPjwvc3Bhbj48L3A+PHAgY2xhc3M9ImVjeE1zb0xpc3RQYXJhZ3JhcGgiIHN0eWxl
PSJsaW5lLWhlaWdodDogMjEuMjk5OTk5MjM3MDYwNTQ3cHg7IG1hcmdpbi1ib3R0b206IDEuMzVl
bTsgY29sb3I6IHJnYig2OCwgNjgsIDY4KTsgZm9udC1mYW1pbHk6ICdNaWNyb3NvZnQgWWFIZWkg
VUknLCAnTWljcm9zb2Z0IFlhSGVpJywgPz8sIENhbGlicmksIHNhbnMtc2VyaWY7IGZvbnQtc2l6
ZTogMTVweDsgYmFja2dyb3VuZC1jb2xvcjogcmdiKDI1NSwgMjU1LCAyNTUpOyB0ZXh0LWluZGVu
dDogLTE4cHQ7Ij48c3BhbiBsYW5nPSJFTi1VUyI+Mi48c3BhbiBzdHlsZT0ibGluZS1oZWlnaHQ6
IDE3LjA0MDAwMDkxNTUyNzM0NHB4OyBmb250LXNpemU6IDdwdDsgZm9udC1mYW1pbHk6ICdUaW1l
cyBOZXcgUm9tYW4nOyI+Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7
PC9zcGFuPjwvc3Bhbj48c3BhbiBsYW5nPSJFTi1VUyI+SW4gbGluZSAzOTUsIGl0IHNlZW1zIHRo
YXQgdGhlcmUgaXMgYWx3YXlzIHZlcnNpb24gdGFnIGluIG1ldGEgZmllbGQsIGJ1dCBJIHRoaW5r
IElSRCByZXNwb25zZSBkb2VzIG5vdCBuZWVkIHZlcnNpb24gdGFnIGluIGl0cyBoZWFkZXIuPC9z
cGFuPjwvcD48cCBjbGFzcz0iZWN4TXNvTGlzdFBhcmFncmFwaCIgc3R5bGU9ImxpbmUtaGVpZ2h0
OiAyMS4yOTk5OTkyMzcwNjA1NDdweDsgbWFyZ2luLWJvdHRvbTogMS4zNWVtOyBjb2xvcjogcmdi
KDY4LCA2OCwgNjgpOyBmb250LWZhbWlseTogJ01pY3Jvc29mdCBZYUhlaSBVSScsICdNaWNyb3Nv
ZnQgWWFIZWknLCA/PywgQ2FsaWJyaSwgc2Fucy1zZXJpZjsgZm9udC1zaXplOiAxNXB4OyBiYWNr
Z3JvdW5kLWNvbG9yOiByZ2IoMjU1LCAyNTUsIDI1NSk7IHRleHQtaW5kZW50OiAtMThwdDsiPjxz
cGFuIGxhbmc9IkVOLVVTIj48YnI+PC9zcGFuPjwvcD48cCBjbGFzcz0iZWN4TXNvTGlzdFBhcmFn
cmFwaCIgc3R5bGU9ImxpbmUtaGVpZ2h0OiAyMS4yOTk5OTkyMzcwNjA1NDdweDsgbWFyZ2luLWJv
dHRvbTogMS4zNWVtOyBjb2xvcjogcmdiKDY4LCA2OCwgNjgpOyBmb250LWZhbWlseTogJ01pY3Jv
c29mdCBZYUhlaSBVSScsICdNaWNyb3NvZnQgWWFIZWknLCA/PywgQ2FsaWJyaSwgc2Fucy1zZXJp
ZjsgZm9udC1zaXplOiAxNXB4OyBiYWNrZ3JvdW5kLWNvbG9yOiByZ2IoMjU1LCAyNTUsIDI1NSk7
IHRleHQtaW5kZW50OiAtMThwdDsiPjxzcGFuIGxhbmc9IkVOLVVTIj4zLjxzcGFuIHN0eWxlPSJs
aW5lLWhlaWdodDogMTcuMDQwMDAwOTE1NTI3MzQ0cHg7IGZvbnQtc2l6ZTogN3B0OyBmb250LWZh
bWlseTogJ1RpbWVzIE5ldyBSb21hbic7Ij4mbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsm
bmJzcDsmbmJzcDs8L3NwYW4+PC9zcGFuPjxzcGFuIGxhbmc9IkVOLVVTIj5JbiBsaW5lIDczNywg
ZG9lcyB0aGVyZSBuZWVkIGNhcGFiaWxpdGllcyBmaWVsZCBmb3IgdGhlIG91dHB1dCBvZiBlbmRw
b2ludC1wcm9wZXJ0eS1zZXJ2aWNlIGFuZCBmaWx0ZXJlZC1jb3N0LW1hcC1zZXJ2aWNlKGxpbmUg
NzUwKT8gSSB0aGluayBjYXBhYmlsaXRpZXMgaXMgZm9yIElSRCByZXNwb25zZS48L3NwYW4+PC9w
PjxwIGNsYXNzPSJlY3hNc29Ob3JtYWwiIHN0eWxlPSJsaW5lLWhlaWdodDogMjEuMjk5OTk5MjM3
MDYwNTQ3cHg7IG1hcmdpbi1ib3R0b206IDEuMzVlbTsgY29sb3I6IHJnYig2OCwgNjgsIDY4KTsg
Zm9udC1mYW1pbHk6ICdNaWNyb3NvZnQgWWFIZWkgVUknLCAnTWljcm9zb2Z0IFlhSGVpJywgPz8s
IENhbGlicmksIHNhbnMtc2VyaWY7IGZvbnQtc2l6ZTogMTVweDsgYmFja2dyb3VuZC1jb2xvcjog
cmdiKDI1NSwgMjU1LCAyNTUpOyI+PHNwYW4gbGFuZz0iRU4tVVMiPiZuYnNwOzwvc3Bhbj48L3A+
PHAgY2xhc3M9ImVjeE1zb05vcm1hbCIgc3R5bGU9ImxpbmUtaGVpZ2h0OiAyMS4yOTk5OTkyMzcw
NjA1NDdweDsgbWFyZ2luLWJvdHRvbTogMS4zNWVtOyBjb2xvcjogcmdiKDY4LCA2OCwgNjgpOyBm
b250LWZhbWlseTogJ01pY3Jvc29mdCBZYUhlaSBVSScsICdNaWNyb3NvZnQgWWFIZWknLCA/Pywg
Q2FsaWJyaSwgc2Fucy1zZXJpZjsgZm9udC1zaXplOiAxNXB4OyBiYWNrZ3JvdW5kLWNvbG9yOiBy
Z2IoMjU1LCAyNTUsIDI1NSk7Ij48c3BhbiBsYW5nPSJFTi1VUyI+SSBhbSBhIGJlZ2lubmVyIG9m
IGFsdG8gYW5kIFlBTkcsIHNvIGlmIHRoZXJlIGlzIGFueSBiYXNpYyBtaXN1bmRlcnN0YW5kaW5n
LCBwbGVhc2UgZm9yZ2l2ZSBtZS48L3NwYW4+PC9wPjxwIGNsYXNzPSJlY3hNc29Ob3JtYWwiIHN0
eWxlPSJsaW5lLWhlaWdodDogMjEuMjk5OTk5MjM3MDYwNTQ3cHg7IG1hcmdpbi1ib3R0b206IDEu
MzVlbTsgY29sb3I6IHJnYig2OCwgNjgsIDY4KTsgZm9udC1mYW1pbHk6ICdNaWNyb3NvZnQgWWFI
ZWkgVUknLCAnTWljcm9zb2Z0IFlhSGVpJywgPz8sIENhbGlicmksIHNhbnMtc2VyaWY7IGZvbnQt
c2l6ZTogMTVweDsgYmFja2dyb3VuZC1jb2xvcjogcmdiKDI1NSwgMjU1LCAyNTUpOyI+PGJyPjwv
cD48cCBjbGFzcz0iZWN4TXNvTm9ybWFsIiBzdHlsZT0ibGluZS1oZWlnaHQ6IDIxLjI5OTk5OTIz
NzA2MDU0N3B4OyBtYXJnaW4tYm90dG9tOiAxLjM1ZW07IGNvbG9yOiByZ2IoNjgsIDY4LCA2OCk7
IGZvbnQtZmFtaWx5OiAnTWljcm9zb2Z0IFlhSGVpIFVJJywgJ01pY3Jvc29mdCBZYUhlaScsID8/
LCBDYWxpYnJpLCBzYW5zLXNlcmlmOyBmb250LXNpemU6IDE1cHg7IGJhY2tncm91bmQtY29sb3I6
IHJnYigyNTUsIDI1NSwgMjU1KTsiPjxzcGFuIGxhbmc9IkVOLVVTIj5UaGFua3MhPC9zcGFuPjwv
cD48cCBjbGFzcz0iZWN4TXNvTm9ybWFsIiBzdHlsZT0ibGluZS1oZWlnaHQ6IDIxLjI5OTk5OTIz
NzA2MDU0N3B4OyBtYXJnaW4tYm90dG9tOiAxLjM1ZW07IGNvbG9yOiByZ2IoNjgsIDY4LCA2OCk7
IGZvbnQtZmFtaWx5OiAnTWljcm9zb2Z0IFlhSGVpIFVJJywgJ01pY3Jvc29mdCBZYUhlaScsID8/
LCBDYWxpYnJpLCBzYW5zLXNlcmlmOyBmb250LXNpemU6IDE1cHg7IGJhY2tncm91bmQtY29sb3I6
IHJnYigyNTUsIDI1NSwgMjU1KTsiPjxzcGFuIGxhbmc9IkVOLVVTIj5YaW48L3NwYW4+PC9wPgoK
PHN0eWxlPjwhLS0KLmhtbWVzc2FnZSBQCnsKbWFyZ2luOjBweDsKcGFkZGluZzowcHgKfQpib2R5
LmhtbWVzc2FnZQp7CmZvbnQtc2l6ZTogMTJwdDsKZm9udC1mYW1pbHk6Pz8/Pwp9Ci0tPjwvc3R5
bGU+CjxkaXYgZGlyPSJsdHIiPjwvZGl2PgogCQkgCSAgIAkJICA8L2Rpdj48L2JvZHk+DQo8L2h0
bWw+

--_74f460af-be37-4a5d-af7a-f116022244d4_--


From nobody Sun Oct 12 01:53:27 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EED9F1A898B for <alto@ietfa.amsl.com>; Sun, 12 Oct 2014 01:53:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.077
X-Spam-Level: 
X-Spam-Status: No, score=-1.077 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 hgeJWyp8fZWp for <alto@ietfa.amsl.com>; Sun, 12 Oct 2014 01:53:23 -0700 (PDT)
Received: from mail-yh0-x22b.google.com (mail-yh0-x22b.google.com [IPv6:2607:f8b0:4002:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 466A51A8983 for <alto@ietf.org>; Sun, 12 Oct 2014 01:53:23 -0700 (PDT)
Received: by mail-yh0-f43.google.com with SMTP id f73so2925424yha.30 for <alto@ietf.org>; Sun, 12 Oct 2014 01:53:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=6ZGis4MYt/kOx01Mq+d1QNgnbovdkMkHp7nOS/k7/1Y=; b=OuMfDBKof9jy7NHW+6vUOFIta0TqqilsWnXXFcxVphVZt/OuMyDDWbKBppsQdcma0s jvXddr6UUEstOzaCZr81wSRIJsuuWHBPZChJxuyHCOSMT2meAH6w+Kb4dqj4YXybqeiJ hgcKrWQLo6RNSpD5V1mRxu1Yr2Belv++m377T6wAwKqkXPsrIbZZtS7xBec9yC+aT6BD GBocK5gF7OthtjZBYZX2+1N5gHtP5uA7PDrsKtcHS0p7oU9+knnmoBLtObuqTrPdXndO 3aM458BR7ofOArtckok0XulKPU/iCPZFSFGf/cu28jInFTlSgcuNpTxACnEpxIEE/Cj6 CB6w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=6ZGis4MYt/kOx01Mq+d1QNgnbovdkMkHp7nOS/k7/1Y=; b=QKk89tcXmJqE8ouP1LqTfsmY+e10SsMLta3lrNTzKWV/XSV3QijQPs0dfQ05I76Aw+ iuapDrozUR8PGl2EHt6/OT18BrTLY/kHY8a+Gbcp3v+cW3zR3Kl7jh223MWTRTZsgdvZ 0ngkTKTlatpoN12T4wa3O2+ag+EZRo92QGuUE=
X-Received: by 10.236.105.226 with SMTP id k62mr20771717yhg.113.1413104002434;  Sun, 12 Oct 2014 01:53:22 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.97.10 with HTTP; Sun, 12 Oct 2014 01:53:02 -0700 (PDT)
In-Reply-To: <SNT150-W38AB1609BB9A009C758124A8AF0@phx.gbl>
References: <SNT150-W38AB1609BB9A009C758124A8AF0@phx.gbl>
From: Xiao SHI <xiao.shi@yale.edu>
Date: Sun, 12 Oct 2014 04:53:02 -0400
X-Google-Sender-Auth: wNkn7MHjDU2f2v6AvAwTtgppLoU
Message-ID: <CAFwJzZmGxBKA7Sh6a5oPp_Bf-Tz77Wnnv3R0Lob4mUJqqsVUbg@mail.gmail.com>
To: wangxin <xinwang2014@hotmail.com>
Content-Type: multipart/alternative; boundary=089e0160b8c418913c050535ea39
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/IUleE5GwHHoVgbVbdz8W-_11Bag
Cc: "alto@ietf.org" <alto@ietf.org>
Subject: Re: [alto] =?utf-8?q?YANG_Model_for_ALTO_Protocol=E2=80=8F?=
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 12 Oct 2014 08:53:25 -0000

--089e0160b8c418913c050535ea39
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Thanks for the feedback! Please see inline.

On Sun, Oct 12, 2014 at 1:43 AM, wangxin <xinwang2014@hotmail.com> wrote:

> Here I have several questions:
>
>
>
> 1.       I think there are some dependencies between constrains and
> capabilities, as RFC7285 says =E2=80=9CThis parameter MUST NOT be specifi=
ed if this
> resource's "capabilities" field (Section 11.3.2.4) indicate that constrai=
nt
> support is not available.=E2=80=9D So, how to imply this dependency in YA=
NG model?
> In line 869, it seems that there is not a check whether resource's
> "capabilities" field is available.
>
 [sx] Good catch! I added a line to express this constraint. On the other
hand, I am not sure the burden of this constraint should fall on the server
side, since this is in rpc-input.

>
> 2.       In line 395, it seems that there is always version tag in meta
> field, but I think IRD response does not need version tag in its header.
>
[sx] You're totally right. I fixed it.

>
> 3.       In line 737, does there need capabilities field for the output
> of endpoint-property-service and filtered-cost-map-service(line 750)? I
> think capabilities is for IRD response.
>
[sx] See 11.4.1.4. and 11.3.2.4. They are not in the ALTO examples as they
are optional fields I believe.

-Xiao

>
>
> I am a beginner of alto and YANG, so if there is any basic
> misunderstanding, please forgive me.
>
>
> Thanks!
>
> Xin
>
> _______________________________________________
> alto mailing list
> alto@ietf.org
> https://www.ietf.org/mailman/listinfo/alto
>
>

--089e0160b8c418913c050535ea39
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanks for the feedback! Please see inline.<div class=3D"g=
mail_extra"><br><div class=3D"gmail_quote">On Sun, Oct 12, 2014 at 1:43 AM,=
 wangxin <span dir=3D"ltr">&lt;<a href=3D"mailto:xinwang2014@hotmail.com" t=
arget=3D"_blank">xinwang2014@hotmail.com</a>&gt;</span> wrote:<br><blockquo=
te class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-widt=
h:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-le=
ft:1ex">


<div><div dir=3D"ltr"><p><span lang=3D"EN-US">Here I have several questions=
:</span></p><p><span lang=3D"EN-US">=C2=A0</span></p><p><span lang=3D"EN-US=
">1.<span style=3D"line-height:17.040000915527344px;font-size:7pt;font-fami=
ly:&#39;Times New Roman&#39;">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0</s=
pan></span><span lang=3D"EN-US">I think there are some dependencies between=
 constrains and capabilities, as RFC7285 says =E2=80=9CThis parameter MUST =
NOT be specified if this resource&#39;s &quot;capabilities&quot; field (Sec=
tion 11.3.2.4) indicate that constraint support is not available.=E2=80=9D =
So, how to imply this dependency in YANG model? In line 869, it seems that =
there is not a check whether resource&#39;s &quot;capabilities&quot; field =
is available.</span></p></div></div></blockquote><div>=C2=A0[sx] Good catch=
! I added a line to express this constraint. On the other hand, I am not su=
re the burden of this constraint should fall on the server side, since this=
 is in rpc-input.</div><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);bo=
rder-left-style:solid;padding-left:1ex"><div><div dir=3D"ltr"><p><span lang=
=3D"EN-US"><br></span></p><p><span lang=3D"EN-US">2.<span style=3D"line-hei=
ght:17.040000915527344px;font-size:7pt;font-family:&#39;Times New Roman&#39=
;">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0</span></span><span lang=3D"EN=
-US">In line 395, it seems that there is always version tag in meta field, =
but I think IRD response does not need version tag in its header.</span></p=
></div></div></blockquote><div>[sx] You&#39;re totally right. I fixed it.=
=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-s=
tyle:solid;padding-left:1ex"><div><div dir=3D"ltr"><p><span lang=3D"EN-US">=
<br></span></p><p><span lang=3D"EN-US">3.<span style=3D"line-height:17.0400=
00915527344px;font-size:7pt;font-family:&#39;Times New Roman&#39;">=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0</span></span><span lang=3D"EN-US">In l=
ine 737, does there need capabilities field for the output of endpoint-prop=
erty-service and filtered-cost-map-service(line 750)? I think capabilities =
is for IRD response.</span></p></div></div></blockquote><div><span style=3D=
"font-family:arial,sans-serif;font-size:12.727272033691406px">[sx] See 11.4=
.1.4. and 11.3.2.4. They are not in the ALTO examples as they are optional =
fields I believe.=C2=A0</span></div><div><br></div><div>-Xiao=C2=A0</div><b=
lockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-le=
ft-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;pad=
ding-left:1ex"><div><div dir=3D"ltr"><p><span lang=3D"EN-US">=C2=A0</span><=
/p><p><span lang=3D"EN-US">I am a beginner of alto and YANG, so if there is=
 any basic misunderstanding, please forgive me.</span></p><p><br></p><p><sp=
an lang=3D"EN-US">Thanks!</span></p><p><span lang=3D"EN-US">Xin</span></p>


<div dir=3D"ltr"></div>
 		 	   		  </div></div>
<br>_______________________________________________<br>
alto mailing list<br>
<a href=3D"mailto:alto@ietf.org">alto@ietf.org</a><br>
<a href=3D"https://www.ietf.org/mailman/listinfo/alto" target=3D"_blank">ht=
tps://www.ietf.org/mailman/listinfo/alto</a><br>
<br></blockquote></div><br></div></div>

--089e0160b8c418913c050535ea39--


From nobody Tue Oct 14 10:47:10 2014
Return-Path: <yang.r.yang@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A73B71A90E2 for <alto@ietfa.amsl.com>; Tue, 14 Oct 2014 10:47:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.277
X-Spam-Level: 
X-Spam-Status: No, score=-1.277 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 iYRnNo636wz0 for <alto@ietfa.amsl.com>; Tue, 14 Oct 2014 10:47:06 -0700 (PDT)
Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 07B4A1A90C4 for <alto@ietf.org>; Tue, 14 Oct 2014 10:47:05 -0700 (PDT)
Received: by mail-ig0-f181.google.com with SMTP id r10so15607432igi.8 for <alto@ietf.org>; Tue, 14 Oct 2014 10:47:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:date:message-id:subject:from:to:content-type;  bh=urch46M/ZDGryrv3HaaAVqrOLpuDVWq4rIgagZL1Vq8=; b=uzoFJ/i/4JT8U195bP1DgqEulpIk7W8GWqCf6cY2iTroasm5T+SCQhLtED5CL7Opu7 iA6mpVdT/YmpB0+ApwZXyH/nbXvybAa+sZzJh0z7qoC6vzd7eQNrNjNPUMbMj/cHFWTz K4GkHXjhp5pWgJJvP2O3C33iO+Ys4dSX3bRGl9STcNsOEDkdxY9EpjxcUj0d92w7QRqf iYWTQbsLUrVBYzv1vhjsKL582blipYbVtdN4VTbpZRN+6DP+Y/Lj2Z90TZ8uaY/tsGPH iJF6mTJFz152+mwkiGGl1rV18j0nbJwVK+C8XbIPuuzfovWqYrD2dPM5ApG6YuVjhakz r85Q==
MIME-Version: 1.0
X-Received: by 10.50.49.78 with SMTP id s14mr8576420ign.9.1413308824965; Tue, 14 Oct 2014 10:47:04 -0700 (PDT)
Sender: yang.r.yang@gmail.com
Received: by 10.107.131.224 with HTTP; Tue, 14 Oct 2014 10:47:04 -0700 (PDT)
Date: Tue, 14 Oct 2014 13:47:04 -0400
X-Google-Sender-Auth: nCnfPHbdqRJbVLz4hNUnXRozXe8
Message-ID: <CANUuoLqJJL3Quf1RHJ=0rXNgPC6A7cbC=URcCfHt0-JyrmHh9Q@mail.gmail.com>
From: "Y. Richard Yang" <yry@cs.yale.edu>
To: IETF ALTO <alto@ietf.org>, Paul Bryan <pbryan@anode.ca>, Mark Nottingham <mnot@mnot.net>
Content-Type: multipart/alternative; boundary=047d7bdc10ca7859db0505659ac4
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/1SztU6SBkFl3-KET-M1Cp8_Nme4
Subject: [alto] ALTO incremental updates and JSON Patch extension
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Oct 2014 17:47:08 -0000

--047d7bdc10ca7859db0505659ac4
Content-Type: text/plain; charset=UTF-8

Dear all,

Some of us are having an extensive discussion on how to proceed regarding
the ALTO incremental updates WG item. Here is a summary of what we are
thinking. At a high level, we plan to propose an approach of using JSON
Patch (RFC6902), but with some extensions. We want to get your comments and
advice on if you see any problems, and how best to proceed.

Current state:
==========
Both JSON Patch (RFC6902) and
http://tools.ietf.org/html/draft-roome-alto-incr-updates-01 are considered
as candidates of the encoding update message format.

Design goal and problem:
====================
Generality and efficiency. That is, we want an incremental update format
that can handle not only current resources but also future resources. The
recent trend in adopting YANG shows that general mechanisms, not per
protocol patch, have value. Generic encoding of JSON Patch based on XPATH
and a few operators is complete in this sense, but inefficient in key ALTO
cases such as updating cost maps, as pointed out in
http://tools.ietf.org/html/draft-roome-alto-incr-updates-01

Key idea:
=======
A JSON object can be considered as an key-value tree, with each node being
an object and each edge labeled by the key, and the value of the edge
pointing to another object. For example, the ALTO cost map example:
{
            "meta" : {

              "dependent-vtags" : [
                {"resource-id": "my-default-network-map",
                 "tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e"
                }
              ],

              "vtag":
                 {"resource-id": "COST-MAP-ID", "tag": "CM-TAG"},

              "cost-type" : {"cost-mode"  : "numerical",
                             "cost-metric": "routingcost"
              }
            },
            "cost-map" : {
              "PID1": { "PID1": 1,  "PID2": 5,  "PID3": 10 },
              "PID2": { "PID1": 5,  "PID2": 1,  "PID3": 15 },
              "PID3": { "PID1": 20, "PID2": 15  }
            }

defines a data tree with 14 leaf nodes:

"meta/dependent-vtags/resource-id": "my-default-network-map",
"meta/dependent-vtags/tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e",
...
"cost-map/PID3/PID1": 20,
"cost-map/PID3/PID2": 15

RFC6902 focuses on encoding updating one node on the tree at a time. On the
other hand, one can realize that the cost-map update encoding of
http://tools.ietf.org/html/draft-roome-alto-incr-updates-01 updates a set
of nodes. For example, an update example
{
        "meta": {
             "vtag":
                 {"tag": "NEW-CM-TAG"},
             },
        "cost-map": {
             "PID1": {"PID2": 10, "PID99": null}
             }
   }
updates 3 nodes.

If one thinks about, one will realize that this is a general, interesting
design: consider the data tree of the original object; the update object is
a partial tree of the original, and updates a batch containing all matched
nodes in the partial tree. We call this operator the tree-replace operator.
How may one do this as an extension of RFC6902:

{
 "op" : "tree-replace",
 "path" : "/",    // prefix of update object
 "value" :       // just a copy of the partial object in value
      { "meta": {
             "vtag":
                 {"tag": "NEW-CM-TAG"},
         },
        "cost-map": {
             "PID1": {"PID2": 10, "PID99": null}
          }
      }
}

Hence, we have a simple operator that appears to be able to fix the
cost-map efficiency issue and is still general, not ALTO only.

Next step:
========
- One possibility is to start to work on an extension of RFC 6902 to
introduce this operator, if there is no bug. After this is done, we specify
ALTO incremental updates using the new op. An issue is that this is a
sequential process and may take time.

- Another possibility is that we specify JSON Patch as incremental update
encoding for now, losing efficiency. In parallel, we push for the new op,
and when it is done, ALTO incremental updates implementation can use the
new op.

- A third possibility is that we define the extension operator in ALTO
incremental updates document itself, and proceed quickly.

Any bug in the design? Any comments or suggestions?

Thanks!

Richard, Wendy

--047d7bdc10ca7859db0505659ac4
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Dear all,
<div><br></div><div>Some of us are having an extensive discussion on how to=
 proceed regarding the ALTO incremental updates WG item. Here is a summary =
of what we are thinking. At a high level, we plan to propose an approach of=
 using JSON Patch (RFC6902), but with some extensions. We want to get your =
comments and advice on if you see any problems, and how best to proceed.</d=
iv><div><br></div><div>Current state:=C2=A0</div><div>=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D</div><div>Both JSON Patch (RFC6902) and=C2=A0=C2=A0<a href=3D"htt=
p://tools.ietf.org/html/draft-roome-alto-incr-updates-01">http://tools.ietf=
.org/html/draft-roome-alto-incr-updates-01</a> are considered as candidates=
 of the encoding update message format.</div><div><br></div><div>Design goa=
l and problem:=C2=A0</div><div><span style=3D"font-family:arial,sans-serif;=
font-size:12.8000001907349px">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D</span></div><div><span style=3D"font-family:arial,sans-seri=
f;font-size:12.8000001907349px">Generality and efficiency. That is, we want=
 an incremental update format that can handle not only current resources bu=
t also future resources.=C2=A0</span><span style=3D"font-family:arial,sans-=
serif;font-size:12.8000001907349px">The recent trend in adopting YANG shows=
 that general mechanisms, not per protocol patch, have value.=C2=A0</span><=
span style=3D"font-size:12.8000001907349px;font-family:arial,sans-serif">Ge=
neric encoding of JSON Patch based on XPATH and a few operators is complete=
 in this sense, but inefficient in key ALTO cases such as updating cost map=
s, as pointed out in=C2=A0</span><a href=3D"http://tools.ietf.org/html/draf=
t-roome-alto-incr-updates-01">http://tools.ietf.org/html/draft-roome-alto-i=
ncr-updates-01</a></div><div><span style=3D"font-family:arial,sans-serif;fo=
nt-size:12.8000001907349px"><br></span></div><div><span style=3D"font-famil=
y:arial,sans-serif;font-size:12.8000001907349px">Key idea:=C2=A0</span></di=
v><div><span style=3D"font-family:arial,sans-serif;font-size:12.80000019073=
49px">=3D=3D=3D=3D=3D=3D=3D</span></div><div><span style=3D"font-family:ari=
al,sans-serif;font-size:12.8000001907349px">A JSON object can be considered=
 as an key-value tree, with each node being an object and each edge labeled=
 by the key, and the value of the edge pointing to another object. For exam=
ple, the ALTO cost map example:</span></div><div><div style=3D"font-family:=
arial,sans-serif;font-size:12.8000001907349px">{</div><div style=3D"font-fa=
mily:arial,sans-serif;font-size:12.8000001907349px">=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 &quot;meta&quot; : {</div><div style=3D"font-family:ar=
ial,sans-serif;font-size:12.8000001907349px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0=C2=A0<span style=3D"font-family:arial;font-size:small"=
>=C2=A0</span><span style=3D"font-family:arial;font-size:small">=C2=A0</spa=
n></div><div style=3D"font-family:arial,sans-serif;font-size:12.80000019073=
49px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;dependent-vtag=
s&quot; : [</div><div style=3D"font-family:arial,sans-serif;font-size:12.80=
00001907349px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {&qu=
ot;resource-id&quot;: &quot;my-default-network-map&quot;,</div><div style=
=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;tag&quot;: &quot;=
3ee2cb7e8d63d9fab71b9b34cbf764436315542e&quot;</div><div style=3D"font-fami=
ly:arial,sans-serif;font-size:12.8000001907349px">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }</div><div style=3D"font-family:arial,sans=
-serif;font-size:12.8000001907349px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 ],</div><div style=3D"font-family:arial,sans-serif;font-size:12.=
8000001907349px"><br></div><div style=3D"font-family:arial,sans-serif;font-=
size:12.8000001907349px"><div style=3D"font-size:12.8000001907349px"><span =
style=3D"font-family:arial;font-size:small">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 &quot;vtag&quot;:</span></div><div style=3D"font-family:a=
rial;font-size:small">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0{&quot;resource-id&quot;: &quot;COST-MAP-ID&quot;, &quot;tag&quot=
;: &quot;CM-TAG&quot;},</div><div style=3D"font-family:arial;font-size:smal=
l"><br></div></div><div style=3D"font-family:arial,sans-serif;font-size:12.=
8000001907349px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;cos=
t-type&quot; : {&quot;cost-mode&quot; =C2=A0: &quot;numerical&quot;,</div><=
div style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;cost-metric&quot;: &quot;routingcost&quot;=
</div><div style=3D"font-family:arial,sans-serif;font-size:12.8000001907349=
px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }</div><div style=3D"f=
ont-family:arial,sans-serif;font-size:12.8000001907349px">=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 },</div><div style=3D"font-family:arial,sans-serif=
;font-size:12.8000001907349px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &q=
uot;cost-map&quot; : {</div><div style=3D"font-family:arial,sans-serif;font=
-size:12.8000001907349px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
&quot;PID1&quot;: { &quot;PID1&quot;: 1, =C2=A0&quot;PID2&quot;: 5, =C2=A0&=
quot;PID3&quot;: 10 },</div><div style=3D"font-family:arial,sans-serif;font=
-size:12.8000001907349px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
&quot;PID2&quot;: { &quot;PID1&quot;: 5, =C2=A0&quot;PID2&quot;: 1, =C2=A0&=
quot;PID3&quot;: 15 },</div><div style=3D"font-family:arial,sans-serif;font=
-size:12.8000001907349px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
&quot;PID3&quot;: { &quot;PID1&quot;: 20, &quot;PID2&quot;: 15 =C2=A0}</div=
><div style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }</div></div><div style=3D"font-f=
amily:arial,sans-serif;font-size:12.8000001907349px"><br></div><div style=
=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">defines a da=
ta tree with 14 leaf nodes:<br><br></div><div style=3D"font-family:arial,sa=
ns-serif;font-size:12.8000001907349px"><div style=3D"font-size:12.800000190=
7349px">&quot;meta/dependent-vtags/resource-id&quot;: &quot;my-default-netw=
ork-map&quot;,</div><div style=3D"font-size:12.8000001907349px">&quot;meta/=
dependent-vtags/tag&quot;: &quot;3ee2cb7e8d63d9fab71b9b34cbf764436315542e&q=
uot;,</div><div style=3D"font-size:12.8000001907349px">...</div><div style=
=3D"font-size:12.8000001907349px">&quot;cost-map/PID3/PID1&quot;: 20,</div>=
<div style=3D"font-size:12.8000001907349px">&quot;cost-map/PID3/PID2&quot;:=
 15</div><div style=3D"font-size:12.8000001907349px"><br></div></div><div><=
span style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px">RF=
C6902 focuses on encoding updating one node on the tree at a time. On the o=
ther hand, one can realize that the cost-map update encoding of=C2=A0</span=
><a href=3D"http://tools.ietf.org/html/draft-roome-alto-incr-updates-01">ht=
tp://tools.ietf.org/html/draft-roome-alto-incr-updates-01</a> updates a set=
 of nodes. For example, an update example=C2=A0<br><div>{</div><div>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 &quot;meta&quot;: {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0&quot;vtag&quot;:</div><div>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{&quot;tag&quot;: &quot;NEW-CM-TAG=
&quot;},</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0},<br></=
div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;cost-map&quot;: {</div><div>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;PID1&quot;: {&quot;PID2&=
quot;: 10, &quot;PID99&quot;: null}</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0}</div><div>=C2=A0 =C2=A0}</div></div><div>updates 3 no=
des.</div><div><br></div><div>If one thinks about, one will realize that th=
is is a general, interesting design: consider the data tree of the original=
 object; the update object is a partial tree of the original, and updates a=
 batch containing all matched nodes in the partial tree. We call this opera=
tor the tree-replace operator. How may one do this as an extension of RFC69=
02:=C2=A0</div><div><br><div style=3D"font-family:arial,sans-serif;font-siz=
e:12.8000001907349px">{</div><div style=3D"font-family:arial,sans-serif;fon=
t-size:12.8000001907349px">=C2=A0&quot;op&quot; : &quot;tree-replace&quot;,=
</div><div style=3D"font-family:arial,sans-serif;font-size:12.8000001907349=
px">=C2=A0&quot;path&quot; : &quot;/&quot;, =C2=A0 =C2=A0// prefix of updat=
e object</div><div style=3D"font-family:arial,sans-serif;font-size:12.80000=
01907349px">=C2=A0&quot;value&quot; : =C2=A0 =C2=A0 =C2=A0 // just a copy o=
f the partial object in value</div><div style=3D"font-family:arial,sans-ser=
if;font-size:12.8000001907349px"><div style=3D"font-family:arial;font-size:=
small">=C2=A0 =C2=A0 =C2=A0 { &quot;meta&quot;: {</div><div style=3D"font-f=
amily:arial;font-size:small">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0&quot;vtag&quot;:</div><div style=3D"font-family:arial;font-size:small">=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{&quot;tag&qu=
ot;: &quot;NEW-CM-TAG&quot;},</div><div style=3D"font-family:arial;font-siz=
e:small">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0},<br></div><div style=3D"font-f=
amily:arial;font-size:small">=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;cost-map&quo=
t;: {</div><div style=3D"font-family:arial;font-size:small">=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;PID1&quot;: {&quot;PID2&quot;: 10, =
&quot;PID99&quot;: null}</div><div style=3D"font-family:arial;font-size:sma=
ll">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }</div><div style=3D"font-family:ari=
al;font-size:small">=C2=A0 =C2=A0 =C2=A0 } =C2=A0 =C2=A0=C2=A0</div></div><=
div style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><sp=
an style=3D"font-size:12.8000001907349px">}</span><br></div></div><div><br>=
</div><div>Hence, we have a=C2=A0<span style=3D"font-size:12.8000001907349p=
x;font-family:arial,sans-serif">simple operator that appears to be able to =
fix the cost-map efficiency issue and is still general, not ALTO only.=C2=
=A0</span><br></div><div><span style=3D"font-family:arial,sans-serif;font-s=
ize:12.8000001907349px"><br></span></div><div><div>Next step:</div><div>=3D=
=3D=3D=3D=3D=3D=3D=3D</div></div><div>- One possibility is to start to work=
 on an extension of RFC 6902 to introduce this operator, if there is no bug=
. After this is done, we specify ALTO incremental updates using the new op.=
 An issue is that this is a sequential process and may take time.</div><div=
><br></div><div>- Another possibility is that we specify JSON Patch as incr=
emental update encoding for now, losing efficiency. In parallel, we push fo=
r the new op, and when it is done, ALTO incremental updates implementation =
can use the new op.</div><div><br></div><div>- A third possibility is that =
we define the extension operator in ALTO incremental updates document itsel=
f, and proceed quickly.</div><div><br></div><div>Any bug in the design? Any=
 comments or suggestions?</div><div><br></div><div>Thanks!</div><div><br></=
div><div>Richard, Wendy</div></div>

--047d7bdc10ca7859db0505659ac4--


From nobody Tue Oct 14 20:14:02 2014
Return-Path: <mnot@mnot.net>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E53831A00C5 for <alto@ietfa.amsl.com>; Tue, 14 Oct 2014 20:13:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.602
X-Spam-Level: 
X-Spam-Status: No, score=-2.602 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 vypRBZN2ss_l for <alto@ietfa.amsl.com>; Tue, 14 Oct 2014 20:13:57 -0700 (PDT)
Received: from mxout-07.mxes.net (mxout-07.mxes.net [216.86.168.182]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 283A11A007B for <alto@ietf.org>; Tue, 14 Oct 2014 20:13:57 -0700 (PDT)
Received: from [192.168.1.83] (unknown [118.209.119.4]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 81C6A22E1F4; Tue, 14 Oct 2014 23:13:52 -0400 (EDT)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <CANUuoLqJJL3Quf1RHJ=0rXNgPC6A7cbC=URcCfHt0-JyrmHh9Q@mail.gmail.com>
Date: Wed, 15 Oct 2014 14:13:49 +1100
Content-Transfer-Encoding: quoted-printable
Message-Id: <D001A864-F0F7-4421-9123-699D4D7EACE6@mnot.net>
References: <CANUuoLqJJL3Quf1RHJ=0rXNgPC6A7cbC=URcCfHt0-JyrmHh9Q@mail.gmail.com>
To: "Y. Richard Yang" <yry@cs.yale.edu>
X-Mailer: Apple Mail (2.1878.6)
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/lQYmOMhw6vJ57Tqqq6XfVj3WABE
Cc: IETF ALTO <alto@ietf.org>, Paul Bryan <pbryan@anode.ca>
Subject: Re: [alto] ALTO incremental updates and JSON Patch extension
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 15 Oct 2014 03:14:00 -0000

Hi Richard,

RFC6902 doesn't allow extension operators; you'd need to define a new =
media type and specify its behaviour. Of course, you could do that =
pretty easily by just saying "here's a new media type; it has the same =
semantics / requirements as JSON Patch, plus this...".

Also, I trust you've seen the new JSON merge-patch RFC (I think we spoke =
about it before)?
  https://tools.ietf.org/html/rfc7386

Cheers,


On 15 Oct 2014, at 4:47 am, Y. Richard Yang <yry@cs.yale.edu> wrote:

> Dear all,
>=20
> Some of us are having an extensive discussion on how to proceed =
regarding the ALTO incremental updates WG item. Here is a summary of =
what we are thinking. At a high level, we plan to propose an approach of =
using JSON Patch (RFC6902), but with some extensions. We want to get =
your comments and advice on if you see any problems, and how best to =
proceed.
>=20
> Current state:=20
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> Both JSON Patch (RFC6902) and  =
http://tools.ietf.org/html/draft-roome-alto-incr-updates-01 are =
considered as candidates of the encoding update message format.
>=20
> Design goal and problem:=20
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> Generality and efficiency. That is, we want an incremental update =
format that can handle not only current resources but also future =
resources. The recent trend in adopting YANG shows that general =
mechanisms, not per protocol patch, have value. Generic encoding of JSON =
Patch based on XPATH and a few operators is complete in this sense, but =
inefficient in key ALTO cases such as updating cost maps, as pointed out =
in http://tools.ietf.org/html/draft-roome-alto-incr-updates-01
>=20
> Key idea:=20
> =3D=3D=3D=3D=3D=3D=3D
> A JSON object can be considered as an key-value tree, with each node =
being an object and each edge labeled by the key, and the value of the =
edge pointing to another object. For example, the ALTO cost map example:
> {
>             "meta" : {
>                =20
>               "dependent-vtags" : [
>                 {"resource-id": "my-default-network-map",
>                  "tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e"
>                 }
>               ],
>=20
>               "vtag":
>                  {"resource-id": "COST-MAP-ID", "tag": "CM-TAG"},
>=20
>               "cost-type" : {"cost-mode"  : "numerical",
>                              "cost-metric": "routingcost"
>               }
>             },
>             "cost-map" : {
>               "PID1": { "PID1": 1,  "PID2": 5,  "PID3": 10 },
>               "PID2": { "PID1": 5,  "PID2": 1,  "PID3": 15 },
>               "PID3": { "PID1": 20, "PID2": 15  }
>             }
>=20
> defines a data tree with 14 leaf nodes:
>=20
> "meta/dependent-vtags/resource-id": "my-default-network-map",
> "meta/dependent-vtags/tag": =
"3ee2cb7e8d63d9fab71b9b34cbf764436315542e",
> ...
> "cost-map/PID3/PID1": 20,
> "cost-map/PID3/PID2": 15
>=20
> RFC6902 focuses on encoding updating one node on the tree at a time. =
On the other hand, one can realize that the cost-map update encoding of =
http://tools.ietf.org/html/draft-roome-alto-incr-updates-01 updates a =
set of nodes. For example, an update example=20
> {
>         "meta": {
>              "vtag":
>                  {"tag": "NEW-CM-TAG"},
>              },
>         "cost-map": {
>              "PID1": {"PID2": 10, "PID99": null}
>              }
>    }
> updates 3 nodes.
>=20
> If one thinks about, one will realize that this is a general, =
interesting design: consider the data tree of the original object; the =
update object is a partial tree of the original, and updates a batch =
containing all matched nodes in the partial tree. We call this operator =
the tree-replace operator. How may one do this as an extension of =
RFC6902:=20
>=20
> {
>  "op" : "tree-replace",
>  "path" : "/",    // prefix of update object
>  "value" :       // just a copy of the partial object in value
>       { "meta": {
>              "vtag":
>                  {"tag": "NEW-CM-TAG"},
>          },
>         "cost-map": {
>              "PID1": {"PID2": 10, "PID99": null}
>           }
>       }    =20
> }
>=20
> Hence, we have a simple operator that appears to be able to fix the =
cost-map efficiency issue and is still general, not ALTO only.=20
>=20
> Next step:
> =3D=3D=3D=3D=3D=3D=3D=3D
> - One possibility is to start to work on an extension of RFC 6902 to =
introduce this operator, if there is no bug. After this is done, we =
specify ALTO incremental updates using the new op. An issue is that this =
is a sequential process and may take time.
>=20
> - Another possibility is that we specify JSON Patch as incremental =
update encoding for now, losing efficiency. In parallel, we push for the =
new op, and when it is done, ALTO incremental updates implementation can =
use the new op.
>=20
> - A third possibility is that we define the extension operator in ALTO =
incremental updates document itself, and proceed quickly.
>=20
> Any bug in the design? Any comments or suggestions?
>=20
> Thanks!
>=20
> Richard, Wendy

--
Mark Nottingham   https://www.mnot.net/


From nobody Tue Oct 14 21:07:39 2014
Return-Path: <yang.r.yang@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 096DE1A01E5 for <alto@ietfa.amsl.com>; Tue, 14 Oct 2014 21:07:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.623
X-Spam-Level: 
X-Spam-Status: No, score=0.623 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 jQ7R5UjLehBh for <alto@ietfa.amsl.com>; Tue, 14 Oct 2014 21:07:35 -0700 (PDT)
Received: from mail-ie0-x235.google.com (mail-ie0-x235.google.com [IPv6:2607:f8b0:4001:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E8B021A011D for <alto@ietf.org>; Tue, 14 Oct 2014 21:07:34 -0700 (PDT)
Received: by mail-ie0-f181.google.com with SMTP id at20so434170iec.40 for <alto@ietf.org>; Tue, 14 Oct 2014 21:07:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=H+md5r3ZEdOQm0z2Ow59vuEaEVNllFDWMR5HLlOzzK0=; b=LUzx41CgmiyOahHXcEXexjTgl7JQa5DaHuCyZPY42zFBZYlvi7VjtQVPFMaOiP5LXL jAld+hdAE9W1vK0xQ2RmTCmoLJxQfcfprUkxhRqgTTu26c/WJ4lCBoJrKHyG5ryYNBy4 V/8KgX4hA5LDKt3caNjfce5WkXLQZ/Ibko0qClhDw/9Lq5ukKFuKtJG6b59nDyZM1S7x XytftpduWoMjrazaHtABp0Id1tWno9lUQ3uGLizQ9S1JyTrsk8K9OcZKxicYLpDe3aO6 9bVVyGLJmCZYNPo5jFd1R789oivqxN6ykJG//tKsAvCDix32uGZfWk2iY1Hq4p5ZCvPM VJow==
MIME-Version: 1.0
X-Received: by 10.107.19.203 with SMTP id 72mr6633804iot.27.1413346054116; Tue, 14 Oct 2014 21:07:34 -0700 (PDT)
Sender: yang.r.yang@gmail.com
Received: by 10.107.131.224 with HTTP; Tue, 14 Oct 2014 21:07:34 -0700 (PDT)
In-Reply-To: <D001A864-F0F7-4421-9123-699D4D7EACE6@mnot.net>
References: <CANUuoLqJJL3Quf1RHJ=0rXNgPC6A7cbC=URcCfHt0-JyrmHh9Q@mail.gmail.com> <D001A864-F0F7-4421-9123-699D4D7EACE6@mnot.net>
Date: Wed, 15 Oct 2014 00:07:34 -0400
X-Google-Sender-Auth: CeQfrVB9KIfYkmrDSfH9Z0wGMqM
Message-ID: <CANUuoLpNBWTk-B+soLNurw3jL8i9U28Tm3PCvvmXZ=L-0deSzw@mail.gmail.com>
From: "Y. Richard Yang" <yry@cs.yale.edu>
To: Mark Nottingham <mnot@mnot.net>
Content-Type: multipart/alternative; boundary=001a113f826480b7ae05056e4527
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/x_SluoW4c2oTGO0q8tQepqtIYMw
Cc: IETF ALTO <alto@ietf.org>, Paul Bryan <pbryan@anode.ca>
Subject: Re: [alto] ALTO incremental updates and JSON Patch extension
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 15 Oct 2014 04:07:38 -0000

--001a113f826480b7ae05056e4527
Content-Type: text/plain; charset=UTF-8

Dear Mark,

Thanks a lot for the quick response! I did not remember reading
merge-patch. After just reading it, I found that it is doing exactly what
we wanted to do, and we called it tree-replace, to be similar to the
replace operator defined in RFC6902. We will see how we may use it in our
design.

Since we are at JSON patch extensions, here is another issue that we want
to resolve: set operations on an array. Consider a JSON object
{
  "pid1" : ["prefix1", "prefix2", "prefix3"]
  "pid2" : ["prefix3", "prefix4", "prefix5"]
}

To delete "prefix2" from the value of "pid1", we need to write

op : remove
path : /pid1/1

However, the real intention of the values of "pid1" and "pid2" are sets,
but JSON has no concept of a set (not multi set), as discussed before. The
set semantics guarantees no duplicates, and hence we may eliminate the
burden on an application to keep track of the array index, if we are
allowed to extend the JSON Pointer (rfc6901), in particular, when the case
of the currently referenced value is a JSON array, by allowing functions or
other chars, for example, to denote a set, or index look up--the current
definition allows only numerical index or - and hence one can resolve
ambiguity...

Make sense?

Richard

On Tue, Oct 14, 2014 at 11:13 PM, Mark Nottingham <mnot@mnot.net> wrote:

> Hi Richard,
>
> RFC6902 doesn't allow extension operators; you'd need to define a new
> media type and specify its behaviour. Of course, you could do that pretty
> easily by just saying "here's a new media type; it has the same semantics /
> requirements as JSON Patch, plus this...".
>
> Also, I trust you've seen the new JSON merge-patch RFC (I think we spoke
> about it before)?
>   https://tools.ietf.org/html/rfc7386
>
> Cheers,
>
>
> On 15 Oct 2014, at 4:47 am, Y. Richard Yang <yry@cs.yale.edu> wrote:
>
> > Dear all,
> >
> > Some of us are having an extensive discussion on how to proceed
> regarding the ALTO incremental updates WG item. Here is a summary of what
> we are thinking. At a high level, we plan to propose an approach of using
> JSON Patch (RFC6902), but with some extensions. We want to get your
> comments and advice on if you see any problems, and how best to proceed.
> >
> > Current state:
> > ==========
> > Both JSON Patch (RFC6902) and
> http://tools.ietf.org/html/draft-roome-alto-incr-updates-01 are
> considered as candidates of the encoding update message format.
> >
> > Design goal and problem:
> > ====================
> > Generality and efficiency. That is, we want an incremental update format
> that can handle not only current resources but also future resources. The
> recent trend in adopting YANG shows that general mechanisms, not per
> protocol patch, have value. Generic encoding of JSON Patch based on XPATH
> and a few operators is complete in this sense, but inefficient in key ALTO
> cases such as updating cost maps, as pointed out in
> http://tools.ietf.org/html/draft-roome-alto-incr-updates-01
> >
> > Key idea:
> > =======
> > A JSON object can be considered as an key-value tree, with each node
> being an object and each edge labeled by the key, and the value of the edge
> pointing to another object. For example, the ALTO cost map example:
> > {
> >             "meta" : {
> >
> >               "dependent-vtags" : [
> >                 {"resource-id": "my-default-network-map",
> >                  "tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e"
> >                 }
> >               ],
> >
> >               "vtag":
> >                  {"resource-id": "COST-MAP-ID", "tag": "CM-TAG"},
> >
> >               "cost-type" : {"cost-mode"  : "numerical",
> >                              "cost-metric": "routingcost"
> >               }
> >             },
> >             "cost-map" : {
> >               "PID1": { "PID1": 1,  "PID2": 5,  "PID3": 10 },
> >               "PID2": { "PID1": 5,  "PID2": 1,  "PID3": 15 },
> >               "PID3": { "PID1": 20, "PID2": 15  }
> >             }
> >
> > defines a data tree with 14 leaf nodes:
> >
> > "meta/dependent-vtags/resource-id": "my-default-network-map",
> > "meta/dependent-vtags/tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e",
> > ...
> > "cost-map/PID3/PID1": 20,
> > "cost-map/PID3/PID2": 15
> >
> > RFC6902 focuses on encoding updating one node on the tree at a time. On
> the other hand, one can realize that the cost-map update encoding of
> http://tools.ietf.org/html/draft-roome-alto-incr-updates-01 updates a set
> of nodes. For example, an update example
> > {
> >         "meta": {
> >              "vtag":
> >                  {"tag": "NEW-CM-TAG"},
> >              },
> >         "cost-map": {
> >              "PID1": {"PID2": 10, "PID99": null}
> >              }
> >    }
> > updates 3 nodes.
> >
> > If one thinks about, one will realize that this is a general,
> interesting design: consider the data tree of the original object; the
> update object is a partial tree of the original, and updates a batch
> containing all matched nodes in the partial tree. We call this operator the
> tree-replace operator. How may one do this as an extension of RFC6902:
> >
> > {
> >  "op" : "tree-replace",
> >  "path" : "/",    // prefix of update object
> >  "value" :       // just a copy of the partial object in value
> >       { "meta": {
> >              "vtag":
> >                  {"tag": "NEW-CM-TAG"},
> >          },
> >         "cost-map": {
> >              "PID1": {"PID2": 10, "PID99": null}
> >           }
> >       }
> > }
> >
> > Hence, we have a simple operator that appears to be able to fix the
> cost-map efficiency issue and is still general, not ALTO only.
> >
> > Next step:
> > ========
> > - One possibility is to start to work on an extension of RFC 6902 to
> introduce this operator, if there is no bug. After this is done, we specify
> ALTO incremental updates using the new op. An issue is that this is a
> sequential process and may take time.
> >
> > - Another possibility is that we specify JSON Patch as incremental
> update encoding for now, losing efficiency. In parallel, we push for the
> new op, and when it is done, ALTO incremental updates implementation can
> use the new op.
> >
> > - A third possibility is that we define the extension operator in ALTO
> incremental updates document itself, and proceed quickly.
> >
> > Any bug in the design? Any comments or suggestions?
> >
> > Thanks!
> >
> > Richard, Wendy
>
> --
> Mark Nottingham   https://www.mnot.net/
>

--001a113f826480b7ae05056e4527
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Dear Mark,<div><br></div><div>Thanks a lot for the quick r=
esponse! I did not remember reading merge-patch. After just reading it, I f=
ound that it is doing exactly what we wanted to do, and we called it tree-r=
eplace, to be similar to the replace operator defined in RFC6902. We will s=
ee how we may use it in our design.=C2=A0</div><div><br></div><div>Since we=
 are at JSON patch extensions, here is another issue that we want to resolv=
e: set operations on an array. Consider a JSON object=C2=A0</div><div>{</di=
v><div>=C2=A0 &quot;pid1&quot; : [&quot;prefix1&quot;, &quot;prefix2&quot;,=
 &quot;prefix3&quot;]</div><div>=C2=A0 &quot;pid2&quot; : [&quot;prefix3&qu=
ot;, &quot;prefix4&quot;, &quot;prefix5&quot;]</div><div>}</div><div><br></=
div><div>To delete &quot;prefix2&quot; from the value of &quot;pid1&quot;, =
we need to write</div><div><br></div><div>op : remove</div><div>path : /pid=
1/1</div><div><br></div><div>However, the real intention of the values of &=
quot;pid1&quot; and &quot;pid2&quot; are sets, but JSON has no concept of a=
 set (not multi set), as discussed before. The set semantics guarantees no =
duplicates, and hence we may eliminate the burden on an application to keep=
 track of the array index, if we are allowed to extend the JSON Pointer (rf=
c6901), in particular, when the case of the currently referenced value is a=
 JSON array, by allowing functions or other chars, for example, to denote a=
 set, or index look up--the current definition allows only numerical index =
or - and hence one can resolve ambiguity...<br></div><div><br></div><div>Ma=
ke sense?</div><div><br></div><div>Richard</div><div class=3D"gmail_extra">=
<br><div class=3D"gmail_quote">On Tue, Oct 14, 2014 at 11:13 PM, Mark Notti=
ngham <span dir=3D"ltr">&lt;<a href=3D"mailto:mnot@mnot.net" target=3D"_bla=
nk">mnot@mnot.net</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">H=
i Richard,<br>
<br>
RFC6902 doesn&#39;t allow extension operators; you&#39;d need to define a n=
ew media type and specify its behaviour. Of course, you could do that prett=
y easily by just saying &quot;here&#39;s a new media type; it has the same =
semantics / requirements as JSON Patch, plus this...&quot;.<br>
<br>
Also, I trust you&#39;ve seen the new JSON merge-patch RFC (I think we spok=
e about it before)?<br>
=C2=A0 <a href=3D"https://tools.ietf.org/html/rfc7386" target=3D"_blank">ht=
tps://tools.ietf.org/html/rfc7386</a><br>
<br>
Cheers,<br>
<div><div class=3D"h5"><br>
<br>
On 15 Oct 2014, at 4:47 am, Y. Richard Yang &lt;<a href=3D"mailto:yry@cs.ya=
le.edu">yry@cs.yale.edu</a>&gt; wrote:<br>
<br>
&gt; Dear all,<br>
&gt;<br>
&gt; Some of us are having an extensive discussion on how to proceed regard=
ing the ALTO incremental updates WG item. Here is a summary of what we are =
thinking. At a high level, we plan to propose an approach of using JSON Pat=
ch (RFC6902), but with some extensions. We want to get your comments and ad=
vice on if you see any problems, and how best to proceed.<br>
&gt;<br>
&gt; Current state:<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
&gt; Both JSON Patch (RFC6902) and=C2=A0 <a href=3D"http://tools.ietf.org/h=
tml/draft-roome-alto-incr-updates-01" target=3D"_blank">http://tools.ietf.o=
rg/html/draft-roome-alto-incr-updates-01</a> are considered as candidates o=
f the encoding update message format.<br>
&gt;<br>
&gt; Design goal and problem:<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
&gt; Generality and efficiency. That is, we want an incremental update form=
at that can handle not only current resources but also future resources. Th=
e recent trend in adopting YANG shows that general mechanisms, not per prot=
ocol patch, have value. Generic encoding of JSON Patch based on XPATH and a=
 few operators is complete in this sense, but inefficient in key ALTO cases=
 such as updating cost maps, as pointed out in <a href=3D"http://tools.ietf=
.org/html/draft-roome-alto-incr-updates-01" target=3D"_blank">http://tools.=
ietf.org/html/draft-roome-alto-incr-updates-01</a><br>
&gt;<br>
&gt; Key idea:<br>
&gt; =3D=3D=3D=3D=3D=3D=3D<br>
&gt; A JSON object can be considered as an key-value tree, with each node b=
eing an object and each edge labeled by the key, and the value of the edge =
pointing to another object. For example, the ALTO cost map example:<br>
&gt; {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;meta&quot; : {<br=
>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;dependent-=
vtags&quot; : [<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{&quot;re=
source-id&quot;: &quot;my-default-network-map&quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;ta=
g&quot;: &quot;3ee2cb7e8d63d9fab71b9b34cbf764436315542e&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0],<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;vtag&quot;=
:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;r=
esource-id&quot;: &quot;COST-MAP-ID&quot;, &quot;tag&quot;: &quot;CM-TAG&qu=
ot;},<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;cost-type&=
quot; : {&quot;cost-mode&quot;=C2=A0 : &quot;numerical&quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;cost-metric&quot;: &quot;routingco=
st&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0},<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;cost-map&quot; : =
{<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;PID1&quot;=
: { &quot;PID1&quot;: 1,=C2=A0 &quot;PID2&quot;: 5,=C2=A0 &quot;PID3&quot;:=
 10 },<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;PID2&quot;=
: { &quot;PID1&quot;: 5,=C2=A0 &quot;PID2&quot;: 1,=C2=A0 &quot;PID3&quot;:=
 15 },<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;PID3&quot;=
: { &quot;PID1&quot;: 20, &quot;PID2&quot;: 15=C2=A0 }<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;<br>
&gt; defines a data tree with 14 leaf nodes:<br>
&gt;<br>
&gt; &quot;meta/dependent-vtags/resource-id&quot;: &quot;my-default-network=
-map&quot;,<br>
&gt; &quot;meta/dependent-vtags/tag&quot;: &quot;3ee2cb7e8d63d9fab71b9b34cb=
f764436315542e&quot;,<br>
&gt; ...<br>
&gt; &quot;cost-map/PID3/PID1&quot;: 20,<br>
&gt; &quot;cost-map/PID3/PID2&quot;: 15<br>
&gt;<br>
&gt; RFC6902 focuses on encoding updating one node on the tree at a time. O=
n the other hand, one can realize that the cost-map update encoding of <a h=
ref=3D"http://tools.ietf.org/html/draft-roome-alto-incr-updates-01" target=
=3D"_blank">http://tools.ietf.org/html/draft-roome-alto-incr-updates-01</a>=
 updates a set of nodes. For example, an update example<br>
&gt; {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;meta&quot;: {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;vtag&quot;:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;t=
ag&quot;: &quot;NEW-CM-TAG&quot;},<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 },<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;cost-map&quot;: {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;PID1&quot;: {&qu=
ot;PID2&quot;: 10, &quot;PID99&quot;: null}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 =C2=A0 }<br>
&gt; updates 3 nodes.<br>
&gt;<br>
&gt; If one thinks about, one will realize that this is a general, interest=
ing design: consider the data tree of the original object; the update objec=
t is a partial tree of the original, and updates a batch containing all mat=
ched nodes in the partial tree. We call this operator the tree-replace oper=
ator. How may one do this as an extension of RFC6902:<br>
&gt;<br>
&gt; {<br>
&gt;=C2=A0 &quot;op&quot; : &quot;tree-replace&quot;,<br>
&gt;=C2=A0 &quot;path&quot; : &quot;/&quot;,=C2=A0 =C2=A0 // prefix of upda=
te object<br>
&gt;=C2=A0 &quot;value&quot; :=C2=A0 =C2=A0 =C2=A0 =C2=A0// just a copy of =
the partial object in value<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0{ &quot;meta&quot;: {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;vtag&quot;:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;t=
ag&quot;: &quot;NEW-CM-TAG&quot;},<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 },<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;cost-map&quot;: {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;PID1&quot;: {&qu=
ot;PID2&quot;: 10, &quot;PID99&quot;: null}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt; }<br>
&gt;<br>
&gt; Hence, we have a simple operator that appears to be able to fix the co=
st-map efficiency issue and is still general, not ALTO only.<br>
&gt;<br>
&gt; Next step:<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D<br>
&gt; - One possibility is to start to work on an extension of RFC 6902 to i=
ntroduce this operator, if there is no bug. After this is done, we specify =
ALTO incremental updates using the new op. An issue is that this is a seque=
ntial process and may take time.<br>
&gt;<br>
&gt; - Another possibility is that we specify JSON Patch as incremental upd=
ate encoding for now, losing efficiency. In parallel, we push for the new o=
p, and when it is done, ALTO incremental updates implementation can use the=
 new op.<br>
&gt;<br>
&gt; - A third possibility is that we define the extension operator in ALTO=
 incremental updates document itself, and proceed quickly.<br>
&gt;<br>
&gt; Any bug in the design? Any comments or suggestions?<br>
&gt;<br>
&gt; Thanks!<br>
&gt;<br>
&gt; Richard, Wendy<br>
<br>
</div></div>--<br>
Mark Nottingham=C2=A0 =C2=A0<a href=3D"https://www.mnot.net/" target=3D"_bl=
ank">https://www.mnot.net</a>/<br></blockquote></div>
</div></div>

--001a113f826480b7ae05056e4527--


From nobody Tue Oct 14 21:33:02 2014
Return-Path: <yang.r.yang@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0E60D1A020B for <alto@ietfa.amsl.com>; Tue, 14 Oct 2014 21:32:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.623
X-Spam-Level: 
X-Spam-Status: No, score=0.623 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 uc82bpITgqwZ for <alto@ietfa.amsl.com>; Tue, 14 Oct 2014 21:32:57 -0700 (PDT)
Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3E7481A0204 for <alto@ietf.org>; Tue, 14 Oct 2014 21:32:57 -0700 (PDT)
Received: by mail-ig0-f175.google.com with SMTP id uq10so16716729igb.8 for <alto@ietf.org>; Tue, 14 Oct 2014 21:32:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:date:message-id:subject:from:to:content-type;  bh=eO/1+SN4OiO3MAfZmb8jXW8fl+qGZANxAJdPN3X//AQ=; b=MbXPxR7AvLQwvTY7/fw0AfjFrI5TXfjw8iOeh9kI5C7IPbL21bh9xN+VLQOMZ73no7 rU/AJ7DYONjFY3CskPxIDo46EoFwpu2rya9d2e6odzg7e8lS679gVGvcrhuwYlyxhJSw WBMmgQgIEAi++KcFR+H28D+1AUN0NfeZvzYxV4QeGvyt/jZopZxh+I+4rIzXl9y9vywt VKZvWLAqK5Z5HM+cj4pHM5yDeBaEyib6dqAmXV4metAZ3cVL+DAZxsBXDNmzcjy/MktL DYcCKZ/0N9xB4CY+i/vURI0u7rdi5doFRFtUcjZmOJltQMMaSTqsBHMRTJLBHJdTz9rw 4dZw==
MIME-Version: 1.0
X-Received: by 10.107.156.17 with SMTP id f17mr6854181ioe.15.1413347576632; Tue, 14 Oct 2014 21:32:56 -0700 (PDT)
Sender: yang.r.yang@gmail.com
Received: by 10.107.131.224 with HTTP; Tue, 14 Oct 2014 21:32:56 -0700 (PDT)
Date: Wed, 15 Oct 2014 00:32:56 -0400
X-Google-Sender-Auth: a02fINEs-fUxlbSnv1p-XTSxssQ
Message-ID: <CANUuoLoY5tXsWg4mknQ0WsR43ZWVfDe=qb7Xv1U0Qa1zb42xoA@mail.gmail.com>
From: "Y. Richard Yang" <yry@cs.yale.edu>
To: IETF ALTO <alto@ietf.org>
Content-Type: multipart/alternative; boundary=001a1141ba063fdba005056ea070
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/3QwYN2YjANHT1OBp6OgLPHEiIXY
Subject: [alto] Incremental updates transport using SSE?
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 15 Oct 2014 04:32:58 -0000

--001a1141ba063fdba005056ea070
Content-Type: text/plain; charset=UTF-8

Dear all,

Given the potential progress in incremental update messaging format (e.g.,
merge-patch or tree-replace), it is time to consider the next item:
transport. In particular, we want decoupling of update message format from
transport: the payload can be carried by not only HTTP Patch, but other
methods, say client pull using HTTP POST, or SSE.

In particular, consider a design where an ALTO server pushes incremental
updates to an ALTO client using SSE. How about the following straw-man
mapping design, for client subscription and server push content indication:

event name: ALTO resource-id

id:
  if initial resource (full content), tag as full alto resource
  if new-tag_old-tag

data: {
data: "Content-Type": "application/merge-patch+json" | rfc6902 patch
data: "Content":
data: {
data: <op object here, need escape to avoid ambiguity, i.e., no extra
\ndata:>
data: }
data: }\n\n

Make sense, by SSE experts?

Richard

--001a1141ba063fdba005056ea070
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Dear all,</div><div><br></div><div>Given the potentia=
l progress in incremental update messaging format (e.g., merge-patch or tre=
e-replace), it is time to consider the next item: transport. In particular,=
 we want decoupling of update message format from transport: the payload ca=
n be carried by not only HTTP Patch, but other methods, say client pull usi=
ng HTTP POST, or SSE.</div><div><br></div><div>In particular, consider a de=
sign where an ALTO server pushes incremental updates to an ALTO client usin=
g SSE. How about the following straw-man mapping design, for client subscri=
ption and server push content indication:</div><div><br></div><div>event na=
me: ALTO resource-id</div><div><br></div><div>id:=C2=A0</div><div>=C2=A0 if=
 initial resource (full content), tag as full alto resource</div><div>=C2=
=A0 if new-tag_old-tag</div><div><br></div><div>data: {</div><div>data: &qu=
ot;Content-Type&quot;: &quot;application/merge-patch+json&quot; | rfc6902 p=
atch</div><div>data: &quot;Content&quot;:=C2=A0</div><div>data: {</div><div=
>data: &lt;op object here, need escape to avoid ambiguity, i.e., no extra \=
ndata:&gt;</div><div>data: }</div><div>data: }\n\n</div><div><br></div><div=
>Make sense, by SSE experts?</div><div><br></div><div>Richard</div>
</div>

--001a1141ba063fdba005056ea070--


From nobody Wed Oct 15 04:05:18 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B37721A1A91 for <alto@ietfa.amsl.com>; Wed, 15 Oct 2014 04:05:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.323
X-Spam-Level: *
X-Spam-Status: No, score=1.323 tagged_above=-999 required=5 tests=[BAYES_50=0.8, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 nUpBRdunB3fz for <alto@ietfa.amsl.com>; Wed, 15 Oct 2014 04:05:14 -0700 (PDT)
Received: from mail-yh0-x22b.google.com (mail-yh0-x22b.google.com [IPv6:2607:f8b0:4002:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 411941A1A9A for <alto@ietf.org>; Wed, 15 Oct 2014 04:05:07 -0700 (PDT)
Received: by mail-yh0-f43.google.com with SMTP id f73so458587yha.30 for <alto@ietf.org>; Wed, 15 Oct 2014 04:05:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=jBcQWnuP4ekiV1pV6gKMl6swXSZM56qAjnAZmWo7LrU=; b=YOXrluUNU25WTIrDnsOUL94UQTY3xVgzaI7paZO/8hoKU6O2dV6VGgcG/KCjWDSaQw j1kPZlSiVs1jDKndRRGNIGYo8h3awbL11nzDzLQSYUdiks03KskiaTn0hviP4cInzy/q /tFFJgVzi9VyyJpfC8vcUfmh1GzDYOZyssELU6Y27zfb3X+fJe2QUWHVuppnhTyxhpnl Z+JqXfhDUjsYWXlSK9uvIwoAY3R7NUmOowRI59JRbzp8cqkoNlPmZs+GOqniZHfzNkG3 rDuTmw4/m9LpxH8EFbAn93VrjaODQxgxsS2rr/UhMLA6wWZ9j9snUqc+s8PRhyx63UVp MnDA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=jBcQWnuP4ekiV1pV6gKMl6swXSZM56qAjnAZmWo7LrU=; b=kHEWhY/JeE5+DMdDTsB6lnJA4w7dFoYh1sLZWkXRERtxp51h1sjllLnvQeMja6c3Or B11cBxIrQv9xMEMYudCKzDoUTTBWDLkYp8x2FibjgBN0I1+tjDNOl8ih49/6P9e4XAuk KPg9sqBW+kmL7Nam+F5SLBP+Z8odjEPPiETrI=
X-Received: by 10.236.208.68 with SMTP id p44mr11692205yho.151.1413371106458;  Wed, 15 Oct 2014 04:05:06 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.97.10 with HTTP; Wed, 15 Oct 2014 04:04:46 -0700 (PDT)
In-Reply-To: <CANUuoLpNBWTk-B+soLNurw3jL8i9U28Tm3PCvvmXZ=L-0deSzw@mail.gmail.com>
References: <CANUuoLqJJL3Quf1RHJ=0rXNgPC6A7cbC=URcCfHt0-JyrmHh9Q@mail.gmail.com> <D001A864-F0F7-4421-9123-699D4D7EACE6@mnot.net> <CANUuoLpNBWTk-B+soLNurw3jL8i9U28Tm3PCvvmXZ=L-0deSzw@mail.gmail.com>
From: Xiao SHI <xiao.shi@yale.edu>
Date: Wed, 15 Oct 2014 07:04:46 -0400
X-Google-Sender-Auth: fyXkszq9oxxMRRkmprOJTvmma0c
Message-ID: <CAFwJzZke7xiA-fP+xrC8zotgmYsUMB5K+ihyY3-4WG7Rxs1dSg@mail.gmail.com>
To: "Y. Richard Yang" <yry@cs.yale.edu>
Content-Type: multipart/alternative; boundary=089e01537bb0bc84c70505741a46
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/NuUkC--uQvyA7YMWgnRYLz5epY8
Cc: Mark Nottingham <mnot@mnot.net>, IETF ALTO <alto@ietf.org>, Paul Bryan <pbryan@anode.ca>
Subject: Re: [alto] ALTO incremental updates and JSON Patch extension
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 15 Oct 2014 11:05:17 -0000

--089e01537bb0bc84c70505741a46
Content-Type: text/plain; charset=UTF-8

Hi folks,

Based on a cursory reading of the merge-patch, one possible (but clumsy)
solution is to use the assumption that JSON names SHOULD be unique in a
JSON object. Hence if you have for example:
====
{
  "pid1" : {"prefix1" : {}, "prefix2" : {}, "prefix3" :{}}
  "pid2" : {"prefix3" : {}, "prefix4" : {}, "prefix5" : {}}
}
====
Now, to delete "prefix2" from the value of "pid1", one can do:
====
op : remove
path : /pid1/prefix2
====

Building on top of what Richard said, the set-like array may also be an
issue if it is in the middle of the targeted path. For example, if I have
the following object (Sec. 11.4.1.6 of RFC7285 with one added element in
the dependent-vtags array):
====
{
  "meta" : {
    "dependent-vtags" : [
      {
        "resource-id": "my-default-network-map",
        "tag": "7915dc0290c2705481c491a2b4ffbec482b3cf62"
      },
      {
        "resource-id": "my-alternative-network-map",
        "tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e"
      }
    ]
  }
}
====
Let's say we want to modify the tag of the default-network-map (which seems
reasonable). Correct me if I'm wrong, but without knowing the specific
index of the array, this task would not be possible with JSON patch or
merge patch (since merge patch does not iterate through arrays).

Best,
Xiao


On Wed, Oct 15, 2014 at 12:07 AM, Y. Richard Yang <yry@cs.yale.edu> wrote:

> Dear Mark,
>
> Thanks a lot for the quick response! I did not remember reading
> merge-patch. After just reading it, I found that it is doing exactly what
> we wanted to do, and we called it tree-replace, to be similar to the
> replace operator defined in RFC6902. We will see how we may use it in our
> design.
>
> Since we are at JSON patch extensions, here is another issue that we want
> to resolve: set operations on an array. Consider a JSON object
> {
>   "pid1" : ["prefix1", "prefix2", "prefix3"]
>   "pid2" : ["prefix3", "prefix4", "prefix5"]
> }
>
> To delete "prefix2" from the value of "pid1", we need to write
>
> op : remove
> path : /pid1/1
>
> However, the real intention of the values of "pid1" and "pid2" are sets,
> but JSON has no concept of a set (not multi set), as discussed before. The
> set semantics guarantees no duplicates, and hence we may eliminate the
> burden on an application to keep track of the array index, if we are
> allowed to extend the JSON Pointer (rfc6901), in particular, when the case
> of the currently referenced value is a JSON array, by allowing functions or
> other chars, for example, to denote a set, or index look up--the current
> definition allows only numerical index or - and hence one can resolve
> ambiguity...
>
> Make sense?
>
> Richard
>
> On Tue, Oct 14, 2014 at 11:13 PM, Mark Nottingham <mnot@mnot.net> wrote:
>
>> Hi Richard,
>>
>> RFC6902 doesn't allow extension operators; you'd need to define a new
>> media type and specify its behaviour. Of course, you could do that pretty
>> easily by just saying "here's a new media type; it has the same semantics /
>> requirements as JSON Patch, plus this...".
>>
>> Also, I trust you've seen the new JSON merge-patch RFC (I think we spoke
>> about it before)?
>>   https://tools.ietf.org/html/rfc7386
>>
>> Cheers,
>>
>>
>> On 15 Oct 2014, at 4:47 am, Y. Richard Yang <yry@cs.yale.edu> wrote:
>>
>> > Dear all,
>> >
>> > Some of us are having an extensive discussion on how to proceed
>> regarding the ALTO incremental updates WG item. Here is a summary of what
>> we are thinking. At a high level, we plan to propose an approach of using
>> JSON Patch (RFC6902), but with some extensions. We want to get your
>> comments and advice on if you see any problems, and how best to proceed.
>> >
>> > Current state:
>> > ==========
>> > Both JSON Patch (RFC6902) and
>> http://tools.ietf.org/html/draft-roome-alto-incr-updates-01 are
>> considered as candidates of the encoding update message format.
>> >
>> > Design goal and problem:
>> > ====================
>> > Generality and efficiency. That is, we want an incremental update
>> format that can handle not only current resources but also future
>> resources. The recent trend in adopting YANG shows that general mechanisms,
>> not per protocol patch, have value. Generic encoding of JSON Patch based on
>> XPATH and a few operators is complete in this sense, but inefficient in key
>> ALTO cases such as updating cost maps, as pointed out in
>> http://tools.ietf.org/html/draft-roome-alto-incr-updates-01
>> >
>> > Key idea:
>> > =======
>> > A JSON object can be considered as an key-value tree, with each node
>> being an object and each edge labeled by the key, and the value of the edge
>> pointing to another object. For example, the ALTO cost map example:
>> > {
>> >             "meta" : {
>> >
>> >               "dependent-vtags" : [
>> >                 {"resource-id": "my-default-network-map",
>> >                  "tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e"
>> >                 }
>> >               ],
>> >
>> >               "vtag":
>> >                  {"resource-id": "COST-MAP-ID", "tag": "CM-TAG"},
>> >
>> >               "cost-type" : {"cost-mode"  : "numerical",
>> >                              "cost-metric": "routingcost"
>> >               }
>> >             },
>> >             "cost-map" : {
>> >               "PID1": { "PID1": 1,  "PID2": 5,  "PID3": 10 },
>> >               "PID2": { "PID1": 5,  "PID2": 1,  "PID3": 15 },
>> >               "PID3": { "PID1": 20, "PID2": 15  }
>> >             }
>> >
>> > defines a data tree with 14 leaf nodes:
>> >
>> > "meta/dependent-vtags/resource-id": "my-default-network-map",
>> > "meta/dependent-vtags/tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e",
>> > ...
>> > "cost-map/PID3/PID1": 20,
>> > "cost-map/PID3/PID2": 15
>> >
>> > RFC6902 focuses on encoding updating one node on the tree at a time. On
>> the other hand, one can realize that the cost-map update encoding of
>> http://tools.ietf.org/html/draft-roome-alto-incr-updates-01 updates a
>> set of nodes. For example, an update example
>> > {
>> >         "meta": {
>> >              "vtag":
>> >                  {"tag": "NEW-CM-TAG"},
>> >              },
>> >         "cost-map": {
>> >              "PID1": {"PID2": 10, "PID99": null}
>> >              }
>> >    }
>> > updates 3 nodes.
>> >
>> > If one thinks about, one will realize that this is a general,
>> interesting design: consider the data tree of the original object; the
>> update object is a partial tree of the original, and updates a batch
>> containing all matched nodes in the partial tree. We call this operator the
>> tree-replace operator. How may one do this as an extension of RFC6902:
>> >
>> > {
>> >  "op" : "tree-replace",
>> >  "path" : "/",    // prefix of update object
>> >  "value" :       // just a copy of the partial object in value
>> >       { "meta": {
>> >              "vtag":
>> >                  {"tag": "NEW-CM-TAG"},
>> >          },
>> >         "cost-map": {
>> >              "PID1": {"PID2": 10, "PID99": null}
>> >           }
>> >       }
>> > }
>> >
>> > Hence, we have a simple operator that appears to be able to fix the
>> cost-map efficiency issue and is still general, not ALTO only.
>> >
>> > Next step:
>> > ========
>> > - One possibility is to start to work on an extension of RFC 6902 to
>> introduce this operator, if there is no bug. After this is done, we specify
>> ALTO incremental updates using the new op. An issue is that this is a
>> sequential process and may take time.
>> >
>> > - Another possibility is that we specify JSON Patch as incremental
>> update encoding for now, losing efficiency. In parallel, we push for the
>> new op, and when it is done, ALTO incremental updates implementation can
>> use the new op.
>> >
>> > - A third possibility is that we define the extension operator in ALTO
>> incremental updates document itself, and proceed quickly.
>> >
>> > Any bug in the design? Any comments or suggestions?
>> >
>> > Thanks!
>> >
>> > Richard, Wendy
>>
>> --
>> Mark Nottingham   https://www.mnot.net/
>>
>
> _______________________________________________
> alto mailing list
> alto@ietf.org
> https://www.ietf.org/mailman/listinfo/alto
>
>

--089e01537bb0bc84c70505741a46
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi folks,<div><br></div><div>Based on a cursory reading of=
 the merge-patch, one possible (but clumsy) solution is to use the assumpti=
on that JSON names SHOULD be unique in a JSON object. Hence if you have for=
 example:</div><div>=3D=3D=3D=3D</div><div><div style=3D"font-family:arial,=
sans-serif;font-size:13px">{</div><div style=3D"font-family:arial,sans-seri=
f;font-size:13px">=C2=A0 &quot;pid1&quot; : {&quot;prefix1&quot; : {}, &quo=
t;prefix2&quot; : {}, &quot;prefix3&quot; :{}}</div><div style=3D"font-fami=
ly:arial,sans-serif;font-size:13px">=C2=A0 &quot;pid2&quot; : {&quot;prefix=
3&quot; : {}, &quot;prefix4&quot;=C2=A0: {}, &quot;prefix5&quot;=C2=A0: {}}=
</div><div style=3D"font-family:arial,sans-serif;font-size:13px">}</div></d=
iv><div style=3D"font-family:arial,sans-serif;font-size:13px">=3D=3D=3D=3D<=
/div><div><div>Now, to delete &quot;prefix2&quot; from the value of &quot;p=
id1&quot;, one can do:</div><div>=3D=3D=3D=3D</div><div>op : remove</div><d=
iv>path : /pid1/prefix2</div></div><div>=3D=3D=3D=3D</div><div><br></div><d=
iv>Building on top of what Richard said, the set-like array may also be an =
issue if it is in the middle of the targeted path. For example, if I have t=
he following object (Sec. 11.4.1.6 of RFC7285 with one added element in the=
 dependent-vtags array):</div><div>=3D=3D=3D=3D</div><div><div>{</div><div>=
=C2=A0 &quot;meta&quot; : {</div><div>=C2=A0 =C2=A0 &quot;dependent-vtags&q=
uot; : [</div><div>=C2=A0 =C2=A0 =C2=A0 {</div><div>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 &quot;resource-id&quot;: &quot;my-default-network-map&quot;,</div><d=
iv>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;tag&quot;: &quot;7915dc0290c2705481c49=
1a2b4ffbec482b3cf62&quot;</div><div>=C2=A0 =C2=A0 =C2=A0 },</div><div>=C2=
=A0 =C2=A0 =C2=A0 {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;resource-id=
&quot;: &quot;my-alternative-network-map&quot;,</div><div>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 &quot;tag&quot;: &quot;3ee2cb7e8d63d9fab71b9b34cbf764436315542e&=
quot;</div><div>=C2=A0 =C2=A0 =C2=A0 }</div><div>=C2=A0 =C2=A0 ]</div><div>=
=C2=A0 }</div><div>}</div></div><div>=3D=3D=3D=3D</div><div>Let&#39;s say w=
e want to modify the tag of the default-network-map (which seems reasonable=
). Correct me if I&#39;m wrong, but without knowing the specific index of t=
he array, this task would not be possible with JSON patch or merge patch (s=
ince merge patch does not iterate through arrays).</div><div><br></div><div=
>Best,</div><div>Xiao</div><div><br></div></div><div class=3D"gmail_extra">=
<br><div class=3D"gmail_quote">On Wed, Oct 15, 2014 at 12:07 AM, Y. Richard=
 Yang <span dir=3D"ltr">&lt;<a href=3D"mailto:yry@cs.yale.edu" target=3D"_b=
lank">yry@cs.yale.edu</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_q=
uote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1e=
x"><div dir=3D"ltr">Dear Mark,<div><br></div><div>Thanks a lot for the quic=
k response! I did not remember reading merge-patch. After just reading it, =
I found that it is doing exactly what we wanted to do, and we called it tre=
e-replace, to be similar to the replace operator defined in RFC6902. We wil=
l see how we may use it in our design.=C2=A0</div><div><br></div><div>Since=
 we are at JSON patch extensions, here is another issue that we want to res=
olve: set operations on an array. Consider a JSON object=C2=A0</div><div>{<=
/div><div>=C2=A0 &quot;pid1&quot; : [&quot;prefix1&quot;, &quot;prefix2&quo=
t;, &quot;prefix3&quot;]</div><div>=C2=A0 &quot;pid2&quot; : [&quot;prefix3=
&quot;, &quot;prefix4&quot;, &quot;prefix5&quot;]</div><div>}</div><div><br=
></div><div>To delete &quot;prefix2&quot; from the value of &quot;pid1&quot=
;, we need to write</div><div><br></div><div>op : remove</div><div>path : /=
pid1/1</div><div><br></div><div>However, the real intention of the values o=
f &quot;pid1&quot; and &quot;pid2&quot; are sets, but JSON has no concept o=
f a set (not multi set), as discussed before. The set semantics guarantees =
no duplicates, and hence we may eliminate the burden on an application to k=
eep track of the array index, if we are allowed to extend the JSON Pointer =
(rfc6901), in particular, when the case of the currently referenced value i=
s a JSON array, by allowing functions or other chars, for example, to denot=
e a set, or index look up--the current definition allows only numerical ind=
ex or - and hence one can resolve ambiguity...<br></div><div><br></div><div=
>Make sense?</div><span class=3D"HOEnZb"><font color=3D"#888888"><div><br><=
/div><div>Richard</div></font></span><div><div class=3D"h5"><div class=3D"g=
mail_extra"><br><div class=3D"gmail_quote">On Tue, Oct 14, 2014 at 11:13 PM=
, Mark Nottingham <span dir=3D"ltr">&lt;<a href=3D"mailto:mnot@mnot.net" ta=
rget=3D"_blank">mnot@mnot.net</a>&gt;</span> wrote:<br><blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding=
-left:1ex">Hi Richard,<br>
<br>
RFC6902 doesn&#39;t allow extension operators; you&#39;d need to define a n=
ew media type and specify its behaviour. Of course, you could do that prett=
y easily by just saying &quot;here&#39;s a new media type; it has the same =
semantics / requirements as JSON Patch, plus this...&quot;.<br>
<br>
Also, I trust you&#39;ve seen the new JSON merge-patch RFC (I think we spok=
e about it before)?<br>
=C2=A0 <a href=3D"https://tools.ietf.org/html/rfc7386" target=3D"_blank">ht=
tps://tools.ietf.org/html/rfc7386</a><br>
<br>
Cheers,<br>
<div><div><br>
<br>
On 15 Oct 2014, at 4:47 am, Y. Richard Yang &lt;<a href=3D"mailto:yry@cs.ya=
le.edu" target=3D"_blank">yry@cs.yale.edu</a>&gt; wrote:<br>
<br>
&gt; Dear all,<br>
&gt;<br>
&gt; Some of us are having an extensive discussion on how to proceed regard=
ing the ALTO incremental updates WG item. Here is a summary of what we are =
thinking. At a high level, we plan to propose an approach of using JSON Pat=
ch (RFC6902), but with some extensions. We want to get your comments and ad=
vice on if you see any problems, and how best to proceed.<br>
&gt;<br>
&gt; Current state:<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
&gt; Both JSON Patch (RFC6902) and=C2=A0 <a href=3D"http://tools.ietf.org/h=
tml/draft-roome-alto-incr-updates-01" target=3D"_blank">http://tools.ietf.o=
rg/html/draft-roome-alto-incr-updates-01</a> are considered as candidates o=
f the encoding update message format.<br>
&gt;<br>
&gt; Design goal and problem:<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
&gt; Generality and efficiency. That is, we want an incremental update form=
at that can handle not only current resources but also future resources. Th=
e recent trend in adopting YANG shows that general mechanisms, not per prot=
ocol patch, have value. Generic encoding of JSON Patch based on XPATH and a=
 few operators is complete in this sense, but inefficient in key ALTO cases=
 such as updating cost maps, as pointed out in <a href=3D"http://tools.ietf=
.org/html/draft-roome-alto-incr-updates-01" target=3D"_blank">http://tools.=
ietf.org/html/draft-roome-alto-incr-updates-01</a><br>
&gt;<br>
&gt; Key idea:<br>
&gt; =3D=3D=3D=3D=3D=3D=3D<br>
&gt; A JSON object can be considered as an key-value tree, with each node b=
eing an object and each edge labeled by the key, and the value of the edge =
pointing to another object. For example, the ALTO cost map example:<br>
&gt; {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;meta&quot; : {<br=
>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;dependent-=
vtags&quot; : [<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{&quot;re=
source-id&quot;: &quot;my-default-network-map&quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;ta=
g&quot;: &quot;3ee2cb7e8d63d9fab71b9b34cbf764436315542e&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0],<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;vtag&quot;=
:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;r=
esource-id&quot;: &quot;COST-MAP-ID&quot;, &quot;tag&quot;: &quot;CM-TAG&qu=
ot;},<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;cost-type&=
quot; : {&quot;cost-mode&quot;=C2=A0 : &quot;numerical&quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;cost-metric&quot;: &quot;routingco=
st&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0},<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;cost-map&quot; : =
{<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;PID1&quot;=
: { &quot;PID1&quot;: 1,=C2=A0 &quot;PID2&quot;: 5,=C2=A0 &quot;PID3&quot;:=
 10 },<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;PID2&quot;=
: { &quot;PID1&quot;: 5,=C2=A0 &quot;PID2&quot;: 1,=C2=A0 &quot;PID3&quot;:=
 15 },<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;PID3&quot;=
: { &quot;PID1&quot;: 20, &quot;PID2&quot;: 15=C2=A0 }<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;<br>
&gt; defines a data tree with 14 leaf nodes:<br>
&gt;<br>
&gt; &quot;meta/dependent-vtags/resource-id&quot;: &quot;my-default-network=
-map&quot;,<br>
&gt; &quot;meta/dependent-vtags/tag&quot;: &quot;3ee2cb7e8d63d9fab71b9b34cb=
f764436315542e&quot;,<br>
&gt; ...<br>
&gt; &quot;cost-map/PID3/PID1&quot;: 20,<br>
&gt; &quot;cost-map/PID3/PID2&quot;: 15<br>
&gt;<br>
&gt; RFC6902 focuses on encoding updating one node on the tree at a time. O=
n the other hand, one can realize that the cost-map update encoding of <a h=
ref=3D"http://tools.ietf.org/html/draft-roome-alto-incr-updates-01" target=
=3D"_blank">http://tools.ietf.org/html/draft-roome-alto-incr-updates-01</a>=
 updates a set of nodes. For example, an update example<br>
&gt; {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;meta&quot;: {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;vtag&quot;:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;t=
ag&quot;: &quot;NEW-CM-TAG&quot;},<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 },<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;cost-map&quot;: {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;PID1&quot;: {&qu=
ot;PID2&quot;: 10, &quot;PID99&quot;: null}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 =C2=A0 }<br>
&gt; updates 3 nodes.<br>
&gt;<br>
&gt; If one thinks about, one will realize that this is a general, interest=
ing design: consider the data tree of the original object; the update objec=
t is a partial tree of the original, and updates a batch containing all mat=
ched nodes in the partial tree. We call this operator the tree-replace oper=
ator. How may one do this as an extension of RFC6902:<br>
&gt;<br>
&gt; {<br>
&gt;=C2=A0 &quot;op&quot; : &quot;tree-replace&quot;,<br>
&gt;=C2=A0 &quot;path&quot; : &quot;/&quot;,=C2=A0 =C2=A0 // prefix of upda=
te object<br>
&gt;=C2=A0 &quot;value&quot; :=C2=A0 =C2=A0 =C2=A0 =C2=A0// just a copy of =
the partial object in value<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0{ &quot;meta&quot;: {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;vtag&quot;:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;t=
ag&quot;: &quot;NEW-CM-TAG&quot;},<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 },<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;cost-map&quot;: {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;PID1&quot;: {&qu=
ot;PID2&quot;: 10, &quot;PID99&quot;: null}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt; }<br>
&gt;<br>
&gt; Hence, we have a simple operator that appears to be able to fix the co=
st-map efficiency issue and is still general, not ALTO only.<br>
&gt;<br>
&gt; Next step:<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D<br>
&gt; - One possibility is to start to work on an extension of RFC 6902 to i=
ntroduce this operator, if there is no bug. After this is done, we specify =
ALTO incremental updates using the new op. An issue is that this is a seque=
ntial process and may take time.<br>
&gt;<br>
&gt; - Another possibility is that we specify JSON Patch as incremental upd=
ate encoding for now, losing efficiency. In parallel, we push for the new o=
p, and when it is done, ALTO incremental updates implementation can use the=
 new op.<br>
&gt;<br>
&gt; - A third possibility is that we define the extension operator in ALTO=
 incremental updates document itself, and proceed quickly.<br>
&gt;<br>
&gt; Any bug in the design? Any comments or suggestions?<br>
&gt;<br>
&gt; Thanks!<br>
&gt;<br>
&gt; Richard, Wendy<br>
<br>
</div></div>--<br>
Mark Nottingham=C2=A0 =C2=A0<a href=3D"https://www.mnot.net/" target=3D"_bl=
ank">https://www.mnot.net</a>/<br></blockquote></div>
</div></div></div></div>
<br>_______________________________________________<br>
alto mailing list<br>
<a href=3D"mailto:alto@ietf.org">alto@ietf.org</a><br>
<a href=3D"https://www.ietf.org/mailman/listinfo/alto" target=3D"_blank">ht=
tps://www.ietf.org/mailman/listinfo/alto</a><br>
<br></blockquote></div><br></div>

--089e01537bb0bc84c70505741a46--


From nobody Wed Oct 15 12:06:08 2014
Return-Path: <yang.r.yang@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3B0341A9151 for <alto@ietfa.amsl.com>; Wed, 15 Oct 2014 12:06:06 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.277
X-Spam-Level: 
X-Spam-Status: No, score=-1.277 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 iN4GkruhOBHr for <alto@ietfa.amsl.com>; Wed, 15 Oct 2014 12:06:02 -0700 (PDT)
Received: from mail-ig0-x22d.google.com (mail-ig0-x22d.google.com [IPv6:2607:f8b0:4001:c05::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AFEF41A914C for <alto@ietf.org>; Wed, 15 Oct 2014 12:06:02 -0700 (PDT)
Received: by mail-ig0-f173.google.com with SMTP id h18so17984727igc.12 for <alto@ietf.org>; Wed, 15 Oct 2014 12:06:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=vprqp4jLpv4IPlfDdZT3ZnPJ5+zGlj1tg4gOIfVf/VM=; b=vEpf8y1vgPOFP8hIK/iuHTmgfOvkwH1c93lx6mPiXxtDvwNm2rI3PWvl8Yl74U+/sx IOSUOacZHUYUiIficj2IRr/FfZ+SZPaBFi0kCcriskx9e/5LGDb6ebqey+ViffYnuzsL xjg2srvjas7QAkWqZ30MR8LRJCBBfbf0F4bM8ViHzMl2MXxB0l/Zq8Km/2vTtexWvHOz Tfh5eGc53Theu+0UuaV+fiJJL98OJDtoNQxkmFhoK9WbidDcXuvUzvdIVzCQQ11BoTBK KmcgHyEK8CE667T86rdkzO+vU36yATxR8Zz6hiqE9WDfLcRpiu0tjOImdXRGg9syhYu5 8a5g==
MIME-Version: 1.0
X-Received: by 10.107.152.149 with SMTP id a143mr12066210ioe.39.1413399962079;  Wed, 15 Oct 2014 12:06:02 -0700 (PDT)
Sender: yang.r.yang@gmail.com
Received: by 10.107.131.224 with HTTP; Wed, 15 Oct 2014 12:06:02 -0700 (PDT)
In-Reply-To: <CAFwJzZke7xiA-fP+xrC8zotgmYsUMB5K+ihyY3-4WG7Rxs1dSg@mail.gmail.com>
References: <CANUuoLqJJL3Quf1RHJ=0rXNgPC6A7cbC=URcCfHt0-JyrmHh9Q@mail.gmail.com> <D001A864-F0F7-4421-9123-699D4D7EACE6@mnot.net> <CANUuoLpNBWTk-B+soLNurw3jL8i9U28Tm3PCvvmXZ=L-0deSzw@mail.gmail.com> <CAFwJzZke7xiA-fP+xrC8zotgmYsUMB5K+ihyY3-4WG7Rxs1dSg@mail.gmail.com>
Date: Wed, 15 Oct 2014 15:06:02 -0400
X-Google-Sender-Auth: OpRyivPqAU62QUwZez2HTrND7f4
Message-ID: <CANUuoLrRp9kH2fGU9uDdeoTtcPMvbDbgXMkrX8CzjbCgjQVLqQ@mail.gmail.com>
From: "Y. Richard Yang" <yry@cs.yale.edu>
To: Xiao SHI <xiao.shi@yale.edu>
Content-Type: multipart/alternative; boundary=001a1140f504aa5a1205057ad254
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/5xIXsyH8mlj5pvhVQwcgOwwU3P4
Cc: Mark Nottingham <mnot@mnot.net>, IETF ALTO <alto@ietf.org>, Paul Bryan <pbryan@anode.ca>
Subject: Re: [alto] ALTO incremental updates and JSON Patch extension
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 15 Oct 2014 19:06:06 -0000

--001a1140f504aa5a1205057ad254
Content-Type: text/plain; charset=UTF-8

Hi Xiao,

On Wed, Oct 15, 2014 at 7:04 AM, Xiao SHI <xiao.shi@yale.edu> wrote:

> Hi folks,
>
> Based on a cursory reading of the merge-patch, one possible (but clumsy)
> solution is to use the assumption that JSON names SHOULD be unique in a
> JSON object. Hence if you have for example:
> ====
> {
>   "pid1" : {"prefix1" : {}, "prefix2" : {}, "prefix3" :{}}
>   "pid2" : {"prefix3" : {}, "prefix4" : {}, "prefix5" : {}}
> }
> ====
> Now, to delete "prefix2" from the value of "pid1", one can do:
> ====
> op : remove
> path : /pid1/prefix2
> ====
>
>
The preceding is quite clever!! It can be a generic way to encode set. My
concern is that it could be considered as only a clever hack :-)


> Building on top of what Richard said, the set-like array may also be an
> issue if it is in the middle of the targeted path. For example, if I have
> the following object (Sec. 11.4.1.6 of RFC7285 with one added element in
> the dependent-vtags array):
> ====
> {
>   "meta" : {
>     "dependent-vtags" : [
>       {
>         "resource-id": "my-default-network-map",
>         "tag": "7915dc0290c2705481c491a2b4ffbec482b3cf62"
>       },
>       {
>         "resource-id": "my-alternative-network-map",
>         "tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e"
>       }
>     ]
>   }
> }
> ====
> Let's say we want to modify the tag of the default-network-map (which
> seems reasonable). Correct me if I'm wrong, but without knowing the
> specific index of the array, this task would not be possible with JSON
> patch or merge patch (since merge patch does not iterate through arrays).
>

Very interesting example! The only way I could think of now, using your
preceding hack, if we use hash as name in array name:
h1 = hash({
        "resource-id": "my-default-network-map",
        "tag": "7915dc0290c2705481c491a2b4ffbec482b3cf62"
      })
h2 = hash({
        "resource-id": "my-alternative-network-map",
        "tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e"
      })
{
     h1 : {
        "resource-id": "my-default-network-map",
        "tag": "7915dc0290c2705481c491a2b4ffbec482b3cf62"
      },
      h2 : {
        "resource-id": "my-alternative-network-map",
        "tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e"
      }
 }

We might be getting more and more academic, but it will be cool to hear
what others think, if any.

Thanks!

Richard


>
> Best,
> Xiao
>
>
> On Wed, Oct 15, 2014 at 12:07 AM, Y. Richard Yang <yry@cs.yale.edu> wrote:
>
>> Dear Mark,
>>
>> Thanks a lot for the quick response! I did not remember reading
>> merge-patch. After just reading it, I found that it is doing exactly what
>> we wanted to do, and we called it tree-replace, to be similar to the
>> replace operator defined in RFC6902. We will see how we may use it in our
>> design.
>>
>> Since we are at JSON patch extensions, here is another issue that we want
>> to resolve: set operations on an array. Consider a JSON object
>> {
>>   "pid1" : ["prefix1", "prefix2", "prefix3"]
>>   "pid2" : ["prefix3", "prefix4", "prefix5"]
>> }
>>
>> To delete "prefix2" from the value of "pid1", we need to write
>>
>> op : remove
>> path : /pid1/1
>>
>> However, the real intention of the values of "pid1" and "pid2" are sets,
>> but JSON has no concept of a set (not multi set), as discussed before. The
>> set semantics guarantees no duplicates, and hence we may eliminate the
>> burden on an application to keep track of the array index, if we are
>> allowed to extend the JSON Pointer (rfc6901), in particular, when the case
>> of the currently referenced value is a JSON array, by allowing functions or
>> other chars, for example, to denote a set, or index look up--the current
>> definition allows only numerical index or - and hence one can resolve
>> ambiguity...
>>
>> Make sense?
>>
>> Richard
>>
>> On Tue, Oct 14, 2014 at 11:13 PM, Mark Nottingham <mnot@mnot.net> wrote:
>>
>>> Hi Richard,
>>>
>>> RFC6902 doesn't allow extension operators; you'd need to define a new
>>> media type and specify its behaviour. Of course, you could do that pretty
>>> easily by just saying "here's a new media type; it has the same semantics /
>>> requirements as JSON Patch, plus this...".
>>>
>>> Also, I trust you've seen the new JSON merge-patch RFC (I think we spoke
>>> about it before)?
>>>   https://tools.ietf.org/html/rfc7386
>>>
>>> Cheers,
>>>
>>>
>>> On 15 Oct 2014, at 4:47 am, Y. Richard Yang <yry@cs.yale.edu> wrote:
>>>
>>> > Dear all,
>>> >
>>> > Some of us are having an extensive discussion on how to proceed
>>> regarding the ALTO incremental updates WG item. Here is a summary of what
>>> we are thinking. At a high level, we plan to propose an approach of using
>>> JSON Patch (RFC6902), but with some extensions. We want to get your
>>> comments and advice on if you see any problems, and how best to proceed.
>>> >
>>> > Current state:
>>> > ==========
>>> > Both JSON Patch (RFC6902) and
>>> http://tools.ietf.org/html/draft-roome-alto-incr-updates-01 are
>>> considered as candidates of the encoding update message format.
>>> >
>>> > Design goal and problem:
>>> > ====================
>>> > Generality and efficiency. That is, we want an incremental update
>>> format that can handle not only current resources but also future
>>> resources. The recent trend in adopting YANG shows that general mechanisms,
>>> not per protocol patch, have value. Generic encoding of JSON Patch based on
>>> XPATH and a few operators is complete in this sense, but inefficient in key
>>> ALTO cases such as updating cost maps, as pointed out in
>>> http://tools.ietf.org/html/draft-roome-alto-incr-updates-01
>>> >
>>> > Key idea:
>>> > =======
>>> > A JSON object can be considered as an key-value tree, with each node
>>> being an object and each edge labeled by the key, and the value of the edge
>>> pointing to another object. For example, the ALTO cost map example:
>>> > {
>>> >             "meta" : {
>>> >
>>> >               "dependent-vtags" : [
>>> >                 {"resource-id": "my-default-network-map",
>>> >                  "tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e"
>>> >                 }
>>> >               ],
>>> >
>>> >               "vtag":
>>> >                  {"resource-id": "COST-MAP-ID", "tag": "CM-TAG"},
>>> >
>>> >               "cost-type" : {"cost-mode"  : "numerical",
>>> >                              "cost-metric": "routingcost"
>>> >               }
>>> >             },
>>> >             "cost-map" : {
>>> >               "PID1": { "PID1": 1,  "PID2": 5,  "PID3": 10 },
>>> >               "PID2": { "PID1": 5,  "PID2": 1,  "PID3": 15 },
>>> >               "PID3": { "PID1": 20, "PID2": 15  }
>>> >             }
>>> >
>>> > defines a data tree with 14 leaf nodes:
>>> >
>>> > "meta/dependent-vtags/resource-id": "my-default-network-map",
>>> > "meta/dependent-vtags/tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e",
>>> > ...
>>> > "cost-map/PID3/PID1": 20,
>>> > "cost-map/PID3/PID2": 15
>>> >
>>> > RFC6902 focuses on encoding updating one node on the tree at a time.
>>> On the other hand, one can realize that the cost-map update encoding of
>>> http://tools.ietf.org/html/draft-roome-alto-incr-updates-01 updates a
>>> set of nodes. For example, an update example
>>> > {
>>> >         "meta": {
>>> >              "vtag":
>>> >                  {"tag": "NEW-CM-TAG"},
>>> >              },
>>> >         "cost-map": {
>>> >              "PID1": {"PID2": 10, "PID99": null}
>>> >              }
>>> >    }
>>> > updates 3 nodes.
>>> >
>>> > If one thinks about, one will realize that this is a general,
>>> interesting design: consider the data tree of the original object; the
>>> update object is a partial tree of the original, and updates a batch
>>> containing all matched nodes in the partial tree. We call this operator the
>>> tree-replace operator. How may one do this as an extension of RFC6902:
>>> >
>>> > {
>>> >  "op" : "tree-replace",
>>> >  "path" : "/",    // prefix of update object
>>> >  "value" :       // just a copy of the partial object in value
>>> >       { "meta": {
>>> >              "vtag":
>>> >                  {"tag": "NEW-CM-TAG"},
>>> >          },
>>> >         "cost-map": {
>>> >              "PID1": {"PID2": 10, "PID99": null}
>>> >           }
>>> >       }
>>> > }
>>> >
>>> > Hence, we have a simple operator that appears to be able to fix the
>>> cost-map efficiency issue and is still general, not ALTO only.
>>> >
>>> > Next step:
>>> > ========
>>> > - One possibility is to start to work on an extension of RFC 6902 to
>>> introduce this operator, if there is no bug. After this is done, we specify
>>> ALTO incremental updates using the new op. An issue is that this is a
>>> sequential process and may take time.
>>> >
>>> > - Another possibility is that we specify JSON Patch as incremental
>>> update encoding for now, losing efficiency. In parallel, we push for the
>>> new op, and when it is done, ALTO incremental updates implementation can
>>> use the new op.
>>> >
>>> > - A third possibility is that we define the extension operator in ALTO
>>> incremental updates document itself, and proceed quickly.
>>> >
>>> > Any bug in the design? Any comments or suggestions?
>>> >
>>> > Thanks!
>>> >
>>> > Richard, Wendy
>>>
>>> --
>>> Mark Nottingham   https://www.mnot.net/
>>>
>>
>> _______________________________________________
>> alto mailing list
>> alto@ietf.org
>> https://www.ietf.org/mailman/listinfo/alto
>>
>

--001a1140f504aa5a1205057ad254
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Xiao,<br><div class=3D"gmail_extra"><br><div class=3D"g=
mail_quote">On Wed, Oct 15, 2014 at 7:04 AM, Xiao SHI <span dir=3D"ltr">&lt=
;<a href=3D"mailto:xiao.shi@yale.edu" target=3D"_blank">xiao.shi@yale.edu</=
a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0=
px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);b=
order-left-style:solid;padding-left:1ex"><div dir=3D"ltr">Hi folks,<div><br=
></div><div>Based on a cursory reading of the merge-patch, one possible (bu=
t clumsy) solution is to use the assumption that JSON names SHOULD be uniqu=
e in a JSON object. Hence if you have for example:</div><div>=3D=3D=3D=3D</=
div><div><span class=3D""><div style=3D"font-family:arial,sans-serif;font-s=
ize:13px">{</div><div style=3D"font-family:arial,sans-serif;font-size:13px"=
>=C2=A0 &quot;pid1&quot; : {&quot;prefix1&quot; : {}, &quot;prefix2&quot; :=
 {}, &quot;prefix3&quot; :{}}</div></span><div style=3D"font-family:arial,s=
ans-serif;font-size:13px">=C2=A0 &quot;pid2&quot; : {&quot;prefix3&quot; : =
{}, &quot;prefix4&quot;=C2=A0: {}, &quot;prefix5&quot;=C2=A0: {}}</div><div=
 style=3D"font-family:arial,sans-serif;font-size:13px">}</div></div><div st=
yle=3D"font-family:arial,sans-serif;font-size:13px">=3D=3D=3D=3D</div><div>=
<div>Now, to delete &quot;prefix2&quot; from the value of &quot;pid1&quot;,=
 one can do:</div><div>=3D=3D=3D=3D</div><div>op : remove</div><div>path : =
/pid1/prefix2</div></div><div>=3D=3D=3D=3D</div><div><br></div></div></bloc=
kquote><div><br></div><div>The preceding is quite clever!! It can be a gene=
ric way to encode set. My concern is that it could be considered as only a =
clever hack :-)</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(=
204,204,204);border-left-style:solid;padding-left:1ex"><div dir=3D"ltr"><di=
v></div><div>Building on top of what Richard said, the set-like array may a=
lso be an issue if it is in the middle of the targeted path. For example, i=
f I have the following object (Sec. 11.4.1.6 of RFC7285 with one added elem=
ent in the dependent-vtags array):</div><div>=3D=3D=3D=3D</div><div><span c=
lass=3D""><div>{</div><div>=C2=A0 &quot;meta&quot; : {</div><div>=C2=A0 =C2=
=A0 &quot;dependent-vtags&quot; : [</div><div>=C2=A0 =C2=A0 =C2=A0 {</div><=
div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;resource-id&quot;: &quot;my-default-n=
etwork-map&quot;,</div></span><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;tag&qu=
ot;: &quot;7915dc0290c2705481c491a2b4ffbec482b3cf62&quot;</div><div>=C2=A0 =
=C2=A0 =C2=A0 },</div><div>=C2=A0 =C2=A0 =C2=A0 {</div><div>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 &quot;resource-id&quot;: &quot;my-alternative-network-map&quo=
t;,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;tag&quot;: &quot;3ee2cb7e8d=
63d9fab71b9b34cbf764436315542e&quot;</div><div>=C2=A0 =C2=A0 =C2=A0 }</div>=
<div>=C2=A0 =C2=A0 ]</div><div>=C2=A0 }</div><div>}</div></div><div>=3D=3D=
=3D=3D</div><div>Let&#39;s say we want to modify the tag of the default-net=
work-map (which seems reasonable). Correct me if I&#39;m wrong, but without=
 knowing the specific index of the array, this task would not be possible w=
ith JSON patch or merge patch (since merge patch does not iterate through a=
rrays).</div></div></blockquote><div><br></div><div>Very interesting exampl=
e! The only way I could think of now, using your preceding hack, if we use =
hash as name in array name:</div><div>h1 =3D hash({</div><span class=3D""><=
div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;resource-id&quot;: &quot;my-default-n=
etwork-map&quot;,</div></span><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;tag&qu=
ot;: &quot;7915dc0290c2705481c491a2b4ffbec482b3cf62&quot;</div><div>=C2=A0 =
=C2=A0 =C2=A0 })</div><div>h2 =3D hash({</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 &quot;resource-id&quot;: &quot;my-alternative-network-map&quot;,</div><=
div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;tag&quot;: &quot;3ee2cb7e8d63d9fab71b=
9b34cbf764436315542e&quot;</div><div>=C2=A0 =C2=A0 =C2=A0 })</div><div><spa=
n class=3D""><div>{</div><div>=C2=A0 =C2=A0 =C2=A0h1 : {</div><div>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 &quot;resource-id&quot;: &quot;my-default-network-map&=
quot;,</div></span><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;tag&quot;: &quot;=
7915dc0290c2705481c491a2b4ffbec482b3cf62&quot;</div><div>=C2=A0 =C2=A0 =C2=
=A0 },</div><div>=C2=A0 =C2=A0 =C2=A0 h2 : {</div><div>=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 &quot;resource-id&quot;: &quot;my-alternative-network-map&quot;,</d=
iv><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;tag&quot;: &quot;3ee2cb7e8d63d9fa=
b71b9b34cbf764436315542e&quot;</div><div>=C2=A0 =C2=A0 =C2=A0 }</div><div>=
=C2=A0}</div></div><div><br></div><div>We might be getting more and more ac=
ademic, but it will be cool to hear what others think, if any.</div><div><b=
r></div><div>Thanks!</div><div><br></div><div>Richard</div><div>=C2=A0</div=
><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border=
-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;=
padding-left:1ex"><div dir=3D"ltr"><div><br></div><div>Best,</div><div>Xiao=
</div><div><br></div></div><div class=3D"gmail_extra"><br><div class=3D"gma=
il_quote"><div><div class=3D"h5">On Wed, Oct 15, 2014 at 12:07 AM, Y. Richa=
rd Yang <span dir=3D"ltr">&lt;<a href=3D"mailto:yry@cs.yale.edu" target=3D"=
_blank">yry@cs.yale.edu</a>&gt;</span> wrote:<br></div></div><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px=
;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1e=
x"><div><div class=3D"h5"><div dir=3D"ltr">Dear Mark,<div><br></div><div>Th=
anks a lot for the quick response! I did not remember reading merge-patch. =
After just reading it, I found that it is doing exactly what we wanted to d=
o, and we called it tree-replace, to be similar to the replace operator def=
ined in RFC6902. We will see how we may use it in our design.=C2=A0</div><d=
iv><br></div><div>Since we are at JSON patch extensions, here is another is=
sue that we want to resolve: set operations on an array. Consider a JSON ob=
ject=C2=A0</div><div>{</div><div>=C2=A0 &quot;pid1&quot; : [&quot;prefix1&q=
uot;, &quot;prefix2&quot;, &quot;prefix3&quot;]</div><div>=C2=A0 &quot;pid2=
&quot; : [&quot;prefix3&quot;, &quot;prefix4&quot;, &quot;prefix5&quot;]</d=
iv><div>}</div><div><br></div><div>To delete &quot;prefix2&quot; from the v=
alue of &quot;pid1&quot;, we need to write</div><div><br></div><div>op : re=
move</div><div>path : /pid1/1</div><div><br></div><div>However, the real in=
tention of the values of &quot;pid1&quot; and &quot;pid2&quot; are sets, bu=
t JSON has no concept of a set (not multi set), as discussed before. The se=
t semantics guarantees no duplicates, and hence we may eliminate the burden=
 on an application to keep track of the array index, if we are allowed to e=
xtend the JSON Pointer (rfc6901), in particular, when the case of the curre=
ntly referenced value is a JSON array, by allowing functions or other chars=
, for example, to denote a set, or index look up--the current definition al=
lows only numerical index or - and hence one can resolve ambiguity...<br></=
div><div><br></div><div>Make sense?</div><span><font color=3D"#888888"><div=
><br></div><div>Richard</div></font></span><div><div><div class=3D"gmail_ex=
tra"><br><div class=3D"gmail_quote">On Tue, Oct 14, 2014 at 11:13 PM, Mark =
Nottingham <span dir=3D"ltr">&lt;<a href=3D"mailto:mnot@mnot.net" target=3D=
"_blank">mnot@mnot.net</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_=
quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-=
color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Richard=
,<br>
<br>
RFC6902 doesn&#39;t allow extension operators; you&#39;d need to define a n=
ew media type and specify its behaviour. Of course, you could do that prett=
y easily by just saying &quot;here&#39;s a new media type; it has the same =
semantics / requirements as JSON Patch, plus this...&quot;.<br>
<br>
Also, I trust you&#39;ve seen the new JSON merge-patch RFC (I think we spok=
e about it before)?<br>
=C2=A0 <a href=3D"https://tools.ietf.org/html/rfc7386" target=3D"_blank">ht=
tps://tools.ietf.org/html/rfc7386</a><br>
<br>
Cheers,<br>
<div><div><br>
<br>
On 15 Oct 2014, at 4:47 am, Y. Richard Yang &lt;<a href=3D"mailto:yry@cs.ya=
le.edu" target=3D"_blank">yry@cs.yale.edu</a>&gt; wrote:<br>
<br>
&gt; Dear all,<br>
&gt;<br>
&gt; Some of us are having an extensive discussion on how to proceed regard=
ing the ALTO incremental updates WG item. Here is a summary of what we are =
thinking. At a high level, we plan to propose an approach of using JSON Pat=
ch (RFC6902), but with some extensions. We want to get your comments and ad=
vice on if you see any problems, and how best to proceed.<br>
&gt;<br>
&gt; Current state:<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
&gt; Both JSON Patch (RFC6902) and=C2=A0 <a href=3D"http://tools.ietf.org/h=
tml/draft-roome-alto-incr-updates-01" target=3D"_blank">http://tools.ietf.o=
rg/html/draft-roome-alto-incr-updates-01</a> are considered as candidates o=
f the encoding update message format.<br>
&gt;<br>
&gt; Design goal and problem:<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
&gt; Generality and efficiency. That is, we want an incremental update form=
at that can handle not only current resources but also future resources. Th=
e recent trend in adopting YANG shows that general mechanisms, not per prot=
ocol patch, have value. Generic encoding of JSON Patch based on XPATH and a=
 few operators is complete in this sense, but inefficient in key ALTO cases=
 such as updating cost maps, as pointed out in <a href=3D"http://tools.ietf=
.org/html/draft-roome-alto-incr-updates-01" target=3D"_blank">http://tools.=
ietf.org/html/draft-roome-alto-incr-updates-01</a><br>
&gt;<br>
&gt; Key idea:<br>
&gt; =3D=3D=3D=3D=3D=3D=3D<br>
&gt; A JSON object can be considered as an key-value tree, with each node b=
eing an object and each edge labeled by the key, and the value of the edge =
pointing to another object. For example, the ALTO cost map example:<br>
&gt; {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;meta&quot; : {<br=
>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;dependent-=
vtags&quot; : [<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{&quot;re=
source-id&quot;: &quot;my-default-network-map&quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;ta=
g&quot;: &quot;3ee2cb7e8d63d9fab71b9b34cbf764436315542e&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0],<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;vtag&quot;=
:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;r=
esource-id&quot;: &quot;COST-MAP-ID&quot;, &quot;tag&quot;: &quot;CM-TAG&qu=
ot;},<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;cost-type&=
quot; : {&quot;cost-mode&quot;=C2=A0 : &quot;numerical&quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;cost-metric&quot;: &quot;routingco=
st&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0},<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;cost-map&quot; : =
{<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;PID1&quot;=
: { &quot;PID1&quot;: 1,=C2=A0 &quot;PID2&quot;: 5,=C2=A0 &quot;PID3&quot;:=
 10 },<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;PID2&quot;=
: { &quot;PID1&quot;: 5,=C2=A0 &quot;PID2&quot;: 1,=C2=A0 &quot;PID3&quot;:=
 15 },<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;PID3&quot;=
: { &quot;PID1&quot;: 20, &quot;PID2&quot;: 15=C2=A0 }<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;<br>
&gt; defines a data tree with 14 leaf nodes:<br>
&gt;<br>
&gt; &quot;meta/dependent-vtags/resource-id&quot;: &quot;my-default-network=
-map&quot;,<br>
&gt; &quot;meta/dependent-vtags/tag&quot;: &quot;3ee2cb7e8d63d9fab71b9b34cb=
f764436315542e&quot;,<br>
&gt; ...<br>
&gt; &quot;cost-map/PID3/PID1&quot;: 20,<br>
&gt; &quot;cost-map/PID3/PID2&quot;: 15<br>
&gt;<br>
&gt; RFC6902 focuses on encoding updating one node on the tree at a time. O=
n the other hand, one can realize that the cost-map update encoding of <a h=
ref=3D"http://tools.ietf.org/html/draft-roome-alto-incr-updates-01" target=
=3D"_blank">http://tools.ietf.org/html/draft-roome-alto-incr-updates-01</a>=
 updates a set of nodes. For example, an update example<br>
&gt; {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;meta&quot;: {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;vtag&quot;:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;t=
ag&quot;: &quot;NEW-CM-TAG&quot;},<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 },<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;cost-map&quot;: {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;PID1&quot;: {&qu=
ot;PID2&quot;: 10, &quot;PID99&quot;: null}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 =C2=A0 }<br>
&gt; updates 3 nodes.<br>
&gt;<br>
&gt; If one thinks about, one will realize that this is a general, interest=
ing design: consider the data tree of the original object; the update objec=
t is a partial tree of the original, and updates a batch containing all mat=
ched nodes in the partial tree. We call this operator the tree-replace oper=
ator. How may one do this as an extension of RFC6902:<br>
&gt;<br>
&gt; {<br>
&gt;=C2=A0 &quot;op&quot; : &quot;tree-replace&quot;,<br>
&gt;=C2=A0 &quot;path&quot; : &quot;/&quot;,=C2=A0 =C2=A0 // prefix of upda=
te object<br>
&gt;=C2=A0 &quot;value&quot; :=C2=A0 =C2=A0 =C2=A0 =C2=A0// just a copy of =
the partial object in value<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0{ &quot;meta&quot;: {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;vtag&quot;:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;t=
ag&quot;: &quot;NEW-CM-TAG&quot;},<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 },<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;cost-map&quot;: {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;PID1&quot;: {&qu=
ot;PID2&quot;: 10, &quot;PID99&quot;: null}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt; }<br>
&gt;<br>
&gt; Hence, we have a simple operator that appears to be able to fix the co=
st-map efficiency issue and is still general, not ALTO only.<br>
&gt;<br>
&gt; Next step:<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D<br>
&gt; - One possibility is to start to work on an extension of RFC 6902 to i=
ntroduce this operator, if there is no bug. After this is done, we specify =
ALTO incremental updates using the new op. An issue is that this is a seque=
ntial process and may take time.<br>
&gt;<br>
&gt; - Another possibility is that we specify JSON Patch as incremental upd=
ate encoding for now, losing efficiency. In parallel, we push for the new o=
p, and when it is done, ALTO incremental updates implementation can use the=
 new op.<br>
&gt;<br>
&gt; - A third possibility is that we define the extension operator in ALTO=
 incremental updates document itself, and proceed quickly.<br>
&gt;<br>
&gt; Any bug in the design? Any comments or suggestions?<br>
&gt;<br>
&gt; Thanks!<br>
&gt;<br>
&gt; Richard, Wendy<br>
<br>
</div></div>--<br>
Mark Nottingham=C2=A0 =C2=A0<a href=3D"https://www.mnot.net/" target=3D"_bl=
ank">https://www.mnot.net</a>/<br></blockquote></div>
</div></div></div></div>
<br></div></div>_______________________________________________<br>
alto mailing list<br>
<a href=3D"mailto:alto@ietf.org" target=3D"_blank">alto@ietf.org</a><br>
<a href=3D"https://www.ietf.org/mailman/listinfo/alto" target=3D"_blank">ht=
tps://www.ietf.org/mailman/listinfo/alto</a><br></blockquote></div></div></=
blockquote></div>
</div></div>

--001a1140f504aa5a1205057ad254--


From nobody Wed Oct 15 13:09:56 2014
Return-Path: <w.roome@alcatel-lucent.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D12421AC435 for <alto@ietfa.amsl.com>; Wed, 15 Oct 2014 13:09:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.91
X-Spam-Level: 
X-Spam-Status: No, score=-1.91 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
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 A6FD8MyyW-po for <alto@ietfa.amsl.com>; Wed, 15 Oct 2014 13:09:46 -0700 (PDT)
Received: from smtp-us.alcatel-lucent.com (us-hpswa-esg-01.alcatel-lucent.com [135.245.18.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4E8601A88CD for <alto@ietf.org>; Wed, 15 Oct 2014 13:09:36 -0700 (PDT)
Received: from us70tusmtp1.zam.alcatel-lucent.com (unknown [135.5.2.63]) by Websense Email Security Gateway with ESMTPS id 6AA5CD8773314 for <alto@ietf.org>; Wed, 15 Oct 2014 20:09:32 +0000 (GMT)
Received: from usnavsmail1.ndc.alcatel-lucent.com (usnavsmail1.ndc.alcatel-lucent.com [135.3.39.9]) by us70tusmtp1.zam.alcatel-lucent.com (GMO) with ESMTP id s9FK9Z4i029496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for <alto@ietf.org>; Wed, 15 Oct 2014 16:09:35 -0400
Received: from umail.lucent.com (umail.ndc.lucent.com [135.3.40.61]) by usnavsmail1.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id s9FK9YsL013620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for <alto@ietf.org>; Wed, 15 Oct 2014 15:09:34 -0500
Received: from [135.222.152.71] (wdr-i7mbp2.mh.lucent.com [135.222.152.71]) by umail.lucent.com (8.13.8/TPES) with ESMTP id s9FK9W9S025799 for <alto@ietf.org>; Wed, 15 Oct 2014 15:09:33 -0500 (CDT)
User-Agent: Microsoft-MacOutlook/14.4.4.140807
Date: Wed, 15 Oct 2014 16:09:33 -0400
From: Wendy Roome <w.roome@alcatel-lucent.com>
To: <alto@ietf.org>
Message-ID: <D0644784.180EE4%w.roome@alcatel-lucent.com>
Thread-Topic: [alto] Incremental updates transport using SSE?
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/Lh5pRQChEYCzEoZvmp4VT578KPY
Subject: Re: [alto] Incremental updates transport using SSE?
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 15 Oct 2014 20:09:49 -0000

I like SSE as well. But I suggest using the event field for the data type.
That means we have two events: application/alto-costmap+json and
application/merge-patch+json.

For an application/alto-costmap+json event, the data is JSON for a Cost
Map response message, as defined in RFC 7285. To handle this event, the
client throws out any previous cost map data and starts over from scratch.

For an application/merge-patch+json event, the data is a JSON merge-patch
update to the previous cost map data. The client applies that patch.

When a client initiates the stream, the server MUST send an
application/alto-costmap+json event as the fist message. Subsequent
messages are application/merge-patch+json events. The server can also send
another application/alto-costmap+json event, if the changes are so
dramatic that that is easier. E.g., suppose the network map changed and
renamed the PIDs.

Note that this method does NOT need version tags for cost map versions.

So a stream would look something like:

event: application/alto-costmap+json
data: {"meta": {...}, "cost-map": {"PID1": {...}}

event: application/merge-patch+json
data: { json merge-patch }

	- Wendy Roome



On 10/15/2014, 00:32, "alto-request@ietf.org" <alto-request@ietf.org>
wrote:

>Date: Wed, 15 Oct 2014 00:32:56 -0400
>From: "Y. Richard Yang" <yry@cs.yale.edu>
>To: IETF ALTO <alto@ietf.org>
>Subject: [alto] Incremental updates transport using SSE?
>Message-ID:
>	<CANUuoLoY5tXsWg4mknQ0WsR43ZWVfDe=qb7Xv1U0Qa1zb42xoA@mail.gmail.com>
>Content-Type: text/plain; charset="utf-8"
>
>Dear all,
>
>Given the potential progress in incremental update messaging format (e.g.,
>merge-patch or tree-replace), it is time to consider the next item:
>transport. In particular, we want decoupling of update message format from
>transport: the payload can be carried by not only HTTP Patch, but other
>methods, say client pull using HTTP POST, or SSE.
>
>In particular, consider a design where an ALTO server pushes incremental
>updates to an ALTO client using SSE. How about the following straw-man
>mapping design, for client subscription and server push content
>indication:
>
>event name: ALTO resource-id
>
>id:
>  if initial resource (full content), tag as full alto resource
>  if new-tag_old-tag
>
>data: {
>data: "Content-Type": "application/merge-patch+json" | rfc6902 patch
>data: "Content":
>data: {
>data: <op object here, need escape to avoid ambiguity, i.e., no extra
>\ndata:>
>data: }
>data: }\n\n
>
>Make sense, by SSE experts?
>
>Richard
>



From nobody Wed Oct 15 14:27:34 2014
Return-Path: <yang.r.yang@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2D1761ACDAF for <alto@ietfa.amsl.com>; Wed, 15 Oct 2014 14:27:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.277
X-Spam-Level: 
X-Spam-Status: No, score=-1.277 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 RCqiNTN-LNic for <alto@ietfa.amsl.com>; Wed, 15 Oct 2014 14:27:31 -0700 (PDT)
Received: from mail-ie0-x22b.google.com (mail-ie0-x22b.google.com [IPv6:2607:f8b0:4001:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4118A1ACDAE for <alto@ietf.org>; Wed, 15 Oct 2014 14:27:31 -0700 (PDT)
Received: by mail-ie0-f171.google.com with SMTP id tr6so2159110ieb.16 for <alto@ietf.org>; Wed, 15 Oct 2014 14:27:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=qGyom/JLDRB48WXc43jxkkEtIyA1kS+QlOI6Au4sucA=; b=RSssVVfrdDMKgCJGfWi2d4rZ5yVd5GgBwu6Mqh3fE+K9CdwxElgrf+uH1GP3ZVCrgs k9rbFSxuB8l6qHfyjBKKR5Bzx0WJfg9+f4M2mve3wYcNO5udjpWLHCz76fMBoZExeqp6 PoaFN/6y0RQQnY9jN5krbe5pjz3llL9+l7wAQIgBljUTlP32MeVZe2XMe3G6ic/cLAw9 8+s8c33NlSY2EqJNWzBVZdyxzdxFSiw2oIgaXxDbStG5E46ry4enLOXOT/eneVlb6Kbb S6ZuJKo71FVWeGVwNUEufXXwZldPUm0obm7ylzyyBRxfQAiLEppvG9n4HlUYuYek2lUt 8yxg==
MIME-Version: 1.0
X-Received: by 10.107.152.149 with SMTP id a143mr12887636ioe.39.1413408450554;  Wed, 15 Oct 2014 14:27:30 -0700 (PDT)
Sender: yang.r.yang@gmail.com
Received: by 10.107.131.224 with HTTP; Wed, 15 Oct 2014 14:27:30 -0700 (PDT)
In-Reply-To: <D0644784.180EE4%w.roome@alcatel-lucent.com>
References: <D0644784.180EE4%w.roome@alcatel-lucent.com>
Date: Wed, 15 Oct 2014 17:27:30 -0400
X-Google-Sender-Auth: 2y9doO7uqypeR2_uVj5XR7mX1VI
Message-ID: <CANUuoLoDnPx-V37==AXbMzuRPiYLXRz3CkMVpfSRfEMehg8S_g@mail.gmail.com>
From: "Y. Richard Yang" <yry@cs.yale.edu>
To: Wendy Roome <w.roome@alcatel-lucent.com>
Content-Type: multipart/alternative; boundary=001a1140f5049e32ab05057ccc33
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/onC7eDJwZ1tu1SoFDshnFTTkUvI
Cc: IETF ALTO <alto@ietf.org>
Subject: Re: [alto] Incremental updates transport using SSE?
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 15 Oct 2014 21:27:33 -0000

--001a1140f5049e32ab05057ccc33
Content-Type: text/plain; charset=UTF-8

Hi Wendy,

On Wed, Oct 15, 2014 at 4:09 PM, Wendy Roome <w.roome@alcatel-lucent.com>
wrote:

> I like SSE as well. But I suggest using the event field for the data type.
> That means we have two events: application/alto-costmap+json and
> application/merge-patch+json.
>
>
Interesting alternative design. Always preferring a solution that is
general, I would prefer an SSE design that handles general cases; for
example, ALTO server may output more media types such as alto-directory+json,
alto-networkmap+json, alto-costmap+json, alto-endpointprop+json, and
alto-endpointcost+json.
The design should handle all such cases and potential new media types.

Make sense?

Richard

For an application/alto-costmap+json event, the data is JSON for a Cost
> Map response message, as defined in RFC 7285. To handle this event, the
> client throws out any previous cost map data and starts over from scratch.
>
> For an application/merge-patch+json event, the data is a JSON merge-patch
> update to the previous cost map data. The client applies that patch.
>
> When a client initiates the stream, the server MUST send an
> application/alto-costmap+json event as the fist message. Subsequent
> messages are application/merge-patch+json events. The server can also send
> another application/alto-costmap+json event, if the changes are so
> dramatic that that is easier. E.g., suppose the network map changed and
> renamed the PIDs.
>
> Note that this method does NOT need version tags for cost map versions.
>
> So a stream would look something like:
>
> event: application/alto-costmap+json
> data: {"meta": {...}, "cost-map": {"PID1": {...}}
>
> event: application/merge-patch+json
> data: { json merge-patch }
>
>         - Wendy Roome
>
>
>
> On 10/15/2014, 00:32, "alto-request@ietf.org" <alto-request@ietf.org>
> wrote:
>
> >Date: Wed, 15 Oct 2014 00:32:56 -0400
> >From: "Y. Richard Yang" <yry@cs.yale.edu>
> >To: IETF ALTO <alto@ietf.org>
> >Subject: [alto] Incremental updates transport using SSE?
> >Message-ID:
> >       <CANUuoLoY5tXsWg4mknQ0WsR43ZWVfDe=
> qb7Xv1U0Qa1zb42xoA@mail.gmail.com>
> >Content-Type: text/plain; charset="utf-8"
> >
> >Dear all,
> >
> >Given the potential progress in incremental update messaging format (e.g.,
> >merge-patch or tree-replace), it is time to consider the next item:
> >transport. In particular, we want decoupling of update message format from
> >transport: the payload can be carried by not only HTTP Patch, but other
> >methods, say client pull using HTTP POST, or SSE.
> >
> >In particular, consider a design where an ALTO server pushes incremental
> >updates to an ALTO client using SSE. How about the following straw-man
> >mapping design, for client subscription and server push content
> >indication:
> >
> >event name: ALTO resource-id
> >
> >id:
> >  if initial resource (full content), tag as full alto resource
> >  if new-tag_old-tag
> >
> >data: {
> >data: "Content-Type": "application/merge-patch+json" | rfc6902 patch
> >data: "Content":
> >data: {
> >data: <op object here, need escape to avoid ambiguity, i.e., no extra
> >\ndata:>
> >data: }
> >data: }\n\n
> >
> >Make sense, by SSE experts?
> >
> >Richard
> >
>
>
> _______________________________________________
> alto mailing list
> alto@ietf.org
> https://www.ietf.org/mailman/listinfo/alto

--001a1140f5049e32ab05057ccc33
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Wendy,<div class=3D"gmail_extra"><br><div class=3D"gmai=
l_quote">On Wed, Oct 15, 2014 at 4:09 PM, Wendy Roome <span dir=3D"ltr">&lt=
;<a href=3D"mailto:w.roome@alcatel-lucent.com" target=3D"_blank">w.roome@al=
catel-lucent.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote"=
 style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:=
rgb(204,204,204);border-left-style:solid;padding-left:1ex">I like SSE as we=
ll. But I suggest using the event field for the data type.<br>
That means we have two events: application/alto-costmap+json and<br>
application/merge-patch+json.<br>
<br></blockquote><div>=C2=A0</div><div>Interesting alternative design. Alwa=
ys preferring a solution that is general, I would prefer an SSE design that=
 handles general cases; for example, ALTO server may output more media type=
s such as=C2=A0<span style=3D"color:rgb(0,0,0);white-space:pre-wrap">alto-d=
irectory+json, </span><span style=3D"color:rgb(0,0,0);white-space:pre-wrap"=
>alto-networkmap+json, </span><span style=3D"color:rgb(0,0,0);white-space:p=
re-wrap">alto-costmap+json, </span><span style=3D"color:rgb(0,0,0);white-sp=
ace:pre-wrap">alto-endpointprop+json, and </span><span style=3D"color:rgb(0=
,0,0);white-space:pre-wrap">alto-endpointcost+json. The design should handl=
e all such cases and potential new media types.</span></div><div><br></div>=
<div>Make sense?</div><div><br></div><div>Richard</div><div><br></div><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-=
width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;paddin=
g-left:1ex">
For an application/alto-costmap+json event, the data is JSON for a Cost<br>
Map response message, as defined in RFC 7285. To handle this event, the<br>
client throws out any previous cost map data and starts over from scratch.<=
br>
<br>
For an application/merge-patch+json event, the data is a JSON merge-patch<b=
r>
update to the previous cost map data. The client applies that patch.<br>
<br>
When a client initiates the stream, the server MUST send an<br>
application/alto-costmap+json event as the fist message. Subsequent<br>
messages are application/merge-patch+json events. The server can also send<=
br>
another application/alto-costmap+json event, if the changes are so<br>
dramatic that that is easier. E.g., suppose the network map changed and<br>
renamed the PIDs.<br>
<br>
Note that this method does NOT need version tags for cost map versions.<br>
<br>
So a stream would look something like:<br>
<br>
event: application/alto-costmap+json<br>
data: {&quot;meta&quot;: {...}, &quot;cost-map&quot;: {&quot;PID1&quot;: {.=
..}}<br>
<br>
event: application/merge-patch+json<br>
data: { json merge-patch }<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 - Wendy Roome<br>
<br>
<br>
<br>
On 10/15/2014, 00:32, &quot;<a href=3D"mailto:alto-request@ietf.org">alto-r=
equest@ietf.org</a>&quot; &lt;<a href=3D"mailto:alto-request@ietf.org">alto=
-request@ietf.org</a>&gt;<br>
wrote:<br>
<br>
&gt;Date: Wed, 15 Oct 2014 00:32:56 -0400<br>
&gt;From: &quot;Y. Richard Yang&quot; &lt;<a href=3D"mailto:yry@cs.yale.edu=
">yry@cs.yale.edu</a>&gt;<br>
&gt;To: IETF ALTO &lt;<a href=3D"mailto:alto@ietf.org">alto@ietf.org</a>&gt=
;<br>
&gt;Subject: [alto] Incremental updates transport using SSE?<br>
&gt;Message-ID:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;CANUuoLoY5tXsWg4mknQ0WsR43ZWVfDe=3D<a hr=
ef=3D"mailto:qb7Xv1U0Qa1zb42xoA@mail.gmail.com">qb7Xv1U0Qa1zb42xoA@mail.gma=
il.com</a>&gt;<br>
&gt;Content-Type: text/plain; charset=3D&quot;utf-8&quot;<br>
<div><div class=3D"h5">&gt;<br>
&gt;Dear all,<br>
&gt;<br>
&gt;Given the potential progress in incremental update messaging format (e.=
g.,<br>
&gt;merge-patch or tree-replace), it is time to consider the next item:<br>
&gt;transport. In particular, we want decoupling of update message format f=
rom<br>
&gt;transport: the payload can be carried by not only HTTP Patch, but other=
<br>
&gt;methods, say client pull using HTTP POST, or SSE.<br>
&gt;<br>
&gt;In particular, consider a design where an ALTO server pushes incrementa=
l<br>
&gt;updates to an ALTO client using SSE. How about the following straw-man<=
br>
&gt;mapping design, for client subscription and server push content<br>
&gt;indication:<br>
&gt;<br>
&gt;event name: ALTO resource-id<br>
&gt;<br>
&gt;id:<br>
&gt;=C2=A0 if initial resource (full content), tag as full alto resource<br=
>
&gt;=C2=A0 if new-tag_old-tag<br>
&gt;<br>
&gt;data: {<br>
&gt;data: &quot;Content-Type&quot;: &quot;application/merge-patch+json&quot=
; | rfc6902 patch<br>
&gt;data: &quot;Content&quot;:<br>
&gt;data: {<br>
&gt;data: &lt;op object here, need escape to avoid ambiguity, i.e., no extr=
a<br>
&gt;\ndata:&gt;<br>
&gt;data: }<br>
&gt;data: }\n\n<br>
&gt;<br>
&gt;Make sense, by SSE experts?<br>
&gt;<br>
&gt;Richard<br>
&gt;<br>
<br>
<br>
</div></div>_______________________________________________<br>
alto mailing list<br>
<a href=3D"mailto:alto@ietf.org">alto@ietf.org</a><br>
<a href=3D"https://www.ietf.org/mailman/listinfo/alto" target=3D"_blank">ht=
tps://www.ietf.org/mailman/listinfo/alto</a></blockquote></div>
</div></div>

--001a1140f5049e32ab05057ccc33--


From nobody Thu Oct 16 05:45:24 2014
Return-Path: <xinwang2014@hotmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 25CD91A1B00 for <alto@ietfa.amsl.com>; Thu, 16 Oct 2014 05:45:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.059
X-Spam-Level: 
X-Spam-Status: No, score=-1.059 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, J_CHICKENPOX_44=0.6, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 ZgnJinawu25n for <alto@ietfa.amsl.com>; Thu, 16 Oct 2014 05:45:16 -0700 (PDT)
Received: from SNT004-OMC2S39.hotmail.com (snt004-omc2s39.hotmail.com [65.54.61.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 868C81A1AE1 for <alto@ietf.org>; Thu, 16 Oct 2014 05:45:16 -0700 (PDT)
Received: from SNT150-W1 ([65.55.90.73]) by SNT004-OMC2S39.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751);  Thu, 16 Oct 2014 05:45:15 -0700
X-TMN: [38Pf1WvKCweubVSUIJiLy+zaW+0bUcs2]
X-Originating-Email: [xinwang2014@hotmail.com]
Message-ID: <SNT150-W16AE65847089609946185A8AB0@phx.gbl>
Content-Type: multipart/alternative; boundary="_9b3b5e94-6bd4-46df-91b7-3ecf5df6d62b_"
From: wangxin <xinwang2014@hotmail.com>
To: Xiao SHI <xiao.shi@yale.edu>, Richard Yang Y. <yry@cs.yale.edu>
Date: Thu, 16 Oct 2014 12:45:15 +0000
Importance: Normal
In-Reply-To: <CAFwJzZke7xiA-fP+xrC8zotgmYsUMB5K+ihyY3-4WG7Rxs1dSg@mail.gmail.com>
References: <CANUuoLqJJL3Quf1RHJ=0rXNgPC6A7cbC=URcCfHt0-JyrmHh9Q@mail.gmail.com>,  <D001A864-F0F7-4421-9123-699D4D7EACE6@mnot.net>, <CANUuoLpNBWTk-B+soLNurw3jL8i9U28Tm3PCvvmXZ=L-0deSzw@mail.gmail.com>, <CAFwJzZke7xiA-fP+xrC8zotgmYsUMB5K+ihyY3-4WG7Rxs1dSg@mail.gmail.com>
MIME-Version: 1.0
X-OriginalArrivalTime: 16 Oct 2014 12:45:15.0620 (UTC) FILETIME=[08C25A40:01CFE93F]
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/PXz5Wwp3F5EAKbVrxDcCdcXKWcE
Cc: Mark Nottingham <mnot@mnot.net>, IETF ALTO <alto@ietf.org>, Paul Bryan <pbryan@anode.ca>
Subject: Re: [alto] ALTO incremental updates and JSON Patch extension
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Oct 2014 12:45:20 -0000

--_9b3b5e94-6bd4-46df-91b7-3ecf5df6d62b_
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: base64

SGksIFhpYW8sDQpJdCBzZWVtcyB0aGF0IHlvdSB1c2Ugb2JqZWN0IHRvIHJlcHJlc2VudCBhIHNl
dCBpbnN0ZWFkIG9mIGFycmF5LCBhbmQgeW91IG1ha2UgbWVyZ2UtcGF0Y2ggYWxzbyBhdmFpbGFi
bGUgYnkgdXNpbmcgYW4gZW1wdHkgb2JqZWN0IChoZXJlLCBpIHdvbmRlciB0aGF0IGlzIG1lcmdl
LXBhdGNoIHN0aWxsIGF2YWlsYWJsZSBpZiB3ZSB3YW50IHRvIGFkZCBhbiBvYmplY3Qgd2l0aCBh
IG51bGwgdmFsdWU/KS4NCkkgYWxzbyB0aGluayB0aGF0IHVzaW5nIGFycmF5IHRvIHJlcHJlc2Vu
dCBhIHNldCBpcyB2ZXJ5IGhhcmQgc2luY2UgaXQgc2VlbXMgdGhhdCB0aGUgb25seSB3YXkgdG8g
YWNjZXNzIHRoZSBpdGVtIGlzIHVzaW5nIHRoZSBudW1iZXIgb2YgaXRlbSBpbiBhcnJheSAobWVy
Z2UtcGF0Y2ggY2FuIG9ubHkgcmVwbGFjZSB0aGUgd2hvbGUgYXJyYXkgaW5zdGVhZCBvZiBhZGRp
bmcgb3IgcmVtb3ZpbmcpLg0KQXMgZm9yICJtZXRhIiwgaSB0aGluayB1c2luZyAicmVzb3VyY2Ut
aWQiOiJ0YWciIGNhbiB3b3JrOg0KeyAgIm1ldGEiIDogeyAgICAiZGVwZW5kZW50LXZ0YWdzIiA6
IHsgICAgICAgIm15LWRlZmF1bHQtbmV0d29yay1tYXAiOiAiNzkxNWRjMDI5MGMyNzA1NDgxYzQ5
MWEyYjRmZmJlYzQ4MmIzY2Y2MiIsICAgICAgICJteS1hbHRlcm5hdGl2ZS1uZXR3b3JrLW1hcCI6
ICIzZWUyY2I3ZThkNjNkOWZhYjcxYjliMzRjYmY3NjQ0MzYzMTU1NDJlIiAgICB9ICB9fQ0Kb3Is
IGlmIHdlIG5lZWQgdG8gYWRkIG1vcmUgaW5mb3JtYXRpb24gaW4gInJlc291cmNlLWlkIiBmb3Ig
ZnV0dXJlIHdvcms6DQp7ICAibWV0YSIgOiB7ICAgICJkZXBlbmRlbnQtdnRhZ3MiIDogeyAgICAg
ICAibXktZGVmYXVsdC1uZXR3b3JrLW1hcCI6IHsgICAgICAgICAgICAgICAgICJ0YWciOiI3OTE1
ZGMwMjkwYzI3MDU0ODFjNDkxYTJiNGZmYmVjNDgyYjNjZjYyIiAgICAgICAgfSAgICAgICAibXkt
YWx0ZXJuYXRpdmUtbmV0d29yay1tYXAiOiB7ICAgICAgICAgICAgICAgICAidGFnIjoiM2VlMmNi
N2U4ZDYzZDlmYWI3MWI5YjM0Y2JmNzY0NDM2MzE1NTQyZSIgICAgICAgIH0gICAgfSAgfX0NClRo
YW5rcyxYaW4NCkZyb206IHhpYW8uc2hpQHlhbGUuZWR1DQpEYXRlOiBXZWQsIDE1IE9jdCAyMDE0
IDA3OjA0OjQ2IC0wNDAwDQpUbzogeXJ5QGNzLnlhbGUuZWR1DQpDQzogbW5vdEBtbm90Lm5ldDsg
YWx0b0BpZXRmLm9yZzsgcGJyeWFuQGFub2RlLmNhDQpTdWJqZWN0OiBSZTogW2FsdG9dIEFMVE8g
aW5jcmVtZW50YWwgdXBkYXRlcyBhbmQgSlNPTiBQYXRjaCBleHRlbnNpb24NCg0KSGkgZm9sa3Ms
DQpCYXNlZCBvbiBhIGN1cnNvcnkgcmVhZGluZyBvZiB0aGUgbWVyZ2UtcGF0Y2gsIG9uZSBwb3Nz
aWJsZSAoYnV0IGNsdW1zeSkgc29sdXRpb24gaXMgdG8gdXNlIHRoZSBhc3N1bXB0aW9uIHRoYXQg
SlNPTiBuYW1lcyBTSE9VTEQgYmUgdW5pcXVlIGluIGEgSlNPTiBvYmplY3QuIEhlbmNlIGlmIHlv
dSBoYXZlIGZvciBleGFtcGxlOj09PT17ICAicGlkMSIgOiB7InByZWZpeDEiIDoge30sICJwcmVm
aXgyIiA6IHt9LCAicHJlZml4MyIgOnt9fSAgInBpZDIiIDogeyJwcmVmaXgzIiA6IHt9LCAicHJl
Zml4NCIgOiB7fSwgInByZWZpeDUiIDoge319fT09PT1Ob3csIHRvIGRlbGV0ZSAicHJlZml4MiIg
ZnJvbSB0aGUgdmFsdWUgb2YgInBpZDEiLCBvbmUgY2FuIGRvOj09PT1vcCA6IHJlbW92ZXBhdGgg
OiAvcGlkMS9wcmVmaXgyPT09PQ0KQnVpbGRpbmcgb24gdG9wIG9mIHdoYXQgUmljaGFyZCBzYWlk
LCB0aGUgc2V0LWxpa2UgYXJyYXkgbWF5IGFsc28gYmUgYW4gaXNzdWUgaWYgaXQgaXMgaW4gdGhl
IG1pZGRsZSBvZiB0aGUgdGFyZ2V0ZWQgcGF0aC4gRm9yIGV4YW1wbGUsIGlmIEkgaGF2ZSB0aGUg
Zm9sbG93aW5nIG9iamVjdCAoU2VjLiAxMS40LjEuNiBvZiBSRkM3Mjg1IHdpdGggb25lIGFkZGVk
IGVsZW1lbnQgaW4gdGhlIGRlcGVuZGVudC12dGFncyBhcnJheSk6PT09PXsgICJtZXRhIiA6IHsg
ICAgImRlcGVuZGVudC12dGFncyIgOiBbICAgICAgeyAgICAgICAgInJlc291cmNlLWlkIjogIm15
LWRlZmF1bHQtbmV0d29yay1tYXAiLCAgICAgICAgInRhZyI6ICI3OTE1ZGMwMjkwYzI3MDU0ODFj
NDkxYTJiNGZmYmVjNDgyYjNjZjYyIiAgICAgIH0sICAgICAgeyAgICAgICAgInJlc291cmNlLWlk
IjogIm15LWFsdGVybmF0aXZlLW5ldHdvcmstbWFwIiwgICAgICAgICJ0YWciOiAiM2VlMmNiN2U4
ZDYzZDlmYWI3MWI5YjM0Y2JmNzY0NDM2MzE1NTQyZSIgICAgICB9ICAgIF0gIH19PT09PUxldCdz
IHNheSB3ZSB3YW50IHRvIG1vZGlmeSB0aGUgdGFnIG9mIHRoZSBkZWZhdWx0LW5ldHdvcmstbWFw
ICh3aGljaCBzZWVtcyByZWFzb25hYmxlKS4gQ29ycmVjdCBtZSBpZiBJJ20gd3JvbmcsIGJ1dCB3
aXRob3V0IGtub3dpbmcgdGhlIHNwZWNpZmljIGluZGV4IG9mIHRoZSBhcnJheSwgdGhpcyB0YXNr
IHdvdWxkIG5vdCBiZSBwb3NzaWJsZSB3aXRoIEpTT04gcGF0Y2ggb3IgbWVyZ2UgcGF0Y2ggKHNp
bmNlIG1lcmdlIHBhdGNoIGRvZXMgbm90IGl0ZXJhdGUgdGhyb3VnaCBhcnJheXMpLg0KQmVzdCxY
aWFvDQoNCk9uIFdlZCwgT2N0IDE1LCAyMDE0IGF0IDEyOjA3IEFNLCBZLiBSaWNoYXJkIFlhbmcg
PHlyeUBjcy55YWxlLmVkdT4gd3JvdGU6DQpEZWFyIE1hcmssDQpUaGFua3MgYSBsb3QgZm9yIHRo
ZSBxdWljayByZXNwb25zZSEgSSBkaWQgbm90IHJlbWVtYmVyIHJlYWRpbmcgbWVyZ2UtcGF0Y2gu
IEFmdGVyIGp1c3QgcmVhZGluZyBpdCwgSSBmb3VuZCB0aGF0IGl0IGlzIGRvaW5nIGV4YWN0bHkg
d2hhdCB3ZSB3YW50ZWQgdG8gZG8sIGFuZCB3ZSBjYWxsZWQgaXQgdHJlZS1yZXBsYWNlLCB0byBi
ZSBzaW1pbGFyIHRvIHRoZSByZXBsYWNlIG9wZXJhdG9yIGRlZmluZWQgaW4gUkZDNjkwMi4gV2Ug
d2lsbCBzZWUgaG93IHdlIG1heSB1c2UgaXQgaW4gb3VyIGRlc2lnbi4gDQpTaW5jZSB3ZSBhcmUg
YXQgSlNPTiBwYXRjaCBleHRlbnNpb25zLCBoZXJlIGlzIGFub3RoZXIgaXNzdWUgdGhhdCB3ZSB3
YW50IHRvIHJlc29sdmU6IHNldCBvcGVyYXRpb25zIG9uIGFuIGFycmF5LiBDb25zaWRlciBhIEpT
T04gb2JqZWN0IHsgICJwaWQxIiA6IFsicHJlZml4MSIsICJwcmVmaXgyIiwgInByZWZpeDMiXSAg
InBpZDIiIDogWyJwcmVmaXgzIiwgInByZWZpeDQiLCAicHJlZml4NSJdfQ0KVG8gZGVsZXRlICJw
cmVmaXgyIiBmcm9tIHRoZSB2YWx1ZSBvZiAicGlkMSIsIHdlIG5lZWQgdG8gd3JpdGUNCm9wIDog
cmVtb3ZlcGF0aCA6IC9waWQxLzENCkhvd2V2ZXIsIHRoZSByZWFsIGludGVudGlvbiBvZiB0aGUg
dmFsdWVzIG9mICJwaWQxIiBhbmQgInBpZDIiIGFyZSBzZXRzLCBidXQgSlNPTiBoYXMgbm8gY29u
Y2VwdCBvZiBhIHNldCAobm90IG11bHRpIHNldCksIGFzIGRpc2N1c3NlZCBiZWZvcmUuIFRoZSBz
ZXQgc2VtYW50aWNzIGd1YXJhbnRlZXMgbm8gZHVwbGljYXRlcywgYW5kIGhlbmNlIHdlIG1heSBl
bGltaW5hdGUgdGhlIGJ1cmRlbiBvbiBhbiBhcHBsaWNhdGlvbiB0byBrZWVwIHRyYWNrIG9mIHRo
ZSBhcnJheSBpbmRleCwgaWYgd2UgYXJlIGFsbG93ZWQgdG8gZXh0ZW5kIHRoZSBKU09OIFBvaW50
ZXIgKHJmYzY5MDEpLCBpbiBwYXJ0aWN1bGFyLCB3aGVuIHRoZSBjYXNlIG9mIHRoZSBjdXJyZW50
bHkgcmVmZXJlbmNlZCB2YWx1ZSBpcyBhIEpTT04gYXJyYXksIGJ5IGFsbG93aW5nIGZ1bmN0aW9u
cyBvciBvdGhlciBjaGFycywgZm9yIGV4YW1wbGUsIHRvIGRlbm90ZSBhIHNldCwgb3IgaW5kZXgg
bG9vayB1cC0tdGhlIGN1cnJlbnQgZGVmaW5pdGlvbiBhbGxvd3Mgb25seSBudW1lcmljYWwgaW5k
ZXggb3IgLSBhbmQgaGVuY2Ugb25lIGNhbiByZXNvbHZlIGFtYmlndWl0eS4uLg0KDQpNYWtlIHNl
bnNlPw0KUmljaGFyZA0KT24gVHVlLCBPY3QgMTQsIDIwMTQgYXQgMTE6MTMgUE0sIE1hcmsgTm90
dGluZ2hhbSA8bW5vdEBtbm90Lm5ldD4gd3JvdGU6DQpIaSBSaWNoYXJkLA0KCg0KClJGQzY5MDIg
ZG9lc24ndCBhbGxvdyBleHRlbnNpb24gb3BlcmF0b3JzOyB5b3UnZCBuZWVkIHRvIGRlZmluZSBh
IG5ldyBtZWRpYSB0eXBlIGFuZCBzcGVjaWZ5IGl0cyBiZWhhdmlvdXIuIE9mIGNvdXJzZSwgeW91
IGNvdWxkIGRvIHRoYXQgcHJldHR5IGVhc2lseSBieSBqdXN0IHNheWluZyAiaGVyZSdzIGEgbmV3
IG1lZGlhIHR5cGU7IGl0IGhhcyB0aGUgc2FtZSBzZW1hbnRpY3MgLyByZXF1aXJlbWVudHMgYXMg
SlNPTiBQYXRjaCwgcGx1cyB0aGlzLi4uIi4NCgoNCgpBbHNvLCBJIHRydXN0IHlvdSd2ZSBzZWVu
IHRoZSBuZXcgSlNPTiBtZXJnZS1wYXRjaCBSRkMgKEkgdGhpbmsgd2Ugc3Bva2UgYWJvdXQgaXQg
YmVmb3JlKT8NCgogIGh0dHBzOi8vdG9vbHMuaWV0Zi5vcmcvaHRtbC9yZmM3Mzg2DQoKDQoKQ2hl
ZXJzLA0KCg0KCg0KCk9uIDE1IE9jdCAyMDE0LCBhdCA0OjQ3IGFtLCBZLiBSaWNoYXJkIFlhbmcg
PHlyeUBjcy55YWxlLmVkdT4gd3JvdGU6DQoKDQoKPiBEZWFyIGFsbCwNCgo+DQoKPiBTb21lIG9m
IHVzIGFyZSBoYXZpbmcgYW4gZXh0ZW5zaXZlIGRpc2N1c3Npb24gb24gaG93IHRvIHByb2NlZWQg
cmVnYXJkaW5nIHRoZSBBTFRPIGluY3JlbWVudGFsIHVwZGF0ZXMgV0cgaXRlbS4gSGVyZSBpcyBh
IHN1bW1hcnkgb2Ygd2hhdCB3ZSBhcmUgdGhpbmtpbmcuIEF0IGEgaGlnaCBsZXZlbCwgd2UgcGxh
biB0byBwcm9wb3NlIGFuIGFwcHJvYWNoIG9mIHVzaW5nIEpTT04gUGF0Y2ggKFJGQzY5MDIpLCBi
dXQgd2l0aCBzb21lIGV4dGVuc2lvbnMuIFdlIHdhbnQgdG8gZ2V0IHlvdXIgY29tbWVudHMgYW5k
IGFkdmljZSBvbiBpZiB5b3Ugc2VlIGFueSBwcm9ibGVtcywgYW5kIGhvdyBiZXN0IHRvIHByb2Nl
ZWQuDQoKPg0KCj4gQ3VycmVudCBzdGF0ZToNCgo+ID09PT09PT09PT0NCgo+IEJvdGggSlNPTiBQ
YXRjaCAoUkZDNjkwMikgYW5kICBodHRwOi8vdG9vbHMuaWV0Zi5vcmcvaHRtbC9kcmFmdC1yb29t
ZS1hbHRvLWluY3ItdXBkYXRlcy0wMSBhcmUgY29uc2lkZXJlZCBhcyBjYW5kaWRhdGVzIG9mIHRo
ZSBlbmNvZGluZyB1cGRhdGUgbWVzc2FnZSBmb3JtYXQuDQoKPg0KCj4gRGVzaWduIGdvYWwgYW5k
IHByb2JsZW06DQoKPiA9PT09PT09PT09PT09PT09PT09PQ0KCj4gR2VuZXJhbGl0eSBhbmQgZWZm
aWNpZW5jeS4gVGhhdCBpcywgd2Ugd2FudCBhbiBpbmNyZW1lbnRhbCB1cGRhdGUgZm9ybWF0IHRo
YXQgY2FuIGhhbmRsZSBub3Qgb25seSBjdXJyZW50IHJlc291cmNlcyBidXQgYWxzbyBmdXR1cmUg
cmVzb3VyY2VzLiBUaGUgcmVjZW50IHRyZW5kIGluIGFkb3B0aW5nIFlBTkcgc2hvd3MgdGhhdCBn
ZW5lcmFsIG1lY2hhbmlzbXMsIG5vdCBwZXIgcHJvdG9jb2wgcGF0Y2gsIGhhdmUgdmFsdWUuIEdl
bmVyaWMgZW5jb2Rpbmcgb2YgSlNPTiBQYXRjaCBiYXNlZCBvbiBYUEFUSCBhbmQgYSBmZXcgb3Bl
cmF0b3JzIGlzIGNvbXBsZXRlIGluIHRoaXMgc2Vuc2UsIGJ1dCBpbmVmZmljaWVudCBpbiBrZXkg
QUxUTyBjYXNlcyBzdWNoIGFzIHVwZGF0aW5nIGNvc3QgbWFwcywgYXMgcG9pbnRlZCBvdXQgaW4g
aHR0cDovL3Rvb2xzLmlldGYub3JnL2h0bWwvZHJhZnQtcm9vbWUtYWx0by1pbmNyLXVwZGF0ZXMt
MDENCgo+DQoKPiBLZXkgaWRlYToNCgo+ID09PT09PT0NCgo+IEEgSlNPTiBvYmplY3QgY2FuIGJl
IGNvbnNpZGVyZWQgYXMgYW4ga2V5LXZhbHVlIHRyZWUsIHdpdGggZWFjaCBub2RlIGJlaW5nIGFu
IG9iamVjdCBhbmQgZWFjaCBlZGdlIGxhYmVsZWQgYnkgdGhlIGtleSwgYW5kIHRoZSB2YWx1ZSBv
ZiB0aGUgZWRnZSBwb2ludGluZyB0byBhbm90aGVyIG9iamVjdC4gRm9yIGV4YW1wbGUsIHRoZSBB
TFRPIGNvc3QgbWFwIGV4YW1wbGU6DQoKPiB7DQoKPiAgICAgICAgICAgICAibWV0YSIgOiB7DQoK
Pg0KCj4gICAgICAgICAgICAgICAiZGVwZW5kZW50LXZ0YWdzIiA6IFsNCgo+ICAgICAgICAgICAg
ICAgICB7InJlc291cmNlLWlkIjogIm15LWRlZmF1bHQtbmV0d29yay1tYXAiLA0KCj4gICAgICAg
ICAgICAgICAgICAidGFnIjogIjNlZTJjYjdlOGQ2M2Q5ZmFiNzFiOWIzNGNiZjc2NDQzNjMxNTU0
MmUiDQoKPiAgICAgICAgICAgICAgICAgfQ0KCj4gICAgICAgICAgICAgICBdLA0KCj4NCgo+ICAg
ICAgICAgICAgICAgInZ0YWciOg0KCj4gICAgICAgICAgICAgICAgICB7InJlc291cmNlLWlkIjog
IkNPU1QtTUFQLUlEIiwgInRhZyI6ICJDTS1UQUcifSwNCgo+DQoKPiAgICAgICAgICAgICAgICJj
b3N0LXR5cGUiIDogeyJjb3N0LW1vZGUiICA6ICJudW1lcmljYWwiLA0KCj4gICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAiY29zdC1tZXRyaWMiOiAicm91dGluZ2Nvc3QiDQoKPiAgICAgICAg
ICAgICAgIH0NCgo+ICAgICAgICAgICAgIH0sDQoKPiAgICAgICAgICAgICAiY29zdC1tYXAiIDog
ew0KCj4gICAgICAgICAgICAgICAiUElEMSI6IHsgIlBJRDEiOiAxLCAgIlBJRDIiOiA1LCAgIlBJ
RDMiOiAxMCB9LA0KCj4gICAgICAgICAgICAgICAiUElEMiI6IHsgIlBJRDEiOiA1LCAgIlBJRDIi
OiAxLCAgIlBJRDMiOiAxNSB9LA0KCj4gICAgICAgICAgICAgICAiUElEMyI6IHsgIlBJRDEiOiAy
MCwgIlBJRDIiOiAxNSAgfQ0KCj4gICAgICAgICAgICAgfQ0KCj4NCgo+IGRlZmluZXMgYSBkYXRh
IHRyZWUgd2l0aCAxNCBsZWFmIG5vZGVzOg0KCj4NCgo+ICJtZXRhL2RlcGVuZGVudC12dGFncy9y
ZXNvdXJjZS1pZCI6ICJteS1kZWZhdWx0LW5ldHdvcmstbWFwIiwNCgo+ICJtZXRhL2RlcGVuZGVu
dC12dGFncy90YWciOiAiM2VlMmNiN2U4ZDYzZDlmYWI3MWI5YjM0Y2JmNzY0NDM2MzE1NTQyZSIs
DQoKPiAuLi4NCgo+ICJjb3N0LW1hcC9QSUQzL1BJRDEiOiAyMCwNCgo+ICJjb3N0LW1hcC9QSUQz
L1BJRDIiOiAxNQ0KCj4NCgo+IFJGQzY5MDIgZm9jdXNlcyBvbiBlbmNvZGluZyB1cGRhdGluZyBv
bmUgbm9kZSBvbiB0aGUgdHJlZSBhdCBhIHRpbWUuIE9uIHRoZSBvdGhlciBoYW5kLCBvbmUgY2Fu
IHJlYWxpemUgdGhhdCB0aGUgY29zdC1tYXAgdXBkYXRlIGVuY29kaW5nIG9mIGh0dHA6Ly90b29s
cy5pZXRmLm9yZy9odG1sL2RyYWZ0LXJvb21lLWFsdG8taW5jci11cGRhdGVzLTAxIHVwZGF0ZXMg
YSBzZXQgb2Ygbm9kZXMuIEZvciBleGFtcGxlLCBhbiB1cGRhdGUgZXhhbXBsZQ0KCj4gew0KCj4g
ICAgICAgICAibWV0YSI6IHsNCgo+ICAgICAgICAgICAgICAidnRhZyI6DQoKPiAgICAgICAgICAg
ICAgICAgIHsidGFnIjogIk5FVy1DTS1UQUcifSwNCgo+ICAgICAgICAgICAgICB9LA0KCj4gICAg
ICAgICAiY29zdC1tYXAiOiB7DQoKPiAgICAgICAgICAgICAgIlBJRDEiOiB7IlBJRDIiOiAxMCwg
IlBJRDk5IjogbnVsbH0NCgo+ICAgICAgICAgICAgICB9DQoKPiAgICB9DQoKPiB1cGRhdGVzIDMg
bm9kZXMuDQoKPg0KCj4gSWYgb25lIHRoaW5rcyBhYm91dCwgb25lIHdpbGwgcmVhbGl6ZSB0aGF0
IHRoaXMgaXMgYSBnZW5lcmFsLCBpbnRlcmVzdGluZyBkZXNpZ246IGNvbnNpZGVyIHRoZSBkYXRh
IHRyZWUgb2YgdGhlIG9yaWdpbmFsIG9iamVjdDsgdGhlIHVwZGF0ZSBvYmplY3QgaXMgYSBwYXJ0
aWFsIHRyZWUgb2YgdGhlIG9yaWdpbmFsLCBhbmQgdXBkYXRlcyBhIGJhdGNoIGNvbnRhaW5pbmcg
YWxsIG1hdGNoZWQgbm9kZXMgaW4gdGhlIHBhcnRpYWwgdHJlZS4gV2UgY2FsbCB0aGlzIG9wZXJh
dG9yIHRoZSB0cmVlLXJlcGxhY2Ugb3BlcmF0b3IuIEhvdyBtYXkgb25lIGRvIHRoaXMgYXMgYW4g
ZXh0ZW5zaW9uIG9mIFJGQzY5MDI6DQoKPg0KCj4gew0KCj4gICJvcCIgOiAidHJlZS1yZXBsYWNl
IiwNCgo+ICAicGF0aCIgOiAiLyIsICAgIC8vIHByZWZpeCBvZiB1cGRhdGUgb2JqZWN0DQoKPiAg
InZhbHVlIiA6ICAgICAgIC8vIGp1c3QgYSBjb3B5IG9mIHRoZSBwYXJ0aWFsIG9iamVjdCBpbiB2
YWx1ZQ0KCj4gICAgICAgeyAibWV0YSI6IHsNCgo+ICAgICAgICAgICAgICAidnRhZyI6DQoKPiAg
ICAgICAgICAgICAgICAgIHsidGFnIjogIk5FVy1DTS1UQUcifSwNCgo+ICAgICAgICAgIH0sDQoK
PiAgICAgICAgICJjb3N0LW1hcCI6IHsNCgo+ICAgICAgICAgICAgICAiUElEMSI6IHsiUElEMiI6
IDEwLCAiUElEOTkiOiBudWxsfQ0KCj4gICAgICAgICAgIH0NCgo+ICAgICAgIH0NCgo+IH0NCgo+
DQoKPiBIZW5jZSwgd2UgaGF2ZSBhIHNpbXBsZSBvcGVyYXRvciB0aGF0IGFwcGVhcnMgdG8gYmUg
YWJsZSB0byBmaXggdGhlIGNvc3QtbWFwIGVmZmljaWVuY3kgaXNzdWUgYW5kIGlzIHN0aWxsIGdl
bmVyYWwsIG5vdCBBTFRPIG9ubHkuDQoKPg0KCj4gTmV4dCBzdGVwOg0KCj4gPT09PT09PT0NCgo+
IC0gT25lIHBvc3NpYmlsaXR5IGlzIHRvIHN0YXJ0IHRvIHdvcmsgb24gYW4gZXh0ZW5zaW9uIG9m
IFJGQyA2OTAyIHRvIGludHJvZHVjZSB0aGlzIG9wZXJhdG9yLCBpZiB0aGVyZSBpcyBubyBidWcu
IEFmdGVyIHRoaXMgaXMgZG9uZSwgd2Ugc3BlY2lmeSBBTFRPIGluY3JlbWVudGFsIHVwZGF0ZXMg
dXNpbmcgdGhlIG5ldyBvcC4gQW4gaXNzdWUgaXMgdGhhdCB0aGlzIGlzIGEgc2VxdWVudGlhbCBw
cm9jZXNzIGFuZCBtYXkgdGFrZSB0aW1lLg0KCj4NCgo+IC0gQW5vdGhlciBwb3NzaWJpbGl0eSBp
cyB0aGF0IHdlIHNwZWNpZnkgSlNPTiBQYXRjaCBhcyBpbmNyZW1lbnRhbCB1cGRhdGUgZW5jb2Rp
bmcgZm9yIG5vdywgbG9zaW5nIGVmZmljaWVuY3kuIEluIHBhcmFsbGVsLCB3ZSBwdXNoIGZvciB0
aGUgbmV3IG9wLCBhbmQgd2hlbiBpdCBpcyBkb25lLCBBTFRPIGluY3JlbWVudGFsIHVwZGF0ZXMg
aW1wbGVtZW50YXRpb24gY2FuIHVzZSB0aGUgbmV3IG9wLg0KCj4NCgo+IC0gQSB0aGlyZCBwb3Nz
aWJpbGl0eSBpcyB0aGF0IHdlIGRlZmluZSB0aGUgZXh0ZW5zaW9uIG9wZXJhdG9yIGluIEFMVE8g
aW5jcmVtZW50YWwgdXBkYXRlcyBkb2N1bWVudCBpdHNlbGYsIGFuZCBwcm9jZWVkIHF1aWNrbHku
DQoKPg0KCj4gQW55IGJ1ZyBpbiB0aGUgZGVzaWduPyBBbnkgY29tbWVudHMgb3Igc3VnZ2VzdGlv
bnM/DQoKPg0KCj4gVGhhbmtzIQ0KCj4NCgo+IFJpY2hhcmQsIFdlbmR5DQoKDQoKLS0NCgpNYXJr
IE5vdHRpbmdoYW0gICBodHRwczovL3d3dy5tbm90Lm5ldC8NCgoKDQpfX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXw0KCmFsdG8gbWFpbGluZyBsaXN0DQoKYWx0
b0BpZXRmLm9yZw0KCmh0dHBzOi8vd3d3LmlldGYub3JnL21haWxtYW4vbGlzdGluZm8vYWx0bw0K
Cg0KDQoKDQpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwph
bHRvIG1haWxpbmcgbGlzdAphbHRvQGlldGYub3JnCmh0dHBzOi8vd3d3LmlldGYub3JnL21haWxt
YW4vbGlzdGluZm8vYWx0byAJCSAJICAgCQkgIA==

--_9b3b5e94-6bd4-46df-91b7-3ecf5df6d62b_
Content-Type: text/html; charset="gb2312"
Content-Transfer-Encoding: base64

PGh0bWw+DQo8aGVhZD4NCjxzdHlsZT48IS0tDQouaG1tZXNzYWdlIFANCnsNCm1hcmdpbjowcHg7
DQpwYWRkaW5nOjBweA0KfQ0KYm9keS5obW1lc3NhZ2UNCnsNCmZvbnQtc2l6ZTogMTJwdDsNCmZv
bnQtZmFtaWx5Os6iyO3RxbraDQp9DQotLT48L3N0eWxlPjwvaGVhZD4NCjxib2R5IGNsYXNzPSdo
bW1lc3NhZ2UnPjxkaXYgZGlyPSdsdHInPkhpLCBYaWFvLDxkaXY+PGJyPjwvZGl2PjxkaXY+SXQg
c2VlbXMgdGhhdCB5b3UgdXNlIG9iamVjdCB0byByZXByZXNlbnQgYSBzZXQgaW5zdGVhZCBvZiBh
cnJheSwgYW5kIHlvdSBtYWtlIG1lcmdlLXBhdGNoIGFsc28gYXZhaWxhYmxlIGJ5IHVzaW5nIGFu
IGVtcHR5IG9iamVjdCAoaGVyZSwgaSB3b25kZXIgdGhhdCBpcyBtZXJnZS1wYXRjaCBzdGlsbCBh
dmFpbGFibGUgaWYgd2Ugd2FudCB0byBhZGQgYW4gb2JqZWN0IHdpdGggYSBudWxsIHZhbHVlPyku
PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5JIGFsc28gdGhpbmsgdGhhdCB1c2luZyBhcnJheSB0
byByZXByZXNlbnQgYSBzZXQgaXMgdmVyeSBoYXJkIHNpbmNlIGl0IHNlZW1zIHRoYXQgdGhlIG9u
bHkgd2F5IHRvIGFjY2VzcyB0aGUgaXRlbSBpcyB1c2luZyB0aGUgbnVtYmVyIG9mIGl0ZW0gaW4g
YXJyYXkgKG1lcmdlLXBhdGNoIGNhbiBvbmx5IHJlcGxhY2UgdGhlIHdob2xlIGFycmF5IGluc3Rl
YWQgb2YgYWRkaW5nIG9yIHJlbW92aW5nKS48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PkFzIGZv
ciAibWV0YSIsIGkgdGhpbmsgdXNpbmcgInJlc291cmNlLWlkIjoidGFnIiBjYW4gd29yazo8L2Rp
dj48ZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+ezwvZGl2PjxkaXY+Jm5ic3A7ICJtZXRhIiA6IHs8
L2Rpdj48ZGl2PiZuYnNwOyAmbmJzcDsgImRlcGVuZGVudC12dGFncyIgOiB7PC9kaXY+PGRpdj4m
bmJzcDsgJm5ic3A7ICZuYnNwOyA8c3BhbiBzdHlsZT0iZm9udC1zaXplOiAxMnB0OyI+Jm5ic3A7
Im15LWRlZmF1bHQtbmV0d29yay1tYXAiPC9zcGFuPjxzcGFuIHN0eWxlPSJmb250LXNpemU6IDEy
cHQ7Ij46ICI3OTE1ZGMwMjkwYzI3MDU0ODFjNDkxYTJiNGZmYmVjNDgyYjNjZjYyIiw8L3NwYW4+
PC9kaXY+PGRpdj4mbmJzcDsgJm5ic3A7ICZuYnNwOyA8c3BhbiBzdHlsZT0iZm9udC1zaXplOiAx
MnB0OyI+Jm5ic3A7Im15LWFsdGVybmF0aXZlLW5ldHdvcmstbWFwIjwvc3Bhbj48c3BhbiBzdHls
ZT0iZm9udC1zaXplOiAxMnB0OyI+OiAiM2VlMmNiN2U4ZDYzZDlmYWI3MWI5YjM0Y2JmNzY0NDM2
MzE1NTQyZSI8L3NwYW4+PC9kaXY+PGRpdj4mbmJzcDsgJm5ic3A7IH08L2Rpdj48ZGl2PiZuYnNw
OyB9PC9kaXY+PGRpdj59PC9kaXY+PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5vciwmbmJzcDs8
c3BhbiBzdHlsZT0iZm9udC1zaXplOiAxMnB0OyI+aWYgd2UgbmVlZCB0byBhZGQgbW9yZSBpbmZv
cm1hdGlvbiBpbiAicmVzb3VyY2UtaWQiIGZvciBmdXR1cmUgd29yazo8L3NwYW4+PC9kaXY+PGRp
dj48YnI+PC9kaXY+PGRpdj48ZGl2Pns8L2Rpdj48ZGl2PiZuYnNwOyAibWV0YSIgOiB7PC9kaXY+
PGRpdj4mbmJzcDsgJm5ic3A7ICJkZXBlbmRlbnQtdnRhZ3MiIDogezwvZGl2PjxkaXY+Jm5ic3A7
ICZuYnNwOyAmbmJzcDsmbmJzcDs8c3BhbiBzdHlsZT0iZm9udC1zaXplOiAxMnB0OyI+Jm5ic3A7
Im15LWRlZmF1bHQtbmV0d29yay1tYXAiPC9zcGFuPjxzcGFuIHN0eWxlPSJmb250LXNpemU6IDEy
cHQ7Ij46IHs8L3NwYW4+PC9kaXY+PGRpdj48c3BhbiBzdHlsZT0iZm9udC1zaXplOiAxMnB0OyI+
Jm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAm
bmJzcDsidGFnIjoiNzkxNWRjMDI5MGMyNzA1NDgxYzQ5MWEyYjRmZmJlYzQ4MmIzY2Y2MiI8L3Nw
YW4+PC9kaXY+PGRpdj48c3BhbiBzdHlsZT0iZm9udC1zaXplOiAxMnB0OyI+Jm5ic3A7ICZuYnNw
OyAmbmJzcDsgJm5ic3A7IH08L3NwYW4+PC9kaXY+PGRpdj4mbmJzcDsgJm5ic3A7ICZuYnNwOyZu
YnNwOzxzcGFuIHN0eWxlPSJmb250LXNpemU6IDEycHQ7Ij4mbmJzcDsibXktYWx0ZXJuYXRpdmUt
bmV0d29yay1tYXAiPC9zcGFuPjxzcGFuIHN0eWxlPSJmb250LXNpemU6IDEycHQ7Ij46IHs8L3Nw
YW4+PC9kaXY+PGRpdj48c3BhbiBzdHlsZT0iZm9udC1zaXplOiAxMnB0OyI+Jm5ic3A7ICZuYnNw
OyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsidGFnIjoi
M2VlMmNiN2U4ZDYzZDlmYWI3MWI5YjM0Y2JmNzY0NDM2MzE1NTQyZSI8L3NwYW4+PC9kaXY+PGRp
dj48c3BhbiBzdHlsZT0iZm9udC1zaXplOiAxMnB0OyI+Jm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5i
c3A7IH08L3NwYW4+PC9kaXY+PGRpdj4mbmJzcDsgJm5ic3A7IH08L2Rpdj48ZGl2PiZuYnNwOyB9
PC9kaXY+PGRpdj59PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5UaGFua3MsPC9kaXY+PGRpdj5Y
aW48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PjxociBpZD0ic3RvcFNwZWxsaW5nIj5Gcm9tOiB4
aWFvLnNoaUB5YWxlLmVkdTxicj5EYXRlOiBXZWQsIDE1IE9jdCAyMDE0IDA3OjA0OjQ2IC0wNDAw
PGJyPlRvOiB5cnlAY3MueWFsZS5lZHU8YnI+Q0M6IG1ub3RAbW5vdC5uZXQ7IGFsdG9AaWV0Zi5v
cmc7IHBicnlhbkBhbm9kZS5jYTxicj5TdWJqZWN0OiBSZTogW2FsdG9dIEFMVE8gaW5jcmVtZW50
YWwgdXBkYXRlcyBhbmQgSlNPTiBQYXRjaCBleHRlbnNpb248YnI+PGJyPjxkaXYgZGlyPSJsdHIi
PkhpIGZvbGtzLDxkaXY+PGJyPjwvZGl2PjxkaXY+QmFzZWQgb24gYSBjdXJzb3J5IHJlYWRpbmcg
b2YgdGhlIG1lcmdlLXBhdGNoLCBvbmUgcG9zc2libGUgKGJ1dCBjbHVtc3kpIHNvbHV0aW9uIGlz
IHRvIHVzZSB0aGUgYXNzdW1wdGlvbiB0aGF0IEpTT04gbmFtZXMgU0hPVUxEIGJlIHVuaXF1ZSBp
biBhIEpTT04gb2JqZWN0LiBIZW5jZSBpZiB5b3UgaGF2ZSBmb3IgZXhhbXBsZTo8L2Rpdj48ZGl2
Pj09PT08L2Rpdj48ZGl2PjxkaXYgc3R5bGU9ImZvbnQtZmFtaWx5OmFyaWFsLHNhbnMtc2VyaWY7
Zm9udC1zaXplOjEzcHg7Ij57PC9kaXY+PGRpdiBzdHlsZT0iZm9udC1mYW1pbHk6YXJpYWwsc2Fu
cy1zZXJpZjtmb250LXNpemU6MTNweDsiPiZuYnNwOyAicGlkMSIgOiB7InByZWZpeDEiIDoge30s
ICJwcmVmaXgyIiA6IHt9LCAicHJlZml4MyIgOnt9fTwvZGl2PjxkaXYgc3R5bGU9ImZvbnQtZmFt
aWx5OmFyaWFsLHNhbnMtc2VyaWY7Zm9udC1zaXplOjEzcHg7Ij4mbmJzcDsgInBpZDIiIDogeyJw
cmVmaXgzIiA6IHt9LCAicHJlZml4NCImbmJzcDs6IHt9LCAicHJlZml4NSImbmJzcDs6IHt9fTwv
ZGl2PjxkaXYgc3R5bGU9ImZvbnQtZmFtaWx5OmFyaWFsLHNhbnMtc2VyaWY7Zm9udC1zaXplOjEz
cHg7Ij59PC9kaXY+PC9kaXY+PGRpdiBzdHlsZT0iZm9udC1mYW1pbHk6YXJpYWwsc2Fucy1zZXJp
Zjtmb250LXNpemU6MTNweDsiPj09PT08L2Rpdj48ZGl2PjxkaXY+Tm93LCB0byBkZWxldGUgInBy
ZWZpeDIiIGZyb20gdGhlIHZhbHVlIG9mICJwaWQxIiwgb25lIGNhbiBkbzo8L2Rpdj48ZGl2Pj09
PT08L2Rpdj48ZGl2Pm9wIDogcmVtb3ZlPC9kaXY+PGRpdj5wYXRoIDogL3BpZDEvcHJlZml4Mjwv
ZGl2PjwvZGl2PjxkaXY+PT09PTwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+QnVpbGRpbmcgb24g
dG9wIG9mIHdoYXQgUmljaGFyZCBzYWlkLCB0aGUgc2V0LWxpa2UgYXJyYXkgbWF5IGFsc28gYmUg
YW4gaXNzdWUgaWYgaXQgaXMgaW4gdGhlIG1pZGRsZSBvZiB0aGUgdGFyZ2V0ZWQgcGF0aC4gRm9y
IGV4YW1wbGUsIGlmIEkgaGF2ZSB0aGUgZm9sbG93aW5nIG9iamVjdCAoU2VjLiAxMS40LjEuNiBv
ZiBSRkM3Mjg1IHdpdGggb25lIGFkZGVkIGVsZW1lbnQgaW4gdGhlIGRlcGVuZGVudC12dGFncyBh
cnJheSk6PC9kaXY+PGRpdj49PT09PC9kaXY+PGRpdj48ZGl2Pns8L2Rpdj48ZGl2PiZuYnNwOyAi
bWV0YSIgOiB7PC9kaXY+PGRpdj4mbmJzcDsgJm5ic3A7ICJkZXBlbmRlbnQtdnRhZ3MiIDogWzwv
ZGl2PjxkaXY+Jm5ic3A7ICZuYnNwOyAmbmJzcDsgezwvZGl2PjxkaXY+Jm5ic3A7ICZuYnNwOyAm
bmJzcDsgJm5ic3A7ICJyZXNvdXJjZS1pZCI6ICJteS1kZWZhdWx0LW5ldHdvcmstbWFwIiw8L2Rp
dj48ZGl2PiZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAidGFnIjogIjc5MTVkYzAyOTBjMjcw
NTQ4MWM0OTFhMmI0ZmZiZWM0ODJiM2NmNjIiPC9kaXY+PGRpdj4mbmJzcDsgJm5ic3A7ICZuYnNw
OyB9LDwvZGl2PjxkaXY+Jm5ic3A7ICZuYnNwOyAmbmJzcDsgezwvZGl2PjxkaXY+Jm5ic3A7ICZu
YnNwOyAmbmJzcDsgJm5ic3A7ICJyZXNvdXJjZS1pZCI6ICJteS1hbHRlcm5hdGl2ZS1uZXR3b3Jr
LW1hcCIsPC9kaXY+PGRpdj4mbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgInRhZyI6ICIzZWUy
Y2I3ZThkNjNkOWZhYjcxYjliMzRjYmY3NjQ0MzYzMTU1NDJlIjwvZGl2PjxkaXY+Jm5ic3A7ICZu
YnNwOyAmbmJzcDsgfTwvZGl2PjxkaXY+Jm5ic3A7ICZuYnNwOyBdPC9kaXY+PGRpdj4mbmJzcDsg
fTwvZGl2PjxkaXY+fTwvZGl2PjwvZGl2PjxkaXY+PT09PTwvZGl2PjxkaXY+TGV0J3Mgc2F5IHdl
IHdhbnQgdG8gbW9kaWZ5IHRoZSB0YWcgb2YgdGhlIGRlZmF1bHQtbmV0d29yay1tYXAgKHdoaWNo
IHNlZW1zIHJlYXNvbmFibGUpLiBDb3JyZWN0IG1lIGlmIEknbSB3cm9uZywgYnV0IHdpdGhvdXQg
a25vd2luZyB0aGUgc3BlY2lmaWMgaW5kZXggb2YgdGhlIGFycmF5LCB0aGlzIHRhc2sgd291bGQg
bm90IGJlIHBvc3NpYmxlIHdpdGggSlNPTiBwYXRjaCBvciBtZXJnZSBwYXRjaCAoc2luY2UgbWVy
Z2UgcGF0Y2ggZG9lcyBub3QgaXRlcmF0ZSB0aHJvdWdoIGFycmF5cykuPC9kaXY+PGRpdj48YnI+
PC9kaXY+PGRpdj5CZXN0LDwvZGl2PjxkaXY+WGlhbzwvZGl2PjxkaXY+PGJyPjwvZGl2PjwvZGl2
PjxkaXYgY2xhc3M9ImVjeGdtYWlsX2V4dHJhIj48YnI+PGRpdiBjbGFzcz0iZWN4Z21haWxfcXVv
dGUiPk9uIFdlZCwgT2N0IDE1LCAyMDE0IGF0IDEyOjA3IEFNLCBZLiBSaWNoYXJkIFlhbmcgPHNw
YW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86eXJ5QGNzLnlhbGUuZWR1IiB0YXJnZXQ9
Il9ibGFuayI+eXJ5QGNzLnlhbGUuZWR1PC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48YmxvY2tx
dW90ZSBjbGFzcz0iZWN4Z21haWxfcXVvdGUiIHN0eWxlPSJib3JkZXItbGVmdDoxcHggI2NjYyBz
b2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+PGRpdiBkaXI9Imx0ciI+RGVhciBNYXJrLDxkaXY+PGJy
PjwvZGl2PjxkaXY+VGhhbmtzIGEgbG90IGZvciB0aGUgcXVpY2sgcmVzcG9uc2UhIEkgZGlkIG5v
dCByZW1lbWJlciByZWFkaW5nIG1lcmdlLXBhdGNoLiBBZnRlciBqdXN0IHJlYWRpbmcgaXQsIEkg
Zm91bmQgdGhhdCBpdCBpcyBkb2luZyBleGFjdGx5IHdoYXQgd2Ugd2FudGVkIHRvIGRvLCBhbmQg
d2UgY2FsbGVkIGl0IHRyZWUtcmVwbGFjZSwgdG8gYmUgc2ltaWxhciB0byB0aGUgcmVwbGFjZSBv
cGVyYXRvciBkZWZpbmVkIGluIFJGQzY5MDIuIFdlIHdpbGwgc2VlIGhvdyB3ZSBtYXkgdXNlIGl0
IGluIG91ciBkZXNpZ24uJm5ic3A7PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5TaW5jZSB3ZSBh
cmUgYXQgSlNPTiBwYXRjaCBleHRlbnNpb25zLCBoZXJlIGlzIGFub3RoZXIgaXNzdWUgdGhhdCB3
ZSB3YW50IHRvIHJlc29sdmU6IHNldCBvcGVyYXRpb25zIG9uIGFuIGFycmF5LiBDb25zaWRlciBh
IEpTT04gb2JqZWN0Jm5ic3A7PC9kaXY+PGRpdj57PC9kaXY+PGRpdj4mbmJzcDsgInBpZDEiIDog
WyJwcmVmaXgxIiwgInByZWZpeDIiLCAicHJlZml4MyJdPC9kaXY+PGRpdj4mbmJzcDsgInBpZDIi
IDogWyJwcmVmaXgzIiwgInByZWZpeDQiLCAicHJlZml4NSJdPC9kaXY+PGRpdj59PC9kaXY+PGRp
dj48YnI+PC9kaXY+PGRpdj5UbyBkZWxldGUgInByZWZpeDIiIGZyb20gdGhlIHZhbHVlIG9mICJw
aWQxIiwgd2UgbmVlZCB0byB3cml0ZTwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+b3AgOiByZW1v
dmU8L2Rpdj48ZGl2PnBhdGggOiAvcGlkMS8xPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5Ib3dl
dmVyLCB0aGUgcmVhbCBpbnRlbnRpb24gb2YgdGhlIHZhbHVlcyBvZiAicGlkMSIgYW5kICJwaWQy
IiBhcmUgc2V0cywgYnV0IEpTT04gaGFzIG5vIGNvbmNlcHQgb2YgYSBzZXQgKG5vdCBtdWx0aSBz
ZXQpLCBhcyBkaXNjdXNzZWQgYmVmb3JlLiBUaGUgc2V0IHNlbWFudGljcyBndWFyYW50ZWVzIG5v
IGR1cGxpY2F0ZXMsIGFuZCBoZW5jZSB3ZSBtYXkgZWxpbWluYXRlIHRoZSBidXJkZW4gb24gYW4g
YXBwbGljYXRpb24gdG8ga2VlcCB0cmFjayBvZiB0aGUgYXJyYXkgaW5kZXgsIGlmIHdlIGFyZSBh
bGxvd2VkIHRvIGV4dGVuZCB0aGUgSlNPTiBQb2ludGVyIChyZmM2OTAxKSwgaW4gcGFydGljdWxh
ciwgd2hlbiB0aGUgY2FzZSBvZiB0aGUgY3VycmVudGx5IHJlZmVyZW5jZWQgdmFsdWUgaXMgYSBK
U09OIGFycmF5LCBieSBhbGxvd2luZyBmdW5jdGlvbnMgb3Igb3RoZXIgY2hhcnMsIGZvciBleGFt
cGxlLCB0byBkZW5vdGUgYSBzZXQsIG9yIGluZGV4IGxvb2sgdXAtLXRoZSBjdXJyZW50IGRlZmlu
aXRpb24gYWxsb3dzIG9ubHkgbnVtZXJpY2FsIGluZGV4IG9yIC0gYW5kIGhlbmNlIG9uZSBjYW4g
cmVzb2x2ZSBhbWJpZ3VpdHkuLi48YnI+PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5NYWtlIHNl
bnNlPzwvZGl2PjxzcGFuIGNsYXNzPSJlY3hIT0VuWmIiPjxmb250IGNvbG9yPSIjODg4ODg4Ij48
ZGl2Pjxicj48L2Rpdj48ZGl2PlJpY2hhcmQ8L2Rpdj48L2ZvbnQ+PC9zcGFuPjxkaXY+PGRpdiBj
bGFzcz0iaDUiPjxkaXYgY2xhc3M9ImVjeGdtYWlsX2V4dHJhIj48YnI+PGRpdiBjbGFzcz0iZWN4
Z21haWxfcXVvdGUiPk9uIFR1ZSwgT2N0IDE0LCAyMDE0IGF0IDExOjEzIFBNLCBNYXJrIE5vdHRp
bmdoYW0gPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86bW5vdEBtbm90Lm5ldCIg
dGFyZ2V0PSJfYmxhbmsiPm1ub3RAbW5vdC5uZXQ8L2E+Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjxi
bG9ja3F1b3RlIGNsYXNzPSJlY3hnbWFpbF9xdW90ZSIgc3R5bGU9ImJvcmRlci1sZWZ0OjFweCAj
Y2NjIHNvbGlkO3BhZGRpbmctbGVmdDoxZXg7Ij5IaSBSaWNoYXJkLDxicj4KPGJyPgpSRkM2OTAy
IGRvZXNuJ3QgYWxsb3cgZXh0ZW5zaW9uIG9wZXJhdG9yczsgeW91J2QgbmVlZCB0byBkZWZpbmUg
YSBuZXcgbWVkaWEgdHlwZSBhbmQgc3BlY2lmeSBpdHMgYmVoYXZpb3VyLiBPZiBjb3Vyc2UsIHlv
dSBjb3VsZCBkbyB0aGF0IHByZXR0eSBlYXNpbHkgYnkganVzdCBzYXlpbmcgImhlcmUncyBhIG5l
dyBtZWRpYSB0eXBlOyBpdCBoYXMgdGhlIHNhbWUgc2VtYW50aWNzIC8gcmVxdWlyZW1lbnRzIGFz
IEpTT04gUGF0Y2gsIHBsdXMgdGhpcy4uLiIuPGJyPgo8YnI+CkFsc28sIEkgdHJ1c3QgeW91J3Zl
IHNlZW4gdGhlIG5ldyBKU09OIG1lcmdlLXBhdGNoIFJGQyAoSSB0aGluayB3ZSBzcG9rZSBhYm91
dCBpdCBiZWZvcmUpPzxicj4KJm5ic3A7IDxhIGhyZWY9Imh0dHBzOi8vdG9vbHMuaWV0Zi5vcmcv
aHRtbC9yZmM3Mzg2IiB0YXJnZXQ9Il9ibGFuayI+aHR0cHM6Ly90b29scy5pZXRmLm9yZy9odG1s
L3JmYzczODY8L2E+PGJyPgo8YnI+CkNoZWVycyw8YnI+CjxkaXY+PGRpdj48YnI+Cjxicj4KT24g
MTUgT2N0IDIwMTQsIGF0IDQ6NDcgYW0sIFkuIFJpY2hhcmQgWWFuZyAmbHQ7PGEgaHJlZj0ibWFp
bHRvOnlyeUBjcy55YWxlLmVkdSIgdGFyZ2V0PSJfYmxhbmsiPnlyeUBjcy55YWxlLmVkdTwvYT4m
Z3Q7IHdyb3RlOjxicj4KPGJyPgomZ3Q7IERlYXIgYWxsLDxicj4KJmd0Ozxicj4KJmd0OyBTb21l
IG9mIHVzIGFyZSBoYXZpbmcgYW4gZXh0ZW5zaXZlIGRpc2N1c3Npb24gb24gaG93IHRvIHByb2Nl
ZWQgcmVnYXJkaW5nIHRoZSBBTFRPIGluY3JlbWVudGFsIHVwZGF0ZXMgV0cgaXRlbS4gSGVyZSBp
cyBhIHN1bW1hcnkgb2Ygd2hhdCB3ZSBhcmUgdGhpbmtpbmcuIEF0IGEgaGlnaCBsZXZlbCwgd2Ug
cGxhbiB0byBwcm9wb3NlIGFuIGFwcHJvYWNoIG9mIHVzaW5nIEpTT04gUGF0Y2ggKFJGQzY5MDIp
LCBidXQgd2l0aCBzb21lIGV4dGVuc2lvbnMuIFdlIHdhbnQgdG8gZ2V0IHlvdXIgY29tbWVudHMg
YW5kIGFkdmljZSBvbiBpZiB5b3Ugc2VlIGFueSBwcm9ibGVtcywgYW5kIGhvdyBiZXN0IHRvIHBy
b2NlZWQuPGJyPgomZ3Q7PGJyPgomZ3Q7IEN1cnJlbnQgc3RhdGU6PGJyPgomZ3Q7ID09PT09PT09
PT08YnI+CiZndDsgQm90aCBKU09OIFBhdGNoIChSRkM2OTAyKSBhbmQmbmJzcDsgPGEgaHJlZj0i
aHR0cDovL3Rvb2xzLmlldGYub3JnL2h0bWwvZHJhZnQtcm9vbWUtYWx0by1pbmNyLXVwZGF0ZXMt
MDEiIHRhcmdldD0iX2JsYW5rIj5odHRwOi8vdG9vbHMuaWV0Zi5vcmcvaHRtbC9kcmFmdC1yb29t
ZS1hbHRvLWluY3ItdXBkYXRlcy0wMTwvYT4gYXJlIGNvbnNpZGVyZWQgYXMgY2FuZGlkYXRlcyBv
ZiB0aGUgZW5jb2RpbmcgdXBkYXRlIG1lc3NhZ2UgZm9ybWF0Ljxicj4KJmd0Ozxicj4KJmd0OyBE
ZXNpZ24gZ29hbCBhbmQgcHJvYmxlbTo8YnI+CiZndDsgPT09PT09PT09PT09PT09PT09PT08YnI+
CiZndDsgR2VuZXJhbGl0eSBhbmQgZWZmaWNpZW5jeS4gVGhhdCBpcywgd2Ugd2FudCBhbiBpbmNy
ZW1lbnRhbCB1cGRhdGUgZm9ybWF0IHRoYXQgY2FuIGhhbmRsZSBub3Qgb25seSBjdXJyZW50IHJl
c291cmNlcyBidXQgYWxzbyBmdXR1cmUgcmVzb3VyY2VzLiBUaGUgcmVjZW50IHRyZW5kIGluIGFk
b3B0aW5nIFlBTkcgc2hvd3MgdGhhdCBnZW5lcmFsIG1lY2hhbmlzbXMsIG5vdCBwZXIgcHJvdG9j
b2wgcGF0Y2gsIGhhdmUgdmFsdWUuIEdlbmVyaWMgZW5jb2Rpbmcgb2YgSlNPTiBQYXRjaCBiYXNl
ZCBvbiBYUEFUSCBhbmQgYSBmZXcgb3BlcmF0b3JzIGlzIGNvbXBsZXRlIGluIHRoaXMgc2Vuc2Us
IGJ1dCBpbmVmZmljaWVudCBpbiBrZXkgQUxUTyBjYXNlcyBzdWNoIGFzIHVwZGF0aW5nIGNvc3Qg
bWFwcywgYXMgcG9pbnRlZCBvdXQgaW4gPGEgaHJlZj0iaHR0cDovL3Rvb2xzLmlldGYub3JnL2h0
bWwvZHJhZnQtcm9vbWUtYWx0by1pbmNyLXVwZGF0ZXMtMDEiIHRhcmdldD0iX2JsYW5rIj5odHRw
Oi8vdG9vbHMuaWV0Zi5vcmcvaHRtbC9kcmFmdC1yb29tZS1hbHRvLWluY3ItdXBkYXRlcy0wMTwv
YT48YnI+CiZndDs8YnI+CiZndDsgS2V5IGlkZWE6PGJyPgomZ3Q7ID09PT09PT08YnI+CiZndDsg
QSBKU09OIG9iamVjdCBjYW4gYmUgY29uc2lkZXJlZCBhcyBhbiBrZXktdmFsdWUgdHJlZSwgd2l0
aCBlYWNoIG5vZGUgYmVpbmcgYW4gb2JqZWN0IGFuZCBlYWNoIGVkZ2UgbGFiZWxlZCBieSB0aGUg
a2V5LCBhbmQgdGhlIHZhbHVlIG9mIHRoZSBlZGdlIHBvaW50aW5nIHRvIGFub3RoZXIgb2JqZWN0
LiBGb3IgZXhhbXBsZSwgdGhlIEFMVE8gY29zdCBtYXAgZXhhbXBsZTo8YnI+CiZndDsgezxicj4K
Jmd0OyZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyJtZXRh
IiA6IHs8YnI+CiZndDs8YnI+CiZndDsmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7
ICZuYnNwOyAmbmJzcDsgJm5ic3A7ImRlcGVuZGVudC12dGFncyIgOiBbPGJyPgomZ3Q7Jm5ic3A7
ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDt7
InJlc291cmNlLWlkIjogIm15LWRlZmF1bHQtbmV0d29yay1tYXAiLDxicj4KJmd0OyZuYnNwOyAm
bmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICJ0
YWciOiAiM2VlMmNiN2U4ZDYzZDlmYWI3MWI5YjM0Y2JmNzY0NDM2MzE1NTQyZSI8YnI+CiZndDsm
bmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZu
YnNwO308YnI+CiZndDsmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAm
bmJzcDsgJm5ic3A7XSw8YnI+CiZndDs8YnI+CiZndDsmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJz
cDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7InZ0YWciOjxicj4KJmd0OyZuYnNwOyAmbmJz
cDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7IHsicmVz
b3VyY2UtaWQiOiAiQ09TVC1NQVAtSUQiLCAidGFnIjogIkNNLVRBRyJ9LDxicj4KJmd0Ozxicj4K
Jmd0OyZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJz
cDsiY29zdC10eXBlIiA6IHsiY29zdC1tb2RlIiZuYnNwOyA6ICJudW1lcmljYWwiLDxicj4KJmd0
OyZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsg
Jm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICJjb3N0LW1l
dHJpYyI6ICJyb3V0aW5nY29zdCI8YnI+CiZndDsmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsg
Jm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7fTxicj4KJmd0OyZuYnNwOyAmbmJzcDsgJm5ic3A7
ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwO30sPGJyPgomZ3Q7Jm5ic3A7ICZuYnNwOyAmbmJz
cDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ImNvc3QtbWFwIiA6IHs8YnI+CiZndDsmbmJz
cDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7IlBJRDEi
OiB7ICJQSUQxIjogMSwmbmJzcDsgIlBJRDIiOiA1LCZuYnNwOyAiUElEMyI6IDEwIH0sPGJyPgom
Z3Q7Jm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNw
OyJQSUQyIjogeyAiUElEMSI6IDUsJm5ic3A7ICJQSUQyIjogMSwmbmJzcDsgIlBJRDMiOiAxNSB9
LDxicj4KJmd0OyZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNw
OyAmbmJzcDsiUElEMyI6IHsgIlBJRDEiOiAyMCwgIlBJRDIiOiAxNSZuYnNwOyB9PGJyPgomZ3Q7
Jm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7fTxicj4KJmd0
Ozxicj4KJmd0OyBkZWZpbmVzIGEgZGF0YSB0cmVlIHdpdGggMTQgbGVhZiBub2Rlczo8YnI+CiZn
dDs8YnI+CiZndDsgIm1ldGEvZGVwZW5kZW50LXZ0YWdzL3Jlc291cmNlLWlkIjogIm15LWRlZmF1
bHQtbmV0d29yay1tYXAiLDxicj4KJmd0OyAibWV0YS9kZXBlbmRlbnQtdnRhZ3MvdGFnIjogIjNl
ZTJjYjdlOGQ2M2Q5ZmFiNzFiOWIzNGNiZjc2NDQzNjMxNTU0MmUiLDxicj4KJmd0OyAuLi48YnI+
CiZndDsgImNvc3QtbWFwL1BJRDMvUElEMSI6IDIwLDxicj4KJmd0OyAiY29zdC1tYXAvUElEMy9Q
SUQyIjogMTU8YnI+CiZndDs8YnI+CiZndDsgUkZDNjkwMiBmb2N1c2VzIG9uIGVuY29kaW5nIHVw
ZGF0aW5nIG9uZSBub2RlIG9uIHRoZSB0cmVlIGF0IGEgdGltZS4gT24gdGhlIG90aGVyIGhhbmQs
IG9uZSBjYW4gcmVhbGl6ZSB0aGF0IHRoZSBjb3N0LW1hcCB1cGRhdGUgZW5jb2Rpbmcgb2YgPGEg
aHJlZj0iaHR0cDovL3Rvb2xzLmlldGYub3JnL2h0bWwvZHJhZnQtcm9vbWUtYWx0by1pbmNyLXVw
ZGF0ZXMtMDEiIHRhcmdldD0iX2JsYW5rIj5odHRwOi8vdG9vbHMuaWV0Zi5vcmcvaHRtbC9kcmFm
dC1yb29tZS1hbHRvLWluY3ItdXBkYXRlcy0wMTwvYT4gdXBkYXRlcyBhIHNldCBvZiBub2Rlcy4g
Rm9yIGV4YW1wbGUsIGFuIHVwZGF0ZSBleGFtcGxlPGJyPgomZ3Q7IHs8YnI+CiZndDsmbmJzcDsg
Jm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7Im1ldGEiOiB7PGJyPgomZ3Q7Jm5ic3A7ICZuYnNw
OyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICJ2dGFnIjo8YnI+CiZndDsmbmJz
cDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNw
OyB7InRhZyI6ICJORVctQ00tVEFHIn0sPGJyPgomZ3Q7Jm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5i
c3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7IH0sPGJyPgomZ3Q7Jm5ic3A7ICZuYnNwOyAmbmJzcDsg
Jm5ic3A7ICZuYnNwOyJjb3N0LW1hcCI6IHs8YnI+CiZndDsmbmJzcDsgJm5ic3A7ICZuYnNwOyAm
bmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgIlBJRDEiOiB7IlBJRDIiOiAxMCwgIlBJRDk5Ijog
bnVsbH08YnI+CiZndDsmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAm
bmJzcDsgfTxicj4KJmd0OyZuYnNwOyAmbmJzcDsgfTxicj4KJmd0OyB1cGRhdGVzIDMgbm9kZXMu
PGJyPgomZ3Q7PGJyPgomZ3Q7IElmIG9uZSB0aGlua3MgYWJvdXQsIG9uZSB3aWxsIHJlYWxpemUg
dGhhdCB0aGlzIGlzIGEgZ2VuZXJhbCwgaW50ZXJlc3RpbmcgZGVzaWduOiBjb25zaWRlciB0aGUg
ZGF0YSB0cmVlIG9mIHRoZSBvcmlnaW5hbCBvYmplY3Q7IHRoZSB1cGRhdGUgb2JqZWN0IGlzIGEg
cGFydGlhbCB0cmVlIG9mIHRoZSBvcmlnaW5hbCwgYW5kIHVwZGF0ZXMgYSBiYXRjaCBjb250YWlu
aW5nIGFsbCBtYXRjaGVkIG5vZGVzIGluIHRoZSBwYXJ0aWFsIHRyZWUuIFdlIGNhbGwgdGhpcyBv
cGVyYXRvciB0aGUgdHJlZS1yZXBsYWNlIG9wZXJhdG9yLiBIb3cgbWF5IG9uZSBkbyB0aGlzIGFz
IGFuIGV4dGVuc2lvbiBvZiBSRkM2OTAyOjxicj4KJmd0Ozxicj4KJmd0OyB7PGJyPgomZ3Q7Jm5i
c3A7ICJvcCIgOiAidHJlZS1yZXBsYWNlIiw8YnI+CiZndDsmbmJzcDsgInBhdGgiIDogIi8iLCZu
YnNwOyAmbmJzcDsgLy8gcHJlZml4IG9mIHVwZGF0ZSBvYmplY3Q8YnI+CiZndDsmbmJzcDsgInZh
bHVlIiA6Jm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7Ly8ganVzdCBhIGNvcHkgb2YgdGhlIHBh
cnRpYWwgb2JqZWN0IGluIHZhbHVlPGJyPgomZ3Q7Jm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7
eyAibWV0YSI6IHs8YnI+CiZndDsmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZu
YnNwOyAmbmJzcDsgInZ0YWciOjxicj4KJmd0OyZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAm
bmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7IHsidGFnIjogIk5FVy1DTS1UQUcifSw8
YnI+CiZndDsmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7IH0sPGJyPgomZ3Q7Jm5i
c3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyJjb3N0LW1hcCI6IHs8YnI+CiZndDsmbmJz
cDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgIlBJRDEiOiB7IlBJ
RDIiOiAxMCwgIlBJRDk5IjogbnVsbH08YnI+CiZndDsmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJz
cDsgJm5ic3A7ICZuYnNwO308YnI+CiZndDsmbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDt9PGJy
PgomZ3Q7IH08YnI+CiZndDs8YnI+CiZndDsgSGVuY2UsIHdlIGhhdmUgYSBzaW1wbGUgb3BlcmF0
b3IgdGhhdCBhcHBlYXJzIHRvIGJlIGFibGUgdG8gZml4IHRoZSBjb3N0LW1hcCBlZmZpY2llbmN5
IGlzc3VlIGFuZCBpcyBzdGlsbCBnZW5lcmFsLCBub3QgQUxUTyBvbmx5Ljxicj4KJmd0Ozxicj4K
Jmd0OyBOZXh0IHN0ZXA6PGJyPgomZ3Q7ID09PT09PT09PGJyPgomZ3Q7IC0gT25lIHBvc3NpYmls
aXR5IGlzIHRvIHN0YXJ0IHRvIHdvcmsgb24gYW4gZXh0ZW5zaW9uIG9mIFJGQyA2OTAyIHRvIGlu
dHJvZHVjZSB0aGlzIG9wZXJhdG9yLCBpZiB0aGVyZSBpcyBubyBidWcuIEFmdGVyIHRoaXMgaXMg
ZG9uZSwgd2Ugc3BlY2lmeSBBTFRPIGluY3JlbWVudGFsIHVwZGF0ZXMgdXNpbmcgdGhlIG5ldyBv
cC4gQW4gaXNzdWUgaXMgdGhhdCB0aGlzIGlzIGEgc2VxdWVudGlhbCBwcm9jZXNzIGFuZCBtYXkg
dGFrZSB0aW1lLjxicj4KJmd0Ozxicj4KJmd0OyAtIEFub3RoZXIgcG9zc2liaWxpdHkgaXMgdGhh
dCB3ZSBzcGVjaWZ5IEpTT04gUGF0Y2ggYXMgaW5jcmVtZW50YWwgdXBkYXRlIGVuY29kaW5nIGZv
ciBub3csIGxvc2luZyBlZmZpY2llbmN5LiBJbiBwYXJhbGxlbCwgd2UgcHVzaCBmb3IgdGhlIG5l
dyBvcCwgYW5kIHdoZW4gaXQgaXMgZG9uZSwgQUxUTyBpbmNyZW1lbnRhbCB1cGRhdGVzIGltcGxl
bWVudGF0aW9uIGNhbiB1c2UgdGhlIG5ldyBvcC48YnI+CiZndDs8YnI+CiZndDsgLSBBIHRoaXJk
IHBvc3NpYmlsaXR5IGlzIHRoYXQgd2UgZGVmaW5lIHRoZSBleHRlbnNpb24gb3BlcmF0b3IgaW4g
QUxUTyBpbmNyZW1lbnRhbCB1cGRhdGVzIGRvY3VtZW50IGl0c2VsZiwgYW5kIHByb2NlZWQgcXVp
Y2tseS48YnI+CiZndDs8YnI+CiZndDsgQW55IGJ1ZyBpbiB0aGUgZGVzaWduPyBBbnkgY29tbWVu
dHMgb3Igc3VnZ2VzdGlvbnM/PGJyPgomZ3Q7PGJyPgomZ3Q7IFRoYW5rcyE8YnI+CiZndDs8YnI+
CiZndDsgUmljaGFyZCwgV2VuZHk8YnI+Cjxicj4KPC9kaXY+PC9kaXY+LS08YnI+Ck1hcmsgTm90
dGluZ2hhbSZuYnNwOyAmbmJzcDs8YSBocmVmPSJodHRwczovL3d3dy5tbm90Lm5ldC8iIHRhcmdl
dD0iX2JsYW5rIj5odHRwczovL3d3dy5tbm90Lm5ldDwvYT4vPGJyPjwvYmxvY2txdW90ZT48L2Rp
dj4KPC9kaXY+PC9kaXY+PC9kaXY+PC9kaXY+Cjxicj5fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fXzxicj4KYWx0byBtYWlsaW5nIGxpc3Q8YnI+CjxhIGhyZWY9
Im1haWx0bzphbHRvQGlldGYub3JnIj5hbHRvQGlldGYub3JnPC9hPjxicj4KPGEgaHJlZj0iaHR0
cHM6Ly93d3cuaWV0Zi5vcmcvbWFpbG1hbi9saXN0aW5mby9hbHRvIiB0YXJnZXQ9Il9ibGFuayI+
aHR0cHM6Ly93d3cuaWV0Zi5vcmcvbWFpbG1hbi9saXN0aW5mby9hbHRvPC9hPjxicj4KPGJyPjwv
YmxvY2txdW90ZT48L2Rpdj48YnI+PC9kaXY+Cjxicj5fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fXwphbHRvIG1haWxpbmcgbGlzdAphbHRvQGlldGYub3JnCmh0
dHBzOi8vd3d3LmlldGYub3JnL21haWxtYW4vbGlzdGluZm8vYWx0bzwvZGl2PjwvZGl2PiAJCSAJ
ICAgCQkgIDwvZGl2PjwvYm9keT4NCjwvaHRtbD4=

--_9b3b5e94-6bd4-46df-91b7-3ecf5df6d62b_--


From nobody Thu Oct 16 06:52:40 2014
Return-Path: <w.roome@alcatel-lucent.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DA0AD1A0149 for <alto@ietfa.amsl.com>; Thu, 16 Oct 2014 06:52:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.908
X-Spam-Level: 
X-Spam-Status: No, score=-1.908 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
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 tSCZ9Fc45G5P for <alto@ietfa.amsl.com>; Thu, 16 Oct 2014 06:52:35 -0700 (PDT)
Received: from smtp-us.alcatel-lucent.com (us-hpswa-esg-02.alcatel-lucent.com [135.245.18.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D7BBF1A0119 for <alto@ietf.org>; Thu, 16 Oct 2014 06:52:34 -0700 (PDT)
Received: from us70tusmtp2.zam.alcatel-lucent.com (unknown [135.5.2.64]) by Websense Email Security Gateway with ESMTPS id 486B752E853F2; Thu, 16 Oct 2014 13:52:31 +0000 (GMT)
Received: from usnavsmail2.ndc.alcatel-lucent.com (usnavsmail2.ndc.alcatel-lucent.com [135.3.39.10]) by us70tusmtp2.zam.alcatel-lucent.com (GMO) with ESMTP id s9GDqVvq018020 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 16 Oct 2014 09:52:33 -0400
Received: from umail.lucent.com (umail.ndc.lucent.com [135.3.40.61]) by usnavsmail2.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id s9GDqVRD025287 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 16 Oct 2014 08:52:31 -0500
Received: from [135.222.152.71] (wdr-i7mbp2.mh.lucent.com [135.222.152.71]) by umail.lucent.com (8.13.8/TPES) with ESMTP id s9GDqQjc017880; Thu, 16 Oct 2014 08:52:29 -0500 (CDT)
User-Agent: Microsoft-MacOutlook/14.4.4.140807
Date: Thu, 16 Oct 2014 09:52:31 -0400
From: Wendy Roome <w.roome@alcatel-lucent.com>
To: "Y. Richard Yang" <yry@cs.yale.edu>
Message-ID: <D0653E13.181A19%w.roome@alcatel-lucent.com>
Thread-Topic: [alto] Incremental updates transport using SSE?
References: <D0644784.180EE4%w.roome@alcatel-lucent.com> <CANUuoLoDnPx-V37==AXbMzuRPiYLXRz3CkMVpfSRfEMehg8S_g@mail.gmail.com>
In-Reply-To: <CANUuoLoDnPx-V37==AXbMzuRPiYLXRz3CkMVpfSRfEMehg8S_g@mail.gmail.com>
Mime-version: 1.0
Content-type: multipart/alternative; boundary="B_3496297955_8679387"
X-Scanned-By: MIMEDefang 2.64 on 135.3.39.10
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/1FSj6hW1OdsMOmQRnOuaHgaNZC0
Cc: IETF ALTO <alto@ietf.org>
Subject: Re: [alto] Incremental updates transport using SSE?
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Oct 2014 13:52:39 -0000

> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--B_3496297955_8679387
Content-type: text/plain;
	charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

Richard,

Wonderful! So let=B9s generalize it with the following event types:
=20
application/alto-networkmap+json     // Full network map
application/alto-networkmap-merge-patch+json   // JSON merge-patch for a
network map message (new)
application/alto-costmap+json            // Full cost map
application/alto-costmap-merge-patch+json   // JSON merge-patch for a cost
map message (new)

This could be extended to the proposed PID-property map service, if that is
accepted.

I dropped endpointcost and endpointprop because those are not full maps.
They return costs or properties for the endpoints specified by the client. =
I
don't know what "incremental update" would mean in that case. Any ideas?

It's possible to extend this to the directory as well. But I hesitate to do
that because what happens if the update changes the incremental update
resource? Also, if a server has linked directories, it wouldn=B9t cover
changes to the linked ones. But again, if you can define how that would
work, go for it.

The IRD entry for this update service could have media-type
text/event-stream, the MIME type for SSE, and an "event" capability with a
list of the event types this stream supports. For example,
        application/alto-networkmap+json
        application/alto-costmap+json
        application/alto-costmap-merge-patch+json
would mean that stream sends merge-patch cost map updates as the are
available. It also sends new network maps when they change, but it always
sends full maps, not merge-patch updates.

We could also define a filtered update service. Same idea, except that it i=
s
a POST request, and the client sends a list of the event types the client i=
s
willing to accept.

There are a few additional requirements, such as if a resource's event list
has a merge-patch type, it MUST have the corresponding full-map event as
well. The server MUST send a full map event before it sends the first
merge-patch event. And for the filtered service, a client MUST request the
full map event if it wants the merge-patch event.

- Wendy
     =20

From:  "Y. Richard Yang" <yry@cs.yale.edu>
Date:  Wed, October 15, 2014 at 17:27
To:  Wendy Roome <w.roome@alcatel-lucent.com>
Cc:  IETF ALTO <alto@ietf.org>
Subject:  Re: [alto] Incremental updates transport using SSE?

On Wed, Oct 15, 2014 at 4:09 PM, Wendy Roome <w.roome@alcatel-lucent.com>
wrote:
> I like SSE as well. But I suggest using the event field for the data type=
.
> That means we have two events: application/alto-costmap+json and
> application/merge-patch+json.
>=20
=20
Interesting alternative design. Always preferring a solution that is
general, I would prefer an SSE design that handles general cases; for
example, ALTO server may output more media types such as
alto-directory+json, alto-networkmap+json, alto-costmap+json,
alto-endpointprop+json, and alto-endpointcost+json. The design should handl=
e
all such cases and potential new media types.

Make sense?

Richard

> For an application/alto-costmap+json event, the data is JSON for a Cost
> Map response message, as defined in RFC 7285. To handle this event, the
> client throws out any previous cost map data and starts over from scratch=
.
>=20
> For an application/merge-patch+json event, the data is a JSON merge-patch
> update to the previous cost map data. The client applies that patch.
>=20
> When a client initiates the stream, the server MUST send an
> application/alto-costmap+json event as the fist message. Subsequent
> messages are application/merge-patch+json events. The server can also sen=
d
> another application/alto-costmap+json event, if the changes are so
> dramatic that that is easier. E.g., suppose the network map changed and
> renamed the PIDs.
>=20
> Note that this method does NOT need version tags for cost map versions.
>=20
> So a stream would look something like:
>=20
> event: application/alto-costmap+json
> data: {"meta": {...}, "cost-map": {"PID1": {...}}
>=20
> event: application/merge-patch+json
> data: { json merge-patch }
>=20
>         - Wendy Roome



--B_3496297955_8679387
Content-type: text/html;
	charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

<html><head></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size:=
 14px; font-family: Calibri, sans-serif;"><div>Richard,</div><div><br></div>=
<div>Wonderful! So let&#8217;s generalize it with the following event types:=
</div><div>&nbsp;</div><div>application/alto-networkmap+json &nbsp; &nbsp; /=
/ Full network map</div><div>application/alto-networkmap-merge-patch+json &n=
bsp; // JSON merge-patch for a network map message (new)</div><div>applicati=
on/alto-costmap+json &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Full cost m=
ap</div><div><div>application/alto-costmap-merge-patch+json &nbsp; // JSON m=
erge-patch for a cost map message (new)</div></div><div><br></div><div><div>=
This could be extended to the proposed PID-property map service, if that is =
accepted.</div></div><div><br></div><div>I dropped endpointcost and endpoint=
prop because those are not full maps. They return costs or properties for th=
e endpoints specified by the client. I don't know what "incremental update" =
would mean in that case. Any ideas?</div><div><br></div><div>It's possible t=
o extend this to the directory as well. But I hesitate to do that because wh=
at happens if the update changes the incremental update resource? Also, if a=
 server has linked directories, it wouldn&#8217;t cover changes to the linke=
d ones. But again, if you can define how that would work, go for it.</div><d=
iv><br></div><div>The IRD entry for this update service could have media-typ=
e text/event-stream, the MIME type for SSE, and an "event" capability with a=
 list of the event types this stream supports. For example,</div><div>&nbsp;=
 &nbsp; &nbsp; &nbsp; application/alto-networkmap+json</div><div>&nbsp; &nbs=
p; &nbsp; &nbsp; application/alto-costmap+json</div><div>&nbsp; &nbsp; &nbsp=
; &nbsp; application/alto-costmap-merge-patch+json</div><div>would mean that=
 stream sends merge-patch cost map updates as the are available. It also sen=
ds new network maps when they change, but it always sends full maps, not mer=
ge-patch updates.</div><div><br></div><div>We could also define a filtered u=
pdate service. Same idea, except that it is a POST request, and the client s=
ends a list of the event types the client is willing to accept.</div><div><b=
r></div><div>There are a few additional requirements, such as if a resource'=
s event list has a merge-patch type, it MUST have the corresponding full-map=
 event as well. The server MUST send a full map event before it sends the fi=
rst merge-patch event. And for the filtered service, a client MUST request t=
he full map event if it wants the merge-patch event.</div><div><br></div><di=
v><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>- Wendy</div>=
<div>&nbsp; &nbsp; &nbsp;&nbsp;</div><div><br></div><span id=3D"OLK_SRC_BODY_S=
ECTION"><div style=3D"font-family:Calibri; font-size:11pt; text-align:left; co=
lor:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOT=
TOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt sol=
id; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style=3D"font-weight:bo=
ld">From: </span> "Y. Richard Yang" &lt;<a href=3D"mailto:yry@cs.yale.edu">yry=
@cs.yale.edu</a>&gt;<br><span style=3D"font-weight:bold">Date: </span> Wed, Oc=
tober 15, 2014 at 17:27<br><span style=3D"font-weight:bold">To: </span> Wendy =
Roome &lt;<a href=3D"mailto:w.roome@alcatel-lucent.com">w.roome@alcatel-lucent=
.com</a>&gt;<br><span style=3D"font-weight:bold">Cc: </span> IETF ALTO &lt;<a =
href=3D"mailto:alto@ietf.org">alto@ietf.org</a>&gt;<br><span style=3D"font-weigh=
t:bold">Subject: </span> Re: [alto] Incremental updates transport using SSE?=
<br></div><div><br></div><span style=3D"color: rgb(0, 0, 0); font-family: Cali=
bri; font-size: medium; font-style: normal; font-variant: normal; font-weigh=
t: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-=
align: start; text-indent: 0px; text-transform: none; white-space: normal; w=
idows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inl=
ine !important; float: none;">On Wed, Oct 15, 2014 at 4:09 PM, Wendy Roome<s=
pan class=3D"Apple-converted-space">&nbsp;</span></span><span dir=3D"ltr" style=3D=
"color: rgb(0, 0, 0); font-family: Calibri; font-size: medium; font-style: n=
ormal; font-variant: normal; font-weight: normal; letter-spacing: normal; li=
ne-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-=
transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webk=
it-text-stroke-width: 0px;">&lt;<a href=3D"mailto:w.roome@alcatel-lucent.com" =
target=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;</span><span style=3D"color:=
 rgb(0, 0, 0); font-family: Calibri; font-size: medium; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; line-heig=
ht: normal; orphans: auto; text-align: start; text-indent: 0px; text-transfo=
rm: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text=
-stroke-width: 0px; display: inline !important; float: none;"><span class=3D"A=
pple-converted-space">&nbsp;</span>wrote:</span><br style=3D"color: rgb(0, 0, =
0); font-family: Calibri; font-size: medium; font-style: normal; font-varian=
t: normal; font-weight: normal; letter-spacing: normal; line-height: normal;=
 orphans: auto; text-align: start; text-indent: 0px; text-transform: none; w=
hite-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-wid=
th: 0px;"><blockquote class=3D"gmail_quote" style=3D"color: rgb(0, 0, 0); font-f=
amily: Calibri; font-size: medium; font-style: normal; font-variant: normal;=
 font-weight: normal; letter-spacing: normal; line-height: normal; orphans: =
auto; text-align: start; text-indent: 0px; text-transform: none; white-space=
: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; m=
argin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204=
, 204, 204); border-left-style: solid; padding-left: 1ex;">I like SSE as wel=
l. But I suggest using the event field for the data type.<br>That means we h=
ave two events: application/alto-costmap+json and<br>application/merge-patch=
+json.<br><br></blockquote><div style=3D"color: rgb(0, 0, 0); font-family: Cal=
ibri; font-size: medium; font-style: normal; font-variant: normal; font-weig=
ht: normal; letter-spacing: normal; line-height: normal; orphans: auto; text=
-align: start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">&nbsp;</di=
v><div style=3D"color: rgb(0, 0, 0); font-family: Calibri; font-size: medium; =
font-style: normal; font-variant: normal; font-weight: normal; letter-spacin=
g: normal; line-height: normal; orphans: auto; text-align: start; text-inden=
t: 0px; text-transform: none; white-space: normal; widows: auto; word-spacin=
g: 0px; -webkit-text-stroke-width: 0px;">Interesting alternative design. Alw=
ays preferring a solution that is general, I would prefer an SSE design that=
 handles general cases; for example, ALTO server may output more media types=
 such as&nbsp;<span style=3D"color: rgb(0, 0, 0); white-space: pre-wrap;">alto=
-directory+json, </span><span style=3D"color: rgb(0, 0, 0); white-space: pre-w=
rap;">alto-networkmap+json, </span><span style=3D"color: rgb(0, 0, 0); white-s=
pace: pre-wrap;">alto-costmap+json, </span><span style=3D"color: rgb(0, 0, 0);=
 white-space: pre-wrap;">alto-endpointprop+json, and </span><span style=3D"col=
or: rgb(0, 0, 0); white-space: pre-wrap;">alto-endpointcost+json. The design=
 should handle all such cases and potential new media types.</span></div><di=
v style=3D"color: rgb(0, 0, 0); font-family: Calibri; font-size: medium; font-=
style: normal; font-variant: normal; font-weight: normal; letter-spacing: no=
rmal; line-height: normal; orphans: auto; text-align: start; text-indent: 0p=
x; text-transform: none; white-space: normal; widows: auto; word-spacing: 0p=
x; -webkit-text-stroke-width: 0px;"><br></div><div style=3D"color: rgb(0, 0, 0=
); font-family: Calibri; font-size: medium; font-style: normal; font-variant=
: normal; font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: none; wh=
ite-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-widt=
h: 0px;">Make sense?</div><div style=3D"color: rgb(0, 0, 0); font-family: Cali=
bri; font-size: medium; font-style: normal; font-variant: normal; font-weigh=
t: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-=
align: start; text-indent: 0px; text-transform: none; white-space: normal; w=
idows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><=
div style=3D"color: rgb(0, 0, 0); font-family: Calibri; font-size: medium; fon=
t-style: normal; font-variant: normal; font-weight: normal; letter-spacing: =
normal; line-height: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px;">Richard</div><div style=3D"color: rgb(0,=
 0, 0); font-family: Calibri; font-size: medium; font-style: normal; font-va=
riant: normal; font-weight: normal; letter-spacing: normal; line-height: nor=
mal; orphans: auto; text-align: start; text-indent: 0px; text-transform: non=
e; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke=
-width: 0px;"><br></div><blockquote class=3D"gmail_quote" style=3D"color: rgb(0,=
 0, 0); font-family: Calibri; font-size: medium; font-style: normal; font-va=
riant: normal; font-weight: normal; letter-spacing: normal; line-height: nor=
mal; orphans: auto; text-align: start; text-indent: 0px; text-transform: non=
e; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke=
-width: 0px; margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-=
color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">For=
 an application/alto-costmap+json event, the data is JSON for a Cost<br>Map =
response message, as defined in RFC 7285. To handle this event, the<br>clien=
t throws out any previous cost map data and starts over from scratch.<br><br=
>For an application/merge-patch+json event, the data is a JSON merge-patch<b=
r>update to the previous cost map data. The client applies that patch.<br><b=
r>When a client initiates the stream, the server MUST send an<br>application=
/alto-costmap+json event as the fist message. Subsequent<br>messages are app=
lication/merge-patch+json events. The server can also send<br>another applic=
ation/alto-costmap+json event, if the changes are so<br>dramatic that that i=
s easier. E.g., suppose the network map changed and<br>renamed the PIDs.<br>=
<br>Note that this method does NOT need version tags for cost map versions.<=
br><br>So a stream would look something like:<br><br>event: application/alto=
-costmap+json<br>data: {"meta": {...}, "cost-map": {"PID1": {...}}<br><br>ev=
ent: application/merge-patch+json<br>data: { json merge-patch }<br><br>&nbsp=
; &nbsp; &nbsp; &nbsp; - Wendy Roome<br></blockquote></span></body></html>

--B_3496297955_8679387--



From nobody Thu Oct 16 07:19:35 2014
Return-Path: <w.roome@alcatel-lucent.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 13E371A1A7D for <alto@ietfa.amsl.com>; Thu, 16 Oct 2014 07:19:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.91
X-Spam-Level: 
X-Spam-Status: No, score=-1.91 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
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 gxFUK8uWi_iA for <alto@ietfa.amsl.com>; Thu, 16 Oct 2014 07:19:23 -0700 (PDT)
Received: from smtp-us.alcatel-lucent.com (us-hpatc-esg-02.alcatel-lucent.com [135.245.18.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 701FC1A1AE6 for <alto@ietf.org>; Thu, 16 Oct 2014 07:19:21 -0700 (PDT)
Received: from us70uusmtp4.zam.alcatel-lucent.com (unknown [135.5.2.66]) by Websense Email Security Gateway with ESMTPS id 7E5616942DE90 for <alto@ietf.org>; Thu, 16 Oct 2014 14:19:16 +0000 (GMT)
Received: from usnavsmail4.ndc.alcatel-lucent.com (usnavsmail4.ndc.alcatel-lucent.com [135.3.39.12]) by us70uusmtp4.zam.alcatel-lucent.com (GMO) with ESMTP id s9GEJIJq008408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for <alto@ietf.org>; Thu, 16 Oct 2014 10:19:18 -0400
Received: from umail.lucent.com (umail.ndc.lucent.com [135.3.40.61]) by usnavsmail4.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id s9GEJH5I003078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for <alto@ietf.org>; Thu, 16 Oct 2014 09:19:18 -0500
Received: from [135.222.152.71] (wdr-i7mbp2.mh.lucent.com [135.222.152.71]) by umail.lucent.com (8.13.8/TPES) with ESMTP id s9GEJEcE013775 for <alto@ietf.org>; Thu, 16 Oct 2014 09:19:16 -0500 (CDT)
User-Agent: Microsoft-MacOutlook/14.4.4.140807
Date: Thu, 16 Oct 2014 10:19:18 -0400
From: Wendy Roome <w.roome@alcatel-lucent.com>
To: <alto@ietf.org>
Message-ID: <D06548D9.181D21%w.roome@alcatel-lucent.com>
Thread-Topic: [alto] ALTO incremental updates and JSON Patch extension
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
X-Scanned-By: MIMEDefang 2.64 on 135.3.39.12
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/COl1Ax1Ik0lrEdetylQPchwEDsI
Subject: Re: [alto] ALTO incremental updates and JSON Patch extension
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Oct 2014 14:19:30 -0000

>Date: Wed, 15 Oct 2014 07:04:46 -0400
>From: Xiao SHI <xiao.shi@yale.edu>
>Subject: Re: [alto] ALTO incremental updates and JSON Patch extension
>
>Hi folks,
>     ......
>
>Building on top of what Richard said, the set-like array may also be an
>issue if it is in the middle of the targeted path. For example, if I have
>the following object (Sec. 11.4.1.6 of RFC7285 with one added element in
>the dependent-vtags array):
>====
>{
>  "meta" : {
>    "dependent-vtags" : [
>      {
>        "resource-id": "my-default-network-map",
>        "tag": "7915dc0290c2705481c491a2b4ffbec482b3cf62"
>      },
>      {
>        "resource-id": "my-alternative-network-map",
>        "tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e"
>      }
>    ]
>  }
>}
>====
>Let's say we want to modify the tag of the default-network-map (which
>seems
>reasonable). Correct me if I'm wrong, but without knowing the specific
>index of the array, this task would not be possible with JSON patch or
>merge patch (since merge patch does not iterate through arrays).
>
>Best,
>Xiao

In this case, merge-patch would just replace the dependent-vtags array in
its entirety. That's less space-efficient, of course. But that array will
never be very large, so that doesn't hurt much.

But it will be significant if we use merge-patch for incremental Network
Map updates. If PIDs have 50+ prefixes (large, but certainly not
impossible), if a prefix moves from one PID to another, merge-patch would
have the give the complete list of prefixes for both PIDs. In the extreme,
if one prefix changes in every PID, the merge-update message would be no
smaller than the full network map message, even though only a small
fraction of the prefixes changed.

	- Wendy Roome 



From nobody Thu Oct 16 15:22:42 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 779541A8AC4 for <alto@ietfa.amsl.com>; Thu, 16 Oct 2014 15:22:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.377
X-Spam-Level: 
X-Spam-Status: No, score=-1.377 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 vCx1n_JDQG80 for <alto@ietfa.amsl.com>; Thu, 16 Oct 2014 15:22:37 -0700 (PDT)
Received: from mail-yh0-x236.google.com (mail-yh0-x236.google.com [IPv6:2607:f8b0:4002:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AA3D51A8ABA for <alto@ietf.org>; Thu, 16 Oct 2014 15:22:37 -0700 (PDT)
Received: by mail-yh0-f54.google.com with SMTP id z6so2446304yhz.13 for <alto@ietf.org>; Thu, 16 Oct 2014 15:22:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=+3zt6XO5d6jwT5RCys2318Xxne0D10gh4KI3/X4ssp0=; b=oFOTvA6CqIohf1P+3CuY6s+NJWG43+CQLK4C9MyjxrkDG/d2QokCTUcllcUoUipERw 7afLu+CIlieSEQ3BHVd8d9y7MYEqAPTyQuNxmUoo6M4RvvPOYBGboirRhYwCXlNvOhNi 14/4fQtZR9sv+Nyk8Ga3VoAd8tDsMXziOpSvPvYyzqK+wxf9B4FQQZAtiSy0FHJ8eGEp 1KeTNlq0tOr2xuOBUi5qbTnYZy6/WWmrmq/9pKOpNylrWiRjDgPgK+rWyZVXLwcQhtAN 54iGrqj0HGmlCxVz1qIWJpOZWTlhHCIGy8nbCriq2bq6x7Vq93Q6G2CdOhIhXEt6k9J1 CE6w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=+3zt6XO5d6jwT5RCys2318Xxne0D10gh4KI3/X4ssp0=; b=GNXUgTnreUx1qB4FrxJ0Jns0zu8ZPqNa97B0dBKUq7P2W1VHzxuL7GZ8aMHUGfSxnO HB+hGoaBQ4sqMqELWkZwIi0kVJ80GOo0iL8Tdp+TyMDMI6Ed8/V3Iy6XE8CnHIgrigLl WJF7XqMdvaeFqA3SyZ7yHW4bWt3En0d0A4QgQ=
X-Received: by 10.236.221.168 with SMTP id r38mr5421899yhp.137.1413498156966;  Thu, 16 Oct 2014 15:22:36 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.97.10 with HTTP; Thu, 16 Oct 2014 15:22:16 -0700 (PDT)
In-Reply-To: <D0653E13.181A19%w.roome@alcatel-lucent.com>
References: <D0644784.180EE4%w.roome@alcatel-lucent.com> <CANUuoLoDnPx-V37==AXbMzuRPiYLXRz3CkMVpfSRfEMehg8S_g@mail.gmail.com> <D0653E13.181A19%w.roome@alcatel-lucent.com>
From: Xiao SHI <xiao.shi@yale.edu>
Date: Thu, 16 Oct 2014 18:22:16 -0400
X-Google-Sender-Auth: RLIr7XxKbveuC2ccA-J14c1MiyM
Message-ID: <CAFwJzZn6hOzP-ef0Ji2vpnkTpU_wifZoKqxhpSo3pVzXB901LA@mail.gmail.com>
To: Wendy Roome <w.roome@alcatel-lucent.com>
Content-Type: multipart/alternative; boundary=001a11c2cb7e89687e050591af8a
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/Op8bMEucEMbDxVXpvymmAKrOXMM
Cc: IETF ALTO <alto@ietf.org>
Subject: Re: [alto] Incremental updates transport using SSE?
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Oct 2014 22:22:41 -0000

--001a11c2cb7e89687e050591af8a
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi Wendy,

If a client accidentally dropped the connection and hopes to re-connect and
receive the merge-patch events, would it make sense for the server not to
send the first full-map event? It will save quite some effort that way.

Best,
Xiao

On Thu, Oct 16, 2014 at 9:52 AM, Wendy Roome <w.roome@alcatel-lucent.com>
wrote:

> Richard,
>
> Wonderful! So let=E2=80=99s generalize it with the following event types:
>
> application/alto-networkmap+json     // Full network map
> application/alto-networkmap-merge-patch+json   // JSON merge-patch for a
> network map message (new)
> application/alto-costmap+json            // Full cost map
> application/alto-costmap-merge-patch+json   // JSON merge-patch for a cos=
t
> map message (new)
>
> This could be extended to the proposed PID-property map service, if that
> is accepted.
>
> I dropped endpointcost and endpointprop because those are not full maps.
> They return costs or properties for the endpoints specified by the client=
.
> I don't know what "incremental update" would mean in that case. Any ideas=
?
>
> It's possible to extend this to the directory as well. But I hesitate to
> do that because what happens if the update changes the incremental update
> resource? Also, if a server has linked directories, it wouldn=E2=80=99t c=
over
> changes to the linked ones. But again, if you can define how that would
> work, go for it.
>
> The IRD entry for this update service could have media-type
> text/event-stream, the MIME type for SSE, and an "event" capability with =
a
> list of the event types this stream supports. For example,
>         application/alto-networkmap+json
>         application/alto-costmap+json
>         application/alto-costmap-merge-patch+json
> would mean that stream sends merge-patch cost map updates as the are
> available. It also sends new network maps when they change, but it always
> sends full maps, not merge-patch updates.
>
> We could also define a filtered update service. Same idea, except that it
> is a POST request, and the client sends a list of the event types the
> client is willing to accept.
>
> There are a few additional requirements, such as if a resource's event
> list has a merge-patch type, it MUST have the corresponding full-map even=
t
> as well. The server MUST send a full map event before it sends the first
> merge-patch event. And for the filtered service, a client MUST request th=
e
> full map event if it wants the merge-patch event.
>
> - Wendy
>
>
> From: "Y. Richard Yang" <yry@cs.yale.edu>
> Date: Wed, October 15, 2014 at 17:27
> To: Wendy Roome <w.roome@alcatel-lucent.com>
> Cc: IETF ALTO <alto@ietf.org>
> Subject: Re: [alto] Incremental updates transport using SSE?
>
> On Wed, Oct 15, 2014 at 4:09 PM, Wendy Roome <w.roome@alcatel-lucent.com>
> wrote:
>
>> I like SSE as well. But I suggest using the event field for the data typ=
e.
>> That means we have two events: application/alto-costmap+json and
>> application/merge-patch+json.
>>
>>
> Interesting alternative design. Always preferring a solution that is
> general, I would prefer an SSE design that handles general cases; for
> example, ALTO server may output more media types such as alto-directory+j=
son,
> alto-networkmap+json, alto-costmap+json, alto-endpointprop+json, and alto=
-endpointcost+json.
> The design should handle all such cases and potential new media types.
>
> Make sense?
>
> Richard
>
> For an application/alto-costmap+json event, the data is JSON for a Cost
>> Map response message, as defined in RFC 7285. To handle this event, the
>> client throws out any previous cost map data and starts over from scratc=
h.
>>
>> For an application/merge-patch+json event, the data is a JSON merge-patc=
h
>> update to the previous cost map data. The client applies that patch.
>>
>> When a client initiates the stream, the server MUST send an
>> application/alto-costmap+json event as the fist message. Subsequent
>> messages are application/merge-patch+json events. The server can also se=
nd
>> another application/alto-costmap+json event, if the changes are so
>> dramatic that that is easier. E.g., suppose the network map changed and
>> renamed the PIDs.
>>
>> Note that this method does NOT need version tags for cost map versions.
>>
>> So a stream would look something like:
>>
>> event: application/alto-costmap+json
>> data: {"meta": {...}, "cost-map": {"PID1": {...}}
>>
>> event: application/merge-patch+json
>> data: { json merge-patch }
>>
>>         - Wendy Roome
>>
>
> _______________________________________________
> alto mailing list
> alto@ietf.org
> https://www.ietf.org/mailman/listinfo/alto
>
>

--001a11c2cb7e89687e050591af8a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Wendy,<div><br></div><div>If a client accidentally drop=
ped the connection and hopes to re-connect and receive the merge-patch even=
ts, would it make sense for the server not to send the first full-map event=
? It will save quite some effort that way.</div><div><br></div><div>Best,</=
div><div>Xiao</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail=
_quote">On Thu, Oct 16, 2014 at 9:52 AM, Wendy Roome <span dir=3D"ltr">&lt;=
<a href=3D"mailto:w.roome@alcatel-lucent.com" target=3D"_blank">w.roome@alc=
atel-lucent.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><di=
v style=3D"word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family=
:Calibri,sans-serif"><div>Richard,</div><div><br></div><div>Wonderful! So l=
et=E2=80=99s generalize it with the following event types:</div><div>=C2=A0=
</div><div>application/alto-networkmap+json =C2=A0 =C2=A0 // Full network m=
ap</div><div>application/alto-networkmap-merge-patch+json =C2=A0 // JSON me=
rge-patch for a network map message (new)</div><div>application/alto-costma=
p+json =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0// Full cost map</div><div>=
<div>application/alto-costmap-merge-patch+json =C2=A0 // JSON merge-patch f=
or a cost map message (new)</div></div><div><br></div><div><div>This could =
be extended to the proposed PID-property map service, if that is accepted.<=
/div></div><div><br></div><div>I dropped endpointcost and endpointprop beca=
use those are not full maps. They return costs or properties for the endpoi=
nts specified by the client. I don&#39;t know what &quot;incremental update=
&quot; would mean in that case. Any ideas?</div><div><br></div><div>It&#39;=
s possible to extend this to the directory as well. But I hesitate to do th=
at because what happens if the update changes the incremental update resour=
ce? Also, if a server has linked directories, it wouldn=E2=80=99t cover cha=
nges to the linked ones. But again, if you can define how that would work, =
go for it.</div><div><br></div><div>The IRD entry for this update service c=
ould have media-type text/event-stream, the MIME type for SSE, and an &quot=
;event&quot; capability with a list of the event types this stream supports=
. For example,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 application/alto-netwo=
rkmap+json</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 application/alto-costmap+j=
son</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 application/alto-costmap-merge-pa=
tch+json</div><div>would mean that stream sends merge-patch cost map update=
s as the are available. It also sends new network maps when they change, bu=
t it always sends full maps, not merge-patch updates.</div><div><br></div><=
div>We could also define a filtered update service. Same idea, except that =
it is a POST request, and the client sends a list of the event types the cl=
ient is willing to accept.</div><div><br></div><div>There are a few additio=
nal requirements, such as if a resource&#39;s event list has a merge-patch =
type, it MUST have the corresponding full-map event as well. The server MUS=
T send a full map event before it sends the first merge-patch event. And fo=
r the filtered service, a client MUST request the full map event if it want=
s the merge-patch event.</div><div><br></div><div><span style=3D"white-spac=
e:pre-wrap">	</span>- Wendy</div><div>=C2=A0 =C2=A0 =C2=A0=C2=A0</div><div>=
<br></div><span><div style=3D"font-family:Calibri;font-size:11pt;text-align=
:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING=
-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid=
;BORDER-RIGHT:medium none;PADDING-TOP:3pt"><span class=3D""><span style=3D"=
font-weight:bold">From: </span> &quot;Y. Richard Yang&quot; &lt;<a href=3D"=
mailto:yry@cs.yale.edu" target=3D"_blank">yry@cs.yale.edu</a>&gt;<br></span=
><span style=3D"font-weight:bold">Date: </span> Wed, October 15, 2014 at 17=
:27<br><span style=3D"font-weight:bold">To: </span> Wendy Roome &lt;<a href=
=3D"mailto:w.roome@alcatel-lucent.com" target=3D"_blank">w.roome@alcatel-lu=
cent.com</a>&gt;<br><span style=3D"font-weight:bold">Cc: </span> IETF ALTO =
&lt;<a href=3D"mailto:alto@ietf.org" target=3D"_blank">alto@ietf.org</a>&gt=
;<br><span style=3D"font-weight:bold">Subject: </span> Re: [alto] Increment=
al updates transport using SSE?<br></div><div><div class=3D"h5"><div><br></=
div><span style=3D"color:rgb(0,0,0);font-family:Calibri;font-size:medium;fo=
nt-style:normal;font-variant:normal;font-weight:normal;letter-spacing:norma=
l;line-height:normal;text-align:start;text-indent:0px;text-transform:none;w=
hite-space:normal;word-spacing:0px;display:inline!important;float:none">On =
Wed, Oct 15, 2014 at 4:09 PM, Wendy Roome<span>=C2=A0</span></span><span di=
r=3D"ltr" style=3D"color:rgb(0,0,0);font-family:Calibri;font-size:medium;fo=
nt-style:normal;font-variant:normal;font-weight:normal;letter-spacing:norma=
l;line-height:normal;text-align:start;text-indent:0px;text-transform:none;w=
hite-space:normal;word-spacing:0px">&lt;<a href=3D"mailto:w.roome@alcatel-l=
ucent.com" target=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;</span><span=
 style=3D"color:rgb(0,0,0);font-family:Calibri;font-size:medium;font-style:=
normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-he=
ight:normal;text-align:start;text-indent:0px;text-transform:none;white-spac=
e:normal;word-spacing:0px;display:inline!important;float:none"><span>=C2=A0=
</span>wrote:</span><br style=3D"color:rgb(0,0,0);font-family:Calibri;font-=
size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter=
-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-tr=
ansform:none;white-space:normal;word-spacing:0px"><blockquote class=3D"gmai=
l_quote" style=3D"color:rgb(0,0,0);font-family:Calibri;font-size:medium;fon=
t-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal=
;line-height:normal;text-align:start;text-indent:0px;text-transform:none;wh=
ite-space:normal;word-spacing:0px;margin:0px 0px 0px 0.8ex;border-left-widt=
h:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-le=
ft:1ex">I like SSE as well. But I suggest using the event field for the dat=
a type.<br>That means we have two events: application/alto-costmap+json and=
<br>application/merge-patch+json.<br><br></blockquote><div style=3D"color:r=
gb(0,0,0);font-family:Calibri;font-size:medium;font-style:normal;font-varia=
nt:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-=
align:start;text-indent:0px;text-transform:none;white-space:normal;word-spa=
cing:0px">=C2=A0</div><div style=3D"color:rgb(0,0,0);font-family:Calibri;fo=
nt-size:medium;font-style:normal;font-variant:normal;font-weight:normal;let=
ter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text=
-transform:none;white-space:normal;word-spacing:0px">Interesting alternativ=
e design. Always preferring a solution that is general, I would prefer an S=
SE design that handles general cases; for example, ALTO server may output m=
ore media types such as=C2=A0<span style=3D"color:rgb(0,0,0);white-space:pr=
e-wrap">alto-directory+json, </span><span style=3D"color:rgb(0,0,0);white-s=
pace:pre-wrap">alto-networkmap+json, </span><span style=3D"color:rgb(0,0,0)=
;white-space:pre-wrap">alto-costmap+json, </span><span style=3D"color:rgb(0=
,0,0);white-space:pre-wrap">alto-endpointprop+json, and </span><span style=
=3D"color:rgb(0,0,0);white-space:pre-wrap">alto-endpointcost+json. The desi=
gn should handle all such cases and potential new media types.</span></div>=
<div style=3D"color:rgb(0,0,0);font-family:Calibri;font-size:medium;font-st=
yle:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;lin=
e-height:normal;text-align:start;text-indent:0px;text-transform:none;white-=
space:normal;word-spacing:0px"><br></div><div style=3D"color:rgb(0,0,0);fon=
t-family:Calibri;font-size:medium;font-style:normal;font-variant:normal;fon=
t-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;t=
ext-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Mak=
e sense?</div><div style=3D"color:rgb(0,0,0);font-family:Calibri;font-size:=
medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spac=
ing:normal;line-height:normal;text-align:start;text-indent:0px;text-transfo=
rm:none;white-space:normal;word-spacing:0px"><br></div><div style=3D"color:=
rgb(0,0,0);font-family:Calibri;font-size:medium;font-style:normal;font-vari=
ant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text=
-align:start;text-indent:0px;text-transform:none;white-space:normal;word-sp=
acing:0px">Richard</div><div style=3D"color:rgb(0,0,0);font-family:Calibri;=
font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;l=
etter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;te=
xt-transform:none;white-space:normal;word-spacing:0px"><br></div><blockquot=
e class=3D"gmail_quote" style=3D"color:rgb(0,0,0);font-family:Calibri;font-=
size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter=
-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-tr=
ansform:none;white-space:normal;word-spacing:0px;margin:0px 0px 0px 0.8ex;b=
order-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:s=
olid;padding-left:1ex">For an application/alto-costmap+json event, the data=
 is JSON for a Cost<br>Map response message, as defined in RFC 7285. To han=
dle this event, the<br>client throws out any previous cost map data and sta=
rts over from scratch.<br><br>For an application/merge-patch+json event, th=
e data is a JSON merge-patch<br>update to the previous cost map data. The c=
lient applies that patch.<br><br>When a client initiates the stream, the se=
rver MUST send an<br>application/alto-costmap+json event as the fist messag=
e. Subsequent<br>messages are application/merge-patch+json events. The serv=
er can also send<br>another application/alto-costmap+json event, if the cha=
nges are so<br>dramatic that that is easier. E.g., suppose the network map =
changed and<br>renamed the PIDs.<br><br>Note that this method does NOT need=
 version tags for cost map versions.<br><br>So a stream would look somethin=
g like:<br><br>event: application/alto-costmap+json<br>data: {&quot;meta&qu=
ot;: {...}, &quot;cost-map&quot;: {&quot;PID1&quot;: {...}}<br><br>event: a=
pplication/merge-patch+json<br>data: { json merge-patch }<br><br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 - Wendy Roome<br></blockquote></div></div></span></div>
<br>_______________________________________________<br>
alto mailing list<br>
<a href=3D"mailto:alto@ietf.org">alto@ietf.org</a><br>
<a href=3D"https://www.ietf.org/mailman/listinfo/alto" target=3D"_blank">ht=
tps://www.ietf.org/mailman/listinfo/alto</a><br>
<br></blockquote></div><br></div>

--001a11c2cb7e89687e050591af8a--


From nobody Fri Oct 17 06:22:02 2014
Return-Path: <w.roome@alcatel-lucent.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2C9F51ACDA1 for <alto@ietfa.amsl.com>; Fri, 17 Oct 2014 06:21:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.908
X-Spam-Level: 
X-Spam-Status: No, score=-1.908 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
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 P87xtMabNDCS for <alto@ietfa.amsl.com>; Fri, 17 Oct 2014 06:21:50 -0700 (PDT)
Received: from smtp-us.alcatel-lucent.com (us-hpswa-esg-01.alcatel-lucent.com [135.245.18.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8B6AE1ACD98 for <alto@ietf.org>; Fri, 17 Oct 2014 06:21:48 -0700 (PDT)
Received: from us70tusmtp1.zam.alcatel-lucent.com (unknown [135.5.2.63]) by Websense Email Security Gateway with ESMTPS id DA305DA0E59FA; Fri, 17 Oct 2014 13:21:45 +0000 (GMT)
Received: from usnavsmail1.ndc.alcatel-lucent.com (usnavsmail1.ndc.alcatel-lucent.com [135.3.39.9]) by us70tusmtp1.zam.alcatel-lucent.com (GMO) with ESMTP id s9HDLitS002117 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 17 Oct 2014 09:21:45 -0400
Received: from umail.lucent.com (umail.ndc.lucent.com [135.3.40.61]) by usnavsmail1.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id s9HDLiEv017243 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 17 Oct 2014 08:21:44 -0500
Received: from [135.222.152.71] (wdr-i7mbp2.mh.lucent.com [135.222.152.71]) by umail.lucent.com (8.13.8/TPES) with ESMTP id s9HDLdV0025918; Fri, 17 Oct 2014 08:21:41 -0500 (CDT)
User-Agent: Microsoft-MacOutlook/14.4.4.140807
Date: Fri, 17 Oct 2014 09:21:40 -0400
From: Wendy Roome <w.roome@alcatel-lucent.com>
To: Xiao SHI <xiao.shi@yale.edu>
Message-ID: <D06687CA.1854F3%w.roome@alcatel-lucent.com>
Thread-Topic: [alto] Incremental updates transport using SSE?
References: <D0644784.180EE4%w.roome@alcatel-lucent.com> <CANUuoLoDnPx-V37==AXbMzuRPiYLXRz3CkMVpfSRfEMehg8S_g@mail.gmail.com> <D0653E13.181A19%w.roome@alcatel-lucent.com> <CAFwJzZn6hOzP-ef0Ji2vpnkTpU_wifZoKqxhpSo3pVzXB901LA@mail.gmail.com>
In-Reply-To: <CAFwJzZn6hOzP-ef0Ji2vpnkTpU_wifZoKqxhpSo3pVzXB901LA@mail.gmail.com>
Mime-version: 1.0
Content-type: multipart/alternative; boundary="B_3496382505_10385538"
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/L-1JNscy9wN5Aop0CH8oEXqcHnU
Cc: IETF ALTO <alto@ietf.org>
Subject: Re: [alto] Incremental updates transport using SSE?
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Oct 2014 13:21:58 -0000

> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--B_3496382505_10385538
Content-type: text/plain;
	charset="US-ASCII"
Content-transfer-encoding: 7bit

Xiao,

That is a very good point. I hoped someone would ask about that.

It is a tradeoff. The disadvantage of requiring the server to send full
map(s) at the start of each stream is that if the connection drops, we have
to send the full map over again. But the advantage is that incremental
updates are only within the context of this particular stream. We don't need
keep track of where we were.

To see the issue, suppose we wanted to avoid re-sending the full map when
the client reestablishes the connection. Then the server must assign a
unique id to every incremental update event. When the client reconnects, the
client gives the server the last known event id, and the server sends any
events the client missed.

BTW, SSE does define event ids. Each event has an id, and when connecting,
the client gives a Last-Event-Id header with the last id it received (if
any).

So what is the problem with that? First, the server MUST assign a unique id
to every incremental update, and they must be the same for all clients. That
is, if the server has several increment-update clients, the server must
"clock" their update event streams at the same rate. Second, the server must
keep a buffer of old update events, in case a client needs to reconnect. And
third, because a reconnecting client may send an old (or bogus)
Last-Event-Id, the server may have send the full map(s) anyway.

If we do not use event ids, then it is much simpler. Incremental updates are
in the context of this stream. Period. No persistent state that must survive
the end of the connection. And if desired, the server can send updates are
different rates to different clients.

So I think it boils down to how often we expect connections to drop
unintentionally. If that is common, then, yes, we need to define event ids
to avoid resending the full maps. But if we can assume accidental drops are
rare, then I think it is simpler just to send the full map(s) for every new
connection.

- Wendy Roome

From:  Xiao SHI <xiao.shi@yale.edu>
Date:  Thu, October 16, 2014 at 18:22
To:  Wendy Roome <w.roome@alcatel-lucent.com>
Cc:  "Y. Richard Yang" <yry@cs.yale.edu>, IETF ALTO <alto@ietf.org>
Subject:  Re: [alto] Incremental updates transport using SSE?

Hi Wendy,

If a client accidentally dropped the connection and hopes to re-connect and
receive the merge-patch events, would it make sense for the server not to
send the first full-map event? It will save quite some effort that way.

Best,
Xiao




--B_3496382505_10385538
Content-type: text/html;
	charset="US-ASCII"
Content-transfer-encoding: quoted-printable

<html><head></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size:=
 14px; font-family: Calibri, sans-serif;"><div>Xiao,</div><div><br></div><di=
v>That is a very good point. I hoped someone would ask about that.</div><div=
><br></div><div>It is a tradeoff. The disadvantage of requiring the server t=
o send full map(s) at the start of each stream is that if the connection dro=
ps, we have to send the full map over again. But the advantage is that incre=
mental updates are only within the context of this particular stream. We don=
't need keep track of where we were.</div><div><br></div><div>To see the iss=
ue, suppose we wanted to avoid re-sending the full map when the client reest=
ablishes the connection. Then the server must assign a unique id to every in=
cremental update event. When the client reconnects, the client gives the ser=
ver the last known event id, and the server sends any events the client miss=
ed.</div><div><br></div><div>BTW, SSE does define event ids. Each event has =
an id, and when connecting, the client gives a Last-Event-Id header with the=
 last id it received (if any).</div><div><br></div><div>So what is the probl=
em with that? First, the server MUST assign a unique id to every incremental=
 update, and they must be the same for all clients. That is, if the server h=
as several increment-update clients, the server must "clock" their update ev=
ent streams at the same rate. Second, the server must keep a buffer of old u=
pdate events, in case a client needs to reconnect. And third, because a reco=
nnecting client may send an old (or bogus) Last-Event-Id, the server may hav=
e send the full map(s) anyway.</div><div><br></div><div>If we do not use eve=
nt ids, then it is much simpler. Incremental updates are in the context of t=
his stream. Period. No persistent state that must survive the end of the con=
nection. And if desired, the server can send updates are different rates to =
different clients.</div><div><br></div><div>So I think it boils down to how =
often we expect connections to drop unintentionally. If that is common, then=
, yes, we need to define event ids to avoid resending the full maps. But if =
we can assume accidental drops are rare, then I think it is simpler just to =
send the full map(s) for every new connection.</div><div><br></div><div><spa=
n class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>- Wendy Roome</div>=
<div><br></div><span id=3D"OLK_SRC_BODY_SECTION"><div style=3D"font-family:Calib=
ri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none=
; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-=
RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDIN=
G-TOP: 3pt"><span style=3D"font-weight:bold">From: </span> Xiao SHI &lt;<a hre=
f=3D"mailto:xiao.shi@yale.edu">xiao.shi@yale.edu</a>&gt;<br><span style=3D"font-=
weight:bold">Date: </span> Thu, October 16, 2014 at 18:22<br><span style=3D"fo=
nt-weight:bold">To: </span> Wendy Roome &lt;<a href=3D"mailto:w.roome@alcatel-=
lucent.com">w.roome@alcatel-lucent.com</a>&gt;<br><span style=3D"font-weight:b=
old">Cc: </span> "Y. Richard Yang" &lt;<a href=3D"mailto:yry@cs.yale.edu">yry@=
cs.yale.edu</a>&gt;, IETF ALTO &lt;<a href=3D"mailto:alto@ietf.org">alto@ietf.=
org</a>&gt;<br><span style=3D"font-weight:bold">Subject: </span> Re: [alto] In=
cremental updates transport using SSE?<br></div><div><br></div><div dir=3D"ltr=
" style=3D"color: rgb(0, 0, 0); font-family: Calibri; font-size: medium; font-=
style: normal; font-variant: normal; font-weight: normal; letter-spacing: no=
rmal; line-height: normal; orphans: auto; text-align: start; text-indent: 0p=
x; text-transform: none; white-space: normal; widows: auto; word-spacing: 0p=
x; -webkit-text-stroke-width: 0px;">Hi Wendy,<div><br></div><div>If a client=
 accidentally dropped the connection and hopes to re-connect and receive the=
 merge-patch events, would it make sense for the server not to send the firs=
t full-map event? It will save quite some effort that way.</div><div><br></d=
iv><div>Best,</div><div>Xiao</div></div><br class=3D"Apple-interchange-newline=
"></span></body></html>

--B_3496382505_10385538--



From nobody Fri Oct 17 07:11:22 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E6C591ACE30 for <alto@ietfa.amsl.com>; Fri, 17 Oct 2014 07:11:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.071
X-Spam-Level: 
X-Spam-Status: No, score=-0.071 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001, TRACKER_ID=1.306] 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 Q6kbttVuyHVz for <alto@ietfa.amsl.com>; Fri, 17 Oct 2014 07:11:16 -0700 (PDT)
Received: from mail-yk0-x231.google.com (mail-yk0-x231.google.com [IPv6:2607:f8b0:4002:c07::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2B84F1ACE55 for <alto@ietf.org>; Fri, 17 Oct 2014 07:10:28 -0700 (PDT)
Received: by mail-yk0-f177.google.com with SMTP id q200so370390ykb.36 for <alto@ietf.org>; Fri, 17 Oct 2014 07:10:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=AvHYaLg8u+Y4/nSSvhuTS+PcQ8xMi/16Hr44hGfq9Bs=; b=F5eOzWyQNMWKLaJXqYUoaAveYc6GmhE3MB4gDMyeQfVO1HCEo+IGWcT4CzQFbRl45D wAYyDkaj8lFkStWw4eErdrdSFltYA1x17kkoMH6vVvwwqjtaSb51dunzW8rHpAuhDTMm tDdrCr476Q0hJ3r8FfvlYAQ2PNNNKWVTTpo9Ze7QEK3g3ZyNW76HIu81QxSMBTacfpsX yQ5K0vDg8jYmSpHqgWuD7l9FEWHxhv6JjS4zrL3cBpFqkDLZQSxQt5XVSqMDciCfthih BXaKKcpqx3tvgdYcZ5D/cSIvv91R4A1M1i+QHRO8oRDcikEi7s/Hl/XQ/dS3DdGo/sbF cLFg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=AvHYaLg8u+Y4/nSSvhuTS+PcQ8xMi/16Hr44hGfq9Bs=; b=zYBbiq/hnYGyWejAi2aPoZP6oUCxszSmijzMzGXxTvjasMgF9OCm4SfnKSAhPY+/es 9yW+zZ5aJ07bZqKL5dYppBA3QUwnHujKLmlbmZ/7y43WkYpsz6FJJRETQWitrtUnAlpy tPDvTgP9dRYhTFRIm3VoKoG2kQAzPYdMfPxcM=
X-Received: by 10.236.25.166 with SMTP id z26mr11725125yhz.69.1413555027469; Fri, 17 Oct 2014 07:10:27 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.97.10 with HTTP; Fri, 17 Oct 2014 07:10:06 -0700 (PDT)
In-Reply-To: <D06687CA.1854F3%w.roome@alcatel-lucent.com>
References: <D0644784.180EE4%w.roome@alcatel-lucent.com> <CANUuoLoDnPx-V37==AXbMzuRPiYLXRz3CkMVpfSRfEMehg8S_g@mail.gmail.com> <D0653E13.181A19%w.roome@alcatel-lucent.com> <CAFwJzZn6hOzP-ef0Ji2vpnkTpU_wifZoKqxhpSo3pVzXB901LA@mail.gmail.com> <D06687CA.1854F3%w.roome@alcatel-lucent.com>
From: Xiao SHI <xiao.shi@yale.edu>
Date: Fri, 17 Oct 2014 10:10:06 -0400
X-Google-Sender-Auth: s0iaYd3Whw79W-EGQoPDdhd4qfM
Message-ID: <CAFwJzZm2GPCYbZDmtTyOBzuS6RFCxrSKZO4Vy9xR-usDtvWeFg@mail.gmail.com>
To: Wendy Roome <w.roome@alcatel-lucent.com>
Content-Type: multipart/alternative; boundary=089e013d0890486be705059eed03
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/M8hyyIAeV4oxRpD5mIU2KwwGwHw
Cc: Xiao SHI <xiao.shi@yale.edu>, IETF ALTO <alto@ietf.org>
Subject: Re: [alto] Incremental updates transport using SSE?
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Oct 2014 14:11:19 -0000

--089e013d0890486be705059eed03
Content-Type: text/plain; charset=UTF-8

Hi Wendy,

I completely agree with you. I was thinking maybe there's some clever way
of using the SSE event-id, but the questionable saving is simply not worth
the logging and synchronization trouble.

1. One thing that follows this choice is to use one single SSE stream (open
connection) for each resource. I briefly considered having one open
connection and send updates for all resources on the server via that
stream. The advantage of having only one connection open is smaller
overhead, and the disadvantage is that it would require a more complicated
ID and version tagging in event name/id maybe. What do you think?

2. If the mapping between SSE stream and underlying map is one-to-one,
would it make sense for the resourceID of a stream to be the resourceID of
the underlying map and ".update" concatenated together? This way, when the
client actually requests and initiates the stream, the client would be
aware of the resourceID of the underlying map.

3. Following that, we should define id field in the events. Richard
proposed using a tag as the id if it's a full network map, and
newtag_oldtag if it's a patch. The vtag for network map is ResourceID+tag
tuple, if the client knows about the resourceID, could we only use the tag?
And should the cost maps simply use dependent-vtags? Since the id field is
a string, what format do we want the tags in? A few options are 1) json
with all whitespaces removed; 2) an even more compact patterned string.

e.g. for network map patch, it could be:
{"old-tag":{"resource-id":"my-default-network-map","tag":"3ee2cb7e8d63d9fab71b9b34cbf764436315542e"},"new-tag":{"resource-id":"my-default-network-map","tag":"
c0ce023b8678a7b9ec00324673b98e54656d1f6d"}}

or (since it must be the same resource):
{"resource-id":"my-default-network-map","old-tag":"3ee2cb7e8d63d9fab71b9b34cbf764436315542e","new-tag":"
c0ce023b8678a7b9ec00324673b98e54656d1f6d"}

or (if the client knows the resource-id for the underlying map of the
stream, just use a delimiter):
3ee2cb7e8d63d9fab71b9b34cbf764436315542e_
c0ce023b8678a7b9ec00324673b98e54656d1f6d

What do you think?

Best,
Xiao

On Fri, Oct 17, 2014 at 9:21 AM, Wendy Roome <w.roome@alcatel-lucent.com>
wrote:

> Xiao,
>
> That is a very good point. I hoped someone would ask about that.
>
> It is a tradeoff. The disadvantage of requiring the server to send full
> map(s) at the start of each stream is that if the connection drops, we have
> to send the full map over again. But the advantage is that incremental
> updates are only within the context of this particular stream. We don't
> need keep track of where we were.
>
> To see the issue, suppose we wanted to avoid re-sending the full map when
> the client reestablishes the connection. Then the server must assign a
> unique id to every incremental update event. When the client reconnects,
> the client gives the server the last known event id, and the server sends
> any events the client missed.
>
> BTW, SSE does define event ids. Each event has an id, and when connecting,
> the client gives a Last-Event-Id header with the last id it received (if
> any).
>
> So what is the problem with that? First, the server MUST assign a unique
> id to every incremental update, and they must be the same for all clients.
> That is, if the server has several increment-update clients, the server
> must "clock" their update event streams at the same rate. Second, the
> server must keep a buffer of old update events, in case a client needs to
> reconnect. And third, because a reconnecting client may send an old (or
> bogus) Last-Event-Id, the server may have send the full map(s) anyway.
>
> If we do not use event ids, then it is much simpler. Incremental updates
> are in the context of this stream. Period. No persistent state that must
> survive the end of the connection. And if desired, the server can send
> updates are different rates to different clients.
>
> So I think it boils down to how often we expect connections to drop
> unintentionally. If that is common, then, yes, we need to define event ids
> to avoid resending the full maps. But if we can assume accidental drops are
> rare, then I think it is simpler just to send the full map(s) for every new
> connection.
>
> - Wendy Roome
>
> From: Xiao SHI <xiao.shi@yale.edu>
> Date: Thu, October 16, 2014 at 18:22
> To: Wendy Roome <w.roome@alcatel-lucent.com>
> Cc: "Y. Richard Yang" <yry@cs.yale.edu>, IETF ALTO <alto@ietf.org>
> Subject: Re: [alto] Incremental updates transport using SSE?
>
> Hi Wendy,
>
> If a client accidentally dropped the connection and hopes to re-connect
> and receive the merge-patch events, would it make sense for the server not
> to send the first full-map event? It will save quite some effort that way.
>
> Best,
> Xiao
>
>

--089e013d0890486be705059eed03
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Wendy,<div><br></div><div>I completely agree with you. =
I was thinking maybe there&#39;s some clever way of using the SSE event-id,=
 but the questionable saving is simply not worth the logging and synchroniz=
ation trouble.</div><div><br></div><div>1. One thing that follows this choi=
ce is to use one single SSE stream (open connection) for each resource. I b=
riefly considered having one open connection and send updates for all resou=
rces on the server via that stream. The advantage of having only one connec=
tion open is smaller overhead, and the disadvantage is that it would requir=
e a more complicated ID and version tagging in event name/id maybe. What do=
 you think?</div><div><br></div><div>2. If the mapping between SSE stream a=
nd underlying map is one-to-one, would it make sense for the resourceID of =
a stream to be the resourceID of the underlying map and &quot;.update&quot;=
 concatenated together? This way, when the client actually requests and ini=
tiates the stream, the client would be aware of the resourceID of the under=
lying map.</div><div><br></div><div>3. Following that, we should define id =
field in the events. Richard proposed using a tag as the id if it&#39;s a f=
ull network map, and newtag_oldtag if it&#39;s a patch. The vtag for networ=
k map is ResourceID+tag tuple, if the client knows about the resourceID, co=
uld we only use the tag? And should the cost maps simply use dependent-vtag=
s? Since the id field is a string, what format do we want the tags in? A fe=
w options are 1) json with all whitespaces removed; 2) an even more compact=
 patterned string.</div><div><br></div><div>e.g. for network map patch, it =
could be:</div><div>{&quot;old-tag&quot;:{&quot;resource-id&quot;:&quot;my-=
default-network-map&quot;,&quot;tag&quot;:&quot;3ee2cb7e8d63d9fab71b9b34cbf=
764436315542e&quot;},&quot;new-tag&quot;:{&quot;resource-id&quot;:&quot;my-=
default-network-map&quot;,&quot;tag&quot;:&quot;<span style=3D"color:rgb(0,=
0,0);font-size:1em">c0ce023b8678a7b9ec00324673b98e54656d1f6d</span>&quot;}}=
<br></div><div><br></div><div>or (since it must be the same resource):<br><=
/div><div>{&quot;resource-id&quot;:&quot;my-default-network-map&quot;,&quot=
;old-tag&quot;:&quot;3ee2cb7e8d63d9fab71b9b34cbf764436315542e&quot;,&quot;n=
ew-tag&quot;:&quot;<span style=3D"color:rgb(0,0,0);font-size:1em">c0ce023b8=
678a7b9ec00324673b98e54656d1f6d</span>&quot;}<br></div><div><br></div><div>=
or (if the client knows the resource-id for the underlying map of the strea=
m, just use a delimiter):</div><div>3ee2cb7e8d63d9fab71b9b34cbf764436315542=
e_<span style=3D"color:rgb(0,0,0);font-size:13px">c0ce023b8678a7b9ec0032467=
3b98e54656d1f6d</span><br></div><div><br></div><div>What do you think?</div=
><div><br></div><div>Best,</div><div>Xiao</div></div><div class=3D"gmail_ex=
tra"><br><div class=3D"gmail_quote">On Fri, Oct 17, 2014 at 9:21 AM, Wendy =
Roome <span dir=3D"ltr">&lt;<a href=3D"mailto:w.roome@alcatel-lucent.com" t=
arget=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;</span> wrote:<br><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc=
 solid;padding-left:1ex"><div style=3D"word-wrap:break-word;color:rgb(0,0,0=
);font-size:14px;font-family:Calibri,sans-serif"><div>Xiao,</div><div><br><=
/div><div>That is a very good point. I hoped someone would ask about that.<=
/div><div><br></div><div>It is a tradeoff. The disadvantage of requiring th=
e server to send full map(s) at the start of each stream is that if the con=
nection drops, we have to send the full map over again. But the advantage i=
s that incremental updates are only within the context of this particular s=
tream. We don&#39;t need keep track of where we were.</div><div><br></div><=
div>To see the issue, suppose we wanted to avoid re-sending the full map wh=
en the client reestablishes the connection. Then the server must assign a u=
nique id to every incremental update event. When the client reconnects, the=
 client gives the server the last known event id, and the server sends any =
events the client missed.</div><div><br></div><div>BTW, SSE does define eve=
nt ids. Each event has an id, and when connecting, the client gives a Last-=
Event-Id header with the last id it received (if any).</div><div><br></div>=
<div>So what is the problem with that? First, the server MUST assign a uniq=
ue id to every incremental update, and they must be the same for all client=
s. That is, if the server has several increment-update clients, the server =
must &quot;clock&quot; their update event streams at the same rate. Second,=
 the server must keep a buffer of old update events, in case a client needs=
 to reconnect. And third, because a reconnecting client may send an old (or=
 bogus) Last-Event-Id, the server may have send the full map(s) anyway.</di=
v><div><br></div><div>If we do not use event ids, then it is much simpler. =
Incremental updates are in the context of this stream. Period. No persisten=
t state that must survive the end of the connection. And if desired, the se=
rver can send updates are different rates to different clients.</div><div><=
br></div><div>So I think it boils down to how often we expect connections t=
o drop unintentionally. If that is common, then, yes, we need to define eve=
nt ids to avoid resending the full maps. But if we can assume accidental dr=
ops are rare, then I think it is simpler just to send the full map(s) for e=
very new connection.</div><div><br></div><div><span style=3D"white-space:pr=
e-wrap">	</span>- Wendy Roome</div><div><br></div><span><div style=3D"font-=
family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:med=
ium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDIN=
G-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-T=
OP:3pt"><span style=3D"font-weight:bold">From: </span> Xiao SHI &lt;<a href=
=3D"mailto:xiao.shi@yale.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt;<b=
r><span style=3D"font-weight:bold">Date: </span> Thu, October 16, 2014 at 1=
8:22<br><span style=3D"font-weight:bold">To: </span> Wendy Roome &lt;<a hre=
f=3D"mailto:w.roome@alcatel-lucent.com" target=3D"_blank">w.roome@alcatel-l=
ucent.com</a>&gt;<br><span style=3D"font-weight:bold">Cc: </span> &quot;Y. =
Richard Yang&quot; &lt;<a href=3D"mailto:yry@cs.yale.edu" target=3D"_blank"=
>yry@cs.yale.edu</a>&gt;, IETF ALTO &lt;<a href=3D"mailto:alto@ietf.org" ta=
rget=3D"_blank">alto@ietf.org</a>&gt;<span class=3D""><br><span style=3D"fo=
nt-weight:bold">Subject: </span> Re: [alto] Incremental updates transport u=
sing SSE?<br></span></div><span class=3D""><div><br></div><div dir=3D"ltr" =
style=3D"color:rgb(0,0,0);font-family:Calibri;font-size:medium;font-style:n=
ormal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-hei=
ght:normal;text-align:start;text-indent:0px;text-transform:none;white-space=
:normal;word-spacing:0px">Hi Wendy,<div><br></div><div>If a client accident=
ally dropped the connection and hopes to re-connect and receive the merge-p=
atch events, would it make sense for the server not to send the first full-=
map event? It will save quite some effort that way.</div><div><br></div><di=
v>Best,</div><div>Xiao</div></div><br></span></span></div>
</blockquote></div><br></div>

--089e013d0890486be705059eed03--


From nobody Fri Oct 17 10:36:01 2014
Return-Path: <w.roome@alcatel-lucent.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8BF521A0063 for <alto@ietfa.amsl.com>; Fri, 17 Oct 2014 10:35:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.602
X-Spam-Level: 
X-Spam-Status: No, score=-0.602 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, TRACKER_ID=1.306, T_RP_MATCHES_RCVD=-0.01] 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 kmm6N75Cm6PL for <alto@ietfa.amsl.com>; Fri, 17 Oct 2014 10:35:54 -0700 (PDT)
Received: from smtp-us.alcatel-lucent.com (us-hpswa-esg-02.alcatel-lucent.com [135.245.18.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0886B1A0039 for <alto@ietf.org>; Fri, 17 Oct 2014 10:35:53 -0700 (PDT)
Received: from us70tusmtp2.zam.alcatel-lucent.com (unknown [135.5.2.64]) by Websense Email Security Gateway with ESMTPS id 1D165E95AEC0E; Fri, 17 Oct 2014 17:35:50 +0000 (GMT)
Received: from usnavsmail2.ndc.alcatel-lucent.com (usnavsmail2.ndc.alcatel-lucent.com [135.3.39.10]) by us70tusmtp2.zam.alcatel-lucent.com (GMO) with ESMTP id s9HHZp9X006715 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 17 Oct 2014 13:35:52 -0400
Received: from umail.lucent.com (umail.ndc.lucent.com [135.3.40.61]) by usnavsmail2.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id s9HHZogi019229 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 17 Oct 2014 12:35:50 -0500
Received: from [135.222.152.71] (wdr-i7mbp2.mh.lucent.com [135.222.152.71]) by umail.lucent.com (8.13.8/TPES) with ESMTP id s9HHZjKA020060; Fri, 17 Oct 2014 12:35:46 -0500 (CDT)
User-Agent: Microsoft-MacOutlook/14.4.4.140807
Date: Fri, 17 Oct 2014 13:35:45 -0400
From: Wendy Roome <w.roome@alcatel-lucent.com>
To: Xiao SHI <xiao.shi@yale.edu>
Message-ID: <D066C5FC.188767%w.roome@alcatel-lucent.com>
Thread-Topic: [alto] Incremental updates transport using SSE?
References: <D0644784.180EE4%w.roome@alcatel-lucent.com> <CANUuoLoDnPx-V37==AXbMzuRPiYLXRz3CkMVpfSRfEMehg8S_g@mail.gmail.com> <D0653E13.181A19%w.roome@alcatel-lucent.com> <CAFwJzZn6hOzP-ef0Ji2vpnkTpU_wifZoKqxhpSo3pVzXB901LA@mail.gmail.com> <D06687CA.1854F3%w.roome@alcatel-lucent.com> <CAFwJzZm2GPCYbZDmtTyOBzuS6RFCxrSKZO4Vy9xR-usDtvWeFg@mail.gmail.com>
In-Reply-To: <CAFwJzZm2GPCYbZDmtTyOBzuS6RFCxrSKZO4Vy9xR-usDtvWeFg@mail.gmail.com>
Mime-version: 1.0
Content-type: multipart/alternative; boundary="B_3496397750_11246547"
X-Scanned-By: MIMEDefang 2.64 on 135.3.39.10
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/pPOqTbI_CMZbHpVwhaZo0xOWcD8
Cc: IETF ALTO <alto@ietf.org>
Subject: Re: [alto] Incremental updates transport using SSE?
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Oct 2014 17:35:59 -0000

> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--B_3496397750_11246547
Content-type: text/plain;
	charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

Xiao,

My first take was that update stream resources should be 1-1 with the
underlying full map resources. Then I realized that cost maps depend on
network maps, and clients & servers should coordinate changes to the two.
The easiest way to accomplish that was to use the same stream for both
network map and cost map updates, with the event type distinguishing networ=
k
map updates from cost map updates.

But your comment reminded me that network maps are 1-n with cost maps. Eg, =
a
network map can have two cost maps, one for routingcost and the other for
hopcount.

So I suggest that an update stream resource can provide updates for an
arbitrary set of resources. The server picks the set. Each update event has
a media-type (basically, full-map vs merge-patch), and the resource-id of
the map it updates. Because SSE only allows three fields (event, id and
data), I suggest we encode the media-type,resource-id pair in the event
type, as a JSON object with those field names, as in:

    event:=20
{"media-type":"application/alto-network-map+json","resource-id":"network-ma=
p
"}

Here=B9s a detailed example of an IRD with an update stream service that give=
s
updates for the network map and the associated routingcost and hopcount
maps. It offers merge-patch incremental updates for the cost maps, but only
full updates for network maps:

  "network-map": {...},
  "routingcost-map": {...},
  "hopcount-map": {...},
 =20
  "network-map-updates": {
    "uri": "http://somewhere.com/network-map-updates",
    "media-type": "text/event-stream",
    "uses": ["network-map", "routingcost-map", "hopcount-map"],
    "accepts": "application/alto-updatestreamfilter+json",
    "capabilities": {
      "events": [
        {"media-type": "application/alto-networkmap+json",
         "resource-id": "network-map"},
        {"media-type": "application/alto-costmap+json",
         "resource-id": "routingcost-map"},
        {"media-type": "application/merge-patch+json",
         "resource-id": "routingcost-map"},
        {"media-type": "application/alto-costmap+json",
         "resource-id": "hopcount-map"},
        {"media-type": "application/merge-patch+json",
         "resource-id": "hopcount-map"}
      ]
    }
  }

This is a POST request. The client sends
application/alto-updatestreamfilter+json data (a new MIME type) to select
the events it wishes to get. Here is how a client would request updates for
the network and routingcost maps, but not the hopcount map:

  POST /network-map-updates
  Host: somewhere.com
  Content-Length: ###
  Content-Type: application/alto-updatestreamfilter+json
  Accept: test/event-stream,application/alto-error+json
 =20
  {"events": [
     {"media-type": "application/alto-networkmap+json",
      "resource-id": "network-map"},
     {"media-type": "application/alto-costmap+json",
      "resource-id": "routingcost-map"},
     {"media-type": "application/merge-patch+json",
      "resource-id": "routingcost-map"}
  ]}

The server would respond with something like this.

  HTTP/1.1 200 OK
  Content-Type: text/event-stream
 =20
  : Full network map, sent immediately.
  event:=20
{"media-type":"application/alto-network-map+json","resource-id":"network-ma=
p
"}
  data: { ... full network map ... }

  : Full routingcost map, sent immediately.
  event:=20
{"media-type":"application/alto-costmap+json","resource-id":"routingcost-ma=
p
"}
  data: { ... full routingcost cost map ... }
    =20
  : Incremental routingcost map update, sent when enough costs have changed=
.
  event:=20
{"media-type":"application/merge-patch+json","resource-id":"routingcost-map=
"
}
  data: { ... merge-patch for routingcost cost map ... }

Note that this omits the ids. They aren't really necessary. But if the
underlying SSE library expects them, the server can always use sequence
numbers 1, 2, 3, etc.

How do people feel about this approach?

- Wendy Roome

From:  Xiao SHI <xiao.shi@yale.edu>
Date:  Fri, October 17, 2014 at 10:10
To:  Wendy Roome <w.roome@alcatel-lucent.com>
Cc:  Xiao SHI <xiao.shi@yale.edu>, "Y. Richard Yang" <yry@cs.yale.edu>, IET=
F
ALTO <alto@ietf.org>
Subject:  Re: [alto] Incremental updates transport using SSE?

Hi Wendy,

I completely agree with you. I was thinking maybe there's some clever way o=
f
using the SSE event-id, but the questionable saving is simply not worth the
logging and synchronization trouble.

1. One thing that follows this choice is to use one single SSE stream (open
connection) for each resource. I briefly considered having one open
connection and send updates for all resources on the server via that stream=
.
The advantage of having only one connection open is smaller overhead, and
the disadvantage is that it would require a more complicated ID and version
tagging in event name/id maybe. What do you think?

2. If the mapping between SSE stream and underlying map is one-to-one, woul=
d
it make sense for the resourceID of a stream to be the resourceID of the
underlying map and ".update" concatenated together? This way, when the
client actually requests and initiates the stream, the client would be awar=
e
of the resourceID of the underlying map.

3. Following that, we should define id field in the events. Richard propose=
d
using a tag as the id if it's a full network map, and newtag_oldtag if it's
a patch. The vtag for network map is ResourceID+tag tuple, if the client
knows about the resourceID, could we only use the tag? And should the cost
maps simply use dependent-vtags? Since the id field is a string, what forma=
t
do we want the tags in? A few options are 1) json with all whitespaces
removed; 2) an even more compact patterned string.

e.g. for network map patch, it could be:
{"old-tag":{"resource-id":"my-default-network-map","tag":"3ee2cb7e8d63d9fab=
7
1b9b34cbf764436315542e"},"new-tag":{"resource-id":"my-default-network-map",=
"
tag":"c0ce023b8678a7b9ec00324673b98e54656d1f6d"}}

or (since it must be the same resource):
{"resource-id":"my-default-network-map","old-tag":"3ee2cb7e8d63d9fab71b9b34=
c
bf764436315542e","new-tag":"c0ce023b8678a7b9ec00324673b98e54656d1f6d"}

or (if the client knows the resource-id for the underlying map of the
stream, just use a delimiter):
3ee2cb7e8d63d9fab71b9b34cbf764436315542e_c0ce023b8678a7b9ec00324673b98e5465=
6
d1f6d

What do you think?

Best,
Xiao

On Fri, Oct 17, 2014 at 9:21 AM, Wendy Roome <w.roome@alcatel-lucent.com>
wrote:
> Xiao,
>=20
> That is a very good point. I hoped someone would ask about that.
>=20
> It is a tradeoff. The disadvantage of requiring the server to send full m=
ap(s)
> at the start of each stream is that if the connection drops, we have to s=
end
> the full map over again. But the advantage is that incremental updates ar=
e
> only within the context of this particular stream. We don't need keep tra=
ck of
> where we were.
>=20
> To see the issue, suppose we wanted to avoid re-sending the full map when=
 the
> client reestablishes the connection. Then the server must assign a unique=
 id
> to every incremental update event. When the client reconnects, the client
> gives the server the last known event id, and the server sends any events=
 the
> client missed.
>=20
> BTW, SSE does define event ids. Each event has an id, and when connecting=
, the
> client gives a Last-Event-Id header with the last id it received (if any)=
.
>=20
> So what is the problem with that? First, the server MUST assign a unique =
id to
> every incremental update, and they must be the same for all clients. That=
 is,
> if the server has several increment-update clients, the server must "cloc=
k"
> their update event streams at the same rate. Second, the server must keep=
 a
> buffer of old update events, in case a client needs to reconnect. And thi=
rd,
> because a reconnecting client may send an old (or bogus) Last-Event-Id, t=
he
> server may have send the full map(s) anyway.
>=20
> If we do not use event ids, then it is much simpler. Incremental updates =
are
> in the context of this stream. Period. No persistent state that must surv=
ive
> the end of the connection. And if desired, the server can send updates ar=
e
> different rates to different clients.
>=20
> So I think it boils down to how often we expect connections to drop
> unintentionally. If that is common, then, yes, we need to define event id=
s to
> avoid resending the full maps. But if we can assume accidental drops are =
rare,
> then I think it is simpler just to send the full map(s) for every new
> connection.
>=20
> - Wendy Roome
>=20
> From:  Xiao SHI <xiao.shi@yale.edu>
> Date:  Thu, October 16, 2014 at 18:22
> To:  Wendy Roome <w.roome@alcatel-lucent.com>
> Cc:  "Y. Richard Yang" <yry@cs.yale.edu>, IETF ALTO <alto@ietf.org>
> Subject:  Re: [alto] Incremental updates transport using SSE?
>=20
> Hi Wendy,
>=20
> If a client accidentally dropped the connection and hopes to re-connect a=
nd
> receive the merge-patch events, would it make sense for the server not to=
 send
> the first full-map event? It will save quite some effort that way.
>=20
> Best,
> Xiao
>=20




--B_3496397750_11246547
Content-type: text/html;
	charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

<html><head></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size:=
 14px; font-family: Calibri, sans-serif;"><div>Xiao,</div><div><br></div><di=
v>My first take was that update stream resources should be 1-1 with the unde=
rlying full map resources. Then I realized that cost maps depend on network =
maps, and clients &amp; servers should coordinate changes to the two. The ea=
siest way to accomplish that was to use the same stream for both network map=
 and cost map updates, with the event type distinguishing network map update=
s from cost map updates.</div><div><br></div><div>But your comment reminded =
me that network maps are 1-n with cost maps. Eg, a network map can have two =
cost maps, one for routingcost and the other for hopcount.</div><div><br></d=
iv><div>So I suggest that an update stream resource can provide updates for =
an arbitrary set of resources. The server picks the set. Each update event h=
as a media-type (basically, full-map vs merge-patch), and the resource-id of=
 the map it updates. Because SSE only allows three fields (event, id and dat=
a), I suggest we encode the media-type,resource-id pair in the event type, a=
s a JSON object with those field names, as in:</div><div><br></div><div>&nbs=
p; &nbsp; event: {"media-type":"application/alto-network-map+json","resource=
-id":"network-map"}</div><div><br></div><div>Here&#8217;s a detailed example=
 of an IRD with an update stream service that gives updates for the network =
map and the associated routingcost and hopcount maps. It offers merge-patch =
incremental updates for the cost maps, but only full updates for network map=
s:</div><div><br></div><div><div>&nbsp; "network-map": {...},</div><div>&nbs=
p; "routingcost-map": {...},</div><div>&nbsp; "hopcount-map": {...},</div><d=
iv>&nbsp;&nbsp;</div><div>&nbsp; "network-map-updates": {</div><div>&nbsp; &=
nbsp; "uri": "http://somewhere.com/network-map-updates",</div><div>&nbsp; &n=
bsp; "media-type": "text/event-stream",</div><div>&nbsp; &nbsp; "uses": ["ne=
twork-map", "routingcost-map", "hopcount-map"],</div><div>&nbsp; &nbsp; "acc=
epts": "application/alto-updatestreamfilter+json",</div><div>&nbsp; &nbsp; "=
capabilities": {</div><div>&nbsp; &nbsp; &nbsp; "events": [</div><div>&nbsp;=
 &nbsp; &nbsp; &nbsp; {"media-type": "application/alto-networkmap+json",</di=
v><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"resource-id": "network-map"},</div=
><div>&nbsp; &nbsp; &nbsp; &nbsp; {"media-type": "application/alto-costmap+j=
son",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"resource-id": "routingcos=
t-map"},</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {"media-type": "application/m=
erge-patch+json",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"resource-id":=
 "routingcost-map"},</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {"media-type": "a=
pplication/alto-costmap+json",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"=
resource-id": "hopcount-map"},</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {"media=
-type": "application/merge-patch+json",</div><div>&nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp;"resource-id": "hopcount-map"}</div><div>&nbsp; &nbsp; &nbsp; ]</div=
><div>&nbsp; &nbsp; }</div><div>&nbsp; }</div></div><div><br></div><div>This=
 is a POST request. The client sends application/alto-updatestreamfilter+jso=
n data (a new MIME type) to select the events it wishes to get. Here is how =
a client would request updates for the network and routingcost maps, but not=
 the hopcount map:</div><div><br></div><div><div>&nbsp; POST /network-map-up=
dates</div><div>&nbsp; Host: somewhere.com</div><div>&nbsp; Content-Length: =
###</div><div>&nbsp; Content-Type: application/alto-updatestreamfilter+json<=
/div><div>&nbsp; Accept: test/event-stream,application/alto-error+json</div>=
<div>&nbsp;&nbsp;</div><div>&nbsp; {"events": [</div><div>&nbsp; &nbsp; &nbs=
p;{"media-type": "application/alto-networkmap+json",</div><div>&nbsp; &nbsp;=
 &nbsp; "resource-id": "network-map"},</div><div>&nbsp; &nbsp; &nbsp;{"media=
-type": "application/alto-costmap+json",</div><div>&nbsp; &nbsp; &nbsp; "res=
ource-id": "routingcost-map"},</div><div>&nbsp; &nbsp; &nbsp;{"media-type": =
"application/merge-patch+json",</div><div>&nbsp; &nbsp; &nbsp; "resource-id"=
: "routingcost-map"}</div><div>&nbsp; ]}</div></div><div><br></div><div>The =
server would respond with something like this.</div><div><br></div><div><div=
>&nbsp; HTTP/1.1 200 OK</div><div>&nbsp; Content-Type: text/event-stream</di=
v><div>&nbsp;&nbsp;</div><div>&nbsp; : Full network map, sent immediately.</=
div><div>&nbsp; event: {"media-type":"application/alto-network-map+json","re=
source-id":"network-map"}</div><div>&nbsp; data: { ... full network map ... =
}</div><div><br></div><div>&nbsp; : Full routingcost map, sent immediately. =
&nbsp;</div><div>&nbsp; event: {"media-type":"application/alto-costmap+json"=
,"resource-id":"routingcost-map"}</div><div>&nbsp; data: { ... full routingc=
ost cost map ... }</div><div>&nbsp; &nbsp; &nbsp;</div><div>&nbsp; : Increme=
ntal routingcost map update, sent when enough costs have changed. &nbsp;</di=
v><div>&nbsp; event: {"media-type":"application/merge-patch+json","resource-=
id":"routingcost-map"}</div><div>&nbsp; data: { ... merge-patch for routingc=
ost cost map ... }</div></div><div><br></div><div>Note that this omits the i=
ds. They aren't really necessary. But if the underlying SSE library expects =
them, the server can always use sequence numbers 1, 2, 3, etc.</div><div><br=
></div><div>How do people feel about this approach?</div><div><br></div><div=
><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>- Wendy Roome<=
/div><div><br></div><span id=3D"OLK_SRC_BODY_SECTION"><div style=3D"font-family:=
Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium=
 none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PAD=
DING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; P=
ADDING-TOP: 3pt"><span style=3D"font-weight:bold">From: </span> Xiao SHI &lt;<=
a href=3D"mailto:xiao.shi@yale.edu">xiao.shi@yale.edu</a>&gt;<br><span style=3D"=
font-weight:bold">Date: </span> Fri, October 17, 2014 at 10:10<br><span styl=
e=3D"font-weight:bold">To: </span> Wendy Roome &lt;<a href=3D"mailto:w.roome@alc=
atel-lucent.com">w.roome@alcatel-lucent.com</a>&gt;<br><span style=3D"font-wei=
ght:bold">Cc: </span> Xiao SHI &lt;<a href=3D"mailto:xiao.shi@yale.edu">xiao.s=
hi@yale.edu</a>&gt;, "Y. Richard Yang" &lt;<a href=3D"mailto:yry@cs.yale.edu">=
yry@cs.yale.edu</a>&gt;, IETF ALTO &lt;<a href=3D"mailto:alto@ietf.org">alto@i=
etf.org</a>&gt;<br><span style=3D"font-weight:bold">Subject: </span> Re: [alto=
] Incremental updates transport using SSE?<br></div><div><br></div><div dir=3D=
"ltr">Hi Wendy,<div><br></div><div>I completely agree with you. I was thinki=
ng maybe there's some clever way of using the SSE event-id, but the question=
able saving is simply not worth the logging and synchronization trouble.</di=
v><div><br></div><div>1. One thing that follows this choice is to use one si=
ngle SSE stream (open connection) for each resource. I briefly considered ha=
ving one open connection and send updates for all resources on the server vi=
a that stream. The advantage of having only one connection open is smaller o=
verhead, and the disadvantage is that it would require a more complicated ID=
 and version tagging in event name/id maybe. What do you think?</div><div><b=
r></div><div>2. If the mapping between SSE stream and underlying map is one-=
to-one, would it make sense for the resourceID of a stream to be the resourc=
eID of the underlying map and ".update" concatenated together? This way, whe=
n the client actually requests and initiates the stream, the client would be=
 aware of the resourceID of the underlying map.</div><div><br></div><div>3. =
Following that, we should define id field in the events. Richard proposed us=
ing a tag as the id if it's a full network map, and newtag_oldtag if it's a =
patch. The vtag for network map is ResourceID+tag tuple, if the client knows=
 about the resourceID, could we only use the tag? And should the cost maps s=
imply use dependent-vtags? Since the id field is a string, what format do we=
 want the tags in? A few options are 1) json with all whitespaces removed; 2=
) an even more compact patterned string.</div><div><br></div><div>e.g. for n=
etwork map patch, it could be:</div><div>{"old-tag":{"resource-id":"my-defau=
lt-network-map","tag":"3ee2cb7e8d63d9fab71b9b34cbf764436315542e"},"new-tag":=
{"resource-id":"my-default-network-map","tag":"<span style=3D"color:rgb(0,0,0)=
;font-size:1em">c0ce023b8678a7b9ec00324673b98e54656d1f6d</span>"}}<br></div>=
<div><br></div><div>or (since it must be the same resource):<br></div><div>{=
"resource-id":"my-default-network-map","old-tag":"3ee2cb7e8d63d9fab71b9b34cb=
f764436315542e","new-tag":"<span style=3D"color:rgb(0,0,0);font-size:1em">c0ce=
023b8678a7b9ec00324673b98e54656d1f6d</span>"}<br></div><div><br></div><div>o=
r (if the client knows the resource-id for the underlying map of the stream,=
 just use a delimiter):</div><div>3ee2cb7e8d63d9fab71b9b34cbf764436315542e_<=
span style=3D"color:rgb(0,0,0);font-size:13px">c0ce023b8678a7b9ec00324673b98e5=
4656d1f6d</span><br></div><div><br></div><div>What do you think?</div><div><=
br></div><div>Best,</div><div>Xiao</div></div><div class=3D"gmail_extra"><br><=
div class=3D"gmail_quote">On Fri, Oct 17, 2014 at 9:21 AM, Wendy Roome <span d=
ir=3D"ltr">&lt;<a href=3D"mailto:w.roome@alcatel-lucent.com" target=3D"_blank">w.r=
oome@alcatel-lucent.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><=
div style=3D"word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:=
Calibri,sans-serif"><div>Xiao,</div><div><br></div><div>That is a very good =
point. I hoped someone would ask about that.</div><div><br></div><div>It is =
a tradeoff. The disadvantage of requiring the server to send full map(s) at =
the start of each stream is that if the connection drops, we have to send th=
e full map over again. But the advantage is that incremental updates are onl=
y within the context of this particular stream. We don't need keep track of =
where we were.</div><div><br></div><div>To see the issue, suppose we wanted =
to avoid re-sending the full map when the client reestablishes the connectio=
n. Then the server must assign a unique id to every incremental update event=
. When the client reconnects, the client gives the server the last known eve=
nt id, and the server sends any events the client missed.</div><div><br></di=
v><div>BTW, SSE does define event ids. Each event has an id, and when connec=
ting, the client gives a Last-Event-Id header with the last id it received (=
if any).</div><div><br></div><div>So what is the problem with that? First, t=
he server MUST assign a unique id to every incremental update, and they must=
 be the same for all clients. That is, if the server has several increment-u=
pdate clients, the server must "clock" their update event streams at the sam=
e rate. Second, the server must keep a buffer of old update events, in case =
a client needs to reconnect. And third, because a reconnecting client may se=
nd an old (or bogus) Last-Event-Id, the server may have send the full map(s)=
 anyway.</div><div><br></div><div>If we do not use event ids, then it is muc=
h simpler. Incremental updates are in the context of this stream. Period. No=
 persistent state that must survive the end of the connection. And if desire=
d, the server can send updates are different rates to different clients.</di=
v><div><br></div><div>So I think it boils down to how often we expect connec=
tions to drop unintentionally. If that is common, then, yes, we need to defi=
ne event ids to avoid resending the full maps. But if we can assume accident=
al drops are rare, then I think it is simpler just to send the full map(s) f=
or every new connection.</div><div><br></div><div><span style=3D"white-space:p=
re-wrap">	</span>- Wendy Roome</div><div><br></div><span><div style=3D"font-fa=
mily:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:medium=
 none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RI=
GHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3p=
t"><span style=3D"font-weight:bold">From: </span> Xiao SHI &lt;<a href=3D"mailto=
:xiao.shi@yale.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt;<br><span style=
=3D"font-weight:bold">Date: </span> Thu, October 16, 2014 at 18:22<br><span st=
yle=3D"font-weight:bold">To: </span> Wendy Roome &lt;<a href=3D"mailto:w.roome@a=
lcatel-lucent.com" target=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;<br><sp=
an style=3D"font-weight:bold">Cc: </span> "Y. Richard Yang" &lt;<a href=3D"mailt=
o:yry@cs.yale.edu" target=3D"_blank">yry@cs.yale.edu</a>&gt;, IETF ALTO &lt;<a=
 href=3D"mailto:alto@ietf.org" target=3D"_blank">alto@ietf.org</a>&gt;<span clas=
s=3D""><br><span style=3D"font-weight:bold">Subject: </span> Re: [alto] Incremen=
tal updates transport using SSE?<br></span></div><span class=3D""><div><br></d=
iv><div dir=3D"ltr" style=3D"color:rgb(0,0,0);font-family:Calibri;font-size:medi=
um;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:n=
ormal;line-height:normal;text-align:start;text-indent:0px;text-transform:non=
e;white-space:normal;word-spacing:0px">Hi Wendy,<div><br></div><div>If a cli=
ent accidentally dropped the connection and hopes to re-connect and receive =
the merge-patch events, would it make sense for the server not to send the f=
irst full-map event? It will save quite some effort that way.</div><div><br>=
</div><div>Best,</div><div>Xiao</div></div><br></span></span></div></blockqu=
ote></div><br></div></span></body></html>

--B_3496397750_11246547--



From nobody Fri Oct 17 17:14:20 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5F48F1A8822 for <alto@ietfa.amsl.com>; Fri, 17 Oct 2014 17:14:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.071
X-Spam-Level: 
X-Spam-Status: No, score=-0.071 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001, TRACKER_ID=1.306] 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 L1XJaGneBrIZ for <alto@ietfa.amsl.com>; Fri, 17 Oct 2014 17:14:15 -0700 (PDT)
Received: from mail-yh0-x229.google.com (mail-yh0-x229.google.com [IPv6:2607:f8b0:4002:c01::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E31AC1A883B for <alto@ietf.org>; Fri, 17 Oct 2014 17:14:14 -0700 (PDT)
Received: by mail-yh0-f41.google.com with SMTP id i57so819689yha.14 for <alto@ietf.org>; Fri, 17 Oct 2014 17:14:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=dEnYT6uJSCZQAecc5BveCJ/taqt+9n9ke3F01LdWjSw=; b=iKTj2qU++fLEdeCahvpicnXIQOkLmKRwZJ9RG8uHj+VHlwzAEfL2CvO/GDGIJefWNW VBTyQHArCvOR54pBtV0a5gmyAsFvyf7NUsG6B3J8yU5uKehbY599DhcuOkBAWj+4PXUJ kMizH9srblmOanhCZirNWk47sb7O6eEeoNH9X3pA7ReOLnR6aIwrKUx0KYIvjvGVzD68 OwsQEIiKDp2KB0s5FEEZWPK+Mhtz63GWrNC0UVPWYTosmr6YOA9ZxgLCT9gW1roMhGYO 5+P5vZ5BGPpxkeabXa6Cb58IQ3twb5C+4TUrJ+Tfr9YbQ1HN6mlQiWkRGMdNrhquowMb 6B8w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=dEnYT6uJSCZQAecc5BveCJ/taqt+9n9ke3F01LdWjSw=; b=jbS4fhQavgEhDihtjKQwCkB7NG+xmKot/JjQ0tSDRtmQ0O6pP3QKW1wB7z4KSlrI8/ 1JUTOp1qzn9GL0ilksGy/FeGZ7c3nx1bCAzCJtA+3ruYWucqX7UGvM3o+VazQuuMpR+5 CskY5+tJAB/U81k2AeuzsG1Yfme/rVc+fPawk=
X-Received: by 10.236.98.172 with SMTP id v32mr15065338yhf.77.1413591254229; Fri, 17 Oct 2014 17:14:14 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.97.10 with HTTP; Fri, 17 Oct 2014 17:13:53 -0700 (PDT)
In-Reply-To: <D066C5FC.188767%w.roome@alcatel-lucent.com>
References: <D0644784.180EE4%w.roome@alcatel-lucent.com> <CANUuoLoDnPx-V37==AXbMzuRPiYLXRz3CkMVpfSRfEMehg8S_g@mail.gmail.com> <D0653E13.181A19%w.roome@alcatel-lucent.com> <CAFwJzZn6hOzP-ef0Ji2vpnkTpU_wifZoKqxhpSo3pVzXB901LA@mail.gmail.com> <D06687CA.1854F3%w.roome@alcatel-lucent.com> <CAFwJzZm2GPCYbZDmtTyOBzuS6RFCxrSKZO4Vy9xR-usDtvWeFg@mail.gmail.com> <D066C5FC.188767%w.roome@alcatel-lucent.com>
From: Xiao SHI <xiao.shi@yale.edu>
Date: Fri, 17 Oct 2014 20:13:53 -0400
X-Google-Sender-Auth: gGnwyyYoiXwLFIzoH2Hs905hTjI
Message-ID: <CAFwJzZkMim8S6u_24oyns_x8_hnU1sXhajcj-CNQgToBHHjARw@mail.gmail.com>
To: Wendy Roome <w.roome@alcatel-lucent.com>
Content-Type: multipart/alternative; boundary=001a11c2523290e8400505a75c18
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/RTGyhdZaiPITKWDasF26-Ka1OyI
Cc: Xiao SHI <xiao.shi@yale.edu>, IETF ALTO <alto@ietf.org>
Subject: Re: [alto] Incremental updates transport using SSE?
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 18 Oct 2014 00:14:19 -0000

--001a11c2523290e8400505a75c18
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi Wendy,

I think this is a very good and efficient design. Just a few comments:

1. In the event field of the SSE, you included the resource-id but not the
tag along with it. I agree that the tag seems unnecessary because each
event is essentially an update of the map, and should be assigned a new tag
if the update were not incremental. However, consider the following
scenario: if, for whatever reason, the client only subscribed to the
network map incr updates (or the server only provided the network map
stream), and the client is requesting cost maps from the server via regular
mechanism (i.e. always getting a full new map which contains the
dependent-vtag), could there be issues when the version of the network map
is not synchronized with the dependent vtag that the client is about to
use? For example, if I got the cost map which depends on the network map a
few incremental updates ago, but I have already processed those updates,
there could potentially be PID mismatches and what not, right?

Shall we simply go ahead and add the tag into the event field? As for cost
maps, that would be the dependent-vtag. We can also put it in the id field.

2. In the IRD, would it make sense to include the incremental update uri in
the entries for regular resources? For example, a client would probably
find it useful to know that the server is providing
"my-default-network-map," and its incr update stream can be found in "
http://example.com/network-map-updates."

So the IRD would look like this:
  "network-map": {
    ...,
    "update-uri":"http://somewhere.com/network-map-updates"
  },
  "routingcost-map": {
    ...,
    "update-uri":"http://somewhere.com/network-map-updates"
  },
  "hopcount-map": {
    ...,
    "update-uri":"http://somewhere.com/network-map-updates"
  },

  "network-map-updates": {
    "uri": "http://somewhere.com/network-map-updates",
    "media-type": "text/event-stream",
    "uses": ["network-map", "routingcost-map", "hopcount-map"],
    "accepts": "application/alto-updatestreamfilter+json",
    "capabilities": {
      "events": [
        {"media-type": "application/alto-networkmap+json",
         "resource-id": "network-map"},
        {"media-type": "application/alto-costmap+json",
         "resource-id": "routingcost-map"},
        {"media-type": "application/merge-patch+json",
         "resource-id": "routingcost-map"},
        {"media-type": "application/alto-costmap+json",
         "resource-id": "hopcount-map"},
        {"media-type": "application/merge-patch+json",
         "resource-id": "hopcount-map"}
      ]
    }
  }

This saves the trouble for the client to search through the "uses" field in
each stream resource; Also, when there are multiple streams for incremental
updates for one map (e.g. one stream for networkmap A + costmap B, one
stream for networkmap A + costmap C and D), the server could load-balance
by providing the default update-uri for networkmap A in its IRD entry.

3. To reduce overall traffic, I assume for one particular event stream, the
event filtering would be done on the server side, right?

What do you think?

Cheers,
Xiao

On Fri, Oct 17, 2014 at 1:35 PM, Wendy Roome <w.roome@alcatel-lucent.com>
wrote:

> Xiao,
>
> My first take was that update stream resources should be 1-1 with the
> underlying full map resources. Then I realized that cost maps depend on
> network maps, and clients & servers should coordinate changes to the two.
> The easiest way to accomplish that was to use the same stream for both
> network map and cost map updates, with the event type distinguishing
> network map updates from cost map updates.
>
> But your comment reminded me that network maps are 1-n with cost maps. Eg=
,
> a network map can have two cost maps, one for routingcost and the other f=
or
> hopcount.
>
> So I suggest that an update stream resource can provide updates for an
> arbitrary set of resources. The server picks the set. Each update event h=
as
> a media-type (basically, full-map vs merge-patch), and the resource-id of
> the map it updates. Because SSE only allows three fields (event, id and
> data), I suggest we encode the media-type,resource-id pair in the event
> type, as a JSON object with those field names, as in:
>
>     event:
> {"media-type":"application/alto-network-map+json","resource-id":"network-=
map"}
>
> Here=E2=80=99s a detailed example of an IRD with an update stream service=
 that
> gives updates for the network map and the associated routingcost and
> hopcount maps. It offers merge-patch incremental updates for the cost map=
s,
> but only full updates for network maps:
>
>   "network-map": {...},
>   "routingcost-map": {...},
>   "hopcount-map": {...},
>
>   "network-map-updates": {
>     "uri": "http://somewhere.com/network-map-updates",
>     "media-type": "text/event-stream",
>     "uses": ["network-map", "routingcost-map", "hopcount-map"],
>     "accepts": "application/alto-updatestreamfilter+json",
>     "capabilities": {
>       "events": [
>         {"media-type": "application/alto-networkmap+json",
>          "resource-id": "network-map"},
>         {"media-type": "application/alto-costmap+json",
>          "resource-id": "routingcost-map"},
>         {"media-type": "application/merge-patch+json",
>          "resource-id": "routingcost-map"},
>         {"media-type": "application/alto-costmap+json",
>          "resource-id": "hopcount-map"},
>         {"media-type": "application/merge-patch+json",
>          "resource-id": "hopcount-map"}
>       ]
>     }
>   }
>
> This is a POST request. The client sends
> application/alto-updatestreamfilter+json data (a new MIME type) to select
> the events it wishes to get. Here is how a client would request updates f=
or
> the network and routingcost maps, but not the hopcount map:
>
>   POST /network-map-updates
>   Host: somewhere.com
>   Content-Length: ###
>   Content-Type: application/alto-updatestreamfilter+json
>   Accept: test/event-stream,application/alto-error+json
>
>   {"events": [
>      {"media-type": "application/alto-networkmap+json",
>       "resource-id": "network-map"},
>      {"media-type": "application/alto-costmap+json",
>       "resource-id": "routingcost-map"},
>      {"media-type": "application/merge-patch+json",
>       "resource-id": "routingcost-map"}
>   ]}
>
> The server would respond with something like this.
>
>   HTTP/1.1 200 OK
>   Content-Type: text/event-stream
>
>   : Full network map, sent immediately.
>   event:
> {"media-type":"application/alto-network-map+json","resource-id":"network-=
map"}
>   data: { ... full network map ... }
>
>   : Full routingcost map, sent immediately.
>   event:
> {"media-type":"application/alto-costmap+json","resource-id":"routingcost-=
map"}
>   data: { ... full routingcost cost map ... }
>
>   : Incremental routingcost map update, sent when enough costs have
> changed.
>   event:
> {"media-type":"application/merge-patch+json","resource-id":"routingcost-m=
ap"}
>   data: { ... merge-patch for routingcost cost map ... }
>
> Note that this omits the ids. They aren't really necessary. But if the
> underlying SSE library expects them, the server can always use sequence
> numbers 1, 2, 3, etc.
>
> How do people feel about this approach?
>
> - Wendy Roome
>
> From: Xiao SHI <xiao.shi@yale.edu>
> Date: Fri, October 17, 2014 at 10:10
> To: Wendy Roome <w.roome@alcatel-lucent.com>
> Cc: Xiao SHI <xiao.shi@yale.edu>, "Y. Richard Yang" <yry@cs.yale.edu>,
> IETF ALTO <alto@ietf.org>
>
> Subject: Re: [alto] Incremental updates transport using SSE?
>
> Hi Wendy,
>
> I completely agree with you. I was thinking maybe there's some clever way
> of using the SSE event-id, but the questionable saving is simply not wort=
h
> the logging and synchronization trouble.
>
> 1. One thing that follows this choice is to use one single SSE stream
> (open connection) for each resource. I briefly considered having one open
> connection and send updates for all resources on the server via that
> stream. The advantage of having only one connection open is smaller
> overhead, and the disadvantage is that it would require a more complicate=
d
> ID and version tagging in event name/id maybe. What do you think?
>
> 2. If the mapping between SSE stream and underlying map is one-to-one,
> would it make sense for the resourceID of a stream to be the resourceID o=
f
> the underlying map and ".update" concatenated together? This way, when th=
e
> client actually requests and initiates the stream, the client would be
> aware of the resourceID of the underlying map.
>
> 3. Following that, we should define id field in the events. Richard
> proposed using a tag as the id if it's a full network map, and
> newtag_oldtag if it's a patch. The vtag for network map is ResourceID+tag
> tuple, if the client knows about the resourceID, could we only use the ta=
g?
> And should the cost maps simply use dependent-vtags? Since the id field i=
s
> a string, what format do we want the tags in? A few options are 1) json
> with all whitespaces removed; 2) an even more compact patterned string.
>
> e.g. for network map patch, it could be:
>
> {"old-tag":{"resource-id":"my-default-network-map","tag":"3ee2cb7e8d63d9f=
ab71b9b34cbf764436315542e"},"new-tag":{"resource-id":"my-default-network-ma=
p","tag":"
> c0ce023b8678a7b9ec00324673b98e54656d1f6d"}}
>
> or (since it must be the same resource):
>
> {"resource-id":"my-default-network-map","old-tag":"3ee2cb7e8d63d9fab71b9b=
34cbf764436315542e","new-tag":"
> c0ce023b8678a7b9ec00324673b98e54656d1f6d"}
>
> or (if the client knows the resource-id for the underlying map of the
> stream, just use a delimiter):
> 3ee2cb7e8d63d9fab71b9b34cbf764436315542e_
> c0ce023b8678a7b9ec00324673b98e54656d1f6d
>
> What do you think?
>
> Best,
> Xiao
>
> On Fri, Oct 17, 2014 at 9:21 AM, Wendy Roome <w.roome@alcatel-lucent.com>
> wrote:
>
>> Xiao,
>>
>> That is a very good point. I hoped someone would ask about that.
>>
>> It is a tradeoff. The disadvantage of requiring the server to send full
>> map(s) at the start of each stream is that if the connection drops, we h=
ave
>> to send the full map over again. But the advantage is that incremental
>> updates are only within the context of this particular stream. We don't
>> need keep track of where we were.
>>
>> To see the issue, suppose we wanted to avoid re-sending the full map whe=
n
>> the client reestablishes the connection. Then the server must assign a
>> unique id to every incremental update event. When the client reconnects,
>> the client gives the server the last known event id, and the server send=
s
>> any events the client missed.
>>
>> BTW, SSE does define event ids. Each event has an id, and when
>> connecting, the client gives a Last-Event-Id header with the last id it
>> received (if any).
>>
>> So what is the problem with that? First, the server MUST assign a unique
>> id to every incremental update, and they must be the same for all client=
s.
>> That is, if the server has several increment-update clients, the server
>> must "clock" their update event streams at the same rate. Second, the
>> server must keep a buffer of old update events, in case a client needs t=
o
>> reconnect. And third, because a reconnecting client may send an old (or
>> bogus) Last-Event-Id, the server may have send the full map(s) anyway.
>>
>> If we do not use event ids, then it is much simpler. Incremental updates
>> are in the context of this stream. Period. No persistent state that must
>> survive the end of the connection. And if desired, the server can send
>> updates are different rates to different clients.
>>
>> So I think it boils down to how often we expect connections to drop
>> unintentionally. If that is common, then, yes, we need to define event i=
ds
>> to avoid resending the full maps. But if we can assume accidental drops =
are
>> rare, then I think it is simpler just to send the full map(s) for every =
new
>> connection.
>>
>> - Wendy Roome
>>
>> From: Xiao SHI <xiao.shi@yale.edu>
>> Date: Thu, October 16, 2014 at 18:22
>> To: Wendy Roome <w.roome@alcatel-lucent.com>
>> Cc: "Y. Richard Yang" <yry@cs.yale.edu>, IETF ALTO <alto@ietf.org>
>> Subject: Re: [alto] Incremental updates transport using SSE?
>>
>> Hi Wendy,
>>
>> If a client accidentally dropped the connection and hopes to re-connect
>> and receive the merge-patch events, would it make sense for the server n=
ot
>> to send the first full-map event? It will save quite some effort that wa=
y.
>>
>> Best,
>> Xiao
>>
>>
>

--001a11c2523290e8400505a75c18
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Wendy,<div><br></div><div>I think this is a very good a=
nd efficient design. Just a few comments:</div><div><br></div><div>1. In th=
e event field of the SSE, you included the resource-id but not the tag alon=
g with it. I agree that the tag seems unnecessary because each event is ess=
entially an update of the map, and should be assigned a new tag if the upda=
te were not incremental. However, consider the following scenario: if, for =
whatever reason, the client only subscribed to the network map incr updates=
 (or the server only provided the network map stream), and the client is re=
questing cost maps from the server via regular mechanism (i.e. always getti=
ng a full new map which contains the dependent-vtag), could there be issues=
 when the version of the network map is not synchronized with the dependent=
 vtag that the client is about to use? For example, if I got the cost map w=
hich depends on the network map a few incremental updates ago, but I have a=
lready processed those updates, there could potentially be PID mismatches a=
nd what not, right?</div><div><br></div><div>Shall we simply go ahead and a=
dd the tag into the event field? As for cost maps, that would be the depend=
ent-vtag. We can also put it in the id field.</div><div><br></div><div>2. I=
n the IRD, would it make sense to include the incremental update uri in the=
 entries for regular resources? For example, a client would probably find i=
t useful to know that the server is providing &quot;my-default-network-map,=
&quot; and its incr update stream can be found in &quot;<a href=3D"http://e=
xample.com/network-map-updates">http://example.com/network-map-updates</a>.=
&quot;</div><div><br></div><div>So the IRD would look like this:</div><div>=
<div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14p=
x">=C2=A0 &quot;network-map&quot;: {</div><div style=3D"color:rgb(0,0,0);fo=
nt-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 ...,</div><div s=
tyle=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=
=A0 =C2=A0 &quot;update-uri&quot;:&quot;<a href=3D"http://somewhere.com/net=
work-map-updates" target=3D"_blank">http://somewhere.com/network-map-update=
s</a>&quot;</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-se=
rif;font-size:14px">=C2=A0 },</div><div style=3D"color:rgb(0,0,0);font-fami=
ly:Calibri,sans-serif;font-size:14px">=C2=A0 &quot;routingcost-map&quot;:=
=C2=A0{</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;=
font-size:14px">=C2=A0 =C2=A0 ...,</div><div style=3D"color:rgb(0,0,0);font=
-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 &quot;update-uri&q=
uot;:&quot;<a href=3D"http://somewhere.com/network-map-updates" target=3D"_=
blank">http://somewhere.com/network-map-updates</a>&quot;</div><div style=
=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=A0 =
},</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-=
size:14px">=C2=A0 &quot;hopcount-map&quot;: {</div><div style=3D"color:rgb(=
0,0,0);font-family:Calibri,sans-serif;font-size:14px"><div>=C2=A0 =C2=A0 ..=
.,</div><div>=C2=A0 =C2=A0 &quot;update-uri&quot;:&quot;<a href=3D"http://s=
omewhere.com/network-map-updates" target=3D"_blank">http://somewhere.com/ne=
twork-map-updates</a>&quot;</div><div>=C2=A0 },</div></div><div style=3D"co=
lor:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=A0=C2=A0<=
/div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-siz=
e:14px">=C2=A0 &quot;network-map-updates&quot;: {</div><div style=3D"color:=
rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 &qu=
ot;uri&quot;: &quot;<a href=3D"http://somewhere.com/network-map-updates" ta=
rget=3D"_blank">http://somewhere.com/network-map-updates</a>&quot;,</div><d=
iv style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"=
>=C2=A0 =C2=A0 &quot;media-type&quot;: &quot;text/event-stream&quot;,</div>=
<div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14p=
x">=C2=A0 =C2=A0 &quot;uses&quot;: [&quot;network-map&quot;, &quot;routingc=
ost-map&quot;, &quot;hopcount-map&quot;],</div><div style=3D"color:rgb(0,0,=
0);font-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 &quot;accep=
ts&quot;: &quot;application/alto-updatestreamfilter+json&quot;,</div><div s=
tyle=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=
=A0 =C2=A0 &quot;capabilities&quot;: {</div><div style=3D"color:rgb(0,0,0);=
font-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 &quot;e=
vents&quot;: [</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans=
-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;media-type&quot;:=
 &quot;application/alto-networkmap+json&quot;,</div><div style=3D"color:rgb=
(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0&quot;resource-id&quot;: &quot;network-map&quot;},</div><div =
style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;media-type&quot;: &quot;application/alto=
-costmap+json&quot;,</div><div style=3D"color:rgb(0,0,0);font-family:Calibr=
i,sans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;resour=
ce-id&quot;: &quot;routingcost-map&quot;},</div><div style=3D"color:rgb(0,0=
,0);font-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 {&quot;media-type&quot;: &quot;application/merge-patch+json&quot;,</div=
><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14=
px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;resource-id&quot;: &quot;routin=
gcost-map&quot;},</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,s=
ans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;media-type&quo=
t;: &quot;application/alto-costmap+json&quot;,</div><div style=3D"color:rgb=
(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0&quot;resource-id&quot;: &quot;hopcount-map&quot;},</div><div=
 style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;media-type&quot;: &quot;application/merg=
e-patch+json&quot;,</div><div style=3D"color:rgb(0,0,0);font-family:Calibri=
,sans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;resourc=
e-id&quot;: &quot;hopcount-map&quot;}</div><div style=3D"color:rgb(0,0,0);f=
ont-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 ]</div><=
div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px=
">=C2=A0 =C2=A0 }</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,s=
ans-serif;font-size:14px">=C2=A0 }</div></div><div><br></div><div>This save=
s the trouble for the client to search through the &quot;uses&quot; field i=
n each stream resource; Also, when there are multiple streams for increment=
al updates for one map (e.g. one stream for networkmap A + costmap B, one s=
tream for networkmap A + costmap C and D), the server could load-balance by=
 providing the default update-uri for networkmap A in its IRD entry.</div><=
div><br></div><div>3. To reduce overall traffic, I assume for one particula=
r event stream, the event filtering would be done on the server side, right=
?</div><div><br></div><div>What do you think?</div><div><br></div><div>Chee=
rs,</div><div>Xiao</div></div><div class=3D"gmail_extra"><br><div class=3D"=
gmail_quote">On Fri, Oct 17, 2014 at 1:35 PM, Wendy Roome <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:w.roome@alcatel-lucent.com" target=3D"_blank">w.room=
e@alcatel-lucent.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex=
"><div style=3D"word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-f=
amily:Calibri,sans-serif"><div>Xiao,</div><div><br></div><div>My first take=
 was that update stream resources should be 1-1 with the underlying full ma=
p resources. Then I realized that cost maps depend on network maps, and cli=
ents &amp; servers should coordinate changes to the two. The easiest way to=
 accomplish that was to use the same stream for both network map and cost m=
ap updates, with the event type distinguishing network map updates from cos=
t map updates.</div><div><br></div><div>But your comment reminded me that n=
etwork maps are 1-n with cost maps. Eg, a network map can have two cost map=
s, one for routingcost and the other for hopcount.</div><div><br></div><div=
>So I suggest that an update stream resource can provide updates for an arb=
itrary set of resources. The server picks the set. Each update event has a =
media-type (basically, full-map vs merge-patch), and the resource-id of the=
 map it updates. Because SSE only allows three fields (event, id and data),=
 I suggest we encode the media-type,resource-id pair in the event type, as =
a JSON object with those field names, as in:</div><div><br></div><div>=C2=
=A0 =C2=A0 event: {&quot;media-type&quot;:&quot;application/alto-network-ma=
p+json&quot;,&quot;resource-id&quot;:&quot;network-map&quot;}</div><div><br=
></div><div>Here=E2=80=99s a detailed example of an IRD with an update stre=
am service that gives updates for the network map and the associated routin=
gcost and hopcount maps. It offers merge-patch incremental updates for the =
cost maps, but only full updates for network maps:</div><div><br></div><div=
><div>=C2=A0 &quot;network-map&quot;: {...},</div><div>=C2=A0 &quot;routing=
cost-map&quot;: {...},</div><div>=C2=A0 &quot;hopcount-map&quot;: {...},</d=
iv><div>=C2=A0=C2=A0</div><div>=C2=A0 &quot;network-map-updates&quot;: {</d=
iv><div>=C2=A0 =C2=A0 &quot;uri&quot;: &quot;<a href=3D"http://somewhere.co=
m/network-map-updates" target=3D"_blank">http://somewhere.com/network-map-u=
pdates</a>&quot;,</div><div>=C2=A0 =C2=A0 &quot;media-type&quot;: &quot;tex=
t/event-stream&quot;,</div><div>=C2=A0 =C2=A0 &quot;uses&quot;: [&quot;netw=
ork-map&quot;, &quot;routingcost-map&quot;, &quot;hopcount-map&quot;],</div=
><div>=C2=A0 =C2=A0 &quot;accepts&quot;: &quot;application/alto-updatestrea=
mfilter+json&quot;,</div><div>=C2=A0 =C2=A0 &quot;capabilities&quot;: {</di=
v><div>=C2=A0 =C2=A0 =C2=A0 &quot;events&quot;: [</div><div>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 {&quot;media-type&quot;: &quot;application/alto-networkmap+js=
on&quot;,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;resource-id&quo=
t;: &quot;network-map&quot;},</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;=
media-type&quot;: &quot;application/alto-costmap+json&quot;,</div><div>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;resource-id&quot;: &quot;routingcost-m=
ap&quot;},</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;media-type&quot;: &=
quot;application/merge-patch+json&quot;,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0&quot;resource-id&quot;: &quot;routingcost-map&quot;},</div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;media-type&quot;: &quot;application/alto=
-costmap+json&quot;,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;reso=
urce-id&quot;: &quot;hopcount-map&quot;},</div><div>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 {&quot;media-type&quot;: &quot;application/merge-patch+json&quot;,</=
div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;resource-id&quot;: &quot;h=
opcount-map&quot;}</div><div>=C2=A0 =C2=A0 =C2=A0 ]</div><div>=C2=A0 =C2=A0=
 }</div><div>=C2=A0 }</div></div><div><br></div><div>This is a POST request=
. The client sends application/alto-updatestreamfilter+json data (a new MIM=
E type) to select the events it wishes to get. Here is how a client would r=
equest updates for the network and routingcost maps, but not the hopcount m=
ap:</div><div><br></div><div><div>=C2=A0 POST /network-map-updates</div><di=
v>=C2=A0 Host: <a href=3D"http://somewhere.com" target=3D"_blank">somewhere=
.com</a></div><div>=C2=A0 Content-Length: ###</div><div>=C2=A0 Content-Type=
: application/alto-updatestreamfilter+json</div><div>=C2=A0 Accept: test/ev=
ent-stream,application/alto-error+json</div><div>=C2=A0=C2=A0</div><div>=C2=
=A0 {&quot;events&quot;: [</div><div>=C2=A0 =C2=A0 =C2=A0{&quot;media-type&=
quot;: &quot;application/alto-networkmap+json&quot;,</div><div>=C2=A0 =C2=
=A0 =C2=A0 &quot;resource-id&quot;: &quot;network-map&quot;},</div><div>=C2=
=A0 =C2=A0 =C2=A0{&quot;media-type&quot;: &quot;application/alto-costmap+js=
on&quot;,</div><div>=C2=A0 =C2=A0 =C2=A0 &quot;resource-id&quot;: &quot;rou=
tingcost-map&quot;},</div><div>=C2=A0 =C2=A0 =C2=A0{&quot;media-type&quot;:=
 &quot;application/merge-patch+json&quot;,</div><div>=C2=A0 =C2=A0 =C2=A0 &=
quot;resource-id&quot;: &quot;routingcost-map&quot;}</div><div>=C2=A0 ]}</d=
iv></div><div><br></div><div>The server would respond with something like t=
his.</div><div><br></div><div><div>=C2=A0 HTTP/1.1 200 OK</div><div>=C2=A0 =
Content-Type: text/event-stream</div><div>=C2=A0=C2=A0</div><div>=C2=A0 : F=
ull network map, sent immediately.</div><div>=C2=A0 event: {&quot;media-typ=
e&quot;:&quot;application/alto-network-map+json&quot;,&quot;resource-id&quo=
t;:&quot;network-map&quot;}</div><div>=C2=A0 data: { ... full network map .=
.. }</div><div><br></div><div>=C2=A0 : Full routingcost map, sent immediate=
ly. =C2=A0</div><div>=C2=A0 event: {&quot;media-type&quot;:&quot;applicatio=
n/alto-costmap+json&quot;,&quot;resource-id&quot;:&quot;routingcost-map&quo=
t;}</div><div>=C2=A0 data: { ... full routingcost cost map ... }</div><div>=
=C2=A0 =C2=A0 =C2=A0</div><div>=C2=A0 : Incremental routingcost map update,=
 sent when enough costs have changed. =C2=A0</div><div>=C2=A0 event: {&quot=
;media-type&quot;:&quot;application/merge-patch+json&quot;,&quot;resource-i=
d&quot;:&quot;routingcost-map&quot;}</div><div>=C2=A0 data: { ... merge-pat=
ch for routingcost cost map ... }</div></div><div><br></div><div>Note that =
this omits the ids. They aren&#39;t really necessary. But if the underlying=
 SSE library expects them, the server can always use sequence numbers 1, 2,=
 3, etc.</div><div><br></div><div>How do people feel about this approach?</=
div><div><br></div><div><span style=3D"white-space:pre-wrap">	</span>- Wend=
y Roome</div><div><br></div><span><div style=3D"font-family:Calibri;font-si=
ze:11pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:m=
edium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP=
:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt"><span style=3D=
"font-weight:bold">From: </span> Xiao SHI &lt;<a href=3D"mailto:xiao.shi@ya=
le.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt;<br><span style=3D"font-=
weight:bold">Date: </span> Fri, October 17, 2014 at 10:10<br><span style=3D=
"font-weight:bold">To: </span> Wendy Roome &lt;<a href=3D"mailto:w.roome@al=
catel-lucent.com" target=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;<br><=
span style=3D"font-weight:bold">Cc: </span> Xiao SHI &lt;<a href=3D"mailto:=
xiao.shi@yale.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt;, &quot;Y. Ri=
chard Yang&quot; &lt;<a href=3D"mailto:yry@cs.yale.edu" target=3D"_blank">y=
ry@cs.yale.edu</a>&gt;, IETF ALTO &lt;<a href=3D"mailto:alto@ietf.org" targ=
et=3D"_blank">alto@ietf.org</a>&gt;<div><div class=3D"h5"><br><span style=
=3D"font-weight:bold">Subject: </span> Re: [alto] Incremental updates trans=
port using SSE?<br></div></div></div><div><div class=3D"h5"><div><br></div>=
<div dir=3D"ltr">Hi Wendy,<div><br></div><div>I completely agree with you. =
I was thinking maybe there&#39;s some clever way of using the SSE event-id,=
 but the questionable saving is simply not worth the logging and synchroniz=
ation trouble.</div><div><br></div><div>1. One thing that follows this choi=
ce is to use one single SSE stream (open connection) for each resource. I b=
riefly considered having one open connection and send updates for all resou=
rces on the server via that stream. The advantage of having only one connec=
tion open is smaller overhead, and the disadvantage is that it would requir=
e a more complicated ID and version tagging in event name/id maybe. What do=
 you think?</div><div><br></div><div>2. If the mapping between SSE stream a=
nd underlying map is one-to-one, would it make sense for the resourceID of =
a stream to be the resourceID of the underlying map and &quot;.update&quot;=
 concatenated together? This way, when the client actually requests and ini=
tiates the stream, the client would be aware of the resourceID of the under=
lying map.</div><div><br></div><div>3. Following that, we should define id =
field in the events. Richard proposed using a tag as the id if it&#39;s a f=
ull network map, and newtag_oldtag if it&#39;s a patch. The vtag for networ=
k map is ResourceID+tag tuple, if the client knows about the resourceID, co=
uld we only use the tag? And should the cost maps simply use dependent-vtag=
s? Since the id field is a string, what format do we want the tags in? A fe=
w options are 1) json with all whitespaces removed; 2) an even more compact=
 patterned string.</div><div><br></div><div>e.g. for network map patch, it =
could be:</div><div>{&quot;old-tag&quot;:{&quot;resource-id&quot;:&quot;my-=
default-network-map&quot;,&quot;tag&quot;:&quot;3ee2cb7e8d63d9fab71b9b34cbf=
764436315542e&quot;},&quot;new-tag&quot;:{&quot;resource-id&quot;:&quot;my-=
default-network-map&quot;,&quot;tag&quot;:&quot;<span style=3D"color:rgb(0,=
0,0);font-size:1em">c0ce023b8678a7b9ec00324673b98e54656d1f6d</span>&quot;}}=
<br></div><div><br></div><div>or (since it must be the same resource):<br><=
/div><div>{&quot;resource-id&quot;:&quot;my-default-network-map&quot;,&quot=
;old-tag&quot;:&quot;3ee2cb7e8d63d9fab71b9b34cbf764436315542e&quot;,&quot;n=
ew-tag&quot;:&quot;<span style=3D"color:rgb(0,0,0);font-size:1em">c0ce023b8=
678a7b9ec00324673b98e54656d1f6d</span>&quot;}<br></div><div><br></div><div>=
or (if the client knows the resource-id for the underlying map of the strea=
m, just use a delimiter):</div><div>3ee2cb7e8d63d9fab71b9b34cbf764436315542=
e_<span style=3D"color:rgb(0,0,0);font-size:13px">c0ce023b8678a7b9ec0032467=
3b98e54656d1f6d</span><br></div><div><br></div><div>What do you think?</div=
><div><br></div><div>Best,</div><div>Xiao</div></div><div class=3D"gmail_ex=
tra"><br><div class=3D"gmail_quote">On Fri, Oct 17, 2014 at 9:21 AM, Wendy =
Roome <span dir=3D"ltr">&lt;<a href=3D"mailto:w.roome@alcatel-lucent.com" t=
arget=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;</span> wrote:<br><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc=
 solid;padding-left:1ex"><div style=3D"word-wrap:break-word;color:rgb(0,0,0=
);font-size:14px;font-family:Calibri,sans-serif"><div>Xiao,</div><div><br><=
/div><div>That is a very good point. I hoped someone would ask about that.<=
/div><div><br></div><div>It is a tradeoff. The disadvantage of requiring th=
e server to send full map(s) at the start of each stream is that if the con=
nection drops, we have to send the full map over again. But the advantage i=
s that incremental updates are only within the context of this particular s=
tream. We don&#39;t need keep track of where we were.</div><div><br></div><=
div>To see the issue, suppose we wanted to avoid re-sending the full map wh=
en the client reestablishes the connection. Then the server must assign a u=
nique id to every incremental update event. When the client reconnects, the=
 client gives the server the last known event id, and the server sends any =
events the client missed.</div><div><br></div><div>BTW, SSE does define eve=
nt ids. Each event has an id, and when connecting, the client gives a Last-=
Event-Id header with the last id it received (if any).</div><div><br></div>=
<div>So what is the problem with that? First, the server MUST assign a uniq=
ue id to every incremental update, and they must be the same for all client=
s. That is, if the server has several increment-update clients, the server =
must &quot;clock&quot; their update event streams at the same rate. Second,=
 the server must keep a buffer of old update events, in case a client needs=
 to reconnect. And third, because a reconnecting client may send an old (or=
 bogus) Last-Event-Id, the server may have send the full map(s) anyway.</di=
v><div><br></div><div>If we do not use event ids, then it is much simpler. =
Incremental updates are in the context of this stream. Period. No persisten=
t state that must survive the end of the connection. And if desired, the se=
rver can send updates are different rates to different clients.</div><div><=
br></div><div>So I think it boils down to how often we expect connections t=
o drop unintentionally. If that is common, then, yes, we need to define eve=
nt ids to avoid resending the full maps. But if we can assume accidental dr=
ops are rare, then I think it is simpler just to send the full map(s) for e=
very new connection.</div><div><br></div><div><span style=3D"white-space:pr=
e-wrap">	</span>- Wendy Roome</div><div><br></div><span><div style=3D"font-=
family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:med=
ium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDIN=
G-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-T=
OP:3pt"><span style=3D"font-weight:bold">From: </span> Xiao SHI &lt;<a href=
=3D"mailto:xiao.shi@yale.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt;<b=
r><span style=3D"font-weight:bold">Date: </span> Thu, October 16, 2014 at 1=
8:22<br><span style=3D"font-weight:bold">To: </span> Wendy Roome &lt;<a hre=
f=3D"mailto:w.roome@alcatel-lucent.com" target=3D"_blank">w.roome@alcatel-l=
ucent.com</a>&gt;<br><span style=3D"font-weight:bold">Cc: </span> &quot;Y. =
Richard Yang&quot; &lt;<a href=3D"mailto:yry@cs.yale.edu" target=3D"_blank"=
>yry@cs.yale.edu</a>&gt;, IETF ALTO &lt;<a href=3D"mailto:alto@ietf.org" ta=
rget=3D"_blank">alto@ietf.org</a>&gt;<span><br><span style=3D"font-weight:b=
old">Subject: </span> Re: [alto] Incremental updates transport using SSE?<b=
r></span></div><span><div><br></div><div dir=3D"ltr" style=3D"color:rgb(0,0=
,0);font-family:Calibri;font-size:medium;font-style:normal;font-variant:nor=
mal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:=
start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0=
px">Hi Wendy,<div><br></div><div>If a client accidentally dropped the conne=
ction and hopes to re-connect and receive the merge-patch events, would it =
make sense for the server not to send the first full-map event? It will sav=
e quite some effort that way.</div><div><br></div><div>Best,</div><div>Xiao=
</div></div><br></span></span></div></blockquote></div><br></div></div></di=
v></span></div>
</blockquote></div><br></div>

--001a11c2523290e8400505a75c18--


From nobody Sun Oct 19 23:05:47 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8B60E1A6FA6; Sun, 19 Oct 2014 23:05:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.522
X-Spam-Level: 
X-Spam-Status: No, score=0.522 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 qUpWxrj36o41; Sun, 19 Oct 2014 23:05:35 -0700 (PDT)
Received: from mail-yh0-x22e.google.com (mail-yh0-x22e.google.com [IPv6:2607:f8b0:4002:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 708871A6FA0; Sun, 19 Oct 2014 23:05:35 -0700 (PDT)
Received: by mail-yh0-f46.google.com with SMTP id f73so2551482yha.19 for <multiple recipients>; Sun, 19 Oct 2014 23:05:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:from:date:message-id:subject:to:cc:content-type;  bh=lTaTxiWmc5vUyeA+dHO046lBRzXgf7whsQez81T+2zc=; b=WISwMo7twlo3dtiZGDe1hU09DbEHC6r+q3cuq/y6MzmcgnG/xLSKnr/8yoj5fyJpu2 TC5kBpV9ULm6+Sm5+C3EZPYCD1dlBEIMbc5dbU88sdWkDwaTXMQEVSgUJEVccD5eN0nd T99roVNv5Ttnvx1uf1+IbKLa8IzdLSiLE1xLDpigYMPaLKvPDOSVXU+JGv8/q9+ronX2 5uxLhLhZNwOpHla2rJ6fwKcKLa1ohCJyBcRCmwheEUYoYId6P7KUPnwQLNZoDW4P5tYH 6+zqJeYjkD0NNLMPn55W/hT6grLUat3nT+gyZrQBzpp2xs0krQoNntLmJjesb+50n4Aw cpzw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:from:date:message-id:subject:to:cc:content-type;  bh=lTaTxiWmc5vUyeA+dHO046lBRzXgf7whsQez81T+2zc=; b=lsV6NfGnf6G1vLqlX/baLpl4riHwG2J7tMw60lqfz9fxthPOpxR6bXezcjTGutlVc6 Fru97y7q7DyVcWgjkK5gLvkrWb9a3G2EhnqZMQypAdvdJX33k83+scgz2zgJY/X0N6Wy k/pStXW8zhhQ6PnFgshl4UizGcmagxviIbeTw=
X-Received: by 10.236.34.167 with SMTP id s27mr35132810yha.53.1413785134619; Sun, 19 Oct 2014 23:05:34 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.97.10 with HTTP; Sun, 19 Oct 2014 23:05:14 -0700 (PDT)
From: Xiao SHI <xiao.shi@yale.edu>
Date: Mon, 20 Oct 2014 02:05:14 -0400
X-Google-Sender-Auth: nprBq1F3kzUIKvA64zhc-Jn4MHA
Message-ID: <CAFwJzZkAp-4umrrHZEY3qYuFCXu=+Pqbh8SeB=Qr=TTbQurj6A@mail.gmail.com>
To: IETF ALTO <alto@ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
Content-Type: multipart/alternative; boundary=001a11c1c058bce7bd0505d480e7
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/WtlRytqfK9cGMoBwIFo4sqvhl_0
Subject: [alto] Modeling JSON based protocols using YANG
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Oct 2014 06:05:40 -0000

--001a11c1c058bce7bd0505d480e7
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi folks,


As a few of us were working on modeling the ALTO protocol using YANG, we
were pondering on a more general question: can YANG model all JSON based
protocols? What is the condition for a JSON based protocol (at least the
message format) to have an syntactically equivalent, hence interoperable,
YANG model with JSON encoding? Alternatively, in order to interoperate,
semantic equivalence might be sufficient, is there any condition for
semantic equivalence?


tl;dr: A JSON based protocol carried by HTTP can have syntactically
equivalent YANG model, if and only if all the keys in the key-value pairs
in the JSON message are pre-defined keywords in the protocol.


We've come up with a few ideas, and a few things below are work in
progress, but we would love your feedback!


Thank you!

Xiao


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

1. Introduction.

JavaScript Object Notation (JSON) has been a popular choice as the message
encoding for many network protocols such as the Application Layer Traffic
Optimization (ALTO) protocol, the Content Delivery Networks Interconnection
(CDNi) protocol, etc.

Meanwhile, there are broad interests in the networking community to use
YANG to define data model so that one can use YANG related tools such as
OpenDayLight controller. Although YANG itself is XML based, there have been
efforts to model JSON content using YANG [draft-ietf-netmod-yang-json-01].

A natural question rises: can YANG model all JSON based protocols? What is
the condition for a JSON based protocol (at least the message format) to
have an syntactically equivalent, hence interoperable, YANG model with JSON
encoding? Alternatively, in order to interoperate, semantic equivalence
might be sufficient, is there any condition for semantic equivalence?

2. Claim

A JSON based protocol carried by HTTP can have syntactically equivalent
YANG model, if and only if:

(1) the message encoding condition is met;

(2) the uri condition is met.

2.1. The message encoding condition

The JSON message encoding MUST not contain a variable as a key in a JSON
object key-value pair. In other words, the keys in the JSON message must be
an already defined constant (or keyword) in the message format of the
protocol.

For example, if I have a protocol where =E2=80=9Cnetwork-map=E2=80=9D, =E2=
=80=9Csrc=E2=80=9D, and =E2=80=9Cdsts=E2=80=9D
are defined keywords, JSON text A meets the condition whereas B does not
because =E2=80=9CPID1=E2=80=9D and =E2=80=9CPID2=E2=80=9D are not protocol =
keywords (they are resource IDs).

A:

{

 =E2=80=9Cnetwork-map=E2=80=9D: [

   {

     =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,

     =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=
=9D]

   },

   {

     =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,

     =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=E2=80=
=9D]

   }

 ]

}

B:


{

 =E2=80=9Cnetwork-map=E2=80=9D: [

   =E2=80=9CPID1: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=9D],

   =E2=80=9CPID2=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=E2=80=9D]

 ]

}

>From this we know that since ALTO protocol uses encoding B, there cannot be
a syntactically equivalent YANG model.

2.2 The URI condition

Some of the YANG-related protocols might have URI constraints, e.g.
RESTCONF. For now, we assume either that the JSON-based protocol URI could
be conformed to RESTCONF compliant uri, or that the server could have a
routing mapping between the protocol compliant uri and the RESTCONF
compliant uri, hence this condition would not be an issue, which allows us
to focus on the message encoding condition.

3. Proof

3.1. The message encoding condition is necessary.

We first note that this condition is a necessary condition for a JSON based
protocol to have a syntactically equivalent YANG model by proving its
contrapositive.

If one of the keys in the key-value pair in the JSON document is not
pre-defined, the corresponding XML tags will not be pre-defined keywords.
Therefore, it would not possible to model it in YANG without using
YANG=E2=80=99s anyxml
statement (which allows arbitrary XML content).

However, using the anyxml statement would defeat our purpose of modeling
the data as it allows arbitrary XML content, and will not be helpful in the
subsequent parsing process.

3.2. The message encoding condition is sufficient.

We prove this by providing a translation procedure from a JSON message that
is compliant with the protocol we are trying to model, to a custom java
class that can be used for Jackson data binding, then to a YANG model.

We note that the middle step of translating to and from the custom parser
class is not necessary, but it will be useful.

3.2.1. motivation

JSON data binding is the process of binding data structures (objects,
arrays, etc.) in JSON to the appropriate data structures in the server
(e.g. java classes, database tables, etc.) in parsing the JSON text. In
order to process JSON messages in a meaningful manner, data binding is
necessary. Even if the binding is not explicit, the server would need to do
it eventually. For example, one can read JSON content in a stream without
binding it to the java classes, but eventually in order to make sense of
the data, the server would eventually have to organize it, which is roughly
analogous to data binding upfront. Popular choices for JSON parsing and
data binding include jackson and gson.

We use Jackson full data binding as our approach. Full data binding binds
JSON content into plain old java objects (POJOs), i.e. this custom parser
class can neither extend nor implement any other class. Jackson uses
ObjectMapper with the custom parser class to parse JSON content into this
class.

3.2.2. The message encoding condition

The message encoding condition is that all keys in each key-value pair in
the JSON text must be pre-defined keywords. As the keys will become either
class names and instance variable names, or be keys in the java maps, it is
easy to see that the condition is equivalent to =E2=80=9Cthere exists a ful=
l data
binding in Jackson custom parser class without using any map structures
(Map<String, ?>).=E2=80=9D

3.2.3. Proof

We provide a recursive binding process from a JSON object to the Jackson
custom parser class to be used by Jackson ObjectMapper.

Type determine_type(value) {

 if (value is of a primitive type, i.e. string, number, boolean, null) {

   return the corresponding java primitive type;

 }

 if (value is a JSON object) {

   return build_parser_class(value).class;

 }

 if (value is an array) {

   return ArrayList<T> where T=3Ddetermine_type(value[0]);

 }

 // should not reach here.

}

Class build_parser_class(JSONObject obj) {

 create custom class C;

 for each key/value pair in the obj {

   add instance variable v in C;

   the name of variable v <- key; // (__known__ a/c to our assumption)

   the type of variable v <- determine_type(value);

 }

 return C.class;

}

Naming:

--change everything into CamelCase (i.e. remove dashes, etc.)

--for instance variables, use =E2=80=9Cmy=E2=80=9D prefix, (e.g. myVariable=
, myNetworkMap,
etc.)

--for the custom class name, if the object is an element of the array, use
=E2=80=9CElement=E2=80=9D suffix.

This is just one convention so that the next step proceeds smoothly. As
long as this naming translation is consistent with the naming stage in the
next step, it will work just fine.

Example (a modified ALTO protocol network map example):

JSON object:

{

 =E2=80=9Cmeta=E2=80=9D: {

   =E2=80=9Cresource-id=E2=80=9D: =E2=80=9Cmy-default-map=E2=80=9D,

   =E2=80=9Ctag=E2=80=9D: =E2=80=9Caab875ef69c87d012=E2=80=9D

 },

 =E2=80=9Cnetwork-map=E2=80=9D: [

   {

     =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,

     =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =E2=80=9CPID2=E2=80=
=9D, =E2=80=9CPID3=E2=80=9D]

   },

   {

     =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,

     =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =E2=80=9CPID3=E2=80=
=9D]

   },

   {

     =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID3=E2=80=9D,

     =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=
=9D]

   }

 ]

}

Result of build_parser_class(obj):

Class JSONObject {

 Meta myMeta;

 ArrayList<NetworkMapElement> myNetworkMap;

}

Class Meta {

 String myResourceId;

 String myTag;

}

Class NetworkMapElement {

 String mySrc;

 ArrayList<String> myDsts;

}

Now given the Jackson Parser Java Class, to get a syntactically equivalent
YANG model:

YANGModel build_yang_model(Class C) {

 for each instance variable (Type, Name) {

   if (Type is primitive type: string, number, boolean, null) {

     add the following to the YANG module:

     =E2=80=9Cleaf Name { type <YANG equivalent of Type>; }=E2=80=9D

   }

   if (Type is an ArrayList<TypeElement>) {

     if (TypeElement is primitive type) {

       add the following to the YANG module:

       =E2=80=9Cleaf-list Name { type <YANG equivalent of TypeElement>; }=
=E2=80=9D

     } else {

       // TypeElement is a custom parser class

       add the following to the YANG module:

       =E2=80=9Clist Name { <result from build_yang_model<TypeElement.class=
>> }=E2=80=9D

     }

   }

   if (Type is a custom parser class) {

     add the following to the YANG module:

     =E2=80=9Ccontainer Name { <result from build_yang_model<Type.class>> }=
=E2=80=9D

   }

 }

}

Result from the previous example:

container meta {

 leaf resource-id {

   type string;

 }

 leaf tag {

   type string;

 }

}

list network-map {

 leaf src {

   type string;

 }

 leaf-list dsts {

   type string;

 }

}

This does validate the JSON document with XML-JSON encoding. For your
reference, this is the XML document which validates:

<?xml version=3D"1.0" encoding=3D"UTF-8" ?>

<meta>

 <resource-id>my-default-map</resource-id>

 <tag>aab875ef69c87d012</tag>

</meta>

<network-map>

 <src>PID1</src>

 <dsts>PID1</dsts>

 <dsts>PID2</dsts>

 <dsts>PID3</dsts>

</network-map>

<network-map>

 <src>PID2</src>

 <dsts>PID1</dsts>

 <dsts>PID3</dsts>

</network-map>

<network-map>

 <src>PID3</src>

 <dsts>PID2</dsts>

 <dsts>PID3</dsts>

</network-map>

This proves that the message encoding condition is a sufficient condition
for the JSON object to have a YANG model.

Note the model generated is very crude and lose almost all constraints and
all inheritance features (if any), because it focuses on the syntax and is
essentially converted from an JSON object compliant with a protocol instead
of from the protocol itself. Hence this result is more useful in
determining which JSON based protocols cannot have a syntactically
equivalent YANG model, than in generating a good YANG model.

3.3. Conclusion

Our claim holds. A JSON based protocol carried by HTTP can have
syntactically equivalent YANG model, if and only if all the keys in the
key-value pairs in the JSON message are pre-defined keywords.

4. Semantic equivalence

For JSON based protocols that don=E2=80=99t satisfy the message encoding co=
ndition,
it is still possible to have a semantically equivalent YANG model. All that
is required for the protocol compliant clients and the YANG model compliant
server to interoperate is an adapter which does the following:

1) translate FROM YANG server compliant response msg TO alto compliant
response msg

2) translate FROM alto compliant request msg TO YANG server compliant
request msg

4.1. Claim

This adapter needs to be protocol-aware.

Ideally, given any YANG model, we would like to be able to automatically
(or at least mechanically) generate this message adapter, which means not
looking at the protocol or its compliant msgs. However, without knowing the
specific protocol that we are working with (i.e. human intervention, i.e.
looking at the protocol compliant msgs), such an adapter cannot be
auto-generated.

4.2. Proof by Indistinguishability

Suppose both the YANG server compliant msg m_y and the actually protocol
compliant msg m_p are in JSON (or have been encoded into JSON). Looking at
the differences between the two messages, call these differences {d1, d2,
..., dn}. The goal for the auto-generated adapter would be to identify and
eliminate these differences. Construct a new JSON msg m' where all but one
difference di is the same as m_p and di is the same as the m_y. Without
looking at the protocol (or m_p), the auto-generated adapter would not be
able to distinguish between m' and m_p in its translation process, which
means, it won't be able to tell whether it should change di or not. Hence,
such an adapter must be protocol-aware.

A good example is the dependent-vtag in the ALTO protocol:

"dependent-vtag" : [

 {

   "resource-id" : "my-network-map",

   "tag" : "abcd1234"

 }

]

It was specified this way in the alto protocol. However, it could
conceivably be the case that it was originally the following map structure,
and was converted into the above encoding because of the map->list+key
issue. (This case is actually one of the few differences in the m_y and m_p
where the adapter does not need to convert it back to a map structure.)

"dependent-vtag" : {

 "my-network-map" : {

   "tag" : "abcd1234"

 }

}

Without knowing the protocol, there is no way to tell.

5. Ramifications

We now understand the basic condition for a JSON based protocol to have a
YANG Model. For the protocols that don=E2=80=99t meet this condition, there=
 can be
a semantic equivalent YANG model, but there won=E2=80=99t be a generic proc=
ess of
generating the adapter for all such protocols.

--001a11c1c058bce7bd0505d480e7
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><span id=3D"docs-internal-guid-64e88392-2c22-b1c4-9102-7d9=
cb2048a9e"><p style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><=
span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,=
0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transpar=
ent">Hi folks,</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-to=
p:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubu=
ntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap=
;background-color:transparent"><br></span></p><p style=3D"line-height:1.15;=
margin-top:0pt;margin-bottom:0pt"><span style=3D"color:rgb(0,0,0);font-fami=
ly:&#39;Ubuntu Mono&#39;;font-size:15px;white-space:pre-wrap;line-height:1.=
15;background-color:transparent">As a few of us were working on modeling th=
e ALTO protocol using YANG, we were pondering on a more general question: c=
an YANG model all JSON based protocols? What is the condition for a JSON ba=
sed protocol (at least the message format) to have an syntactically equival=
ent, hence interoperable, YANG model with JSON encoding? Alternatively, in =
order to interoperate, semantic equivalence might be sufficient, is there a=
ny condition for semantic equivalence?</span><br></p><p style=3D"line-heigh=
t:1.15;margin-top:0pt;margin-bottom:0pt"><br></p><p style=3D"line-height:1.=
15;margin-top:0pt;margin-bottom:0pt"><span style=3D"color:rgb(0,0,0);font-f=
amily:&#39;Ubuntu Mono&#39;;font-size:15px;white-space:pre-wrap;line-height=
:1.15;background-color:transparent">tl;dr: </span><span style=3D"color:rgb(=
0,0,0);font-family:&#39;Ubuntu Mono&#39;;font-size:15px;line-height:17.25px=
;white-space:pre-wrap">A JSON based protocol carried by HTTP can have synta=
ctically equivalent YANG model, if and only if all the keys in the key-valu=
e pairs in the JSON message are pre-defined keywords in the protocol.</span=
></p><p style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><br></p=
><p style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=
=3D"color:rgb(0,0,0);font-family:&#39;Ubuntu Mono&#39;;font-size:15px;line-=
height:17.25px;white-space:pre-wrap">We&#39;ve come up with a few ideas, an=
d a few things below are work in progress, but we would love your feedback!=
</span><span style=3D"color:rgb(0,0,0);font-family:&#39;Ubuntu Mono&#39;;fo=
nt-size:15px;line-height:17.25px;white-space:pre-wrap"><br></span></p><p st=
yle=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"co=
lor:rgb(0,0,0);font-family:&#39;Ubuntu Mono&#39;;font-size:15px;line-height=
:17.25px;white-space:pre-wrap"><br></span></p><p style=3D"line-height:1.15;=
margin-top:0pt;margin-bottom:0pt"><span style=3D"color:rgb(0,0,0);font-fami=
ly:&#39;Ubuntu Mono&#39;;font-size:15px;line-height:17.25px;white-space:pre=
-wrap">Thank you!</span></p><p style=3D"line-height:1.15;margin-top:0pt;mar=
gin-bottom:0pt"><span style=3D"color:rgb(0,0,0);font-family:&#39;Ubuntu Mon=
o&#39;;font-size:15px;line-height:17.25px;white-space:pre-wrap">Xiao</span>=
</p><p style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span st=
yle=3D"color:rgb(0,0,0);font-family:&#39;Ubuntu Mono&#39;;font-size:15px;li=
ne-height:17.25px;white-space:pre-wrap"><br></span></p>=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</span><div><span id=3D"doc=
s-internal-guid-64e88392-2c27-54ce-2150-d094d41d5d85"><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-=
size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align=
:baseline;white-space:pre-wrap;background-color:transparent">1. Introductio=
n.</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin=
-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39=
;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-=
color:transparent">JavaScript Object Notation (JSON) has been a popular cho=
ice as the message encoding for many network protocols such as the Applicat=
ion Layer Traffic Optimization (ALTO) protocol, the Content Delivery Networ=
ks Interconnection (CDNi) protocol, etc.</span></p><br><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-=
size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align=
:baseline;white-space:pre-wrap;background-color:transparent">Meanwhile, the=
re are broad interests in the networking community to use YANG to define da=
ta model so that one can use YANG related tools such as OpenDayLight contro=
ller. Although YANG itself is XML based, there have been efforts to model J=
SON content using YANG [draft-ietf-netmod-yang-json-01]. </span></p><br><p =
dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><sp=
an style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,=
0);vertical-align:baseline;white-space:pre-wrap;background-color:transparen=
t">A natural question rises: can YANG model all JSON based protocols? What =
is the condition for a JSON based protocol (at least the message format) to=
 have an syntactically equivalent, hence interoperable, YANG model with JSO=
N encoding? Alternatively, in order to interoperate, semantic equivalence m=
ight be sufficient, is there any condition for semantic equivalence?</span>=
</p></span></div><div><span><br><p dir=3D"ltr" style=3D"line-height:1.15;ma=
rgin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&=
#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:p=
re-wrap;background-color:transparent">2. Claim</span></p><p dir=3D"ltr" sty=
le=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"fon=
t-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-ali=
gn:baseline;white-space:pre-wrap;background-color:transparent">A JSON based=
 protocol carried by HTTP can have syntactically equivalent YANG model, if =
and only if:</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:=
0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubunt=
u Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;b=
ackground-color:transparent">(1) the message encoding condition is met;</sp=
an></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-botto=
m:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;colo=
r:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:=
transparent">(2) the uri condition is met.</span></p><br><p dir=3D"ltr" sty=
le=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"fon=
t-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-ali=
gn:baseline;white-space:pre-wrap;background-color:transparent">2.1. The mes=
sage encoding condition</span></p><p dir=3D"ltr" style=3D"line-height:1.15;=
margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family=
:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space=
:pre-wrap;background-color:transparent">The JSON message encoding MUST not =
contain a variable as a key in a JSON object key-value pair. In other words=
, the keys in the JSON message must be an already defined constant (or keyw=
ord) in the message format of the protocol.</span></p><br><p dir=3D"ltr" st=
yle=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"fo=
nt-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-al=
ign:baseline;white-space:pre-wrap;background-color:transparent">For example=
, if I have a protocol where =E2=80=9Cnetwork-map=E2=80=9D, =E2=80=9Csrc=E2=
=80=9D, and =E2=80=9Cdsts=E2=80=9D are defined keywords, JSON text A meets =
the condition whereas B does not because =E2=80=9CPID1=E2=80=9D and =E2=80=
=9CPID2=E2=80=9D are not protocol keywords (they are resource IDs).</span><=
/p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0p=
t"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rg=
b(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:tran=
sparent">A:</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0=
pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu=
 Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;ba=
ckground-color:transparent">{</span></p><p dir=3D"ltr" style=3D"line-height=
:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-=
family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white=
-space:pre-wrap;background-color:transparent"> =C2=A0=E2=80=9Cnetwork-map=
=E2=80=9D: [</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:=
0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubunt=
u Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;b=
ackground-color:transparent"> =C2=A0=C2=A0=C2=A0{</span></p><p dir=3D"ltr" =
style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"=
font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-=
align:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,</spa=
n></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom=
:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color=
:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:t=
ransparent"> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=E2=80=9Cdsts=E2=80=9D: [=E2=80=
=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=9D]</span></p><p dir=3D"ltr" style=3D=
"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-siz=
e:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:ba=
seline;white-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=C2=
=A0},</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;mar=
gin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&=
#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backgrou=
nd-color:transparent"> =C2=A0=C2=A0=C2=A0{</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-=
size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align=
:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,</span></p>=
<p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt">=
<span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0=
,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transpa=
rent"> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID3=
=E2=80=9D, =E2=80=9CPID4=E2=80=9D]</span></p><p dir=3D"ltr" style=3D"line-h=
eight:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;=
font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;=
white-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=C2=A0}</sp=
an></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-botto=
m:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;colo=
r:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:=
transparent"> =C2=A0]</span></p><p dir=3D"ltr" style=3D"line-height:1.15;ma=
rgin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&=
#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:p=
re-wrap;background-color:transparent">}</span></p><p dir=3D"ltr" style=3D"l=
ine-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:=
15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:base=
line;white-space:pre-wrap;background-color:transparent">B:</span></p><br><b=
r><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt=
"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb=
(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:trans=
parent">{</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt=
;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu M=
ono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;back=
ground-color:transparent"> =C2=A0=E2=80=9Cnetwork-map=E2=80=9D: [</span></p=
><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"=
><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(=
0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transp=
arent"> =C2=A0=C2=A0=C2=A0=E2=80=9CPID1: [=E2=80=9CPID2=E2=80=9D, =E2=80=9C=
PID3=E2=80=9D],</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-t=
op:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ub=
untu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wra=
p;background-color:transparent"> =C2=A0=C2=A0=C2=A0=E2=80=9CPID2=E2=80=9D: =
[=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=E2=80=9D]</span></p><p dir=3D"ltr" s=
tyle=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"f=
ont-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-a=
lign:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0]</=
span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bot=
tom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;co=
lor:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-colo=
r:transparent">}</span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;mar=
gin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#=
39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pr=
e-wrap;background-color:transparent">From this we know that since ALTO prot=
ocol uses encoding B, there cannot be a syntactically equivalent YANG model=
.</span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;mar=
gin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&=
#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backgrou=
nd-color:transparent">2.2 The URI condition</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-=
size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align=
:baseline;white-space:pre-wrap;background-color:transparent">Some of the YA=
NG-related protocols might have URI constraints, e.g. RESTCONF. For now, we=
 assume either that the JSON-based protocol URI could be conformed to RESTC=
ONF compliant uri, or that the server could have a routing mapping between =
the protocol compliant uri and the RESTCONF compliant uri, hence this condi=
tion would not be an issue, which allows us to focus on the message encodin=
g condition.</span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-=
top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;U=
buntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wr=
ap;background-color:transparent">3. Proof</span></p><p dir=3D"ltr" style=3D=
"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-siz=
e:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:ba=
seline;white-space:pre-wrap;background-color:transparent">3.1. The message =
encoding condition is necessary.</span></p><p dir=3D"ltr" style=3D"line-hei=
ght:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;fo=
nt-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;wh=
ite-space:pre-wrap;background-color:transparent">We first note that this co=
ndition is a necessary condition for a JSON based protocol to have a syntac=
tically equivalent YANG model by proving its contrapositive.</span></p><br>=
<p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt">=
<span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0=
,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transpa=
rent">If one of the keys in the key-value pair in the JSON document is not =
pre-defined, the corresponding XML tags will not be pre-defined keywords. T=
herefore, it would not possible to model it in YANG without using YANG=E2=
=80=99s </span><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#=
39;;color:rgb(0,0,0);font-weight:bold;vertical-align:baseline;white-space:p=
re-wrap;background-color:transparent">anyxml </span><span style=3D"font-siz=
e:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:ba=
seline;white-space:pre-wrap;background-color:transparent">statement (which =
allows arbitrary XML content).</span></p><br><p dir=3D"ltr" style=3D"line-h=
eight:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;=
font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;=
white-space:pre-wrap;background-color:transparent">However, using the anyxm=
l statement would defeat our purpose of modeling the data as it allows arbi=
trary XML content, and will not be helpful in the subsequent parsing proces=
s.</span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;ma=
rgin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono=
&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backgro=
und-color:transparent">3.2. The message encoding condition is sufficient.</=
span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bot=
tom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;co=
lor:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-colo=
r:transparent">We prove this by providing a translation procedure from a JS=
ON message that is compliant with the protocol we are trying to model, to a=
 custom java class that can be used for Jackson data binding, then to a YAN=
G model.</span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:=
0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubunt=
u Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;b=
ackground-color:transparent">We note that the middle step of translating to=
 and from the custom parser class is not necessary, but it will be useful.<=
/span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margi=
n-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#3=
9;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background=
-color:transparent">3.2.1. motivation</span></p><p dir=3D"ltr" style=3D"lin=
e-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15=
px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseli=
ne;white-space:pre-wrap;background-color:transparent">JSON data binding is =
the process of binding data structures (objects, arrays, etc.) in JSON to t=
he appropriate data structures in the server (e.g. java classes, database t=
ables, etc.) in parsing the JSON text. In order to process JSON messages in=
 a meaningful manner, data binding is necessary. Even if the binding is not=
 explicit, the server would need to do it eventually. For example, one can =
read JSON content in a stream without binding it to the java classes, but e=
ventually in order to make sense of the data, the server would eventually h=
ave to organize it, which is roughly analogous to data binding upfront. Pop=
ular choices for JSON parsing and data binding include jackson and gson.</s=
pan></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-=
bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;=
;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-c=
olor:transparent">We use Jackson full data binding as our approach. Full da=
ta binding binds JSON content into plain old java objects (POJOs), i.e. thi=
s custom parser class can neither extend nor implement any other class. Jac=
kson uses ObjectMapper with the custom parser class to parse JSON content i=
nto this class.</span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;marg=
in-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#3=
9;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre=
-wrap;background-color:transparent">3.2.2. The message encoding condition</=
span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bot=
tom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;co=
lor:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-colo=
r:transparent">The message encoding condition is that all keys in each key-=
value pair in the JSON text must be pre-defined keywords. As the keys will =
become either class names and instance variable names, or be keys in the ja=
va maps, it is easy to see that the condition is equivalent to =E2=80=9Cthe=
re exists a full data binding in Jackson custom parser class without using =
any map structures (Map&lt;String, ?&gt;).=E2=80=9D </span></p><br><p dir=
=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span =
style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);=
vertical-align:baseline;white-space:pre-wrap;background-color:transparent">=
3.2.3. Proof</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:=
0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubunt=
u Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;b=
ackground-color:transparent">We provide a recursive binding process from a =
JSON object to the Jackson custom parser class to be used by Jackson Object=
Mapper.</span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0=
pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu=
 Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;ba=
ckground-color:transparent">Type determine_type(value) {</span></p><p dir=
=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span =
style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);=
vertical-align:baseline;white-space:pre-wrap;background-color:transparent">=
 =C2=A0if (value is of a primitive type, i.e. string, number, boolean, null=
) {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margi=
n-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#3=
9;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background=
-color:transparent"> =C2=A0=C2=A0=C2=A0return the corresponding java primit=
ive type;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt=
;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu M=
ono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;back=
ground-color:transparent"> =C2=A0}</span></p><p dir=3D"ltr" style=3D"line-h=
eight:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;=
font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;=
white-space:pre-wrap;background-color:transparent"> =C2=A0if (value is a JS=
ON object) {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:=
0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubunt=
u Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;b=
ackground-color:transparent"> =C2=A0=C2=A0=C2=A0return build_parser_class(v=
alue).class;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:=
0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubunt=
u Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;b=
ackground-color:transparent"> =C2=A0}</span></p><p dir=3D"ltr" style=3D"lin=
e-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15=
px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseli=
ne;white-space:pre-wrap;background-color:transparent"> =C2=A0if (value is a=
n array) {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0p=
t;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu =
Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;bac=
kground-color:transparent"> =C2=A0=C2=A0=C2=A0return ArrayList&lt;T&gt; whe=
re T=3Ddetermine_type(value[0]);</span></p><p dir=3D"ltr" style=3D"line-hei=
ght:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;fo=
nt-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;wh=
ite-space:pre-wrap;background-color:transparent"> =C2=A0}</span></p><p dir=
=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span =
style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);=
vertical-align:baseline;white-space:pre-wrap;background-color:transparent">=
 =C2=A0// should not reach here.</span></p><p dir=3D"ltr" style=3D"line-hei=
ght:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;fo=
nt-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;wh=
ite-space:pre-wrap;background-color:transparent">}</span></p><br><p dir=3D"=
ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vert=
ical-align:baseline;white-space:pre-wrap;background-color:transparent">Clas=
s build_parser_class(JSONObject obj) {</span></p><p dir=3D"ltr" style=3D"li=
ne-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:1=
5px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:basel=
ine;white-space:pre-wrap;background-color:transparent"> =C2=A0create custom=
 class C;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt=
;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu M=
ono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;back=
ground-color:transparent"> =C2=A0for each key/value pair in the obj {</span=
></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:=
0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:=
rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:tr=
ansparent"> =C2=A0=C2=A0=C2=A0add instance variable v in C; </span></p><p d=
ir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><spa=
n style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0=
);vertical-align:baseline;white-space:pre-wrap;background-color:transparent=
"> =C2=A0=C2=A0=C2=A0the name of variable v &lt;- key; // (__known__ a/c to=
 our assumption)</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-=
top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;U=
buntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wr=
ap;background-color:transparent"> =C2=A0=C2=A0=C2=A0the type of variable v =
&lt;- determine_type(value);</span></p><p dir=3D"ltr" style=3D"line-height:=
1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-f=
amily:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-=
space:pre-wrap;background-color:transparent"> =C2=A0}</span></p><p dir=3D"l=
tr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=
=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);verti=
cal-align:baseline;white-space:pre-wrap;background-color:transparent"> =C2=
=A0return C.class;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margi=
n-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39=
;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-=
wrap;background-color:transparent">}</span></p><br><p dir=3D"ltr" style=3D"=
line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size=
:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:bas=
eline;white-space:pre-wrap;background-color:transparent">Naming:</span></p>=
<p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt">=
<span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0=
,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transpa=
rent">--change everything into CamelCase (i.e. remove dashes, etc.)</span><=
/p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0p=
t"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rg=
b(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:tran=
sparent">--for instance variables, use =E2=80=9Cmy=E2=80=9D prefix, (e.g. m=
yVariable, myNetworkMap, etc.)</span></p><p dir=3D"ltr" style=3D"line-heigh=
t:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font=
-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;whit=
e-space:pre-wrap;background-color:transparent">--for the custom class name,=
 if the object is an element of the array, use =E2=80=9CElement=E2=80=9D su=
ffix.</span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt=
;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu M=
ono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;back=
ground-color:transparent">This is just one convention so that the next step=
 proceeds smoothly. As long as this naming translation is consistent with t=
he naming stage in the next step, it will work just fine.</span></p><br><p =
dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><sp=
an style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,=
0);vertical-align:baseline;white-space:pre-wrap;background-color:transparen=
t">Example (a </span><span style=3D"font-size:15px;font-family:&#39;Ubuntu =
Mono&#39;;color:rgb(0,0,0);font-weight:bold;vertical-align:baseline;white-s=
pace:pre-wrap;background-color:transparent">modified</span><span style=3D"f=
ont-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-a=
lign:baseline;white-space:pre-wrap;background-color:transparent"> ALTO prot=
ocol</span><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;=
color:rgb(0,0,0);font-weight:bold;vertical-align:baseline;white-space:pre-w=
rap;background-color:transparent"> </span><span style=3D"font-size:15px;fon=
t-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;whi=
te-space:pre-wrap;background-color:transparent">network map example):</span=
></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:=
0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:=
rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:tr=
ansparent">JSON object:</span></p><p dir=3D"ltr" style=3D"line-height:1.15;=
margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family=
:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space=
:pre-wrap;background-color:transparent">{</span></p><p dir=3D"ltr" style=3D=
"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-siz=
e:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:ba=
seline;white-space:pre-wrap;background-color:transparent"> =C2=A0=E2=80=9Cm=
eta=E2=80=9D: {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-t=
op:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ub=
untu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wra=
p;background-color:transparent"> =C2=A0=C2=A0=C2=A0=E2=80=9Cresource-id=E2=
=80=9D: =E2=80=9Cmy-default-map=E2=80=9D,</span></p><p dir=3D"ltr" style=3D=
"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-siz=
e:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:ba=
seline;white-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=C2=
=A0=E2=80=9Ctag=E2=80=9D: =E2=80=9Caab875ef69c87d012=E2=80=9D</span></p><p =
dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><sp=
an style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,=
0);vertical-align:baseline;white-space:pre-wrap;background-color:transparen=
t"> =C2=A0},</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:=
0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubunt=
u Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;b=
ackground-color:transparent"> =C2=A0=E2=80=9Cnetwork-map=E2=80=9D: [</span>=
</p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0=
pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:r=
gb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:tra=
nsparent"> =C2=A0=C2=A0=C2=A0{</span></p><p dir=3D"ltr" style=3D"line-heigh=
t:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font=
-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;whit=
e-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,</span></p><p dir=3D"ltr" =
style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"=
font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-=
align:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =
=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=9D]</span></p><p dir=3D"ltr" st=
yle=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"fo=
nt-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-al=
ign:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0=C2=
=A0=C2=A0},</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0=
pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu=
 Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;ba=
ckground-color:transparent"> =C2=A0=C2=A0=C2=A0{</span></p><p dir=3D"ltr" s=
tyle=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"f=
ont-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-a=
lign:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,</span><=
/p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0p=
t"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rg=
b(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:tran=
sparent"> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=E2=80=9Cdsts=E2=80=9D: [=E2=80=9CP=
ID1=E2=80=9D, =E2=80=9CPID3=E2=80=9D]</span></p><p dir=3D"ltr" style=3D"lin=
e-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15=
px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseli=
ne;white-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=C2=A0},=
</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-b=
ottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;=
color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-co=
lor:transparent"> =C2=A0=C2=A0=C2=A0{</span></p><p dir=3D"ltr" style=3D"lin=
e-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15=
px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseli=
ne;white-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=E2=80=9Csrc=E2=80=9D: =E2=80=9CPID3=E2=80=9D,</span></p><p dir=
=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span =
style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);=
vertical-align:baseline;white-space:pre-wrap;background-color:transparent">=
 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=
=9D, =E2=80=9CPID3=E2=80=9D]</span></p><p dir=3D"ltr" style=3D"line-height:=
1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-f=
amily:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-=
space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=C2=A0}</span></p=
><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"=
><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(=
0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transp=
arent"> =C2=A0]</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-t=
op:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ub=
untu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wra=
p;background-color:transparent">}</span></p><br><p dir=3D"ltr" style=3D"lin=
e-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15=
px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseli=
ne;white-space:pre-wrap;background-color:transparent">Result of build_parse=
r_class(obj):</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top=
:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubun=
tu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;=
background-color:transparent">Class JSONObject {</span></p><p dir=3D"ltr" s=
tyle=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"f=
ont-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-a=
lign:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0Met=
a myMeta;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt=
;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu M=
ono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;back=
ground-color:transparent"> =C2=A0ArrayList&lt;NetworkMapElement&gt; myNetwo=
rkMap;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;ma=
rgin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono=
&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backgro=
und-color:transparent">}</span></p><p dir=3D"ltr" style=3D"line-height:1.15=
;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-famil=
y:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-spac=
e:pre-wrap;background-color:transparent">Class Meta {</span></p><p dir=3D"l=
tr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=
=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);verti=
cal-align:baseline;white-space:pre-wrap;background-color:transparent"> =C2=
=A0String myResourceId;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;=
margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family=
:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space=
:pre-wrap;background-color:transparent"> =C2=A0String myTag;</span></p><p d=
ir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><spa=
n style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0=
);vertical-align:baseline;white-space:pre-wrap;background-color:transparent=
">}</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margi=
n-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#3=
9;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background=
-color:transparent">Class NetworkMapElement {</span></p><p dir=3D"ltr" styl=
e=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font=
-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-alig=
n:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0String=
 mySrc;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;m=
argin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mon=
o&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backgr=
ound-color:transparent"> =C2=A0ArrayList&lt;String&gt; myDsts;</span></p><p=
 dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><s=
pan style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0=
,0);vertical-align:baseline;white-space:pre-wrap;background-color:transpare=
nt">}</span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt=
;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu M=
ono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;back=
ground-color:transparent">Now given the Jackson Parser Java Class, to get a=
 syntactically equivalent YANG model:</span></p><p dir=3D"ltr" style=3D"lin=
e-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15=
px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseli=
ne;white-space:pre-wrap;background-color:transparent">YANGModel build_yang_=
model(Class C) {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-=
top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;U=
buntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wr=
ap;background-color:transparent"> =C2=A0for each instance variable (Type, N=
ame) {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;ma=
rgin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono=
&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backgro=
und-color:transparent"> =C2=A0=C2=A0=C2=A0if (Type is primitive type: strin=
g, number, boolean, null) {</span></p><p dir=3D"ltr" style=3D"line-height:1=
.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-fa=
mily:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-s=
pace:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
add the following to the YANG module:</span></p><p dir=3D"ltr" style=3D"lin=
e-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15=
px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseli=
ne;white-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=E2=80=9Cleaf Name { type &lt;YANG equivalent of Type&gt;; }=E2=
=80=9D</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;ma=
rgin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono=
&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backgro=
und-color:transparent"> =C2=A0=C2=A0=C2=A0}</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-=
size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align=
:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=
=C2=A0if (Type is an ArrayList&lt;TypeElement&gt;) {</span></p><p dir=3D"lt=
r" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=
=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);verti=
cal-align:baseline;white-space:pre-wrap;background-color:transparent"> =C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0if (TypeElement is primitive type) {</span></p><=
p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><=
span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,=
0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transpar=
ent"> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0add the following to the YA=
NG module:</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0p=
t;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu =
Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;bac=
kground-color:transparent"> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=E2=
=80=9Cleaf-list Name { type &lt;YANG equivalent of TypeElement&gt;; }=E2=80=
=9D</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margi=
n-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#3=
9;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background=
-color:transparent"> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} else {</span></p><p di=
r=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span=
 style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0)=
;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"=
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0// TypeElement is a custom pars=
er class</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;=
margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mo=
no&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backg=
round-color:transparent"> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0add the=
 following to the YANG module:</span></p><p dir=3D"ltr" style=3D"line-heigh=
t:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font=
-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;whit=
e-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=E2=80=9Clist Name { &lt;result from build_yang_model&lt;Typ=
eElement.class&gt;&gt; }=E2=80=9D</span></p><p dir=3D"ltr" style=3D"line-he=
ight:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;f=
ont-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;w=
hite-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0}</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;m=
argin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mon=
o&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backgr=
ound-color:transparent"> =C2=A0=C2=A0=C2=A0}</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-=
size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align=
:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=
=C2=A0if (Type is a custom parser class) {</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-=
size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align=
:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0add the following to the YANG module:</span></p><p dir=3D=
"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span sty=
le=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);ver=
tical-align:baseline;white-space:pre-wrap;background-color:transparent"> =
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=E2=80=9Ccontainer Name { &lt;result from bui=
ld_yang_model&lt;Type.class&gt;&gt; }=E2=80=9D =C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-t=
op:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ub=
untu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wra=
p;background-color:transparent"> =C2=A0=C2=A0=C2=A0}</span></p><p dir=3D"lt=
r" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=
=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);verti=
cal-align:baseline;white-space:pre-wrap;background-color:transparent"> =C2=
=A0}</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;marg=
in-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#=
39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backgroun=
d-color:transparent">}</span></p><br><p dir=3D"ltr" style=3D"line-height:1.=
15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-fam=
ily:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-sp=
ace:pre-wrap;background-color:transparent">Result from the previous example=
:</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-=
bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;=
;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-c=
olor:transparent">container meta {</span></p><p dir=3D"ltr" style=3D"line-h=
eight:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;=
font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;=
white-space:pre-wrap;background-color:transparent"> =C2=A0leaf resource-id =
{</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-=
bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;=
;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-c=
olor:transparent"> =C2=A0=C2=A0=C2=A0type string;</span></p><p dir=3D"ltr" =
style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"=
font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-=
align:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0}<=
/span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bo=
ttom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;c=
olor:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-col=
or:transparent"> =C2=A0leaf tag {</span></p><p dir=3D"ltr" style=3D"line-he=
ight:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;f=
ont-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;w=
hite-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=C2=A0type s=
tring;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;ma=
rgin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono=
&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backgro=
und-color:transparent"> =C2=A0}</span></p><p dir=3D"ltr" style=3D"line-heig=
ht:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;fon=
t-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;whi=
te-space:pre-wrap;background-color:transparent">}</span></p><p dir=3D"ltr" =
style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"=
font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-=
align:baseline;white-space:pre-wrap;background-color:transparent">list netw=
ork-map {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt=
;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu M=
ono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;back=
ground-color:transparent"> =C2=A0leaf src {</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-=
size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align=
:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=
=C2=A0type string;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margi=
n-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39=
;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-=
wrap;background-color:transparent"> =C2=A0}</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-=
size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align=
:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0leaf-li=
st dsts {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt=
;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu M=
ono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;back=
ground-color:transparent"> =C2=A0=C2=A0=C2=A0type string;</span></p><p dir=
=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span =
style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);=
vertical-align:baseline;white-space:pre-wrap;background-color:transparent">=
 =C2=A0}</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;=
margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mo=
no&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backg=
round-color:transparent">}</span></p><br><p dir=3D"ltr" style=3D"line-heigh=
t:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font=
-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;whit=
e-space:pre-wrap;background-color:transparent">This does validate the JSON =
document with XML-JSON encoding. For your reference, this is the XML docume=
nt which validates:</span></p><p dir=3D"ltr" style=3D"line-height:1.15;marg=
in-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#3=
9;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre=
-wrap;background-color:transparent">&lt;?xml version=3D&quot;1.0&quot; enco=
ding=3D&quot;UTF-8&quot; ?&gt;</span></p><p dir=3D"ltr" style=3D"line-heigh=
t:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font=
-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;whit=
e-space:pre-wrap;background-color:transparent">&lt;meta&gt;</span></p><p di=
r=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span=
 style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0)=
;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"=
> =C2=A0&lt;resource-id&gt;my-default-map&lt;/resource-id&gt;</span></p><p =
dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><sp=
an style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,=
0);vertical-align:baseline;white-space:pre-wrap;background-color:transparen=
t"> =C2=A0&lt;tag&gt;aab875ef69c87d012&lt;/tag&gt;</span></p><p dir=3D"ltr"=
 style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D=
"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical=
-align:baseline;white-space:pre-wrap;background-color:transparent">&lt;/met=
a&gt;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;mar=
gin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&=
#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backgrou=
nd-color:transparent">&lt;network-map&gt;</span></p><p dir=3D"ltr" style=3D=
"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-siz=
e:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:ba=
seline;white-space:pre-wrap;background-color:transparent"> =C2=A0&lt;src&gt=
;PID1&lt;/src&gt;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin=
-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;=
Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-w=
rap;background-color:transparent"> =C2=A0&lt;dsts&gt;PID1&lt;/dsts&gt;</spa=
n></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom=
:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color=
:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:t=
ransparent"> =C2=A0&lt;dsts&gt;PID2&lt;/dsts&gt;</span></p><p dir=3D"ltr" s=
tyle=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"f=
ont-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-a=
lign:baseline;white-space:pre-wrap;background-color:transparent"> =C2=A0&lt=
;dsts&gt;PID3&lt;/dsts&gt;</span></p><p dir=3D"ltr" style=3D"line-height:1.=
15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-fam=
ily:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-sp=
ace:pre-wrap;background-color:transparent">&lt;/network-map&gt;</span></p><=
p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><=
span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,=
0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transpar=
ent">&lt;network-map&gt;</span></p><p dir=3D"ltr" style=3D"line-height:1.15=
;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-famil=
y:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-spac=
e:pre-wrap;background-color:transparent"> =C2=A0&lt;src&gt;PID2&lt;/src&gt;=
</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-b=
ottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;=
color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-co=
lor:transparent"> =C2=A0&lt;dsts&gt;PID1&lt;/dsts&gt;</span></p><p dir=3D"l=
tr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=
=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);verti=
cal-align:baseline;white-space:pre-wrap;background-color:transparent"> =C2=
=A0&lt;dsts&gt;PID3&lt;/dsts&gt;</span></p><p dir=3D"ltr" style=3D"line-hei=
ght:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;fo=
nt-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;wh=
ite-space:pre-wrap;background-color:transparent">&lt;/network-map&gt;</span=
></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:=
0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:=
rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:tr=
ansparent">&lt;network-map&gt;</span></p><p dir=3D"ltr" style=3D"line-heigh=
t:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font=
-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;whit=
e-space:pre-wrap;background-color:transparent"> =C2=A0&lt;src&gt;PID3&lt;/s=
rc&gt;</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;ma=
rgin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono=
&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backgro=
und-color:transparent"> =C2=A0&lt;dsts&gt;PID2&lt;/dsts&gt;</span></p><p di=
r=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span=
 style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0)=
;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"=
> =C2=A0&lt;dsts&gt;PID3&lt;/dsts&gt;</span></p><p dir=3D"ltr" style=3D"lin=
e-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15=
px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseli=
ne;white-space:pre-wrap;background-color:transparent">&lt;/network-map&gt;<=
/span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margi=
n-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#3=
9;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background=
-color:transparent">This proves that the message encoding condition is a su=
fficient condition for the JSON object to have a YANG model.</span></p><br>=
<p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt">=
<span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0=
,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transpa=
rent">Note the model generated is very crude and lose almost all constraint=
s and all inheritance features (if any), because it focuses on the syntax a=
nd is essentially converted from an JSON object compliant with a protocol i=
nstead of from the protocol itself. Hence this result is more useful in det=
ermining which JSON based protocols cannot have a syntactically equivalent =
YANG model, than in generating a good YANG model.</span></p><br><p dir=3D"l=
tr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=
=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);verti=
cal-align:baseline;white-space:pre-wrap;background-color:transparent">3.3. =
Conclusion</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0p=
t;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu =
Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;bac=
kground-color:transparent">Our claim holds. A JSON based protocol carried b=
y HTTP can have syntactically equivalent YANG model, if and only if all the=
 keys in the key-value pairs in the JSON message are pre-defined keywords.<=
/span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margi=
n-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#3=
9;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background=
-color:transparent">4. Semantic equivalence</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-=
size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align=
:baseline;white-space:pre-wrap;background-color:transparent">For JSON based=
 protocols that don=E2=80=99t satisfy the message encoding condition, it is=
 still possible to have a semantically equivalent YANG model. All that is r=
equired for the protocol compliant clients and the YANG model compliant ser=
ver to interoperate is an adapter which does the following:</span></p><br><=
p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><=
span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,=
0,0);vertical-align:baseline;white-space:pre-wrap;background-color:transpar=
ent">1) translate FROM YANG server compliant response msg TO alto compliant=
 response msg</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top=
:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubun=
tu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;=
background-color:transparent">2) translate FROM alto compliant request msg =
TO YANG server compliant request msg</span></p><br><p dir=3D"ltr" style=3D"=
line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size=
:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:bas=
eline;white-space:pre-wrap;background-color:transparent">4.1. Claim</span><=
/p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0p=
t"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rg=
b(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:tran=
sparent">This adapter needs to be protocol-aware.</span></p><br><p dir=3D"l=
tr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=
=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);verti=
cal-align:baseline;white-space:pre-wrap;background-color:transparent">Ideal=
ly, given any YANG model, we would like to be able to automatically (or at =
least mechanically) generate this message adapter, which means not looking =
at the protocol or its compliant msgs. However, without knowing the specifi=
c protocol that we are working with (i.e. human intervention, i.e. looking =
at the protocol compliant msgs), such an adapter cannot be auto-generated.<=
/span></p><br><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margi=
n-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#3=
9;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background=
-color:transparent">4.2. Proof by Indistinguishability</span></p><p dir=3D"=
ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vert=
ical-align:baseline;white-space:pre-wrap;background-color:transparent">Supp=
ose both the YANG server compliant msg m_y and the actually protocol compli=
ant msg m_p are in JSON (or have been encoded into JSON). Looking at the di=
fferences between the two messages, call these differences {d1, d2, ..., dn=
}. The goal for the auto-generated adapter would be to identify and elimina=
te these differences. Construct a new JSON msg m&#39; where all but one dif=
ference di is the same as m_p and di is the same as the m_y. Without lookin=
g at the protocol (or m_p), the auto-generated adapter would not be able to=
 distinguish between m&#39; and m_p in its translation process, which means=
, it won&#39;t be able to tell whether it should change di or not. Hence, s=
uch an adapter must be protocol-aware.</span></p><br><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-=
size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align=
:baseline;white-space:pre-wrap;background-color:transparent">A good example=
 is the dependent-vtag in the ALTO protocol:</span></p><p dir=3D"ltr" style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-=
size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align=
:baseline;white-space:pre-wrap;background-color:transparent">&quot;dependen=
t-vtag&quot; : [</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-=
top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;U=
buntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wr=
ap;background-color:transparent"> =C2=A0{</span></p><p dir=3D"ltr" style=3D=
"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-siz=
e:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:ba=
seline;white-space:pre-wrap;background-color:transparent"> =C2=A0=C2=A0=C2=
=A0&quot;resource-id&quot; : &quot;my-network-map&quot;,</span></p><p dir=
=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span =
style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);=
vertical-align:baseline;white-space:pre-wrap;background-color:transparent">=
 =C2=A0=C2=A0=C2=A0&quot;tag&quot; : &quot;abcd1234&quot;</span></p><p dir=
=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span =
style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);=
vertical-align:baseline;white-space:pre-wrap;background-color:transparent">=
 =C2=A0}</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;=
margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mo=
no&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backg=
round-color:transparent">]</span></p><br><p dir=3D"ltr" style=3D"line-heigh=
t:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font=
-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;whit=
e-space:pre-wrap;background-color:transparent">It was specified this way in=
 the alto protocol. However, it could conceivably be the case that it was o=
riginally the following map structure, and was converted into the above enc=
oding because of the map-&gt;list+key issue. (This case is actually one of =
the few differences in the m_y and m_p where the adapter does not need to c=
onvert it back to a map structure.)</span></p><p dir=3D"ltr" style=3D"line-=
height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px=
;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline=
;white-space:pre-wrap;background-color:transparent">&quot;dependent-vtag&qu=
ot; : {</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;m=
argin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mon=
o&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;backgr=
ound-color:transparent"> =C2=A0&quot;my-network-map&quot; : {</span></p><p =
dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><sp=
an style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,=
0);vertical-align:baseline;white-space:pre-wrap;background-color:transparen=
t"> =C2=A0=C2=A0=C2=A0&quot;tag&quot; : &quot;abcd1234&quot;</span></p><p d=
ir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><spa=
n style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0=
);vertical-align:baseline;white-space:pre-wrap;background-color:transparent=
"> =C2=A0}</span></p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0p=
t;margin-bottom:0pt"><span style=3D"font-size:15px;font-family:&#39;Ubuntu =
Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;bac=
kground-color:transparent">}</span></p><br><p dir=3D"ltr" style=3D"line-hei=
ght:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;fo=
nt-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;wh=
ite-space:pre-wrap;background-color:transparent">Without knowing the protoc=
ol, there is no way to tell. </span></p><br><p dir=3D"ltr" style=3D"line-he=
ight:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;f=
ont-family:&#39;Ubuntu Mono&#39;;color:rgb(0,0,0);vertical-align:baseline;w=
hite-space:pre-wrap;background-color:transparent">5. Ramifications</span></=
p><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt=
"><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;color:rgb=
(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-color:trans=
parent">We now understand the basic condition for a JSON based protocol to =
have a YANG Model. For the protocols that don=E2=80=99t meet this condition=
, there can be a semantic equivalent YANG model, but there won=E2=80=99t be=
 a generic process of generating the adapter for all such protocols.</span>=
</p><div><span style=3D"font-size:15px;font-family:&#39;Ubuntu Mono&#39;;co=
lor:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap;background-colo=
r:transparent"><br></span></div></span></div></div>

--001a11c1c058bce7bd0505d480e7--


From nobody Mon Oct 20 06:06:48 2014
Return-Path: <vkg@bell-labs.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id F35E71A873A for <alto@ietfa.amsl.com>; Mon, 20 Oct 2014 06:06:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.001
X-Spam-Level: 
X-Spam-Status: No, score=0.001 tagged_above=-999 required=5 tests=[BAYES_40=-0.001, URIBL_DBL_ABUSE_REDIR=0.001, URIBL_DBL_REDIR=0.001] autolearn=ham
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 9sstz7E_EZk8 for <alto@ietfa.amsl.com>; Mon, 20 Oct 2014 06:06:40 -0700 (PDT)
Received: from smtp-us.alcatel-lucent.com (us-hpatc-esg-02.alcatel-lucent.com [135.245.18.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C41F31A8725 for <alto@ietf.org>; Mon, 20 Oct 2014 06:06:38 -0700 (PDT)
Received: from us70uusmtp4.zam.alcatel-lucent.com (unknown [135.5.2.66]) by Websense Email Security Gateway with ESMTPS id 68C6582D60778 for <alto@ietf.org>; Mon, 20 Oct 2014 13:06:36 +0000 (GMT)
Received: from usnavsmail4.ndc.alcatel-lucent.com (usnavsmail4.ndc.alcatel-lucent.com [135.3.39.12]) by us70uusmtp4.zam.alcatel-lucent.com (GMO) with ESMTP id s9KD6ZvU008143 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for <alto@ietf.org>; Mon, 20 Oct 2014 09:06:37 -0400
Received: from umail.lucent.com (umail.ndc.lucent.com [135.3.40.61]) by usnavsmail4.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id s9KD6YdV024081 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for <alto@ietf.org>; Mon, 20 Oct 2014 08:06:34 -0500
Received: from shoonya.ih.lucent.com (shoonya.ih.lucent.com [135.185.238.169]) by umail.lucent.com (8.13.8/TPES) with ESMTP id s9KD6YVq025300 for <alto@ietf.org>; Mon, 20 Oct 2014 08:06:34 -0500 (CDT)
Message-ID: <544509C9.6030901@bell-labs.com>
Date: Mon, 20 Oct 2014 08:10:33 -0500
From: "Vijay K. Gurbani" <vkg@bell-labs.com>
Organization: Bell Laboratories, Alcatel-Lucent
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.1.1
MIME-Version: 1.0
To: alto <alto@ietf.org>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.64 on 135.3.39.12
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/c9h3TiOsNGlpSf0MDPr1wh1F79c
Subject: [alto] Agenda requests for IETF 91
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Oct 2014 13:06:47 -0000

Folks: Please send me, Enrico and Jan the agenda requests for the
upcoming meeting in HI.

We have a 2.5 hour session on Thu, Nov 13 2014 1640-1910 local time.

As usual, agenda time will be prioritized according to item discussion
on the mailing list.

When sending a request, please indicate title, relevant drafts,
presenter, and time requested.

Thanks,

- vijay
-- 
Vijay K. Gurbani, Bell Laboratories, Alcatel-Lucent
1960 Lucent Lane, Rm. 9C-533, Naperville, Illinois 60563 (USA)
Email: vkg@{bell-labs.com,acm.org} / vijay.gurbani@alcatel-lucent.com
Web: http://ect.bell-labs.com/who/vkg/  | Calendar: http://goo.gl/x3Ogq


From nobody Mon Oct 20 07:00:32 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C65DE1A88BB; Mon, 20 Oct 2014 07:00:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.377
X-Spam-Level: 
X-Spam-Status: No, score=-1.377 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 zbZGHfyTnNUJ; Mon, 20 Oct 2014 07:00:09 -0700 (PDT)
Received: from mail-yh0-x233.google.com (mail-yh0-x233.google.com [IPv6:2607:f8b0:4002:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B61CA1A87AD; Mon, 20 Oct 2014 06:57:39 -0700 (PDT)
Received: by mail-yh0-f51.google.com with SMTP id t59so3189492yho.10 for <multiple recipients>; Mon, 20 Oct 2014 06:57:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=bpSD3PG2q+dxL6we/q9xcFmRSf/de630JKSZVZ8+/Jc=; b=cFDLPjtjYZYWxy7ZouNPLNhpI9kxeTfkUMWlf66jA7Mka4gE8lEOfmzz/5s/8UK8x7 X0vNAs2pvSsCrA0t1nncTxrTwULIbmOOzaJikmkVhyIxVDj033Eof8mDFD4JMQsr5/jG /n+u1tH7HAFjihpYEryIH54VHsoSq11ldrNR8mU+pKw09Jp3VZcKmcst2CUOdewgD+Ew 1xwiOqwM48rQO6R7bRJNV+EfzNVfx6vj+cEYN0j8L8k3niSF4DgitiPwm4OBsManTPir lGpk5Ws8W+yhefcmE1pbbhJnGuVNE6dw3tK59ztQOF1isyrC81ZX0qxSco3olnI5E0lO 8Ttw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=bpSD3PG2q+dxL6we/q9xcFmRSf/de630JKSZVZ8+/Jc=; b=lm07pSlLiFHD1/L78lggSz6Zjzq+vkqeOLs/cFTaIWKKhED7T+zX+mq0aPBG8A1BPc N+FMz4nUzR5K7teaY7wEWWwixYYrt2BEYkmEqgxqmpKtAdQ5ppzOkUsrD2TJahdewERm QcWdsCdfe0BB69WtDF111jvpsf2cGiXNza0cE=
X-Received: by 10.236.17.129 with SMTP id j1mr3295248yhj.143.1413813458992; Mon, 20 Oct 2014 06:57:38 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.97.10 with HTTP; Mon, 20 Oct 2014 06:57:18 -0700 (PDT)
In-Reply-To: <m2tx2ynadg.fsf@nic.cz>
References: <CAFwJzZkAp-4umrrHZEY3qYuFCXu=+Pqbh8SeB=Qr=TTbQurj6A@mail.gmail.com> <m2tx2ynadg.fsf@nic.cz>
From: Xiao SHI <xiao.shi@yale.edu>
Date: Mon, 20 Oct 2014 09:57:18 -0400
X-Google-Sender-Auth: 0zvX13JZCe841QZKaEe0nW5Gk4g
Message-ID: <CAFwJzZ=kv7_W=mrJz77Y1DTkL_Cq-o+B-FDJERy-8g-OCVbj5g@mail.gmail.com>
To: Ladislav Lhotka <lhotka@nic.cz>
Content-Type: multipart/alternative; boundary=001a11c1e2dc0083860505db1943
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/j2W85tElb3fVn5GoIJRydor52OE
Cc: Xiao SHI <xiao.shi@yale.edu>, IETF ALTO <alto@ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [alto] [netmod] Modeling JSON based protocols using YANG
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Oct 2014 14:00:16 -0000

--001a11c1e2dc0083860505db1943
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi Lada,

Thank you so much for your feedback!

The motivation here is to produce a YANG model given a defined protocol,
e.g. ALTO, CDNi, etc. This way, we may incorporate future protocols into
ODL controllers or use other YANG related tools to handle those protocols.
Hence the objective of the modeling is the protocol, not the messages. I am
not suggesting to use YANG as a schema language.

The conditions discussed in this process will be helpful in the following
sense:
1) disprove the possibility to get a syntactically equivalent YANG model
from a JSON based protocol;
2) generate a Jackson JSON parser class and YANG model from the protocols
that meet the criteria;
3) for designers of future protocols who are thinking of using YANG related
tools, set a guideline of what their messages should look like (or MUST not
contain);
4) for the YANG/NETCONF WG, describing the compatibility issues that they
might be interested in tackling for expanding YANG's usage.

For this example, "foo": [ { "bar": 1 }, 2 ] is also not easy to do
data-binding in the parser, because the elements of the array are not of
the same type, which is indeed an assumption that I left out.

For the {"foo=E2=80=9D:null} example, can't we model it using type empty? T=
hat's
equivalent to the XML element <foo /> right?

Cheers,
Xiao

On Mon, Oct 20, 2014 at 9:23 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:

> Xiao SHI <xiao.shi@yale.edu> writes:
>
> > Hi folks,
> >
> >
> > As a few of us were working on modeling the ALTO protocol using YANG, w=
e
> > were pondering on a more general question: can YANG model all JSON base=
d
> > protocols? What is the condition for a JSON based protocol (at least th=
e
> > message format) to have an syntactically equivalent, hence interoperabl=
e,
> > YANG model with JSON encoding? Alternatively, in order to interoperate,
> > semantic equivalence might be sufficient, is there any condition for
> > semantic equivalence?
> >
> >
> > tl;dr: A JSON based protocol carried by HTTP can have syntactically
> > equivalent YANG model, if and only if all the keys in the key-value pai=
rs
> > in the JSON message are pre-defined keywords in the protocol.
> >
>
> Generating a YANG data model from existing instance data seems backwards
> to me, although Examplotron (http://examplotron.org) does something quite
> similar. In any case, it might be quite challenging because YANG isn't
> intended as a general schema language. Your observation above is true
> but it is just one aspect of the problem. For instance
>
> "foo": [ { "bar": 1 }, 2 ]
>
> or
>
> "foo": null
>
> cannot be modelled in YANG using the encoding of
> draft-ietf-netmod-yang-json.
>
> Lada
>
> >
> > We've come up with a few ideas, and a few things below are work in
> > progress, but we would love your feedback!
> >
> >
> > Thank you!
> >
> > Xiao
> >
> >
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >
> > 1. Introduction.
> >
> > JavaScript Object Notation (JSON) has been a popular choice as the
> message
> > encoding for many network protocols such as the Application Layer Traff=
ic
> > Optimization (ALTO) protocol, the Content Delivery Networks
> Interconnection
> > (CDNi) protocol, etc.
> >
> > Meanwhile, there are broad interests in the networking community to use
> > YANG to define data model so that one can use YANG related tools such a=
s
> > OpenDayLight controller. Although YANG itself is XML based, there have
> been
> > efforts to model JSON content using YANG
> [draft-ietf-netmod-yang-json-01].
> >
> > A natural question rises: can YANG model all JSON based protocols? What
> is
> > the condition for a JSON based protocol (at least the message format) t=
o
> > have an syntactically equivalent, hence interoperable, YANG model with
> JSON
> > encoding? Alternatively, in order to interoperate, semantic equivalence
> > might be sufficient, is there any condition for semantic equivalence?
> >
> > 2. Claim
> >
> > A JSON based protocol carried by HTTP can have syntactically equivalent
> > YANG model, if and only if:
> >
> > (1) the message encoding condition is met;
> >
> > (2) the uri condition is met.
> >
> > 2.1. The message encoding condition
> >
> > The JSON message encoding MUST not contain a variable as a key in a JSO=
N
> > object key-value pair. In other words, the keys in the JSON message mus=
t
> be
> > an already defined constant (or keyword) in the message format of the
> > protocol.
> >
> > For example, if I have a protocol where =E2=80=9Cnetwork-map=E2=80=9D, =
=E2=80=9Csrc=E2=80=9D, and =E2=80=9Cdsts=E2=80=9D
> > are defined keywords, JSON text A meets the condition whereas B does no=
t
> > because =E2=80=9CPID1=E2=80=9D and =E2=80=9CPID2=E2=80=9D are not proto=
col keywords (they are resource
> IDs).
> >
> > A:
> >
> > {
> >
> >  =E2=80=9Cnetwork-map=E2=80=9D: [
> >
> >    {
> >
> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,
> >
> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=
=80=9D]
> >
> >    },
> >
> >    {
> >
> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,
> >
> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=E2=
=80=9D]
> >
> >    }
> >
> >  ]
> >
> > }
> >
> > B:
> >
> >
> > {
> >
> >  =E2=80=9Cnetwork-map=E2=80=9D: [
> >
> >    =E2=80=9CPID1: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=9D],
> >
> >    =E2=80=9CPID2=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=E2=80=
=9D]
> >
> >  ]
> >
> > }
> >
> >>From this we know that since ALTO protocol uses encoding B, there canno=
t
> be
> > a syntactically equivalent YANG model.
> >
> > 2.2 The URI condition
> >
> > Some of the YANG-related protocols might have URI constraints, e.g.
> > RESTCONF. For now, we assume either that the JSON-based protocol URI
> could
> > be conformed to RESTCONF compliant uri, or that the server could have a
> > routing mapping between the protocol compliant uri and the RESTCONF
> > compliant uri, hence this condition would not be an issue, which allows
> us
> > to focus on the message encoding condition.
> >
> > 3. Proof
> >
> > 3.1. The message encoding condition is necessary.
> >
> > We first note that this condition is a necessary condition for a JSON
> based
> > protocol to have a syntactically equivalent YANG model by proving its
> > contrapositive.
> >
> > If one of the keys in the key-value pair in the JSON document is not
> > pre-defined, the corresponding XML tags will not be pre-defined keyword=
s.
> > Therefore, it would not possible to model it in YANG without using
> > YANG=E2=80=99s anyxml
> > statement (which allows arbitrary XML content).
> >
> > However, using the anyxml statement would defeat our purpose of modelin=
g
> > the data as it allows arbitrary XML content, and will not be helpful in
> the
> > subsequent parsing process.
> >
> > 3.2. The message encoding condition is sufficient.
> >
> > We prove this by providing a translation procedure from a JSON message
> that
> > is compliant with the protocol we are trying to model, to a custom java
> > class that can be used for Jackson data binding, then to a YANG model.
> >
> > We note that the middle step of translating to and from the custom pars=
er
> > class is not necessary, but it will be useful.
> >
> > 3.2.1. motivation
> >
> > JSON data binding is the process of binding data structures (objects,
> > arrays, etc.) in JSON to the appropriate data structures in the server
> > (e.g. java classes, database tables, etc.) in parsing the JSON text. In
> > order to process JSON messages in a meaningful manner, data binding is
> > necessary. Even if the binding is not explicit, the server would need t=
o
> do
> > it eventually. For example, one can read JSON content in a stream witho=
ut
> > binding it to the java classes, but eventually in order to make sense o=
f
> > the data, the server would eventually have to organize it, which is
> roughly
> > analogous to data binding upfront. Popular choices for JSON parsing and
> > data binding include jackson and gson.
> >
> > We use Jackson full data binding as our approach. Full data binding bin=
ds
> > JSON content into plain old java objects (POJOs), i.e. this custom pars=
er
> > class can neither extend nor implement any other class. Jackson uses
> > ObjectMapper with the custom parser class to parse JSON content into th=
is
> > class.
> >
> > 3.2.2. The message encoding condition
> >
> > The message encoding condition is that all keys in each key-value pair =
in
> > the JSON text must be pre-defined keywords. As the keys will become
> either
> > class names and instance variable names, or be keys in the java maps, i=
t
> is
> > easy to see that the condition is equivalent to =E2=80=9Cthere exists a=
 full data
> > binding in Jackson custom parser class without using any map structures
> > (Map<String, ?>).=E2=80=9D
> >
> > 3.2.3. Proof
> >
> > We provide a recursive binding process from a JSON object to the Jackso=
n
> > custom parser class to be used by Jackson ObjectMapper.
> >
> > Type determine_type(value) {
> >
> >  if (value is of a primitive type, i.e. string, number, boolean, null) =
{
> >
> >    return the corresponding java primitive type;
> >
> >  }
> >
> >  if (value is a JSON object) {
> >
> >    return build_parser_class(value).class;
> >
> >  }
> >
> >  if (value is an array) {
> >
> >    return ArrayList<T> where T=3Ddetermine_type(value[0]);
> >
> >  }
> >
> >  // should not reach here.
> >
> > }
> >
> > Class build_parser_class(JSONObject obj) {
> >
> >  create custom class C;
> >
> >  for each key/value pair in the obj {
> >
> >    add instance variable v in C;
> >
> >    the name of variable v <- key; // (__known__ a/c to our assumption)
> >
> >    the type of variable v <- determine_type(value);
> >
> >  }
> >
> >  return C.class;
> >
> > }
> >
> > Naming:
> >
> > --change everything into CamelCase (i.e. remove dashes, etc.)
> >
> > --for instance variables, use =E2=80=9Cmy=E2=80=9D prefix, (e.g. myVari=
able,
> myNetworkMap,
> > etc.)
> >
> > --for the custom class name, if the object is an element of the array,
> use
> > =E2=80=9CElement=E2=80=9D suffix.
> >
> > This is just one convention so that the next step proceeds smoothly. As
> > long as this naming translation is consistent with the naming stage in
> the
> > next step, it will work just fine.
> >
> > Example (a modified ALTO protocol network map example):
> >
> > JSON object:
> >
> > {
> >
> >  =E2=80=9Cmeta=E2=80=9D: {
> >
> >    =E2=80=9Cresource-id=E2=80=9D: =E2=80=9Cmy-default-map=E2=80=9D,
> >
> >    =E2=80=9Ctag=E2=80=9D: =E2=80=9Caab875ef69c87d012=E2=80=9D
> >
> >  },
> >
> >  =E2=80=9Cnetwork-map=E2=80=9D: [
> >
> >    {
> >
> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,
> >
> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =E2=80=9CPID2=E2=
=80=9D, =E2=80=9CPID3=E2=80=9D]
> >
> >    },
> >
> >    {
> >
> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,
> >
> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =E2=80=9CPID3=E2=
=80=9D]
> >
> >    },
> >
> >    {
> >
> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID3=E2=80=9D,
> >
> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=
=80=9D]
> >
> >    }
> >
> >  ]
> >
> > }
> >
> > Result of build_parser_class(obj):
> >
> > Class JSONObject {
> >
> >  Meta myMeta;
> >
> >  ArrayList<NetworkMapElement> myNetworkMap;
> >
> > }
> >
> > Class Meta {
> >
> >  String myResourceId;
> >
> >  String myTag;
> >
> > }
> >
> > Class NetworkMapElement {
> >
> >  String mySrc;
> >
> >  ArrayList<String> myDsts;
> >
> > }
> >
> > Now given the Jackson Parser Java Class, to get a syntactically
> equivalent
> > YANG model:
> >
> > YANGModel build_yang_model(Class C) {
> >
> >  for each instance variable (Type, Name) {
> >
> >    if (Type is primitive type: string, number, boolean, null) {
> >
> >      add the following to the YANG module:
> >
> >      =E2=80=9Cleaf Name { type <YANG equivalent of Type>; }=E2=80=9D
> >
> >    }
> >
> >    if (Type is an ArrayList<TypeElement>) {
> >
> >      if (TypeElement is primitive type) {
> >
> >        add the following to the YANG module:
> >
> >        =E2=80=9Cleaf-list Name { type <YANG equivalent of TypeElement>;=
 }=E2=80=9D
> >
> >      } else {
> >
> >        // TypeElement is a custom parser class
> >
> >        add the following to the YANG module:
> >
> >        =E2=80=9Clist Name { <result from build_yang_model<TypeElement.c=
lass>> }=E2=80=9D
> >
> >      }
> >
> >    }
> >
> >    if (Type is a custom parser class) {
> >
> >      add the following to the YANG module:
> >
> >      =E2=80=9Ccontainer Name { <result from build_yang_model<Type.class=
>> }=E2=80=9D
> >
> >    }
> >
> >  }
> >
> > }
> >
> > Result from the previous example:
> >
> > container meta {
> >
> >  leaf resource-id {
> >
> >    type string;
> >
> >  }
> >
> >  leaf tag {
> >
> >    type string;
> >
> >  }
> >
> > }
> >
> > list network-map {
> >
> >  leaf src {
> >
> >    type string;
> >
> >  }
> >
> >  leaf-list dsts {
> >
> >    type string;
> >
> >  }
> >
> > }
> >
> > This does validate the JSON document with XML-JSON encoding. For your
> > reference, this is the XML document which validates:
> >
> > <?xml version=3D"1.0" encoding=3D"UTF-8" ?>
> >
> > <meta>
> >
> >  <resource-id>my-default-map</resource-id>
> >
> >  <tag>aab875ef69c87d012</tag>
> >
> > </meta>
> >
> > <network-map>
> >
> >  <src>PID1</src>
> >
> >  <dsts>PID1</dsts>
> >
> >  <dsts>PID2</dsts>
> >
> >  <dsts>PID3</dsts>
> >
> > </network-map>
> >
> > <network-map>
> >
> >  <src>PID2</src>
> >
> >  <dsts>PID1</dsts>
> >
> >  <dsts>PID3</dsts>
> >
> > </network-map>
> >
> > <network-map>
> >
> >  <src>PID3</src>
> >
> >  <dsts>PID2</dsts>
> >
> >  <dsts>PID3</dsts>
> >
> > </network-map>
> >
> > This proves that the message encoding condition is a sufficient conditi=
on
> > for the JSON object to have a YANG model.
> >
> > Note the model generated is very crude and lose almost all constraints
> and
> > all inheritance features (if any), because it focuses on the syntax and
> is
> > essentially converted from an JSON object compliant with a protocol
> instead
> > of from the protocol itself. Hence this result is more useful in
> > determining which JSON based protocols cannot have a syntactically
> > equivalent YANG model, than in generating a good YANG model.
> >
> > 3.3. Conclusion
> >
> > Our claim holds. A JSON based protocol carried by HTTP can have
> > syntactically equivalent YANG model, if and only if all the keys in the
> > key-value pairs in the JSON message are pre-defined keywords.
> >
> > 4. Semantic equivalence
> >
> > For JSON based protocols that don=E2=80=99t satisfy the message encodin=
g
> condition,
> > it is still possible to have a semantically equivalent YANG model. All
> that
> > is required for the protocol compliant clients and the YANG model
> compliant
> > server to interoperate is an adapter which does the following:
> >
> > 1) translate FROM YANG server compliant response msg TO alto compliant
> > response msg
> >
> > 2) translate FROM alto compliant request msg TO YANG server compliant
> > request msg
> >
> > 4.1. Claim
> >
> > This adapter needs to be protocol-aware.
> >
> > Ideally, given any YANG model, we would like to be able to automaticall=
y
> > (or at least mechanically) generate this message adapter, which means n=
ot
> > looking at the protocol or its compliant msgs. However, without knowing
> the
> > specific protocol that we are working with (i.e. human intervention, i.=
e.
> > looking at the protocol compliant msgs), such an adapter cannot be
> > auto-generated.
> >
> > 4.2. Proof by Indistinguishability
> >
> > Suppose both the YANG server compliant msg m_y and the actually protoco=
l
> > compliant msg m_p are in JSON (or have been encoded into JSON). Looking
> at
> > the differences between the two messages, call these differences {d1, d=
2,
> > ..., dn}. The goal for the auto-generated adapter would be to identify
> and
> > eliminate these differences. Construct a new JSON msg m' where all but
> one
> > difference di is the same as m_p and di is the same as the m_y. Without
> > looking at the protocol (or m_p), the auto-generated adapter would not =
be
> > able to distinguish between m' and m_p in its translation process, whic=
h
> > means, it won't be able to tell whether it should change di or not.
> Hence,
> > such an adapter must be protocol-aware.
> >
> > A good example is the dependent-vtag in the ALTO protocol:
> >
> > "dependent-vtag" : [
> >
> >  {
> >
> >    "resource-id" : "my-network-map",
> >
> >    "tag" : "abcd1234"
> >
> >  }
> >
> > ]
> >
> > It was specified this way in the alto protocol. However, it could
> > conceivably be the case that it was originally the following map
> structure,
> > and was converted into the above encoding because of the map->list+key
> > issue. (This case is actually one of the few differences in the m_y and
> m_p
> > where the adapter does not need to convert it back to a map structure.)
> >
> > "dependent-vtag" : {
> >
> >  "my-network-map" : {
> >
> >    "tag" : "abcd1234"
> >
> >  }
> >
> > }
> >
> > Without knowing the protocol, there is no way to tell.
> >
> > 5. Ramifications
> >
> > We now understand the basic condition for a JSON based protocol to have=
 a
> > YANG Model. For the protocols that don=E2=80=99t meet this condition, t=
here can
> be
> > a semantic equivalent YANG model, but there won=E2=80=99t be a generic =
process of
> > generating the adapter for all such protocols.
> > _______________________________________________
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod
>
> --
> Ladislav Lhotka, CZ.NIC Labs
> PGP Key ID: E74E8C0C
>

--001a11c1e2dc0083860505db1943
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Lada,<div><br></div><div>Thank you so much for your fee=
dback!<br><div><br></div><div>The motivation here is to produce a YANG mode=
l given a defined protocol, e.g. ALTO, CDNi, etc. This way, we may incorpor=
ate future protocols into ODL controllers or use other YANG related tools t=
o handle those protocols. Hence the objective of the modeling is the protoc=
ol, not the messages. I am not suggesting to use YANG as a schema language.=
</div><div><br></div><div>The conditions discussed in this process will be =
helpful in the following sense:</div><div>1) disprove the possibility to ge=
t a syntactically equivalent YANG model from a JSON based protocol;</div><d=
iv>2) generate a Jackson JSON parser class and YANG model from the protocol=
s that meet the criteria;</div><div>3) for designers of future protocols wh=
o are thinking of using YANG related tools, set a guideline of what their m=
essages should look like (or MUST not contain);</div><div>4) for the YANG/N=
ETCONF WG, describing the compatibility issues that they might be intereste=
d in tackling for expanding YANG&#39;s usage.=C2=A0</div><div><br></div><di=
v><span style=3D"font-family:arial,sans-serif;font-size:13px">For this exam=
ple, &quot;foo&quot;: [ { &quot;bar&quot;: 1 }, 2 ] is also not easy to do =
data-binding in the parser, because the elements of the array are not of th=
e same type, which is indeed an assumption that I left out.</span><br></div=
><div><span style=3D"font-family:arial,sans-serif;font-size:13px"><br></spa=
n></div><div><span style=3D"font-family:arial,sans-serif;font-size:13px">Fo=
r the {&quot;foo=E2=80=9D:null} example, can&#39;t we model it using type e=
mpty? That&#39;s equivalent to the XML element &lt;foo /&gt; right?</span><=
/div><div><span style=3D"font-family:arial,sans-serif;font-size:13px"><br><=
/span></div><div><font face=3D"arial, sans-serif">Cheers,</font></div><div>=
<font face=3D"arial, sans-serif">Xiao</font></div></div></div><div class=3D=
"gmail_extra"><br><div class=3D"gmail_quote">On Mon, Oct 20, 2014 at 9:23 A=
M, Ladislav Lhotka <span dir=3D"ltr">&lt;<a href=3D"mailto:lhotka@nic.cz" t=
arget=3D"_blank">lhotka@nic.cz</a>&gt;</span> wrote:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><span class=3D"">Xiao SHI &lt;<a href=3D"mailto:xiao.shi@yale=
.edu">xiao.shi@yale.edu</a>&gt; writes:<br>
<br>
&gt; Hi folks,<br>
&gt;<br>
&gt;<br>
&gt; As a few of us were working on modeling the ALTO protocol using YANG, =
we<br>
&gt; were pondering on a more general question: can YANG model all JSON bas=
ed<br>
&gt; protocols? What is the condition for a JSON based protocol (at least t=
he<br>
&gt; message format) to have an syntactically equivalent, hence interoperab=
le,<br>
&gt; YANG model with JSON encoding? Alternatively, in order to interoperate=
,<br>
&gt; semantic equivalence might be sufficient, is there any condition for<b=
r>
&gt; semantic equivalence?<br>
&gt;<br>
&gt;<br>
&gt; tl;dr: A JSON based protocol carried by HTTP can have syntactically<br=
>
&gt; equivalent YANG model, if and only if all the keys in the key-value pa=
irs<br>
&gt; in the JSON message are pre-defined keywords in the protocol.<br>
&gt;<br>
<br>
</span>Generating a YANG data model from existing instance data seems backw=
ards<br>
to me, although Examplotron (<a href=3D"http://examplotron.org" target=3D"_=
blank">http://examplotron.org</a>) does something quite<br>
similar. In any case, it might be quite challenging because YANG isn&#39;t<=
br>
intended as a general schema language. Your observation above is true<br>
but it is just one aspect of the problem. For instance<br>
<br>
&quot;foo&quot;: [ { &quot;bar&quot;: 1 }, 2 ]<br>
<br>
or<br>
<br>
&quot;foo&quot;: null<br>
<br>
cannot be modelled in YANG using the encoding of<br>
draft-ietf-netmod-yang-json.<br>
<br>
Lada<br>
<div><div class=3D"h5"><br>
&gt;<br>
&gt; We&#39;ve come up with a few ideas, and a few things below are work in=
<br>
&gt; progress, but we would love your feedback!<br>
&gt;<br>
&gt;<br>
&gt; Thank you!<br>
&gt;<br>
&gt; Xiao<br>
&gt;<br>
&gt;<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
&gt;<br>
&gt; 1. Introduction.<br>
&gt;<br>
&gt; JavaScript Object Notation (JSON) has been a popular choice as the mes=
sage<br>
&gt; encoding for many network protocols such as the Application Layer Traf=
fic<br>
&gt; Optimization (ALTO) protocol, the Content Delivery Networks Interconne=
ction<br>
&gt; (CDNi) protocol, etc.<br>
&gt;<br>
&gt; Meanwhile, there are broad interests in the networking community to us=
e<br>
&gt; YANG to define data model so that one can use YANG related tools such =
as<br>
&gt; OpenDayLight controller. Although YANG itself is XML based, there have=
 been<br>
&gt; efforts to model JSON content using YANG [draft-ietf-netmod-yang-json-=
01].<br>
&gt;<br>
&gt; A natural question rises: can YANG model all JSON based protocols? Wha=
t is<br>
&gt; the condition for a JSON based protocol (at least the message format) =
to<br>
&gt; have an syntactically equivalent, hence interoperable, YANG model with=
 JSON<br>
&gt; encoding? Alternatively, in order to interoperate, semantic equivalenc=
e<br>
&gt; might be sufficient, is there any condition for semantic equivalence?<=
br>
&gt;<br>
&gt; 2. Claim<br>
&gt;<br>
&gt; A JSON based protocol carried by HTTP can have syntactically equivalen=
t<br>
&gt; YANG model, if and only if:<br>
&gt;<br>
&gt; (1) the message encoding condition is met;<br>
&gt;<br>
&gt; (2) the uri condition is met.<br>
&gt;<br>
&gt; 2.1. The message encoding condition<br>
&gt;<br>
&gt; The JSON message encoding MUST not contain a variable as a key in a JS=
ON<br>
&gt; object key-value pair. In other words, the keys in the JSON message mu=
st be<br>
&gt; an already defined constant (or keyword) in the message format of the<=
br>
&gt; protocol.<br>
&gt;<br>
&gt; For example, if I have a protocol where =E2=80=9Cnetwork-map=E2=80=9D,=
 =E2=80=9Csrc=E2=80=9D, and =E2=80=9Cdsts=E2=80=9D<br>
&gt; are defined keywords, JSON text A meets the condition whereas B does n=
ot<br>
&gt; because =E2=80=9CPID1=E2=80=9D and =E2=80=9CPID2=E2=80=9D are not prot=
ocol keywords (they are resource IDs).<br>
&gt;<br>
&gt; A:<br>
&gt;<br>
&gt; {<br>
&gt;<br>
&gt;=C2=A0 =E2=80=9Cnetwork-map=E2=80=9D: [<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =
=E2=80=9CPID3=E2=80=9D]<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 },<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =
=E2=80=9CPID4=E2=80=9D]<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 ]<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; B:<br>
&gt;<br>
&gt;<br>
&gt; {<br>
&gt;<br>
&gt;=C2=A0 =E2=80=9Cnetwork-map=E2=80=9D: [<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =E2=80=9CPID1: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=
=80=9D],<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =E2=80=9CPID2=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=
=9CPID4=E2=80=9D]<br>
&gt;<br>
&gt;=C2=A0 ]<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt;&gt;From this we know that since ALTO protocol uses encoding B, there c=
annot be<br>
&gt; a syntactically equivalent YANG model.<br>
&gt;<br>
&gt; 2.2 The URI condition<br>
&gt;<br>
&gt; Some of the YANG-related protocols might have URI constraints, e.g.<br=
>
&gt; RESTCONF. For now, we assume either that the JSON-based protocol URI c=
ould<br>
&gt; be conformed to RESTCONF compliant uri, or that the server could have =
a<br>
&gt; routing mapping between the protocol compliant uri and the RESTCONF<br=
>
&gt; compliant uri, hence this condition would not be an issue, which allow=
s us<br>
&gt; to focus on the message encoding condition.<br>
&gt;<br>
&gt; 3. Proof<br>
&gt;<br>
&gt; 3.1. The message encoding condition is necessary.<br>
&gt;<br>
&gt; We first note that this condition is a necessary condition for a JSON =
based<br>
&gt; protocol to have a syntactically equivalent YANG model by proving its<=
br>
&gt; contrapositive.<br>
&gt;<br>
&gt; If one of the keys in the key-value pair in the JSON document is not<b=
r>
&gt; pre-defined, the corresponding XML tags will not be pre-defined keywor=
ds.<br>
&gt; Therefore, it would not possible to model it in YANG without using<br>
&gt; YANG=E2=80=99s anyxml<br>
&gt; statement (which allows arbitrary XML content).<br>
&gt;<br>
&gt; However, using the anyxml statement would defeat our purpose of modeli=
ng<br>
&gt; the data as it allows arbitrary XML content, and will not be helpful i=
n the<br>
&gt; subsequent parsing process.<br>
&gt;<br>
&gt; 3.2. The message encoding condition is sufficient.<br>
&gt;<br>
&gt; We prove this by providing a translation procedure from a JSON message=
 that<br>
&gt; is compliant with the protocol we are trying to model, to a custom jav=
a<br>
&gt; class that can be used for Jackson data binding, then to a YANG model.=
<br>
&gt;<br>
&gt; We note that the middle step of translating to and from the custom par=
ser<br>
&gt; class is not necessary, but it will be useful.<br>
&gt;<br>
&gt; 3.2.1. motivation<br>
&gt;<br>
&gt; JSON data binding is the process of binding data structures (objects,<=
br>
&gt; arrays, etc.) in JSON to the appropriate data structures in the server=
<br>
&gt; (e.g. java classes, database tables, etc.) in parsing the JSON text. I=
n<br>
&gt; order to process JSON messages in a meaningful manner, data binding is=
<br>
&gt; necessary. Even if the binding is not explicit, the server would need =
to do<br>
&gt; it eventually. For example, one can read JSON content in a stream with=
out<br>
&gt; binding it to the java classes, but eventually in order to make sense =
of<br>
&gt; the data, the server would eventually have to organize it, which is ro=
ughly<br>
&gt; analogous to data binding upfront. Popular choices for JSON parsing an=
d<br>
&gt; data binding include jackson and gson.<br>
&gt;<br>
&gt; We use Jackson full data binding as our approach. Full data binding bi=
nds<br>
&gt; JSON content into plain old java objects (POJOs), i.e. this custom par=
ser<br>
&gt; class can neither extend nor implement any other class. Jackson uses<b=
r>
&gt; ObjectMapper with the custom parser class to parse JSON content into t=
his<br>
&gt; class.<br>
&gt;<br>
&gt; 3.2.2. The message encoding condition<br>
&gt;<br>
&gt; The message encoding condition is that all keys in each key-value pair=
 in<br>
&gt; the JSON text must be pre-defined keywords. As the keys will become ei=
ther<br>
&gt; class names and instance variable names, or be keys in the java maps, =
it is<br>
&gt; easy to see that the condition is equivalent to =E2=80=9Cthere exists =
a full data<br>
&gt; binding in Jackson custom parser class without using any map structure=
s<br>
&gt; (Map&lt;String, ?&gt;).=E2=80=9D<br>
&gt;<br>
&gt; 3.2.3. Proof<br>
&gt;<br>
&gt; We provide a recursive binding process from a JSON object to the Jacks=
on<br>
&gt; custom parser class to be used by Jackson ObjectMapper.<br>
&gt;<br>
&gt; Type determine_type(value) {<br>
&gt;<br>
&gt;=C2=A0 if (value is of a primitive type, i.e. string, number, boolean, =
null) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 return the corresponding java primitive type;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 if (value is a JSON object) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 return build_parser_class(value).class;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 if (value is an array) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 return ArrayList&lt;T&gt; where T=3Ddetermine_type(value[=
0]);<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 // should not reach here.<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Class build_parser_class(JSONObject obj) {<br>
&gt;<br>
&gt;=C2=A0 create custom class C;<br>
&gt;<br>
&gt;=C2=A0 for each key/value pair in the obj {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 add instance variable v in C;<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 the name of variable v &lt;- key; // (__known__ a/c to ou=
r assumption)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 the type of variable v &lt;- determine_type(value);<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 return C.class;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Naming:<br>
&gt;<br>
&gt; --change everything into CamelCase (i.e. remove dashes, etc.)<br>
&gt;<br>
&gt; --for instance variables, use =E2=80=9Cmy=E2=80=9D prefix, (e.g. myVar=
iable, myNetworkMap,<br>
&gt; etc.)<br>
&gt;<br>
&gt; --for the custom class name, if the object is an element of the array,=
 use<br>
&gt; =E2=80=9CElement=E2=80=9D suffix.<br>
&gt;<br>
&gt; This is just one convention so that the next step proceeds smoothly. A=
s<br>
&gt; long as this naming translation is consistent with the naming stage in=
 the<br>
&gt; next step, it will work just fine.<br>
&gt;<br>
&gt; Example (a modified ALTO protocol network map example):<br>
&gt;<br>
&gt; JSON object:<br>
&gt;<br>
&gt; {<br>
&gt;<br>
&gt;=C2=A0 =E2=80=9Cmeta=E2=80=9D: {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =E2=80=9Cresource-id=E2=80=9D: =E2=80=9Cmy-default-map=E2=
=80=9D,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =E2=80=9Ctag=E2=80=9D: =E2=80=9Caab875ef69c87d012=E2=80=
=9D<br>
&gt;<br>
&gt;=C2=A0 },<br>
&gt;<br>
&gt;=C2=A0 =E2=80=9Cnetwork-map=E2=80=9D: [<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =
=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=9D]<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 },<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =
=E2=80=9CPID3=E2=80=9D]<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 },<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID3=E2=80=9D,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =
=E2=80=9CPID3=E2=80=9D]<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 ]<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Result of build_parser_class(obj):<br>
&gt;<br>
&gt; Class JSONObject {<br>
&gt;<br>
&gt;=C2=A0 Meta myMeta;<br>
&gt;<br>
&gt;=C2=A0 ArrayList&lt;NetworkMapElement&gt; myNetworkMap;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Class Meta {<br>
&gt;<br>
&gt;=C2=A0 String myResourceId;<br>
&gt;<br>
&gt;=C2=A0 String myTag;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Class NetworkMapElement {<br>
&gt;<br>
&gt;=C2=A0 String mySrc;<br>
&gt;<br>
&gt;=C2=A0 ArrayList&lt;String&gt; myDsts;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Now given the Jackson Parser Java Class, to get a syntactically equiva=
lent<br>
&gt; YANG model:<br>
&gt;<br>
&gt; YANGModel build_yang_model(Class C) {<br>
&gt;<br>
&gt;=C2=A0 for each instance variable (Type, Name) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 if (Type is primitive type: string, number, boolean, null=
) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 add the following to the YANG module:<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cleaf Name { type &lt;YANG equivalent of T=
ype&gt;; }=E2=80=9D<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 if (Type is an ArrayList&lt;TypeElement&gt;) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 if (TypeElement is primitive type) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 add the following to the YANG module:<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =E2=80=9Cleaf-list Name { type &lt;YANG equ=
ivalent of TypeElement&gt;; }=E2=80=9D<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 } else {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 // TypeElement is a custom parser class<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 add the following to the YANG module:<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =E2=80=9Clist Name { &lt;result from build_=
yang_model&lt;TypeElement.class&gt;&gt; }=E2=80=9D<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 if (Type is a custom parser class) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 add the following to the YANG module:<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Ccontainer Name { &lt;result from build_ya=
ng_model&lt;Type.class&gt;&gt; }=E2=80=9D<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Result from the previous example:<br>
&gt;<br>
&gt; container meta {<br>
&gt;<br>
&gt;=C2=A0 leaf resource-id {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 type string;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 leaf tag {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 type string;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; list network-map {<br>
&gt;<br>
&gt;=C2=A0 leaf src {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 type string;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 leaf-list dsts {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 type string;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; This does validate the JSON document with XML-JSON encoding. For your<=
br>
&gt; reference, this is the XML document which validates:<br>
&gt;<br>
&gt; &lt;?xml version=3D&quot;1.0&quot; encoding=3D&quot;UTF-8&quot; ?&gt;<=
br>
&gt;<br>
&gt; &lt;meta&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;resource-id&gt;my-default-map&lt;/resource-id&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;tag&gt;aab875ef69c87d012&lt;/tag&gt;<br>
&gt;<br>
&gt; &lt;/meta&gt;<br>
&gt;<br>
&gt; &lt;network-map&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;src&gt;PID1&lt;/src&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;dsts&gt;PID1&lt;/dsts&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;dsts&gt;PID2&lt;/dsts&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;<br>
&gt; &lt;/network-map&gt;<br>
&gt;<br>
&gt; &lt;network-map&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;src&gt;PID2&lt;/src&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;dsts&gt;PID1&lt;/dsts&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;<br>
&gt; &lt;/network-map&gt;<br>
&gt;<br>
&gt; &lt;network-map&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;src&gt;PID3&lt;/src&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;dsts&gt;PID2&lt;/dsts&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;<br>
&gt; &lt;/network-map&gt;<br>
&gt;<br>
&gt; This proves that the message encoding condition is a sufficient condit=
ion<br>
&gt; for the JSON object to have a YANG model.<br>
&gt;<br>
&gt; Note the model generated is very crude and lose almost all constraints=
 and<br>
&gt; all inheritance features (if any), because it focuses on the syntax an=
d is<br>
&gt; essentially converted from an JSON object compliant with a protocol in=
stead<br>
&gt; of from the protocol itself. Hence this result is more useful in<br>
&gt; determining which JSON based protocols cannot have a syntactically<br>
&gt; equivalent YANG model, than in generating a good YANG model.<br>
&gt;<br>
&gt; 3.3. Conclusion<br>
&gt;<br>
&gt; Our claim holds. A JSON based protocol carried by HTTP can have<br>
&gt; syntactically equivalent YANG model, if and only if all the keys in th=
e<br>
&gt; key-value pairs in the JSON message are pre-defined keywords.<br>
&gt;<br>
&gt; 4. Semantic equivalence<br>
&gt;<br>
&gt; For JSON based protocols that don=E2=80=99t satisfy the message encodi=
ng condition,<br>
&gt; it is still possible to have a semantically equivalent YANG model. All=
 that<br>
&gt; is required for the protocol compliant clients and the YANG model comp=
liant<br>
&gt; server to interoperate is an adapter which does the following:<br>
&gt;<br>
&gt; 1) translate FROM YANG server compliant response msg TO alto compliant=
<br>
&gt; response msg<br>
&gt;<br>
&gt; 2) translate FROM alto compliant request msg TO YANG server compliant<=
br>
&gt; request msg<br>
&gt;<br>
&gt; 4.1. Claim<br>
&gt;<br>
&gt; This adapter needs to be protocol-aware.<br>
&gt;<br>
&gt; Ideally, given any YANG model, we would like to be able to automatical=
ly<br>
&gt; (or at least mechanically) generate this message adapter, which means =
not<br>
&gt; looking at the protocol or its compliant msgs. However, without knowin=
g the<br>
&gt; specific protocol that we are working with (i.e. human intervention, i=
.e.<br>
&gt; looking at the protocol compliant msgs), such an adapter cannot be<br>
&gt; auto-generated.<br>
&gt;<br>
&gt; 4.2. Proof by Indistinguishability<br>
&gt;<br>
&gt; Suppose both the YANG server compliant msg m_y and the actually protoc=
ol<br>
&gt; compliant msg m_p are in JSON (or have been encoded into JSON). Lookin=
g at<br>
&gt; the differences between the two messages, call these differences {d1, =
d2,<br>
&gt; ..., dn}. The goal for the auto-generated adapter would be to identify=
 and<br>
&gt; eliminate these differences. Construct a new JSON msg m&#39; where all=
 but one<br>
&gt; difference di is the same as m_p and di is the same as the m_y. Withou=
t<br>
&gt; looking at the protocol (or m_p), the auto-generated adapter would not=
 be<br>
&gt; able to distinguish between m&#39; and m_p in its translation process,=
 which<br>
&gt; means, it won&#39;t be able to tell whether it should change di or not=
. Hence,<br>
&gt; such an adapter must be protocol-aware.<br>
&gt;<br>
&gt; A good example is the dependent-vtag in the ALTO protocol:<br>
&gt;<br>
&gt; &quot;dependent-vtag&quot; : [<br>
&gt;<br>
&gt;=C2=A0 {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 &quot;resource-id&quot; : &quot;my-network-map&quot;,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 &quot;tag&quot; : &quot;abcd1234&quot;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt; ]<br>
&gt;<br>
&gt; It was specified this way in the alto protocol. However, it could<br>
&gt; conceivably be the case that it was originally the following map struc=
ture,<br>
&gt; and was converted into the above encoding because of the map-&gt;list+=
key<br>
&gt; issue. (This case is actually one of the few differences in the m_y an=
d m_p<br>
&gt; where the adapter does not need to convert it back to a map structure.=
)<br>
&gt;<br>
&gt; &quot;dependent-vtag&quot; : {<br>
&gt;<br>
&gt;=C2=A0 &quot;my-network-map&quot; : {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 &quot;tag&quot; : &quot;abcd1234&quot;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Without knowing the protocol, there is no way to tell.<br>
&gt;<br>
&gt; 5. Ramifications<br>
&gt;<br>
&gt; We now understand the basic condition for a JSON based protocol to hav=
e a<br>
&gt; YANG Model. For the protocols that don=E2=80=99t meet this condition, =
there can be<br>
&gt; a semantic equivalent YANG model, but there won=E2=80=99t be a generic=
 process of<br>
&gt; generating the adapter for all such protocols.<br>
</div></div>&gt; _______________________________________________<br>
&gt; netmod mailing list<br>
&gt; <a href=3D"mailto:netmod@ietf.org">netmod@ietf.org</a><br>
&gt; <a href=3D"https://www.ietf.org/mailman/listinfo/netmod" target=3D"_bl=
ank">https://www.ietf.org/mailman/listinfo/netmod</a><br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
--<br>
Ladislav Lhotka, CZ.NIC Labs<br>
PGP Key ID: E74E8C0C<br>
</font></span></blockquote></div><br></div>

--001a11c1e2dc0083860505db1943--


From nobody Mon Oct 20 07:35:10 2014
Return-Path: <w.roome@alcatel-lucent.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1501C1A8767 for <alto@ietfa.amsl.com>; Mon, 20 Oct 2014 07:35:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.602
X-Spam-Level: 
X-Spam-Status: No, score=-0.602 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, TRACKER_ID=1.306, T_RP_MATCHES_RCVD=-0.01] 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 ThtoNB7MnpTl for <alto@ietfa.amsl.com>; Mon, 20 Oct 2014 07:34:56 -0700 (PDT)
Received: from smtp-us.alcatel-lucent.com (us-hpatc-esg-02.alcatel-lucent.com [135.245.18.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1506C1A8840 for <alto@ietf.org>; Mon, 20 Oct 2014 07:14:04 -0700 (PDT)
Received: from us70uusmtp4.zam.alcatel-lucent.com (unknown [135.5.2.66]) by Websense Email Security Gateway with ESMTPS id 06D6A7B3D6539; Mon, 20 Oct 2014 14:14:02 +0000 (GMT)
Received: from usnavsmail4.ndc.alcatel-lucent.com (usnavsmail4.ndc.alcatel-lucent.com [135.3.39.12]) by us70uusmtp4.zam.alcatel-lucent.com (GMO) with ESMTP id s9KEE0hk010340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 20 Oct 2014 10:14:02 -0400
Received: from umail.lucent.com (umail.ndc.lucent.com [135.3.40.61]) by usnavsmail4.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id s9KEDx57003881 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 20 Oct 2014 09:13:59 -0500
Received: from [135.222.152.71] (wdr-i7mbp2.mh.lucent.com [135.222.152.71]) by umail.lucent.com (8.13.8/TPES) with ESMTP id s9KEDv9v011217; Mon, 20 Oct 2014 09:13:58 -0500 (CDT)
User-Agent: Microsoft-MacOutlook/14.4.5.141003
Date: Mon, 20 Oct 2014 10:14:04 -0400
From: Wendy Roome <w.roome@alcatel-lucent.com>
To: Xiao SHI <xiao.shi@yale.edu>
Message-ID: <D06A8B01.18A8A8%w.roome@alcatel-lucent.com>
Thread-Topic: [alto] Incremental updates transport using SSE?
References: <D0644784.180EE4%w.roome@alcatel-lucent.com> <CANUuoLoDnPx-V37==AXbMzuRPiYLXRz3CkMVpfSRfEMehg8S_g@mail.gmail.com> <D0653E13.181A19%w.roome@alcatel-lucent.com> <CAFwJzZn6hOzP-ef0Ji2vpnkTpU_wifZoKqxhpSo3pVzXB901LA@mail.gmail.com> <D06687CA.1854F3%w.roome@alcatel-lucent.com> <CAFwJzZm2GPCYbZDmtTyOBzuS6RFCxrSKZO4Vy9xR-usDtvWeFg@mail.gmail.com> <D066C5FC.188767%w.roome@alcatel-lucent.com> <CAFwJzZkMim8S6u_24oyns_x8_hnU1sXhajcj-CNQgToBHHjARw@mail.gmail.com>
In-Reply-To: <CAFwJzZkMim8S6u_24oyns_x8_hnU1sXhajcj-CNQgToBHHjARw@mail.gmail.com>
Mime-version: 1.0
Content-type: multipart/alternative; boundary="B_3496644846_25456719"
X-Scanned-By: MIMEDefang 2.64 on 135.3.39.12
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/fCi_1K3TNGZzZ85Ozo4DUHqE3HE
Cc: IETF ALTO <alto@ietf.org>
Subject: Re: [alto] Incremental updates transport using SSE?
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Oct 2014 14:35:04 -0000

> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--B_3496644846_25456719
Content-type: text/plain;
	charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

Xiao,

#1: I don't think that is a good idea. The tag is mutable -- it changes
every update. I believe the event type should be immutable over updates.
E.g., note that the IRD has resource ids, but not tags. I believe the
scenario you described is easily avoidable: when the client gets a new
network map event, the client updates the cached network map, including
updated the tag, and automatically discards any cached cost map(s) that
depended on the old tag. And in any case, before using a cost map, the
client should always verify that the network map tag in the cost map matche=
s
the tag of the map used to lookup the address.

Or did I not understand your scenario properly?

#2: That seems to be an unnecessary optimization and complication. It's a
complication because it adds an additional constraint (that uri must exist,
the resource must be an event stream, etc). It's unnecessary because let=B9s
be realistic, an IRD will have at most 20 or 30 entries. Searching them for
an update stream is not a challenge. Particularly if you remember a client
does that once and then keeps the stream open for hours.

Also, if you do think that is necessary, the map resource should give the
*resource id* of the associated update resource, not the uri. Only a
resource's IRD entry should give the uri. Think of that as equivalent to
normalizing a relational DB.

Or perhaps there could be a capability (or an attribute) that says this
resource does have an update stream, so the client knows whether search the
IRD for it.

#3: I assumed that for a filtered update stream, the client would use a POS=
T
request to tell the server which events the client wanted, and the server
would filter out (or just not send) the other events. Is that what you
meant?

- Wendy Roome

From:  Xiao SHI <xiao.shi@yale.edu>
Date:  Fri, October 17, 2014 at 20:13
To:  Wendy Roome <w.roome@alcatel-lucent.com>
Cc:  Xiao SHI <xiao.shi@yale.edu>, "Y. Richard Yang" <yry@cs.yale.edu>, IET=
F
ALTO <alto@ietf.org>
Subject:  Re: [alto] Incremental updates transport using SSE?

Hi Wendy,

I think this is a very good and efficient design. Just a few comments:

1. In the event field of the SSE, you included the resource-id but not the
tag along with it. I agree that the tag seems unnecessary because each even=
t
is essentially an update of the map, and should be assigned a new tag if th=
e
update were not incremental. However, consider the following scenario: if,
for whatever reason, the client only subscribed to the network map incr
updates (or the server only provided the network map stream), and the clien=
t
is requesting cost maps from the server via regular mechanism (i.e. always
getting a full new map which contains the dependent-vtag), could there be
issues when the version of the network map is not synchronized with the
dependent vtag that the client is about to use? For example, if I got the
cost map which depends on the network map a few incremental updates ago, bu=
t
I have already processed those updates, there could potentially be PID
mismatches and what not, right?

Shall we simply go ahead and add the tag into the event field? As for cost
maps, that would be the dependent-vtag. We can also put it in the id field.

2. In the IRD, would it make sense to include the incremental update uri in
the entries for regular resources? For example, a client would probably fin=
d
it useful to know that the server is providing "my-default-network-map," an=
d
its incr update stream can be found in
"http://example.com/network-map-updates."

So the IRD would look like this:
  "network-map": {
    ...,
    "update-uri":"http://somewhere.com/network-map-updates"
  },
  "routingcost-map": {
    ...,
    "update-uri":"http://somewhere.com/network-map-updates"
  },
  "hopcount-map": {
    ...,
    "update-uri":"http://somewhere.com/network-map-updates"
  },
 =20
  "network-map-updates": {
    "uri": "http://somewhere.com/network-map-updates",
    "media-type": "text/event-stream",
    "uses": ["network-map", "routingcost-map", "hopcount-map"],
    "accepts": "application/alto-updatestreamfilter+json",
    "capabilities": {
      "events": [
        {"media-type": "application/alto-networkmap+json",
         "resource-id": "network-map"},
        {"media-type": "application/alto-costmap+json",
         "resource-id": "routingcost-map"},
        {"media-type": "application/merge-patch+json",
         "resource-id": "routingcost-map"},
        {"media-type": "application/alto-costmap+json",
         "resource-id": "hopcount-map"},
        {"media-type": "application/merge-patch+json",
         "resource-id": "hopcount-map"}
      ]
    }
  }

This saves the trouble for the client to search through the "uses" field in
each stream resource; Also, when there are multiple streams for incremental
updates for one map (e.g. one stream for networkmap A + costmap B, one
stream for networkmap A + costmap C and D), the server could load-balance b=
y
providing the default update-uri for networkmap A in its IRD entry.

3. To reduce overall traffic, I assume for one particular event stream, the
event filtering would be done on the server side, right?

What do you think?

Cheers,
Xiao

On Fri, Oct 17, 2014 at 1:35 PM, Wendy Roome <w.roome@alcatel-lucent.com>
wrote:
> Xiao,
>=20
> My first take was that update stream resources should be 1-1 with the
> underlying full map resources. Then I realized that cost maps depend on
> network maps, and clients & servers should coordinate changes to the two.=
 The
> easiest way to accomplish that was to use the same stream for both networ=
k map
> and cost map updates, with the event type distinguishing network map upda=
tes
> from cost map updates.
>=20
> But your comment reminded me that network maps are 1-n with cost maps. Eg=
, a
> network map can have two cost maps, one for routingcost and the other for
> hopcount.
>=20
> So I suggest that an update stream resource can provide updates for an
> arbitrary set of resources. The server picks the set. Each update event h=
as a
> media-type (basically, full-map vs merge-patch), and the resource-id of t=
he
> map it updates. Because SSE only allows three fields (event, id and data)=
, I
> suggest we encode the media-type,resource-id pair in the event type, as a=
 JSON
> object with those field names, as in:
>=20
>     event:=20
> {"media-type":"application/alto-network-map+json","resource-id":"network-=
map"}
>=20
> Here=B9s a detailed example of an IRD with an update stream service that gi=
ves
> updates for the network map and the associated routingcost and hopcount m=
aps.
> It offers merge-patch incremental updates for the cost maps, but only ful=
l
> updates for network maps:
>=20
>   "network-map": {...},
>   "routingcost-map": {...},
>   "hopcount-map": {...},
>  =20
>   "network-map-updates": {
>     "uri": "http://somewhere.com/network-map-updates",
>     "media-type": "text/event-stream",
>     "uses": ["network-map", "routingcost-map", "hopcount-map"],
>     "accepts": "application/alto-updatestreamfilter+json",
>     "capabilities": {
>       "events": [
>         {"media-type": "application/alto-networkmap+json",
>          "resource-id": "network-map"},
>         {"media-type": "application/alto-costmap+json",
>          "resource-id": "routingcost-map"},
>         {"media-type": "application/merge-patch+json",
>          "resource-id": "routingcost-map"},
>         {"media-type": "application/alto-costmap+json",
>          "resource-id": "hopcount-map"},
>         {"media-type": "application/merge-patch+json",
>          "resource-id": "hopcount-map"}
>       ]
>     }
>   }
>=20
> This is a POST request. The client sends
> application/alto-updatestreamfilter+json data (a new MIME type) to select=
 the
> events it wishes to get. Here is how a client would request updates for t=
he
> network and routingcost maps, but not the hopcount map:
>=20
>   POST /network-map-updates
>   Host: somewhere.com <http://somewhere.com>
>   Content-Length: ###
>   Content-Type: application/alto-updatestreamfilter+json
>   Accept: test/event-stream,application/alto-error+json
>  =20
>   {"events": [
>      {"media-type": "application/alto-networkmap+json",
>       "resource-id": "network-map"},
>      {"media-type": "application/alto-costmap+json",
>       "resource-id": "routingcost-map"},
>      {"media-type": "application/merge-patch+json",
>       "resource-id": "routingcost-map"}
>   ]}
>=20
> The server would respond with something like this.
>=20
>   HTTP/1.1 200 OK
>   Content-Type: text/event-stream
>  =20
>   : Full network map, sent immediately.
>   event:=20
> {"media-type":"application/alto-network-map+json","resource-id":"network-=
map"}
>   data: { ... full network map ... }
>=20
>   : Full routingcost map, sent immediately.
>   event:=20
> {"media-type":"application/alto-costmap+json","resource-id":"routingcost-=
map"}
>   data: { ... full routingcost cost map ... }
>     =20
>   : Incremental routingcost map update, sent when enough costs have chang=
ed.
>   event:=20
> {"media-type":"application/merge-patch+json","resource-id":"routingcost-m=
ap"}
>   data: { ... merge-patch for routingcost cost map ... }
>=20
> Note that this omits the ids. They aren't really necessary. But if the
> underlying SSE library expects them, the server can always use sequence
> numbers 1, 2, 3, etc.
>=20
> How do people feel about this approach?
>=20
> - Wendy Roome
>=20
> From:  Xiao SHI <xiao.shi@yale.edu>
> Date:  Fri, October 17, 2014 at 10:10
> To:  Wendy Roome <w.roome@alcatel-lucent.com>
> Cc:  Xiao SHI <xiao.shi@yale.edu>, "Y. Richard Yang" <yry@cs.yale.edu>, I=
ETF
> ALTO <alto@ietf.org>
>=20
> Subject:  Re: [alto] Incremental updates transport using SSE?
>=20
> Hi Wendy,
>=20
> I completely agree with you. I was thinking maybe there's some clever way=
 of
> using the SSE event-id, but the questionable saving is simply not worth t=
he
> logging and synchronization trouble.
>=20
> 1. One thing that follows this choice is to use one single SSE stream (op=
en
> connection) for each resource. I briefly considered having one open conne=
ction
> and send updates for all resources on the server via that stream. The
> advantage of having only one connection open is smaller overhead, and the
> disadvantage is that it would require a more complicated ID and version
> tagging in event name/id maybe. What do you think?
>=20
> 2. If the mapping between SSE stream and underlying map is one-to-one, wo=
uld
> it make sense for the resourceID of a stream to be the resourceID of the
> underlying map and ".update" concatenated together? This way, when the cl=
ient
> actually requests and initiates the stream, the client would be aware of =
the
> resourceID of the underlying map.
>=20
> 3. Following that, we should define id field in the events. Richard propo=
sed
> using a tag as the id if it's a full network map, and newtag_oldtag if it=
's a
> patch. The vtag for network map is ResourceID+tag tuple, if the client kn=
ows
> about the resourceID, could we only use the tag? And should the cost maps
> simply use dependent-vtags? Since the id field is a string, what format d=
o we
> want the tags in? A few options are 1) json with all whitespaces removed;=
 2)
> an even more compact patterned string.
>=20
> e.g. for network map patch, it could be:
> {"old-tag":{"resource-id":"my-default-network-map","tag":"3ee2cb7e8d63d9f=
ab71b
> 9b34cbf764436315542e"},"new-tag":{"resource-id":"my-default-network-map",=
"tag"
> :"c0ce023b8678a7b9ec00324673b98e54656d1f6d"}}
>=20
> or (since it must be the same resource):
> {"resource-id":"my-default-network-map","old-tag":"3ee2cb7e8d63d9fab71b9b=
34cbf
> 764436315542e","new-tag":"c0ce023b8678a7b9ec00324673b98e54656d1f6d"}
>=20
> or (if the client knows the resource-id for the underlying map of the str=
eam,
> just use a delimiter):
> 3ee2cb7e8d63d9fab71b9b34cbf764436315542e_c0ce023b8678a7b9ec00324673b98e54=
656d1
> f6d
>=20
> What do you think?
>=20
> Best,
> Xiao
>=20
> On Fri, Oct 17, 2014 at 9:21 AM, Wendy Roome <w.roome@alcatel-lucent.com>
> wrote:
>> Xiao,
>>=20
>> That is a very good point. I hoped someone would ask about that.
>>=20
>> It is a tradeoff. The disadvantage of requiring the server to send full
>> map(s) at the start of each stream is that if the connection drops, we h=
ave
>> to send the full map over again. But the advantage is that incremental
>> updates are only within the context of this particular stream. We don't =
need
>> keep track of where we were.
>>=20
>> To see the issue, suppose we wanted to avoid re-sending the full map whe=
n the
>> client reestablishes the connection. Then the server must assign a uniqu=
e id
>> to every incremental update event. When the client reconnects, the clien=
t
>> gives the server the last known event id, and the server sends any event=
s the
>> client missed.
>>=20
>> BTW, SSE does define event ids. Each event has an id, and when connectin=
g,
>> the client gives a Last-Event-Id header with the last id it received (if
>> any).
>>=20
>> So what is the problem with that? First, the server MUST assign a unique=
 id
>> to every incremental update, and they must be the same for all clients. =
That
>> is, if the server has several increment-update clients, the server must
>> "clock" their update event streams at the same rate. Second, the server =
must
>> keep a buffer of old update events, in case a client needs to reconnect.=
 And
>> third, because a reconnecting client may send an old (or bogus)
>> Last-Event-Id, the server may have send the full map(s) anyway.
>>=20
>> If we do not use event ids, then it is much simpler. Incremental updates=
 are
>> in the context of this stream. Period. No persistent state that must sur=
vive
>> the end of the connection. And if desired, the server can send updates a=
re
>> different rates to different clients.
>>=20
>> So I think it boils down to how often we expect connections to drop
>> unintentionally. If that is common, then, yes, we need to define event i=
ds to
>> avoid resending the full maps. But if we can assume accidental drops are
>> rare, then I think it is simpler just to send the full map(s) for every =
new
>> connection.
>>=20
>> - Wendy Roome
>>=20
>> From:  Xiao SHI <xiao.shi@yale.edu>
>> Date:  Thu, October 16, 2014 at 18:22
>> To:  Wendy Roome <w.roome@alcatel-lucent.com>
>> Cc:  "Y. Richard Yang" <yry@cs.yale.edu>, IETF ALTO <alto@ietf.org>
>> Subject:  Re: [alto] Incremental updates transport using SSE?
>>=20
>> Hi Wendy,
>>=20
>> If a client accidentally dropped the connection and hopes to re-connect =
and
>> receive the merge-patch events, would it make sense for the server not t=
o
>> send the first full-map event? It will save quite some effort that way.
>>=20
>> Best,
>> Xiao
>>=20
>=20




--B_3496644846_25456719
Content-type: text/html;
	charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

<html><head></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size:=
 14px; font-family: Calibri, sans-serif;"><div>Xiao,</div><div><br></div><di=
v>#1: I don't think that is a good idea. The tag is mutable -- it changes ev=
ery update. I believe the event type should be immutable over updates. E.g.,=
 note that the IRD has resource ids, but not tags. I believe the scenario yo=
u described is easily avoidable: when the client gets a new network map even=
t, the client updates the cached network map, including updated the tag, and=
 automatically discards any cached cost map(s) that depended on the old tag.=
 And in any case, before using a cost map, the client should always verify t=
hat the network map tag in the cost map matches the tag of the map used to l=
ookup the address.</div><div><br></div><div>Or did I not understand your sce=
nario properly?</div><div><br></div><div>#2: That seems to be an unnecessary=
 optimization and complication. It's a complication because it adds an addit=
ional constraint (that uri must exist, the resource must be an event stream,=
 etc). It's unnecessary because let&#8217;s be realistic, an IRD will have a=
t most 20 or 30 entries. Searching them for an update stream is not a challe=
nge. Particularly if you remember a client does that once and then keeps the=
 stream open for hours.</div><div><br></div><div>Also, if you do think that =
is necessary, the map resource should give the *resource id* of the associat=
ed update resource, not the uri. Only a resource's IRD entry should give the=
 uri. Think of that as equivalent to normalizing a relational DB.</div><div>=
<br></div><div>Or perhaps there could be a capability (or an attribute) that=
 says this resource does have an update stream, so the client knows whether =
search the IRD for it.</div><div><br></div><div>#3: I assumed that for a fil=
tered update stream, the client would use a POST request to tell the server =
which events the client wanted, and the server would filter out (or just not=
 send) the other events. Is that what you meant?</div><div><br></div><div><s=
pan class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>- Wendy Roome</di=
v><div><br></div><span id=3D"OLK_SRC_BODY_SECTION"><div style=3D"font-family:Cal=
ibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium no=
ne; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDIN=
G-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADD=
ING-TOP: 3pt"><span style=3D"font-weight:bold">From: </span> Xiao SHI &lt;<a h=
ref=3D"mailto:xiao.shi@yale.edu">xiao.shi@yale.edu</a>&gt;<br><span style=3D"fon=
t-weight:bold">Date: </span> Fri, October 17, 2014 at 20:13<br><span style=3D"=
font-weight:bold">To: </span> Wendy Roome &lt;<a href=3D"mailto:w.roome@alcate=
l-lucent.com">w.roome@alcatel-lucent.com</a>&gt;<br><span style=3D"font-weight=
:bold">Cc: </span> Xiao SHI &lt;<a href=3D"mailto:xiao.shi@yale.edu">xiao.shi@=
yale.edu</a>&gt;, "Y. Richard Yang" &lt;<a href=3D"mailto:yry@cs.yale.edu">yry=
@cs.yale.edu</a>&gt;, IETF ALTO &lt;<a href=3D"mailto:alto@ietf.org">alto@ietf=
.org</a>&gt;<br><span style=3D"font-weight:bold">Subject: </span> Re: [alto] I=
ncremental updates transport using SSE?<br></div><div><br></div><div dir=3D"lt=
r">Hi Wendy,<div><br></div><div>I think this is a very good and efficient de=
sign. Just a few comments:</div><div><br></div><div>1. In the event field of=
 the SSE, you included the resource-id but not the tag along with it. I agre=
e that the tag seems unnecessary because each event is essentially an update=
 of the map, and should be assigned a new tag if the update were not increme=
ntal. However, consider the following scenario: if, for whatever reason, the=
 client only subscribed to the network map incr updates (or the server only =
provided the network map stream), and the client is requesting cost maps fro=
m the server via regular mechanism (i.e. always getting a full new map which=
 contains the dependent-vtag), could there be issues when the version of the=
 network map is not synchronized with the dependent vtag that the client is =
about to use? For example, if I got the cost map which depends on the networ=
k map a few incremental updates ago, but I have already processed those upda=
tes, there could potentially be PID mismatches and what not, right?</div><di=
v><br></div><div>Shall we simply go ahead and add the tag into the event fie=
ld? As for cost maps, that would be the dependent-vtag. We can also put it i=
n the id field.</div><div><br></div><div>2. In the IRD, would it make sense =
to include the incremental update uri in the entries for regular resources? =
For example, a client would probably find it useful to know that the server =
is providing "my-default-network-map," and its incr update stream can be fou=
nd in "<a href=3D"http://example.com/network-map-updates">http://example.com/n=
etwork-map-updates</a>."</div><div><br></div><div>So the IRD would look like=
 this:</div><div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif=
;font-size:14px">&nbsp; "network-map": {</div><div style=3D"color:rgb(0,0,0);f=
ont-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; ...,</div><div s=
tyle=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">&nbsp;=
 &nbsp; "update-uri":"<a href=3D"http://somewhere.com/network-map-updates" tar=
get=3D"_blank">http://somewhere.com/network-map-updates</a>"</div><div style=3D"=
color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">&nbsp; },</d=
iv><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14p=
x">&nbsp; "routingcost-map":&nbsp;{</div><div style=3D"color:rgb(0,0,0);font-f=
amily:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; ...,</div><div style=3D=
"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbs=
p; "update-uri":"<a href=3D"http://somewhere.com/network-map-updates" target=3D"=
_blank">http://somewhere.com/network-map-updates</a>"</div><div style=3D"color=
:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">&nbsp; },</div><d=
iv style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">&n=
bsp; "hopcount-map": {</div><div style=3D"color:rgb(0,0,0);font-family:Calibri=
,sans-serif;font-size:14px"><div>&nbsp; &nbsp; ...,</div><div>&nbsp; &nbsp; =
"update-uri":"<a href=3D"http://somewhere.com/network-map-updates" target=3D"_bl=
ank">http://somewhere.com/network-map-updates</a>"</div><div>&nbsp; },</div>=
</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:=
14px">&nbsp;&nbsp;</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,san=
s-serif;font-size:14px">&nbsp; "network-map-updates": {</div><div style=3D"col=
or:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; "=
uri": "<a href=3D"http://somewhere.com/network-map-updates" target=3D"_blank">ht=
tp://somewhere.com/network-map-updates</a>",</div><div style=3D"color:rgb(0,0,=
0);font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; "media-type"=
: "text/event-stream",</div><div style=3D"color:rgb(0,0,0);font-family:Calibri=
,sans-serif;font-size:14px">&nbsp; &nbsp; "uses": ["network-map", "routingco=
st-map", "hopcount-map"],</div><div style=3D"color:rgb(0,0,0);font-family:Cali=
bri,sans-serif;font-size:14px">&nbsp; &nbsp; "accepts": "application/alto-up=
datestreamfilter+json",</div><div style=3D"color:rgb(0,0,0);font-family:Calibr=
i,sans-serif;font-size:14px">&nbsp; &nbsp; "capabilities": {</div><div style=
=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nb=
sp; &nbsp; "events": [</div><div style=3D"color:rgb(0,0,0);font-family:Calibri=
,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; {"media-type": "appl=
ication/alto-networkmap+json",</div><div style=3D"color:rgb(0,0,0);font-family=
:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"resou=
rce-id": "network-map"},</div><div style=3D"color:rgb(0,0,0);font-family:Calib=
ri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; {"media-type": "ap=
plication/alto-costmap+json",</div><div style=3D"color:rgb(0,0,0);font-family:=
Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"resour=
ce-id": "routingcost-map"},</div><div style=3D"color:rgb(0,0,0);font-family:Ca=
libri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; {"media-type": =
"application/merge-patch+json",</div><div style=3D"color:rgb(0,0,0);font-famil=
y:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"reso=
urce-id": "routingcost-map"},</div><div style=3D"color:rgb(0,0,0);font-family:=
Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; {"media-type"=
: "application/alto-costmap+json",</div><div style=3D"color:rgb(0,0,0);font-fa=
mily:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"r=
esource-id": "hopcount-map"},</div><div style=3D"color:rgb(0,0,0);font-family:=
Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; {"media-type"=
: "application/merge-patch+json",</div><div style=3D"color:rgb(0,0,0);font-fam=
ily:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"re=
source-id": "hopcount-map"}</div><div style=3D"color:rgb(0,0,0);font-family:Ca=
libri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; ]</div><div style=3D"col=
or:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; }=
</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:=
14px">&nbsp; }</div></div><div><br></div><div>This saves the trouble for the=
 client to search through the "uses" field in each stream resource; Also, wh=
en there are multiple streams for incremental updates for one map (e.g. one =
stream for networkmap A + costmap B, one stream for networkmap A + costmap C=
 and D), the server could load-balance by providing the default update-uri f=
or networkmap A in its IRD entry.</div><div><br></div><div>3. To reduce over=
all traffic, I assume for one particular event stream, the event filtering w=
ould be done on the server side, right?</div><div><br></div><div>What do you=
 think?</div><div><br></div><div>Cheers,</div><div>Xiao</div></div><div clas=
s=3D"gmail_extra"><br><div class=3D"gmail_quote">On Fri, Oct 17, 2014 at 1:35 PM=
, Wendy Roome <span dir=3D"ltr">&lt;<a href=3D"mailto:w.roome@alcatel-lucent.com=
" target=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;</span> wrote:<br><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli=
d;padding-left:1ex"><div style=3D"word-wrap:break-word;color:rgb(0,0,0);font-s=
ize:14px;font-family:Calibri,sans-serif"><div>Xiao,</div><div><br></div><div=
>My first take was that update stream resources should be 1-1 with the under=
lying full map resources. Then I realized that cost maps depend on network m=
aps, and clients &amp; servers should coordinate changes to the two. The eas=
iest way to accomplish that was to use the same stream for both network map =
and cost map updates, with the event type distinguishing network map updates=
 from cost map updates.</div><div><br></div><div>But your comment reminded m=
e that network maps are 1-n with cost maps. Eg, a network map can have two c=
ost maps, one for routingcost and the other for hopcount.</div><div><br></di=
v><div>So I suggest that an update stream resource can provide updates for a=
n arbitrary set of resources. The server picks the set. Each update event ha=
s a media-type (basically, full-map vs merge-patch), and the resource-id of =
the map it updates. Because SSE only allows three fields (event, id and data=
), I suggest we encode the media-type,resource-id pair in the event type, as=
 a JSON object with those field names, as in:</div><div><br></div><div>&nbsp=
; &nbsp; event: {"media-type":"application/alto-network-map+json","resource-=
id":"network-map"}</div><div><br></div><div>Here&#8217;s a detailed example =
of an IRD with an update stream service that gives updates for the network m=
ap and the associated routingcost and hopcount maps. It offers merge-patch i=
ncremental updates for the cost maps, but only full updates for network maps=
:</div><div><br></div><div><div>&nbsp; "network-map": {...},</div><div>&nbsp=
; "routingcost-map": {...},</div><div>&nbsp; "hopcount-map": {...},</div><di=
v>&nbsp;&nbsp;</div><div>&nbsp; "network-map-updates": {</div><div>&nbsp; &n=
bsp; "uri": "<a href=3D"http://somewhere.com/network-map-updates" target=3D"_bla=
nk">http://somewhere.com/network-map-updates</a>",</div><div>&nbsp; &nbsp; "=
media-type": "text/event-stream",</div><div>&nbsp; &nbsp; "uses": ["network-=
map", "routingcost-map", "hopcount-map"],</div><div>&nbsp; &nbsp; "accepts":=
 "application/alto-updatestreamfilter+json",</div><div>&nbsp; &nbsp; "capabi=
lities": {</div><div>&nbsp; &nbsp; &nbsp; "events": [</div><div>&nbsp; &nbsp=
; &nbsp; &nbsp; {"media-type": "application/alto-networkmap+json",</div><div=
>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"resource-id": "network-map"},</div><div>=
&nbsp; &nbsp; &nbsp; &nbsp; {"media-type": "application/alto-costmap+json",<=
/div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"resource-id": "routingcost-map"=
},</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {"media-type": "application/merge-p=
atch+json",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"resource-id": "rout=
ingcost-map"},</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {"media-type": "applica=
tion/alto-costmap+json",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"resour=
ce-id": "hopcount-map"},</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {"media-type"=
: "application/merge-patch+json",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p;"resource-id": "hopcount-map"}</div><div>&nbsp; &nbsp; &nbsp; ]</div><div>=
&nbsp; &nbsp; }</div><div>&nbsp; }</div></div><div><br></div><div>This is a =
POST request. The client sends application/alto-updatestreamfilter+json data=
 (a new MIME type) to select the events it wishes to get. Here is how a clie=
nt would request updates for the network and routingcost maps, but not the h=
opcount map:</div><div><br></div><div><div>&nbsp; POST /network-map-updates<=
/div><div>&nbsp; Host: <a href=3D"http://somewhere.com" target=3D"_blank">somewh=
ere.com</a></div><div>&nbsp; Content-Length: ###</div><div>&nbsp; Content-Ty=
pe: application/alto-updatestreamfilter+json</div><div>&nbsp; Accept: test/e=
vent-stream,application/alto-error+json</div><div>&nbsp;&nbsp;</div><div>&nb=
sp; {"events": [</div><div>&nbsp; &nbsp; &nbsp;{"media-type": "application/a=
lto-networkmap+json",</div><div>&nbsp; &nbsp; &nbsp; "resource-id": "network=
-map"},</div><div>&nbsp; &nbsp; &nbsp;{"media-type": "application/alto-costm=
ap+json",</div><div>&nbsp; &nbsp; &nbsp; "resource-id": "routingcost-map"},<=
/div><div>&nbsp; &nbsp; &nbsp;{"media-type": "application/merge-patch+json",=
</div><div>&nbsp; &nbsp; &nbsp; "resource-id": "routingcost-map"}</div><div>=
&nbsp; ]}</div></div><div><br></div><div>The server would respond with somet=
hing like this.</div><div><br></div><div><div>&nbsp; HTTP/1.1 200 OK</div><d=
iv>&nbsp; Content-Type: text/event-stream</div><div>&nbsp;&nbsp;</div><div>&=
nbsp; : Full network map, sent immediately.</div><div>&nbsp; event: {"media-=
type":"application/alto-network-map+json","resource-id":"network-map"}</div>=
<div>&nbsp; data: { ... full network map ... }</div><div><br></div><div>&nbs=
p; : Full routingcost map, sent immediately. &nbsp;</div><div>&nbsp; event: =
{"media-type":"application/alto-costmap+json","resource-id":"routingcost-map=
"}</div><div>&nbsp; data: { ... full routingcost cost map ... }</div><div>&n=
bsp; &nbsp; &nbsp;</div><div>&nbsp; : Incremental routingcost map update, se=
nt when enough costs have changed. &nbsp;</div><div>&nbsp; event: {"media-ty=
pe":"application/merge-patch+json","resource-id":"routingcost-map"}</div><di=
v>&nbsp; data: { ... merge-patch for routingcost cost map ... }</div></div><=
div><br></div><div>Note that this omits the ids. They aren't really necessar=
y. But if the underlying SSE library expects them, the server can always use=
 sequence numbers 1, 2, 3, etc.</div><div><br></div><div>How do people feel =
about this approach?</div><div><br></div><div><span style=3D"white-space:pre-w=
rap">	</span>- Wendy Roome</div><div><br></div><span><div style=3D"font-family=
:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:medium non=
e;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:=
0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt"><=
span style=3D"font-weight:bold">From: </span> Xiao SHI &lt;<a href=3D"mailto:xia=
o.shi@yale.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt;<br><span style=3D"fo=
nt-weight:bold">Date: </span> Fri, October 17, 2014 at 10:10<br><span style=3D=
"font-weight:bold">To: </span> Wendy Roome &lt;<a href=3D"mailto:w.roome@alcat=
el-lucent.com" target=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;<br><span s=
tyle=3D"font-weight:bold">Cc: </span> Xiao SHI &lt;<a href=3D"mailto:xiao.shi@ya=
le.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt;, "Y. Richard Yang" &lt;<a =
href=3D"mailto:yry@cs.yale.edu" target=3D"_blank">yry@cs.yale.edu</a>&gt;, IETF =
ALTO &lt;<a href=3D"mailto:alto@ietf.org" target=3D"_blank">alto@ietf.org</a>&gt=
;<div><div class=3D"h5"><br><span style=3D"font-weight:bold">Subject: </span> Re=
: [alto] Incremental updates transport using SSE?<br></div></div></div><div>=
<div class=3D"h5"><div><br></div><div dir=3D"ltr">Hi Wendy,<div><br></div><div>I=
 completely agree with you. I was thinking maybe there's some clever way of =
using the SSE event-id, but the questionable saving is simply not worth the =
logging and synchronization trouble.</div><div><br></div><div>1. One thing t=
hat follows this choice is to use one single SSE stream (open connection) fo=
r each resource. I briefly considered having one open connection and send up=
dates for all resources on the server via that stream. The advantage of havi=
ng only one connection open is smaller overhead, and the disadvantage is tha=
t it would require a more complicated ID and version tagging in event name/i=
d maybe. What do you think?</div><div><br></div><div>2. If the mapping betwe=
en SSE stream and underlying map is one-to-one, would it make sense for the =
resourceID of a stream to be the resourceID of the underlying map and ".upda=
te" concatenated together? This way, when the client actually requests and i=
nitiates the stream, the client would be aware of the resourceID of the unde=
rlying map.</div><div><br></div><div>3. Following that, we should define id =
field in the events. Richard proposed using a tag as the id if it's a full n=
etwork map, and newtag_oldtag if it's a patch. The vtag for network map is R=
esourceID+tag tuple, if the client knows about the resourceID, could we only=
 use the tag? And should the cost maps simply use dependent-vtags? Since the=
 id field is a string, what format do we want the tags in? A few options are=
 1) json with all whitespaces removed; 2) an even more compact patterned str=
ing.</div><div><br></div><div>e.g. for network map patch, it could be:</div>=
<div>{"old-tag":{"resource-id":"my-default-network-map","tag":"3ee2cb7e8d63d=
9fab71b9b34cbf764436315542e"},"new-tag":{"resource-id":"my-default-network-m=
ap","tag":"<span style=3D"color:rgb(0,0,0);font-size:1em">c0ce023b8678a7b9ec00=
324673b98e54656d1f6d</span>"}}<br></div><div><br></div><div>or (since it mus=
t be the same resource):<br></div><div>{"resource-id":"my-default-network-ma=
p","old-tag":"3ee2cb7e8d63d9fab71b9b34cbf764436315542e","new-tag":"<span sty=
le=3D"color:rgb(0,0,0);font-size:1em">c0ce023b8678a7b9ec00324673b98e54656d1f6d=
</span>"}<br></div><div><br></div><div>or (if the client knows the resource-=
id for the underlying map of the stream, just use a delimiter):</div><div>3e=
e2cb7e8d63d9fab71b9b34cbf764436315542e_<span style=3D"color:rgb(0,0,0);font-si=
ze:13px">c0ce023b8678a7b9ec00324673b98e54656d1f6d</span><br></div><div><br><=
/div><div>What do you think?</div><div><br></div><div>Best,</div><div>Xiao</=
div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Fri, Oct =
17, 2014 at 9:21 AM, Wendy Roome <span dir=3D"ltr">&lt;<a href=3D"mailto:w.roome=
@alcatel-lucent.com" target=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;</spa=
n> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border=
-left:1px #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-word;colo=
r:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><div>Xiao,</div>=
<div><br></div><div>That is a very good point. I hoped someone would ask abo=
ut that.</div><div><br></div><div>It is a tradeoff. The disadvantage of requ=
iring the server to send full map(s) at the start of each stream is that if =
the connection drops, we have to send the full map over again. But the advan=
tage is that incremental updates are only within the context of this particu=
lar stream. We don't need keep track of where we were.</div><div><br></div><=
div>To see the issue, suppose we wanted to avoid re-sending the full map whe=
n the client reestablishes the connection. Then the server must assign a uni=
que id to every incremental update event. When the client reconnects, the cl=
ient gives the server the last known event id, and the server sends any even=
ts the client missed.</div><div><br></div><div>BTW, SSE does define event id=
s. Each event has an id, and when connecting, the client gives a Last-Event-=
Id header with the last id it received (if any).</div><div><br></div><div>So=
 what is the problem with that? First, the server MUST assign a unique id to=
 every incremental update, and they must be the same for all clients. That i=
s, if the server has several increment-update clients, the server must "cloc=
k" their update event streams at the same rate. Second, the server must keep=
 a buffer of old update events, in case a client needs to reconnect. And thi=
rd, because a reconnecting client may send an old (or bogus) Last-Event-Id, =
the server may have send the full map(s) anyway.</div><div><br></div><div>If=
 we do not use event ids, then it is much simpler. Incremental updates are i=
n the context of this stream. Period. No persistent state that must survive =
the end of the connection. And if desired, the server can send updates are d=
ifferent rates to different clients.</div><div><br></div><div>So I think it =
boils down to how often we expect connections to drop unintentionally. If th=
at is common, then, yes, we need to define event ids to avoid resending the =
full maps. But if we can assume accidental drops are rare, then I think it i=
s simpler just to send the full map(s) for every new connection.</div><div><=
br></div><div><span style=3D"white-space:pre-wrap">	</span>- Wendy Roome</div>=
<div><br></div><span><div style=3D"font-family:Calibri;font-size:11pt;text-ali=
gn:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDIN=
G-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid=
;BORDER-RIGHT:medium none;PADDING-TOP:3pt"><span style=3D"font-weight:bold">Fr=
om: </span> Xiao SHI &lt;<a href=3D"mailto:xiao.shi@yale.edu" target=3D"_blank">=
xiao.shi@yale.edu</a>&gt;<br><span style=3D"font-weight:bold">Date: </span> Th=
u, October 16, 2014 at 18:22<br><span style=3D"font-weight:bold">To: </span> W=
endy Roome &lt;<a href=3D"mailto:w.roome@alcatel-lucent.com" target=3D"_blank">w=
.roome@alcatel-lucent.com</a>&gt;<br><span style=3D"font-weight:bold">Cc: </sp=
an> "Y. Richard Yang" &lt;<a href=3D"mailto:yry@cs.yale.edu" target=3D"_blank">y=
ry@cs.yale.edu</a>&gt;, IETF ALTO &lt;<a href=3D"mailto:alto@ietf.org" target=3D=
"_blank">alto@ietf.org</a>&gt;<span><br><span style=3D"font-weight:bold">Subje=
ct: </span> Re: [alto] Incremental updates transport using SSE?<br></span></=
div><span><div><br></div><div dir=3D"ltr" style=3D"color:rgb(0,0,0);font-family:=
Calibri;font-size:medium;font-style:normal;font-variant:normal;font-weight:n=
ormal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:=
0px;text-transform:none;white-space:normal;word-spacing:0px">Hi Wendy,<div><=
br></div><div>If a client accidentally dropped the connection and hopes to r=
e-connect and receive the merge-patch events, would it make sense for the se=
rver not to send the first full-map event? It will save quite some effort th=
at way.</div><div><br></div><div>Best,</div><div>Xiao</div></div><br></span>=
</span></div></blockquote></div><br></div></div></div></span></div></blockqu=
ote></div><br></div></span></body></html>

--B_3496644846_25456719--




From nobody Mon Oct 20 08:11:07 2014
Return-Path: <lhotka@nic.cz>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B8F171A880E; Mon, 20 Oct 2014 06:25:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham
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 BkzRoUrwguqv; Mon, 20 Oct 2014 06:25:14 -0700 (PDT)
Received: from trail.lhotka.name (trail.lhotka.name [77.48.224.143]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C22971A878C; Mon, 20 Oct 2014 06:23:19 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by trail.lhotka.name (Postfix) with ESMTP id E7B42540A2A; Mon, 20 Oct 2014 15:23:17 +0200 (CEST)
Received: from trail.lhotka.name ([127.0.0.1]) by localhost (trail.lhotka.name [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LWefBbk6l6rr; Mon, 20 Oct 2014 15:23:08 +0200 (CEST)
Received: from localhost (unknown [195.113.220.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by trail.lhotka.name (Postfix) with ESMTPSA id 5FFC5540A28; Mon, 20 Oct 2014 15:23:07 +0200 (CEST)
From: Ladislav Lhotka <lhotka@nic.cz>
To: Xiao SHI <xiao.shi@yale.edu>, IETF ALTO <alto@ietf.org>, "netmod\@ietf.org" <netmod@ietf.org>
In-Reply-To: <CAFwJzZkAp-4umrrHZEY3qYuFCXu=+Pqbh8SeB=Qr=TTbQurj6A@mail.gmail.com>
References: <CAFwJzZkAp-4umrrHZEY3qYuFCXu=+Pqbh8SeB=Qr=TTbQurj6A@mail.gmail.com>
User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.50.2 (x86_64-apple-darwin13.0.0)
Date: Mon, 20 Oct 2014 15:23:07 +0200
Message-ID: <m2tx2ynadg.fsf@nic.cz>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/uAAWo6mItm24HpYBCQkVnlE2kkc
X-Mailman-Approved-At: Mon, 20 Oct 2014 08:11:06 -0700
Subject: Re: [alto] [netmod] Modeling JSON based protocols using YANG
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Oct 2014 13:25:20 -0000

Xiao SHI <xiao.shi@yale.edu> writes:

> Hi folks,
>
>
> As a few of us were working on modeling the ALTO protocol using YANG, we
> were pondering on a more general question: can YANG model all JSON based
> protocols? What is the condition for a JSON based protocol (at least the
> message format) to have an syntactically equivalent, hence interoperable,
> YANG model with JSON encoding? Alternatively, in order to interoperate,
> semantic equivalence might be sufficient, is there any condition for
> semantic equivalence?
>
>
> tl;dr: A JSON based protocol carried by HTTP can have syntactically
> equivalent YANG model, if and only if all the keys in the key-value pairs
> in the JSON message are pre-defined keywords in the protocol.
>

Generating a YANG data model from existing instance data seems backwards
to me, although Examplotron (http://examplotron.org) does something quite
similar. In any case, it might be quite challenging because YANG isn't
intended as a general schema language. Your observation above is true
but it is just one aspect of the problem. For instance

"foo": [ { "bar": 1 }, 2 ]

or

"foo": null

cannot be modelled in YANG using the encoding of
draft-ietf-netmod-yang-json.

Lada

>
> We've come up with a few ideas, and a few things below are work in
> progress, but we would love your feedback!
>
>
> Thank you!
>
> Xiao
>
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> 1. Introduction.
>
> JavaScript Object Notation (JSON) has been a popular choice as the message
> encoding for many network protocols such as the Application Layer Traffic
> Optimization (ALTO) protocol, the Content Delivery Networks Interconnecti=
on
> (CDNi) protocol, etc.
>
> Meanwhile, there are broad interests in the networking community to use
> YANG to define data model so that one can use YANG related tools such as
> OpenDayLight controller. Although YANG itself is XML based, there have be=
en
> efforts to model JSON content using YANG [draft-ietf-netmod-yang-json-01].
>
> A natural question rises: can YANG model all JSON based protocols? What is
> the condition for a JSON based protocol (at least the message format) to
> have an syntactically equivalent, hence interoperable, YANG model with JS=
ON
> encoding? Alternatively, in order to interoperate, semantic equivalence
> might be sufficient, is there any condition for semantic equivalence?
>
> 2. Claim
>
> A JSON based protocol carried by HTTP can have syntactically equivalent
> YANG model, if and only if:
>
> (1) the message encoding condition is met;
>
> (2) the uri condition is met.
>
> 2.1. The message encoding condition
>
> The JSON message encoding MUST not contain a variable as a key in a JSON
> object key-value pair. In other words, the keys in the JSON message must =
be
> an already defined constant (or keyword) in the message format of the
> protocol.
>
> For example, if I have a protocol where =E2=80=9Cnetwork-map=E2=80=9D, =
=E2=80=9Csrc=E2=80=9D, and =E2=80=9Cdsts=E2=80=9D
> are defined keywords, JSON text A meets the condition whereas B does not
> because =E2=80=9CPID1=E2=80=9D and =E2=80=9CPID2=E2=80=9D are not protoco=
l keywords (they are resource IDs).
>
> A:
>
> {
>
>  =E2=80=9Cnetwork-map=E2=80=9D: [
>
>    {
>
>      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,
>
>      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=
=9D]
>
>    },
>
>    {
>
>      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,
>
>      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=E2=80=
=9D]
>
>    }
>
>  ]
>
> }
>
> B:
>
>
> {
>
>  =E2=80=9Cnetwork-map=E2=80=9D: [
>
>    =E2=80=9CPID1: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=9D],
>
>    =E2=80=9CPID2=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=E2=80=
=9D]
>
>  ]
>
> }
>
>>From this we know that since ALTO protocol uses encoding B, there cannot =
be
> a syntactically equivalent YANG model.
>
> 2.2 The URI condition
>
> Some of the YANG-related protocols might have URI constraints, e.g.
> RESTCONF. For now, we assume either that the JSON-based protocol URI could
> be conformed to RESTCONF compliant uri, or that the server could have a
> routing mapping between the protocol compliant uri and the RESTCONF
> compliant uri, hence this condition would not be an issue, which allows us
> to focus on the message encoding condition.
>
> 3. Proof
>
> 3.1. The message encoding condition is necessary.
>
> We first note that this condition is a necessary condition for a JSON bas=
ed
> protocol to have a syntactically equivalent YANG model by proving its
> contrapositive.
>
> If one of the keys in the key-value pair in the JSON document is not
> pre-defined, the corresponding XML tags will not be pre-defined keywords.
> Therefore, it would not possible to model it in YANG without using
> YANG=E2=80=99s anyxml
> statement (which allows arbitrary XML content).
>
> However, using the anyxml statement would defeat our purpose of modeling
> the data as it allows arbitrary XML content, and will not be helpful in t=
he
> subsequent parsing process.
>
> 3.2. The message encoding condition is sufficient.
>
> We prove this by providing a translation procedure from a JSON message th=
at
> is compliant with the protocol we are trying to model, to a custom java
> class that can be used for Jackson data binding, then to a YANG model.
>
> We note that the middle step of translating to and from the custom parser
> class is not necessary, but it will be useful.
>
> 3.2.1. motivation
>
> JSON data binding is the process of binding data structures (objects,
> arrays, etc.) in JSON to the appropriate data structures in the server
> (e.g. java classes, database tables, etc.) in parsing the JSON text. In
> order to process JSON messages in a meaningful manner, data binding is
> necessary. Even if the binding is not explicit, the server would need to =
do
> it eventually. For example, one can read JSON content in a stream without
> binding it to the java classes, but eventually in order to make sense of
> the data, the server would eventually have to organize it, which is rough=
ly
> analogous to data binding upfront. Popular choices for JSON parsing and
> data binding include jackson and gson.
>
> We use Jackson full data binding as our approach. Full data binding binds
> JSON content into plain old java objects (POJOs), i.e. this custom parser
> class can neither extend nor implement any other class. Jackson uses
> ObjectMapper with the custom parser class to parse JSON content into this
> class.
>
> 3.2.2. The message encoding condition
>
> The message encoding condition is that all keys in each key-value pair in
> the JSON text must be pre-defined keywords. As the keys will become either
> class names and instance variable names, or be keys in the java maps, it =
is
> easy to see that the condition is equivalent to =E2=80=9Cthere exists a f=
ull data
> binding in Jackson custom parser class without using any map structures
> (Map<String, ?>).=E2=80=9D
>
> 3.2.3. Proof
>
> We provide a recursive binding process from a JSON object to the Jackson
> custom parser class to be used by Jackson ObjectMapper.
>
> Type determine_type(value) {
>
>  if (value is of a primitive type, i.e. string, number, boolean, null) {
>
>    return the corresponding java primitive type;
>
>  }
>
>  if (value is a JSON object) {
>
>    return build_parser_class(value).class;
>
>  }
>
>  if (value is an array) {
>
>    return ArrayList<T> where T=3Ddetermine_type(value[0]);
>
>  }
>
>  // should not reach here.
>
> }
>
> Class build_parser_class(JSONObject obj) {
>
>  create custom class C;
>
>  for each key/value pair in the obj {
>
>    add instance variable v in C;
>
>    the name of variable v <- key; // (__known__ a/c to our assumption)
>
>    the type of variable v <- determine_type(value);
>
>  }
>
>  return C.class;
>
> }
>
> Naming:
>
> --change everything into CamelCase (i.e. remove dashes, etc.)
>
> --for instance variables, use =E2=80=9Cmy=E2=80=9D prefix, (e.g. myVariab=
le, myNetworkMap,
> etc.)
>
> --for the custom class name, if the object is an element of the array, use
> =E2=80=9CElement=E2=80=9D suffix.
>
> This is just one convention so that the next step proceeds smoothly. As
> long as this naming translation is consistent with the naming stage in the
> next step, it will work just fine.
>
> Example (a modified ALTO protocol network map example):
>
> JSON object:
>
> {
>
>  =E2=80=9Cmeta=E2=80=9D: {
>
>    =E2=80=9Cresource-id=E2=80=9D: =E2=80=9Cmy-default-map=E2=80=9D,
>
>    =E2=80=9Ctag=E2=80=9D: =E2=80=9Caab875ef69c87d012=E2=80=9D
>
>  },
>
>  =E2=80=9Cnetwork-map=E2=80=9D: [
>
>    {
>
>      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,
>
>      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =E2=80=9CPID2=E2=80=
=9D, =E2=80=9CPID3=E2=80=9D]
>
>    },
>
>    {
>
>      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,
>
>      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =E2=80=9CPID3=E2=80=
=9D]
>
>    },
>
>    {
>
>      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID3=E2=80=9D,
>
>      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=
=9D]
>
>    }
>
>  ]
>
> }
>
> Result of build_parser_class(obj):
>
> Class JSONObject {
>
>  Meta myMeta;
>
>  ArrayList<NetworkMapElement> myNetworkMap;
>
> }
>
> Class Meta {
>
>  String myResourceId;
>
>  String myTag;
>
> }
>
> Class NetworkMapElement {
>
>  String mySrc;
>
>  ArrayList<String> myDsts;
>
> }
>
> Now given the Jackson Parser Java Class, to get a syntactically equivalent
> YANG model:
>
> YANGModel build_yang_model(Class C) {
>
>  for each instance variable (Type, Name) {
>
>    if (Type is primitive type: string, number, boolean, null) {
>
>      add the following to the YANG module:
>
>      =E2=80=9Cleaf Name { type <YANG equivalent of Type>; }=E2=80=9D
>
>    }
>
>    if (Type is an ArrayList<TypeElement>) {
>
>      if (TypeElement is primitive type) {
>
>        add the following to the YANG module:
>
>        =E2=80=9Cleaf-list Name { type <YANG equivalent of TypeElement>; }=
=E2=80=9D
>
>      } else {
>
>        // TypeElement is a custom parser class
>
>        add the following to the YANG module:
>
>        =E2=80=9Clist Name { <result from build_yang_model<TypeElement.cla=
ss>> }=E2=80=9D
>
>      }
>
>    }
>
>    if (Type is a custom parser class) {
>
>      add the following to the YANG module:
>
>      =E2=80=9Ccontainer Name { <result from build_yang_model<Type.class>>=
 }=E2=80=9D
>
>    }
>
>  }
>
> }
>
> Result from the previous example:
>
> container meta {
>
>  leaf resource-id {
>
>    type string;
>
>  }
>
>  leaf tag {
>
>    type string;
>
>  }
>
> }
>
> list network-map {
>
>  leaf src {
>
>    type string;
>
>  }
>
>  leaf-list dsts {
>
>    type string;
>
>  }
>
> }
>
> This does validate the JSON document with XML-JSON encoding. For your
> reference, this is the XML document which validates:
>
> <?xml version=3D"1.0" encoding=3D"UTF-8" ?>
>
> <meta>
>
>  <resource-id>my-default-map</resource-id>
>
>  <tag>aab875ef69c87d012</tag>
>
> </meta>
>
> <network-map>
>
>  <src>PID1</src>
>
>  <dsts>PID1</dsts>
>
>  <dsts>PID2</dsts>
>
>  <dsts>PID3</dsts>
>
> </network-map>
>
> <network-map>
>
>  <src>PID2</src>
>
>  <dsts>PID1</dsts>
>
>  <dsts>PID3</dsts>
>
> </network-map>
>
> <network-map>
>
>  <src>PID3</src>
>
>  <dsts>PID2</dsts>
>
>  <dsts>PID3</dsts>
>
> </network-map>
>
> This proves that the message encoding condition is a sufficient condition
> for the JSON object to have a YANG model.
>
> Note the model generated is very crude and lose almost all constraints and
> all inheritance features (if any), because it focuses on the syntax and is
> essentially converted from an JSON object compliant with a protocol inste=
ad
> of from the protocol itself. Hence this result is more useful in
> determining which JSON based protocols cannot have a syntactically
> equivalent YANG model, than in generating a good YANG model.
>
> 3.3. Conclusion
>
> Our claim holds. A JSON based protocol carried by HTTP can have
> syntactically equivalent YANG model, if and only if all the keys in the
> key-value pairs in the JSON message are pre-defined keywords.
>
> 4. Semantic equivalence
>
> For JSON based protocols that don=E2=80=99t satisfy the message encoding =
condition,
> it is still possible to have a semantically equivalent YANG model. All th=
at
> is required for the protocol compliant clients and the YANG model complia=
nt
> server to interoperate is an adapter which does the following:
>
> 1) translate FROM YANG server compliant response msg TO alto compliant
> response msg
>
> 2) translate FROM alto compliant request msg TO YANG server compliant
> request msg
>
> 4.1. Claim
>
> This adapter needs to be protocol-aware.
>
> Ideally, given any YANG model, we would like to be able to automatically
> (or at least mechanically) generate this message adapter, which means not
> looking at the protocol or its compliant msgs. However, without knowing t=
he
> specific protocol that we are working with (i.e. human intervention, i.e.
> looking at the protocol compliant msgs), such an adapter cannot be
> auto-generated.
>
> 4.2. Proof by Indistinguishability
>
> Suppose both the YANG server compliant msg m_y and the actually protocol
> compliant msg m_p are in JSON (or have been encoded into JSON). Looking at
> the differences between the two messages, call these differences {d1, d2,
> ..., dn}. The goal for the auto-generated adapter would be to identify and
> eliminate these differences. Construct a new JSON msg m' where all but one
> difference di is the same as m_p and di is the same as the m_y. Without
> looking at the protocol (or m_p), the auto-generated adapter would not be
> able to distinguish between m' and m_p in its translation process, which
> means, it won't be able to tell whether it should change di or not. Hence,
> such an adapter must be protocol-aware.
>
> A good example is the dependent-vtag in the ALTO protocol:
>
> "dependent-vtag" : [
>
>  {
>
>    "resource-id" : "my-network-map",
>
>    "tag" : "abcd1234"
>
>  }
>
> ]
>
> It was specified this way in the alto protocol. However, it could
> conceivably be the case that it was originally the following map structur=
e,
> and was converted into the above encoding because of the map->list+key
> issue. (This case is actually one of the few differences in the m_y and m=
_p
> where the adapter does not need to convert it back to a map structure.)
>
> "dependent-vtag" : {
>
>  "my-network-map" : {
>
>    "tag" : "abcd1234"
>
>  }
>
> }
>
> Without knowing the protocol, there is no way to tell.
>
> 5. Ramifications
>
> We now understand the basic condition for a JSON based protocol to have a
> YANG Model. For the protocols that don=E2=80=99t meet this condition, the=
re can be
> a semantic equivalent YANG model, but there won=E2=80=99t be a generic pr=
ocess of
> generating the adapter for all such protocols.
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

--=20
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C


From nobody Mon Oct 20 08:29:12 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 608ED1A1B55 for <alto@ietfa.amsl.com>; Mon, 20 Oct 2014 08:29:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.071
X-Spam-Level: 
X-Spam-Status: No, score=-0.071 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001, TRACKER_ID=1.306] 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 4C3Zf-_vrWqO for <alto@ietfa.amsl.com>; Mon, 20 Oct 2014 08:28:55 -0700 (PDT)
Received: from mail-yh0-x22a.google.com (mail-yh0-x22a.google.com [IPv6:2607:f8b0:4002:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1C14F1A1BDD for <alto@ietf.org>; Mon, 20 Oct 2014 08:22:28 -0700 (PDT)
Received: by mail-yh0-f42.google.com with SMTP id t59so3335153yho.15 for <alto@ietf.org>; Mon, 20 Oct 2014 08:22:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=QEf5WCElc05BYircScBMOcYhkLcq+kpwn/XrLQUOKqU=; b=MXKspd65dFZmSYe/krhYrVO34YXc3KWfQ7ddkIfnELqIOAZM020aUKBcg1k4Xgm5pq ZHDwKeM0csZj98fh2aYMBH3miNcdY4ua01LSZUgXIKi79+ta4Grx14wgIVXz2NPLp6tB bONQOUdqSl01YR/ceJ5ZDbiJTeJ3k//fxZqr8rf2+RZQvJ3WLDgrDPPbX36hdtZ86y4v 6MJRrbLhDlFcHxPmxvySljR0loTWAQhMcN3dNU8tq//LxeGJegV1jxDLW0Xj1qUsCwSg BFra7Xg6cezPYuSakmH7hqynmTnQFA9/JKZcTyS9Un/iEHqjjEROS8f0FiiftLEHBqOL xm+A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=QEf5WCElc05BYircScBMOcYhkLcq+kpwn/XrLQUOKqU=; b=IDvO8SVCbkehRUuuPBHpvwGBlUNWB04htI2LvZ6lSVPyM6yj9SJWUqlanhasuDX6Jy RDL4A6VT1RgrWVTBtoWWn7E/bEblzzuTh1/Agw0j4sTBtenHWavhLYhoPP5/n6EYf8yW HoTCHC38Uort4FN+1gpyiQobYAuuwgghajqpM=
X-Received: by 10.236.25.166 with SMTP id z26mr38273934yhz.69.1413818547359; Mon, 20 Oct 2014 08:22:27 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.97.10 with HTTP; Mon, 20 Oct 2014 08:22:07 -0700 (PDT)
In-Reply-To: <D06A8B01.18A8A8%w.roome@alcatel-lucent.com>
References: <D0644784.180EE4%w.roome@alcatel-lucent.com> <CANUuoLoDnPx-V37==AXbMzuRPiYLXRz3CkMVpfSRfEMehg8S_g@mail.gmail.com> <D0653E13.181A19%w.roome@alcatel-lucent.com> <CAFwJzZn6hOzP-ef0Ji2vpnkTpU_wifZoKqxhpSo3pVzXB901LA@mail.gmail.com> <D06687CA.1854F3%w.roome@alcatel-lucent.com> <CAFwJzZm2GPCYbZDmtTyOBzuS6RFCxrSKZO4Vy9xR-usDtvWeFg@mail.gmail.com> <D066C5FC.188767%w.roome@alcatel-lucent.com> <CAFwJzZkMim8S6u_24oyns_x8_hnU1sXhajcj-CNQgToBHHjARw@mail.gmail.com> <D06A8B01.18A8A8%w.roome@alcatel-lucent.com>
From: Xiao SHI <xiao.shi@yale.edu>
Date: Mon, 20 Oct 2014 11:22:07 -0400
X-Google-Sender-Auth: t8oKoLgRYZWC816gU4aBjBiYn70
Message-ID: <CAFwJzZ=Cyb4t6ae6KEo9d-Q6muRtZj0vF15DDbK=7F6H8vJc0w@mail.gmail.com>
To: Wendy Roome <w.roome@alcatel-lucent.com>
Content-Type: multipart/alternative; boundary=089e013d08904ad54b0505dc4864
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/tEcqJHy8VQ_3SBjM1NC7RRm2R7M
Cc: Xiao SHI <xiao.shi@yale.edu>, IETF ALTO <alto@ietf.org>
Subject: Re: [alto] Incremental updates transport using SSE?
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Oct 2014 15:29:01 -0000

--089e013d08904ad54b0505dc4864
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi Wendy,

#1: Yes, that will solve the problem I was thinking of.

A follow up on this: what if say the client gets a cost map which depends
on a version of the network map that the client has not received? Should
the client simply discard the cost map or its patch? or temporarily save
the cost map and wait? Or does this question enters the realm of
client/server implementation/optimization and is no longer the protocol's
concern?

Anyhow, I agree that the resource-id should do.

#2: Sounds good. The reason I thought of this is that a network map could
be in multiple update streams, should/could there be a preference of which
stream the user get the update of the network map from? Or the client could
simply find *any* update stream which contains the resource update it wants=
?

#3: That's exactly what I meant. Just double checking.

Thanks,
Xiao


On Mon, Oct 20, 2014 at 10:14 AM, Wendy Roome <w.roome@alcatel-lucent.com>
wrote:

> Xiao,
>
> #1: I don't think that is a good idea. The tag is mutable -- it changes
> every update. I believe the event type should be immutable over updates.
> E.g., note that the IRD has resource ids, but not tags. I believe the
> scenario you described is easily avoidable: when the client gets a new
> network map event, the client updates the cached network map, including
> updated the tag, and automatically discards any cached cost map(s) that
> depended on the old tag. And in any case, before using a cost map, the
> client should always verify that the network map tag in the cost map
> matches the tag of the map used to lookup the address.
>
> Or did I not understand your scenario properly?
>
> #2: That seems to be an unnecessary optimization and complication. It's a
> complication because it adds an additional constraint (that uri must exis=
t,
> the resource must be an event stream, etc). It's unnecessary because let=
=E2=80=99s
> be realistic, an IRD will have at most 20 or 30 entries. Searching them f=
or
> an update stream is not a challenge. Particularly if you remember a clien=
t
> does that once and then keeps the stream open for hours.
>
> Also, if you do think that is necessary, the map resource should give the
> *resource id* of the associated update resource, not the uri. Only a
> resource's IRD entry should give the uri. Think of that as equivalent to
> normalizing a relational DB.
>
> Or perhaps there could be a capability (or an attribute) that says this
> resource does have an update stream, so the client knows whether search t=
he
> IRD for it.
>
> #3: I assumed that for a filtered update stream, the client would use a
> POST request to tell the server which events the client wanted, and the
> server would filter out (or just not send) the other events. Is that what
> you meant?
>
> - Wendy Roome
>
> From: Xiao SHI <xiao.shi@yale.edu>
> Date: Fri, October 17, 2014 at 20:13
>
> To: Wendy Roome <w.roome@alcatel-lucent.com>
> Cc: Xiao SHI <xiao.shi@yale.edu>, "Y. Richard Yang" <yry@cs.yale.edu>,
> IETF ALTO <alto@ietf.org>
> Subject: Re: [alto] Incremental updates transport using SSE?
>
> Hi Wendy,
>
> I think this is a very good and efficient design. Just a few comments:
>
> 1. In the event field of the SSE, you included the resource-id but not th=
e
> tag along with it. I agree that the tag seems unnecessary because each
> event is essentially an update of the map, and should be assigned a new t=
ag
> if the update were not incremental. However, consider the following
> scenario: if, for whatever reason, the client only subscribed to the
> network map incr updates (or the server only provided the network map
> stream), and the client is requesting cost maps from the server via regul=
ar
> mechanism (i.e. always getting a full new map which contains the
> dependent-vtag), could there be issues when the version of the network ma=
p
> is not synchronized with the dependent vtag that the client is about to
> use? For example, if I got the cost map which depends on the network map =
a
> few incremental updates ago, but I have already processed those updates,
> there could potentially be PID mismatches and what not, right?
>
> Shall we simply go ahead and add the tag into the event field? As for cos=
t
> maps, that would be the dependent-vtag. We can also put it in the id fiel=
d.
>
> 2. In the IRD, would it make sense to include the incremental update uri
> in the entries for regular resources? For example, a client would probabl=
y
> find it useful to know that the server is providing
> "my-default-network-map," and its incr update stream can be found in "
> http://example.com/network-map-updates."
>
> So the IRD would look like this:
>   "network-map": {
>     ...,
>     "update-uri":"http://somewhere.com/network-map-updates"
>   },
>   "routingcost-map": {
>     ...,
>     "update-uri":"http://somewhere.com/network-map-updates"
>   },
>   "hopcount-map": {
>     ...,
>     "update-uri":"http://somewhere.com/network-map-updates"
>   },
>
>   "network-map-updates": {
>     "uri": "http://somewhere.com/network-map-updates",
>     "media-type": "text/event-stream",
>     "uses": ["network-map", "routingcost-map", "hopcount-map"],
>     "accepts": "application/alto-updatestreamfilter+json",
>     "capabilities": {
>       "events": [
>         {"media-type": "application/alto-networkmap+json",
>          "resource-id": "network-map"},
>         {"media-type": "application/alto-costmap+json",
>          "resource-id": "routingcost-map"},
>         {"media-type": "application/merge-patch+json",
>          "resource-id": "routingcost-map"},
>         {"media-type": "application/alto-costmap+json",
>          "resource-id": "hopcount-map"},
>         {"media-type": "application/merge-patch+json",
>          "resource-id": "hopcount-map"}
>       ]
>     }
>   }
>
> This saves the trouble for the client to search through the "uses" field
> in each stream resource; Also, when there are multiple streams for
> incremental updates for one map (e.g. one stream for networkmap A + costm=
ap
> B, one stream for networkmap A + costmap C and D), the server could
> load-balance by providing the default update-uri for networkmap A in its
> IRD entry.
>
> 3. To reduce overall traffic, I assume for one particular event stream,
> the event filtering would be done on the server side, right?
>
> What do you think?
>
> Cheers,
> Xiao
>
> On Fri, Oct 17, 2014 at 1:35 PM, Wendy Roome <w.roome@alcatel-lucent.com>
> wrote:
>
>> Xiao,
>>
>> My first take was that update stream resources should be 1-1 with the
>> underlying full map resources. Then I realized that cost maps depend on
>> network maps, and clients & servers should coordinate changes to the two=
.
>> The easiest way to accomplish that was to use the same stream for both
>> network map and cost map updates, with the event type distinguishing
>> network map updates from cost map updates.
>>
>> But your comment reminded me that network maps are 1-n with cost maps.
>> Eg, a network map can have two cost maps, one for routingcost and the ot=
her
>> for hopcount.
>>
>> So I suggest that an update stream resource can provide updates for an
>> arbitrary set of resources. The server picks the set. Each update event =
has
>> a media-type (basically, full-map vs merge-patch), and the resource-id o=
f
>> the map it updates. Because SSE only allows three fields (event, id and
>> data), I suggest we encode the media-type,resource-id pair in the event
>> type, as a JSON object with those field names, as in:
>>
>>     event:
>> {"media-type":"application/alto-network-map+json","resource-id":"network=
-map"}
>>
>> Here=E2=80=99s a detailed example of an IRD with an update stream servic=
e that
>> gives updates for the network map and the associated routingcost and
>> hopcount maps. It offers merge-patch incremental updates for the cost ma=
ps,
>> but only full updates for network maps:
>>
>>   "network-map": {...},
>>   "routingcost-map": {...},
>>   "hopcount-map": {...},
>>
>>   "network-map-updates": {
>>     "uri": "http://somewhere.com/network-map-updates",
>>     "media-type": "text/event-stream",
>>     "uses": ["network-map", "routingcost-map", "hopcount-map"],
>>     "accepts": "application/alto-updatestreamfilter+json",
>>     "capabilities": {
>>       "events": [
>>         {"media-type": "application/alto-networkmap+json",
>>          "resource-id": "network-map"},
>>         {"media-type": "application/alto-costmap+json",
>>          "resource-id": "routingcost-map"},
>>         {"media-type": "application/merge-patch+json",
>>          "resource-id": "routingcost-map"},
>>         {"media-type": "application/alto-costmap+json",
>>          "resource-id": "hopcount-map"},
>>         {"media-type": "application/merge-patch+json",
>>          "resource-id": "hopcount-map"}
>>       ]
>>     }
>>   }
>>
>> This is a POST request. The client sends
>> application/alto-updatestreamfilter+json data (a new MIME type) to selec=
t
>> the events it wishes to get. Here is how a client would request updates =
for
>> the network and routingcost maps, but not the hopcount map:
>>
>>   POST /network-map-updates
>>   Host: somewhere.com
>>   Content-Length: ###
>>   Content-Type: application/alto-updatestreamfilter+json
>>   Accept: test/event-stream,application/alto-error+json
>>
>>   {"events": [
>>      {"media-type": "application/alto-networkmap+json",
>>       "resource-id": "network-map"},
>>      {"media-type": "application/alto-costmap+json",
>>       "resource-id": "routingcost-map"},
>>      {"media-type": "application/merge-patch+json",
>>       "resource-id": "routingcost-map"}
>>   ]}
>>
>> The server would respond with something like this.
>>
>>   HTTP/1.1 200 OK
>>   Content-Type: text/event-stream
>>
>>   : Full network map, sent immediately.
>>   event:
>> {"media-type":"application/alto-network-map+json","resource-id":"network=
-map"}
>>   data: { ... full network map ... }
>>
>>   : Full routingcost map, sent immediately.
>>   event:
>> {"media-type":"application/alto-costmap+json","resource-id":"routingcost=
-map"}
>>   data: { ... full routingcost cost map ... }
>>
>>   : Incremental routingcost map update, sent when enough costs have
>> changed.
>>   event:
>> {"media-type":"application/merge-patch+json","resource-id":"routingcost-=
map"}
>>   data: { ... merge-patch for routingcost cost map ... }
>>
>> Note that this omits the ids. They aren't really necessary. But if the
>> underlying SSE library expects them, the server can always use sequence
>> numbers 1, 2, 3, etc.
>>
>> How do people feel about this approach?
>>
>> - Wendy Roome
>>
>> From: Xiao SHI <xiao.shi@yale.edu>
>> Date: Fri, October 17, 2014 at 10:10
>> To: Wendy Roome <w.roome@alcatel-lucent.com>
>> Cc: Xiao SHI <xiao.shi@yale.edu>, "Y. Richard Yang" <yry@cs.yale.edu>,
>> IETF ALTO <alto@ietf.org>
>>
>> Subject: Re: [alto] Incremental updates transport using SSE?
>>
>> Hi Wendy,
>>
>> I completely agree with you. I was thinking maybe there's some clever wa=
y
>> of using the SSE event-id, but the questionable saving is simply not wor=
th
>> the logging and synchronization trouble.
>>
>> 1. One thing that follows this choice is to use one single SSE stream
>> (open connection) for each resource. I briefly considered having one ope=
n
>> connection and send updates for all resources on the server via that
>> stream. The advantage of having only one connection open is smaller
>> overhead, and the disadvantage is that it would require a more complicat=
ed
>> ID and version tagging in event name/id maybe. What do you think?
>>
>> 2. If the mapping between SSE stream and underlying map is one-to-one,
>> would it make sense for the resourceID of a stream to be the resourceID =
of
>> the underlying map and ".update" concatenated together? This way, when t=
he
>> client actually requests and initiates the stream, the client would be
>> aware of the resourceID of the underlying map.
>>
>> 3. Following that, we should define id field in the events. Richard
>> proposed using a tag as the id if it's a full network map, and
>> newtag_oldtag if it's a patch. The vtag for network map is ResourceID+ta=
g
>> tuple, if the client knows about the resourceID, could we only use the t=
ag?
>> And should the cost maps simply use dependent-vtags? Since the id field =
is
>> a string, what format do we want the tags in? A few options are 1) json
>> with all whitespaces removed; 2) an even more compact patterned string.
>>
>> e.g. for network map patch, it could be:
>>
>> {"old-tag":{"resource-id":"my-default-network-map","tag":"3ee2cb7e8d63d9=
fab71b9b34cbf764436315542e"},"new-tag":{"resource-id":"my-default-network-m=
ap","tag":"
>> c0ce023b8678a7b9ec00324673b98e54656d1f6d"}}
>>
>> or (since it must be the same resource):
>>
>> {"resource-id":"my-default-network-map","old-tag":"3ee2cb7e8d63d9fab71b9=
b34cbf764436315542e","new-tag":"
>> c0ce023b8678a7b9ec00324673b98e54656d1f6d"}
>>
>> or (if the client knows the resource-id for the underlying map of the
>> stream, just use a delimiter):
>> 3ee2cb7e8d63d9fab71b9b34cbf764436315542e_
>> c0ce023b8678a7b9ec00324673b98e54656d1f6d
>>
>> What do you think?
>>
>> Best,
>> Xiao
>>
>> On Fri, Oct 17, 2014 at 9:21 AM, Wendy Roome <w.roome@alcatel-lucent.com=
>
>> wrote:
>>
>>> Xiao,
>>>
>>> That is a very good point. I hoped someone would ask about that.
>>>
>>> It is a tradeoff. The disadvantage of requiring the server to send full
>>> map(s) at the start of each stream is that if the connection drops, we =
have
>>> to send the full map over again. But the advantage is that incremental
>>> updates are only within the context of this particular stream. We don't
>>> need keep track of where we were.
>>>
>>> To see the issue, suppose we wanted to avoid re-sending the full map
>>> when the client reestablishes the connection. Then the server must assi=
gn a
>>> unique id to every incremental update event. When the client reconnects=
,
>>> the client gives the server the last known event id, and the server sen=
ds
>>> any events the client missed.
>>>
>>> BTW, SSE does define event ids. Each event has an id, and when
>>> connecting, the client gives a Last-Event-Id header with the last id it
>>> received (if any).
>>>
>>> So what is the problem with that? First, the server MUST assign a uniqu=
e
>>> id to every incremental update, and they must be the same for all clien=
ts.
>>> That is, if the server has several increment-update clients, the server
>>> must "clock" their update event streams at the same rate. Second, the
>>> server must keep a buffer of old update events, in case a client needs =
to
>>> reconnect. And third, because a reconnecting client may send an old (or
>>> bogus) Last-Event-Id, the server may have send the full map(s) anyway.
>>>
>>> If we do not use event ids, then it is much simpler. Incremental update=
s
>>> are in the context of this stream. Period. No persistent state that mus=
t
>>> survive the end of the connection. And if desired, the server can send
>>> updates are different rates to different clients.
>>>
>>> So I think it boils down to how often we expect connections to drop
>>> unintentionally. If that is common, then, yes, we need to define event =
ids
>>> to avoid resending the full maps. But if we can assume accidental drops=
 are
>>> rare, then I think it is simpler just to send the full map(s) for every=
 new
>>> connection.
>>>
>>> - Wendy Roome
>>>
>>> From: Xiao SHI <xiao.shi@yale.edu>
>>> Date: Thu, October 16, 2014 at 18:22
>>> To: Wendy Roome <w.roome@alcatel-lucent.com>
>>> Cc: "Y. Richard Yang" <yry@cs.yale.edu>, IETF ALTO <alto@ietf.org>
>>> Subject: Re: [alto] Incremental updates transport using SSE?
>>>
>>> Hi Wendy,
>>>
>>> If a client accidentally dropped the connection and hopes to re-connect
>>> and receive the merge-patch events, would it make sense for the server =
not
>>> to send the first full-map event? It will save quite some effort that w=
ay.
>>>
>>> Best,
>>> Xiao
>>>
>>>
>>
>

--089e013d08904ad54b0505dc4864
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Wendy,<div><br></div><div>#1: Yes, that will solve the =
problem I was thinking of.</div><div><br></div><div>A follow up on this: wh=
at if say the client gets a cost map which depends on a version of the netw=
ork map that the client has not received? Should the client simply discard =
the cost map or its patch? or temporarily save the cost map and wait? Or do=
es this question enters the realm of client/server implementation/optimizat=
ion and is no longer the protocol&#39;s concern?</div><div><br></div><div>A=
nyhow, I agree that the resource-id should do.</div><div><br></div><div>#2:=
 Sounds good. The reason I thought of this is that a network map could be i=
n multiple update streams, should/could there be a preference of which stre=
am the user get the update of the network map from? Or the client could sim=
ply find *any* update stream which contains the resource update it wants?</=
div><div><br></div><div>#3: That&#39;s exactly what I meant. Just double ch=
ecking.</div><div><br></div><div>Thanks,</div><div>Xiao</div><div><br></div=
></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Mon, Oc=
t 20, 2014 at 10:14 AM, Wendy Roome <span dir=3D"ltr">&lt;<a href=3D"mailto=
:w.roome@alcatel-lucent.com" target=3D"_blank">w.roome@alcatel-lucent.com</=
a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0=
 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style=3D"word-w=
rap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-ser=
if"><div>Xiao,</div><div><br></div><div>#1: I don&#39;t think that is a goo=
d idea. The tag is mutable -- it changes every update. I believe the event =
type should be immutable over updates. E.g., note that the IRD has resource=
 ids, but not tags. I believe the scenario you described is easily avoidabl=
e: when the client gets a new network map event, the client updates the cac=
hed network map, including updated the tag, and automatically discards any =
cached cost map(s) that depended on the old tag. And in any case, before us=
ing a cost map, the client should always verify that the network map tag in=
 the cost map matches the tag of the map used to lookup the address.</div><=
div><br></div><div>Or did I not understand your scenario properly?</div><di=
v><br></div><div>#2: That seems to be an unnecessary optimization and compl=
ication. It&#39;s a complication because it adds an additional constraint (=
that uri must exist, the resource must be an event stream, etc). It&#39;s u=
nnecessary because let=E2=80=99s be realistic, an IRD will have at most 20 =
or 30 entries. Searching them for an update stream is not a challenge. Part=
icularly if you remember a client does that once and then keeps the stream =
open for hours.</div><div><br></div><div>Also, if you do think that is nece=
ssary, the map resource should give the *resource id* of the associated upd=
ate resource, not the uri. Only a resource&#39;s IRD entry should give the =
uri. Think of that as equivalent to normalizing a relational DB.</div><div>=
<br></div><div>Or perhaps there could be a capability (or an attribute) tha=
t says this resource does have an update stream, so the client knows whethe=
r search the IRD for it.</div><div><br></div><div>#3: I assumed that for a =
filtered update stream, the client would use a POST request to tell the ser=
ver which events the client wanted, and the server would filter out (or jus=
t not send) the other events. Is that what you meant?</div><div><br></div><=
div><span style=3D"white-space:pre-wrap">	</span>- Wendy Roome</div><div><b=
r></div><span><div style=3D"font-family:Calibri;font-size:11pt;text-align:l=
eft;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-B=
OTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;B=
ORDER-RIGHT:medium none;PADDING-TOP:3pt"><span style=3D"font-weight:bold">F=
rom: </span> Xiao SHI &lt;<a href=3D"mailto:xiao.shi@yale.edu" target=3D"_b=
lank">xiao.shi@yale.edu</a>&gt;<br><span style=3D"font-weight:bold">Date: <=
/span> Fri, October 17, 2014 at 20:13<div><div class=3D"h5"><br><span style=
=3D"font-weight:bold">To: </span> Wendy Roome &lt;<a href=3D"mailto:w.roome=
@alcatel-lucent.com" target=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;<b=
r><span style=3D"font-weight:bold">Cc: </span> Xiao SHI &lt;<a href=3D"mail=
to:xiao.shi@yale.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt;, &quot;Y.=
 Richard Yang&quot; &lt;<a href=3D"mailto:yry@cs.yale.edu" target=3D"_blank=
">yry@cs.yale.edu</a>&gt;, IETF ALTO &lt;<a href=3D"mailto:alto@ietf.org" t=
arget=3D"_blank">alto@ietf.org</a>&gt;<br><span style=3D"font-weight:bold">=
Subject: </span> Re: [alto] Incremental updates transport using SSE?<br></d=
iv></div></div><div><div class=3D"h5"><div><br></div><div dir=3D"ltr">Hi We=
ndy,<div><br></div><div>I think this is a very good and efficient design. J=
ust a few comments:</div><div><br></div><div>1. In the event field of the S=
SE, you included the resource-id but not the tag along with it. I agree tha=
t the tag seems unnecessary because each event is essentially an update of =
the map, and should be assigned a new tag if the update were not incrementa=
l. However, consider the following scenario: if, for whatever reason, the c=
lient only subscribed to the network map incr updates (or the server only p=
rovided the network map stream), and the client is requesting cost maps fro=
m the server via regular mechanism (i.e. always getting a full new map whic=
h contains the dependent-vtag), could there be issues when the version of t=
he network map is not synchronized with the dependent vtag that the client =
is about to use? For example, if I got the cost map which depends on the ne=
twork map a few incremental updates ago, but I have already processed those=
 updates, there could potentially be PID mismatches and what not, right?</d=
iv><div><br></div><div>Shall we simply go ahead and add the tag into the ev=
ent field? As for cost maps, that would be the dependent-vtag. We can also =
put it in the id field.</div><div><br></div><div>2. In the IRD, would it ma=
ke sense to include the incremental update uri in the entries for regular r=
esources? For example, a client would probably find it useful to know that =
the server is providing &quot;my-default-network-map,&quot; and its incr up=
date stream can be found in &quot;<a href=3D"http://example.com/network-map=
-updates" target=3D"_blank">http://example.com/network-map-updates</a>.&quo=
t;</div><div><br></div><div>So the IRD would look like this:</div><div><div=
 style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=
=C2=A0 &quot;network-map&quot;: {</div><div style=3D"color:rgb(0,0,0);font-=
family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 ...,</div><div styl=
e=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=A0=
 =C2=A0 &quot;update-uri&quot;:&quot;<a href=3D"http://somewhere.com/networ=
k-map-updates" target=3D"_blank">http://somewhere.com/network-map-updates</=
a>&quot;</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif=
;font-size:14px">=C2=A0 },</div><div style=3D"color:rgb(0,0,0);font-family:=
Calibri,sans-serif;font-size:14px">=C2=A0 &quot;routingcost-map&quot;:=C2=
=A0{</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;fon=
t-size:14px">=C2=A0 =C2=A0 ...,</div><div style=3D"color:rgb(0,0,0);font-fa=
mily:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 &quot;update-uri&quot=
;:&quot;<a href=3D"http://somewhere.com/network-map-updates" target=3D"_bla=
nk">http://somewhere.com/network-map-updates</a>&quot;</div><div style=3D"c=
olor:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=A0 },</d=
iv><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:=
14px">=C2=A0 &quot;hopcount-map&quot;: {</div><div style=3D"color:rgb(0,0,0=
);font-family:Calibri,sans-serif;font-size:14px"><div>=C2=A0 =C2=A0 ...,</d=
iv><div>=C2=A0 =C2=A0 &quot;update-uri&quot;:&quot;<a href=3D"http://somewh=
ere.com/network-map-updates" target=3D"_blank">http://somewhere.com/network=
-map-updates</a>&quot;</div><div>=C2=A0 },</div></div><div style=3D"color:r=
gb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=A0=C2=A0</div>=
<div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14p=
x">=C2=A0 &quot;network-map-updates&quot;: {</div><div style=3D"color:rgb(0=
,0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 &quot;ur=
i&quot;: &quot;<a href=3D"http://somewhere.com/network-map-updates" target=
=3D"_blank">http://somewhere.com/network-map-updates</a>&quot;,</div><div s=
tyle=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=
=A0 =C2=A0 &quot;media-type&quot;: &quot;text/event-stream&quot;,</div><div=
 style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=
=C2=A0 =C2=A0 &quot;uses&quot;: [&quot;network-map&quot;, &quot;routingcost=
-map&quot;, &quot;hopcount-map&quot;],</div><div style=3D"color:rgb(0,0,0);=
font-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 &quot;accepts&=
quot;: &quot;application/alto-updatestreamfilter+json&quot;,</div><div styl=
e=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=A0=
 =C2=A0 &quot;capabilities&quot;: {</div><div style=3D"color:rgb(0,0,0);fon=
t-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 &quot;even=
ts&quot;: [</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-se=
rif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;media-type&quot;: &q=
uot;application/alto-networkmap+json&quot;,</div><div style=3D"color:rgb(0,=
0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0&quot;resource-id&quot;: &quot;network-map&quot;},</div><div s=
tyle=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;media-type&quot;: &quot;application/alto-co=
stmap+json&quot;,</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,s=
ans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;resource-=
id&quot;: &quot;routingcost-map&quot;},</div><div style=3D"color:rgb(0,0,0)=
;font-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 =C2=A0=
 {&quot;media-type&quot;: &quot;application/merge-patch+json&quot;,</div><d=
iv style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;resource-id&quot;: &quot;routingco=
st-map&quot;},</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans=
-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;media-type&quot;:=
 &quot;application/alto-costmap+json&quot;,</div><div style=3D"color:rgb(0,=
0,0);font-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0&quot;resource-id&quot;: &quot;hopcount-map&quot;},</div><div =
style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;media-type&quot;: &quot;application/merg=
e-patch+json&quot;,</div><div style=3D"color:rgb(0,0,0);font-family:Calibri=
,sans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;resourc=
e-id&quot;: &quot;hopcount-map&quot;}</div><div style=3D"color:rgb(0,0,0);f=
ont-family:Calibri,sans-serif;font-size:14px">=C2=A0 =C2=A0 =C2=A0 ]</div><=
div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px=
">=C2=A0 =C2=A0 }</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,s=
ans-serif;font-size:14px">=C2=A0 }</div></div><div><br></div><div>This save=
s the trouble for the client to search through the &quot;uses&quot; field i=
n each stream resource; Also, when there are multiple streams for increment=
al updates for one map (e.g. one stream for networkmap A + costmap B, one s=
tream for networkmap A + costmap C and D), the server could load-balance by=
 providing the default update-uri for networkmap A in its IRD entry.</div><=
div><br></div><div>3. To reduce overall traffic, I assume for one particula=
r event stream, the event filtering would be done on the server side, right=
?</div><div><br></div><div>What do you think?</div><div><br></div><div>Chee=
rs,</div><div>Xiao</div></div><div class=3D"gmail_extra"><br><div class=3D"=
gmail_quote">On Fri, Oct 17, 2014 at 1:35 PM, Wendy Roome <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:w.roome@alcatel-lucent.com" target=3D"_blank">w.room=
e@alcatel-lucent.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex=
"><div style=3D"word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-f=
amily:Calibri,sans-serif"><div>Xiao,</div><div><br></div><div>My first take=
 was that update stream resources should be 1-1 with the underlying full ma=
p resources. Then I realized that cost maps depend on network maps, and cli=
ents &amp; servers should coordinate changes to the two. The easiest way to=
 accomplish that was to use the same stream for both network map and cost m=
ap updates, with the event type distinguishing network map updates from cos=
t map updates.</div><div><br></div><div>But your comment reminded me that n=
etwork maps are 1-n with cost maps. Eg, a network map can have two cost map=
s, one for routingcost and the other for hopcount.</div><div><br></div><div=
>So I suggest that an update stream resource can provide updates for an arb=
itrary set of resources. The server picks the set. Each update event has a =
media-type (basically, full-map vs merge-patch), and the resource-id of the=
 map it updates. Because SSE only allows three fields (event, id and data),=
 I suggest we encode the media-type,resource-id pair in the event type, as =
a JSON object with those field names, as in:</div><div><br></div><div>=C2=
=A0 =C2=A0 event: {&quot;media-type&quot;:&quot;application/alto-network-ma=
p+json&quot;,&quot;resource-id&quot;:&quot;network-map&quot;}</div><div><br=
></div><div>Here=E2=80=99s a detailed example of an IRD with an update stre=
am service that gives updates for the network map and the associated routin=
gcost and hopcount maps. It offers merge-patch incremental updates for the =
cost maps, but only full updates for network maps:</div><div><br></div><div=
><div>=C2=A0 &quot;network-map&quot;: {...},</div><div>=C2=A0 &quot;routing=
cost-map&quot;: {...},</div><div>=C2=A0 &quot;hopcount-map&quot;: {...},</d=
iv><div>=C2=A0=C2=A0</div><div>=C2=A0 &quot;network-map-updates&quot;: {</d=
iv><div>=C2=A0 =C2=A0 &quot;uri&quot;: &quot;<a href=3D"http://somewhere.co=
m/network-map-updates" target=3D"_blank">http://somewhere.com/network-map-u=
pdates</a>&quot;,</div><div>=C2=A0 =C2=A0 &quot;media-type&quot;: &quot;tex=
t/event-stream&quot;,</div><div>=C2=A0 =C2=A0 &quot;uses&quot;: [&quot;netw=
ork-map&quot;, &quot;routingcost-map&quot;, &quot;hopcount-map&quot;],</div=
><div>=C2=A0 =C2=A0 &quot;accepts&quot;: &quot;application/alto-updatestrea=
mfilter+json&quot;,</div><div>=C2=A0 =C2=A0 &quot;capabilities&quot;: {</di=
v><div>=C2=A0 =C2=A0 =C2=A0 &quot;events&quot;: [</div><div>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 {&quot;media-type&quot;: &quot;application/alto-networkmap+js=
on&quot;,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;resource-id&quo=
t;: &quot;network-map&quot;},</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;=
media-type&quot;: &quot;application/alto-costmap+json&quot;,</div><div>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;resource-id&quot;: &quot;routingcost-m=
ap&quot;},</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;media-type&quot;: &=
quot;application/merge-patch+json&quot;,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0&quot;resource-id&quot;: &quot;routingcost-map&quot;},</div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;media-type&quot;: &quot;application/alto=
-costmap+json&quot;,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;reso=
urce-id&quot;: &quot;hopcount-map&quot;},</div><div>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 {&quot;media-type&quot;: &quot;application/merge-patch+json&quot;,</=
div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;resource-id&quot;: &quot;h=
opcount-map&quot;}</div><div>=C2=A0 =C2=A0 =C2=A0 ]</div><div>=C2=A0 =C2=A0=
 }</div><div>=C2=A0 }</div></div><div><br></div><div>This is a POST request=
. The client sends application/alto-updatestreamfilter+json data (a new MIM=
E type) to select the events it wishes to get. Here is how a client would r=
equest updates for the network and routingcost maps, but not the hopcount m=
ap:</div><div><br></div><div><div>=C2=A0 POST /network-map-updates</div><di=
v>=C2=A0 Host: <a href=3D"http://somewhere.com" target=3D"_blank">somewhere=
.com</a></div><div>=C2=A0 Content-Length: ###</div><div>=C2=A0 Content-Type=
: application/alto-updatestreamfilter+json</div><div>=C2=A0 Accept: test/ev=
ent-stream,application/alto-error+json</div><div>=C2=A0=C2=A0</div><div>=C2=
=A0 {&quot;events&quot;: [</div><div>=C2=A0 =C2=A0 =C2=A0{&quot;media-type&=
quot;: &quot;application/alto-networkmap+json&quot;,</div><div>=C2=A0 =C2=
=A0 =C2=A0 &quot;resource-id&quot;: &quot;network-map&quot;},</div><div>=C2=
=A0 =C2=A0 =C2=A0{&quot;media-type&quot;: &quot;application/alto-costmap+js=
on&quot;,</div><div>=C2=A0 =C2=A0 =C2=A0 &quot;resource-id&quot;: &quot;rou=
tingcost-map&quot;},</div><div>=C2=A0 =C2=A0 =C2=A0{&quot;media-type&quot;:=
 &quot;application/merge-patch+json&quot;,</div><div>=C2=A0 =C2=A0 =C2=A0 &=
quot;resource-id&quot;: &quot;routingcost-map&quot;}</div><div>=C2=A0 ]}</d=
iv></div><div><br></div><div>The server would respond with something like t=
his.</div><div><br></div><div><div>=C2=A0 HTTP/1.1 200 OK</div><div>=C2=A0 =
Content-Type: text/event-stream</div><div>=C2=A0=C2=A0</div><div>=C2=A0 : F=
ull network map, sent immediately.</div><div>=C2=A0 event: {&quot;media-typ=
e&quot;:&quot;application/alto-network-map+json&quot;,&quot;resource-id&quo=
t;:&quot;network-map&quot;}</div><div>=C2=A0 data: { ... full network map .=
.. }</div><div><br></div><div>=C2=A0 : Full routingcost map, sent immediate=
ly. =C2=A0</div><div>=C2=A0 event: {&quot;media-type&quot;:&quot;applicatio=
n/alto-costmap+json&quot;,&quot;resource-id&quot;:&quot;routingcost-map&quo=
t;}</div><div>=C2=A0 data: { ... full routingcost cost map ... }</div><div>=
=C2=A0 =C2=A0 =C2=A0</div><div>=C2=A0 : Incremental routingcost map update,=
 sent when enough costs have changed. =C2=A0</div><div>=C2=A0 event: {&quot=
;media-type&quot;:&quot;application/merge-patch+json&quot;,&quot;resource-i=
d&quot;:&quot;routingcost-map&quot;}</div><div>=C2=A0 data: { ... merge-pat=
ch for routingcost cost map ... }</div></div><div><br></div><div>Note that =
this omits the ids. They aren&#39;t really necessary. But if the underlying=
 SSE library expects them, the server can always use sequence numbers 1, 2,=
 3, etc.</div><div><br></div><div>How do people feel about this approach?</=
div><div><br></div><div><span style=3D"white-space:pre-wrap">	</span>- Wend=
y Roome</div><div><br></div><span><div style=3D"font-family:Calibri;font-si=
ze:11pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:m=
edium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP=
:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt"><span style=3D=
"font-weight:bold">From: </span> Xiao SHI &lt;<a href=3D"mailto:xiao.shi@ya=
le.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt;<br><span style=3D"font-=
weight:bold">Date: </span> Fri, October 17, 2014 at 10:10<br><span style=3D=
"font-weight:bold">To: </span> Wendy Roome &lt;<a href=3D"mailto:w.roome@al=
catel-lucent.com" target=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;<br><=
span style=3D"font-weight:bold">Cc: </span> Xiao SHI &lt;<a href=3D"mailto:=
xiao.shi@yale.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt;, &quot;Y. Ri=
chard Yang&quot; &lt;<a href=3D"mailto:yry@cs.yale.edu" target=3D"_blank">y=
ry@cs.yale.edu</a>&gt;, IETF ALTO &lt;<a href=3D"mailto:alto@ietf.org" targ=
et=3D"_blank">alto@ietf.org</a>&gt;<div><div><br><span style=3D"font-weight=
:bold">Subject: </span> Re: [alto] Incremental updates transport using SSE?=
<br></div></div></div><div><div><div><br></div><div dir=3D"ltr">Hi Wendy,<d=
iv><br></div><div>I completely agree with you. I was thinking maybe there&#=
39;s some clever way of using the SSE event-id, but the questionable saving=
 is simply not worth the logging and synchronization trouble.</div><div><br=
></div><div>1. One thing that follows this choice is to use one single SSE =
stream (open connection) for each resource. I briefly considered having one=
 open connection and send updates for all resources on the server via that =
stream. The advantage of having only one connection open is smaller overhea=
d, and the disadvantage is that it would require a more complicated ID and =
version tagging in event name/id maybe. What do you think?</div><div><br></=
div><div>2. If the mapping between SSE stream and underlying map is one-to-=
one, would it make sense for the resourceID of a stream to be the resourceI=
D of the underlying map and &quot;.update&quot; concatenated together? This=
 way, when the client actually requests and initiates the stream, the clien=
t would be aware of the resourceID of the underlying map.</div><div><br></d=
iv><div>3. Following that, we should define id field in the events. Richard=
 proposed using a tag as the id if it&#39;s a full network map, and newtag_=
oldtag if it&#39;s a patch. The vtag for network map is ResourceID+tag tupl=
e, if the client knows about the resourceID, could we only use the tag? And=
 should the cost maps simply use dependent-vtags? Since the id field is a s=
tring, what format do we want the tags in? A few options are 1) json with a=
ll whitespaces removed; 2) an even more compact patterned string.</div><div=
><br></div><div>e.g. for network map patch, it could be:</div><div>{&quot;o=
ld-tag&quot;:{&quot;resource-id&quot;:&quot;my-default-network-map&quot;,&q=
uot;tag&quot;:&quot;3ee2cb7e8d63d9fab71b9b34cbf764436315542e&quot;},&quot;n=
ew-tag&quot;:{&quot;resource-id&quot;:&quot;my-default-network-map&quot;,&q=
uot;tag&quot;:&quot;<span style=3D"color:rgb(0,0,0);font-size:1em">c0ce023b=
8678a7b9ec00324673b98e54656d1f6d</span>&quot;}}<br></div><div><br></div><di=
v>or (since it must be the same resource):<br></div><div>{&quot;resource-id=
&quot;:&quot;my-default-network-map&quot;,&quot;old-tag&quot;:&quot;3ee2cb7=
e8d63d9fab71b9b34cbf764436315542e&quot;,&quot;new-tag&quot;:&quot;<span sty=
le=3D"color:rgb(0,0,0);font-size:1em">c0ce023b8678a7b9ec00324673b98e54656d1=
f6d</span>&quot;}<br></div><div><br></div><div>or (if the client knows the =
resource-id for the underlying map of the stream, just use a delimiter):</d=
iv><div>3ee2cb7e8d63d9fab71b9b34cbf764436315542e_<span style=3D"color:rgb(0=
,0,0);font-size:13px">c0ce023b8678a7b9ec00324673b98e54656d1f6d</span><br></=
div><div><br></div><div>What do you think?</div><div><br></div><div>Best,</=
div><div>Xiao</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail=
_quote">On Fri, Oct 17, 2014 at 9:21 AM, Wendy Roome <span dir=3D"ltr">&lt;=
<a href=3D"mailto:w.roome@alcatel-lucent.com" target=3D"_blank">w.roome@alc=
atel-lucent.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><di=
v style=3D"word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family=
:Calibri,sans-serif"><div>Xiao,</div><div><br></div><div>That is a very goo=
d point. I hoped someone would ask about that.</div><div><br></div><div>It =
is a tradeoff. The disadvantage of requiring the server to send full map(s)=
 at the start of each stream is that if the connection drops, we have to se=
nd the full map over again. But the advantage is that incremental updates a=
re only within the context of this particular stream. We don&#39;t need kee=
p track of where we were.</div><div><br></div><div>To see the issue, suppos=
e we wanted to avoid re-sending the full map when the client reestablishes =
the connection. Then the server must assign a unique id to every incrementa=
l update event. When the client reconnects, the client gives the server the=
 last known event id, and the server sends any events the client missed.</d=
iv><div><br></div><div>BTW, SSE does define event ids. Each event has an id=
, and when connecting, the client gives a Last-Event-Id header with the las=
t id it received (if any).</div><div><br></div><div>So what is the problem =
with that? First, the server MUST assign a unique id to every incremental u=
pdate, and they must be the same for all clients. That is, if the server ha=
s several increment-update clients, the server must &quot;clock&quot; their=
 update event streams at the same rate. Second, the server must keep a buff=
er of old update events, in case a client needs to reconnect. And third, be=
cause a reconnecting client may send an old (or bogus) Last-Event-Id, the s=
erver may have send the full map(s) anyway.</div><div><br></div><div>If we =
do not use event ids, then it is much simpler. Incremental updates are in t=
he context of this stream. Period. No persistent state that must survive th=
e end of the connection. And if desired, the server can send updates are di=
fferent rates to different clients.</div><div><br></div><div>So I think it =
boils down to how often we expect connections to drop unintentionally. If t=
hat is common, then, yes, we need to define event ids to avoid resending th=
e full maps. But if we can assume accidental drops are rare, then I think i=
t is simpler just to send the full map(s) for every new connection.</div><d=
iv><br></div><div><span style=3D"white-space:pre-wrap">	</span>- Wendy Room=
e</div><div><br></div><span><div style=3D"font-family:Calibri;font-size:11p=
t;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium =
none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4=
df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt"><span style=3D"font-=
weight:bold">From: </span> Xiao SHI &lt;<a href=3D"mailto:xiao.shi@yale.edu=
" target=3D"_blank">xiao.shi@yale.edu</a>&gt;<br><span style=3D"font-weight=
:bold">Date: </span> Thu, October 16, 2014 at 18:22<br><span style=3D"font-=
weight:bold">To: </span> Wendy Roome &lt;<a href=3D"mailto:w.roome@alcatel-=
lucent.com" target=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;<br><span s=
tyle=3D"font-weight:bold">Cc: </span> &quot;Y. Richard Yang&quot; &lt;<a hr=
ef=3D"mailto:yry@cs.yale.edu" target=3D"_blank">yry@cs.yale.edu</a>&gt;, IE=
TF ALTO &lt;<a href=3D"mailto:alto@ietf.org" target=3D"_blank">alto@ietf.or=
g</a>&gt;<span><br><span style=3D"font-weight:bold">Subject: </span> Re: [a=
lto] Incremental updates transport using SSE?<br></span></div><span><div><b=
r></div><div dir=3D"ltr" style=3D"color:rgb(0,0,0);font-family:Calibri;font=
-size:medium;font-style:normal;font-variant:normal;font-weight:normal;lette=
r-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-t=
ransform:none;white-space:normal;word-spacing:0px">Hi Wendy,<div><br></div>=
<div>If a client accidentally dropped the connection and hopes to re-connec=
t and receive the merge-patch events, would it make sense for the server no=
t to send the first full-map event? It will save quite some effort that way=
.</div><div><br></div><div>Best,</div><div>Xiao</div></div><br></span></spa=
n></div></blockquote></div><br></div></div></div></span></div></blockquote>=
</div><br></div></div></div></span></div>
</blockquote></div><br></div>

--089e013d08904ad54b0505dc4864--


From nobody Mon Oct 20 08:36:35 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 52A5B1A1BB9; Mon, 20 Oct 2014 08:36:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.377
X-Spam-Level: 
X-Spam-Status: No, score=-1.377 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 o7NhTY7LFPHV; Mon, 20 Oct 2014 08:36:06 -0700 (PDT)
Received: from mail-yh0-x233.google.com (mail-yh0-x233.google.com [IPv6:2607:f8b0:4002:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4556F1A0394; Mon, 20 Oct 2014 08:34:17 -0700 (PDT)
Received: by mail-yh0-f51.google.com with SMTP id t59so3323955yho.24 for <multiple recipients>; Mon, 20 Oct 2014 08:34:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=LHk8ZCbtOrBnQhCUbTlcLXVCRu4HeiWShfcGc0UXG7Y=; b=t17zsFDZiYuwIsDuX3golkXuXnuV28hOVPHLEN+ds51solRFhZPdTZxMZNysZhB8Lf V48Qf70/oQMVg6K5yijnCVCskObWfRYxL2Rv2377Atx2LGHbbu6CKGbk+avZtO86/+yg aWPxzCBhl6ISCTeBjzrQklPA+LBmLtLMhRNpFGxVurbNle31ZMYXnJ1JU2wiw3ELxrA8 TQzsH2HtaMr5qSrk5Gac5bUUll3vxRcxYxwSrnYMbpGfGdM7BQLbFktdJBsKZEh5VCl/ cGBn4Ya/aoHrbEgfftO0L2APGT9P9Z1j/wMvHimfCqMH51UMpcG0EzOfQLJRpxapeOdM 4zYQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=LHk8ZCbtOrBnQhCUbTlcLXVCRu4HeiWShfcGc0UXG7Y=; b=18rEp1+GnV6j24VrMA3H/Gnhjt1TKx+VLShB6/GqMg3WgykN6bHTqycS0faea+Xnh3 ZEEe0fw1S+rchS/3k420WecFo91ZMcYtyoAf/tibY3M6SrnYVbRCTYXVOWwjqPpWsu45 K7ABUF8LARKYv3kDlvz9h6+IpTaF3s0ntCGMs=
X-Received: by 10.236.25.166 with SMTP id z26mr38365055yhz.69.1413819256449; Mon, 20 Oct 2014 08:34:16 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.97.10 with HTTP; Mon, 20 Oct 2014 08:33:56 -0700 (PDT)
In-Reply-To: <CABCOCHRxKWFZDue8WaHVei9FdGsBctSf8PE2C_+vCaV66A48JA@mail.gmail.com>
References: <CAFwJzZkAp-4umrrHZEY3qYuFCXu=+Pqbh8SeB=Qr=TTbQurj6A@mail.gmail.com> <m2tx2ynadg.fsf@nic.cz> <CABCOCHRxKWFZDue8WaHVei9FdGsBctSf8PE2C_+vCaV66A48JA@mail.gmail.com>
From: Xiao SHI <xiao.shi@yale.edu>
Date: Mon, 20 Oct 2014 11:33:56 -0400
X-Google-Sender-Auth: 5BxpoA8xntepbAUVif-_PzRF3rE
Message-ID: <CAFwJzZnJJadP_tqYLygVw33gjv_Q1XwPGU8wT4YV=1f6kKqYYg@mail.gmail.com>
To: Andy Bierman <andy@yumaworks.com>
Content-Type: multipart/alternative; boundary=089e013d08908eaeef0505dc7288
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/QiTAJLl92Fzg3YeiQtRaVrlNzjU
Cc: Xiao SHI <xiao.shi@yale.edu>, Ladislav Lhotka <lhotka@nic.cz>, "netmod@ietf.org" <netmod@ietf.org>, IETF ALTO <alto@ietf.org>
Subject: Re: [alto] [netmod] Modeling JSON based protocols using YANG
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Oct 2014 15:36:11 -0000

--089e013d08908eaeef0505dc7288
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi Andy,

I agree with you. Just to clarify, what I am trying to do is to use YANG
data structures for the protocol whose message encoding is JSON. I am not
trying to use JSON as a data structure. Does this make sense?

Best,
Xiao

On Mon, Oct 20, 2014 at 11:29 AM, Andy Bierman <andy@yumaworks.com> wrote:

>
>
> On Mon, Oct 20, 2014 at 6:23 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:
>
>> Xiao SHI <xiao.shi@yale.edu> writes:
>>
>> > Hi folks,
>> >
>> >
>> > As a few of us were working on modeling the ALTO protocol using YANG, =
we
>> > were pondering on a more general question: can YANG model all JSON bas=
ed
>> > protocols? What is the condition for a JSON based protocol (at least t=
he
>> > message format) to have an syntactically equivalent, hence
>> interoperable,
>> > YANG model with JSON encoding? Alternatively, in order to interoperate=
,
>> > semantic equivalence might be sufficient, is there any condition for
>> > semantic equivalence?
>> >
>> >
>> > tl;dr: A JSON based protocol carried by HTTP can have syntactically
>> > equivalent YANG model, if and only if all the keys in the key-value
>> pairs
>> > in the JSON message are pre-defined keywords in the protocol.
>> >
>>
>> Generating a YANG data model from existing instance data seems backwards
>> to me, although Examplotron (http://examplotron.org) does something quit=
e
>> similar. In any case, it might be quite challenging because YANG isn't
>> intended as a general schema language. Your observation above is true
>> but it is just one aspect of the problem. For instance
>>
>> "foo": [ { "bar": 1 }, 2 ]
>>
>> or
>>
>> "foo": null
>>
>> cannot be modelled in YANG using the encoding of
>> draft-ietf-netmod-yang-json.
>>
>>
>
> I think perhaps RESTCONF is overloading JSON and this has led to some
> confusion.
> RESTCONF uses JSON strictly as an encoding format, not a data structure.
> JSON is just
> the message encoding. The corresponding instance document must conform to
> the YANG definitions (not just be valid JSON).
>
> A protocol should pick between YANG data structures and JSON data
> structures,
> and not try to do both.
>
>
>
>
>> Lada
>>
>>
> Andy
>
>
>> >
>> > We've come up with a few ideas, and a few things below are work in
>> > progress, but we would love your feedback!
>> >
>> >
>> > Thank you!
>> >
>> > Xiao
>> >
>> >
>> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> >
>> > 1. Introduction.
>> >
>> > JavaScript Object Notation (JSON) has been a popular choice as the
>> message
>> > encoding for many network protocols such as the Application Layer
>> Traffic
>> > Optimization (ALTO) protocol, the Content Delivery Networks
>> Interconnection
>> > (CDNi) protocol, etc.
>> >
>> > Meanwhile, there are broad interests in the networking community to us=
e
>> > YANG to define data model so that one can use YANG related tools such =
as
>> > OpenDayLight controller. Although YANG itself is XML based, there have
>> been
>> > efforts to model JSON content using YANG
>> [draft-ietf-netmod-yang-json-01].
>> >
>> > A natural question rises: can YANG model all JSON based protocols? Wha=
t
>> is
>> > the condition for a JSON based protocol (at least the message format) =
to
>> > have an syntactically equivalent, hence interoperable, YANG model with
>> JSON
>> > encoding? Alternatively, in order to interoperate, semantic equivalenc=
e
>> > might be sufficient, is there any condition for semantic equivalence?
>> >
>> > 2. Claim
>> >
>> > A JSON based protocol carried by HTTP can have syntactically equivalen=
t
>> > YANG model, if and only if:
>> >
>> > (1) the message encoding condition is met;
>> >
>> > (2) the uri condition is met.
>> >
>> > 2.1. The message encoding condition
>> >
>> > The JSON message encoding MUST not contain a variable as a key in a JS=
ON
>> > object key-value pair. In other words, the keys in the JSON message
>> must be
>> > an already defined constant (or keyword) in the message format of the
>> > protocol.
>> >
>> > For example, if I have a protocol where =E2=80=9Cnetwork-map=E2=80=9D,=
 =E2=80=9Csrc=E2=80=9D, and =E2=80=9Cdsts=E2=80=9D
>> > are defined keywords, JSON text A meets the condition whereas B does n=
ot
>> > because =E2=80=9CPID1=E2=80=9D and =E2=80=9CPID2=E2=80=9D are not prot=
ocol keywords (they are resource
>> IDs).
>> >
>> > A:
>> >
>> > {
>> >
>> >  =E2=80=9Cnetwork-map=E2=80=9D: [
>> >
>> >    {
>> >
>> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,
>> >
>> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=
=80=9D]
>> >
>> >    },
>> >
>> >    {
>> >
>> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,
>> >
>> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=E2=
=80=9D]
>> >
>> >    }
>> >
>> >  ]
>> >
>> > }
>> >
>> > B:
>> >
>> >
>> > {
>> >
>> >  =E2=80=9Cnetwork-map=E2=80=9D: [
>> >
>> >    =E2=80=9CPID1: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=9D],
>> >
>> >    =E2=80=9CPID2=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=E2=
=80=9D]
>> >
>> >  ]
>> >
>> > }
>> >
>> >>From this we know that since ALTO protocol uses encoding B, there
>> cannot be
>> > a syntactically equivalent YANG model.
>> >
>> > 2.2 The URI condition
>> >
>> > Some of the YANG-related protocols might have URI constraints, e.g.
>> > RESTCONF. For now, we assume either that the JSON-based protocol URI
>> could
>> > be conformed to RESTCONF compliant uri, or that the server could have =
a
>> > routing mapping between the protocol compliant uri and the RESTCONF
>> > compliant uri, hence this condition would not be an issue, which allow=
s
>> us
>> > to focus on the message encoding condition.
>> >
>> > 3. Proof
>> >
>> > 3.1. The message encoding condition is necessary.
>> >
>> > We first note that this condition is a necessary condition for a JSON
>> based
>> > protocol to have a syntactically equivalent YANG model by proving its
>> > contrapositive.
>> >
>> > If one of the keys in the key-value pair in the JSON document is not
>> > pre-defined, the corresponding XML tags will not be pre-defined
>> keywords.
>> > Therefore, it would not possible to model it in YANG without using
>> > YANG=E2=80=99s anyxml
>> > statement (which allows arbitrary XML content).
>> >
>> > However, using the anyxml statement would defeat our purpose of modeli=
ng
>> > the data as it allows arbitrary XML content, and will not be helpful i=
n
>> the
>> > subsequent parsing process.
>> >
>> > 3.2. The message encoding condition is sufficient.
>> >
>> > We prove this by providing a translation procedure from a JSON message
>> that
>> > is compliant with the protocol we are trying to model, to a custom jav=
a
>> > class that can be used for Jackson data binding, then to a YANG model.
>> >
>> > We note that the middle step of translating to and from the custom
>> parser
>> > class is not necessary, but it will be useful.
>> >
>> > 3.2.1. motivation
>> >
>> > JSON data binding is the process of binding data structures (objects,
>> > arrays, etc.) in JSON to the appropriate data structures in the server
>> > (e.g. java classes, database tables, etc.) in parsing the JSON text. I=
n
>> > order to process JSON messages in a meaningful manner, data binding is
>> > necessary. Even if the binding is not explicit, the server would need
>> to do
>> > it eventually. For example, one can read JSON content in a stream
>> without
>> > binding it to the java classes, but eventually in order to make sense =
of
>> > the data, the server would eventually have to organize it, which is
>> roughly
>> > analogous to data binding upfront. Popular choices for JSON parsing an=
d
>> > data binding include jackson and gson.
>> >
>> > We use Jackson full data binding as our approach. Full data binding
>> binds
>> > JSON content into plain old java objects (POJOs), i.e. this custom
>> parser
>> > class can neither extend nor implement any other class. Jackson uses
>> > ObjectMapper with the custom parser class to parse JSON content into
>> this
>> > class.
>> >
>> > 3.2.2. The message encoding condition
>> >
>> > The message encoding condition is that all keys in each key-value pair
>> in
>> > the JSON text must be pre-defined keywords. As the keys will become
>> either
>> > class names and instance variable names, or be keys in the java maps,
>> it is
>> > easy to see that the condition is equivalent to =E2=80=9Cthere exists =
a full
>> data
>> > binding in Jackson custom parser class without using any map structure=
s
>> > (Map<String, ?>).=E2=80=9D
>> >
>> > 3.2.3. Proof
>> >
>> > We provide a recursive binding process from a JSON object to the Jacks=
on
>> > custom parser class to be used by Jackson ObjectMapper.
>> >
>> > Type determine_type(value) {
>> >
>> >  if (value is of a primitive type, i.e. string, number, boolean, null)=
 {
>> >
>> >    return the corresponding java primitive type;
>> >
>> >  }
>> >
>> >  if (value is a JSON object) {
>> >
>> >    return build_parser_class(value).class;
>> >
>> >  }
>> >
>> >  if (value is an array) {
>> >
>> >    return ArrayList<T> where T=3Ddetermine_type(value[0]);
>> >
>> >  }
>> >
>> >  // should not reach here.
>> >
>> > }
>> >
>> > Class build_parser_class(JSONObject obj) {
>> >
>> >  create custom class C;
>> >
>> >  for each key/value pair in the obj {
>> >
>> >    add instance variable v in C;
>> >
>> >    the name of variable v <- key; // (__known__ a/c to our assumption)
>> >
>> >    the type of variable v <- determine_type(value);
>> >
>> >  }
>> >
>> >  return C.class;
>> >
>> > }
>> >
>> > Naming:
>> >
>> > --change everything into CamelCase (i.e. remove dashes, etc.)
>> >
>> > --for instance variables, use =E2=80=9Cmy=E2=80=9D prefix, (e.g. myVar=
iable,
>> myNetworkMap,
>> > etc.)
>> >
>> > --for the custom class name, if the object is an element of the array,
>> use
>> > =E2=80=9CElement=E2=80=9D suffix.
>> >
>> > This is just one convention so that the next step proceeds smoothly. A=
s
>> > long as this naming translation is consistent with the naming stage in
>> the
>> > next step, it will work just fine.
>> >
>> > Example (a modified ALTO protocol network map example):
>> >
>> > JSON object:
>> >
>> > {
>> >
>> >  =E2=80=9Cmeta=E2=80=9D: {
>> >
>> >    =E2=80=9Cresource-id=E2=80=9D: =E2=80=9Cmy-default-map=E2=80=9D,
>> >
>> >    =E2=80=9Ctag=E2=80=9D: =E2=80=9Caab875ef69c87d012=E2=80=9D
>> >
>> >  },
>> >
>> >  =E2=80=9Cnetwork-map=E2=80=9D: [
>> >
>> >    {
>> >
>> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,
>> >
>> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =E2=80=9CPID2=E2=
=80=9D, =E2=80=9CPID3=E2=80=9D]
>> >
>> >    },
>> >
>> >    {
>> >
>> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,
>> >
>> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =E2=80=9CPID3=E2=
=80=9D]
>> >
>> >    },
>> >
>> >    {
>> >
>> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID3=E2=80=9D,
>> >
>> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=
=80=9D]
>> >
>> >    }
>> >
>> >  ]
>> >
>> > }
>> >
>> > Result of build_parser_class(obj):
>> >
>> > Class JSONObject {
>> >
>> >  Meta myMeta;
>> >
>> >  ArrayList<NetworkMapElement> myNetworkMap;
>> >
>> > }
>> >
>> > Class Meta {
>> >
>> >  String myResourceId;
>> >
>> >  String myTag;
>> >
>> > }
>> >
>> > Class NetworkMapElement {
>> >
>> >  String mySrc;
>> >
>> >  ArrayList<String> myDsts;
>> >
>> > }
>> >
>> > Now given the Jackson Parser Java Class, to get a syntactically
>> equivalent
>> > YANG model:
>> >
>> > YANGModel build_yang_model(Class C) {
>> >
>> >  for each instance variable (Type, Name) {
>> >
>> >    if (Type is primitive type: string, number, boolean, null) {
>> >
>> >      add the following to the YANG module:
>> >
>> >      =E2=80=9Cleaf Name { type <YANG equivalent of Type>; }=E2=80=9D
>> >
>> >    }
>> >
>> >    if (Type is an ArrayList<TypeElement>) {
>> >
>> >      if (TypeElement is primitive type) {
>> >
>> >        add the following to the YANG module:
>> >
>> >        =E2=80=9Cleaf-list Name { type <YANG equivalent of TypeElement>=
; }=E2=80=9D
>> >
>> >      } else {
>> >
>> >        // TypeElement is a custom parser class
>> >
>> >        add the following to the YANG module:
>> >
>> >        =E2=80=9Clist Name { <result from build_yang_model<TypeElement.=
class>> }=E2=80=9D
>> >
>> >      }
>> >
>> >    }
>> >
>> >    if (Type is a custom parser class) {
>> >
>> >      add the following to the YANG module:
>> >
>> >      =E2=80=9Ccontainer Name { <result from build_yang_model<Type.clas=
s>> }=E2=80=9D
>> >
>> >    }
>> >
>> >  }
>> >
>> > }
>> >
>> > Result from the previous example:
>> >
>> > container meta {
>> >
>> >  leaf resource-id {
>> >
>> >    type string;
>> >
>> >  }
>> >
>> >  leaf tag {
>> >
>> >    type string;
>> >
>> >  }
>> >
>> > }
>> >
>> > list network-map {
>> >
>> >  leaf src {
>> >
>> >    type string;
>> >
>> >  }
>> >
>> >  leaf-list dsts {
>> >
>> >    type string;
>> >
>> >  }
>> >
>> > }
>> >
>> > This does validate the JSON document with XML-JSON encoding. For your
>> > reference, this is the XML document which validates:
>> >
>> > <?xml version=3D"1.0" encoding=3D"UTF-8" ?>
>> >
>> > <meta>
>> >
>> >  <resource-id>my-default-map</resource-id>
>> >
>> >  <tag>aab875ef69c87d012</tag>
>> >
>> > </meta>
>> >
>> > <network-map>
>> >
>> >  <src>PID1</src>
>> >
>> >  <dsts>PID1</dsts>
>> >
>> >  <dsts>PID2</dsts>
>> >
>> >  <dsts>PID3</dsts>
>> >
>> > </network-map>
>> >
>> > <network-map>
>> >
>> >  <src>PID2</src>
>> >
>> >  <dsts>PID1</dsts>
>> >
>> >  <dsts>PID3</dsts>
>> >
>> > </network-map>
>> >
>> > <network-map>
>> >
>> >  <src>PID3</src>
>> >
>> >  <dsts>PID2</dsts>
>> >
>> >  <dsts>PID3</dsts>
>> >
>> > </network-map>
>> >
>> > This proves that the message encoding condition is a sufficient
>> condition
>> > for the JSON object to have a YANG model.
>> >
>> > Note the model generated is very crude and lose almost all constraints
>> and
>> > all inheritance features (if any), because it focuses on the syntax an=
d
>> is
>> > essentially converted from an JSON object compliant with a protocol
>> instead
>> > of from the protocol itself. Hence this result is more useful in
>> > determining which JSON based protocols cannot have a syntactically
>> > equivalent YANG model, than in generating a good YANG model.
>> >
>> > 3.3. Conclusion
>> >
>> > Our claim holds. A JSON based protocol carried by HTTP can have
>> > syntactically equivalent YANG model, if and only if all the keys in th=
e
>> > key-value pairs in the JSON message are pre-defined keywords.
>> >
>> > 4. Semantic equivalence
>> >
>> > For JSON based protocols that don=E2=80=99t satisfy the message encodi=
ng
>> condition,
>> > it is still possible to have a semantically equivalent YANG model. All
>> that
>> > is required for the protocol compliant clients and the YANG model
>> compliant
>> > server to interoperate is an adapter which does the following:
>> >
>> > 1) translate FROM YANG server compliant response msg TO alto compliant
>> > response msg
>> >
>> > 2) translate FROM alto compliant request msg TO YANG server compliant
>> > request msg
>> >
>> > 4.1. Claim
>> >
>> > This adapter needs to be protocol-aware.
>> >
>> > Ideally, given any YANG model, we would like to be able to automatical=
ly
>> > (or at least mechanically) generate this message adapter, which means
>> not
>> > looking at the protocol or its compliant msgs. However, without knowin=
g
>> the
>> > specific protocol that we are working with (i.e. human intervention,
>> i.e.
>> > looking at the protocol compliant msgs), such an adapter cannot be
>> > auto-generated.
>> >
>> > 4.2. Proof by Indistinguishability
>> >
>> > Suppose both the YANG server compliant msg m_y and the actually protoc=
ol
>> > compliant msg m_p are in JSON (or have been encoded into JSON). Lookin=
g
>> at
>> > the differences between the two messages, call these differences {d1,
>> d2,
>> > ..., dn}. The goal for the auto-generated adapter would be to identify
>> and
>> > eliminate these differences. Construct a new JSON msg m' where all but
>> one
>> > difference di is the same as m_p and di is the same as the m_y. Withou=
t
>> > looking at the protocol (or m_p), the auto-generated adapter would not
>> be
>> > able to distinguish between m' and m_p in its translation process, whi=
ch
>> > means, it won't be able to tell whether it should change di or not.
>> Hence,
>> > such an adapter must be protocol-aware.
>> >
>> > A good example is the dependent-vtag in the ALTO protocol:
>> >
>> > "dependent-vtag" : [
>> >
>> >  {
>> >
>> >    "resource-id" : "my-network-map",
>> >
>> >    "tag" : "abcd1234"
>> >
>> >  }
>> >
>> > ]
>> >
>> > It was specified this way in the alto protocol. However, it could
>> > conceivably be the case that it was originally the following map
>> structure,
>> > and was converted into the above encoding because of the map->list+key
>> > issue. (This case is actually one of the few differences in the m_y an=
d
>> m_p
>> > where the adapter does not need to convert it back to a map structure.=
)
>> >
>> > "dependent-vtag" : {
>> >
>> >  "my-network-map" : {
>> >
>> >    "tag" : "abcd1234"
>> >
>> >  }
>> >
>> > }
>> >
>> > Without knowing the protocol, there is no way to tell.
>> >
>> > 5. Ramifications
>> >
>> > We now understand the basic condition for a JSON based protocol to hav=
e
>> a
>> > YANG Model. For the protocols that don=E2=80=99t meet this condition, =
there can
>> be
>> > a semantic equivalent YANG model, but there won=E2=80=99t be a generic=
 process
>> of
>> > generating the adapter for all such protocols.
>> > _______________________________________________
>> > netmod mailing list
>> > netmod@ietf.org
>> > https://www.ietf.org/mailman/listinfo/netmod
>>
>> --
>> Ladislav Lhotka, CZ.NIC Labs
>> PGP Key ID: E74E8C0C
>>
>> _______________________________________________
>> netmod mailing list
>> netmod@ietf.org
>> https://www.ietf.org/mailman/listinfo/netmod
>>
>
>

--089e013d08908eaeef0505dc7288
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Andy,<div><br></div><div>I agree with you. Just to clar=
ify, what I am trying to do is to use YANG data structures for the protocol=
 whose message encoding is JSON. I am not trying to use JSON as a data stru=
cture. Does this make sense?</div><div><br></div><div>Best,</div><div>Xiao<=
/div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Mon=
, Oct 20, 2014 at 11:29 AM, Andy Bierman <span dir=3D"ltr">&lt;<a href=3D"m=
ailto:andy@yumaworks.com" target=3D"_blank">andy@yumaworks.com</a>&gt;</spa=
n> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><div class=
=3D"gmail_extra"><br><div class=3D"gmail_quote"><span class=3D"">On Mon, Oc=
t 20, 2014 at 6:23 AM, Ladislav Lhotka <span dir=3D"ltr">&lt;<a href=3D"mai=
lto:lhotka@nic.cz" target=3D"_blank">lhotka@nic.cz</a>&gt;</span> wrote:<br=
></span><span class=3D""><blockquote class=3D"gmail_quote" style=3D"margin:=
0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Xiao SHI &lt;<a hre=
f=3D"mailto:xiao.shi@yale.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt; =
writes:<br>
<br>
&gt; Hi folks,<br>
&gt;<br>
&gt;<br>
&gt; As a few of us were working on modeling the ALTO protocol using YANG, =
we<br>
&gt; were pondering on a more general question: can YANG model all JSON bas=
ed<br>
&gt; protocols? What is the condition for a JSON based protocol (at least t=
he<br>
&gt; message format) to have an syntactically equivalent, hence interoperab=
le,<br>
&gt; YANG model with JSON encoding? Alternatively, in order to interoperate=
,<br>
&gt; semantic equivalence might be sufficient, is there any condition for<b=
r>
&gt; semantic equivalence?<br>
&gt;<br>
&gt;<br>
&gt; tl;dr: A JSON based protocol carried by HTTP can have syntactically<br=
>
&gt; equivalent YANG model, if and only if all the keys in the key-value pa=
irs<br>
&gt; in the JSON message are pre-defined keywords in the protocol.<br>
&gt;<br>
<br>
Generating a YANG data model from existing instance data seems backwards<br=
>
to me, although Examplotron (<a href=3D"http://examplotron.org" target=3D"_=
blank">http://examplotron.org</a>) does something quite<br>
similar. In any case, it might be quite challenging because YANG isn&#39;t<=
br>
intended as a general schema language. Your observation above is true<br>
but it is just one aspect of the problem. For instance<br>
<br>
&quot;foo&quot;: [ { &quot;bar&quot;: 1 }, 2 ]<br>
<br>
or<br>
<br>
&quot;foo&quot;: null<br>
<br>
cannot be modelled in YANG using the encoding of<br>
draft-ietf-netmod-yang-json.<br>
<br></blockquote><div><br></div><div><br></div></span><div>I think perhaps =
RESTCONF is overloading JSON and this has led to some confusion.</div><div>=
RESTCONF uses JSON strictly as an encoding format, not a data structure.=C2=
=A0 JSON is just</div><div>the message encoding. The corresponding instance=
 document must conform to</div><div>the YANG definitions (not just be valid=
 JSON).</div><div><br></div><div>A protocol should pick between YANG data s=
tructures and JSON data structures,</div><div>and not try to do both.</div>=
<div><br></div><div><br></div><div>=C2=A0<br></div><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex">
Lada<br>
<br></blockquote><span class=3D"HOEnZb"><font color=3D"#888888"><div><br></=
div><div>Andy</div></font></span><div><div class=3D"h5"><div>=C2=A0</div><b=
lockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px =
#ccc solid;padding-left:1ex">
&gt;<br>
&gt; We&#39;ve come up with a few ideas, and a few things below are work in=
<br>
&gt; progress, but we would love your feedback!<br>
&gt;<br>
&gt;<br>
&gt; Thank you!<br>
&gt;<br>
&gt; Xiao<br>
&gt;<br>
&gt;<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
&gt;<br>
&gt; 1. Introduction.<br>
&gt;<br>
&gt; JavaScript Object Notation (JSON) has been a popular choice as the mes=
sage<br>
&gt; encoding for many network protocols such as the Application Layer Traf=
fic<br>
&gt; Optimization (ALTO) protocol, the Content Delivery Networks Interconne=
ction<br>
&gt; (CDNi) protocol, etc.<br>
&gt;<br>
&gt; Meanwhile, there are broad interests in the networking community to us=
e<br>
&gt; YANG to define data model so that one can use YANG related tools such =
as<br>
&gt; OpenDayLight controller. Although YANG itself is XML based, there have=
 been<br>
&gt; efforts to model JSON content using YANG [draft-ietf-netmod-yang-json-=
01].<br>
&gt;<br>
&gt; A natural question rises: can YANG model all JSON based protocols? Wha=
t is<br>
&gt; the condition for a JSON based protocol (at least the message format) =
to<br>
&gt; have an syntactically equivalent, hence interoperable, YANG model with=
 JSON<br>
&gt; encoding? Alternatively, in order to interoperate, semantic equivalenc=
e<br>
&gt; might be sufficient, is there any condition for semantic equivalence?<=
br>
&gt;<br>
&gt; 2. Claim<br>
&gt;<br>
&gt; A JSON based protocol carried by HTTP can have syntactically equivalen=
t<br>
&gt; YANG model, if and only if:<br>
&gt;<br>
&gt; (1) the message encoding condition is met;<br>
&gt;<br>
&gt; (2) the uri condition is met.<br>
&gt;<br>
&gt; 2.1. The message encoding condition<br>
&gt;<br>
&gt; The JSON message encoding MUST not contain a variable as a key in a JS=
ON<br>
&gt; object key-value pair. In other words, the keys in the JSON message mu=
st be<br>
&gt; an already defined constant (or keyword) in the message format of the<=
br>
&gt; protocol.<br>
&gt;<br>
&gt; For example, if I have a protocol where =E2=80=9Cnetwork-map=E2=80=9D,=
 =E2=80=9Csrc=E2=80=9D, and =E2=80=9Cdsts=E2=80=9D<br>
&gt; are defined keywords, JSON text A meets the condition whereas B does n=
ot<br>
&gt; because =E2=80=9CPID1=E2=80=9D and =E2=80=9CPID2=E2=80=9D are not prot=
ocol keywords (they are resource IDs).<br>
&gt;<br>
&gt; A:<br>
&gt;<br>
&gt; {<br>
&gt;<br>
&gt;=C2=A0 =E2=80=9Cnetwork-map=E2=80=9D: [<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =
=E2=80=9CPID3=E2=80=9D]<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 },<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =
=E2=80=9CPID4=E2=80=9D]<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 ]<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; B:<br>
&gt;<br>
&gt;<br>
&gt; {<br>
&gt;<br>
&gt;=C2=A0 =E2=80=9Cnetwork-map=E2=80=9D: [<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =E2=80=9CPID1: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=
=80=9D],<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =E2=80=9CPID2=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=
=9CPID4=E2=80=9D]<br>
&gt;<br>
&gt;=C2=A0 ]<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt;&gt;From this we know that since ALTO protocol uses encoding B, there c=
annot be<br>
&gt; a syntactically equivalent YANG model.<br>
&gt;<br>
&gt; 2.2 The URI condition<br>
&gt;<br>
&gt; Some of the YANG-related protocols might have URI constraints, e.g.<br=
>
&gt; RESTCONF. For now, we assume either that the JSON-based protocol URI c=
ould<br>
&gt; be conformed to RESTCONF compliant uri, or that the server could have =
a<br>
&gt; routing mapping between the protocol compliant uri and the RESTCONF<br=
>
&gt; compliant uri, hence this condition would not be an issue, which allow=
s us<br>
&gt; to focus on the message encoding condition.<br>
&gt;<br>
&gt; 3. Proof<br>
&gt;<br>
&gt; 3.1. The message encoding condition is necessary.<br>
&gt;<br>
&gt; We first note that this condition is a necessary condition for a JSON =
based<br>
&gt; protocol to have a syntactically equivalent YANG model by proving its<=
br>
&gt; contrapositive.<br>
&gt;<br>
&gt; If one of the keys in the key-value pair in the JSON document is not<b=
r>
&gt; pre-defined, the corresponding XML tags will not be pre-defined keywor=
ds.<br>
&gt; Therefore, it would not possible to model it in YANG without using<br>
&gt; YANG=E2=80=99s anyxml<br>
&gt; statement (which allows arbitrary XML content).<br>
&gt;<br>
&gt; However, using the anyxml statement would defeat our purpose of modeli=
ng<br>
&gt; the data as it allows arbitrary XML content, and will not be helpful i=
n the<br>
&gt; subsequent parsing process.<br>
&gt;<br>
&gt; 3.2. The message encoding condition is sufficient.<br>
&gt;<br>
&gt; We prove this by providing a translation procedure from a JSON message=
 that<br>
&gt; is compliant with the protocol we are trying to model, to a custom jav=
a<br>
&gt; class that can be used for Jackson data binding, then to a YANG model.=
<br>
&gt;<br>
&gt; We note that the middle step of translating to and from the custom par=
ser<br>
&gt; class is not necessary, but it will be useful.<br>
&gt;<br>
&gt; 3.2.1. motivation<br>
&gt;<br>
&gt; JSON data binding is the process of binding data structures (objects,<=
br>
&gt; arrays, etc.) in JSON to the appropriate data structures in the server=
<br>
&gt; (e.g. java classes, database tables, etc.) in parsing the JSON text. I=
n<br>
&gt; order to process JSON messages in a meaningful manner, data binding is=
<br>
&gt; necessary. Even if the binding is not explicit, the server would need =
to do<br>
&gt; it eventually. For example, one can read JSON content in a stream with=
out<br>
&gt; binding it to the java classes, but eventually in order to make sense =
of<br>
&gt; the data, the server would eventually have to organize it, which is ro=
ughly<br>
&gt; analogous to data binding upfront. Popular choices for JSON parsing an=
d<br>
&gt; data binding include jackson and gson.<br>
&gt;<br>
&gt; We use Jackson full data binding as our approach. Full data binding bi=
nds<br>
&gt; JSON content into plain old java objects (POJOs), i.e. this custom par=
ser<br>
&gt; class can neither extend nor implement any other class. Jackson uses<b=
r>
&gt; ObjectMapper with the custom parser class to parse JSON content into t=
his<br>
&gt; class.<br>
&gt;<br>
&gt; 3.2.2. The message encoding condition<br>
&gt;<br>
&gt; The message encoding condition is that all keys in each key-value pair=
 in<br>
&gt; the JSON text must be pre-defined keywords. As the keys will become ei=
ther<br>
&gt; class names and instance variable names, or be keys in the java maps, =
it is<br>
&gt; easy to see that the condition is equivalent to =E2=80=9Cthere exists =
a full data<br>
&gt; binding in Jackson custom parser class without using any map structure=
s<br>
&gt; (Map&lt;String, ?&gt;).=E2=80=9D<br>
&gt;<br>
&gt; 3.2.3. Proof<br>
&gt;<br>
&gt; We provide a recursive binding process from a JSON object to the Jacks=
on<br>
&gt; custom parser class to be used by Jackson ObjectMapper.<br>
&gt;<br>
&gt; Type determine_type(value) {<br>
&gt;<br>
&gt;=C2=A0 if (value is of a primitive type, i.e. string, number, boolean, =
null) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 return the corresponding java primitive type;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 if (value is a JSON object) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 return build_parser_class(value).class;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 if (value is an array) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 return ArrayList&lt;T&gt; where T=3Ddetermine_type(value[=
0]);<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 // should not reach here.<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Class build_parser_class(JSONObject obj) {<br>
&gt;<br>
&gt;=C2=A0 create custom class C;<br>
&gt;<br>
&gt;=C2=A0 for each key/value pair in the obj {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 add instance variable v in C;<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 the name of variable v &lt;- key; // (__known__ a/c to ou=
r assumption)<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 the type of variable v &lt;- determine_type(value);<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 return C.class;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Naming:<br>
&gt;<br>
&gt; --change everything into CamelCase (i.e. remove dashes, etc.)<br>
&gt;<br>
&gt; --for instance variables, use =E2=80=9Cmy=E2=80=9D prefix, (e.g. myVar=
iable, myNetworkMap,<br>
&gt; etc.)<br>
&gt;<br>
&gt; --for the custom class name, if the object is an element of the array,=
 use<br>
&gt; =E2=80=9CElement=E2=80=9D suffix.<br>
&gt;<br>
&gt; This is just one convention so that the next step proceeds smoothly. A=
s<br>
&gt; long as this naming translation is consistent with the naming stage in=
 the<br>
&gt; next step, it will work just fine.<br>
&gt;<br>
&gt; Example (a modified ALTO protocol network map example):<br>
&gt;<br>
&gt; JSON object:<br>
&gt;<br>
&gt; {<br>
&gt;<br>
&gt;=C2=A0 =E2=80=9Cmeta=E2=80=9D: {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =E2=80=9Cresource-id=E2=80=9D: =E2=80=9Cmy-default-map=E2=
=80=9D,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =E2=80=9Ctag=E2=80=9D: =E2=80=9Caab875ef69c87d012=E2=80=
=9D<br>
&gt;<br>
&gt;=C2=A0 },<br>
&gt;<br>
&gt;=C2=A0 =E2=80=9Cnetwork-map=E2=80=9D: [<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =
=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=9D]<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 },<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =
=E2=80=9CPID3=E2=80=9D]<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 },<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID3=E2=80=9D,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =
=E2=80=9CPID3=E2=80=9D]<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 ]<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Result of build_parser_class(obj):<br>
&gt;<br>
&gt; Class JSONObject {<br>
&gt;<br>
&gt;=C2=A0 Meta myMeta;<br>
&gt;<br>
&gt;=C2=A0 ArrayList&lt;NetworkMapElement&gt; myNetworkMap;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Class Meta {<br>
&gt;<br>
&gt;=C2=A0 String myResourceId;<br>
&gt;<br>
&gt;=C2=A0 String myTag;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Class NetworkMapElement {<br>
&gt;<br>
&gt;=C2=A0 String mySrc;<br>
&gt;<br>
&gt;=C2=A0 ArrayList&lt;String&gt; myDsts;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Now given the Jackson Parser Java Class, to get a syntactically equiva=
lent<br>
&gt; YANG model:<br>
&gt;<br>
&gt; YANGModel build_yang_model(Class C) {<br>
&gt;<br>
&gt;=C2=A0 for each instance variable (Type, Name) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 if (Type is primitive type: string, number, boolean, null=
) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 add the following to the YANG module:<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cleaf Name { type &lt;YANG equivalent of T=
ype&gt;; }=E2=80=9D<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 if (Type is an ArrayList&lt;TypeElement&gt;) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 if (TypeElement is primitive type) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 add the following to the YANG module:<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =E2=80=9Cleaf-list Name { type &lt;YANG equ=
ivalent of TypeElement&gt;; }=E2=80=9D<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 } else {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 // TypeElement is a custom parser class<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 add the following to the YANG module:<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =E2=80=9Clist Name { &lt;result from build_=
yang_model&lt;TypeElement.class&gt;&gt; }=E2=80=9D<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 if (Type is a custom parser class) {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 add the following to the YANG module:<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Ccontainer Name { &lt;result from build_ya=
ng_model&lt;Type.class&gt;&gt; }=E2=80=9D<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Result from the previous example:<br>
&gt;<br>
&gt; container meta {<br>
&gt;<br>
&gt;=C2=A0 leaf resource-id {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 type string;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 leaf tag {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 type string;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; list network-map {<br>
&gt;<br>
&gt;=C2=A0 leaf src {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 type string;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt;=C2=A0 leaf-list dsts {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 type string;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; This does validate the JSON document with XML-JSON encoding. For your<=
br>
&gt; reference, this is the XML document which validates:<br>
&gt;<br>
&gt; &lt;?xml version=3D&quot;1.0&quot; encoding=3D&quot;UTF-8&quot; ?&gt;<=
br>
&gt;<br>
&gt; &lt;meta&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;resource-id&gt;my-default-map&lt;/resource-id&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;tag&gt;aab875ef69c87d012&lt;/tag&gt;<br>
&gt;<br>
&gt; &lt;/meta&gt;<br>
&gt;<br>
&gt; &lt;network-map&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;src&gt;PID1&lt;/src&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;dsts&gt;PID1&lt;/dsts&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;dsts&gt;PID2&lt;/dsts&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;<br>
&gt; &lt;/network-map&gt;<br>
&gt;<br>
&gt; &lt;network-map&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;src&gt;PID2&lt;/src&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;dsts&gt;PID1&lt;/dsts&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;<br>
&gt; &lt;/network-map&gt;<br>
&gt;<br>
&gt; &lt;network-map&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;src&gt;PID3&lt;/src&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;dsts&gt;PID2&lt;/dsts&gt;<br>
&gt;<br>
&gt;=C2=A0 &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;<br>
&gt; &lt;/network-map&gt;<br>
&gt;<br>
&gt; This proves that the message encoding condition is a sufficient condit=
ion<br>
&gt; for the JSON object to have a YANG model.<br>
&gt;<br>
&gt; Note the model generated is very crude and lose almost all constraints=
 and<br>
&gt; all inheritance features (if any), because it focuses on the syntax an=
d is<br>
&gt; essentially converted from an JSON object compliant with a protocol in=
stead<br>
&gt; of from the protocol itself. Hence this result is more useful in<br>
&gt; determining which JSON based protocols cannot have a syntactically<br>
&gt; equivalent YANG model, than in generating a good YANG model.<br>
&gt;<br>
&gt; 3.3. Conclusion<br>
&gt;<br>
&gt; Our claim holds. A JSON based protocol carried by HTTP can have<br>
&gt; syntactically equivalent YANG model, if and only if all the keys in th=
e<br>
&gt; key-value pairs in the JSON message are pre-defined keywords.<br>
&gt;<br>
&gt; 4. Semantic equivalence<br>
&gt;<br>
&gt; For JSON based protocols that don=E2=80=99t satisfy the message encodi=
ng condition,<br>
&gt; it is still possible to have a semantically equivalent YANG model. All=
 that<br>
&gt; is required for the protocol compliant clients and the YANG model comp=
liant<br>
&gt; server to interoperate is an adapter which does the following:<br>
&gt;<br>
&gt; 1) translate FROM YANG server compliant response msg TO alto compliant=
<br>
&gt; response msg<br>
&gt;<br>
&gt; 2) translate FROM alto compliant request msg TO YANG server compliant<=
br>
&gt; request msg<br>
&gt;<br>
&gt; 4.1. Claim<br>
&gt;<br>
&gt; This adapter needs to be protocol-aware.<br>
&gt;<br>
&gt; Ideally, given any YANG model, we would like to be able to automatical=
ly<br>
&gt; (or at least mechanically) generate this message adapter, which means =
not<br>
&gt; looking at the protocol or its compliant msgs. However, without knowin=
g the<br>
&gt; specific protocol that we are working with (i.e. human intervention, i=
.e.<br>
&gt; looking at the protocol compliant msgs), such an adapter cannot be<br>
&gt; auto-generated.<br>
&gt;<br>
&gt; 4.2. Proof by Indistinguishability<br>
&gt;<br>
&gt; Suppose both the YANG server compliant msg m_y and the actually protoc=
ol<br>
&gt; compliant msg m_p are in JSON (or have been encoded into JSON). Lookin=
g at<br>
&gt; the differences between the two messages, call these differences {d1, =
d2,<br>
&gt; ..., dn}. The goal for the auto-generated adapter would be to identify=
 and<br>
&gt; eliminate these differences. Construct a new JSON msg m&#39; where all=
 but one<br>
&gt; difference di is the same as m_p and di is the same as the m_y. Withou=
t<br>
&gt; looking at the protocol (or m_p), the auto-generated adapter would not=
 be<br>
&gt; able to distinguish between m&#39; and m_p in its translation process,=
 which<br>
&gt; means, it won&#39;t be able to tell whether it should change di or not=
. Hence,<br>
&gt; such an adapter must be protocol-aware.<br>
&gt;<br>
&gt; A good example is the dependent-vtag in the ALTO protocol:<br>
&gt;<br>
&gt; &quot;dependent-vtag&quot; : [<br>
&gt;<br>
&gt;=C2=A0 {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 &quot;resource-id&quot; : &quot;my-network-map&quot;,<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 &quot;tag&quot; : &quot;abcd1234&quot;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt; ]<br>
&gt;<br>
&gt; It was specified this way in the alto protocol. However, it could<br>
&gt; conceivably be the case that it was originally the following map struc=
ture,<br>
&gt; and was converted into the above encoding because of the map-&gt;list+=
key<br>
&gt; issue. (This case is actually one of the few differences in the m_y an=
d m_p<br>
&gt; where the adapter does not need to convert it back to a map structure.=
)<br>
&gt;<br>
&gt; &quot;dependent-vtag&quot; : {<br>
&gt;<br>
&gt;=C2=A0 &quot;my-network-map&quot; : {<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 &quot;tag&quot; : &quot;abcd1234&quot;<br>
&gt;<br>
&gt;=C2=A0 }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Without knowing the protocol, there is no way to tell.<br>
&gt;<br>
&gt; 5. Ramifications<br>
&gt;<br>
&gt; We now understand the basic condition for a JSON based protocol to hav=
e a<br>
&gt; YANG Model. For the protocols that don=E2=80=99t meet this condition, =
there can be<br>
&gt; a semantic equivalent YANG model, but there won=E2=80=99t be a generic=
 process of<br>
&gt; generating the adapter for all such protocols.<br>
&gt; _______________________________________________<br>
&gt; netmod mailing list<br>
&gt; <a href=3D"mailto:netmod@ietf.org" target=3D"_blank">netmod@ietf.org</=
a><br>
&gt; <a href=3D"https://www.ietf.org/mailman/listinfo/netmod" target=3D"_bl=
ank">https://www.ietf.org/mailman/listinfo/netmod</a><br>
<span><font color=3D"#888888"><br>
--<br>
Ladislav Lhotka, CZ.NIC Labs<br>
PGP Key ID: E74E8C0C<br>
<br>
_______________________________________________<br>
netmod mailing list<br>
<a href=3D"mailto:netmod@ietf.org" target=3D"_blank">netmod@ietf.org</a><br=
>
<a href=3D"https://www.ietf.org/mailman/listinfo/netmod" target=3D"_blank">=
https://www.ietf.org/mailman/listinfo/netmod</a><br>
</font></span></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>

--089e013d08908eaeef0505dc7288--


From nobody Mon Oct 20 10:12:51 2014
Return-Path: <w.roome@alcatel-lucent.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 36B6E1A86E6 for <alto@ietfa.amsl.com>; Mon, 20 Oct 2014 10:12:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.602
X-Spam-Level: 
X-Spam-Status: No, score=-0.602 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, TRACKER_ID=1.306, T_RP_MATCHES_RCVD=-0.01] 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 nXobznp6lI2u for <alto@ietfa.amsl.com>; Mon, 20 Oct 2014 10:12:29 -0700 (PDT)
Received: from smtp-us.alcatel-lucent.com (us-hpswa-esg-01.alcatel-lucent.com [135.245.18.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 357C11A88FD for <alto@ietf.org>; Mon, 20 Oct 2014 10:01:40 -0700 (PDT)
Received: from us70tusmtp1.zam.alcatel-lucent.com (unknown [135.5.2.63]) by Websense Email Security Gateway with ESMTPS id 97273D1ECD20F; Mon, 20 Oct 2014 17:01:35 +0000 (GMT)
Received: from usnavsmail1.ndc.alcatel-lucent.com (usnavsmail1.ndc.alcatel-lucent.com [135.3.39.9]) by us70tusmtp1.zam.alcatel-lucent.com (GMO) with ESMTP id s9KH1b3I014864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 20 Oct 2014 13:01:38 -0400
Received: from umail.lucent.com (umail.ndc.lucent.com [135.3.40.61]) by usnavsmail1.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id s9KH1bPm022473 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 20 Oct 2014 12:01:37 -0500
Received: from [135.222.152.71] (wdr-i7mbp2.mh.lucent.com [135.222.152.71]) by umail.lucent.com (8.13.8/TPES) with ESMTP id s9KH1WCj013792; Mon, 20 Oct 2014 12:01:34 -0500 (CDT)
User-Agent: Microsoft-MacOutlook/14.4.5.141003
Date: Mon, 20 Oct 2014 13:01:38 -0400
From: Wendy Roome <w.roome@alcatel-lucent.com>
To: Xiao SHI <xiao.shi@yale.edu>
Message-ID: <D06AB09C.18BF5C%w.roome@alcatel-lucent.com>
Thread-Topic: [alto] Incremental updates transport using SSE?
References: <D0644784.180EE4%w.roome@alcatel-lucent.com> <CANUuoLoDnPx-V37==AXbMzuRPiYLXRz3CkMVpfSRfEMehg8S_g@mail.gmail.com> <D0653E13.181A19%w.roome@alcatel-lucent.com> <CAFwJzZn6hOzP-ef0Ji2vpnkTpU_wifZoKqxhpSo3pVzXB901LA@mail.gmail.com> <D06687CA.1854F3%w.roome@alcatel-lucent.com> <CAFwJzZm2GPCYbZDmtTyOBzuS6RFCxrSKZO4Vy9xR-usDtvWeFg@mail.gmail.com> <D066C5FC.188767%w.roome@alcatel-lucent.com> <CAFwJzZkMim8S6u_24oyns_x8_hnU1sXhajcj-CNQgToBHHjARw@mail.gmail.com> <D06A8B01.18A8A8%w.roome@alcatel-lucent.com> <CAFwJzZ=Cyb4t6ae6KEo9d-Q6muRtZj0vF15DDbK=7F6H8vJc0w@mail.gmail.com>
In-Reply-To: <CAFwJzZ=Cyb4t6ae6KEo9d-Q6muRtZj0vF15DDbK=7F6H8vJc0w@mail.gmail.com>
Mime-version: 1.0
Content-type: multipart/alternative; boundary="B_3496654902_26029428"
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/_bdRbbxAZ2sL44VujoZwNpEs9FA
Cc: IETF ALTO <alto@ietf.org>
Subject: Re: [alto] Incremental updates transport using SSE?
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Oct 2014 17:12:39 -0000

> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--B_3496654902_26029428
Content-type: text/plain;
	charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

Xiao,

#1: That case is certainly possible. So we should say that when a server
updates a network map, the server SHOULD send the update on all SSE streams
at the same time as that version becomes available via the network map
resource and the dependent cost map resources. If a client gets network map
and cost map updates via two different SSE streams, it is possible the
client will receive the cost map updates before the network map updates. Th=
e
client can detect this by the tag mismatch. If this happens, the client MUS=
T
buffer the cost map updates and apply them after receiving the network map
update. If the corresponding network map update does not arrive in a timely
fashion (whatever that means), the client MUST close both streams, discard
both maps, and reestablish both streams. That may not the most efficient wa=
y
to resynchronize, but it is the simplest and most reliable.

Of course, avoiding bizarre cases like that are why a server should normall=
y
use the same stream for network map and cost map updates. :-)

#2: To handle that issue, we should say that if several different update
stream resources offer the same update event type, then events of that type
must be identical on all streams (modulo transmission delays). A client may
use which ever stream it prefers. In particular, a client may pick the
stream that offers the desired combination of update events.

- Wendy Roome=20

From:  Xiao SHI <xiao.shi@yale.edu>
Date:  Mon, October 20, 2014 at 11:22
To:  Wendy Roome <w.roome@alcatel-lucent.com>
Cc:  Xiao SHI <xiao.shi@yale.edu>, "Y. Richard Yang" <yry@cs.yale.edu>, IET=
F
ALTO <alto@ietf.org>
Subject:  Re: [alto] Incremental updates transport using SSE?

Hi Wendy,

#1: Yes, that will solve the problem I was thinking of.

A follow up on this: what if say the client gets a cost map which depends o=
n
a version of the network map that the client has not received? Should the
client simply discard the cost map or its patch? or temporarily save the
cost map and wait? Or does this question enters the realm of client/server
implementation/optimization and is no longer the protocol's concern?

Anyhow, I agree that the resource-id should do.

#2: Sounds good. The reason I thought of this is that a network map could b=
e
in multiple update streams, should/could there be a preference of which
stream the user get the update of the network map from? Or the client could
simply find *any* update stream which contains the resource update it wants=
?

#3: That's exactly what I meant. Just double checking.

Thanks,
Xiao


On Mon, Oct 20, 2014 at 10:14 AM, Wendy Roome <w.roome@alcatel-lucent.com>
wrote:
> Xiao,
>=20
> #1: I don't think that is a good idea. The tag is mutable -- it changes e=
very
> update. I believe the event type should be immutable over updates. E.g., =
note
> that the IRD has resource ids, but not tags. I believe the scenario you
> described is easily avoidable: when the client gets a new network map eve=
nt,
> the client updates the cached network map, including updated the tag, and
> automatically discards any cached cost map(s) that depended on the old ta=
g.
> And in any case, before using a cost map, the client should always verify=
 that
> the network map tag in the cost map matches the tag of the map used to lo=
okup
> the address.
>=20
> Or did I not understand your scenario properly?
>=20
> #2: That seems to be an unnecessary optimization and complication. It's a
> complication because it adds an additional constraint (that uri must exis=
t,
> the resource must be an event stream, etc). It's unnecessary because let=B9=
s be
> realistic, an IRD will have at most 20 or 30 entries. Searching them for =
an
> update stream is not a challenge. Particularly if you remember a client d=
oes
> that once and then keeps the stream open for hours.
>=20
> Also, if you do think that is necessary, the map resource should give the
> *resource id* of the associated update resource, not the uri. Only a
> resource's IRD entry should give the uri. Think of that as equivalent to
> normalizing a relational DB.
>=20
> Or perhaps there could be a capability (or an attribute) that says this
> resource does have an update stream, so the client knows whether search t=
he
> IRD for it.
>=20
> #3: I assumed that for a filtered update stream, the client would use a P=
OST
> request to tell the server which events the client wanted, and the server
> would filter out (or just not send) the other events. Is that what you me=
ant?
>=20
> - Wendy Roome
>=20
> From:  Xiao SHI <xiao.shi@yale.edu>
> Date:  Fri, October 17, 2014 at 20:13
>=20
> To:  Wendy Roome <w.roome@alcatel-lucent.com>
> Cc:  Xiao SHI <xiao.shi@yale.edu>, "Y. Richard Yang" <yry@cs.yale.edu>, I=
ETF
> ALTO <alto@ietf.org>
> Subject:  Re: [alto] Incremental updates transport using SSE?
>=20
> Hi Wendy,
>=20
> I think this is a very good and efficient design. Just a few comments:
>=20
> 1. In the event field of the SSE, you included the resource-id but not th=
e tag
> along with it. I agree that the tag seems unnecessary because each event =
is
> essentially an update of the map, and should be assigned a new tag if the
> update were not incremental. However, consider the following scenario: if=
, for
> whatever reason, the client only subscribed to the network map incr updat=
es
> (or the server only provided the network map stream), and the client is
> requesting cost maps from the server via regular mechanism (i.e. always
> getting a full new map which contains the dependent-vtag), could there be
> issues when the version of the network map is not synchronized with the
> dependent vtag that the client is about to use? For example, if I got the=
 cost
> map which depends on the network map a few incremental updates ago, but I=
 have
> already processed those updates, there could potentially be PID mismatche=
s and
> what not, right?
>=20
> Shall we simply go ahead and add the tag into the event field? As for cos=
t
> maps, that would be the dependent-vtag. We can also put it in the id fiel=
d.
>=20
> 2. In the IRD, would it make sense to include the incremental update uri =
in
> the entries for regular resources? For example, a client would probably f=
ind
> it useful to know that the server is providing "my-default-network-map," =
and
> its incr update stream can be found in
> "http://example.com/network-map-updates."
>=20
> So the IRD would look like this:
>   "network-map": {
>     ...,
>     "update-uri":"http://somewhere.com/network-map-updates"
>   },
>   "routingcost-map": {
>     ...,
>     "update-uri":"http://somewhere.com/network-map-updates"
>   },
>   "hopcount-map": {
>     ...,
>     "update-uri":"http://somewhere.com/network-map-updates"
>   },
>  =20
>   "network-map-updates": {
>     "uri": "http://somewhere.com/network-map-updates",
>     "media-type": "text/event-stream",
>     "uses": ["network-map", "routingcost-map", "hopcount-map"],
>     "accepts": "application/alto-updatestreamfilter+json",
>     "capabilities": {
>       "events": [
>         {"media-type": "application/alto-networkmap+json",
>          "resource-id": "network-map"},
>         {"media-type": "application/alto-costmap+json",
>          "resource-id": "routingcost-map"},
>         {"media-type": "application/merge-patch+json",
>          "resource-id": "routingcost-map"},
>         {"media-type": "application/alto-costmap+json",
>          "resource-id": "hopcount-map"},
>         {"media-type": "application/merge-patch+json",
>          "resource-id": "hopcount-map"}
>       ]
>     }
>   }
>=20
> This saves the trouble for the client to search through the "uses" field =
in
> each stream resource; Also, when there are multiple streams for increment=
al
> updates for one map (e.g. one stream for networkmap A + costmap B, one st=
ream
> for networkmap A + costmap C and D), the server could load-balance by
> providing the default update-uri for networkmap A in its IRD entry.
>=20
> 3. To reduce overall traffic, I assume for one particular event stream, t=
he
> event filtering would be done on the server side, right?
>=20
> What do you think?
>=20
> Cheers,
> Xiao
>=20
> On Fri, Oct 17, 2014 at 1:35 PM, Wendy Roome <w.roome@alcatel-lucent.com>
> wrote:
>> Xiao,
>>=20
>> My first take was that update stream resources should be 1-1 with the
>> underlying full map resources. Then I realized that cost maps depend on
>> network maps, and clients & servers should coordinate changes to the two=
. The
>> easiest way to accomplish that was to use the same stream for both netwo=
rk
>> map and cost map updates, with the event type distinguishing network map
>> updates from cost map updates.
>>=20
>> But your comment reminded me that network maps are 1-n with cost maps. E=
g, a
>> network map can have two cost maps, one for routingcost and the other fo=
r
>> hopcount.
>>=20
>> So I suggest that an update stream resource can provide updates for an
>> arbitrary set of resources. The server picks the set. Each update event =
has a
>> media-type (basically, full-map vs merge-patch), and the resource-id of =
the
>> map it updates. Because SSE only allows three fields (event, id and data=
), I
>> suggest we encode the media-type,resource-id pair in the event type, as =
a
>> JSON object with those field names, as in:
>>=20
>>     event:=20
>>=20
{"media-type":"application/alto-network-map+json","resource-id":"network-ma=
p">>
}
>>=20
>> Here=B9s a detailed example of an IRD with an update stream service that g=
ives
>> updates for the network map and the associated routingcost and hopcount =
maps.
>> It offers merge-patch incremental updates for the cost maps, but only fu=
ll
>> updates for network maps:
>>=20
>>   "network-map": {...},
>>   "routingcost-map": {...},
>>   "hopcount-map": {...},
>>  =20
>>   "network-map-updates": {
>>     "uri": "http://somewhere.com/network-map-updates",
>>     "media-type": "text/event-stream",
>>     "uses": ["network-map", "routingcost-map", "hopcount-map"],
>>     "accepts": "application/alto-updatestreamfilter+json",
>>     "capabilities": {
>>       "events": [
>>         {"media-type": "application/alto-networkmap+json",
>>          "resource-id": "network-map"},
>>         {"media-type": "application/alto-costmap+json",
>>          "resource-id": "routingcost-map"},
>>         {"media-type": "application/merge-patch+json",
>>          "resource-id": "routingcost-map"},
>>         {"media-type": "application/alto-costmap+json",
>>          "resource-id": "hopcount-map"},
>>         {"media-type": "application/merge-patch+json",
>>          "resource-id": "hopcount-map"}
>>       ]
>>     }
>>   }
>>=20
>> This is a POST request. The client sends
>> application/alto-updatestreamfilter+json data (a new MIME type) to selec=
t the
>> events it wishes to get. Here is how a client would request updates for =
the
>> network and routingcost maps, but not the hopcount map:
>>=20
>>   POST /network-map-updates
>>   Host: somewhere.com <http://somewhere.com>
>>   Content-Length: ###
>>   Content-Type: application/alto-updatestreamfilter+json
>>   Accept: test/event-stream,application/alto-error+json
>>  =20
>>   {"events": [
>>      {"media-type": "application/alto-networkmap+json",
>>       "resource-id": "network-map"},
>>      {"media-type": "application/alto-costmap+json",
>>       "resource-id": "routingcost-map"},
>>      {"media-type": "application/merge-patch+json",
>>       "resource-id": "routingcost-map"}
>>   ]}
>>=20
>> The server would respond with something like this.
>>=20
>>   HTTP/1.1 200 OK
>>   Content-Type: text/event-stream
>>  =20
>>   : Full network map, sent immediately.
>>   event:=20
>>=20
{"media-type":"application/alto-network-map+json","resource-id":"network-ma=
p">>
}
>>   data: { ... full network map ... }
>>=20
>>   : Full routingcost map, sent immediately.
>>   event:=20
>>=20
{"media-type":"application/alto-costmap+json","resource-id":"routingcost-ma=
p">>
}
>>   data: { ... full routingcost cost map ... }
>>     =20
>>   : Incremental routingcost map update, sent when enough costs have chan=
ged.
>>   event:=20
>> {"media-type":"application/merge-patch+json","resource-id":"routingcost-=
map"}
>>   data: { ... merge-patch for routingcost cost map ... }
>>=20
>> Note that this omits the ids. They aren't really necessary. But if the
>> underlying SSE library expects them, the server can always use sequence
>> numbers 1, 2, 3, etc.
>>=20
>> How do people feel about this approach?
>>=20
>> - Wendy Roome
>>=20
>> From:  Xiao SHI <xiao.shi@yale.edu>
>> Date:  Fri, October 17, 2014 at 10:10
>> To:  Wendy Roome <w.roome@alcatel-lucent.com>
>> Cc:  Xiao SHI <xiao.shi@yale.edu>, "Y. Richard Yang" <yry@cs.yale.edu>, =
IETF
>> ALTO <alto@ietf.org>
>>=20
>> Subject:  Re: [alto] Incremental updates transport using SSE?
>>=20
>> Hi Wendy,
>>=20
>> I completely agree with you. I was thinking maybe there's some clever wa=
y of
>> using the SSE event-id, but the questionable saving is simply not worth =
the
>> logging and synchronization trouble.
>>=20
>> 1. One thing that follows this choice is to use one single SSE stream (o=
pen
>> connection) for each resource. I briefly considered having one open
>> connection and send updates for all resources on the server via that str=
eam.
>> The advantage of having only one connection open is smaller overhead, an=
d the
>> disadvantage is that it would require a more complicated ID and version
>> tagging in event name/id maybe. What do you think?
>>=20
>> 2. If the mapping between SSE stream and underlying map is one-to-one, w=
ould
>> it make sense for the resourceID of a stream to be the resourceID of the
>> underlying map and ".update" concatenated together? This way, when the c=
lient
>> actually requests and initiates the stream, the client would be aware of=
 the
>> resourceID of the underlying map.
>>=20
>> 3. Following that, we should define id field in the events. Richard prop=
osed
>> using a tag as the id if it's a full network map, and newtag_oldtag if i=
t's a
>> patch. The vtag for network map is ResourceID+tag tuple, if the client k=
nows
>> about the resourceID, could we only use the tag? And should the cost map=
s
>> simply use dependent-vtags? Since the id field is a string, what format =
do we
>> want the tags in? A few options are 1) json with all whitespaces removed=
; 2)
>> an even more compact patterned string.
>>=20
>> e.g. for network map patch, it could be:
>> {"old-tag":{"resource-id":"my-default-network-map","tag":"3ee2cb7e8d63d9=
fab71
>> b9b34cbf764436315542e"},"new-tag":{"resource-id":"my-default-network-map=
","ta
>> g":"c0ce023b8678a7b9ec00324673b98e54656d1f6d"}}
>>=20
>> or (since it must be the same resource):
>> {"resource-id":"my-default-network-map","old-tag":"3ee2cb7e8d63d9fab71b9=
b34cb
>> f764436315542e","new-tag":"c0ce023b8678a7b9ec00324673b98e54656d1f6d"}
>>=20
>> or (if the client knows the resource-id for the underlying map of the st=
ream,
>> just use a delimiter):
>> 3ee2cb7e8d63d9fab71b9b34cbf764436315542e_c0ce023b8678a7b9ec00324673b98e5=
4656d
>> 1f6d
>>=20
>> What do you think?
>>=20
>> Best,
>> Xiao
>>=20
>> On Fri, Oct 17, 2014 at 9:21 AM, Wendy Roome <w.roome@alcatel-lucent.com=
>
>> wrote:
>>> Xiao,
>>>=20
>>> That is a very good point. I hoped someone would ask about that.
>>>=20
>>> It is a tradeoff. The disadvantage of requiring the server to send full
>>> map(s) at the start of each stream is that if the connection drops, we =
have
>>> to send the full map over again. But the advantage is that incremental
>>> updates are only within the context of this particular stream. We don't=
 need
>>> keep track of where we were.
>>>=20
>>> To see the issue, suppose we wanted to avoid re-sending the full map wh=
en
>>> the client reestablishes the connection. Then the server must assign a
>>> unique id to every incremental update event. When the client reconnects=
, the
>>> client gives the server the last known event id, and the server sends a=
ny
>>> events the client missed.
>>>=20
>>> BTW, SSE does define event ids. Each event has an id, and when connecti=
ng,
>>> the client gives a Last-Event-Id header with the last id it received (i=
f
>>> any).
>>>=20
>>> So what is the problem with that? First, the server MUST assign a uniqu=
e id
>>> to every incremental update, and they must be the same for all clients.=
 That
>>> is, if the server has several increment-update clients, the server must
>>> "clock" their update event streams at the same rate. Second, the server=
 must
>>> keep a buffer of old update events, in case a client needs to reconnect=
. And
>>> third, because a reconnecting client may send an old (or bogus)
>>> Last-Event-Id, the server may have send the full map(s) anyway.
>>>=20
>>> If we do not use event ids, then it is much simpler. Incremental update=
s are
>>> in the context of this stream. Period. No persistent state that must su=
rvive
>>> the end of the connection. And if desired, the server can send updates =
are
>>> different rates to different clients.
>>>=20
>>> So I think it boils down to how often we expect connections to drop
>>> unintentionally. If that is common, then, yes, we need to define event =
ids
>>> to avoid resending the full maps. But if we can assume accidental drops=
 are
>>> rare, then I think it is simpler just to send the full map(s) for every=
 new
>>> connection.
>>>=20
>>> - Wendy Roome
>>>=20
>>> From:  Xiao SHI <xiao.shi@yale.edu>
>>> Date:  Thu, October 16, 2014 at 18:22
>>> To:  Wendy Roome <w.roome@alcatel-lucent.com>
>>> Cc:  "Y. Richard Yang" <yry@cs.yale.edu>, IETF ALTO <alto@ietf.org>
>>> Subject:  Re: [alto] Incremental updates transport using SSE?
>>>=20
>>> Hi Wendy,
>>>=20
>>> If a client accidentally dropped the connection and hopes to re-connect=
 and
>>> receive the merge-patch events, would it make sense for the server not =
to
>>> send the first full-map event? It will save quite some effort that way.
>>>=20
>>> Best,
>>> Xiao
>>>=20
>>=20
>=20




--B_3496654902_26029428
Content-type: text/html;
	charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

<html><head></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size:=
 14px; font-family: Calibri, sans-serif;"><div>Xiao,</div><div><br></div><di=
v>#1: That case is certainly possible. So we should say that when a server u=
pdates a network map, the server SHOULD send the update on all SSE streams a=
t the same time as that version becomes available via the network map resour=
ce and the dependent cost map resources. If a client gets network map and co=
st map updates via two different SSE streams, it is possible the client will=
 receive the cost map updates before the network map updates. The client can=
 detect this by the tag mismatch. If this happens, the client MUST buffer th=
e cost map updates and apply them after receiving the network map update. If=
 the corresponding network map update does not arrive in a timely fashion (w=
hatever that means), the client MUST close both streams, discard both maps, =
and reestablish both streams. That may not the most efficient way to resynch=
ronize, but it is the simplest and most reliable.</div><div><br></div><div>O=
f course, avoiding bizarre cases like that are why a server should normally =
use the same stream for network map and cost map updates. :-)</div><div><br>=
</div><div>#2: To handle that issue, we should say that if several different=
 update stream resources offer the same update event type, then events of th=
at type must be identical on all streams (modulo transmission delays). A cli=
ent may use which ever stream it prefers. In particular, a client may pick t=
he stream that offers the desired combination of update events.</div><div><b=
r></div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>- =
Wendy Roome&nbsp;</div><div><br></div><span id=3D"OLK_SRC_BODY_SECTION"><div s=
tyle=3D"font-family:Calibri; font-size:11pt; text-align:left; color:black; BOR=
DER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADD=
ING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIG=
HT: medium none; PADDING-TOP: 3pt"><span style=3D"font-weight:bold">From: </sp=
an> Xiao SHI &lt;<a href=3D"mailto:xiao.shi@yale.edu">xiao.shi@yale.edu</a>&gt=
;<br><span style=3D"font-weight:bold">Date: </span> Mon, October 20, 2014 at 1=
1:22<br><span style=3D"font-weight:bold">To: </span> Wendy Roome &lt;<a href=3D"=
mailto:w.roome@alcatel-lucent.com">w.roome@alcatel-lucent.com</a>&gt;<br><sp=
an style=3D"font-weight:bold">Cc: </span> Xiao SHI &lt;<a href=3D"mailto:xiao.sh=
i@yale.edu">xiao.shi@yale.edu</a>&gt;, "Y. Richard Yang" &lt;<a href=3D"mailto=
:yry@cs.yale.edu">yry@cs.yale.edu</a>&gt;, IETF ALTO &lt;<a href=3D"mailto:alt=
o@ietf.org">alto@ietf.org</a>&gt;<br><span style=3D"font-weight:bold">Subject:=
 </span> Re: [alto] Incremental updates transport using SSE?<br></div><div><=
br></div><div dir=3D"ltr">Hi Wendy,<div><br></div><div>#1: Yes, that will solv=
e the problem I was thinking of.</div><div><br></div><div>A follow up on thi=
s: what if say the client gets a cost map which depends on a version of the =
network map that the client has not received? Should the client simply disca=
rd the cost map or its patch? or temporarily save the cost map and wait? Or =
does this question enters the realm of client/server implementation/optimiza=
tion and is no longer the protocol's concern?</div><div><br></div><div>Anyho=
w, I agree that the resource-id should do.</div><div><br></div><div>#2: Soun=
ds good. The reason I thought of this is that a network map could be in mult=
iple update streams, should/could there be a preference of which stream the =
user get the update of the network map from? Or the client could simply find=
 *any* update stream which contains the resource update it wants?</div><div>=
<br></div><div>#3: That's exactly what I meant. Just double checking.</div><=
div><br></div><div>Thanks,</div><div>Xiao</div><div><br></div></div><div cla=
ss=3D"gmail_extra"><br><div class=3D"gmail_quote">On Mon, Oct 20, 2014 at 10:14 =
AM, Wendy Roome <span dir=3D"ltr">&lt;<a href=3D"mailto:w.roome@alcatel-lucent.c=
om" target=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;</span> wrote:<br><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc so=
lid;padding-left:1ex"><div style=3D"word-wrap:break-word;color:rgb(0,0,0);font=
-size:14px;font-family:Calibri,sans-serif"><div>Xiao,</div><div><br></div><d=
iv>#1: I don't think that is a good idea. The tag is mutable -- it changes e=
very update. I believe the event type should be immutable over updates. E.g.=
, note that the IRD has resource ids, but not tags. I believe the scenario y=
ou described is easily avoidable: when the client gets a new network map eve=
nt, the client updates the cached network map, including updated the tag, an=
d automatically discards any cached cost map(s) that depended on the old tag=
. And in any case, before using a cost map, the client should always verify =
that the network map tag in the cost map matches the tag of the map used to =
lookup the address.</div><div><br></div><div>Or did I not understand your sc=
enario properly?</div><div><br></div><div>#2: That seems to be an unnecessar=
y optimization and complication. It's a complication because it adds an addi=
tional constraint (that uri must exist, the resource must be an event stream=
, etc). It's unnecessary because let&#8217;s be realistic, an IRD will have =
at most 20 or 30 entries. Searching them for an update stream is not a chall=
enge. Particularly if you remember a client does that once and then keeps th=
e stream open for hours.</div><div><br></div><div>Also, if you do think that=
 is necessary, the map resource should give the *resource id* of the associa=
ted update resource, not the uri. Only a resource's IRD entry should give th=
e uri. Think of that as equivalent to normalizing a relational DB.</div><div=
><br></div><div>Or perhaps there could be a capability (or an attribute) tha=
t says this resource does have an update stream, so the client knows whether=
 search the IRD for it.</div><div><br></div><div>#3: I assumed that for a fi=
ltered update stream, the client would use a POST request to tell the server=
 which events the client wanted, and the server would filter out (or just no=
t send) the other events. Is that what you meant?</div><div><br></div><div><=
span style=3D"white-space:pre-wrap">	</span>- Wendy Roome</div><div><br></div>=
<span><div style=3D"font-family:Calibri;font-size:11pt;text-align:left;color:b=
lack;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PA=
DDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:m=
edium none;PADDING-TOP:3pt"><span style=3D"font-weight:bold">From: </span> Xia=
o SHI &lt;<a href=3D"mailto:xiao.shi@yale.edu" target=3D"_blank">xiao.shi@yale.e=
du</a>&gt;<br><span style=3D"font-weight:bold">Date: </span> Fri, October 17, =
2014 at 20:13<div><div class=3D"h5"><br><span style=3D"font-weight:bold">To: </s=
pan> Wendy Roome &lt;<a href=3D"mailto:w.roome@alcatel-lucent.com" target=3D"_bl=
ank">w.roome@alcatel-lucent.com</a>&gt;<br><span style=3D"font-weight:bold">Cc=
: </span> Xiao SHI &lt;<a href=3D"mailto:xiao.shi@yale.edu" target=3D"_blank">xi=
ao.shi@yale.edu</a>&gt;, "Y. Richard Yang" &lt;<a href=3D"mailto:yry@cs.yale.e=
du" target=3D"_blank">yry@cs.yale.edu</a>&gt;, IETF ALTO &lt;<a href=3D"mailto:a=
lto@ietf.org" target=3D"_blank">alto@ietf.org</a>&gt;<br><span style=3D"font-wei=
ght:bold">Subject: </span> Re: [alto] Incremental updates transport using SS=
E?<br></div></div></div><div><div class=3D"h5"><div><br></div><div dir=3D"ltr">H=
i Wendy,<div><br></div><div>I think this is a very good and efficient design=
. Just a few comments:</div><div><br></div><div>1. In the event field of the=
 SSE, you included the resource-id but not the tag along with it. I agree th=
at the tag seems unnecessary because each event is essentially an update of =
the map, and should be assigned a new tag if the update were not incremental=
. However, consider the following scenario: if, for whatever reason, the cli=
ent only subscribed to the network map incr updates (or the server only prov=
ided the network map stream), and the client is requesting cost maps from th=
e server via regular mechanism (i.e. always getting a full new map which con=
tains the dependent-vtag), could there be issues when the version of the net=
work map is not synchronized with the dependent vtag that the client is abou=
t to use? For example, if I got the cost map which depends on the network ma=
p a few incremental updates ago, but I have already processed those updates,=
 there could potentially be PID mismatches and what not, right?</div><div><b=
r></div><div>Shall we simply go ahead and add the tag into the event field? =
As for cost maps, that would be the dependent-vtag. We can also put it in th=
e id field.</div><div><br></div><div>2. In the IRD, would it make sense to i=
nclude the incremental update uri in the entries for regular resources? For =
example, a client would probably find it useful to know that the server is p=
roviding "my-default-network-map," and its incr update stream can be found i=
n "<a href=3D"http://example.com/network-map-updates" target=3D"_blank">http://e=
xample.com/network-map-updates</a>."</div><div><br></div><div>So the IRD wou=
ld look like this:</div><div><div style=3D"color:rgb(0,0,0);font-family:Calibr=
i,sans-serif;font-size:14px">&nbsp; "network-map": {</div><div style=3D"color:=
rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; ...,=
</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:=
14px">&nbsp; &nbsp; "update-uri":"<a href=3D"http://somewhere.com/network-map-=
updates" target=3D"_blank">http://somewhere.com/network-map-updates</a>"</div>=
<div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">=
&nbsp; },</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;f=
ont-size:14px">&nbsp; "routingcost-map":&nbsp;{</div><div style=3D"color:rgb(0=
,0,0);font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; ...,</div=
><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"=
>&nbsp; &nbsp; "update-uri":"<a href=3D"http://somewhere.com/network-map-updat=
es" target=3D"_blank">http://somewhere.com/network-map-updates</a>"</div><div =
style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">&nbsp=
; },</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-s=
ize:14px">&nbsp; "hopcount-map": {</div><div style=3D"color:rgb(0,0,0);font-fa=
mily:Calibri,sans-serif;font-size:14px"><div>&nbsp; &nbsp; ...,</div><div>&n=
bsp; &nbsp; "update-uri":"<a href=3D"http://somewhere.com/network-map-updates"=
 target=3D"_blank">http://somewhere.com/network-map-updates</a>"</div><div>&nb=
sp; },</div></div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-seri=
f;font-size:14px">&nbsp;&nbsp;</div><div style=3D"color:rgb(0,0,0);font-family=
:Calibri,sans-serif;font-size:14px">&nbsp; "network-map-updates": {</div><di=
v style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">&nb=
sp; &nbsp; "uri": "<a href=3D"http://somewhere.com/network-map-updates" target=
=3D"_blank">http://somewhere.com/network-map-updates</a>",</div><div style=3D"co=
lor:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; =
"media-type": "text/event-stream",</div><div style=3D"color:rgb(0,0,0);font-fa=
mily:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; "uses": ["network-map"=
, "routingcost-map", "hopcount-map"],</div><div style=3D"color:rgb(0,0,0);font=
-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; "accepts": "applica=
tion/alto-updatestreamfilter+json",</div><div style=3D"color:rgb(0,0,0);font-f=
amily:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; "capabilities": {</di=
v><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px=
">&nbsp; &nbsp; &nbsp; "events": [</div><div style=3D"color:rgb(0,0,0);font-fa=
mily:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; {"media-=
type": "application/alto-networkmap+json",</div><div style=3D"color:rgb(0,0,0)=
;font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;"resource-id": "network-map"},</div><div style=3D"color:rgb(0,0,0);font-=
family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; {"medi=
a-type": "application/alto-costmap+json",</div><div style=3D"color:rgb(0,0,0);=
font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp;"resource-id": "routingcost-map"},</div><div style=3D"color:rgb(0,0,0);fo=
nt-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; {"m=
edia-type": "application/merge-patch+json",</div><div style=3D"color:rgb(0,0,0=
);font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp;"resource-id": "routingcost-map"},</div><div style=3D"color:rgb(0,0,0);=
font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; {=
"media-type": "application/alto-costmap+json",</div><div style=3D"color:rgb(0,=
0,0);font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp;"resource-id": "hopcount-map"},</div><div style=3D"color:rgb(0,0,0);=
font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbsp; {=
"media-type": "application/merge-patch+json",</div><div style=3D"color:rgb(0,0=
,0);font-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp;"resource-id": "hopcount-map"}</div><div style=3D"color:rgb(0,0,0);fo=
nt-family:Calibri,sans-serif;font-size:14px">&nbsp; &nbsp; &nbsp; ]</div><di=
v style=3D"color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">&nb=
sp; &nbsp; }</div><div style=3D"color:rgb(0,0,0);font-family:Calibri,sans-seri=
f;font-size:14px">&nbsp; }</div></div><div><br></div><div>This saves the tro=
uble for the client to search through the "uses" field in each stream resour=
ce; Also, when there are multiple streams for incremental updates for one ma=
p (e.g. one stream for networkmap A + costmap B, one stream for networkmap A=
 + costmap C and D), the server could load-balance by providing the default =
update-uri for networkmap A in its IRD entry.</div><div><br></div><div>3. To=
 reduce overall traffic, I assume for one particular event stream, the event=
 filtering would be done on the server side, right?</div><div><br></div><div=
>What do you think?</div><div><br></div><div>Cheers,</div><div>Xiao</div></d=
iv><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Fri, Oct 17, 201=
4 at 1:35 PM, Wendy Roome <span dir=3D"ltr">&lt;<a href=3D"mailto:w.roome@alcate=
l-lucent.com" target=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;</span> wrot=
e:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-word;color:rgb(0=
,0,0);font-size:14px;font-family:Calibri,sans-serif"><div>Xiao,</div><div><b=
r></div><div>My first take was that update stream resources should be 1-1 wi=
th the underlying full map resources. Then I realized that cost maps depend =
on network maps, and clients &amp; servers should coordinate changes to the =
two. The easiest way to accomplish that was to use the same stream for both =
network map and cost map updates, with the event type distinguishing network=
 map updates from cost map updates.</div><div><br></div><div>But your commen=
t reminded me that network maps are 1-n with cost maps. Eg, a network map ca=
n have two cost maps, one for routingcost and the other for hopcount.</div><=
div><br></div><div>So I suggest that an update stream resource can provide u=
pdates for an arbitrary set of resources. The server picks the set. Each upd=
ate event has a media-type (basically, full-map vs merge-patch), and the res=
ource-id of the map it updates. Because SSE only allows three fields (event,=
 id and data), I suggest we encode the media-type,resource-id pair in the ev=
ent type, as a JSON object with those field names, as in:</div><div><br></di=
v><div>&nbsp; &nbsp; event: {"media-type":"application/alto-network-map+json=
","resource-id":"network-map"}</div><div><br></div><div>Here&#8217;s a detai=
led example of an IRD with an update stream service that gives updates for t=
he network map and the associated routingcost and hopcount maps. It offers m=
erge-patch incremental updates for the cost maps, but only full updates for =
network maps:</div><div><br></div><div><div>&nbsp; "network-map": {...},</di=
v><div>&nbsp; "routingcost-map": {...},</div><div>&nbsp; "hopcount-map": {..=
.},</div><div>&nbsp;&nbsp;</div><div>&nbsp; "network-map-updates": {</div><d=
iv>&nbsp; &nbsp; "uri": "<a href=3D"http://somewhere.com/network-map-updates" =
target=3D"_blank">http://somewhere.com/network-map-updates</a>",</div><div>&nb=
sp; &nbsp; "media-type": "text/event-stream",</div><div>&nbsp; &nbsp; "uses"=
: ["network-map", "routingcost-map", "hopcount-map"],</div><div>&nbsp; &nbsp=
; "accepts": "application/alto-updatestreamfilter+json",</div><div>&nbsp; &n=
bsp; "capabilities": {</div><div>&nbsp; &nbsp; &nbsp; "events": [</div><div>=
&nbsp; &nbsp; &nbsp; &nbsp; {"media-type": "application/alto-networkmap+json=
",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"resource-id": "network-map"}=
,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {"media-type": "application/alto-cos=
tmap+json",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"resource-id": "rout=
ingcost-map"},</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {"media-type": "applica=
tion/merge-patch+json",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"resourc=
e-id": "routingcost-map"},</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {"media-typ=
e": "application/alto-costmap+json",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp;"resource-id": "hopcount-map"},</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {=
"media-type": "application/merge-patch+json",</div><div>&nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp;"resource-id": "hopcount-map"}</div><div>&nbsp; &nbsp; &nbsp; =
]</div><div>&nbsp; &nbsp; }</div><div>&nbsp; }</div></div><div><br></div><di=
v>This is a POST request. The client sends application/alto-updatestreamfilt=
er+json data (a new MIME type) to select the events it wishes to get. Here i=
s how a client would request updates for the network and routingcost maps, b=
ut not the hopcount map:</div><div><br></div><div><div>&nbsp; POST /network-=
map-updates</div><div>&nbsp; Host: <a href=3D"http://somewhere.com" target=3D"_b=
lank">somewhere.com</a></div><div>&nbsp; Content-Length: ###</div><div>&nbsp=
; Content-Type: application/alto-updatestreamfilter+json</div><div>&nbsp; Ac=
cept: test/event-stream,application/alto-error+json</div><div>&nbsp;&nbsp;</=
div><div>&nbsp; {"events": [</div><div>&nbsp; &nbsp; &nbsp;{"media-type": "a=
pplication/alto-networkmap+json",</div><div>&nbsp; &nbsp; &nbsp; "resource-i=
d": "network-map"},</div><div>&nbsp; &nbsp; &nbsp;{"media-type": "applicatio=
n/alto-costmap+json",</div><div>&nbsp; &nbsp; &nbsp; "resource-id": "routing=
cost-map"},</div><div>&nbsp; &nbsp; &nbsp;{"media-type": "application/merge-=
patch+json",</div><div>&nbsp; &nbsp; &nbsp; "resource-id": "routingcost-map"=
}</div><div>&nbsp; ]}</div></div><div><br></div><div>The server would respon=
d with something like this.</div><div><br></div><div><div>&nbsp; HTTP/1.1 20=
0 OK</div><div>&nbsp; Content-Type: text/event-stream</div><div>&nbsp;&nbsp;=
</div><div>&nbsp; : Full network map, sent immediately.</div><div>&nbsp; eve=
nt: {"media-type":"application/alto-network-map+json","resource-id":"network=
-map"}</div><div>&nbsp; data: { ... full network map ... }</div><div><br></d=
iv><div>&nbsp; : Full routingcost map, sent immediately. &nbsp;</div><div>&n=
bsp; event: {"media-type":"application/alto-costmap+json","resource-id":"rou=
tingcost-map"}</div><div>&nbsp; data: { ... full routingcost cost map ... }<=
/div><div>&nbsp; &nbsp; &nbsp;</div><div>&nbsp; : Incremental routingcost ma=
p update, sent when enough costs have changed. &nbsp;</div><div>&nbsp; event=
: {"media-type":"application/merge-patch+json","resource-id":"routingcost-ma=
p"}</div><div>&nbsp; data: { ... merge-patch for routingcost cost map ... }<=
/div></div><div><br></div><div>Note that this omits the ids. They aren't rea=
lly necessary. But if the underlying SSE library expects them, the server ca=
n always use sequence numbers 1, 2, 3, etc.</div><div><br></div><div>How do =
people feel about this approach?</div><div><br></div><div><span style=3D"white=
-space:pre-wrap">	</span>- Wendy Roome</div><div><br></div><span><div style=3D=
"font-family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTO=
M:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PA=
DDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDIN=
G-TOP:3pt"><span style=3D"font-weight:bold">From: </span> Xiao SHI &lt;<a href=
=3D"mailto:xiao.shi@yale.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt;<br><sp=
an style=3D"font-weight:bold">Date: </span> Fri, October 17, 2014 at 10:10<br>=
<span style=3D"font-weight:bold">To: </span> Wendy Roome &lt;<a href=3D"mailto:w=
.roome@alcatel-lucent.com" target=3D"_blank">w.roome@alcatel-lucent.com</a>&gt=
;<br><span style=3D"font-weight:bold">Cc: </span> Xiao SHI &lt;<a href=3D"mailto=
:xiao.shi@yale.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt;, "Y. Richard Y=
ang" &lt;<a href=3D"mailto:yry@cs.yale.edu" target=3D"_blank">yry@cs.yale.edu</a=
>&gt;, IETF ALTO &lt;<a href=3D"mailto:alto@ietf.org" target=3D"_blank">alto@iet=
f.org</a>&gt;<div><div><br><span style=3D"font-weight:bold">Subject: </span> R=
e: [alto] Incremental updates transport using SSE?<br></div></div></div><div=
><div><div><br></div><div dir=3D"ltr">Hi Wendy,<div><br></div><div>I completel=
y agree with you. I was thinking maybe there's some clever way of using the =
SSE event-id, but the questionable saving is simply not worth the logging an=
d synchronization trouble.</div><div><br></div><div>1. One thing that follow=
s this choice is to use one single SSE stream (open connection) for each res=
ource. I briefly considered having one open connection and send updates for =
all resources on the server via that stream. The advantage of having only on=
e connection open is smaller overhead, and the disadvantage is that it would=
 require a more complicated ID and version tagging in event name/id maybe. W=
hat do you think?</div><div><br></div><div>2. If the mapping between SSE str=
eam and underlying map is one-to-one, would it make sense for the resourceID=
 of a stream to be the resourceID of the underlying map and ".update" concat=
enated together? This way, when the client actually requests and initiates t=
he stream, the client would be aware of the resourceID of the underlying map=
.</div><div><br></div><div>3. Following that, we should define id field in t=
he events. Richard proposed using a tag as the id if it's a full network map=
, and newtag_oldtag if it's a patch. The vtag for network map is ResourceID+=
tag tuple, if the client knows about the resourceID, could we only use the t=
ag? And should the cost maps simply use dependent-vtags? Since the id field =
is a string, what format do we want the tags in? A few options are 1) json w=
ith all whitespaces removed; 2) an even more compact patterned string.</div>=
<div><br></div><div>e.g. for network map patch, it could be:</div><div>{"old=
-tag":{"resource-id":"my-default-network-map","tag":"3ee2cb7e8d63d9fab71b9b3=
4cbf764436315542e"},"new-tag":{"resource-id":"my-default-network-map","tag":=
"<span style=3D"color:rgb(0,0,0);font-size:1em">c0ce023b8678a7b9ec00324673b98e=
54656d1f6d</span>"}}<br></div><div><br></div><div>or (since it must be the s=
ame resource):<br></div><div>{"resource-id":"my-default-network-map","old-ta=
g":"3ee2cb7e8d63d9fab71b9b34cbf764436315542e","new-tag":"<span style=3D"color:=
rgb(0,0,0);font-size:1em">c0ce023b8678a7b9ec00324673b98e54656d1f6d</span>"}<=
br></div><div><br></div><div>or (if the client knows the resource-id for the=
 underlying map of the stream, just use a delimiter):</div><div>3ee2cb7e8d63=
d9fab71b9b34cbf764436315542e_<span style=3D"color:rgb(0,0,0);font-size:13px">c=
0ce023b8678a7b9ec00324673b98e54656d1f6d</span><br></div><div><br></div><div>=
What do you think?</div><div><br></div><div>Best,</div><div>Xiao</div></div>=
<div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Fri, Oct 17, 2014 a=
t 9:21 AM, Wendy Roome <span dir=3D"ltr">&lt;<a href=3D"mailto:w.roome@alcatel-l=
ucent.com" target=3D"_blank">w.roome@alcatel-lucent.com</a>&gt;</span> wrote:<=
br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px =
#ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-word;color:rgb(0,0,=
0);font-size:14px;font-family:Calibri,sans-serif"><div>Xiao,</div><div><br><=
/div><div>That is a very good point. I hoped someone would ask about that.</=
div><div><br></div><div>It is a tradeoff. The disadvantage of requiring the =
server to send full map(s) at the start of each stream is that if the connec=
tion drops, we have to send the full map over again. But the advantage is th=
at incremental updates are only within the context of this particular stream=
. We don't need keep track of where we were.</div><div><br></div><div>To see=
 the issue, suppose we wanted to avoid re-sending the full map when the clie=
nt reestablishes the connection. Then the server must assign a unique id to =
every incremental update event. When the client reconnects, the client gives=
 the server the last known event id, and the server sends any events the cli=
ent missed.</div><div><br></div><div>BTW, SSE does define event ids. Each ev=
ent has an id, and when connecting, the client gives a Last-Event-Id header =
with the last id it received (if any).</div><div><br></div><div>So what is t=
he problem with that? First, the server MUST assign a unique id to every inc=
remental update, and they must be the same for all clients. That is, if the =
server has several increment-update clients, the server must "clock" their u=
pdate event streams at the same rate. Second, the server must keep a buffer =
of old update events, in case a client needs to reconnect. And third, becaus=
e a reconnecting client may send an old (or bogus) Last-Event-Id, the server=
 may have send the full map(s) anyway.</div><div><br></div><div>If we do not=
 use event ids, then it is much simpler. Incremental updates are in the cont=
ext of this stream. Period. No persistent state that must survive the end of=
 the connection. And if desired, the server can send updates are different r=
ates to different clients.</div><div><br></div><div>So I think it boils down=
 to how often we expect connections to drop unintentionally. If that is comm=
on, then, yes, we need to define event ids to avoid resending the full maps.=
 But if we can assume accidental drops are rare, then I think it is simpler =
just to send the full map(s) for every new connection.</div><div><br></div><=
div><span style=3D"white-space:pre-wrap">	</span>- Wendy Roome</div><div><br><=
/div><span><div style=3D"font-family:Calibri;font-size:11pt;text-align:left;co=
lor:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0=
in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RI=
GHT:medium none;PADDING-TOP:3pt"><span style=3D"font-weight:bold">From: </span=
> Xiao SHI &lt;<a href=3D"mailto:xiao.shi@yale.edu" target=3D"_blank">xiao.shi@y=
ale.edu</a>&gt;<br><span style=3D"font-weight:bold">Date: </span> Thu, October=
 16, 2014 at 18:22<br><span style=3D"font-weight:bold">To: </span> Wendy Roome=
 &lt;<a href=3D"mailto:w.roome@alcatel-lucent.com" target=3D"_blank">w.roome@alc=
atel-lucent.com</a>&gt;<br><span style=3D"font-weight:bold">Cc: </span> "Y. Ri=
chard Yang" &lt;<a href=3D"mailto:yry@cs.yale.edu" target=3D"_blank">yry@cs.yale=
.edu</a>&gt;, IETF ALTO &lt;<a href=3D"mailto:alto@ietf.org" target=3D"_blank">a=
lto@ietf.org</a>&gt;<span><br><span style=3D"font-weight:bold">Subject: </span=
> Re: [alto] Incremental updates transport using SSE?<br></span></div><span>=
<div><br></div><div dir=3D"ltr" style=3D"color:rgb(0,0,0);font-family:Calibri;fo=
nt-size:medium;font-style:normal;font-variant:normal;font-weight:normal;lett=
er-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-t=
ransform:none;white-space:normal;word-spacing:0px">Hi Wendy,<div><br></div><=
div>If a client accidentally dropped the connection and hopes to re-connect =
and receive the merge-patch events, would it make sense for the server not t=
o send the first full-map event? It will save quite some effort that way.</d=
iv><div><br></div><div>Best,</div><div>Xiao</div></div><br></span></span></d=
iv></blockquote></div><br></div></div></div></span></div></blockquote></div>=
<br></div></div></div></span></div></blockquote></div><br></div></span></bod=
y></html>

--B_3496654902_26029428--




From nobody Mon Oct 20 19:29:46 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 335F41ACF03; Mon, 20 Oct 2014 19:29:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.777
X-Spam-Level: 
X-Spam-Status: No, score=-0.777 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, J_CHICKENPOX_46=0.6, 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 jmx-Lyijks6p; Mon, 20 Oct 2014 19:29:37 -0700 (PDT)
Received: from mail-yh0-x22f.google.com (mail-yh0-x22f.google.com [IPv6:2607:f8b0:4002:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 749291ACED6; Mon, 20 Oct 2014 19:29:37 -0700 (PDT)
Received: by mail-yh0-f47.google.com with SMTP id c41so455717yho.6 for <multiple recipients>; Mon, 20 Oct 2014 19:29:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=lSsndNGMrYa+P9EFE0KILP8QNU//4FDyANwmwdbQFSw=; b=BQmHEL6CMhpwl5PlnY5/Dys1gKqcd4TznU8rRivQq+QR7sIFqXc8q+UnJbG8GTKqzH 8zjhjbMU1AZA97iR1cz8bOh68UZRRy2ZIPraRWKI2gus4LRiy//gaTqeOdYL28Hh/wJ/ DeJv6F8NYu9zrjmTkG34Xx/2tqb3sWCMuaR+t05IeDv2mPAzCaaHEZaAvXxJ6hR+E3yc kzqY1dkDPWCIhdMNPRybPwv8+QrrxCVu7g6AjVr1ZPAuy5E5qBXV2wQxoz3O4ArSp6kP w9I32gXeeoLNsaDKgJWdBlYCaaBy0PoaE7mukjZQTTJUZXB0fVhKVKjVmvOU87DB/zbA HtTw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=lSsndNGMrYa+P9EFE0KILP8QNU//4FDyANwmwdbQFSw=; b=z3W3aMXFqPOrap9Vx/IwyuZOZHW1Dfd9keSeeT5EOabckSg9phX3290klguePlu3YE 5CNLhnDr2GRnkoH0jgBJZeKf8v3KBtvQrSvS6FrOQQQ9hQ7weY3POR+DcxG5JN8v8oL+ VYqZXAWNdd/gSl9Am8kTxho3pl2vbPS0WUuek=
X-Received: by 10.236.19.138 with SMTP id n10mr44744205yhn.55.1413858576684; Mon, 20 Oct 2014 19:29:36 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.97.10 with HTTP; Mon, 20 Oct 2014 19:29:16 -0700 (PDT)
In-Reply-To: <m2k33uag60.fsf@nic.cz>
References: <CAFwJzZkAp-4umrrHZEY3qYuFCXu=+Pqbh8SeB=Qr=TTbQurj6A@mail.gmail.com> <m2tx2ynadg.fsf@nic.cz> <CAFwJzZ=kv7_W=mrJz77Y1DTkL_Cq-o+B-FDJERy-8g-OCVbj5g@mail.gmail.com> <m2k33uag60.fsf@nic.cz>
From: Xiao SHI <xiao.shi@yale.edu>
Date: Mon, 20 Oct 2014 22:29:16 -0400
X-Google-Sender-Auth: MXji9V77CAiQBvXz-0apkpzOdX0
Message-ID: <CAFwJzZ=HVnXBUgQP9eNc2NZ=vZ+W6=NyqqVbyxyHn5wipxCUUg@mail.gmail.com>
To: Ladislav Lhotka <lhotka@nic.cz>
Content-Type: multipart/alternative; boundary=089e0160befa39db590505e59adc
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/PFitTqFR6EJdIM-bJsc4qQhNRd0
Cc: Xiao SHI <xiao.shi@yale.edu>, IETF ALTO <alto@ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [alto] [netmod] Modeling JSON based protocols using YANG
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 21 Oct 2014 02:29:44 -0000

--089e0160befa39db590505e59adc
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi Lada,

I agree with your statement that YANG is designed to model datastore and
the protocol messages.

Right now the question I am trying to answer is this scenario: we have the
protocols (hence the protocol messages) first, and would like to know
whether we would be able to use YANG to model the content messages (in
order to use the YANG tools for this protocol, etc.). And the question is
what are the conditions for JSON msgs to be able to be modeled by YANG.

For JSON arrays:
0. a standalone non-object JSON value is not model-able in YANG:
examples:
--"foo"
--14
--[1,2,3]
which translates to the following in XML:
<0>1</0>
<1>2</1>
<2>3</2>

This is why your example "foo": [ { "bar": 1 }, 2 ] cannot be
modeled--because 2 is a standalone value and {"bar": 1} is an object,
otherwise there are following ways to model an array with a mix of elements=
:

1. an array with only built-in types or derived types (standalone JSON
values except for arrays and objects) can be modeled in YANG as the
following:
"foo" : [1, "abc", enum1]

leaf-list foo {
  type union {
    type int64;
    type string;
    type enumeration {
      enum enum1;
    }
  }
}

2. an array of all objects
(1) This structure is model-able as well, right?
"foo": [{"a": 1}, {"a": 1, "b": 2}]

list foo {
  leaf a {
    type int;
  }
  leaf b {
    type int;
  }
}

(2) how about this?
"foo": [{"a": 1, "b": 2, "c": 3}, {"c": 1, "b":3, "y": 2}]

If the JSON-XML translate it to the following:
        <foo>
<a>1</a>
<b>2</b>
<c>3</c>
</foo>
<foo>
<c>1</c>
<b>3</b>
<y>2</y>
</foo>
We can still model this using the choice statement, right?

If the above statements about whether these JSON texts are model-able are
correct, essentially the only JSON arrays that are not model-able are (a)
those mixed with objects and a standalone non-object JSON value; and (b)
those whose elements is an array. And this gap is caused by the difference
between leaf-list modeling capabilities of handling arrays with non-object,
non-array, standalone JSON values, and the list+choice modeling
capabilities of modeling arrays with objects. Does this sound plausible?

Cheers,
Xiao

On Mon, Oct 20, 2014 at 11:56 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:

> Xiao SHI <xiao.shi@yale.edu> writes:
>
> > Hi Lada,
> >
> > Thank you so much for your feedback!
> >
> > The motivation here is to produce a YANG model given a defined protocol=
,
> > e.g. ALTO, CDNi, etc. This way, we may incorporate future protocols int=
o
> > ODL controllers or use other YANG related tools to handle those
> protocols.
> > Hence the objective of the modeling is the protocol, not the messages. =
I
> am
> > not suggesting to use YANG as a schema language.
>
> Hmm, YANG was designed for modelling datastores and contents of protocol
> messages, not protocols as such.
>
> >
> > The conditions discussed in this process will be helpful in the followi=
ng
> > sense:
> > 1) disprove the possibility to get a syntactically equivalent YANG mode=
l
> > from a JSON based protocol;
> > 2) generate a Jackson JSON parser class and YANG model from the protoco=
ls
> > that meet the criteria;
> > 3) for designers of future protocols who are thinking of using YANG
> related
> > tools, set a guideline of what their messages should look like (or MUST
> not
> > contain);
> > 4) for the YANG/NETCONF WG, describing the compatibility issues that th=
ey
> > might be interested in tackling for expanding YANG's usage.
> >
> > For this example, "foo": [ { "bar": 1 }, 2 ] is also not easy to do
> > data-binding in the parser, because the elements of the array are not o=
f
> > the same type, which is indeed an assumption that I left out.
> >
> > For the {"foo=E2=80=9D:null} example, can't we model it using type empt=
y? That's
> > equivalent to the XML element <foo /> right?
>
> <foo/> corresponds to
>
> "foo": [null]
>
> Section 6.9 in draft-ietf-netmod-yang-json-01 gives the reasoning,
> essentially it is because some software isn't able to distinguish
>
> "foo": null
>
> from "foo" being absent.
>
> Lada
>
> >
> > Cheers,
> > Xiao
> >
> > On Mon, Oct 20, 2014 at 9:23 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:
> >
> >> Xiao SHI <xiao.shi@yale.edu> writes:
> >>
> >> > Hi folks,
> >> >
> >> >
> >> > As a few of us were working on modeling the ALTO protocol using YANG=
,
> we
> >> > were pondering on a more general question: can YANG model all JSON
> based
> >> > protocols? What is the condition for a JSON based protocol (at least
> the
> >> > message format) to have an syntactically equivalent, hence
> interoperable,
> >> > YANG model with JSON encoding? Alternatively, in order to
> interoperate,
> >> > semantic equivalence might be sufficient, is there any condition for
> >> > semantic equivalence?
> >> >
> >> >
> >> > tl;dr: A JSON based protocol carried by HTTP can have syntactically
> >> > equivalent YANG model, if and only if all the keys in the key-value
> pairs
> >> > in the JSON message are pre-defined keywords in the protocol.
> >> >
> >>
> >> Generating a YANG data model from existing instance data seems backwar=
ds
> >> to me, although Examplotron (http://examplotron.org) does something
> quite
> >> similar. In any case, it might be quite challenging because YANG isn't
> >> intended as a general schema language. Your observation above is true
> >> but it is just one aspect of the problem. For instance
> >>
> >> "foo": [ { "bar": 1 }, 2 ]
> >>
> >> or
> >>
> >> "foo": null
> >>
> >> cannot be modelled in YANG using the encoding of
> >> draft-ietf-netmod-yang-json.
> >>
> >> Lada
> >>
> >> >
> >> > We've come up with a few ideas, and a few things below are work in
> >> > progress, but we would love your feedback!
> >> >
> >> >
> >> > Thank you!
> >> >
> >> > Xiao
> >> >
> >> >
> >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >> >
> >> > 1. Introduction.
> >> >
> >> > JavaScript Object Notation (JSON) has been a popular choice as the
> >> message
> >> > encoding for many network protocols such as the Application Layer
> Traffic
> >> > Optimization (ALTO) protocol, the Content Delivery Networks
> >> Interconnection
> >> > (CDNi) protocol, etc.
> >> >
> >> > Meanwhile, there are broad interests in the networking community to
> use
> >> > YANG to define data model so that one can use YANG related tools suc=
h
> as
> >> > OpenDayLight controller. Although YANG itself is XML based, there ha=
ve
> >> been
> >> > efforts to model JSON content using YANG
> >> [draft-ietf-netmod-yang-json-01].
> >> >
> >> > A natural question rises: can YANG model all JSON based protocols?
> What
> >> is
> >> > the condition for a JSON based protocol (at least the message format=
)
> to
> >> > have an syntactically equivalent, hence interoperable, YANG model wi=
th
> >> JSON
> >> > encoding? Alternatively, in order to interoperate, semantic
> equivalence
> >> > might be sufficient, is there any condition for semantic equivalence=
?
> >> >
> >> > 2. Claim
> >> >
> >> > A JSON based protocol carried by HTTP can have syntactically
> equivalent
> >> > YANG model, if and only if:
> >> >
> >> > (1) the message encoding condition is met;
> >> >
> >> > (2) the uri condition is met.
> >> >
> >> > 2.1. The message encoding condition
> >> >
> >> > The JSON message encoding MUST not contain a variable as a key in a
> JSON
> >> > object key-value pair. In other words, the keys in the JSON message
> must
> >> be
> >> > an already defined constant (or keyword) in the message format of th=
e
> >> > protocol.
> >> >
> >> > For example, if I have a protocol where =E2=80=9Cnetwork-map=E2=80=
=9D, =E2=80=9Csrc=E2=80=9D, and
> =E2=80=9Cdsts=E2=80=9D
> >> > are defined keywords, JSON text A meets the condition whereas B does
> not
> >> > because =E2=80=9CPID1=E2=80=9D and =E2=80=9CPID2=E2=80=9D are not pr=
otocol keywords (they are resource
> >> IDs).
> >> >
> >> > A:
> >> >
> >> > {
> >> >
> >> >  =E2=80=9Cnetwork-map=E2=80=9D: [
> >> >
> >> >    {
> >> >
> >> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,
> >> >
> >> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=
=E2=80=9D]
> >> >
> >> >    },
> >> >
> >> >    {
> >> >
> >> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,
> >> >
> >> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=
=E2=80=9D]
> >> >
> >> >    }
> >> >
> >> >  ]
> >> >
> >> > }
> >> >
> >> > B:
> >> >
> >> >
> >> > {
> >> >
> >> >  =E2=80=9Cnetwork-map=E2=80=9D: [
> >> >
> >> >    =E2=80=9CPID1: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=9D],
> >> >
> >> >    =E2=80=9CPID2=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=E2=
=80=9D]
> >> >
> >> >  ]
> >> >
> >> > }
> >> >
> >> >>From this we know that since ALTO protocol uses encoding B, there
> cannot
> >> be
> >> > a syntactically equivalent YANG model.
> >> >
> >> > 2.2 The URI condition
> >> >
> >> > Some of the YANG-related protocols might have URI constraints, e.g.
> >> > RESTCONF. For now, we assume either that the JSON-based protocol URI
> >> could
> >> > be conformed to RESTCONF compliant uri, or that the server could hav=
e
> a
> >> > routing mapping between the protocol compliant uri and the RESTCONF
> >> > compliant uri, hence this condition would not be an issue, which
> allows
> >> us
> >> > to focus on the message encoding condition.
> >> >
> >> > 3. Proof
> >> >
> >> > 3.1. The message encoding condition is necessary.
> >> >
> >> > We first note that this condition is a necessary condition for a JSO=
N
> >> based
> >> > protocol to have a syntactically equivalent YANG model by proving it=
s
> >> > contrapositive.
> >> >
> >> > If one of the keys in the key-value pair in the JSON document is not
> >> > pre-defined, the corresponding XML tags will not be pre-defined
> keywords.
> >> > Therefore, it would not possible to model it in YANG without using
> >> > YANG=E2=80=99s anyxml
> >> > statement (which allows arbitrary XML content).
> >> >
> >> > However, using the anyxml statement would defeat our purpose of
> modeling
> >> > the data as it allows arbitrary XML content, and will not be helpful
> in
> >> the
> >> > subsequent parsing process.
> >> >
> >> > 3.2. The message encoding condition is sufficient.
> >> >
> >> > We prove this by providing a translation procedure from a JSON messa=
ge
> >> that
> >> > is compliant with the protocol we are trying to model, to a custom
> java
> >> > class that can be used for Jackson data binding, then to a YANG mode=
l.
> >> >
> >> > We note that the middle step of translating to and from the custom
> parser
> >> > class is not necessary, but it will be useful.
> >> >
> >> > 3.2.1. motivation
> >> >
> >> > JSON data binding is the process of binding data structures (objects=
,
> >> > arrays, etc.) in JSON to the appropriate data structures in the serv=
er
> >> > (e.g. java classes, database tables, etc.) in parsing the JSON text.
> In
> >> > order to process JSON messages in a meaningful manner, data binding =
is
> >> > necessary. Even if the binding is not explicit, the server would nee=
d
> to
> >> do
> >> > it eventually. For example, one can read JSON content in a stream
> without
> >> > binding it to the java classes, but eventually in order to make sens=
e
> of
> >> > the data, the server would eventually have to organize it, which is
> >> roughly
> >> > analogous to data binding upfront. Popular choices for JSON parsing
> and
> >> > data binding include jackson and gson.
> >> >
> >> > We use Jackson full data binding as our approach. Full data binding
> binds
> >> > JSON content into plain old java objects (POJOs), i.e. this custom
> parser
> >> > class can neither extend nor implement any other class. Jackson uses
> >> > ObjectMapper with the custom parser class to parse JSON content into
> this
> >> > class.
> >> >
> >> > 3.2.2. The message encoding condition
> >> >
> >> > The message encoding condition is that all keys in each key-value
> pair in
> >> > the JSON text must be pre-defined keywords. As the keys will become
> >> either
> >> > class names and instance variable names, or be keys in the java maps=
,
> it
> >> is
> >> > easy to see that the condition is equivalent to =E2=80=9Cthere exist=
s a full
> data
> >> > binding in Jackson custom parser class without using any map
> structures
> >> > (Map<String, ?>).=E2=80=9D
> >> >
> >> > 3.2.3. Proof
> >> >
> >> > We provide a recursive binding process from a JSON object to the
> Jackson
> >> > custom parser class to be used by Jackson ObjectMapper.
> >> >
> >> > Type determine_type(value) {
> >> >
> >> >  if (value is of a primitive type, i.e. string, number, boolean,
> null) {
> >> >
> >> >    return the corresponding java primitive type;
> >> >
> >> >  }
> >> >
> >> >  if (value is a JSON object) {
> >> >
> >> >    return build_parser_class(value).class;
> >> >
> >> >  }
> >> >
> >> >  if (value is an array) {
> >> >
> >> >    return ArrayList<T> where T=3Ddetermine_type(value[0]);
> >> >
> >> >  }
> >> >
> >> >  // should not reach here.
> >> >
> >> > }
> >> >
> >> > Class build_parser_class(JSONObject obj) {
> >> >
> >> >  create custom class C;
> >> >
> >> >  for each key/value pair in the obj {
> >> >
> >> >    add instance variable v in C;
> >> >
> >> >    the name of variable v <- key; // (__known__ a/c to our assumptio=
n)
> >> >
> >> >    the type of variable v <- determine_type(value);
> >> >
> >> >  }
> >> >
> >> >  return C.class;
> >> >
> >> > }
> >> >
> >> > Naming:
> >> >
> >> > --change everything into CamelCase (i.e. remove dashes, etc.)
> >> >
> >> > --for instance variables, use =E2=80=9Cmy=E2=80=9D prefix, (e.g. myV=
ariable,
> >> myNetworkMap,
> >> > etc.)
> >> >
> >> > --for the custom class name, if the object is an element of the arra=
y,
> >> use
> >> > =E2=80=9CElement=E2=80=9D suffix.
> >> >
> >> > This is just one convention so that the next step proceeds smoothly.
> As
> >> > long as this naming translation is consistent with the naming stage =
in
> >> the
> >> > next step, it will work just fine.
> >> >
> >> > Example (a modified ALTO protocol network map example):
> >> >
> >> > JSON object:
> >> >
> >> > {
> >> >
> >> >  =E2=80=9Cmeta=E2=80=9D: {
> >> >
> >> >    =E2=80=9Cresource-id=E2=80=9D: =E2=80=9Cmy-default-map=E2=80=9D,
> >> >
> >> >    =E2=80=9Ctag=E2=80=9D: =E2=80=9Caab875ef69c87d012=E2=80=9D
> >> >
> >> >  },
> >> >
> >> >  =E2=80=9Cnetwork-map=E2=80=9D: [
> >> >
> >> >    {
> >> >
> >> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,
> >> >
> >> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =E2=80=9CPID2=
=E2=80=9D, =E2=80=9CPID3=E2=80=9D]
> >> >
> >> >    },
> >> >
> >> >    {
> >> >
> >> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,
> >> >
> >> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =E2=80=9CPID3=
=E2=80=9D]
> >> >
> >> >    },
> >> >
> >> >    {
> >> >
> >> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID3=E2=80=9D,
> >> >
> >> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=
=E2=80=9D]
> >> >
> >> >    }
> >> >
> >> >  ]
> >> >
> >> > }
> >> >
> >> > Result of build_parser_class(obj):
> >> >
> >> > Class JSONObject {
> >> >
> >> >  Meta myMeta;
> >> >
> >> >  ArrayList<NetworkMapElement> myNetworkMap;
> >> >
> >> > }
> >> >
> >> > Class Meta {
> >> >
> >> >  String myResourceId;
> >> >
> >> >  String myTag;
> >> >
> >> > }
> >> >
> >> > Class NetworkMapElement {
> >> >
> >> >  String mySrc;
> >> >
> >> >  ArrayList<String> myDsts;
> >> >
> >> > }
> >> >
> >> > Now given the Jackson Parser Java Class, to get a syntactically
> >> equivalent
> >> > YANG model:
> >> >
> >> > YANGModel build_yang_model(Class C) {
> >> >
> >> >  for each instance variable (Type, Name) {
> >> >
> >> >    if (Type is primitive type: string, number, boolean, null) {
> >> >
> >> >      add the following to the YANG module:
> >> >
> >> >      =E2=80=9Cleaf Name { type <YANG equivalent of Type>; }=E2=80=9D
> >> >
> >> >    }
> >> >
> >> >    if (Type is an ArrayList<TypeElement>) {
> >> >
> >> >      if (TypeElement is primitive type) {
> >> >
> >> >        add the following to the YANG module:
> >> >
> >> >        =E2=80=9Cleaf-list Name { type <YANG equivalent of TypeElemen=
t>; }=E2=80=9D
> >> >
> >> >      } else {
> >> >
> >> >        // TypeElement is a custom parser class
> >> >
> >> >        add the following to the YANG module:
> >> >
> >> >        =E2=80=9Clist Name { <result from build_yang_model<TypeElemen=
t.class>>
> }=E2=80=9D
> >> >
> >> >      }
> >> >
> >> >    }
> >> >
> >> >    if (Type is a custom parser class) {
> >> >
> >> >      add the following to the YANG module:
> >> >
> >> >      =E2=80=9Ccontainer Name { <result from build_yang_model<Type.cl=
ass>> }=E2=80=9D
> >> >
> >> >    }
> >> >
> >> >  }
> >> >
> >> > }
> >> >
> >> > Result from the previous example:
> >> >
> >> > container meta {
> >> >
> >> >  leaf resource-id {
> >> >
> >> >    type string;
> >> >
> >> >  }
> >> >
> >> >  leaf tag {
> >> >
> >> >    type string;
> >> >
> >> >  }
> >> >
> >> > }
> >> >
> >> > list network-map {
> >> >
> >> >  leaf src {
> >> >
> >> >    type string;
> >> >
> >> >  }
> >> >
> >> >  leaf-list dsts {
> >> >
> >> >    type string;
> >> >
> >> >  }
> >> >
> >> > }
> >> >
> >> > This does validate the JSON document with XML-JSON encoding. For you=
r
> >> > reference, this is the XML document which validates:
> >> >
> >> > <?xml version=3D"1.0" encoding=3D"UTF-8" ?>
> >> >
> >> > <meta>
> >> >
> >> >  <resource-id>my-default-map</resource-id>
> >> >
> >> >  <tag>aab875ef69c87d012</tag>
> >> >
> >> > </meta>
> >> >
> >> > <network-map>
> >> >
> >> >  <src>PID1</src>
> >> >
> >> >  <dsts>PID1</dsts>
> >> >
> >> >  <dsts>PID2</dsts>
> >> >
> >> >  <dsts>PID3</dsts>
> >> >
> >> > </network-map>
> >> >
> >> > <network-map>
> >> >
> >> >  <src>PID2</src>
> >> >
> >> >  <dsts>PID1</dsts>
> >> >
> >> >  <dsts>PID3</dsts>
> >> >
> >> > </network-map>
> >> >
> >> > <network-map>
> >> >
> >> >  <src>PID3</src>
> >> >
> >> >  <dsts>PID2</dsts>
> >> >
> >> >  <dsts>PID3</dsts>
> >> >
> >> > </network-map>
> >> >
> >> > This proves that the message encoding condition is a sufficient
> condition
> >> > for the JSON object to have a YANG model.
> >> >
> >> > Note the model generated is very crude and lose almost all constrain=
ts
> >> and
> >> > all inheritance features (if any), because it focuses on the syntax
> and
> >> is
> >> > essentially converted from an JSON object compliant with a protocol
> >> instead
> >> > of from the protocol itself. Hence this result is more useful in
> >> > determining which JSON based protocols cannot have a syntactically
> >> > equivalent YANG model, than in generating a good YANG model.
> >> >
> >> > 3.3. Conclusion
> >> >
> >> > Our claim holds. A JSON based protocol carried by HTTP can have
> >> > syntactically equivalent YANG model, if and only if all the keys in
> the
> >> > key-value pairs in the JSON message are pre-defined keywords.
> >> >
> >> > 4. Semantic equivalence
> >> >
> >> > For JSON based protocols that don=E2=80=99t satisfy the message enco=
ding
> >> condition,
> >> > it is still possible to have a semantically equivalent YANG model. A=
ll
> >> that
> >> > is required for the protocol compliant clients and the YANG model
> >> compliant
> >> > server to interoperate is an adapter which does the following:
> >> >
> >> > 1) translate FROM YANG server compliant response msg TO alto complia=
nt
> >> > response msg
> >> >
> >> > 2) translate FROM alto compliant request msg TO YANG server complian=
t
> >> > request msg
> >> >
> >> > 4.1. Claim
> >> >
> >> > This adapter needs to be protocol-aware.
> >> >
> >> > Ideally, given any YANG model, we would like to be able to
> automatically
> >> > (or at least mechanically) generate this message adapter, which mean=
s
> not
> >> > looking at the protocol or its compliant msgs. However, without
> knowing
> >> the
> >> > specific protocol that we are working with (i.e. human intervention,
> i.e.
> >> > looking at the protocol compliant msgs), such an adapter cannot be
> >> > auto-generated.
> >> >
> >> > 4.2. Proof by Indistinguishability
> >> >
> >> > Suppose both the YANG server compliant msg m_y and the actually
> protocol
> >> > compliant msg m_p are in JSON (or have been encoded into JSON).
> Looking
> >> at
> >> > the differences between the two messages, call these differences {d1=
,
> d2,
> >> > ..., dn}. The goal for the auto-generated adapter would be to identi=
fy
> >> and
> >> > eliminate these differences. Construct a new JSON msg m' where all b=
ut
> >> one
> >> > difference di is the same as m_p and di is the same as the m_y.
> Without
> >> > looking at the protocol (or m_p), the auto-generated adapter would
> not be
> >> > able to distinguish between m' and m_p in its translation process,
> which
> >> > means, it won't be able to tell whether it should change di or not.
> >> Hence,
> >> > such an adapter must be protocol-aware.
> >> >
> >> > A good example is the dependent-vtag in the ALTO protocol:
> >> >
> >> > "dependent-vtag" : [
> >> >
> >> >  {
> >> >
> >> >    "resource-id" : "my-network-map",
> >> >
> >> >    "tag" : "abcd1234"
> >> >
> >> >  }
> >> >
> >> > ]
> >> >
> >> > It was specified this way in the alto protocol. However, it could
> >> > conceivably be the case that it was originally the following map
> >> structure,
> >> > and was converted into the above encoding because of the map->list+k=
ey
> >> > issue. (This case is actually one of the few differences in the m_y
> and
> >> m_p
> >> > where the adapter does not need to convert it back to a map
> structure.)
> >> >
> >> > "dependent-vtag" : {
> >> >
> >> >  "my-network-map" : {
> >> >
> >> >    "tag" : "abcd1234"
> >> >
> >> >  }
> >> >
> >> > }
> >> >
> >> > Without knowing the protocol, there is no way to tell.
> >> >
> >> > 5. Ramifications
> >> >
> >> > We now understand the basic condition for a JSON based protocol to
> have a
> >> > YANG Model. For the protocols that don=E2=80=99t meet this condition=
, there
> can
> >> be
> >> > a semantic equivalent YANG model, but there won=E2=80=99t be a gener=
ic
> process of
> >> > generating the adapter for all such protocols.
> >> > _______________________________________________
> >> > netmod mailing list
> >> > netmod@ietf.org
> >> > https://www.ietf.org/mailman/listinfo/netmod
> >>
> >> --
> >> Ladislav Lhotka, CZ.NIC Labs
> >> PGP Key ID: E74E8C0C
> >>
>
> --
> Ladislav Lhotka, CZ.NIC Labs
> PGP Key ID: E74E8C0C
>

--089e0160befa39db590505e59adc
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Lada,<div><br></div><div>I agree with your statement th=
at YANG is designed to model datastore and the protocol messages.</div><div=
><br></div><div>Right now the question I am trying to answer is this scenar=
io: we have the protocols (hence the protocol messages) first, and would li=
ke to know whether we would be able to use YANG to model the content messag=
es (in order to use the YANG tools for this protocol, etc.). And the questi=
on is what are the conditions for JSON msgs to be able to be modeled by YAN=
G.=C2=A0</div><div><br></div><div>For JSON arrays:</div><div>0. a standalon=
e non-object JSON value is not model-able in YANG:</div><div>examples:</div=
><div>--&quot;foo&quot;</div><div>--14</div><div>--[1,2,3]</div><div>which =
translates to the following in XML:</div><div><div>&lt;0&gt;1&lt;/0&gt;</di=
v><div>&lt;1&gt;2&lt;/1&gt;</div><div>&lt;2&gt;3&lt;/2&gt;</div></div><div>=
<br></div><div>This is why your example &quot;foo&quot;: [ { &quot;bar&quot=
;: 1 }, 2 ] cannot be modeled--because 2 is a standalone value and {&quot;b=
ar&quot;: 1} is an object, otherwise there are following ways to model an a=
rray with a mix of elements:</div><div><br></div><div>1. an array with only=
 built-in types or derived types (standalone JSON values except for arrays =
and objects) can be modeled in YANG as the following:</div><div>&quot;foo&q=
uot; : [1, &quot;abc&quot;, enum1]</div><div><br></div><div>leaf-list foo {=
</div><div>=C2=A0 type union {<br></div><div>=C2=A0 =C2=A0 type int64;</div=
><div>=C2=A0 =C2=A0 type string;</div><div>=C2=A0 =C2=A0 type enumeration {=
</div><div>=C2=A0 =C2=A0 =C2=A0 enum enum1;</div><div>=C2=A0 =C2=A0 }</div>=
<div>=C2=A0 }</div><div>}</div><div><br></div><div>2. an array of all objec=
ts</div><div>(1) This structure is model-able as well, right?</div><div>&qu=
ot;foo&quot;: [{&quot;a&quot;: 1}, {&quot;a&quot;: 1, &quot;b&quot;: 2}]</d=
iv><div><br></div><div>list foo {</div><div>=C2=A0 leaf a {</div><div>=C2=
=A0 =C2=A0 type int;</div><div>=C2=A0 }</div><div>=C2=A0 leaf b {</div><div=
>=C2=A0 =C2=A0 type int;</div><div>=C2=A0 }</div><div>}</div><div><br></div=
><div>(2) how about this?</div><div><div>&quot;foo&quot;: [{&quot;a&quot;: =
1, &quot;b&quot;: 2, &quot;c&quot;: 3}, {&quot;c&quot;: 1, &quot;b&quot;:3,=
 &quot;y&quot;: 2}]</div><div><br></div><div>If the JSON-XML translate it t=
o the following:</div></div><div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;foo&g=
t;</div><div><span class=3D"" style=3D"white-space:pre">		</span>&lt;a&gt;1=
&lt;/a&gt;</div><div><span class=3D"" style=3D"white-space:pre">		</span>&l=
t;b&gt;2&lt;/b&gt;</div><div><span class=3D"" style=3D"white-space:pre">		<=
/span>&lt;c&gt;3&lt;/c&gt;</div><div><span class=3D"" style=3D"white-space:=
pre">	</span>&lt;/foo&gt;</div><div><span class=3D"" style=3D"white-space:p=
re">	</span>&lt;foo&gt;</div><div><span class=3D"" style=3D"white-space:pre=
">		</span>&lt;c&gt;1&lt;/c&gt;</div><div><span class=3D"" style=3D"white-s=
pace:pre">		</span>&lt;b&gt;3&lt;/b&gt;</div><div><span class=3D"" style=3D=
"white-space:pre">		</span>&lt;y&gt;2&lt;/y&gt;</div><div><span class=3D"" =
style=3D"white-space:pre">	</span>&lt;/foo&gt;</div></div><div>We can still=
 model this using the choice statement, right?</div><div><br></div><div>If =
the above statements about whether these JSON texts are model-able are corr=
ect, essentially the only JSON arrays that are not model-able are (a) those=
 mixed with objects and a standalone non-object JSON value; and (b) those w=
hose elements is an array. And this gap is caused by the difference between=
 leaf-list modeling capabilities of handling arrays with non-object, non-ar=
ray, standalone JSON values, and the list+choice modeling capabilities of m=
odeling arrays with objects. Does this sound plausible?</div><div><br></div=
><div>Cheers,</div><div>Xiao</div></div><div class=3D"gmail_extra"><br><div=
 class=3D"gmail_quote">On Mon, Oct 20, 2014 at 11:56 AM, Ladislav Lhotka <s=
pan dir=3D"ltr">&lt;<a href=3D"mailto:lhotka@nic.cz" target=3D"_blank">lhot=
ka@nic.cz</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span cl=
ass=3D"">Xiao SHI &lt;<a href=3D"mailto:xiao.shi@yale.edu">xiao.shi@yale.ed=
u</a>&gt; writes:<br>
<br>
&gt; Hi Lada,<br>
&gt;<br>
&gt; Thank you so much for your feedback!<br>
&gt;<br>
&gt; The motivation here is to produce a YANG model given a defined protoco=
l,<br>
&gt; e.g. ALTO, CDNi, etc. This way, we may incorporate future protocols in=
to<br>
&gt; ODL controllers or use other YANG related tools to handle those protoc=
ols.<br>
&gt; Hence the objective of the modeling is the protocol, not the messages.=
 I am<br>
&gt; not suggesting to use YANG as a schema language.<br>
<br>
</span>Hmm, YANG was designed for modelling datastores and contents of prot=
ocol<br>
messages, not protocols as such.<br>
<span class=3D""><br>
&gt;<br>
&gt; The conditions discussed in this process will be helpful in the follow=
ing<br>
&gt; sense:<br>
&gt; 1) disprove the possibility to get a syntactically equivalent YANG mod=
el<br>
&gt; from a JSON based protocol;<br>
&gt; 2) generate a Jackson JSON parser class and YANG model from the protoc=
ols<br>
&gt; that meet the criteria;<br>
&gt; 3) for designers of future protocols who are thinking of using YANG re=
lated<br>
&gt; tools, set a guideline of what their messages should look like (or MUS=
T not<br>
&gt; contain);<br>
&gt; 4) for the YANG/NETCONF WG, describing the compatibility issues that t=
hey<br>
&gt; might be interested in tackling for expanding YANG&#39;s usage.<br>
&gt;<br>
&gt; For this example, &quot;foo&quot;: [ { &quot;bar&quot;: 1 }, 2 ] is al=
so not easy to do<br>
&gt; data-binding in the parser, because the elements of the array are not =
of<br>
&gt; the same type, which is indeed an assumption that I left out.<br>
&gt;<br>
&gt; For the {&quot;foo=E2=80=9D:null} example, can&#39;t we model it using=
 type empty? That&#39;s<br>
&gt; equivalent to the XML element &lt;foo /&gt; right?<br>
<br>
</span>&lt;foo/&gt; corresponds to<br>
<br>
&quot;foo&quot;: [null]<br>
<br>
Section 6.9 in draft-ietf-netmod-yang-json-01 gives the reasoning,<br>
essentially it is because some software isn&#39;t able to distinguish<br>
<br>
&quot;foo&quot;: null<br>
<br>
from &quot;foo&quot; being absent.<br>
<br>
Lada<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br>
&gt;<br>
&gt; Cheers,<br>
&gt; Xiao<br>
&gt;<br>
&gt; On Mon, Oct 20, 2014 at 9:23 AM, Ladislav Lhotka &lt;<a href=3D"mailto=
:lhotka@nic.cz">lhotka@nic.cz</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Xiao SHI &lt;<a href=3D"mailto:xiao.shi@yale.edu">xiao.shi@yale.ed=
u</a>&gt; writes:<br>
&gt;&gt;<br>
&gt;&gt; &gt; Hi folks,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; As a few of us were working on modeling the ALTO protocol usi=
ng YANG, we<br>
&gt;&gt; &gt; were pondering on a more general question: can YANG model all=
 JSON based<br>
&gt;&gt; &gt; protocols? What is the condition for a JSON based protocol (a=
t least the<br>
&gt;&gt; &gt; message format) to have an syntactically equivalent, hence in=
teroperable,<br>
&gt;&gt; &gt; YANG model with JSON encoding? Alternatively, in order to int=
eroperate,<br>
&gt;&gt; &gt; semantic equivalence might be sufficient, is there any condit=
ion for<br>
&gt;&gt; &gt; semantic equivalence?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; tl;dr: A JSON based protocol carried by HTTP can have syntact=
ically<br>
&gt;&gt; &gt; equivalent YANG model, if and only if all the keys in the key=
-value pairs<br>
&gt;&gt; &gt; in the JSON message are pre-defined keywords in the protocol.=
<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; Generating a YANG data model from existing instance data seems bac=
kwards<br>
&gt;&gt; to me, although Examplotron (<a href=3D"http://examplotron.org" ta=
rget=3D"_blank">http://examplotron.org</a>) does something quite<br>
&gt;&gt; similar. In any case, it might be quite challenging because YANG i=
sn&#39;t<br>
&gt;&gt; intended as a general schema language. Your observation above is t=
rue<br>
&gt;&gt; but it is just one aspect of the problem. For instance<br>
&gt;&gt;<br>
&gt;&gt; &quot;foo&quot;: [ { &quot;bar&quot;: 1 }, 2 ]<br>
&gt;&gt;<br>
&gt;&gt; or<br>
&gt;&gt;<br>
&gt;&gt; &quot;foo&quot;: null<br>
&gt;&gt;<br>
&gt;&gt; cannot be modelled in YANG using the encoding of<br>
&gt;&gt; draft-ietf-netmod-yang-json.<br>
&gt;&gt;<br>
&gt;&gt; Lada<br>
&gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; We&#39;ve come up with a few ideas, and a few things below ar=
e work in<br>
&gt;&gt; &gt; progress, but we would love your feedback!<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thank you!<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Xiao<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 1. Introduction.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; JavaScript Object Notation (JSON) has been a popular choice a=
s the<br>
&gt;&gt; message<br>
&gt;&gt; &gt; encoding for many network protocols such as the Application L=
ayer Traffic<br>
&gt;&gt; &gt; Optimization (ALTO) protocol, the Content Delivery Networks<b=
r>
&gt;&gt; Interconnection<br>
&gt;&gt; &gt; (CDNi) protocol, etc.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Meanwhile, there are broad interests in the networking commun=
ity to use<br>
&gt;&gt; &gt; YANG to define data model so that one can use YANG related to=
ols such as<br>
&gt;&gt; &gt; OpenDayLight controller. Although YANG itself is XML based, t=
here have<br>
&gt;&gt; been<br>
&gt;&gt; &gt; efforts to model JSON content using YANG<br>
&gt;&gt; [draft-ietf-netmod-yang-json-01].<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; A natural question rises: can YANG model all JSON based proto=
cols? What<br>
&gt;&gt; is<br>
&gt;&gt; &gt; the condition for a JSON based protocol (at least the message=
 format) to<br>
&gt;&gt; &gt; have an syntactically equivalent, hence interoperable, YANG m=
odel with<br>
&gt;&gt; JSON<br>
&gt;&gt; &gt; encoding? Alternatively, in order to interoperate, semantic e=
quivalence<br>
&gt;&gt; &gt; might be sufficient, is there any condition for semantic equi=
valence?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 2. Claim<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; A JSON based protocol carried by HTTP can have syntactically =
equivalent<br>
&gt;&gt; &gt; YANG model, if and only if:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; (1) the message encoding condition is met;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; (2) the uri condition is met.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 2.1. The message encoding condition<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; The JSON message encoding MUST not contain a variable as a ke=
y in a JSON<br>
&gt;&gt; &gt; object key-value pair. In other words, the keys in the JSON m=
essage must<br>
&gt;&gt; be<br>
&gt;&gt; &gt; an already defined constant (or keyword) in the message forma=
t of the<br>
&gt;&gt; &gt; protocol.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; For example, if I have a protocol where =E2=80=9Cnetwork-map=
=E2=80=9D, =E2=80=9Csrc=E2=80=9D, and =E2=80=9Cdsts=E2=80=9D<br>
&gt;&gt; &gt; are defined keywords, JSON text A meets the condition whereas=
 B does not<br>
&gt;&gt; &gt; because =E2=80=9CPID1=E2=80=9D and =E2=80=9CPID2=E2=80=9D are=
 not protocol keywords (they are resource<br>
&gt;&gt; IDs).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; A:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =E2=80=9Cnetwork-map=E2=80=9D: [<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=
=80=9D,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=
=80=9D, =E2=80=9CPID3=E2=80=9D]<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 },<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=
=80=9D,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID3=E2=
=80=9D, =E2=80=9CPID4=E2=80=9D]<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 ]<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; B:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =E2=80=9Cnetwork-map=E2=80=9D: [<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =E2=80=9CPID1: [=E2=80=9CPID2=E2=80=9D, =E2=80=
=9CPID3=E2=80=9D],<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =E2=80=9CPID2=E2=80=9D: [=E2=80=9CPID3=E2=80=9D,=
 =E2=80=9CPID4=E2=80=9D]<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 ]<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;From this we know that since ALTO protocol uses encoding B=
, there cannot<br>
&gt;&gt; be<br>
&gt;&gt; &gt; a syntactically equivalent YANG model.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 2.2 The URI condition<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Some of the YANG-related protocols might have URI constraints=
, e.g.<br>
&gt;&gt; &gt; RESTCONF. For now, we assume either that the JSON-based proto=
col URI<br>
&gt;&gt; could<br>
&gt;&gt; &gt; be conformed to RESTCONF compliant uri, or that the server co=
uld have a<br>
&gt;&gt; &gt; routing mapping between the protocol compliant uri and the RE=
STCONF<br>
&gt;&gt; &gt; compliant uri, hence this condition would not be an issue, wh=
ich allows<br>
&gt;&gt; us<br>
&gt;&gt; &gt; to focus on the message encoding condition.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 3. Proof<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 3.1. The message encoding condition is necessary.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; We first note that this condition is a necessary condition fo=
r a JSON<br>
&gt;&gt; based<br>
&gt;&gt; &gt; protocol to have a syntactically equivalent YANG model by pro=
ving its<br>
&gt;&gt; &gt; contrapositive.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; If one of the keys in the key-value pair in the JSON document=
 is not<br>
&gt;&gt; &gt; pre-defined, the corresponding XML tags will not be pre-defin=
ed keywords.<br>
&gt;&gt; &gt; Therefore, it would not possible to model it in YANG without =
using<br>
&gt;&gt; &gt; YANG=E2=80=99s anyxml<br>
&gt;&gt; &gt; statement (which allows arbitrary XML content).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; However, using the anyxml statement would defeat our purpose =
of modeling<br>
&gt;&gt; &gt; the data as it allows arbitrary XML content, and will not be =
helpful in<br>
&gt;&gt; the<br>
&gt;&gt; &gt; subsequent parsing process.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 3.2. The message encoding condition is sufficient.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; We prove this by providing a translation procedure from a JSO=
N message<br>
&gt;&gt; that<br>
&gt;&gt; &gt; is compliant with the protocol we are trying to model, to a c=
ustom java<br>
&gt;&gt; &gt; class that can be used for Jackson data binding, then to a YA=
NG model.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; We note that the middle step of translating to and from the c=
ustom parser<br>
&gt;&gt; &gt; class is not necessary, but it will be useful.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 3.2.1. motivation<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; JSON data binding is the process of binding data structures (=
objects,<br>
&gt;&gt; &gt; arrays, etc.) in JSON to the appropriate data structures in t=
he server<br>
&gt;&gt; &gt; (e.g. java classes, database tables, etc.) in parsing the JSO=
N text. In<br>
&gt;&gt; &gt; order to process JSON messages in a meaningful manner, data b=
inding is<br>
&gt;&gt; &gt; necessary. Even if the binding is not explicit, the server wo=
uld need to<br>
&gt;&gt; do<br>
&gt;&gt; &gt; it eventually. For example, one can read JSON content in a st=
ream without<br>
&gt;&gt; &gt; binding it to the java classes, but eventually in order to ma=
ke sense of<br>
&gt;&gt; &gt; the data, the server would eventually have to organize it, wh=
ich is<br>
&gt;&gt; roughly<br>
&gt;&gt; &gt; analogous to data binding upfront. Popular choices for JSON p=
arsing and<br>
&gt;&gt; &gt; data binding include jackson and gson.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; We use Jackson full data binding as our approach. Full data b=
inding binds<br>
&gt;&gt; &gt; JSON content into plain old java objects (POJOs), i.e. this c=
ustom parser<br>
&gt;&gt; &gt; class can neither extend nor implement any other class. Jacks=
on uses<br>
&gt;&gt; &gt; ObjectMapper with the custom parser class to parse JSON conte=
nt into this<br>
&gt;&gt; &gt; class.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 3.2.2. The message encoding condition<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; The message encoding condition is that all keys in each key-v=
alue pair in<br>
&gt;&gt; &gt; the JSON text must be pre-defined keywords. As the keys will =
become<br>
&gt;&gt; either<br>
&gt;&gt; &gt; class names and instance variable names, or be keys in the ja=
va maps, it<br>
&gt;&gt; is<br>
&gt;&gt; &gt; easy to see that the condition is equivalent to =E2=80=9Cther=
e exists a full data<br>
&gt;&gt; &gt; binding in Jackson custom parser class without using any map =
structures<br>
&gt;&gt; &gt; (Map&lt;String, ?&gt;).=E2=80=9D<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 3.2.3. Proof<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; We provide a recursive binding process from a JSON object to =
the Jackson<br>
&gt;&gt; &gt; custom parser class to be used by Jackson ObjectMapper.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Type determine_type(value) {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 if (value is of a primitive type, i.e. string, number, =
boolean, null) {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 return the corresponding java primitive type;<br=
>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 if (value is a JSON object) {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 return build_parser_class(value).class;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 if (value is an array) {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 return ArrayList&lt;T&gt; where T=3Ddetermine_ty=
pe(value[0]);<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 // should not reach here.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Class build_parser_class(JSONObject obj) {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 create custom class C;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 for each key/value pair in the obj {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 add instance variable v in C;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 the name of variable v &lt;- key; // (__known__ =
a/c to our assumption)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 the type of variable v &lt;- determine_type(valu=
e);<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 return C.class;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Naming:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --change everything into CamelCase (i.e. remove dashes, etc.)=
<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --for instance variables, use =E2=80=9Cmy=E2=80=9D prefix, (e=
.g. myVariable,<br>
&gt;&gt; myNetworkMap,<br>
&gt;&gt; &gt; etc.)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --for the custom class name, if the object is an element of t=
he array,<br>
&gt;&gt; use<br>
&gt;&gt; &gt; =E2=80=9CElement=E2=80=9D suffix.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; This is just one convention so that the next step proceeds sm=
oothly. As<br>
&gt;&gt; &gt; long as this naming translation is consistent with the naming=
 stage in<br>
&gt;&gt; the<br>
&gt;&gt; &gt; next step, it will work just fine.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Example (a modified ALTO protocol network map example):<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; JSON object:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =E2=80=9Cmeta=E2=80=9D: {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =E2=80=9Cresource-id=E2=80=9D: =E2=80=9Cmy-defau=
lt-map=E2=80=9D,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =E2=80=9Ctag=E2=80=9D: =E2=80=9Caab875ef69c87d01=
2=E2=80=9D<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 },<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =E2=80=9Cnetwork-map=E2=80=9D: [<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=
=80=9D,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=
=80=9D, =E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=9D]<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 },<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=
=80=9D,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=
=80=9D, =E2=80=9CPID3=E2=80=9D]<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 },<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID3=E2=
=80=9D,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=
=80=9D, =E2=80=9CPID3=E2=80=9D]<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 ]<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Result of build_parser_class(obj):<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Class JSONObject {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 Meta myMeta;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 ArrayList&lt;NetworkMapElement&gt; myNetworkMap;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Class Meta {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 String myResourceId;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 String myTag;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Class NetworkMapElement {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 String mySrc;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 ArrayList&lt;String&gt; myDsts;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Now given the Jackson Parser Java Class, to get a syntactical=
ly<br>
&gt;&gt; equivalent<br>
&gt;&gt; &gt; YANG model:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; YANGModel build_yang_model(Class C) {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 for each instance variable (Type, Name) {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 if (Type is primitive type: string, number, bool=
ean, null) {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 add the following to the YANG module:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Cleaf Name { type &lt;YANG equiva=
lent of Type&gt;; }=E2=80=9D<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 if (Type is an ArrayList&lt;TypeElement&gt;) {<b=
r>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 if (TypeElement is primitive type) {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 add the following to the YANG modu=
le:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =E2=80=9Cleaf-list Name { type &lt=
;YANG equivalent of TypeElement&gt;; }=E2=80=9D<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 } else {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 // TypeElement is a custom parser =
class<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 add the following to the YANG modu=
le:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =E2=80=9Clist Name { &lt;result fr=
om build_yang_model&lt;TypeElement.class&gt;&gt; }=E2=80=9D<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 if (Type is a custom parser class) {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 add the following to the YANG module:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =E2=80=9Ccontainer Name { &lt;result from=
 build_yang_model&lt;Type.class&gt;&gt; }=E2=80=9D<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Result from the previous example:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; container meta {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 leaf resource-id {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 type string;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 leaf tag {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 type string;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; list network-map {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 leaf src {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 type string;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 leaf-list dsts {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 type string;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; This does validate the JSON document with XML-JSON encoding. =
For your<br>
&gt;&gt; &gt; reference, this is the XML document which validates:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &lt;?xml version=3D&quot;1.0&quot; encoding=3D&quot;UTF-8&quo=
t; ?&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &lt;meta&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 &lt;resource-id&gt;my-default-map&lt;/resource-id&gt;<b=
r>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 &lt;tag&gt;aab875ef69c87d012&lt;/tag&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &lt;/meta&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &lt;network-map&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 &lt;src&gt;PID1&lt;/src&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 &lt;dsts&gt;PID1&lt;/dsts&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 &lt;dsts&gt;PID2&lt;/dsts&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &lt;/network-map&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &lt;network-map&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 &lt;src&gt;PID2&lt;/src&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 &lt;dsts&gt;PID1&lt;/dsts&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &lt;/network-map&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &lt;network-map&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 &lt;src&gt;PID3&lt;/src&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 &lt;dsts&gt;PID2&lt;/dsts&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &lt;/network-map&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; This proves that the message encoding condition is a sufficie=
nt condition<br>
&gt;&gt; &gt; for the JSON object to have a YANG model.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Note the model generated is very crude and lose almost all co=
nstraints<br>
&gt;&gt; and<br>
&gt;&gt; &gt; all inheritance features (if any), because it focuses on the =
syntax and<br>
&gt;&gt; is<br>
&gt;&gt; &gt; essentially converted from an JSON object compliant with a pr=
otocol<br>
&gt;&gt; instead<br>
&gt;&gt; &gt; of from the protocol itself. Hence this result is more useful=
 in<br>
&gt;&gt; &gt; determining which JSON based protocols cannot have a syntacti=
cally<br>
&gt;&gt; &gt; equivalent YANG model, than in generating a good YANG model.<=
br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 3.3. Conclusion<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Our claim holds. A JSON based protocol carried by HTTP can ha=
ve<br>
&gt;&gt; &gt; syntactically equivalent YANG model, if and only if all the k=
eys in the<br>
&gt;&gt; &gt; key-value pairs in the JSON message are pre-defined keywords.=
<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 4. Semantic equivalence<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; For JSON based protocols that don=E2=80=99t satisfy the messa=
ge encoding<br>
&gt;&gt; condition,<br>
&gt;&gt; &gt; it is still possible to have a semantically equivalent YANG m=
odel. All<br>
&gt;&gt; that<br>
&gt;&gt; &gt; is required for the protocol compliant clients and the YANG m=
odel<br>
&gt;&gt; compliant<br>
&gt;&gt; &gt; server to interoperate is an adapter which does the following=
:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 1) translate FROM YANG server compliant response msg TO alto =
compliant<br>
&gt;&gt; &gt; response msg<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 2) translate FROM alto compliant request msg TO YANG server c=
ompliant<br>
&gt;&gt; &gt; request msg<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 4.1. Claim<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; This adapter needs to be protocol-aware.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Ideally, given any YANG model, we would like to be able to au=
tomatically<br>
&gt;&gt; &gt; (or at least mechanically) generate this message adapter, whi=
ch means not<br>
&gt;&gt; &gt; looking at the protocol or its compliant msgs. However, witho=
ut knowing<br>
&gt;&gt; the<br>
&gt;&gt; &gt; specific protocol that we are working with (i.e. human interv=
ention, i.e.<br>
&gt;&gt; &gt; looking at the protocol compliant msgs), such an adapter cann=
ot be<br>
&gt;&gt; &gt; auto-generated.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 4.2. Proof by Indistinguishability<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Suppose both the YANG server compliant msg m_y and the actual=
ly protocol<br>
&gt;&gt; &gt; compliant msg m_p are in JSON (or have been encoded into JSON=
). Looking<br>
&gt;&gt; at<br>
&gt;&gt; &gt; the differences between the two messages, call these differen=
ces {d1, d2,<br>
&gt;&gt; &gt; ..., dn}. The goal for the auto-generated adapter would be to=
 identify<br>
&gt;&gt; and<br>
&gt;&gt; &gt; eliminate these differences. Construct a new JSON msg m&#39; =
where all but<br>
&gt;&gt; one<br>
&gt;&gt; &gt; difference di is the same as m_p and di is the same as the m_=
y. Without<br>
&gt;&gt; &gt; looking at the protocol (or m_p), the auto-generated adapter =
would not be<br>
&gt;&gt; &gt; able to distinguish between m&#39; and m_p in its translation=
 process, which<br>
&gt;&gt; &gt; means, it won&#39;t be able to tell whether it should change =
di or not.<br>
&gt;&gt; Hence,<br>
&gt;&gt; &gt; such an adapter must be protocol-aware.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; A good example is the dependent-vtag in the ALTO protocol:<br=
>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &quot;dependent-vtag&quot; : [<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 &quot;resource-id&quot; : &quot;my-network-map&q=
uot;,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 &quot;tag&quot; : &quot;abcd1234&quot;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ]<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; It was specified this way in the alto protocol. However, it c=
ould<br>
&gt;&gt; &gt; conceivably be the case that it was originally the following =
map<br>
&gt;&gt; structure,<br>
&gt;&gt; &gt; and was converted into the above encoding because of the map-=
&gt;list+key<br>
&gt;&gt; &gt; issue. (This case is actually one of the few differences in t=
he m_y and<br>
&gt;&gt; m_p<br>
&gt;&gt; &gt; where the adapter does not need to convert it back to a map s=
tructure.)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &quot;dependent-vtag&quot; : {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 &quot;my-network-map&quot; : {<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 =C2=A0 &quot;tag&quot; : &quot;abcd1234&quot;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;=C2=A0 }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Without knowing the protocol, there is no way to tell.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 5. Ramifications<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; We now understand the basic condition for a JSON based protoc=
ol to have a<br>
&gt;&gt; &gt; YANG Model. For the protocols that don=E2=80=99t meet this co=
ndition, there can<br>
&gt;&gt; be<br>
&gt;&gt; &gt; a semantic equivalent YANG model, but there won=E2=80=99t be =
a generic process of<br>
&gt;&gt; &gt; generating the adapter for all such protocols.<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; netmod mailing list<br>
&gt;&gt; &gt; <a href=3D"mailto:netmod@ietf.org">netmod@ietf.org</a><br>
&gt;&gt; &gt; <a href=3D"https://www.ietf.org/mailman/listinfo/netmod" targ=
et=3D"_blank">https://www.ietf.org/mailman/listinfo/netmod</a><br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Ladislav Lhotka, CZ.NIC Labs<br>
&gt;&gt; PGP Key ID: E74E8C0C<br>
&gt;&gt;<br>
<br>
--<br>
Ladislav Lhotka, CZ.NIC Labs<br>
PGP Key ID: E74E8C0C<br>
</div></div></blockquote></div><br></div>

--089e0160befa39db590505e59adc--


From nobody Tue Oct 21 08:04:46 2014
Return-Path: <j.schoenwaelder@jacobs-university.de>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DB14E1AD05F; Mon, 20 Oct 2014 23:00:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.56
X-Spam-Level: 
X-Spam-Status: No, score=-1.56 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, T_RP_MATCHES_RCVD=-0.01] 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 SLoLO6em7xZ6; Mon, 20 Oct 2014 23:00:51 -0700 (PDT)
Received: from atlas3.jacobs-university.de (atlas3.jacobs-university.de [212.201.44.18]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DB5AD1A6F9C; Mon, 20 Oct 2014 23:00:50 -0700 (PDT)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas3.jacobs-university.de (Postfix) with ESMTP id 3F1D26F7; Tue, 21 Oct 2014 08:00:49 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas3.jacobs-university.de ([10.70.0.220]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10030) with ESMTP id wVB_nvcgizX0; Tue, 21 Oct 2014 08:00:48 +0200 (CEST)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "Jacobs University CA - G01" (verified OK)) by atlas3.jacobs-university.de (Postfix) with ESMTPS; Tue, 21 Oct 2014 08:00:48 +0200 (CEST)
Received: from localhost (demetrius3.jacobs-university.de [212.201.44.48]) by hermes.jacobs-university.de (Postfix) with ESMTP id 46EDD20037; Tue, 21 Oct 2014 08:00:48 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius3.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id U-349RVMiqCR; Tue, 21 Oct 2014 08:00:47 +0200 (CEST)
Received: from elstar.local (elstar.jacobs.jacobs-university.de [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id 775B220038; Tue, 21 Oct 2014 08:00:46 +0200 (CEST)
Received: by elstar.local (Postfix, from userid 501) id 64ED92F0641A; Tue, 21 Oct 2014 08:00:46 +0200 (CEST)
Date: Tue, 21 Oct 2014 08:00:46 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Xiao SHI <xiao.shi@yale.edu>
Message-ID: <20141021060046.GB89879@elstar.local>
Mail-Followup-To: Xiao SHI <xiao.shi@yale.edu>, Ladislav Lhotka <lhotka@nic.cz>, IETF ALTO <alto@ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
References: <CAFwJzZkAp-4umrrHZEY3qYuFCXu=+Pqbh8SeB=Qr=TTbQurj6A@mail.gmail.com> <m2tx2ynadg.fsf@nic.cz> <CAFwJzZ=kv7_W=mrJz77Y1DTkL_Cq-o+B-FDJERy-8g-OCVbj5g@mail.gmail.com> <m2k33uag60.fsf@nic.cz> <CAFwJzZ=HVnXBUgQP9eNc2NZ=vZ+W6=NyqqVbyxyHn5wipxCUUg@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CAFwJzZ=HVnXBUgQP9eNc2NZ=vZ+W6=NyqqVbyxyHn5wipxCUUg@mail.gmail.com>
User-Agent: Mutt/1.4.2.3i
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/JHbQkHh_hwoOnD1ZxY97VPAiFRE
X-Mailman-Approved-At: Tue, 21 Oct 2014 08:04:26 -0700
Cc: Ladislav Lhotka <lhotka@nic.cz>, "netmod@ietf.org" <netmod@ietf.org>, IETF ALTO <alto@ietf.org>
Subject: Re: [alto] [netmod] Modeling JSON based protocols using YANG
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 21 Oct 2014 06:00:53 -0000

On Mon, Oct 20, 2014 at 10:29:16PM -0400, Xiao SHI wrote:
> Hi Lada,
> 
> I agree with your statement that YANG is designed to model datastore and
> the protocol messages.
> 

YANG was designed to model datastores. It was _not_ designed to model
arbtirary protocol messages. Here is the abstract of RFC 6020:

   YANG is a data modeling language used to model configuration and
   state data manipulated by the Network Configuration Protocol
   (NETCONF), NETCONF remote procedure calls, and NETCONF notifications.

I think this describes the purpose quite clearly. I understand that
people like to expand the scope in several directions and I think it
is good if people experiment with new ideas. However, one important
goal is also to keep YANG highly useful for the original purpose it
was created for.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1, 28759 Bremen, Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>


From nobody Tue Oct 21 08:04:47 2014
Return-Path: <andy@yumaworks.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 791401A1B11 for <alto@ietfa.amsl.com>; Mon, 20 Oct 2014 08:33:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.978
X-Spam-Level: 
X-Spam-Status: No, score=-1.978 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=unavailable
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 thvHJ1IghsRU for <alto@ietfa.amsl.com>; Mon, 20 Oct 2014 08:33:11 -0700 (PDT)
Received: from mail-qc0-f181.google.com (mail-qc0-f181.google.com [209.85.216.181]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 058C91A1B58 for <alto@ietf.org>; Mon, 20 Oct 2014 08:29:02 -0700 (PDT)
Received: by mail-qc0-f181.google.com with SMTP id r5so3904553qcx.12 for <alto@ietf.org>; Mon, 20 Oct 2014 08:29:02 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=uKZUcgls/pMkYS+V3KnkR+oTA68FHzcUR2IqVvnEYyo=; b=CU+vkvx4n7bkm50PUulSUf3mofU00M/Ph1eXfpwx/aEAOHZWdU3rAXQxeealpLtEVH DJuwpCVMvC1ugsa4ddyECUEiAQqOMbGZzEKuYtuKGUTuRV+I6tx8CNpKEUGzjYLIFxow lEtGHaCRvd1Dkr18k8inrOlA8OXStpI1uBzTtg26ZHl/cFdG/6PdjJ9B4MPZ9QpFJEkM QZkni4MoLg3RiUG/zn8sZggQDyeCf9UawyWVlE/SaeuWKFkrD2lFWN/q/IKahgVVJkrL hzzXiuB4u7Nk6OJZZAfkp/IkSaYW8N8eJ5YDe1F4ZKaSDR0xgLmwAnpHLuTKVCTLx7A8 5LwQ==
X-Gm-Message-State: ALoCoQn+xI1PyMIgNx+JGmp2mwtfM+LPPqY8Owk4Ip8a7A1BFJJjQH6s2vYDa4sziMAWR0WJ9Z5T
MIME-Version: 1.0
X-Received: by 10.140.88.177 with SMTP id t46mr26420548qgd.36.1413818940469; Mon, 20 Oct 2014 08:29:00 -0700 (PDT)
Received: by 10.140.37.52 with HTTP; Mon, 20 Oct 2014 08:29:00 -0700 (PDT)
In-Reply-To: <m2tx2ynadg.fsf@nic.cz>
References: <CAFwJzZkAp-4umrrHZEY3qYuFCXu=+Pqbh8SeB=Qr=TTbQurj6A@mail.gmail.com> <m2tx2ynadg.fsf@nic.cz>
Date: Mon, 20 Oct 2014 08:29:00 -0700
Message-ID: <CABCOCHRxKWFZDue8WaHVei9FdGsBctSf8PE2C_+vCaV66A48JA@mail.gmail.com>
From: Andy Bierman <andy@yumaworks.com>
To: Ladislav Lhotka <lhotka@nic.cz>
Content-Type: multipart/alternative; boundary=001a11c13e4ab941f80505dc5f08
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/Ex5n3CIZ07kNbrS_nzTuR2XDL7U
X-Mailman-Approved-At: Tue, 21 Oct 2014 08:04:30 -0700
Cc: Xiao SHI <xiao.shi@yale.edu>, IETF ALTO <alto@ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [alto] [netmod] Modeling JSON based protocols using YANG
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Oct 2014 15:33:19 -0000

--001a11c13e4ab941f80505dc5f08
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Oct 20, 2014 at 6:23 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:

> Xiao SHI <xiao.shi@yale.edu> writes:
>
> > Hi folks,
> >
> >
> > As a few of us were working on modeling the ALTO protocol using YANG, we
> > were pondering on a more general question: can YANG model all JSON based
> > protocols? What is the condition for a JSON based protocol (at least the
> > message format) to have an syntactically equivalent, hence interoperable,
> > YANG model with JSON encoding? Alternatively, in order to interoperate,
> > semantic equivalence might be sufficient, is there any condition for
> > semantic equivalence?
> >
> >
> > tl;dr: A JSON based protocol carried by HTTP can have syntactically
> > equivalent YANG model, if and only if all the keys in the key-value pairs
> > in the JSON message are pre-defined keywords in the protocol.
> >
>
> Generating a YANG data model from existing instance data seems backwards
> to me, although Examplotron (http://examplotron.org) does something quite
> similar. In any case, it might be quite challenging because YANG isn't
> intended as a general schema language. Your observation above is true
> but it is just one aspect of the problem. For instance
>
> "foo": [ { "bar": 1 }, 2 ]
>
> or
>
> "foo": null
>
> cannot be modelled in YANG using the encoding of
> draft-ietf-netmod-yang-json.
>
>

I think perhaps RESTCONF is overloading JSON and this has led to some
confusion.
RESTCONF uses JSON strictly as an encoding format, not a data structure.
JSON is just
the message encoding. The corresponding instance document must conform to
the YANG definitions (not just be valid JSON).

A protocol should pick between YANG data structures and JSON data
structures,
and not try to do both.




> Lada
>
>
Andy


> >
> > We've come up with a few ideas, and a few things below are work in
> > progress, but we would love your feedback!
> >
> >
> > Thank you!
> >
> > Xiao
> >
> >
> > ======================
> >
> > 1. Introduction.
> >
> > JavaScript Object Notation (JSON) has been a popular choice as the
> message
> > encoding for many network protocols such as the Application Layer Traffic
> > Optimization (ALTO) protocol, the Content Delivery Networks
> Interconnection
> > (CDNi) protocol, etc.
> >
> > Meanwhile, there are broad interests in the networking community to use
> > YANG to define data model so that one can use YANG related tools such as
> > OpenDayLight controller. Although YANG itself is XML based, there have
> been
> > efforts to model JSON content using YANG
> [draft-ietf-netmod-yang-json-01].
> >
> > A natural question rises: can YANG model all JSON based protocols? What
> is
> > the condition for a JSON based protocol (at least the message format) to
> > have an syntactically equivalent, hence interoperable, YANG model with
> JSON
> > encoding? Alternatively, in order to interoperate, semantic equivalence
> > might be sufficient, is there any condition for semantic equivalence?
> >
> > 2. Claim
> >
> > A JSON based protocol carried by HTTP can have syntactically equivalent
> > YANG model, if and only if:
> >
> > (1) the message encoding condition is met;
> >
> > (2) the uri condition is met.
> >
> > 2.1. The message encoding condition
> >
> > The JSON message encoding MUST not contain a variable as a key in a JSON
> > object key-value pair. In other words, the keys in the JSON message must
> be
> > an already defined constant (or keyword) in the message format of the
> > protocol.
> >
> > For example, if I have a protocol where "network-map", "src", and "dsts"
> > are defined keywords, JSON text A meets the condition whereas B does not
> > because "PID1" and "PID2" are not protocol keywords (they are resource
> IDs).
> >
> > A:
> >
> > {
> >
> >  "network-map": [
> >
> >    {
> >
> >      "src": "PID1",
> >
> >      "dsts": ["PID2", "PID3"]
> >
> >    },
> >
> >    {
> >
> >      "src": "PID2",
> >
> >      "dsts": ["PID3", "PID4"]
> >
> >    }
> >
> >  ]
> >
> > }
> >
> > B:
> >
> >
> > {
> >
> >  "network-map": [
> >
> >    "PID1: ["PID2", "PID3"],
> >
> >    "PID2": ["PID3", "PID4"]
> >
> >  ]
> >
> > }
> >
> >>From this we know that since ALTO protocol uses encoding B, there cannot
> be
> > a syntactically equivalent YANG model.
> >
> > 2.2 The URI condition
> >
> > Some of the YANG-related protocols might have URI constraints, e.g.
> > RESTCONF. For now, we assume either that the JSON-based protocol URI
> could
> > be conformed to RESTCONF compliant uri, or that the server could have a
> > routing mapping between the protocol compliant uri and the RESTCONF
> > compliant uri, hence this condition would not be an issue, which allows
> us
> > to focus on the message encoding condition.
> >
> > 3. Proof
> >
> > 3.1. The message encoding condition is necessary.
> >
> > We first note that this condition is a necessary condition for a JSON
> based
> > protocol to have a syntactically equivalent YANG model by proving its
> > contrapositive.
> >
> > If one of the keys in the key-value pair in the JSON document is not
> > pre-defined, the corresponding XML tags will not be pre-defined keywords.
> > Therefore, it would not possible to model it in YANG without using
> > YANG's anyxml
> > statement (which allows arbitrary XML content).
> >
> > However, using the anyxml statement would defeat our purpose of modeling
> > the data as it allows arbitrary XML content, and will not be helpful in
> the
> > subsequent parsing process.
> >
> > 3.2. The message encoding condition is sufficient.
> >
> > We prove this by providing a translation procedure from a JSON message
> that
> > is compliant with the protocol we are trying to model, to a custom java
> > class that can be used for Jackson data binding, then to a YANG model.
> >
> > We note that the middle step of translating to and from the custom parser
> > class is not necessary, but it will be useful.
> >
> > 3.2.1. motivation
> >
> > JSON data binding is the process of binding data structures (objects,
> > arrays, etc.) in JSON to the appropriate data structures in the server
> > (e.g. java classes, database tables, etc.) in parsing the JSON text. In
> > order to process JSON messages in a meaningful manner, data binding is
> > necessary. Even if the binding is not explicit, the server would need to
> do
> > it eventually. For example, one can read JSON content in a stream without
> > binding it to the java classes, but eventually in order to make sense of
> > the data, the server would eventually have to organize it, which is
> roughly
> > analogous to data binding upfront. Popular choices for JSON parsing and
> > data binding include jackson and gson.
> >
> > We use Jackson full data binding as our approach. Full data binding binds
> > JSON content into plain old java objects (POJOs), i.e. this custom parser
> > class can neither extend nor implement any other class. Jackson uses
> > ObjectMapper with the custom parser class to parse JSON content into this
> > class.
> >
> > 3.2.2. The message encoding condition
> >
> > The message encoding condition is that all keys in each key-value pair in
> > the JSON text must be pre-defined keywords. As the keys will become
> either
> > class names and instance variable names, or be keys in the java maps, it
> is
> > easy to see that the condition is equivalent to "there exists a full data
> > binding in Jackson custom parser class without using any map structures
> > (Map<String, ?>)."
> >
> > 3.2.3. Proof
> >
> > We provide a recursive binding process from a JSON object to the Jackson
> > custom parser class to be used by Jackson ObjectMapper.
> >
> > Type determine_type(value) {
> >
> >  if (value is of a primitive type, i.e. string, number, boolean, null) {
> >
> >    return the corresponding java primitive type;
> >
> >  }
> >
> >  if (value is a JSON object) {
> >
> >    return build_parser_class(value).class;
> >
> >  }
> >
> >  if (value is an array) {
> >
> >    return ArrayList<T> where T=determine_type(value[0]);
> >
> >  }
> >
> >  // should not reach here.
> >
> > }
> >
> > Class build_parser_class(JSONObject obj) {
> >
> >  create custom class C;
> >
> >  for each key/value pair in the obj {
> >
> >    add instance variable v in C;
> >
> >    the name of variable v <- key; // (__known__ a/c to our assumption)
> >
> >    the type of variable v <- determine_type(value);
> >
> >  }
> >
> >  return C.class;
> >
> > }
> >
> > Naming:
> >
> > --change everything into CamelCase (i.e. remove dashes, etc.)
> >
> > --for instance variables, use "my" prefix, (e.g. myVariable,
> myNetworkMap,
> > etc.)
> >
> > --for the custom class name, if the object is an element of the array,
> use
> > "Element" suffix.
> >
> > This is just one convention so that the next step proceeds smoothly. As
> > long as this naming translation is consistent with the naming stage in
> the
> > next step, it will work just fine.
> >
> > Example (a modified ALTO protocol network map example):
> >
> > JSON object:
> >
> > {
> >
> >  "meta": {
> >
> >    "resource-id": "my-default-map",
> >
> >    "tag": "aab875ef69c87d012"
> >
> >  },
> >
> >  "network-map": [
> >
> >    {
> >
> >      "src": "PID1",
> >
> >      "dsts": ["PID1", "PID2", "PID3"]
> >
> >    },
> >
> >    {
> >
> >      "src": "PID2",
> >
> >      "dsts": ["PID1", "PID3"]
> >
> >    },
> >
> >    {
> >
> >      "src": "PID3",
> >
> >      "dsts": ["PID2", "PID3"]
> >
> >    }
> >
> >  ]
> >
> > }
> >
> > Result of build_parser_class(obj):
> >
> > Class JSONObject {
> >
> >  Meta myMeta;
> >
> >  ArrayList<NetworkMapElement> myNetworkMap;
> >
> > }
> >
> > Class Meta {
> >
> >  String myResourceId;
> >
> >  String myTag;
> >
> > }
> >
> > Class NetworkMapElement {
> >
> >  String mySrc;
> >
> >  ArrayList<String> myDsts;
> >
> > }
> >
> > Now given the Jackson Parser Java Class, to get a syntactically
> equivalent
> > YANG model:
> >
> > YANGModel build_yang_model(Class C) {
> >
> >  for each instance variable (Type, Name) {
> >
> >    if (Type is primitive type: string, number, boolean, null) {
> >
> >      add the following to the YANG module:
> >
> >      "leaf Name { type <YANG equivalent of Type>; }"
> >
> >    }
> >
> >    if (Type is an ArrayList<TypeElement>) {
> >
> >      if (TypeElement is primitive type) {
> >
> >        add the following to the YANG module:
> >
> >        "leaf-list Name { type <YANG equivalent of TypeElement>; }"
> >
> >      } else {
> >
> >        // TypeElement is a custom parser class
> >
> >        add the following to the YANG module:
> >
> >        "list Name { <result from build_yang_model<TypeElement.class>> }"
> >
> >      }
> >
> >    }
> >
> >    if (Type is a custom parser class) {
> >
> >      add the following to the YANG module:
> >
> >      "container Name { <result from build_yang_model<Type.class>> }"
> >
> >    }
> >
> >  }
> >
> > }
> >
> > Result from the previous example:
> >
> > container meta {
> >
> >  leaf resource-id {
> >
> >    type string;
> >
> >  }
> >
> >  leaf tag {
> >
> >    type string;
> >
> >  }
> >
> > }
> >
> > list network-map {
> >
> >  leaf src {
> >
> >    type string;
> >
> >  }
> >
> >  leaf-list dsts {
> >
> >    type string;
> >
> >  }
> >
> > }
> >
> > This does validate the JSON document with XML-JSON encoding. For your
> > reference, this is the XML document which validates:
> >
> > <?xml version="1.0" encoding="UTF-8" ?>
> >
> > <meta>
> >
> >  <resource-id>my-default-map</resource-id>
> >
> >  <tag>aab875ef69c87d012</tag>
> >
> > </meta>
> >
> > <network-map>
> >
> >  <src>PID1</src>
> >
> >  <dsts>PID1</dsts>
> >
> >  <dsts>PID2</dsts>
> >
> >  <dsts>PID3</dsts>
> >
> > </network-map>
> >
> > <network-map>
> >
> >  <src>PID2</src>
> >
> >  <dsts>PID1</dsts>
> >
> >  <dsts>PID3</dsts>
> >
> > </network-map>
> >
> > <network-map>
> >
> >  <src>PID3</src>
> >
> >  <dsts>PID2</dsts>
> >
> >  <dsts>PID3</dsts>
> >
> > </network-map>
> >
> > This proves that the message encoding condition is a sufficient condition
> > for the JSON object to have a YANG model.
> >
> > Note the model generated is very crude and lose almost all constraints
> and
> > all inheritance features (if any), because it focuses on the syntax and
> is
> > essentially converted from an JSON object compliant with a protocol
> instead
> > of from the protocol itself. Hence this result is more useful in
> > determining which JSON based protocols cannot have a syntactically
> > equivalent YANG model, than in generating a good YANG model.
> >
> > 3.3. Conclusion
> >
> > Our claim holds. A JSON based protocol carried by HTTP can have
> > syntactically equivalent YANG model, if and only if all the keys in the
> > key-value pairs in the JSON message are pre-defined keywords.
> >
> > 4. Semantic equivalence
> >
> > For JSON based protocols that don't satisfy the message encoding
> condition,
> > it is still possible to have a semantically equivalent YANG model. All
> that
> > is required for the protocol compliant clients and the YANG model
> compliant
> > server to interoperate is an adapter which does the following:
> >
> > 1) translate FROM YANG server compliant response msg TO alto compliant
> > response msg
> >
> > 2) translate FROM alto compliant request msg TO YANG server compliant
> > request msg
> >
> > 4.1. Claim
> >
> > This adapter needs to be protocol-aware.
> >
> > Ideally, given any YANG model, we would like to be able to automatically
> > (or at least mechanically) generate this message adapter, which means not
> > looking at the protocol or its compliant msgs. However, without knowing
> the
> > specific protocol that we are working with (i.e. human intervention, i.e.
> > looking at the protocol compliant msgs), such an adapter cannot be
> > auto-generated.
> >
> > 4.2. Proof by Indistinguishability
> >
> > Suppose both the YANG server compliant msg m_y and the actually protocol
> > compliant msg m_p are in JSON (or have been encoded into JSON). Looking
> at
> > the differences between the two messages, call these differences {d1, d2,
> > ..., dn}. The goal for the auto-generated adapter would be to identify
> and
> > eliminate these differences. Construct a new JSON msg m' where all but
> one
> > difference di is the same as m_p and di is the same as the m_y. Without
> > looking at the protocol (or m_p), the auto-generated adapter would not be
> > able to distinguish between m' and m_p in its translation process, which
> > means, it won't be able to tell whether it should change di or not.
> Hence,
> > such an adapter must be protocol-aware.
> >
> > A good example is the dependent-vtag in the ALTO protocol:
> >
> > "dependent-vtag" : [
> >
> >  {
> >
> >    "resource-id" : "my-network-map",
> >
> >    "tag" : "abcd1234"
> >
> >  }
> >
> > ]
> >
> > It was specified this way in the alto protocol. However, it could
> > conceivably be the case that it was originally the following map
> structure,
> > and was converted into the above encoding because of the map->list+key
> > issue. (This case is actually one of the few differences in the m_y and
> m_p
> > where the adapter does not need to convert it back to a map structure.)
> >
> > "dependent-vtag" : {
> >
> >  "my-network-map" : {
> >
> >    "tag" : "abcd1234"
> >
> >  }
> >
> > }
> >
> > Without knowing the protocol, there is no way to tell.
> >
> > 5. Ramifications
> >
> > We now understand the basic condition for a JSON based protocol to have a
> > YANG Model. For the protocols that don't meet this condition, there can
> be
> > a semantic equivalent YANG model, but there won't be a generic process of
> > generating the adapter for all such protocols.
> > _______________________________________________
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod
>
> --
> Ladislav Lhotka, CZ.NIC Labs
> PGP Key ID: E74E8C0C
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>

--001a11c13e4ab941f80505dc5f08
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Mon, Oct 20, 2014 at 6:23 AM, Ladislav Lhotka <span dir=3D"ltr">&lt;=
<a href=3D"mailto:lhotka@nic.cz" target=3D"_blank">lhotka@nic.cz</a>&gt;</s=
pan> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex">Xiao SHI &lt;<a href=3D"mailt=
o:xiao.shi@yale.edu">xiao.shi@yale.edu</a>&gt; writes:<br>
<br>
&gt; Hi folks,<br>
&gt;<br>
&gt;<br>
&gt; As a few of us were working on modeling the ALTO protocol using YANG, =
we<br>
&gt; were pondering on a more general question: can YANG model all JSON bas=
ed<br>
&gt; protocols? What is the condition for a JSON based protocol (at least t=
he<br>
&gt; message format) to have an syntactically equivalent, hence interoperab=
le,<br>
&gt; YANG model with JSON encoding? Alternatively, in order to interoperate=
,<br>
&gt; semantic equivalence might be sufficient, is there any condition for<b=
r>
&gt; semantic equivalence?<br>
&gt;<br>
&gt;<br>
&gt; tl;dr: A JSON based protocol carried by HTTP can have syntactically<br=
>
&gt; equivalent YANG model, if and only if all the keys in the key-value pa=
irs<br>
&gt; in the JSON message are pre-defined keywords in the protocol.<br>
&gt;<br>
<br>
Generating a YANG data model from existing instance data seems backwards<br=
>
to me, although Examplotron (<a href=3D"http://examplotron.org" target=3D"_=
blank">http://examplotron.org</a>) does something quite<br>
similar. In any case, it might be quite challenging because YANG isn&#39;t<=
br>
intended as a general schema language. Your observation above is true<br>
but it is just one aspect of the problem. For instance<br>
<br>
&quot;foo&quot;: [ { &quot;bar&quot;: 1 }, 2 ]<br>
<br>
or<br>
<br>
&quot;foo&quot;: null<br>
<br>
cannot be modelled in YANG using the encoding of<br>
draft-ietf-netmod-yang-json.<br>
<br></blockquote><div><br></div><div><br></div><div>I think perhaps RESTCON=
F is overloading JSON and this has led to some confusion.</div><div>RESTCON=
F uses JSON strictly as an encoding format, not a data structure.&nbsp; JSO=
N is just</div><div>the message encoding. The corresponding instance docume=
nt must conform to</div><div>the YANG definitions (not just be valid JSON).=
</div><div><br></div><div>A protocol should pick between YANG data structur=
es and JSON data structures,</div><div>and not try to do both.</div><div><b=
r></div><div><br></div><div>&nbsp;<br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Lada<br>
<br></blockquote><div><br></div><div>Andy</div><div>&nbsp;</div><blockquote=
 class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli=
d;padding-left:1ex">
&gt;<br>
&gt; We&#39;ve come up with a few ideas, and a few things below are work in=
<br>
&gt; progress, but we would love your feedback!<br>
&gt;<br>
&gt;<br>
&gt; Thank you!<br>
&gt;<br>
&gt; Xiao<br>
&gt;<br>
&gt;<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
&gt;<br>
&gt; 1. Introduction.<br>
&gt;<br>
&gt; JavaScript Object Notation (JSON) has been a popular choice as the mes=
sage<br>
&gt; encoding for many network protocols such as the Application Layer Traf=
fic<br>
&gt; Optimization (ALTO) protocol, the Content Delivery Networks Interconne=
ction<br>
&gt; (CDNi) protocol, etc.<br>
&gt;<br>
&gt; Meanwhile, there are broad interests in the networking community to us=
e<br>
&gt; YANG to define data model so that one can use YANG related tools such =
as<br>
&gt; OpenDayLight controller. Although YANG itself is XML based, there have=
 been<br>
&gt; efforts to model JSON content using YANG [draft-ietf-netmod-yang-json-=
01].<br>
&gt;<br>
&gt; A natural question rises: can YANG model all JSON based protocols? Wha=
t is<br>
&gt; the condition for a JSON based protocol (at least the message format) =
to<br>
&gt; have an syntactically equivalent, hence interoperable, YANG model with=
 JSON<br>
&gt; encoding? Alternatively, in order to interoperate, semantic equivalenc=
e<br>
&gt; might be sufficient, is there any condition for semantic equivalence?<=
br>
&gt;<br>
&gt; 2. Claim<br>
&gt;<br>
&gt; A JSON based protocol carried by HTTP can have syntactically equivalen=
t<br>
&gt; YANG model, if and only if:<br>
&gt;<br>
&gt; (1) the message encoding condition is met;<br>
&gt;<br>
&gt; (2) the uri condition is met.<br>
&gt;<br>
&gt; 2.1. The message encoding condition<br>
&gt;<br>
&gt; The JSON message encoding MUST not contain a variable as a key in a JS=
ON<br>
&gt; object key-value pair. In other words, the keys in the JSON message mu=
st be<br>
&gt; an already defined constant (or keyword) in the message format of the<=
br>
&gt; protocol.<br>
&gt;<br>
&gt; For example, if I have a protocol where &ldquo;network-map&rdquo;, &ld=
quo;src&rdquo;, and &ldquo;dsts&rdquo;<br>
&gt; are defined keywords, JSON text A meets the condition whereas B does n=
ot<br>
&gt; because &ldquo;PID1&rdquo; and &ldquo;PID2&rdquo; are not protocol key=
words (they are resource IDs).<br>
&gt;<br>
&gt; A:<br>
&gt;<br>
&gt; {<br>
&gt;<br>
&gt;&nbsp; &ldquo;network-map&rdquo;: [<br>
&gt;<br>
&gt;&nbsp; &nbsp; {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;src&rdquo;: &ldquo;PID1&rdquo;,<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;dsts&rdquo;: [&ldquo;PID2&rdquo;, &ldquo;PI=
D3&rdquo;]<br>
&gt;<br>
&gt;&nbsp; &nbsp; },<br>
&gt;<br>
&gt;&nbsp; &nbsp; {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;src&rdquo;: &ldquo;PID2&rdquo;,<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;dsts&rdquo;: [&ldquo;PID3&rdquo;, &ldquo;PI=
D4&rdquo;]<br>
&gt;<br>
&gt;&nbsp; &nbsp; }<br>
&gt;<br>
&gt;&nbsp; ]<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; B:<br>
&gt;<br>
&gt;<br>
&gt; {<br>
&gt;<br>
&gt;&nbsp; &ldquo;network-map&rdquo;: [<br>
&gt;<br>
&gt;&nbsp; &nbsp; &ldquo;PID1: [&ldquo;PID2&rdquo;, &ldquo;PID3&rdquo;],<br=
>
&gt;<br>
&gt;&nbsp; &nbsp; &ldquo;PID2&rdquo;: [&ldquo;PID3&rdquo;, &ldquo;PID4&rdqu=
o;]<br>
&gt;<br>
&gt;&nbsp; ]<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt;&gt;From this we know that since ALTO protocol uses encoding B, there c=
annot be<br>
&gt; a syntactically equivalent YANG model.<br>
&gt;<br>
&gt; 2.2 The URI condition<br>
&gt;<br>
&gt; Some of the YANG-related protocols might have URI constraints, e.g.<br=
>
&gt; RESTCONF. For now, we assume either that the JSON-based protocol URI c=
ould<br>
&gt; be conformed to RESTCONF compliant uri, or that the server could have =
a<br>
&gt; routing mapping between the protocol compliant uri and the RESTCONF<br=
>
&gt; compliant uri, hence this condition would not be an issue, which allow=
s us<br>
&gt; to focus on the message encoding condition.<br>
&gt;<br>
&gt; 3. Proof<br>
&gt;<br>
&gt; 3.1. The message encoding condition is necessary.<br>
&gt;<br>
&gt; We first note that this condition is a necessary condition for a JSON =
based<br>
&gt; protocol to have a syntactically equivalent YANG model by proving its<=
br>
&gt; contrapositive.<br>
&gt;<br>
&gt; If one of the keys in the key-value pair in the JSON document is not<b=
r>
&gt; pre-defined, the corresponding XML tags will not be pre-defined keywor=
ds.<br>
&gt; Therefore, it would not possible to model it in YANG without using<br>
&gt; YANG&rsquo;s anyxml<br>
&gt; statement (which allows arbitrary XML content).<br>
&gt;<br>
&gt; However, using the anyxml statement would defeat our purpose of modeli=
ng<br>
&gt; the data as it allows arbitrary XML content, and will not be helpful i=
n the<br>
&gt; subsequent parsing process.<br>
&gt;<br>
&gt; 3.2. The message encoding condition is sufficient.<br>
&gt;<br>
&gt; We prove this by providing a translation procedure from a JSON message=
 that<br>
&gt; is compliant with the protocol we are trying to model, to a custom jav=
a<br>
&gt; class that can be used for Jackson data binding, then to a YANG model.=
<br>
&gt;<br>
&gt; We note that the middle step of translating to and from the custom par=
ser<br>
&gt; class is not necessary, but it will be useful.<br>
&gt;<br>
&gt; 3.2.1. motivation<br>
&gt;<br>
&gt; JSON data binding is the process of binding data structures (objects,<=
br>
&gt; arrays, etc.) in JSON to the appropriate data structures in the server=
<br>
&gt; (e.g. java classes, database tables, etc.) in parsing the JSON text. I=
n<br>
&gt; order to process JSON messages in a meaningful manner, data binding is=
<br>
&gt; necessary. Even if the binding is not explicit, the server would need =
to do<br>
&gt; it eventually. For example, one can read JSON content in a stream with=
out<br>
&gt; binding it to the java classes, but eventually in order to make sense =
of<br>
&gt; the data, the server would eventually have to organize it, which is ro=
ughly<br>
&gt; analogous to data binding upfront. Popular choices for JSON parsing an=
d<br>
&gt; data binding include jackson and gson.<br>
&gt;<br>
&gt; We use Jackson full data binding as our approach. Full data binding bi=
nds<br>
&gt; JSON content into plain old java objects (POJOs), i.e. this custom par=
ser<br>
&gt; class can neither extend nor implement any other class. Jackson uses<b=
r>
&gt; ObjectMapper with the custom parser class to parse JSON content into t=
his<br>
&gt; class.<br>
&gt;<br>
&gt; 3.2.2. The message encoding condition<br>
&gt;<br>
&gt; The message encoding condition is that all keys in each key-value pair=
 in<br>
&gt; the JSON text must be pre-defined keywords. As the keys will become ei=
ther<br>
&gt; class names and instance variable names, or be keys in the java maps, =
it is<br>
&gt; easy to see that the condition is equivalent to &ldquo;there exists a =
full data<br>
&gt; binding in Jackson custom parser class without using any map structure=
s<br>
&gt; (Map&lt;String, ?&gt;).&rdquo;<br>
&gt;<br>
&gt; 3.2.3. Proof<br>
&gt;<br>
&gt; We provide a recursive binding process from a JSON object to the Jacks=
on<br>
&gt; custom parser class to be used by Jackson ObjectMapper.<br>
&gt;<br>
&gt; Type determine_type(value) {<br>
&gt;<br>
&gt;&nbsp; if (value is of a primitive type, i.e. string, number, boolean, =
null) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; return the corresponding java primitive type;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt;&nbsp; if (value is a JSON object) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; return build_parser_class(value).class;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt;&nbsp; if (value is an array) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; return ArrayList&lt;T&gt; where T=3Ddetermine_type(value[=
0]);<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt;&nbsp; // should not reach here.<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Class build_parser_class(JSONObject obj) {<br>
&gt;<br>
&gt;&nbsp; create custom class C;<br>
&gt;<br>
&gt;&nbsp; for each key/value pair in the obj {<br>
&gt;<br>
&gt;&nbsp; &nbsp; add instance variable v in C;<br>
&gt;<br>
&gt;&nbsp; &nbsp; the name of variable v &lt;- key; // (__known__ a/c to ou=
r assumption)<br>
&gt;<br>
&gt;&nbsp; &nbsp; the type of variable v &lt;- determine_type(value);<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt;&nbsp; return C.class;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Naming:<br>
&gt;<br>
&gt; --change everything into CamelCase (i.e. remove dashes, etc.)<br>
&gt;<br>
&gt; --for instance variables, use &ldquo;my&rdquo; prefix, (e.g. myVariabl=
e, myNetworkMap,<br>
&gt; etc.)<br>
&gt;<br>
&gt; --for the custom class name, if the object is an element of the array,=
 use<br>
&gt; &ldquo;Element&rdquo; suffix.<br>
&gt;<br>
&gt; This is just one convention so that the next step proceeds smoothly. A=
s<br>
&gt; long as this naming translation is consistent with the naming stage in=
 the<br>
&gt; next step, it will work just fine.<br>
&gt;<br>
&gt; Example (a modified ALTO protocol network map example):<br>
&gt;<br>
&gt; JSON object:<br>
&gt;<br>
&gt; {<br>
&gt;<br>
&gt;&nbsp; &ldquo;meta&rdquo;: {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &ldquo;resource-id&rdquo;: &ldquo;my-default-map&rdquo;,<=
br>
&gt;<br>
&gt;&nbsp; &nbsp; &ldquo;tag&rdquo;: &ldquo;aab875ef69c87d012&rdquo;<br>
&gt;<br>
&gt;&nbsp; },<br>
&gt;<br>
&gt;&nbsp; &ldquo;network-map&rdquo;: [<br>
&gt;<br>
&gt;&nbsp; &nbsp; {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;src&rdquo;: &ldquo;PID1&rdquo;,<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;dsts&rdquo;: [&ldquo;PID1&rdquo;, &ldquo;PI=
D2&rdquo;, &ldquo;PID3&rdquo;]<br>
&gt;<br>
&gt;&nbsp; &nbsp; },<br>
&gt;<br>
&gt;&nbsp; &nbsp; {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;src&rdquo;: &ldquo;PID2&rdquo;,<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;dsts&rdquo;: [&ldquo;PID1&rdquo;, &ldquo;PI=
D3&rdquo;]<br>
&gt;<br>
&gt;&nbsp; &nbsp; },<br>
&gt;<br>
&gt;&nbsp; &nbsp; {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;src&rdquo;: &ldquo;PID3&rdquo;,<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;dsts&rdquo;: [&ldquo;PID2&rdquo;, &ldquo;PI=
D3&rdquo;]<br>
&gt;<br>
&gt;&nbsp; &nbsp; }<br>
&gt;<br>
&gt;&nbsp; ]<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Result of build_parser_class(obj):<br>
&gt;<br>
&gt; Class JSONObject {<br>
&gt;<br>
&gt;&nbsp; Meta myMeta;<br>
&gt;<br>
&gt;&nbsp; ArrayList&lt;NetworkMapElement&gt; myNetworkMap;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Class Meta {<br>
&gt;<br>
&gt;&nbsp; String myResourceId;<br>
&gt;<br>
&gt;&nbsp; String myTag;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Class NetworkMapElement {<br>
&gt;<br>
&gt;&nbsp; String mySrc;<br>
&gt;<br>
&gt;&nbsp; ArrayList&lt;String&gt; myDsts;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Now given the Jackson Parser Java Class, to get a syntactically equiva=
lent<br>
&gt; YANG model:<br>
&gt;<br>
&gt; YANGModel build_yang_model(Class C) {<br>
&gt;<br>
&gt;&nbsp; for each instance variable (Type, Name) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; if (Type is primitive type: string, number, boolean, null=
) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; add the following to the YANG module:<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;leaf Name { type &lt;YANG equivalent of Typ=
e&gt;; }&rdquo;<br>
&gt;<br>
&gt;&nbsp; &nbsp; }<br>
&gt;<br>
&gt;&nbsp; &nbsp; if (Type is an ArrayList&lt;TypeElement&gt;) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; if (TypeElement is primitive type) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp; add the following to the YANG module:<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp; &ldquo;leaf-list Name { type &lt;YANG equiv=
alent of TypeElement&gt;; }&rdquo;<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; } else {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp; // TypeElement is a custom parser class<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp; add the following to the YANG module:<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp; &ldquo;list Name { &lt;result from build_ya=
ng_model&lt;TypeElement.class&gt;&gt; }&rdquo;<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; }<br>
&gt;<br>
&gt;&nbsp; &nbsp; }<br>
&gt;<br>
&gt;&nbsp; &nbsp; if (Type is a custom parser class) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; add the following to the YANG module:<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;container Name { &lt;result from build_yang=
_model&lt;Type.class&gt;&gt; }&rdquo;<br>
&gt;<br>
&gt;&nbsp; &nbsp; }<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Result from the previous example:<br>
&gt;<br>
&gt; container meta {<br>
&gt;<br>
&gt;&nbsp; leaf resource-id {<br>
&gt;<br>
&gt;&nbsp; &nbsp; type string;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt;&nbsp; leaf tag {<br>
&gt;<br>
&gt;&nbsp; &nbsp; type string;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; list network-map {<br>
&gt;<br>
&gt;&nbsp; leaf src {<br>
&gt;<br>
&gt;&nbsp; &nbsp; type string;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt;&nbsp; leaf-list dsts {<br>
&gt;<br>
&gt;&nbsp; &nbsp; type string;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; This does validate the JSON document with XML-JSON encoding. For your<=
br>
&gt; reference, this is the XML document which validates:<br>
&gt;<br>
&gt; &lt;?xml version=3D&quot;1.0&quot; encoding=3D&quot;UTF-8&quot; ?&gt;<=
br>
&gt;<br>
&gt; &lt;meta&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;resource-id&gt;my-default-map&lt;/resource-id&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;tag&gt;aab875ef69c87d012&lt;/tag&gt;<br>
&gt;<br>
&gt; &lt;/meta&gt;<br>
&gt;<br>
&gt; &lt;network-map&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;src&gt;PID1&lt;/src&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;dsts&gt;PID1&lt;/dsts&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;dsts&gt;PID2&lt;/dsts&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;<br>
&gt; &lt;/network-map&gt;<br>
&gt;<br>
&gt; &lt;network-map&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;src&gt;PID2&lt;/src&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;dsts&gt;PID1&lt;/dsts&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;<br>
&gt; &lt;/network-map&gt;<br>
&gt;<br>
&gt; &lt;network-map&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;src&gt;PID3&lt;/src&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;dsts&gt;PID2&lt;/dsts&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;<br>
&gt; &lt;/network-map&gt;<br>
&gt;<br>
&gt; This proves that the message encoding condition is a sufficient condit=
ion<br>
&gt; for the JSON object to have a YANG model.<br>
&gt;<br>
&gt; Note the model generated is very crude and lose almost all constraints=
 and<br>
&gt; all inheritance features (if any), because it focuses on the syntax an=
d is<br>
&gt; essentially converted from an JSON object compliant with a protocol in=
stead<br>
&gt; of from the protocol itself. Hence this result is more useful in<br>
&gt; determining which JSON based protocols cannot have a syntactically<br>
&gt; equivalent YANG model, than in generating a good YANG model.<br>
&gt;<br>
&gt; 3.3. Conclusion<br>
&gt;<br>
&gt; Our claim holds. A JSON based protocol carried by HTTP can have<br>
&gt; syntactically equivalent YANG model, if and only if all the keys in th=
e<br>
&gt; key-value pairs in the JSON message are pre-defined keywords.<br>
&gt;<br>
&gt; 4. Semantic equivalence<br>
&gt;<br>
&gt; For JSON based protocols that don&rsquo;t satisfy the message encoding=
 condition,<br>
&gt; it is still possible to have a semantically equivalent YANG model. All=
 that<br>
&gt; is required for the protocol compliant clients and the YANG model comp=
liant<br>
&gt; server to interoperate is an adapter which does the following:<br>
&gt;<br>
&gt; 1) translate FROM YANG server compliant response msg TO alto compliant=
<br>
&gt; response msg<br>
&gt;<br>
&gt; 2) translate FROM alto compliant request msg TO YANG server compliant<=
br>
&gt; request msg<br>
&gt;<br>
&gt; 4.1. Claim<br>
&gt;<br>
&gt; This adapter needs to be protocol-aware.<br>
&gt;<br>
&gt; Ideally, given any YANG model, we would like to be able to automatical=
ly<br>
&gt; (or at least mechanically) generate this message adapter, which means =
not<br>
&gt; looking at the protocol or its compliant msgs. However, without knowin=
g the<br>
&gt; specific protocol that we are working with (i.e. human intervention, i=
.e.<br>
&gt; looking at the protocol compliant msgs), such an adapter cannot be<br>
&gt; auto-generated.<br>
&gt;<br>
&gt; 4.2. Proof by Indistinguishability<br>
&gt;<br>
&gt; Suppose both the YANG server compliant msg m_y and the actually protoc=
ol<br>
&gt; compliant msg m_p are in JSON (or have been encoded into JSON). Lookin=
g at<br>
&gt; the differences between the two messages, call these differences {d1, =
d2,<br>
&gt; ..., dn}. The goal for the auto-generated adapter would be to identify=
 and<br>
&gt; eliminate these differences. Construct a new JSON msg m&#39; where all=
 but one<br>
&gt; difference di is the same as m_p and di is the same as the m_y. Withou=
t<br>
&gt; looking at the protocol (or m_p), the auto-generated adapter would not=
 be<br>
&gt; able to distinguish between m&#39; and m_p in its translation process,=
 which<br>
&gt; means, it won&#39;t be able to tell whether it should change di or not=
. Hence,<br>
&gt; such an adapter must be protocol-aware.<br>
&gt;<br>
&gt; A good example is the dependent-vtag in the ALTO protocol:<br>
&gt;<br>
&gt; &quot;dependent-vtag&quot; : [<br>
&gt;<br>
&gt;&nbsp; {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &quot;resource-id&quot; : &quot;my-network-map&quot;,<br>
&gt;<br>
&gt;&nbsp; &nbsp; &quot;tag&quot; : &quot;abcd1234&quot;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt; ]<br>
&gt;<br>
&gt; It was specified this way in the alto protocol. However, it could<br>
&gt; conceivably be the case that it was originally the following map struc=
ture,<br>
&gt; and was converted into the above encoding because of the map-&gt;list+=
key<br>
&gt; issue. (This case is actually one of the few differences in the m_y an=
d m_p<br>
&gt; where the adapter does not need to convert it back to a map structure.=
)<br>
&gt;<br>
&gt; &quot;dependent-vtag&quot; : {<br>
&gt;<br>
&gt;&nbsp; &quot;my-network-map&quot; : {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &quot;tag&quot; : &quot;abcd1234&quot;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Without knowing the protocol, there is no way to tell.<br>
&gt;<br>
&gt; 5. Ramifications<br>
&gt;<br>
&gt; We now understand the basic condition for a JSON based protocol to hav=
e a<br>
&gt; YANG Model. For the protocols that don&rsquo;t meet this condition, th=
ere can be<br>
&gt; a semantic equivalent YANG model, but there won&rsquo;t be a generic p=
rocess of<br>
&gt; generating the adapter for all such protocols.<br>
&gt; _______________________________________________<br>
&gt; netmod mailing list<br>
&gt; <a href=3D"mailto:netmod@ietf.org">netmod@ietf.org</a><br>
&gt; <a href=3D"https://www.ietf.org/mailman/listinfo/netmod" target=3D"_bl=
ank">https://www.ietf.org/mailman/listinfo/netmod</a><br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
--<br>
Ladislav Lhotka, CZ.NIC Labs<br>
PGP Key ID: E74E8C0C<br>
<br>
_______________________________________________<br>
netmod mailing list<br>
<a href=3D"mailto:netmod@ietf.org">netmod@ietf.org</a><br>
<a href=3D"https://www.ietf.org/mailman/listinfo/netmod" target=3D"_blank">=
https://www.ietf.org/mailman/listinfo/netmod</a><br>
</font></span></blockquote></div><br></div></div>

--001a11c13e4ab941f80505dc5f08--


From nobody Tue Oct 21 08:04:49 2014
Return-Path: <andy@yumaworks.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DE1341A01F9 for <alto@ietfa.amsl.com>; Mon, 20 Oct 2014 08:47:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.978
X-Spam-Level: 
X-Spam-Status: No, score=-1.978 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham
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 YOOazJl5HU8A for <alto@ietfa.amsl.com>; Mon, 20 Oct 2014 08:46:49 -0700 (PDT)
Received: from mail-qg0-f42.google.com (mail-qg0-f42.google.com [209.85.192.42]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id BE4C41A1AD8 for <alto@ietf.org>; Mon, 20 Oct 2014 08:45:24 -0700 (PDT)
Received: by mail-qg0-f42.google.com with SMTP id z60so3725382qgd.29 for <alto@ietf.org>; Mon, 20 Oct 2014 08:45:23 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=wQyny0sEZ0OXmFXRVKVzciAmq0fB6KgQkg1IQGCGNP4=; b=NFDMbFd/lJY6CoTxSlNlm2c1WwUyays/jLRttdAsepVnmjhmI4ZR6PEnfLwtxq5m7o AyL/sgOOtoFLDc/JpTv6BD2oinVHtcahcWp0D+BKdNg5lrCQVDu2Wibbx6ztq1CRfM2S mlF9aRa0kiduwGdIOiOA77zwoAGvyCjN0MipZpb34FwpsVktJwPI99FtlIzAX7g84GBf NgKKNvNkrywpnrNKBSVXlHZ5apc1eVDrtAOJy+SUoYMLMoeycC9kd3qaGnXFPJT06JGu 13Gulk5BX7HyQwyljL6ipibfm5TSj0PECAo3Yg3eeY16k3flQG0M9mG7dHcT3C5OEzgX FN2A==
X-Gm-Message-State: ALoCoQl2alc42EK0cpMg6WLFnuG4AYG6/ywaDFKaHHsg8uW3FiAMXkC+G0d3TNWgBpkFl52lT//5
MIME-Version: 1.0
X-Received: by 10.229.28.196 with SMTP id n4mr37065793qcc.14.1413819923344; Mon, 20 Oct 2014 08:45:23 -0700 (PDT)
Received: by 10.140.37.52 with HTTP; Mon, 20 Oct 2014 08:45:23 -0700 (PDT)
In-Reply-To: <CAFwJzZnJJadP_tqYLygVw33gjv_Q1XwPGU8wT4YV=1f6kKqYYg@mail.gmail.com>
References: <CAFwJzZkAp-4umrrHZEY3qYuFCXu=+Pqbh8SeB=Qr=TTbQurj6A@mail.gmail.com> <m2tx2ynadg.fsf@nic.cz> <CABCOCHRxKWFZDue8WaHVei9FdGsBctSf8PE2C_+vCaV66A48JA@mail.gmail.com> <CAFwJzZnJJadP_tqYLygVw33gjv_Q1XwPGU8wT4YV=1f6kKqYYg@mail.gmail.com>
Date: Mon, 20 Oct 2014 08:45:23 -0700
Message-ID: <CABCOCHQoAvJ_rKahgCx=O+f0ykHH3fNQiDBQu_dEoNFjxB7sDQ@mail.gmail.com>
From: Andy Bierman <andy@yumaworks.com>
To: Xiao SHI <xiao.shi@yale.edu>
Content-Type: multipart/alternative; boundary=001a1134a5364ec68f0505dc9acd
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/74aH12hz_kHHNEcHNxiVKsqKkKE
X-Mailman-Approved-At: Tue, 21 Oct 2014 08:04:32 -0700
Cc: Ladislav Lhotka <lhotka@nic.cz>, "netmod@ietf.org" <netmod@ietf.org>, IETF ALTO <alto@ietf.org>
Subject: Re: [alto] [netmod] Modeling JSON based protocols using YANG
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Oct 2014 15:47:03 -0000

--001a1134a5364ec68f0505dc9acd
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Oct 20, 2014 at 8:33 AM, Xiao SHI <xiao.shi@yale.edu> wrote:

> Hi Andy,
>
> I agree with you. Just to clarify, what I am trying to do is to use YANG
> data structures for the protocol whose message encoding is JSON. I am not
> trying to use JSON as a data structure. Does this make sense?
>
>
yes -- so you want to write the YANG module that corresponds to the
existing JSON usage. Not extend YANG to support all possible JSON usage.
Good.




> Best,
> Xiao
>

Andy


>
> On Mon, Oct 20, 2014 at 11:29 AM, Andy Bierman <andy@yumaworks.com> wrote:
>
>>
>>
>> On Mon, Oct 20, 2014 at 6:23 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:
>>
>>> Xiao SHI <xiao.shi@yale.edu> writes:
>>>
>>> > Hi folks,
>>> >
>>> >
>>> > As a few of us were working on modeling the ALTO protocol using YANG,
>>> we
>>> > were pondering on a more general question: can YANG model all JSON
>>> based
>>> > protocols? What is the condition for a JSON based protocol (at least
>>> the
>>> > message format) to have an syntactically equivalent, hence
>>> interoperable,
>>> > YANG model with JSON encoding? Alternatively, in order to interoperate,
>>> > semantic equivalence might be sufficient, is there any condition for
>>> > semantic equivalence?
>>> >
>>> >
>>> > tl;dr: A JSON based protocol carried by HTTP can have syntactically
>>> > equivalent YANG model, if and only if all the keys in the key-value
>>> pairs
>>> > in the JSON message are pre-defined keywords in the protocol.
>>> >
>>>
>>> Generating a YANG data model from existing instance data seems backwards
>>> to me, although Examplotron (http://examplotron.org) does something
>>> quite
>>> similar. In any case, it might be quite challenging because YANG isn't
>>> intended as a general schema language. Your observation above is true
>>> but it is just one aspect of the problem. For instance
>>>
>>> "foo": [ { "bar": 1 }, 2 ]
>>>
>>> or
>>>
>>> "foo": null
>>>
>>> cannot be modelled in YANG using the encoding of
>>> draft-ietf-netmod-yang-json.
>>>
>>>
>>
>> I think perhaps RESTCONF is overloading JSON and this has led to some
>> confusion.
>> RESTCONF uses JSON strictly as an encoding format, not a data structure.
>> JSON is just
>> the message encoding. The corresponding instance document must conform to
>> the YANG definitions (not just be valid JSON).
>>
>> A protocol should pick between YANG data structures and JSON data
>> structures,
>> and not try to do both.
>>
>>
>>
>>
>>> Lada
>>>
>>>
>> Andy
>>
>>
>>> >
>>> > We've come up with a few ideas, and a few things below are work in
>>> > progress, but we would love your feedback!
>>> >
>>> >
>>> > Thank you!
>>> >
>>> > Xiao
>>> >
>>> >
>>> > ======================
>>> >
>>> > 1. Introduction.
>>> >
>>> > JavaScript Object Notation (JSON) has been a popular choice as the
>>> message
>>> > encoding for many network protocols such as the Application Layer
>>> Traffic
>>> > Optimization (ALTO) protocol, the Content Delivery Networks
>>> Interconnection
>>> > (CDNi) protocol, etc.
>>> >
>>> > Meanwhile, there are broad interests in the networking community to use
>>> > YANG to define data model so that one can use YANG related tools such
>>> as
>>> > OpenDayLight controller. Although YANG itself is XML based, there have
>>> been
>>> > efforts to model JSON content using YANG
>>> [draft-ietf-netmod-yang-json-01].
>>> >
>>> > A natural question rises: can YANG model all JSON based protocols?
>>> What is
>>> > the condition for a JSON based protocol (at least the message format)
>>> to
>>> > have an syntactically equivalent, hence interoperable, YANG model with
>>> JSON
>>> > encoding? Alternatively, in order to interoperate, semantic equivalence
>>> > might be sufficient, is there any condition for semantic equivalence?
>>> >
>>> > 2. Claim
>>> >
>>> > A JSON based protocol carried by HTTP can have syntactically equivalent
>>> > YANG model, if and only if:
>>> >
>>> > (1) the message encoding condition is met;
>>> >
>>> > (2) the uri condition is met.
>>> >
>>> > 2.1. The message encoding condition
>>> >
>>> > The JSON message encoding MUST not contain a variable as a key in a
>>> JSON
>>> > object key-value pair. In other words, the keys in the JSON message
>>> must be
>>> > an already defined constant (or keyword) in the message format of the
>>> > protocol.
>>> >
>>> > For example, if I have a protocol where "network-map", "src", and
>>> "dsts"
>>> > are defined keywords, JSON text A meets the condition whereas B does
>>> not
>>> > because "PID1" and "PID2" are not protocol keywords (they are resource
>>> IDs).
>>> >
>>> > A:
>>> >
>>> > {
>>> >
>>> >  "network-map": [
>>> >
>>> >    {
>>> >
>>> >      "src": "PID1",
>>> >
>>> >      "dsts": ["PID2", "PID3"]
>>> >
>>> >    },
>>> >
>>> >    {
>>> >
>>> >      "src": "PID2",
>>> >
>>> >      "dsts": ["PID3", "PID4"]
>>> >
>>> >    }
>>> >
>>> >  ]
>>> >
>>> > }
>>> >
>>> > B:
>>> >
>>> >
>>> > {
>>> >
>>> >  "network-map": [
>>> >
>>> >    "PID1: ["PID2", "PID3"],
>>> >
>>> >    "PID2": ["PID3", "PID4"]
>>> >
>>> >  ]
>>> >
>>> > }
>>> >
>>> >>From this we know that since ALTO protocol uses encoding B, there
>>> cannot be
>>> > a syntactically equivalent YANG model.
>>> >
>>> > 2.2 The URI condition
>>> >
>>> > Some of the YANG-related protocols might have URI constraints, e.g.
>>> > RESTCONF. For now, we assume either that the JSON-based protocol URI
>>> could
>>> > be conformed to RESTCONF compliant uri, or that the server could have a
>>> > routing mapping between the protocol compliant uri and the RESTCONF
>>> > compliant uri, hence this condition would not be an issue, which
>>> allows us
>>> > to focus on the message encoding condition.
>>> >
>>> > 3. Proof
>>> >
>>> > 3.1. The message encoding condition is necessary.
>>> >
>>> > We first note that this condition is a necessary condition for a JSON
>>> based
>>> > protocol to have a syntactically equivalent YANG model by proving its
>>> > contrapositive.
>>> >
>>> > If one of the keys in the key-value pair in the JSON document is not
>>> > pre-defined, the corresponding XML tags will not be pre-defined
>>> keywords.
>>> > Therefore, it would not possible to model it in YANG without using
>>> > YANG's anyxml
>>> > statement (which allows arbitrary XML content).
>>> >
>>> > However, using the anyxml statement would defeat our purpose of
>>> modeling
>>> > the data as it allows arbitrary XML content, and will not be helpful
>>> in the
>>> > subsequent parsing process.
>>> >
>>> > 3.2. The message encoding condition is sufficient.
>>> >
>>> > We prove this by providing a translation procedure from a JSON message
>>> that
>>> > is compliant with the protocol we are trying to model, to a custom java
>>> > class that can be used for Jackson data binding, then to a YANG model.
>>> >
>>> > We note that the middle step of translating to and from the custom
>>> parser
>>> > class is not necessary, but it will be useful.
>>> >
>>> > 3.2.1. motivation
>>> >
>>> > JSON data binding is the process of binding data structures (objects,
>>> > arrays, etc.) in JSON to the appropriate data structures in the server
>>> > (e.g. java classes, database tables, etc.) in parsing the JSON text. In
>>> > order to process JSON messages in a meaningful manner, data binding is
>>> > necessary. Even if the binding is not explicit, the server would need
>>> to do
>>> > it eventually. For example, one can read JSON content in a stream
>>> without
>>> > binding it to the java classes, but eventually in order to make sense
>>> of
>>> > the data, the server would eventually have to organize it, which is
>>> roughly
>>> > analogous to data binding upfront. Popular choices for JSON parsing and
>>> > data binding include jackson and gson.
>>> >
>>> > We use Jackson full data binding as our approach. Full data binding
>>> binds
>>> > JSON content into plain old java objects (POJOs), i.e. this custom
>>> parser
>>> > class can neither extend nor implement any other class. Jackson uses
>>> > ObjectMapper with the custom parser class to parse JSON content into
>>> this
>>> > class.
>>> >
>>> > 3.2.2. The message encoding condition
>>> >
>>> > The message encoding condition is that all keys in each key-value pair
>>> in
>>> > the JSON text must be pre-defined keywords. As the keys will become
>>> either
>>> > class names and instance variable names, or be keys in the java maps,
>>> it is
>>> > easy to see that the condition is equivalent to "there exists a full
>>> data
>>> > binding in Jackson custom parser class without using any map structures
>>> > (Map<String, ?>)."
>>> >
>>> > 3.2.3. Proof
>>> >
>>> > We provide a recursive binding process from a JSON object to the
>>> Jackson
>>> > custom parser class to be used by Jackson ObjectMapper.
>>> >
>>> > Type determine_type(value) {
>>> >
>>> >  if (value is of a primitive type, i.e. string, number, boolean, null)
>>> {
>>> >
>>> >    return the corresponding java primitive type;
>>> >
>>> >  }
>>> >
>>> >  if (value is a JSON object) {
>>> >
>>> >    return build_parser_class(value).class;
>>> >
>>> >  }
>>> >
>>> >  if (value is an array) {
>>> >
>>> >    return ArrayList<T> where T=determine_type(value[0]);
>>> >
>>> >  }
>>> >
>>> >  // should not reach here.
>>> >
>>> > }
>>> >
>>> > Class build_parser_class(JSONObject obj) {
>>> >
>>> >  create custom class C;
>>> >
>>> >  for each key/value pair in the obj {
>>> >
>>> >    add instance variable v in C;
>>> >
>>> >    the name of variable v <- key; // (__known__ a/c to our assumption)
>>> >
>>> >    the type of variable v <- determine_type(value);
>>> >
>>> >  }
>>> >
>>> >  return C.class;
>>> >
>>> > }
>>> >
>>> > Naming:
>>> >
>>> > --change everything into CamelCase (i.e. remove dashes, etc.)
>>> >
>>> > --for instance variables, use "my" prefix, (e.g. myVariable,
>>> myNetworkMap,
>>> > etc.)
>>> >
>>> > --for the custom class name, if the object is an element of the array,
>>> use
>>> > "Element" suffix.
>>> >
>>> > This is just one convention so that the next step proceeds smoothly. As
>>> > long as this naming translation is consistent with the naming stage in
>>> the
>>> > next step, it will work just fine.
>>> >
>>> > Example (a modified ALTO protocol network map example):
>>> >
>>> > JSON object:
>>> >
>>> > {
>>> >
>>> >  "meta": {
>>> >
>>> >    "resource-id": "my-default-map",
>>> >
>>> >    "tag": "aab875ef69c87d012"
>>> >
>>> >  },
>>> >
>>> >  "network-map": [
>>> >
>>> >    {
>>> >
>>> >      "src": "PID1",
>>> >
>>> >      "dsts": ["PID1", "PID2", "PID3"]
>>> >
>>> >    },
>>> >
>>> >    {
>>> >
>>> >      "src": "PID2",
>>> >
>>> >      "dsts": ["PID1", "PID3"]
>>> >
>>> >    },
>>> >
>>> >    {
>>> >
>>> >      "src": "PID3",
>>> >
>>> >      "dsts": ["PID2", "PID3"]
>>> >
>>> >    }
>>> >
>>> >  ]
>>> >
>>> > }
>>> >
>>> > Result of build_parser_class(obj):
>>> >
>>> > Class JSONObject {
>>> >
>>> >  Meta myMeta;
>>> >
>>> >  ArrayList<NetworkMapElement> myNetworkMap;
>>> >
>>> > }
>>> >
>>> > Class Meta {
>>> >
>>> >  String myResourceId;
>>> >
>>> >  String myTag;
>>> >
>>> > }
>>> >
>>> > Class NetworkMapElement {
>>> >
>>> >  String mySrc;
>>> >
>>> >  ArrayList<String> myDsts;
>>> >
>>> > }
>>> >
>>> > Now given the Jackson Parser Java Class, to get a syntactically
>>> equivalent
>>> > YANG model:
>>> >
>>> > YANGModel build_yang_model(Class C) {
>>> >
>>> >  for each instance variable (Type, Name) {
>>> >
>>> >    if (Type is primitive type: string, number, boolean, null) {
>>> >
>>> >      add the following to the YANG module:
>>> >
>>> >      "leaf Name { type <YANG equivalent of Type>; }"
>>> >
>>> >    }
>>> >
>>> >    if (Type is an ArrayList<TypeElement>) {
>>> >
>>> >      if (TypeElement is primitive type) {
>>> >
>>> >        add the following to the YANG module:
>>> >
>>> >        "leaf-list Name { type <YANG equivalent of TypeElement>; }"
>>> >
>>> >      } else {
>>> >
>>> >        // TypeElement is a custom parser class
>>> >
>>> >        add the following to the YANG module:
>>> >
>>> >        "list Name { <result from build_yang_model<TypeElement.class>>
>>> }"
>>> >
>>> >      }
>>> >
>>> >    }
>>> >
>>> >    if (Type is a custom parser class) {
>>> >
>>> >      add the following to the YANG module:
>>> >
>>> >      "container Name { <result from build_yang_model<Type.class>> }"
>>> >
>>> >    }
>>> >
>>> >  }
>>> >
>>> > }
>>> >
>>> > Result from the previous example:
>>> >
>>> > container meta {
>>> >
>>> >  leaf resource-id {
>>> >
>>> >    type string;
>>> >
>>> >  }
>>> >
>>> >  leaf tag {
>>> >
>>> >    type string;
>>> >
>>> >  }
>>> >
>>> > }
>>> >
>>> > list network-map {
>>> >
>>> >  leaf src {
>>> >
>>> >    type string;
>>> >
>>> >  }
>>> >
>>> >  leaf-list dsts {
>>> >
>>> >    type string;
>>> >
>>> >  }
>>> >
>>> > }
>>> >
>>> > This does validate the JSON document with XML-JSON encoding. For your
>>> > reference, this is the XML document which validates:
>>> >
>>> > <?xml version="1.0" encoding="UTF-8" ?>
>>> >
>>> > <meta>
>>> >
>>> >  <resource-id>my-default-map</resource-id>
>>> >
>>> >  <tag>aab875ef69c87d012</tag>
>>> >
>>> > </meta>
>>> >
>>> > <network-map>
>>> >
>>> >  <src>PID1</src>
>>> >
>>> >  <dsts>PID1</dsts>
>>> >
>>> >  <dsts>PID2</dsts>
>>> >
>>> >  <dsts>PID3</dsts>
>>> >
>>> > </network-map>
>>> >
>>> > <network-map>
>>> >
>>> >  <src>PID2</src>
>>> >
>>> >  <dsts>PID1</dsts>
>>> >
>>> >  <dsts>PID3</dsts>
>>> >
>>> > </network-map>
>>> >
>>> > <network-map>
>>> >
>>> >  <src>PID3</src>
>>> >
>>> >  <dsts>PID2</dsts>
>>> >
>>> >  <dsts>PID3</dsts>
>>> >
>>> > </network-map>
>>> >
>>> > This proves that the message encoding condition is a sufficient
>>> condition
>>> > for the JSON object to have a YANG model.
>>> >
>>> > Note the model generated is very crude and lose almost all constraints
>>> and
>>> > all inheritance features (if any), because it focuses on the syntax
>>> and is
>>> > essentially converted from an JSON object compliant with a protocol
>>> instead
>>> > of from the protocol itself. Hence this result is more useful in
>>> > determining which JSON based protocols cannot have a syntactically
>>> > equivalent YANG model, than in generating a good YANG model.
>>> >
>>> > 3.3. Conclusion
>>> >
>>> > Our claim holds. A JSON based protocol carried by HTTP can have
>>> > syntactically equivalent YANG model, if and only if all the keys in the
>>> > key-value pairs in the JSON message are pre-defined keywords.
>>> >
>>> > 4. Semantic equivalence
>>> >
>>> > For JSON based protocols that don't satisfy the message encoding
>>> condition,
>>> > it is still possible to have a semantically equivalent YANG model. All
>>> that
>>> > is required for the protocol compliant clients and the YANG model
>>> compliant
>>> > server to interoperate is an adapter which does the following:
>>> >
>>> > 1) translate FROM YANG server compliant response msg TO alto compliant
>>> > response msg
>>> >
>>> > 2) translate FROM alto compliant request msg TO YANG server compliant
>>> > request msg
>>> >
>>> > 4.1. Claim
>>> >
>>> > This adapter needs to be protocol-aware.
>>> >
>>> > Ideally, given any YANG model, we would like to be able to
>>> automatically
>>> > (or at least mechanically) generate this message adapter, which means
>>> not
>>> > looking at the protocol or its compliant msgs. However, without
>>> knowing the
>>> > specific protocol that we are working with (i.e. human intervention,
>>> i.e.
>>> > looking at the protocol compliant msgs), such an adapter cannot be
>>> > auto-generated.
>>> >
>>> > 4.2. Proof by Indistinguishability
>>> >
>>> > Suppose both the YANG server compliant msg m_y and the actually
>>> protocol
>>> > compliant msg m_p are in JSON (or have been encoded into JSON).
>>> Looking at
>>> > the differences between the two messages, call these differences {d1,
>>> d2,
>>> > ..., dn}. The goal for the auto-generated adapter would be to identify
>>> and
>>> > eliminate these differences. Construct a new JSON msg m' where all but
>>> one
>>> > difference di is the same as m_p and di is the same as the m_y. Without
>>> > looking at the protocol (or m_p), the auto-generated adapter would not
>>> be
>>> > able to distinguish between m' and m_p in its translation process,
>>> which
>>> > means, it won't be able to tell whether it should change di or not.
>>> Hence,
>>> > such an adapter must be protocol-aware.
>>> >
>>> > A good example is the dependent-vtag in the ALTO protocol:
>>> >
>>> > "dependent-vtag" : [
>>> >
>>> >  {
>>> >
>>> >    "resource-id" : "my-network-map",
>>> >
>>> >    "tag" : "abcd1234"
>>> >
>>> >  }
>>> >
>>> > ]
>>> >
>>> > It was specified this way in the alto protocol. However, it could
>>> > conceivably be the case that it was originally the following map
>>> structure,
>>> > and was converted into the above encoding because of the map->list+key
>>> > issue. (This case is actually one of the few differences in the m_y
>>> and m_p
>>> > where the adapter does not need to convert it back to a map structure.)
>>> >
>>> > "dependent-vtag" : {
>>> >
>>> >  "my-network-map" : {
>>> >
>>> >    "tag" : "abcd1234"
>>> >
>>> >  }
>>> >
>>> > }
>>> >
>>> > Without knowing the protocol, there is no way to tell.
>>> >
>>> > 5. Ramifications
>>> >
>>> > We now understand the basic condition for a JSON based protocol to
>>> have a
>>> > YANG Model. For the protocols that don't meet this condition, there
>>> can be
>>> > a semantic equivalent YANG model, but there won't be a generic process
>>> of
>>> > generating the adapter for all such protocols.
>>> > _______________________________________________
>>> > netmod mailing list
>>> > netmod@ietf.org
>>> > https://www.ietf.org/mailman/listinfo/netmod
>>>
>>> --
>>> Ladislav Lhotka, CZ.NIC Labs
>>> PGP Key ID: E74E8C0C
>>>
>>> _______________________________________________
>>> netmod mailing list
>>> netmod@ietf.org
>>> https://www.ietf.org/mailman/listinfo/netmod
>>>
>>
>>
>

--001a1134a5364ec68f0505dc9acd
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Mon, Oct 20, 2014 at 8:33 AM, Xiao SHI <span dir=3D"ltr">&lt;<a href=
=3D"mailto:xiao.shi@yale.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt;</=
span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e=
x;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hi Andy,<di=
v><br></div><div>I agree with you. Just to clarify, what I am trying to do =
is to use YANG data structures for the protocol whose message encoding is J=
SON. I am not trying to use JSON as a data structure. Does this make sense?=
</div><div><br></div></div></blockquote><div><br></div><div>yes -- so you w=
ant to write the YANG module that corresponds to the</div><div>existing JSO=
N usage. Not extend YANG to support all possible JSON usage.</div><div>Good=
.</div><div><br></div><div><br></div><div>&nbsp;</div><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex"><div dir=3D"ltr"><div></div><div>Best,</div><div>Xiao</div></div>=
</blockquote><div><br></div><div>Andy</div><div>&nbsp;</div><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex"><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">O=
n Mon, Oct 20, 2014 at 11:29 AM, Andy Bierman <span dir=3D"ltr">&lt;<a href=
=3D"mailto:andy@yumaworks.com" target=3D"_blank">andy@yumaworks.com</a>&gt;=
</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .=
8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><div =
class=3D"gmail_extra"><br><div class=3D"gmail_quote"><span>On Mon, Oct 20, =
2014 at 6:23 AM, Ladislav Lhotka <span dir=3D"ltr">&lt;<a href=3D"mailto:lh=
otka@nic.cz" target=3D"_blank">lhotka@nic.cz</a>&gt;</span> wrote:<br></spa=
n><span><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border=
-left:1px #ccc solid;padding-left:1ex">Xiao SHI &lt;<a href=3D"mailto:xiao.=
shi@yale.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt; writes:<br>
<br>
&gt; Hi folks,<br>
&gt;<br>
&gt;<br>
&gt; As a few of us were working on modeling the ALTO protocol using YANG, =
we<br>
&gt; were pondering on a more general question: can YANG model all JSON bas=
ed<br>
&gt; protocols? What is the condition for a JSON based protocol (at least t=
he<br>
&gt; message format) to have an syntactically equivalent, hence interoperab=
le,<br>
&gt; YANG model with JSON encoding? Alternatively, in order to interoperate=
,<br>
&gt; semantic equivalence might be sufficient, is there any condition for<b=
r>
&gt; semantic equivalence?<br>
&gt;<br>
&gt;<br>
&gt; tl;dr: A JSON based protocol carried by HTTP can have syntactically<br=
>
&gt; equivalent YANG model, if and only if all the keys in the key-value pa=
irs<br>
&gt; in the JSON message are pre-defined keywords in the protocol.<br>
&gt;<br>
<br>
Generating a YANG data model from existing instance data seems backwards<br=
>
to me, although Examplotron (<a href=3D"http://examplotron.org" target=3D"_=
blank">http://examplotron.org</a>) does something quite<br>
similar. In any case, it might be quite challenging because YANG isn&#39;t<=
br>
intended as a general schema language. Your observation above is true<br>
but it is just one aspect of the problem. For instance<br>
<br>
&quot;foo&quot;: [ { &quot;bar&quot;: 1 }, 2 ]<br>
<br>
or<br>
<br>
&quot;foo&quot;: null<br>
<br>
cannot be modelled in YANG using the encoding of<br>
draft-ietf-netmod-yang-json.<br>
<br></blockquote><div><br></div><div><br></div></span><div>I think perhaps =
RESTCONF is overloading JSON and this has led to some confusion.</div><div>=
RESTCONF uses JSON strictly as an encoding format, not a data structure.&nb=
sp; JSON is just</div><div>the message encoding. The corresponding instance=
 document must conform to</div><div>the YANG definitions (not just be valid=
 JSON).</div><div><br></div><div>A protocol should pick between YANG data s=
tructures and JSON data structures,</div><div>and not try to do both.</div>=
<div><br></div><div><br></div><div>&nbsp;<br></div><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex">
Lada<br>
<br></blockquote><span><font color=3D"#888888"><div><br></div><div>Andy</di=
v></font></span><div><div><div>&nbsp;</div><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
&gt;<br>
&gt; We&#39;ve come up with a few ideas, and a few things below are work in=
<br>
&gt; progress, but we would love your feedback!<br>
&gt;<br>
&gt;<br>
&gt; Thank you!<br>
&gt;<br>
&gt; Xiao<br>
&gt;<br>
&gt;<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
&gt;<br>
&gt; 1. Introduction.<br>
&gt;<br>
&gt; JavaScript Object Notation (JSON) has been a popular choice as the mes=
sage<br>
&gt; encoding for many network protocols such as the Application Layer Traf=
fic<br>
&gt; Optimization (ALTO) protocol, the Content Delivery Networks Interconne=
ction<br>
&gt; (CDNi) protocol, etc.<br>
&gt;<br>
&gt; Meanwhile, there are broad interests in the networking community to us=
e<br>
&gt; YANG to define data model so that one can use YANG related tools such =
as<br>
&gt; OpenDayLight controller. Although YANG itself is XML based, there have=
 been<br>
&gt; efforts to model JSON content using YANG [draft-ietf-netmod-yang-json-=
01].<br>
&gt;<br>
&gt; A natural question rises: can YANG model all JSON based protocols? Wha=
t is<br>
&gt; the condition for a JSON based protocol (at least the message format) =
to<br>
&gt; have an syntactically equivalent, hence interoperable, YANG model with=
 JSON<br>
&gt; encoding? Alternatively, in order to interoperate, semantic equivalenc=
e<br>
&gt; might be sufficient, is there any condition for semantic equivalence?<=
br>
&gt;<br>
&gt; 2. Claim<br>
&gt;<br>
&gt; A JSON based protocol carried by HTTP can have syntactically equivalen=
t<br>
&gt; YANG model, if and only if:<br>
&gt;<br>
&gt; (1) the message encoding condition is met;<br>
&gt;<br>
&gt; (2) the uri condition is met.<br>
&gt;<br>
&gt; 2.1. The message encoding condition<br>
&gt;<br>
&gt; The JSON message encoding MUST not contain a variable as a key in a JS=
ON<br>
&gt; object key-value pair. In other words, the keys in the JSON message mu=
st be<br>
&gt; an already defined constant (or keyword) in the message format of the<=
br>
&gt; protocol.<br>
&gt;<br>
&gt; For example, if I have a protocol where &ldquo;network-map&rdquo;, &ld=
quo;src&rdquo;, and &ldquo;dsts&rdquo;<br>
&gt; are defined keywords, JSON text A meets the condition whereas B does n=
ot<br>
&gt; because &ldquo;PID1&rdquo; and &ldquo;PID2&rdquo; are not protocol key=
words (they are resource IDs).<br>
&gt;<br>
&gt; A:<br>
&gt;<br>
&gt; {<br>
&gt;<br>
&gt;&nbsp; &ldquo;network-map&rdquo;: [<br>
&gt;<br>
&gt;&nbsp; &nbsp; {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;src&rdquo;: &ldquo;PID1&rdquo;,<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;dsts&rdquo;: [&ldquo;PID2&rdquo;, &ldquo;PI=
D3&rdquo;]<br>
&gt;<br>
&gt;&nbsp; &nbsp; },<br>
&gt;<br>
&gt;&nbsp; &nbsp; {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;src&rdquo;: &ldquo;PID2&rdquo;,<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;dsts&rdquo;: [&ldquo;PID3&rdquo;, &ldquo;PI=
D4&rdquo;]<br>
&gt;<br>
&gt;&nbsp; &nbsp; }<br>
&gt;<br>
&gt;&nbsp; ]<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; B:<br>
&gt;<br>
&gt;<br>
&gt; {<br>
&gt;<br>
&gt;&nbsp; &ldquo;network-map&rdquo;: [<br>
&gt;<br>
&gt;&nbsp; &nbsp; &ldquo;PID1: [&ldquo;PID2&rdquo;, &ldquo;PID3&rdquo;],<br=
>
&gt;<br>
&gt;&nbsp; &nbsp; &ldquo;PID2&rdquo;: [&ldquo;PID3&rdquo;, &ldquo;PID4&rdqu=
o;]<br>
&gt;<br>
&gt;&nbsp; ]<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt;&gt;From this we know that since ALTO protocol uses encoding B, there c=
annot be<br>
&gt; a syntactically equivalent YANG model.<br>
&gt;<br>
&gt; 2.2 The URI condition<br>
&gt;<br>
&gt; Some of the YANG-related protocols might have URI constraints, e.g.<br=
>
&gt; RESTCONF. For now, we assume either that the JSON-based protocol URI c=
ould<br>
&gt; be conformed to RESTCONF compliant uri, or that the server could have =
a<br>
&gt; routing mapping between the protocol compliant uri and the RESTCONF<br=
>
&gt; compliant uri, hence this condition would not be an issue, which allow=
s us<br>
&gt; to focus on the message encoding condition.<br>
&gt;<br>
&gt; 3. Proof<br>
&gt;<br>
&gt; 3.1. The message encoding condition is necessary.<br>
&gt;<br>
&gt; We first note that this condition is a necessary condition for a JSON =
based<br>
&gt; protocol to have a syntactically equivalent YANG model by proving its<=
br>
&gt; contrapositive.<br>
&gt;<br>
&gt; If one of the keys in the key-value pair in the JSON document is not<b=
r>
&gt; pre-defined, the corresponding XML tags will not be pre-defined keywor=
ds.<br>
&gt; Therefore, it would not possible to model it in YANG without using<br>
&gt; YANG&rsquo;s anyxml<br>
&gt; statement (which allows arbitrary XML content).<br>
&gt;<br>
&gt; However, using the anyxml statement would defeat our purpose of modeli=
ng<br>
&gt; the data as it allows arbitrary XML content, and will not be helpful i=
n the<br>
&gt; subsequent parsing process.<br>
&gt;<br>
&gt; 3.2. The message encoding condition is sufficient.<br>
&gt;<br>
&gt; We prove this by providing a translation procedure from a JSON message=
 that<br>
&gt; is compliant with the protocol we are trying to model, to a custom jav=
a<br>
&gt; class that can be used for Jackson data binding, then to a YANG model.=
<br>
&gt;<br>
&gt; We note that the middle step of translating to and from the custom par=
ser<br>
&gt; class is not necessary, but it will be useful.<br>
&gt;<br>
&gt; 3.2.1. motivation<br>
&gt;<br>
&gt; JSON data binding is the process of binding data structures (objects,<=
br>
&gt; arrays, etc.) in JSON to the appropriate data structures in the server=
<br>
&gt; (e.g. java classes, database tables, etc.) in parsing the JSON text. I=
n<br>
&gt; order to process JSON messages in a meaningful manner, data binding is=
<br>
&gt; necessary. Even if the binding is not explicit, the server would need =
to do<br>
&gt; it eventually. For example, one can read JSON content in a stream with=
out<br>
&gt; binding it to the java classes, but eventually in order to make sense =
of<br>
&gt; the data, the server would eventually have to organize it, which is ro=
ughly<br>
&gt; analogous to data binding upfront. Popular choices for JSON parsing an=
d<br>
&gt; data binding include jackson and gson.<br>
&gt;<br>
&gt; We use Jackson full data binding as our approach. Full data binding bi=
nds<br>
&gt; JSON content into plain old java objects (POJOs), i.e. this custom par=
ser<br>
&gt; class can neither extend nor implement any other class. Jackson uses<b=
r>
&gt; ObjectMapper with the custom parser class to parse JSON content into t=
his<br>
&gt; class.<br>
&gt;<br>
&gt; 3.2.2. The message encoding condition<br>
&gt;<br>
&gt; The message encoding condition is that all keys in each key-value pair=
 in<br>
&gt; the JSON text must be pre-defined keywords. As the keys will become ei=
ther<br>
&gt; class names and instance variable names, or be keys in the java maps, =
it is<br>
&gt; easy to see that the condition is equivalent to &ldquo;there exists a =
full data<br>
&gt; binding in Jackson custom parser class without using any map structure=
s<br>
&gt; (Map&lt;String, ?&gt;).&rdquo;<br>
&gt;<br>
&gt; 3.2.3. Proof<br>
&gt;<br>
&gt; We provide a recursive binding process from a JSON object to the Jacks=
on<br>
&gt; custom parser class to be used by Jackson ObjectMapper.<br>
&gt;<br>
&gt; Type determine_type(value) {<br>
&gt;<br>
&gt;&nbsp; if (value is of a primitive type, i.e. string, number, boolean, =
null) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; return the corresponding java primitive type;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt;&nbsp; if (value is a JSON object) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; return build_parser_class(value).class;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt;&nbsp; if (value is an array) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; return ArrayList&lt;T&gt; where T=3Ddetermine_type(value[=
0]);<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt;&nbsp; // should not reach here.<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Class build_parser_class(JSONObject obj) {<br>
&gt;<br>
&gt;&nbsp; create custom class C;<br>
&gt;<br>
&gt;&nbsp; for each key/value pair in the obj {<br>
&gt;<br>
&gt;&nbsp; &nbsp; add instance variable v in C;<br>
&gt;<br>
&gt;&nbsp; &nbsp; the name of variable v &lt;- key; // (__known__ a/c to ou=
r assumption)<br>
&gt;<br>
&gt;&nbsp; &nbsp; the type of variable v &lt;- determine_type(value);<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt;&nbsp; return C.class;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Naming:<br>
&gt;<br>
&gt; --change everything into CamelCase (i.e. remove dashes, etc.)<br>
&gt;<br>
&gt; --for instance variables, use &ldquo;my&rdquo; prefix, (e.g. myVariabl=
e, myNetworkMap,<br>
&gt; etc.)<br>
&gt;<br>
&gt; --for the custom class name, if the object is an element of the array,=
 use<br>
&gt; &ldquo;Element&rdquo; suffix.<br>
&gt;<br>
&gt; This is just one convention so that the next step proceeds smoothly. A=
s<br>
&gt; long as this naming translation is consistent with the naming stage in=
 the<br>
&gt; next step, it will work just fine.<br>
&gt;<br>
&gt; Example (a modified ALTO protocol network map example):<br>
&gt;<br>
&gt; JSON object:<br>
&gt;<br>
&gt; {<br>
&gt;<br>
&gt;&nbsp; &ldquo;meta&rdquo;: {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &ldquo;resource-id&rdquo;: &ldquo;my-default-map&rdquo;,<=
br>
&gt;<br>
&gt;&nbsp; &nbsp; &ldquo;tag&rdquo;: &ldquo;aab875ef69c87d012&rdquo;<br>
&gt;<br>
&gt;&nbsp; },<br>
&gt;<br>
&gt;&nbsp; &ldquo;network-map&rdquo;: [<br>
&gt;<br>
&gt;&nbsp; &nbsp; {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;src&rdquo;: &ldquo;PID1&rdquo;,<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;dsts&rdquo;: [&ldquo;PID1&rdquo;, &ldquo;PI=
D2&rdquo;, &ldquo;PID3&rdquo;]<br>
&gt;<br>
&gt;&nbsp; &nbsp; },<br>
&gt;<br>
&gt;&nbsp; &nbsp; {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;src&rdquo;: &ldquo;PID2&rdquo;,<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;dsts&rdquo;: [&ldquo;PID1&rdquo;, &ldquo;PI=
D3&rdquo;]<br>
&gt;<br>
&gt;&nbsp; &nbsp; },<br>
&gt;<br>
&gt;&nbsp; &nbsp; {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;src&rdquo;: &ldquo;PID3&rdquo;,<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;dsts&rdquo;: [&ldquo;PID2&rdquo;, &ldquo;PI=
D3&rdquo;]<br>
&gt;<br>
&gt;&nbsp; &nbsp; }<br>
&gt;<br>
&gt;&nbsp; ]<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Result of build_parser_class(obj):<br>
&gt;<br>
&gt; Class JSONObject {<br>
&gt;<br>
&gt;&nbsp; Meta myMeta;<br>
&gt;<br>
&gt;&nbsp; ArrayList&lt;NetworkMapElement&gt; myNetworkMap;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Class Meta {<br>
&gt;<br>
&gt;&nbsp; String myResourceId;<br>
&gt;<br>
&gt;&nbsp; String myTag;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Class NetworkMapElement {<br>
&gt;<br>
&gt;&nbsp; String mySrc;<br>
&gt;<br>
&gt;&nbsp; ArrayList&lt;String&gt; myDsts;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Now given the Jackson Parser Java Class, to get a syntactically equiva=
lent<br>
&gt; YANG model:<br>
&gt;<br>
&gt; YANGModel build_yang_model(Class C) {<br>
&gt;<br>
&gt;&nbsp; for each instance variable (Type, Name) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; if (Type is primitive type: string, number, boolean, null=
) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; add the following to the YANG module:<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;leaf Name { type &lt;YANG equivalent of Typ=
e&gt;; }&rdquo;<br>
&gt;<br>
&gt;&nbsp; &nbsp; }<br>
&gt;<br>
&gt;&nbsp; &nbsp; if (Type is an ArrayList&lt;TypeElement&gt;) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; if (TypeElement is primitive type) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp; add the following to the YANG module:<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp; &ldquo;leaf-list Name { type &lt;YANG equiv=
alent of TypeElement&gt;; }&rdquo;<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; } else {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp; // TypeElement is a custom parser class<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp; add the following to the YANG module:<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp; &ldquo;list Name { &lt;result from build_ya=
ng_model&lt;TypeElement.class&gt;&gt; }&rdquo;<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; }<br>
&gt;<br>
&gt;&nbsp; &nbsp; }<br>
&gt;<br>
&gt;&nbsp; &nbsp; if (Type is a custom parser class) {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; add the following to the YANG module:<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp; &ldquo;container Name { &lt;result from build_yang=
_model&lt;Type.class&gt;&gt; }&rdquo;<br>
&gt;<br>
&gt;&nbsp; &nbsp; }<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Result from the previous example:<br>
&gt;<br>
&gt; container meta {<br>
&gt;<br>
&gt;&nbsp; leaf resource-id {<br>
&gt;<br>
&gt;&nbsp; &nbsp; type string;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt;&nbsp; leaf tag {<br>
&gt;<br>
&gt;&nbsp; &nbsp; type string;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; list network-map {<br>
&gt;<br>
&gt;&nbsp; leaf src {<br>
&gt;<br>
&gt;&nbsp; &nbsp; type string;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt;&nbsp; leaf-list dsts {<br>
&gt;<br>
&gt;&nbsp; &nbsp; type string;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; This does validate the JSON document with XML-JSON encoding. For your<=
br>
&gt; reference, this is the XML document which validates:<br>
&gt;<br>
&gt; &lt;?xml version=3D&quot;1.0&quot; encoding=3D&quot;UTF-8&quot; ?&gt;<=
br>
&gt;<br>
&gt; &lt;meta&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;resource-id&gt;my-default-map&lt;/resource-id&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;tag&gt;aab875ef69c87d012&lt;/tag&gt;<br>
&gt;<br>
&gt; &lt;/meta&gt;<br>
&gt;<br>
&gt; &lt;network-map&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;src&gt;PID1&lt;/src&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;dsts&gt;PID1&lt;/dsts&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;dsts&gt;PID2&lt;/dsts&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;<br>
&gt; &lt;/network-map&gt;<br>
&gt;<br>
&gt; &lt;network-map&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;src&gt;PID2&lt;/src&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;dsts&gt;PID1&lt;/dsts&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;<br>
&gt; &lt;/network-map&gt;<br>
&gt;<br>
&gt; &lt;network-map&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;src&gt;PID3&lt;/src&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;dsts&gt;PID2&lt;/dsts&gt;<br>
&gt;<br>
&gt;&nbsp; &lt;dsts&gt;PID3&lt;/dsts&gt;<br>
&gt;<br>
&gt; &lt;/network-map&gt;<br>
&gt;<br>
&gt; This proves that the message encoding condition is a sufficient condit=
ion<br>
&gt; for the JSON object to have a YANG model.<br>
&gt;<br>
&gt; Note the model generated is very crude and lose almost all constraints=
 and<br>
&gt; all inheritance features (if any), because it focuses on the syntax an=
d is<br>
&gt; essentially converted from an JSON object compliant with a protocol in=
stead<br>
&gt; of from the protocol itself. Hence this result is more useful in<br>
&gt; determining which JSON based protocols cannot have a syntactically<br>
&gt; equivalent YANG model, than in generating a good YANG model.<br>
&gt;<br>
&gt; 3.3. Conclusion<br>
&gt;<br>
&gt; Our claim holds. A JSON based protocol carried by HTTP can have<br>
&gt; syntactically equivalent YANG model, if and only if all the keys in th=
e<br>
&gt; key-value pairs in the JSON message are pre-defined keywords.<br>
&gt;<br>
&gt; 4. Semantic equivalence<br>
&gt;<br>
&gt; For JSON based protocols that don&rsquo;t satisfy the message encoding=
 condition,<br>
&gt; it is still possible to have a semantically equivalent YANG model. All=
 that<br>
&gt; is required for the protocol compliant clients and the YANG model comp=
liant<br>
&gt; server to interoperate is an adapter which does the following:<br>
&gt;<br>
&gt; 1) translate FROM YANG server compliant response msg TO alto compliant=
<br>
&gt; response msg<br>
&gt;<br>
&gt; 2) translate FROM alto compliant request msg TO YANG server compliant<=
br>
&gt; request msg<br>
&gt;<br>
&gt; 4.1. Claim<br>
&gt;<br>
&gt; This adapter needs to be protocol-aware.<br>
&gt;<br>
&gt; Ideally, given any YANG model, we would like to be able to automatical=
ly<br>
&gt; (or at least mechanically) generate this message adapter, which means =
not<br>
&gt; looking at the protocol or its compliant msgs. However, without knowin=
g the<br>
&gt; specific protocol that we are working with (i.e. human intervention, i=
.e.<br>
&gt; looking at the protocol compliant msgs), such an adapter cannot be<br>
&gt; auto-generated.<br>
&gt;<br>
&gt; 4.2. Proof by Indistinguishability<br>
&gt;<br>
&gt; Suppose both the YANG server compliant msg m_y and the actually protoc=
ol<br>
&gt; compliant msg m_p are in JSON (or have been encoded into JSON). Lookin=
g at<br>
&gt; the differences between the two messages, call these differences {d1, =
d2,<br>
&gt; ..., dn}. The goal for the auto-generated adapter would be to identify=
 and<br>
&gt; eliminate these differences. Construct a new JSON msg m&#39; where all=
 but one<br>
&gt; difference di is the same as m_p and di is the same as the m_y. Withou=
t<br>
&gt; looking at the protocol (or m_p), the auto-generated adapter would not=
 be<br>
&gt; able to distinguish between m&#39; and m_p in its translation process,=
 which<br>
&gt; means, it won&#39;t be able to tell whether it should change di or not=
. Hence,<br>
&gt; such an adapter must be protocol-aware.<br>
&gt;<br>
&gt; A good example is the dependent-vtag in the ALTO protocol:<br>
&gt;<br>
&gt; &quot;dependent-vtag&quot; : [<br>
&gt;<br>
&gt;&nbsp; {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &quot;resource-id&quot; : &quot;my-network-map&quot;,<br>
&gt;<br>
&gt;&nbsp; &nbsp; &quot;tag&quot; : &quot;abcd1234&quot;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt; ]<br>
&gt;<br>
&gt; It was specified this way in the alto protocol. However, it could<br>
&gt; conceivably be the case that it was originally the following map struc=
ture,<br>
&gt; and was converted into the above encoding because of the map-&gt;list+=
key<br>
&gt; issue. (This case is actually one of the few differences in the m_y an=
d m_p<br>
&gt; where the adapter does not need to convert it back to a map structure.=
)<br>
&gt;<br>
&gt; &quot;dependent-vtag&quot; : {<br>
&gt;<br>
&gt;&nbsp; &quot;my-network-map&quot; : {<br>
&gt;<br>
&gt;&nbsp; &nbsp; &quot;tag&quot; : &quot;abcd1234&quot;<br>
&gt;<br>
&gt;&nbsp; }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; Without knowing the protocol, there is no way to tell.<br>
&gt;<br>
&gt; 5. Ramifications<br>
&gt;<br>
&gt; We now understand the basic condition for a JSON based protocol to hav=
e a<br>
&gt; YANG Model. For the protocols that don&rsquo;t meet this condition, th=
ere can be<br>
&gt; a semantic equivalent YANG model, but there won&rsquo;t be a generic p=
rocess of<br>
&gt; generating the adapter for all such protocols.<br>
&gt; _______________________________________________<br>
&gt; netmod mailing list<br>
&gt; <a href=3D"mailto:netmod@ietf.org" target=3D"_blank">netmod@ietf.org</=
a><br>
&gt; <a href=3D"https://www.ietf.org/mailman/listinfo/netmod" target=3D"_bl=
ank">https://www.ietf.org/mailman/listinfo/netmod</a><span class=3D"HOEnZb"=
><font color=3D"#888888"><br>
<span><font color=3D"#888888"><br>
--<br>
Ladislav Lhotka, CZ.NIC Labs<br>
PGP Key ID: E74E8C0C<br>
<br>
_______________________________________________<br>
netmod mailing list<br>
<a href=3D"mailto:netmod@ietf.org" target=3D"_blank">netmod@ietf.org</a><br=
>
<a href=3D"https://www.ietf.org/mailman/listinfo/netmod" target=3D"_blank">=
https://www.ietf.org/mailman/listinfo/netmod</a><br>
</font></span></font></span></blockquote></div></div></div><span class=3D"H=
OEnZb"><font color=3D"#888888"><br></font></span></div></div>
</blockquote></div><br></div>
</blockquote></div><br></div></div>

--001a1134a5364ec68f0505dc9acd--


From nobody Tue Oct 21 08:04:54 2014
Return-Path: <lhotka@nic.cz>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CD7D51A0264; Mon, 20 Oct 2014 08:57:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham
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 qr2IS3LfOzn1; Mon, 20 Oct 2014 08:57:54 -0700 (PDT)
Received: from trail.lhotka.name (trail.lhotka.name [77.48.224.143]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D0CD41A1B5F; Mon, 20 Oct 2014 08:56:37 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by trail.lhotka.name (Postfix) with ESMTP id A7CA35404BC; Mon, 20 Oct 2014 17:56:31 +0200 (CEST)
Received: from trail.lhotka.name ([127.0.0.1]) by localhost (trail.lhotka.name [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4rBb5bWfg1xS; Mon, 20 Oct 2014 17:56:25 +0200 (CEST)
Received: from localhost (unknown [172.29.2.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by trail.lhotka.name (Postfix) with ESMTPSA id A3A9E5400EE; Mon, 20 Oct 2014 17:56:25 +0200 (CEST)
From: Ladislav Lhotka <lhotka@nic.cz>
To: Xiao SHI <xiao.shi@yale.edu>
In-Reply-To: <CAFwJzZ=kv7_W=mrJz77Y1DTkL_Cq-o+B-FDJERy-8g-OCVbj5g@mail.gmail.com>
References: <CAFwJzZkAp-4umrrHZEY3qYuFCXu=+Pqbh8SeB=Qr=TTbQurj6A@mail.gmail.com> <m2tx2ynadg.fsf@nic.cz> <CAFwJzZ=kv7_W=mrJz77Y1DTkL_Cq-o+B-FDJERy-8g-OCVbj5g@mail.gmail.com>
User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.50.2 (x86_64-apple-darwin13.0.0)
Date: Mon, 20 Oct 2014 17:56:23 +0200
Message-ID: <m2k33uag60.fsf@nic.cz>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/NHcDurfRcFbhAM_ZidjWkv9vWwM
X-Mailman-Approved-At: Tue, 21 Oct 2014 08:04:32 -0700
Cc: Xiao SHI <xiao.shi@yale.edu>, IETF ALTO <alto@ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [alto] [netmod] Modeling JSON based protocols using YANG
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Oct 2014 15:57:58 -0000

Xiao SHI <xiao.shi@yale.edu> writes:

> Hi Lada,
>
> Thank you so much for your feedback!
>
> The motivation here is to produce a YANG model given a defined protocol,
> e.g. ALTO, CDNi, etc. This way, we may incorporate future protocols into
> ODL controllers or use other YANG related tools to handle those protocols.
> Hence the objective of the modeling is the protocol, not the messages. I =
am
> not suggesting to use YANG as a schema language.

Hmm, YANG was designed for modelling datastores and contents of protocol
messages, not protocols as such.

>
> The conditions discussed in this process will be helpful in the following
> sense:
> 1) disprove the possibility to get a syntactically equivalent YANG model
> from a JSON based protocol;
> 2) generate a Jackson JSON parser class and YANG model from the protocols
> that meet the criteria;
> 3) for designers of future protocols who are thinking of using YANG relat=
ed
> tools, set a guideline of what their messages should look like (or MUST n=
ot
> contain);
> 4) for the YANG/NETCONF WG, describing the compatibility issues that they
> might be interested in tackling for expanding YANG's usage.
>
> For this example, "foo": [ { "bar": 1 }, 2 ] is also not easy to do
> data-binding in the parser, because the elements of the array are not of
> the same type, which is indeed an assumption that I left out.
>
> For the {"foo=E2=80=9D:null} example, can't we model it using type empty?=
 That's
> equivalent to the XML element <foo /> right?

<foo/> corresponds to

"foo": [null]

Section 6.9 in draft-ietf-netmod-yang-json-01 gives the reasoning,
essentially it is because some software isn't able to distinguish

"foo": null

from "foo" being absent.

Lada
=20
>
> Cheers,
> Xiao
>
> On Mon, Oct 20, 2014 at 9:23 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:
>
>> Xiao SHI <xiao.shi@yale.edu> writes:
>>
>> > Hi folks,
>> >
>> >
>> > As a few of us were working on modeling the ALTO protocol using YANG, =
we
>> > were pondering on a more general question: can YANG model all JSON bas=
ed
>> > protocols? What is the condition for a JSON based protocol (at least t=
he
>> > message format) to have an syntactically equivalent, hence interoperab=
le,
>> > YANG model with JSON encoding? Alternatively, in order to interoperate,
>> > semantic equivalence might be sufficient, is there any condition for
>> > semantic equivalence?
>> >
>> >
>> > tl;dr: A JSON based protocol carried by HTTP can have syntactically
>> > equivalent YANG model, if and only if all the keys in the key-value pa=
irs
>> > in the JSON message are pre-defined keywords in the protocol.
>> >
>>
>> Generating a YANG data model from existing instance data seems backwards
>> to me, although Examplotron (http://examplotron.org) does something quite
>> similar. In any case, it might be quite challenging because YANG isn't
>> intended as a general schema language. Your observation above is true
>> but it is just one aspect of the problem. For instance
>>
>> "foo": [ { "bar": 1 }, 2 ]
>>
>> or
>>
>> "foo": null
>>
>> cannot be modelled in YANG using the encoding of
>> draft-ietf-netmod-yang-json.
>>
>> Lada
>>
>> >
>> > We've come up with a few ideas, and a few things below are work in
>> > progress, but we would love your feedback!
>> >
>> >
>> > Thank you!
>> >
>> > Xiao
>> >
>> >
>> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> >
>> > 1. Introduction.
>> >
>> > JavaScript Object Notation (JSON) has been a popular choice as the
>> message
>> > encoding for many network protocols such as the Application Layer Traf=
fic
>> > Optimization (ALTO) protocol, the Content Delivery Networks
>> Interconnection
>> > (CDNi) protocol, etc.
>> >
>> > Meanwhile, there are broad interests in the networking community to use
>> > YANG to define data model so that one can use YANG related tools such =
as
>> > OpenDayLight controller. Although YANG itself is XML based, there have
>> been
>> > efforts to model JSON content using YANG
>> [draft-ietf-netmod-yang-json-01].
>> >
>> > A natural question rises: can YANG model all JSON based protocols? What
>> is
>> > the condition for a JSON based protocol (at least the message format) =
to
>> > have an syntactically equivalent, hence interoperable, YANG model with
>> JSON
>> > encoding? Alternatively, in order to interoperate, semantic equivalence
>> > might be sufficient, is there any condition for semantic equivalence?
>> >
>> > 2. Claim
>> >
>> > A JSON based protocol carried by HTTP can have syntactically equivalent
>> > YANG model, if and only if:
>> >
>> > (1) the message encoding condition is met;
>> >
>> > (2) the uri condition is met.
>> >
>> > 2.1. The message encoding condition
>> >
>> > The JSON message encoding MUST not contain a variable as a key in a JS=
ON
>> > object key-value pair. In other words, the keys in the JSON message mu=
st
>> be
>> > an already defined constant (or keyword) in the message format of the
>> > protocol.
>> >
>> > For example, if I have a protocol where =E2=80=9Cnetwork-map=E2=80=9D,=
 =E2=80=9Csrc=E2=80=9D, and =E2=80=9Cdsts=E2=80=9D
>> > are defined keywords, JSON text A meets the condition whereas B does n=
ot
>> > because =E2=80=9CPID1=E2=80=9D and =E2=80=9CPID2=E2=80=9D are not prot=
ocol keywords (they are resource
>> IDs).
>> >
>> > A:
>> >
>> > {
>> >
>> >  =E2=80=9Cnetwork-map=E2=80=9D: [
>> >
>> >    {
>> >
>> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,
>> >
>> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=
=80=9D]
>> >
>> >    },
>> >
>> >    {
>> >
>> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,
>> >
>> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=E2=
=80=9D]
>> >
>> >    }
>> >
>> >  ]
>> >
>> > }
>> >
>> > B:
>> >
>> >
>> > {
>> >
>> >  =E2=80=9Cnetwork-map=E2=80=9D: [
>> >
>> >    =E2=80=9CPID1: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=9D],
>> >
>> >    =E2=80=9CPID2=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=E2=
=80=9D]
>> >
>> >  ]
>> >
>> > }
>> >
>> >>From this we know that since ALTO protocol uses encoding B, there cann=
ot
>> be
>> > a syntactically equivalent YANG model.
>> >
>> > 2.2 The URI condition
>> >
>> > Some of the YANG-related protocols might have URI constraints, e.g.
>> > RESTCONF. For now, we assume either that the JSON-based protocol URI
>> could
>> > be conformed to RESTCONF compliant uri, or that the server could have a
>> > routing mapping between the protocol compliant uri and the RESTCONF
>> > compliant uri, hence this condition would not be an issue, which allows
>> us
>> > to focus on the message encoding condition.
>> >
>> > 3. Proof
>> >
>> > 3.1. The message encoding condition is necessary.
>> >
>> > We first note that this condition is a necessary condition for a JSON
>> based
>> > protocol to have a syntactically equivalent YANG model by proving its
>> > contrapositive.
>> >
>> > If one of the keys in the key-value pair in the JSON document is not
>> > pre-defined, the corresponding XML tags will not be pre-defined keywor=
ds.
>> > Therefore, it would not possible to model it in YANG without using
>> > YANG=E2=80=99s anyxml
>> > statement (which allows arbitrary XML content).
>> >
>> > However, using the anyxml statement would defeat our purpose of modeli=
ng
>> > the data as it allows arbitrary XML content, and will not be helpful in
>> the
>> > subsequent parsing process.
>> >
>> > 3.2. The message encoding condition is sufficient.
>> >
>> > We prove this by providing a translation procedure from a JSON message
>> that
>> > is compliant with the protocol we are trying to model, to a custom java
>> > class that can be used for Jackson data binding, then to a YANG model.
>> >
>> > We note that the middle step of translating to and from the custom par=
ser
>> > class is not necessary, but it will be useful.
>> >
>> > 3.2.1. motivation
>> >
>> > JSON data binding is the process of binding data structures (objects,
>> > arrays, etc.) in JSON to the appropriate data structures in the server
>> > (e.g. java classes, database tables, etc.) in parsing the JSON text. In
>> > order to process JSON messages in a meaningful manner, data binding is
>> > necessary. Even if the binding is not explicit, the server would need =
to
>> do
>> > it eventually. For example, one can read JSON content in a stream with=
out
>> > binding it to the java classes, but eventually in order to make sense =
of
>> > the data, the server would eventually have to organize it, which is
>> roughly
>> > analogous to data binding upfront. Popular choices for JSON parsing and
>> > data binding include jackson and gson.
>> >
>> > We use Jackson full data binding as our approach. Full data binding bi=
nds
>> > JSON content into plain old java objects (POJOs), i.e. this custom par=
ser
>> > class can neither extend nor implement any other class. Jackson uses
>> > ObjectMapper with the custom parser class to parse JSON content into t=
his
>> > class.
>> >
>> > 3.2.2. The message encoding condition
>> >
>> > The message encoding condition is that all keys in each key-value pair=
 in
>> > the JSON text must be pre-defined keywords. As the keys will become
>> either
>> > class names and instance variable names, or be keys in the java maps, =
it
>> is
>> > easy to see that the condition is equivalent to =E2=80=9Cthere exists =
a full data
>> > binding in Jackson custom parser class without using any map structures
>> > (Map<String, ?>).=E2=80=9D
>> >
>> > 3.2.3. Proof
>> >
>> > We provide a recursive binding process from a JSON object to the Jacks=
on
>> > custom parser class to be used by Jackson ObjectMapper.
>> >
>> > Type determine_type(value) {
>> >
>> >  if (value is of a primitive type, i.e. string, number, boolean, null)=
 {
>> >
>> >    return the corresponding java primitive type;
>> >
>> >  }
>> >
>> >  if (value is a JSON object) {
>> >
>> >    return build_parser_class(value).class;
>> >
>> >  }
>> >
>> >  if (value is an array) {
>> >
>> >    return ArrayList<T> where T=3Ddetermine_type(value[0]);
>> >
>> >  }
>> >
>> >  // should not reach here.
>> >
>> > }
>> >
>> > Class build_parser_class(JSONObject obj) {
>> >
>> >  create custom class C;
>> >
>> >  for each key/value pair in the obj {
>> >
>> >    add instance variable v in C;
>> >
>> >    the name of variable v <- key; // (__known__ a/c to our assumption)
>> >
>> >    the type of variable v <- determine_type(value);
>> >
>> >  }
>> >
>> >  return C.class;
>> >
>> > }
>> >
>> > Naming:
>> >
>> > --change everything into CamelCase (i.e. remove dashes, etc.)
>> >
>> > --for instance variables, use =E2=80=9Cmy=E2=80=9D prefix, (e.g. myVar=
iable,
>> myNetworkMap,
>> > etc.)
>> >
>> > --for the custom class name, if the object is an element of the array,
>> use
>> > =E2=80=9CElement=E2=80=9D suffix.
>> >
>> > This is just one convention so that the next step proceeds smoothly. As
>> > long as this naming translation is consistent with the naming stage in
>> the
>> > next step, it will work just fine.
>> >
>> > Example (a modified ALTO protocol network map example):
>> >
>> > JSON object:
>> >
>> > {
>> >
>> >  =E2=80=9Cmeta=E2=80=9D: {
>> >
>> >    =E2=80=9Cresource-id=E2=80=9D: =E2=80=9Cmy-default-map=E2=80=9D,
>> >
>> >    =E2=80=9Ctag=E2=80=9D: =E2=80=9Caab875ef69c87d012=E2=80=9D
>> >
>> >  },
>> >
>> >  =E2=80=9Cnetwork-map=E2=80=9D: [
>> >
>> >    {
>> >
>> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,
>> >
>> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =E2=80=9CPID2=E2=
=80=9D, =E2=80=9CPID3=E2=80=9D]
>> >
>> >    },
>> >
>> >    {
>> >
>> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,
>> >
>> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =E2=80=9CPID3=E2=
=80=9D]
>> >
>> >    },
>> >
>> >    {
>> >
>> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID3=E2=80=9D,
>> >
>> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=
=80=9D]
>> >
>> >    }
>> >
>> >  ]
>> >
>> > }
>> >
>> > Result of build_parser_class(obj):
>> >
>> > Class JSONObject {
>> >
>> >  Meta myMeta;
>> >
>> >  ArrayList<NetworkMapElement> myNetworkMap;
>> >
>> > }
>> >
>> > Class Meta {
>> >
>> >  String myResourceId;
>> >
>> >  String myTag;
>> >
>> > }
>> >
>> > Class NetworkMapElement {
>> >
>> >  String mySrc;
>> >
>> >  ArrayList<String> myDsts;
>> >
>> > }
>> >
>> > Now given the Jackson Parser Java Class, to get a syntactically
>> equivalent
>> > YANG model:
>> >
>> > YANGModel build_yang_model(Class C) {
>> >
>> >  for each instance variable (Type, Name) {
>> >
>> >    if (Type is primitive type: string, number, boolean, null) {
>> >
>> >      add the following to the YANG module:
>> >
>> >      =E2=80=9Cleaf Name { type <YANG equivalent of Type>; }=E2=80=9D
>> >
>> >    }
>> >
>> >    if (Type is an ArrayList<TypeElement>) {
>> >
>> >      if (TypeElement is primitive type) {
>> >
>> >        add the following to the YANG module:
>> >
>> >        =E2=80=9Cleaf-list Name { type <YANG equivalent of TypeElement>=
; }=E2=80=9D
>> >
>> >      } else {
>> >
>> >        // TypeElement is a custom parser class
>> >
>> >        add the following to the YANG module:
>> >
>> >        =E2=80=9Clist Name { <result from build_yang_model<TypeElement.=
class>> }=E2=80=9D
>> >
>> >      }
>> >
>> >    }
>> >
>> >    if (Type is a custom parser class) {
>> >
>> >      add the following to the YANG module:
>> >
>> >      =E2=80=9Ccontainer Name { <result from build_yang_model<Type.clas=
s>> }=E2=80=9D
>> >
>> >    }
>> >
>> >  }
>> >
>> > }
>> >
>> > Result from the previous example:
>> >
>> > container meta {
>> >
>> >  leaf resource-id {
>> >
>> >    type string;
>> >
>> >  }
>> >
>> >  leaf tag {
>> >
>> >    type string;
>> >
>> >  }
>> >
>> > }
>> >
>> > list network-map {
>> >
>> >  leaf src {
>> >
>> >    type string;
>> >
>> >  }
>> >
>> >  leaf-list dsts {
>> >
>> >    type string;
>> >
>> >  }
>> >
>> > }
>> >
>> > This does validate the JSON document with XML-JSON encoding. For your
>> > reference, this is the XML document which validates:
>> >
>> > <?xml version=3D"1.0" encoding=3D"UTF-8" ?>
>> >
>> > <meta>
>> >
>> >  <resource-id>my-default-map</resource-id>
>> >
>> >  <tag>aab875ef69c87d012</tag>
>> >
>> > </meta>
>> >
>> > <network-map>
>> >
>> >  <src>PID1</src>
>> >
>> >  <dsts>PID1</dsts>
>> >
>> >  <dsts>PID2</dsts>
>> >
>> >  <dsts>PID3</dsts>
>> >
>> > </network-map>
>> >
>> > <network-map>
>> >
>> >  <src>PID2</src>
>> >
>> >  <dsts>PID1</dsts>
>> >
>> >  <dsts>PID3</dsts>
>> >
>> > </network-map>
>> >
>> > <network-map>
>> >
>> >  <src>PID3</src>
>> >
>> >  <dsts>PID2</dsts>
>> >
>> >  <dsts>PID3</dsts>
>> >
>> > </network-map>
>> >
>> > This proves that the message encoding condition is a sufficient condit=
ion
>> > for the JSON object to have a YANG model.
>> >
>> > Note the model generated is very crude and lose almost all constraints
>> and
>> > all inheritance features (if any), because it focuses on the syntax and
>> is
>> > essentially converted from an JSON object compliant with a protocol
>> instead
>> > of from the protocol itself. Hence this result is more useful in
>> > determining which JSON based protocols cannot have a syntactically
>> > equivalent YANG model, than in generating a good YANG model.
>> >
>> > 3.3. Conclusion
>> >
>> > Our claim holds. A JSON based protocol carried by HTTP can have
>> > syntactically equivalent YANG model, if and only if all the keys in the
>> > key-value pairs in the JSON message are pre-defined keywords.
>> >
>> > 4. Semantic equivalence
>> >
>> > For JSON based protocols that don=E2=80=99t satisfy the message encodi=
ng
>> condition,
>> > it is still possible to have a semantically equivalent YANG model. All
>> that
>> > is required for the protocol compliant clients and the YANG model
>> compliant
>> > server to interoperate is an adapter which does the following:
>> >
>> > 1) translate FROM YANG server compliant response msg TO alto compliant
>> > response msg
>> >
>> > 2) translate FROM alto compliant request msg TO YANG server compliant
>> > request msg
>> >
>> > 4.1. Claim
>> >
>> > This adapter needs to be protocol-aware.
>> >
>> > Ideally, given any YANG model, we would like to be able to automatical=
ly
>> > (or at least mechanically) generate this message adapter, which means =
not
>> > looking at the protocol or its compliant msgs. However, without knowing
>> the
>> > specific protocol that we are working with (i.e. human intervention, i=
.e.
>> > looking at the protocol compliant msgs), such an adapter cannot be
>> > auto-generated.
>> >
>> > 4.2. Proof by Indistinguishability
>> >
>> > Suppose both the YANG server compliant msg m_y and the actually protoc=
ol
>> > compliant msg m_p are in JSON (or have been encoded into JSON). Looking
>> at
>> > the differences between the two messages, call these differences {d1, =
d2,
>> > ..., dn}. The goal for the auto-generated adapter would be to identify
>> and
>> > eliminate these differences. Construct a new JSON msg m' where all but
>> one
>> > difference di is the same as m_p and di is the same as the m_y. Without
>> > looking at the protocol (or m_p), the auto-generated adapter would not=
 be
>> > able to distinguish between m' and m_p in its translation process, whi=
ch
>> > means, it won't be able to tell whether it should change di or not.
>> Hence,
>> > such an adapter must be protocol-aware.
>> >
>> > A good example is the dependent-vtag in the ALTO protocol:
>> >
>> > "dependent-vtag" : [
>> >
>> >  {
>> >
>> >    "resource-id" : "my-network-map",
>> >
>> >    "tag" : "abcd1234"
>> >
>> >  }
>> >
>> > ]
>> >
>> > It was specified this way in the alto protocol. However, it could
>> > conceivably be the case that it was originally the following map
>> structure,
>> > and was converted into the above encoding because of the map->list+key
>> > issue. (This case is actually one of the few differences in the m_y and
>> m_p
>> > where the adapter does not need to convert it back to a map structure.)
>> >
>> > "dependent-vtag" : {
>> >
>> >  "my-network-map" : {
>> >
>> >    "tag" : "abcd1234"
>> >
>> >  }
>> >
>> > }
>> >
>> > Without knowing the protocol, there is no way to tell.
>> >
>> > 5. Ramifications
>> >
>> > We now understand the basic condition for a JSON based protocol to hav=
e a
>> > YANG Model. For the protocols that don=E2=80=99t meet this condition, =
there can
>> be
>> > a semantic equivalent YANG model, but there won=E2=80=99t be a generic=
 process of
>> > generating the adapter for all such protocols.
>> > _______________________________________________
>> > netmod mailing list
>> > netmod@ietf.org
>> > https://www.ietf.org/mailman/listinfo/netmod
>>
>> --
>> Ladislav Lhotka, CZ.NIC Labs
>> PGP Key ID: E74E8C0C
>>

--=20
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C


From nobody Tue Oct 21 08:04:57 2014
Return-Path: <lhotka@nic.cz>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 05D6E1A03AA; Tue, 21 Oct 2014 02:31:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.3
X-Spam-Level: 
X-Spam-Status: No, score=-1.3 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, J_CHICKENPOX_46=0.6] 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 dXoziPKT2XY3; Tue, 21 Oct 2014 02:31:34 -0700 (PDT)
Received: from trail.lhotka.name (trail.lhotka.name [77.48.224.143]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 799561A064C; Tue, 21 Oct 2014 02:29:37 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by trail.lhotka.name (Postfix) with ESMTP id AA9FA54074A; Tue, 21 Oct 2014 11:29:35 +0200 (CEST)
Received: from trail.lhotka.name ([127.0.0.1]) by localhost (trail.lhotka.name [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cd+O1HZqnj3a; Tue, 21 Oct 2014 11:29:29 +0200 (CEST)
Received: from localhost (unknown [195.113.220.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by trail.lhotka.name (Postfix) with ESMTPSA id 5704A540336; Tue, 21 Oct 2014 11:29:27 +0200 (CEST)
From: Ladislav Lhotka <lhotka@nic.cz>
To: Xiao SHI <xiao.shi@yale.edu>
In-Reply-To: <CAFwJzZ=HVnXBUgQP9eNc2NZ=vZ+W6=NyqqVbyxyHn5wipxCUUg@mail.gmail.com>
References: <CAFwJzZkAp-4umrrHZEY3qYuFCXu=+Pqbh8SeB=Qr=TTbQurj6A@mail.gmail.com> <m2tx2ynadg.fsf@nic.cz> <CAFwJzZ=kv7_W=mrJz77Y1DTkL_Cq-o+B-FDJERy-8g-OCVbj5g@mail.gmail.com> <m2k33uag60.fsf@nic.cz> <CAFwJzZ=HVnXBUgQP9eNc2NZ=vZ+W6=NyqqVbyxyHn5wipxCUUg@mail.gmail.com>
User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.50.2 (x86_64-apple-darwin13.0.0)
Date: Tue, 21 Oct 2014 11:29:28 +0200
Message-ID: <m2siih4vpj.fsf@nic.cz>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/AAaPHrH110-5GvtfA2GsW38k_K4
X-Mailman-Approved-At: Tue, 21 Oct 2014 08:04:33 -0700
Cc: Xiao SHI <xiao.shi@yale.edu>, IETF ALTO <alto@ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [alto] [netmod] Modeling JSON based protocols using YANG
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 21 Oct 2014 09:31:39 -0000

Hi Xiao,

see inline.

Xiao SHI <xiao.shi@yale.edu> writes:

> Hi Lada,
>
> I agree with your statement that YANG is designed to model datastore and
> the protocol messages.
>
> Right now the question I am trying to answer is this scenario: we have the
> protocols (hence the protocol messages) first, and would like to know
> whether we would be able to use YANG to model the content messages (in
> order to use the YANG tools for this protocol, etc.). And the question is
> what are the conditions for JSON msgs to be able to be modeled by YANG.
>
> For JSON arrays:
> 0. a standalone non-object JSON value is not model-able in YANG:
> examples:
> --"foo"
> --14
> --[1,2,3]
> which translates to the following in XML:
> <0>1</0>
> <1>2</1>
> <2>3</2>
>
> This is why your example "foo": [ { "bar": 1 }, 2 ] cannot be
> modeled--because 2 is a standalone value and {"bar": 1} is an object,

Yes.

> otherwise there are following ways to model an array with a mix of elemen=
ts:
>
> 1. an array with only built-in types or derived types (standalone JSON
> values except for arrays and objects) can be modeled in YANG as the
> following:
> "foo" : [1, "abc", enum1]

It should be "foo" : [1, "abc", "enum1"]

>
> leaf-list foo {
>   type union {
>     type int64;
>     type string;
>     type enumeration {
>       enum enum1;
>     }
>   }
> }

Right.

>
> 2. an array of all objects
> (1) This structure is model-able as well, right?
> "foo": [{"a": 1}, {"a": 1, "b": 2}]
>
> list foo {
>   leaf a {
>     type int;
>   }
>   leaf b {
>     type int;
>   }
> }

Yes.

>
> (2) how about this?
> "foo": [{"a": 1, "b": 2, "c": 3}, {"c": 1, "b":3, "y": 2}]
>
> If the JSON-XML translate it to the following:
>         <foo>
> <a>1</a>
> <b>2</b>
> <c>3</c>
> </foo>
> <foo>
> <c>1</c>
> <b>3</b>
> <y>2</y>
> </foo>
> We can still model this using the choice statement, right?

Right.

>
> If the above statements about whether these JSON texts are model-able are
> correct, essentially the only JSON arrays that are not model-able are (a)
> those mixed with objects and a standalone non-object JSON value; and (b)
> those whose elements is an array. And this gap is caused by the difference
> between leaf-list modeling capabilities of handling arrays with non-objec=
t,
> non-array, standalone JSON values, and the list+choice modeling
> capabilities of modeling arrays with objects. Does this sound
> plausible?

It does, I am not aware of any other issues.

Cheers, Lada=20

>
> Cheers,
> Xiao
>
> On Mon, Oct 20, 2014 at 11:56 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:
>
>> Xiao SHI <xiao.shi@yale.edu> writes:
>>
>> > Hi Lada,
>> >
>> > Thank you so much for your feedback!
>> >
>> > The motivation here is to produce a YANG model given a defined protoco=
l,
>> > e.g. ALTO, CDNi, etc. This way, we may incorporate future protocols in=
to
>> > ODL controllers or use other YANG related tools to handle those
>> protocols.
>> > Hence the objective of the modeling is the protocol, not the messages.=
 I
>> am
>> > not suggesting to use YANG as a schema language.
>>
>> Hmm, YANG was designed for modelling datastores and contents of protocol
>> messages, not protocols as such.
>>
>> >
>> > The conditions discussed in this process will be helpful in the follow=
ing
>> > sense:
>> > 1) disprove the possibility to get a syntactically equivalent YANG mod=
el
>> > from a JSON based protocol;
>> > 2) generate a Jackson JSON parser class and YANG model from the protoc=
ols
>> > that meet the criteria;
>> > 3) for designers of future protocols who are thinking of using YANG
>> related
>> > tools, set a guideline of what their messages should look like (or MUST
>> not
>> > contain);
>> > 4) for the YANG/NETCONF WG, describing the compatibility issues that t=
hey
>> > might be interested in tackling for expanding YANG's usage.
>> >
>> > For this example, "foo": [ { "bar": 1 }, 2 ] is also not easy to do
>> > data-binding in the parser, because the elements of the array are not =
of
>> > the same type, which is indeed an assumption that I left out.
>> >
>> > For the {"foo=E2=80=9D:null} example, can't we model it using type emp=
ty? That's
>> > equivalent to the XML element <foo /> right?
>>
>> <foo/> corresponds to
>>
>> "foo": [null]
>>
>> Section 6.9 in draft-ietf-netmod-yang-json-01 gives the reasoning,
>> essentially it is because some software isn't able to distinguish
>>
>> "foo": null
>>
>> from "foo" being absent.
>>
>> Lada
>>
>> >
>> > Cheers,
>> > Xiao
>> >
>> > On Mon, Oct 20, 2014 at 9:23 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:
>> >
>> >> Xiao SHI <xiao.shi@yale.edu> writes:
>> >>
>> >> > Hi folks,
>> >> >
>> >> >
>> >> > As a few of us were working on modeling the ALTO protocol using YAN=
G,
>> we
>> >> > were pondering on a more general question: can YANG model all JSON
>> based
>> >> > protocols? What is the condition for a JSON based protocol (at least
>> the
>> >> > message format) to have an syntactically equivalent, hence
>> interoperable,
>> >> > YANG model with JSON encoding? Alternatively, in order to
>> interoperate,
>> >> > semantic equivalence might be sufficient, is there any condition for
>> >> > semantic equivalence?
>> >> >
>> >> >
>> >> > tl;dr: A JSON based protocol carried by HTTP can have syntactically
>> >> > equivalent YANG model, if and only if all the keys in the key-value
>> pairs
>> >> > in the JSON message are pre-defined keywords in the protocol.
>> >> >
>> >>
>> >> Generating a YANG data model from existing instance data seems backwa=
rds
>> >> to me, although Examplotron (http://examplotron.org) does something
>> quite
>> >> similar. In any case, it might be quite challenging because YANG isn't
>> >> intended as a general schema language. Your observation above is true
>> >> but it is just one aspect of the problem. For instance
>> >>
>> >> "foo": [ { "bar": 1 }, 2 ]
>> >>
>> >> or
>> >>
>> >> "foo": null
>> >>
>> >> cannot be modelled in YANG using the encoding of
>> >> draft-ietf-netmod-yang-json.
>> >>
>> >> Lada
>> >>
>> >> >
>> >> > We've come up with a few ideas, and a few things below are work in
>> >> > progress, but we would love your feedback!
>> >> >
>> >> >
>> >> > Thank you!
>> >> >
>> >> > Xiao
>> >> >
>> >> >
>> >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> >> >
>> >> > 1. Introduction.
>> >> >
>> >> > JavaScript Object Notation (JSON) has been a popular choice as the
>> >> message
>> >> > encoding for many network protocols such as the Application Layer
>> Traffic
>> >> > Optimization (ALTO) protocol, the Content Delivery Networks
>> >> Interconnection
>> >> > (CDNi) protocol, etc.
>> >> >
>> >> > Meanwhile, there are broad interests in the networking community to
>> use
>> >> > YANG to define data model so that one can use YANG related tools su=
ch
>> as
>> >> > OpenDayLight controller. Although YANG itself is XML based, there h=
ave
>> >> been
>> >> > efforts to model JSON content using YANG
>> >> [draft-ietf-netmod-yang-json-01].
>> >> >
>> >> > A natural question rises: can YANG model all JSON based protocols?
>> What
>> >> is
>> >> > the condition for a JSON based protocol (at least the message forma=
t)
>> to
>> >> > have an syntactically equivalent, hence interoperable, YANG model w=
ith
>> >> JSON
>> >> > encoding? Alternatively, in order to interoperate, semantic
>> equivalence
>> >> > might be sufficient, is there any condition for semantic equivalenc=
e?
>> >> >
>> >> > 2. Claim
>> >> >
>> >> > A JSON based protocol carried by HTTP can have syntactically
>> equivalent
>> >> > YANG model, if and only if:
>> >> >
>> >> > (1) the message encoding condition is met;
>> >> >
>> >> > (2) the uri condition is met.
>> >> >
>> >> > 2.1. The message encoding condition
>> >> >
>> >> > The JSON message encoding MUST not contain a variable as a key in a
>> JSON
>> >> > object key-value pair. In other words, the keys in the JSON message
>> must
>> >> be
>> >> > an already defined constant (or keyword) in the message format of t=
he
>> >> > protocol.
>> >> >
>> >> > For example, if I have a protocol where =E2=80=9Cnetwork-map=E2=80=
=9D, =E2=80=9Csrc=E2=80=9D, and
>> =E2=80=9Cdsts=E2=80=9D
>> >> > are defined keywords, JSON text A meets the condition whereas B does
>> not
>> >> > because =E2=80=9CPID1=E2=80=9D and =E2=80=9CPID2=E2=80=9D are not p=
rotocol keywords (they are resource
>> >> IDs).
>> >> >
>> >> > A:
>> >> >
>> >> > {
>> >> >
>> >> >  =E2=80=9Cnetwork-map=E2=80=9D: [
>> >> >
>> >> >    {
>> >> >
>> >> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,
>> >> >
>> >> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=
=E2=80=9D]
>> >> >
>> >> >    },
>> >> >
>> >> >    {
>> >> >
>> >> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,
>> >> >
>> >> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=
=E2=80=9D]
>> >> >
>> >> >    }
>> >> >
>> >> >  ]
>> >> >
>> >> > }
>> >> >
>> >> > B:
>> >> >
>> >> >
>> >> > {
>> >> >
>> >> >  =E2=80=9Cnetwork-map=E2=80=9D: [
>> >> >
>> >> >    =E2=80=9CPID1: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=E2=80=9D],
>> >> >
>> >> >    =E2=80=9CPID2=E2=80=9D: [=E2=80=9CPID3=E2=80=9D, =E2=80=9CPID4=
=E2=80=9D]
>> >> >
>> >> >  ]
>> >> >
>> >> > }
>> >> >
>> >> >>From this we know that since ALTO protocol uses encoding B, there
>> cannot
>> >> be
>> >> > a syntactically equivalent YANG model.
>> >> >
>> >> > 2.2 The URI condition
>> >> >
>> >> > Some of the YANG-related protocols might have URI constraints, e.g.
>> >> > RESTCONF. For now, we assume either that the JSON-based protocol URI
>> >> could
>> >> > be conformed to RESTCONF compliant uri, or that the server could ha=
ve
>> a
>> >> > routing mapping between the protocol compliant uri and the RESTCONF
>> >> > compliant uri, hence this condition would not be an issue, which
>> allows
>> >> us
>> >> > to focus on the message encoding condition.
>> >> >
>> >> > 3. Proof
>> >> >
>> >> > 3.1. The message encoding condition is necessary.
>> >> >
>> >> > We first note that this condition is a necessary condition for a JS=
ON
>> >> based
>> >> > protocol to have a syntactically equivalent YANG model by proving i=
ts
>> >> > contrapositive.
>> >> >
>> >> > If one of the keys in the key-value pair in the JSON document is not
>> >> > pre-defined, the corresponding XML tags will not be pre-defined
>> keywords.
>> >> > Therefore, it would not possible to model it in YANG without using
>> >> > YANG=E2=80=99s anyxml
>> >> > statement (which allows arbitrary XML content).
>> >> >
>> >> > However, using the anyxml statement would defeat our purpose of
>> modeling
>> >> > the data as it allows arbitrary XML content, and will not be helpful
>> in
>> >> the
>> >> > subsequent parsing process.
>> >> >
>> >> > 3.2. The message encoding condition is sufficient.
>> >> >
>> >> > We prove this by providing a translation procedure from a JSON mess=
age
>> >> that
>> >> > is compliant with the protocol we are trying to model, to a custom
>> java
>> >> > class that can be used for Jackson data binding, then to a YANG mod=
el.
>> >> >
>> >> > We note that the middle step of translating to and from the custom
>> parser
>> >> > class is not necessary, but it will be useful.
>> >> >
>> >> > 3.2.1. motivation
>> >> >
>> >> > JSON data binding is the process of binding data structures (object=
s,
>> >> > arrays, etc.) in JSON to the appropriate data structures in the ser=
ver
>> >> > (e.g. java classes, database tables, etc.) in parsing the JSON text.
>> In
>> >> > order to process JSON messages in a meaningful manner, data binding=
 is
>> >> > necessary. Even if the binding is not explicit, the server would ne=
ed
>> to
>> >> do
>> >> > it eventually. For example, one can read JSON content in a stream
>> without
>> >> > binding it to the java classes, but eventually in order to make sen=
se
>> of
>> >> > the data, the server would eventually have to organize it, which is
>> >> roughly
>> >> > analogous to data binding upfront. Popular choices for JSON parsing
>> and
>> >> > data binding include jackson and gson.
>> >> >
>> >> > We use Jackson full data binding as our approach. Full data binding
>> binds
>> >> > JSON content into plain old java objects (POJOs), i.e. this custom
>> parser
>> >> > class can neither extend nor implement any other class. Jackson uses
>> >> > ObjectMapper with the custom parser class to parse JSON content into
>> this
>> >> > class.
>> >> >
>> >> > 3.2.2. The message encoding condition
>> >> >
>> >> > The message encoding condition is that all keys in each key-value
>> pair in
>> >> > the JSON text must be pre-defined keywords. As the keys will become
>> >> either
>> >> > class names and instance variable names, or be keys in the java map=
s,
>> it
>> >> is
>> >> > easy to see that the condition is equivalent to =E2=80=9Cthere exis=
ts a full
>> data
>> >> > binding in Jackson custom parser class without using any map
>> structures
>> >> > (Map<String, ?>).=E2=80=9D
>> >> >
>> >> > 3.2.3. Proof
>> >> >
>> >> > We provide a recursive binding process from a JSON object to the
>> Jackson
>> >> > custom parser class to be used by Jackson ObjectMapper.
>> >> >
>> >> > Type determine_type(value) {
>> >> >
>> >> >  if (value is of a primitive type, i.e. string, number, boolean,
>> null) {
>> >> >
>> >> >    return the corresponding java primitive type;
>> >> >
>> >> >  }
>> >> >
>> >> >  if (value is a JSON object) {
>> >> >
>> >> >    return build_parser_class(value).class;
>> >> >
>> >> >  }
>> >> >
>> >> >  if (value is an array) {
>> >> >
>> >> >    return ArrayList<T> where T=3Ddetermine_type(value[0]);
>> >> >
>> >> >  }
>> >> >
>> >> >  // should not reach here.
>> >> >
>> >> > }
>> >> >
>> >> > Class build_parser_class(JSONObject obj) {
>> >> >
>> >> >  create custom class C;
>> >> >
>> >> >  for each key/value pair in the obj {
>> >> >
>> >> >    add instance variable v in C;
>> >> >
>> >> >    the name of variable v <- key; // (__known__ a/c to our assumpti=
on)
>> >> >
>> >> >    the type of variable v <- determine_type(value);
>> >> >
>> >> >  }
>> >> >
>> >> >  return C.class;
>> >> >
>> >> > }
>> >> >
>> >> > Naming:
>> >> >
>> >> > --change everything into CamelCase (i.e. remove dashes, etc.)
>> >> >
>> >> > --for instance variables, use =E2=80=9Cmy=E2=80=9D prefix, (e.g. my=
Variable,
>> >> myNetworkMap,
>> >> > etc.)
>> >> >
>> >> > --for the custom class name, if the object is an element of the arr=
ay,
>> >> use
>> >> > =E2=80=9CElement=E2=80=9D suffix.
>> >> >
>> >> > This is just one convention so that the next step proceeds smoothly.
>> As
>> >> > long as this naming translation is consistent with the naming stage=
 in
>> >> the
>> >> > next step, it will work just fine.
>> >> >
>> >> > Example (a modified ALTO protocol network map example):
>> >> >
>> >> > JSON object:
>> >> >
>> >> > {
>> >> >
>> >> >  =E2=80=9Cmeta=E2=80=9D: {
>> >> >
>> >> >    =E2=80=9Cresource-id=E2=80=9D: =E2=80=9Cmy-default-map=E2=80=9D,
>> >> >
>> >> >    =E2=80=9Ctag=E2=80=9D: =E2=80=9Caab875ef69c87d012=E2=80=9D
>> >> >
>> >> >  },
>> >> >
>> >> >  =E2=80=9Cnetwork-map=E2=80=9D: [
>> >> >
>> >> >    {
>> >> >
>> >> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID1=E2=80=9D,
>> >> >
>> >> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =E2=80=9CPID2=
=E2=80=9D, =E2=80=9CPID3=E2=80=9D]
>> >> >
>> >> >    },
>> >> >
>> >> >    {
>> >> >
>> >> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID2=E2=80=9D,
>> >> >
>> >> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID1=E2=80=9D, =E2=80=9CPID3=
=E2=80=9D]
>> >> >
>> >> >    },
>> >> >
>> >> >    {
>> >> >
>> >> >      =E2=80=9Csrc=E2=80=9D: =E2=80=9CPID3=E2=80=9D,
>> >> >
>> >> >      =E2=80=9Cdsts=E2=80=9D: [=E2=80=9CPID2=E2=80=9D, =E2=80=9CPID3=
=E2=80=9D]
>> >> >
>> >> >    }
>> >> >
>> >> >  ]
>> >> >
>> >> > }
>> >> >
>> >> > Result of build_parser_class(obj):
>> >> >
>> >> > Class JSONObject {
>> >> >
>> >> >  Meta myMeta;
>> >> >
>> >> >  ArrayList<NetworkMapElement> myNetworkMap;
>> >> >
>> >> > }
>> >> >
>> >> > Class Meta {
>> >> >
>> >> >  String myResourceId;
>> >> >
>> >> >  String myTag;
>> >> >
>> >> > }
>> >> >
>> >> > Class NetworkMapElement {
>> >> >
>> >> >  String mySrc;
>> >> >
>> >> >  ArrayList<String> myDsts;
>> >> >
>> >> > }
>> >> >
>> >> > Now given the Jackson Parser Java Class, to get a syntactically
>> >> equivalent
>> >> > YANG model:
>> >> >
>> >> > YANGModel build_yang_model(Class C) {
>> >> >
>> >> >  for each instance variable (Type, Name) {
>> >> >
>> >> >    if (Type is primitive type: string, number, boolean, null) {
>> >> >
>> >> >      add the following to the YANG module:
>> >> >
>> >> >      =E2=80=9Cleaf Name { type <YANG equivalent of Type>; }=E2=80=9D
>> >> >
>> >> >    }
>> >> >
>> >> >    if (Type is an ArrayList<TypeElement>) {
>> >> >
>> >> >      if (TypeElement is primitive type) {
>> >> >
>> >> >        add the following to the YANG module:
>> >> >
>> >> >        =E2=80=9Cleaf-list Name { type <YANG equivalent of TypeEleme=
nt>; }=E2=80=9D
>> >> >
>> >> >      } else {
>> >> >
>> >> >        // TypeElement is a custom parser class
>> >> >
>> >> >        add the following to the YANG module:
>> >> >
>> >> >        =E2=80=9Clist Name { <result from build_yang_model<TypeEleme=
nt.class>>
>> }=E2=80=9D
>> >> >
>> >> >      }
>> >> >
>> >> >    }
>> >> >
>> >> >    if (Type is a custom parser class) {
>> >> >
>> >> >      add the following to the YANG module:
>> >> >
>> >> >      =E2=80=9Ccontainer Name { <result from build_yang_model<Type.c=
lass>> }=E2=80=9D
>> >> >
>> >> >    }
>> >> >
>> >> >  }
>> >> >
>> >> > }
>> >> >
>> >> > Result from the previous example:
>> >> >
>> >> > container meta {
>> >> >
>> >> >  leaf resource-id {
>> >> >
>> >> >    type string;
>> >> >
>> >> >  }
>> >> >
>> >> >  leaf tag {
>> >> >
>> >> >    type string;
>> >> >
>> >> >  }
>> >> >
>> >> > }
>> >> >
>> >> > list network-map {
>> >> >
>> >> >  leaf src {
>> >> >
>> >> >    type string;
>> >> >
>> >> >  }
>> >> >
>> >> >  leaf-list dsts {
>> >> >
>> >> >    type string;
>> >> >
>> >> >  }
>> >> >
>> >> > }
>> >> >
>> >> > This does validate the JSON document with XML-JSON encoding. For yo=
ur
>> >> > reference, this is the XML document which validates:
>> >> >
>> >> > <?xml version=3D"1.0" encoding=3D"UTF-8" ?>
>> >> >
>> >> > <meta>
>> >> >
>> >> >  <resource-id>my-default-map</resource-id>
>> >> >
>> >> >  <tag>aab875ef69c87d012</tag>
>> >> >
>> >> > </meta>
>> >> >
>> >> > <network-map>
>> >> >
>> >> >  <src>PID1</src>
>> >> >
>> >> >  <dsts>PID1</dsts>
>> >> >
>> >> >  <dsts>PID2</dsts>
>> >> >
>> >> >  <dsts>PID3</dsts>
>> >> >
>> >> > </network-map>
>> >> >
>> >> > <network-map>
>> >> >
>> >> >  <src>PID2</src>
>> >> >
>> >> >  <dsts>PID1</dsts>
>> >> >
>> >> >  <dsts>PID3</dsts>
>> >> >
>> >> > </network-map>
>> >> >
>> >> > <network-map>
>> >> >
>> >> >  <src>PID3</src>
>> >> >
>> >> >  <dsts>PID2</dsts>
>> >> >
>> >> >  <dsts>PID3</dsts>
>> >> >
>> >> > </network-map>
>> >> >
>> >> > This proves that the message encoding condition is a sufficient
>> condition
>> >> > for the JSON object to have a YANG model.
>> >> >
>> >> > Note the model generated is very crude and lose almost all constrai=
nts
>> >> and
>> >> > all inheritance features (if any), because it focuses on the syntax
>> and
>> >> is
>> >> > essentially converted from an JSON object compliant with a protocol
>> >> instead
>> >> > of from the protocol itself. Hence this result is more useful in
>> >> > determining which JSON based protocols cannot have a syntactically
>> >> > equivalent YANG model, than in generating a good YANG model.
>> >> >
>> >> > 3.3. Conclusion
>> >> >
>> >> > Our claim holds. A JSON based protocol carried by HTTP can have
>> >> > syntactically equivalent YANG model, if and only if all the keys in
>> the
>> >> > key-value pairs in the JSON message are pre-defined keywords.
>> >> >
>> >> > 4. Semantic equivalence
>> >> >
>> >> > For JSON based protocols that don=E2=80=99t satisfy the message enc=
oding
>> >> condition,
>> >> > it is still possible to have a semantically equivalent YANG model. =
All
>> >> that
>> >> > is required for the protocol compliant clients and the YANG model
>> >> compliant
>> >> > server to interoperate is an adapter which does the following:
>> >> >
>> >> > 1) translate FROM YANG server compliant response msg TO alto compli=
ant
>> >> > response msg
>> >> >
>> >> > 2) translate FROM alto compliant request msg TO YANG server complia=
nt
>> >> > request msg
>> >> >
>> >> > 4.1. Claim
>> >> >
>> >> > This adapter needs to be protocol-aware.
>> >> >
>> >> > Ideally, given any YANG model, we would like to be able to
>> automatically
>> >> > (or at least mechanically) generate this message adapter, which mea=
ns
>> not
>> >> > looking at the protocol or its compliant msgs. However, without
>> knowing
>> >> the
>> >> > specific protocol that we are working with (i.e. human intervention,
>> i.e.
>> >> > looking at the protocol compliant msgs), such an adapter cannot be
>> >> > auto-generated.
>> >> >
>> >> > 4.2. Proof by Indistinguishability
>> >> >
>> >> > Suppose both the YANG server compliant msg m_y and the actually
>> protocol
>> >> > compliant msg m_p are in JSON (or have been encoded into JSON).
>> Looking
>> >> at
>> >> > the differences between the two messages, call these differences {d=
1,
>> d2,
>> >> > ..., dn}. The goal for the auto-generated adapter would be to ident=
ify
>> >> and
>> >> > eliminate these differences. Construct a new JSON msg m' where all =
but
>> >> one
>> >> > difference di is the same as m_p and di is the same as the m_y.
>> Without
>> >> > looking at the protocol (or m_p), the auto-generated adapter would
>> not be
>> >> > able to distinguish between m' and m_p in its translation process,
>> which
>> >> > means, it won't be able to tell whether it should change di or not.
>> >> Hence,
>> >> > such an adapter must be protocol-aware.
>> >> >
>> >> > A good example is the dependent-vtag in the ALTO protocol:
>> >> >
>> >> > "dependent-vtag" : [
>> >> >
>> >> >  {
>> >> >
>> >> >    "resource-id" : "my-network-map",
>> >> >
>> >> >    "tag" : "abcd1234"
>> >> >
>> >> >  }
>> >> >
>> >> > ]
>> >> >
>> >> > It was specified this way in the alto protocol. However, it could
>> >> > conceivably be the case that it was originally the following map
>> >> structure,
>> >> > and was converted into the above encoding because of the map->list+=
key
>> >> > issue. (This case is actually one of the few differences in the m_y
>> and
>> >> m_p
>> >> > where the adapter does not need to convert it back to a map
>> structure.)
>> >> >
>> >> > "dependent-vtag" : {
>> >> >
>> >> >  "my-network-map" : {
>> >> >
>> >> >    "tag" : "abcd1234"
>> >> >
>> >> >  }
>> >> >
>> >> > }
>> >> >
>> >> > Without knowing the protocol, there is no way to tell.
>> >> >
>> >> > 5. Ramifications
>> >> >
>> >> > We now understand the basic condition for a JSON based protocol to
>> have a
>> >> > YANG Model. For the protocols that don=E2=80=99t meet this conditio=
n, there
>> can
>> >> be
>> >> > a semantic equivalent YANG model, but there won=E2=80=99t be a gene=
ric
>> process of
>> >> > generating the adapter for all such protocols.
>> >> > _______________________________________________
>> >> > netmod mailing list
>> >> > netmod@ietf.org
>> >> > https://www.ietf.org/mailman/listinfo/netmod
>> >>
>> >> --
>> >> Ladislav Lhotka, CZ.NIC Labs
>> >> PGP Key ID: E74E8C0C
>> >>
>>
>> --
>> Ladislav Lhotka, CZ.NIC Labs
>> PGP Key ID: E74E8C0C
>>

--=20
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C


From nobody Thu Oct 23 02:34:31 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 16A531A89FA for <alto@ietfa.amsl.com>; Thu, 23 Oct 2014 02:34:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.522
X-Spam-Level: 
X-Spam-Status: No, score=0.522 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 zyW6gtpfRQAt for <alto@ietfa.amsl.com>; Thu, 23 Oct 2014 02:34:28 -0700 (PDT)
Received: from mail-yh0-x231.google.com (mail-yh0-x231.google.com [IPv6:2607:f8b0:4002:c01::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 97EBB1A89C4 for <alto@ietf.org>; Thu, 23 Oct 2014 02:34:28 -0700 (PDT)
Received: by mail-yh0-f49.google.com with SMTP id a41so526049yho.36 for <alto@ietf.org>; Thu, 23 Oct 2014 02:34:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:from:date:message-id:subject:to:cc:content-type;  bh=3byuW87ITZy1cwDFfYBXAAxO5zItaywx2Rf38mGEuso=; b=z6Q2l9OhZxtSvGLbTJU5KfQl/h4ZUcgfRK1JmeD4EJdsn4dRn3ESYyFgm4EhB9CH1c AJEgpEe8Tkg9UXh4RPPghsvTFf49S2Ry4lqVW6IRCYLQD1E3kdrhBYUrf6thY9SrM04x 5it8fWm5V/dtKMdzVvh26/qV+XZv3x9E/Dent/9KdQ+g0y4QDa6lUjFqVnIjGjqp/+oj siqz1H8IcIoQyYlpWHbOKI6OvrFJofSN65hTqKvhT7HXhP0vKVzIIbWvqix5y0QyLo9f yAa5sejoucjKUf20sYJD16a78zFNB+gxXXp7g3ZMoRASQU8ZnMY4tuv6A5y93vA3raIV Iwag==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:from:date:message-id:subject:to:cc:content-type;  bh=3byuW87ITZy1cwDFfYBXAAxO5zItaywx2Rf38mGEuso=; b=l6ZcXfUwNP7sLV8M32L96ShRvZohpz2dl9r2NgcytFw3jueJOXzaSQAcyVHjMweUUP NuL3tb+5tsanCWDs3AOMizufvho/Zb31zzyisUiCfvhntwYd+uNt0WknvcratEppKRxq kKGWaVWPTNeeSauExgSG0jb7bw5uBX4rN3P0o=
X-Received: by 10.236.208.68 with SMTP id p44mr2621063yho.151.1414056867963; Thu, 23 Oct 2014 02:34:27 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.221.193 with HTTP; Thu, 23 Oct 2014 02:34:07 -0700 (PDT)
From: Xiao SHI <xiao.shi@yale.edu>
Date: Thu, 23 Oct 2014 05:34:07 -0400
X-Google-Sender-Auth: OlMMxLT7aec1WhRf3jFiK3DdWdM
Message-ID: <CAFwJzZmb00=biL8+sfDKHdXC6g1XXwuE7gTxheNrkfBpks_XgQ@mail.gmail.com>
To: IETF ALTO <alto@ietf.org>
Content-Type: multipart/alternative; boundary=089e01537bb04ea971050613c5a6
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/vbS7XCtnNb8OJ_WsZ0TiqZ96Sfg
Cc: Wendy Roome <w.roome@alcatel-lucent.com>
Subject: [alto] Incremental Update/SSE Key Design Issue 1: Event subscription name in SSE
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Oct 2014 09:34:30 -0000

--089e01537bb04ea971050613c5a6
Content-Type: text/plain; charset=UTF-8

Hi all,

Wendy, Richard, and I are considering the incremental updates subscription
model for ALTO using Server-Sent Event (SSE) streams. In this model, the
client subscribes to an event stream, and the server push updates as events
via the stream.

We use an "event" field to encode the unique identifier of the resource
that the event should update, which should be a subset of {resource-id,
resource-parameters, input-parameters}. (The client also has the IRD in its
possession so that it can do certain look-ups).

We would like a __minimal__ unique identifier of each resource and each
resource object. One resource could have multiple objects, e.g. when the
"accepts" field is non-empty (i.e. they have input params), or they could
have filters etc. Below are the proposal solutions:

For full network/cost map objects, resource-id is sufficient.
object {
  ResourceID resource-id;
} NetworkMapEventName;

object {
  ResourceID resource-id;
} CostMapEventName;

For resource objects that have non-empty "accepts" field or filters (i.e.
input params) in the IRD, there are multiple solutions:

*Solution 1. put the the input params in the events field*
For  filtered network map objects, resource-id coupled with the pids for
the filter:
object {
  ResourceID resource-id;
  PIDName pids<0..*>;
  [AddressType address-types<0..*>;]
} FilteredNetworkMapEventName;

For filtered cost map objects, we need to identify the costmap objects and
the filter:
object {
  ResourceID resource-id;
  CostType cost-type;
  [JSONString constraints<0..*>;]
  [PIDFilter  pids;]
} CostMapEventName;

e.g. the event for a filtered network map would start with:
event: {"resource-id":"my-default-network-map", "pids":["PID2", "PID4"]}\n

*Solution 2. add the input params information as meta information for an
update.*
We put the merge-patch object with the meta information together to form
the update object:
object {
  ResponseMeta update-meta;
  JSONObject merge-patch;
} ALTOUpdate;

What do people think?

Best,
Xiao

--089e01537bb04ea971050613c5a6
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi all,<div><br></div><div>Wendy, Richard, and I are consi=
dering the incremental updates subscription model for ALTO using Server-Sen=
t Event (SSE) streams. In this model, the client subscribes to an event str=
eam, and the server push updates as events via the stream.</div><div><br></=
div><div>We use an &quot;event&quot; field to encode the unique identifier =
of the resource that the event should update, which should be a subset of {=
resource-id, resource-parameters, input-parameters}. (The client also has t=
he IRD in its possession so that it can do certain look-ups).</div><div><br=
></div><div>We would like a __minimal__ unique identifier of each resource =
and each resource object. One resource could have multiple objects, e.g. wh=
en the &quot;accepts&quot; field is non-empty (i.e. they have input params)=
, or they could have filters etc. Below are the proposal solutions:</div><d=
iv><br></div><div>For full network/cost map objects, resource-id is suffici=
ent.<br></div><div>object {</div><div>=C2=A0 ResourceID resource-id;</div><=
div>} NetworkMapEventName;</div><div><br></div><div>object {</div><div>=C2=
=A0 ResourceID resource-id;</div><div>} CostMapEventName;</div><div><br></d=
iv><div>For resource objects that have non-empty &quot;accepts&quot; field =
or filters (i.e. input params) in the IRD, there are multiple solutions:</d=
iv><div><br></div><div><b>Solution 1. put the the input params in the event=
s field</b></div><div>For =C2=A0filtered network map objects, resource-id c=
oupled with the pids for the filter:</div><div><div>object {</div><div>=C2=
=A0 ResourceID resource-id;</div><div><div>=C2=A0 PIDName pids&lt;0..*&gt;;=
</div><div>=C2=A0 [AddressType address-types&lt;0..*&gt;;]</div></div><div>=
} FilteredNetworkMapEventName;</div></div><div><br></div><div>For filtered =
cost map objects, we need to identify the costmap objects and the filter:</=
div><div><div>object {</div><div>=C2=A0 ResourceID resource-id;</div><div>=
=C2=A0 CostType cost-type;</div><div><div>=C2=A0 [JSONString constraints&lt=
;0..*&gt;;]</div><div>=C2=A0 [PIDFilter =C2=A0pids;]</div></div><div>} Cost=
MapEventName;</div></div><div><br></div><div>e.g. the event for a filtered =
network map would start with:</div><div>event: {&quot;resource-id&quot;:&qu=
ot;my-default-network-map&quot;, &quot;pids&quot;:[&quot;PID2&quot;, &quot;=
PID4&quot;]}\n</div><div><br></div><div><b>Solution 2. add the input params=
 information as meta information for an update.</b></div><div>We put the me=
rge-patch object with the meta information together to form the update obje=
ct:</div><div>object {</div><div>=C2=A0 ResponseMeta update-meta;</div><div=
>=C2=A0 JSONObject merge-patch;</div><div>} ALTOUpdate;</div><div><br></div=
><div>What do people think?</div><div><br></div><div>Best,</div><div>Xiao</=
div></div>

--089e01537bb04ea971050613c5a6--


From nobody Thu Oct 23 03:37:38 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 29AF71A8A1A for <alto@ietfa.amsl.com>; Thu, 23 Oct 2014 03:37:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.377
X-Spam-Level: 
X-Spam-Status: No, score=-0.377 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, J_BACKHAIR_12=1, 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 TGOL14O6mp4q for <alto@ietfa.amsl.com>; Thu, 23 Oct 2014 03:37:34 -0700 (PDT)
Received: from mail-yh0-x236.google.com (mail-yh0-x236.google.com [IPv6:2607:f8b0:4002:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 365151A8A72 for <alto@ietf.org>; Thu, 23 Oct 2014 03:37:33 -0700 (PDT)
Received: by mail-yh0-f54.google.com with SMTP id 29so677913yhl.13 for <alto@ietf.org>; Thu, 23 Oct 2014 03:37:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:from:date:message-id:subject:to:cc:content-type;  bh=u5CJNn0IShI7ZXz1gLmzqx9T2dwWjhK7dHlfrbSPIAA=; b=K4MbYge7YXYppUaFxDOoOHgmqXgjpqS8k3BwowbjoLmKHI2D7s79bfQm3kuAQt5e7N K0w/DhVUmV3EQ8QjfDuyqPDK0Tpol9gpbmMkcd9BHN5/5REzUBUc806xf9xfd8188i5r 24DbfiUAS7bBjwE4uRdxQ1HSB0374GycdgFGbGhBMPKkTrA1//4IwdcAWFjEnTpPCBHQ jOnni5FBzhxAVWnsfgDZsJGJcMwKm477HcHQIdofSdh7vBFQTThd/K9PO0l6SBQRzi1B 4/fv2f04jb4/Y3RhXYjLFQG8VLyDakQmRBWaIKvSTTkMwyr3jXBdEat3RxcQRc85uzuJ l4Qw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:from:date:message-id:subject:to:cc:content-type;  bh=u5CJNn0IShI7ZXz1gLmzqx9T2dwWjhK7dHlfrbSPIAA=; b=MBLc0Uwfoe2Z0+EUNpOox5DSb5OxLpT9id13JvYkk6l1bqJR+MU7lEEfMMGNAwlGgG hINwiikFsYCrILeQ25UiSbfTz6E/B/lnm71GEU4QuB4A2RzYlzwiMJqgFFHHqpjXVOGn uXIGe1peLqZCnt7sELdFS7/Ot+38jHkMZDeek=
X-Received: by 10.236.17.129 with SMTP id j1mr3505755yhj.143.1414060652545; Thu, 23 Oct 2014 03:37:32 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.221.193 with HTTP; Thu, 23 Oct 2014 03:37:12 -0700 (PDT)
From: Xiao SHI <xiao.shi@yale.edu>
Date: Thu, 23 Oct 2014 06:37:12 -0400
X-Google-Sender-Auth: jJ-atnoqOcBcfVSQdf-qw5GJJB0
Message-ID: <CAFwJzZ=Gj+TtxGHbNoqJ9Ka5erZMdrG_LNqgjo97mQ_H4aTjyA@mail.gmail.com>
To: IETF ALTO <alto@ietf.org>
Content-Type: multipart/alternative; boundary=001a11c1e2dce2cb80050614a670
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/P_15iD2Dh8u_USoTqnc5MpePW0w
Cc: Wendy Roome <w.roome@alcatel-lucent.com>
Subject: [alto] Incremental Update/SSE Key Design Issue 2: sending full resources at the beginning of stream
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Oct 2014 10:37:36 -0000

--001a11c1e2dce2cb80050614a670
Content-Type: text/plain; charset=UTF-8

Hi folks,

Another design question is whether we should include the full resource
(e.g. full network map/cost map) when the SSE stream is first initiated.

The advantage of doing so is that the server does not need to keep any old
version of the resources. The full map the server first sends to the client
will always be updated, and the updates come when they become available.

It also has the following disadvantage:
(1) Modularity: SSE streams are for incremental updates, it carries a
different functionality than full resource requests;
(2) Space efficiency: to reduce the payload for the SSE stream, it would be
nice not to do that. It is conceivable that the client fetches the full
resource somewhere else and then ask for incremental updates via HTTP SSE
stream.


If we do not send the full resource via SSE, the client needs to request
for incremental updates with resource-id and version-tag. there are two
possible extreme solutions:
(1) the laziest: The server accepts the request that have the most recent
version-tag; if the version-tag is not the most update version, the server
simply rejects this request.
(2) the most costly: The server remembers all history of all resources,
when the client requests with a resource-id and vtag, the server accepts
the connection, and immediately send out patches to "catch the client up."


*Example:*
Notate version tags as vi, e.g. v0, v1, v2, etc. And the patches that
updates vi to vj as patch(vi->vj) where vi is the old tag and vj is the new
tag.

Say the current network map is v3. Client 1 requests incr updates with
{"resource-id":"my-networkmap", "tag":"v0"} and Client 2 requests incr
updates with {"resource-id":"my-networkmap", "tag":"v3"}. The lazy server
would reject the request from client 1 and accepts that from client 2. The
costly server would accept both request and send patch(v0->v3)


Another possible solution is a hybrid of the two extremes. The server keeps
a patch that can update the resource from vi to vj, and accepts requests
that has vtag vk such that i<=k<=j.

Because of the JSON merge-patch replacement property, applying patch(*vi*->vj)
would update vk to vj. No matter what vtag vk the request comes in with,
the server accepts if i<=k<=j, and immediately sends patch(vi->vj) via the
stream. This will update the client's resource to the most updated version.
The subsequent updates will be pushed as they become available.The window
of [i, j] can be determined by the server, according to time or storage
constraints.

You comments would be much appreciated. Thank you!

Best,
Xiao

--001a11c1e2dce2cb80050614a670
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi folks,<div><br></div><div>Another design question is wh=
ether we should include the full resource (e.g. full network map/cost map) =
when the SSE stream is first initiated.</div><div><br></div><div>The advant=
age of doing so is that the server does not need to keep any old version of=
 the resources. The full map the server first sends to the client will alwa=
ys be updated, and the updates come when they become available.</div><div><=
br></div><div>It also has the following disadvantage:</div><div>(1) Modular=
ity: SSE streams are for incremental updates, it carries a different functi=
onality than full resource requests;</div><div>(2) Space efficiency: to red=
uce the payload for the SSE stream, it would be nice not to do that. It is =
conceivable that the client fetches the full resource somewhere else and th=
en ask for incremental updates via HTTP SSE stream.</div><div><br></div><di=
v><br></div><div>If we do not send the full resource via SSE, the client ne=
eds to request for incremental updates with resource-id and version-tag.=C2=
=A0there are two possible extreme solutions:</div><div>(1) the laziest: The=
 server accepts the request that have the most recent version-tag; if the v=
ersion-tag is not the most update version, the server simply rejects this r=
equest.<br></div><div>(2) the most costly: The server remembers all history=
 of all resources, when the client requests with a resource-id and vtag, th=
e server accepts the connection, and immediately send out patches to &quot;=
catch the client up.&quot;<br></div><div><br></div><div><br></div><div><b>E=
xample:</b></div><div>Notate version tags as vi, e.g. v0, v1, v2, etc. And =
the patches that updates vi to vj as patch(vi-&gt;vj) where vi is the old t=
ag and vj is the new tag.</div><div><br></div><div>Say the current network =
map is v3. Client 1 requests incr updates with {&quot;resource-id&quot;:&qu=
ot;my-networkmap&quot;, &quot;tag&quot;:&quot;v0&quot;} and Client 2 reques=
ts incr updates with {&quot;resource-id&quot;:&quot;my-networkmap&quot;, &q=
uot;tag&quot;:&quot;v3&quot;}. The lazy server would reject the request fro=
m client 1 and accepts that from client 2. The costly server would accept b=
oth request and send patch(v0-&gt;v3)</div><div><br></div><div><br></div><d=
iv>Another possible solution is a hybrid of the two extremes. The server ke=
eps a patch that can update the resource from vi to vj, and accepts request=
s that has vtag vk such that i&lt;=3Dk&lt;=3Dj.</div><div><br></div><div>Be=
cause of the JSON merge-patch replacement property, applying patch(<b>vi</b=
>-&gt;vj) would update vk to vj. No matter what vtag vk the request comes i=
n with, the server accepts if i&lt;=3Dk&lt;=3Dj, and immediately sends patc=
h(vi-&gt;vj) via the stream. This will update the client&#39;s resource to =
the most updated version. The subsequent updates will be pushed as they bec=
ome available.The window of [i, j] can be determined by the server, accordi=
ng to time or storage constraints.</div><div><br></div><div>You comments wo=
uld be much appreciated. Thank you!</div><div><br></div><div>Best,</div><di=
v>Xiao</div></div>

--001a11c1e2dce2cb80050614a670--


From nobody Thu Oct 23 04:15:43 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 115781A8ABF for <alto@ietfa.amsl.com>; Thu, 23 Oct 2014 04:15:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.377
X-Spam-Level: 
X-Spam-Status: No, score=-1.377 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 Pds0URN8Zcrc for <alto@ietfa.amsl.com>; Thu, 23 Oct 2014 04:15:39 -0700 (PDT)
Received: from mail-yh0-x236.google.com (mail-yh0-x236.google.com [IPv6:2607:f8b0:4002:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A689A1A8A6E for <alto@ietf.org>; Thu, 23 Oct 2014 04:15:39 -0700 (PDT)
Received: by mail-yh0-f54.google.com with SMTP id 29so709208yhl.27 for <alto@ietf.org>; Thu, 23 Oct 2014 04:15:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:from:date:message-id:subject:to:cc:content-type;  bh=AnTYQ6khe5/Tx98v6jUvInXfET5rjqkxDK2bkRTrs7E=; b=uZkl+LBhFxKEDQLSfU47A5B6A6wtBK1HHoOB11cqcau6cxBrm/+onNBveeWyxWLTBi otLGUrDoFjTp68BwJnfgrnnIYtFYpxHTm+QxNsVf+2JvrPiHKr38HzdtrJ94rHas+wgR EH74LalyVaGUR7iA+3ju+2UBwQDBwGzJ82je0tgKtWvUWFE7j7lYxcH3YC3+aVV+VLfT Yl1eW878sjZa7w3KiTg+BlJbt2Ta5py1cV3uXzCr+qAEKNVAW62hieVUO2V5TUuRb9BA GxLWls7EuF2k22uYlPE3o8NHnFGSdb0o6fHxVvII9LoM1CI3ubK9lopGe5HA304q19gt Wb3Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:from:date:message-id:subject:to:cc:content-type;  bh=AnTYQ6khe5/Tx98v6jUvInXfET5rjqkxDK2bkRTrs7E=; b=ilFEckjRYa97/zlBaCW30t9+J2rF4qjkxEzZHw6ySZGcQrW1jE6Wussa+Ne/qDcV8r lsRHikr1y/C7a58rzW6tNIobZ11pE/0NAyCf4d8A8+I1QfOY2ftN5/8EryW14ouJf4pZ Lrms0/m5eh9l9aCkIL5e7dAMa5sWVbqqw3t9c=
X-Received: by 10.236.202.146 with SMTP id d18mr6049252yho.113.1414062939049;  Thu, 23 Oct 2014 04:15:39 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.221.193 with HTTP; Thu, 23 Oct 2014 04:15:18 -0700 (PDT)
From: Xiao SHI <xiao.shi@yale.edu>
Date: Thu, 23 Oct 2014 07:15:18 -0400
X-Google-Sender-Auth: nfly8WsXTG8rIfzhNRdR0vshWfw
Message-ID: <CAFwJzZnZRn2GT3pXarE=Lva_WxyOiBfUjp_YA1s+qEtPLU=qnA@mail.gmail.com>
To: IETF ALTO <alto@ietf.org>
Content-Type: multipart/alternative; boundary=001a11c1b7182c184e0506152fb2
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/1UGnIxUC8czkoynb6oNVvHTmSpc
Cc: Wendy Roome <w.roome@alcatel-lucent.com>
Subject: [alto] Incremental Update/SSE Key Design Issue 3: updates for dependent resources
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Oct 2014 11:15:41 -0000

--001a11c1b7182c184e0506152fb2
Content-Type: text/plain; charset=UTF-8

Hi guys,

I have some questions on the procedures to update dependent resources.

Suppose the network map M updates from v1 to v2; in the meantime, four cost
maps C1 C2 C3 and C4 that depends on said network map each have their own
update and they switched dependency from networkmap v1 to networkmap v2.
What is the process of updating these 5 resources/applying these updates if
they become available at different times?

Our main goal is for the update to happen as soon as possible and for all
the involved resources to remain as available as possible.

Theoretically, similar to what a compiler/linker does, since the cost maps
depend on M, we should update M first to v2, then update the depending
resources. The issue with this approach is that until all cost maps are
updated, their look-ups are potentially not usable as their dependent
network map has changed.

If we hold off applying the update on network map, we must wait for all
depending resources to complete. That's not ideal either.

Should the clients store multiple versions of resources then? How would
this work? Are there examples from other implementations that handle
similar questions (e.g. compilers, git internals, software package updates,
etc.)?

Thoughts?

Cheers,
Xiao

--001a11c1b7182c184e0506152fb2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi guys,<div><br></div><div>I have some questions on the p=
rocedures to update dependent resources.</div><div><br></div><div>Suppose t=
he network map M updates from v1 to v2; in the meantime, four cost maps C1 =
C2 C3 and C4 that depends on said network map each have their own update an=
d they switched dependency from networkmap v1 to networkmap v2. What is the=
 process of updating these 5 resources/applying these updates if they becom=
e available at different times?</div><div><br></div><div>Our main goal is f=
or the update to happen as soon as possible and for all the involved resour=
ces to remain as available as possible.</div><div><br></div><div>Theoretica=
lly, similar to what a compiler/linker does, since the cost maps depend on =
M, we should update M first to v2, then update the depending resources. The=
 issue with this approach is that until all cost maps are updated, their lo=
ok-ups are potentially not usable as their dependent network map has change=
d.</div><div><br></div><div>If we hold off applying the update on network m=
ap, we must wait for all depending resources to complete. That&#39;s not id=
eal either.</div><div><br></div><div>Should the clients store multiple vers=
ions of resources then? How would this work? Are there examples from other =
implementations that handle similar questions (e.g. compilers, git internal=
s, software package updates, etc.)?</div><div><br></div><div>Thoughts?</div=
><div><br></div><div>Cheers,</div><div>Xiao</div></div>

--001a11c1b7182c184e0506152fb2--


From nobody Thu Oct 23 08:08:34 2014
Return-Path: <w.roome@alcatel-lucent.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4662D1AC39B for <alto@ietfa.amsl.com>; Thu, 23 Oct 2014 08:08:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.908
X-Spam-Level: 
X-Spam-Status: No, score=-1.908 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
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 YwLo2xqbbMI1 for <alto@ietfa.amsl.com>; Thu, 23 Oct 2014 08:08:19 -0700 (PDT)
Received: from smtp-us.alcatel-lucent.com (us-hpswa-esg-02.alcatel-lucent.com [135.245.18.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A3A6F1AC39C for <alto@ietf.org>; Thu, 23 Oct 2014 08:07:29 -0700 (PDT)
Received: from us70tusmtp2.zam.alcatel-lucent.com (unknown [135.5.2.64]) by Websense Email Security Gateway with ESMTPS id 3F227543A66BC; Thu, 23 Oct 2014 15:07:26 +0000 (GMT)
Received: from usnavsmail2.ndc.alcatel-lucent.com (usnavsmail2.ndc.alcatel-lucent.com [135.3.39.10]) by us70tusmtp2.zam.alcatel-lucent.com (GMO) with ESMTP id s9NF7Prc003510 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 23 Oct 2014 11:07:25 -0400
Received: from umail.lucent.com (umail.ndc.lucent.com [135.3.40.61]) by usnavsmail2.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id s9NF7OHK027098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 23 Oct 2014 10:07:24 -0500
Received: from [135.222.152.71] (wdr-i7mbp2.mh.lucent.com [135.222.152.71]) by umail.lucent.com (8.13.8/TPES) with ESMTP id s9NF7Kbc014427; Thu, 23 Oct 2014 10:07:22 -0500 (CDT)
User-Agent: Microsoft-MacOutlook/14.4.5.141003
Date: Thu, 23 Oct 2014 11:07:26 -0400
From: Wendy Roome <w.roome@alcatel-lucent.com>
To: Xiao SHI <xiao.shi@yale.edu>, IETF ALTO <alto@ietf.org>
Message-ID: <D06E8F5A.1951BB%w.roome@alcatel-lucent.com>
Thread-Topic: Incremental Update/SSE Key Design Issue 3: updates for dependent resources
References: <CAFwJzZnZRn2GT3pXarE=Lva_WxyOiBfUjp_YA1s+qEtPLU=qnA@mail.gmail.com>
In-Reply-To: <CAFwJzZnZRn2GT3pXarE=Lva_WxyOiBfUjp_YA1s+qEtPLU=qnA@mail.gmail.com>
Mime-version: 1.0
Content-type: multipart/alternative; boundary="B_3496907250_35846540"
X-Scanned-By: MIMEDefang 2.64 on 135.3.39.10
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/oMJIIUHMrulGaK8AGFSCl3CY99M
Subject: Re: [alto] Incremental Update/SSE Key Design Issue 3: updates for dependent resources
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Oct 2014 15:08:24 -0000

> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--B_3496907250_35846540
Content-type: text/plain;
	charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

If the server sends all 6 of those updates on the same stream, it's a
non-issue. The client applies the updates in the order in which they arrive=
.

Of course, the server must ensure that a cost-map update always applies to
the most recently sent network map update.

Eg, if updates C1 & C2 depend on network map update M1, and updates C3 & C4
depend on M2, then the server sends:

        M1  C1  C2  M2  C3  C4

When a client gets a network map update like M1, the client could apply the
update and mark the associated cost map as =B3temporarily invalid=B2. The clien=
t
changes that to =B3valid=B2 when next cost-map update arrives. Hopefully the
server will send that very quickly. While a cost-map is temporarily invalid=
,
the client must defer any accesses to that cost-map.

Alternatively, the client could save a network map update in a buffer until
the associated cost map updates arrive,
and then apply all those updates atomically.

In any case, there is no need for a client to keep multiple versions.

- Wendy

From:  Xiao SHI <xiao.shi@yale.edu>
Date:  Thu, October 23, 2014 at 07:15
To:  IETF ALTO <alto@ietf.org>
Cc:  Wendy Roome <w.roome@alcatel-lucent.com>, "Y. Richard Yang"
<yry@cs.yale.edu>
Subject:  Incremental Update/SSE Key Design Issue 3: updates for dependent
resources

Hi guys,

I have some questions on the procedures to update dependent resources.

Suppose the network map M updates from v1 to v2; in the meantime, four cost
maps C1 C2 C3 and C4 that depends on said network map each have their own
update and they switched dependency from networkmap v1 to networkmap v2.
What is the process of updating these 5 resources/applying these updates if
they become available at different times?

Our main goal is for the update to happen as soon as possible and for all
the involved resources to remain as available as possible.

Theoretically, similar to what a compiler/linker does, since the cost maps
depend on M, we should update M first to v2, then update the depending
resources. The issue with this approach is that until all cost maps are
updated, their look-ups are potentially not usable as their dependent
network map has changed.

If we hold off applying the update on network map, we must wait for all
depending resources to complete. That's not ideal either.

Should the clients store multiple versions of resources then? How would thi=
s
work? Are there examples from other implementations that handle similar
questions (e.g. compilers, git internals, software package updates, etc.)?

Thoughts?

Cheers,
Xiao



--B_3496907250_35846540
Content-type: text/html;
	charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

<html><head></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size:=
 14px; font-family: Calibri, sans-serif;"><div>If the server sends all 6 of =
those updates on the same stream, it's a non-issue. The client applies the u=
pdates in the order in which they arrive.</div><div><br></div><div>Of course=
, the server must ensure that a cost-map update always applies to the most r=
ecently sent network map update.</div><div><br></div><div>Eg, if updates C1 =
&amp; C2 depend on network map update M1, and updates C3 &amp; C4 depend on =
M2, then the server sends:</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nb=
sp; M1 &nbsp;C1 &nbsp;C2 &nbsp;M2 &nbsp;C3 &nbsp;C4</div><div><br></div><div=
>When a client gets a network map update like M1, the client could apply the=
 update and mark the associated cost map as &#8220;temporarily invalid&#8221=
;. The client changes that to &#8220;valid&#8221; when next cost-map update =
arrives. Hopefully the server will send that very quickly. While a cost-map =
is temporarily invalid, the client must defer any accesses to that cost-map.=
</div><div><br></div><div>Alternatively, the client could save a network map=
 update in a buffer until the associated cost map updates arrive,</div><div>=
and then apply all those updates atomically.</div><div><br></div><div>In any=
 case, there is no need for a client to keep multiple versions.</div><div><b=
r></div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>- =
Wendy</div><div><br></div><span id=3D"OLK_SRC_BODY_SECTION"><div style=3D"font-f=
amily:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: =
medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0i=
n; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium n=
one; PADDING-TOP: 3pt"><span style=3D"font-weight:bold">From: </span> Xiao SHI=
 &lt;<a href=3D"mailto:xiao.shi@yale.edu">xiao.shi@yale.edu</a>&gt;<br><span s=
tyle=3D"font-weight:bold">Date: </span> Thu, October 23, 2014 at 07:15<br><spa=
n style=3D"font-weight:bold">To: </span> IETF ALTO &lt;<a href=3D"mailto:alto@ie=
tf.org">alto@ietf.org</a>&gt;<br><span style=3D"font-weight:bold">Cc: </span> =
Wendy Roome &lt;<a href=3D"mailto:w.roome@alcatel-lucent.com">w.roome@alcatel-=
lucent.com</a>&gt;, "Y. Richard Yang" &lt;<a href=3D"mailto:yry@cs.yale.edu">y=
ry@cs.yale.edu</a>&gt;<br><span style=3D"font-weight:bold">Subject: </span> In=
cremental Update/SSE Key Design Issue 3: updates for dependent resources<br>=
</div><div><br></div><span style=3D"color: rgb(0, 0, 0); font-family: Calibri;=
 font-size: medium; font-style: normal; font-variant: normal; font-weight: n=
ormal; letter-spacing: normal; line-height: normal; orphans: auto; text-alig=
n: start; text-indent: 0px; text-transform: none; white-space: normal; widow=
s: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline =
!important; float: none;">Hi guys,</span><div style=3D"color: rgb(0, 0, 0); fo=
nt-family: Calibri; font-size: medium; font-style: normal; font-variant: nor=
mal; font-weight: normal; letter-spacing: normal; line-height: normal; orpha=
ns: auto; text-align: start; text-indent: 0px; text-transform: none; white-s=
pace: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0p=
x;"><br></div><div style=3D"color: rgb(0, 0, 0); font-family: Calibri; font-si=
ze: medium; font-style: normal; font-variant: normal; font-weight: normal; l=
etter-spacing: normal; line-height: normal; orphans: auto; text-align: start=
; text-indent: 0px; text-transform: none; white-space: normal; widows: auto;=
 word-spacing: 0px; -webkit-text-stroke-width: 0px;">I have some questions o=
n the procedures to update dependent resources.</div><div style=3D"color: rgb(=
0, 0, 0); font-family: Calibri; font-size: medium; font-style: normal; font-=
variant: normal; font-weight: normal; letter-spacing: normal; line-height: n=
ormal; orphans: auto; text-align: start; text-indent: 0px; text-transform: n=
one; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stro=
ke-width: 0px;"><br></div><div style=3D"color: rgb(0, 0, 0); font-family: Cali=
bri; font-size: medium; font-style: normal; font-variant: normal; font-weigh=
t: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-=
align: start; text-indent: 0px; text-transform: none; white-space: normal; w=
idows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Suppose the=
 network map M updates from v1 to v2; in the meantime, four cost maps C1 C2 =
C3 and C4 that depends on said network map each have their own update and th=
ey switched dependency from networkmap v1 to networkmap v2. What is the proc=
ess of updating these 5 resources/applying these updates if they become avai=
lable at different times?</div><div style=3D"color: rgb(0, 0, 0); font-family:=
 Calibri; font-size: medium; font-style: normal; font-variant: normal; font-=
weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: norm=
al; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></=
div><div style=3D"color: rgb(0, 0, 0); font-family: Calibri; font-size: medium=
; font-style: normal; font-variant: normal; font-weight: normal; letter-spac=
ing: normal; line-height: normal; orphans: auto; text-align: start; text-ind=
ent: 0px; text-transform: none; white-space: normal; widows: auto; word-spac=
ing: 0px; -webkit-text-stroke-width: 0px;">Our main goal is for the update t=
o happen as soon as possible and for all the involved resources to remain as=
 available as possible.</div><div style=3D"color: rgb(0, 0, 0); font-family: C=
alibri; font-size: medium; font-style: normal; font-variant: normal; font-we=
ight: normal; letter-spacing: normal; line-height: normal; orphans: auto; te=
xt-align: start; text-indent: 0px; text-transform: none; white-space: normal=
; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></di=
v><div style=3D"color: rgb(0, 0, 0); font-family: Calibri; font-size: medium; =
font-style: normal; font-variant: normal; font-weight: normal; letter-spacin=
g: normal; line-height: normal; orphans: auto; text-align: start; text-inden=
t: 0px; text-transform: none; white-space: normal; widows: auto; word-spacin=
g: 0px; -webkit-text-stroke-width: 0px;">Theoretically, similar to what a co=
mpiler/linker does, since the cost maps depend on M, we should update M firs=
t to v2, then update the depending resources. The issue with this approach i=
s that until all cost maps are updated, their look-ups are potentially not u=
sable as their dependent network map has changed.</div><div style=3D"color: rg=
b(0, 0, 0); font-family: Calibri; font-size: medium; font-style: normal; fon=
t-variant: normal; font-weight: normal; letter-spacing: normal; line-height:=
 normal; orphans: auto; text-align: start; text-indent: 0px; text-transform:=
 none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-st=
roke-width: 0px;"><br></div><div style=3D"color: rgb(0, 0, 0); font-family: Ca=
libri; font-size: medium; font-style: normal; font-variant: normal; font-wei=
ght: normal; letter-spacing: normal; line-height: normal; orphans: auto; tex=
t-align: start; text-indent: 0px; text-transform: none; white-space: normal;=
 widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">If we hol=
d off applying the update on network map, we must wait for all depending res=
ources to complete. That's not ideal either.</div><div style=3D"color: rgb(0, =
0, 0); font-family: Calibri; font-size: medium; font-style: normal; font-var=
iant: normal; font-weight: normal; letter-spacing: normal; line-height: norm=
al; orphans: auto; text-align: start; text-indent: 0px; text-transform: none=
; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-=
width: 0px;"><br></div><div style=3D"color: rgb(0, 0, 0); font-family: Calibri=
; font-size: medium; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; orphans: auto; text-ali=
gn: start; text-indent: 0px; text-transform: none; white-space: normal; wido=
ws: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Should the cli=
ents store multiple versions of resources then? How would this work? Are the=
re examples from other implementations that handle similar questions (e.g. c=
ompilers, git internals, software package updates, etc.)?</div><div style=3D"c=
olor: rgb(0, 0, 0); font-family: Calibri; font-size: medium; font-style: nor=
mal; font-variant: normal; font-weight: normal; letter-spacing: normal; line=
-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-tr=
ansform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit=
-text-stroke-width: 0px;"><br></div><div style=3D"color: rgb(0, 0, 0); font-fa=
mily: Calibri; font-size: medium; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; orphans: a=
uto; text-align: start; text-indent: 0px; text-transform: none; white-space:=
 normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">T=
houghts?</div><div style=3D"color: rgb(0, 0, 0); font-family: Calibri; font-si=
ze: medium; font-style: normal; font-variant: normal; font-weight: normal; l=
etter-spacing: normal; line-height: normal; orphans: auto; text-align: start=
; text-indent: 0px; text-transform: none; white-space: normal; widows: auto;=
 word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div style=3D"c=
olor: rgb(0, 0, 0); font-family: Calibri; font-size: medium; font-style: nor=
mal; font-variant: normal; font-weight: normal; letter-spacing: normal; line=
-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-tr=
ansform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit=
-text-stroke-width: 0px;">Cheers,</div><div style=3D"color: rgb(0, 0, 0); font=
-family: Calibri; font-size: medium; font-style: normal; font-variant: norma=
l; font-weight: normal; letter-spacing: normal; line-height: normal; orphans=
: auto; text-align: start; text-indent: 0px; text-transform: none; white-spa=
ce: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;=
">Xiao</div></span></body></html>

--B_3496907250_35846540--



From nobody Thu Oct 23 21:42:26 2014
Return-Path: <yang.r.yang@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2F3A81A888B for <alto@ietfa.amsl.com>; Thu, 23 Oct 2014 21:42:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.622
X-Spam-Level: 
X-Spam-Status: No, score=0.622 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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 F9gt7yESJhfe for <alto@ietfa.amsl.com>; Thu, 23 Oct 2014 21:42:22 -0700 (PDT)
Received: from mail-yh0-x22b.google.com (mail-yh0-x22b.google.com [IPv6:2607:f8b0:4002:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3458F1A8881 for <alto@ietf.org>; Thu, 23 Oct 2014 21:42:22 -0700 (PDT)
Received: by mail-yh0-f43.google.com with SMTP id z6so2607991yhz.16 for <alto@ietf.org>; Thu, 23 Oct 2014 21:42:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=b4jsfNRqj4lBcn/BweWg62iNA2WBzG26S2nLbD66P0s=; b=cXyvNGbrwQbOTeAnXrIXkYmBXalmdvz0Tv7ZPIqUcjRAoIhSr6qfiYZ9NRVbJTtrU/ /MwOoOokKeMXtFsJIDsR7AxKEdreYtAt49c1p2k80fD3QdOtLkVkkiH5bepc5VOhABuV 4Jbzb3z6ajVupEzRJhkcHKrhShyKAfAIhlBr6Nt2KhB2YSZLf+/d6VYZIRv/74d01OoN czsfw97/q4HenPzgiQyLH9rghsp6d2xnLMdqUkJJOF52Sr/udBQhzJZE4xLSbP+jArUK /LbeRtBJU3f0GGVX9sn8tW0WkWDU3jmQ5ECQAINL6E1uVCFLTBtEFOD+dwxNF96RTbQh 6w7w==
MIME-Version: 1.0
X-Received: by 10.170.149.133 with SMTP id q127mr2413187ykc.90.1414125741493;  Thu, 23 Oct 2014 21:42:21 -0700 (PDT)
Sender: yang.r.yang@gmail.com
Received: by 10.107.131.224 with HTTP; Thu, 23 Oct 2014 21:42:21 -0700 (PDT)
In-Reply-To: <CAFwJzZmb00=biL8+sfDKHdXC6g1XXwuE7gTxheNrkfBpks_XgQ@mail.gmail.com>
References: <CAFwJzZmb00=biL8+sfDKHdXC6g1XXwuE7gTxheNrkfBpks_XgQ@mail.gmail.com>
Date: Fri, 24 Oct 2014 00:42:21 -0400
X-Google-Sender-Auth: cocvmgRSj7Xst_xMobgAJ3PVTjM
Message-ID: <CANUuoLrj0sMcBRNZ1WWgMFp0nwqCnz2voQzCjYE9syjC2f3yAA@mail.gmail.com>
From: "Y. Richard Yang" <yry@cs.yale.edu>
To: Xiao SHI <xiao.shi@yale.edu>
Content-Type: multipart/alternative; boundary=001a113a86707d5954050623ced7
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/F1gd8k0yBwjCTiADZt5CP4L8nXw
Cc: Wendy Roome <w.roome@alcatel-lucent.com>, IETF ALTO <alto@ietf.org>
Subject: Re: [alto] Incremental Update/SSE Key Design Issue 1: Event subscription name in SSE
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 24 Oct 2014 04:42:24 -0000

--001a113a86707d5954050623ced7
Content-Type: text/plain; charset=UTF-8

Let me clarify and understand the context a bit more.

On Thu, Oct 23, 2014 at 5:34 AM, Xiao SHI <xiao.shi@yale.edu> wrote:

> Hi all,
>
> Wendy, Richard, and I are considering the incremental updates subscription
> model for ALTO using Server-Sent Event (SSE) streams. In this model, the
> client subscribes to an event stream, and the server push updates as events
> via the stream.
>
>
The model is that an ALTO client can subscribe to *multiple* ALTO
information resources, to avoid multiple HTTP connections, if we do not
want one connection per stream. Hence, we need the event field for
demultiplexing.


> We use an "event" field to encode the unique identifier of the resource
> that the event should update,
>

an "event" field => the "event" field, which is the field in SSE to
demultiplex the streams (to potentially different handlers at the client).
I feel that we need to solve the problem in both directions: first the
client indicates the data stream and then the server pushes.


> which should be a subset of {resource-id, resource-parameters,
> input-parameters}. (The client also has the IRD in its possession so that
> it can do certain look-ups).
>

We would like a __minimal__ unique identifier of each resource and each
> resource object. One resource could have multiple objects, e.g. when the
> "accepts" field is non-empty (i.e. they have input params), or they could
> have filters etc. Below are the proposal solutions:
>
> For full network/cost map objects, resource-id is sufficient.
> object {
>   ResourceID resource-id;
> } NetworkMapEventName;
>
> object {
>   ResourceID resource-id;
> } CostMapEventName;
>
> For resource objects that have non-empty "accepts" field or filters (i.e.
> input params) in the IRD, there are multiple solutions:
>
> *Solution 1. put the the input params in the events field*
> For  filtered network map objects, resource-id coupled with the pids for
> the filter:
> object {
>   ResourceID resource-id;
>   PIDName pids<0..*>;
>   [AddressType address-types<0..*>;]
> } FilteredNetworkMapEventName;
>
> For filtered cost map objects, we need to identify the costmap objects and
> the filter:
> object {
>   ResourceID resource-id;
>   CostType cost-type;
>   [JSONString constraints<0..*>;]
>   [PIDFilter  pids;]
> } CostMapEventName;
>
> e.g. the event for a filtered network map would start with:
> event: {"resource-id":"my-default-network-map", "pids":["PID2", "PID4"]}\n
>
> *Solution 2. add the input params information as meta information for an
> update.*
> We put the merge-patch object with the meta information together to form
> the update object:
> object {
>   ResponseMeta update-meta;
>   JSONObject merge-patch;
> } ALTOUpdate;
>
> What do people think?
>
>
How would Solution 2 work?

Richard


> Best,
> Xiao
>



-- 
-- 
 =====================================
| Y. Richard Yang <yry@cs.yale.edu>   |
| Professor of Computer Science       |
| http://www.cs.yale.edu/~yry/        |
 =====================================

--001a113a86707d5954050623ced7
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Let me clarify and understand the context a bit more.<div>=
<br></div><div><div class=3D"gmail_extra"><div class=3D"gmail_quote">On Thu=
, Oct 23, 2014 at 5:34 AM, Xiao SHI <span dir=3D"ltr">&lt;<a href=3D"mailto=
:xiao.shi@yale.edu" target=3D"_blank">xiao.shi@yale.edu</a>&gt;</span> wrot=
e:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hi all,<div><br></div=
><div>Wendy, Richard, and I are considering the incremental updates subscri=
ption model for ALTO using Server-Sent Event (SSE) streams. In this model, =
the client subscribes to an event stream, and the server push updates as ev=
ents via the stream.</div><div><br></div></div></blockquote><div><br></div>=
<div>The model is that an ALTO client can subscribe to *multiple* ALTO info=
rmation resources, to avoid multiple HTTP connections, if we do not want on=
e connection per stream. Hence, we need the event field for demultiplexing.=
</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 =
0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div=
></div><div>We use an &quot;event&quot; field to encode the unique identifi=
er of the resource that the event should update, </div></div></blockquote><=
div><br></div><div>an &quot;event&quot; field =3D&gt; the &quot;event&quot;=
 field, which is the field in SSE to demultiplex the streams (to potentiall=
y different handlers at the client). I feel that we need to solve the probl=
em in both directions: first the client indicates the data stream and then =
the server pushes.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><di=
v dir=3D"ltr"><div>which should be a subset of {resource-id, resource-param=
eters, input-parameters}. (The client also has the IRD in its possession so=
 that it can do certain look-ups).</div></div></blockquote><div><br></div><=
blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px=
 #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div></div><div>We would lik=
e a __minimal__ unique identifier of each resource and each resource object=
. One resource could have multiple objects, e.g. when the &quot;accepts&quo=
t; field is non-empty (i.e. they have input params), or they could have fil=
ters etc. Below are the proposal solutions:</div><div><br></div><div>For fu=
ll network/cost map objects, resource-id is sufficient.<br></div><div>objec=
t {</div><div>=C2=A0 ResourceID resource-id;</div><div>} NetworkMapEventNam=
e;</div><div><br></div><div>object {</div><div>=C2=A0 ResourceID resource-i=
d;</div><div>} CostMapEventName;</div><div><br></div><div>For resource obje=
cts that have non-empty &quot;accepts&quot; field or filters (i.e. input pa=
rams) in the IRD, there are multiple solutions:</div><div><br></div><div><b=
>Solution 1. put the the input params in the events field</b></div><div>For=
 =C2=A0filtered network map objects, resource-id coupled with the pids for =
the filter:</div><div><div>object {</div><div>=C2=A0 ResourceID resource-id=
;</div><div><div>=C2=A0 PIDName pids&lt;0..*&gt;;</div><div>=C2=A0 [Address=
Type address-types&lt;0..*&gt;;]</div></div><div>} FilteredNetworkMapEventN=
ame;</div></div><div><br></div><div>For filtered cost map objects, we need =
to identify the costmap objects and the filter:</div><div><div>object {</di=
v><div>=C2=A0 ResourceID resource-id;</div><div>=C2=A0 CostType cost-type;<=
/div><div><div>=C2=A0 [JSONString constraints&lt;0..*&gt;;]</div><div>=C2=
=A0 [PIDFilter =C2=A0pids;]</div></div><div>} CostMapEventName;</div></div>=
<div><br></div><div>e.g. the event for a filtered network map would start w=
ith:</div><div>event: {&quot;resource-id&quot;:&quot;my-default-network-map=
&quot;, &quot;pids&quot;:[&quot;PID2&quot;, &quot;PID4&quot;]}\n</div><div>=
<br></div><div><b>Solution 2. add the input params information as meta info=
rmation for an update.</b></div><div>We put the merge-patch object with the=
 meta information together to form the update object:</div><div>object {</d=
iv><div>=C2=A0 ResponseMeta update-meta;</div><div>=C2=A0 JSONObject merge-=
patch;</div><div>} ALTOUpdate;</div><div><br></div><div>What do people thin=
k?</div><div><br></div></div></blockquote><div><br></div><div>How would Sol=
ution 2 work?</div><div><br></div><div>Richard</div><div>=C2=A0</div><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc=
 solid;padding-left:1ex"><div dir=3D"ltr"><div></div><div>Best,</div><div>X=
iao</div></div>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div dir=3D"=
ltr"><div><font face=3D"courier new, monospace">--=C2=A0</font></div><div><=
font face=3D"courier new, monospace">=C2=A0=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D</font></div><div><font face=3D"courier new, monospace">| Y. Richard =
Yang &lt;<a href=3D"mailto:yry@cs.yale.edu" target=3D"_blank">yry@cs.yale.e=
du</a>&gt; =C2=A0 |</font></div><div><font face=3D"courier new, monospace">=
| Professor of Computer Science =C2=A0 =C2=A0 =C2=A0 |</font></div><div><fo=
nt face=3D"courier new, monospace">| <a href=3D"http://www.cs.yale.edu/~yry=
/" target=3D"_blank">http://www.cs.yale.edu/~yry/</a> =C2=A0 =C2=A0 =C2=A0 =
=C2=A0|</font></div><div><font face=3D"courier new, monospace">=C2=A0=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</font></div></div>
</div></div></div>

--001a113a86707d5954050623ced7--


From nobody Thu Oct 23 21:46:38 2014
Return-Path: <yang.r.yang@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 111DA1A888E for <alto@ietfa.amsl.com>; Thu, 23 Oct 2014 21:46:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.622
X-Spam-Level: *
X-Spam-Status: No, score=1.622 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, J_BACKHAIR_12=1, 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 WPt_ytMmxg22 for <alto@ietfa.amsl.com>; Thu, 23 Oct 2014 21:46:35 -0700 (PDT)
Received: from mail-yh0-x229.google.com (mail-yh0-x229.google.com [IPv6:2607:f8b0:4002:c01::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EDB341A888B for <alto@ietf.org>; Thu, 23 Oct 2014 21:46:34 -0700 (PDT)
Received: by mail-yh0-f41.google.com with SMTP id i57so2562114yha.28 for <alto@ietf.org>; Thu, 23 Oct 2014 21:46:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=jGVtUz0V5JmPHFDFN6utmCgcYnHlBP3S2kVTFcTSicE=; b=KHURGXFz9Hf6/7tULhpna9ArCa4oAsIRaEb4UJnZFDaVyChw/uhhaL/LgfKwuhxq5i 80gND7C1g3GQFDheMF7OzH6gk34kzmuV0dSzViLbvP9Vj4t5+CAMaHZo9e6USWHFXQ0K SkU8iyPvDjxTSBfkjAoJGUJMrt9tSGNGDGH7bpvqRwB9kd5DdCOSmY8Zs6syX6YGM52D GMzgxwAsOUd7wJT+oum80IF5Hbv70V7gh0KUZJqCCcKyjJxcK+Gp2J0QbKffpTuKmhrJ ZxO4t1bk4ecEhGXJSckrJVVHgDnxxSZwpEVd/XCIfVaQ96Z+Jovcs1QdrvBxmhk4Og4k 0QXg==
MIME-Version: 1.0
X-Received: by 10.170.145.194 with SMTP id m185mr2472637ykc.84.1414125994210;  Thu, 23 Oct 2014 21:46:34 -0700 (PDT)
Sender: yang.r.yang@gmail.com
Received: by 10.107.131.224 with HTTP; Thu, 23 Oct 2014 21:46:34 -0700 (PDT)
In-Reply-To: <CAFwJzZ=Gj+TtxGHbNoqJ9Ka5erZMdrG_LNqgjo97mQ_H4aTjyA@mail.gmail.com>
References: <CAFwJzZ=Gj+TtxGHbNoqJ9Ka5erZMdrG_LNqgjo97mQ_H4aTjyA@mail.gmail.com>
Date: Fri, 24 Oct 2014 00:46:34 -0400
X-Google-Sender-Auth: -V6492QPS3dI63HfGq0e_t8O0iM
Message-ID: <CANUuoLpRq5+c2c6zq0F0Nfo3COwtnyhp=h4WYqjRt-MQjkGTHg@mail.gmail.com>
From: "Y. Richard Yang" <yry@cs.yale.edu>
To: Xiao SHI <xiao.shi@yale.edu>
Content-Type: multipart/alternative; boundary=001a113937ca8d7f34050623ddd6
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/3XnbXR7ewJ31Gb6lTuxxrQCNzoI
Cc: Wendy Roome <w.roome@alcatel-lucent.com>, IETF ALTO <alto@ietf.org>
Subject: Re: [alto] Incremental Update/SSE Key Design Issue 2: sending full resources at the beginning of stream
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 24 Oct 2014 04:46:37 -0000

--001a113937ca8d7f34050623ddd6
Content-Type: text/plain; charset=UTF-8

Good design question.

On Thu, Oct 23, 2014 at 6:37 AM, Xiao SHI <xiao.shi@yale.edu> wrote:

> Hi folks,
>
> Another design question is whether we should include the full resource
> (e.g. full network map/cost map) when the SSE stream is first initiated.
>
> The advantage of doing so is that the server does not need to keep any old
> version of the resources. The full map the server first sends to the client
> will always be updated, and the updates come when they become available.
>
> It also has the following disadvantage:
> (1) Modularity: SSE streams are for incremental updates, it carries a
> different functionality than full resource requests;
> (2) Space efficiency: to reduce the payload for the SSE stream, it would
> be nice not to do that. It is conceivable that the client fetches the full
> resource somewhere else and then ask for incremental updates via HTTP SSE
> stream.
>

This also means that SSE serves to update only one resource?



> If we do not send the full resource via SSE, the client needs to request
> for incremental updates with resource-id and version-tag. there are two
> possible extreme solutions:
> (1) the laziest: The server accepts the request that have the most recent
> version-tag; if the version-tag is not the most update version, the server
> simply rejects this request.
> (2) the most costly: The server remembers all history of all resources,
> when the client requests with a resource-id and vtag, the server accepts
> the connection, and immediately send out patches to "catch the client up."
>
>
> *Example:*
> Notate version tags as vi, e.g. v0, v1, v2, etc. And the patches that
> updates vi to vj as patch(vi->vj) where vi is the old tag and vj is the new
> tag.
>
> Say the current network map is v3. Client 1 requests incr updates with
> {"resource-id":"my-networkmap", "tag":"v0"} and Client 2 requests incr
> updates with {"resource-id":"my-networkmap", "tag":"v3"}. The lazy server
> would reject the request from client 1 and accepts that from client 2. The
> costly server would accept both request and send patch(v0->v3)
>
>
> Another possible solution is a hybrid of the two extremes. The server
> keeps a patch that can update the resource from vi to vj, and accepts
> requests that has vtag vk such that i<=k<=j.
>
> Because of the JSON merge-patch replacement property, applying patch(*vi*->vj)
> would update vk to vj. No matter what vtag vk the request comes in with,
> the server accepts if i<=k<=j, and immediately sends patch(vi->vj) via the
> stream. This will update the client's resource to the most updated version.
> The subsequent updates will be pushed as they become available.The window
> of [i, j] can be determined by the server, according to time or storage
> constraints.
>
>
I prefer this last one :-)

Richard


> You comments would be much appreciated. Thank you!
>
> Best,
> Xiao
>



-- 
-- 
 =====================================
| Y. Richard Yang <yry@cs.yale.edu>   |
| Professor of Computer Science       |
| http://www.cs.yale.edu/~yry/        |
 =====================================

--001a113937ca8d7f34050623ddd6
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Good design question.<br><div class=3D"gmail_extra"><br><d=
iv class=3D"gmail_quote">On Thu, Oct 23, 2014 at 6:37 AM, Xiao SHI <span di=
r=3D"ltr">&lt;<a href=3D"mailto:xiao.shi@yale.edu" target=3D"_blank">xiao.s=
hi@yale.edu</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div di=
r=3D"ltr">Hi folks,<div><br></div><div>Another design question is whether w=
e should include the full resource (e.g. full network map/cost map) when th=
e SSE stream is first initiated.</div><div><br></div><div>The advantage of =
doing so is that the server does not need to keep any old version of the re=
sources. The full map the server first sends to the client will always be u=
pdated, and the updates come when they become available.</div><div><br></di=
v><div>It also has the following disadvantage:</div><div>(1) Modularity: SS=
E streams are for incremental updates, it carries a different functionality=
 than full resource requests;</div><div>(2) Space efficiency: to reduce the=
 payload for the SSE stream, it would be nice not to do that. It is conceiv=
able that the client fetches the full resource somewhere else and then ask =
for incremental updates via HTTP SSE stream.</div></div></blockquote><div>=
=C2=A0</div><div>This also means that SSE serves to update only one resourc=
e?</div><div>=C2=A0</div><div>=C2=A0</div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><d=
iv dir=3D"ltr"><div></div><div>If we do not send the full resource via SSE,=
 the client needs to request for incremental updates with resource-id and v=
ersion-tag.=C2=A0there are two possible extreme solutions:</div><div>(1) th=
e laziest: The server accepts the request that have the most recent version=
-tag; if the version-tag is not the most update version, the server simply =
rejects this request.<br></div><div>(2) the most costly: The server remembe=
rs all history of all resources, when the client requests with a resource-i=
d and vtag, the server accepts the connection, and immediately send out pat=
ches to &quot;catch the client up.&quot;<br></div><div><br></div><div><br><=
/div><div><b>Example:</b></div><div>Notate version tags as vi, e.g. v0, v1,=
 v2, etc. And the patches that updates vi to vj as patch(vi-&gt;vj) where v=
i is the old tag and vj is the new tag.</div><div><br></div><div>Say the cu=
rrent network map is v3. Client 1 requests incr updates with {&quot;resourc=
e-id&quot;:&quot;my-networkmap&quot;, &quot;tag&quot;:&quot;v0&quot;} and C=
lient 2 requests incr updates with {&quot;resource-id&quot;:&quot;my-networ=
kmap&quot;, &quot;tag&quot;:&quot;v3&quot;}. The lazy server would reject t=
he request from client 1 and accepts that from client 2. The costly server =
would accept both request and send patch(v0-&gt;v3)</div><div><br></div><di=
v><br></div><div>Another possible solution is a hybrid of the two extremes.=
 The server keeps a patch that can update the resource from vi to vj, and a=
ccepts requests that has vtag vk such that i&lt;=3Dk&lt;=3Dj.</div><div><br=
></div><div>Because of the JSON merge-patch replacement property, applying =
patch(<b>vi</b>-&gt;vj) would update vk to vj. No matter what vtag vk the r=
equest comes in with, the server accepts if i&lt;=3Dk&lt;=3Dj, and immediat=
ely sends patch(vi-&gt;vj) via the stream. This will update the client&#39;=
s resource to the most updated version. The subsequent updates will be push=
ed as they become available.The window of [i, j] can be determined by the s=
erver, according to time or storage constraints.</div><div><br></div></div>=
</blockquote><div><br></div><div>I prefer this last one :-)</div><div><br><=
/div><div>Richard</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div=
 dir=3D"ltr"><div></div><div>You comments would be much appreciated. Thank =
you!</div><div><br></div><div>Best,</div><div>Xiao</div></div>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div dir=3D"=
ltr"><div><font face=3D"courier new, monospace">--=C2=A0</font></div><div><=
font face=3D"courier new, monospace">=C2=A0=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D</font></div><div><font face=3D"courier new, monospace">| Y. Richard =
Yang &lt;<a href=3D"mailto:yry@cs.yale.edu" target=3D"_blank">yry@cs.yale.e=
du</a>&gt; =C2=A0 |</font></div><div><font face=3D"courier new, monospace">=
| Professor of Computer Science =C2=A0 =C2=A0 =C2=A0 |</font></div><div><fo=
nt face=3D"courier new, monospace">| <a href=3D"http://www.cs.yale.edu/~yry=
/" target=3D"_blank">http://www.cs.yale.edu/~yry/</a> =C2=A0 =C2=A0 =C2=A0 =
=C2=A0|</font></div><div><font face=3D"courier new, monospace">=C2=A0=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</font></div></div>
</div></div>

--001a113937ca8d7f34050623ddd6--


From nobody Thu Oct 23 21:50:55 2014
Return-Path: <boxs.jq@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 867391A8892 for <alto@ietfa.amsl.com>; Thu, 23 Oct 2014 21:50:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.522
X-Spam-Level: *
X-Spam-Status: No, score=1.522 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, J_BACKHAIR_12=1, 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 pR2EzDEN6_RL for <alto@ietfa.amsl.com>; Thu, 23 Oct 2014 21:50:51 -0700 (PDT)
Received: from mail-yh0-x229.google.com (mail-yh0-x229.google.com [IPv6:2607:f8b0:4002:c01::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5BCB71A888B for <alto@ietf.org>; Thu, 23 Oct 2014 21:50:51 -0700 (PDT)
Received: by mail-yh0-f41.google.com with SMTP id i57so2661490yha.0 for <alto@ietf.org>; Thu, 23 Oct 2014 21:50:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=/+HS0w8ZszCYAOyBtA8wFKFaLhnZjZ6+1quCv/KDxz0=; b=ysgFGiLQh0AY5aMRbKS4yZvwW7KZAuIjWuWShjQC6N8UP4f+RHzgwyXcknvUv5EmtG DZZUXyLi2EebahgDdGk5NIPz+DYVgEhJW7HK5hH5ENWLbkwJCAh/sfusHNydjuACTYWT RT0ZtHiCazwpEO/PP07YUKw+hrUh4tMF5klrjicBEnu42YJfrGMh/8XsVF5fC+8mssoH 5ewTXfl8Gv2kCpGguayz8RpJtVjNJiOIEydG9J9nVhE4NIY3mb1lm+8gtSHJ6tHi46KJ Y8cOUusioSx0PG376nCGTlfupGaYe810tlwCEKxymYeF+kv5z4zgfbRL51O4iH28sz00 SJGQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yale.edu; s=googleprd;  h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=/+HS0w8ZszCYAOyBtA8wFKFaLhnZjZ6+1quCv/KDxz0=; b=eMC8xWFEc65k4P8jscJYgknhkw5a1LzIbqMLpd35WIvzYHbpBAojxKIeOTA3uhiCQ5 nymFXcyrOh6AAJm9jWolrFb3m81aK5dxiHt9grn0sZC/TRf/Sxlx6xKRENluf3qWNnDx ctJ39b/3SO7jnKzis4PygW+Tm2IQ/DSyE8r18=
X-Received: by 10.170.123.212 with SMTP id p203mr2478099ykb.67.1414126250519;  Thu, 23 Oct 2014 21:50:50 -0700 (PDT)
MIME-Version: 1.0
Sender: boxs.jq@gmail.com
Received: by 10.170.221.193 with HTTP; Thu, 23 Oct 2014 21:50:30 -0700 (PDT)
In-Reply-To: <CANUuoLpRq5+c2c6zq0F0Nfo3COwtnyhp=h4WYqjRt-MQjkGTHg@mail.gmail.com>
References: <CAFwJzZ=Gj+TtxGHbNoqJ9Ka5erZMdrG_LNqgjo97mQ_H4aTjyA@mail.gmail.com> <CANUuoLpRq5+c2c6zq0F0Nfo3COwtnyhp=h4WYqjRt-MQjkGTHg@mail.gmail.com>
From: Xiao SHI <xiao.shi@yale.edu>
Date: Fri, 24 Oct 2014 00:50:30 -0400
X-Google-Sender-Auth: LTTrFz4a1Z6gZBJi1MDb4KIWYk4
Message-ID: <CAFwJzZ=_qXCefp3ZbhT8GqNnAPvaKyH886ZFFS4GE5eN1g3Diw@mail.gmail.com>
To: "Y. Richard Yang" <yry@cs.yale.edu>
Content-Type: multipart/alternative; boundary=001a1137df54d472a4050623ecd5
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/s2abUTO22-_JbQsJwhl6602d_1E
Cc: Wendy Roome <w.roome@alcatel-lucent.com>, Xiao SHI <xiao.shi@yale.edu>, IETF ALTO <alto@ietf.org>
Subject: Re: [alto] Incremental Update/SSE Key Design Issue 2: sending full resources at the beginning of stream
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 24 Oct 2014 04:50:53 -0000

--001a1137df54d472a4050623ecd5
Content-Type: text/plain; charset=UTF-8

On Fri, Oct 24, 2014 at 12:46 AM, Y. Richard Yang <yry@cs.yale.edu> wrote:

> Good design question.
>
> On Thu, Oct 23, 2014 at 6:37 AM, Xiao SHI <xiao.shi@yale.edu> wrote:
>
>> Hi folks,
>>
>> Another design question is whether we should include the full resource
>> (e.g. full network map/cost map) when the SSE stream is first initiated.
>>
>> The advantage of doing so is that the server does not need to keep any
>> old version of the resources. The full map the server first sends to the
>> client will always be updated, and the updates come when they become
>> available.
>>
>> It also has the following disadvantage:
>> (1) Modularity: SSE streams are for incremental updates, it carries a
>> different functionality than full resource requests;
>> (2) Space efficiency: to reduce the payload for the SSE stream, it would
>> be nice not to do that. It is conceivable that the client fetches the full
>> resource somewhere else and then ask for incremental updates via HTTP SSE
>> stream.
>>
>
> This also means that SSE serves to update only one resource?
>
[sx] not necessarily. say SSE updates cost map C which depends on network
map M, when a client requests update for cost map C, the SSE would initiate
the stream with full map M and C, then follow up with updates on C when
they become available.

>
>
>
>> If we do not send the full resource via SSE, the client needs to request
>> for incremental updates with resource-id and version-tag. there are two
>> possible extreme solutions:
>> (1) the laziest: The server accepts the request that have the most recent
>> version-tag; if the version-tag is not the most update version, the server
>> simply rejects this request.
>> (2) the most costly: The server remembers all history of all resources,
>> when the client requests with a resource-id and vtag, the server accepts
>> the connection, and immediately send out patches to "catch the client up."
>>
>>
>> *Example:*
>> Notate version tags as vi, e.g. v0, v1, v2, etc. And the patches that
>> updates vi to vj as patch(vi->vj) where vi is the old tag and vj is the new
>> tag.
>>
>> Say the current network map is v3. Client 1 requests incr updates with
>> {"resource-id":"my-networkmap", "tag":"v0"} and Client 2 requests incr
>> updates with {"resource-id":"my-networkmap", "tag":"v3"}. The lazy server
>> would reject the request from client 1 and accepts that from client 2. The
>> costly server would accept both request and send patch(v0->v3)
>>
>>
>> Another possible solution is a hybrid of the two extremes. The server
>> keeps a patch that can update the resource from vi to vj, and accepts
>> requests that has vtag vk such that i<=k<=j.
>>
>> Because of the JSON merge-patch replacement property, applying patch(*vi*->vj)
>> would update vk to vj. No matter what vtag vk the request comes in with,
>> the server accepts if i<=k<=j, and immediately sends patch(vi->vj) via the
>> stream. This will update the client's resource to the most updated version.
>> The subsequent updates will be pushed as they become available.The window
>> of [i, j] can be determined by the server, according to time or storage
>> constraints.
>>
>>
> I prefer this last one :-)
>
> Richard
>
>
>> You comments would be much appreciated. Thank you!
>>
>> Best,
>> Xiao
>>
>
>
>
> --
> --
>  =====================================
> | Y. Richard Yang <yry@cs.yale.edu>   |
> | Professor of Computer Science       |
> | http://www.cs.yale.edu/~yry/        |
>  =====================================
>

--001a1137df54d472a4050623ecd5
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Fri, Oct 24, 2014 at 12:46 AM, Y. Richard Yang <span dir=3D"ltr">&lt=
;<a href=3D"mailto:yry@cs.yale.edu" target=3D"_blank">yry@cs.yale.edu</a>&g=
t;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Good de=
sign question.<br><div class=3D"gmail_extra"><br><div class=3D"gmail_quote"=
><span class=3D"">On Thu, Oct 23, 2014 at 6:37 AM, Xiao SHI <span dir=3D"lt=
r">&lt;<a href=3D"mailto:xiao.shi@yale.edu" target=3D"_blank">xiao.shi@yale=
.edu</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"lt=
r">Hi folks,<div><br></div><div>Another design question is whether we shoul=
d include the full resource (e.g. full network map/cost map) when the SSE s=
tream is first initiated.</div><div><br></div><div>The advantage of doing s=
o is that the server does not need to keep any old version of the resources=
. The full map the server first sends to the client will always be updated,=
 and the updates come when they become available.</div><div><br></div><div>=
It also has the following disadvantage:</div><div>(1) Modularity: SSE strea=
ms are for incremental updates, it carries a different functionality than f=
ull resource requests;</div><div>(2) Space efficiency: to reduce the payloa=
d for the SSE stream, it would be nice not to do that. It is conceivable th=
at the client fetches the full resource somewhere else and then ask for inc=
remental updates via HTTP SSE stream.</div></div></blockquote><div>=C2=A0</=
div></span><div>This also means that SSE serves to update only one resource=
?</div></div></div></div></blockquote><div>[sx] not necessarily. say SSE up=
dates cost map C which depends on network map M, when a client requests upd=
ate for cost map C, the SSE would initiate the stream with full map M and C=
, then follow up with updates on C when they become available.=C2=A0</div><=
blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px=
 #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_extra"><=
div class=3D"gmail_quote"><span class=3D""><div>=C2=A0</div><div>=C2=A0</di=
v><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:=
1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div></div><div>If we do =
not send the full resource via SSE, the client needs to request for increme=
ntal updates with resource-id and version-tag.=C2=A0there are two possible =
extreme solutions:</div><div>(1) the laziest: The server accepts the reques=
t that have the most recent version-tag; if the version-tag is not the most=
 update version, the server simply rejects this request.<br></div><div>(2) =
the most costly: The server remembers all history of all resources, when th=
e client requests with a resource-id and vtag, the server accepts the conne=
ction, and immediately send out patches to &quot;catch the client up.&quot;=
<br></div><div><br></div><div><br></div><div><b>Example:</b></div><div>Nota=
te version tags as vi, e.g. v0, v1, v2, etc. And the patches that updates v=
i to vj as patch(vi-&gt;vj) where vi is the old tag and vj is the new tag.<=
/div><div><br></div><div>Say the current network map is v3. Client 1 reques=
ts incr updates with {&quot;resource-id&quot;:&quot;my-networkmap&quot;, &q=
uot;tag&quot;:&quot;v0&quot;} and Client 2 requests incr updates with {&quo=
t;resource-id&quot;:&quot;my-networkmap&quot;, &quot;tag&quot;:&quot;v3&quo=
t;}. The lazy server would reject the request from client 1 and accepts tha=
t from client 2. The costly server would accept both request and send patch=
(v0-&gt;v3)</div><div><br></div><div><br></div><div>Another possible soluti=
on is a hybrid of the two extremes. The server keeps a patch that can updat=
e the resource from vi to vj, and accepts requests that has vtag vk such th=
at i&lt;=3Dk&lt;=3Dj.</div><div><br></div><div>Because of the JSON merge-pa=
tch replacement property, applying patch(<b>vi</b>-&gt;vj) would update vk =
to vj. No matter what vtag vk the request comes in with, the server accepts=
 if i&lt;=3Dk&lt;=3Dj, and immediately sends patch(vi-&gt;vj) via the strea=
m. This will update the client&#39;s resource to the most updated version. =
The subsequent updates will be pushed as they become available.The window o=
f [i, j] can be determined by the server, according to time or storage cons=
traints.</div><div><br></div></div></blockquote><div><br></div></span><div>=
I prefer this last one :-)</div><div><br></div><div>Richard</div><span clas=
s=3D""><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0=
 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><di=
v></div><div>You comments would be much appreciated. Thank you!</div><div><=
br></div><div>Best,</div><div>Xiao</div></div>
</blockquote></span></div><span class=3D"HOEnZb"><font color=3D"#888888"><b=
r><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"><div><font face=
=3D"courier new, monospace">--=C2=A0</font></div><div><font face=3D"courier=
 new, monospace">=C2=A0=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</font></div><d=
iv><font face=3D"courier new, monospace">| Y. Richard Yang &lt;<a href=3D"m=
ailto:yry@cs.yale.edu" target=3D"_blank">yry@cs.yale.edu</a>&gt; =C2=A0 |</=
font></div><div><font face=3D"courier new, monospace">| Professor of Comput=
er Science =C2=A0 =C2=A0 =C2=A0 |</font></div><div><font face=3D"courier ne=
w, monospace">| <a href=3D"http://www.cs.yale.edu/~yry/" target=3D"_blank">=
http://www.cs.yale.edu/~yry/</a> =C2=A0 =C2=A0 =C2=A0 =C2=A0|</font></div><=
div><font face=3D"courier new, monospace">=C2=A0=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D</font></div></div>
</font></span></div></div>
</blockquote></div><br></div></div>

--001a1137df54d472a4050623ecd5--


From nobody Fri Oct 24 07:43:32 2014
Return-Path: <13xinwang@tongji.edu.cn>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 941A11A0125 for <alto@ietfa.amsl.com>; Fri, 24 Oct 2014 07:43:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 2.789
X-Spam-Level: **
X-Spam-Status: No, score=2.789 tagged_above=-999 required=5 tests=[BAYES_50=0.8, GB_SUMOF=1, HTML_MESSAGE=0.001, J_BACKHAIR_12=1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 pE9r1SwV9Bvp for <alto@ietfa.amsl.com>; Fri, 24 Oct 2014 07:43:27 -0700 (PDT)
Received: from tongji.edu.cn (mail1.tongji.edu.cn [202.120.189.172]) by ietfa.amsl.com (Postfix) with ESMTP id 967211A0121 for <alto@ietf.org>; Fri, 24 Oct 2014 07:43:24 -0700 (PDT)
Received: by ajax-webmail-app1 (Coremail) ; Fri, 24 Oct 2014 22:42:29 +0800 (GMT+08:00)
Date: Fri, 24 Oct 2014 22:42:29 +0800 (GMT+08:00)
From: 13xinwang@tongji.edu.cn
To: xiao.shi@yale.edu
Message-ID: <a9f5f.2115a.149429bd4dd.Coremail.13xinwang@tongji.edu.cn>
MIME-Version: 1.0
Content-Type: multipart/mixed;  boundary="----=_Part_446068_1102711269.1414161749210"
X-Originating-IP: [10.60.149.72]
X-Priority: 3
X-Mailer: Coremail Webmail Server Version XT2.1.10 dev build 20131120(24194.5778.5783) Copyright (c) 2002-2014 www.mailtech.cn tongji
X-SendMailWithSms: false
X-CM-TRANSID: BXyowEAZIHhVZUpUmVY9AA--.4954W
X-CM-SenderInfo: qrtrikqqw630pqjmxhxhgxhubq/1tbiAQAHA1H6MgDHxAABse
X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VW3Jw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU=
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/Sn0Dp0kaWm34V_0ciHcWv4hOs4s
Cc: alto@ietf.org
Subject: [alto] Fw: Incremental Update/SSE Key Design Issue 2: sending full resources at the beginning of stream
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 24 Oct 2014 14:43:30 -0000

------=_Part_446068_1102711269.1414161749210
Content-Type: multipart/alternative; 
	boundary="----=_Part_446070_611611934.1414161749210"

------=_Part_446070_611611934.1414161749210
Content-Type: text/plain; charset=GBK
Content-Transfer-Encoding: base64

SGkgWGlhbywKCgpNeSBzdWdnZXN0aW9uIGlzIHRoYXQgaWYgd2UgY2FuIGFkb3B0IHlvdXIgd2lu
ZG93IGRlc2lnbiBpbnRvIHRoZSBtb3N0IGNvc3RseSBzb2x1dGlvbiB0byBtYWtlIGFsbCB2ZXJz
aW9uIGNhbiBiZSBhY2NlcHRhYmxlLiBXZSBhc3N1bWUgVjAgaXMgdGhlIGZpcnN0IHZlcnNpb24g
YW5kIFZrbiBpcyB0aGUgbGFzdCB2ZXJzaW9uLCBhbmQgdGhlIHNlcnZlciBrZWVwcyBWMC0+Vmss
IFZrLT5WMmssLi4uLCBWKG4tMSlrLT5Wa24uCgoKVGhlIHByb2JsZW0gaGVyZSBpIHRoaW5rIGlz
IHRoZSBzaXplIG9mIHBhdGNoIGJldHdlZW4gVmktPlZqIGFuZCB0aGUgc3VtIG9mIFZpLT5WKGkr
MSksIFYoaSsxKS0+VihpKzIpLC4uLiBWKGotMSktPlZqLiBXZSBzZXQgdGhlIGZpcnN0IG9uZSBp
cyBTMSBhbmQgdGhlIHNlY29uZCBvbmUgaXMgUzI6IDEuIGlmIGVhY2ggcGF0Y2ggZG9lcyBub3Qg
b3ZlcmxhcCB3aXRoIG90aGVycywgUzEgPSBTMjsgMi4gZWxzZSwgUzEgPCBTMi4KCgpIb3dldmVy
LCBhcyB2ZXJzaW9ucyBjaGFuZ2UsIHRoZSBkaWZmZXJlbmNlIGJldHdlZW4gVmkgYW5kIFZqIGNh
biBiZSBodWdlICh0aGUgc2l6ZSBvZiBWaS0+VmogaXMgYWxzbyBodWdlIGNvcnJlc3BvbmRpbmds
eSksIHdoaWNoIG1ha2VzIFZpLT5WaiBpcyBub3Qgc3VpdGFibGUgYXMgYSBwYXRjaC4gU28sIGkg
dGhpbmsgaWYgd2UgY2FuIGdldCB0aGUgYmVzdCB2YWx1ZSBvZiBrLCB3ZSBjYW4gbWFrZSBzZXJ2
ZXIgbm90IHJlamVjdCBhbnkgcmVxdWVzdCB3aGlsZSBtYWludGFpbmluZyBoaWdoIHBlcmZvcm1h
bmNlLgoKCklzIHRoaXMgcmlnaHQ/CgoKVGhhbmtzLApYaW4gCgoKRnJvbTogeGlhby5zaGlAeWFs
ZS5lZHUKRGF0ZTogVGh1LCAyMyBPY3QgMjAxNCAwNjozNzoxMiAtMDQwMApUbzogYWx0b0BpZXRm
Lm9yZwpDQzogdy5yb29tZUBhbGNhdGVsLWx1Y2VudC5jb20KU3ViamVjdDogW2FsdG9dIEluY3Jl
bWVudGFsIFVwZGF0ZS9TU0UgS2V5IERlc2lnbiBJc3N1ZSAyOiBzZW5kaW5nIGZ1bGwgcmVzb3Vy
Y2VzIGF0IHRoZSBiZWdpbm5pbmcgb2Ygc3RyZWFtCgoKSGkgZm9sa3MsCgoKQW5vdGhlciBkZXNp
Z24gcXVlc3Rpb24gaXMgd2hldGhlciB3ZSBzaG91bGQgaW5jbHVkZSB0aGUgZnVsbCByZXNvdXJj
ZSAoZS5nLiBmdWxsIG5ldHdvcmsgbWFwL2Nvc3QgbWFwKSB3aGVuIHRoZSBTU0Ugc3RyZWFtIGlz
IGZpcnN0IGluaXRpYXRlZC4KCgpUaGUgYWR2YW50YWdlIG9mIGRvaW5nIHNvIGlzIHRoYXQgdGhl
IHNlcnZlciBkb2VzIG5vdCBuZWVkIHRvIGtlZXAgYW55IG9sZCB2ZXJzaW9uIG9mIHRoZSByZXNv
dXJjZXMuIFRoZSBmdWxsIG1hcCB0aGUgc2VydmVyIGZpcnN0IHNlbmRzIHRvIHRoZSBjbGllbnQg
d2lsbCBhbHdheXMgYmUgdXBkYXRlZCwgYW5kIHRoZSB1cGRhdGVzIGNvbWUgd2hlbiB0aGV5IGJl
Y29tZSBhdmFpbGFibGUuCgoKSXQgYWxzbyBoYXMgdGhlIGZvbGxvd2luZyBkaXNhZHZhbnRhZ2U6
CigxKSBNb2R1bGFyaXR5OiBTU0Ugc3RyZWFtcyBhcmUgZm9yIGluY3JlbWVudGFsIHVwZGF0ZXMs
IGl0IGNhcnJpZXMgYSBkaWZmZXJlbnQgZnVuY3Rpb25hbGl0eSB0aGFuIGZ1bGwgcmVzb3VyY2Ug
cmVxdWVzdHM7CigyKSBTcGFjZSBlZmZpY2llbmN5OiB0byByZWR1Y2UgdGhlIHBheWxvYWQgZm9y
IHRoZSBTU0Ugc3RyZWFtLCBpdCB3b3VsZCBiZSBuaWNlIG5vdCB0byBkbyB0aGF0LiBJdCBpcyBj
b25jZWl2YWJsZSB0aGF0IHRoZSBjbGllbnQgZmV0Y2hlcyB0aGUgZnVsbCByZXNvdXJjZSBzb21l
d2hlcmUgZWxzZSBhbmQgdGhlbiBhc2sgZm9yIGluY3JlbWVudGFsIHVwZGF0ZXMgdmlhIEhUVFAg
U1NFIHN0cmVhbS4KCgoKCklmIHdlIGRvIG5vdCBzZW5kIHRoZSBmdWxsIHJlc291cmNlIHZpYSBT
U0UsIHRoZSBjbGllbnQgbmVlZHMgdG8gcmVxdWVzdCBmb3IgaW5jcmVtZW50YWwgdXBkYXRlcyB3
aXRoIHJlc291cmNlLWlkIGFuZCB2ZXJzaW9uLXRhZy4gdGhlcmUgYXJlIHR3byBwb3NzaWJsZSBl
eHRyZW1lIHNvbHV0aW9uczoKKDEpIHRoZSBsYXppZXN0OiBUaGUgc2VydmVyIGFjY2VwdHMgdGhl
IHJlcXVlc3QgdGhhdCBoYXZlIHRoZSBtb3N0IHJlY2VudCB2ZXJzaW9uLXRhZzsgaWYgdGhlIHZl
cnNpb24tdGFnIGlzIG5vdCB0aGUgbW9zdCB1cGRhdGUgdmVyc2lvbiwgdGhlIHNlcnZlciBzaW1w
bHkgcmVqZWN0cyB0aGlzIHJlcXVlc3QuCgooMikgdGhlIG1vc3QgY29zdGx5OiBUaGUgc2VydmVy
IHJlbWVtYmVycyBhbGwgaGlzdG9yeSBvZiBhbGwgcmVzb3VyY2VzLCB3aGVuIHRoZSBjbGllbnQg
cmVxdWVzdHMgd2l0aCBhIHJlc291cmNlLWlkIGFuZCB2dGFnLCB0aGUgc2VydmVyIGFjY2VwdHMg
dGhlIGNvbm5lY3Rpb24sIGFuZCBpbW1lZGlhdGVseSBzZW5kIG91dCBwYXRjaGVzIHRvICJjYXRj
aCB0aGUgY2xpZW50IHVwLiIKCgoKCgpFeGFtcGxlOgpOb3RhdGUgdmVyc2lvbiB0YWdzIGFzIHZp
LCBlLmcuIHYwLCB2MSwgdjIsIGV0Yy4gQW5kIHRoZSBwYXRjaGVzIHRoYXQgdXBkYXRlcyB2aSB0
byB2aiBhcyBwYXRjaCh2aS0+dmopIHdoZXJlIHZpIGlzIHRoZSBvbGQgdGFnIGFuZCB2aiBpcyB0
aGUgbmV3IHRhZy4KCgpTYXkgdGhlIGN1cnJlbnQgbmV0d29yayBtYXAgaXMgdjMuIENsaWVudCAx
IHJlcXVlc3RzIGluY3IgdXBkYXRlcyB3aXRoIHsicmVzb3VyY2UtaWQiOiJteS1uZXR3b3JrbWFw
IiwgInRhZyI6InYwIn0gYW5kIENsaWVudCAyIHJlcXVlc3RzIGluY3IgdXBkYXRlcyB3aXRoIHsi
cmVzb3VyY2UtaWQiOiJteS1uZXR3b3JrbWFwIiwgInRhZyI6InYzIn0uIFRoZSBsYXp5IHNlcnZl
ciB3b3VsZCByZWplY3QgdGhlIHJlcXVlc3QgZnJvbSBjbGllbnQgMSBhbmQgYWNjZXB0cyB0aGF0
IGZyb20gY2xpZW50IDIuIFRoZSBjb3N0bHkgc2VydmVyIHdvdWxkIGFjY2VwdCBib3RoIHJlcXVl
c3QgYW5kIHNlbmQgcGF0Y2godjAtPnYzKQoKCgoKQW5vdGhlciBwb3NzaWJsZSBzb2x1dGlvbiBp
cyBhIGh5YnJpZCBvZiB0aGUgdHdvIGV4dHJlbWVzLiBUaGUgc2VydmVyIGtlZXBzIGEgcGF0Y2gg
dGhhdCBjYW4gdXBkYXRlIHRoZSByZXNvdXJjZSBmcm9tIHZpIHRvIHZqLCBhbmQgYWNjZXB0cyBy
ZXF1ZXN0cyB0aGF0IGhhcyB2dGFnIHZrIHN1Y2ggdGhhdCBpPD1rPD1qLgoKCkJlY2F1c2Ugb2Yg
dGhlIEpTT04gbWVyZ2UtcGF0Y2ggcmVwbGFjZW1lbnQgcHJvcGVydHksIGFwcGx5aW5nIHBhdGNo
KHZpLT52aikgd291bGQgdXBkYXRlIHZrIHRvIHZqLiBObyBtYXR0ZXIgd2hhdCB2dGFnIHZrIHRo
ZSByZXF1ZXN0IGNvbWVzIGluIHdpdGgsIHRoZSBzZXJ2ZXIgYWNjZXB0cyBpZiBpPD1rPD1qLCBh
bmQgaW1tZWRpYXRlbHkgc2VuZHMgcGF0Y2godmktPnZqKSB2aWEgdGhlIHN0cmVhbS4gVGhpcyB3
aWxsIHVwZGF0ZSB0aGUgY2xpZW50J3MgcmVzb3VyY2UgdG8gdGhlIG1vc3QgdXBkYXRlZCB2ZXJz
aW9uLiBUaGUgc3Vic2VxdWVudCB1cGRhdGVzIHdpbGwgYmUgcHVzaGVkIGFzIHRoZXkgYmVjb21l
IGF2YWlsYWJsZS5UaGUgd2luZG93IG9mIFtpLCBqXSBjYW4gYmUgZGV0ZXJtaW5lZCBieSB0aGUg
c2VydmVyLCBhY2NvcmRpbmcgdG8gdGltZSBvciBzdG9yYWdlIGNvbnN0cmFpbnRzLgoKCllvdSBj
b21tZW50cyB3b3VsZCBiZSBtdWNoIGFwcHJlY2lhdGVkLiBUaGFuayB5b3UhCgoKQmVzdCwKWGlh
bwoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18gYWx0byBt
YWlsaW5nIGxpc3QgYWx0b0BpZXRmLm9yZyBodHRwczovL3d3dy5pZXRmLm9yZy9tYWlsbWFuL2xp
c3RpbmZvL2FsdG8KCg==
------=_Part_446070_611611934.1414161749210
Content-Type: text/html; charset=GBK
Content-Transfer-Encoding: base64

SGkgWGlhbyw8ZGl2Pjxicj48L2Rpdj48ZGl2Pk15IHN1Z2dlc3Rpb24gaXMgdGhhdCBpZiB3ZSBj
YW4gYWRvcHQgeW91ciB3aW5kb3cgZGVzaWduIGludG8gdGhlIG1vc3QgY29zdGx5IHNvbHV0aW9u
IHRvIG1ha2UgYWxsIHZlcnNpb24gY2FuIGJlIGFjY2VwdGFibGUuIFdlIGFzc3VtZSBWMCBpcyB0
aGUgZmlyc3QgdmVyc2lvbiBhbmQgVmtuIGlzIHRoZSBsYXN0IHZlcnNpb24sIGFuZCB0aGUgc2Vy
dmVyIGtlZXBzIFYwLSZndDtWaywgVmstJmd0O1YyaywuLi4sIFYobi0xKWstJmd0O1Zrbi48L2Rp
dj48ZGl2Pjxicj48L2Rpdj48ZGl2PlRoZSBwcm9ibGVtIGhlcmUgaSB0aGluayBpcyB0aGUgc2l6
ZSBvZiBwYXRjaCBiZXR3ZWVuIFZpLSZndDtWaiBhbmQgdGhlIHN1bSBvZiBWaS0mZ3Q7VihpKzEp
LCBWKGkrMSktJmd0O1YoaSsyKSwuLi4gVihqLTEpLSZndDtWai4gV2Ugc2V0IHRoZSBmaXJzdCBv
bmUgaXMgUzEgYW5kIHRoZSBzZWNvbmQgb25lIGlzIFMyOiAxLiBpZiBlYWNoIHBhdGNoIGRvZXMg
bm90IG92ZXJsYXAgd2l0aCBvdGhlcnMsIFMxID0gUzI7IDIuIGVsc2UsIFMxICZsdDsgUzIuPC9k
aXY+PGRpdj48YnI+PC9kaXY+PGRpdj5Ib3dldmVyLCBhcyB2ZXJzaW9ucyBjaGFuZ2UsIHRoZSBk
aWZmZXJlbmNlIGJldHdlZW4gVmkgYW5kIFZqIGNhbiBiZSBodWdlICh0aGUgc2l6ZSBvZiBWaS0m
Z3Q7VmogaXMgYWxzbyBodWdlIGNvcnJlc3BvbmRpbmdseSksIHdoaWNoIG1ha2VzIFZpLSZndDtW
aiBpcyBub3Qgc3VpdGFibGUgYXMgYSBwYXRjaC4gU28sIGkgdGhpbmsgaWYgd2UgY2FuIGdldCB0
aGUgYmVzdCB2YWx1ZSBvZiBrLCB3ZSBjYW4gbWFrZSBzZXJ2ZXIgbm90IHJlamVjdCBhbnkgcmVx
dWVzdCB3aGlsZSBtYWludGFpbmluZyBoaWdoIHBlcmZvcm1hbmNlLjwvZGl2PjxkaXY+PGJyPjwv
ZGl2PjxkaXY+SXMgdGhpcyByaWdodD88L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PlRoYW5rcyw8
L2Rpdj48ZGl2PlhpbiZuYnNwOzxkaXYgZGlyPSJsdHIiPjxicj48ZGl2PjxociBpZD0ic3RvcFNw
ZWxsaW5nIj5Gcm9tOiA8YSBocmVmPSJtYWlsdG86eGlhby5zaGlAeWFsZS5lZHUiIHRhcmdldD0i
X2JsYW5rIj54aWFvLnNoaUB5YWxlLmVkdTwvYT48YnI+RGF0ZTogVGh1LCAyMyBPY3QgMjAxNCAw
NjozNzoxMiAtMDQwMDxicj5UbzogPGEgaHJlZj0ibWFpbHRvOmFsdG9AaWV0Zi5vcmciIHRhcmdl
dD0iX2JsYW5rIj5hbHRvQGlldGYub3JnPC9hPjxicj5DQzogPGEgaHJlZj0ibWFpbHRvOncucm9v
bWVAYWxjYXRlbC1sdWNlbnQuY29tIiB0YXJnZXQ9Il9ibGFuayI+dy5yb29tZUBhbGNhdGVsLWx1
Y2VudC5jb208L2E+PGJyPlN1YmplY3Q6IFthbHRvXSBJbmNyZW1lbnRhbCBVcGRhdGUvU1NFIEtl
eSBEZXNpZ24gSXNzdWUgMjogc2VuZGluZyBmdWxsIHJlc291cmNlcyBhdCB0aGUgYmVnaW5uaW5n
IG9mIHN0cmVhbTxicj48YnI+PGRpdiBkaXI9Imx0ciI+SGkgZm9sa3MsPGRpdj48YnI+PC9kaXY+
PGRpdj5Bbm90aGVyIGRlc2lnbiBxdWVzdGlvbiBpcyB3aGV0aGVyIHdlIHNob3VsZCBpbmNsdWRl
IHRoZSBmdWxsIHJlc291cmNlIChlLmcuIGZ1bGwgbmV0d29yayBtYXAvY29zdCBtYXApIHdoZW4g
dGhlIFNTRSBzdHJlYW0gaXMgZmlyc3QgaW5pdGlhdGVkLjwvZGl2PjxkaXY+PGJyPjwvZGl2Pjxk
aXY+VGhlIGFkdmFudGFnZSBvZiBkb2luZyBzbyBpcyB0aGF0IHRoZSBzZXJ2ZXIgZG9lcyBub3Qg
bmVlZCB0byBrZWVwIGFueSBvbGQgdmVyc2lvbiBvZiB0aGUgcmVzb3VyY2VzLiBUaGUgZnVsbCBt
YXAgdGhlIHNlcnZlciBmaXJzdCBzZW5kcyB0byB0aGUgY2xpZW50IHdpbGwgYWx3YXlzIGJlIHVw
ZGF0ZWQsIGFuZCB0aGUgdXBkYXRlcyBjb21lIHdoZW4gdGhleSBiZWNvbWUgYXZhaWxhYmxlLjwv
ZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+SXQgYWxzbyBoYXMgdGhlIGZvbGxvd2luZyBkaXNhZHZh
bnRhZ2U6PC9kaXY+PGRpdj4oMSkgTW9kdWxhcml0eTogU1NFIHN0cmVhbXMgYXJlIGZvciBpbmNy
ZW1lbnRhbCB1cGRhdGVzLCBpdCBjYXJyaWVzIGEgZGlmZmVyZW50IGZ1bmN0aW9uYWxpdHkgdGhh
biBmdWxsIHJlc291cmNlIHJlcXVlc3RzOzwvZGl2PjxkaXY+KDIpIFNwYWNlIGVmZmljaWVuY3k6
IHRvIHJlZHVjZSB0aGUgcGF5bG9hZCBmb3IgdGhlIFNTRSBzdHJlYW0sIGl0IHdvdWxkIGJlIG5p
Y2Ugbm90IHRvIGRvIHRoYXQuIEl0IGlzIGNvbmNlaXZhYmxlIHRoYXQgdGhlIGNsaWVudCBmZXRj
aGVzIHRoZSBmdWxsIHJlc291cmNlIHNvbWV3aGVyZSBlbHNlIGFuZCB0aGVuIGFzayBmb3IgaW5j
cmVtZW50YWwgdXBkYXRlcyB2aWEgSFRUUCBTU0Ugc3RyZWFtLjwvZGl2PjxkaXY+PGJyPjwvZGl2
PjxkaXY+PGJyPjwvZGl2PjxkaXY+SWYgd2UgZG8gbm90IHNlbmQgdGhlIGZ1bGwgcmVzb3VyY2Ug
dmlhIFNTRSwgdGhlIGNsaWVudCBuZWVkcyB0byByZXF1ZXN0IGZvciBpbmNyZW1lbnRhbCB1cGRh
dGVzIHdpdGggcmVzb3VyY2UtaWQgYW5kIHZlcnNpb24tdGFnLiZuYnNwO3RoZXJlIGFyZSB0d28g
cG9zc2libGUgZXh0cmVtZSBzb2x1dGlvbnM6PC9kaXY+PGRpdj4oMSkgdGhlIGxhemllc3Q6IFRo
ZSBzZXJ2ZXIgYWNjZXB0cyB0aGUgcmVxdWVzdCB0aGF0IGhhdmUgdGhlIG1vc3QgcmVjZW50IHZl
cnNpb24tdGFnOyBpZiB0aGUgdmVyc2lvbi10YWcgaXMgbm90IHRoZSBtb3N0IHVwZGF0ZSB2ZXJz
aW9uLCB0aGUgc2VydmVyIHNpbXBseSByZWplY3RzIHRoaXMgcmVxdWVzdC48YnI+PC9kaXY+PGRp
dj4oMikgdGhlIG1vc3QgY29zdGx5OiBUaGUgc2VydmVyIHJlbWVtYmVycyBhbGwgaGlzdG9yeSBv
ZiBhbGwgcmVzb3VyY2VzLCB3aGVuIHRoZSBjbGllbnQgcmVxdWVzdHMgd2l0aCBhIHJlc291cmNl
LWlkIGFuZCB2dGFnLCB0aGUgc2VydmVyIGFjY2VwdHMgdGhlIGNvbm5lY3Rpb24sIGFuZCBpbW1l
ZGlhdGVseSBzZW5kIG91dCBwYXRjaGVzIHRvICJjYXRjaCB0aGUgY2xpZW50IHVwLiI8YnI+PC9k
aXY+PGRpdj48YnI+PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj48Yj5FeGFtcGxlOjwvYj48L2Rp
dj48ZGl2Pk5vdGF0ZSB2ZXJzaW9uIHRhZ3MgYXMgdmksIGUuZy4gdjAsIHYxLCB2MiwgZXRjLiBB
bmQgdGhlIHBhdGNoZXMgdGhhdCB1cGRhdGVzIHZpIHRvIHZqIGFzIHBhdGNoKHZpLSZndDt2aikg
d2hlcmUgdmkgaXMgdGhlIG9sZCB0YWcgYW5kIHZqIGlzIHRoZSBuZXcgdGFnLjwvZGl2PjxkaXY+
PGJyPjwvZGl2PjxkaXY+U2F5IHRoZSBjdXJyZW50IG5ldHdvcmsgbWFwIGlzIHYzLiBDbGllbnQg
MSByZXF1ZXN0cyBpbmNyIHVwZGF0ZXMgd2l0aCB7InJlc291cmNlLWlkIjoibXktbmV0d29ya21h
cCIsICJ0YWciOiJ2MCJ9IGFuZCBDbGllbnQgMiByZXF1ZXN0cyBpbmNyIHVwZGF0ZXMgd2l0aCB7
InJlc291cmNlLWlkIjoibXktbmV0d29ya21hcCIsICJ0YWciOiJ2MyJ9LiBUaGUgbGF6eSBzZXJ2
ZXIgd291bGQgcmVqZWN0IHRoZSByZXF1ZXN0IGZyb20gY2xpZW50IDEgYW5kIGFjY2VwdHMgdGhh
dCBmcm9tIGNsaWVudCAyLiBUaGUgY29zdGx5IHNlcnZlciB3b3VsZCBhY2NlcHQgYm90aCByZXF1
ZXN0IGFuZCBzZW5kIHBhdGNoKHYwLSZndDt2Myk8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2Pjxi
cj48L2Rpdj48ZGl2PkFub3RoZXIgcG9zc2libGUgc29sdXRpb24gaXMgYSBoeWJyaWQgb2YgdGhl
IHR3byBleHRyZW1lcy4gVGhlIHNlcnZlciBrZWVwcyBhIHBhdGNoIHRoYXQgY2FuIHVwZGF0ZSB0
aGUgcmVzb3VyY2UgZnJvbSB2aSB0byB2aiwgYW5kIGFjY2VwdHMgcmVxdWVzdHMgdGhhdCBoYXMg
dnRhZyB2ayBzdWNoIHRoYXQgaSZsdDs9ayZsdDs9ai48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2
PkJlY2F1c2Ugb2YgdGhlIEpTT04gbWVyZ2UtcGF0Y2ggcmVwbGFjZW1lbnQgcHJvcGVydHksIGFw
cGx5aW5nIHBhdGNoKDxiPnZpPC9iPi0mZ3Q7dmopIHdvdWxkIHVwZGF0ZSB2ayB0byB2ai4gTm8g
bWF0dGVyIHdoYXQgdnRhZyB2ayB0aGUgcmVxdWVzdCBjb21lcyBpbiB3aXRoLCB0aGUgc2VydmVy
IGFjY2VwdHMgaWYgaSZsdDs9ayZsdDs9aiwgYW5kIGltbWVkaWF0ZWx5IHNlbmRzIHBhdGNoKHZp
LSZndDt2aikgdmlhIHRoZSBzdHJlYW0uIFRoaXMgd2lsbCB1cGRhdGUgdGhlIGNsaWVudCdzIHJl
c291cmNlIHRvIHRoZSBtb3N0IHVwZGF0ZWQgdmVyc2lvbi4gVGhlIHN1YnNlcXVlbnQgdXBkYXRl
cyB3aWxsIGJlIHB1c2hlZCBhcyB0aGV5IGJlY29tZSBhdmFpbGFibGUuVGhlIHdpbmRvdyBvZiBb
aSwgal0gY2FuIGJlIGRldGVybWluZWQgYnkgdGhlIHNlcnZlciwgYWNjb3JkaW5nIHRvIHRpbWUg
b3Igc3RvcmFnZSBjb25zdHJhaW50cy48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PllvdSBjb21t
ZW50cyB3b3VsZCBiZSBtdWNoIGFwcHJlY2lhdGVkLiBUaGFuayB5b3UhPC9kaXY+PGRpdj48YnI+
PC9kaXY+PGRpdj5CZXN0LDwvZGl2PjxkaXY+WGlhbzwvZGl2PjwvZGl2Pgo8YnI+X19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYWx0byBtYWlsaW5nIGxpc3QK
PGEgaHJlZj0ibWFpbHRvOmFsdG9AaWV0Zi5vcmciIHRhcmdldD0iX2JsYW5rIj5hbHRvQGlldGYu
b3JnPC9hPgpodHRwczovL3d3dy5pZXRmLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2FsdG88L2Rpdj4g
CQkgCSAgIAkJICA8L2Rpdj4KPGJyPjxzcGFuPjwvc3Bhbj48L2Rpdj48c3R5bGU+PCEtLQouaG1t
ZXNzYWdlIFAKewptYXJnaW46MHB4OwpwYWRkaW5nOjBweAp9CmJvZHkuaG1tZXNzYWdlCnsKZm9u
dC1zaXplOiAxMnB0Owpmb250LWZhbWlseTrOosjt0cW62gp9Ci0tPjwvc3R5bGU+
------=_Part_446070_611611934.1414161749210--

------=_Part_446068_1102711269.1414161749210
Content-Type: text/plain; name="ATT00001"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="ATT00001"

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18NCmFsdG8gbWFp
bGluZyBsaXN0DQphbHRvQGlldGYub3JnDQpodHRwczovL3d3dy5pZXRmLm9yZy9tYWlsbWFuL2xp
c3RpbmZvL2FsdG8NCg==

------=_Part_446068_1102711269.1414161749210--


From nobody Fri Oct 24 12:40:40 2014
Return-Path: <w.roome@alcatel-lucent.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 071E71A9098 for <alto@ietfa.amsl.com>; Fri, 24 Oct 2014 12:40:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.491
X-Spam-Level: 
X-Spam-Status: No, score=0.491 tagged_above=-999 required=5 tests=[BAYES_05=-0.5, J_BACKHAIR_12=1, MIME_QP_LONG_LINE=0.001, T_RP_MATCHES_RCVD=-0.01] 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 6opD3UuXQqRW for <alto@ietfa.amsl.com>; Fri, 24 Oct 2014 12:40:35 -0700 (PDT)
Received: from smtp-us.alcatel-lucent.com (us-hpatc-esg-01.alcatel-lucent.com [135.245.18.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 532F51A90B7 for <alto@ietf.org>; Fri, 24 Oct 2014 12:40:33 -0700 (PDT)
Received: from us70uusmtp3.zam.alcatel-lucent.com (unknown [135.5.2.65]) by Websense Email Security Gateway with ESMTPS id 30F7133C3EA7B for <alto@ietf.org>; Fri, 24 Oct 2014 19:40:29 +0000 (GMT)
Received: from usnavsmail3.ndc.alcatel-lucent.com (usnavsmail3.ndc.alcatel-lucent.com [135.3.39.11]) by us70uusmtp3.zam.alcatel-lucent.com (GMO) with ESMTP id s9OJeWgb014189 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for <alto@ietf.org>; Fri, 24 Oct 2014 15:40:32 -0400
Received: from umail.lucent.com (umail.ndc.lucent.com [135.3.40.61]) by usnavsmail3.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id s9OJeV7l001830 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for <alto@ietf.org>; Fri, 24 Oct 2014 14:40:31 -0500
Received: from [135.222.152.71] (wdr-i7mbp2.mh.lucent.com [135.222.152.71]) by umail.lucent.com (8.13.8/TPES) with ESMTP id s9OJeSt8004554 for <alto@ietf.org>; Fri, 24 Oct 2014 14:40:30 -0500 (CDT)
User-Agent: Microsoft-MacOutlook/14.4.5.141003
Date: Fri, 24 Oct 2014 15:40:35 -0400
From: Wendy Roome <w.roome@alcatel-lucent.com>
To: <alto@ietf.org>
Message-ID: <D0701DBF.199360%w.roome@alcatel-lucent.com>
Thread-Topic: Incremental Update/SSE Key Design Issue 2: sending  full resources at the beginning of stream
Mime-version: 1.0
Content-type: text/plain; charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable
X-Scanned-By: MIMEDefang 2.64 on 135.3.39.11
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/q94M-q9hu4thcXgWc45prOUF9sQ
Subject: Re: [alto] Incremental Update/SSE Key Design Issue 2: sending full resources at the beginning of stream
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 24 Oct 2014 19:40:37 -0000

That can work for Network Maps, but I don't think it is a good idea for
Cost Map updates. Here is why.

First, Network Maps already are versioned, and although the protocol does
not require it, the assumption is that Network Maps do not change very
often. So when a client requests an Update Stream, the client could give
the vtag of its current Network Map. If that is the latest version, the
server can omit sending the full Network Map.

But Cost Maps don't have version tags, at least not yet, so that trick
doesn't work for them. And I do not think we should add version tags to
Cost Maps if we can avoid them. Why? Because vtags force changes to happen
in discrete quantum jumps. Right now, conceptually, anyway, cost map
changes trickle in as a continuous process. Cost PID1=3D>PID2 changes. Cost
PID47=3D>PI9 changes. Etc. But if we have to assign vtags to Cost Map
versions, then the server has to somehow hold updates until it has enough
to justify assigning a new tag.

Consider how this would work without Cost Map vtags. An update stream
would send updates for a Network Map and its associated Cost Maps (or
perhaps a subset of those Cost Maps). FThe ALTO server would have an
update buffer for each update stream. When a cost changes, a central
thread in the server appends the new cost to the buffer of every stream
that subscribes to that cost map. Each update stream has its own sender
thread (in case the tcp/wrote blocks). Each thread would batch up the
individual PID->PID cost updates into merge-patch messages and send them
to its client. Each sender thread would separately decide how many costs
to fold into one merge-patch update message; there is no "master clock=B2.

I think that is much more modular than trying to assign versions to every
cost update and get every stream to operate in lock-step.

And yes, the downside is that if a stream terminates abnormally, the
server has to resend the full cost map. While that isn't esthetically
pleasing, it is simple. And unless we expect streams to fail frequently, I
vote for simplicity.

	- Wendy Roome

On 10/23/2014, 11:08, "alto-request@ietf.org" <alto-request@ietf.org>
wrote:

>Date: Thu, 23 Oct 2014 06:37:12 -0400
>From: Xiao SHI <xiao.shi@yale.edu>
>Subject: [alto] Incremental Update/SSE Key Design Issue 2: sending
>	full resources at the beginning of stream
>
>Hi folks,
>
>Another design question is whether we should include the full resource
>(e.g. full network map/cost map) when the SSE stream is first initiated.
>
>The advantage of doing so is that the server does not need to keep any old
>version of the resources. The full map the server first sends to the
>client
>will always be updated, and the updates come when they become available.
>
>It also has the following disadvantage:
>(1) Modularity: SSE streams are for incremental updates, it carries a
>different functionality than full resource requests;
>(2) Space efficiency: to reduce the payload for the SSE stream, it would
>be
>nice not to do that. It is conceivable that the client fetches the full
>resource somewhere else and then ask for incremental updates via HTTP SSE
>stream.
>
>
>If we do not send the full resource via SSE, the client needs to request
>for incremental updates with resource-id and version-tag. there are two
>possible extreme solutions:
>(1) the laziest: The server accepts the request that have the most recent
>version-tag; if the version-tag is not the most update version, the server
>simply rejects this request.
>(2) the most costly: The server remembers all history of all resources,
>when the client requests with a resource-id and vtag, the server accepts
>the connection, and immediately send out patches to "catch the client up."
>
>
>*Example:*
>Notate version tags as vi, e.g. v0, v1, v2, etc. And the patches that
>updates vi to vj as patch(vi->vj) where vi is the old tag and vj is the
>new
>tag.
>
>Say the current network map is v3. Client 1 requests incr updates with
>{"resource-id":"my-networkmap", "tag":"v0"} and Client 2 requests incr
>updates with {"resource-id":"my-networkmap", "tag":"v3"}. The lazy server
>would reject the request from client 1 and accepts that from client 2. The
>costly server would accept both request and send patch(v0->v3)
>
>
>Another possible solution is a hybrid of the two extremes. The server
>keeps
>a patch that can update the resource from vi to vj, and accepts requests
>that has vtag vk such that i<=3Dk<=3Dj.
>
>Because of the JSON merge-patch replacement property, applying
>patch(*vi*->vj)
>would update vk to vj. No matter what vtag vk the request comes in with,
>the server accepts if i<=3Dk<=3Dj, and immediately sends patch(vi->vj) via the
>stream. This will update the client's resource to the most updated
>version.
>The subsequent updates will be pushed as they become available.The window
>of [i, j] can be determined by the server, according to time or storage
>constraints.
>
>You comments would be much appreciated. Thank you!
>
>Best,
>Xiao



From nobody Sun Oct 26 21:19:12 2014
Return-Path: <denglingli@chinamobile.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5F5A51A1BBE for <alto@ietfa.amsl.com>; Sun, 26 Oct 2014 21:19:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.611
X-Spam-Level: 
X-Spam-Status: No, score=0.611 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, MIME_8BIT_HEADER=0.3, RELAY_IS_221=2.222, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 hz-dNkead9XT for <alto@ietfa.amsl.com>; Sun, 26 Oct 2014 21:19:06 -0700 (PDT)
Received: from cmccmta3.chinamobile.com (cmccmta3.chinamobile.com [221.176.66.81]) by ietfa.amsl.com (Postfix) with SMTP id D93DB1A1BB8 for <alto@ietf.org>; Sun, 26 Oct 2014 21:19:05 -0700 (PDT)
Received: from spf.mail.chinamobile.com (unknown[172.16.121.3]) by rmmx-syy-dmz-app11-12011 (RichMail) with SMTP id 2eeb544dc7b70d6-c5466; Mon, 27 Oct 2014 12:19:04 +0800 (CST)
X-RM-TRANSID: 2eeb544dc7b70d6-c5466
X-RM-SPAM-FLAG: 00000000
Received: from cmccPC (unknown[10.2.43.66]) by rmsmtp-syy-appsvr02-12002 (RichMail) with SMTP id 2ee2544dc7b5ab6-a8b38; Mon, 27 Oct 2014 12:19:04 +0800 (CST)
X-RM-TRANSID: 2ee2544dc7b5ab6-a8b38
From: =?utf-8?B?6YKT54G16I6JL0xpbmdsaSBEZW5n?= <denglingli@chinamobile.com>
To: "'IETF ALTO'" <alto@ietf.org>
Date: Mon, 27 Oct 2014 12:19:10 +0800
Message-ID: <01a801cff19d$28826f30$79874d90$@com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: Ac/xmzGEoBWaFzTJTxOkEODQZyOLXAAAUu2Q
Content-Language: zh-cn
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/4EkzBAmOvM0UjdkkOlNO5VArPNk
Subject: [alto] FW: New Version Notification for draft-deng-alto-p2p-ext-04.txt
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Oct 2014 04:19:08 -0000

Hi all,

We just uploaded a new revision of the draft on extended endpoint =
properties for ALTO.
Your review and comments are welcome.

Lingli

> -----Original Message-----
> From: internet-drafts@ietf.org [mailto:internet-drafts@ietf.org]
> Sent: Monday, October 27, 2014 12:05 PM
> To: Haibin Song; Qin Wu; Wenson Wu; Richard Yang; Haibin Song; Deng =
Lingli;
> Sebastian Kiesel; Yang Yang; Lingli Deng; Sebastian Kiesel
> Subject: New Version Notification for draft-deng-alto-p2p-ext-04.txt
>=20
>=20
> A new version of I-D, draft-deng-alto-p2p-ext-04.txt
> has been successfully submitted by Lingli Deng and posted to the
> IETF repository.
>=20
> Name:		draft-deng-alto-p2p-ext
> Revision:	04
> Title:		Extended Endpoint Properties for Application Layer Traffic
> Optimization
> Document date:	2014-10-26
> Group:		Individual Submission
> Pages:		16
> URL:
> http://www.ietf.org/internet-drafts/draft-deng-alto-p2p-ext-04.txt
> Status:         =
https://datatracker.ietf.org/doc/draft-deng-alto-p2p-ext/
> Htmlized:       http://tools.ietf.org/html/draft-deng-alto-p2p-ext-04
> Diff:           =
http://www.ietf.org/rfcdiff?url2=3Ddraft-deng-alto-p2p-ext-04
>=20
> Abstract:
>    The purpose of the ALTO protocol is to provide better-than-random
>    peer selection for P2P networks. The base ALTO protocol focuses,
>    however, only on providing network topological location information
>    (i.e., network maps and cost maps). However, the peer selection
>    method of an endpoint may also use other properties such as
>    geographic location. This document defines a framework and an
>    extended set of endpoint properties to extend the base ALTO =
protocol.
>=20
>=20
>=20
>=20
> Please note that it may take a couple of minutes from the time of =
submission
> until the htmlized version and diff are available at tools.ietf.org.
>=20
> The IETF Secretariat





From nobody Mon Oct 27 11:47:13 2014
Return-Path: <w.roome@alcatel-lucent.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 20DD01A0058 for <alto@ietfa.amsl.com>; Mon, 27 Oct 2014 11:46:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.91
X-Spam-Level: 
X-Spam-Status: No, score=-6.91 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
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 ZLp5GG1UiC7U for <alto@ietfa.amsl.com>; Mon, 27 Oct 2014 11:46:50 -0700 (PDT)
Received: from smtp-us.alcatel-lucent.com (us-hpswa-esg-02.alcatel-lucent.com [135.245.18.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 56CF11A906C for <alto@ietf.org>; Mon, 27 Oct 2014 11:44:41 -0700 (PDT)
Received: from us70tusmtp2.zam.alcatel-lucent.com (unknown [135.5.2.64]) by Websense Email Security Gateway with ESMTPS id BF4DA49A80799 for <alto@ietf.org>; Mon, 27 Oct 2014 18:44:36 +0000 (GMT)
Received: from usnavsmail2.ndc.alcatel-lucent.com (usnavsmail2.ndc.alcatel-lucent.com [135.3.39.10]) by us70tusmtp2.zam.alcatel-lucent.com (GMO) with ESMTP id s9RIidHD014750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for <alto@ietf.org>; Mon, 27 Oct 2014 14:44:39 -0400
Received: from umail.lucent.com (umail.ndc.lucent.com [135.3.40.61]) by usnavsmail2.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id s9RIicH6014623 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for <alto@ietf.org>; Mon, 27 Oct 2014 13:44:38 -0500
Received: from [135.222.152.71] (wdr-i7mbp2.mh.lucent.com [135.222.152.71]) by umail.lucent.com (8.13.8/TPES) with ESMTP id s9RIiZ3k027087 for <alto@ietf.org>; Mon, 27 Oct 2014 13:44:37 -0500 (CDT)
User-Agent: Microsoft-MacOutlook/14.4.5.141003
Date: Mon, 27 Oct 2014 14:44:51 -0400
From: Wendy Roome <w.roome@alcatel-lucent.com>
To: IETF ALTO <alto@ietf.org>
Message-ID: <D0740AE3.19D302%w.roome@alcatel-lucent.com>
Thread-Topic: Revised Incremental Update draft
Mime-version: 1.0
Content-type: text/plain; charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable
X-Scanned-By: MIMEDefang 2.64 on 135.3.39.10
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/m8OjAgCjrlJNlEYiGipp_UK7NAI
Subject: [alto] Revised Incremental Update draft
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Oct 2014 18:46:54 -0000

Richard Yang, Xiao Shi & I submitted a new proposal for incremental
updates to ALTO resources. See
http://datatracker.ietf.org/doc/draft-roome-alto-incr-update-sse/

This version uses Server-Sent Events (SSE) and JSON Merge Patch, and is a
substantial change from my previous proposal.

We would like to present this version at IETF =B991. I expect there will be
a lot of discussion, so we might need 25 minutes or more.

	- Wendy Roome



From nobody Tue Oct 28 06:43:48 2014
Return-Path: <vkg@bell-labs.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 09CE31A88DF for <alto@ietfa.amsl.com>; Tue, 28 Oct 2014 06:43:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.198
X-Spam-Level: 
X-Spam-Status: No, score=-4.198 tagged_above=-999 required=5 tests=[BAYES_50=0.8, RCVD_IN_DNSWL_HI=-5, URIBL_DBL_ABUSE_REDIR=0.001, URIBL_DBL_REDIR=0.001] autolearn=ham
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 T-JqFAGxAlFM for <alto@ietfa.amsl.com>; Tue, 28 Oct 2014 06:43:39 -0700 (PDT)
Received: from smtp-us.alcatel-lucent.com (us-hpatc-esg-02.alcatel-lucent.com [135.245.18.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 49A861A88E0 for <alto@ietf.org>; Tue, 28 Oct 2014 06:43:38 -0700 (PDT)
Received: from us70uusmtp4.zam.alcatel-lucent.com (unknown [135.5.2.66]) by Websense Email Security Gateway with ESMTPS id 303F58B28199D for <alto@ietf.org>; Tue, 28 Oct 2014 13:43:35 +0000 (GMT)
Received: from usnavsmail4.ndc.alcatel-lucent.com (usnavsmail4.ndc.alcatel-lucent.com [135.3.39.12]) by us70uusmtp4.zam.alcatel-lucent.com (GMO) with ESMTP id s9SDhakD014355 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for <alto@ietf.org>; Tue, 28 Oct 2014 09:43:37 -0400
Received: from umail.lucent.com (umail.ndc.lucent.com [135.3.40.61]) by usnavsmail4.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id s9SDhahn025493 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for <alto@ietf.org>; Tue, 28 Oct 2014 08:43:36 -0500
Received: from shoonya.ih.lucent.com (shoonya.ih.lucent.com [135.185.238.169]) by umail.lucent.com (8.13.8/TPES) with ESMTP id s9SDhZ9Z028210 for <alto@ietf.org>; Tue, 28 Oct 2014 08:43:36 -0500 (CDT)
Message-ID: <544F9E7C.6010505@bell-labs.com>
Date: Tue, 28 Oct 2014 08:47:40 -0500
From: "Vijay K. Gurbani" <vkg@bell-labs.com>
Organization: Bell Laboratories, Alcatel-Lucent
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
MIME-Version: 1.0
To: alto <alto@ietf.org>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.64 on 135.3.39.12
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/-cplEh8oCRNFXWAFoxESSw7Jp7s
Subject: [alto] Draft agenda posted
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Oct 2014 13:43:47 -0000

Folks: A draft agenda for ALTO meeting in HI has been posted.

Please see https://datatracker.ietf.org/meeting/91/agenda/alto/

Let the chairs know of any changes.

Meeting materials (slides) are due on November 9, 2014.  Please
convert your slides to PDF and email them to the chairs.

Thanks,

- vijay
-- 
Vijay K. Gurbani, Bell Laboratories, Alcatel-Lucent
1960 Lucent Lane, Rm. 9C-533, Naperville, Illinois 60563 (USA)
Email: vkg@{bell-labs.com,acm.org} / vijay.gurbani@alcatel-lucent.com
Web: http://ect.bell-labs.com/who/vkg/  | Calendar: http://goo.gl/x3Ogq


From nobody Tue Oct 28 09:07:46 2014
Return-Path: <yang.r.yang@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DFFC01A0010 for <alto@ietfa.amsl.com>; Mon, 27 Oct 2014 09:32:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level: 
X-Spam-Status: No, score=-1.999 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, SPF_PASS=-0.001] autolearn=ham
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 q4ErjkuHwlQN for <alto@ietfa.amsl.com>; Mon, 27 Oct 2014 09:32:10 -0700 (PDT)
Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com [IPv6:2607:f8b0:4001:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id BAC0D1A0079 for <alto@ietf.org>; Mon, 27 Oct 2014 09:32:10 -0700 (PDT)
Received: by mail-ie0-f177.google.com with SMTP id tp5so4680202ieb.22 for <alto@ietf.org>; Mon, 27 Oct 2014 09:32:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=rKAWJ7++VJxug2AYvuW3NPTXMKql6xFaCWotxyTJB8w=; b=lGaDOFcifxXZW61GEeKhA3pSoOz0p3LXMZWa9JAZKoYaPEGQDh7JGCmI584HrwcOq0 A3NxBCSNiHnviGq5P3hmsOMkOrH2EGBxM4tk85+cQRCYTCBAM7MvwnCNFsBRIHYclITA wvXfRY+zO0iNHZPZm7CxfakidBOhkc3ylc8CxxSDQKlJUdUbAAFT0VTBgb0+D9Dtlf+n Rjo9/I54ZRFeqSP+ARuCJZQFDJRnzqzopm15cgc9fvQCFBC/Z16OEQvwIy1nbuKK/hdT keqEzgoagd1k6sqL5EckCo8RLkuvgsG1JnGCkCCVDSVQwWI6SfKbB0ducOV3ScEVg1XV 0Yqg==
MIME-Version: 1.0
X-Received: by 10.42.212.7 with SMTP id gq7mr15768394icb.32.1414427530195; Mon, 27 Oct 2014 09:32:10 -0700 (PDT)
Received: by 10.107.137.159 with HTTP; Mon, 27 Oct 2014 09:32:10 -0700 (PDT)
In-Reply-To: <20141027161129.30839.10383.idtracker@ietfa.amsl.com>
References: <20141027161129.30839.10383.idtracker@ietfa.amsl.com>
Date: Mon, 27 Oct 2014 12:32:10 -0400
Message-ID: <CANUuoLpFWbadBkrfAk3iyA08Y=Z2BTOJVCgXU-eA7YhyTTsncQ@mail.gmail.com>
From: "Y. Richard Yang" <yang.r.yang@gmail.com>
To: IETF ALTO <alto@ietf.org>
Content-Type: multipart/alternative; boundary=20cf301d44ba7f9bff05066a12fb
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/h_-0uHeLdkc4EMYkm40BAhJqTxM
X-Mailman-Approved-At: Tue, 28 Oct 2014 09:07:34 -0700
Subject: [alto] Fwd: New Version Notification for draft-shi-alto-yang-model-00.txt
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Oct 2014 16:32:14 -0000

--20cf301d44ba7f9bff05066a12fb
Content-Type: text/plain; charset=UTF-8

Hi all,

In a setting of providing ALTO into ODL, we started to specify ALTO
services defined in RFC7285 using YANG. It turns to be a quite interesting
experience. Below is an draft specifying our approaches and first two
models. The third model, in the context of considering NETCONF/RESTCONF, is
slightly more complex and we will post in a next revision.

Any comments are appreciated!

Richard


---------- Forwarded message ----------
From: <internet-drafts@ietf.org>
Date: Mon, Oct 27, 2014 at 12:11 PM
Subject: New Version Notification for draft-shi-alto-yang-model-00.txt
To: Michael Scharf <michael.scharf@alcatel-lucent.com>, "Y. Richard Yang" <
yang.r.yang@gmail.com>, Xiao Shi <xiao.shi@yale.edu>



A new version of I-D, draft-shi-alto-yang-model-00.txt
has been successfully submitted by Xiao Shi and posted to the
IETF repository.

Name:           draft-shi-alto-yang-model
Revision:       00
Title:          A YANG Data Model for Base ALTO Data and Services
Document date:  2014-10-27
Group:          Individual Submission
Pages:          66
URL:
http://www.ietf.org/internet-drafts/draft-shi-alto-yang-model-00.txt
Status:         https://datatracker.ietf.org/doc/draft-shi-alto-yang-model/
Htmlized:       http://tools.ietf.org/html/draft-shi-alto-yang-model-00


Abstract:
   The Application-Layer Traffic Optimization (ALTO) protocol [RFC7285]
   defines a set of network information services, including the network-
   map service, the cost-map service, the filtered map services, the
   endpoint property service, and the endpoint cost service.  A meta
   service, called the information resource directory (IRD) service,
   allows an ALTO server to provide ALTO clients with meta information
   (e.g., the access URI) about each resource and service it provides.
   [RFC7285] uses a RESTful design and encodes client request parameters
   and server responses using JSON.  One may consider that most of these
   services are based on data maintained at an ALTO server.  Hence, in
   this document, we explore how one may use the data modeling language
   YANG [RFC6020] to specify the services defined in [RFC7285].  We
   first define two YANG models for RPC specification and data instance
   description of of ALTO services.  We then discuss the "standard
   operations" defined in NETCONF/RESTCONF to evaluate potential
   integration.




Please note that it may take a couple of minutes from the time of submission
until the htmlized version and diff are available at tools.ietf.org.

The IETF Secretariat




-- 
Richard

--20cf301d44ba7f9bff05066a12fb
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi all,<div><br></div><div>In a setting of providing ALTO =
into ODL, we started to specify ALTO services defined in RFC7285 using YANG=
. It turns to be a quite interesting experience. Below is an draft specifyi=
ng our approaches and first two models. The third model, in the context of =
considering NETCONF/RESTCONF, is slightly more complex and we will post in =
a next revision.</div><div><br></div><div>Any comments are appreciated!</di=
v><div><br></div><div>Richard</div><div><br></div><div><br><div class=3D"gm=
ail_quote">---------- Forwarded message ----------<br>From: <b class=3D"gma=
il_sendername"></b> <span dir=3D"ltr">&lt;<a href=3D"mailto:internet-drafts=
@ietf.org">internet-drafts@ietf.org</a>&gt;</span><br>Date: Mon, Oct 27, 20=
14 at 12:11 PM<br>Subject: New Version Notification for draft-shi-alto-yang=
-model-00.txt<br>To: Michael Scharf &lt;<a href=3D"mailto:michael.scharf@al=
catel-lucent.com">michael.scharf@alcatel-lucent.com</a>&gt;, &quot;Y. Richa=
rd Yang&quot; &lt;<a href=3D"mailto:yang.r.yang@gmail.com">yang.r.yang@gmai=
l.com</a>&gt;, Xiao Shi &lt;<a href=3D"mailto:xiao.shi@yale.edu">xiao.shi@y=
ale.edu</a>&gt;<br><br><br><br>
A new version of I-D, draft-shi-alto-yang-model-00.txt<br>
has been successfully submitted by Xiao Shi and posted to the<br>
IETF repository.<br>
<br>
Name:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0draft-shi-alto-yang-model<br>
Revision:=C2=A0 =C2=A0 =C2=A0 =C2=A000<br>
Title:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 A YANG Data Model for Base ALTO Da=
ta and Services<br>
Document date:=C2=A0 2014-10-27<br>
Group:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Individual Submission<br>
Pages:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 66<br>
URL:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <a href=3D"http://www.ietf.or=
g/internet-drafts/draft-shi-alto-yang-model-00.txt" target=3D"_blank">http:=
//www.ietf.org/internet-drafts/draft-shi-alto-yang-model-00.txt</a><br>
Status:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"https://datatracker.iet=
f.org/doc/draft-shi-alto-yang-model/" target=3D"_blank">https://datatracker=
.ietf.org/doc/draft-shi-alto-yang-model/</a><br>
Htmlized:=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"http://tools.ietf.org/html/d=
raft-shi-alto-yang-model-00" target=3D"_blank">http://tools.ietf.org/html/d=
raft-shi-alto-yang-model-00</a><br>
<br>
<br>
Abstract:<br>
=C2=A0 =C2=A0The Application-Layer Traffic Optimization (ALTO) protocol [RF=
C7285]<br>
=C2=A0 =C2=A0defines a set of network information services, including the n=
etwork-<br>
=C2=A0 =C2=A0map service, the cost-map service, the filtered map services, =
the<br>
=C2=A0 =C2=A0endpoint property service, and the endpoint cost service.=C2=
=A0 A meta<br>
=C2=A0 =C2=A0service, called the information resource directory (IRD) servi=
ce,<br>
=C2=A0 =C2=A0allows an ALTO server to provide ALTO clients with meta inform=
ation<br>
=C2=A0 =C2=A0(e.g., the access URI) about each resource and service it prov=
ides.<br>
=C2=A0 =C2=A0[RFC7285] uses a RESTful design and encodes client request par=
ameters<br>
=C2=A0 =C2=A0and server responses using JSON.=C2=A0 One may consider that m=
ost of these<br>
=C2=A0 =C2=A0services are based on data maintained at an ALTO server.=C2=A0=
 Hence, in<br>
=C2=A0 =C2=A0this document, we explore how one may use the data modeling la=
nguage<br>
=C2=A0 =C2=A0YANG [RFC6020] to specify the services defined in [RFC7285].=
=C2=A0 We<br>
=C2=A0 =C2=A0first define two YANG models for RPC specification and data in=
stance<br>
=C2=A0 =C2=A0description of of ALTO services.=C2=A0 We then discuss the &qu=
ot;standard<br>
=C2=A0 =C2=A0operations&quot; defined in NETCONF/RESTCONF to evaluate poten=
tial<br>
=C2=A0 =C2=A0integration.<br>
<br>
<br>
<br>
<br>
Please note that it may take a couple of minutes from the time of submissio=
n<br>
until the htmlized version and diff are available at <a href=3D"http://tool=
s.ietf.org" target=3D"_blank">tools.ietf.org</a>.<br>
<br>
The IETF Secretariat<br>
<br>
</div><br><br clear=3D"all"><div><br></div>-- <br>Richard
</div></div>

--20cf301d44ba7f9bff05066a12fb--


From nobody Tue Oct 28 09:08:03 2014
Return-Path: <yang.r.yang@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7D10A1A19F6 for <alto@ietfa.amsl.com>; Mon, 27 Oct 2014 09:38:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level: 
X-Spam-Status: No, score=-1.999 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, SPF_PASS=-0.001] autolearn=ham
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 n2P-78Mm8d9G for <alto@ietfa.amsl.com>; Mon, 27 Oct 2014 09:38:48 -0700 (PDT)
Received: from mail-ie0-x236.google.com (mail-ie0-x236.google.com [IPv6:2607:f8b0:4001:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 62E6C1A19EC for <alto@ietf.org>; Mon, 27 Oct 2014 09:38:31 -0700 (PDT)
Received: by mail-ie0-f182.google.com with SMTP id rd18so4200642iec.27 for <alto@ietf.org>; Mon, 27 Oct 2014 09:38:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=aEZX8rn/LaS1FqBRfC4rGyl8eWsOnd0AEkhZNhrOzg0=; b=BNnDMZbnPcl0ry4HtvyolXbGo1lVKk8XCGiWe731KwjZNoJi+w3aaUD53q2mg6V3I3 cqCuXfa7pKQn+oYiqnkwaU532A+3QmSNmaGa2fTFnUTGTgc2qZTQnSHy4Ke5piaO4jQT DH90dnDMXOEA5ZTcXSKYyNVF6DlbMth5WxEPYwnsNEdqsR/SiQHNrP25JiOaK0Ne7J+h qZTvB82gJkja1mBGXqskeHIy0KXUg4BMoTkwxxMh7TXPS8FW9WIjnRG1AS7YIiY+0ZPr lXMaveXaBYjzvIfu0+4DtNpsl5BE9ol5r8bXbqxgHjOQddI5pHY/z7bSPc03wFSLX2yx XZ0w==
MIME-Version: 1.0
X-Received: by 10.42.170.201 with SMTP id g9mr3157473icz.76.1414427910777; Mon, 27 Oct 2014 09:38:30 -0700 (PDT)
Received: by 10.107.137.159 with HTTP; Mon, 27 Oct 2014 09:38:30 -0700 (PDT)
In-Reply-To: <20141027153150.30084.43281.idtracker@ietfa.amsl.com>
References: <20141027153150.30084.43281.idtracker@ietfa.amsl.com>
Date: Mon, 27 Oct 2014 12:38:30 -0400
Message-ID: <CANUuoLqxvt7VqxwnLFnmX_id9Rd_6n-2fAZEZMeujuehfJFGig@mail.gmail.com>
From: "Y. Richard Yang" <yang.r.yang@gmail.com>
To: IETF ALTO <alto@ietf.org>
Content-Type: multipart/alternative; boundary=90e6ba6e8dc62ed78605066a290c
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/SDkRiCcmZCeL9LgzpUEYt3lToxA
X-Mailman-Approved-At: Tue, 28 Oct 2014 09:07:38 -0700
Subject: [alto] Fwd: New Version Notification for draft-shi-alto-yang-json-00.txt
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Oct 2014 16:38:55 -0000

--90e6ba6e8dc62ed78605066a290c
Content-Type: text/plain; charset=UTF-8

Hi all,

Related with the previous email. This document looks at not only ALTO but
other protocols that use JSON objects in message body. We look at if one
may use YANG to specify it (note, only the message body). It turns out ALTO
JSON objects cannot be generated from a YANG specification. The main issue,
as already discussed in some previous email messages appeared in both
ALTO/netmod, is key-value store.

Any comments are appreciated, again!

Richard

---------- Forwarded message ----------
From: <internet-drafts@ietf.org>
Date: Mon, Oct 27, 2014 at 11:31 AM
Subject: New Version Notification for draft-shi-alto-yang-json-00.txt
To: "Y. Richard Yang" <yang.r.yang@gmail.com>, Xiao Shi <xiao.shi@yale.edu>



A new version of I-D, draft-shi-alto-yang-json-00.txt
has been successfully submitted by Xiao Shi and posted to the
IETF repository.

Name:           draft-shi-alto-yang-json
Revision:       00
Title:          Modeling JSON Messages Using YANG
Document date:  2014-10-27
Group:          Individual Submission
Pages:          23
URL:
http://www.ietf.org/internet-drafts/draft-shi-alto-yang-json-00.txt
Status:         https://datatracker.ietf.org/doc/draft-shi-alto-yang-json/
Htmlized:       http://tools.ietf.org/html/draft-shi-alto-yang-json-00


Abstract:
   JavaScript Object Notation (JSON) has been a popular choice as the
   message encoding for many network protocols.  Meanwhile, there are
   broad interests in the networking community to use the YANG data
   modeling language [RFC6020] to define data store and protocol
   messages, so that one can use YANG related tools such as the
   OpenDayLight Controller.  Although YANG itself is XML based, there
   have been efforts to model JSON content using YANG
   [draft-ietf-netmod-yang-json-01]

   This document explores the conditions under which the messages of a
   JSON based protocol can have a syntactically equivalent and hence
   interoperable YANG model.  In particular, this document shows that
   any JSON protocol message with stand-alone non-object JSON values,
   certain JSON arrays of elements of mixed types, or non-keyword keys
   in key-value pairs cannot have a syntactically equivalent YANG model.
   It also applies these conditions to the ALTO and CDNi protocol
   messages as examples.




Please note that it may take a couple of minutes from the time of submission
until the htmlized version and diff are available at tools.ietf.org.

The IETF Secretariat




-- 
Richard

--90e6ba6e8dc62ed78605066a290c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><span style=3D"font-family:arial,sans-serif;font-size:12.8=
000001907349px">Hi all,</span><div style=3D"font-family:arial,sans-serif;fo=
nt-size:12.8000001907349px"><br></div><div style=3D"font-family:arial,sans-=
serif;font-size:12.8000001907349px">Related with the previous email. This d=
ocument looks at not only ALTO but other protocols that use JSON objects in=
 message body. We look at if one may use YANG to specify it (note, only the=
 message body). It turns out ALTO JSON objects cannot be generated from a Y=
ANG specification. The main issue, as already discussed in some previous em=
ail messages appeared in both ALTO/netmod, is key-value store.=C2=A0</div><=
div style=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><br=
></div><div style=3D"font-family:arial,sans-serif;font-size:12.800000190734=
9px">Any comments are appreciated, again!</div><div style=3D"font-family:ar=
ial,sans-serif;font-size:12.8000001907349px"><br></div><div style=3D"font-f=
amily:arial,sans-serif;font-size:12.8000001907349px">Richard</div><div styl=
e=3D"font-family:arial,sans-serif;font-size:12.8000001907349px"><br></div><=
div class=3D"gmail_quote">---------- Forwarded message ----------<br>From: =
<b class=3D"gmail_sendername"></b> <span dir=3D"ltr">&lt;<a href=3D"mailto:=
internet-drafts@ietf.org">internet-drafts@ietf.org</a>&gt;</span><br>Date: =
Mon, Oct 27, 2014 at 11:31 AM<br>Subject: New Version Notification for draf=
t-shi-alto-yang-json-00.txt<br>To: &quot;Y. Richard Yang&quot; &lt;<a href=
=3D"mailto:yang.r.yang@gmail.com">yang.r.yang@gmail.com</a>&gt;, Xiao Shi &=
lt;<a href=3D"mailto:xiao.shi@yale.edu">xiao.shi@yale.edu</a>&gt;<br><br><b=
r><br>
A new version of I-D, draft-shi-alto-yang-json-00.txt<br>
has been successfully submitted by Xiao Shi and posted to the<br>
IETF repository.<br>
<br>
Name:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0draft-shi-alto-yang-json<br>
Revision:=C2=A0 =C2=A0 =C2=A0 =C2=A000<br>
Title:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Modeling JSON Messages Using YANG<=
br>
Document date:=C2=A0 2014-10-27<br>
Group:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Individual Submission<br>
Pages:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 23<br>
URL:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <a href=3D"http://www.ietf.or=
g/internet-drafts/draft-shi-alto-yang-json-00.txt" target=3D"_blank">http:/=
/www.ietf.org/internet-drafts/draft-shi-alto-yang-json-00.txt</a><br>
Status:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"https://datatracker.iet=
f.org/doc/draft-shi-alto-yang-json/" target=3D"_blank">https://datatracker.=
ietf.org/doc/draft-shi-alto-yang-json/</a><br>
Htmlized:=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"http://tools.ietf.org/html/d=
raft-shi-alto-yang-json-00" target=3D"_blank">http://tools.ietf.org/html/dr=
aft-shi-alto-yang-json-00</a><br>
<br>
<br>
Abstract:<br>
=C2=A0 =C2=A0JavaScript Object Notation (JSON) has been a popular choice as=
 the<br>
=C2=A0 =C2=A0message encoding for many network protocols.=C2=A0 Meanwhile, =
there are<br>
=C2=A0 =C2=A0broad interests in the networking community to use the YANG da=
ta<br>
=C2=A0 =C2=A0modeling language [RFC6020] to define data store and protocol<=
br>
=C2=A0 =C2=A0messages, so that one can use YANG related tools such as the<b=
r>
=C2=A0 =C2=A0OpenDayLight Controller.=C2=A0 Although YANG itself is XML bas=
ed, there<br>
=C2=A0 =C2=A0have been efforts to model JSON content using YANG<br>
=C2=A0 =C2=A0[draft-ietf-netmod-yang-json-01]<br>
<br>
=C2=A0 =C2=A0This document explores the conditions under which the messages=
 of a<br>
=C2=A0 =C2=A0JSON based protocol can have a syntactically equivalent and he=
nce<br>
=C2=A0 =C2=A0interoperable YANG model.=C2=A0 In particular, this document s=
hows that<br>
=C2=A0 =C2=A0any JSON protocol message with stand-alone non-object JSON val=
ues,<br>
=C2=A0 =C2=A0certain JSON arrays of elements of mixed types, or non-keyword=
 keys<br>
=C2=A0 =C2=A0in key-value pairs cannot have a syntactically equivalent YANG=
 model.<br>
=C2=A0 =C2=A0It also applies these conditions to the ALTO and CDNi protocol=
<br>
=C2=A0 =C2=A0messages as examples.<br>
<br>
<br>
<br>
<br>
Please note that it may take a couple of minutes from the time of submissio=
n<br>
until the htmlized version and diff are available at <a href=3D"http://tool=
s.ietf.org" target=3D"_blank">tools.ietf.org</a>.<br>
<br>
The IETF Secretariat<br>
<br>
</div><br><br clear=3D"all"><div><br></div>-- <br>Richard
</div>

--90e6ba6e8dc62ed78605066a290c--


From nobody Tue Oct 28 10:03:57 2014
Return-Path: <sabine.randriamasy@alcatel-lucent.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6462E1A0144 for <alto@ietfa.amsl.com>; Tue, 28 Oct 2014 10:03:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.909
X-Spam-Level: 
X-Spam-Status: No, score=-6.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
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 xPdmRrvEO4s2 for <alto@ietfa.amsl.com>; Tue, 28 Oct 2014 10:03:50 -0700 (PDT)
Received: from smtp-fr.alcatel-lucent.com (fr-hpgre-esg-01.alcatel-lucent.com [135.245.210.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B49521A1B6D for <alto@ietf.org>; Tue, 28 Oct 2014 10:03:50 -0700 (PDT)
Received: from fr711usmtp1.zeu.alcatel-lucent.com (unknown [135.239.2.122]) by Websense Email Security Gateway with ESMTPS id 79DAFF00A7533 for <alto@ietf.org>; Tue, 28 Oct 2014 17:03:45 +0000 (GMT)
Received: from FR712WXCHHUB03.zeu.alcatel-lucent.com (fr712wxchhub03.zeu.alcatel-lucent.com [135.239.2.74]) by fr711usmtp1.zeu.alcatel-lucent.com (GMO) with ESMTP id s9SH3fTw025904 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for <alto@ietf.org>; Tue, 28 Oct 2014 18:03:48 +0100
Received: from FR711WXCHMBA01.zeu.alcatel-lucent.com ([169.254.1.91]) by FR712WXCHHUB03.zeu.alcatel-lucent.com ([135.239.2.74]) with mapi id 14.03.0195.001; Tue, 28 Oct 2014 18:03:41 +0100
From: "RANDRIAMASY, SABINE (SABINE)" <sabine.randriamasy@alcatel-lucent.com>
To: IETF ALTO <alto@ietf.org>
Thread-Topic: Updates on Multi-Cost ALTO 
Thread-Index: Ac/y0R8KfKQrgIrUSXaPFzONrQfvFQ==
Date: Tue, 28 Oct 2014 17:03:41 +0000
Message-ID: <A7A5844EB93EB94AB22C2068B10AD65A6ADDEE5A@FR711WXCHMBA01.zeu.alcatel-lucent.com>
Accept-Language: fr-FR, en-US
Content-Language: fr-FR
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [135.239.27.41]
Content-Type: multipart/alternative; boundary="_000_A7A5844EB93EB94AB22C2068B10AD65A6ADDEE5AFR711WXCHMBA01z_"
MIME-Version: 1.0
Archived-At: http://mailarchive.ietf.org/arch/msg/alto/t4snM4j7FPbt4YcTst4vYAsQ26Y
Subject: [alto] Updates on Multi-Cost ALTO
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list" <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>, <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>, <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Oct 2014 17:03:54 -0000

--_000_A7A5844EB93EB94AB22C2068B10AD65A6ADDEE5AFR711WXCHMBA01z_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi all,

A new version of the Multi-Cost ALTO draft by Wendy Roome and myself  is av=
ailable at
http://tools.ietf.org/id/draft-randriamasy-alto-multi-cost-09.txt
The revision relates to discussions in Toronto and before on the possibilit=
y to request Cost Values on a set C1 of Cost Types with  AND/OR constraints=
 on a different set C2 of cost types.
The draft  proposes a light way to do it:
-it introduces a member "testable cost-types" in the IRD capabilities of th=
e Filtered Multi-Cost Map and Endpoint Multi-Cost Map
- it adapts the constraints syntax rules accordingly.
The draft provides related transaction examples and refers to previous work=
 that dealt with requests on cost-types with AND-constraints on different c=
ost-types, see draft-lee-alto-app-net-info-exchange<http://tools.ietf.org/h=
tml/draft-lee-alto-app-net-info-exchange>.

Feedback on this proposal is more than welcome,
Thanks,

Sabine and Wendy



--_000_A7A5844EB93EB94AB22C2068B10AD65A6ADDEE5AFR711WXCHMBA01z_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">Hi all,<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">A new version of the Multi-Cost ALTO draft by Wendy =
Roome and myself &nbsp;is available at
<o:p></o:p></p>
<p class=3D"MsoNormal"><a href=3D"http://tools.ietf.org/id/draft-randriamas=
y-alto-multi-cost-09.txt">http://tools.ietf.org/id/draft-randriamasy-alto-m=
ulti-cost-09.txt</a>
<o:p></o:p></p>
<p class=3D"MsoNormal">The revision relates to discussions in Toronto and b=
efore on the possibility to request Cost Values on a set C1 of Cost Types w=
ith &nbsp;AND/OR constraints on a different set C2 of cost types. &nbsp;<o:=
p></o:p></p>
<p class=3D"MsoNormal">The draft &nbsp;proposes a light way to do it: <o:p>=
</o:p></p>
<p class=3D"MsoNormal">-it introduces a member &#8220;testable cost-types&#=
8221; in the IRD capabilities of the Filtered Multi-Cost Map and Endpoint M=
ulti-Cost Map<o:p></o:p></p>
<p class=3D"MsoNormal">- it adapts the constraints syntax rules accordingly=
. <o:p></o:p></p>
<p class=3D"MsoNormal">The draft provides related transaction examples and =
refers to previous work that dealt with requests on cost-types with AND-con=
straints on different cost-types, see
<a href=3D"http://tools.ietf.org/html/draft-lee-alto-app-net-info-exchange"=
>draft-lee-alto-app-net-info-exchange</a>. &nbsp;&nbsp;<o:p></o:p></p>
<table class=3D"MsoNormalTable" border=3D"0" cellpadding=3D"0">
<tbody>
<tr>
<td style=3D"padding:.75pt .75pt .75pt .75pt"></td>
<td style=3D"padding:.75pt .75pt .75pt .75pt"></td>
</tr>
</tbody>
</table>
<p class=3D"MsoNormal">Feedback on this proposal is more than welcome,<o:p>=
</o:p></p>
<p class=3D"MsoNormal">Thanks,<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Sabine and Wendy<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>

--_000_A7A5844EB93EB94AB22C2068B10AD65A6ADDEE5AFR711WXCHMBA01z_--

