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