aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-wifi-phy.yang
blob: 7c4453ca639f972c9bd9d26bdb9c6dc131e40634 (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
module openconfig-wifi-phy {

  yang-version "1";

  // namespace
  namespace "http://openconfig.net/yang/wifi/phy";

  // Assign this module a prefix to be used by other modules, when imported.
  prefix "oc-wifi-phy";

  // Imports
  import openconfig-yang-types { prefix oc-yang; }
  // OC-specific types
  import openconfig-extensions { prefix oc-ext; }
  import openconfig-types { prefix oc-types; }
  import openconfig-wifi-types { prefix oc-wifi-types; }

  // Some required meta
  organization "OpenConfig working group";

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

  description
    "Model for managing PHY layer configuration of Radio interfaces.";

  oc-ext:openconfig-version "0.2.0";

  revision "2017-12-21" {
    description
      "Add last-seen to neighbor-table.";
    reference "0.2.0";
  }

  revision "2017-11-06" {
    description
      "Add SSID to neighbor-table.";
    reference "0.1.1";
  }

  revision "2017-07-25" {
    description
      "Initial revision.";
    reference "0.1.0";
  }

  // Grouping statements
  grouping radio-common-config {
    description
      "Configuration items common to all Radio interfaces, independent
      of frequency";

    leaf id {
      type uint8;
      description
        "Unique ID of the radio.";
    }

    leaf operating-frequency {
      type identityref {
        base oc-wifi-types:OPERATING_FREQUENCY;
      }
      description
        "Operating frequency of this radio.";
    }

    leaf enabled {
      type boolean;
      default "true";
      description
        "The desired operational state (up/down) of this radio interface.";
    }

    leaf transmit-power {
      type uint8;
      units dBm;
      default 9;
      description
        "Transmit power of the radio, in dBm.";
    }

    leaf channel {
      type uint8 {
        range "1..165";
        }
      description
        "Operating channel of this radio. If using channel-bonding this
        will represent the Primary 20MHz channel of the 40,80,160MHz channel.";
    }

    leaf channel-width {
      type uint8;
      units MHz;
      default 20;
      description
        "Operating channel-width of this radio.";
    }

    leaf dca {
      type boolean;
      default "true";
      description
        "Utilize Dynamic Channel Assignment on this Radio.";
    }

    leaf-list allowed-channels {
      type oc-wifi-types:channels-type;
      description
        "Allowed channel list for this Radio to utilize.";
    }

    leaf dtp {
      type boolean;
      default "true";
      description
        "Utilize dynamic transmit-power on this Radio.";
    }

    leaf dtp-min {
      when "../dtp = 'true'";
      type uint8;
      default '3';
      description
        "Minimum allowed transmit-power on this radio, if utilizing dtp.
        Expressed in dBm.";
    }

    leaf dtp-max {
      when "../dtp = 'true'";
      type uint8;
      default '15';
      description
        "Maximum allowed transmit-power on this radio, if utilizing dtp.
        Expressed in dBm.";
    }

    leaf antenna-gain {
      type int8;
      description
        "Antenna gain applied to this Radio; typically used when
        external antennae connected.";
    }

    leaf scanning {
      type boolean;
      default "true";
      description
        "Whether the radio will perform off-channel scanning, to collect
        neighboring RF information.";
    }

    leaf scanning-interval {
      type uint8;
      units seconds;
      description
        "How often, in seconds, the radio will go off-channel to perform
        scanning.";
    }

    leaf scanning-dwell-time {
      type uint16;
      units milliseconds;
      description
        "Amount of time, in milliseconds, the radio will spend on a
        channel during scanning-interval. If a Monitor-mode Radio, it will
        cycle through scanning-allowed-channels spending this amount of time
        on each.";
    }

    leaf scanning-defer-clients {
      type uint8;
      description
        "Do not perform scanning if this amount of Stations are Associated
        to the Radio.";
    }

    leaf scanning-defer-traffic {
      type boolean;
      description
        "Do not perform scanning if any traffic received from an active Station
        in the past 100ms marked as AC_VO or AC_VI.";
    }
  }

  grouping radio-common-state {
    description
      "Grouping for defining radio-specific operational state";

    leaf base-radio-mac {
      type oc-yang:mac-address;
      description
        "Represents the 'burned-in' base-radio MAC
        address for the a Radio interface.";
    }

    leaf dfs-hit-time {
      type oc-types:timeticks64;
      description
        "Reports the time of the last DFS hit. The value is the timestamp
        in seconds relative to the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
    }

    leaf channel-change-reason {
      type identityref {
        base oc-wifi-types:CHANGE_REASON_TYPE;
      }
      description
        "When an Access Point changes channels, this will
        provide the reason that led to the change.";
    }

    leaf total-channel-utilization {
      type oc-types:percentage;
      description
        "Total 802.11 and non-802.11 channel utilization on this Radio. The
        total channel utilization should include all time periods the AP
        spent actively receiving and transmitting 802.11 frames, and also
        include all time spent with clear channel assessment (CCA) in a
        busy state";
    }

    leaf rx-dot11-channel-utilization {
      type oc-types:percentage;
      description
        "Received channel-utilization due to 802.11 frames";
    }

    leaf rx-noise-channel-utilization {
      type oc-types:percentage;
         description
           "Received channel-utilization percentage due to Noise.";
    }

    leaf tx-dot11-channel-utilization {
      type oc-types:percentage;
      description
        "Transmit channel-utilization percentage.";
    }
  }

  grouping radio-counters-state {
    description
      "Radio telemetry statistics.";
    container counters {
      description
        "A collection of radio-related statistics objects.";

      // Rx Counters
      leaf failed-fcs-frames {
        type oc-yang:counter64;
        description
          "Number of frames that failed the FCS";
      }

      // Tx Counters
      leaf noise-floor {
        type int8;
        description
          "Noise Floor, as measured by this radio.";
      }
    }
  }

  // neighbor BSSID | SSID | RSSI | Channel | Center Channel | Last-seen
  grouping neighbor-list-state {
    description
      "Operational state data relating to neighboring
       BSSIDs and their received signal strength.";
    leaf bssid {
      type oc-yang:mac-address;
      description
        "Neighboring BSSID.";
    }

    leaf ssid {
      type string;
      description
       "The SSID of this neighboring BSSID.";
    }

    leaf rssi {
      type int8;
      description
       "The RSSI of this neighboring BSSID.";
    }

    leaf channel {
      type uint16;
      description
        "The channel of this neighboring BSSID. This is to utilize 802.11ac
        nomenclature. For example, 40MHz channel 36-40 represented as
        channel 38. primary-channel used to identify the primary
        20MHz channel of the neighbor.";
    }

    leaf primary-channel {
      type uint16;
      description
        "The primary 20MHz channel, if the neighbor is operating on bonded
        channel.";
    }

    leaf last-seen {
      type oc-types:timeticks64;
      description
        "Reports the time this reading was taken, indicating when this neighbor
        was last seen. If a cache is used, it MUST be updated instantly when a
        neighbor BSS changes channels, or a new BSS is seen. The value is the
        timestamp in seconds relative to the Unix Epoch
        (Jan 1, 1970 00:00:00 UTC).";
    }
  }

  grouping neighbor-bssid-top {
  description
    "Top-level grouping for neighbor table
    operational state data.";

    container neighbors {
      description
        "Top-level container for RF neighbors.";
      list neighbor {
        key "bssid";
        config false;
        description
          "The mac address, or BSSID, of a neighbor, and
          their corresponding RSSI.";

        leaf bssid {
          type leafref {
            path "../state/bssid";
          }
          config false;
          description "Reference to neighbor bssid.";
        }

        container state {
          config false;
          description
            "State container for RF neighbors.";
          uses neighbor-list-state;
        }
      }
    }
  }

  grouping radio-top {
    description
      "Top-level grouping for radio configuration and
      operational state data";

    container radios {
      description
        "Top level container for radios, including configuration
        and state data.";

      list radio {
        key "id";
        description
          "The list of radios on the device.";

        leaf id {
          type leafref {
            path "../config/id";
          }
          description
            "References the configured id of the radio";
        }

        container config {
          description
            "Configurable items at the global, radio interface
            level";

          uses radio-common-config;
        }

        container state {
          config false;
          description
            "Operational state data at the global radio level";

          uses radio-common-config;
          uses radio-common-state;
          uses radio-counters-state;
        }
        uses neighbor-bssid-top;
      }
    }
  }
  uses radio-top;
}