summaryrefslogtreecommitdiffstats
path: root/srv6/srv6-api/src/main/yang/hc2vpp-ietf-srv6-base@2018-03-01.yang
blob: 4d41b4566eea6269f2bd7475454e94b1b4b84198 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
module hc2vpp-ietf-srv6-base {

  namespace "urn:ietf:params:xml:ns:yang:ietf-srv6-base";
  prefix srv6;

  import ietf-interfaces {
    prefix "if";
  }

  import ietf-inet-types {
    prefix inet;
  }

  import ietf-yang-types {
    prefix "yang";
  }

  // TODO: hc2vpp-298 - Renamed imports, because hc2vpp uses modified versions of these models.
  import hc2vpp-ietf-routing-types {
     prefix "rt-types";
  }


  // TODO: hc2vpp-298 - Renamed imports, because hc2vpp uses modified versions of these models.
  import hc2vpp-ietf-routing {
    prefix "rt";
  }

  import ietf-srv6-types {
    prefix srv6-types;
  }

  organization
    "IETF SPRING Working Group";
  contact
      "WG Web:   <http://tools.ietf.org/wg/spring/>
     WG List:  <mailto:spring@ietf.org>

     Editor:   Kamran Raza
               <mailto:skraza@cisco.com>

     Editor:   Jaganbabu Rajamanickam
               <maito:jrajaman@cisco.com>

     Editor:   Xufeng Liu
               <mailto:Xufeng_Liu@jabil.com>

     Editor:   Zhibo Hu
               <mailto:huzhibo@huawei.com>

     Editor:   Iftekhar Hussain
               <mailto:IHussain@infinera.com>

     Editor:   Himanshu Shah
               <mailto:hshah@ciena.com>

     Editor:   Daniel Voyer
               <mailto:daniel.voyer@bell.ca>

     Editor:   Hani Elmalky
               <mailto:hani.elmalky@ericsson.com>

     Editor:   Satoru Matsushima
               <mailto:satoru.matsushima@gmail.com>

     Editor:   Katsuhiro Horiba
               <mailto:katsuhiro.horiba@g.softbank.co.jp>

     Editor:   Ahmed AbdelSalam
               <mailto:ahmed.abdelsalam@gssi.it>

     ";

  description
    "This YANG module defines the essential elements for the
     management of Segment-Routing with IPv6 dataplane (SRv6).

     Copyright (c) 2017 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the Simplified BSD License
     set forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (http://trustee.ietf.org/license-info).";

  reference "RFC XXXX";

  revision 2018-03-01 {
    description
      "Updated to align with SRv6 network programming draft rev 04";
    reference
      "RFC XXXX: YANG Data Model for SRv6";
      }

  revision 2017-11-12 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: YANG Data Model for SRv6";
  }

/*
 * Common
 */

  grouping path-attrs-cmn {
     description
       "Path properties -common for v4/v6";

     leaf weight {
       type uint32;
       description
         "This value is used to compute a loadshare to perform un-equal
          load balancing when multiple outgoing path(s) are specified. A
          share is computed as a ratio of this number to the total under
          all configured path(s).";
     }

     leaf role {

       type enumeration {
         enum PRIMARY { description "Path as primary traffic carrying"; }
         enum BACKUP { description "Path acts as a backup"; }
         enum PRIMARY_AND_BACKUP { description
                    "Path acts as primary and backup simultaneously"; }
        }
         description "The path role";
      }

      leaf backup-path-index {
       type uint8;
       description "Index of the protecting (backup) path";
      }
   }

  grouping path-out-sids {
    description "Grouping for path's SID stack";

      list out-sid {
        key "sid";
        description "Out SID";

        leaf sid {
          type srv6-types:srv6-sid;
          description "SID value";
        }
      }

  }

  grouping path-out-labels {
    description "Grouping for path's label stack";

      list out-label {
        key "label";
        description "Out label";

        leaf label {
          type rt-types:mpls-label;
          description "Label value";
        }
      }

  }

 /*
  * Config and State
  */

  grouping srv6-encap {
   description "Grouping for encap param config.";

   container encapsulation {
      description "Configure encapsulation related parameters";
      leaf source-address {
        type inet:ipv6-address;
        description "Specify a source address (for T.Encap). The address must locally exists
                     and be routable";
      }
      leaf ip-ttl-propagation {
        type boolean;
        default false;
        description "IP TTL propagation from encapsulated packet to encapsulating outer
                     IPv6 header. When configured on decapsulation side, this refers to
                     propagating IP TTL from outer IPv6 header to inner header after decap";
      }

    }
  }

  grouping srv6-locator-state {
   description "SRv6 grouping Locastateor ";

       leaf operational-status {
         type srv6-types:srv6-status-type;
         config false;
         description "Indicates whether locator state is UP";
       }

       leaf is-in-address-conflict {
         type boolean;
         config false;
         description "Indicates whether locator address conflicts with
                      some other IPv6 address on the box";
       }
    }

  grouping srv6-locators {
   description "SRv6 locator grouping";

   container locators {
      description "SRv6 locators";

      list locator {
        key "name";
        description "Configure a SRv6 locator";


        leaf name {
          type string;
          description "Locator name";
        }

        leaf enable {
          type boolean;
          default false;
          description "Enable a SRv6 locator";
        }
        leaf is-default {
          type boolean;
          mandatory true;
          description "Indicates if the locator is a default locator";
        }

        container prefix {
          description "Specify locator prefix value";
          leaf address {
            type inet:ipv6-address;
            mandatory true;
            description "IPv6 address";
          }
          leaf length {
            type srv6-types:srv6-locator-len;
            mandatory true;
            description "Locator (prefix) length";
          }
        }
        uses srv6-locator-state;
      }
    }
  }

  grouping srv6-stats-in {
    description "Grouping for inbound stats";

      leaf in-pkts {
        type yang:counter64;
        description
          "A cumulative counter of the total number of packets received";
      }

      leaf in-octets {
        type yang:counter64;
        description
          "A cumulative counter of the total bytes received.";
      }

  }

  grouping srv6-stats-out {
    description "Grouping for inbound stats";

      leaf out-pkts {
        type yang:counter64;
        description
          "A cumulative counter of the total number of packets transmitted";
      }

      leaf out-octets {
        type yang:counter64;
        description
          "A cumulative counter of the total bytes transmitted.";
      }
  }

  grouping path-out-sids-choice {
    description "Grouping for Out-SID choices";
    choice encap-type {
       description "Out-SID encap-based choice";
       case srv6 {
         uses path-out-sids;
       }
       case mpls {
         uses path-out-labels;
       }
    }
  }

  grouping local-sid-fwd-state {
    description "SRv6 local-SID forwarding state grouping";

    container forwarding {
       description "SRv6 local-SID forwarding state";

       leaf is-installed {
         type boolean;
         description "Indicates whether SID is installed in forwarding";
       }

       leaf next-hop-type {
         type srv6-types:srv6-nexthop-type;
         description "Forwarding next-hop types";
       }

       container paths {

         when "../is-installed = 'true'" {
           description "This container is valid only when the local-SID is installed
               in forwarding";
         }

         list path {
          key path-index;
          description "The list of paths associated with the SID";

          leaf path-index {
            type uint8;
            description "Index of the path";
          }

          container l2 {
            when "../../../next-hop-type = 'l2'" {
              description "This container is valid only for L2 type of NHs";
            }

            leaf interface {
              type if:interface-ref;
               description "The outgoing Layer2 interface";
            }

            description "L2 information";
          }

          container l3 {
            when "../../../next-hop-type != 'l2'" {
              description "This container is valid only for L3 type of NHs";
            }

            leaf interface {
              type if:interface-ref;
               description "The outgoing Layer3 interface";
            }

            leaf next-hop {
              type inet:ip-address;
              description "The IP address of the next-hop";
            }

            uses path-attrs-cmn;

            description "L3 information";
          }
          uses path-out-sids-choice;
        }

        description "Forwarding paths";
       }
    }
  }

  grouping srv6-state-sid {
   description "SRv6 SID state grouping";

   container local-sids {
     config false;
     description "Local-SID state";

     container counters {
         description "SRv6 counters";

         container cnt3 {
           description "Counts SRv6 traffic received/dropped on local prefix not instantiated as local-SID";
           uses srv6-stats-in;
         }
     }

     list local-sid {
       key "sid";
       description "Per-localSID Counters";

       leaf sid {
        type srv6-types:srv6-sid;
        description "Local SID value";
       }

       uses srv6-locator-ref;

       leaf is-reserved {
         type boolean;
         description "Set to true if SID comes from reserved pool";
       }

       leaf end-behavior-type {
           type identityref {
             base srv6-types:srv6-endpoint-type;
           }
           description "Type of SRv6 end behavior.";
       }

       leaf alloc-type {
        type srv6-types:sid-alloc-type;
        description
          "Type of sid allocation.";

       }

       list owner {
         key "type instance";
         description "SID Owner clients";
         leaf type {
           type identityref {
             base srv6-types:srv6-sid-owner-type;
           }
           description "SID owner/client type";
         }
         leaf instance {
           type string;
           description "Client instance";
         }
         leaf is-winner {
           type boolean;
           description "Is this client/owner the winning in terms of forwarding";
         }
       }

       uses local-sid-fwd-state;

       container counters {
         description "SRv6 per local-SID counters";

         container cnt1 {
           description "Counts SRv6 traffic received on local-SID prefix and processed successfully";
           uses srv6-stats-in;
         }
       }
    }
   }
  }

  grouping srv6-support-ends {
    description "SRv6 End behavior support grouping";

   list end-behavior {
     key "type";
     description "End behavior support";

     leaf type {
       type identityref {
         base srv6-types:srv6-endpoint-type;
       }
       description "End behavior (End*) type";
     }

     leaf supported {
       type boolean;
       mandatory true;
       description "True if supported";
     }
    }
   }

  grouping srv6-support-transits {
    description "SRv6 Transit behavior support grouping";

   list transit-behavior {
     key "type";
     description "Transit behavior support";

     leaf type {
       type srv6-types:srv6-transit-type;
       description "Transit behavior (T*) type";
     }
     leaf supported {
       type boolean;
       mandatory true;
       description "True if supported";
     }
    }
   }

  grouping srv6-support-signaled {
    description "SRv6 signaled parameter support grouping";

   container signaled-parameters {
     description "SRv6 signaled parameter support";

     leaf max-sl {
       type uint8;
       //mandatory true;
       description "Maximum value of the SL field in the SRH of
                    a received packet before applying the function
                    associated with a SID";
     }
     leaf max-end-pop-srh {
       type uint8;
       //mandatory true;
       description "Maximum number of SIDs in the top SRH in an
                    SRH stack to which the router can apply
                    PSP or USP flavors";
     }
     leaf max-t_insert {

       type uint8;
       //mandatory true;
       description "Maximum number of SIDs that can be inserted as
                   part of the T.insert behavior";
     }
     leaf max-t_encap {
       type uint8;
       //mandatory true;
       description "Maximum number of SIDs that can be inserted as
                    part of the T.Encap behavior";
     }
     leaf max-end_d {
       type uint8;
       //mandatory true;
       description "Maximum number of SIDs in an SRH when applying
                    End.DX6 and End.DT6 functions";
     }
    }
  }

  grouping srv6-support-security-rules {
    description "SRv6 Security rules grouping";

   list security-rule {
     key "type";
     description "Security rule support";

     leaf type {
       type srv6-types:srv6-security-rule-type;
       description "Security rule type";
     }
     leaf supported {
       type boolean;
       mandatory true;
       description "True if supported";
     }
    }
   }

  grouping srv6-support-counters {
    description "SRv6 Counters grouping";

   list counters {
     key "type";
     description "SRv6 counter support";

     leaf type {
       type srv6-types:srv6-counter-type;

       description "Counter type";
     }
     leaf supported {
       type boolean;
       mandatory true;
       description "True if supported";
     }
    }
   }

   grouping srv6-state-capabilities {
     description "SRv6 node capabilities grouping";
     container node-capabilities {
       config false;
       description "Node's SRv6 capabilities";

       uses srv6-support-ends;
       uses srv6-support-transits;
       uses srv6-support-signaled;
       uses srv6-support-security-rules;
       uses srv6-support-counters;
     }
  }

  augment "/rt:routing" {
     description
      "This augments routing-instance configuration with segment-routing SRv6.";

   container srv6 {
    description "Segment Routing with IPv6 dataplane";

    /* config */
    leaf enable {
      type boolean;
      default false;
      description "Enable SRv6";
    }

    uses srv6-encap;
    uses srv6-locators;
    uses srv6-state-capabilities;
    uses srv6-state-sid;
   }
 }

 /* Notifications */

  grouping srv6-locator-ref {

    description
      "An absolute reference to an SRv6 locator";
    leaf locator-ref {
      type leafref {
        path "/rt:routing/srv6:srv6/srv6:locators/srv6:locator/srv6:name";
      }
      description
        "Reference to a SRv6 locator.";
    }
  }

  notification srv6-locator-status-event {
    description
      "Notification event for a change of SRv6 locator operational status.";
    leaf operational-status {
      type srv6-types:srv6-status-type;
      description "Operational status";
    }
    uses srv6-locator-ref;
  }

  notification srv6-sid-collision-event {
    description
      "Notification event for an SRv6 SID collision - i.e., attempt to bind an already
       bound SID to a new context";
    leaf sid {
      type srv6-types:srv6-sid;
      description "SRv6 SID";
    }
    container existing {
      description "Current assignment / bind";
      leaf end-behavior-type {
        type identityref {
          base srv6-types:srv6-endpoint-type;
        }
        description "End type";
      }
      // TODO: More
    }
    container requested {
      description "Requested assignment / bind";

      leaf end-behavior-type {
        type identityref {
          base srv6-types:srv6-endpoint-type;
        }
        description "End type";
      }

    }

    }

} // module