aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-network-instance-l2.yang
blob: 530b8c884a81ac6c3a4536e4fb5b6c1668f13eb5 (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
submodule openconfig-network-instance-l2 {

  belongs-to openconfig-network-instance {
    prefix "oc-netinst";
  }

  // import some basic types
  import openconfig-extensions { prefix "oc-ext"; }
  import openconfig-interfaces { prefix "oc-if"; }
  import ietf-yang-types { prefix "yang"; }

  // meta
  organization "OpenConfig working group";

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

  description
    "This module contains groupings which specifically relate to
    Layer 2 network instance configuration and operational state
    parameters.";

  oc-ext:openconfig-version "0.11.0";

  revision "2018-08-11" {
    description
      "Add vlan id as additional key in MAC table";
    reference "0.11.0";
  }

  revision "2018-06-22" {
    description
      "Fix typo in OSPF when statement";
    reference "0.10.2";
  }

  revision "2018-06-05" {
    description
      "Fix bugs in when statements";
    reference "0.10.1";
  }

  revision "2018-02-19" {
    description
      "Add PIM and IGMP to network instance";
    reference "0.10.0";
  }

  revision "2017-12-13" {
    description
      "Fix incorrect constraint on SR and MPLS containers";
    reference "0.9.0";
  }

  revision "2017-08-24" {
    description
      "Minor formatting fixes";
    reference "0.8.1";
  }

  revision "2017-02-28" {
    description
      "Add OSPFv2 to network instance";
    reference "0.8.0";
  }

  revision "2017-01-26" {
    description
      "Add policy forwarding to network instance";
    reference "0.7.0";
  }

  revision "2017-01-13" {
    description
      "Add AFT to the network instance";
    reference "0.6.0";
  }

  revision "2016-12-15" {
    description
      "Add segment routing to network instance";
    reference "0.5.0";
  }

  revision "2016-11-10" {
    description
      "Update model to include IS-IS.";
    reference "0.4.1";
  }

  revision "2016-10-12" {
    description
      "Update table connections";
    reference "0.4.0";
  }

  revision "2016-09-28" {
    description
      "Change L2 instance to submodule; add MAC table";
    reference "0.3.0";
  }

  revision "2016-08-11" {
    description
      "Resolve repeated container names in routing protocols";
    reference "0.2.3";
  }

  revision "2016-07-08" {
    description
      "Updated with refactored routing protocol models";
    reference "0.2.1";
  }

  revision "2016-03-29" {
    description
      "Initial revision";
    reference "0.2.0";
  }

  revision "2015-11-20" {
    description
      "Initial revision";
    reference "0.1.0";
  }

  grouping l2ni-instance {
    description
      "Configuration and operational state parameters relating
      to a Layer 2 network instance";

    container fdb {
      description
        "Operational state and configuration parameters relating to
        the forwarding database of the network instance";

      container config {
        description
          "Configuration parameters relating to the FDB";
        uses l2ni-fdb-mac-config;
      }
      container state {
        config false;
        description
          "Operational state parameters relating to the FDB";
        uses l2ni-fdb-mac-config;
      }

       uses l2ni-mac-table-top;
    }
  }

  grouping l2ni-instance-common-config {
    description
      "Common configuration options which are specific to Layer 2
      network instances";

    leaf mtu {
      type uint16;
      description
        "The maximum frame size which should be supported for this
        instance for Layer 2 frames";
    }

  }

  grouping l2ni-fdb-mac-config {
    description
      "Parameters relating to FDB behaviour relating to MAC
      addresses";

    leaf mac-learning {
      type boolean;
      description
        "When this leaf is set to true, MAC learning is enabled for
        the network instance, such that MAC addresses are learned
        from ingress frames and added to the FDB.";
    }

    leaf mac-aging-time {
      // Cisco supports one aging time for local and remote, but
      // can specify this time is absolute or against inactivity.
      // ALU SROS supports different aging times for local and remote
      // but does not allow absolute/inactivity specification.
      // JNPR supports only a single aging time, and no specification
      // of whether inactivity/absolute is used.
      // It is easy to augment new options in here for local remote
      // and an extra leaf to allow specification of the type of aging
      // so this is left as a single value.
      type uint16;
      units seconds;
      description
        "The number of seconds of inactivity after which the entry
        in the local FDB is timed out.";
    }

    leaf maximum-entries {
      type uint16;
      description
        "The maximum number of MAC address entries that should be
        accepted into the FDB";
    }
  }

  grouping l2ni-encapsulation-config {
    description
      "Encapsulation related configuration parameters for a L2
      network instance";

    leaf control-word {
      type boolean;
      description
        "Whether the control-word should be used for the network
        instance";
      reference "RFC3985";
    }
  }

  grouping l2ni-mac-table-config {
    description
      "Configuration data for MAC table entries";

    leaf mac-address {
      type yang:mac-address;
      description
        "MAC address for the dynamic or static MAC table
        entry";
    }

    leaf vlan {
      //TODO(aashaikh): Consider whether this should just reflect the
      //VLAN id or be a union type to also support displaying/setting
      //the VLAN by name (i.e., global VLAN configured in the VLAN
      // model).
      type leafref {
        path "../../../../../../vlans/vlan/config/vlan-id";
      }
      description
        "VLAN on which the MAC address is present. The same MAC
        address may be seen on multiple VLANs in some cases.";
    }
  }

  grouping l2ni-mac-table-state {
    description
      "Operational state data for MAC table entries";

    leaf age {
      type uint64;
      units seconds;
      description
        "The time in seconds since the MAC address has been in the
        table";
    }

    leaf entry-type {
      type enumeration {
        enum STATIC {
          description
            "Statically programmed MAC table entry";
        }
        enum DYNAMIC {
          description
            "Dynamically learned MAC table entry";
        }
      }
      description
        "Indicates whether the entry was statically configured, or
        dynamically learned.";
    }

  }

  grouping l2ni-mac-table-top {
    description
      "Top-level grouping for MAC table list";


    container mac-table {
      description
        "Table of learned or statically configured MAC addresses and
        corresponding VLANs in the bridge domain";

      container entries {
        description
          "Enclosing container for list of MAC table entries";

        list entry {
          key "mac-address vlan";
          description
            "List of learned MAC addresses";

          leaf mac-address {
            type leafref {
              path "../config/mac-address";
            }
            description
              "Reference to mac-address list key";
          }

          leaf vlan {
            type leafref {
              path "../config/vlan";
            }
            description
              "Reference to vlan list key";
          }

          container config {
            description
              "Configuration data for MAC table entries";

            uses l2ni-mac-table-config;
          }

          container state {

            config false;

            description
              "Operational state data for MAC table entries";

            uses l2ni-mac-table-config;
            uses l2ni-mac-table-state;
          }

          container interface {
            description
              "Reference to the base and/or subinterface for the
              MAC table entry";

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