idnits 2.17.1 draft-ietf-dhc-dhcpv6-yang-18.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 290 has weird spacing: '...on-code uin...' == Line 368 has weird spacing: '...d-count uin...' == Line 424 has weird spacing: '...d-count uin...' == Line 458 has weird spacing: '...-delete ine...' == Line 463 has weird spacing: '...-delete ine...' == (14 more instances...) -- The document date (22 February 2021) is 1153 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Possible downref: Non-RFC (?) normative reference: ref. 'IANA-HARDWARE-TYPES' -- Possible downref: Non-RFC (?) normative reference: ref. 'IANA-PEN' Summary: 0 errors (**), 0 flaws (~~), 7 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 DHC Working Group I. Farrer, Ed. 3 Internet-Draft Deutsche Telekom AG 4 Intended status: Standards Track 22 February 2021 5 Expires: 26 August 2021 7 YANG Data Model for DHCPv6 Configuration 8 draft-ietf-dhc-dhcpv6-yang-18 10 Abstract 12 This document describes YANG data modules for the configuration and 13 management of DHCPv6 (Dynamic Host Configuration Protocol for IPv6) 14 servers, relays, and clients. 16 Requirements Language 18 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 19 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 20 "OPTIONAL" in this document are to be interpreted as described in BCP 21 14 [RFC2119] [RFC8174] when, and only when, they appear in all 22 capitals, as shown here. 24 Status of This Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at https://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on 26 August 2021. 41 Copyright Notice 43 Copyright (c) 2021 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 48 license-info) in effect on the date of publication of this document. 49 Please review these documents carefully, as they describe your rights 50 and restrictions with respect to this document. Code Components 51 extracted from this document must include Simplified BSD License text 52 as described in Section 4.e of the Trust Legal Provisions and are 53 provided without warranty as described in the Simplified BSD License. 55 Table of Contents 57 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 58 1.1. Scope . . . . . . . . . . . . . . . . . . . . . . . . . . 3 59 1.2. Extensibility of the DHCPv6 Server YANG Module . . . . . 3 60 1.2.1. DHCPv6 Option Definitions . . . . . . . . . . . . . . 4 61 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 6 62 2. DHCPv6 Tree Diagrams . . . . . . . . . . . . . . . . . . . . 6 63 2.1. DHCPv6 Server Tree Diagram . . . . . . . . . . . . . . . 6 64 2.2. DHCPv6 Relay Tree Diagram . . . . . . . . . . . . . . . . 13 65 2.3. DHCPv6 Client Tree Diagram . . . . . . . . . . . . . . . 15 66 3. DHCPv6 YANG Modules . . . . . . . . . . . . . . . . . . . . . 19 67 3.1. DHCPv6 Server YANG Module . . . . . . . . . . . . . . . . 19 68 3.2. DHCPv6 Relay YANG Module . . . . . . . . . . . . . . . . 36 69 3.3. DHCPv6 Client YANG Module . . . . . . . . . . . . . . . . 46 70 3.4. DHCPv6 Common YANG Module . . . . . . . . . . . . . . . . 58 71 4. Security Considerations . . . . . . . . . . . . . . . . . . . 65 72 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 67 73 6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 68 74 7. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 68 75 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 68 76 8.1. Normative References . . . . . . . . . . . . . . . . . . 68 77 8.2. Informative References . . . . . . . . . . . . . . . . . 70 78 Appendix A. Example of Augmenting Additional DHCPv6 Option 79 Definitions . . . . . . . . . . . . . . . . . . . . . . . 70 80 Appendix B. Example Vendor Specific Server Configuration 81 Module . . . . . . . . . . . . . . . . . . . . . . . . . 75 82 Appendix C. Example definition of class selector 83 configuration . . . . . . . . . . . . . . . . . . . . . . 81 84 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 89 86 1. Introduction 88 DHCPv6 [RFC8415] is widely used for supplying configuration and other 89 relevant parameters to clients in IPv6 networks. This document 90 defines YANG [RFC7950] modules for the configuration and management 91 of DHCPv6 'element' (servers, relays and clients) using the Network 92 Configuration Protocol (NETCONF [RFC6241]) or RESTCONF [RFC8040] 93 protocols. 95 Separate modules are defined for each element. Additionally, a 96 'common' module contains typedefs and groupings used by all of the 97 element modules. 99 It is worth noting that as DHCPv6 is itself a client configuration 100 protocol, it is not the intention of this document to provide a 101 replacement for the allocation of DHCPv6 assigned addressing and 102 parameters by using NETCONF/YANG. The DHCPv6 client module is 103 intended for the configuration and monitoring of the DHCPv6 client 104 function and does not play a part in the normal DHCPv6 message flow. 106 The YANG modules in this document adopt the Network Management 107 Datastore Architecture (NMDA) [RFC8342]. 109 1.1. Scope 111 [RFC8415] describes the current version of the DHCPv6 base protocol 112 specification. A large number of additional specifications have also 113 been published, extending DHCPv6 element functionality and adding new 114 options. The YANG modules contained in this document do not attempt 115 to capture all of these extensions and additions, rather to model the 116 DHCPv6 functions and options covered in [RFC8415]. A focus has also 117 been given on the extensibility of the modules so that it is easy to 118 augment in additional functionality as required by a particular 119 implementation or deployment scenario. 121 1.2. Extensibility of the DHCPv6 Server YANG Module 123 The modules in this document only attempt to model DHCPv6 specific 124 behavior and do not cover the configuration and management of 125 functionality relevant for specific server implementations. The 126 level of variance between implementations is too great to attempt to 127 standardize in a way that is useful without being restrictive. 129 However, it is recognized that implementation specific configuration 130 and management is also an essential part of DHCP deployment and 131 operations. To resolve this, Appendix B contains an example YANG 132 module for the configuration of implementation specific functions, 133 illustrating how this functionality can be augmented into the main 134 'ietf-dhcpv6-server.yang' module. 136 In DHCPv6, the concept of 'class selection' for messages received by 137 the server is common. This is the identification and classification 138 of messages based on a number of parameters so that the correct 139 provisioning information can be supplied. For example, allocating a 140 prefix from the correct pool, or supplying a set of options relevant 141 for a specific vendor's client implementation. During the 142 development of this document, research has been carried out into a 143 number of vendor's class selection implementations and the findings 144 were that while this function is common to all, the method for 145 configuring and implementing this function differs greatly. 146 Therefore, configuration of the class selection function has been 147 omitted from the DHCPv6 server module to allow implementors to define 148 their own suitable YANG module. Appendix C provides an example of 149 this, to demonstrate how this is can be integrated with the main 150 'ietf-dhcpv6-server.yang' module. 152 1.2.1. DHCPv6 Option Definitions 154 A large number of DHCPv6 options have been created in addition to 155 those defined in [RFC8415]. As implementations differ widely as to 156 which DHCPv6 options they support, the following approach has been 157 taken to defining options: Only the DHCPv6 options defined in 158 [RFC8415] are included in this document. 160 Of these, only the options that require operator configuration are 161 modelled. E.g. OPTION_IA_NA (3) is created by the DHCP server when 162 requested by the client. The contents of the fields in the option 163 are based on a number of input configuration parameters which the 164 server will apply when it receives the request (e.g., the T1/T2 165 timers that are relevant for the pool of addresses). As a result, 166 there are no fields that are directly configurable in the option, so 167 it is not modelled. 169 The following table shows the DHCPv6 options that are modelled, the 170 element(s) they are sent by, and the relevant YANG module name: 172 +---------------------+------+-----+------+-------------------------+ 173 | Name |Server|Relay|Client| Module Name | 174 +=====================+======+=====+======+=========================+ 175 |OPTION_ORO (6) Option| | | X | ietf-dhcpv6-client.yang | 176 | Request Option | | | | | 177 +---------------------+------+-----+------+-------------------------+ 178 |OPTION_PREFERENCE (7)| X | | | ietf-dhcpv6-server.yang | 179 | Preference Option | | | | | 180 +---------------------+------+-----+------+-------------------------+ 181 | OPTION_AUTH (11) | X | X | | ietf-dhcpv6-common.yang | 182 |Authentication Option| | | | | 183 +---------------------+------+-----+------+-------------------------+ 184 | OPTION_UNICAST (12) | X | | | ietf-dhcpv6-server.yang | 185 |Server Unicast Option| | | | | 186 +---------------------+------+-----+------+-------------------------+ 187 | OPTION_STATUS_CODE | X | X | X | ietf-dhcpv6-common.yang | 188 | (13) Status Code | | | | | 189 | Option | | | | | 190 +---------------------+------+-----+------+-------------------------+ 191 | OPTION_RAPID_COMMIT | X | | X | ietf-dhcpv6-common.yang | 192 | (14) Rapid Commit | | | | | 193 | Option | | | | | 194 +---------------------+------+-----+------+-------------------------+ 195 | OPTION_USER_CLASS | | | X | ietf-dhcpv6-client.yang | 196 | (15) User Class | | | | | 197 | Option | | | | | 198 +---------------------+------+-----+------+-------------------------+ 199 | OPTION_VENDOR_CLASS | | | X | ietf-dhcpv6-client.yang | 200 | (16) Vendor Class | | | | | 201 | Option | | | | | 202 +---------------------+------+-----+------+-------------------------+ 203 | OPTION_VENDOR_OPTS | X | | X | ietf-dhcpv6-common.yang | 204 |(17) Vendor-specific | | | | | 205 | Information Option | | | | | 206 +---------------------+------+-----+------+-------------------------+ 207 | OPTION_INTERFACE_ID | | X | | ietf-dhcpv6-relay.yang | 208 | (18) Interface-Id | | | | | 209 | Option | | | | | 210 +---------------------+------+-----+------+-------------------------+ 211 | OPTION_RECONF_MSG | X | | | ietf-dhcpv6-server.yang | 212 | (19) Reconfigure | | | | | 213 | Message Option | | | | | 214 +---------------------+------+-----+------+-------------------------+ 215 |OPTION_RECONF_ACCEPT | X | | X | ietf-dhcpv6-client.yang | 216 | (20) Reconfigure | | | | | 217 | Accept Option | | | | | 218 +---------------------+------+-----+------+-------------------------+ 219 | OPTION_INFORMATION | X | | | ietf-dhcpv6-server.yang | 220 | _REFRESH_TIME (32) | | | | | 221 | Information Refresh | | | | | 222 | Time Option | | | | | 223 +---------------------+------+-----+------+-------------------------+ 224 | OPTION_SOL_MAX_RT | X | | | ietf-dhcpv6-server.yang | 225 | (82) sol max rt | | | | | 226 | Option | | | | | 227 +---------------------+------+-----+------+-------------------------+ 228 | OPTION_INF_MAX_RT | X | | | ietf-dhcpv6-server.yang | 229 | (83) inf max rt | | | | | 230 | Option | | | | | 231 +---------------------+------+-----+------+-------------------------+ 233 Table 1: Modelled DHCPv6 Options 235 Further options definitions can be added using additional YANG 236 modules via augmentation into the relevant element modules from this 237 document. Appendix A contains an example module showing how the 238 DHCPv6 option definitions can be extended in this manner. Some 239 guidance on how to write YANG modules for additional DHCPv6 options 240 is also provided. 242 1.3. Terminology 244 The reader should be familiar with the YANG data modelling language 245 defined in [RFC7950]. 247 The YANG modules in this document adopt the Network Management 248 Datastore Architecture (NMDA) [RFC8342]. The meanings of the symbols 249 used in tree diagrams are defined in [RFC8340]. 251 The reader should be familiar with DHCPv6 relevant terminology as 252 defined in [RFC8415] and other relevant documents. 254 2. DHCPv6 Tree Diagrams 256 2.1. DHCPv6 Server Tree Diagram 258 The tree diagram in Figure 1 provides an overview of the DHCPv6 259 server module. The tree also includes the common functions module 260 Section 3.4. 262 module: ietf-dhcpv6-server 263 +--rw dhcpv6-server 264 +--rw enabled? boolean 265 +--rw server-duid? dhcpv6-common:duid 266 +--rw vendor-config 267 +--rw option-sets 268 | +--rw option-set* [option-set-id] 269 | +--rw option-set-id uint32 270 | +--rw description? string 271 | +--rw preference-option 272 | | +--rw pref-value? uint8 273 | +--rw auth-option 274 | | +--rw protocol? uint8 275 | | +--rw algorithm? uint8 276 | | +--rw rdm? uint8 277 | | +--rw replay-detection? uint64 278 | | +--rw auth-information? string 279 | +--rw server-unicast-option 280 | | +--rw server-address? inet:ipv6-address 281 | +--rw status-code-option 282 | | +--rw status-code? uint16 283 | | +--rw status-message? string 284 | +--rw rapid-commit-option! 285 | +--rw vendor-specific-information-option 286 | | +--rw vendor-specific-information-option-instances* 287 | | [enterprise-number] 288 | | +--rw enterprise-number uint32 289 | | +--rw vendor-option-data* [sub-option-code] 290 | | +--rw sub-option-code uint16 291 | | +--rw sub-option-data? string 292 | +--rw reconfigure-message-option 293 | | +--rw msg-type? uint8 294 | +--rw reconfigure-accept-option! 295 | +--rw info-refresh-time-option 296 | | +--rw info-refresh-time? 297 | | dhcpv6-common:timer-seconds32 298 | +--rw sol-max-rt-option 299 | | +--rw sol-max-rt-value? 300 | | dhcpv6-common:timer-seconds32 301 | +--rw inf-max-rt-option 302 | +--rw inf-max-rt-value? 303 | dhcpv6-common:timer-seconds32 304 +--rw class-selector 305 +--rw network-ranges 306 +--rw option-set-id* leafref 307 +--rw valid-lifetime? 308 | dhcpv6-common:timer-seconds32 309 +--rw renew-time? 310 | dhcpv6-common:timer-seconds32 311 +--rw rebind-time? 312 | dhcpv6-common:timer-seconds32 313 +--rw preferred-lifetime? 314 | dhcpv6-common:timer-seconds32 315 +--rw rapid-commit? boolean 316 +--rw network-range* [id] 317 | +--rw id uint32 318 | +--rw description string 319 | +--rw network-prefix inet:ipv6-prefix 320 | +--rw option-set-id* leafref 321 | +--rw valid-lifetime? 322 | | dhcpv6-common:timer-seconds32 323 | +--rw renew-time? 324 | | dhcpv6-common:timer-seconds32 325 | +--rw rebind-time? 326 | | dhcpv6-common:timer-seconds32 327 | +--rw preferred-lifetime? 328 | | dhcpv6-common:timer-seconds32 329 | +--rw rapid-commit? boolean 330 | +--rw address-pools 331 | | +--rw address-pool* [pool-id] 332 | | +--rw pool-id uint32 333 | | +--rw pool-prefix inet:ipv6-prefix 334 | | +--rw start-address 335 | | | inet:ipv6-address-no-zone 336 | | +--rw end-address 337 | | | inet:ipv6-address-no-zone 338 | | +--rw max-address-count 339 | | | dhcpv6-common:threshold 340 | | +--rw option-set-id* leafref 341 | | +--rw valid-lifetime? 342 | | | dhcpv6-common:timer-seconds32 343 | | +--rw renew-time? 344 | | | dhcpv6-common:timer-seconds32 345 | | +--rw rebind-time? 346 | | | dhcpv6-common:timer-seconds32 347 | | +--rw preferred-lifetime? 348 | | | dhcpv6-common:timer-seconds32 349 | | +--rw rapid-commit? boolean 350 | | +--rw host-reservations 351 | | | +--rw host-reservation* [reserved-addr] 352 | | | +--rw client-duid? 353 | | | | dhcpv6-common:duid 354 | | | +--rw reserved-addr 355 | | | | inet:ipv6-address 356 | | | +--rw option-set-id* leafref 357 | | | +--rw valid-lifetime? 358 | | | | dhcpv6-common:timer-seconds32 359 | | | +--rw renew-time? 360 | | | | dhcpv6-common:timer-seconds32 361 | | | +--rw rebind-time? 362 | | | | dhcpv6-common:timer-seconds32 363 | | | +--rw preferred-lifetime? 364 | | | | dhcpv6-common:timer-seconds32 365 | | | +--rw rapid-commit? boolean 366 | | +--ro active-leases 367 | | +--ro total-count uint64 368 | | +--ro allocated-count uint64 369 | | +--ro active-lease* [leased-address] 370 | | +--ro leased-address 371 | | | inet:ipv6-address 372 | | +--ro client-duid? 373 | | | dhcpv6-common:duid 374 | | +--ro iaid uint32 375 | | +--ro allocation-time? 376 | | | yang:date-and-time 377 | | +--ro last-renew-rebind? 378 | | | yang:date-and-time 379 | | +--ro preferred-lifetime? 380 | | | dhcpv6-common:timer-seconds32 381 | | +--ro valid-lifetime? 382 | | | dhcpv6-common:timer-seconds32 383 | | +--ro lease-t1? 384 | | | dhcpv6-common:timer-seconds32 385 | | +--ro lease-t2? 386 | | dhcpv6-common:timer-seconds32 387 | +--rw prefix-pools {prefix-delegation}? 388 | +--rw prefix-pool* [pool-id] 389 | +--rw pool-id uint32 390 | +--rw pool-prefix 391 | | inet:ipv6-prefix 392 | +--rw client-prefix-length uint8 393 | +--rw max-pd-space-utilization 394 | | dhcpv6-common:threshold 395 | +--rw option-set-id* leafref 396 | +--rw valid-lifetime? 397 | | dhcpv6-common:timer-seconds32 398 | +--rw renew-time? 399 | | dhcpv6-common:timer-seconds32 400 | +--rw rebind-time? 401 | | dhcpv6-common:timer-seconds32 402 | +--rw preferred-lifetime? 403 | | dhcpv6-common:timer-seconds32 404 | +--rw rapid-commit? boolean 405 | +--rw host-reservations 406 | | +--rw prefix-reservation* [reserved-prefix] 407 | | | +--rw client-duid? 408 | | | | dhcpv6-common:duid 409 | | | +--rw reserved-prefix 410 | | | | inet:ipv6-prefix 411 | | | +--rw reserved-prefix-len? uint8 412 | | +--rw option-set-id* leafref 413 | | +--rw valid-lifetime? 414 | | | dhcpv6-common:timer-seconds32 415 | | +--rw renew-time? 416 | | | dhcpv6-common:timer-seconds32 417 | | +--rw rebind-time? 418 | | | dhcpv6-common:timer-seconds32 419 | | +--rw preferred-lifetime? 420 | | | dhcpv6-common:timer-seconds32 421 | | +--rw rapid-commit? boolean 422 | +--ro active-leases 423 | +--ro total-count uint64 424 | +--ro allocated-count uint64 425 | +--ro active-lease* [leased-prefix] 426 | +--ro leased-prefix 427 | | inet:ipv6-prefix 428 | +--ro client-duid? 429 | | dhcpv6-common:duid 430 | +--ro iaid uint32 431 | +--ro allocation-time? 432 | | yang:date-and-time 433 | +--ro last-renew-rebind? 434 | | yang:date-and-time 435 | +--ro preferred-lifetime? 436 | | dhcpv6-common:timer-seconds32 437 | +--ro valid-lifetime? 438 | | dhcpv6-common:timer-seconds32 439 | +--ro lease-t1? 440 | | dhcpv6-common:timer-seconds32 441 | +--ro lease-t2? 442 | dhcpv6-common:timer-seconds32 443 +--ro solicit-count? uint32 444 +--ro advertise-count? uint32 445 +--ro request-count? uint32 446 +--ro confirm-count? uint32 447 +--ro renew-count? uint32 448 +--ro rebind-count? uint32 449 +--ro reply-count? uint32 450 +--ro release-count? uint32 451 +--ro decline-count? uint32 452 +--ro reconfigure-count? uint32 453 +--ro information-request-count? uint32 455 rpcs: 456 +---x delete-address-lease 457 | +---w input 458 | | +---w lease-address-to-delete inet:ipv6-address 459 | +--ro output 460 | +--ro return-message? string 461 +---x delete-prefix-lease 462 +---w input 463 | +---w lease-prefix-to-delete inet:ipv6-prefix 464 +--ro output 465 +--ro return-message? string 467 notifications: 468 +---n address-pool-utilization-threshold-exceeded 469 | +--ro pool-id? leafref 470 | +--ro total-address-count uint64 471 | +--ro max-address-count uint64 472 | +--ro allocated-address-count uint64 473 +---n prefix-pool-utilization-threshold-exceeded 474 | {prefix-delegation}? 475 | +--ro pool-id leafref 476 | +--ro max-pd-space-utilization leafref 477 | +--ro pd-space-utilization? uint64 478 +---n invalid-client-detected 479 | +--ro duid? dhcpv6-common:duid 480 | +--ro description? string 481 +---n decline-received 482 | +--ro duid? dhcpv6-common:duid 483 | +--ro declined-resources* [] 484 | +--ro (resource-type)? 485 | +--:(declined-address) 486 | | +--ro address? inet:ipv6-address 487 | +--:(declined-prefix) 488 | +--ro prefix? inet:ipv6-prefix 489 +---n non-success-code-sent 490 +--ro status-code uint16 491 +--ro duid? dhcpv6-common:duid 493 Figure 1: DHCPv6 Server Data Module Structure 495 Descriptions of important nodes: 497 * enabled: Enables/disables the function of the DHCPv6 server. 499 * dhcpv6-server: This container holds the server's DHCPv6 specific 500 configuration. 502 * server-duid: Each server must have a DUID (DHCP Unique Identifier) 503 to identify itself to clients. A DUID consists of a two-octet 504 type field and an arbitrary length (of no more than 128-bytes) 505 content field. Currently there are four defined types of DUIDs in 506 [RFC8415] and [RFC6355]. The DUID may be configured using the 507 format for one of these types, or using the 'unstructured' format. 508 The DUID type definitions are imported from the 'ietf- 509 dhcpv6-common.yang' module. [IANA-HARDWARE-TYPES] and [IANA-PEN] 510 are referenced for the relevant DUID types. 512 * vendor-config: This container is provided as a location for 513 additional implementation specific YANG nodes for the 514 configuration of the device to be augmented. See Appendix B for 515 an example of such a module. 517 * option-sets: The server can be configured with multiple option- 518 sets. These are groups of DHCPv6 options with common parameters 519 which will be supplied to clients on request. The 'option-set-id' 520 field is used to reference an option-set elsewhere in the server's 521 configuration. 523 * option-set: Holds configuration parameters for DHCPv6 options. 524 The initial set of applicable option definitions are defined here 525 and additional options that are also relevant to the relay and/or 526 client are imported from the 'ietf-dhcpv6-common' module. Where 527 needed, other DHCPv6 option modules can be augmented as they are 528 defined. 530 * class-selector: This is provided as a location for additional 531 implementation specific YANG nodes for vendor specific class 532 selector nodes to be augmented. See Appendix C for an example of 533 this. 535 * network-ranges: A hierarchical model is used for the allocation of 536 addresses and prefixes. At the top level 'network-ranges' holds 537 global configuration parameters. Under this, a list of 'network- 538 ranges' can be defined. Inside 'network-rages', 'address-pools' 539 (for IA_NA and IA_TA allocations), and 'prefix-pools' (for IA_PD 540 allocation) are defined. Finally within the pools, specific host- 541 reservations are held. 543 * prefix-pools: Defines pools to be used for prefix delegation to 544 clients. As prefix delegation is not supported by all DHCPv6 545 server implementations, it is enabled by a feature statement. 547 Information about notifications: 549 * address/prefix-pool-utilization-threshold-exceeded: Raised when 550 number of leased addresses or prefixes exceeds the configured 551 usage threshold. 553 * invalid-client-detected: Raised when the server detects an invalid 554 client. A description of the error that has generated the 555 notification can be included. 557 * decline-received: Raised when a DHCPv6 Decline message is received 558 from a client. 560 * non-success-code-sent: Raised when a status message is raised for 561 an error. 563 Information about RPCs 565 * delete-address-lease: Allows the deletion of a lease for an 566 individual IPv6 address from the server's lease database. 568 * delete-prefix-lease: Allows the deletion of a lease for an 569 individual IPv6 prefix from the server's lease database. 571 2.2. DHCPv6 Relay Tree Diagram 573 The tree diagram in Figure 2 provides an overview of the DHCPv6 relay 574 module. The tree also includes the common functions module 575 Section 3.4. 577 module: ietf-dhcpv6-relay 578 +--rw dhcpv6-relay 579 +--rw enabled? boolean 580 +--rw relay-if* [if-name] 581 | +--rw if-name 582 | | if:interface-ref 583 | +--rw enabled? boolean 584 | +--rw destination-addresses* 585 | | inet:ipv6-address 586 | +--rw link-address? binary 587 | +--rw relay-options 588 | | +--rw auth-option 589 | | | +--rw protocol? uint8 590 | | | +--rw algorithm? uint8 591 | | | +--rw rdm? uint8 592 | | | +--rw replay-detection? uint64 593 | | | +--rw auth-information? string 594 | | +--rw status-code-option 595 | | | +--rw status-code? uint16 596 | | | +--rw status-message? string 597 | | +--rw interface-id-option 598 | | +--rw interface-id? string 599 | +--ro solicit-received-count? uint32 600 | +--ro advertise-sent-count? uint32 601 | +--ro request-received-count? uint32 602 | +--ro confirm-received-count? uint32 603 | +--ro renew-received-count? uint32 604 | +--ro rebind-received-count? uint32 605 | +--ro reply-sent-count? uint32 606 | +--ro release-received-count? uint32 607 | +--ro decline-received-count? uint32 608 | +--ro reconfigure-sent-count? uint32 609 | +--ro information-request-received-count? uint32 610 | +--ro unknown-message-received-count? uint32 611 | +--ro unknown-message-sent-count? uint32 612 | +--ro discarded-message-count? uint32 613 | +--rw prefix-delegation! {prefix-delegation}? 614 | +--ro pd-leases* [ia-pd-prefix] 615 | +--ro ia-pd-prefix inet:ipv6-prefix 616 | +--ro last-renew? yang:date-and-time 617 | +--ro client-peer-address? inet:ipv6-address 618 | +--ro client-duid? dhcpv6-common:duid 619 | +--ro server-duid? dhcpv6-common:duid 620 +--ro relay-forward-sent-count? uint32 621 +--ro relay-forward-received-count? uint32 622 +--ro relay-reply-received-count? uint32 623 +--ro relay-forward-unknown-sent-count? uint32 624 +--ro relay-forward-unknown-received-count? uint32 625 +--ro discarded-message-count? uint32 627 rpcs: 628 +---x clear-prefix-entry 629 | +---w input 630 | | +---w lease-prefix inet:ipv6-prefix 631 | +--ro output 632 | +--ro return-message? string 633 +---x clear-client-prefixes 634 | +---w input 635 | | +---w client-duid dhcpv6-common:duid 636 | +--ro output 637 | +--ro return-message? string 638 +---x clear-interface-prefixes 639 +---w input 640 | +---w interface if:interface-ref 641 +--ro output 642 +--ro return-message? string 644 notifications: 645 +---n relay-event 646 +--ro topology-change 647 +--ro relay-if-name? 648 | -> /dhcpv6-relay/relay-if/if-name 649 +--ro last-ipv6-addr? inet:ipv6-address 651 Figure 2: DHCPv6 Relay Data Module Structure 653 Descriptions of important nodes: 655 * enabled: Globally enables/disables all DHCPv6 relay functions. 657 * dhcpv6-relay: This container holds the relay's DHCPv6 specific 658 configuration. 660 * relay-if: As a relay may have multiple client-facing interfaces, 661 they are configured in a list. The if-name leaf is the key and is 662 an interface-ref to the applicable interface defined by the 'ietf- 663 interfaces' YANG module. 665 * enabled: Enables/disables all DHCPv6 relay function for the 666 specific interface. 668 * destination-addresses: Defines a list of IPv6 addresses that 669 client messages will be relayed to. May include unicast or 670 multicast addresses. 672 * link-address: Configures the value that the relay will put into 673 the link-address field of Relay-Forward messages. 675 * prefix-delegation: As prefix delegation is not supported by all 676 DHCPv6 relay implementations, it is enabled by this feature 677 statement where required. 679 * pd-leases: Contains read-only nodes for holding information about 680 active delegated prefix leases. 682 * relay-options: Holds configuration parameters for DHCPv6 options 683 which can be sent by the relay. The initial set of applicable 684 option definitions are defined here and additional options that 685 are also relevant to the server and/or client are imported from 686 the 'ietf-dhcpv6-common' module. Where needed, other DHCPv6 687 option modules can be augmented as they are defined. 689 Information about notifications: 691 * topology-changed: Raised when the topology of the relay agent is 692 changed, e.g. a client facing interface is reconfigured. 694 Information about RPCs 696 * clear-prefix-lease: Allows the removal of a delegated lease entry 697 from the relay. 699 * clear-client-prefixes: Allows the removal of all of the delegated 700 lease entries for a single client (referenced by client DUID) from 701 the relay. 703 * clear-interface-prefixes: Allows the removal of all of the 704 delegated lease entries from an interface on the relay. 706 2.3. DHCPv6 Client Tree Diagram 708 The tree diagram in Figure 3 provides an overview of the DHCPv6 709 client module. The tree also includes the common functions module 710 Section 3.4. 712 module: ietf-dhcpv6-client 713 +--rw dhcpv6-client 714 +--rw enabled? boolean 715 +--rw client-if* [if-name] 716 +--rw if-name if:interface-ref 717 +--rw enabled? boolean 718 +--rw duid? dhcpv6-common:duid 719 +--rw client-configured-options 720 | +--rw option-request-option 721 | | +--rw oro-option* uint16 722 | +--rw status-code-option 723 | | +--rw status-code? uint16 724 | | +--rw status-message? string 725 | +--rw rapid-commit-option! 726 | +--rw user-class-option! 727 | | +--rw user-class-data* [user-class-datum-id] 728 | | +--rw user-class-datum-id uint8 729 | | +--rw user-class-datum? string 730 | +--rw vendor-class-option 731 | | +--rw vendor-class-option-instances* 732 | | [enterprise-number] 733 | | +--rw enterprise-number uint32 734 | | +--rw vendor-class* [vendor-class-datum-id] 735 | | +--rw vendor-class-datum-id uint8 736 | | +--rw vendor-class-datum? string 737 | +--rw vendor-specific-information-option 738 | | +--rw vendor-specific-information-option-instances* 739 | | [enterprise-number] 740 | | +--rw enterprise-number uint32 741 | | +--rw vendor-option-data* [sub-option-code] 742 | | +--rw sub-option-code uint16 743 | | +--rw sub-option-data? string 744 | +--rw reconfigure-accept-option! 745 +--rw ia-na* [iaid] 746 | +--rw iaid uint32 747 | +--rw ia-na-options 748 | +--ro lease-state 749 | +--ro ia-na-address? inet:ipv6-address 750 | +--ro preferred-lifetime? 751 | | dhcpv6-common:timer-seconds32 752 | +--ro valid-lifetime? 753 | | dhcpv6-common:timer-seconds32 754 | +--ro lease-t1? 755 | | dhcpv6-common:timer-seconds32 756 | +--ro lease-t2? 757 | | dhcpv6-common:timer-seconds32 758 | +--ro allocation-time? yang:date-and-time 759 | +--ro last-renew-rebind? yang:date-and-time 760 | +--ro server-duid? dhcpv6-common:duid 761 +--rw ia-ta* [iaid] 762 | +--rw iaid uint32 763 | +--rw ia-ta-options 764 | +--ro lease-state 765 | +--ro ia-ta-address? inet:ipv6-address 766 | +--ro preferred-lifetime? 767 | | dhcpv6-common:timer-seconds32 768 | +--ro valid-lifetime? 769 | | dhcpv6-common:timer-seconds32 770 | +--ro allocation-time? yang:date-and-time 771 | +--ro last-renew-rebind? yang:date-and-time 772 | +--ro server-duid? dhcpv6-common:duid 773 +--rw ia-pd* [iaid] 774 | +--rw iaid uint32 775 | +--rw ia-pd-options 776 | +--ro lease-state 777 | +--ro ia-pd-prefix? inet:ipv6-prefix 778 | +--ro preferred-lifetime? 779 | | dhcpv6-common:timer-seconds32 780 | +--ro valid-lifetime? 781 | | dhcpv6-common:timer-seconds32 782 | +--ro lease-t1? 783 | | dhcpv6-common:timer-seconds32 784 | +--ro lease-t2? 785 | | dhcpv6-common:timer-seconds32 786 | +--ro allocation-time? yang:date-and-time 787 | +--ro last-renew-rebind? yang:date-and-time 788 | +--ro server-duid? dhcpv6-common:duid 789 +--ro solicit-count? uint32 790 +--ro advertise-count? uint32 791 +--ro request-count? uint32 792 +--ro confirm-count? uint32 793 +--ro renew-count? uint32 794 +--ro rebind-count? uint32 795 +--ro reply-count? uint32 796 +--ro release-count? uint32 797 +--ro decline-count? uint32 798 +--ro reconfigure-count? uint32 799 +--ro information-request-count? uint32 801 notifications: 802 +---n invalid-ia-detected 803 | +--ro iaid uint32 804 | +--ro description? string 805 +---n retransmission-failed 806 | +--ro failure-type enumeration 807 +---n unsuccessful-status-code 808 | +--ro status-code uint16 809 | +--ro server-duid dhcpv6-common:duid 810 +---n server-duid-changed 811 +--ro new-server-duid dhcpv6-common:duid 812 +--ro previous-server-duid dhcpv6-common:duid 813 +--ro lease-ia-na? 814 | -> /dhcpv6-client/client-if/ia-na/iaid 815 +--ro lease-ia-ta? 816 | -> /dhcpv6-client/client-if/ia-ta/iaid 817 +--ro lease-ia-pd? 818 -> /dhcpv6-client/client-if/ia-pd/iaid 820 Figure 3: DHCPv6 Client Data Module Structure 822 Descriptions of important nodes: 824 * enabled: Globally enables/disables all DHCPv6 client functions. 826 * dhcpv6-client: This container holds the client's DHCPv6 specific 827 configuration. 829 * client-if: As a client may have multiple interfaces requesting 830 configuration over DHCP, they are configured in a list. The if- 831 name leaf is the key and is an interface-ref to the applicable 832 interface defined by the 'ietf-interfaces' YANG module. 834 * enabled: Enables/disables all DHCPv6 client function for the 835 specific interface. 837 * client-duid: Each client must have a DUID (DHCP Unique Identifier) 838 to identify itself to servers and relays. A DUID consists of a 839 two-octet type field and an arbitrary length (of no more than 840 128-bytes) content field. Currently there are four defined types 841 of DUIDs in [RFC8415] and [RFC6355]. The DUID may be configured 842 using the format for one of these types, or using the 843 'unstructured' format. The DUID type definitions are imported 844 from the 'ietf-dhcpv6-common.yang' module. [IANA-HARDWARE-TYPES] 845 and [IANA-PEN] are referenced for the relevant DUID types. 847 * client-configured-options: Holds configuration parameters for 848 DHCPv6 options which can be sent by the client. The initial set 849 of applicable option definitions are defined here and additional 850 options that are also relevant to the relay and/or server are 851 imported from the 'ietf-dhcpv6-common' module. Where needed, 852 other DHCPv6 option modules can be augmented as they are defined. 854 * ia-na, ia-ta, ia-pd: Contains configuration nodes relevant for 855 requesting one or more of each of the lease types. Read-only 856 nodes related to the active lease are also located here. 858 Information about notifications: 860 * invalid-ia-detected: Raised when the identity association of the 861 client can be proved to be invalid. Possible conditions include: 862 duplicated address, illegal address, etc. 864 * retransmission-failed: Raised when the retransmission mechanism 865 defined in [RFC8415] has failed. 867 3. DHCPv6 YANG Modules 869 3.1. DHCPv6 Server YANG Module 871 This module imports typedefs from [RFC6991], [RFC8343]. 873 file "ietf-dhcpv6-server.yang" 875 module ietf-dhcpv6-server { 876 yang-version 1.1; 877 namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-server"; 878 prefix "dhcpv6-server"; 880 import ietf-inet-types { 881 prefix inet; 882 reference 883 "RFC 6991: Common YANG Data Types"; 884 } 886 import ietf-yang-types { 887 prefix yang; 888 reference 889 "RFC 6991: Common YANG Data Types"; 890 } 892 import ietf-dhcpv6-common { 893 prefix dhcpv6-common; 894 reference 895 "RFC XXXX: To be updated on publication"; 896 } 898 import ietf-netconf-acm { 899 prefix nacm; 900 reference 901 "RFC 8341: Network Configuration Access Control Model"; 903 } 905 organization 906 "IETF DHC (Dynamic Host Configuration) Working Group"; 908 contact 909 "WG Web: 910 WG List: 911 Author: Yong Cui 912 Author: Linhui Sun 913 Editor: Ian Farrer 914 Author: Sladjana Zeichlin 915 Author: Zihao He 916 Author: Michal Nowikowski "; 918 description "This YANG module defines components for the 919 configuration and management of DHCPv6 servers. 921 Copyright (c) 2021 IETF Trust and the persons identified as 922 authors of the code. All rights reserved. 924 Redistribution and use in source and binary forms, with or 925 without modification, is permitted pursuant to, and subject 926 to the license terms contained in, the Simplified BSD License 927 set forth in Section 4.c of the IETF Trust's Legal Provisions 928 Relating to IETF Documents 929 (http://trustee.ietf.org/license-info). 931 This version of this YANG module is part of RFC XXXX; see 932 the RFC itself for full legal notices."; 934 revision 2021-02-22 { 935 description "Version update for draft -18 publication."; 936 reference "I-D: draft-ietf-dhc-dhcpv6-yang-18"; 937 } 939 revision 2021-01-29 { 940 description "Version update for draft -17 publication."; 941 reference "I-D: draft-ietf-dhc-dhcpv6-yang-17"; 942 } 944 revision 2021-01-06 { 945 description "Version update for draft -16 publication."; 946 reference "I-D: draft-ietf-dhc-dhcpv6-yang-16"; 947 } 949 revision 2020-12-22 { 950 description "Version update for draft -13 publication."; 951 reference "I-D: draft-ietf-dhc-dhcpv6-yang-15"; 952 } 954 revision 2020-12-10 { 955 description "Version update for draft -13 publication."; 956 reference "I-D: draft-ietf-dhc-dhcpv6-yang-13"; 957 } 959 revision 2020-12-01 { 960 description "Version update for draft -12 publication."; 961 reference "I-D: draft-ietf-dhc-dhcpv6-yang-12"; 962 } 964 revision 2020-05-26 { 965 description "Version update for draft -11 publication and 966 to align revisions across the different modules."; 967 reference "I-D: draft-ietf-dhc-dhcpv6-yang-11"; 968 } 970 revision 2019-12-02 { 971 description "Major reworking of the module."; 972 reference "I-D: draft-ietf-dhc-dhcpv6-yang-10"; 973 } 975 revision 2018-09-04 { 976 description ""; 977 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 978 } 980 revision 2018-03-04 { 981 description "Resolved most issues on the DHC official 982 github"; 983 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 984 } 986 revision 2017-12-22 { 987 description "Resolve most issues on Ian's github."; 988 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 989 } 991 revision 2017-11-24 { 992 description "First version of the separated server specific 993 YANG model."; 994 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 995 } 997 /* 998 * Features 999 */ 1001 feature prefix-delegation { 1002 description "Denotes that the server implements DHCPv6 prefix 1003 delegation."; 1004 reference "RFC 8415: Dynamic Host Configuration Protocol for 1005 IPv6 (DHCPv6), Section 6.2"; 1006 } 1008 /* 1009 * Groupings 1010 */ 1012 grouping resource-config { 1013 description "Nodes that are reused at multiple levels in the 1014 DHCPv6 server's addressing hierarchy."; 1015 leaf-list option-set-id { 1016 type leafref { 1017 path "/dhcpv6-server/option-sets/option-set/option-set-id"; 1018 } 1019 description "The ID field of relevant set of DHCPv6 options 1020 (option-set) to be provisioned to clients of this 1021 network-range."; 1022 } 1023 leaf valid-lifetime { 1024 type dhcpv6-common:timer-seconds32; 1025 description "Valid lifetime for the Identity Association 1026 (IA)."; 1027 reference "RFC 8415: Dynamic Host Configuration Protocol for 1028 IPv6 (DHCPv6), Section 6"; 1029 } 1030 leaf renew-time { 1031 type dhcpv6-common:timer-seconds32; 1032 description "Renew (T1) time."; 1033 reference "RFC 8415: Dynamic Host Configuration Protocol for 1034 IPv6 (DHCPv6), Section 4.2"; 1035 } 1036 leaf rebind-time { 1037 type dhcpv6-common:timer-seconds32; 1038 description "Rebind (T2) time."; 1039 reference "RFC 8415: Dynamic Host Configuration Protocol for 1040 IPv6 (DHCPv6), Section 4.2"; 1041 } 1042 leaf preferred-lifetime { 1043 type dhcpv6-common:timer-seconds32; 1044 description "Preferred lifetime for the Identity Association 1045 (IA)."; 1046 reference "RFC 8415: Dynamic Host Configuration Protocol for 1047 IPv6 (DHCPv6), Section 6"; 1048 } 1049 leaf rapid-commit { 1050 type boolean; 1051 description "When set to 'true', Specifies that the pool 1052 supports client-server exchanges involving two messages."; 1053 reference "RFC 8415: Dynamic Host Configuration Protocol for 1054 IPv6 (DHCPv6), Section 5.2"; 1055 } 1056 } 1058 grouping lease-information { 1059 description "Binding information for each client that has 1060 been allocated an IPv6 address or prefix."; 1061 leaf client-duid { 1062 type dhcpv6-common:duid; 1063 description "Client DUID."; 1064 reference "RFC 8415: Dynamic Host Configuration Protocol for 1065 IPv6 (DHCPv6), Section 11"; 1066 } 1067 leaf iaid { 1068 type uint32; 1069 mandatory true; 1070 description "Client's IAID"; 1071 reference "RFC 8415: Dynamic Host Configuration Protocol for 1072 IPv6 (DHCPv6), Section 12"; 1073 } 1074 leaf allocation-time { 1075 type yang:date-and-time; 1076 description "Time and date that the lease was made."; 1077 reference "RFC 8415: Dynamic Host Configuration Protocol for 1078 IPv6 (DHCPv6), Section 18"; 1079 } 1080 leaf last-renew-rebind { 1081 type yang:date-and-time; 1082 description "Time of the last successful renew or 1083 rebind."; 1084 reference "RFC 8415: Dynamic Host Configuration Protocol for 1085 IPv6 (DHCPv6), Section 18"; 1086 } 1087 leaf preferred-lifetime { 1088 type dhcpv6-common:timer-seconds32; 1089 description "The preferred lifetime expressed in 1090 seconds."; 1091 reference "RFC 8415: Dynamic Host Configuration Protocol for 1092 IPv6 (DHCPv6), Section 6"; 1093 } 1094 leaf valid-lifetime { 1095 type dhcpv6-common:timer-seconds32; 1096 description "The valid lifetime for the leased prefix 1097 expressed in seconds."; 1098 reference "RFC 8415: Dynamic Host Configuration Protocol for 1099 IPv6 (DHCPv6), Section 6"; 1100 } 1101 leaf lease-t1 { 1102 type dhcpv6-common:timer-seconds32; 1103 description "The time interval after which the client 1104 should contact the server from which the addresses 1105 in the IA_NA were obtained to extend the lifetimes 1106 of the addresses assigned to the IA_PD."; 1107 reference "RFC 8415: Dynamic Host Configuration Protocol for 1108 IPv6 (DHCPv6), Section 4.2"; 1109 } 1110 leaf lease-t2 { 1111 type dhcpv6-common:timer-seconds32; 1112 description "The time interval after which the client 1113 should contact any available server to extend 1114 the lifetimes of the addresses assigned to the 1115 IA_PD."; 1116 reference "RFC 8415: Dynamic Host Configuration Protocol for 1117 IPv6 (DHCPv6), Section 4.2"; 1118 } 1119 } 1121 grouping message-stats { 1122 description "Counters for DHCPv6 messages."; 1123 leaf solicit-count { 1124 type uint32; 1125 config "false"; 1126 description "Number of Solicit (1) messages received."; 1127 } 1128 leaf advertise-count { 1129 type uint32; 1130 config "false"; 1131 description "Number of Advertise (2) messages sent."; 1132 } 1133 leaf request-count { 1134 type uint32; 1135 config "false"; 1136 description "Number of Request (3) messages received."; 1137 } 1138 leaf confirm-count { 1139 type uint32; 1140 config "false"; 1141 description "Number of Confirm (4) messages received."; 1142 } 1143 leaf renew-count { 1144 type uint32; 1145 config "false"; 1146 description "Number of Renew (5) messages received."; 1147 } 1148 leaf rebind-count { 1149 type uint32; 1150 config "false"; 1151 description "Number of Rebind (6) messages received."; 1152 } 1153 leaf reply-count { 1154 type uint32; 1155 config "false"; 1156 description "Number of Reply (7) messages sent."; 1157 } 1158 leaf release-count { 1159 type uint32; 1160 config "false"; 1161 description "Number of Release (8) messages received."; 1162 } 1163 leaf decline-count { 1164 type uint32; 1165 config "false"; 1166 description "Number of Decline (9) messages received."; 1167 } 1168 leaf reconfigure-count { 1169 type uint32; 1170 config "false"; 1171 description "Number of Reconfigure (10) messages sent."; 1172 } 1173 leaf information-request-count { 1174 type uint32; 1175 config "false"; 1176 description "Number of Information-request (11) messages 1177 received."; 1178 } 1179 } 1181 grouping preference-option-group { 1182 description "OPTION_PREFERENCE (7) Preference Option."; 1183 reference "RFC 8415: Dynamic Host Configuration Protocol for 1184 IPv6 (DHCPv6), Section 21.8"; 1185 container preference-option { 1186 description "OPTION_PREFERENCE (7) Preference Option 1187 container."; 1188 leaf pref-value { 1189 type uint8; 1190 description "The preference value for the server in this 1191 message. A 1-octet unsigned integer."; 1192 } 1193 } 1194 } 1196 grouping server-unicast-option-group { 1197 description "OPTION_UNICAST (12) Server Unicast Option."; 1198 reference "RFC 8415: Dynamic Host Configuration Protocol for 1199 IPv6 (DHCPv6), Section 21.12"; 1200 container server-unicast-option { 1201 description "OPTION_UNICAST (12) Server Unicast Option 1202 container."; 1203 leaf server-address { 1204 type inet:ipv6-address; 1205 description "The 128-bit address to which the client 1206 should send messages delivered using unicast."; 1207 } 1208 } 1209 } 1211 grouping reconfigure-message-option-group { 1212 description "OPTION_RECONF_MSG (19) Reconfigure Message 1213 Option."; 1214 reference "RFC 8415: Dynamic Host Configuration Protocol for 1215 IPv6 (DHCPv6), Section 21.19"; 1216 container reconfigure-message-option { 1217 description "OPTION_RECONF_MSG (19) Reconfigure Message 1218 Option."; 1219 leaf msg-type { 1220 type uint8; 1221 description "5 for Renew message, 6 for Rebind message, 1222 11 for Information-request message."; 1223 } 1224 } 1225 } 1227 grouping info-refresh-time-option-group { 1228 description "OPTION_INFORMATION_REFRESH_TIME (32) 1229 Information Refresh Time Option."; 1230 reference "RFC 8415: Dynamic Host Configuration Protocol for 1231 IPv6 (DHCPv6), Section 21.23"; 1232 container info-refresh-time-option { 1233 description "OPTION_INFORMATION_REFRESH_TIME (32) 1234 Information Refresh Time option container."; 1235 leaf info-refresh-time { 1236 type dhcpv6-common:timer-seconds32; 1237 description "Time duration relative to the current time, 1238 expressed in units of seconds."; 1240 } 1241 } 1242 } 1244 grouping sol-max-rt-option-group { 1245 description "OPTION_SOL_MAX_RT (82) sol max rt Option."; 1246 reference "RFC 8415: Dynamic Host Configuration Protocol for 1247 IPv6 (DHCPv6), Section 21.24"; 1248 container sol-max-rt-option { 1249 description "OPTION_SOL_MAX_RT (82) sol max rt option 1250 container."; 1251 leaf sol-max-rt-value { 1252 type dhcpv6-common:timer-seconds32; 1253 description "sol max rt value"; 1254 } 1255 } 1256 } 1258 grouping inf-max-rt-option-group { 1259 description "OPTION_INF_MAX_RT (83) inf max rt Option."; 1260 reference "RFC 8415: Dynamic Host Configuration Protocol for 1261 IPv6 (DHCPv6), Section 21.25"; 1262 container inf-max-rt-option { 1263 description "OPTION_INF_MAX_RT (83) inf max rt option 1264 container."; 1265 leaf inf-max-rt-value { 1266 type dhcpv6-common:timer-seconds32; 1267 description "inf max rt value"; 1268 } 1269 } 1270 } 1272 /* 1273 * Data Nodes 1274 */ 1276 container dhcpv6-server { 1277 description "Configuration nodes for the DHCPv6 server."; 1278 reference "RFC 8415: Dynamic Host Configuration Protocol for 1279 IPv6 (DHCPv6), Section 18.3"; 1280 leaf enabled { 1281 type boolean; 1282 default true; 1283 description "Enables the DHCP server function."; 1284 } 1285 leaf server-duid { 1286 type dhcpv6-common:duid; 1287 description "DUID of the server."; 1288 reference "RFC 8415: Dynamic Host Configuration Protocol for 1289 IPv6 (DHCPv6), Section 11"; 1290 } 1291 container vendor-config { 1292 description "This container provides a location for 1293 augmenting vendor or implementation specific 1294 configuration nodes."; 1295 } 1296 container option-sets { 1297 description "A server may allow different option sets 1298 to be configured for clients matching specific parameters 1299 such as topological location or client type. The 1300 'option-set' list is a set of options and their 1301 contents that will be returned to clients."; 1302 reference "RFC 8415: Dynamic Host Configuration Protocol for 1303 IPv6 (DHCPv6), Section 21"; 1304 list option-set { 1305 key option-set-id; 1306 description "YANG definitions for DHCPv6 options are 1307 contained in separate YANG modules and augmented to this 1308 container as required."; 1309 leaf option-set-id { 1310 type uint32; 1311 description "Option set identifier."; 1312 } 1313 leaf description { 1314 type string; 1315 description "An optional field for storing additional 1316 information relevant to the option set."; 1317 } 1318 uses preference-option-group; 1319 uses dhcpv6-common:auth-option-group; 1320 uses server-unicast-option-group; 1321 uses dhcpv6-common:status-code-option-group; 1322 uses dhcpv6-common:rapid-commit-option-group; 1323 uses dhcpv6-common:vendor-specific-information-option-group; 1324 uses reconfigure-message-option-group; 1325 uses dhcpv6-common:reconfigure-accept-option-group; 1326 uses info-refresh-time-option-group; 1327 uses sol-max-rt-option-group; 1328 uses inf-max-rt-option-group; 1329 } 1330 } 1332 container class-selector { 1333 description "DHCPv6 servers use a 'class-selector' function 1334 in order to identify and classify incoming client messages 1335 so that they can be given the correct configuration. 1337 The mechanisms used for implementing this function vary 1338 greatly between different implementations such that they 1339 are not possible to include in this module. This container 1340 provides a location for server implementors to augment 1341 their own class-selector YANG."; 1342 } 1344 container network-ranges { 1345 description "This model is based on an address and parameter 1346 allocation hierarchy. The top level is 'global' - which 1347 is defined as the container for all network-ranges. Under 1348 this are the individual network-ranges."; 1349 uses resource-config; 1350 list network-range { 1351 key id; 1352 description "Network-ranges are identified by the 1353 'id' key."; 1354 leaf id { 1355 type uint32; 1356 mandatory true; 1357 description "Equivalent to subnet ID."; 1358 } 1359 leaf description { 1360 type string; 1361 mandatory true; 1362 description "Description for the network range."; 1363 } 1364 leaf network-prefix { 1365 type inet:ipv6-prefix; 1366 mandatory true; 1367 description "Network prefix."; 1368 } 1369 uses resource-config; 1370 container address-pools { 1371 description "Configuration for the DHCPv6 server's 1372 address pools."; 1373 list address-pool { 1374 key pool-id; 1375 description "List of address pools for allocation to 1376 clients, distinguished by 'pool-id'."; 1377 leaf pool-id { 1378 type uint32; 1379 mandatory true; 1380 description "Unique identifier for the pool."; 1381 } 1382 leaf pool-prefix { 1383 type inet:ipv6-prefix; 1384 mandatory true; 1385 description "IPv6 prefix for the pool."; 1386 } 1387 leaf start-address { 1388 type inet:ipv6-address-no-zone; 1389 mandatory true; 1390 description "Start IPv6 address for the pool."; 1391 } 1392 leaf end-address { 1393 type inet:ipv6-address-no-zone; 1394 mandatory true; 1395 description "End IPv6 address for the pool."; 1396 } 1397 leaf max-address-count { 1398 type dhcpv6-common:threshold; 1399 mandatory true; 1400 description "Maximum number of addresses that can 1401 be simultaneously allocated from this pool."; 1402 } 1403 uses resource-config; 1404 container host-reservations { 1405 description "Configuration for host reservations from 1406 the address pool."; 1407 list host-reservation { 1408 key reserved-addr; 1409 description "List of host reservations."; 1410 leaf client-duid { 1411 type dhcpv6-common:duid; 1412 description "Client DUID for the reservation."; 1413 } 1414 leaf reserved-addr { 1415 type inet:ipv6-address; 1416 description "Reserved IPv6 address."; 1417 } 1418 uses resource-config; 1419 } 1420 } 1421 container active-leases { 1422 config false; 1423 description "Holds state related to active client 1424 leases."; 1425 leaf total-count { 1426 type uint64; 1427 mandatory true; 1428 description "The total number of addresses in the 1429 pool."; 1430 } 1431 leaf allocated-count { 1432 type uint64; 1433 mandatory true; 1434 description "The number of addresses or prefixes 1435 in the pool that are currently allocated."; 1436 } 1437 list active-lease { 1438 key leased-address; 1439 description "List of active address leases."; 1440 leaf leased-address { 1441 type inet:ipv6-address; 1442 description "Active address lease entry."; 1443 } 1444 uses lease-information; 1445 } 1446 } 1447 } 1448 } 1449 container prefix-pools { 1450 if-feature prefix-delegation; 1451 description "Configuration for the DHCPv6 server's 1452 prefix pools."; 1453 list prefix-pool { 1454 key pool-id; 1455 description "List of prefix pools for allocation to 1456 clients, distinguished by 'pool-id'."; 1457 leaf pool-id { 1458 type uint32; 1459 mandatory true; 1460 description "Unique identifier for the pool."; 1461 } 1462 leaf pool-prefix { 1463 type inet:ipv6-prefix; 1464 mandatory true; 1465 description "IPv6 prefix for the pool."; 1466 } 1467 leaf client-prefix-length { 1468 type uint8; 1469 mandatory true; 1470 description "Length of the prefixes that will be 1471 delegated to clients."; 1472 } 1473 leaf max-pd-space-utilization { 1474 type dhcpv6-common:threshold; 1475 mandatory true; 1476 description "Maximum percentage utilization of the 1477 prefix pool in this pool."; 1478 } 1479 uses resource-config; 1480 container host-reservations { 1481 description "Configuration for host reservations 1482 from the prefix pool."; 1483 list prefix-reservation { 1484 key reserved-prefix; 1485 description "reserved prefix reservation"; 1486 leaf client-duid { 1487 type dhcpv6-common:duid; 1488 description "Client DUID for the reservation."; 1489 } 1490 leaf reserved-prefix { 1491 type inet:ipv6-prefix; 1492 description "Reserved IPv6 prefix"; 1493 } 1494 leaf reserved-prefix-len { 1495 type uint8; 1496 description "Reserved IPv6 prefix length."; 1497 } 1498 } 1499 uses resource-config; 1500 } 1501 container active-leases { 1502 config false; 1503 description "Holds state related to for active client 1504 prefix leases."; 1505 leaf total-count { 1506 type uint64; 1507 mandatory true; 1508 description "The total number of prefixes in 1509 the pool."; 1510 } 1511 leaf allocated-count { 1512 type uint64; 1513 mandatory true; 1514 description "The number of prefixes in the pool 1515 that are currently allocated."; 1516 } 1517 list active-lease { 1518 key leased-prefix; 1519 description "List of active prefix leases."; 1520 leaf leased-prefix { 1521 type inet:ipv6-prefix; 1522 description "Active leased prefix entry."; 1523 } 1524 uses lease-information; 1525 } 1526 } 1527 } 1528 } 1530 } 1531 uses message-stats; 1532 } 1533 } 1535 /* 1536 * Notifications 1537 */ 1539 notification address-pool-utilization-threshold-exceeded { 1540 description "Notification sent when the address pool 1541 utilization exceeds the configured threshold."; 1542 leaf pool-id { 1543 type leafref { 1544 path "/dhcpv6-server/network-ranges/network-range/" + 1545 "address-pools/address-pool/pool-id"; 1546 } 1547 description "Leafref to the address pool which the notification 1548 is being generated for."; 1549 } 1550 leaf total-address-count { 1551 type uint64; 1552 mandatory true; 1553 description "Count of the total addresses in the pool."; 1554 } 1555 leaf max-address-count { 1556 type uint64; 1557 mandatory true; 1558 description "Maximum count of addresses that can be allocated 1559 in the pool. This value may be less than count of total 1560 addresses."; 1561 } 1562 leaf allocated-address-count { 1563 type uint64; 1564 mandatory true; 1565 description "Count of allocated addresses in the pool."; 1566 } 1567 } 1569 notification prefix-pool-utilization-threshold-exceeded { 1570 if-feature prefix-delegation; 1571 description "Notification sent when the prefix pool 1572 utilization exceeds the configured threshold."; 1573 leaf pool-id { 1574 type leafref { 1575 path "/dhcpv6-server/network-ranges/network-range/" + 1576 "prefix-pools/prefix-pool/pool-id"; 1577 } 1578 mandatory true; 1579 description "Unique identifier for the pool."; 1580 } 1581 leaf max-pd-space-utilization { 1582 type leafref { 1583 path "/dhcpv6-server/network-ranges/network-range/" + 1584 "prefix-pools/prefix-pool/max-pd-space-utilization"; 1585 } 1586 mandatory true; 1587 description "PD space utilization threshold."; 1588 } 1589 leaf pd-space-utilization { 1590 type uint64; 1591 description "Current PD space utilization"; 1592 } 1593 } 1595 notification invalid-client-detected { 1596 description "Notification sent when the server detects an 1597 invalid client."; 1598 leaf duid { 1599 type dhcpv6-common:duid; 1600 description "Client DUID."; 1601 } 1602 leaf description { 1603 type string; 1604 description "Description of the event (e.g. and error code or 1605 log message)."; 1606 } 1607 } 1609 notification decline-received { 1610 description "Notification sent when the server has received a 1611 Decline (9) message from a client."; 1612 leaf duid { 1613 type dhcpv6-common:duid; 1614 description "Client DUID."; 1615 } 1616 list declined-resources { 1617 description "List of declined addresses and/or prefixes."; 1618 choice resource-type { 1619 description "Type of resource that has been declined."; 1620 case declined-address { 1621 leaf address { 1622 type inet:ipv6-address; 1623 description "Address that has been declined."; 1624 } 1625 } 1626 case declined-prefix { 1627 leaf prefix { 1628 type inet:ipv6-prefix; 1629 description "Prefix that has been declined."; 1630 } 1631 } 1632 } 1633 } 1634 } 1636 notification non-success-code-sent { 1637 description "Notification sent when the server responded 1638 to a client with non-success status code."; 1639 leaf status-code { 1640 type uint16; 1641 mandatory true; 1642 description "Status code returned to the client."; 1643 } 1644 leaf duid { 1645 type dhcpv6-common:duid; 1646 description "Client DUID."; 1647 } 1648 } 1650 /* 1651 * RPCs 1652 */ 1654 rpc delete-address-lease { 1655 nacm:default-deny-all; 1656 description "Deletes a client's active address lease from the 1657 server's lease database. Note, this will not cause the address 1658 to be revoked from the client, and the lease may be refreshed 1659 or renewed by the client."; 1660 input { 1661 leaf lease-address-to-delete { 1662 type inet:ipv6-address; 1663 mandatory true; 1664 description "IPv6 address of an active lease that will be 1665 deleted from the server."; 1666 } 1667 } 1668 output { 1669 leaf return-message { 1670 type string; 1671 description "Response message from the server."; 1672 } 1673 } 1675 } 1676 rpc delete-prefix-lease { 1677 nacm:default-deny-all; 1678 description "Deletes a client's active prefix lease from the 1679 server's lease database. Note, this will not cause the prefix 1680 to be revoked from the client, and the lease may be refreshed 1681 or renewed by the client."; 1682 input { 1683 leaf lease-prefix-to-delete { 1684 type inet:ipv6-prefix; 1685 mandatory true; 1686 description "IPv6 prefix of an active lease that will be 1687 deleted from the server."; 1688 } 1689 } 1690 output { 1691 leaf return-message { 1692 type string; 1693 description "Response message from the server."; 1694 } 1695 } 1696 } 1697 } 1698 1700 3.2. DHCPv6 Relay YANG Module 1702 This module imports typedefs from [RFC6991], [RFC8343]. 1704 file "ietf-dhcpv6-relay.yang" 1706 module ietf-dhcpv6-relay { 1707 yang-version 1.1; 1708 namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-relay"; 1709 prefix "dhcpv6-relay"; 1711 import ietf-inet-types { 1712 prefix inet; 1713 reference 1714 "RFC 6991: Common YANG Data Types"; 1715 } 1717 import ietf-yang-types { 1718 prefix yang; 1719 reference 1720 "RFC 6991: Common YANG Data Types"; 1721 } 1722 import ietf-dhcpv6-common { 1723 prefix dhcpv6-common; 1724 reference 1725 "RFC XXXX: To be updated on publication"; 1726 } 1728 import ietf-interfaces { 1729 prefix if; 1730 reference 1731 "RFC 8343: A YANG Data Model for Interface Management"; 1732 } 1734 import ietf-netconf-acm { 1735 prefix nacm; 1736 reference 1737 "RFC 8341: Network Configuration Access Control Model"; 1738 } 1740 organization 1741 "IETF DHC (Dynamic Host Configuration) Working Group"; 1743 contact 1744 "WG Web: 1745 WG List: 1746 Author: Yong Cui 1747 Author: Linhui Sun 1748 Editor: Ian Farrer 1749 Author: Sladjana Zeichlin 1750 Author: Zihao He 1751 Author: Michal Nowikowski "; 1753 description 1754 "This YANG module defines components necessary for the 1755 configuration and management of DHCPv6 relays. 1757 Copyright (c) 2021 IETF Trust and the persons identified as 1758 authors of the code. All rights reserved. 1760 Redistribution and use in source and binary forms, with or 1761 without modification, is permitted pursuant to, and subject 1762 to the license terms contained in, the Simplified BSD License 1763 set forth in Section 4.c of the IETF Trust's Legal Provisions 1764 Relating to IETF Documents 1765 (http://trustee.ietf.org/license-info). 1767 This version of this YANG module is part of RFC XXXX; see 1768 the RFC itself for full legal notices."; 1770 revision 2021-02-22 { 1771 description "Version update for draft -18 publication."; 1772 reference "I-D: draft-ietf-dhc-dhcpv6-yang-18"; 1773 } 1775 revision 2021-01-29 { 1776 description "Version update for draft -17 publication."; 1777 reference "I-D: draft-ietf-dhc-dhcpv6-yang-17"; 1778 } 1780 revision 2021-01-06 { 1781 description "Version update for draft -16 publication."; 1782 reference "I-D: draft-ietf-dhc-dhcpv6-yang-16"; 1783 } 1785 revision 2020-12-22 { 1786 description "Version update for draft -13 publication."; 1787 reference "I-D: draft-ietf-dhc-dhcpv6-yang-15"; 1788 } 1790 revision 2020-12-10 { 1791 description "Version update for draft -13 publication."; 1792 reference "I-D: draft-ietf-dhc-dhcpv6-yang-13"; 1793 } 1795 revision 2020-12-01 { 1796 description "Version update for draft -12 publication."; 1797 reference "I-D: draft-ietf-dhc-dhcpv6-yang-12"; 1798 } 1800 revision 2020-05-26 { 1801 description "Version update for draft -11 publication and 1802 to align revisions across the different modules."; 1803 reference "I-D: draft-ietf-dhc-dhcpv6-yang-11"; 1804 } 1806 revision 2019-09-20 { 1807 description ""; 1808 reference "I-D: draft-ietf-dhc-dhcpv6-yang-10"; 1809 } 1811 revision 2018-03-04 { 1812 description "Resolved most issues on the DHC official 1813 github"; 1814 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 1815 } 1817 revision 2017-12-22 { 1818 description 1819 "Resolve most issues on Ians Github."; 1820 reference 1821 "I-D: draft-ietf-dhc-dhcpv6-yang"; 1822 } 1824 revision 2017-11-24 { 1825 description 1826 "First version of the separated relay specific 1827 YANG model."; 1828 reference 1829 "I-D: draft-ietf-dhc-dhcpv6-yang"; 1830 } 1832 /* 1833 * Features 1834 */ 1836 feature prefix-delegation { 1837 description "Enable if the relay functions as a delegating router 1838 for DHCPv6 prefix delegation."; 1839 reference "RFC 8415: Dynamic Host Configuration Protocol for 1840 IPv6 (DHCPv6), Section 6.2"; 1841 } 1843 /* 1844 * Groupings 1845 */ 1847 grouping pd-lease-state { 1848 description "State data for the relay."; 1849 list pd-leases { 1850 key ia-pd-prefix; 1851 config false; 1852 description "Information about an active IA_PD prefix 1853 delegation."; 1854 leaf ia-pd-prefix { 1855 type inet:ipv6-prefix; 1856 description "Prefix that is delegated."; 1857 } 1858 leaf last-renew { 1859 type yang:date-and-time; 1860 description "Time of the last successful refresh or renew 1861 of the delegated prefix."; 1862 } 1863 leaf client-peer-address { 1864 type inet:ipv6-address; 1865 description "Peer-address of the client."; 1867 } 1868 leaf client-duid { 1869 type dhcpv6-common:duid; 1870 description "DUID of the leasing client."; 1871 } 1872 leaf server-duid { 1873 type dhcpv6-common:duid; 1874 description "DUID of the delegating server."; 1875 } 1876 } 1877 } 1879 grouping message-statistics { 1880 description "Contains counters for the different DHCPv6 1881 message types."; 1882 leaf solicit-received-count { 1883 type uint32; 1884 config "false"; 1885 description "Number of Solicit (1) messages received."; 1886 } 1887 leaf advertise-sent-count { 1888 type uint32; 1889 config "false"; 1890 description "Number of Advertise (2) messages sent."; 1891 } 1892 leaf request-received-count { 1893 type uint32; 1894 config "false"; 1895 description "Number of Request (3) messages received."; 1896 } 1897 leaf confirm-received-count { 1898 type uint32; 1899 config "false"; 1900 description "Number of Confirm (4) messages received."; 1901 } 1902 leaf renew-received-count { 1903 type uint32; 1904 config "false"; 1905 description "Number of Renew (5) messages received."; 1906 } 1907 leaf rebind-received-count { 1908 type uint32; 1909 config "false"; 1910 description "Number of Rebind (6) messages received."; 1911 } 1912 leaf reply-sent-count { 1913 type uint32; 1914 config "false"; 1915 description "Number of Reply (7) messages received."; 1916 } 1917 leaf release-received-count { 1918 type uint32; 1919 config "false"; 1920 description "Number of Release (8) messages sent."; 1921 } 1922 leaf decline-received-count { 1923 type uint32; 1924 config "false"; 1925 description "Number of Decline (9) messages sent."; 1926 } 1927 leaf reconfigure-sent-count { 1928 type uint32; 1929 config "false"; 1930 description "Number of Reconfigure (10) messages sent."; 1931 } 1932 leaf information-request-received-count { 1933 type uint32; 1934 config "false"; 1935 description "Number of Information-request (11) messages 1936 received."; 1937 } 1938 leaf unknown-message-received-count { 1939 type uint32; 1940 config "false"; 1941 description 1942 "Number of messages of unknown type that have been 1943 received."; 1944 } 1945 leaf unknown-message-sent-count { 1946 type uint32; 1947 config "false"; 1948 description 1949 "Number of messages of unknown type that have been sent."; 1950 } 1951 leaf discarded-message-count { 1952 type uint32; 1953 config "false"; 1954 description 1955 "Number of messages that have been discarded for any 1956 reason."; 1957 } 1958 } 1960 grouping global-statistics { 1961 description "Global statistics for the device."; 1962 leaf relay-forward-sent-count { 1963 type uint32; 1964 config "false"; 1965 description "Number of Relay-forward (12) messages sent."; 1966 } 1967 leaf relay-forward-received-count { 1968 type uint32; 1969 config "false"; 1970 description "Number of Relay-forward (12) messages received."; 1971 } 1972 leaf relay-reply-received-count { 1973 type uint32; 1974 config "false"; 1975 description "Number of Relay-reply (13) messages received."; 1976 } 1977 leaf relay-forward-unknown-sent-count { 1978 type uint32; 1979 config "false"; 1980 description "Number of Relay-forward (12) messages containing 1981 a message of unknown type sent."; 1982 } 1983 leaf relay-forward-unknown-received-count { 1984 type uint32; 1985 config "false"; 1986 description "Number of Relay-forward (12) messages containing 1987 a message of unknown type received."; 1988 } 1989 leaf discarded-message-count { 1990 type uint32; 1991 config "false"; 1992 description "Number of messages that have been discarded 1993 for any reason."; 1994 } 1995 } 1997 grouping interface-id-option-group { 1998 description "OPTION_INTERFACE_ID (18) Interface-Id Option."; 1999 reference "RFC 8415: Dynamic Host Configuration Protocol for 2000 IPv6 (DHCPv6), Section 21.18"; 2001 container interface-id-option { 2002 description "OPTION_INTERFACE_ID (18) Interface-Id Option 2003 container."; 2004 leaf interface-id { 2005 type string; 2006 description "An opaque value of arbitrary length generated 2007 by the relay agent to identify one of the relay agent's 2008 interfaces."; 2009 } 2010 } 2012 } 2014 /* 2015 * Data Nodes 2016 */ 2018 container dhcpv6-relay { 2019 description 2020 "This container contains the configuration data nodes for 2021 the relay."; 2022 reference "RFC 8415: Dynamic Host Configuration Protocol for 2023 IPv6 (DHCPv6), Section 19"; 2024 leaf enabled { 2025 type boolean; 2026 default true; 2027 description "Globally enables the DHCP relay function."; 2028 } 2029 list relay-if { 2030 key if-name; 2031 description "List of interfaces configured for DHCPv6 2032 relaying."; 2033 leaf if-name { 2034 type if:interface-ref; 2035 description "interface-ref to the relay interface."; 2036 } 2037 leaf enabled { 2038 type boolean; 2039 default true; 2040 description "Enables the DHCP relay function for this 2041 interface."; 2042 } 2043 leaf-list destination-addresses { 2044 type inet:ipv6-address; 2045 description "Each DHCPv6 relay agent may be configured with 2046 a list of destination addresses for relayed messages. 2047 The list may include unicast addresses, multicast addresses 2048 or other valid addresses."; 2049 } 2050 leaf link-address { 2051 type binary { 2052 length "0..16"; 2053 } 2054 description "An address that may be used by the server 2055 to identify the link on which the client is located."; 2056 } 2057 container relay-options { 2058 description "Definitions for DHCPv6 options that can be sent 2059 by the relay are augmented to this location from other YANG 2060 modules as required."; 2061 uses dhcpv6-common:auth-option-group; 2062 uses dhcpv6-common:status-code-option-group; 2063 uses interface-id-option-group; 2064 } 2065 uses message-statistics; 2066 container prefix-delegation { 2067 if-feature prefix-delegation; 2068 presence "Enables prefix delegation for this interface."; 2069 description "Controls and holds state information for prefix 2070 delegation."; 2071 uses pd-lease-state; 2072 } 2073 } 2074 uses global-statistics; 2075 } 2077 /* 2078 * Notifications 2079 */ 2081 notification relay-event { 2082 description 2083 "DHCPv6 relay event notifications."; 2084 container topology-change { 2085 description "Raised if the entry for an interface with DHCPv6 2086 related configuration or state is removed from 2087 if:interface-refs."; 2088 leaf relay-if-name { 2089 type leafref { 2090 path "/dhcpv6-relay/relay-if/if-name"; 2091 } 2092 description "Name of the interface that has been removed."; 2093 } 2094 leaf last-ipv6-addr { 2095 type inet:ipv6-address; 2096 description "Last IPv6 address configured on the interface."; 2097 } 2098 } 2099 } 2101 /* 2102 * RPCs 2103 */ 2105 rpc clear-prefix-entry { 2106 nacm:default-deny-all; 2107 description "Clears an entry for an active delegated prefix 2108 from the relay."; 2109 reference "draft-ietf-dhc-dhcpv6-pd-relay-requirements: DHCPv6 2110 Prefix Delegating Relay Requirements, Section 4.4"; 2111 input { 2112 leaf lease-prefix { 2113 type inet:ipv6-prefix; 2114 mandatory true; 2115 description "IPv6 prefix of an active lease entry that will 2116 be deleted from the relay."; 2117 } 2118 } 2119 output { 2120 leaf return-message { 2121 type string; 2122 description "Response message from the relay."; 2123 } 2124 } 2125 } 2126 rpc clear-client-prefixes { 2127 nacm:default-deny-all; 2128 description "Clears all active prefix entries for a single 2129 client."; 2130 reference "draft-ietf-dhc-dhcpv6-pd-relay-requirements: DHCPv6 2131 Prefix Delegating Relay Requirements, Section 4.4"; 2132 input { 2133 leaf client-duid { 2134 type dhcpv6-common:duid; 2135 mandatory true; 2136 description "DUID of the client ."; 2137 } 2138 } 2139 output { 2140 leaf return-message { 2141 type string; 2142 description "Response message from the relay."; 2143 } 2144 } 2145 } 2146 rpc clear-interface-prefixes { 2147 nacm:default-deny-all; 2148 description "Clears all delegated prefix bindings from an 2149 interface on the relay."; 2150 reference "draft-ietf-dhc-dhcpv6-pd-relay-requirements: DHCPv6 2151 Prefix Delegating Relay Requirements, Section 4.4"; 2152 input { 2153 leaf interface { 2154 type if:interface-ref; 2155 mandatory true; 2156 description "Reference to the relay interface that will have 2157 all active prefix delegation bindings deleted."; 2158 } 2159 } 2160 output { 2161 leaf return-message { 2162 type string; 2163 description "Response message from the relay."; 2164 } 2165 } 2166 } 2167 } 2168 2170 3.3. DHCPv6 Client YANG Module 2172 This module imports typedefs from [RFC6991], [RFC8343]. 2174 file "ietf-dhcpv6-client.yang" 2176 module ietf-dhcpv6-client { 2177 yang-version 1.1; 2178 namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-client"; 2179 prefix "dhcpv6-client"; 2181 import ietf-inet-types { 2182 prefix inet; 2183 reference 2184 "RFC 6991: Common YANG Data Types"; 2185 } 2187 import ietf-yang-types { 2188 prefix yang; 2189 reference 2190 "RFC 6991: Common YANG Data Types"; 2191 } 2193 import ietf-dhcpv6-common { 2194 prefix dhcpv6-common; 2195 reference 2196 "RFC XXXX: To be updated on publication"; 2197 } 2199 import ietf-interfaces { 2200 prefix if; 2201 reference 2202 "RFC 8343: A YANG Data Model for Interface Management"; 2203 } 2204 organization 2205 "IETF DHC (Dynamic Host Configuration) Working Group"; 2207 contact 2208 "WG Web: 2209 WG List: 2210 Author: Yong Cui 2211 Author: Linhui Sun 2212 Editor: Ian Farrer 2213 Author: Sladjana Zeichlin 2214 Author: Zihao He 2215 Author: Michal Nowikowski "; 2217 description 2218 "This YANG module defines components necessary for the 2219 configuration and management of DHCPv6 clients. 2221 Copyright (c) 2021 IETF Trust and the persons identified as 2222 authors of the code. All rights reserved. 2224 Redistribution and use in source and binary forms, with or 2225 without modification, is permitted pursuant to, and subject 2226 to the license terms contained in, the Simplified BSD License 2227 set forth in Section 4.c of the IETF Trust's Legal Provisions 2228 Relating to IETF Documents 2229 (http://trustee.ietf.org/license-info). 2231 This version of this YANG module is part of RFC XXXX; see 2232 the RFC itself for full legal notices."; 2234 revision 2021-02-22 { 2235 description "Version update for draft -18 publication."; 2236 reference "I-D: draft-ietf-dhc-dhcpv6-yang-18"; 2237 } 2239 revision 2021-01-29 { 2240 description "Version update for draft -17 publication."; 2241 reference "I-D: draft-ietf-dhc-dhcpv6-yang-17"; 2242 } 2244 revision 2021-01-06 { 2245 description "Version update for draft -16 publication."; 2246 reference "I-D: draft-ietf-dhc-dhcpv6-yang-16"; 2247 } 2249 revision 2020-12-22 { 2250 description "Version update for draft -13 publication."; 2251 reference "I-D: draft-ietf-dhc-dhcpv6-yang-15"; 2253 } 2255 revision 2020-12-10 { 2256 description "Version update for draft -13 publication."; 2257 reference "I-D: draft-ietf-dhc-dhcpv6-yang-13"; 2258 } 2260 revision 2020-12-01 { 2261 description "Version update for draft -12 publication."; 2262 reference "I-D: draft-ietf-dhc-dhcpv6-yang-12"; 2263 } 2265 revision 2020-05-26 { 2266 description "Version update for draft -11 publication and 2267 to align revisions across the different modules."; 2268 reference "I-D: draft-ietf-dhc-dhcpv6-yang-11"; 2269 } 2271 revision 2019-09-20 { 2272 description ""; 2273 reference "I-D: draft-ietf-dhc-dhcpv6-yang-10"; 2274 } 2276 revision 2018-09-04 { 2277 description ""; 2278 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 2279 } 2281 revision 2018-03-04 { 2282 description "Resolved most issues on the DHC official github"; 2283 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 2284 } 2286 revision 2017-12-22 { 2287 description "Resolve most issues on Ian's Github."; 2288 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 2289 } 2291 revision 2017-11-24 { 2292 description "First version of the separated client specific 2293 YANG model."; 2294 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 2295 } 2297 /* 2298 * Groupings 2299 */ 2301 grouping message-statistics { 2302 description "Counters for DHCPv6 messages."; 2303 leaf solicit-count { 2304 type uint32; 2305 config "false"; 2306 description "Number of Solicit (1) messages sent."; 2307 } 2308 leaf advertise-count { 2309 type uint32; 2310 config "false"; 2311 description "Number of Advertise (2) messages received."; 2312 } 2313 leaf request-count { 2314 type uint32; 2315 config "false"; 2316 description "Number of Request (3) messages sent."; 2317 } 2318 leaf confirm-count { 2319 type uint32; 2320 config "false"; 2321 description "Number of Confirm (4) messages sent."; 2322 } 2323 leaf renew-count { 2324 type uint32; 2325 config "false"; 2326 description "Number of Renew (5) messages sent."; 2327 } 2328 leaf rebind-count { 2329 type uint32; 2330 config "false"; 2331 description "Number of Rebind (6) messages sent."; 2332 } 2333 leaf reply-count { 2334 type uint32; 2335 config "false"; 2336 description "Number of Reply (7) messages received."; 2337 } 2338 leaf release-count { 2339 type uint32; 2340 config "false"; 2341 description "Number of Release (8) messages sent."; 2342 } 2343 leaf decline-count { 2344 type uint32; 2345 config "false"; 2346 description "Number of Decline (9) messages sent."; 2347 } 2348 leaf reconfigure-count { 2349 type uint32; 2350 config "false"; 2351 description "Number of Reconfigure (10) messages received."; 2352 } 2353 leaf information-request-count { 2354 type uint32; 2355 config "false"; 2356 description "Number of Information-request (11) messages 2357 sent."; 2358 } 2359 } 2361 grouping option-request-option-group { 2362 description "OPTION_ORO (6) Option Request Option. A client 2363 MUST include an Option Request option in a Solicit, Request, 2364 Renew, Rebind, or Information-request message to inform 2365 the server about options the client wants the server to send 2366 to the client."; 2367 reference "RFC 8415: Dynamic Host Configuration Protocol for 2368 IPv6 (DHCPv6), Section 21.7"; 2369 container option-request-option { 2370 description "OPTION_ORO (6) Option Request Option container."; 2371 leaf-list oro-option { 2372 type uint16; 2373 description "List of options that the client is requesting, 2374 identified by option code"; 2375 } 2376 } 2377 } 2379 grouping user-class-option-group { 2380 description "OPTION_USER_CLASS (15) User Class Option"; 2381 reference "RFC 8415: Dynamic Host Configuration Protocol 2382 for IPv6 (DHCPv6), Section 21.15"; 2383 container user-class-option { 2384 presence "Configures the option"; 2385 description "OPTION_USER_CLASS (15) User Class Option 2386 container."; 2387 list user-class-data { 2388 key user-class-datum-id; 2389 min-elements 1; 2390 description "The user classes of which the client 2391 is a member."; 2392 leaf user-class-datum-id { 2393 type uint8; 2394 description "User class datum ID"; 2395 } 2396 leaf user-class-datum { 2397 type string; 2398 description "Opaque field representing a User Class 2399 of which the client is a member."; 2400 } 2401 } 2402 } 2403 } 2405 grouping vendor-class-option-group { 2406 description "OPTION_VENDOR_CLASS (16) Vendor Class Option"; 2407 reference "RFC 8415: Dynamic Host Configuration Protocol 2408 for IPv6 (DHCPv6), Section 21.16"; 2409 container vendor-class-option { 2410 description "OPTION_VENDOR_CLASS (16) Vendor Class Option 2411 container."; 2412 list vendor-class-option-instances { 2413 key enterprise-number; 2414 description "The vendor class option allows for multiple 2415 instances in a single message. Each list entry defines 2416 the contents of an instance of the option."; 2417 leaf enterprise-number { 2418 type uint32; 2419 description "The vendor's registered Enterprise Number 2420 as maintained by IANA."; 2421 } 2422 list vendor-class { 2423 key vendor-class-datum-id; 2424 description "The vendor classes of which the client is 2425 a member."; 2426 leaf vendor-class-datum-id { 2427 type uint8; 2428 description "Vendor class datum ID"; 2429 } 2430 leaf vendor-class-datum { 2431 type string; 2432 description "Opaque field representing a vendor class 2433 of which the client is a member."; 2434 } 2435 } 2436 } 2437 } 2438 } 2440 /* 2441 * Data Nodes 2442 */ 2444 container dhcpv6-client { 2445 description "DHCPv6 client configuration and state."; 2446 leaf enabled { 2447 type boolean; 2448 default true; 2449 description "Globally enables the DHCP client function."; 2450 } 2451 list client-if { 2452 key if-name; 2453 description "The list of interfaces that the client will be 2454 requesting DHCPv6 configuration for."; 2455 leaf if-name { 2456 type if:interface-ref; 2457 mandatory true; 2458 description "Reference to the interface entry that 2459 the requested configuration is relevant to."; 2460 } 2461 leaf enabled { 2462 type boolean; 2463 default true; 2464 description "Enables the DHCP client function for this 2465 interface."; 2466 } 2467 leaf duid { 2468 type dhcpv6-common:duid; 2469 description "Client DUID."; 2470 reference "RFC 8415: Dynamic Host Configuration Protocol for 2471 IPv6 (DHCPv6), Section 11"; 2472 } 2473 container client-configured-options { 2474 description " Definitions for DHCPv6 options that can be be 2475 sent by the client. Additional option definitions can be 2476 augmented to this location from other YANG modules as 2477 required."; 2478 uses option-request-option-group; 2479 uses dhcpv6-common:status-code-option-group; 2480 uses dhcpv6-common:rapid-commit-option-group; 2481 uses user-class-option-group; 2482 uses vendor-class-option-group; 2483 uses dhcpv6-common:vendor-specific-information-option-group; 2484 uses dhcpv6-common:reconfigure-accept-option-group; 2485 } 2486 list ia-na { 2487 key iaid; 2488 description "Configuration relevant for an IA_NA."; 2489 reference "RFC 8415: Dynamic Host Configuration Protocol 2490 for IPv6 (DHCPv6), Section 13.1"; 2491 leaf iaid { 2492 type uint32; 2493 description "A unique identifier for this IA_NA."; 2494 reference "RFC 8415: Dynamic Host Configuration Protocol 2495 for IPv6 (DHCPv6), Section 12"; 2496 } 2497 container ia-na-options { 2498 description "An augmentation point for additional options 2499 that the client will send in the IA_NA-options field 2500 of OPTION_IA_NA."; 2501 } 2502 container lease-state { 2503 config "false"; 2504 description "Information about the active IA_NA lease."; 2505 leaf ia-na-address { 2506 type inet:ipv6-address; 2507 description "Address that is currently leased."; 2508 } 2509 leaf preferred-lifetime { 2510 type dhcpv6-common:timer-seconds32; 2511 description "The preferred lifetime for the leased 2512 address expressed in units of seconds."; 2513 } 2514 leaf valid-lifetime { 2515 type dhcpv6-common:timer-seconds32; 2516 description "The valid lifetime for the leased address 2517 expressed in units of seconds."; 2518 } 2519 leaf lease-t1 { 2520 type dhcpv6-common:timer-seconds32; 2521 description "The time interval after which the client 2522 should contact the server from which the addresses 2523 in the IA_NA were obtained to extend the lifetimes 2524 of the addresses assigned to the IA_NA."; 2525 } 2526 leaf lease-t2 { 2527 type dhcpv6-common:timer-seconds32; 2528 description "The time interval after which the client 2529 should contact any available server to extend 2530 the lifetimes of the addresses assigned to the IA_NA."; 2531 } 2532 leaf allocation-time { 2533 type yang:date-and-time; 2534 description "Time and date that the address was first 2535 leased."; 2536 } 2537 leaf last-renew-rebind { 2538 type yang:date-and-time; 2539 description "Time of the last successful renew or rebind 2540 of the leased address."; 2542 } 2543 leaf server-duid { 2544 type dhcpv6-common:duid; 2545 description "DUID of the leasing server."; 2546 } 2547 } 2548 } 2549 list ia-ta { 2550 key iaid; 2551 description "Configuration relevant for an IA_TA."; 2552 reference "RFC 8415: Dynamic Host Configuration Protocol for 2553 IPv6 (DHCPv6), Section 13.2"; 2554 leaf iaid { 2555 type uint32; 2556 description "The unique identifier for this IA_TA."; 2557 reference "RFC 8415: Dynamic Host Configuration Protocol 2558 for IPv6 (DHCPv6), Section 12"; 2559 } 2560 container ia-ta-options { 2561 description "An augmentation point for additional options 2562 that the client will send in the IA_TA-options field 2563 of OPTION_IA_TA."; 2564 } 2565 container lease-state { 2566 config "false"; 2567 description "Information about an active IA_TA lease."; 2568 leaf ia-ta-address { 2569 type inet:ipv6-address; 2570 description "Address that is currently leased."; 2571 } 2572 leaf preferred-lifetime { 2573 type dhcpv6-common:timer-seconds32; 2574 description "The preferred lifetime for the leased 2575 address expressed in units of seconds."; 2576 } 2577 leaf valid-lifetime { 2578 type dhcpv6-common:timer-seconds32; 2579 description "The valid lifetime for the leased address 2580 expressed in units of seconds."; 2581 } 2582 leaf allocation-time { 2583 type yang:date-and-time; 2584 description "Time and date that the address was first 2585 leased."; 2586 } 2587 leaf last-renew-rebind { 2588 type yang:date-and-time; 2589 description "Time of the last successful renew or rebind 2590 of the address."; 2591 } 2592 leaf server-duid { 2593 type dhcpv6-common:duid; 2594 description "DUID of the leasing server."; 2595 } 2596 } 2597 } 2598 list ia-pd { 2599 key iaid; 2600 description "Configuration relevant for an IA_PD."; 2601 reference "RFC 8415: Dynamic Host Configuration Protocol for 2602 IPv6 (DHCPv6), Section 13.3"; 2603 leaf iaid { 2604 type uint32; 2605 description "The unique identifier for this IA_PD."; 2606 reference "RFC 8415: Dynamic Host Configuration Protocol 2607 for IPv6 (DHCPv6), Section 12"; 2608 } 2609 container ia-pd-options { 2610 description "An augmentation point for additional options 2611 that the client will send in the IA_PD-options field 2612 of OPTION_IA_TA."; 2613 } 2614 container lease-state { 2615 config "false"; 2616 description "Information about an active IA_PD delegated 2617 prefix."; 2618 leaf ia-pd-prefix { 2619 type inet:ipv6-prefix; 2620 description "Delegated prefix that is currently leased."; 2621 } 2622 leaf preferred-lifetime { 2623 type dhcpv6-common:timer-seconds32; 2624 description "The preferred lifetime for the leased prefix 2625 expressed in units of seconds."; 2626 } 2627 leaf valid-lifetime { 2628 type dhcpv6-common:timer-seconds32; 2629 description "The valid lifetime for the leased prefix 2630 expressed in units of seconds."; 2631 } 2632 leaf lease-t1 { 2633 type dhcpv6-common:timer-seconds32; 2634 description "The time interval after which the client 2635 should contact the server from which the addresses 2636 in the IA_NA were obtained to extend the lifetimes 2637 of the addresses assigned to the IA_PD."; 2639 } 2640 leaf lease-t2 { 2641 type dhcpv6-common:timer-seconds32; 2642 description "The time interval after which the client 2643 should contact any available server to extend 2644 the lifetimes of the addresses assigned to the IA_PD."; 2645 } 2646 leaf allocation-time { 2647 type yang:date-and-time; 2648 description "Time and date that the prefix was first 2649 leased."; 2650 } 2651 leaf last-renew-rebind { 2652 type yang:date-and-time; 2653 description "Time of the last successful renew or rebind 2654 of the delegated prefix."; 2655 } 2656 leaf server-duid { 2657 type dhcpv6-common:duid; 2658 description "DUID of the delegating server."; 2659 } 2660 } 2661 } 2662 uses message-statistics; 2663 } 2664 } 2666 /* 2667 * Notifications 2668 */ 2670 notification invalid-ia-detected { 2671 description "Notification sent when the identity association 2672 of the client can be proved to be invalid. Possible conditions 2673 include a duplicate or otherwise illegal address."; 2674 reference "RFC 8415: Dynamic Host Configuration Protocol for 2675 IPv6 (DHCPv6), Section 18.2.10.1"; 2676 leaf iaid { 2677 type uint32; 2678 mandatory true; 2679 description "IAID"; 2680 } 2681 leaf description { 2682 type string; 2683 description "Description of the event."; 2684 } 2685 } 2686 notification retransmission-failed { 2687 description "Notification sent when the retransmission mechanism 2688 defined in RFC 8415 is unsuccessful."; 2689 reference "RFC 8415: Dynamic Host Configuration Protocol for 2690 IPv6 (DHCPv6), Section 7.6"; 2691 leaf failure-type { 2692 type enumeration { 2693 enum "MRC-exceeded" { 2694 description "Maximum retransmission count exceeded."; 2695 } 2696 enum "MRD-exceeded" { 2697 description "Maximum retransmission duration exceeded."; 2698 } 2699 } 2700 mandatory true; 2701 description "Description of the failure."; 2702 } 2703 } 2705 notification unsuccessful-status-code { 2706 description "Notification sent when the client receives a message 2707 that includes an unsuccessful Status Code option."; 2708 reference "RFC 8415: Dynamic Host Configuration Protocol for 2709 IPv6 (DHCPv6), Section 21.13"; 2710 leaf status-code { 2711 type uint16; 2712 mandatory true; 2713 description "Unsuccessful status code received by a client."; 2714 } 2715 leaf server-duid { 2716 type dhcpv6-common:duid; 2717 mandatory true; 2718 description "DUID of the server sending the unsuccessful 2719 error code."; 2720 } 2721 } 2723 notification server-duid-changed { 2724 description "Notification sent when the client receives a lease 2725 from a server with different DUID to the one currently stored 2726 by the client."; 2727 reference "RFC 8415: Dynamic Host Configuration Protocol for 2728 IPv6 (DHCPv6), Section 18.2.10.1"; 2729 leaf new-server-duid { 2730 type dhcpv6-common:duid; 2731 mandatory true; 2732 description "DUID of the new server."; 2733 } 2734 leaf previous-server-duid { 2735 type dhcpv6-common:duid; 2736 mandatory true; 2737 description "DUID of the previous server."; 2738 } 2739 leaf lease-ia-na { 2740 type leafref { 2741 path "/dhcpv6-client/client-if/ia-na/iaid"; 2742 } 2743 description "Reference to the IA_NA lease."; 2744 } 2745 leaf lease-ia-ta { 2746 type leafref { 2747 path "/dhcpv6-client/client-if/ia-ta/iaid"; 2748 } 2749 description "Reference to the IA_TA lease."; 2750 } 2751 leaf lease-ia-pd { 2752 type leafref { 2753 path "/dhcpv6-client/client-if/ia-pd/iaid"; 2754 } 2755 description "Reference to the IA_PD lease."; 2756 } 2757 } 2758 } 2759 2761 3.4. DHCPv6 Common YANG Module 2763 This module imports typedefs from [RFC6991]. 2765 file "ietf-dhcpv6-common.yang" 2767 module ietf-dhcpv6-common { 2768 yang-version 1.1; 2769 namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-common"; 2770 prefix "dhcpv6-common"; 2772 import ietf-yang-types { 2773 prefix yang; 2774 reference "RFC 6991: Common YANG Data Types"; 2775 } 2777 organization 2778 "IETF DHC (Dynamic Host Configuration) Working Group"; 2780 contact 2781 "WG Web: 2782 WG List: 2783 Author: Yong Cui 2784 Author: Linhui Sun 2785 Editor: Ian Farrer 2786 Author: Sladjana Zeichlin 2787 Author: Zihao He 2788 Author: Michal Nowikowski "; 2790 description "This YANG module defines common components 2791 used for the configuration and management of DHCPv6. 2793 Copyright (c) 2021 IETF Trust and the persons identified as 2794 authors of the code. All rights reserved. 2796 Redistribution and use in source and binary forms, with or 2797 without modification, is permitted pursuant to, and subject 2798 to the license terms contained in, the Simplified BSD License 2799 set forth in Section 4.c of the IETF Trust's Legal Provisions 2800 Relating to IETF Documents 2801 (http://trustee.ietf.org/license-info). 2803 This version of this YANG module is part of RFC XXXX; see 2804 the RFC itself for full legal notices."; 2806 revision 2021-02-22 { 2807 description "Version update for draft -18 publication."; 2808 reference "I-D: draft-ietf-dhc-dhcpv6-yang-18"; 2809 } 2811 revision 2021-01-29 { 2812 description "Version update for draft -17 publication."; 2813 reference "I-D: draft-ietf-dhc-dhcpv6-yang-17"; 2814 } 2816 revision 2021-01-06 { 2817 description "Version update for draft -16 publication."; 2818 reference "I-D: draft-ietf-dhc-dhcpv6-yang-16"; 2819 } 2821 revision 2020-12-22 { 2822 description "Version update for draft -13 publication."; 2823 reference "I-D: draft-ietf-dhc-dhcpv6-yang-15"; 2824 } 2826 revision 2020-12-10 { 2827 description "Version update for draft -13 publication."; 2828 reference "I-D: draft-ietf-dhc-dhcpv6-yang-13"; 2829 } 2830 revision 2020-12-01 { 2831 description "Version update for draft -12 publication."; 2832 reference "I-D: draft-ietf-dhc-dhcpv6-yang-12"; 2833 } 2835 revision 2020-05-26 { 2836 description "Version update for draft -11 publication and 2837 to align revisions across the different modules."; 2838 reference "I-D: draft-ietf-dhc-dhcpv6-yang-11"; 2839 } 2841 revision 2018-09-04 { 2842 description ""; 2843 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 2844 } 2846 revision 2018-01-30 { 2847 description "Initial revision"; 2848 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 2849 } 2851 typedef threshold { 2852 type union { 2853 type uint16 { 2854 range 0..100; 2855 } 2856 type enumeration { 2857 enum "disabled" { 2858 description "No threshold."; 2859 } 2860 } 2861 } 2862 description "Threshold value in percent."; 2863 } 2865 typedef timer-seconds32 { 2866 type uint32; 2867 units "seconds"; 2868 description 2869 "Timer value type, in seconds (32-bit range)."; 2870 } 2872 typedef duid-base { 2873 type string { 2874 length '6..260'; 2875 } 2876 description "Each DHCP server and client has a DUID (DHCP 2877 Unique Identifier). The DUID consists of a two-octet 2878 type field and an arbitrary length (between 1 and 128 bytes) 2879 content field. Currently, there are four defined types of 2880 DUIDs in RFC 8415 and RFC 6355 - DUID-LLT, DUID-EN, DUID-LL 2881 and DUID-UUID. DUID-unstructured represents DUIDs which 2882 do not follow any of the defined formats."; 2883 reference "RFC 8415: Dynamic Host Configuration Protocol for 2884 IPv6 (DHCPv6), Section 11 2885 RFC 6355: Definition of the UUID-Based DHCPv6 Unique 2886 Identifier (DUID-UUID), Section 4"; 2887 } 2889 typedef duid-llt { 2890 type duid-base { 2891 pattern '^0001' 2892 + '[0-9a-fA-F]{12,}'; 2893 } 2894 description "DUID type 1, based on Link-Layer Address Plus Time 2895 (DUID-LLT). Constructed with a 2-byte hardware type assigned 2896 by IANA, 4-bytes containing the time the DUID is generated 2897 (represented in seconds since midnight (UTC), January 1, 2000, 2898 modulo 2^32), and a link-layer address. The address is encoded 2899 without separator characters."; 2900 reference "RFC 8415: Dynamic Host Configuration Protocol for 2901 IPv6 (DHCPv6), Section 11.2 2902 IANA 'Hardware Types' registry. 2903 "; 2904 } 2906 typedef duid-en { 2907 type duid-base { 2908 pattern '^0002' 2909 + '[0-9a-fA-F]{4,}'; 2910 } 2911 description "DUID type 2, assigned by vendor based on Enterprise 2912 Number (DUID-EN). This DUID consists of the 4-octet vendor's 2913 registered Private Enterprise Number as maintained by IANA 2914 followed by a unique identifier assigned by the vendor."; 2915 reference "RFC 8415: Dynamic Host Configuration Protocol for 2916 IPv6 (DHCPv6), Section 11.3 2917 IANA 'Private Enterprise Numbers' registry. 2918 "; 2919 } 2921 typedef duid-ll { 2922 type duid-base { 2923 pattern '^0003' 2924 + '([0-9a-fA-F]){4,}'; 2925 } 2926 description "DUID type 3, based on Link-Layer Address (DUID-LL). 2927 Constructed with a 2-byte hardware type assigned 2928 by IANA, and a link-layer address. The address is encoded 2929 without separator characters."; 2930 reference "RFC 8415: Dynamic Host Configuration Protocol for 2931 IPv6 (DHCPv6), Section 11.4 2932 IANA 'Hardware Types' registry. 2933 "; 2934 } 2936 typedef duid-uuid { 2937 type duid-base { 2938 pattern '^0004' 2939 + '[0-9a-fA-F]{32}'; 2940 } 2941 description "DUID type 4, based on Universally Unique Identifier 2942 (DUID-UUID). This type of DUID consists of 16 octets 2943 containing a 128-bit UUID."; 2944 reference "RFC 8415: Dynamic Host Configuration Protocol for 2945 IPv6 (DHCPv6), Section 11.5 2946 RFC 6355: Definition of the UUID-Based DHCPv6 Unique Identifier 2948 (DUID-UUID)"; 2949 } 2951 typedef duid-unstructured { 2952 type duid-base { 2953 pattern '^[0-9a-fA-F]{3}' 2954 + '[05-9a-fA-F]' 2955 + '([0-1a-fA-F])*'; 2956 } 2957 description "Used for DUIDs following any other formats than 2958 DUID types 1-4."; 2959 reference "RFC 8415: Dynamic Host Configuration Protocol for 2960 IPv6 (DHCPv6), Section 11"; 2961 } 2963 typedef duid { 2964 type union { 2965 type duid-llt; 2966 type duid-en; 2967 type duid-ll; 2968 type duid-uuid; 2969 type duid-unstructured; 2970 } 2971 description "Represents the DUID and is neutral to the DUID's 2972 construction format."; 2973 reference "RFC 8415: Dynamic Host Configuration Protocol for 2974 IPv6 (DHCPv6), Section 11"; 2975 } 2977 /* 2978 * Groupings 2979 */ 2981 grouping auth-option-group { 2982 description "OPTION_AUTH (11) Authentication Option."; 2983 reference "RFC 8415: Dynamic Host Configuration Protocol 2984 for IPv6 (DHCPv6), Section 21.11"; 2985 container auth-option { 2986 description "OPTION_AUTH (11) Authentication Option 2987 container."; 2988 leaf protocol { 2989 type uint8; 2990 description "The authentication protocol used by this 2991 Authentication option."; 2992 } 2993 leaf algorithm { 2994 type uint8; 2995 description "The algorithm used in the authentication 2996 protocol."; 2997 } 2998 leaf rdm { 2999 type uint8; 3000 description "The Replay Detection Method (RDM) used 3001 in this Authentication option."; 3002 } 3003 leaf replay-detection { 3004 type uint64; 3005 description "The replay detection information for the RDM."; 3006 } 3007 leaf auth-information { 3008 type string; 3009 description "The authentication information, as specified 3010 by the protocol and algorithm used in this Authentication 3011 option."; 3012 } 3013 } 3014 } 3016 grouping status-code-option-group { 3017 description "OPTION_STATUS_CODE (13) Status Code Option."; 3018 reference "RFC 8415: Dynamic Host Configuration Protocol 3019 for IPv6 (DHCPv6), Section 21.13"; 3020 container status-code-option { 3021 description "OPTION_STATUS_CODE (13) Status Code Option 3022 container."; 3023 leaf status-code { 3024 type uint16; 3025 description "The numeric code for the status encoded 3026 in this option. See the Status Codes registry at 3027 3028 for the current list of status codes."; 3029 } 3030 leaf status-message { 3031 type string; 3032 description "A UTF-8 encoded text string suitable for 3033 display to an end user. MUST NOT be null-terminated."; 3034 } 3035 } 3036 } 3038 grouping rapid-commit-option-group { 3039 description "OPTION_RAPID_COMMIT (14) Rapid Commit Option."; 3040 reference "RFC 8415: Dynamic Host Configuration Protocol for 3041 IPv6 (DHCPv6), Section 21.14"; 3042 container rapid-commit-option { 3043 presence "Enable sending of this option"; 3044 description "OPTION_RAPID_COMMIT (14) Rapid Commit Option 3045 container."; 3046 } 3047 } 3049 grouping vendor-specific-information-option-group { 3050 description "OPTION_VENDOR_OPTS (17) Vendor-specific 3051 Information Option."; 3052 reference "RFC 8415: Dynamic Host Configuration Protocol 3053 for IPv6 (DHCPv6), Section 21.17"; 3054 container vendor-specific-information-option { 3055 description "OPTION_VENDOR_OPTS (17) Vendor-specific 3056 Information Option container."; 3057 list vendor-specific-information-option-instances { 3058 key enterprise-number; 3059 description "The vendor specific information option allows 3060 for multiple instances in a single message. Each list entry 3061 defines the contents of an instance of the option."; 3062 leaf enterprise-number { 3063 type uint32; 3064 description "The vendor's registered Enterprise Number, 3065 as maintained by IANA."; 3066 reference "IANA 'Private Enterprise Numbers' registry. 3067 "; 3068 } 3069 list vendor-option-data { 3070 key sub-option-code; 3071 description "Vendor options, interpreted by vendor-specific 3072 client/server functions."; 3073 leaf sub-option-code { 3074 type uint16; 3075 description "The code for the sub-option."; 3076 } 3077 leaf sub-option-data { 3078 type string; 3079 description "The data area for the sub-option."; 3080 } 3081 } 3082 } 3083 } 3084 } 3086 grouping reconfigure-accept-option-group { 3087 description "OPTION_RECONF_ACCEPT (20) Reconfigure Accept 3088 Option. 3089 A client uses the Reconfigure Accept option to announce to 3090 the server whether the client is willing to accept Reconfigure 3091 messages, and a server uses this option to tell the client 3092 whether or not to accept Reconfigure messages. In the absence 3093 of this option, the default behavior is that the client is 3094 unwilling to accept Reconfigure messages. The presence node 3095 is used to enable the option."; 3096 reference "RFC 8415: Dynamic Host Configuration Protocol 3097 for IPv6 (DHCPv6), Section 21.20"; 3098 container reconfigure-accept-option { 3099 presence "Enable sending of this option"; 3100 description "OPTION_RECONF_ACCEPT (20) Reconfigure Accept 3101 Option container."; 3102 } 3103 } 3104 } 3105 3107 4. Security Considerations 3109 The YANG modules defined in this document are designed to be accessed 3110 via network management protocols such as NETCONF [RFC6241] or 3111 RESTCONF [RFC8040]. The lowest NETCONF layer is the secure transport 3112 layer, and the mandatory-to-implement secure transport is Secure 3113 Shell (SSH) [RFC6242]. The lowest RESTCONF layer is HTTPS, and the 3114 mandatory-to-implement secure transport is TLS [RFC8446]. 3116 The Network Configuration Access Control Model (NACM) [RFC8341] 3117 provides the means to restrict access for particular NETCONF or 3118 RESTCONF users to a preconfigured subset of all available NETCONF or 3119 RESTCONF protocol operations and content. 3121 All data nodes defined in the YANG modules which can be created, 3122 modified, and deleted (i.e., config true, which is the default) are 3123 considered sensitive. Write operations (e.g., edit-config) to these 3124 data nodes without proper protection can have a negative effect on 3125 network operations. 3127 As the RPCs for deleting/clearing active address and prefix entries 3128 in the server and relay modules are particularly sensitive, these use 3129 'nacm:default-deny-all'. 3131 An attacker who is able to access the DHCPv6 server can undertake 3132 various attacks, such as: 3134 * Denial of service attacks, based on re-configuring messages to a 3135 rogue DHCPv6 server. 3137 * Various attacks based on re-configuring the contents of DHCPv6 3138 options. E.g., changing the address of a the DNS server supplied 3139 in a DHCP option to point to a rogue server. 3141 An attacker who is able to access the DHCPv6 relay can undertake 3142 various attacks, such as: 3144 * Re-configuring the relay's destination address to send messages to 3145 a rogue DHCPv6 server. 3147 * Deleting information about a client's delegated prefix, causing a 3148 denial of service attack as traffic will no longer be routed to 3149 the client. 3151 Some of the readable data nodes in this YANG module may be considered 3152 sensitive or vulnerable in some network environments. Therefore, it 3153 is important to control read access (e.g., only permitting get, get- 3154 config, or notifications) to these data nodes. These subtrees and 3155 data nodes can be misused to track the activity of a host: 3157 * Information the server holds about clients with active leases: 3158 (dhcpv6-server/network-ranges/network-range/ address-pools/ 3159 address-pool/active-leases) 3161 * Information the relay holds about clients with active leases: 3162 (dhcpv6-relay/relay-if/prefix-delegation/) 3164 Security considerations related to DHCPv6 are discussed in [RFC8415]. 3166 Security considerations given in [RFC7950] are also applicable here. 3168 5. IANA Considerations 3170 This document requests IANA to register the following URIs in the 3171 "IETF XML Registry" [RFC3688]: 3173 URI: urn:ietf:params:xml:ns:yang:ietf-dhcpv6-server 3174 Registrant Contact: The IESG. 3175 XML: N/A; the requested URI is an XML namespace. 3177 URI: urn:ietf:params:xml:ns:yang:ietf-dhcpv6-relay 3178 Registrant Contact: The IESG. 3179 XML: N/A; the requested URI is an XML namespace. 3181 URI: urn:ietf:params:xml:ns:yang:ietf-dhcpv6-client 3182 Registrant Contact: The IESG. 3183 XML: N/A; the requested URI is an XML namespace. 3185 URI: urn:ietf:params:xml:ns:yang:ietf-dhcpv6-common 3186 Registrant Contact: The IESG. 3187 XML: N/A; the requested URI is an XML namespace. 3189 This document registers the following YANG modules in the "YANG 3190 Module Names" registry [RFC6020]. 3192 name: ietf-dhcpv6-server 3193 namespace: urn:ietf:params:xml:ns:yang:ietf-dhcpv6-server 3194 prefix: dhcpv6-server 3195 reference: RFC XXXX YANG Data Model for DHCPv6 Configuration 3197 name: ietf-dhcpv6-relay 3198 namespace: urn:ietf:params:xml:ns:yang:ietf-dhcpv6-relay 3199 prefix: dhcpv6-client 3200 reference: RFC XXXX YANG Data Model for DHCPv6 Configuration 3202 name: ietf-dhcpv6-client 3203 namespace: urn:ietf:params:xml:ns:yang:ietf-dhcpv6-client 3204 prefix: dhcpv6-relay 3205 reference: RFC XXXX YANG Data Model for DHCPv6 Configuration 3207 name: ietf-dhcpv6-common 3208 namespace: urn:ietf:params:xml:ns:yang:ietf-dhcpv6-common 3209 prefix: dhcpv6-common 3210 reference: RFC XXXX YANG Data Model for DHCPv6 Configuration 3212 6. Acknowledgments 3214 The authors would like to thank Qi Sun, Lishan Li, Hao Wang, Tomek 3215 Mrugalski, Marcin Siodelski, Bernie Volz, Ted Lemon, Bing Liu, and 3216 Tom Petch for their valuable comments and contributions to this work. 3218 7. Contributors 3220 The following individuals are co-authors of this document: 3222 Yong Cui 3223 Tsinghua University 3224 Beijing, 100084 3225 P.R. China 3226 Email: cuiyong@tsinghua.edu.cn 3228 Linhui Sun 3229 Tsinghua University 3230 Beijing, 100084 3231 P.R. China 3232 Email: lh.sunlinh@gmail.com 3234 Sladjana Zechlin 3235 Deutsche Telekom AG 3236 CTO-IPT, Landgrabenweg 151 3237 53227, Bonn 3238 Germany 3239 Email: sladjana.zechlin@telekom.de 3241 Zihao He 3242 Tsinghua University 3243 Beijing, 100084 3244 P.R. China 3245 Email: hezihao9512@gmail.com 3247 Michal Nowikowski 3248 Internet Systems Consortium 3249 Gdansk 3250 Poland 3251 Email: godfryd@isc.org 3253 8. References 3255 8.1. Normative References 3257 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3258 Requirement Levels", BCP 14, RFC 2119, 3259 DOI 10.17487/RFC2119, March 1997, 3260 . 3262 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 3263 DOI 10.17487/RFC3688, January 2004, 3264 . 3266 [RFC6355] Narten, T. and J. Johnson, "Definition of the UUID-Based 3267 DHCPv6 Unique Identifier (DUID-UUID)", RFC 6355, 3268 DOI 10.17487/RFC6355, August 2011, 3269 . 3271 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 3272 the Network Configuration Protocol (NETCONF)", RFC 6020, 3273 DOI 10.17487/RFC6020, October 2010, 3274 . 3276 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 3277 and A. Bierman, Ed., "Network Configuration Protocol 3278 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 3279 . 3281 [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure 3282 Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, 3283 . 3285 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 3286 RFC 6991, DOI 10.17487/RFC6991, July 2013, 3287 . 3289 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 3290 RFC 7950, DOI 10.17487/RFC7950, August 2016, 3291 . 3293 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 3294 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 3295 May 2017, . 3297 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 3298 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 3299 . 3301 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 3302 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 3303 . 3305 [RFC8341] Bierman, A. and M. Bjorklund, "Network Configuration 3306 Access Control Model", STD 91, RFC 8341, 3307 DOI 10.17487/RFC8341, March 2018, 3308 . 3310 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., 3311 and R. Wilton, "Network Management Datastore Architecture 3312 (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, 3313 . 3315 [RFC8343] Bjorklund, M., "A YANG Data Model for Interface 3316 Management", RFC 8343, DOI 10.17487/RFC8343, March 2018, 3317 . 3319 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 3320 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 3321 . 3323 [RFC8415] Mrugalski, T., Siodelski, M., Volz, B., Yourtchenko, A., 3324 Richardson, M., Jiang, S., Lemon, T., and T. Winters, 3325 "Dynamic Host Configuration Protocol for IPv6 (DHCPv6)", 3326 RFC 8415, DOI 10.17487/RFC8415, November 2018, 3327 . 3329 [IANA-HARDWARE-TYPES] 3330 Internet Assigned Numbers Authority, "Hardware Types", 3331 . 3333 [IANA-PEN] Internet Assigned Numbers Authority, "Private Enterprise 3334 Numbers", 3335 . 3337 8.2. Informative References 3339 [RFC3319] Schulzrinne, H. and B. Volz, "Dynamic Host Configuration 3340 Protocol (DHCPv6) Options for Session Initiation Protocol 3341 (SIP) Servers", RFC 3319, DOI 10.17487/RFC3319, July 2003, 3342 . 3344 Appendix A. Example of Augmenting Additional DHCPv6 Option Definitions 3346 The following section provides a example of how the DHCPv6 option 3347 definitions can be extended to include additional options. It is 3348 expected that additional specification documents will be published 3349 for this in the future. 3351 The example defines YANG models for OPTION_SIP_SERVER_D (21) and 3352 OPTION_SIP_SERVER_D (22) defined in [RFC3319]. The module is 3353 constructed as follows: 3355 * The module is named using a meaningful, shortened version of the 3356 document name in which the DHCP option format is specified. 3358 * A separate grouping is used to define each option. 3360 * The name of the option is taken from the registered IANA name for 3361 the option, with an '-option' suffix added. 3363 * The description field is taken from the relevant option code name 3364 and number. 3366 * The reference section is the number and name of the RFC in which 3367 the DHCPv6 option is defined. 3369 * The remaining fields match the fields in the DHCP option. They 3370 are in the same order as defined in the DHCP option. Where-ever 3371 possible, the format that is defined for the DHCP field should be 3372 matched by the relevant YANG type. 3374 * Fields which can have multiple entries or instances are defined 3375 using list or leaf-list nodes. 3377 Below the groupings for option definitions, augment statements are 3378 used to add the option definitions for use in the relevant DHCP 3379 element's module (server, relay and/or client). 3381 file "ietf-example-dhcpv6-options-sip-server.yang" 3383 module ietf-example-dhcpv6-options-sip-server { 3384 yang-version 1.1; 3385 namespace "urn:ietf:params:xml:ns:yang:" + 3386 "ietf-example-dhcpv6-options-sip-server"; 3387 prefix "sip-srv"; 3389 import ietf-inet-types { 3390 prefix inet; 3391 } 3393 import ietf-dhcpv6-server { 3394 prefix dhcpv6-server; 3395 } 3397 organization 3398 "IETF DHC (Dynamic Host Configuration) Working Group"; 3400 contact 3401 "WG Web: 3402 WG List: 3403 Author: Yong Cui 3404 Author: Linhui Sun 3405 Editor: Ian Farrer 3406 Author: Sladjana Zeichlin 3407 Author: Zihao He 3408 Author: Michal Nowikowski "; 3410 description "This YANG module contains DHCPv6 options defined 3411 in RFC 3319 that can be used by DHCPv6 servers. 3413 Copyright (c) 2021 IETF Trust and the persons identified as 3414 authors of the code. All rights reserved. 3416 Redistribution and use in source and binary forms, with or 3417 without modification, is permitted pursuant to, and subject 3418 to the license terms contained in, the Simplified BSD License 3419 set forth in Section 4.c of the IETF Trust's Legal Provisions 3420 Relating to IETF Documents 3421 (http://trustee.ietf.org/license-info). 3423 This version of this YANG module is part of RFC XXXX; see 3424 the RFC itself for full legal notices."; 3426 revision 2021-02-22 { 3427 description "Version update for draft -18 publication."; 3428 reference "I-D: draft-ietf-dhc-dhcpv6-yang-18"; 3429 } 3431 revision 2021-01-29 { 3432 description "Version update for draft -17 publication."; 3433 reference "I-D: draft-ietf-dhc-dhcpv6-yang-17"; 3434 } 3436 revision 2021-01-06 { 3437 description "Version update for draft -16 publication."; 3438 reference "I-D: draft-ietf-dhc-dhcpv6-yang-16"; 3439 } 3441 revision 2020-12-22 { 3442 description "Version update for draft -13 publication."; 3443 reference "I-D: draft-ietf-dhc-dhcpv6-yang-15"; 3444 } 3446 revision 2020-12-10 { 3447 description "Version update for draft -13 publication."; 3448 reference "I-D: draft-ietf-dhc-dhcpv6-yang-13"; 3449 } 3451 revision 2020-12-01 { 3452 description "Version update for draft -12 publication."; 3453 reference "I-D: draft-ietf-dhc-dhcpv6-yang-12"; 3454 } 3456 revision 2020-05-26 { 3457 description "Version update for draft -11 publication and 3458 to align revisions across the different modules."; 3459 reference "I-D: draft-ietf-dhc-dhcpv6-yang-11"; 3460 } 3462 revision 2019-10-18 { 3463 description "Initial version."; 3464 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 3465 } 3467 /* 3468 * Groupings 3469 */ 3471 grouping sip-server-domain-name-list-option-group { 3472 description "OPTION_SIP_SERVER_D (21) SIP Servers Domain Name 3473 List"; 3474 reference "RFC 3319: Dynamic Host Configuration Protocol 3475 (DHCPv6) Options for Session Initiation Protocol (SIP) 3476 Servers"; 3477 container sip-server-domain-name-list-option { 3478 description "OPTION_SIP_SERVER_D (21) SIP Servers Domain Name 3479 List container."; 3480 list sip-server { 3481 key sip-serv-id; 3482 description "SIP server information."; 3483 leaf sip-serv-id { 3484 type uint8; 3485 description "SIP server list identifier identifier."; 3486 } 3487 leaf sip-serv-domain-name { 3488 type inet:domain-name; 3489 description "SIP server domain name."; 3490 } 3491 } 3492 } 3493 } 3495 grouping sip-server-address-list-option-group { 3496 description "OPTION_SIP_SERVER_A (22) SIP Servers IPv6 Address 3497 List"; 3498 reference "RFC 3319: Dynamic Host Configuration Protocol 3499 (DHCPv6) Options for Session Initiation Protocol (SIP) 3500 Servers"; 3501 container sip-server-address-list-option { 3502 description "OPTION_SIP_SERVER_A (22) SIP Servers IPv6 Address 3503 List container."; 3504 list sip-server { 3505 key sip-serv-id; 3506 description "SIP server information."; 3507 leaf sip-serv-id { 3508 type uint8; 3509 description "SIP server list entry identifier."; 3510 } 3511 leaf sip-serv-addr { 3512 type inet:ipv6-address; 3513 description "SIP server IPv6 address."; 3514 } 3515 } 3516 } 3517 } 3519 /* 3520 * Augmentations 3521 */ 3523 augment "/dhcpv6-server:dhcpv6-server/dhcpv6-server:option-sets/" + 3525 "dhcpv6-server:option-set" { 3526 description "Augment the option definition groupings to the 3527 server module."; 3528 uses sip-server-domain-name-list-option-group; 3529 uses sip-server-address-list-option-group; 3530 } 3531 } 3532 3534 The correct location to augment the new option definition(s) will 3535 vary according to the specific rules defined for the use of that 3536 specific option. E.g. for options which will be augmented into the 3537 ietf-dhcpv6-server module, in many cases, these will be augmented to: 3539 '/dhcpv6-server:dhcpv6-server/dhcpv6-server:option-sets/\ dhcpv6- 3540 server:option-set' 3541 so that they can be defined within option sets. However, there are 3542 some options which are only applicable for specific deployment 3543 scenarios and in these cases it may be more logical to augment the 3544 option group to a location relevant for the option. 3546 One example for this could be OPTION_PD_EXCLUDE (67). This option is 3547 only relevant in combination with a delegated prefix which contains a 3548 specific prefix. In this case, the following location for the 3549 augmentation may be more suitable: 3551 '/dhcpv6-server:dhcpv6-server/dhcpv6-server:network-ranges/\ dhcpv6- 3552 server:network-range/dhcpv6-server:prefix-pools/\ dhcpv6- 3553 server:prefix-pool" 3555 Appendix B. Example Vendor Specific Server Configuration Module 3557 This section shows how to extend the server YANG module defined in 3558 this document with vendor specific configuration nodes, e.g., 3559 configuring access to a lease storage database. 3561 The example module defines additional server attributes such as name 3562 and description. Storage for leases is configured using a lease- 3563 storage container. It allows storing leases in one of three options: 3564 memory (memfile), MySQL and PosgreSQL. For each case, the necessary 3565 configuration parameters are provided. 3567 At the end there is an augment statement which adds the vendor 3568 specific configuration defined in "dhcpv6-server-config:config" under 3569 the "/dhcpv6-server:config/dhcpv6-server:vendor-config" mount point. 3571 file "ietf-example-dhcpv6-server-config.yang" 3573 module ietf-example-dhcpv6-server-config { 3574 yang-version 1.1; 3575 namespace "urn:ietf:params:xml:ns:yang:" + 3576 "ietf-example-dhcpv6-server-config"; 3577 prefix "dhcpv6-server-config"; 3579 import ietf-inet-types { 3580 prefix inet; 3581 } 3583 import ietf-interfaces { 3584 prefix if; 3585 } 3587 import ietf-dhcpv6-server { 3588 prefix dhcpv6-server; 3590 } 3592 organization 3593 "IETF DHC (Dynamic Host Configuration) Working Group"; 3595 contact 3596 "WG Web: 3597 WG List: 3598 Author: Yong Cui 3599 Author: Linhui Sun 3600 Editor: Ian Farrer 3601 Author: Sladjana Zeichlin 3602 Author: Zihao He 3603 Author: Michal Nowikowski "; 3605 description "This YANG module defines components for the 3606 configuration and management of vendor/implementation specific 3607 DHCPv6 server functionality. As this functionality varies 3608 greatly between different implementations, the module 3609 provided as an example only. 3611 Copyright (c) 2021 IETF Trust and the persons identified as 3612 authors of the code. All rights reserved. 3614 Redistribution and use in source and binary forms, with or 3615 without modification, is permitted pursuant to, and subject 3616 to the license terms contained in, the Simplified BSD License 3617 set forth in Section 4.c of the IETF Trust's Legal Provisions 3618 Relating to IETF Documents 3619 (http://trustee.ietf.org/license-info). 3621 This version of this YANG module is part of RFC XXXX; see 3622 the RFC itself for full legal notices."; 3624 revision 2021-02-22 { 3625 description "Version update for draft -18 publication."; 3626 reference "I-D: draft-ietf-dhc-dhcpv6-yang-18"; 3627 } 3629 revision 2021-01-29 { 3630 description "Version update for draft -17 publication."; 3631 reference "I-D: draft-ietf-dhc-dhcpv6-yang-17"; 3632 } 3634 revision 2021-01-06 { 3635 description "Version update for draft -16 publication."; 3636 reference "I-D: draft-ietf-dhc-dhcpv6-yang-16"; 3637 } 3638 revision 2020-12-22 { 3639 description "Version update for draft -13 publication."; 3640 reference "I-D: draft-ietf-dhc-dhcpv6-yang-15"; 3641 } 3643 revision 2020-12-10 { 3644 description "Version update for draft -13 publication."; 3645 reference "I-D: draft-ietf-dhc-dhcpv6-yang-13"; 3646 } 3648 revision 2020-12-01 { 3649 description "Version update for draft -12 publication."; 3650 reference "I-D: draft-ietf-dhc-dhcpv6-yang-12"; 3651 } 3653 revision 2020-05-26 { 3654 description "Version update for draft -11 publication and 3655 to align revisions across the different modules."; 3656 reference "I-D: draft-ietf-dhc-dhcpv6-yang-11"; 3657 } 3659 revision 2019-06-04 { 3660 description ""; 3661 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 3662 } 3664 /* 3665 * Groupings 3666 */ 3668 grouping config { 3669 description "Parameters necessary for the configuration of a 3670 DHCPv6 server"; 3671 container serv-attributes { 3672 description "Contains basic attributes necessary for running a 3673 DHCPv6 server."; 3674 leaf name { 3675 type string; 3676 description "Name of the DHCPv6 server."; 3677 } 3678 leaf description { 3679 type string; 3680 description "Description of the DHCPv6 server."; 3681 } 3682 leaf ipv6-listen-port { 3683 type uint16; 3684 default 547; 3685 description "UDP port that the server will listen on."; 3687 } 3688 choice listening-interfaces { 3689 default all-interfaces; 3690 description "Configures which interface or addresses the 3691 server will listen for incoming messages on."; 3692 case all-interfaces { 3693 container all-interfaces { 3694 presence true; 3695 description "Configures the server to listen for 3696 incoming messages on all IPv6 addresses (unicast and 3697 multicast) on all of its network interfaces."; 3698 } 3699 } 3700 case interface-list { 3701 leaf-list interfaces { 3702 type if:interface-ref; 3703 description "List of interfaces that the server will 3704 listen for incoming messages on. Messages addressed 3705 to any valid IPv6 address (unicast and multicast) will 3706 be received."; 3707 } 3708 } 3709 case address-list { 3710 leaf-list address-list { 3711 type inet:ipv6-address; 3712 description "List of IPv6 address(es) that the server 3713 will listen for incoming messages on."; 3714 } 3715 } 3716 } 3717 leaf-list interfaces-config { 3718 type if:interface-ref; 3719 default "if:interfaces/if:interface/if:name"; 3720 description "A leaf list to denote which one or more 3721 interfaces the server should listen on."; 3722 } 3723 container lease-storage { 3724 description "Configures how the server will stores leases."; 3725 choice storage-type { 3726 description "The type storage that will be used for lease 3727 information."; 3728 case memfile { 3729 description "Configuration for storing leases information 3730 in a CSV file."; 3731 leaf memfile-name { 3732 type string; 3733 description "Specifies the absolute location 3734 of the lease file. The format of the string follow 3735 the semantics of the relevant operating system."; 3736 } 3737 leaf memfile-lfc-interval { 3738 type uint64; 3739 description "Specifies the interval in seconds, 3740 at which the server will perform a lease file cleanup 3741 (LFC)."; 3742 } 3743 } 3744 case mysql { 3745 leaf mysql-name { 3746 type string; 3747 description "Name of the database."; 3748 } 3749 choice mysql-host { 3750 description "Define host or address for MySQL server."; 3751 case mysql-server-hostname { 3752 leaf mysql-hostname { 3753 type inet:domain-name; 3754 default "localhost"; 3755 description "If the database is located on a 3756 different system to the DHCPv6 server, the 3757 domain name can be specified."; 3758 } 3759 } 3760 case mysql-server-address { 3761 leaf mysql-address { 3762 type inet:ip-address; 3763 default "::"; 3764 description "Configure the location of the 3765 database using an IP (v6 or v6) literal 3766 address"; 3767 } 3768 } 3769 } 3770 leaf mysql-username { 3771 type string; 3772 description "User name of the account under which the 3773 server will access the database."; 3774 } 3775 leaf mysql-password { 3776 type string; 3777 description "Password of the account under which 3778 the server will access the database."; 3779 } 3780 leaf mysql-port { 3781 type inet:port-number; 3782 default 5432; 3783 description "If the database is located on a different 3784 system, the port number may be specified."; 3785 } 3786 leaf mysql-lfc-interval { 3787 type uint64; 3788 description "Specifies the interval in seconds, 3789 at which the server will perform a lease file cleanup 3790 (LFC)."; 3791 } 3792 leaf mysql-connect-timeout { 3793 type uint64; 3794 description "Defines the timeout interval for 3795 connecting to the database. A longer interval can 3796 be specified if the database is remote."; 3797 } 3798 } 3799 case postgresql { 3800 choice postgresql-host { 3801 description "Define host or address for postgresql 3802 server."; 3803 case postgresql-server-hostname { 3804 leaf postgresql-hostname { 3805 type inet:domain-name; 3806 default "localhost"; 3807 description "If the database is located on a 3808 different system to the DHCPv6 server, the 3809 domain name can be specified."; 3810 } 3811 } 3812 case postgresql-server-address { 3813 leaf postgresql-address { 3814 type inet:ip-address; 3815 default "::"; 3816 description "Configure the location of the database 3817 using an IP (v6 or v6) literal address"; 3818 } 3819 } 3820 } 3821 leaf postgresql-username { 3822 type string; 3823 description "User name of the account under which 3824 the server will access the database"; 3825 } 3826 leaf postgresql-password { 3827 type string; 3828 description "Password of the account under which 3829 the server will access the database"; 3830 } 3831 leaf postgresql-port { 3832 type inet:port-number; 3833 default 5432; 3834 description "If the database is located on a different 3835 system, the port number may be specified"; 3836 } 3837 leaf postgresql-lfc-interval { 3838 type uint64; 3839 description "Specifies the interval in seconds, 3840 at which the server will perform a lease file cleanup 3841 (LFC)"; 3842 } 3843 leaf postgresql-connect-timeout { 3844 type uint64; 3845 description "Defines the timeout interval for 3846 connecting to the database. A longer interval can 3847 be specified if the database is remote."; 3848 } 3849 } 3850 } 3851 } 3852 } 3853 } 3855 /* 3856 * Augmentations 3857 */ 3859 augment "/dhcpv6-server:dhcpv6-server/dhcpv6-server:vendor-config" 3860 { 3861 description "Augment the server specific YANG to the 3862 ietf-dhcpv6-server module."; 3863 uses dhcpv6-server-config:config; 3864 } 3865 } 3866 3868 Appendix C. Example definition of class selector configuration 3870 The module "ietf-example-dhcpv6-class-selector" provides an example 3871 of how vendor specific class selection configuration can be modelled 3872 and integrated with the "ietf-dhcpv6-server" module defined in this 3873 document. 3875 The example module defines "client-class-names" with associated 3876 matching rules. A client can be classified based on "client-id", 3877 "interface-id" (ingress interface of the client's messages), packets 3878 source or destination address, relay link address, relay link 3879 interface-id and more. Actually, there are endless methods for 3880 classifying clients. So this standard does not try to provide full 3881 specification for class selection, it only shows an example how it 3882 can be defined. 3884 At the end of the example augment statements are used to add the 3885 defined class selector rules into the overall DHCPv6 addressing 3886 hierarchy. This is done in two main parts: 3888 * The augmented class-selector configuration in the main DHCPv6 3889 Server configuration. 3891 * client-class leafrefs augmented to "network-range", "address-pool" 3892 and "pd-pool", pointing to the "client-class-name" that is 3893 required. 3895 The mechanism is as follows: class is associated to client based on 3896 rules and then client is allowed to get address(es)/prefix(es) from 3897 given network-range/pool if the class name matches. 3899 file "ietf-example-dhcpv6-class-selector.yang" 3901 module ietf-example-dhcpv6-class-selector { 3902 yang-version 1.1; 3903 namespace "urn:ietf:params:xml:ns:yang:" + 3904 "ietf-example-dhcpv6-class-selector"; 3905 prefix "dhcpv6-class-selector"; 3907 import ietf-inet-types { 3908 prefix inet; 3909 } 3911 import ietf-interfaces { 3912 prefix if; 3913 } 3915 import ietf-dhcpv6-common { 3916 prefix dhcpv6-common; 3917 } 3919 import ietf-dhcpv6-server { 3920 prefix dhcpv6-server; 3921 } 3923 organization 3924 "IETF DHC (Dynamic Host Configuration) Working Group"; 3926 contact 3927 "WG Web: 3928 WG List: 3929 Author: Yong Cui 3930 Author: Linhui Sun 3931 Editor: Ian Farrer 3932 Author: Sladjana Zeichlin 3933 Author: Zihao He 3934 Author: Michal Nowikowski "; 3936 description "This YANG module defines components for the definition 3937 and configuration of the client class selector function for a 3938 DHCPv6 server. As this functionality varies greatly between 3939 different implementations, the module provided as an example 3940 only. 3942 Copyright (c) 2021 IETF Trust and the persons identified as 3943 authors of the code. All rights reserved. 3945 Redistribution and use in source and binary forms, with or 3946 without modification, is permitted pursuant to, and subject 3947 to the license terms contained in, the Simplified BSD License 3948 set forth in Section 4.c of the IETF Trust's Legal Provisions 3949 Relating to IETF Documents 3950 (http://trustee.ietf.org/license-info). 3952 This version of this YANG module is part of RFC XXXX; see 3953 the RFC itself for full legal notices."; 3955 revision 2021-02-22 { 3956 description "Version update for draft -18 publication."; 3957 reference "I-D: draft-ietf-dhc-dhcpv6-yang-18"; 3958 } 3960 revision 2021-01-29 { 3961 description "Version update for draft -17 publication."; 3962 reference "I-D: draft-ietf-dhc-dhcpv6-yang-17"; 3963 } 3965 revision 2021-01-06 { 3966 description "Version update for draft -16 publication."; 3967 reference "I-D: draft-ietf-dhc-dhcpv6-yang-16"; 3968 } 3970 revision 2020-12-22 { 3971 description "Version update for draft -13 publication."; 3972 reference "I-D: draft-ietf-dhc-dhcpv6-yang-15"; 3973 } 3974 revision 2020-12-10 { 3975 description "Version update for draft -13 publication."; 3976 reference "I-D: draft-ietf-dhc-dhcpv6-yang-13"; 3977 } 3979 revision 2020-12-01 { 3980 description "Version update for draft -12 publication."; 3981 reference "I-D: draft-ietf-dhc-dhcpv6-yang-12"; 3982 } 3984 revision 2020-05-26 { 3985 description "Version update for draft -11 publication and 3986 to align revisions across the different modules."; 3987 reference "I-D: draft-ietf-dhc-dhcpv6-yang-11"; 3988 } 3990 revision 2019-06-13 { 3991 description ""; 3992 reference "I-D: draft-ietf-dhc-dhcpv6-yang"; 3993 } 3995 /* 3996 * Groupings 3997 */ 3999 grouping client-class-id { 4000 description "Definitions of client message classification for 4001 authorization and assignment purposes."; 4002 leaf client-class-name { 4003 type string; 4004 description "Unique Identifier for client class identification 4005 list entries."; 4006 } 4007 choice id-type { 4008 mandatory true; 4009 description "Definitions for different client identifier 4010 types."; 4011 case client-id-id { 4012 leaf client-id { 4013 type string; 4014 mandatory true; 4015 description "String literal client identifier."; 4016 } 4017 description "Client class selection based on a string literal 4018 client identifier."; 4019 } 4020 case received-interface-id { 4021 description "Client class selection based on the incoming 4022 interface of the DHCPv6 message."; 4023 leaf received-interface { 4024 type if:interface-ref; 4025 description "Reference to the interface entry 4026 for the incoming DHCPv6 message."; 4027 } 4028 } 4029 case packet-source-address-id { 4030 description "Client class selection based on the source 4031 address of the DHCPv6 message."; 4032 leaf packet-source-address { 4033 type inet:ipv6-address; 4034 mandatory true; 4035 description "Source address of the DHCPv6 message."; 4036 } 4037 } 4038 case packet-destination-address-id { 4039 description "Client class selection based on the destination 4040 address of the DHCPv6 message."; 4041 leaf packet-destination-address { 4042 type inet:ipv6-address; 4043 mandatory true; 4044 description "Destination address of the DHCPv6 message."; 4045 } 4046 } 4047 case relay-link-address-id { 4048 description "Client class selection based on the prefix 4049 of the link-address field in the relay agent message 4050 header."; 4051 leaf relay-link-address { 4052 type inet:ipv6-prefix; 4053 mandatory true; 4054 description "Prefix of the link-address field in the relay 4055 agent message header."; 4056 } 4057 } 4058 case relay-peer-address-id { 4059 description "Client class selection based on the value of the 4060 peer-address field in the relay agent message header."; 4061 leaf relay-peer-address { 4062 type inet:ipv6-prefix; 4063 mandatory true; 4064 description "Prefix of the peer-address field 4065 in the relay agent message header."; 4066 } 4067 } 4068 case relay-interface-id { 4069 description "Client class selection based on the incoming 4070 interface-id option."; 4071 leaf relay-interface { 4072 type string; 4073 description "Reference to the interface entry 4074 for the incoming DHCPv6 message."; 4075 } 4076 } 4077 case user-class-option-id { 4078 description "Client class selection based on the value of the 4079 OPTION_USER_CLASS(15) and its user-class-data field."; 4080 leaf user-class-data { 4081 type string; 4082 mandatory true; 4083 description "Value of the enterprise-number field."; 4084 } 4085 } 4086 case vendor-class-present-id { 4087 description "Client class selection based on the presence of 4088 OPTION_VENDOR_CLASS(16) in the received message."; 4089 leaf vendor-class-present { 4090 type boolean; 4091 mandatory true; 4092 description "Presence of OPTION_VENDOR_CLASS(16) 4093 in the received message."; 4094 } 4095 } 4096 case vendor-class-option-enterprise-number-id { 4097 description "Client class selection based on the value of the 4098 enterprise-number field in OPTION_VENDOR_CLASS(16)."; 4099 leaf vendor-class-option-enterprise-number { 4100 type uint32; 4101 mandatory true; 4102 description "Value of the enterprise-number field."; 4103 } 4104 } 4105 case vendor-class-option-data-id { 4106 description "Client class selection based on the value 4107 of a data field within a vendor-class-data entry 4108 for a matching enterprise-number field 4109 in OPTION_VENDOR_CLASS(16)."; 4110 container vendor-class-option-data { 4111 description "Vendor class option data container."; 4112 leaf vendor-class-option-enterprise-number { 4113 type uint32; 4114 mandatory true; 4115 description "Value of the enterprise-number field 4116 for matching the data contents."; 4117 } 4118 leaf vendor-class-data { 4119 type string; 4120 mandatory true; 4121 description "Vendor class data to match."; 4122 } 4123 } 4124 } 4125 case remote-id { 4126 description "Client class selection based on the value 4127 of Remote-ID ."; 4128 container remote-id { 4129 description "Remote-id client class selector container."; 4130 leaf vendor-class-option-enterprise-number { 4131 type uint32; 4132 mandatory true; 4133 description "Value of the enterprise-number field 4134 for matching the data contents."; 4135 } 4136 leaf remote-id { 4137 type string; 4138 mandatory true; 4139 description "Remote-ID data to match."; 4140 } 4141 } 4142 } 4143 case client-duid-id { 4144 description "Client class selection based on the value 4145 of the received client DUID."; 4146 leaf duid { 4147 type dhcpv6-common:duid; 4148 description "Client DUID."; 4149 } 4150 } 4151 } 4152 } 4154 /* 4155 * Augmentations 4156 */ 4158 augment "/dhcpv6-server:dhcpv6-server/dhcpv6-server:class-selector" 4159 { 4160 description "Augment class selector functions to the DHCPv6 4161 server module."; 4162 container client-classes { 4163 description "Client classes to augment."; 4164 list class { 4165 key client-class-name; 4166 description "List of the client class identifiers applicable 4167 to clients served by this address pool"; 4168 uses dhcpv6-class-selector:client-class-id; 4169 } 4170 } 4171 } 4173 augment "/dhcpv6-server:dhcpv6-server/" + 4174 "dhcpv6-server:network-ranges/dhcpv6-server:network-range" { 4175 description "Augment class selector functions to the DHCPv6 4176 server network-ranges."; 4177 leaf-list client-class { 4178 type leafref { 4179 path "/dhcpv6-server:dhcpv6-server/dhcpv6-server:" + 4180 "class-selector/client-classes/class/client-class-name"; 4181 } 4182 description "Leafrefs to client classes."; 4183 } 4184 } 4186 augment "/dhcpv6-server:dhcpv6-server/dhcpv6-server:" + 4187 "network-ranges/dhcpv6-server:network-range/dhcpv6-server:" + 4188 "address-pools/dhcpv6-server:address-pool" { 4189 description "Augment class selector functions to the DHCPv6 4190 server address-pools."; 4191 leaf-list client-class { 4192 type leafref { 4193 path "/dhcpv6-server:dhcpv6-server/dhcpv6-server:" + 4194 "class-selector/client-classes/class/client-class-name"; 4195 } 4196 description "Leafrefs to client classes."; 4197 } 4198 } 4200 augment "/dhcpv6-server:dhcpv6-server/dhcpv6-server:" + 4201 "network-ranges/dhcpv6-server:network-range/dhcpv6-server:" + 4202 "prefix-pools/dhcpv6-server:prefix-pool" { 4203 description "Augment class selector functions to the DHCPv6 4204 server prefix-pools."; 4205 leaf-list client-class { 4206 type leafref { 4207 path "/dhcpv6-server:dhcpv6-server/dhcpv6-server:" + 4208 "class-selector/client-classes/class/client-class-name"; 4209 } 4210 description "Leafrefs to client classes."; 4211 } 4212 } 4213 } 4214 4216 Author's Address 4218 Ian Farrer (editor) 4219 Deutsche Telekom AG 4220 TAI, Landgrabenweg 151 4221 53227 Bonn 4222 Germany 4224 Email: ian.farrer@telekom.de