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