Re: [mmox] The Structure and Interpretation of LLSD Messages [Was: Re: unefficient binary serialization ?]

Lisa Dusseault <lisa.dusseault@gmail.com> Wed, 25 February 2009 21:44 UTC

Return-Path: <lisa.dusseault@gmail.com>
X-Original-To: mmox@core3.amsl.com
Delivered-To: mmox@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 129C63A68BC for <mmox@core3.amsl.com>; Wed, 25 Feb 2009 13:44:38 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.456
X-Spam-Level:
X-Spam-Status: No, score=-2.456 tagged_above=-999 required=5 tests=[AWL=0.143, BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JMzJ9Gsc0ZLr for <mmox@core3.amsl.com>; Wed, 25 Feb 2009 13:44:37 -0800 (PST)
Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.230]) by core3.amsl.com (Postfix) with ESMTP id 15F033A67FA for <mmox@ietf.org>; Wed, 25 Feb 2009 13:44:37 -0800 (PST)
Received: by rv-out-0506.google.com with SMTP id l9so185376rvb.49 for <mmox@ietf.org>; Wed, 25 Feb 2009 13:44:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=MMiEE3/JCdr3/VM0EOtzHBvY90+gCrg9Qiz3Ign6sUM=; b=DUSg63MZNqFV1oV1BhVTHLn26hHrwPVtG35TP4I1isprodnWCZoGHG7VEBDGTyJyMb NXdjWKIZUD5Zr/Lt9N4vqlmnCnoiSdGMFzRdieuUqiHi+NYnlmtTOUtS0RUm+QUrYTgg KZ2qYpA0Dw4MVRHND5oWse0I+ZheLftv5hv+g=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=O1fZ/VdkikwcUHZghocMxQ0z28ibMF6KiiiCsDSo9BVvV49+sMuRz9tQpS1KSEKomA 7m4VyKzkG5TqeTylR7VjYKYFO9iXG3+6keoQ6EecCd6wVKrFZ12E8h+GnaZ3NagwdPnw 0To0puB/dIe8V0eGgfKeA8XB1nadZA1Cv133o=
MIME-Version: 1.0
Received: by 10.141.155.15 with SMTP id h15mr230552rvo.158.1235598297778; Wed, 25 Feb 2009 13:44:57 -0800 (PST)
In-Reply-To: <024355C7-0753-451F-9542-4478D27A2802@lindenlab.com>
References: <ebe4d1860902241754s7942179ajd4a29dde4e1d1bdb@mail.gmail.com> <49A4A8FA.607@gmail.com> <024355C7-0753-451F-9542-4478D27A2802@lindenlab.com>
Date: Wed, 25 Feb 2009 13:44:57 -0800
Message-ID: <ca722a9e0902251344g42af15d3q4515b5f6c35cf6fa@mail.gmail.com>
From: Lisa Dusseault <lisa.dusseault@gmail.com>
To: "Meadhbh Hamrick (Infinity)" <infinity@lindenlab.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: mmox@ietf.org, Jon Watte <jwatte@gmail.com>
Subject: Re: [mmox] The Structure and Interpretation of LLSD Messages [Was: Re: unefficient binary serialization ?]
X-BeenThere: mmox@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Massively Multi-participant Online Games and Applications <mmox.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/mmox>, <mailto:mmox-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/mmox>
List-Post: <mailto:mmox@ietf.org>
List-Help: <mailto:mmox-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mmox>, <mailto:mmox-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 25 Feb 2009 21:44:38 -0000

I really think this is a key difference between good design for an
extensible single-party (or at least single-change-owner) protocol,
and good design for an interoperable standard.  The reason is that we
want to shut down extensibility where it would hurt interoperability
and backward-compatibility.  The result of designing like this means
that there are some ways you can't extend the standard; extensions are
more limited in the creative ways they can be applied.

IOW, the tradeoffs for extensibility are different in standards than
for a protocol controlled by one host, e.g. Google PB.

More inline:

On Tue, Feb 24, 2009 at 9:41 PM, Meadhbh Hamrick (Infinity)
<infinity@lindenlab.com> wrote:
>
> ...
>
> now.. imagine we have a PDU with three members while the second version adds a member. for simplicity's sake, let's say they're all integers.
>
> if used the DTD to define the validation for the message, the first version of the message might look like:
>
> <?xml version="1.0"?>
> <!DOCTYPE pdutastic PUBLIC "-//MMOX//Poorly Defined Derivatives ML PDU 1.0//EN" "http://example.com/pdu/1.0/pdutastic.dtd">
> <pdutastic>
>  <foo type="integer">13</foo>
>  <bar type="integer">42</bar>
>  <baz type="integer">93</baz>
> </pdutastic>
>
> while the new version would look like this:
>
> <?xml version="1.0"?>
> <!DOCTYPE pdutastic PUBLIC "-//MMOX//Poorly Defined Derivatives ML PDU 1.1//EN" "http://example.com/pdu/1.1/pdutastic.dtd">
> <pdutastic>
>  <foo type="integer">13</foo>
>  <bar type="integer">42</bar>
>  <baz type="integer">93</baz>
>  <qux type="integer">161</qux>
> </pdutastic>
>
> so when i (expecting the new version) consume the old version, i do not see qux. but my parser doesn't complain because instead of the DTD of the new PDU, i see a reference to the old PDU and say to myself... "it's okay... it's just an older version," and i do whatever i have to do to continue processing in the absence of the qux member i was expecting. even if i'm doing validation, it's okay, i'm pulling the DTD from the old definition, so we're cool.

Excellent example, totally agree.

>
> now... when cathy consumes the new PDU, something similar happens. she see's a DTD she's not familiar with, but it's all good.. she grabs teh DTD from URL specified in teh DOCTYPE and moves on with her life, hoping that new version PDU didn't change the semantics of the three values (foo, bar and baz) she's familiar with.
>
> and then one day she receives this from david:
>
> <?xml version="1.0"?>
> <!DOCTYPE pdutastic PUBLIC "-//MMOX//Poorly Defined Derivatives ML PDU 1.2//EN" "http://example.com/pdu/1.2/pdutastic.dtd">
> <pdutastic>
>  <foo type="integer">13</foo>
>  <bar type="date">2008-12-15T13:17:23.235Z</bar>
>  <baz type="integer">93</baz>
>  <qux type="integer">161</qux>
> </pdutastic>
>
> but this is now a serious problem for cathy. the "shape" of the structured data now does not match. what does she do? how does she convert that date into an integer?

In a *standard*?  Cathy does not.  She flags an error.  The standard
that would have produced the interoperability so far in your example
would have said "bar is an integer".

In fact, if there's agreed interoperability between Cathy, Meadhbh and
David on the foo, bar and baz semantics, then none of them need to be
annotated with their datatypes.



<?xml version="1.0"?>
<!DOCTYPE pdutastic PUBLIC "-//MMOX//Poorly Defined Derivatives ML PDU
1.2//EN" "http://example.com/pdu/1.2/pdutastic.dtd">
<pdutastic>
   <foo>13</foo>
   <bar>2008-12-15T13:17:23.235Z</bar>
   <baz>93</baz>
   <qux type="integer">161</qux>
</pdutastic>

Result?  Cathy returns an error because her XML handling looks like this:

try:
    barval = int(xmldoc.getElementsByTagName('bar').data)
except ValueError:
    return new ErrorResponse(400, "Bad Request")


Whether there is a role for marking some things as "integer" types
right in the protocol, I don't know.  But if there's agreed semantics
for an operation like "I would like to send you a user to rez with the
following avatar information in the following location which may be
valid in your world", then the location semantics are probably solid
enough to do mostly by marking an integer as an integer in the
specification, once and for all, rather than in every request.

Lisa