1 // vi: set smarttab et sw=4 tabstop=4:
2 module odl-bgp-rib-impl-cfg {
4 namespace "urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl";
7 import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-19; }
8 import bgp-rib { prefix rib; revision-date 2013-09-25; }
9 import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
10 import odl-bgp-rib-cfg { prefix bgprib; revision-date 2013-07-01; }
11 import odl-bgp-parser-spi-cfg { prefix bgpspi; revision-date 2013-11-15; }
12 import odl-bgp-rib-spi-cfg { prefix ribspi; revision-date 2013-11-15; }
13 import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
14 import opendaylight-md-sal-binding {prefix mdsb; revision-date 2013-10-28; }
15 import opendaylight-md-sal-dom {prefix sal; revision-date 2013-10-28; }
16 import netty { prefix netty; revision-date 2013-11-19; }
17 import config { prefix config; revision-date 2013-04-05; }
18 import odl-tcpmd5-cfg { prefix tcpmd5; revision-date 2014-04-27; }
19 import odl-tcpmd5-netty-cfg { prefix tcpmd5n; revision-date 2014-04-27; }
20 import rpc-context { prefix rpcx; revision-date 2013-06-17; }
21 import odl-bgp-openconfig-spi-cfg { prefix bgp-oc-spi; revision-date 2015-09-25; }
22 import odl-bgp-path-selection-mode { prefix bps; revision-date 2016-03-01;}
24 organization "Cisco Systems, Inc.";
26 contact "Robert Varga <rovarga@cisco.com>";
29 "This module contains the base YANG definitions for
30 BGP listener implementation.
32 Copyright (c)2013 Cisco Systems, Inc. All rights reserved.;
34 This program and the accompanying materials are made available
35 under the terms of the Eclipse Public License v1.0 which
36 accompanies this distribution, and is available at
37 http://www.eclipse.org/legal/epl-v10.html";
39 revision "2016-03-30" {
41 "Updated to simplify reconnection strategy.";
43 revision "2013-04-09" {
48 identity base-bgp-parser {
49 base config:module-type;
50 config:java-name-prefix BaseBGPParser;
51 config:provided-service bgpspi:extension;
54 augment "/config:modules/config:module/config:configuration" {
55 case base-bgp-parser {
56 when "/config:modules/config:module/config:type = 'base-bgp-parser'";
60 identity bgp-dispatcher {
62 "Service representing a BGP Dispatcher.";
64 base "config:service-type";
65 config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher";
68 identity bgp-dispatcher-impl {
69 base config:module-type;
70 config:provided-service bgp-dispatcher;
71 config:java-name-prefix BGPDispatcherImpl;
74 augment "/config:modules/config:module/config:configuration" {
75 case bgp-dispatcher-impl {
76 when "/config:modules/config:module/config:type = 'bgp-dispatcher-impl'";
78 container bgp-extensions {
79 uses config:service-ref {
82 config:required-identity bgpspi:consumer-extensions;
87 container boss-group {
88 uses config:service-ref {
91 config:required-identity netty:netty-threadgroup;
96 container worker-group {
97 uses config:service-ref {
100 config:required-identity netty:netty-threadgroup;
105 container md5-channel-factory {
106 uses config:service-ref {
109 config:required-identity tcpmd5n:md5-channel-factory;
114 container md5-server-channel-factory {
115 uses config:service-ref {
118 config:required-identity tcpmd5n:md5-server-channel-factory;
125 identity base-bgp-rib {
126 base config:module-type;
127 config:provided-service ribspi:extension;
128 config:java-name-prefix BaseBGPRIB;
131 augment "/config:modules/config:module/config:configuration" {
133 when "/config:modules/config:module/config:type = 'base-bgp-rib'";
137 identity rib-instance {
139 "Service representing a RIB instance";
141 base "config:service-type";
142 config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.RIB";
145 identity bgp-peer-registry {
147 "Registry of BGP peers. Every new BGP in/out connection looks for peers to handle bgp messages in this registry";
149 base "config:service-type";
150 config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry";
153 identity strict-bgp-peer-registry {
155 "Registry of BGP peers that allows only one connection per 2 peers. Uses IP address for Peer identification and BGP Ids to resolve duplicate connections";
157 config:provided-service bgp-peer-registry;
158 base config:module-type;
159 config:java-name-prefix StrictBgpPeerRegistry;
163 augment "/config:modules/config:module/config:configuration" {
164 case strict-bgp-peer-registry {
165 when "/config:modules/config:module/config:type = 'strict-bgp-peer-registry'";
171 "BGP peer instance.";
173 base config:module-type;
174 config:java-name-prefix BGPPeer;
177 identity bgp-peer-acceptor {
179 "BGP peer acceptor that handles incoming bgp connections. Uses BGP peer registry to accept or decline incoming connections";
181 base config:module-type;
182 config:java-name-prefix BGPPeerAcceptor;
185 augment "/config:modules/config:module/config:configuration" {
186 case bgp-peer-acceptor {
187 when "/config:modules/config:module/config:type = 'bgp-peer-acceptor'";
189 leaf binding-address {
190 description "IP address to bind to";
191 type inet:ip-address;
196 description "Port to bind to";
197 type inet:port-number;
201 container accepting-bgp-dispatcher {
202 uses config:service-ref {
205 config:required-identity bgp-dispatcher;
210 container accepting-peer-registry {
211 uses config:service-ref {
214 config:required-identity bgp-peer-registry;
221 identity bgp-application-peer {
223 "Application peer handler which handles translation from custom RIB into local RIB";
225 base config:module-type;
226 config:java-name-prefix BGPApplicationPeer;
229 augment "/config:modules/config:module/config:configuration" {
230 case bgp-application-peer {
231 when "/config:modules/config:module/config:type = 'bgp-application-peer'";
233 container data-broker {
234 uses config:service-ref {
237 config:required-identity sal:dom-async-data-broker;
242 container target-rib {
243 uses config:service-ref {
246 config:required-identity rib-instance;
251 container peer-registry {
252 description "BGP peer registry where current instance of BGP peer will be registered.";
253 uses config:service-ref {
255 // FIXME backwards compatibility. If not configured, GLOBAL instance is used
257 config:required-identity bgp-peer-registry;
262 leaf application-rib-id {
263 type rib:application-rib-id;
268 type inet:ipv4-address;
274 identity bgp-table-type {
276 "Service representing a AFI/SAFI pair";
278 base "config:service-type";
279 config:java-class "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType";
283 base "config:service-type";
284 config:java-class "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.mp.capabilities.add.path.capability.AddressFamilies";
287 identity add-path-impl {
288 config:provided-service add-path;
289 base config:module-type;
290 config:java-name-prefix AddPathImpl;
293 identity bgp-table-type-impl {
295 "Simple provider for bgp-table-type.";
297 config:provided-service bgp-table-type;
298 base config:module-type;
299 config:java-name-prefix BGPTableTypeImpl;
302 augment "/config:modules/config:module/config:configuration" {
303 case bgp-table-type-impl {
304 when "/config:modules/config:module/config:type = 'bgp-table-type-impl'";
308 base bgp-t:address-family;
314 base bgp-t:subsequent-address-family;
321 augment "/config:modules/config:module/config:configuration" {
323 when "/config:modules/config:module/config:type = 'add-path-impl'";
324 container address-family {
325 uses config:service-ref {
328 config:required-identity bgp-table-type;
333 type bgp-mp:send-receive;
339 augment "/config:modules/config:module/config:configuration" {
341 when "/config:modules/config:module/config:type = 'bgp-peer'";
344 description "Remote host IP address";
345 type inet:ip-address;
350 description "Remote host port";
351 type inet:port-number;
370 leaf initiate-connection {
371 description "If true, connection will be initiated right away from current device.
372 If not, the peer will only be registered to peer registry and available for incomming bgp connections.";
377 list advertized-table {
379 uses config:service-ref {
382 config:required-identity bgp-table-type;
389 uses config:service-ref {
391 config:required-identity add-path;
403 "Expected remote AS number. If not present, it is assumed
404 to be the same as our local AS number.";
409 type tcpmd5:rfc2385-key;
410 description "RFC2385 shared secret";
414 uses config:service-ref {
417 config:required-identity rib-instance;
422 container peer-registry {
423 description "BGP peer registry where current instance of BGP peer will be registered.";
424 uses config:service-ref {
426 // FIXME backwards compatibility. If not configured, GLOBAL instance is used
428 config:required-identity bgp-peer-registry;
435 grouping message-state {
437 description "Total number of BGP messages.";
443 description "The BGP message timestamp (seconds).";
449 grouping message-stats {
451 description "The received BGP messages statistics.";
456 description "The sent BGP messages statistics.";
463 description "The BGP error code.";
469 description "The BGP error sub-code.";
477 description "Address Family Identifier.";
482 description "Subsequent Address Family Identifier.";
488 grouping preferences {
490 description "The BGP Identifier.";
496 description "The IP address of BGP connection.";
502 description "The port for connection between the BGP peers.";
508 description "Autonomous system number.";
514 description "Time interval (in seconds) for HoldTimer proposed by the peer.";
519 leaf four-octet-as-capability {
520 description "The BGP peer 4 byte AS numbers support capability.";
525 leaf bgp-extended-message-capability {
526 description "The bgp extended message support capability.";
532 description "BGP graceful restart support capability.";
537 leaf add-path-capability {
542 leaf route-refresh-capability {
543 reference "https://tools.ietf.org/html/rfc2918";
548 list advertized-table-types {
549 description "The BGP Table-type capabilities advertized by the BGP peer.";
553 list advertised-add-path-table-types {
554 description "The BGP Table-type capabilities advertized by the BGP peer.";
557 description "Send Receive Add Path Configuration.";
566 augment "/config:modules/config:module/config:state" {
568 when "/config:modules/config:module/config:type = 'bgp-peer'";
570 rpcx:rpc-context-instance "peer-rpc";
572 container bgp-peer-state {
576 description "The table name - composed of AFI and SAFI.";
581 description "The total number of routes in table.";
587 leaf session-established-count {
588 description "The total number of time the BGP session was transitioned to Up state.";
594 container bgp-session-state {
597 description "The BGP peer connection state.";
601 leaf session-duration {
602 description "The session duration (time formated d:HH:mm:ss).";
606 leaf holdtime-current {
607 description "Time interval (in seconds) for HoldTimer established with the peer.";
612 leaf keepalive-current {
613 description "Time interval (in seconds) for KeepAlive established with the peer.";
618 container speaker-preferences {
619 description "The BGP speaker preferences, to which this BGP peer is connected.";
623 container peer-preferences {
624 description "The BGP peer preferences.";
628 container messages-stats {
629 description "The BGP messages statistics.";
630 container total-msgs {
631 description "The statistics for all received/sent BGP messages.";
635 container keep-alive-msgs {
636 description "The statistics for received/sent BGP Keep-Alive messages.";
640 container update-msgs {
641 description "The statistics for received/sent BGP Update messages.";
645 container route-refresh-msgs {
646 description "The statistics for received/sent BGP Route Refresh messages.";
650 container error-msgs {
651 container error-received {
652 description "The received BGP Error (notification) messages statistics.";
657 container error-sent {
658 description "The sent BGP Error (notification) messages statistics.";
669 description "Restart the session between BGP peers";
671 uses rpcx:rpc-context-ref {
672 refine context-instance {
673 rpcx:rpc-context-instance peer-rpc;
680 description "Reset the BGP peer statistics.";
682 uses rpcx:rpc-context-ref {
683 refine context-instance {
684 rpcx:rpc-context-instance peer-rpc;
690 identity bgp-path-selection-mode {
692 "Service representing an address family + path selection mode.";
694 base "config:service-type";
695 config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPBestPathSelection";
698 identity bgp-psm-impl {
699 base config:module-type;
700 config:provided-service bgp-path-selection-mode;
701 config:java-name-prefix BGPPSMImpl;
704 augment "/config:modules/config:module/config:configuration" {
706 when "/config:modules/config:module/config:type = 'bgp-psm-impl'";
707 container path-address-family {
708 uses config:service-ref {
711 config:required-identity bgp-table-type;
715 container path-selection-mode {
716 uses config:service-ref {
719 config:required-identity bps:path-selection-mode-factory;
727 base config:module-type;
728 config:provided-service bgprib:rib;
729 config:provided-service rib-instance;
730 config:java-name-prefix RIBImpl;
733 augment "/config:modules/config:module/config:configuration" {
735 when "/config:modules/config:module/config:type = 'rib-impl'";
737 container extensions {
738 uses config:service-ref {
741 config:required-identity ribspi:consumer-extensions;
746 container bgp-dispatcher {
747 uses config:service-ref {
750 config:required-identity bgp-dispatcher;
755 container data-provider {
756 uses config:service-ref {
759 config:required-identity mdsb:binding-async-data-broker;
764 container codec-tree-factory {
765 uses config:service-ref {
768 config:required-identity mdsb:binding-codec-tree-factory;
773 container dom-data-provider {
774 uses config:service-ref {
777 config:required-identity sal:dom-async-data-broker;
782 container openconfig-provider {
783 uses config:service-ref {
786 config:required-identity bgp-oc-spi:bgp-openconfig-provider;
792 description "Our local AS number. Needed by best selection path attribute.";
798 description "Our local BGP identifier. Needed by best selection path attribute.";
800 type inet:ipv4-address;
804 uses config:service-ref {
807 config:required-identity bgp-table-type;
813 description "Identifier of this RIB in local data store.";
819 description "IBGP identifier. Needed by route reflection.";
820 reference "https://tools.ietf.org/html/rfc4456#section-7";
821 type inet:ipv4-address;
824 list path-selection-mode {
825 uses config:service-ref {
827 config:required-identity bgp-path-selection-mode;