3 namespace "urn:opendaylight:params:xml:ns:yang:bgp-types";
6 import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
7 import network-concepts { prefix netc; revision-date 2013-11-25; }
9 organization "Cisco Systems, Inc.";
10 contact "Dana Kutenicsova <dkutenic@cisco.com>";
13 "This module contains the base concepts contained in RFC4271 and RFC4760.
15 Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
17 This program and the accompanying materials are made available
18 under the terms of the Eclipse Public License v1.0 which
19 accompanies this distribution, and is available at
20 http://www.eclipse.org/legal/epl-v10.html";
23 description "Update to use -no-zone-adresses";
26 revision "2018-03-29" {
27 description "RFC6514 Extended communities";
28 reference "https://tools.ietf.org/html/rfc6514";
31 revision "2013-09-19" {
34 reference "RFC4271, RFC4760";
38 reference "http://tools.ietf.org/html/rfc4271#section-5";
39 description "Values of BGP Origin Path Attribute.";
54 description "BGP identifier";
55 type inet:ipv4-address-no-zone;
58 identity address-family {
59 reference "http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml#address-family-numbers-2";
62 identity ipv4-address-family {
66 identity ipv6-address-family {
70 identity subsequent-address-family {
71 reference "http://tools.ietf.org/html/rfc4760#section-6";
74 identity unicast-subsequent-address-family {
75 reference "http://tools.ietf.org/html/rfc4760#section-6";
77 base subsequent-address-family;
80 identity mpls-labeled-vpn-subsequent-address-family {
81 reference "http://tools.ietf.org/html/rfc4760#section-6";
83 base subsequent-address-family;
86 typedef cluster-identifier {
87 reference "http://tools.ietf.org/html/rfc4456#section-8";
88 type inet:ipv4-address-no-zone;
91 typedef short-as-number {
97 typedef route-distinguisher {
98 reference "https://tools.ietf.org/html/rfc4364#section-4.2";
100 type rd-two-octet-as;
106 typedef rd-two-octet-as {
108 /* 2B AS : 4B number */
110 + '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
111 + '[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|'
112 + '65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5])'
114 + '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
115 + '[1-9][0-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9][0-9]|'
116 + '[1-9][0-9][0-9][0-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|'
117 + '[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|[1-3][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|'
118 + '4[0-1][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|42[0-8][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|'
119 + '429[0-3][0-9][0-9][0-9][0-9][0-9][0-9]|4294[0-8][0-9][0-9][0-9][0-9][0-9]|'
120 + '42949[0-5][0-9][0-9][0-9][0-9]|429496[0-6][0-9][0-9][0-9]|4294967[0-1][0-9][0-9]|'
121 + '42949672[0-8][0-9]|429496729[0-5])';
127 /* IPv4 : 2B number */
128 pattern '((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
129 + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))'
131 + '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
132 + '[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|'
133 + '65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5])';
139 /* 4B AS : 2B number */
140 pattern '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
141 + '[1-9][0-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9][0-9]|'
142 + '[1-9][0-9][0-9][0-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|'
143 + '[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|[1-3][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|'
144 + '4[0-1][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|42[0-8][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|'
145 + '429[0-3][0-9][0-9][0-9][0-9][0-9][0-9]|4294[0-8][0-9][0-9][0-9][0-9][0-9]|'
146 + '42949[0-5][0-9][0-9][0-9][0-9]|429496[0-6][0-9][0-9][0-9]|4294967[0-1][0-9][0-9]|'
147 + '42949672[0-8][0-9]|429496729[0-5])'
149 + '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
150 + '[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|'
151 + '65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5])';
155 typedef encapsulation-tunnel-type {
156 reference "http://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#tunnel-types";
158 enum l2tpv3-over-ip {
164 enum transmit-tunnel-endpoint {
167 enum ipsec-tunnel-mode {
170 enum ip-in-ip-ipsec-transport-mode {
173 enum mpls-in-ip-tunnel-ipsec-transport-mode {
203 grouping bgp-aggregator {
204 reference "http://tools.ietf.org/html/rfc4271#section-5.1.7";
205 description "BGP Path Attribute AGGREGATOR.";
207 // We are acting as a NEW speaker, so only four bytes are allowed
210 leaf network-address {
211 type inet:ipv4-address-no-zone;
216 reference "https://tools.ietf.org/html/rfc1997";
217 description "Community Path Attribute";
226 grouping route-ipv4-extended-community {
227 reference "http://tools.ietf.org/html/rfc4360";
228 leaf global-administrator {
229 type inet:ipv4-address-no-zone;
231 leaf local-administrator {
236 grouping link-bandwidth-extended-community {
237 reference "https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth-06#section-2";
239 "The Link Bandwidth extended community is optional non-transitive";
242 description "Bandwidth of the link";
245 units "bytes per second";
249 grouping as-4-spec-common {
250 container as-4-specific-common {
252 description "Carries a 4-octet Autonomous System (AS) number";
253 reference "https://tools.ietf.org/html/rfc5668#section-2";
259 leaf local-administrator {
266 grouping encapsulation-extended-community {
267 reference "https://tools.ietf.org/html/rfc5512#section-4.5";
268 description "BGP Encapsulation extended community";
271 description "Tunnel type specifying the encapsulation protocol";
273 type encapsulation-tunnel-type;
277 grouping inet4-specific-extended-community-common {
278 container inet4-specific-extended-community-common {
279 leaf global-administrator {
280 type inet:ipv4-address-no-zone;
282 leaf local-administrator {
290 grouping source-as-4-extended-community-grouping {
291 reference "https://tools.ietf.org/html/rfc6514#section-6";
292 leaf global-administrator {
293 description "Carries a 4-octet Autonomous System (AS) number";
294 reference "https://tools.ietf.org/html/rfc5668#section-2";
301 grouping source-as-extended-community-grouping {
302 reference "https://tools.ietf.org/html/rfc6514#section-6";
303 leaf global-administrator {
304 type bgp-t:short-as-number;
308 grouping route-target {
309 description "Marker grouping for Route Target extended communities.";
312 grouping route-target-constrain-default-route-grouping {
313 container route-target-constrain-default-route {
316 "The presence of this container indicates that the routes
317 is a default route target";
321 grouping route-target-extended-community-grouping {
322 container route-target-extended-community {
323 description "Type 0x00 / Subtype 0x02";
324 reference "http://tools.ietf.org/html/rfc4360#section-4";
327 leaf global-administrator {
328 type short-as-number;
330 leaf local-administrator {
338 grouping route-target-ipv4-grouping {
339 container route-target-ipv4 {
340 description "Type 0x01 / Subtype 0x02";
341 reference "http://tools.ietf.org/html/rfc4360#section-4";
343 uses route-ipv4-extended-community;
347 grouping as-4-route-target-extended-community-grouping {
348 container as-4-route-target-extended-community {
349 description "Type 0x02 / Subtype 0x02";
350 reference "https://tools.ietf.org/html/rfc5668";
352 uses as-4-spec-common;
356 grouping extended-community {
360 choice extended-community {
361 case as-specific-extended-community-case {
362 container as-specific-extended-community {
363 leaf global-administrator {
364 type short-as-number;
366 leaf local-administrator {
373 case inet4-specific-extended-community-case {
374 container inet4-specific-extended-community {
375 uses inet4-specific-extended-community-common;
376 leaf global-administrator {
378 type inet:ipv4-address-no-zone;
380 leaf local-administrator {
388 case opaque-extended-community-case {
389 container opaque-extended-community {
397 case route-target-extended-community-case {
398 uses route-target-extended-community-grouping;
400 case route-target-ipv4-case {
401 uses route-target-ipv4-grouping;
403 case as-4-route-target-extended-community-case {
404 uses as-4-route-target-extended-community-grouping;
406 case route-origin-extended-community-case {
407 container route-origin-extended-community {
408 leaf global-administrator {
409 type short-as-number;
411 leaf local-administrator {
418 case route-origin-ipv4-case {
419 container route-origin-ipv4 {
420 reference "http://tools.ietf.org/html/rfc4360#section-5";
421 uses route-ipv4-extended-community;
424 case link-bandwidth-case {
425 container link-bandwidth-extended-community {
426 uses link-bandwidth-extended-community;
429 case as-4-generic-spec-extended-community-case {
430 container as-4-generic-spec-extended-community {
431 reference "https://www.ietf.org/archive/id/draft-ietf-idr-as4octet-extcomm-generic-subtype-08.txt";
432 uses as-4-spec-common;
435 case as-4-route-origin-extended-community-case {
436 container as-4-route-origin-extended-community {
437 reference "https://tools.ietf.org/html/rfc5668";
438 uses as-4-spec-common;
441 case encapsulation-case {
442 container encapsulation-extended-community {
443 uses encapsulation-extended-community;
446 case vrf-route-import-extended-community-case {
447 reference "https://tools.ietf.org/html/rfc6514#section-7";
448 container vrf-route-import-extended-community {
449 uses inet4-specific-extended-community-common;
452 case source-as-4-extended-community-case {
453 container source-as-4-extended-community {
454 uses source-as-4-extended-community-grouping;
457 case source-as-extended-community-case {
458 container source-as-extended-community {
459 uses source-as-extended-community-grouping;
467 default empty-next-hop-case;
468 case ipv4-next-hop-case {
469 container ipv4-next-hop {
470 reference "http://tools.ietf.org/html/rfc4271#section-5.1.3";
472 type inet:ipv4-address-no-zone;
477 case ipv6-next-hop-case {
478 container ipv6-next-hop {
479 reference "http://tools.ietf.org/html/rfc4760#section-3";
481 type inet:ipv6-address-no-zone;
485 type inet:ipv6-address-no-zone;
489 case empty-next-hop-case {
490 leaf empty-next-hop {
497 grouping as-path-segment {
498 reference "http://tools.ietf.org/html/rfc4271#section-5.1.2";
499 leaf-list as-sequence {
509 grouping route-distinguisher-grouping {
510 leaf route-distinguisher {
511 type route-distinguisher;
516 grouping orig-route-ip-grouping {
518 type inet:ip-address-no-zone;