Re: [YANG] relation to XML PDUs

Andy Bierman <ietf@andybierman.com> Mon, 21 January 2008 18:11 UTC

Return-path: <yang-bounces@ietf.org>
Received: from [127.0.0.1] (helo=stiedprmman1.va.neustar.com) by megatron.ietf.org with esmtp (Exim 4.43) id 1JH17j-00027j-OB; Mon, 21 Jan 2008 13:11:55 -0500
Received: from yang by megatron.ietf.org with local (Exim 4.43) id 1JH17i-00027I-Dn for yang-confirm+ok@megatron.ietf.org; Mon, 21 Jan 2008 13:11:54 -0500
Received: from [10.91.34.44] (helo=ietf-mx.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1JH17i-00026c-1c for yang@ietf.org; Mon, 21 Jan 2008 13:11:54 -0500
Received: from smtp110.sbc.mail.re2.yahoo.com ([68.142.229.95]) by ietf-mx.ietf.org with smtp (Exim 4.43) id 1JH17h-0007PV-N0 for yang@ietf.org; Mon, 21 Jan 2008 13:11:54 -0500
Received: (qmail 34986 invoked from network); 21 Jan 2008 18:11:53 -0000
Received: from unknown (HELO ?192.168.0.10?) (andybierman@att.net@67.126.240.103 with plain) by smtp110.sbc.mail.re2.yahoo.com with SMTP; 21 Jan 2008 18:11:53 -0000
X-YMail-OSG: MHooHBIVM1l1Dd5ZloWAYrHCnno_jOjtQZk3fJzHdy0kx6MnG6TyteyCS8vaCCQRfi30GhmAl69xtN6DQfwjwVjNVPyl5bgJhWllQmc4ZhF3ZWhsIJbu9Q--
X-Yahoo-Newman-Property: ymail-3
Message-ID: <4794E068.6000708@andybierman.com>
Date: Mon, 21 Jan 2008 10:11:52 -0800
From: Andy Bierman <ietf@andybierman.com>
User-Agent: Thunderbird 2.0.0.9 (Windows/20071031)
MIME-Version: 1.0
To: Martin Bjorklund <mbj@tail-f.com>
Subject: Re: [YANG] relation to XML PDUs
References: <1200921746.6914.176.camel@missotis> <20080121.145054.158522565.mbj@tail-f.com> <4794C67F.1000303@andybierman.com> <20080121.184601.38475099.mbj@tail-f.com>
In-Reply-To: <20080121.184601.38475099.mbj@tail-f.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Scan-Signature: 02ec665d00de228c50c93ed6b5e4fc1a
Cc: yang@ietf.org, lhotka@cesnet.cz
X-BeenThere: yang@ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: YANG modeling Language for NETCONF <yang.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www1.ietf.org/pipermail/yang>
List-Post: <mailto:yang@ietf.org>
List-Help: <mailto:yang-request@ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=subscribe>
Errors-To: yang-bounces@ietf.org

Martin Bjorklund wrote:
> Andy Bierman <ietf@andybierman.com> wrote:
>> Martin Bjorklund wrote:
>>> Ladislav Lhotka <lhotka@cesnet.cz> wrote:
>>>> Hi,
>>>>
>>>> I understand that YANG data models describe entire configuration
>>>> datasets, but do they also pose any restrictions to the NETCONF XML
>>>> PDUs? For example: the order of children in a YANG model is fixed - does
>>>> it mean that the corresponding XML elements in PDUs must appear in the
>>>> same order?
>>> Currently we do this, mainly b/c of the requirement to be XSD
>>> compatible, i.e. we want to be able to generate an XSD which can be
>>> used to validate the PDUs.
>>>
>>
>> Really?  Where is that documented?
> 
> In the XML Encoding Rules section of the container statetement (and
> same for list statement).
> 
>> Let's review the NETCONF PDUs so we can stop talking about
>> schema validation in high altitude abstractions.
> 
> [...]
> 
>>   3) XML represents config database fragment
>>      XSD cannot do much with this unless minOccurs=0 is set for
>>      every element and the NETCONF operation attribute is added
>>      everywhere it is allowed.  I have never seen an XSD that
>>      actually does this.  Instead they all model the config-database
>>      representation, not any particular PDU.
> 
> I'm not protesting here.  So if they do model the config-database
> representation, is the order important in this config-database?  Is
> the NETCONF server supposed to keep an XML instance document
> representation of the config database, with all elements in order?
> This sounds like vendor-specific internals...
> 

OK -- IMO it is bad to force data model order in NETCONF PDUs.
SNMP does not do this for varbinds.  It is hard enough on applications
just to get every node right, let alone the order of every node.

This also goes for RPC methods.
Since every RPC method parameter is clearly identified, and an <rpc>
is self-contained, there is no need to force any particular
element order in an <rpc> PDU.

But there is still a canonical order (for diff purposes) that
is defined as document order.

For 'bits' elements, the canonical order of bit names in PDUs
is also defined as document order, with all duplicates removed.

> 
> /martin
> 
> 

Andy


_______________________________________________
YANG mailing list
YANG@ietf.org
https://www1.ietf.org/mailman/listinfo/yang