blob: f88dc4e020df49438889ef77a74eafc494e06ed2 [file] [log] [blame]
Thomas Vachuska8ca75a22017-08-24 16:12:59 -07001submodule openconfig-bgp-neighbor {
2
3 belongs-to openconfig-bgp {
4 prefix "oc-bgp";
5 }
6
7 import openconfig-extensions { prefix oc-ext; }
8 import openconfig-routing-policy { prefix oc-rpol; }
9 import openconfig-types { prefix oc-types; }
10 import openconfig-bgp-types { prefix oc-bgp-types; }
11 import openconfig-inet-types { prefix oc-inet; }
12 import openconfig-yang-types { prefix oc-yang; }
13
14 // Include the common submodule
15 include openconfig-bgp-common;
16 include openconfig-bgp-common-multiprotocol;
17 include openconfig-bgp-peer-group;
18 include openconfig-bgp-common-structure;
19
20 // meta
21 organization
22 "OpenConfig working group";
23
24 contact
25 "OpenConfig working group
26 netopenconfig@googlegroups.com";
27
28 description
29 "This sub-module contains groupings that are specific to the
30 neighbor context of the OpenConfig BGP module.";
31
32 oc-ext:openconfig-version "4.0.1";
33
34 revision "2017-07-30" {
35 description
36 "Clarification of add-paths send-max leaf";
37 reference "4.0.1";
38 }
39
40 revision "2017-07-10" {
41 description
42 "Add error notifications; moved add-paths config; add AS
43 prepend policy features; removed unneeded config leaves";
44 reference "4.0.0";
45 }
46
47 revision "2017-02-02" {
48 description
49 "Bugfix to remove remaining global-level policy data";
50 reference "3.0.1";
51 }
52
53 revision "2017-01-26" {
54 description
55 "Add dynamic neighbor support, migrate to OpenConfig types";
56 reference "3.0.0";
57 }
58
59 revision "2016-06-21" {
60 description
61 "OpenConfig BGP refactor";
62 reference "2.1.1";
63 }
64
65 grouping bgp-neighbor-config {
66 description
67 "Configuration parameters relating to a base BGP neighbor that
68 are not also applicable to any other context
69 (e.g., peer group)";
70
71 leaf peer-group {
72 type leafref {
73 path "../../../../peer-groups/peer-group/peer-group-name";
74 }
75 description
76 "The peer-group with which this neighbor is associated";
77 }
78
79 leaf neighbor-address {
80 type oc-inet:ip-address;
81 description
82 "Address of the BGP peer, either in IPv4 or IPv6";
83 }
84
85 leaf enabled {
86 type boolean;
87 default true;
88 description
89 "Whether the BGP peer is enabled. In cases where the
90 enabled leaf is set to false, the local system should not
91 initiate connections to the neighbor, and should not
92 respond to TCP connections attempts from the neighbor. If
93 the state of the BGP session is ESTABLISHED at the time
94 that this leaf is set to false, the BGP session should be
95 ceased.";
96 }
97 }
98
99 grouping bgp-neighbor-use-multiple-paths {
100 description
101 "Multipath configuration and state applicable to a BGP
102 neighbor";
103
104 container use-multiple-paths {
105 description
106 "Parameters related to the use of multiple-paths for the same
107 NLRI when they are received only from this neighbor";
108
109 container config {
110 description
111 "Configuration parameters relating to multipath";
112 uses bgp-common-use-multiple-paths-config;
113 }
114 container state {
115 config false;
116 description
117 "State parameters relating to multipath";
118 uses bgp-common-use-multiple-paths-config;
119 }
120
121 container ebgp {
122 description
123 "Multipath configuration for eBGP";
124 container config {
125 description
126 "Configuration parameters relating to eBGP multipath";
127 uses bgp-common-use-multiple-paths-ebgp-as-options-config;
128 }
129 container state {
130 config false;
131 description
132 "State information relating to eBGP multipath";
133 uses bgp-common-use-multiple-paths-ebgp-as-options-config;
134 }
135 }
136 }
137 }
138
139 grouping bgp-neighbor-state {
140 description
141 "Operational state parameters relating only to a BGP neighbor";
142
143 leaf session-state {
144 type enumeration {
145 enum IDLE {
146 description
147 "neighbor is down, and in the Idle state of the
148 FSM";
149 }
150 enum CONNECT {
151 description
152 "neighbor is down, and the session is waiting for
153 the underlying transport session to be established";
154 }
155 enum ACTIVE {
156 description
157 "neighbor is down, and the local system is awaiting
158 a conncetion from the remote peer";
159 }
160 enum OPENSENT {
161 description
162 "neighbor is in the process of being established.
163 The local system has sent an OPEN message";
164 }
165 enum OPENCONFIRM {
166 description
167 "neighbor is in the process of being established.
168 The local system is awaiting a NOTIFICATION or
169 KEEPALIVE message";
170 }
171 enum ESTABLISHED {
172 description
173 "neighbor is up - the BGP session with the peer is
174 established";
175 }
176 }
177 description
178 "Operational state of the BGP peer";
179 }
180
181 leaf last-established {
182 type oc-types:timeticks64;
183 description
184 "This timestamp indicates the time that the
185 BGP session last transitioned in or out of the Established
186 state. The value is the timestamp in seconds relative to
187 the Unix Epoch (Jan 1, 1970 00:00:00 UTC).
188
189 The BGP session uptime can be computed by clients as the
190 difference between this value and the current time in UTC
191 (assuming the session is in the ESTABLISHED state, per the
192 session-state leaf).";
193 }
194
195 leaf established-transitions {
196 type oc-yang:counter64;
197 description
198 "Number of transitions to the Established state for
199 the neighbor session. This value is analogous to the
200 bgpPeerFsmEstablishedTransitions object from the standard
201 BGP-4 MIB";
202 reference
203 "RFC 4273 - Definitions of Managed Objects for BGP-4";
204 }
205
206 leaf-list supported-capabilities {
207 type identityref {
208 base oc-bgp-types:BGP_CAPABILITY;
209 }
210 description
211 "BGP capabilities negotiated as supported with the peer";
212 }
213
214 container messages {
215 description
216 "Counters for BGP messages sent and received from the
217 neighbor";
218 container sent {
219 description
220 "Counters relating to BGP messages sent to the neighbor";
221 uses bgp-neighbor-counters-message-types-state;
222 }
223
224 container received {
225 description
226 "Counters for BGP messages received from the neighbor";
227 uses bgp-neighbor-counters-message-types-state;
228 }
229 }
230
231 container queues {
232 description
233 "Counters related to queued messages associated with the
234 BGP neighbor";
235 uses bgp-neighbor-queue-counters-state;
236 }
237
238 leaf dynamically-configured {
239 type boolean;
240 default false;
241 description
242 "When this leaf is set to true, the peer was configured dynamically
243 due to an inbound connection request from a specified source prefix
244 within a dynamic-neighbor-prefix.";
245 }
246 }
247
248 grouping bgp-neighbor-counters-message-types-state {
249 description
250 "Grouping of BGP message types, included for re-use
251 across counters";
252
253 leaf UPDATE {
254 type uint64;
255 description
256 "Number of BGP UPDATE messages announcing, withdrawing
257 or modifying paths exchanged.";
258 }
259
260 leaf NOTIFICATION {
261 type uint64;
262 description
263 "Number of BGP NOTIFICATION messages indicating an
264 error condition has occurred exchanged.";
265 }
266
267 leaf last-notification-time {
268 type oc-types:timeticks64;
269 description
270 "This timestamp indicates the time that a NOTIFICATION
271 message was sent or received on the peering session
272 (based on whether this leaf is associated with
273 sent or received messages).
274
275 The value is the timestamp in seconds relative to
276 the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
277 }
278
279 leaf last-notification-error-code {
280 type identityref {
281 base oc-bgp-types:BGP_ERROR_CODE;
282 }
283 description
284 "Indicates the last BGP error sent or received on the peering
285 session (based on whether this leaf is associated with
286 sent or received messages).";
287 }
288
289 leaf last-notification-error-subcode {
290 type identityref {
291 base oc-bgp-types:BGP_ERROR_SUBCODE;
292 }
293 description
294 "Indicates the last BGP error subcode sent or received on
295 the peering session (based on whether this leaf is associated
296 with sent or received messages)";
297 }
298 }
299
300 grouping bgp-neighbor-queue-counters-state {
301 description
302 "Counters relating to the message queues associated with the
303 BGP peer";
304
305 leaf input {
306 type uint32;
307 description
308 "The number of messages received from the peer currently
309 queued";
310 }
311
312 leaf output {
313 type uint32;
314 description
315 "The number of messages queued to be sent to the peer";
316 }
317 }
318
319 grouping bgp-neighbor-transport-state {
320 description
321 "Operational state parameters relating to the transport session
322 used for the BGP session";
323
324 leaf local-port {
325 type oc-inet:port-number;
326 description
327 "Local TCP port being used for the TCP session supporting
328 the BGP session";
329 }
330
331 leaf remote-address {
332 type oc-inet:ip-address;
333 description
334 "Remote address to which the BGP session has been
335 established";
336 }
337
338 leaf remote-port {
339 type oc-inet:port-number;
340 description
341 "Remote port being used by the peer for the TCP session
342 supporting the BGP session";
343 }
344 }
345
346 grouping bgp-neighbor-error-handling-state {
347 description
348 "Operational state parameters relating to enhanced error
349 error handling for BGP";
350
351 leaf erroneous-update-messages {
352 type uint32;
353 description
354 "The number of BGP UPDATE messages for which the
355 treat-as-withdraw mechanism has been applied based
356 on erroneous message contents";
357 }
358 }
359
360 grouping bgp-neighbor-timers-state {
361 description
362 "Operational state parameters relating to BGP timers associated
363 with the BGP session";
364
365 leaf negotiated-hold-time {
366 type decimal64 {
367 fraction-digits 2;
368 }
369 description
370 "The negotiated hold-time for the BGP session";
371 }
372 }
373
374 grouping bgp-neighbor-afi-safi-graceful-restart-state {
375 description
376 "Operational state variables relating to the graceful-restart
377 mechanism on a per-AFI-SAFI basis";
378
379 leaf received {
380 type boolean;
381 description
382 "This leaf indicates whether the neighbor advertised the
383 ability to support graceful-restart for this AFI-SAFI";
384 }
385
386 leaf advertised {
387 type boolean;
388 description
389 "This leaf indicates whether the ability to support
390 graceful-restart has been advertised to the peer";
391 }
392 }
393
394 grouping bgp-neighbor-graceful-restart-state {
395 description
396 "Operational state information relevant to graceful restart
397 for BGP";
398
399 leaf peer-restart-time {
400 type uint16 {
401 range 0..4096;
402 }
403 description
404 "The period of time (advertised by the peer) that
405 the peer expects a restart of a BGP session to
406 take";
407 }
408
409 leaf peer-restarting {
410 type boolean;
411 description
412 "This flag indicates whether the remote neighbor is currently
413 in the process of restarting, and hence received routes are
414 currently stale";
415 }
416
417 leaf local-restarting {
418 type boolean;
419 description
420 "This flag indicates whether the local neighbor is currently
421 restarting. The flag is unset after all NLRI have been
422 advertised to the peer, and the End-of-RIB (EOR) marker has
423 been unset";
424 }
425
426 leaf mode {
427 type enumeration {
428 enum HELPER_ONLY {
429 description
430 "The local router is operating in helper-only mode, and
431 hence will not retain forwarding state during a local
432 session restart, but will do so during a restart of the
433 remote peer";
434 }
435 enum BILATERAL {
436 description
437 "The local router is operating in both helper mode, and
438 hence retains forwarding state during a remote restart,
439 and also maintains forwarding state during local session
440 restart";
441 }
442 enum REMOTE_HELPER {
443 description
444 "The local system is able to retain routes during restart
445 but the remote system is only able to act as a helper";
446 }
447 }
448 description
449 "Ths leaf indicates the mode of operation of BGP graceful
450 restart with the peer";
451 }
452 }
453
454 grouping bgp-neighbor-afi-safi-state {
455 description
456 "Operational state parameters relating to an individual AFI,
457 SAFI for a neighbor";
458
459 leaf active {
460 type boolean;
461 description
462 "This value indicates whether a particular AFI-SAFI has
463 been succesfully negotiated with the peer. An AFI-SAFI
464 may be enabled in the current running configuration, but a
465 session restart may be required in order to negotiate the new
466 capability.";
467 }
468
469 container prefixes {
470 description "Prefix counters for the BGP session";
471 leaf received {
472 type uint32;
473 description
474 "The number of prefixes received from the neighbor";
475 }
476
477 leaf sent {
478 type uint32;
479 description
480 "The number of prefixes advertised to the neighbor";
481 }
482
483 leaf installed {
484 type uint32;
485 description
486 "The number of advertised prefixes installed in the
487 Loc-RIB";
488 }
489 }
490 }
491
492 grouping bgp-neighbor-afi-safi-list {
493 description
494 "List of address-families associated with the BGP neighbor";
495
496 list afi-safi {
497 key "afi-safi-name";
498
499 description
500 "AFI,SAFI configuration available for the
501 neighbour or group";
502
503
504 leaf afi-safi-name {
505 type leafref {
506 path "../config/afi-safi-name";
507 }
508 description
509 "Reference to the AFI-SAFI name used as a key
510 for the AFI-SAFI list";
511 }
512
513 container config {
514 description
515 "Configuration parameters for the AFI-SAFI";
516 uses bgp-common-mp-afi-safi-config;
517 }
518 container state {
519 config false;
520 description
521 "State information relating to the AFI-SAFI";
522 uses bgp-common-mp-afi-safi-config;
523 uses bgp-neighbor-afi-safi-state;
524 }
525
526
527 container graceful-restart {
528 description
529 "Parameters relating to BGP graceful-restart";
530 container config {
531 description
532 "Configuration options for BGP graceful-restart";
533 uses bgp-common-mp-afi-safi-graceful-restart-config;
534 }
535 container state {
536 config false;
537 description
538 "State information for BGP graceful-restart";
539 uses bgp-common-mp-afi-safi-graceful-restart-config;
540 uses bgp-neighbor-afi-safi-graceful-restart-state;
541 }
542 }
543
544 uses bgp-common-structure-neighbor-group-add-paths;
545 uses bgp-common-mp-all-afi-safi-list-contents;
546 uses bgp-neighbor-use-multiple-paths;
547 }
548 }
549
550 grouping bgp-neighbor-base {
551 description
552 "Parameters related to a BGP neighbor";
553
554 container config {
555 description
556 "Configuration parameters relating to the BGP neighbor or
557 group";
558 uses bgp-neighbor-config;
559 uses bgp-common-neighbor-group-config;
560 }
561 container state {
562 config false;
563 description
564 "State information relating to the BGP neighbor";
565 uses bgp-neighbor-config;
566 uses bgp-common-neighbor-group-config;
567 uses bgp-neighbor-state;
568 }
569
570 container timers {
571 description
572 "Timers related to a BGP neighbor";
573 container config {
574 description
575 "Configuration parameters relating to timers used for the
576 BGP neighbor";
577 uses bgp-common-neighbor-group-timers-config;
578 }
579 container state {
580 config false;
581 description
582 "State information relating to the timers used for the BGP
583 neighbor";
584 uses bgp-common-neighbor-group-timers-config;
585 uses bgp-neighbor-timers-state;
586 }
587 }
588
589 container transport {
590 description
591 "Transport session parameters for the BGP neighbor";
592 container config {
593 description
594 "Configuration parameters relating to the transport
595 session(s) used for the BGP neighbor";
596 uses bgp-common-neighbor-group-transport-config;
597 }
598 container state {
599 config false;
600 description
601 "State information relating to the transport session(s)
602 used for the BGP neighbor";
603 uses bgp-common-neighbor-group-transport-config;
604 uses bgp-neighbor-transport-state;
605 }
606 }
607
608 container error-handling {
609 description
610 "Error handling parameters used for the BGP neighbor or
611 group";
612 container config {
613 description
614 "Configuration parameters enabling or modifying the
615 behavior or enhanced error handling mechanisms for the BGP
616 neighbor";
617 uses bgp-common-neighbor-group-error-handling-config;
618 }
619 container state {
620 config false;
621 description
622 "State information relating to enhanced error handling
623 mechanisms for the BGP neighbor";
624 uses bgp-common-neighbor-group-error-handling-config;
625 uses bgp-neighbor-error-handling-state;
626 }
627 }
628
629 container graceful-restart {
630 description
631 "Parameters relating the graceful restart mechanism for BGP";
632 container config {
633 description
634 "Configuration parameters relating to graceful-restart";
635 uses bgp-common-graceful-restart-config;
636 }
637 container state {
638 config false;
639 description
640 "State information associated with graceful-restart";
641 uses bgp-common-graceful-restart-config;
642 uses bgp-neighbor-graceful-restart-state;
643 }
644 }
645
646 uses bgp-common-structure-neighbor-group-logging-options;
647 uses bgp-common-structure-neighbor-group-ebgp-multihop;
648 uses bgp-common-structure-neighbor-group-route-reflector;
649 uses bgp-common-structure-neighbor-group-as-path-options;
650 uses bgp-neighbor-use-multiple-paths;
651 uses oc-rpol:apply-policy-group;
652
653 container afi-safis {
654 description
655 "Per-address-family configuration parameters associated with
656 the neighbor";
657 uses bgp-neighbor-afi-safi-list;
658 }
659 }
660
661 grouping bgp-neighbor-list {
662 description
663 "The list of BGP neighbors";
664
665 list neighbor {
666 key "neighbor-address";
667 description
668 "List of BGP neighbors configured on the local system,
669 uniquely identified by peer IPv[46] address";
670
671 leaf neighbor-address {
672 type leafref {
673 path "../config/neighbor-address";
674 }
675 description
676 "Reference to the address of the BGP neighbor used as
677 a key in the neighbor list";
678 }
679
680 uses bgp-neighbor-base;
681 }
682
683 }
684
685
686}