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";
22 revision "2018-03-29" {
23 description "RFC6514 Extended communities";
24 reference "https://tools.ietf.org/html/rfc6514";
27 revision "2013-09-19" {
30 reference "RFC4271, RFC4760";
34 reference "http://tools.ietf.org/html/rfc4271#section-5";
35 description "Values of BGP Origin Path Attribute.";
50 description "BGP identifier";
51 type inet:ipv4-address;
54 identity address-family {
55 reference "http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml#address-family-numbers-2";
58 identity ipv4-address-family {
62 identity ipv6-address-family {
66 identity subsequent-address-family {
67 reference "http://tools.ietf.org/html/rfc4760#section-6";
70 identity unicast-subsequent-address-family {
71 reference "http://tools.ietf.org/html/rfc4760#section-6";
73 base subsequent-address-family;
76 identity mpls-labeled-vpn-subsequent-address-family {
77 reference "http://tools.ietf.org/html/rfc4760#section-6";
79 base subsequent-address-family;
82 typedef cluster-identifier {
83 reference "http://tools.ietf.org/html/rfc4456#section-8";
84 type inet:ipv4-address;
87 typedef short-as-number {
93 typedef route-distinguisher {
94 reference "https://tools.ietf.org/html/rfc4364#section-4.2";
102 typedef rd-two-octet-as {
104 /* 2B AS : 4B number */
106 + '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
107 + '[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|'
108 + '65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5])'
110 + '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
111 + '[1-9][0-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9][0-9]|'
112 + '[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]|'
113 + '[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]|'
114 + '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]|'
115 + '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]|'
116 + '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]|'
117 + '42949672[0-8][0-9]|429496729[0-5])';
123 /* IPv4 : 2B number */
124 pattern '((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
125 + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))'
127 + '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
128 + '[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|'
129 + '65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5])';
135 /* 4B AS : 2B number */
136 pattern '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
137 + '[1-9][0-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9][0-9]|'
138 + '[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]|'
139 + '[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]|'
140 + '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]|'
141 + '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]|'
142 + '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]|'
143 + '42949672[0-8][0-9]|429496729[0-5])'
145 + '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
146 + '[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|'
147 + '65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5])';
151 typedef encapsulation-tunnel-type {
152 reference "http://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#tunnel-types";
154 enum l2tpv3-over-ip {
160 enum transmit-tunnel-endpoint {
163 enum ipsec-tunnel-mode {
166 enum ip-in-ip-ipsec-transport-mode {
169 enum mpls-in-ip-tunnel-ipsec-transport-mode {
199 grouping bgp-aggregator {
200 reference "http://tools.ietf.org/html/rfc4271#section-5.1.7";
201 description "BGP Path Attribute AGGREGATOR.";
203 // We are acting as a NEW speaker, so only four bytes are allowed
206 leaf network-address {
207 type inet:ipv4-address;
212 reference "https://tools.ietf.org/html/rfc1997";
213 description "Community Path Attribute";
222 grouping route-ipv4-extended-community {
223 reference "http://tools.ietf.org/html/rfc4360";
224 leaf global-administrator {
225 type inet:ipv4-address;
227 leaf local-administrator {
232 grouping link-bandwidth-extended-community {
233 reference "https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth-06#section-2";
235 "The Link Bandwidth extended community is optional non-transitive";
238 description "Bandwidth of the link";
241 units "bytes per second";
245 grouping as-4-spec-common {
246 container as-4-specific-common {
248 description "Carries a 4-octet Autonomous System (AS) number";
249 reference "https://tools.ietf.org/html/rfc5668#section-2";
255 leaf local-administrator {
262 grouping encapsulation-extended-community {
263 reference "https://tools.ietf.org/html/rfc5512#section-4.5";
264 description "BGP Encapsulation extended community";
267 description "Tunnel type specifying the encapsulation protocol";
269 type encapsulation-tunnel-type;
273 grouping inet4-specific-extended-community-common {
274 container inet4-specific-extended-community-common {
275 leaf global-administrator {
276 type inet:ipv4-address;
278 leaf local-administrator {
286 grouping source-as-4-extended-community-grouping {
287 reference "https://tools.ietf.org/html/rfc6514#section-6";
288 leaf global-administrator {
289 description "Carries a 4-octet Autonomous System (AS) number";
290 reference "https://tools.ietf.org/html/rfc5668#section-2";
297 grouping source-as-extended-community-grouping {
298 reference "https://tools.ietf.org/html/rfc6514#section-6";
299 leaf global-administrator {
300 type bgp-t:short-as-number;
304 grouping route-target {
305 description "Marker grouping for Route Target extended communities.";
308 grouping route-target-constrain-default-route-grouping {
309 container route-target-constrain-default-route {
312 "The presence of this container indicates that the routes
313 is a default route target";
317 grouping route-target-extended-community-grouping {
318 container route-target-extended-community {
319 description "Type 0x00 / Subtype 0x02";
320 reference "http://tools.ietf.org/html/rfc4360#section-4";
323 leaf global-administrator {
324 type short-as-number;
326 leaf local-administrator {
334 grouping route-target-ipv4-grouping {
335 container route-target-ipv4 {
336 description "Type 0x01 / Subtype 0x02";
337 reference "http://tools.ietf.org/html/rfc4360#section-4";
339 uses route-ipv4-extended-community;
343 grouping as-4-route-target-extended-community-grouping {
344 container as-4-route-target-extended-community {
345 description "Type 0x02 / Subtype 0x02";
346 reference "https://tools.ietf.org/html/rfc5668";
348 uses as-4-spec-common;
352 grouping extended-community {
356 choice extended-community {
357 case as-specific-extended-community-case {
358 container as-specific-extended-community {
359 leaf global-administrator {
360 type short-as-number;
362 leaf local-administrator {
369 case inet4-specific-extended-community-case {
370 container inet4-specific-extended-community {
371 uses inet4-specific-extended-community-common;
372 leaf global-administrator {
374 type inet:ipv4-address;
376 leaf local-administrator {
384 case opaque-extended-community-case {
385 container opaque-extended-community {
393 case route-target-extended-community-case {
394 uses route-target-extended-community-grouping;
396 case route-target-ipv4-case {
397 uses route-target-ipv4-grouping;
399 case as-4-route-target-extended-community-case {
400 uses as-4-route-target-extended-community-grouping;
402 case route-origin-extended-community-case {
403 container route-origin-extended-community {
404 leaf global-administrator {
405 type short-as-number;
407 leaf local-administrator {
414 case route-origin-ipv4-case {
415 container route-origin-ipv4 {
416 reference "http://tools.ietf.org/html/rfc4360#section-5";
417 uses route-ipv4-extended-community;
420 case link-bandwidth-case {
421 container link-bandwidth-extended-community {
422 uses link-bandwidth-extended-community;
425 case as-4-generic-spec-extended-community-case {
426 container as-4-generic-spec-extended-community {
427 reference "https://www.ietf.org/archive/id/draft-ietf-idr-as4octet-extcomm-generic-subtype-08.txt";
428 uses as-4-spec-common;
431 case as-4-route-origin-extended-community-case {
432 container as-4-route-origin-extended-community {
433 reference "https://tools.ietf.org/html/rfc5668";
434 uses as-4-spec-common;
437 case encapsulation-case {
438 container encapsulation-extended-community {
439 uses encapsulation-extended-community;
442 case vrf-route-import-extended-community-case {
443 reference "https://tools.ietf.org/html/rfc6514#section-7";
444 container vrf-route-import-extended-community {
445 uses inet4-specific-extended-community-common;
448 case source-as-4-extended-community-case {
449 container source-as-4-extended-community {
450 uses source-as-4-extended-community-grouping;
453 case source-as-extended-community-case {
454 container source-as-extended-community {
455 uses source-as-extended-community-grouping;
463 default empty-next-hop-case;
464 case ipv4-next-hop-case {
465 container ipv4-next-hop {
466 reference "http://tools.ietf.org/html/rfc4271#section-5.1.3";
468 type inet:ipv4-address;
473 case ipv6-next-hop-case {
474 container ipv6-next-hop {
475 reference "http://tools.ietf.org/html/rfc4760#section-3";
477 type inet:ipv6-address;
481 type inet:ipv6-address;
485 case empty-next-hop-case {
486 leaf empty-next-hop {
493 grouping as-path-segment {
494 reference "http://tools.ietf.org/html/rfc4271#section-5.1.2";
495 leaf-list as-sequence {
505 grouping route-distinguisher-grouping {
506 leaf route-distinguisher {
507 type route-distinguisher;
512 grouping orig-route-ip-grouping {
514 type inet:ip-address;