-
Notifications
You must be signed in to change notification settings - Fork 1
/
draft-berger-xml-sample-repo.xml
496 lines (460 loc) · 14.8 KB
/
draft-berger-xml-sample-repo.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" ?>
<?rfc strict="yes" ?>
<rfc category="info" ipr="trust200902" docName="draft-berger-xml-sample-repo-00" >
<front>
<title abbrev="YANG NIs">SAMPLE DRAFT</title>
<author initials='L.' surname="Berger" fullname='Lou Berger'>
<organization>LabN Consulting, L.L.C.</organization>
<address>
<email>lberger@labn.net</email>
</address>
</author>
<date/>
<abstract>
<t>
This sample document based on draft-ietf-rtgwg-ni-model-05 fill in
your own text.
</t>
</abstract>
</front>
<middle>
<section anchor="sec-1" title="Introduction">
<t>
This sample document based on <xref target="I-D.ietf-rtgwg-ni-model"/>
fill in your own text.
</t>
<section title="Terminology" anchor="sec-definitions">
<t>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described
in <xref target="RFC2119"/>.
</t>
<t>
Readers are expected to be familiar with terms and concepts of
YANG <xref target="RFC7950"/> and YANG Schema Mount <xref
target="I-D.ietf-netmod-schema-mount"/>.
</t>
<t>
This document uses the graphical representation of data models
defined in <xref target="I-D.ietf-netmod-yang-tree-diagrams"/>.
</t>
</section>
<section anchor="sec-1.1" title="Status of Work and Open Issues">
<t>
The top open issues are:
<list style="numbers">
<t>
You need to update this to make it your own!
</t>
</list>
</t>
</section>
</section>
<section anchor="sec-2" title="Overview">
<t>
Fill this in.
</t>
<t>
<figure>
<artwork>
,''''''''''''''''''''''''''''''''''''''''''''''`.
| Network Device (Physical or Virtual) |
| ..................... ..................... |
| : Logical Network : : Logical Network : |
| : Element : : Element : |
| :+-----+-----+-----+: :+-----+-----+-----+: |
| :| Net | Net | Net |: :| Net | Net | Net |: |
| :|Inst.|Inst.|Inst.|: :|Inst.|Inst.|Inst.|: |
| :+-----+-----+-----+: :+-----+-----+-----+: |
| : | | | | | | : : | | | | | | : |
| :..|.|...|.|...|.|..: :..|.|...|.|...|.|..: |
| | | | | | | | | | | | | |
`'''|'|'''|'|'''|'|'''''''''|'|'''|'|'''|'|'''''
| | | | | | | | | | | |
Interfaces Interfaces
</artwork>
</figure>
</t>
<t>
Figure 1: Module Element Relationships
</t>
<t>
a figure from <xref target="I-D.ietf-rtgwg-ni-model"/>.
</t>
</section>
<section anchor="sec-NI" title="Sample Tree">
<t>
Here's a sample tree.
</t>
<t>
The NI model can be represented using the tree format defined in <xref
target="I-D.ietf-netmod-yang-tree-diagrams"/> as:
</t>
<t>
<figure>
<artwork>
module: ietf-network-instance
+--rw network-instances
+--rw network-instance* [name]
+--rw name string
+--rw enabled? boolean
+--rw description? string
+--rw (ni-type)?
+--rw (root-type)
+--:(vrf-root)
| +--mp vrf-root
+--:(vsi-root)
| +--mp vsi-root
+--:(vv-root)
+--mp vv-root
augment /if:interfaces/if:interface:
+--rw bind-ni-name? -> /network-instances/network-instance/name
augment /if:interfaces/if:interface/ip:ipv4:
+--rw bind-ni-name? -> /network-instances/network-instance/name
augment /if:interfaces/if:interface/ip:ipv6:
+--rw bind-ni-name? -> /network-instances/network-instance/name
notifications:
+---n bind-ni-name-failed
+--ro name -> /if:interfaces/interface/name
+--ro interface
| +--ro bind-ni-name?
| -> /if:interfaces/interface/ni:bind-ni-name
+--ro ipv4
| +--ro bind-ni-name?
| -> /if:interfaces/interface/ip:ipv4/ni:bind-ni-name
+--ro ipv6
| +--ro bind-ni-name?
| -> /if:interfaces/interface/ip:ipv6/ni:bind-ni-name
+--ro error-info? string
</artwork>
</figure>
</t>
<t>
A network instance is identified by a
'name' string. This string is used both as
an index within the network-instance module and to associate
resources with a network instance as shown above in the
interface augmentation. The ni-type and root-type choice statements are used to
support different types of L2 and L3 VPN technologies.
The bind-ni-name-failed notification is used in certain failure cases.
</t>
</section>
<section anchor="sec-6.3" title="Sample Model">
<t>
The structure of the model defined in this document is described
by the YANG module below.
</t>
<t>
<figure>
<artwork><![CDATA[
<CODE BEGINS> file "ietf-yang-sample@2017-10-06.yang"
module ietf-yang-sample {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-yang-sample";
prefix ni;
// import some basic types
import ietf-interfaces {
prefix if;
reference "RFC 7223: A YANG Data Model for Interface
Management";
}
import ietf-ip {
prefix ip;
reference "RFC 7277: A YANG Data Model for IP Management";
}
import ietf-yang-schema-mount {
prefix yangmnt;
reference "draft-ietf-netmod-schema-mount: YANG Schema Mount";
// RFC Ed.: Please replace this draft name with the
// corresponding RFC number
}
organization
"IETF Routing Area (rtgwg) Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/rtgwg/>
WG List: <mailto:rtgwg@ietf.org>
Author: Lou Berger
<mailto:lberger@labn.net>
Author: Christan Hopps
<mailto:chopps@chopps.org>
Author: Acee Lindem
<mailto:acee@cisco.com>
Author: Dean Bogdanovic
<mailto:ivandean@gmail.com>";
description
"sample stolen from draft-ietf-rtgwg-ni-model-05
This module is used to support multiple network instances
within a single physical or virtual device. Network
instances are commonly known as VRFs (virtual routing
and forwarding) and VSIs (virtual switching instances).
Copyright (c) 2017 IETF Trust and the persons
identified as authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject
to the license terms contained in, the Simplified BSD License
set forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents
(http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX; see
the RFC itself for full legal notices.";
// RFC Ed.: replace XXXX with actual RFC number and remove
// this note
// RFC Ed.: please update TBD
revision 2017-10-06 {
description
"Initial revision.";
reference "RFC TBD";
}
// top level device definition statements
container network-instances {
description
"Network instances each of which consists of a
VRFs (virtual routing and forwarding) and/or
VSIs (virtual switching instances).";
reference "RFC 8022 - A YANG Data Model for Routing
Management";
list network-instance {
key "name";
description
"List of network-instances.";
leaf name {
type string;
mandatory true;
description
"device scoped identifier for the network
instance.";
}
leaf enabled {
type boolean;
default "true";
description
"Flag indicating whether or not the network
instance is enabled.";
}
leaf description {
type string;
description
"Description of the network instance
and its intended purpose.";
}
choice ni-type {
description
"This node serves as an anchor point for different types
of network instances. Each 'case' is expected to
differ in terms of the information needed in the
parent/core to support the NI, and may differ in their
mounted schema definition. When the mounted schema is
not expected to be the same for a specific type of NI
a mount point should be defined.";
}
choice root-type {
mandatory true;
description
"Well known mount points.";
container vrf-root {
description
"Container for mount point.";
yangmnt:mount-point "vrf-root" {
description
"Root for L3VPN type models. This will typically
not be an inline type mount point.";
}
}
container vsi-root {
description
"Container for mount point.";
yangmnt:mount-point "vsi-root" {
description
"Root for L2VPN type models. This will typically
not be an inline type mount point.";
}
}
container vv-root {
description
"Container for mount point.";
yangmnt:mount-point "vv-root" {
description
"Root models that support both L2VPN type bridging
and L3VPN type routing. This will typically
not be an inline type mount point.";
}
}
}
}
}
// augment statements
augment "/if:interfaces/if:interface" {
description
"Add a node for the identification of the network
instance associated with the information configured
on a interface.
Note that a standard error will be returned if the
identified leafref isn't present. If an interfaces cannot
be assigned for any other reason, the operation SHALL fail
with an error-tag of 'operation-failed' and an
error-app-tag of 'ni-assignment-failed'. A meaningful
error-info that indicates the source of the assignment
failure SHOULD also be provided.";
leaf bind-ni-name {
type leafref {
path "/network-instances/network-instance/name";
}
description
"Network Instance to which an interface is bound.";
}
}
augment "/if:interfaces/if:interface/ip:ipv4" {
description
"Add a node for the identification of the network
instance associated with the information configured
on an IPv4 interface.
Note that a standard error will be returned if the
identified leafref isn't present. If an interfaces cannot
be assigned for any other reason, the operation SHALL fail
with an error-tag of 'operation-failed' and an
error-app-tag of 'ni-assignment-failed'. A meaningful
error-info that indicates the source of the assignment
failure SHOULD also be provided.";
leaf bind-ni-name {
type leafref {
path "/network-instances/network-instance/name";
}
description
"Network Instance to which IPv4 interface is bound.";
}
}
augment "/if:interfaces/if:interface/ip:ipv6" {
description
"Add a node for the identification of the network
instance associated with the information configured
on an IPv6 interface.
Note that a standard error will be returned if the
identified leafref isn't present. If an interfaces cannot
be assigned for any other reason, the operation SHALL fail
with an error-tag of 'operation-failed' and an
error-app-tag of 'ni-assignment-failed'. A meaningful
error-info that indicates the source of the assignment
failure SHOULD also be provided.";
leaf bind-ni-name {
type leafref {
path "/network-instances/network-instance/name";
}
description
"Network Instance to which IPv6 interface is bound.";
}
}
// notification statements
notification bind-ni-name-failed {
description
"Indicates an error in the association of an interface to an
NI. Only generated after success is initially returned when
bind-ni-name is set.
Note: some errors may need to be reported for multiple
associations, e.g., a single error may need to be reported
for an IPv4 and an IPv6 bind-ni-name.
At least one container with a bind-ni-name leaf MUST be
included in this notification.";
leaf name {
type leafref {
path "/if:interfaces/if:interface/if:name";
}
mandatory true;
description
"Contains the interface name associated with the
failure.";
}
container interface {
description
"Generic interface type.";
leaf bind-ni-name {
type leafref {
path "/if:interfaces/if:interface/ni:bind-ni-name";
}
description
"Contains the bind-ni-name associated with the
failure.";
}
}
container ipv4 {
description
"IPv4 interface type.";
leaf bind-ni-name {
type leafref {
path "/if:interfaces/if:interface"
+ "/ip:ipv4/ni:bind-ni-name";
}
description
"Contains the bind-ni-name associated with the
failure.";
}
}
container ipv6 {
description
"IPv6 interface type.";
leaf bind-ni-name {
type leafref {
path "/if:interfaces/if:interface"
+ "/ip:ipv6/ni:bind-ni-name";
}
description
"Contains the bind-ni-name associated with the
failure.";
}
}
leaf error-info {
type string;
description
"Optionally, indicates the source of the assignment
failure.";
}
}
}
<CODE ENDS>
]]></artwork>
</figure>
</t>
</section>
<section anchor="sec-4" title=" Security Considerations">
<t>
Here to keep idnits happy!
</t>
</section>
<section anchor="sec-5" title=" IANA Considerations">
<t>
Here to keep idnits happy!
</t>
</section>
</middle>
<?rfc needLines="20"?>
<back>
<references title="Normative References">
<?rfc include="reference.I-D.ietf-rtgwg-ni-model.xml"?>
<?rfc include="reference.I-D.ietf-netmod-schema-mount.xml"?>
<?rfc include="reference.I-D.ietf-netmod-yang-tree-diagrams.xml"?>
<?rfc include="reference.RFC.2119"?>
</references>
<references title="Informative References">
<?rfc include="reference.RFC.7950"?>
</references>
<?rfc needLines="100"?>
<section title="Acknowledgments">
<t>
This sample document based on <xref target="I-D.ietf-rtgwg-ni-model"/>
fill in your own text.
</t>
<t>The RFC text was produced using Marshall Rose's xml2rfc tool.
</t>
</section>
</back>
</rfc>
<!-- Local Variables: -->
<!-- fill-column:72 -->
<!-- End: -->