summaryrefslogtreecommitdiffstats
path: root/mpls/api/src/main/yang/hc2vpp-ietf-mpls-static@2017-03-10.yang
blob: ae8688bbd37e503925bde39292b0f0b8c443285a (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
module hc2vpp-ietf-mpls-static {

  namespace "urn:ietf:params:xml:ns:yang:ietf-mpls-static";

  prefix "mpls-static";

  import hc2vpp-ietf-mpls {
    prefix mpls;
  }

/*
  TODO: changed to modified version of ietf-routing that we use
  Set back to ietf-routing after HC2VPP-253 is resolved.
*/
  import hc2vpp-ietf-routing {
    prefix "rt";
  }

  import hc2vpp-ietf-routing-types {
    prefix "rt-types";
  }

  import ietf-inet-types {
    prefix inet;
  }

  import ietf-interfaces {
    prefix "if";
  }

  /* Import TE generic types */
  /*
  Yangtools has some issues with ietf-te model.
  There is no plan to support tunnels currently, so we simply comment this out.
  TODO: remove comment after following issues are resolved:
  https://jira.opendaylight.org/browse/MDSAL-182
  https://jira.opendaylight.org/browse/YANGTOOLS-677

  import ietf-te {
    prefix te;
  }
*/

  organization "IETF MPLS Working Group";

  contact
    "WG Web:   <http://tools.ietf.org/wg/mpls/>

     WG List:  <mailto:mpls@ietf.org>

     WG Chair: Loa Andersson
               <mailto:loa@pi.nu>

     WG Chair: Ross Callon
               <mailto:rcallon@juniper.net>

     WG Chair: George Swallow
               <mailto:swallow.ietf@gmail.com>

     Editor:   Tarek Saad
               <mailto:tsaad@cisco.com>

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

     Editor:   Rakesh Gandhi
               <mailto:rgandhi@cisco.com>

     Editor:   Xufeng Liu
               <mailto: xufeng.liu.ietf@gmail.com>

     Editor:   Vishnu Pavan Beeram
               <mailto:vbeeram@juniper.net>

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

     Editor:   Igor Bryskin
               <mailto: Igor.Bryskin@huawei.com>

     Editor:   Xia Chen
               <mailto:jescia.chenxia@huawei.com>

     Editor:   Raqib Jones
               <mailto:raqib@Brocade.com>

     Editor:   Bin Wen
               <mailto:Bin_Wen@cable.comcast.com>";

  description
     "This YANG module augments the 'ietf-routing' module with basic
     configuration and operational state data for MPLS static";

  /*
    TODO: 2017-07-02 defines grouping in-segment but does not use it.
    Bump to newer version after the issue is resolved.
  */
  revision "2017-03-10" {
    description
      "Latest revision:
        - Addressed MPLS-RT review comments";
    reference "RFC 3031: A YANG Data Model for Static MPLS LSPs";
  }

  typedef static-lsp-ref {
    type leafref {
      path "/rt:routing/mpls:mpls/mpls-static:static-lsps/" +
           "mpls-static:static-lsp/mpls-static:name";
    }
    description
      "This type is used by data models that need to reference
       configured static LSP.";
  }

  grouping path-basic_config {
    description "common definitions for statics";

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

    leaf outgoing-label {
      type rt-types:mpls-label;
      description
        "label value to push at the current hop for the
         LSP";
    }

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

  grouping path-properties_config {
    description
      "MPLS path properties";
    leaf path-index {
      type uint16;
      description
        "Path identifier";
    }

    leaf backup-path-index {
      type uint16;
      description
        "Backup path identifier";
    }

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

    leaf-list outgoing-labels {
      type rt-types:mpls-label;
      ordered-by user;
      description
        "The outgoing MPLS labels to impose";
    }

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

    leaf loadshare {
      type uint16;
      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 backup";
        }
        enum PRIMARY_AND_BACKUP {
          description
            "Path acts as primary and backup simultaneously";
        }
      }
      description
        "The MPLS path role";
    }
  }

  grouping static-lsp_config {
    description "common definitions for static LSPs";

    container in-segment {
      description
        "MPLS incoming segment";
      choice type {
        description
          "Basic FEC choice";
        case ip-prefix {
          leaf ip-prefix {
            type inet:ip-prefix;
            description "An IP prefix";
          }
        }
        case mpls-label {
          leaf incoming-label {
            type rt-types:mpls-label;
            description "label value on the incoming packet";
          }
        }
        /*
        Currently not supported. Commented out due to ODL issues (MDSAL-182, YANGTOOLS-677).
        case tunnel {
          leaf tunnel {
            type te:tunnel-ref;
            description "TE tunnel FEC mapping";
          }
        }
        */
      }
      leaf incoming-interface {
        type if:interface-ref;
        description
          "Optional incoming interface if FEC is restricted
           to traffic incoming on a specific interface";
      }
    }

    leaf operation {
      type enumeration {
        enum impose-and-forward {
          description
            "Operation impose outgoing label(s) and forward to
             next-hop";
        }
        enum pop-and-forward {
          description
            "Operation pop incoming label and forward to next-hop";
        }
        enum pop-impose-and-forward {
          description
            "Operation pop incoming label, impose one or more
             outgoing label(s) and forward to next-hop";
        }
        enum swap-and-forward {
          description
            "Operation swap incoming label, with outgoing label and
             forward to next-hop";
        }
        enum pop-and-lookup {
          description
            "Operation pop incoming label and perform a lookup";
        }
      }
      description
        "The MPLS operation to be executed on the incoming packet";
    }

    choice out-segment {
      description "The MPLS out-segment type choice";
      case simple-path {
        uses path-basic_config;
      }
      case path-list {
        list paths {
          key path-index;
          description
            "The list of MPLS paths associated with the FEC";
          uses path-properties_config;
        }
      }
    }
  }

  grouping static-lsp {
    description "grouping for top level list of static LSPs";
    container config {
      description
        "Holds the intended configuration";
      uses static-lsp_config;
    }
    container state {
      config false;
      description
        "Holds the state and inuse configuration";
      uses static-lsp_config;
    }
  }

  augment "/rt:routing/mpls:mpls" {
    description "Augmentations for MPLS Static LSPs";
    container static-lsps {
      description
        "Statically configured LSPs, without dynamic signaling";
      list static-lsp {
        key name;
        description "list of defined static LSPs";

        leaf name {
          type string;
          description "name to identify the LSP";
        }
        uses static-lsp;
      }
    }
  }
}