On 20/07/2020 11:19, Ladislav Lhotka wrote:
Juergen Schoenwaelder <[email protected]> writes:

   - Percentages are frequently used in YANG models but usages differ a
     lot in precision and range. It is not clear what the proper
     generic definition of a percentage type would be and whether it is
     worth having it.

     RFC 7950 example:

          typedef percent { type uint8 { range "0 .. 100"; } }

     RFC 8294:

          typedef percentage { type uint8 { range "0..100"; } }

     I-Ds:
          typedef percentage { type decimal64 { fraction-digits 5; } }
          typedef percentile { type decimal64 { fraction-digits 2; } }

     The yang catalogue seems to be down. :-(

   - Proposal: do not add a percentage type since it is trivial to
     define a context specific percentage type that matches range and
     precision requirements (and there is already a definition in RFC
     8294 for those who need exactly that definition).
I agree with this proposal. It is also possible to use

    units percent;

where necessary.
On the other hand, when I look at the numerous percent/percentage occurrences in YANG model, it doesn't hurt to define that typedef.

https://yangcatalog.org/yang-search/ => search on "node name" and typedef only
We can find 56 entries from IETF, IEEE, BBF, OC, MEF, vendors
Most of them points to:

   *typedef*  percent {
        *type*  uint8 {
                *range*  "0 .. 100";

        }
   }
Regards, Benoit



Lada

--
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>

_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to