Set topology tp states from device port state
[transportpce.git] / api / src / main / yang / gnpy-path-computation-simplified@2020-09-09.yang
1 module gnpy-path-computation-simplified {
2   yang-version 1;
3   namespace "gnpy:path";
4   prefix gnpypc;
5
6   import ietf-inet-types {
7     prefix inet;
8   }
9
10   organization
11     "Telecom Infra Project OOPT PSE Working Group";
12   contact
13     "WG Web:   <https://github.com/Telecominfraproject/oopt-gnpy>
14      contact:  <mailto:ahmed.triki@orange.com>
15      contact:  <mailto:esther.lerouzic@orange.com>
16     ";
17   description
18     "YANG model for gnpy path computation simplified for transportPCE";
19
20   revision 2020-09-09 {
21     description
22       "remove key from route-object-include-exclude";
23   }
24   revision 2020-02-02 {
25     description
26       "second draft with detailed blocking reasons";
27     reference
28       "YANG model for path computation with gnpy inputs";
29   }
30
31   identity SNR-bandwidth {
32     base path-metric-type;
33     description
34       "A metric that records SNR in signal bandwidth";
35   }
36
37   identity OSNR-bandwidth {
38     base path-metric-type;
39     description
40       "A metric that records OSNR in signal bandwidth";
41   }
42
43   identity SNR-0.1nm {
44     base path-metric-type;
45     description
46       "A metric that records SNR in 0.1nm";
47   }
48
49   identity OSNR-0.1nm {
50     base path-metric-type;
51     description
52       "A metric that records OSNR in 0.1nm";
53   }
54
55   identity reference_power {
56     base path-metric-type;
57     description
58       "to be revised";
59   }
60
61   identity path_bandwidth {
62     base path-metric-type;
63     description
64       "to be revised";
65   }
66
67   identity path-metric-type {
68     description
69       "Base identity for path metric type";
70   }
71
72   identity route-usage-type {
73     description
74       "Base identity for route usage";
75   }
76
77   identity route-include-ero {
78     base route-usage-type;
79     description
80       "Include ERO from route";
81   }
82
83   identity route-exclude-ero {
84     base route-usage-type;
85     description
86       "Exclude ERO from route";
87   }
88
89   identity route-exclude-srlg {
90     base route-usage-type;
91     description
92       "Exclude SRLG from route";
93   }
94
95   typedef te-hop-type {
96     type enumeration {
97       enum LOOSE {
98         description
99           "loose hop in an explicit path";
100       }
101       enum STRICT {
102         description
103           "strict hop in an explicit path";
104       }
105     }
106     description
107       "enumerated type for specifying loose or strict
108        paths";
109     reference
110       "RFC3209: section-4.3.2";
111   }
112
113   typedef te-path-disjointness {
114     type bits {
115       bit node {
116         position 0;
117         description
118           "Node disjoint.";
119       }
120       bit link {
121         position 1;
122         description
123           "Link disjoint.";
124       }
125       bit srlg {
126         position 2;
127         description
128           "SRLG (Shared Risk Link Group) disjoint.";
129       }
130     }
131     description
132       "Type of the resource disjointness for a TE tunnel path.";
133     reference
134       "RFC4872: RSVP-TE Extensions in Support of End-to-End
135        Generalized Multi-Protocol Label Switching (GMPLS)
136        Recovery";
137   } // te-path-disjointness
138
139   typedef te-node-id {
140     type inet:ip-address;
141     description
142       "An identifier for a node in a topology.
143        The identifier is represented as 32-bit unsigned integer in
144        the dotted-quad notation.
145        This attribute is mapped to Router ID in
146        RFC3630, RFC5329, RFC5305, and RFC6119.";
147   }
148
149   typedef te-tp-id {
150     type union {
151       type uint32; // Unnumbered
152       type inet:ip-address; // IPv4 or IPv6 address
153     }
154     description
155       "An identifier for a TE link endpoint on a node.
156        This attribute is mapped to local or remote link identifier in
157        RFC3630 and RFC5305.";
158   }
159
160   typedef accumulated-metric-type {
161     type union {
162       type uint64;
163       type decimal64 {
164         fraction-digits 2;
165       }
166     }
167     description
168       "type useable for accumulative-value";
169   }
170
171   grouping effective-freq-slot {
172     /* content copied from ietf-flexi-grid-media-channel, because only M and N are needed
173        from the initial grouping.
174      */
175     description
176       "The effective frequency slot is an attribute
177        of a media channel and, being a frequency slot, it is
178        described by its nominal central frequency and slot
179        width";
180     reference
181       "rfc7698";
182     leaf N {
183       type int32;
184       description
185         "Is used to determine the Nominal Central
186          Frequency. The set of nominal central frequencies
187          can be built using the following expression:
188            f = 193.1 THz + n x 0.00625 THz,
189          where 193.1 THz is ITU-T ''anchor frequency'' for
190          transmission over the C band, n is a positive or
191          negative integer including 0.";
192       reference
193         "rfc7698";
194     }
195     leaf M {
196       type int32;
197       description
198         "Is used to determine the slot width. A slot width
199          is constrained to be M x SWG (that is, M x 12.5 GHz),
200          where M is an integer greater than or equal to 1.";
201       reference
202         "rfc7698";
203     }
204   }
205
206   grouping gnpy-specific-parameters {
207     description
208       "This grouping defines the gnpy specific parameters for requests.";
209     leaf technology {
210       type string;
211       default "flexi-grid";
212       description
213         "Data plane technology type.";
214     }
215     leaf trx_type {
216       type string;
217       mandatory true;
218       description
219         "name of the transponder type (to be read from equipment library";
220     }
221     leaf trx_mode {
222       type string;
223       description
224         "name of the transponder mode (to be read from equipment library";
225     }
226     list effective-freq-slot {
227       key "N";
228       uses effective-freq-slot;
229     }
230     leaf spacing {
231       type decimal64 {
232         fraction-digits 1;
233       }
234       units "Hz";
235       mandatory true;
236       description
237         "It is the spacing between channels assuming full load with
238          same channels as the requested one. multiple of 12.5 GHz";
239     }
240     leaf max-nb-of-channel {
241       type uint32;
242       description
243         "Nb of channel to take into account for the full load case.\n";
244     }
245     leaf output-power {
246       type decimal64 {
247         fraction-digits 5;
248       }
249       units "W";
250       description
251         "optical power setting to be used for the propagation";
252     }
253     leaf path_bandwidth {
254       type decimal64 {
255         fraction-digits 5;
256       }
257       units "bit/s";
258       mandatory true;
259       description
260         "Capacity required";
261     }
262   }
263
264   grouping transponder {
265     leaf transponder-type {
266       type string;
267       description
268         "transponder type.";
269     }
270     leaf transponder-mode {
271       type string;
272       description
273         "transponder mode.";
274     }
275   }
276
277   grouping hop-attribute {
278     description
279       "This grouping defines the hop attribute parameters for request or response";
280     choice hop-type {
281       case tsp {
282         container transponder {
283           uses transponder;
284         }
285       }
286       case regen {
287         container regenerator {
288           leaf regenerator-id {
289             type string;
290           }
291           uses transponder;
292         }
293       }
294       case pow {
295         container optical-power {
296           leaf optical-power {
297             type decimal64 {
298               fraction-digits 5;
299             }
300             units "W";
301             description
302               "hop output (input??) power";
303           }
304         }
305       }
306     }
307   }
308
309   grouping path-route-objects {
310     description
311       "List of EROs to be included or excluded when performing
312        the path computation.";
313     container explicit-route-objects {
314       description
315         "Container for the route object list";
316       list route-object-include-exclude {
317         description
318           "List of explicit route objects to include or
319            exclude in path computation";
320         leaf explicit-route-usage {
321           type identityref {
322             base route-usage-type;
323           }
324           description
325             "Explicit-route usage.";
326         }
327         uses explicit-route-hop;
328       }
329     }
330   }
331
332   grouping generic-path-disjointness {
333     description
334       "Path disjointness grouping";
335     leaf disjointness {
336       type te-path-disjointness;
337       description
338         "The type of resource disjointness.
339          Under primary path, disjointness level applies to
340          all secondary LSPs. Under secondary, disjointness
341          level overrides the one under primary";
342     }
343   }
344
345   grouping common-path-constraints-attributes {
346     description
347       "Common path constraints configuration grouping";
348     uses common-constraints_config;
349   }
350
351   grouping generic-path-constraints {
352     description
353       "Global named path constraints configuration
354        grouping";
355     container path-constraints {
356       description
357         "TE named path constraints container";
358       uses common-path-constraints-attributes;
359     }
360   }
361
362   grouping explicit-route-hop {
363     description
364       "The explicit route subobject grouping";
365     leaf index {
366       type uint32;
367       description
368         "ERO subobject index";
369     }
370     choice type {
371       description
372         "The explicit route subobject type";
373       case num-unnum-hop {
374         container num-unnum-hop {
375           description
376             "Numbered and Unnumbered link/node explicit route
377              subobject";
378           leaf node-id {
379             //type te-node-id;
380             type string;
381             description
382               "The identifier of a node in the TE topology.";
383           }
384           leaf link-tp-id {
385             //type te-tp-id;
386             type string;
387             description
388               "TE link termination point identifier. The combination
389                of TE link ID and the TE node ID is used to identify an
390                unnumbered TE link.";
391           }
392           leaf hop-type {
393             type te-hop-type;
394             description
395               "strict or loose hop";
396           }
397         }
398       }
399       case label {
400         description
401           "The Label ERO subobject";
402         container label-hop {
403           description
404             "Label hop type";
405           uses effective-freq-slot;
406         }
407       }
408       case hop-attribute {
409         uses gnpypc:hop-attribute;
410       }
411     }
412   }
413
414   grouping common-constraints_config {
415     description
416       "Common constraints grouping that can be set on
417        a constraint set or directly on the tunnel";
418     container te-bandwidth {
419       description
420         "A requested bandwidth to use for path computation";
421       uses gnpy-specific-parameters;
422     }
423   }
424
425   grouping end-points {
426     description
427       "Common grouping to define the TE tunnel end-points";
428     leaf source {
429       type inet:ip-address;
430       description
431         "TE tunnel source address.";
432     }
433     leaf destination {
434       type inet:ip-address;
435       description
436         "P2P tunnel destination address";
437     }
438     leaf src-tp-id {
439       type binary;
440       description
441         "TE tunnel source termination point identifier.";
442     }
443     leaf dst-tp-id {
444       type binary;
445       description
446         "TE tunnel destination termination point
447          identifier.";
448     }
449   }
450
451   grouping synchronization-info {
452     description
453       "Information for sync";
454     list synchronization {
455       key "synchronization-id";
456       description
457         "sync list";
458       leaf synchronization-id {
459         type uint32;
460         description
461           "index";
462       }
463       container svec {
464         description
465           "Synchronization VECtor";
466         leaf relaxable {
467           type boolean;
468           default "true";
469           description
470             "If this leaf is true, path computation process is free
471              to ignore svec content.
472              otherwise it must take into account this svec.";
473         }
474         uses generic-path-disjointness;
475         leaf-list request-id-number {
476           type uint32;
477           description
478             "This list reports the set of M path computation requests that must be synchronized.";
479         }
480       }
481     }
482   }
483
484   grouping generic-path-properties {
485     description
486       "TE generic path properties grouping";
487     container path-properties {
488       config false;
489       description
490         "The TE path properties";
491       list path-metric {
492         key "metric-type";
493         description
494           "TE path metric type";
495         leaf metric-type {
496           type identityref {
497             base path-metric-type;
498           }
499           description
500             "TE path metric type";
501         }
502         leaf accumulative-value {
503           type decimal64 {
504             fraction-digits 2;
505           }
506           description
507             "TE path metric accumulative value";
508         }
509       }
510       //      container path-route-objects {
511       //        description
512       //          "Container for the list of route objects either returned by
513       //           the computation engine or actually used by an LSP";
514       //        list path-route-object {
515       //          key index;
516       //          description
517       //            "List of route objects either returned by the computation
518       //             engine or actually used by an LSP";
519       //          uses explicit-route-hop;
520       //        }
521       //      }
522       list path-route-objects {
523         description
524           "Container for the list of route objects either returned by
525            the computation engine or actually used by an LSP";
526         container path-route-object {
527           description
528             "List of route objects either returned by the computation
529              engine or actually used by an LSP";
530           uses explicit-route-hop;
531         }
532       }
533     }
534   }
535
536   grouping path-info {
537     description
538       "Path computation output information";
539     uses generic-path-properties;
540   }
541
542   // adding some blocking reasons and info on path in case of blocking
543
544   grouping no-path-info {
545     description
546       "no-path-info";
547     container no-path {
548       presence "Response without path information, due to failure
549                 performing the path computation";
550       description
551         "if path computation cannot identify a path,
552          rpc returns no path.";
553       leaf no-path {
554         type string;
555         mandatory true;
556         description
557           "returned blocking reasons:
558             NO_PATH
559             NO_COMPUTED_SNR
560             NO_FEASIBLE_BAUDRATE_WITH_SPACING
561             NO_PATH_WITH_CONSTRAINT
562             NO_FEASIBLE_MODE
563             MODE_NOT_FEASIBLE
564             NO_SPECTRUM
565           ";
566       }
567       uses generic-path-properties;
568     }
569   }
570
571   /* TODO : correct the following with good trees:
572    *  te:tunnels-rpc/te:input/te:tunnel-info
573    *  te:tunnels-rpc/te:output/te:result
574    */
575
576   grouping service {
577     list path-request {
578       key "request-id";
579       description
580         "request-list";
581       leaf request-id {
582         type uint32;
583         mandatory true;
584         description
585           "Each path computation request is uniquely identified by the request-id-number.";
586       }
587       leaf bidirectional {
588         type boolean;
589         mandatory true;
590         description
591           "Specify the bidirectionality of the path";
592       }
593       uses end-points;
594       uses path-route-objects;
595       uses generic-path-constraints;
596     }
597     uses synchronization-info;
598   }
599
600   grouping result {
601     list response {
602       key "response-id";
603       config false;
604       description
605         "response";
606       leaf response-id {
607         type uint32;
608         description
609           "The list key that has to reuse request-id-number.";
610       }
611       choice response-type {
612         config false;
613         description
614           "response-type";
615         case no-path-case {
616           uses no-path-info;
617         }
618         case path-case {
619           description
620             "Path computation service.";
621           uses path-info;
622         }
623       }
624     }
625   }
626
627   container result {
628     description
629       "Describe the service file to connect to gnpy";
630     uses result;
631   }
632 }