blob: 5ebc98b384c45e9e984e200b801a75c2fbf794fe [file] [log] [blame]
Thomas Vachuska6655bee2017-08-24 16:12:59 -07001submodule openconfig-bgp-common {
2
3 belongs-to openconfig-bgp {
4 prefix "oc-bgp";
5 }
6
7 import openconfig-extensions { prefix oc-ext; }
8 import openconfig-bgp-types { prefix oc-bgp-types; }
9 import openconfig-routing-policy { prefix oc-rpol; }
10 import openconfig-types { prefix oc-types; }
11 import openconfig-inet-types { prefix oc-inet; }
12
13 // meta
14 organization
15 "OpenConfig working group";
16
17 contact
18 "OpenConfig working group
19 netopenconfig@googlegroups.com";
20
21 description
22 "This sub-module contains common groupings that are common across
23 multiple contexts within the BGP module. That is to say that they
24 may be application to a subset of global, peer-group or neighbor
25 contexts.";
26
27 oc-ext:openconfig-version "4.0.1";
28
29 revision "2017-07-30" {
30 description
31 "Clarification of add-paths send-max leaf";
32 reference "4.0.1";
33 }
34
35 revision "2017-07-10" {
36 description
37 "Add error notifications; moved add-paths config; add AS
38 prepend policy features; removed unneeded config leaves";
39 reference "4.0.0";
40 }
41
42 revision "2017-02-02" {
43 description
44 "Bugfix to remove remaining global-level policy data";
45 reference "3.0.1";
46 }
47
48 revision "2017-01-26" {
49 description
50 "Add dynamic neighbor support, migrate to OpenConfig types";
51 reference "3.0.0";
52 }
53
54 revision "2016-06-21" {
55 description
56 "OpenConfig BGP refactor";
57 reference "2.1.1";
58 }
59
60 grouping bgp-common-neighbor-group-timers-config {
61 description
62 "Config parameters related to timers associated with the BGP
63 peer";
64
65 leaf connect-retry {
66 type decimal64 {
67 fraction-digits 2;
68 }
69 default 30;
70 description
71 "Time interval in seconds between attempts to establish a
72 session with the peer.";
73 }
74
75 leaf hold-time {
76 type decimal64 {
77 fraction-digits 2;
78 }
79 default 90;
80 description
81 "Time interval in seconds that a BGP session will be
82 considered active in the absence of keepalive or other
83 messages from the peer. The hold-time is typically
84 set to 3x the keepalive-interval.";
85 reference
86 "RFC 4271 - A Border Gateway Protocol 4, Sec. 10";
87 }
88
89 leaf keepalive-interval {
90 type decimal64 {
91 fraction-digits 2;
92 }
93 default 30;
94 description
95 "Time interval in seconds between transmission of keepalive
96 messages to the neighbor. Typically set to 1/3 the
97 hold-time.";
98 }
99
100 leaf minimum-advertisement-interval {
101 type decimal64 {
102 fraction-digits 2;
103 }
104 default 30;
105 description
106 "Minimum time which must elapse between subsequent UPDATE
107 messages relating to a common set of NLRI being transmitted
108 to a peer. This timer is referred to as
109 MinRouteAdvertisementIntervalTimer by RFC 4721 and serves to
110 reduce the number of UPDATE messages transmitted when a
111 particular set of NLRI exhibit instability.";
112 reference
113 "RFC 4271 - A Border Gateway Protocol 4, Sec 9.2.1.1";
114 }
115 }
116
117 grouping bgp-common-neighbor-group-config {
118 description
119 "Neighbor level configuration items.";
120
121 leaf peer-as {
122 type oc-inet:as-number;
123 description
124 "AS number of the peer.";
125 }
126
127 leaf local-as {
128 type oc-inet:as-number;
129 description
130 "The local autonomous system number that is to be used
131 when establishing sessions with the remote peer or peer
132 group, if this differs from the global BGP router
133 autonomous system number.";
134 }
135
136 leaf peer-type {
137 type oc-bgp-types:peer-type;
138 description
139 "Explicitly designate the peer or peer group as internal
140 (iBGP) or external (eBGP).";
141 }
142
143 leaf auth-password {
144 type oc-types:routing-password;
145 description
146 "Configures an MD5 authentication password for use with
147 neighboring devices.";
148 }
149
150 leaf remove-private-as {
151 // could also make this a container with a flag to enable
152 // remove-private and separate option. here, option implies
153 // remove-private is enabled.
154 type oc-bgp-types:remove-private-as-option;
155 description
156 "Remove private AS numbers from updates sent to peers - when
157 this leaf is not specified, the AS_PATH attribute should be
158 sent to the peer unchanged";
159 }
160
161 leaf route-flap-damping {
162 type boolean;
163 default false;
164 description
165 "Enable route flap damping.";
166 }
167
168 leaf send-community {
169 type oc-bgp-types:community-type;
170 default "NONE";
171 description
172 "Specify which types of community should be sent to the
173 neighbor or group. The default is to not send the
174 community attribute";
175 }
176
177 leaf description {
178 type string;
179 description
180 "An optional textual description (intended primarily for use
181 with a peer or group";
182 }
183 }
184
185 grouping bgp-common-neighbor-group-transport-config {
186 description
187 "Configuration parameters relating to the transport protocol
188 used by the BGP session to the peer";
189
190 leaf tcp-mss {
191 type uint16;
192 description
193 "Sets the max segment size for BGP TCP sessions.";
194 }
195
196 leaf mtu-discovery {
197 type boolean;
198 default false;
199 description
200 "Turns path mtu discovery for BGP TCP sessions on (true)
201 or off (false)";
202 }
203
204 leaf passive-mode {
205 type boolean;
206 default false;
207 description
208 "Wait for peers to issue requests to open a BGP session,
209 rather than initiating sessions from the local router.";
210 }
211
212 leaf local-address {
213 type union {
214 type oc-inet:ip-address;
215 type string;
216 }
217 //TODO: the string should be converted to a leafref type
218 //to point to an interface when YANG 1.1 is available with
219 //leafrefs in union types.
220 description
221 "Set the local IP (either IPv4 or IPv6) address to use
222 for the session when sending BGP update messages. This
223 may be expressed as either an IP address or reference
224 to the name of an interface.";
225 }
226 }
227
228 grouping bgp-common-neighbor-group-error-handling-config {
229 description
230 "Configuration parameters relating to enhanced error handling
231 behaviours for BGP";
232
233 leaf treat-as-withdraw {
234 type boolean;
235 default "false";
236 description
237 "Specify whether erroneous UPDATE messages for which the
238 NLRI can be extracted are reated as though the NLRI is
239 withdrawn - avoiding session reset";
240 reference "draft-ietf-idr-error-handling-16";
241 }
242 }
243
244 grouping bgp-common-neighbor-group-logging-options-config {
245 description
246 "Configuration parameters specifying the logging behaviour for
247 BGP sessions to the peer";
248
249 leaf log-neighbor-state-changes {
250 type boolean;
251 default "true";
252 description
253 "Configure logging of peer state changes. Default is
254 to enable logging of peer state changes.";
255 }
256 }
257
258 grouping bgp-common-neighbor-group-multihop-config {
259 description
260 "Configuration parameters specifying the multihop behaviour for
261 BGP sessions to the peer";
262
263 leaf enabled {
264 type boolean;
265 default "false";
266 description
267 "When enabled the referenced group or neighbors are permitted
268 to be indirectly connected - including cases where the TTL
269 can be decremented between the BGP peers";
270 }
271
272 leaf multihop-ttl {
273 type uint8;
274 description
275 "Time-to-live value to use when packets are sent to the
276 referenced group or neighbors and ebgp-multihop is enabled";
277 }
278 }
279
280 grouping bgp-common-neighbor-group-route-reflector-config {
281 description
282 "Configuration parameters determining whether the behaviour of
283 the local system when acting as a route-reflector";
284
285 leaf route-reflector-cluster-id {
286 type oc-bgp-types:rr-cluster-id-type;
287 description
288 "route-reflector cluster id to use when local router is
289 configured as a route reflector. Commonly set at the group
290 level, but allows a different cluster
291 id to be set for each neighbor.";
292 }
293
294 leaf route-reflector-client {
295 type boolean;
296 default "false";
297 description
298 "Configure the neighbor as a route reflector client.";
299 }
300 }
301
302 grouping bgp-common-neighbor-group-as-path-options-config {
303 description
304 "Configuration parameters allowing manipulation of the AS_PATH
305 attribute";
306
307 leaf allow-own-as {
308 type uint8;
309 default 0;
310 description
311 "Specify the number of occurrences of the local BGP speaker's
312 AS that can occur within the AS_PATH before it is rejected.";
313 }
314
315 leaf replace-peer-as {
316 type boolean;
317 default "false";
318 description
319 "Replace occurrences of the peer's AS in the AS_PATH
320 with the local autonomous system number";
321 }
322
323 leaf disable-peer-as-filter {
324 type boolean;
325 default "false";
326 description
327 "When set to true, the system advertises routes to a peer
328 even if the peer's AS was in the AS path. The default
329 behavior (false) suppresses advertisements to peers if
330 their AS number is in the AS path of the route.";
331 }
332 }
333
334 grouping bgp-common-neighbor-group-add-paths-config {
335 description
336 "Configuration parameters specfying whether the local system
337 will send or receive multiple paths using ADD_PATHS";
338
339 leaf receive {
340 type boolean;
341 default false;
342 description
343 "Enable capability negotiation to receive multiple path
344 advertisements for an NLRI from the neighbor or group";
345 reference
346 "RFC 7911 - Advertisement of Multiple Paths in BGP";
347 }
348
349 leaf send {
350 type boolean;
351 default false;
352 description
353 "Enable capability negotiation to send multiple path
354 advertisements for an NLRI from the neighbor or group";
355 reference
356 "RFC 7911 - Advertisement of Multiple Paths in BGP";
357 }
358
359 leaf send-max {
360 type uint8;
361 description
362 "The maximum total number of paths to advertise to neighbors
363 for a single NLRI. This includes the single best path as
364 well as additional paths advertised when add-paths is
365 enabled.";
366 }
367
368 leaf eligible-prefix-policy {
369 type leafref {
370 path "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" +
371 "oc-rpol:policy-definition/oc-rpol:name";
372 }
373 description
374 "A reference to a routing policy which can be used to
375 restrict the prefixes for which add-paths is enabled";
376 }
377 }
378
379 grouping bgp-common-graceful-restart-config {
380 description
381 "Configuration parameters relating to BGP graceful restart.";
382
383 leaf enabled {
384 type boolean;
385 description
386 "Enable or disable the graceful-restart capability.";
387 }
388
389 leaf restart-time {
390 type uint16 {
391 range 0..4096;
392 }
393 description
394 "Estimated time (in seconds) for the local BGP speaker to
395 restart a session. This value is advertise in the graceful
396 restart BGP capability. This is a 12-bit value, referred to
397 as Restart Time in RFC4724. Per RFC4724, the suggested
398 default value is <= the hold-time value.";
399 }
400
401 leaf stale-routes-time {
402 type decimal64 {
403 fraction-digits 2;
404 }
405 description
406 "An upper-bound on the time thate stale routes will be
407 retained by a router after a session is restarted. If an
408 End-of-RIB (EOR) marker is received prior to this timer
409 expiring stale-routes will be flushed upon its receipt - if
410 no EOR is received, then when this timer expires stale paths
411 will be purged. This timer is referred to as the
412 Selection_Deferral_Timer in RFC4724";
413 }
414
415 leaf helper-only {
416 type boolean;
417 description
418 "Enable graceful-restart in helper mode only. When this
419 leaf is set, the local system does not retain forwarding
420 its own state during a restart, but supports procedures
421 for the receiving speaker, as defined in RFC4724.";
422 }
423 }
424
425 grouping bgp-common-use-multiple-paths-config {
426 description
427 "Generic configuration options relating to use of multiple
428 paths for a referenced AFI-SAFI, group or neighbor";
429
430 leaf enabled {
431 type boolean;
432 default false;
433 description
434 "Whether the use of multiple paths for the same NLRI is
435 enabled for the neighbor. This value is overridden by
436 any more specific configuration value.";
437 }
438 }
439
440 grouping bgp-common-use-multiple-paths-ebgp-as-options-config {
441 description
442 "Configuration parameters specific to eBGP multipath applicable
443 to all contexts";
444
445 leaf allow-multiple-as {
446 type boolean;
447 default "false";
448 description
449 "Allow multipath to use paths from different neighbouring
450 ASes. The default is to only consider multiple paths from
451 the same neighbouring AS.";
452 }
453 }
454
455 grouping bgp-common-global-group-use-multiple-paths {
456 description
457 "Common grouping used for both global and groups which provides
458 configuration and state parameters relating to use of multiple
459 paths";
460
461 container use-multiple-paths {
462 description
463 "Parameters related to the use of multiple paths for the
464 same NLRI";
465
466 container config {
467 description
468 "Configuration parameters relating to multipath";
469 uses bgp-common-use-multiple-paths-config;
470 }
471 container state {
472 config false;
473 description
474 "State parameters relating to multipath";
475 uses bgp-common-use-multiple-paths-config;
476 }
477
478 container ebgp {
479 description
480 "Multipath parameters for eBGP";
481 container config {
482 description
483 "Configuration parameters relating to eBGP multipath";
484 uses bgp-common-use-multiple-paths-ebgp-config;
485 }
486 container state {
487 config false;
488 description
489 "State information relating to eBGP multipath";
490 uses bgp-common-use-multiple-paths-ebgp-config;
491 }
492 }
493
494 container ibgp {
495 description
496 "Multipath parameters for iBGP";
497 container config {
498 description
499 "Configuration parameters relating to iBGP multipath";
500 uses bgp-common-use-multiple-paths-ibgp-config;
501 }
502 container state {
503 config false;
504 description
505 "State information relating to iBGP multipath";
506 uses bgp-common-use-multiple-paths-ibgp-config;
507 }
508 }
509 }
510 }
511
512 grouping bgp-common-use-multiple-paths-ebgp-config {
513 description
514 "Configuration parameters relating to multipath for eBGP";
515
516 leaf allow-multiple-as {
517 type boolean;
518 default "false";
519 description
520 "Allow multipath to use paths from different neighbouring
521 ASes. The default is to only consider multiple paths from
522 the same neighbouring AS.";
523 }
524
525 leaf maximum-paths {
526 type uint32;
527 default 1;
528 description
529 "Maximum number of parallel paths to consider when using
530 BGP multipath. The default is use a single path.";
531 }
532 }
533
534 grouping bgp-common-use-multiple-paths-ibgp-config {
535 description
536 "Configuration parmaeters relating to multipath for iBGP";
537
538 leaf maximum-paths {
539 type uint32;
540 default 1;
541 description
542 "Maximum number of parallel paths to consider when using
543 iBGP multipath. The default is to use a single path";
544 }
545 }
546
547 grouping bgp-common-route-selection-options-config {
548 description
549 "Set of configuration options that govern best
550 path selection.";
551
552 leaf always-compare-med {
553 type boolean;
554 default "false";
555 description
556 "Compare multi-exit discriminator (MED) value from
557 different ASes when selecting the best route. The
558 default behavior is to only compare MEDs for paths
559 received from the same AS.";
560 }
561
562 leaf ignore-as-path-length {
563 type boolean;
564 default "false";
565 description
566 "Ignore the AS path length when selecting the best path.
567 The default is to use the AS path length and prefer paths
568 with shorter length.";
569 }
570
571 leaf external-compare-router-id {
572 type boolean;
573 default "true";
574 description
575 "When comparing similar routes received from external
576 BGP peers, use the router-id as a criterion to select
577 the active path.";
578 }
579
580 leaf advertise-inactive-routes {
581 type boolean;
582 default "false";
583 description
584 "Advertise inactive routes to external peers. The
585 default is to only advertise active routes.";
586 }
587
588 leaf enable-aigp {
589 type boolean;
590 default false;
591 description
592 "Flag to enable sending / receiving accumulated IGP
593 attribute in routing updates";
594 }
595
596 leaf ignore-next-hop-igp-metric {
597 type boolean;
598 default "false";
599 description
600 "Ignore the IGP metric to the next-hop when calculating
601 BGP best-path. The default is to select the route for
602 which the metric to the next-hop is lowest";
603 }
604 }
605
606 grouping bgp-common-route-selection-options {
607 description
608 "Configuration and state relating to route selection options";
609
610 container route-selection-options {
611 description
612 "Parameters relating to options for route selection";
613 container config {
614 description
615 "Configuration parameters relating to route selection
616 options";
617 uses bgp-common-route-selection-options-config;
618 }
619 container state {
620 config false;
621 description
622 "State information for the route selection options";
623 uses bgp-common-route-selection-options-config;
624 }
625 }
626 }
627
628 grouping bgp-common-state {
629 description
630 "Grouping containing common counters relating to prefixes and
631 paths";
632
633 leaf total-paths {
634 type uint32;
635 description
636 "Total number of BGP paths within the context";
637 }
638
639 leaf total-prefixes {
640 type uint32;
641 description
642 "Total number of BGP prefixes received within the context";
643 }
644 }
645
646
647}
648