> On Apr 14, 2023, at 07:46, Martin Björklund <mbj+i...@4668.se> wrote:
> 
> Acee Lindem <acee.i...@gmail.com> wrote:
>> 
>>> On Apr 14, 2023, at 04:39, Martin Björklund <mbj+i...@4668.se> wrote:
>>> 
>>> Hi,
>>> 
>>> I am quite confused after reading this thread, so I had to go back to
>>> this first message:
>>> 
>>> "Jason Sterne (Nokia)" <jason.ste...@nokia.com> wrote:
>>>> Hi Jeff,
>>>> 
>>>> One topic that came up during the IETF 116 NETMOD meeting was
>>>> backwards compatibility.
>>>> 
>>>>> From what I understand, a leaf (e.g. unknown-flags) that uses the
>>>>> unknown-bits typedef would never change its definition in YANG. It
>>>>> would always be defined as unknown-bits with all 64 bit definitions
>>>>> even as more and more bits become "known".  *But* the system would
>>>>> suddenly stop reporting bit-0, then bit-1 in that unknown-flags leaf
>>>>> as those bits become known.
>>>> 
>>>> Strictly speaking, that should probably be considered an NBC change
>>> 
>>> Nothing has changed in the data model, so there is no way to mark the
>>> _data model_ as NBC.
>>> 
>>> The server follows the data model, and reports which bits it doesn't
>>> understand.  With software updates, this may change over time.  This
>>> is simply the semantics of this state leaf.
>> 
>> I agree. Removing the definition of the unknown bit in the second leaf
>> for unknown bits is not backward compatible but that isn’t being
>> proposed.
>> 
>> Also, one can define a new bit in an unused position in an
>> augmentation - correct?
> 
> No, you cannot change the type of a leaf/leaf-list with augment.
> Augment can only add new nodes.

That’s what I seemed to remember as why we didn’t use bits type bits for the 
IGP models. 
However, I asked ChatGTP to confirm and it led me astray. I’ve marked it as 
incorrect. See response below: 

Yes, YANG 1.1 type bits can be augmented and remain backward compatible as long 
as the augmentation follows certain guidelines.

The YANG 1.1 specification provides guidance on how to augment existing YANG 
data models in a backward-compatible manner. When augmenting a data model that 
uses bits, the augmentation must not redefine any existing bits, but rather can 
only add new bits to the existing bit field.

In addition, the new bits that are added through the augmentation must have a 
unique name within the bit field, and their position within the bit field must 
be chosen so as to not conflict with any existing bits. This ensures that any 
software that uses the original data model will still be able to understand the 
new augmented version of the data model.

It is worth noting that while YANG 1.1 supports backward compatibility, it is 
still important to test the augmented data model thoroughly to ensure that it 
is compatible with all software that may use it.


Thanks,
Acee


> 
> 
> /martin

_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to