Re: [YANG] key clause issues

Andy Bierman <ietf@andybierman.com> Tue, 08 January 2008 13:57 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 1JCExF-00022p-Ct; Tue, 08 Jan 2008 08:57:21 -0500
Received: from yang by megatron.ietf.org with local (Exim 4.43) id 1JCExE-00022j-IL for yang-confirm+ok@megatron.ietf.org; Tue, 08 Jan 2008 08:57:20 -0500
Received: from [10.91.34.44] (helo=ietf-mx.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1JCExE-00022b-8f for yang@ietf.org; Tue, 08 Jan 2008 08:57:20 -0500
Received: from smtp101.sbc.mail.mud.yahoo.com ([68.142.198.200]) by ietf-mx.ietf.org with smtp (Exim 4.43) id 1JCExC-0000q7-B0 for yang@ietf.org; Tue, 08 Jan 2008 08:57:20 -0500
Received: (qmail 63273 invoked from network); 8 Jan 2008 13:57:17 -0000
Received: from unknown (HELO ?192.168.0.10?) (andybierman@att.net@68.120.80.25 with plain) by smtp101.sbc.mail.mud.yahoo.com with SMTP; 8 Jan 2008 13:57:16 -0000
X-YMail-OSG: tO7APYgVM1lvFRAJynxZFVMTr8thUeY4YOfMAQx.BnfFdUoB
Message-ID: <4783813D.5030104@andybierman.com>
Date: Tue, 08 Jan 2008 05:57:17 -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] key clause issues
References: <4782C606.5010109@andybierman.com> <20080108.121147.221068658.mbj@tail-f.com>
In-Reply-To: <20080108.121147.221068658.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: 93df555cbdbcdae9621e5b95d44b301e
Cc: yang@ietf.org
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:
> Hi Andy,
> 
> Andy Bierman <ietf@andybierman.com> wrote:
>> Issue 1)
>>
>>    From an interoperability perspective, the key needs to
>>    be defined any time there are multiple named instances
>>    of an element (i.e., every list).
> 
> Exactly what will not be interoperable by not having keys for
> non-config data?
> 

The feature intent needs to be explained in the draft.
If a list has no key defined, then that means that
there is no distinction in the agent between any of
the entries, other than their relative position (foo[1], foo[2], etc.)

If this is true, and the manager knows that, then there is no
problem leaving out the key.  (Other DMLs call this multiple
instances of a container, not a list though).

But if the agent has some way of identifying list entries,
other than their relative position, then a key MUST be specified.
(Is this what the draft intends?)


> (One problem might be how to define access control.  W/o keys you
> might have to fall back to generic XPath, which we want to avoid...)
> 
>>    Config vs. read-only is irrelevant.
>>    Operators and manager applications need to know how list entries
>>    are indexed for interoperability.  SNMP is mostly for monitoring.
>>    I can't imagine how operators and DM readers would be able to talk about
>>    tables and rows if all the INDEX clauses were removed from read-only tables.
> 
> In SNMP, the INDEX is needed by the protocol.  Not so in NETCONF for
> non-config data.

Not true at all.  If the agent is using named entries
instead of position-identified entries, the manager needs to know.

Consider any XML table like the ifTable counters.
What if the agent has entries for interfaces 1, 2, and 3,
but after awhile, interface 2 is deleted.  If the agent
knows about 'ifIndex', but not the manager, how well do
you think the manager application will handle this common scenario?

Config vs. non-config is irrelevant here.
Identification via named keys or identification via node position
is the issue.


> 
> 
>> Issue 2)
>>
>>    Why is the CLR about a leaf appearing more than once in the key needed?
>>    It should be up to the DM writer to decide if this makes sense or not:
>>
>>     list addr-pairs {
>>       key "addr-type src-addr addr-type dest-addr";
> 
> What does this mean?  What is the difference between this and:
> 
>         key "addr-type src-addr dest-addr";
> 
> What does an instance identifier for your example look like?
> 

This table obviously cannot use the nested address.
By design, it uses separated fields.


> 
>> Issue 3)
>>    Why is the key statement limited to top-level sibling nodes
>>    within the list?
> 
> Several reasons.  Have you seen any CLIs with arbitrarly deep keys?
> (is it really needed?)


The CLR is simple -- just like the use-case.
Only static container nodes can be listed as interior nodes
in a key.  All your fabricated cases below are invalid.
The key indicates the mandatory naming components for the list entry.
All key components MUST be present in every list entry.


> 
> What does this mean:
> 
>    list foo {
>      key "a/b/c";
>      container a {
>         container b {
>            precense "...";
> 	   leaf c;
>         }
>      }
>                
> Or this:
> 
>    list foo {
>      key "a/b/c";
>      container a {
>         list b {
>            ...
> 	   leaf c;
>         }
>      }
> 
> Or this:
> 
>    list foo {
>      key "a/b";
>      container a {
>         choice x {
> 	   leaf b;
> 	   leaf c;
>         }
>      }
>   
> 
> Also, by allowing deep keys, you force an agent implementation to do
> buffering of - in the worst case - the entire configuration.  You
> influence the protocol characteristics to the worse.  W/o deep keys
> implementations _can_ do minimal buffering, and thus make the NETCONF
> protocol usable in smaller devices.  I know at least three
> implementations that work this way today (and I know one that does
> buffering).
> 

This is really irrelevant in the context of standardization.
In other implementations (like mine) the position of the key
within the list element sub-tree is not a factor.

BTW, there is no text in the draft that says that the key components
must be defined first in the list.  In order to optimize the DML
design in favor of this implementation choice, the key components
can never be in reusable groupings (like address/port) and they
must always be the first leafs, defined in the same order as the key.

SMIv2 never had any massive CLRs like this for tables.
You can specify 'key' clauses in XSD for arbitrary nodes.

There is so much complexity in YANG wrt/ Xpath, local typedefs/groupings,
augments, that this hardly seems like an implementation burden
worthy of such drastic restrictions on data model design.


>>    With this constraint on the key-stmt, YANG cannot support
>>    indexing using reusable containers.  (There needs to be
>>    exactly one instance of the key component per list entry,
>>    so 'list' and 'choice' nodes cannot be used within a key.)
> 
> I can also argue that this is an CLR.  Why don't you allow:
> 
>    list foo {
>       key address;
>       container address {
>          choice type {
>             leaf ipv4address;
>             leaf ipv6address;
>             leaf name;
>          };
>          leaf port;
>       }
>    }
> 


We need to understand what a key is, and when it is used.
A key identifies the static naming components so multiple
instances of a list node can be distinguished by an application.

I am not proposing that the key components be complex and/or non-static,
like you are, with this straw-man example.   It is not a CLR to
specify that key components must be static leafs.  This is
how SMIv2 works, and it should be how YANG works as well.

> 
> 
> /martin
> 
> 

Andy



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