Hi Xian, the way it is structured with containers and all will allow you to indicate the various network types that apply to a network. If there is a hierarchy of network types, you would have a hierarchy of containers. In your case network-types --> ietf-te-topology--> otn-topology. Network will indicate each of the network types that it instantiates.
You could model a hierarchy of network types also through a hierarchy of identities, as you indicate in your example. Sure, in your example this is a viable alternative, but it is not clear what you would gain through that. For one, in the case of "otn-topology", the fact that the same topology is also an ietf-te-topology is rather implicit, not explicit. Per Robert's point, if for some reason you have multiple traits and want to "compose" a network to encompass multiple types, this is straightforward to do with the current pattern, not so straightforward with identities. --- Alex -----Original Message----- From: i2rs [mailto:[email protected]] On Behalf Of Zhangxian (Xian) Sent: Tuesday, July 12, 2016 7:49 AM To: Robert Varga <[email protected]>; [email protected] Cc: [email protected] Subject: Re: [i2rs] network-type: container vs. identity? Hi, Robert, Thank you for your clarification. Just make sure I get your point, let me try with a (real) example. At the moment, we have the following relationship among different topology types ( using the diagram from https://tools.ietf.org/html/draft-ietf-i2rs-yang-l3-topology-02 as base): +-----------------------------+ | +-----------------------+ | | | ietf-network | | | +----------^------------+ | | | | | +-----------------------+ | | | ietf-network-topology | |-------< [ietf-te-topology]------<[ otn-topology] ( as an example) | +----------+------------+ | +-------------^---------------+ | | +-----------^-------------+ | l3-unicast-igp-topology | +----+---------------+----+ ^ ^ | | | | +--------^-----+ +-----^---------+ | ospf-topology| | isis-topology | +--------------+ +---------------+ So, this shows support of more than two levels of relationships and many branches. Is that what you mean by multiple traits and composition? Although I do not see an example using this identity for this, but I wonder if the following way of using identity is supported and can be used to cater your need? Identity network-types { Description "base type for network types"; } Identity type-topology { Base "network-types"; } Identity type-l3-unicast-igp { Base " type-topology "; } Identity type-ospf { Base "type-l3-unicast-igp"; } I am cooking the codes up with my limited understanding of YANG, so I might be wrong. If so, please do let me know. Cheers, Xian -----Original Message----- From: Robert Varga [mailto:[email protected]] Sent: 2016年7月11日 18:54 To: Zhangxian (Xian); [email protected] Cc: [email protected] Subject: Re: [i2rs] network-type: container vs. identity? On 07/08/2016 05:47 AM, Zhangxian (Xian) wrote: > Hi, Authors, > > > > while using this model as a base to augment for technology-specific > topologies, I wonder why the leaf network-types is a container, > instead of being as a identity? > > > > I remember I asked Alex offline before, but the response I got was > that the identity was also under consideration at that time. Given the > latest version (June 2016 version) still use container, I wonder if > the authors can explain why the alternative is discarded? Thank you. The idea is to be able to have multiple traits, for example for composition. Bye, Robert _______________________________________________ i2rs mailing list [email protected] https://www.ietf.org/mailman/listinfo/i2rs _______________________________________________ i2rs mailing list [email protected] https://www.ietf.org/mailman/listinfo/i2rs
