Re: [YANG] mandatory & default

Andy Bierman <ietf@andybierman.com> Sat, 26 January 2008 15:00 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 1JImVw-0001MT-Dc; Sat, 26 Jan 2008 10:00:12 -0500
Received: from yang by megatron.ietf.org with local (Exim 4.43) id 1JImVu-0001ML-WE for yang-confirm+ok@megatron.ietf.org; Sat, 26 Jan 2008 10:00:11 -0500
Received: from [10.91.34.44] (helo=ietf-mx.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1JImVu-0001MD-L5 for yang@ietf.org; Sat, 26 Jan 2008 10:00:10 -0500
Received: from smtp119.sbc.mail.sp1.yahoo.com ([69.147.64.92]) by ietf-mx.ietf.org with smtp (Exim 4.43) id 1JImVu-00053m-4K for yang@ietf.org; Sat, 26 Jan 2008 10:00:10 -0500
Received: (qmail 37708 invoked from network); 26 Jan 2008 15:00:09 -0000
Received: from unknown (HELO ?192.168.0.10?) (andybierman@att.net@67.126.131.12 with plain) by smtp119.sbc.mail.sp1.yahoo.com with SMTP; 26 Jan 2008 15:00:09 -0000
X-YMail-OSG: Vd8fT5sVM1kHUQJPybHJCBnHAmFYA5egv9EYsYNkZ8eMWIpN
X-Yahoo-Newman-Property: ymail-3
Message-ID: <479B4B65.90104@andybierman.com>
Date: Sat, 26 Jan 2008 07:01:57 -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] mandatory & default
References: <479A6CDF.5030304@andybierman.com> <20080126.002618.144263975.mbj@tail-f.com> <479A799D.1060003@andybierman.com> <20080126.112045.214588980.mbj@tail-f.com>
In-Reply-To: <20080126.112045.214588980.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: 1a1bf7677bfe77d8af1ebe0e91045c5b
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 Bierman <ietf@andybierman.com> wrote:
>>    container interfaces {
>>      list interface {
>>        key name;
>>
>>        leaf name { type InterfaceName; }
>>
>>        leaf mtu {
>>          type uint32;
>>          default 1500;
>>        }
>>      }
>>    }
>>
>> I start out with a get-config, and mtu is not there:
>>
>>   <interfaces>
>>     <interface>
>>       <name>eth0</name>
>>       <mtu>1600</mtu>
>>     </interface>
>>     <interface>
>>       <name>eth1</name>
>>     </interface>
>>   </interfaces>
>>
>> Does /interfaces/interface[name=eth1]/mtu exist or not?
> 
> Not in the config datastore, no.
> 


But here is where this CLI-based design is broken.
If a manager sends jumbo packets on eth1, they will not be accepted.
There is a maximum transmission unit size in effect on eth1,
but the manager is told there is none in the <get-config>.

The response "oh no, there is an MTU value in effect, just not in the config"
is really broken.  It's not state data, and it's not config data, but if
the manager does not know the value, it cannot reliably configure other
devices that send packets to 'eth1' on this agent.

IMO, the mtu is clearly config data, and clearly in effect at
all times eth1 is accepting packets.  The config returned
in NETCONF PDUs should match.  Filtering out these defaults
is a separate issue from whether they exist or not.


Andy


>> If not, then I can do an edit-config to create it:
>>
>>    <config>
>>      <interfaces>
>>        <interface>
>>          <name>eth1</eth1>
>>          <mtu nc:operation='create'>1500</mtu>
>>        </interface>
>>      </interfaces>
>>    </config>
>>
>> Does this succeed? 
> 
> Yes.
> 
>> NETCONF says it should, because the
>> leaf did not get returned in the previous <get-config>.
>>
>> Now I do a get-config again and get back:
>>
>>   <interfaces>
>>     <interface>
>>       <name>eth0</name>
>>       <mtu>1600</mtu>
>>     </interface>
>>     <interface>
>>       <name>eth1</name>
>>       <mtu>1500</mtu>
>>     </interface>
>>   </interfaces>
>>
>> The leaf never really changed value, but you would never know
>> that from the NETCONF PDU responses.
>>
>> After a system reboot, does the agent 'remember' that mtu
>> was set to 1500 by the manager, so the initial <running/>
>> config from NV-storage after the next reboot has an mtu leaf
>> for eth1?
> 
> The value is stored in NV-storage, just like all other values set by
> the manager.
> 
> 
> /martin
> 
> 



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