aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-aft-common.yang
blob: c2b884f33806f30aa722bd8e2839b26d5c308246 (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
submodule openconfig-aft-common {
  belongs-to "openconfig-aft" {
    prefix "oc-aft";
  }

  import openconfig-interfaces { prefix "oc-if"; }
  import openconfig-extensions { prefix "oc-ext"; }
  import openconfig-yang-types { prefix "oc-yang"; }
  import openconfig-inet-types { prefix "oc-inet"; }
  import openconfig-mpls-types { prefix "oc-mplst"; }
  import openconfig-policy-types { prefix "oc-pol-types"; }
  import openconfig-aft-types { prefix "oc-aftt"; }

  organization
    "OpenConfig working group";

  contact
    "OpenConfig working group
    www.openconfig.net";

  description
    "Submodule containing definitions of groupings that are re-used
    across multiple contexts within the AFT model.";

  oc-ext:openconfig-version "0.3.1";

  revision 2017-08-24 {
    description
      "Formatting fixes";
    reference "0.3.1";
  }

  revision 2017-05-10 {
    description
      "Refactor to provide concretised per-AF schemas per AFT.";
    reference "0.3.0";
  }

  grouping aft-nhop-structural {
    description
      "Structural grouping describing a next-hop entry.";

    container next-hops {
      description
        "The list of next-hops that are to be used for entry within
        the AFT table. The structure of each next-hop is address
        family independent, such that it is possible to resolve fully
        how the next-hop is treated. For example:

        - Where ingress IPv4 unicast packets are to be forwarded via
          an MPLS LSP, the next-hop list should indicate the MPLS
          label stack that is used to the next-hop.
        - Where ingress MPLS labelled packets are to be forwarded to
          an IPv6 nexthop (for example, a CE within a VPN, then the
          popped label stack, and IPv6 next-hop address should be
          indicated).";

      list next-hop {
        key "index";

        description
          "A next-hop associated with the forwarding instance.";

        leaf index {
          type leafref {
            path "../config/index";
          }
          description
            "A unique index identifying the next-hop entry for the
            AFT entry";

        }

        container config {
          description
            "Configuration parameters relating to the AFT next-hop
            entry";

          uses aft-common-entry-nexthop-config;
        }

        container state {
          config false;
          description
            "Operational state parameters relating to the AFT
            next-hop entry";

          uses aft-common-entry-nexthop-config;
          uses aft-common-entry-nexthop-state;
        }

        uses oc-if:interface-ref;
      }
    }
  }

  grouping aft-common-entry-state {
    description
      "Operational state parameters relating to a forwarding entry";

    leaf packets-forwarded {
      type oc-yang:counter64;
      description
        "The number of packets which have matched, and been forwarded,
         based on the AFT entry.";
    }

    leaf octets-forwarded {
      type oc-yang:counter64;
      description
        "The number of octets which have matched, and been forwarded,
         based on the AFT entry";
    }

    // We are at $afi/$entry/state/next-hop-group
    leaf next-hop-group {
      type leafref {
        path "../../../../next-hop-groups/next-hop-group/state/id";
      }
      description
        "A reference to the next-hop-group that is in use for the entry
        within the AFT. Traffic is distributed across the set of next-hops
        within the next-hop group according to the weight.";
    }
  }

  grouping aft-common-entry-nexthop-config {
    description
      "Configuration parameters relating to a next-hop entry for a AFT
      entry";

    leaf index {
      type uint64;
      description
        "A unique entry for the next-hop.";
    }
  }

  grouping aft-common-entry-nexthop-state {
    description
      "Parameters relating to a next-hop.";

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

    leaf mac-address {
      type oc-yang:mac-address;
      description
        "The MAC address of the next-hop if resolved by the local
        network instance.";
    }

    leaf-list pushed-mpls-label-stack {
      type oc-mplst:mpls-label;
      ordered-by user;
      description
        "The MPLS label stack imposed when forwarding packets to the
        next-hop
        - the stack is encoded as a leaf list whereby the order of the
          entries is such that the first entry in the list is the
          label at the bottom of the stack to be pushed.

        To this end, a packet which is to forwarded to a device using
        a service label of 42, and a transport label of 8072 will be
        represented with a label stack list of [42, 8072].

        The MPLS label stack list is ordered by the user, such that no
        system re-ordering of leaves is permitted by the system.

        A swap operation is reflected by entries in the
        popped-mpls-label-stack and pushed-mpls-label-stack nodes.";

    }

    leaf encapsulate-header {
      type oc-aftt:encapsulation-header-type;
      description
        "When forwarding a packet to the specified next-hop the local
        system performs an encapsulation of the packet - adding the
        specified header type.";
    }

    leaf origin-protocol {
      type identityref {
        base "oc-pol-types:INSTALL_PROTOCOL_TYPE";
      }
      description
        "The protocol from which the AFT entry was learned.";
    }
  }

  grouping aft-common-ip-state {
    description
      "Common parameters across IP address families";

    leaf decapsulate-header {
      type oc-aftt:encapsulation-header-type;
      description
        "When forwarding a packet to the specified next-hop, the local
        system performs a decapsulation of the packet - removing the
        specified header type. In the case that no next-hop is
        specified, the packet header is removed, and a subsequent
        forwarding lookup is performed on the packet encapsulated
        within the header, matched within the relevant AFT within the
        specified network-instance.";
    }
  }

  grouping aft-next-hop-groups-structural {
    description
      "Logical grouping for groups of next-hops.";

    container next-hop-groups {
      description
        "Surrounding container for groups of next-hops.";

      list next-hop-group {
        key "id";

        description
          "An individual set of next-hops grouped into a common group.
          Each entry within an abstract forwarding table points to a
          next-hop-group. Entries in the next-hop-group are forwarded to
          according to the weights specified for each next-hop group.

          If an entry within the next-hop group becomes unusable, for
          example due to an interface failure, the remaining entries
          are used until all entries become unusable - at which point
          the backup next-hop-group (if specified) is used.";

        leaf id {
          description
            "A reference to a unique identifier for the next-hop-group.";

          type leafref {
            path "../config/id";
          }
        }

        container config {
          description
            "Configuration parameters related to the next-hop-group.";
          uses aft-nhg-config;
        }

        container state {
          config false;
          description
            "Operational state parameters relating to next-hop-groups.";
          uses aft-nhg-config;
          uses aft-nhg-state;
        }

        container next-hops {
          description
            "Surrounding container for the list of next-hops within
            the next-hop-group.";

          list next-hop {
            key "index";

            description
              "An individual next-hop within the next-hop-group. Each
              next-hop is a reference to an entry within the next-hop
              list.";

            leaf index {
              description
                "A reference to the index for the next-hop within the
                the next-hop-group.";
              type leafref {
                path "../config/index";
              }
            }

            container config {
              description
                "Configuration parameters related to a next-hop within
                the next-hop-group.";
              uses aft-nhg-nh-config;
            }

            container state {
              config false;
              description
                "Operational state parameters related to a next-hop
                within the next-hop-group.";
              uses aft-nhg-nh-config;
              uses aft-nhg-nh-state;
            }
          }
        }
      }
    }
  }

  grouping aft-nhg-config {
    description
      "Configuration parameters related to a next-hop-group.";

    leaf id {
      type uint64;
      description
        "A unique identifier for the next-hop-group. This index
        is not expected to be consistent across reboots, or
        reprogramming of the next-hop-group. When updating
        a next-hop-group, if the group is removed by the system
        or assigned an alternate identifier, the system should
        send telemetry notifications deleting the previous
        identifier. If the identifier of the next-hop-group
        is changed, all AFT entries that reference it must
        also be updated.";
    }
  }

  grouping aft-nhg-state {
    description
      "Operational state parameters related to a next-hop-group.";

    leaf color {
      type uint64;
      description

        "An arbitrary colour that is used as an identifier for the next-hop
        group. Some next-hop resolutions may utilise the colour to select 
        the particular next-hop-group that a routing entry should be resolved 
        to. In this case, next-hop-group selection may be based on colour 
        matches rather than the protocol specified next-hop.

        Regardless of whether the next-hop-group's specified colour is
        used to select an AFT's active forwarding entry, the next-hop-group
        referenced by an entry should be the currently active value.

        Next-hop-groups that are installed on the system through a protocol
        that allows injection of such entries (e.g., BGP using the SR-TE
        Policy SAFI, or gRPC-based RIB programming) should have the colour
        specified in the injecting protocol within this leaf.";
    }

    leaf backup-next-hop-group {
      // We are at afts/next-hop-groups/next-hop-group/config/backup-next-hop-group
      type leafref {
        path "../../../next-hop-group/state/id";
      }
      description
        "The backup next-hop-group for the current group. When all
        entries within the next-hop group become unusable, the backup
        next-hop group is used if specified.";
    }
  }

  grouping aft-nhg-nh-config {
    description
      "Configuration parameters relating to an individual next-hop within
      a next-hop-group.";

    leaf index {
      type leafref {
        // We are at afts/next-hop-groups/next-hop-group/next-hops/next-hop/config/id
        path "../../../../../../next-hops/next-hop/config/index";
      }
      description
        "A reference to the identifier for the next-hop to which
        the entry in the next-hop group corresponds.";
    }
  }

  grouping aft-nhg-nh-state {
    description
      "Operational state parameters relating to an individual next-hop
      within the next-hop-group.";

    leaf weight {
      type uint64;
      description
        "The weight applied to the next-hop within the group. Traffic
        is balanced across the next-hops within the group in the
        proportion of weight/(sum of weights of the next-hops within
        the next-hop group).";
    }
  }
}