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 bgp-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 simple-routing-policy {
371 type rib:simple-routing-policy;
374 leaf initiate-connection {
375 description "If true, connection will be initiated right away from current device.
376 If not, the peer will only be registered to peer registry and available for incomming bgp connections.";
381 list advertized-table {
383 uses config:service-ref {
386 config:required-identity bgp-table-type;
393 uses config:service-ref {
395 config:required-identity add-path;
407 "Expected remote AS number. If not present, it is assumed
408 to be the same as our local AS number.";
413 type tcpmd5:rfc2385-key;
414 description "RFC2385 shared secret";
418 uses config:service-ref {
421 config:required-identity rib-instance;
426 container peer-registry {
427 description "BGP peer registry where current instance of BGP peer will be registered.";
428 uses config:service-ref {
430 // FIXME backwards compatibility. If not configured, GLOBAL instance is used
432 config:required-identity bgp-peer-registry;
436 container rpc-registry {
437 uses config:service-ref {
440 config:required-identity mdsb:binding-rpc-registry;
447 grouping message-state {
449 description "Total number of BGP messages.";
455 description "The BGP message timestamp (seconds).";
461 grouping message-stats {
463 description "The received BGP messages statistics.";
468 description "The sent BGP messages statistics.";
475 description "The BGP error code.";
481 description "The BGP error sub-code.";
489 description "Address Family Identifier.";
494 description "Subsequent Address Family Identifier.";
500 grouping preferences {
502 description "The BGP Identifier.";
508 description "The IP address of BGP connection.";
514 description "The port for connection between the BGP peers.";
520 description "Autonomous system number.";
526 description "Time interval (in seconds) for HoldTimer proposed by the peer.";
531 leaf four-octet-as-capability {
532 description "The BGP peer 4 byte AS numbers support capability.";
537 leaf bgp-extended-message-capability {
538 description "The bgp extended message support capability.";
544 description "BGP graceful restart support capability.";
549 leaf add-path-capability {
554 leaf route-refresh-capability {
555 reference "https://tools.ietf.org/html/rfc2918";
560 list advertized-table-types {
561 description "The BGP Table-type capabilities advertized by the BGP peer.";
565 list advertised-add-path-table-types {
566 description "The BGP Table-type capabilities advertized by the BGP peer.";
569 description "Send Receive Add Path Configuration.";
578 augment "/config:modules/config:module/config:state" {
580 when "/config:modules/config:module/config:type = 'bgp-peer'";
582 rpcx:rpc-context-instance "peer-rpc";
584 container bgp-peer-state {
588 description "The table name - composed of AFI and SAFI.";
593 description "The total number of routes in table.";
599 leaf session-established-count {
600 description "The total number of time the BGP session was transitioned to Up state.";
606 container bgp-session-state {
609 description "The BGP peer connection state.";
613 leaf session-duration {
614 description "The session duration (time formated d:HH:mm:ss).";
618 leaf holdtime-current {
619 description "Time interval (in seconds) for HoldTimer established with the peer.";
624 leaf keepalive-current {
625 description "Time interval (in seconds) for KeepAlive established with the peer.";
630 container speaker-preferences {
631 description "The BGP speaker preferences, to which this BGP peer is connected.";
635 container peer-preferences {
636 description "The BGP peer preferences.";
640 container messages-stats {
641 description "The BGP messages statistics.";
642 container total-msgs {
643 description "The statistics for all received/sent BGP messages.";
647 container keep-alive-msgs {
648 description "The statistics for received/sent BGP Keep-Alive messages.";
652 container update-msgs {
653 description "The statistics for received/sent BGP Update messages.";
657 container route-refresh-msgs {
658 description "The statistics for received/sent BGP Route Refresh messages.";
662 container error-msgs {
663 container error-received {
664 description "The received BGP Error (notification) messages statistics.";
669 container error-sent {
670 description "The sent BGP Error (notification) messages statistics.";
681 description "Restart the session between BGP peers";
683 uses rpcx:rpc-context-ref {
684 refine context-instance {
685 rpcx:rpc-context-instance peer-rpc;
692 description "Reset the BGP peer statistics.";
694 uses rpcx:rpc-context-ref {
695 refine context-instance {
696 rpcx:rpc-context-instance peer-rpc;
702 identity bgp-path-selection-mode {
704 "Service representing an address family + path selection mode.";
706 base "config:service-type";
707 config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPBestPathSelection";
710 identity bgp-psm-impl {
711 base config:module-type;
712 config:provided-service bgp-path-selection-mode;
713 config:java-name-prefix BGPPSMImpl;
716 augment "/config:modules/config:module/config:configuration" {
718 when "/config:modules/config:module/config:type = 'bgp-psm-impl'";
719 container path-address-family {
720 uses config:service-ref {
723 config:required-identity bgp-table-type;
727 container path-selection-mode {
728 uses config:service-ref {
731 config:required-identity bps:path-selection-mode-factory;
739 base config:module-type;
740 config:provided-service bgprib:rib;
741 config:provided-service rib-instance;
742 config:java-name-prefix RIBImpl;
745 augment "/config:modules/config:module/config:configuration" {
747 when "/config:modules/config:module/config:type = 'rib-impl'";
749 container extensions {
750 uses config:service-ref {
753 config:required-identity ribspi:consumer-extensions;
758 container bgp-dispatcher {
759 uses config:service-ref {
762 config:required-identity bgp-dispatcher;
767 container data-provider {
768 uses config:service-ref {
771 config:required-identity mdsb:binding-async-data-broker;
776 container codec-tree-factory {
777 uses config:service-ref {
780 config:required-identity mdsb:binding-codec-tree-factory;
785 container dom-data-provider {
786 uses config:service-ref {
789 config:required-identity sal:dom-async-data-broker;
794 container openconfig-provider {
795 uses config:service-ref {
798 config:required-identity bgp-oc-spi:bgp-openconfig-provider;
804 description "Our local AS number. Needed by best selection path attribute.";
810 description "Our local BGP identifier. Needed by best selection path attribute.";
812 type inet:ipv4-address;
816 uses config:service-ref {
819 config:required-identity bgp-table-type;
825 description "Identifier of this RIB in local data store.";
831 description "IBGP identifier. Needed by route reflection.";
832 reference "https://tools.ietf.org/html/rfc4456#section-7";
833 type inet:ipv4-address;
836 list rib-path-selection-mode {
837 uses config:service-ref {
839 config:required-identity bgp-path-selection-mode;