-
Notifications
You must be signed in to change notification settings - Fork 1
582 lines (544 loc) · 19.9 KB
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
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
module ietf-softwire-br {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-softwire-br";
prefix softwire-br;
import ietf-inet-types {
prefix inet;
reference "Section 4 of RFC 6991";
}
import ietf-yang-types {
prefix yang;
reference "Section 3 of RFC 6991";
}
import ietf-softwire-common {
prefix softwire-common;
reference
"RFC XXXX: YANG Modules for IPv4-in-IPv6 Address plus Port
Softwires";
}
organization
"IETF Softwire Working Group";
contact
"WG Web: <https://datatracker.ietf.org/wg/softwire/>
WG List: <mailto:[email protected]>
Author: Qi Sun
<mailto:[email protected]>
Author: Linhui Sun
<mailto:[email protected]>
Author: Yong Cui
<mailto:[email protected]>
Editor: Ian Farrer
<mailto:[email protected]>
Author: Sladjana Zoric
<mailto:[email protected]>
Editor: Mohamed Boucadair
<mailto:[email protected]>
Author: Rajiv Asati
<mailto:[email protected]>";
description
"This document defines a YANG module for the configuration and
management of A+P Softwire Border Routers. It covers Lightweight
4over6, MAP-E, and MAP-T mechanisms.
Copyright (c) 2018 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.";
revision 2018-10-23 {
description
"Initial revision.";
reference
"RFC XXXX: YANG Modules for IPv4-in-IPv6 Address plus Port
Softwires";
}
/*
* Groupings
*/
grouping port-set {
description
"Describes a set of layer 4 port numbers.
This may be a simple port range, or use the Port Set
Identifier (PSID) algorithm to represent a range of transport
layer ports which will be used by a NAPT.";
leaf psid-offset {
type uint8 {
range "0..16";
}
description
"The number of offset bits. In Lightweight 4over6,
the default value is 0 for assigning one contiguous
port range. In MAP-E/T, the default value is 6,
which means the system ports (0-1023) are excluded by
default and the assigned port ranges are distributed across
the entire port space, depending on either psid-len or the
number of contiguous ports.";
}
leaf psid-len {
type uint8 {
range "0..15";
}
mandatory true;
description
"The length of PSID, representing the sharing
ratio for an IPv4 address. This, along with ea-len, can
be used to calculate the number of contiguous ports per
port range";
}
leaf psid {
type uint16;
mandatory true;
description
"Port Set Identifier (PSID) value, which
identifies a set of ports algorithmically.";
}
}
grouping binding-entry {
description
"The binding BR maintains an address binding table that
contains the binding between the CE's IPv6 address,
the allocated IPv4 address and restricted port-set.";
leaf binding-ipv6info {
type union {
type inet:ipv6-address;
type inet:ipv6-prefix;
}
description
"The IPv6 information for a CE binding entry.
When the IPv6 prefix type is used,
the IPv6 source address of the CE is constructed
according to the description in RFC7596;
if the IPv6 address type is used, the CE can use
any valid /128 address from a prefix assigned to
the CE.";
reference
"RFC7596: Lightweight 4over6: An Extension to the Dual-Stack
Lite Architecture";
}
leaf binding-ipv4-addr {
type inet:ipv4-address;
description
"The IPv4 address assigned to the binding CE,
which is used as the IPv4 external address
for binding CE local NAPT44.";
}
container port-set {
description
"For Lightweight 4over6, the default value
for offset should be 0, to configure one contiguous
port range.";
uses port-set {
refine "psid-offset" {
default "0";
}
}
}
leaf br-ipv6-addr {
type inet:ipv6-address;
description
"The IPv6 address for binding BR.";
}
}
/*
* Features
*/
feature binding-mode {
description
"Binding is used for configuring the Lightweight 4over6 mechanism.
Binding based softwire mechanisms are IPv4-over-IPv6 tunnelling
transition mechanisms specifically intended for complete
independence between the IPv6 subnet prefix (and IPv6 address)
and IPv4 address, with or without IPv4 address sharing.
This is accomplished by maintaining state for each softwire
(per-subscriber state) in the central Border Relay (BR) and using
a hub-and-spoke forwarding architecture. In order to delegate the
NAPT function and achieve IPv4 address sharing, port-restricted
IPv4 addresses needs to be allocated to CEs.
This feature indicates that the network element can function as
one or more binding based softwire instances.";
reference
"RFC7596: Lightweight 4over6: An Extension to the Dual-Stack Lite
Architecture
RFC7597: Mapping of Address and Port with Encapsulation (MAP-E)
RFC7599: Mapping of Address and Port using Translation (MAP-T)";
}
feature map-e {
description
"MAP-E is an IPv6 transition mechanism for transporting IPv4
packets across an IPv6 network using IP encapsulation. MAP-E
allows for a reduction of the amount of centralized state using
rules to express IPv4/IPv6 address mappings. This introduces an
algorithmic relationship between the IPv6 subnet and IPv4
address.
This feature indicates that the network element can function as
one or more MAP-E softwire instances.";
reference
"RFC7597: Mapping of Address and Port with Encapsulation (MAP-E)";
}
feature map-t {
description
"MAP-T is an IPv6 transition mechanism for transporting IPv4
packets across an IPv6 network using IP translation. It leverages
a double stateless NAT64 based solution as well as the stateless
algorithmic address & transport layer port mapping algorithm
defined for MAP-E.
This feature indicates that the network element can function as
one or more MAP-T softwire instances.";
reference
"RFC7599: Mapping of Address and Port using Translation (MAP-T)";
}
container br-instances {
description
"BR instances enabled in a network element.";
choice br-type {
description
"Select binding or algorithmic BR functionality.";
case binding {
if-feature "binding-mode";
container binding {
description
"binding mechanism (binding table) configuration.";
list bind-instance {
key "name";
description
"A set of binding instances to be configured.";
leaf name {
type string;
mandatory true;
description
"The name for the binding BR. It is used to uniquely
distinguish a binding instance by its name.";
}
container binding-table-versioning {
description
"binding table's version";
leaf version {
type uint64;
description
"Timestamp when the binding table was activated.
A binding instance may be provided with binding
entries that may change in time (e.g., increase
the size of the port set). When an abuse party
presents an external IP address/port, the version
of the binding table is important because, depending
on the version, a distinct customer may be
identified.
The timestamp is used as a key to find the
appropriate binding table that was put into effect
when an abuse occurred. ";
}
leaf date {
type yang:date-and-time;
description
"Timestamp of the binding table";
reference
"RFC7422: Deterministic Address Mapping to Reduce
Logging in Carrier-Grade NAT Deployments";
}
}
leaf softwire-num-max {
type uint32 {
range "1..max";
}
mandatory true;
description
"The maximum number of softwires that can be created
on the binding BR.";
}
leaf softwire-payload-mtu {
type uint16;
units "bytes";
mandatory true;
description
"The payload IPv4 MTU for binding softwire.";
}
leaf softwire-path-mru {
type uint16;
units "bytes";
mandatory true;
description
"The path MRU for binding softwire.";
reference
"RFC4213: Basic Transition Mechanisms for IPv6 Hosts
and Routers";
}
leaf enable-hairpinning {
type boolean;
default "true";
description
"Enables/disables support for locally forwarding
(hairpinning) traffic between two CEs.";
reference "Section 6.2 of RFC7596";
}
container binding-table {
description
"binding table";
list binding-entry {
key "binding-ipv6info";
description
"binding entry";
uses binding-entry;
}
}
container icmp-policy {
description
"The binding BR can be configured to process or drop
incoming ICMP messages, and to generate outgoing ICMP
error messages.";
container icmpv4-errors {
description
"ICMPv4 error processing configuration";
leaf allow-incoming-icmpv4 {
type boolean;
default "true";
description
"Enables the processing of incoming ICMPv4
packets.";
reference
"RFC7596: Lightweight 4over6: An Extension to
the Dual-Stack Lite Architecture";
}
leaf icmpv4-rate {
type uint32;
description
"Rate limit threshold in messages per-second
for processing incoming ICMPv4 errors messages";
}
leaf generate-icmpv4-errors {
type boolean;
default "true";
description
"Enables the generation of outgoing ICMPv4 error
messages on receipt of an inbound IPv4 packet
with no matching binding table entry.";
reference "Seciton 5.2 of RFC7596.";
}
}
container icmpv6-errors {
description
"ICMPv6 error processing configuration";
leaf generate-icmpv6-errors {
type boolean;
default "true";
description
"Enables the generation of ICMPv6 error messages if
no matching binding table entry is found for a
received packet.";
reference "Section 6.2 of RFC7596.";
}
leaf icmpv6-rate {
type uint32;
description
"Rate limit threshold in messages per-second
for sending ICMPv6 errors messages";
reference "Section 9 of RFC7596.";
}
}
}
container traffic-stat {
config false;
description
"Traffic statistics information for the BR.";
leaf discontinuity-time {
type yang:date-and-time;
mandatory true;
description
"The time of the most recent occasion on which the BR
instance suffered a discontinuity. This must be
initialized when the BR instance is configured
or rebooted.";
}
uses softwire-common:traffic-stat;
leaf dropped-icmpv4-packets {
type yang:zero-based-counter64;
description
"ICMPv4 packets that are dropped as a result
of the ICMP policy. Typically, this can be any
incoming ICMPv4 packets if ICMPv4 processing is
disabled or incoming ICMPv4 packets that exceed
the ICMPv4 rate-limit threshold.
Discontinuities in the value of this counter can
occur at re-initialization of the management
system, and at other times as indicated by
the value of 'discontinuity-time'.";
}
leaf dropped-icmpv4-bytes {
type yang:zero-based-counter64;
description
"ICMPv4 messages, in bytes, that are dropped as
a result of the ICMP policy. Typically, it
can be any incoming ICMPv4 packets if ICMPv4
processing is disabled or incoming ICMPv4
packets that exceed the ICMPv4 rate-limit
threshold.
Discontinuities in the value of this counter can
occur at re-initialization of the management
system, and at other times as indicated by
the value of 'discontinuity-time'.";
}
leaf hairpin-ipv4-packets {
type yang:zero-based-counter64;
description
"IPv4 packets locally routed between two CEs
(hairpinned).
Discontinuities in the value of this counter can
occur at re-initialization of the management
system, and at other times as indicated by
the value of 'discontinuity-time'.";
}
leaf hairpin-ipv4-bytes {
type yang:zero-based-counter64;
description
"IPv4 bytes locally routed between two CEs
(hairpinned).
Discontinuities in the value of this counter can
occur at re-initialization of the management
system, and at other times as indicated by
the value of 'discontinuity-time'.";
}
leaf active-softwire-num {
type uint32;
config false;
description
"The number of currently active softwires on the
binding instance.
Discontinuities in the value of this counter can
occur at re-initialization of the management
system, and at other times as indicated by
the value of 'discontinuity-time'.";
}
}
}
}
}
case algo {
if-feature "map-e or map-t";
container algorithm {
description
" A set of parameters used for MAP-E/MAP-T.";
list algo-instance {
key "name";
description
"Instances of algorithm";
leaf name {
type string;
mandatory true;
description
"The name is used to uniquely identify an algorithm
instance.
This name can be automatically assigned
or explicitly configured.";
}
uses softwire-common:algorithm-instance;
container port-set {
description
"Indicates a set of ports.";
uses port-set;
}
container traffic-stat {
config false;
description
"Traffic statistics information for the BR.";
leaf discontinuity-time {
type yang:date-and-time;
mandatory true;
description
"The time of the most recent occasion on which the BR
instance suffered a discontinuity. This must be
reset to the current date-and-time when the BR
instance is configured or rebooted.";
}
uses softwire-common:traffic-stat;
}
}
}
}
}
}
/*
* Notifications
*/
notification softwire-binding-instance-event {
if-feature "binding-mode";
description
"Notifications for binding instance when an entry is
added, modified, or is not valid anymore.";
leaf bind-name {
type leafref {
path "/br-instances/binding/bind-instance/name";
}
description
"The name of the binding-instance that
generated the notification.";
}
leaf-list invalid-entry {
type leafref {
path
"/br-instances/binding/"
+ "bind-instance[name=current()/../bind-name]/"
+ "binding-table/binding-entry/binding-ipv6info";
}
description
"Notify the client that a specific binding entry has
expired or is invalid. The binding-ipv6info identifies
an entry.";
}
leaf-list added-entry {
type inet:ipv6-address;
description
"Notify the client that a binding entry has been added.
The ipv6 address of that entry is the index. The client
gets other information from the binding BR about the entry
indexed by that ipv6 address.";
}
leaf-list modified-entry {
type leafref {
path
"/br-instances/binding/"
+ "bind-instance[name=current()/../bind-name]/"
+ "binding-table/binding-entry/binding-ipv6info";
}
description
"The binding-table entry that has been modified.";
}
}
notification softwire-algorithm-instance-event {
if-feature "map-e or map-t";
description
"Notifications for algorithm instance when an entry is
added, modified, or is not valid anymore.";
leaf algo-name {
type leafref {
path "/br-instances/algorithm/algo-instance/name";
}
mandatory true;
description
"algorithmic instance event.";
}
leaf-list invalid-entry {
type leafref {
path "/br-instances/algorithm/algo-instance/name";
}
description
"Invalid entry event.";
}
leaf-list added-entry {
type leafref {
path "/br-instances/algorithm/algo-instance/name";
}
description
"Added entry.";
}
leaf-list modified-entry {
type leafref {
path "/br-instances/algorithm/algo-instance/name";
}
description
"Modified entry.";
}
}
}