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 {
285 grouping extended-community {
289 choice extended-community {
290 case as-specific-extended-community-case {
291 container as-specific-extended-community {
292 leaf global-administrator {
293 type short-as-number;
295 leaf local-administrator {
302 case inet4-specific-extended-community-case {
303 container inet4-specific-extended-community {
304 uses inet4-specific-extended-community-common;
305 leaf global-administrator {
307 type inet:ipv4-address;
309 leaf local-administrator {
317 case opaque-extended-community-case {
318 container opaque-extended-community {
326 case route-target-extended-community-case {
327 container route-target-extended-community {
328 leaf global-administrator {
329 type short-as-number;
331 leaf local-administrator {
338 case route-origin-extended-community-case {
339 container route-origin-extended-community {
340 leaf global-administrator {
341 type short-as-number;
343 leaf local-administrator {
350 case route-target-ipv4-case {
351 container route-target-ipv4 {
352 reference "http://tools.ietf.org/html/rfc4360#section-4";
353 uses route-ipv4-extended-community;
356 case route-origin-ipv4-case {
357 container route-origin-ipv4 {
358 reference "http://tools.ietf.org/html/rfc4360#section-5";
359 uses route-ipv4-extended-community;
362 case link-bandwidth-case {
363 container link-bandwidth-extended-community {
364 uses link-bandwidth-extended-community;
367 case as-4-generic-spec-extended-community-case {
368 container as-4-generic-spec-extended-community {
369 reference "https://www.ietf.org/archive/id/draft-ietf-idr-as4octet-extcomm-generic-subtype-08.txt";
370 uses as-4-spec-common;
373 case as-4-route-target-extended-community-case {
374 container as-4-route-target-extended-community {
375 reference "https://tools.ietf.org/html/rfc5668";
376 uses as-4-spec-common;
379 case as-4-route-origin-extended-community-case {
380 container as-4-route-origin-extended-community {
381 reference "https://tools.ietf.org/html/rfc5668";
382 uses as-4-spec-common;
385 case encapsulation-case {
386 container encapsulation-extended-community {
387 uses encapsulation-extended-community;
395 default empty-next-hop-case;
396 case ipv4-next-hop-case {
397 container ipv4-next-hop {
398 reference "http://tools.ietf.org/html/rfc4271#section-5.1.3";
400 type inet:ipv4-address;
404 case ipv6-next-hop-case {
405 container ipv6-next-hop {
406 reference "http://tools.ietf.org/html/rfc4760#section-3";
408 type inet:ipv6-address;
411 type inet:ipv6-address;
415 case empty-next-hop-case {
416 leaf empty-next-hop {
423 grouping as-path-segment {
424 reference "http://tools.ietf.org/html/rfc4271#section-5.1.2";
425 leaf-list as-sequence {
435 grouping route-distinguisher-grouping {
436 leaf route-distinguisher {
437 type route-distinguisher;
442 grouping orig-route-ip-grouping {
444 type inet:ip-address;