blob: e3fecb63d60b551b419b9e736eb2bdda55f572fa [file] [log] [blame]
Gaurav Agrawalc6d536f2017-03-17 11:56:31 +05301module l3vpn-svc-ext {
2 yang-version 1;
3 namespace "urn:ietf:params:xml:ns:yang:l3vpn:svc:ext";
4 prefix "l3vpn-svc-ext";
5
6 import ietf-inet-types { prefix inet; }
7 import ietf-l3vpn-svc { prefix l3vpn; }
8
9 revision 2016-07-30 {
10 description
11 "Eliminated warnings";
12 }
13
14 revision "2016-07-20" {
15 description "Initial revision of extended l3vpn yang model";
16 }
17
18 typedef short-as-number {
19 type inet:as-number {
20 range 0..65535;
21 }
22 }
23
24 typedef route-distinguisher {
25 reference "https://tools.ietf.org/html/rfc4364#section-4.2";
26 type union {
27 type rd-ipv4;
28 type rd-as;
29 type rd-as2;
30 }
31 }
32
33 typedef rd-ipv4 {
34 type string {
35 /* IPv4 : 2B number */
36 pattern '((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
37 + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))'
38 + ':'
39 + '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
40 + '[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|'
41 + '65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5])';
42 }
43 }
44
45 typedef rd-as {
46 type string {
47 /* 2B AS : 4B number */
48 pattern '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
49 + '[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|'
50 + '65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5])'
51 + ':'
52 + '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
53 + '[1-9][0-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9][0-9]|'
54 + '[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]|'
55 + '[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]|'
56 + '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]|'
57 + '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]|'
58 + '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]|'
59 + '42949672[0-8][0-9]|429496729[0-5])';
60 }
61 }
62
63 typedef rd-as2 {
64 type string {
65 /* 4B AS : 2B number */
66 pattern '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
67 + '[1-9][0-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9][0-9]|'
68 + '[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]|'
69 + '[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]|'
70 + '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]|'
71 + '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]|'
72 + '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]|'
73 + '42949672[0-8][0-9]|429496729[0-5])'
74 + ':'
75 + '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
76 + '[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|'
77 + '65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5])';
78 }
79 }
80
81 identity tc-demanded-tunnel {
82 base l3vpn:transport-constraint;
83 description "on-demand tunnel.";
84 }
85
86 grouping class-profile {
87 list qos-class {
88 key class-id;
89 leaf class-id {
90 type string;
91 description
92 "Identification of the
93 class of service.
94 This identifier is internal to
95 the administration.";
96 }
97 leaf rate-limit {
98 type uint8;
99 units percent;
100 description
101 "To be used if class must
102 be rate
103 limited. Expressed as
104 percentage of the svc-bw.";
105 }
106 leaf priority-level {
107 type uint8;
108 description
109 "Defines the level of the
110 class in
111 term of priority queueing.
112 The higher the level is the
113 higher
114 is the priority.";
115 }
116 leaf guaranteed-bw-percent {
117 type uint8;
118 units percent;
119 description
120 "To be used to define the
121 guaranteed
122 BW in percent of the svc-bw
123 available at the priority-level.";
124 }
125 description
126 "List of class of services.";
127 }
128 }
129
130 augment "/l3vpn:l3vpn-svc/l3vpn:sites/l3vpn:site/l3vpn:site-network-accesses/l3vpn:site-network-access/l3vpn:service/l3vpn:qos/l3vpn:qos-profile/l3vpn:qos-profile" {
131 case custom-unicom {
132 container inbound-classes {
133 uses class-profile;
134 }
135 container outbound-classes {
136 uses class-profile;
137 }
138 }
139 }
140
141 grouping bearer-attachment-grouping {
142 container bearer-attachment {
143 leaf pe-name {
144 type string;
145 }
146 leaf pe-mgmt-ip {
147 type inet:ipv4-address;
148 }
149 description "attached PE";
150 }
151 }
152
153 augment "/l3vpn:l3vpn-svc/l3vpn:sites/l3vpn:site/l3vpn:site-network-accesses/l3vpn:site-network-access/l3vpn:bearer" {
154 uses bearer-attachment-grouping;
155 }
156
157 grouping requested-type-grouping {
158 container requested-type-profile {
159 choice requested-type-choice {
160 case dot1q-case {
161 container dot1q {
162 leaf physical-if {
163 description "physical interface name.";
164 type string;
165 }
166 leaf vlan-id {
167 type uint16 {
168 range "1..4096";
169 }
170 }
171 }
172 }
173 case physical-case {
174 container physical {
175 leaf physical-if {
176 description "physical interface name.";
177 type string;
178 }
179 }
180 }
181 }
182 leaf circuit-id {
183 description "circuit description for PE-CE port.";
184 type string;
185 }
186 }
187 }
188
189 augment "/l3vpn:l3vpn-svc/l3vpn:sites/l3vpn:site/l3vpn:site-network-accesses/l3vpn:site-network-access/l3vpn:bearer/l3vpn:requested-type" {
190 uses requested-type-grouping;
191 }
192
193 grouping bfd-grouping {
194 leaf bfd-enabled {
195 type boolean;
196 description
197 "BFD activation";
198 }
199 choice holdtime {
200 case profile {
201 leaf profile-name {
202 type string;
203 description
204 "Service provider well
205 known profile.";
206 }
207 description
208 "Service provider well
209 known profile.";
210 }
211 case fixed {
212 leaf fixed-value {
213 type uint32;
214 units msec;
215 description
216 "Expected holdtime
217 expressed
218 in msec.";
219 }
220 }
221 case dynamic {
222 container dynamic-value {
223 leaf interval {
224 type uint16;
225 units msec;
226 default 500;
227 }
228 leaf multiplier {
229 type uint16;
230 default 3;
231 }
232 description
233 "interval * multiplier is
234 timeout value.";
235 }
236 }
237 }
238 }
239
240 grouping bgp-profile {
241 leaf as-override {
242 type boolean;
243 default false;
244 }
245 container soo {
246 leaf soo-enabled {
247 type boolean;
248 }
249 leaf soo-value {
250 type string;
251 }
252 }
253 container password {
254 leaf password-enabled {
255 type boolean;
256 }
257 leaf password-value {
258 type string;
259 }
260 }
261 container bgp-timer {
262 leaf keep-alive {
263 type uint16;
264 default 60;
265 units "seconds";
266 }
267 leaf hold-time {
268 type uint16;
269 default 180;
270 units "seconds";
271 }
272 }
273 container bfd {
274 uses bfd-grouping;
275 }
276 }
277
278 augment "/l3vpn:l3vpn-svc/l3vpn:sites/l3vpn:site/l3vpn:site-network-accesses/l3vpn:site-network-access/l3vpn:routing-protocols/l3vpn:routing-protocol/l3vpn:bgp" {
279 uses bgp-profile;
280 }
281
282 augment "/l3vpn:l3vpn-svc/l3vpn:vpn-services/l3vpn:vpn-svc/l3vpn:transport-constraints/l3vpn:unicast-transport-constraints/l3vpn:constraint/l3vpn:constraint-list" {
283 leaf constraint-opaque-value2 {
284 type string;
285 description
286 "Opaque value that can be used to
287 specify constraint parameters.";
288 }
289 }
290
291 grouping route-ipv4-extended-community {
292 reference "http://tools.ietf.org/html/rfc4360";
293 leaf global-administrator {
294 type inet:ipv4-address;
295 }
296 leaf local-administrator {
297 type uint16;
298 }
299 }
300
301 grouping extended-community {
302 choice extended-community {
303 reference "http://tools.ietf.org/html/rfc4360#section-4";
304 default route-target-extended-community-case;
305 case route-target-extended-community-case {
306 container route-target-extended-community {
307 leaf global-administrator {
308 type short-as-number;
309 }
310 leaf local-administrator {
311 type uint32;
312 }
313 }
314 }
315 case route-target-ipv4-case {
316 container route-target-ipv4 {
317 uses route-ipv4-extended-community;
318 }
319 }
320 case route-target-extended-community-case2 {
321 container route-target-extended-community2 {
322 leaf global-administrator {
323 type uint32;
324 }
325 leaf local-administrator {
326 type uint16;
327 }
328 }
329 }
330 }
331 }
332
333 grouping rdrt-profile {
334 choice site-role {
335 case custom-case {
336 container custom {
337 list import-rt {
338 key imrt-id;
339 leaf imrt-id {
340 type string;
341 }
342 uses extended-community;
343 }
344 list export-rt {
345 key exrt-id;
346 leaf exrt-id {
347 type string;
348 }
349 uses extended-community;
350 }
351 leaf rd {
352 type route-distinguisher;
353 }
354 }
355 }
356 }
357 }
358
359 augment "/l3vpn:l3vpn-svc/l3vpn:sites/l3vpn:site/l3vpn:site-network-accesses/l3vpn:site-network-access/l3vpn:vpn-attachment" {
360 uses rdrt-profile;
361 }
362}