Dear Yang specialists,

 

I have a question concerning what is possible in must statements in case of
recursive models.  Assume the following "limits" depending on a plugable
board (just arbitrary examples):

 

+------------+---------+----------------+

| Board type | # ports | max VLAN ports |

+------------+---------+----------------+

|      A     |  8      |  80            |

|      B     |  4      |  40            |

|      C     |  2      |  40            |

|      D     |  16     |  100           |

+------------+---------+----------------+

 

The entity model is a recursive one where you start from the root (below is
just an example to depict the nature of the problem):

 

/entity

    | [Contains]

    + chassis

        | [contains]
        + Board

             | [Contains]

             +  Port

                 |

                 | reference to /interfaces/interface

 

/interfaces

     |

     + interface

          | various augments depending on the if-type but

          | no "back-reference" to port in /entity

 

Problem is two-fold:

-          Recursiveness needs to be expressed in the XPATH statement: when
a client wants to create a port it needs to perform a check based on the
board identification.  So in case of Board A the maximum number of ports
that the client should be allowed to make is 8, for B it is 4, for D it is
16

-          From the interfaces table (for the VLAN port case) there is no
back reference to the entity table, so how would one retrieve the "board" on
top of which this interface has been defined in order to pick up the max
VLAN ports value if we would like to perform a must check in this (as the
value depends on the board identification).  So 100 in case the interface is
defined and an port of board D, 40 in case the interface is defined on a
port of board C (or B).  Should we then have to add a backwards leafref to
the port in /entity (otherwise this must statement will end up in a complete
/entity table look-up to find the port leafref matching the instance from
/interfaces)?

 

Is this something that can be expressed in YANG with XPATH expressions?  How
will that look like (and will that be understandable.)?  Don't we need
XQUERY to do this (which is not part of YANG)?

What is the performance of this (so in fact what is the impact on the
server)?  Is it recommended to do it that way and if not: how would you
suggest to model these kind of restrictions?

 

Thanks in advance.

 

Best regards - Vriendelijke groeten,

Bart Bogaert

 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

Reply via email to