summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-network-function@2021-06-18.yang
blob: f8e39ef2db842dac4af1f2edaf43cee3571e23b6 (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
module nts-network-function {
  yang-version 1.1;
  namespace "urn:o-ran-sc:params:xml:ns:yang:nts:network:function";
  prefix ntsnf;

  import ietf-inet-types {
    prefix inet;
  }

  import nts-common {
    prefix ntsc;
  }

  import ietf-yang-types {
    prefix yang;
  }

  organization
    "O-RAN-SC";
  contact
    " Web: <https://wiki.o-ran-sc.org/display/SIM/SIM>
        Editors:
        Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com>
        Adrian Lita <mailto:adrian.lita@highstreet-technologies.com>
        Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>";
  description
    "This module contains YANG definitions for the Network Topology Simulator - Network Functions";

  revision 2021-06-18 {
    description
      "Added test-list for NETCONF hardware delay emulation.";
    reference
      "O-RAN-SC SIM project";
  }
  revision 2021-06-14 {
    description
      "Added total loss network emulation RPC and NETCONF write-delay emulation.";
    reference
      "O-RAN-SC SIM project";
  }
  revision 2021-06-08 {
    description
      "Added more info and NETCONF latency emulation.";
    reference
      "O-RAN-SC SIM project";
  }
  revision 2021-05-17 {
    description
      "Added support for network emulation.";
    reference
      "O-RAN-SC SIM project";
  }
  revision 2021-03-26 {
    description
      "Added info container, and expanted feature control mechanism and status.";
    reference
      "O-RAN-SC SIM project";
  }
  revision 2021-03-17 {
    description
      "Renamed datastore-random-populate RPC to datastore-populate";
    reference
      "O-RAN-SC SIM project";
  }
  revision 2020-12-11 {
    description
      "Added function-type to simulated function.";
    reference
      "O-RAN-SC SIM project";
  }
  revision 2020-11-30 {
    description
      "Cleared revision for nts-common import.";
    reference
      "O-RAN-SC SIM project";
  }
  revision 2020-10-28 {
    description
      "Add RPC for clearing the fault counters.";
    reference
      "O-RAN-SC SIM project";
  }
  revision 2020-10-13 {
    description
      "Add RPC for datastore populating and feature control.";
    reference
      "O-RAN-SC SIM project";
  }
  revision 2020-09-07 {
    description
      "Initial revision for the Network Topology Simulator - Next Generation";
    reference
      "O-RAN-SC SIM project";
  }

  container info {
    config false;
    description
      "Information about NTS application and modules.";
    leaf build-time {
      type yang:date-and-time;
      description
        "Build time of NTS application.";
    }

    leaf version {
      type string;
      description
        "NTS version of current network-function.";
    }

    leaf started-features {
      type ntsc:feature-type;
      description
        "A bit-wise list with currently started features.";
    }

    leaf ssh-connections {
      type uint8;
      config false;
      description
        "The number of SSH Endpoints the network function instance exposes.";
    }

    leaf tls-connections {
      type uint8;
      config false;
      description
        "The number of TLS Endpoints the network function instance exposes.";
    }

    leaf hostname {
      type string;
      description
        "Current network function hostname.";
    }

    list docker-ports {
      key "port";
      description
        "The ports which are exposed inside the docker container implementing this network function instance.";
      leaf port {
        type inet:port-number;
        description
          "Port number.";
      }

      leaf protocol {
        type identityref {
          base ntsc:NTS_PROTOCOL_TYPE_BASE;
        }
        description
          "Protocol attached to current port.";
      }
    }
  }

  container simulation {
    description
      "Root level container which controls the Network Function.";
    container network-function {
      description
        "Container which encompasses the details of the network function.";
      leaf function-type {
        type string;
        description
          "Type of network function that is simulated.";
      }

      uses ntsc:mount-point-details-g;

      uses ntsc:faults-g;

      uses ntsc:netconf-config-g;

      uses ntsc:ves-config-g;
    }

    container network-emulation {
      description
        "Container which encompasses the details of the network emulation.";
      leaf limit {
        type uint16 {
          range "16 .. max";
        }
        units "packets";
        default "1000";
        description
          "Maximum number of packets the qdisc may hold queued at a time.";
      }

      container delay {
        description
          "Adds the chosen delay to the packets outgoing to chosen network interface.";
        leaf time {
          type uint16;
          units "miliseconds (ms)";
          description
            "Delay time between packets.";
        }

        leaf jitter {
          type uint16;
          units "miliseconds (ms)";
          description
            "Delay jitter.";
        }

        leaf correlation {
          type uint8 {
            range "0 .. 100";
          }
          units "percentage";
          description
            "Delay correlation.";
        }

        leaf distribution {
          type enumeration {
            enum "uniform" {
              description
                "Uniform delay distribution.";
            }
            enum "normal" {
              description
                "Normal delay distribution.";
            }
            enum "pareto" {
              description
                "Pareto delay distribution.";
            }
            enum "paretonormal" {
              description
                "Paretonormal delay distribution.";
            }
          }
          description
            "Delay distribution.";
        }
      }

      leaf loss {
        type uint8 {
          range "0 .. 100";
        }
        units "percentage";
        description
          "Adds an independent loss probability to the packets outgoing from the chosen network interface.";
      }

      container corruption {
        description
          "Allows the emulation of random noise introducing an error in a random position for a chosen percent of packets.";
        leaf percentage {
          type uint8 {
            range "0 .. 100";
          }
          units "percentage";
          description
            "Corruption percentage.";
        }

        leaf correlation {
          type uint8 {
            range "0 .. 100";
          }
          units "percentage";
          description
            "Corruption correlation.";
        }
      }

      container duplication {
        description
          "Using this option the chosen percent of packets is duplicated before queuing them.";
        leaf percentage {
          type uint8 {
            range "0 .. 100";
          }
          units "percentage";
          description
            "Duplication percentage.";
        }

        leaf correlation {
          type uint8 {
            range "0 .. 100";
          }
          units "percentage";
          description
            "Duplication correlation.";
        }
      }

      container reordering {
        description
          "Used together with delay; a percentage of packets are sent immediately (with defined correlation) while the others are delayed (by specified delay).";
        leaf percentage {
          type uint8 {
            range "0 .. 100";
          }
          units "percentage";
          description
            "Reordering percentage.";
        }

        leaf correlation {
          type uint8 {
            range "0 .. 100";
          }
          units "percentage";
          description
            "Reordering correlation.";
        }
      }

      leaf rate {
        type uint16;
        units "kbits";
        description
          "Delay packets based on packet size.";
      }
    }

    container hardware-emulation {
      description
        "Container which encompasses the details of hardware emulation.";
      container netconf-delay {
        description
          "Emulates delay on an operational leaf.";
        leaf delay {
          type uint32;
          units "miliseconds (ms)";
          default "0";
          description
            "Delay time to be set for get operation on test leaf.";
        }

        leaf get-test {
          type uint32;
          units "miliseconds (ms)";
          config false;
          description
            "Read to test. Value represents emulated delay.";
        }

        leaf edit-test {
          type uint32;
          units "miliseconds (ms)";
          description
            "Writing non-null value will emulate a write-delay.";
        }

        list get-test-list {
          config false;
          description
            "Read to test. Returned values are saved from edit-test-list.";
          leaf value {
            type string;
            description
              "Values from edit-test-list.";
          }
        }

        list edit-test-list {
          key "value";
          description
            "Write to test.";
          leaf value {
            type string;
            description
              "Unique values for testing.";
          }
        }
      }
    }

    container sdn-controller {
      description
        "Groups details about the SDN Controller.";
      uses ntsc:controller-g;
    }

    container ves-endpoint {
      description
        "Groups details about the VES Collector endpoint.";
      uses ntsc:ves-endpoint-g;
    }
  }

  rpc datastore-populate {
    description
      "Operation to populate the datastore with data for all the containing YANG models, based on settings in config.json";

    output {
      uses ntsc:rpc-status-g;
    }
  }

  rpc feature-control {
    description
      "Operation to control the features in a Network Function.";
    input {
      leaf start-features {
        type ntsc:feature-type;
        description
          "A bit-wise list with features to be activated.";
      }

      leaf stop-features {
        type ntsc:feature-type;
        description
          "A bit-wise list with features to be deactivated.";
      }
    }

    output {
      uses ntsc:rpc-status-g;
    }
  }

  rpc invoke-notification {
    description
      "Operation to control the features in a Network Function.";
    input {
      leaf notification-format {
        type enumeration {
          enum "xml" {
            description
              "The notification string is formatted as XML.";
          }
          enum "json" {
            description
              "The notification string is formatted as JSON.";
          }
        }
        mandatory true;
        description
          "The format of the notification string.";
      }

      leaf notification-object {
        type string;
        mandatory true;
        description
          "A JSON string containing the notification object to be sent by the device.";
      }
    }

    output {
      uses ntsc:rpc-status-g;
    }
  }

  rpc invoke-ves-pm-file-ready {
    description
      "Operation to generate a VES  notification from a Network Function.";
    input {
      leaf file-location {
        type string;
        mandatory true;
        description
          "A string containing the location of the file on the server.";
      }
    }

    output {
      uses ntsc:rpc-status-g;
    }
  }

  rpc clear-fault-counters {
    description
      "Operation to clear the fault counters.";

    output {
      uses ntsc:rpc-status-g;
    }
  }

  rpc emulate-total-loss {
    description
      "Operation to emulate 100% loss in network packets. Operation will resume after specified timeout.";
    input {
      leaf timeout {
        type uint32;
        units "miliseconds (ms)";
        description
          "Period after which loss will stop being 100%.";
      }
    }

    output {
      uses ntsc:rpc-status-g;
    }
  }
}