aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-bgp-common.yang
blob: 5194266654898994ba7b3e0908ec9150ca7bbb2c (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
submodule openconfig-bgp-common {

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

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

  // meta
  organization
    "OpenConfig working group";

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

  description
    "This sub-module contains common groupings that are common across
    multiple contexts within the BGP module. That is to say that they
    may be application to a subset of global, peer-group or neighbor
    contexts.";

  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-common-neighbor-group-timers-config {
    description
      "Config parameters related to timers associated with the BGP
      peer";

    leaf connect-retry {
      type decimal64 {
        fraction-digits 2;
      }
      default 30;
      description
        "Time interval in seconds between attempts to establish a
        session with the peer.";
    }

    leaf hold-time {
      type decimal64 {
        fraction-digits 2;
      }
      default 90;
      description
        "Time interval in seconds that a BGP session will be
        considered active in the absence of keepalive or other
        messages from the peer.  The hold-time is typically
        set to 3x the keepalive-interval.";
      reference
        "RFC 4271 - A Border Gateway Protocol 4, Sec. 10";
    }

    leaf keepalive-interval {
      type decimal64 {
        fraction-digits 2;
      }
      default 30;
      description
        "Time interval in seconds between transmission of keepalive
        messages to the neighbor.  Typically set to 1/3 the
        hold-time.";
    }

    leaf minimum-advertisement-interval {
      type decimal64 {
        fraction-digits 2;
      }
      default 30;
      description
        "Minimum time which must elapse between subsequent UPDATE
        messages relating to a common set of NLRI being transmitted
        to a peer. This timer is referred to as
        MinRouteAdvertisementIntervalTimer by RFC 4721 and serves to
        reduce the number of UPDATE messages transmitted when a
        particular set of NLRI exhibit instability.";
      reference
        "RFC 4271 - A Border Gateway Protocol 4, Sec 9.2.1.1";
    }
  }

  grouping bgp-common-neighbor-group-config {
    description
      "Neighbor level configuration items.";

    leaf peer-as {
      type oc-inet:as-number;
      description
        "AS number of the peer.";
    }

    leaf local-as {
      type oc-inet:as-number;
      description
        "The local autonomous system number that is to be used
        when establishing sessions with the remote peer or peer
        group, if this differs from the global BGP router
        autonomous system number.";
    }

    leaf peer-type {
        type oc-bgp-types:peer-type;
        description
          "Explicitly designate the peer or peer group as internal
          (iBGP) or external (eBGP).";
    }

    leaf auth-password {
      type oc-types:routing-password;
      description
        "Configures an MD5 authentication password for use with
        neighboring devices.";
    }

    leaf remove-private-as {
      // could also make this a container with a flag to enable
      // remove-private and separate option.  here, option implies
      // remove-private is enabled.
      type oc-bgp-types:remove-private-as-option;
      description
        "Remove private AS numbers from updates sent to peers - when
        this leaf is not specified, the AS_PATH attribute should be
        sent to the peer unchanged";
    }

    leaf route-flap-damping {
      type boolean;
      default false;
      description
        "Enable route flap damping.";
    }

    leaf send-community {
      type oc-bgp-types:community-type;
      default "NONE";
      description
        "Specify which types of community should be sent to the
        neighbor or group. The default is to not send the
        community attribute";
    }

    leaf description {
      type string;
      description
        "An optional textual description (intended primarily for use
        with a peer or group";
    }
  }

  grouping bgp-common-neighbor-group-transport-config {
    description
      "Configuration parameters relating to the transport protocol
      used by the BGP session to the peer";

    leaf tcp-mss {
      type uint16;
      description
        "Sets the max segment size for BGP TCP sessions.";
    }

    leaf mtu-discovery {
      type boolean;
      default false;
      description
        "Turns path mtu discovery for BGP TCP sessions on (true)
        or off (false)";
    }

    leaf passive-mode {
      type boolean;
      default false;
      description
        "Wait for peers to issue requests to open a BGP session,
        rather than initiating sessions from the local router.";
    }

    leaf local-address {
      type union {
        type oc-inet:ip-address;
        type string;
      }
      //TODO:  the string should be converted to a leafref type
      //to point to an interface when YANG 1.1 is available with
      //leafrefs in union types.
      description
        "Set the local IP (either IPv4 or IPv6) address to use
        for the session when sending BGP update messages.  This
        may be expressed as either an IP address or reference
        to the name of an interface.";
    }
  }

  grouping bgp-common-neighbor-group-error-handling-config {
    description
      "Configuration parameters relating to enhanced error handling
      behaviours for BGP";

    leaf treat-as-withdraw {
      type boolean;
      default "false";
      description
        "Specify whether erroneous UPDATE messages for which the
        NLRI can be extracted are reated as though the NLRI is
        withdrawn - avoiding session reset";
      reference "draft-ietf-idr-error-handling-16";
    }
  }

  grouping bgp-common-neighbor-group-logging-options-config {
    description
      "Configuration parameters specifying the logging behaviour for
      BGP sessions to the peer";

    leaf log-neighbor-state-changes {
      type boolean;
      default "true";
      description
        "Configure logging of peer state changes.  Default is
        to enable logging of peer state changes.";
    }
  }

  grouping bgp-common-neighbor-group-multihop-config {
    description
      "Configuration parameters specifying the multihop behaviour for
      BGP sessions to the peer";

    leaf enabled {
      type boolean;
      default "false";
      description
        "When enabled the referenced group or neighbors are permitted
        to be indirectly connected - including cases where the TTL
        can be decremented between the BGP peers";
    }

    leaf multihop-ttl {
      type uint8;
      description
        "Time-to-live value to use when packets are sent to the
        referenced group or neighbors and ebgp-multihop is enabled";
    }
  }

  grouping bgp-common-neighbor-group-route-reflector-config {
    description
      "Configuration parameters determining whether the behaviour of
      the local system when acting as a route-reflector";

    leaf route-reflector-cluster-id {
      type oc-bgp-types:rr-cluster-id-type;
      description
        "route-reflector cluster id to use when local router is
        configured as a route reflector.  Commonly set at the group
        level, but allows a different cluster
        id to be set for each neighbor.";
    }

    leaf route-reflector-client {
      type boolean;
      default "false";
      description
        "Configure the neighbor as a route reflector client.";
    }
  }

  grouping bgp-common-neighbor-group-as-path-options-config {
    description
      "Configuration parameters allowing manipulation of the AS_PATH
      attribute";

    leaf allow-own-as {
      type uint8;
      default 0;
      description
        "Specify the number of occurrences of the local BGP speaker's
        AS that can occur within the AS_PATH before it is rejected.";
    }

    leaf replace-peer-as {
      type boolean;
      default "false";
      description
        "Replace occurrences of the peer's AS in the AS_PATH
        with the local autonomous system number";
    }

    leaf disable-peer-as-filter {
      type boolean;
      default "false";
      description
        "When set to true, the system advertises routes to a peer
        even if the peer's AS was in the AS path.  The default
        behavior (false) suppresses advertisements to peers if
        their AS number is in the AS path of the route.";
    }
  }

  grouping bgp-common-neighbor-group-add-paths-config {
    description
      "Configuration parameters specfying whether the local system
      will send or receive multiple paths using ADD_PATHS";

    leaf receive {
      type boolean;
      default false;
      description
        "Enable capability negotiation to receive multiple path
        advertisements for an NLRI from the neighbor or group";
      reference
        "RFC 7911 - Advertisement of Multiple Paths in BGP";
    }

    leaf send {
      type boolean;
      default false;
      description
        "Enable capability negotiation to send multiple path
        advertisements for an NLRI from the neighbor or group";
      reference
        "RFC 7911 - Advertisement of Multiple Paths in BGP";
    }

    leaf send-max {
      type uint8;
      description
        "The maximum total number of paths to advertise to neighbors
        for a single NLRI.  This includes the single best path as
        well as additional paths advertised when add-paths is
        enabled.";
    }

    leaf eligible-prefix-policy {
      type leafref {
        path "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" +
          "oc-rpol:policy-definition/oc-rpol:name";
      }
      description
        "A reference to a routing policy which can be used to
        restrict the prefixes for which add-paths is enabled";
    }
  }

  grouping bgp-common-graceful-restart-config {
    description
      "Configuration parameters relating to BGP graceful restart.";

    leaf enabled {
      type boolean;
      description
        "Enable or disable the graceful-restart capability.";
    }

    leaf restart-time {
      type uint16 {
        range 0..4096;
      }
      description
        "Estimated time (in seconds) for the local BGP speaker to
        restart a session. This value is advertise in the graceful
        restart BGP capability.  This is a 12-bit value, referred to
        as Restart Time in RFC4724.  Per RFC4724, the suggested
        default value is <= the hold-time value.";
    }

    leaf stale-routes-time {
      type decimal64 {
        fraction-digits 2;
      }
      description
        "An upper-bound on the time thate stale routes will be
        retained by a router after a session is restarted. If an
        End-of-RIB (EOR) marker is received prior to this timer
        expiring stale-routes will be flushed upon its receipt - if
        no EOR is received, then when this timer expires stale paths
        will be purged. This timer is referred to as the
        Selection_Deferral_Timer in RFC4724";
    }

    leaf helper-only {
      type boolean;
      description
        "Enable graceful-restart in helper mode only. When this
        leaf is set, the local system does not retain forwarding
        its own state during a restart, but supports procedures
        for the receiving speaker, as defined in RFC4724.";
    }
  }

  grouping bgp-common-use-multiple-paths-config {
    description
      "Generic configuration options relating to use of multiple
      paths for a referenced AFI-SAFI, group or neighbor";

    leaf enabled {
      type boolean;
      default false;
      description
        "Whether the use of multiple paths for the same NLRI is
        enabled for the neighbor. This value is overridden by
        any more specific configuration value.";
    }
  }

  grouping bgp-common-use-multiple-paths-ebgp-as-options-config {
    description
      "Configuration parameters specific to eBGP multipath applicable
      to all contexts";

    leaf allow-multiple-as {
     type boolean;
     default "false";
     description
      "Allow multipath to use paths from different neighbouring
      ASes.  The default is to only consider multiple paths from
      the same neighbouring AS.";
    }
  }

  grouping bgp-common-global-group-use-multiple-paths {
    description
      "Common grouping used for both global and groups which provides
      configuration and state parameters relating to use of multiple
      paths";

    container use-multiple-paths {
      description
        "Parameters related to the use of multiple paths for the
        same NLRI";

      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 parameters for eBGP";
        container config {
          description
            "Configuration parameters relating to eBGP multipath";
          uses bgp-common-use-multiple-paths-ebgp-config;
        }
        container state {
          config false;
          description
            "State information relating to eBGP multipath";
          uses bgp-common-use-multiple-paths-ebgp-config;
        }
      }

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

  grouping bgp-common-use-multiple-paths-ebgp-config {
    description
      "Configuration parameters relating to multipath for eBGP";

    leaf allow-multiple-as {
     type boolean;
     default "false";
     description
      "Allow multipath to use paths from different neighbouring
      ASes.  The default is to only consider multiple paths from
      the same neighbouring AS.";
    }

    leaf maximum-paths {
     type uint32;
     default 1;
     description
      "Maximum number of parallel paths to consider when using
      BGP multipath. The default is use a single path.";
    }
  }

  grouping bgp-common-use-multiple-paths-ibgp-config {
    description
      "Configuration parmaeters relating to multipath for iBGP";

    leaf maximum-paths {
      type uint32;
      default 1;
      description
        "Maximum number of parallel paths to consider when using
        iBGP multipath. The default is to use a single path";
    }
  }

  grouping bgp-common-route-selection-options-config {
    description
      "Set of configuration options that govern best
       path selection.";

    leaf always-compare-med {
      type boolean;
      default "false";
      description
        "Compare multi-exit discriminator (MED) value from
        different ASes when selecting the best route.  The
        default behavior is to only compare MEDs for paths
        received from the same AS.";
    }

    leaf ignore-as-path-length {
      type boolean;
      default "false";
      description
        "Ignore the AS path length when selecting the best path.
        The default is to use the AS path length and prefer paths
        with shorter length.";
    }

    leaf external-compare-router-id {
      type boolean;
      default "true";
      description
        "When comparing similar routes received from external
        BGP peers, use the router-id as a criterion to select
        the active path.";
    }

    leaf advertise-inactive-routes {
      type boolean;
      default "false";
      description
        "Advertise inactive routes to external peers.  The
        default is to only advertise active routes.";
    }

    leaf enable-aigp {
      type boolean;
      default false;
      description
        "Flag to enable sending / receiving accumulated IGP
        attribute in routing updates";
    }

    leaf ignore-next-hop-igp-metric {
      type boolean;
      default "false";
      description
        "Ignore the IGP metric to the next-hop when calculating
        BGP best-path. The default is to select the route for
        which the metric to the next-hop is lowest";
    }
  }

  grouping bgp-common-route-selection-options {
    description
      "Configuration and state relating to route selection options";

    container route-selection-options {
      description
        "Parameters relating to options for route selection";
      container config {
        description
          "Configuration parameters relating to route selection
          options";
        uses bgp-common-route-selection-options-config;
      }
      container state {
        config false;
        description
          "State information for the route selection options";
        uses bgp-common-route-selection-options-config;
      }
    }
  }

  grouping bgp-common-state {
    description
      "Grouping containing common counters relating to prefixes and
      paths";

    leaf total-paths {
      type uint32;
      description
        "Total number of BGP paths within the context";
    }

    leaf total-prefixes {
      type uint32;
      description
        "Total number of BGP prefixes received within the context";
    }
  }


}