idnits 2.17.1 draft-ietf-dhc-dhcpv6-yang-10.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 247 has weird spacing: '...on-code uin...' == Line 317 has weird spacing: '...fix-len uin...' == Line 332 has weird spacing: '...s-count uin...' == Line 334 has weird spacing: '...nt-duid bin...' == Line 376 has weird spacing: '...fix-len uin...' == (15 more instances...) -- The document date (4 November 2019) is 1632 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) No issues found here. Summary: 0 errors (**), 0 flaws (~~), 7 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 DHC Working Group Y. Cui 3 Internet-Draft L. Sun 4 Intended status: Standards Track Tsinghua University 5 Expires: 7 May 2020 I.F. Farrer 6 S.Z. Zechlin 7 Deutsche Telekom AG 8 Z. He 9 Tsinghua University 10 M.N. Nowikowski 11 Internet Systems Consortium 12 4 November 2019 14 YANG Data Model for DHCPv6 Configuration 15 draft-ietf-dhc-dhcpv6-yang-10 17 Abstract 19 This document describes several YANG data modules for the 20 configuration and management of DHCPv6 servers, relays, and clients. 22 Requirements Language 24 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 25 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 26 "OPTIONAL" in this document are to be interpreted as described in BCP 27 14 [RFC2119] [RFC8174] when, and only when, they appear in all 28 capitals, as shown here. 30 Status of This Memo 32 This Internet-Draft is submitted in full conformance with the 33 provisions of BCP 78 and BCP 79. 35 Internet-Drafts are working documents of the Internet Engineering 36 Task Force (IETF). Note that other groups may also distribute 37 working documents as Internet-Drafts. The list of current Internet- 38 Drafts is at https://datatracker.ietf.org/drafts/current/. 40 Internet-Drafts are draft documents valid for a maximum of six months 41 and may be updated, replaced, or obsoleted by other documents at any 42 time. It is inappropriate to use Internet-Drafts as reference 43 material or to cite them other than as "work in progress." 45 This Internet-Draft will expire on 7 May 2020. 47 Copyright Notice 49 Copyright (c) 2019 IETF Trust and the persons identified as the 50 document authors. All rights reserved. 52 This document is subject to BCP 78 and the IETF Trust's Legal 53 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 54 license-info) in effect on the date of publication of this document. 55 Please review these documents carefully, as they describe your rights 56 and restrictions with respect to this document. Code Components 57 extracted from this document must include Simplified BSD License text 58 as described in Section 4.e of the Trust Legal Provisions and are 59 provided without warranty as described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 64 1.1. Scope . . . . . . . . . . . . . . . . . . . . . . . . . . 3 65 1.2. Extensibility of the DHCPv6 Server YANG Module . . . . . 3 66 1.2.1. DHCPv6 Option Definitions . . . . . . . . . . . . . . 4 67 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4 68 2. DHCPv6 Tree Diagrams . . . . . . . . . . . . . . . . . . . . 4 69 2.1. DHCPv6 Server Tree Diagram . . . . . . . . . . . . . . . 4 70 2.2. DHCPv6 Relay Tree Diagram . . . . . . . . . . . . . . . . 11 71 2.3. DHCPv6 Client Tree Diagram . . . . . . . . . . . . . . . 14 72 3. DHCPv6 YANG Model . . . . . . . . . . . . . . . . . . . . . . 17 73 3.1. DHCPv6 Server YANG Model . . . . . . . . . . . . . . . . 17 74 3.2. DHCPv6 Relay YANG Model . . . . . . . . . . . . . . . . . 29 75 3.3. DHCPv6 Client YANG Model . . . . . . . . . . . . . . . . 36 76 3.4. DHCPv6 RFC8415 Options YANG Model . . . . . . . . . . . . 45 77 3.5. DHCPv6 Common YANG Model . . . . . . . . . . . . . . . . 54 78 4. Security Considerations (TBD) . . . . . . . . . . . . . . . . 58 79 5. IANA Considerations (TBD) . . . . . . . . . . . . . . . . . . 58 80 6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 59 81 7. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 59 82 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 59 83 8.1. Normative References . . . . . . . . . . . . . . . . . . 59 84 8.2. Informative References . . . . . . . . . . . . . . . . . 60 85 Appendix A. Example of Adding New DHCPv6 Option 86 Definitions . . . . . . . . . . . . . . . . . . . . . . . 61 87 Appendix B. Example Vendor Specific Server Configuration 88 Module . . . . . . . . . . . . . . . . . . . . . . . . . 63 89 Appendix C. Example definition of class selector 90 configuration . . . . . . . . . . . . . . . . . . . . . . 68 91 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 73 93 1. Introduction 95 DHCPv6 [RFC8415] is widely used for supplying configuration and other 96 relevant parameters to clients in IPv6 networks. This document 97 defines DHCPv6 YANG modules for the configuration and management of 98 DHCPv6 servers, relays and clients. This document defines separate 99 'element' modules for each of these. 101 Additionally, a 'common' module contains typedefs and groupings used 102 by the element modules. A further module contains an initial set of 103 DHCPv6 option definitions. 105 It is worth noting that as DHCPv6 is itself a client configuration 106 protocol, it is not the intention of this document to replace the 107 allocation of DHCPv6 assigned addressing and parameters using 108 NETCONF/YANG. The DHCPv6 client model is intended for the 109 configuration and monitoring of the DHCPv6 client function and does 110 not affect the normal DHCPv6 message flow. 112 1.1. Scope 114 [RFC8415] describes the current version of the DHCPv6 base protocol 115 specification. In addition to this, a large number of addition 116 specifications have also been published, extending DHCPv6 element 117 functionality and adding new options. The YANG modules contained in 118 this document do not attempt to capture all of these extensions and 119 additions, rather to model the DHCPv6 functions and options covered 120 in [RFC8415]. A focus has also been given on the extensibility of 121 the modules so that it is easy to augment in additional functionality 122 as required by a particular implementation or deployment scenario. 124 1.2. Extensibility of the DHCPv6 Server YANG Module 126 The modules in this document only attempt to model DHCPv6 specific 127 behavior and do not cover the configuration and management of 128 functionality relevant for specific server implementations. The 129 level of variance between implementations is too great to attempt to 130 standardize in a way that is useful without being restrictive. 132 However, it is recognized that implementation specific configuration 133 and management is also an essential part of DHCP deployment and 134 operations. To resolve this, Appendix B contains an example YANG 135 module for the configuration of implementation specific functions, 136 illustrating how this functionality can be augmented into the main 137 ietf-dhcpv6-server.yang module. 139 In DHCPv6 the concept of 'class selection' for messages received by 140 the server is common. This is the identification and classification 141 of messages based on a number of parameters so that the correct 142 provisioning information can be supplied. For example, allocating a 143 prefix from the correct pool, or supplying a set of options relevant 144 for a specific vendor's client implementation. During the 145 development of this document, research has been carried out into a 146 number of vendor's class selection implementations and the findings 147 were that while this function is common to all, the method for 148 implementing this differs greatly. Therefore, configuration of the 149 class selection function has been omitted from the DHCPv6 server 150 module to allow implementors to define their own suitable YANG 151 module. Appendix C provides an example of this, to demonstrate how 152 this is can be integrated with the main "ietf-dhcpv6-server.yang" 153 module. 155 1.2.1. DHCPv6 Option Definitions 157 A large number of DHCPv6 options have been created in addition to 158 those defined in [RFC8415]. As implementations differ widely in 159 which DHCPv6 options that they support, the following approach has 160 been taken to defining options: Only the relevant set of DHCPv6 161 options defined in [RFC8415] are included in this document. Further 162 options definitions can be added by additional YANG modules via 163 augmentation into the relevant element modules from this document. 164 Appendix A contains an example module showing how the DHCPv6 option 165 definitions can be extended in this manner and provides guidance on 166 writing YANG modules for DHCPv6 options. 168 1.3. Terminology 170 The reader should be familiar with the YANG data modelling language 171 defined in [RFC7950]. 173 The YANG modules in this document adopt the Network Management 174 Datastore Architecture (NMDA) [RFC8342]. The meanings of the symbols 175 used in tree diagrams are defined in [RFC8340]. 177 The reader should be familiar with the terms defined in DHCPv6 178 [RFC8415] and other relevant documents. 180 2. DHCPv6 Tree Diagrams 182 2.1. DHCPv6 Server Tree Diagram 184 The tree diagram in Figure 1 provides an overview of the DHCPv6 185 server module. The tree also includes the augmentations of the 186 relevant option definitions from Section 3.4 and the common functions 187 module Section 3.5. 189 module: ietf-dhcpv6-server 190 +--rw dhcpv6-node-type? identityref 191 +--rw dhcpv6-server 192 +--rw server-duid 193 | +--rw type-code? uint16 194 | +--rw (duid-type)? 195 | | +--:(duid-llt) 196 | | | +--rw duid-llt-hardware-type? uint16 197 | | | +--rw duid-llt-time? yang:timeticks 198 | | | +--rw duid-llt-link-layer-address? 199 | | | yang:mac-address 200 | | +--:(duid-en) 201 | | | +--rw duid-en-enterprise-number? uint32 202 | | | +--rw duid-en-identifier? string 203 | | +--:(duid-ll) 204 | | | +--rw duid-ll-hardware-type? uint16 205 | | | +--rw duid-ll-link-layer-address? 206 | | | yang:mac-address 207 | | +--:(duid-uuid) 208 | | | +--rw uuid? yang:uuid 209 | | +--:(duid-unknown) 210 | | +--rw data? binary 211 | +--ro active-duid? binary 212 +--rw vendor-config 213 +--rw option-sets 214 | +--rw option-set* [option-set-id] 215 | +--rw option-set-id 216 | | uint32 217 | +--rw description? 218 | | string 219 | +--rw rfc3319:sip-server-domain-name-list-option 220 | | +--rw rfc3319:sip-serv-domain-name? 221 | | inet:domain-name 222 | +--rw rfc3319:sip-server-address-list-option 223 | | +--rw rfc3319:sip-server* [sip-serv-id] 224 | | +--rw rfc3319:sip-serv-id uint8 225 | | +--rw rfc3319:sip-serv-addr? inet:ipv6-address 226 | +--rw rfc8415:preference-option 227 | | +--rw rfc8415:pref-value? uint8 228 | +--rw rfc8415:auth-option 229 | | +--rw rfc8415:protocol? uint8 230 | | +--rw rfc8415:algorithm? uint8 231 | | +--rw rfc8415:rdm? uint8 232 | | +--rw rfc8415:replay-detection? uint64 233 | | +--rw rfc8415:auth-information? string 234 | +--rw rfc8415:server-unicast-option 235 | | +--rw rfc8415:server-address? inet:ipv6-address 236 | +--rw rfc8415:status-code-option 237 | | +--rw rfc8415:status-code? uint16 238 | | +--rw rfc8415:status-message? string 239 | +--rw rfc8415:rapid-commit-option! 240 | +--rw rfc8415:vendor-specific-information-option 241 | | +--rw rfc8415:vendor-specific-information-option-inst 242 ances* 243 | | [enterprise-number] 244 | | +--rw rfc8415:enterprise-number uint32 245 | | +--rw rfc8415:vendor-option-data* 246 | | [sub-option-code] 247 | | +--rw rfc8415:sub-option-code uint16 248 | | +--rw rfc8415:sub-option-data? string 249 | +--rw rfc8415:reconfigure-message-option 250 | | +--rw rfc8415:msg-type? uint8 251 | +--rw rfc8415:reconfigure-accept-option! 252 | +--rw rfc8415:info-refresh-time-option 253 | | +--rw rfc8415:info-refresh-time? 254 | | dhcpv6-common:timer-value-seconds32 255 | +--rw rfc8415:sol-max-rt-option 256 | | +--rw rfc8415:sol-max-rt-value? 257 | | dhcpv6-common:timer-value-seconds32 258 | +--rw rfc8415:inf-max-rt-option 259 | +--rw rfc8415:inf-max-rt-value? 260 | dhcpv6-common:timer-value-seconds32 261 +--rw class-selector 262 +--rw network-ranges 263 +--rw option-set-id* leafref 264 +--rw valid-lifetime 265 | dhcpv6-common:timer-value-seconds32 266 +--rw renew-time 267 | dhcpv6-common:timer-value-seconds32 268 +--rw rebind-time 269 | dhcpv6-common:timer-value-seconds32 270 +--rw preferred-lifetime 271 | dhcpv6-common:timer-value-seconds32 272 +--rw rapid-commit boolean 273 +--rw network-range* [network-range-id] 274 +--rw network-range-id uint32 275 +--rw network-description string 276 +--rw network-prefix inet:ipv6-prefix 277 +--rw option-set-id* leafref 278 +--rw valid-lifetime 279 | dhcpv6-common:timer-value-seconds32 280 +--rw renew-time 281 | dhcpv6-common:timer-value-seconds32 282 +--rw rebind-time 283 | dhcpv6-common:timer-value-seconds32 284 +--rw preferred-lifetime 285 | dhcpv6-common:timer-value-seconds32 286 +--rw rapid-commit boolean 287 +--rw address-pools 288 | +--rw address-pool* [pool-id] 289 | +--rw pool-id uint32 290 | +--rw pool-prefix inet:ipv6-prefix 291 | +--rw start-address 292 | | inet:ipv6-address-no-zone 293 | +--rw end-address 294 | | inet:ipv6-address-no-zone 295 | +--rw max-address-count 296 | | dhcpv6-common:threshold 297 | +--rw option-set-id* leafref 298 | +--rw valid-lifetime 299 | | dhcpv6-common:timer-value-seconds32 300 | +--rw renew-time 301 | | dhcpv6-common:timer-value-seconds32 302 | +--rw rebind-time 303 | | dhcpv6-common:timer-value-seconds32 304 | +--rw preferred-lifetime 305 | | dhcpv6-common:timer-value-seconds32 306 | +--rw rapid-commit boolean 307 | +--rw host-reservations 308 | | +--rw host-reservation* [reserved-addr] 309 | | +--rw client-duid? binary 310 | | +--rw reserved-addr 311 | | | inet:ipv6-address 312 | | +--rw prefix-reservation* 313 | | | [reserv-prefix-id] 314 | | | +--rw reserv-prefix-id uint32 315 | | | +--rw reserv-prefix 316 | | | | inet:ipv6-prefix 317 | | | +--rw reserv-prefix-len uint8 318 | | +--rw option-set-id* leafref 319 | | +--rw valid-lifetime 320 | | | dhcpv6-common:timer-value-seconds32 321 | | +--rw renew-time 322 | | | dhcpv6-common:timer-value-seconds32 323 | | +--rw rebind-time 324 | | | dhcpv6-common:timer-value-seconds32 325 | | +--rw preferred-lifetime 326 | | | dhcpv6-common:timer-value-seconds32 327 | | +--rw rapid-commit boolean 328 | +--ro active-leases* [leased-address] 329 | +--ro leased-address 330 | | inet:ipv6-address 331 | +--ro total-address-count uint64 332 | +--ro allocated-address-count uint64 333 | +--ro binding-info* [client-duid] 334 | +--ro client-duid binary 335 | +--ro iaid* [iaid] 336 | +--ro iaid uint32 337 | +--ro allocation-time? 338 | | yang:date-and-time 339 | +--ro last-renew-rebind? 340 | | yang:date-and-time 341 | +--ro preferred-lifetime? 342 | | dhcpv6-common:timer-value-seconds 343 32 344 | +--ro valid-lifetime? 345 | | dhcpv6-common:timer-value-seconds 346 32 347 | +--ro lease-t1? 348 | | dhcpv6-common:timer-value-seconds 349 32 350 | +--ro lease-t2? 351 | dhcpv6-common:timer-value-seconds 352 32 353 +--rw prefix-pools {prefix-delegation}? 354 | +--rw prefix-pool* [pool-id] 355 | +--rw pool-id uint32 356 | +--rw prefix 357 | | inet:ipv6-prefix 358 | +--rw prefix-length uint8 359 | +--rw max-pd-space-utilization 360 | | dhcpv6-common:threshold 361 | +--rw option-set-id* leafref 362 | +--rw valid-lifetime 363 | | dhcpv6-common:timer-value-seconds32 364 | +--rw renew-time 365 | | dhcpv6-common:timer-value-seconds32 366 | +--rw rebind-time 367 | | dhcpv6-common:timer-value-seconds32 368 | +--rw preferred-lifetime 369 | | dhcpv6-common:timer-value-seconds32 370 | +--rw rapid-commit boolean 371 | +--rw host-reservations 372 | +--rw prefix-reservation* [reserved-prefix] 373 | | +--rw client-duid? binary 374 | | +--rw reserved-prefix 375 | | | inet:ipv6-prefix 376 | | +--rw reserv-prefix-len uint8 377 | +--rw option-set-id* leafref 378 | +--rw valid-lifetime 379 | | dhcpv6-common:timer-value-seconds32 380 | +--rw renew-time 381 | | dhcpv6-common:timer-value-seconds32 382 | +--rw rebind-time 383 | | dhcpv6-common:timer-value-seconds32 384 | +--rw preferred-lifetime 385 | | dhcpv6-common:timer-value-seconds32 386 | +--rw rapid-commit boolean 387 | +--ro active-leases* [leased-prefix] 388 | +--ro leased-prefix 389 | | inet:ipv6-prefix 390 | +--ro total-address-count uint64 391 | +--ro allocated-address-count uint64 392 | +--ro binding-info* [client-duid] 393 | +--ro client-duid binary 394 | +--ro iaid* [iaid] 395 | +--ro iaid uint32 396 | +--ro allocation-time? 397 | | yang:date-and-time 398 | +--ro last-renew-rebind? 399 | | yang:date-and-time 400 | +--ro preferred-lifetime? 401 | | dhcpv6-common:timer-value-seco 402 nds32 403 | +--ro valid-lifetime? 404 | | dhcpv6-common:timer-value-seco 405 nds32 406 | +--ro lease-t1? 407 | | dhcpv6-common:timer-value-seco 408 nds32 409 | +--ro lease-t2? 410 | dhcpv6-common:timer-value-seco 411 nds32 412 +--ro solicit-count? uint32 413 +--ro advertise-count? uint32 414 +--ro request-count? uint32 415 +--ro confirm-count? uint32 416 +--ro renew-count? uint32 417 +--ro rebind-count? uint32 418 +--ro reply-count? uint32 419 +--rw release-count? uint32 420 +--ro decline-count? uint32 421 +--ro reconfigure-count? uint32 422 +--ro information-request-count? uint32 424 notifications: 425 +---n address-pool-running-out 426 | +--ro total-address-count uint64 427 | +--ro max-address-count uint64 428 | +--ro allocated-address-count uint64 429 | +--ro pool-id uint32 430 +---n pd-pool-running-out 431 | +--ro max-pd-space-utilization dhcpv6-common:threshold 432 | +--ro pd-space-utilization dhcpv6-common:threshold 433 | +--ro pool-id uint32 434 +---n invalid-client-detected 435 | +--ro duid? binary 436 | +--ro description? string 437 +---n decline-received 438 | +--ro duid? binary 439 | +--ro addresses* inet:ipv6-address 440 +---n non-success-code-sent 441 +--ro status-code uint16 442 +--ro duid? binary 444 Figure 1: DHCPv6 Server Data Model Structure 446 Description of important nodes: 448 * dhcpv6-node-type: The different functional DHCPv6 elements each 449 have their relevant identities. 451 * dhcpv6-server: This container holds the server's DHCPv6 specific 452 configuration. 454 * server-duid: Each server must have a DUID (DHCP Unique Identifier) 455 to identify itself to clients. A DUID consists of a two-octet 456 type field and an arbitrary length (of no more than 128-bytes) 457 content field. Currently there are four defined types of DUIDs in 458 [RFC8415] and [RFC6355]: DUID-LLT, DUID-EN, DUID-LL, and DUID- 459 UUID. DUID-Unknown is used for arbitrary DUID formats which do 460 not follow any of these defined types. 'active-duid' is a read- 461 only field that the server's current DUID can be retrieved from. 462 The DUID definitions are imported from the 'ietf- 463 dhcpv6-common.yang' module as they are also used by the 'ietf- 464 dhcpv6-client.yang' module. 466 * vendor-config: This container is provided as a location for 467 additional implementation specific YANG nodes for the 468 configuration of the device to be augmented. See Appendix B for 469 an example of this. 471 * option-sets: The server can be configured with multiple option- 472 sets. These are groups of DHCPv6 options with common parameters 473 which will be supplied to the intended clients. The 'option-set- 474 id' field is the key field which is referenced by the relevant 475 address or prefix pool configuration. 477 * option-set: Holds definitions for DHCPv6 options themselves. The 478 initial set of definitions are contained in the module 'ietf- 479 dhcpv6-options-rfc8415.yang' and are augmented into the server 480 module at this point. 482 * class-selector: This is provided as a location for additional 483 implementation specific YANG nodes for vendor specific class 484 selector nodes to be augmented. See Appendix C for an example of 485 this. 487 * network-ranges: This model uses a hierarchical model for the 488 allocation of addresses and prefixes. At the top level 'network- 489 ranges' holds global configuration parameters. Under this, a list 490 of 'network-ranges' can be defined. Inside 'network-rages', 491 'address-pools' (for IA_NA and IA_TA allocations), and 'prefix- 492 pools' (for IA_PD allocation) are defined. Finally within the 493 pools, specific host-reservations are held. 495 * prefix-pools: Defines prefix pools to be used for prefix 496 delegation to clients. As prefix delegation is not supported by 497 all DHCPv6 server implementations, it is enabled by a feature 498 statement. 500 Information about notifications: 502 * address/pd-pool-running-out: Raised when the address/prefix pool 503 is going to run out. A threshold for the utilization ratio of the 504 pool (max-address-count/max-pd-space utilization) has been defined 505 in the server features so that it will notify the administrator 506 when the utilization ratio reaches the threshold, and such 507 threshold is a settable parameter. 509 * invalid-client-detected: Raised when the server has found a client 510 which can be regarded as a potential attacker. A description may 511 also be included. 513 * decline-received: Raised when a DHCPv6 Decline message is received 514 from a client. 516 * non-success-code-sent: Raised when a status message is raised for 517 an error. 519 2.2. DHCPv6 Relay Tree Diagram 521 The tree diagram in Figure 2 provides an overview of the DHCPv6 relay 522 module. The tree also includes the augmentations of the relevant 523 option definitions from Section 3.4 and the common functions module 524 Section 3.5. 526 module: ietf-dhcpv6-relay 527 +--rw dhcpv6-node-type? identityref 528 +--rw dhcpv6-relay 529 +--rw relay-if* [if-name] 530 | +--rw if-name 531 | | if:interface-ref 532 | +--rw destination-addresses* 533 | | inet:ipv6-address 534 | +--rw link-address? binary 535 | +--rw relay-options 536 | | +--rw rfc8415:auth-option 537 | | | +--rw rfc8415:protocol? uint8 538 | | | +--rw rfc8415:algorithm? uint8 539 | | | +--rw rfc8415:rdm? uint8 540 | | | +--rw rfc8415:replay-detection? uint64 541 | | | +--rw rfc8415:auth-information? string 542 | | +--rw rfc8415:status-code-option 543 | | | +--rw rfc8415:status-code? uint16 544 | | | +--rw rfc8415:status-message? string 545 | | +--rw rfc8415:interface-id-option 546 | | +--rw rfc8415:interface-id? string 547 | +--ro solicit-received-count? uint32 548 | +--ro advertise-sent-count? uint32 549 | +--ro request-received-count? uint32 550 | +--ro confirm-received-count? uint32 551 | +--ro renew-received-count? uint32 552 | +--ro rebind-received-count? uint32 553 | +--ro reply-sent-count? uint32 554 | +--ro release-received-count? uint32 555 | +--ro decline-received-count? uint32 556 | +--ro reconfigure-sent-count? uint32 557 | +--ro information-request-received-count? uint32 558 | +--ro unknown-message-received-count? uint32 559 | +--ro unknown-message-sent-count? uint32 560 | +--ro discarded-message-count? uint32 561 | +--rw prefix-delegation! {prefix-delegation}? 562 | +--ro pd-leases* [ia-pd-prefix] 563 | +--ro ia-pd-prefix inet:ipv6-prefix 564 | +--ro last-renew? yang:date-and-time 565 | +--ro client-peer-address? inet:ipv6-address 566 | +--ro client-duid? binary 567 | +--ro server-duid? binary 568 +--ro relay-forward-sent-count? uint32 569 +--ro relay-forward-received-count? uint32 570 +--ro relay-reply-received-count? uint32 571 +--ro relay-forward-unknown-sent-count? uint32 572 +--ro relay-forward-unknown-received-count? uint32 573 +--ro discarded-message-count? uint32 575 notifications: 576 +---n relay-event 577 +--ro topology-change 578 +--ro relay-if-name? 579 | -> /dhcpv6-relay/relay-if/if-name 580 +--ro last-ipv6-addr? inet:ipv6-address 582 Figure 2: DHCPv6 Relay Data Model Structure 584 Description of important nodes: 586 * dhcpv6-node-type: The different functional DHCPv6 elements each 587 have their relevant identities. 589 * dhcpv6-relay: This container holds the relay's DHCPv6 specific 590 configuration. 592 * relay-if: As a relay may have multiple client-facing interfaces, 593 they are configured in a list. The if-name leaf is the key and is 594 an interface-ref to the applicable interface defined by the 'ietf- 595 interfaces' YANG module. 597 * destination-addresses: Defines a list of IPv6 addresses that 598 client messages will be relayed to. May include unicast or 599 multicast addresses. 601 * link-address: Allows the configuration of the value that the relay 602 will put into the link-address field of Relay-Forward messages. 604 * prefix-delegation: As prefix delegation is not supported by all 605 DHCPv6 relay implementations, it is enabled by this feature 606 statement where required. 608 * pd-leases: Contains read only nodes for holding information about 609 active delegated prefix leases. 611 * relay-options: As with the Server module, DHCPv6 options that can 612 be sent by the relay are augmented here. 614 Information about notifications: 616 * topology-changed: Raised when the topology of the relay agent is 617 changed, e.g. a client facing interface is reconfigured. 619 2.3. DHCPv6 Client Tree Diagram 621 The tree diagram in Figure 3 provides an overview of the DHCPv6 622 client module. The tree also includes the augmentations of the 623 relevant option definitions from Section 3.4 and the common functions 624 module Section 3.5. 626 module: ietf-dhcpv6-client 627 +--rw dhcpv6-node-type? identityref 628 +--rw dhcpv6-client 629 +--rw client-if* [if-name] 630 +--rw if-name 631 | if:interface-ref 632 +--rw type-code? uint16 633 +--rw (duid-type)? 634 | +--:(duid-llt) 635 | | +--rw duid-llt-hardware-type? uint16 636 | | +--rw duid-llt-time? yang:timeticks 637 | | +--rw duid-llt-link-layer-address? 638 | | yang:mac-address 639 | +--:(duid-en) 640 | | +--rw duid-en-enterprise-number? uint32 641 | | +--rw duid-en-identifier? string 642 | +--:(duid-ll) 643 | | +--rw duid-ll-hardware-type? uint16 644 | | +--rw duid-ll-link-layer-address? 645 | | yang:mac-address 646 | +--:(duid-uuid) 647 | | +--rw uuid? yang:uuid 648 | +--:(duid-unknown) 649 | +--rw data? binary 650 +--ro active-duid? binary 651 +--rw client-configured-options 652 | +--rw rfc8415:option-request-option 653 | | +--rw rfc8415:oro-option* uint16 654 | +--rw rfc8415:status-code-option 655 | | +--rw rfc8415:status-code? uint16 656 | | +--rw rfc8415:status-message? string 657 | +--rw rfc8415:rapid-commit-option! 658 | +--rw rfc8415:user-class-option 659 | | +--rw rfc8415:user-class-data* 660 | | [user-class-datum-id] 661 | | +--rw rfc8415:user-class-datum-id uint8 662 | | +--rw rfc8415:user-class-datum? string 663 | +--rw rfc8415:vendor-class-option 664 | | +--rw rfc8415:vendor-class-option-instances* 665 | | [enterprise-number] 666 | | +--rw rfc8415:enterprise-number uint32 667 | | +--rw rfc8415:vendor-class* 668 | | [vendor-class-datum-id] 669 | | +--rw rfc8415:vendor-class-datum-id uint8 670 | | +--rw rfc8415:vendor-class-datum? string 671 | +--rw rfc8415:vendor-specific-information-option 672 | | +--rw rfc8415:vendor-specific-information-option-inst 673 ances* 674 | | [enterprise-number] 675 | | +--rw rfc8415:enterprise-number uint32 676 | | +--rw rfc8415:vendor-option-data* 677 | | [sub-option-code] 678 | | +--rw rfc8415:sub-option-code uint16 679 | | +--rw rfc8415:sub-option-data? string 680 | +--rw rfc8415:reconfigure-accept-option! 681 +--rw ia-na* [iaid] 682 | +--rw iaid uint32 683 | +--rw ia-na-options 684 | +--ro lease-state 685 | +--ro ia-na-address? inet:ipv6-address 686 | +--ro preferred-lifetime? 687 | | dhcpv6-common:timer-value-seconds32 688 | +--ro valid-lifetime? 689 | | dhcpv6-common:timer-value-seconds32 690 | +--ro lease-t1? 691 | | dhcpv6-common:timer-value-seconds32 692 | +--ro lease-t2? 693 | | dhcpv6-common:timer-value-seconds32 694 | +--ro allocation-time? yang:date-and-time 695 | +--ro last-renew-rebind? yang:date-and-time 696 | +--ro server-duid? binary 697 +--rw ia-ta* [iaid] 698 | +--rw iaid uint32 699 | +--rw ia-ta-options 700 | +--ro lease-state 701 | +--ro ia-ta-address? inet:ipv6-address 702 | +--ro preferred-lifetime? 703 | | dhcpv6-common:timer-value-seconds32 704 | +--ro valid-lifetime? 705 | | dhcpv6-common:timer-value-seconds32 706 | +--ro allocation-time? yang:date-and-time 707 | +--ro last-renew-rebind? yang:date-and-time 708 | +--ro server-duid? binary 709 +--rw ia-pd* [iaid] 710 | +--rw iaid uint32 711 | +--rw ia-pd-options 712 | +--ro lease-state 713 | +--ro ia-pd-prefix? inet:ipv6-prefix 714 | +--ro preferred-lifetime? 715 | | dhcpv6-common:timer-value-seconds32 716 | +--ro valid-lifetime? 717 | | dhcpv6-common:timer-value-seconds32 718 | +--ro lease-t1? 719 | | dhcpv6-common:timer-value-seconds32 720 | +--ro lease-t2? 721 | | dhcpv6-common:timer-value-seconds32 722 | +--ro allocation-time? yang:date-and-time 723 | +--ro last-renew-rebind? yang:date-and-time 724 | +--ro server-duid? binary 725 +--ro solicit-count? uint32 726 +--ro advertise-count? uint32 727 +--ro request-count? uint32 728 +--ro confirm-count? uint32 729 +--ro renew-count? uint32 730 +--ro rebind-count? uint32 731 +--ro reply-count? uint32 732 +--rw release-count? uint32 733 +--ro decline-count? uint32 734 +--ro reconfigure-count? uint32 735 +--ro information-request-count? uint32 737 notifications: 738 +---n invalid-ia-detected 739 | +--ro iaid uint32 740 | +--ro description? string 741 +---n retransmission-failed 742 | +--ro failure-type enumeration 743 +---n unsuccessful-status-code 744 | +--ro status-code uint16 745 | +--ro server-duid binary 746 +---n server-duid-changed 747 +--ro new-server-duid binary 748 +--ro previous-server-duid binary 749 +--ro lease-ia-na? 750 | -> /dhcpv6-client/client-if/ia-na/iaid 751 +--ro lease-ia-ta? 752 | -> /dhcpv6-client/client-if/ia-ta/iaid 753 +--ro lease-ia-pd? 754 -> /dhcpv6-client/client-if/ia-pd/iaid 756 Figure 3: DHCPv6 Client Data Model Structure 758 Description of important nodes: 760 * dhcpv6-node-type: The different functional DHCPv6 elements each 761 have their relevant identities. 763 * dhcpv6-client: This container holds the client's DHCPv6 specific 764 configuration. 766 * client-if: As a client may have multiple interfaces requesting 767 configuration over DHCP, they are configured in a list. The if- 768 name leaf is the key and is an interface-ref to the applicable 769 interface defined by the 'ietf-interfaces' YANG module. 771 * client-duid: Each DHCP client must have a DUID (DHCP Unique 772 Identifier) to identify itself to clients. A DUID consists of a 773 two-octet type field and an arbitrary length (of no more than 774 128-bytes) content field. Currently there are four defined types 775 of DUIDs in [RFC8415]: DUID-LLT, DUID-EN, DUID-LL, and DUID-UUID. 776 DUID-Unknown is used for arbitrary DUID formats which do not 777 follow any of these defined types. 'active-duid' is a read-only 778 field that the client's current DUID can be retrieved from. The 779 DUID definitions are imported from the 'ietf-dhcpv6-common.yang' 780 module. DUID is configured under the 'client-if' to allow a 781 client to have different DUIDs for each interface if required. 783 * ia-na, ia-ta, ia-pd: Contains configuration nodes relevant for 784 requesting one or more of each of the lease types. Also contains 785 read only nodes related to active leases. 787 Information about notifications: 789 * invalid-ia-detected: Raised when the identity association of the 790 client can be proved to be invalid. Possible condition includes 791 duplicated address, illegal address, etc. 793 * retransmission-failed: Raised when the retransmission mechanism 794 defined in [RFC8415] is failed. 796 * failed-status-turn-up: Raised when the client receives a message 797 includes an unsuccessful Status Code option. 799 3. DHCPv6 YANG Model 801 3.1. DHCPv6 Server YANG Model 803 This module imports typedefs from [RFC6991], [RFC8343]. 805 module ietf-dhcpv6-server { 806 yang-version 1.1; 807 namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-server"; 808 prefix "dhcpv6-server"; 810 import ietf-inet-types { 811 prefix inet; 812 } 813 import ietf-yang-types { 814 prefix yang; 815 } 816 import ietf-dhcpv6-common { 817 prefix dhcpv6-common; 818 } 820 organization "DHC WG"; 821 contact 822 "cuiyong@tsinghua.edu.cn 823 lh.sunlinh@gmail.com 824 ian.farrer@telekom.de 825 sladjana.zechlin@telekom.de 826 hezihao9512@gmail.com 827 godfryd@isc.org"; 829 description "This is a YANG data module for the configuration 830 and management of DHCPv6 servers. 832 Copyright (c) 2018 IETF Trust and the persons identified as 833 authors of the code. All rights reserved. 835 Redistribution and use in source and binary forms, with or 836 without modification, is permitted pursuant to, and subject 837 to the license terms contained in, the Simplified BSD License 838 set forth in Section 4.c of the IETF Trust's Legal Provisions 839 Relating to IETF Documents 840 (http://trustee.ietf.org/license-info). 842 This version of this YANG module is part of RFC 8513; see 843 the RFC itself for full legal notices."; 845 revision 2018-09-04 { 846 description ""; 847 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 848 } 850 revision 2018-03-04 { 851 description "Resolved most issues on the DHC official 852 github"; 853 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 854 } 856 revision 2017-12-22 { 857 description "Resolve most issues on Ian's github."; 858 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 860 } 862 revision 2017-11-24 { 863 description "First version of the separated server specific 864 YANG model."; 865 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 866 } 868 /* 869 * Typedef 870 */ 872 identity server { 873 base "dhcpv6-common:dhcpv6-node"; 874 description "DHCPv6 server."; 875 } 877 leaf dhcpv6-node-type { 878 description "Type for a DHCPv6 server"; 879 type identityref { 880 base "dhcpv6-server:server"; 881 } 882 } 884 feature prefix-delegation { 885 description "Enable if the server implements prefix delegation."; 886 } 888 grouping resource-config { 889 description "Nodes that are reused by multiple levels 890 in the DHCPv6 server's addressing hierarchy."; 891 leaf-list option-set-id { 892 type leafref { 893 path "/dhcpv6-server/option-sets/option-set/option-set-id"; 894 } 895 description "The ID field of relevant option-set 896 to be provisioned to clients of this network-range."; 897 } 898 leaf valid-lifetime { 899 type dhcpv6-common:timer-value-seconds32; 900 mandatory true; 901 description "Valid lifetime for the IA."; 902 } 903 leaf renew-time { 904 type dhcpv6-common:timer-value-seconds32; 905 mandatory true; 906 description "Renew (T1) time."; 907 } 908 leaf rebind-time { 909 type dhcpv6-common:timer-value-seconds32; 910 mandatory true; 911 description "Rebind (T2) time."; 912 } 913 leaf preferred-lifetime { 914 type dhcpv6-common:timer-value-seconds32; 915 mandatory true; 916 description "Preferred lifetime for the IA"; 917 } 918 leaf rapid-commit { 919 type boolean; 920 mandatory true; 921 description "A value of 1 specifies that the pool supports 922 client-server exchanges involving two messages."; 923 } 924 } 926 grouping lease-information { 927 leaf total-address-count { 928 type uint64; 929 mandatory true; 930 description "count of total addresses in the pool"; 931 } 932 leaf allocated-address-count { 933 type uint64; 934 mandatory true; 935 description "count of allocated addresses in the pool"; 936 } 937 list binding-info { 938 key client-duid; 939 description "Records binding information for each client that 940 has previously been allocated IPv6 addresses."; 941 leaf client-duid { 942 description "Client DUID."; 943 type binary; 944 } 945 list iaid { 946 key iaid; 947 description "Clients IAID."; 948 leaf iaid { 949 type uint32; 950 mandatory true; 951 description "IAID"; 952 } 953 leaf allocation-time { 954 description "Time and date that the lease was made."; 955 type yang:date-and-time; 957 } 958 leaf last-renew-rebind { 959 description "Time of the last successful renew or rebind."; 960 type yang:date-and-time; 961 } 962 leaf preferred-lifetime { 963 description "The preferred lifetime expressed in units 964 of seconds."; 965 type dhcpv6-common:timer-value-seconds32; 966 } 967 leaf valid-lifetime { 968 description "The valid lifetime for the leased prefix 969 expressed in units of seconds."; 970 type dhcpv6-common:timer-value-seconds32; 971 } 972 leaf lease-t1 { 973 description "The time interval after which the client 974 should contact the server from which the addresses 975 in the IA_NA were obtained to extend the lifetimes 976 of the addresses assigned to the IA_PD."; 977 type dhcpv6-common:timer-value-seconds32; 978 } 979 leaf lease-t2 { 980 description "The time interval after which the client 981 should contact any available server to extend 982 the lifetimes of the addresses assigned to the IA_PD."; 983 type dhcpv6-common:timer-value-seconds32; 984 } 985 } 986 } 987 } 989 grouping message-stats { 990 description "Counters for DHCPv6 messages."; 991 leaf solicit-count { 992 config "false"; 993 type uint32; 994 description "Number of Solicit (1) messages received."; 995 } 996 leaf advertise-count { 997 config "false"; 998 type uint32; 999 description "Number of Advertise (2) messages sent."; 1000 } 1001 leaf request-count { 1002 config "false"; 1003 type uint32; 1004 description "Number of Request (3) messages received."; 1006 } 1007 leaf confirm-count { 1008 config "false"; 1009 type uint32; 1010 description "Number of Confirm (4) messages received."; 1011 } 1012 leaf renew-count { 1013 config "false"; 1014 type uint32; 1015 description "Number of Renew (5) messages received."; 1016 } 1017 leaf rebind-count { 1018 config "false"; 1019 type uint32; 1020 description "Number of Rebind (6) messages received."; 1021 } 1022 leaf reply-count { 1023 config "false"; 1024 type uint32; 1025 description "Number of Reply (7) messages sent."; 1026 } 1027 leaf release-count { 1028 type uint32; 1029 description "Number of Release (8) messages received."; 1030 } 1031 leaf decline-count { 1032 config "false"; 1033 type uint32; 1034 description "Number of Decline (9) messages received."; 1035 } 1036 leaf reconfigure-count { 1037 config "false"; 1038 type uint32; 1039 description "Number of Reconfigure (10) messages sent."; 1040 } 1041 leaf information-request-count { 1042 config "false"; 1043 type uint32; 1044 description "Number of Information-request (11) messages 1045 received."; 1046 } 1047 } 1049 /* 1050 * Data Nodes 1051 */ 1052 container dhcpv6-server { 1053 container server-duid { 1054 description "DUID of the server."; 1055 uses dhcpv6-common:duid; 1056 } 1057 container vendor-config { 1058 description "This container provides a location for augmenting 1059 vendor or implementation specific configuration nodes."; 1060 } 1061 container option-sets { 1062 description "A server may allow different option sets 1063 to be configured for clients matching specific parameters 1064 such as topological location or client type. The 'option-set' 1065 list is a set of options and their contents that 1066 will be returned to clients."; 1067 list option-set { 1068 key option-set-id; 1069 description "YANG definitions for DHCPv6 options are 1070 contained in separate YANG modules and augmented to this 1071 container as required."; 1072 leaf option-set-id { 1073 type uint32; 1074 description "Option set identifier."; 1075 } 1076 leaf description { 1077 type string; 1078 description "An optional field for storing additional 1079 information relevant to the option set."; 1080 } 1081 } 1082 } 1084 container class-selector { 1085 description "DHCPv6 servers use a 'class-selector' function 1086 in order to identify and classify incoming client messages 1087 so that they can be given the correct configuration. 1088 The mechanisms used for implementing this function vary 1089 greatly between different implementations such that they are 1090 not possible to include in this module. This container 1091 provides a location for server implementors to augment their 1092 own class-selector YANG."; 1093 } 1095 container network-ranges { 1096 description "This model supports a hierarchy to achieve dynamic 1097 configuration. That is to say we could configure the server 1098 at different levels through this model. The top level is 1099 a global level which is defined as the container 1100 'network-ranges'. The following levels are defined 1101 as sub-containers under it. The 'network-ranges' contains the 1102 parameters (e.g. option-sets) that would be allocated to 1103 all the clients served by this server."; 1104 uses resource-config; 1105 list network-range { 1106 key network-range-id; 1107 description "Under the 'network-ranges' container, 1108 a 'network-range' list is defined to configure the server 1109 at a network level which is also considered as the second 1110 level. Different network are identified by the key 1111 'network-range-id'. This is because a server may have 1112 different configuration parameters (e.g. option sets) 1113 for different networks."; 1114 leaf network-range-id { 1115 type uint32; 1116 mandatory true; 1117 description "Equivalent to subnet ID"; 1118 } 1119 leaf network-description { 1120 type string; 1121 mandatory true; 1122 description "Description of the network range."; 1123 } 1124 leaf network-prefix { 1125 type inet:ipv6-prefix; 1126 mandatory true; 1127 description "Network prefix"; 1128 } 1129 uses resource-config; 1130 container address-pools { 1131 description 1132 "A container that describes the DHCPv6 server's 1133 address pools."; 1134 list address-pool { 1135 key pool-id; 1136 description "A DHCPv6 server can be configured with 1137 several address pools. This list defines such address 1138 pools which are distinguished by the key called 1139 'pool-id'."; 1140 leaf pool-id { 1141 type uint32; 1142 mandatory true; 1143 description "Pool ID"; 1144 } 1145 leaf pool-prefix { 1146 type inet:ipv6-prefix; 1147 mandatory true; 1148 description "Pool prefix"; 1149 } 1150 leaf start-address { 1151 type inet:ipv6-address-no-zone; 1152 mandatory true; 1153 description "Start address"; 1154 } 1155 leaf end-address { 1156 type inet:ipv6-address-no-zone; 1157 mandatory true; 1158 description "End address"; 1159 } 1160 leaf max-address-count { 1161 type dhcpv6-common:threshold; 1162 mandatory true; 1163 description "Maximum count of addresses that can 1164 be allocated in this pool. This value may be 1165 less than count of total addresses."; 1166 } 1167 uses resource-config; 1168 container host-reservations { 1169 description "Configuration for host reservations 1170 in the address pool."; 1171 list host-reservation { 1172 key reserved-addr; 1173 leaf client-duid { 1174 type binary; 1175 description "Client DUID."; 1176 } 1177 leaf reserved-addr { 1178 type inet:ipv6-address; 1179 description "reserved addr"; 1180 } 1181 list prefix-reservation { 1182 key reserv-prefix-id; 1183 description "reserved prefix reservation"; 1184 leaf reserv-prefix-id { 1185 type uint32; 1186 mandatory true; 1187 description "reserved prefix id"; 1188 } 1189 leaf reserv-prefix { 1190 type inet:ipv6-prefix; 1191 mandatory true; 1192 description "reserved prefix"; 1193 } 1194 leaf reserv-prefix-len { 1195 type uint8; 1196 mandatory true; 1197 description "reserved prefix length"; 1199 } 1200 } 1201 uses resource-config; 1202 } 1203 } 1204 list active-leases { 1205 description "Holds state for active client leases."; 1206 config false; 1207 key leased-address; 1208 leaf leased-address { 1209 type inet:ipv6-address; 1210 } 1211 uses lease-information; 1212 } 1213 } 1214 } 1215 container prefix-pools { 1216 description "Defines IPv6 prefix pools to be delegated 1217 to clients."; 1218 if-feature prefix-delegation; 1219 list prefix-pool { 1220 key pool-id; 1221 description "A server can be configured with multiple 1222 prefix pools."; 1223 leaf pool-id { 1224 type uint32; 1225 mandatory true; 1226 description "Unique identifier for the pool."; 1227 } 1228 leaf prefix { 1229 type inet:ipv6-prefix; 1230 mandatory true; 1231 description "IPv6 prefix"; 1232 } 1233 leaf prefix-length { 1234 type uint8; 1235 mandatory true; 1236 description "Length of prefixes that will be delegated 1237 to clients."; 1238 } 1239 leaf max-pd-space-utilization { 1240 type dhcpv6-common:threshold; 1241 mandatory true; 1242 description "Maximum utilization of PD space 1243 in this pool"; 1244 } 1245 uses resource-config; 1246 container host-reservations { 1247 description "Configuration for host reservations 1248 in the prefix pool."; 1249 list prefix-reservation { 1250 description "reserved prefix reservation"; 1251 key reserved-prefix; 1252 leaf client-duid { 1253 type binary; 1254 description "Client DUID."; 1255 } 1256 leaf reserved-prefix { 1257 type inet:ipv6-prefix; 1258 mandatory true; 1259 description "reserved prefix"; 1260 } 1261 leaf reserv-prefix-len { 1262 type uint8; 1263 mandatory true; 1264 description "reserved prefix length"; 1265 } 1266 } 1267 uses resource-config; 1268 list active-leases { 1269 description "Holds state for active client leases."; 1270 config false; 1271 key leased-prefix; 1272 leaf leased-prefix{ 1273 type inet:ipv6-prefix; 1274 } 1275 uses lease-information; 1276 } 1277 } 1278 } 1279 } 1280 uses message-stats; 1281 } 1282 } 1283 } 1285 /* 1286 * Notifications 1287 */ 1289 notification address-pool-running-out { 1290 description "Notification sent when the address pool is going to 1291 run out. A threshold for utilization ratio of the pool has 1292 been defined in the server feature so that it will notify the 1293 administrator when the utilization ratio reaches the 1294 threshold, and such threshold is a settable parameter"; 1296 leaf total-address-count { 1297 type uint64; 1298 mandatory true; 1299 description "Count of total addresses in the pool"; 1300 } 1301 leaf max-address-count { 1302 type uint64; 1303 mandatory true; 1304 description "Maximum count of addresses that can be allocated 1305 in the pool. This value may be less than count of total 1306 addresses"; 1307 } 1308 leaf allocated-address-count { 1309 type uint64; 1310 mandatory true; 1311 description "Count of allocated addresses in the pool"; 1312 } 1313 leaf pool-id { 1314 type uint32; 1315 mandatory true; 1316 description "Pool ID"; 1317 } 1318 } 1320 notification pd-pool-running-out { 1321 description "Notification sent when the address/prefix pool 1322 is going to run out. A threshold for utilization ratio 1323 of the pool has been defined in the server feature so that 1324 it will notify the administrator when the utilization ratio 1325 reaches the threshold, and such threshold is a settable 1326 parameter"; 1327 leaf max-pd-space-utilization { 1328 type dhcpv6-common:threshold; 1329 mandatory true; 1330 description "Maximum PD space utilization"; 1331 } 1332 leaf pd-space-utilization { 1333 type dhcpv6-common:threshold; 1334 mandatory true; 1335 description "Current PD space utilization"; 1336 } 1337 leaf pool-id { 1338 type uint32; 1339 mandatory true; 1340 description "Pool ID"; 1341 } 1342 } 1343 notification invalid-client-detected { 1344 description "Notification sent when the server has found a client 1345 which can be regarded as a potential attacker. Some description 1346 could also be included."; 1347 leaf duid { 1348 description "Client's DUID"; 1349 type binary; 1350 } 1351 leaf description { 1352 type string; 1353 description "Description of the event"; 1354 } 1355 } 1357 notification decline-received { 1358 description "Notification sent when the server has received 1359 DECLINE message from a client."; 1360 leaf duid { 1361 description "Client's DUID"; 1362 type binary; 1363 } 1364 leaf-list addresses { 1365 type inet:ipv6-address; 1366 description "List of suspicious addresses"; 1367 } 1368 } 1370 notification non-success-code-sent { 1371 description "Notification sent when the server responded 1372 to a client with non-success status code."; 1373 leaf status-code { 1374 type uint16; 1375 mandatory true; 1376 description "Status code returned to a client"; 1377 } 1378 leaf duid { 1379 description "Client's DUID"; 1380 type binary; 1381 } 1382 } 1383 } 1385 3.2. DHCPv6 Relay YANG Model 1387 This module imports typedefs from [RFC6991], [RFC8343]. 1389 module ietf-dhcpv6-relay { 1390 yang-version 1.1; 1391 namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-relay"; 1392 prefix "dhcpv6-relay"; 1394 import ietf-inet-types { 1395 prefix inet; 1396 } 1397 import ietf-yang-types { 1398 prefix yang; 1399 } 1400 import ietf-dhcpv6-common { 1401 prefix dhcpv6-common; 1402 } 1403 import ietf-interfaces { 1404 prefix if; 1405 } 1407 organization 1408 "IETF DHC (Dynamic Host Configuration) Working group"; 1410 contact 1411 "cuiyong@tsinghua.edu.cn 1412 lh.sunlinh@gmail.com 1413 ian.farrer@telekom.de 1414 sladjana.zechlin@telekom.de 1415 hezihao9512@gmail.com 1416 godfryd@isc.org"; 1418 description 1419 "This model defines a YANG data model that can be 1420 used to configure and manage a DHCPv6 relay. 1422 Copyright (c) 2018 IETF Trust and the persons identified as 1423 authors of the code. All rights reserved. 1425 Redistribution and use in source and binary forms, with or 1426 without modification, is permitted pursuant to, and subject 1427 to the license terms contained in, the Simplified BSD License 1428 set forth in Section 4.c of the IETF Trust's Legal Provisions 1429 Relating to IETF Documents 1430 (http://trustee.ietf.org/license-info). 1432 This version of this YANG module is part of RFC 8513; see 1433 the RFC itself for full legal notices."; 1435 revision 2019-09-20 { 1436 description ""; 1437 reference "I-D: draft-ietf-dhc-dhcpv6-yang-10"; 1438 } 1440 revision 2018-03-04 { 1441 description "Resolved most issues on the DHC official 1442 github"; 1443 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 1444 } 1446 revision 2017-12-22 { 1447 description 1448 "Resolve most issues on Ians Github."; 1449 reference 1450 "I-D: draft-ietf-dhc-dhcpv6-yang"; 1451 } 1453 revision 2017-11-24 { 1454 description 1455 "First version of the separated relay specific 1456 YANG model."; 1457 reference 1458 "I-D: draft-ietf-dhc-dhcpv6-yang"; 1459 } 1461 identity relay { 1462 base "dhcpv6-common:dhcpv6-node"; 1463 description "DHCPv6 relay agent."; 1464 } 1466 leaf dhcpv6-node-type { 1467 description "Type for a DHCPv6 relay"; 1468 type identityref { 1469 base "dhcpv6-relay:relay"; 1470 } 1471 } 1473 feature prefix-delegation { 1474 description "Enable if the relay functions as a delegating router 1475 for prefix delegation."; 1476 } 1478 grouping pd-lease-state { 1479 description "State data for the relay"; 1480 list pd-leases { 1481 config false; 1482 key ia-pd-prefix; 1483 description "Information about an active IA_PD prefix 1484 delegation."; 1486 leaf ia-pd-prefix { 1487 description "Prefix that is delegated."; 1488 type inet:ipv6-prefix; 1489 } 1490 leaf last-renew { 1491 description "Time of the last successful refresh or renew 1492 of the delegated prefix."; 1493 type yang:date-and-time; 1494 } 1495 leaf client-peer-address { 1496 description "Peer-address of the client."; 1497 type inet:ipv6-address; 1498 } 1499 leaf client-duid { 1500 description "DUID of the client."; 1501 type binary; 1502 } 1503 leaf server-duid { 1504 description "DUID of the delegating server."; 1505 type binary; 1506 } 1507 } 1508 } 1510 grouping message-statistics { 1511 description "Contains counters for DHCPv6 messages."; 1512 leaf solicit-received-count { 1513 config "false"; 1514 type uint32; 1515 description "Number of Solicit (1) messages received."; 1516 } 1517 leaf advertise-sent-count { 1518 config "false"; 1519 type uint32; 1520 description "Number of Advertise (2) messages sent."; 1521 } 1522 leaf request-received-count { 1523 config "false"; 1524 type uint32; 1525 description "Number of Request (3) messages received."; 1526 } 1527 leaf confirm-received-count { 1528 config "false"; 1529 type uint32; 1530 description "Number of Confirm (4) messages received."; 1531 } 1532 leaf renew-received-count { 1533 config "false"; 1534 type uint32; 1535 description "Number of Renew (5) messages received."; 1536 } 1537 leaf rebind-received-count { 1538 config "false"; 1539 type uint32; 1540 description "Number of Rebind (6) messages received."; 1541 } 1542 leaf reply-sent-count { 1543 config "false"; 1544 type uint32; 1545 description "Number of Reply (7) messages received."; 1546 } 1547 leaf release-received-count { 1548 config "false"; 1549 type uint32; 1550 description "Number of Release (8) messages sent."; 1551 } 1552 leaf decline-received-count { 1553 config "false"; 1554 type uint32; 1555 description "Number of Decline (9) messages sent."; 1556 } 1557 leaf reconfigure-sent-count { 1558 config "false"; 1559 type uint32; 1560 description "Number of Reconfigure (10) messages sent."; 1561 } 1562 leaf information-request-received-count { 1563 config "false"; 1564 type uint32; 1565 description "Number of Information-request (11) messages 1566 received."; 1567 } 1568 leaf unknown-message-received-count { 1569 config "false"; 1570 type uint32; 1571 description 1572 "Number of messages of unknown type that have been received." 1573 ; 1574 } 1575 leaf unknown-message-sent-count { 1576 config "false"; 1577 type uint32; 1578 description 1579 "Number of messages of unknown type that have been sent."; 1580 } 1581 leaf discarded-message-count { 1582 config "false"; 1583 type uint32; 1584 description 1585 "Number of messages that have been discarded for any reason." 1586 ; 1587 } 1588 } 1590 grouping global-statistics { 1591 leaf relay-forward-sent-count { 1592 config "false"; 1593 type uint32; 1594 description "Number of Relay-forward (12) messages sent."; 1595 } 1596 leaf relay-forward-received-count { 1597 config "false"; 1598 type uint32; 1599 description "Number of Relay-forward (12) messages received."; 1600 } 1601 leaf relay-reply-received-count { 1602 config "false"; 1603 type uint32; 1604 description "Number of Relay-reply (13) messages received."; 1605 } 1606 leaf relay-forward-unknown-sent-count { 1607 config "false"; 1608 type uint32; 1609 description "Number of Relay-forward (12) messages containing 1610 a message of unknown type sent."; 1611 } 1612 leaf relay-forward-unknown-received-count { 1613 config "false"; 1614 type uint32; 1615 description "Number of Relay-forward (12) messages containing 1616 a message of unknown type received."; 1617 } 1618 leaf discarded-message-count { 1619 config "false"; 1620 type uint32; 1621 description "Number of messages that have been discarded 1622 for any reason."; 1623 } 1624 } 1626 /* 1627 * Data Nodes 1628 */ 1630 container dhcpv6-relay { 1631 description 1632 "This container contains the configuration data of the relay."; 1633 list relay-if { 1634 key if-name; 1635 leaf if-name { 1636 type if:interface-ref; 1637 } 1638 leaf-list destination-addresses { 1639 type inet:ipv6-address; 1640 description "Each DHCPv6 relay agent may be configured with 1641 a list of destination addresses for relayed messages. 1642 The list may include unicast addresses, multicast addresses 1643 or other addresses."; 1644 } 1645 leaf link-address { 1646 description "An address that may be used by the server 1647 to identify the link on which the client is located."; 1648 type binary { 1649 length "0..16"; 1650 } 1651 } 1652 container relay-options { 1653 description "Definitions for DHCPv6 options that can be sent 1654 by the relay are augmented to this location from other YANG 1655 modules as required."; 1656 } 1657 uses message-statistics; 1658 container prefix-delegation { 1659 description "Controls and holds state information for prefix 1660 delegation."; 1661 presence "Enables prefix delegation for this interface."; 1662 if-feature prefix-delegation; 1663 uses pd-lease-state; 1664 } 1665 } 1666 uses global-statistics; 1667 } 1669 /* 1670 * Notifications 1671 */ 1673 notification relay-event { 1674 description 1675 "DHCPv6 relay event"; 1676 container topology-change { 1677 description "Raised if the entry for and interface with DHCPv6 1678 related configuration or state is removed 1679 from if:interface-refs."; 1680 leaf relay-if-name { 1681 description "Name of the interface that has been removed."; 1682 type leafref { 1683 path "/dhcpv6-relay/relay-if/if-name"; 1684 } 1685 } 1686 leaf last-ipv6-addr { 1687 type inet:ipv6-address; 1688 description "Last IPv6 address configured on the interface."; 1689 } 1690 } 1691 } 1692 } 1694 3.3. DHCPv6 Client YANG Model 1696 This module imports typedefs from [RFC6991], [RFC8343]. 1698 module ietf-dhcpv6-client { 1699 yang-version 1.1; 1700 namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-client"; 1701 prefix "dhcpv6-client"; 1703 import ietf-inet-types { 1704 prefix inet; 1705 } 1706 import ietf-yang-types { 1707 prefix yang; 1708 } 1709 import ietf-dhcpv6-common { 1710 prefix dhcpv6-common; 1711 } 1712 import ietf-interfaces { 1713 prefix if; 1714 } 1716 organization "DHC WG"; 1717 contact 1718 "cuiyong@tsinghua.edu.cn 1719 wangh13@mails.tsinghua.edu.cn 1720 lh.sunlinh@gmail.com 1721 ian.farrer@telekom.de 1722 sladjana.zechlin@telekom.de 1723 hezihao9512@gmail.com 1724 godfryd@isc.org"; 1726 description "This is a YANG data module for the configuration 1727 and management of DHCPv6 clients. 1729 Copyright (c) 2018 IETF Trust and the persons identified as 1730 authors of the code. All rights reserved. 1732 Redistribution and use in source and binary forms, with or 1733 without modification, is permitted pursuant to, and subject 1734 to the license terms contained in, the Simplified BSD License 1735 set forth in Section 4.c of the IETF Trust's Legal Provisions 1736 Relating to IETF Documents 1737 (http://trustee.ietf.org/license-info). 1739 This version of this YANG module is part of RFC 8513; see 1740 the RFC itself for full legal notices."; 1742 revision 2019-09-20 { 1743 description ""; 1744 reference "I-D: draft-ietf-dhc-dhcpv6-yang-10"; 1745 } 1747 revision 2018-09-04 { 1748 description ""; 1749 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 1750 } 1752 revision 2018-03-04 { 1753 description "Resolved most issues on the DHC official github"; 1754 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 1755 } 1757 revision 2017-12-22 { 1758 description "Resolve most issues on Ian's Github."; 1759 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 1760 } 1762 revision 2017-11-24 { 1763 description "First version of the separated client specific 1764 YANG model."; 1765 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 1766 } 1768 identity client { 1769 base "dhcpv6-common:dhcpv6-node"; 1770 description "DHCPv6 client."; 1771 } 1773 leaf dhcpv6-node-type { 1774 description "Type for a DHCPv6 client"; 1775 type identityref { 1776 base "dhcpv6-client:client"; 1777 } 1778 } 1780 /* 1781 * Groupings 1782 */ 1784 grouping message-statistics { 1785 description "Counters for DHCPv6 messages."; 1786 leaf solicit-count { 1787 config "false"; 1788 type uint32; 1789 description "Number of Solicit (1) messages sent."; 1790 } 1791 leaf advertise-count { 1792 config "false"; 1793 type uint32; 1794 description "Number of Advertise (2) messages received."; 1795 } 1796 leaf request-count { 1797 config "false"; 1798 type uint32; 1799 description "Number of Request (3) messages sent."; 1800 } 1801 leaf confirm-count { 1802 config "false"; 1803 type uint32; 1804 description "Number of Confirm (4) messages sent."; 1805 } 1806 leaf renew-count { 1807 config "false"; 1808 type uint32; 1809 description "Number of Renew (5) messages sent."; 1810 } 1811 leaf rebind-count { 1812 config "false"; 1813 type uint32; 1814 description "Number of Rebind (6) messages sent."; 1815 } 1816 leaf reply-count { 1817 config "false"; 1818 type uint32; 1819 description "Number of Reply (7) messages received."; 1820 } 1821 leaf release-count { 1822 type uint32; 1823 description "Number of Release (8) messages sent."; 1824 } 1825 leaf decline-count { 1826 config "false"; 1827 type uint32; 1828 description "Number of Decline (9) messages sent."; 1829 } 1830 leaf reconfigure-count { 1831 config "false"; 1832 type uint32; 1833 description "Number of Reconfigure (10) messages received."; 1834 } 1835 leaf information-request-count { 1836 config "false"; 1837 type uint32; 1838 description "Number of Information-request (11) messages 1839 sent."; 1840 } 1841 } 1843 /* 1844 * Data Nodes 1845 */ 1847 container dhcpv6-client { 1848 description "DHCPv6 client configuration and state."; 1849 list client-if { 1850 key if-name; 1851 description "The list of interfaces that the client will be 1852 requesting DHCPv6 configuration for."; 1853 leaf if-name { 1854 type if:interface-ref; 1855 mandatory true; 1856 description "Reference to the interface entry that 1857 the requested configuration is relevant to."; 1858 } 1859 uses dhcpv6-common:duid; 1860 container client-configured-options { 1861 description "Definitions for DHCPv6 options that can be be 1862 sent by the client are augmented to this location from 1863 other YANG modules as required."; 1864 } 1865 list ia-na { 1866 key iaid; 1867 description "Configuration relevant for an IA_NA."; 1868 reference "RFC8415: Dynamic Host Configuration Protocol 1869 for IPv6 (DHCPv6)."; 1870 leaf iaid { 1871 type uint32; 1872 description "The unique identifier for this IA_NA."; 1873 } 1874 container ia-na-options { 1875 description "An augmenation point for additional options 1876 that the client will send in the IA_NA-options field 1877 of OPTION_IA_NA options."; 1878 } 1879 container lease-state { 1880 config "false"; 1881 description "Information about the active IA_NA lease."; 1882 leaf ia-na-address { 1883 description "Address that is currently leased."; 1884 type inet:ipv6-address; 1885 } 1886 leaf preferred-lifetime { 1887 description "The preferred lifetime for the leased 1888 address expressed in units of seconds."; 1889 type dhcpv6-common:timer-value-seconds32; 1890 } 1891 leaf valid-lifetime { 1892 description "The valid lifetime for the leased address 1893 expressed in units of seconds."; 1894 type dhcpv6-common:timer-value-seconds32; 1895 } 1896 leaf lease-t1 { 1897 description "The time interval after which the client 1898 should contact the server from which the addresses 1899 in the IA_NA were obtained to extend the lifetimes 1900 of the addresses assigned to the IA_NA."; 1901 type dhcpv6-common:timer-value-seconds32; 1902 } 1903 leaf lease-t2 { 1904 description "The time interval after which the client 1905 should contact any available server to extend 1906 the lifetimes of the addresses assigned to the IA_NA."; 1907 type dhcpv6-common:timer-value-seconds32; 1908 } 1909 leaf allocation-time { 1910 description "Time and date that the address was first 1911 leased."; 1912 type yang:date-and-time; 1913 } 1914 leaf last-renew-rebind { 1915 description "Time of the last successful renew or rebind 1916 of the leased address."; 1918 type yang:date-and-time; 1919 } 1920 leaf server-duid { 1921 description "DUID of the leasing server."; 1922 type binary; 1923 } 1924 } 1925 } 1926 list ia-ta { 1927 key iaid; 1928 description "Configuration relevant for an IA_TA."; 1929 reference "RFC8415: Dynamic Host Configuration Protocol for 1930 IPv6 (DHCPv6)."; 1931 leaf iaid { 1932 type uint32; 1933 description "The unique identifier for this IA_TA."; 1934 } 1935 container ia-ta-options { 1936 description "An augmenation point for additional options 1937 that the client will send in the IA_TA-options field 1938 of OPTION_IA_TA options."; 1939 } 1940 container lease-state { 1941 config "false"; 1942 description "Information about an active IA_TA lease."; 1943 leaf ia-ta-address { 1944 description "Address that is currently leased."; 1945 type inet:ipv6-address; 1946 } 1947 leaf preferred-lifetime { 1948 description "The preferred lifetime for the leased 1949 address expressed in units of seconds."; 1950 type dhcpv6-common:timer-value-seconds32; 1951 } 1952 leaf valid-lifetime { 1953 description "The valid lifetime for the leased address 1954 expressed in units of seconds."; 1955 type dhcpv6-common:timer-value-seconds32; 1956 } 1957 leaf allocation-time { 1958 description "Time and date that the address was first 1959 leased."; 1960 type yang:date-and-time; 1961 } 1962 leaf last-renew-rebind { 1963 description "Time of the last successful renew or rebind 1964 of the address."; 1965 type yang:date-and-time; 1967 } 1968 leaf server-duid { 1969 description "DUID of the leasing server."; 1970 type binary; 1971 } 1972 } 1973 } 1974 list ia-pd { 1975 key iaid; 1976 reference "RFC8415: Dynamic Host Configuration Protocol for 1977 IPv6 (DHCPv6)."; 1978 description "Configuration relevant for an IA_PD."; 1979 leaf iaid { 1980 type uint32; 1981 description "The unique identifier for this IA_PD."; 1982 } 1983 container ia-pd-options { 1984 description "An augmenation point for additional options 1985 that the client will send in the IA_PD-options field 1986 of OPTION_IA_TA options."; 1987 } 1988 container lease-state { 1989 config "false"; 1990 description "Information about an active IA_PD delegated 1991 prefix."; 1992 leaf ia-pd-prefix { 1993 description "Delegated prefix that is currently leased."; 1994 type inet:ipv6-prefix; 1995 } 1996 leaf preferred-lifetime { 1997 description "The preferred lifetime for the leased prefix 1998 expressed in units of seconds."; 1999 type dhcpv6-common:timer-value-seconds32; 2000 } 2001 leaf valid-lifetime { 2002 description "The valid lifetime for the leased prefix 2003 expressed in units of seconds."; 2004 type dhcpv6-common:timer-value-seconds32; 2005 } 2006 leaf lease-t1 { 2007 description "The time interval after which the client 2008 should contact the server from which the addresses 2009 in the IA_NA were obtained to extend the lifetimes 2010 of the addresses assigned to the IA_PD."; 2011 type dhcpv6-common:timer-value-seconds32; 2012 } 2013 leaf lease-t2 { 2014 description "The time interval after which the client 2015 should contact any available server to extend 2016 the lifetimes of the addresses assigned to the IA_PD."; 2017 type dhcpv6-common:timer-value-seconds32; 2018 } 2019 leaf allocation-time { 2020 description "Time and date that the prefix was first 2021 leased."; 2022 type yang:date-and-time; 2023 } 2024 leaf last-renew-rebind { 2025 description "Time of the last successful renew or rebind 2026 of the delegated prefix."; 2027 type yang:date-and-time; 2028 } 2029 leaf server-duid { 2030 description "DUID of the delegating server."; 2031 type binary; 2032 } 2033 } 2034 } 2035 uses message-statistics; 2036 } 2037 } 2039 /* 2040 * Notifications 2041 */ 2043 notification invalid-ia-detected { 2044 description "Notification sent when the identity association 2045 of the client can be proved to be invalid. Possible conditions 2046 include a duplicate or otherwise illegal address."; 2047 leaf iaid { 2048 type uint32; 2049 mandatory true; 2050 description "IAID"; 2051 } 2052 leaf description { 2053 type string; 2054 description "Description of the event."; 2055 } 2056 } 2058 notification retransmission-failed { 2059 description "Notification sent when the retransmission mechanism 2060 defined in [RFC8415] is unsucessful."; 2061 leaf failure-type { 2062 type enumeration { 2063 enum "MRC-exceeded" { 2064 description "Maximum retransmission count exceeded."; 2065 } 2066 enum "MRD-exceeded" { 2067 description "Maximum retransmission duration exceeded."; 2068 } 2069 } 2070 mandatory true; 2071 description "Description of the failure."; 2072 } 2073 } 2075 notification unsuccessful-status-code { 2076 description "Notification sent when the client receives a message 2077 that includes an unsuccessful Status Code option."; 2078 leaf status-code { 2079 type uint16; 2080 mandatory true; 2081 description "Unsuccessful status code recevied by a client."; 2082 } 2083 leaf server-duid { 2084 description "DUID of the server sending the unsuccessful 2085 error code."; 2086 mandatory true; 2087 type binary; 2088 } 2089 } 2091 notification server-duid-changed { 2092 description "Notification sent when the client receives a lease 2093 from a server with different DUID to the one currently stored 2094 by the client."; 2095 leaf new-server-duid { 2096 description "DUID of the new server."; 2097 mandatory true; 2098 type binary; 2099 } 2100 leaf previous-server-duid { 2101 description "DUID of the previous server."; 2102 mandatory true; 2103 type binary; 2104 } 2105 leaf lease-ia-na { 2106 description "Reference to the IA_NA lease."; 2107 type leafref { 2108 path "/dhcpv6-client/client-if/ia-na/iaid"; 2109 } 2110 } 2111 leaf lease-ia-ta { 2112 description "Reference to the IA_TA lease."; 2113 type leafref { 2114 path "/dhcpv6-client/client-if/ia-ta/iaid"; 2115 } 2116 } 2117 leaf lease-ia-pd { 2118 description "Reference to the IA_PD lease."; 2119 type leafref { 2120 path "/dhcpv6-client/client-if/ia-pd/iaid"; 2121 } 2122 } 2123 } 2124 } 2126 3.4. DHCPv6 RFC8415 Options YANG Model 2128 This module imports typedefs from [RFC6991]. 2130 module ietf-dhcpv6-options-rfc8415 { 2131 yang-version 1.1; 2132 namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-options-8415"; 2133 prefix "rfc8415"; 2135 import ietf-inet-types { 2136 prefix inet; 2137 } 2139 import ietf-dhcpv6-common { 2140 prefix dhcpv6-common; 2141 } 2143 import ietf-dhcpv6-server { 2144 prefix dhcpv6-server; 2145 } 2147 import ietf-dhcpv6-relay { 2148 prefix dhcpv6-relay; 2149 } 2151 import ietf-dhcpv6-client { 2152 prefix dhcpv6-client; 2153 } 2155 organization "DHC WG"; 2156 contact 2157 "cuiyong@tsinghua.edu.cn 2158 wangh13@mails.tsinghua.edu.cn 2159 lh.sunlinh@gmail.com 2160 ian.farrer@telekom.de 2161 sladjana.zechlin@telekom.de 2162 hezihao9512@gmail.com"; 2164 description "This YANG module contains DHCPv6 options defined 2165 in RFC8415 that can be used by DHCPv6 clients, relays 2166 and servers."; 2168 revision 2019-06-07 { 2169 description "Major reworking to only contain RFC8415 options. 2170 if-feature for each option removed. Removed groupings 2171 of features by device or combination of devices. Added "; 2172 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 2173 } 2175 revision 2018-09-04 { 2176 description ""; 2177 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 2178 } 2180 revision 2018-03-04 { 2181 description "Resolved most issues on the DHC official 2182 github"; 2183 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 2184 } 2186 revision 2017-12-22 { 2187 description "Resolve most issues on Ian's github."; 2188 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 2189 } 2191 revision 2017-11-24 { 2192 description "First version of the separated DHCPv6 options 2193 YANG model."; 2194 reference "I-D:draft-ietf-dhc-dhcpv6-yang"; 2195 } 2197 /* 2198 * Features 2200 /* 2201 * Groupings 2202 */ 2203 grouping option-iaaddr-option { 2204 description "OPTION_IAADDR (5) IA Address Option."; 2205 reference "RFC8415: Dynamic Host Configuration Protocol for IPv6 2206 (DHCPv6)"; 2208 leaf IPv6-address { 2209 type inet:ipv6-address; 2210 description "An IPv6 address. A client MUST NOT form 2211 an iplicit prefix with a length other than 128 2212 for this address."; 2213 } 2214 leaf preferred-lifetime { 2215 type uint32; 2216 description "The preferred lifetime for the address 2217 in the option, expressed in units of seconds."; 2218 } 2219 leaf valid-lifetime { 2220 type uint32; 2221 description "The preferred lifetime for the address 2222 in the option, expressed in units of seconds."; 2223 } 2224 container iaaddr-options { 2225 description "Definitions for DHCPv6 options that can be be sent 2226 by the client are augmented to this location from other YANG 2227 modules as required."; 2228 } 2229 } 2231 grouping option-request-option-group { 2232 container option-request-option { 2233 description "OPTION_ORO (6) Option Request Option. A client 2234 MUST include an Option Request option in a Solicit, Request, 2235 Renew, Rebind, or Information-request message to inform 2236 the server about options the client wants the server to send 2237 to the client."; 2238 reference "RFC8415: Dynamic Host Configuration Protocol for 2239 IPv6 (DHCPv6)"; 2240 leaf-list oro-option { 2241 description "List of options that the client is requesting, 2242 identified by option code"; 2243 type uint16 { 2244 range "17 | 21..24 | 27..36 | 39..42 | 49..52 | 54..60 | 2245 62..65 | 69..78"; 2246 } 2247 } 2248 } 2249 } 2251 grouping preference-option-group { 2252 container preference-option { 2253 description "OPTION_PREFERENCE (7) Preference Option"; 2254 reference "RFC8415: Dynamic Host Configuration Protocol for 2255 IPv6 (DHCPv6)"; 2257 leaf pref-value { 2258 type uint8; 2259 description "The preference value for the server 2260 in this message. A 1-octet unsigned integer."; 2261 } 2262 } 2263 } 2265 grouping auth-option-group { 2266 container auth-option { 2267 description "OPTION_AUTH (11) Authentication Option"; 2268 reference "RFC8415: Dynamic Host Configuration Protocol 2269 for IPv6 (DHCPv6)"; 2270 leaf protocol { 2271 type uint8; 2272 description "The authentication protocol used 2273 in this Authentication option."; 2274 } 2275 leaf algorithm { 2276 type uint8; 2277 description "The algorithm used in the authentication 2278 protocol."; 2279 } 2280 leaf rdm { 2281 type uint8; 2282 description "The replay detection method used 2283 in this Authentication option."; 2284 } 2285 leaf replay-detection { 2286 type uint64; 2287 description "The replay detection information for the RDM."; 2288 } 2289 leaf auth-information { 2290 type string; 2291 description "The authentication information, as specified 2292 by the protocol and algorithm used in this Authentication 2293 option."; 2294 } 2295 } 2296 } 2298 grouping server-unicast-option-group { 2299 container server-unicast-option { 2300 description "OPTION_UNICAST (12) Server Unicast Option"; 2301 reference "RFC8415: Dynamic Host Configuration Protocol for 2302 IPv6 (DHCPv6)"; 2303 leaf server-address { 2304 type inet:ipv6-address; 2305 description "The 128-bit address to which the client 2306 should send messages delivered using unicast."; 2307 } 2308 } 2309 } 2311 grouping status-code-option-group { 2312 container status-code-option { 2313 description "OPTION_STATUS_CODE (13) Status Code Option."; 2314 reference "RFC8415: Dynamic Host Configuration Protocol 2315 for IPv6 (DHCPv6)"; 2316 leaf status-code { 2317 type uint16; 2318 description "The numeric code for the status encoded 2319 in this option. See the Status Codes registry at 2320 2321 for the current list of status codes."; 2322 } 2323 leaf status-message { 2324 type string; 2325 description "A UTF-8 encoded text string suitable 2326 for display to an end user. MUST NOT be null-terminated."; 2327 } 2328 } 2329 } 2331 grouping rapid-commit-option-group { 2332 container rapid-commit-option { 2333 presence "Enable sending of this option"; 2334 description "OPTION_RAPID_COMMIT (14) Rapid Commit Option. 2335 The presence node is used to enable the option."; 2336 reference "RFC8415: Dynamic Host Configuration Protocol for 2337 IPv6 (DHCPv6)"; 2338 } 2339 } 2341 grouping user-class-option-group { 2342 container user-class-option { 2343 description "OPTION_USER_CLASS (15) User Class Option"; 2344 reference "RFC8415: Dynamic Host Configuration Protocol 2345 for IPv6 (DHCPv6)"; 2346 list user-class-data { 2347 key user-class-datum-id; 2348 min-elements 1; 2349 description "The user classes of which the client 2350 is a member."; 2351 leaf user-class-datum-id { 2352 type uint8; 2353 description "User class datum ID"; 2354 } 2355 leaf user-class-datum { 2356 type string; 2357 description "Opaque field representing a User Class 2358 of which the client is a member."; 2359 } 2360 } 2361 } 2362 } 2364 grouping vendor-class-option-group { 2365 container vendor-class-option { 2366 description "OPTION_VENDOR_CLASS (16) Vendor Class Option"; 2367 reference "RFC8415: Dynamic Host Configuration Protocol 2368 for IPv6 (DHCPv6)"; 2369 list vendor-class-option-instances { 2370 key enterprise-number; 2371 description "The vendor class option allows for multiple 2372 instances in a single message. Each list entry defines 2373 the contents of an instance of the option."; 2374 leaf enterprise-number { 2375 type uint32; 2376 description "The vendor's registered Enterprise Number 2377 as maintained by IANA."; 2378 } 2379 list vendor-class { 2380 key vendor-class-datum-id; 2381 description "The vendor classes of which the client 2382 is a member."; 2383 leaf vendor-class-datum-id { 2384 type uint8; 2385 description "Vendor class datum ID"; 2386 } 2387 leaf vendor-class-datum { 2388 type string; 2389 description "Opaque field representing a vendor class 2390 of which the client is a member."; 2391 } 2392 } 2393 } 2394 } 2395 } 2397 grouping vendor-specific-information-option-group { 2398 container vendor-specific-information-option { 2399 description "OPTION_VENDOR_OPTS (17) Vendor-specific 2400 Information Option"; 2402 reference "RFC8415: Dynamic Host Configuration Protocol 2403 for IPv6 (DHCPv6)"; 2404 list vendor-specific-information-option-instances { 2405 key enterprise-number; 2406 description "The vendor specific information option allows 2407 for multiple instances in a single message. Each list entry 2408 defines the contents of an instance of the option."; 2409 leaf enterprise-number { 2410 type uint32; 2411 description "The vendor's registered Enterprise Number, 2412 as maintained by IANA."; 2413 } 2414 list vendor-option-data { 2415 key sub-option-code; 2416 description "Vendor options, interpreted by vendor-specific 2417 client/server functions."; 2418 leaf sub-option-code { 2419 type uint16; 2420 description "The code for the sub-option."; 2421 } 2422 leaf sub-option-data { 2423 type string; 2424 description "The data area for the sub-option."; 2425 } 2426 } 2427 } 2428 } 2429 } 2431 grouping interface-id-option-group { 2432 container interface-id-option { 2433 description "OPTION_INTERFACE_ID (18) Interface-Id Option"; 2434 reference "RFC8415: Dynamic Host Configuration Protocol for 2435 IPv6 (DHCPv6)"; 2436 leaf interface-id { 2437 type string; 2438 description "An opaque value of arbitrary length generated 2439 by the relay agent to identify one of the relay agent's 2440 interfaces."; 2441 } 2442 } 2443 } 2445 grouping reconfigure-message-option-group { 2446 container reconfigure-message-option { 2447 description "OPTION_RECONF_MSG (19) Reconfigure Message 2448 Option."; 2449 reference "RFC8415: Dynamic Host Configuration Protocol 2450 for IPv6 (DHCPv6)"; 2451 leaf msg-type { 2452 type uint8; 2453 description "5 for Renew message, 6 for Rebind message, 2454 11 for Information-request message."; 2455 } 2456 } 2457 } 2459 grouping reconfigure-accept-option-group { 2460 container reconfigure-accept-option { 2461 presence "Enable sending of this option"; 2462 description "OPTION_RECONF_ACCEPT (20) Rapid Commit Option. 2463 A client uses the Reconfigure Accept option to announce 2464 to the server whether the client is willing to accept 2465 Reconfigure messages, and a server uses this option to tell 2466 the client whether or not to accept Reconfigure messages. 2467 In the absence of this option, the default behavior is that 2468 the client is unwilling to accept Reconfigure messages. 2469 The presence node is used to enable the option."; 2470 reference "RFC8415: Dynamic Host Configuration Protocol 2471 for IPv6 (DHCPv6)"; 2472 } 2473 } 2475 grouping option-iaprefix-option { 2476 description "OPTION_IAPREFIX (26) IA Address Option."; 2477 reference "RFC8415: Dynamic Host Configuration Protocol for IPv6 2478 (DHCPv6)"; 2479 leaf preferred-lifetime { 2480 type uint32; 2481 description "The preferred lifetime for the prefix 2482 in the option, expressed in units of seconds."; 2483 } 2484 leaf valid-lifetime { 2485 type uint32; 2486 description "The preferred lifetime for the prefix 2487 in the option, expressed in units of seconds."; 2488 } 2489 leaf IPv6-prefix { 2490 type inet:ipv6-prefix; 2491 description "The IPv6 prefix delegated to the client."; 2492 } 2493 container iaprefix-options { 2494 description "Definitions for DHCPv6 options that can be 2495 sent by the client are augmented to this location from other 2496 YANG modules as required."; 2497 } 2499 } 2501 grouping info-refresh-time-option-group { 2502 container info-refresh-time-option { 2503 description "OPTION_INFORMATION_REFRESH_TIME (32) 2504 Information Refresh Time option."; 2505 reference "RFC8415: Dynamic Host Configuration Protocol for 2506 IPv6 (DHCPv6)"; 2507 leaf info-refresh-time { 2508 type dhcpv6-common:timer-value-seconds32; 2509 description "Time duration relative to the current time, 2510 expressed in units of seconds."; 2511 } 2512 } 2513 } 2515 grouping sol-max-rt-option-group { 2516 container sol-max-rt-option { 2517 description "OPTION_SOL_MAX_RT (82) sol max rt option"; 2518 reference "RFC8415: Dynamic Host Configuration Protocol for 2519 IPv6 (DHCPv6)"; 2520 leaf sol-max-rt-value { 2521 type dhcpv6-common:timer-value-seconds32; 2522 description "sol max rt value"; 2523 } 2524 } 2525 } 2527 grouping inf-max-rt-option-group { 2528 container inf-max-rt-option { 2529 description "OPTION_INF_MAX_RT (83) inf max rt option"; 2530 reference "RFC8415: Dynamic Host Configuration Protocol for 2531 IPv6 (DHCPv6)"; 2532 leaf inf-max-rt-value { 2533 type dhcpv6-common:timer-value-seconds32; 2534 description "inf max rt value"; 2535 } 2536 } 2537 } 2539 augment "/dhcpv6-server:dhcpv6-server/dhcpv6-server:option-sets/dhc 2540 pv6-server:option-set" { 2541 when "../../../dhcpv6-server:dhcpv6-node-type='dhcpv6-server:serv 2542 er'"; 2543 uses preference-option-group; 2544 uses auth-option-group; 2545 uses server-unicast-option-group; 2546 uses status-code-option-group; 2547 uses rapid-commit-option-group; 2548 uses vendor-specific-information-option-group; 2549 uses reconfigure-message-option-group; 2550 uses reconfigure-accept-option-group; 2551 uses info-refresh-time-option-group; 2552 uses sol-max-rt-option-group; 2553 uses inf-max-rt-option-group; 2554 } 2555 augment "/dhcpv6-relay:dhcpv6-relay/dhcpv6-relay:relay-if/dhcpv6-re 2556 lay:relay-options" { 2557 when "../../../dhcpv6-relay:dhcpv6-node-type='dhcpv6-relay:relay' 2558 "; 2559 uses auth-option-group; 2560 uses status-code-option-group; 2561 uses interface-id-option-group; 2562 } 2563 augment "/dhcpv6-client:dhcpv6-client/dhcpv6-client:client-if/dhcpv 2564 6-client:client-configured-options" { 2565 when "../../../dhcpv6-client:dhcpv6-node-type='dhcpv6-client:clie 2566 nt'"; 2567 uses option-request-option-group; 2568 uses status-code-option-group; 2569 uses rapid-commit-option-group; 2570 uses user-class-option-group; 2571 uses vendor-class-option-group; 2572 uses vendor-specific-information-option-group; 2573 uses reconfigure-accept-option-group; 2574 } 2575 } 2577 3.5. DHCPv6 Common YANG Model 2579 This module imports typedefs from [RFC6991]. 2581 module ietf-dhcpv6-common { 2582 yang-version 1.1; 2583 namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-common"; 2584 prefix "dhcpv6-common"; 2586 import ietf-inet-types { 2587 prefix inet; 2588 } 2589 import ietf-yang-types { 2590 prefix yang; 2591 } 2593 organization "DHC WG"; 2594 contact 2595 "yong@csnet1.cs.tsinghua.edu.cn 2596 lh.sunlinh@gmail.com 2597 ian.farrer@telekom.de 2598 sladjana.zechlin@telekom.de 2599 hezihao9512@gmail.com"; 2601 description "This model defines a YANG data model that can be 2602 used to define some commonly used DHCPv6 types"; 2604 revision 2018-09-04 { 2605 description ""; 2606 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 2607 } 2609 revision 2018-01-30 { 2610 description "Initial revision"; 2611 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 2612 } 2614 typedef threshold { 2615 type union { 2616 type uint16 { 2617 range 0..100; 2618 } 2619 type enumeration { 2620 enum "disabled" { 2621 description "No threshold"; 2622 } 2623 } 2624 } 2625 description "Threshold value in percent"; 2626 } 2628 typedef timer-value-seconds32 { 2629 type uint32 { 2630 range "1..4294967295"; 2631 } 2632 units "seconds"; 2633 description 2634 "Timer value type, in seconds (32-bit range)."; 2635 } 2637 identity dhcpv6-node { 2638 description "Abstract base type for DHCPv6 functional nodes"; 2639 } 2641 /* 2642 * Grouping 2643 */ 2645 grouping duid { 2646 description "Each server and client has only one DUID (DHCP 2647 Unique Identifier). The DUID here identifies a unique DHCPv6 2648 server for clients. DUID consists of a two-octet type field 2649 and an arbitrary length (no more than 128 bytes) content field. 2650 Currently there are four defined types of DUIDs in RFC3315 2651 and RFC6355 - DUID-LLT, DUID-EN, DUID-LL and DUID-UUID. 2652 DUID-Uknown represents those unconventional DUIDs."; 2653 reference "RFC3315: Section 9 and RFC6355: Section 4"; 2654 leaf type-code { 2655 type uint16; 2656 default 65535; 2657 description "Type code of this DUID"; 2658 } 2659 choice duid-type { 2660 default duid-unknown; 2661 description "Selects the format for the DUID."; 2662 case duid-llt { 2663 description "DUID Based on Link-layer Address Plus Time 2664 (Type 1 - DUID-LLT)"; 2665 reference "RFC3315 Section 9.2"; 2666 leaf duid-llt-hardware-type { 2667 type uint16; 2668 description "Hardware type as assigned by IANA (RFC826)."; 2669 } 2670 leaf duid-llt-time { 2671 type yang:timeticks; 2672 description "The time value is the time that the DUID is 2673 generated represented in seconds since midnight (UTC), 2674 January 1, 2000, modulo 2^32."; 2675 } 2676 leaf duid-llt-link-layer-address { 2677 type yang:mac-address; 2678 description "Link-layer address as described in RFC2464"; 2679 } 2680 } 2681 case duid-en { 2682 description "DUID Assigned by Vendor Based on Enterprise 2683 Number (Type 2 - DUID-EN)"; 2684 reference "RFC3315 Section 9.3"; 2685 leaf duid-en-enterprise-number { 2686 type uint32; 2687 description "Vendor's registered Private Enterprise Number 2688 as maintained by IANA"; 2689 } 2690 leaf duid-en-identifier { 2691 type string; 2692 description "Indentifier, unique to the device that is 2693 using it"; 2694 } 2695 } 2696 case duid-ll { 2697 description "DUID Based on Link-layer Address 2698 (Type 3 - DUID-LL)"; 2699 reference "RFC3315 Section 9.4"; 2700 leaf duid-ll-hardware-type { 2701 type uint16; 2702 description "Hardware type as assigned by IANA (RFC826)."; 2703 } 2704 leaf duid-ll-link-layer-address { 2705 type yang:mac-address; 2706 description "Link-layer address as described in RFC2464"; 2707 } 2708 } 2709 case duid-uuid { 2710 description "DUID Based on Universally Unique Identifier 2711 (Type 4 - DUID-UUID)"; 2712 reference "RFC6335 Defination of the UUID-Based Unique 2713 Identifier"; 2714 leaf uuid { 2715 type yang:uuid; 2716 description "A Universally Unique IDentifier in the string 2717 representation defined in RFC 4122. The canonical 2718 representation uses lowercase characters"; 2719 } 2720 } 2721 case duid-unknown { 2722 description "DUID based on free raw bytes"; 2723 leaf data { 2724 type binary; 2725 description "The bits to be used as the identifier"; 2726 } 2727 } 2728 } 2729 leaf active-duid { 2730 config "false"; 2731 description "The DUID which is currently in use"; 2732 type binary; 2733 } 2734 } 2736 // TODO: is it used anywhere? if not should it be removed? 2737 grouping portset-parameters { 2738 description "portset parameters"; 2739 container port-parameter { 2740 description "port parameter"; 2741 leaf offset { 2742 type uint8; 2743 mandatory true; 2744 description "offset in a port set"; 2745 } 2746 leaf psid-len { 2747 type uint8; 2748 mandatory true; 2749 description "length of a psid"; 2750 } 2751 leaf psid { 2752 type uint16; 2753 mandatory true; 2754 description "psid value"; 2755 } 2756 } 2757 } 2758 } 2760 4. Security Considerations (TBD) 2762 TBD 2764 5. IANA Considerations (TBD) 2766 This document registers the following YANG modules in the "YANG 2767 Module Names" registry [RFC6020]. 2769 name: ietf-dhcpv6 2770 namespace: urn:ietf:params:xml:ns:yang:ietf-dhcpv6-common 2771 prefix: dhcpv6 2772 reference: TBD 2774 name: ietf-dhcpv6 2775 namespace: urn:ietf:params:xml:ns:yang:ietf-dhcpv6-server 2776 prefix: dhcpv6 2777 reference: TBD 2779 name: ietf-dhcpv6 2780 namespace: urn:ietf:params:xml:ns:yang:ietf-dhcpv6-client 2781 prefix: dhcpv6 2782 reference: TBD 2784 name: ietf-dhcpv6 2785 namespace: urn:ietf:params:xml:ns:yang:ietf-dhcpv6-relay 2786 prefix: dhcpv6 2787 reference: TBD 2789 name: ietf-dhcpv6 2790 namespace: 2791 urn:ietf:params:xml:ns:yang:ietf-dhcpv6-options- 2792 rfc8415 2793 prefix: dhcpv6 2794 reference: TBD 2796 6. Acknowledgments 2798 The authors would like to thank Qi Sun, Lishan Li, Sladjana Zoric, 2799 Tomek Mrugalski, Marcin Siodelski, Bernie Volz and Bing Liu for their 2800 valuable comments and contributions to this work. 2802 7. Contributors 2804 The following individuals contributed to this effort: 2805 Hao Wang 2806 Tsinghua University 2807 Beijing 100084 2808 P.R.China 2809 Phone: +86-10-6278-5822 2810 Email: wangh13@mails.tsinghua.edu.cn 2812 Ted Lemon 2813 Nomium, Inc 2814 950 Charter St. 2815 Redwood City, CA 94043 2816 USA 2817 Email: Ted.Lemon@nomium.com 2819 Bernie Volz 2820 Cisco Systems, Inc. 2821 1414 Massachusetts Ave 2822 Boxborough, MA 01719 2823 USA 2824 Email: volz@cisco.com 2826 8. References 2828 8.1. Normative References 2830 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2831 Requirement Levels", BCP 14, RFC 2119, 2832 DOI 10.17487/RFC2119, March 1997, 2833 . 2835 [RFC6355] Narten, T. and J. Johnson, "Definition of the UUID-Based 2836 DHCPv6 Unique Identifier (DUID-UUID)", RFC 6355, 2837 DOI 10.17487/RFC6355, August 2011, 2838 . 2840 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 2841 the Network Configuration Protocol (NETCONF)", RFC 6020, 2842 DOI 10.17487/RFC6020, October 2010, 2843 . 2845 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 2846 RFC 6991, DOI 10.17487/RFC6991, July 2013, 2847 . 2849 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 2850 RFC 7950, DOI 10.17487/RFC7950, August 2016, 2851 . 2853 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2854 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2855 May 2017, . 2857 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 2858 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 2859 . 2861 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 2862 and R. Wilton, "Network Management Datastore Architecture 2863 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 2864 . 2866 [RFC8343] Bjorklund, M., "A YANG Data Model for Interface 2867 Management", RFC 8343, DOI 10.17487/RFC8343, March 2018, 2868 . 2870 [RFC8415] Mrugalski, T., Siodelski, M., Volz, B., Yourtchenko, A., 2871 Richardson, M., Jiang, S., Lemon, T., and T. Winters, 2872 "Dynamic Host Configuration Protocol for IPv6 (DHCPv6)", 2873 RFC 8415, DOI 10.17487/RFC8415, November 2018, 2874 . 2876 8.2. Informative References 2878 [RFC3319] Schulzrinne, H. and B. Volz, "Dynamic Host Configuration 2879 Protocol (DHCPv6) Options for Session Initiation Protocol 2880 (SIP) Servers", RFC 3319, DOI 10.17487/RFC3319, July 2003, 2881 . 2883 Appendix A. Example of Adding New DHCPv6 Option Definitions 2885 The following section provides a example of how the DHCPv6 option 2886 definitions can be extended for additional option. It is expected 2887 that additional specficication documents will be published in the 2888 future for this. 2890 The example YANG models OPTION_SIP_SERVER_D (21) and 2891 OPTION_SIP_SERVER_D (21) defined in [RFC3319]. The overall structure 2892 is as follows: 2894 * A separate grouping is used for each option. 2896 * The name of the option is taken from the registered IANA name for 2897 the option, with an '-option' suffix added. 2899 * The description field is taken from the relevant option code name 2900 and number. 2902 * The reference section is the number and name of the RFC in which 2903 the DHCPv6 option is defined. 2905 * The remaining fields match the fields in the DHCP option. They 2906 are in the same order as defined in the DHCP option. Whereever 2907 possilbe, the format that is defined for the DHCP field should be 2908 matched by the relevant YANG type. 2910 * Fields which can have multiple entries or instances are defined 2911 using list or leaf-list nodes. 2913 Below the groupings for option definitions, augment statements are 2914 used to add the option definitions for use in the relevant DHCP 2915 element's module (server, relay and/or client). If an option is 2916 relevant to more than one element type, then an augment statement for 2917 each element is used. 2919 module example-dhcpv6-options-rfc3319 { 2920 yang-version 1.1; 2921 namespace "urn:ietf:params:xml:ns:yang:example-dhcpv6-options-rfc33 2922 19"; 2923 prefix "rfc3319"; 2925 import ietf-inet-types { 2926 prefix inet; 2927 } 2929 import ietf-dhcpv6-server { 2930 prefix dhcpv6-server; 2932 } 2934 organization "DHC WG"; 2935 contact 2936 "ian.farrer@telekom.de 2937 godfryd@isc.org"; 2939 description "This YANG module contains DHCPv6 options defined 2940 in RFC3319 that can be used by DHCPv6 servers."; 2942 revision 2019-10-18 { 2943 description "Initial version."; 2944 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 2945 } 2947 /* 2948 * Groupings 2949 */ 2950 grouping sip-server-domain-name-list-option-group { 2951 container sip-server-domain-name-list-option { 2952 description "OPTION_SIP_SERVER_D (21) SIP Servers Domain Name 2953 List"; 2954 reference "RFC3319: Dynamic Host Configuration Protocol 2955 (DHCPv6) Options for Session Initiation Protocol (SIP) 2956 Servers"; 2957 leaf sip-serv-domain-name { 2958 type inet:domain-name; 2959 description "sip server domain name"; 2960 } 2961 } 2962 } 2964 grouping sip-server-address-list-option-group { 2965 container sip-server-address-list-option { 2966 description "OPTION_SIP_SERVER_A (22) SIP Servers IPv6 Address 2967 List"; 2968 reference "RFC3319: Dynamic Host Configuration Protocol 2969 (DHCPv6) Options for Session Initiation Protocol (SIP) 2970 Servers"; 2971 list sip-server { 2972 key sip-serv-id; 2973 description "sip server info"; 2974 leaf sip-serv-id { 2975 type uint8; 2976 description "sip server id"; 2977 } 2978 leaf sip-serv-addr { 2979 type inet:ipv6-address; 2980 description "sip server addr"; 2981 } 2982 } 2983 } 2984 } 2986 augment "/dhcpv6-server:dhcpv6-server/dhcpv6-server:option-sets/dhc 2987 pv6-server:option-set" { 2988 when "../../../dhcpv6-server:dhcpv6-node-type='dhcpv6-server:serv 2989 er'"; 2990 uses sip-server-domain-name-list-option-group; 2991 uses sip-server-address-list-option-group; 2992 } 2993 } 2995 Appendix B. Example Vendor Specific Server Configuration Module 2997 This section shows how to extend the server YANG module defined in 2998 this document for vendor specific configuration nodes, e.g., 2999 configuring a database for storing leases. 3001 The example module defines additional server attributes such as name 3002 and description. Storage for leases is configured using a lease- 3003 storage container. It allows storing leases in one of three options: 3004 memory (memfile), MySQL and PosgreSQL. For each case, the necessary 3005 configuration parameters are provided. 3007 At the end there is an augment statment which adds the vendor 3008 specific configuration defined in "dhcpv6-server-config:config" under 3009 "/dhcpv6-server:config/dhcpv6-server:vendor-config" mountpoint. 3011 module example-dhcpv6-server-config { 3012 yang-version 1.1; 3013 namespace "urn:ietf:params:xml:ns:yang:example-dhcpv6-server-config 3014 "; 3015 prefix "dhcpv6-server-config"; 3017 import ietf-inet-types { 3018 prefix inet; 3019 } 3020 import ietf-yang-types { 3021 prefix yang; 3022 } 3023 import ietf-interfaces { 3024 prefix if; 3025 } 3026 import ietf-dhcpv6-common { 3027 prefix dhcpv6-common; 3029 } 3030 import ietf-dhcpv6-server { 3031 prefix dhcpv6-server; 3032 } 3034 organization "DHC WG"; 3035 contact 3036 "cuiyong@tsinghua.edu.cn 3037 lh.sunlinh@gmail.com 3038 ian.farrer@telekom.de 3039 sladjana.zechlin@telekom.de 3040 hezihao9512@gmail.com"; 3042 description "This model defines a YANG data model that can be 3043 used to configure and manage a DHCPv6 server."; 3045 revision 2019-06-04 { 3046 description ""; 3047 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 3048 } 3050 /* 3051 * Configuration data 3052 */ 3053 grouping config { 3054 description "Parameters necessary for the configuration 3055 of a DHCPv6 server"; 3056 container serv-attributes { 3057 description 3058 "This container contains basic attributes of a DHCPv6 server 3059 such as IPv6 address, server name and so on. Some optional 3060 functions that can be provided by the server is also 3061 included."; 3062 container duid { 3063 description "Sets the DUID of server"; 3064 uses dhcpv6-common:duid; 3065 } 3066 leaf name { 3067 type string; 3068 description "Name of the DHCpv6 server"; 3069 } 3070 leaf description { 3071 type string; 3072 description "Description of the DHCPv6 server"; 3073 } 3074 leaf-list ipv6-address { 3075 type inet:ipv6-address; 3076 description "List of IPv6 address(es) the server will "; 3078 } 3079 leaf-list interfaces-config { 3080 // Note - this should probably be references to 3081 // entries in the ietf-interfaces model 3082 type if:interface-ref; 3083 description "A leaf list to denote which one or more 3084 interfaces the server should listen on. The default value 3085 is to listen on all the interfaces. This node is also used 3086 to set a unicast address for the server to listen with 3087 a specific interface. For example, if people want 3088 the server to listen on a unicast address with a specific 3089 interface, he can use the format like 'eth1/2001:db8::1'."; 3090 } 3091 container lease-storage { 3092 description "Indicates how the server stores the lease"; 3093 choice storage-type { 3094 description "the type of lease storage"; 3095 // leaf persist { 3096 // type boolean; 3097 // mandatory true; 3098 // description "controls whether the new leases 3099 and updates to existing leases are 3100 // written to the file"; 3101 // } 3102 case memfile { 3103 description "Configuration for storing leases information 3104 in a CSV file."; 3106 leaf memfile-name { 3107 type string; 3108 description "Specifies an absolute location 3109 of the lease file in which new leases and lease 3110 updates are recorded."; 3111 } 3113 leaf memfile-lfc-interval { 3114 type uint64; 3115 description "Specifies the interval in seconds, 3116 at which the server will perform a lease file cleanup 3117 (LFC)."; 3118 } 3119 } 3120 case mysql { 3121 leaf mysql-name { 3122 type string; 3123 description "Name of the database."; 3124 } 3125 leaf mysql-host { 3126 type string; 3127 description "If the database is located on a different 3128 system to the DHCPv6 server, the database host name 3129 must also be specified."; 3130 } 3131 leaf mysql-user { 3132 type string; 3133 description "User name of the account under which 3134 the server will access the database."; 3135 } 3136 leaf mysql-password { 3137 type string; 3138 description "Password of the account under which 3139 the server will access the database"; 3140 } 3141 leaf mysql-port { 3142 type uint8; 3143 description "If the database is located on a different 3144 system, the port number may be specified"; 3145 } 3146 leaf mysql-lfc-interval { 3147 type uint64; 3148 description "Specifies the interval in seconds, 3149 at which the server will perform a lease file cleanup 3150 (LFC)"; 3151 } 3152 leaf mysql-connect-timeout { 3153 type uint64; 3154 description "If the database is located on a different 3155 system, a longer interval can be specified"; 3156 } 3157 } 3158 case postgresql { 3159 leaf postgresql-name { 3160 type string; 3161 description "Name of the database."; 3162 } 3163 leaf postgresql-host { 3164 type string; 3165 description "If the database is located on a different 3166 system to the DHCPv6 server, the database host name 3167 must also be specified."; 3168 } 3169 leaf postgresql-user { 3170 type string; 3171 description "User name of the account under which 3172 the server will access the database"; 3173 } 3174 leaf postgresql-password { 3175 type string; 3176 description "Password of the account under which 3177 the server will access the database"; 3178 } 3179 leaf postgresql-port { 3180 type uint8; 3181 description "If the database is located on a different 3182 system, the port number may be specified"; 3183 } 3184 leaf postgresql-lfc-interval { 3185 type uint64; 3186 description "Specifies the interval in seconds, 3187 at which the server will perform a lease file cleanup 3188 (LFC)"; 3189 } 3190 leaf postgresql-connect-timeout { 3191 type uint64; 3192 description "If the database is located on a different 3193 system, a longer interval can be specified"; 3194 } 3195 } 3196 case cassandra { 3197 leaf cassandra-name { 3198 type string; 3199 description "Name of the database"; 3200 } 3201 leaf cassandra-contact-points { 3202 type string; 3203 description "Cassandra takes a list of comma separated 3204 IP addresses to contact the cluster"; 3205 } 3206 leaf cassandra-user { 3207 type string; 3208 description "User name of the account under which 3209 the server will access the database"; 3210 } 3211 leaf cassandra-password { 3212 type string; 3213 description "Password of the account under which 3214 the server will access the database"; 3215 } 3216 leaf cassandra-lfc-interval { 3217 type uint64; 3218 description "Specifies the interval in seconds, 3219 at which the server will perform a lease file cleanup 3220 (LFC)"; 3221 } 3222 leaf cassandra-connect-timeout { 3223 type uint64; 3224 description "If the database is located on a different 3225 system, a longer interval can be specified"; 3226 } 3227 } 3228 } 3229 } 3230 uses dhcpv6-common:vendor-infor; 3231 } 3233 } 3235 augment "/dhcpv6-server:config/dhcpv6-server:vendor-config" { 3236 uses dhcpv6-server-config:config; 3237 } 3238 } 3240 Appendix C. Example definition of class selector configuration 3242 The module "example-dhcpv6-class-selector" provides an example of how 3243 vendor specific class selector configuration can be modeled and 3244 integrated with the ietf-dhcpv6-server module defined in this 3245 document. 3247 The example module defines "client-class-names" with associated 3248 matching rules. A client can be classified based on "client id", 3249 "interface-id" (ingress inteface of the client's messages), packets 3250 source or destination address, relay link address, relay link 3251 interface-id and more. Actually there is endless methods for 3252 classifying clients. So this standard does not try to provide full 3253 specificiation for class selection, it only shows an example how it 3254 can be defined. 3256 At the end of the example augment statements are used to add the 3257 defind class selector rules into the overall DHCPv6 addressing 3258 heirarchy. This is done in two main parts: 3260 * The augmented class-selector configuration in the main DHCPv6 3261 Server configuration. 3263 * client-class leafrefs augmented to "network-range", "address-pool" 3264 and "pd-pool", pointing to the "client-class-name" that is 3265 required. 3267 The mechanism is as follows: class is associated to client based on 3268 rules and then client is allowed to get address(es)/prefix(es) from 3269 given network-range/pool if the class name matches. 3271 module example-dhcpv6-class-selector { 3272 yang-version 1.1; 3273 namespace "urn:ietf:params:xml:ns:yang:example-dhcpv6-class-selecto 3274 r"; 3275 prefix "dhcpv6-class-selector"; 3277 import ietf-inet-types { 3278 prefix inet; 3279 } 3280 import ietf-interfaces { 3281 prefix if; 3282 } 3283 import ietf-dhcpv6-common { 3284 prefix dhcpv6-common; 3285 } 3286 import ietf-dhcpv6-server { 3287 prefix dhcpv6-server; 3288 } 3290 organization "DHC WG"; 3291 contact 3292 "yong@csnet1.cs.tsinghua.edu.cn 3293 lh.sunlinh@gmail.com 3294 ian.farrer@telekom.de 3295 sladjana.zechlin@telekom.de 3296 hezihao9512@gmail.com"; 3298 description "This model defines a YANG data model that can be 3299 used to define client class selector for DHCPv6 Server model."; 3301 revision 2019-06-13 { 3302 description ""; 3303 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 3304 } 3306 grouping client-class-id { 3307 description "Defintions for client classification for 3308 authorization and assignment purposes."; 3310 leaf client-class-name { 3311 type string; 3312 description "Unique Identifier for client class identification 3313 list entries."; 3314 } 3316 choice id-type { 3317 description "Definitions for different client identifier 3318 types."; 3319 mandatory true; 3320 case client-id-id { 3321 description "Client class selection based on a string literal 3322 client identifier."; 3323 leaf client-id { 3324 description "String literal client identifier."; 3325 mandatory true; 3326 type string; 3327 } 3328 } 3329 case received-interface-id { 3330 description "Client class selection based on the incoming 3331 interface of the DHCPv6 message."; 3332 leaf received-interface { 3333 description "Reference to the interface entry 3334 for the incoming DHCPv6 message."; 3335 type if:interface-ref; 3336 } 3337 } 3338 case packet-source-address-id { 3339 description "Client class selection based on the source 3340 address of the DHCPv6 message."; 3341 leaf packet-source-address { 3342 description "Source address of the DHCPv6 message."; 3343 mandatory true; 3344 type inet:ipv6-address; 3345 } 3346 } 3347 case packet-destination-address-id { 3348 description "Client class selection based on the destination 3349 address of the DHCPv6 message."; 3350 leaf packet-destination-address { 3351 description "Destination address of the DHCPv6 message."; 3352 mandatory true; 3353 type inet:ipv6-address; 3354 } 3355 } 3356 case relay-link-address-id { 3357 description "Client class selection based on the prefix 3358 of the link-address field in the relay agent message 3359 header."; 3360 leaf relay-link-address { 3361 description "Prefix of the link-address field in the relay 3362 agent message header."; 3363 mandatory true; 3364 type inet:ipv6-prefix; 3365 } 3367 } 3368 case relay-peer-address-id { 3369 description "Client class selection based on the value of the 3370 peer-address field in the relay agent message header."; 3371 leaf relay-peer-address { 3372 description "Prefix of the peer-address field 3373 in the relay agent message header."; 3374 mandatory true; 3375 type inet:ipv6-prefix; 3376 } 3377 } 3378 case relay-interface-id { 3379 description "Client class selection based on the incoming 3380 interface-id option."; 3381 leaf relay-interface { 3382 description "Reference to the interface entry 3383 for the incoming DHCPv6 message."; 3384 type string; 3385 } 3386 } 3387 case user-class-option-id { 3388 description "Client class selection based on the value of the 3389 OPTION_USER_CLASS(15) and its user-class-data field."; 3390 leaf user-class-data { 3391 description "Value of the enterprise-number field."; 3392 mandatory true; 3393 type string; 3394 } 3395 } 3396 case vendor-class-present-id { 3397 description "Client class selection based on the presence of 3398 OPTION_VENDOR_CLASS(16) in the received message."; 3399 leaf vendor-class-present { 3400 description "Presence of OPTION_VENDOR_CLASS(16) 3401 in the received message."; 3402 mandatory true; 3403 type boolean; 3404 } 3405 } 3406 case vendor-class-option-enterprise-number-id { 3407 description "Client class selection based on the value of the 3408 enterprise-number field in OPTION_VENDOR_CLASS(16)."; 3409 leaf vendor-class-option-enterprise-number { 3410 description "Value of the enterprise-number field."; 3411 mandatory true; 3412 type uint32; 3413 } 3414 } 3415 case vendor-class-option-data-id { 3416 description "Client class selection based on the value 3417 of a data field within a vendor-class-data entry 3418 for a matching enterprise-number field 3419 in OPTION_VENDOR_CLASS(16)."; 3420 container vendor-class-option-data { 3421 leaf vendor-class-option-enterprise-number { 3422 description "Value of the enterprise-number field 3423 for matching the data contents."; 3424 mandatory true; 3425 type uint32; 3426 } 3427 leaf vendor-class-data { 3428 description "Vendor class data to match."; 3429 mandatory true; 3430 type string; 3431 } 3432 } 3433 } 3434 case remote-id { 3435 description "Client class selection based on the value 3436 of Remote-ID ."; 3437 container remote-id { 3438 leaf vendor-class-option-enterprise-number { 3439 description "Value of the enterprise-number field 3440 for matching the data contents."; 3441 mandatory true; 3442 type uint32; 3443 } 3444 leaf remote-id { 3445 description "Remote-ID data to match."; 3446 mandatory true; 3447 type string; 3448 } 3449 } 3450 } 3451 case client-duid-id { 3452 description "Client class selection based on the value 3453 of the received client DUID."; 3454 uses dhcpv6-common:duid; 3455 } 3456 } 3457 } 3459 /* Augmentations of dhcpv6 server */ 3461 augment "/dhcpv6-server:config/dhcpv6-server:class-selector" { 3462 container client-classes { 3463 list class { 3464 description "List of the client class identifiers applicable 3465 to clients served by this address pool"; 3466 key client-class-name; 3467 uses dhcpv6-class-selector:client-class-id; 3468 } 3469 } 3470 } 3472 augment "/dhcpv6-server:config/dhcpv6-server:network-ranges/dhcpv6- 3473 server:network-range" { 3474 leaf-list client-class { 3475 type leafref { 3476 path "/dhcpv6-server:config/dhcpv6-server:class-selector/clie 3477 nt-classes/class/client-class-name"; 3478 } 3479 } 3480 } 3481 augment "/dhcpv6-server:config/dhcpv6-server:network-ranges/dhcpv6- 3482 server:network-range/dhcpv6-server:address-pools/dhcpv6-server:addres 3483 s-pool" { 3484 leaf-list client-class { 3485 type leafref { 3486 path "/dhcpv6-server:config/dhcpv6-server:class-selector/clie 3487 nt-classes/class/client-class-name"; 3488 } 3489 } 3490 } 3491 augment "/dhcpv6-server:config/dhcpv6-server:network-ranges/dhcpv6- 3492 server:network-range/dhcpv6-server:pd-pools/dhcpv6-server:pd-pool" { 3493 leaf-list client-class { 3494 type leafref { 3495 path "/dhcpv6-server:config/dhcpv6-server:class-selector/clie 3496 nt-classes/class/client-class-name"; 3497 } 3498 } 3499 } 3501 } 3503 Authors' Addresses 3505 Yong Cui 3506 Tsinghua University 3507 Beijing 3509 Phone: +86-10-6260-3059 3510 Email: cuiyong@tsinghua.edu.cn 3512 Linhui Sun 3513 Tsinghua University 3514 Beijing 3516 Phone: +86-10-6278-5822 3517 Email: lh.sunlinh@gmail.com 3519 Ian Farrer 3520 Deutsche Telekom AG 3521 CTO-ATI, Landgrabenweg 151 3522 53227 Bonn 3523 Germany 3525 Email: ian.farrer@telekom.de 3527 Sladjana Zechlin 3528 Deutsche Telekom AG 3529 CTO-IPT, Landgrabenweg 151 3530 53227 Bonn 3531 Germany 3533 Email: sladjana.zechlin@telekom.de 3535 Zihao He 3536 Tsinghua University 3537 Beijing 3539 Phone: +86-10-6278-5822 3540 Email: hezihao9512@gmail.com 3542 Michal Nowikowski 3543 Internet Systems Consortium 3544 Gdansk 3545 Poland 3547 Email: godfryd@isc.org