aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-bgp-neighbor.yang
blob: f7ae33be8b805515bf0de6d103a8b0dd37e995ee (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
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
submodule openconfig-bgp-neighbor {

  belongs-to openconfig-bgp {
    prefix "oc-bgp";
  }

  import openconfig-extensions { prefix oc-ext; }
  import openconfig-routing-policy { prefix oc-rpol; }
  import openconfig-types { prefix oc-types; }
  import openconfig-bgp-types { prefix oc-bgp-types; }
  import openconfig-inet-types { prefix oc-inet; }
  import openconfig-yang-types { prefix oc-yang; }

  // Include the common submodule
  include openconfig-bgp-common;
  include openconfig-bgp-common-multiprotocol;
  include openconfig-bgp-peer-group;
  include openconfig-bgp-common-structure;

  // meta
  organization
    "OpenConfig working group";

  contact
    "OpenConfig working group
    netopenconfig@googlegroups.com";

  description
    "This sub-module contains groupings that are specific to the
    neighbor context of the OpenConfig BGP module.";

  oc-ext:openconfig-version "5.0.1";

  revision "2018-08-20" {
    description
      "Correct description of AFI-SAFI enabled leaf.";
    reference "5.0.1";
  }

  revision "2018-04-11" {
    description
      "Correct naming of BGP maximum prefix warning percentage leaf.";
    reference "5.0.0";
  }

  revision "2018-03-20" {
    description
      "Added SR-TE policy SAFI";
    reference "4.1.0";
  }

  revision "2017-07-30" {
    description
      "Clarification of add-paths send-max leaf";
    reference "4.0.1";
  }

  revision "2017-07-10" {
    description
      "Add error notifications; moved add-paths config; add AS
      prepend policy features; removed unneeded config leaves";
    reference "4.0.0";
  }

  revision "2017-02-02" {
    description
      "Bugfix to remove remaining global-level policy data";
    reference "3.0.1";
  }

  revision "2017-01-26" {
    description
      "Add dynamic neighbor support, migrate to OpenConfig types";
    reference "3.0.0";
  }

  revision "2016-06-21" {
    description
      "OpenConfig BGP refactor";
    reference "2.1.1";
  }

  grouping bgp-neighbor-config {
    description
      "Configuration parameters relating to a base BGP neighbor that
      are not also applicable to any other context
      (e.g., peer group)";

    leaf peer-group {
      type leafref {
        path "../../../../peer-groups/peer-group/peer-group-name";
      }
      description
        "The peer-group with which this neighbor is associated";
    }

    leaf neighbor-address {
        type oc-inet:ip-address;
        description
          "Address of the BGP peer, either in IPv4 or IPv6";
    }

    leaf enabled {
        type boolean;
        default true;
        description
          "Whether the BGP peer is enabled. In cases where the
          enabled leaf is set to false, the local system should not
          initiate connections to the neighbor, and should not
          respond to TCP connections attempts from the neighbor. If
          the state of the BGP session is ESTABLISHED at the time
          that this leaf is set to false, the BGP session should be
          ceased.";
    }
  }

  grouping bgp-neighbor-use-multiple-paths {
    description
      "Multipath configuration and state applicable to a BGP
      neighbor";

    container use-multiple-paths {
      description
        "Parameters related to the use of multiple-paths for the same
        NLRI when they are received only from this neighbor";

      container config {
        description
          "Configuration parameters relating to multipath";
        uses bgp-common-use-multiple-paths-config;
      }
      container state {
        config false;
        description
          "State parameters relating to multipath";
        uses bgp-common-use-multiple-paths-config;
      }

      container ebgp {
        description
          "Multipath configuration for eBGP";
        container config {
          description
            "Configuration parameters relating to eBGP multipath";
          uses bgp-common-use-multiple-paths-ebgp-as-options-config;
        }
        container state {
          config false;
          description
            "State information relating to eBGP multipath";
          uses bgp-common-use-multiple-paths-ebgp-as-options-config;
        }
      }
    }
  }

  grouping bgp-neighbor-state {
    description
      "Operational state parameters relating only to a BGP neighbor";

    leaf session-state {
      type enumeration {
          enum IDLE {
            description
              "neighbor is down, and in the Idle state of the
              FSM";
          }
          enum CONNECT {
            description
              "neighbor is down, and the session is waiting for
              the underlying transport session to be established";
          }
          enum ACTIVE {
            description
              "neighbor is down, and the local system is awaiting
              a conncetion from the remote peer";
          }
          enum OPENSENT {
            description
              "neighbor is in the process of being established.
              The local system has sent an OPEN message";
          }
          enum OPENCONFIRM {
            description
              "neighbor is in the process of being established.
              The local system is awaiting a NOTIFICATION or
              KEEPALIVE message";
          }
          enum ESTABLISHED {
            description
              "neighbor is up - the BGP session with the peer is
              established";
          }
        }
      description
        "Operational state of the BGP peer";
    }

    leaf last-established {
      type oc-types:timeticks64;
      description
        "This timestamp indicates the time that the
        BGP session last transitioned in or out of the Established
        state.  The value is the timestamp in seconds relative to
        the Unix Epoch (Jan 1, 1970 00:00:00 UTC).

        The BGP session uptime can be computed by clients as the
        difference between this value and the current time in UTC
        (assuming the session is in the ESTABLISHED state, per the
        session-state leaf).";
    }

    leaf established-transitions {
      type oc-yang:counter64;
      description
        "Number of transitions to the Established state for
        the neighbor session.  This value is analogous to the
        bgpPeerFsmEstablishedTransitions object from the standard
        BGP-4 MIB";
      reference
        "RFC 4273 - Definitions of Managed Objects for BGP-4";
    }

    leaf-list supported-capabilities {
      type identityref {
        base oc-bgp-types:BGP_CAPABILITY;
      }
      description
        "BGP capabilities negotiated as supported with the peer";
    }

    container messages {
      description
        "Counters for BGP messages sent and received from the
        neighbor";
      container sent {
        description
          "Counters relating to BGP messages sent to the neighbor";
        uses bgp-neighbor-counters-message-types-state;
        }

      container received {
        description
          "Counters for BGP messages received from the neighbor";
        uses bgp-neighbor-counters-message-types-state;
      }
    }

    container queues {
      description
        "Counters related to queued messages associated with the
        BGP neighbor";
      uses bgp-neighbor-queue-counters-state;
    }

    leaf dynamically-configured {
      type boolean;
      default false;
      description
        "When this leaf is set to true, the peer was configured dynamically
        due to an inbound connection request from a specified source prefix
        within a dynamic-neighbor-prefix.";
    }
  }

  grouping bgp-neighbor-counters-message-types-state {
    description
      "Grouping of BGP message types, included for re-use
      across counters";

    leaf UPDATE {
      type uint64;
      description
        "Number of BGP UPDATE messages announcing, withdrawing
        or modifying paths exchanged.";
    }

    leaf NOTIFICATION {
      type uint64;
      description
        "Number of BGP NOTIFICATION messages indicating an
        error condition has occurred exchanged.";
    }

    leaf last-notification-time {
      type oc-types:timeticks64;
      description
        "This timestamp indicates the time that a NOTIFICATION
        message was sent or received on the peering session
        (based on whether this leaf is associated with
        sent or received messages).

        The value is the timestamp in seconds relative to
        the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
    }

    leaf last-notification-error-code {
      type identityref {
        base oc-bgp-types:BGP_ERROR_CODE;
      }
      description
        "Indicates the last BGP error sent or received on the peering
        session (based on whether this leaf is associated with
        sent or received messages).";
    }

    leaf last-notification-error-subcode {
      type identityref {
        base oc-bgp-types:BGP_ERROR_SUBCODE;
      }
      description
        "Indicates the last BGP error subcode sent or received on
        the peering session (based on whether this leaf is associated
        with sent or received messages)";
    }
  }

  grouping bgp-neighbor-queue-counters-state {
    description
      "Counters relating to the message queues associated with the
      BGP peer";

    leaf input {
      type uint32;
      description
        "The number of messages received from the peer currently
        queued";
    }

    leaf output {
      type uint32;
      description
        "The number of messages queued to be sent to the peer";
    }
  }

  grouping bgp-neighbor-transport-state {
    description
      "Operational state parameters relating to the transport session
      used for the BGP session";

    leaf local-port {
      type oc-inet:port-number;
      description
        "Local TCP port being used for the TCP session supporting
        the BGP session";
    }

    leaf remote-address {
      type oc-inet:ip-address;
      description
        "Remote address to which the BGP session has been
        established";
    }

    leaf remote-port {
      type oc-inet:port-number;
      description
        "Remote port being used by the peer for the TCP session
        supporting the BGP session";
    }
  }

  grouping bgp-neighbor-error-handling-state {
    description
      "Operational state parameters relating to enhanced error
      error handling for BGP";

    leaf erroneous-update-messages {
      type uint32;
      description
        "The number of BGP UPDATE messages for which the
        treat-as-withdraw mechanism has been applied based
        on erroneous message contents";
    }
  }

  grouping bgp-neighbor-timers-state {
    description
      "Operational state parameters relating to BGP timers associated
      with the BGP session";

    leaf negotiated-hold-time {
      type decimal64 {
        fraction-digits 2;
      }
      description
        "The negotiated hold-time for the BGP session";
    }
  }

  grouping bgp-neighbor-afi-safi-graceful-restart-state {
    description
      "Operational state variables relating to the graceful-restart
      mechanism on a per-AFI-SAFI basis";

    leaf received {
      type boolean;
      description
        "This leaf indicates whether the neighbor advertised the
        ability to support graceful-restart for this AFI-SAFI";
    }

    leaf advertised {
      type boolean;
      description
        "This leaf indicates whether the ability to support
        graceful-restart has been advertised to the peer";
    }
  }

  grouping bgp-neighbor-graceful-restart-state {
    description
      "Operational state information relevant to graceful restart
      for BGP";

    leaf peer-restart-time {
      type uint16 {
        range 0..4096;
      }
      description
        "The period of time (advertised by the peer) that
        the peer expects a restart of a BGP session to
        take";
    }

    leaf peer-restarting {
      type boolean;
      description
        "This flag indicates whether the remote neighbor is currently
        in the process of restarting, and hence received routes are
        currently stale";
    }

    leaf local-restarting {
      type boolean;
      description
        "This flag indicates whether the local neighbor is currently
        restarting. The flag is unset after all NLRI have been
        advertised to the peer, and the End-of-RIB (EOR) marker has
        been unset";
    }

    leaf mode {
      type enumeration {
        enum HELPER_ONLY {
          description
            "The local router is operating in helper-only mode, and
            hence will not retain forwarding state during a local
            session restart, but will do so during a restart of the
            remote peer";
        }
        enum BILATERAL {
          description
            "The local router is operating in both helper mode, and
            hence retains forwarding state during a remote restart,
            and also maintains forwarding state during local session
            restart";
        }
        enum REMOTE_HELPER {
          description
            "The local system is able to retain routes during restart
            but the remote system is only able to act as a helper";
        }
      }
      description
        "Ths leaf indicates the mode of operation of BGP graceful
        restart with the peer";
    }
  }

  grouping bgp-neighbor-afi-safi-state {
    description
      "Operational state parameters relating to an individual AFI,
      SAFI for a neighbor";

    leaf active {
      type boolean;
      description
        "This value indicates whether a particular AFI-SAFI has
        been succesfully negotiated with the peer. An AFI-SAFI
        may be enabled in the current running configuration, but a
        session restart may be required in order to negotiate the new
        capability.";
    }

    container prefixes {
      description "Prefix counters for the BGP session";
      leaf received {
        type uint32;
        description
          "The number of prefixes received from the neighbor";
      }

      leaf sent {
        type uint32;
        description
          "The number of prefixes advertised to the neighbor";
      }

      leaf installed {
        type uint32;
        description
          "The number of advertised prefixes installed in the
          Loc-RIB";
      }
    }
  }

  grouping bgp-neighbor-afi-safi-list {
    description
      "List of address-families associated with the BGP neighbor";

    list afi-safi {
      key "afi-safi-name";

      description
        "AFI,SAFI configuration available for the
        neighbour or group";


      leaf afi-safi-name {
        type leafref {
          path "../config/afi-safi-name";
        }
        description
          "Reference to the AFI-SAFI name used as a key
          for the AFI-SAFI list";
      }

      container config {
        description
          "Configuration parameters for the AFI-SAFI";
        uses bgp-common-mp-afi-safi-config;
      }
      container state {
        config false;
        description
          "State information relating to the AFI-SAFI";
        uses bgp-common-mp-afi-safi-config;
        uses bgp-neighbor-afi-safi-state;
      }


      container graceful-restart {
        description
          "Parameters relating to BGP graceful-restart";
        container config {
          description
            "Configuration options for BGP graceful-restart";
          uses bgp-common-mp-afi-safi-graceful-restart-config;
        }
        container state {
          config false;
          description
            "State information for BGP graceful-restart";
          uses bgp-common-mp-afi-safi-graceful-restart-config;
          uses bgp-neighbor-afi-safi-graceful-restart-state;
        }
      }

      uses bgp-common-structure-neighbor-group-add-paths;
      uses bgp-common-mp-all-afi-safi-list-contents;
      uses bgp-neighbor-use-multiple-paths;
    }
  }

  grouping bgp-neighbor-base {
    description
      "Parameters related to a BGP neighbor";

    container config {
      description
        "Configuration parameters relating to the BGP neighbor or
        group";
      uses bgp-neighbor-config;
      uses bgp-common-neighbor-group-config;
    }
    container state {
      config false;
      description
        "State information relating to the BGP neighbor";
      uses bgp-neighbor-config;
      uses bgp-common-neighbor-group-config;
      uses bgp-neighbor-state;
    }

    container timers {
      description
        "Timers related to a BGP neighbor";
      container config {
        description
          "Configuration parameters relating to timers used for the
          BGP neighbor";
        uses bgp-common-neighbor-group-timers-config;
      }
      container state {
        config false;
        description
          "State information relating to the timers used for the BGP
          neighbor";
        uses bgp-common-neighbor-group-timers-config;
        uses bgp-neighbor-timers-state;
      }
    }

    container transport {
      description
        "Transport session parameters for the BGP neighbor";
      container config {
        description
          "Configuration parameters relating to the transport
          session(s) used for the BGP neighbor";
        uses bgp-common-neighbor-group-transport-config;
      }
      container state {
        config false;
        description
          "State information relating to the transport session(s)
          used for the BGP neighbor";
        uses bgp-common-neighbor-group-transport-config;
        uses bgp-neighbor-transport-state;
      }
    }

    container error-handling {
      description
        "Error handling parameters used for the BGP neighbor or
        group";
      container config {
        description
          "Configuration parameters enabling or modifying the
          behavior or enhanced error handling mechanisms for the BGP
          neighbor";
        uses bgp-common-neighbor-group-error-handling-config;
      }
      container state {
        config false;
        description
          "State information relating to enhanced error handling
          mechanisms for the BGP neighbor";
        uses bgp-common-neighbor-group-error-handling-config;
        uses bgp-neighbor-error-handling-state;
      }
    }

    container graceful-restart {
      description
        "Parameters relating the graceful restart mechanism for BGP";
      container config {
        description
          "Configuration parameters relating to graceful-restart";
        uses bgp-common-graceful-restart-config;
      }
      container state {
        config false;
        description
          "State information associated with graceful-restart";
        uses bgp-common-graceful-restart-config;
        uses bgp-neighbor-graceful-restart-state;
      }
    }

    uses bgp-common-structure-neighbor-group-logging-options;
    uses bgp-common-structure-neighbor-group-ebgp-multihop;
    uses bgp-common-structure-neighbor-group-route-reflector;
    uses bgp-common-structure-neighbor-group-as-path-options;
    uses bgp-neighbor-use-multiple-paths;
    uses oc-rpol:apply-policy-group;

    container afi-safis {
      description
        "Per-address-family configuration parameters associated with
        the neighbor";
      uses bgp-neighbor-afi-safi-list;
    }
  }

  grouping bgp-neighbor-list {
    description
      "The list of BGP neighbors";

    list neighbor {
      key "neighbor-address";
      description
        "List of BGP neighbors configured on the local system,
        uniquely identified by peer IPv[46] address";

      leaf neighbor-address {
        type leafref {
          path "../config/neighbor-address";
        }
        description
          "Reference to the address of the BGP neighbor used as
          a key in the neighbor list";
      }

      uses bgp-neighbor-base;
    }

  }


}