Skip to main content

YANG Data Model for DHCPv6 Configuration
draft-ietf-dhc-dhcpv6-yang-10

The information below is for an old version of the document.
Document Type
This is an older version of an Internet-Draft that was ultimately published as RFC 9243.
Expired & archived
Authors Yong Cui , Linhui Sun , Ian Farrer , Sladjana Zechlin , Zihao He , Michal Nowikowski
Last updated 2020-05-07 (Latest revision 2019-11-04)
Replaces draft-cui-dhc-dhcpv6-yang
RFC stream Internet Engineering Task Force (IETF)
Formats
Reviews
Additional resources Mailing list discussion
Stream WG state WG Document
Revised I-D Needed - Issue raised by WG
Associated WG milestone
Jul 2021
WGLC draft-ietf-dhc-dhcpv6-yang
Document shepherd Tomek Mrugalski
IESG IESG state Became RFC 9243 (Proposed Standard)
Consensus boilerplate Yes
Telechat date (None)
Responsible AD (None)
Send notices to "Tomek Mrugalski" <tomasz.mrugalski@gmail.com>
draft-ietf-dhc-dhcpv6-yang-10
DHC Working Group                                                 Y. Cui
Internet-Draft                                                    L. Sun
Intended status: Standards Track                     Tsinghua University
Expires: 7 May 2020                                          I.F. Farrer
                                                            S.Z. Zechlin
                                                     Deutsche Telekom AG
                                                                   Z. He
                                                     Tsinghua University
                                                         M.N. Nowikowski
                                             Internet Systems Consortium
                                                         4 November 2019

                YANG Data Model for DHCPv6 Configuration
                     draft-ietf-dhc-dhcpv6-yang-10

Abstract

   This document describes several YANG data modules for the
   configuration and management of DHCPv6 servers, relays, and clients.

Requirements Language

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in BCP
   14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on 7 May 2020.

Cui, et al.                Expires 7 May 2020                   [Page 1]
Internet-Draft              DHCPv6 YANG Model              November 2019

Copyright Notice

   Copyright (c) 2019 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents (https://trustee.ietf.org/
   license-info) in effect on the date of publication of this document.
   Please review these documents carefully, as they describe your rights
   and restrictions with respect to this document.  Code Components
   extracted from this document must include Simplified BSD License text
   as described in Section 4.e of the Trust Legal Provisions and are
   provided without warranty as described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
     1.1.  Scope . . . . . . . . . . . . . . . . . . . . . . . . . .   3
     1.2.  Extensibility of the DHCPv6 Server YANG Module  . . . . .   3
       1.2.1.  DHCPv6 Option Definitions . . . . . . . . . . . . . .   4
     1.3.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   4
   2.  DHCPv6 Tree Diagrams  . . . . . . . . . . . . . . . . . . . .   4
     2.1.  DHCPv6 Server Tree Diagram  . . . . . . . . . . . . . . .   4
     2.2.  DHCPv6 Relay Tree Diagram . . . . . . . . . . . . . . . .  11
     2.3.  DHCPv6 Client Tree Diagram  . . . . . . . . . . . . . . .  14
   3.  DHCPv6 YANG Model . . . . . . . . . . . . . . . . . . . . . .  17
     3.1.  DHCPv6 Server YANG Model  . . . . . . . . . . . . . . . .  17
     3.2.  DHCPv6 Relay YANG Model . . . . . . . . . . . . . . . . .  29
     3.3.  DHCPv6 Client YANG Model  . . . . . . . . . . . . . . . .  36
     3.4.  DHCPv6 RFC8415 Options YANG Model . . . . . . . . . . . .  45
     3.5.  DHCPv6 Common YANG Model  . . . . . . . . . . . . . . . .  54
   4.  Security Considerations (TBD) . . . . . . . . . . . . . . . .  58
   5.  IANA Considerations (TBD) . . . . . . . . . . . . . . . . . .  58
   6.  Acknowledgments . . . . . . . . . . . . . . . . . . . . . . .  59
   7.  Contributors  . . . . . . . . . . . . . . . . . . . . . . . .  59
   8.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  59
     8.1.  Normative References  . . . . . . . . . . . . . . . . . .  59
     8.2.  Informative References  . . . . . . . . . . . . . . . . .  60
   Appendix A.  Example of Adding New DHCPv6 Option
           Definitions . . . . . . . . . . . . . . . . . . . . . . .  61
   Appendix B.  Example Vendor Specific Server Configuration
           Module  . . . . . . . . . . . . . . . . . . . . . . . . .  63
   Appendix C.  Example definition of class selector
           configuration . . . . . . . . . . . . . . . . . . . . . .  68
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  73

Cui, et al.                Expires 7 May 2020                   [Page 2]
Internet-Draft              DHCPv6 YANG Model              November 2019

1.  Introduction

   DHCPv6 [RFC8415] is widely used for supplying configuration and other
   relevant parameters to clients in IPv6 networks.  This document
   defines DHCPv6 YANG modules for the configuration and management of
   DHCPv6 servers, relays and clients.  This document defines separate
   'element' modules for each of these.

   Additionally, a 'common' module contains typedefs and groupings used
   by the element modules.  A further module contains an initial set of
   DHCPv6 option definitions.

   It is worth noting that as DHCPv6 is itself a client configuration
   protocol, it is not the intention of this document to replace the
   allocation of DHCPv6 assigned addressing and parameters using
   NETCONF/YANG.  The DHCPv6 client model is intended for the
   configuration and monitoring of the DHCPv6 client function and does
   not affect the normal DHCPv6 message flow.

1.1.  Scope

   [RFC8415] describes the current version of the DHCPv6 base protocol
   specification.  In addition to this, a large number of addition
   specifications have also been published, extending DHCPv6 element
   functionality and adding new options.  The YANG modules contained in
   this document do not attempt to capture all of these extensions and
   additions, rather to model the DHCPv6 functions and options covered
   in [RFC8415].  A focus has also been given on the extensibility of
   the modules so that it is easy to augment in additional functionality
   as required by a particular implementation or deployment scenario.

1.2.  Extensibility of the DHCPv6 Server YANG Module

   The modules in this document only attempt to model DHCPv6 specific
   behavior and do not cover the configuration and management of
   functionality relevant for specific server implementations.  The
   level of variance between implementations is too great to attempt to
   standardize in a way that is useful without being restrictive.

   However, it is recognized that implementation specific configuration
   and management is also an essential part of DHCP deployment and
   operations.  To resolve this, Appendix B contains an example YANG
   module for the configuration of implementation specific functions,
   illustrating how this functionality can be augmented into the main
   ietf-dhcpv6-server.yang module.

   In DHCPv6 the concept of 'class selection' for messages received by
   the server is common.  This is the identification and classification

Cui, et al.                Expires 7 May 2020                   [Page 3]
Internet-Draft              DHCPv6 YANG Model              November 2019

   of messages based on a number of parameters so that the correct
   provisioning information can be supplied.  For example, allocating a
   prefix from the correct pool, or supplying a set of options relevant
   for a specific vendor's client implementation.  During the
   development of this document, research has been carried out into a
   number of vendor's class selection implementations and the findings
   were that while this function is common to all, the method for
   implementing this differs greatly.  Therefore, configuration of the
   class selection function has been omitted from the DHCPv6 server
   module to allow implementors to define their own suitable YANG
   module.  Appendix C provides an example of this, to demonstrate how
   this is can be integrated with the main "ietf-dhcpv6-server.yang"
   module.

1.2.1.  DHCPv6 Option Definitions

   A large number of DHCPv6 options have been created in addition to
   those defined in [RFC8415].  As implementations differ widely in
   which DHCPv6 options that they support, the following approach has
   been taken to defining options: Only the relevant set of DHCPv6
   options defined in [RFC8415] are included in this document.  Further
   options definitions can be added by additional YANG modules via
   augmentation into the relevant element modules from this document.
   Appendix A contains an example module showing how the DHCPv6 option
   definitions can be extended in this manner and provides guidance on
   writing YANG modules for DHCPv6 options.

1.3.  Terminology

   The reader should be familiar with the YANG data modelling language
   defined in [RFC7950].

   The YANG modules in this document adopt the Network Management
   Datastore Architecture (NMDA) [RFC8342].  The meanings of the symbols
   used in tree diagrams are defined in [RFC8340].

   The reader should be familiar with the terms defined in DHCPv6
   [RFC8415] and other relevant documents.

2.  DHCPv6 Tree Diagrams

2.1.  DHCPv6 Server Tree Diagram

   The tree diagram in Figure 1 provides an overview of the DHCPv6
   server module.  The tree also includes the augmentations of the
   relevant option definitions from Section 3.4 and the common functions
   module Section 3.5.

Cui, et al.                Expires 7 May 2020                   [Page 4]
Internet-Draft              DHCPv6 YANG Model              November 2019

    module: ietf-dhcpv6-server
      +--rw dhcpv6-node-type?   identityref
      +--rw dhcpv6-server
         +--rw server-duid
         |  +--rw type-code?                           uint16
         |  +--rw (duid-type)?
         |  |  +--:(duid-llt)
         |  |  |  +--rw duid-llt-hardware-type?        uint16
         |  |  |  +--rw duid-llt-time?                 yang:timeticks
         |  |  |  +--rw duid-llt-link-layer-address?
         |  |  |          yang:mac-address
         |  |  +--:(duid-en)
         |  |  |  +--rw duid-en-enterprise-number?     uint32
         |  |  |  +--rw duid-en-identifier?            string
         |  |  +--:(duid-ll)
         |  |  |  +--rw duid-ll-hardware-type?         uint16
         |  |  |  +--rw duid-ll-link-layer-address?
         |  |  |          yang:mac-address
         |  |  +--:(duid-uuid)
         |  |  |  +--rw uuid?                          yang:uuid
         |  |  +--:(duid-unknown)
         |  |     +--rw data?                          binary
         |  +--ro active-duid?                         binary
         +--rw vendor-config
         +--rw option-sets
         |  +--rw option-set* [option-set-id]
         |     +--rw option-set-id
         |     |       uint32
         |     +--rw description?
         |     |       string
         |     +--rw rfc3319:sip-server-domain-name-list-option
         |     |  +--rw rfc3319:sip-serv-domain-name?
         |     |          inet:domain-name
         |     +--rw rfc3319:sip-server-address-list-option
         |     |  +--rw rfc3319:sip-server* [sip-serv-id]
         |     |     +--rw rfc3319:sip-serv-id      uint8
         |     |     +--rw rfc3319:sip-serv-addr?   inet:ipv6-address
         |     +--rw rfc8415:preference-option
         |     |  +--rw rfc8415:pref-value?   uint8
         |     +--rw rfc8415:auth-option
         |     |  +--rw rfc8415:protocol?           uint8
         |     |  +--rw rfc8415:algorithm?          uint8
         |     |  +--rw rfc8415:rdm?                uint8
         |     |  +--rw rfc8415:replay-detection?   uint64
         |     |  +--rw rfc8415:auth-information?   string
         |     +--rw rfc8415:server-unicast-option
         |     |  +--rw rfc8415:server-address?   inet:ipv6-address
         |     +--rw rfc8415:status-code-option

Cui, et al.                Expires 7 May 2020                   [Page 5]
Internet-Draft              DHCPv6 YANG Model              November 2019

         |     |  +--rw rfc8415:status-code?      uint16
         |     |  +--rw rfc8415:status-message?   string
         |     +--rw rfc8415:rapid-commit-option!
         |     +--rw rfc8415:vendor-specific-information-option
         |     |  +--rw rfc8415:vendor-specific-information-option-inst
    ances*
         |     |          [enterprise-number]
         |     |     +--rw rfc8415:enterprise-number     uint32
         |     |     +--rw rfc8415:vendor-option-data*
         |     |             [sub-option-code]
         |     |        +--rw rfc8415:sub-option-code    uint16
         |     |        +--rw rfc8415:sub-option-data?   string
         |     +--rw rfc8415:reconfigure-message-option
         |     |  +--rw rfc8415:msg-type?   uint8
         |     +--rw rfc8415:reconfigure-accept-option!
         |     +--rw rfc8415:info-refresh-time-option
         |     |  +--rw rfc8415:info-refresh-time?
         |     |          dhcpv6-common:timer-value-seconds32
         |     +--rw rfc8415:sol-max-rt-option
         |     |  +--rw rfc8415:sol-max-rt-value?
         |     |          dhcpv6-common:timer-value-seconds32
         |     +--rw rfc8415:inf-max-rt-option
         |        +--rw rfc8415:inf-max-rt-value?
         |                dhcpv6-common:timer-value-seconds32
         +--rw class-selector
         +--rw network-ranges
            +--rw option-set-id*        leafref
            +--rw valid-lifetime
            |       dhcpv6-common:timer-value-seconds32
            +--rw renew-time
            |       dhcpv6-common:timer-value-seconds32
            +--rw rebind-time
            |       dhcpv6-common:timer-value-seconds32
            +--rw preferred-lifetime
            |       dhcpv6-common:timer-value-seconds32
            +--rw rapid-commit          boolean
            +--rw network-range* [network-range-id]
               +--rw network-range-id             uint32
               +--rw network-description          string
               +--rw network-prefix               inet:ipv6-prefix
               +--rw option-set-id*               leafref
               +--rw valid-lifetime
               |       dhcpv6-common:timer-value-seconds32
               +--rw renew-time
               |       dhcpv6-common:timer-value-seconds32
               +--rw rebind-time
               |       dhcpv6-common:timer-value-seconds32
               +--rw preferred-lifetime

Cui, et al.                Expires 7 May 2020                   [Page 6]
Internet-Draft              DHCPv6 YANG Model              November 2019

               |       dhcpv6-common:timer-value-seconds32
               +--rw rapid-commit                 boolean
               +--rw address-pools
               |  +--rw address-pool* [pool-id]
               |     +--rw pool-id               uint32
               |     +--rw pool-prefix           inet:ipv6-prefix
               |     +--rw start-address
               |     |       inet:ipv6-address-no-zone
               |     +--rw end-address
               |     |       inet:ipv6-address-no-zone
               |     +--rw max-address-count
               |     |       dhcpv6-common:threshold
               |     +--rw option-set-id*        leafref
               |     +--rw valid-lifetime
               |     |       dhcpv6-common:timer-value-seconds32
               |     +--rw renew-time
               |     |       dhcpv6-common:timer-value-seconds32
               |     +--rw rebind-time
               |     |       dhcpv6-common:timer-value-seconds32
               |     +--rw preferred-lifetime
               |     |       dhcpv6-common:timer-value-seconds32
               |     +--rw rapid-commit          boolean
               |     +--rw host-reservations
               |     |  +--rw host-reservation* [reserved-addr]
               |     |     +--rw client-duid?          binary
               |     |     +--rw reserved-addr
               |     |     |       inet:ipv6-address
               |     |     +--rw prefix-reservation*
               |     |     |       [reserv-prefix-id]
               |     |     |  +--rw reserv-prefix-id     uint32
               |     |     |  +--rw reserv-prefix
               |     |     |  |       inet:ipv6-prefix
               |     |     |  +--rw reserv-prefix-len    uint8
               |     |     +--rw option-set-id*        leafref
               |     |     +--rw valid-lifetime
               |     |     |       dhcpv6-common:timer-value-seconds32
               |     |     +--rw renew-time
               |     |     |       dhcpv6-common:timer-value-seconds32
               |     |     +--rw rebind-time
               |     |     |       dhcpv6-common:timer-value-seconds32
               |     |     +--rw preferred-lifetime
               |     |     |       dhcpv6-common:timer-value-seconds32
               |     |     +--rw rapid-commit          boolean
               |     +--ro active-leases* [leased-address]
               |        +--ro leased-address
               |        |       inet:ipv6-address
               |        +--ro total-address-count        uint64
               |        +--ro allocated-address-count    uint64

Cui, et al.                Expires 7 May 2020                   [Page 7]
Internet-Draft              DHCPv6 YANG Model              November 2019

               |        +--ro binding-info* [client-duid]
               |           +--ro client-duid    binary
               |           +--ro iaid* [iaid]
               |              +--ro iaid                  uint32
               |              +--ro allocation-time?
               |              |       yang:date-and-time
               |              +--ro last-renew-rebind?
               |              |       yang:date-and-time
               |              +--ro preferred-lifetime?
               |              |       dhcpv6-common:timer-value-seconds
    32
               |              +--ro valid-lifetime?
               |              |       dhcpv6-common:timer-value-seconds
    32
               |              +--ro lease-t1?
               |              |       dhcpv6-common:timer-value-seconds
    32
               |              +--ro lease-t2?
               |                      dhcpv6-common:timer-value-seconds
    32
               +--rw prefix-pools {prefix-delegation}?
               |  +--rw prefix-pool* [pool-id]
               |     +--rw pool-id                     uint32
               |     +--rw prefix
               |     |       inet:ipv6-prefix
               |     +--rw prefix-length               uint8
               |     +--rw max-pd-space-utilization
               |     |       dhcpv6-common:threshold
               |     +--rw option-set-id*              leafref
               |     +--rw valid-lifetime
               |     |       dhcpv6-common:timer-value-seconds32
               |     +--rw renew-time
               |     |       dhcpv6-common:timer-value-seconds32
               |     +--rw rebind-time
               |     |       dhcpv6-common:timer-value-seconds32
               |     +--rw preferred-lifetime
               |     |       dhcpv6-common:timer-value-seconds32
               |     +--rw rapid-commit                boolean
               |     +--rw host-reservations
               |        +--rw prefix-reservation* [reserved-prefix]
               |        |  +--rw client-duid?         binary
               |        |  +--rw reserved-prefix
               |        |  |       inet:ipv6-prefix
               |        |  +--rw reserv-prefix-len    uint8
               |        +--rw option-set-id*        leafref
               |        +--rw valid-lifetime
               |        |       dhcpv6-common:timer-value-seconds32
               |        +--rw renew-time

Cui, et al.                Expires 7 May 2020                   [Page 8]
Internet-Draft              DHCPv6 YANG Model              November 2019

               |        |       dhcpv6-common:timer-value-seconds32
               |        +--rw rebind-time
               |        |       dhcpv6-common:timer-value-seconds32
               |        +--rw preferred-lifetime
               |        |       dhcpv6-common:timer-value-seconds32
               |        +--rw rapid-commit          boolean
               |        +--ro active-leases* [leased-prefix]
               |           +--ro leased-prefix
               |           |       inet:ipv6-prefix
               |           +--ro total-address-count        uint64
               |           +--ro allocated-address-count    uint64
               |           +--ro binding-info* [client-duid]
               |              +--ro client-duid    binary
               |              +--ro iaid* [iaid]
               |                 +--ro iaid                  uint32
               |                 +--ro allocation-time?
               |                 |       yang:date-and-time
               |                 +--ro last-renew-rebind?
               |                 |       yang:date-and-time
               |                 +--ro preferred-lifetime?
               |                 |       dhcpv6-common:timer-value-seco
    nds32
               |                 +--ro valid-lifetime?
               |                 |       dhcpv6-common:timer-value-seco
    nds32
               |                 +--ro lease-t1?
               |                 |       dhcpv6-common:timer-value-seco
    nds32
               |                 +--ro lease-t2?
               |                         dhcpv6-common:timer-value-seco
    nds32
               +--ro solicit-count?               uint32
               +--ro advertise-count?             uint32
               +--ro request-count?               uint32
               +--ro confirm-count?               uint32
               +--ro renew-count?                 uint32
               +--ro rebind-count?                uint32
               +--ro reply-count?                 uint32
               +--rw release-count?               uint32
               +--ro decline-count?               uint32
               +--ro reconfigure-count?           uint32
               +--ro information-request-count?   uint32

      notifications:
        +---n address-pool-running-out
        |  +--ro total-address-count        uint64
        |  +--ro max-address-count          uint64
        |  +--ro allocated-address-count    uint64

Cui, et al.                Expires 7 May 2020                   [Page 9]
Internet-Draft              DHCPv6 YANG Model              November 2019

        |  +--ro pool-id                    uint32
        +---n pd-pool-running-out
        |  +--ro max-pd-space-utilization    dhcpv6-common:threshold
        |  +--ro pd-space-utilization        dhcpv6-common:threshold
        |  +--ro pool-id                     uint32
        +---n invalid-client-detected
        |  +--ro duid?          binary
        |  +--ro description?   string
        +---n decline-received
        |  +--ro duid?        binary
        |  +--ro addresses*   inet:ipv6-address
        +---n non-success-code-sent
           +--ro status-code    uint16
           +--ro duid?          binary

                Figure 1: DHCPv6 Server Data Model Structure

   Description of important nodes:

   *  dhcpv6-node-type: The different functional DHCPv6 elements each
      have their relevant identities.

   *  dhcpv6-server: This container holds the server's DHCPv6 specific
      configuration.

   *  server-duid: Each server must have a DUID (DHCP Unique Identifier)
      to identify itself to clients.  A DUID consists of a two-octet
      type field and an arbitrary length (of no more than 128-bytes)
      content field.  Currently there are four defined types of DUIDs in
      [RFC8415] and [RFC6355]: DUID-LLT, DUID-EN, DUID-LL, and DUID-
      UUID.  DUID-Unknown is used for arbitrary DUID formats which do
      not follow any of these defined types. 'active-duid' is a read-
      only field that the server's current DUID can be retrieved from.
      The DUID definitions are imported from the 'ietf-
      dhcpv6-common.yang' module as they are also used by the 'ietf-
      dhcpv6-client.yang' module.

   *  vendor-config: This container is provided as a location for
      additional implementation specific YANG nodes for the
      configuration of the device to be augmented.  See Appendix B for
      an example of this.

   *  option-sets: The server can be configured with multiple option-
      sets.  These are groups of DHCPv6 options with common parameters
      which will be supplied to the intended clients.  The 'option-set-
      id' field is the key field which is referenced by the relevant
      address or prefix pool configuration.

Cui, et al.                Expires 7 May 2020                  [Page 10]
Internet-Draft              DHCPv6 YANG Model              November 2019

   *  option-set: Holds definitions for DHCPv6 options themselves.  The
      initial set of definitions are contained in the module 'ietf-
      dhcpv6-options-rfc8415.yang' and are augmented into the server
      module at this point.

   *  class-selector: This is provided as a location for additional
      implementation specific YANG nodes for vendor specific class
      selector nodes to be augmented.  See Appendix C for an example of
      this.

   *  network-ranges: This model uses a hierarchical model for the
      allocation of addresses and prefixes.  At the top level 'network-
      ranges' holds global configuration parameters.  Under this, a list
      of 'network-ranges' can be defined.  Inside 'network-rages',
      'address-pools' (for IA_NA and IA_TA allocations), and 'prefix-
      pools' (for IA_PD allocation) are defined.  Finally within the
      pools, specific host-reservations are held.

   *  prefix-pools: Defines prefix pools to be used for prefix
      delegation to clients.  As prefix delegation is not supported by
      all DHCPv6 server implementations, it is enabled by a feature
      statement.

   Information about notifications:

   *  address/pd-pool-running-out: Raised when the address/prefix pool
      is going to run out.  A threshold for the utilization ratio of the
      pool (max-address-count/max-pd-space utilization) has been defined
      in the server features so that it will notify the administrator
      when the utilization ratio reaches the threshold, and such
      threshold is a settable parameter.

   *  invalid-client-detected: Raised when the server has found a client
      which can be regarded as a potential attacker.  A description may
      also be included.

   *  decline-received: Raised when a DHCPv6 Decline message is received
      from a client.

   *  non-success-code-sent: Raised when a status message is raised for
      an error.

2.2.  DHCPv6 Relay Tree Diagram

   The tree diagram in Figure 2 provides an overview of the DHCPv6 relay
   module.  The tree also includes the augmentations of the relevant
   option definitions from Section 3.4 and the common functions module
   Section 3.5.

Cui, et al.                Expires 7 May 2020                  [Page 11]
Internet-Draft              DHCPv6 YANG Model              November 2019

       module: ietf-dhcpv6-relay
         +--rw dhcpv6-node-type?   identityref
         +--rw dhcpv6-relay
            +--rw relay-if* [if-name]
            |  +--rw if-name
            |  |       if:interface-ref
            |  +--rw destination-addresses*
            |  |       inet:ipv6-address
            |  +--rw link-address?                         binary
            |  +--rw relay-options
            |  |  +--rw rfc8415:auth-option
            |  |  |  +--rw rfc8415:protocol?           uint8
            |  |  |  +--rw rfc8415:algorithm?          uint8
            |  |  |  +--rw rfc8415:rdm?                uint8
            |  |  |  +--rw rfc8415:replay-detection?   uint64
            |  |  |  +--rw rfc8415:auth-information?   string
            |  |  +--rw rfc8415:status-code-option
            |  |  |  +--rw rfc8415:status-code?      uint16
            |  |  |  +--rw rfc8415:status-message?   string
            |  |  +--rw rfc8415:interface-id-option
            |  |     +--rw rfc8415:interface-id?   string
            |  +--ro solicit-received-count?               uint32
            |  +--ro advertise-sent-count?                 uint32
            |  +--ro request-received-count?               uint32
            |  +--ro confirm-received-count?               uint32
            |  +--ro renew-received-count?                 uint32
            |  +--ro rebind-received-count?                uint32
            |  +--ro reply-sent-count?                     uint32
            |  +--ro release-received-count?               uint32
            |  +--ro decline-received-count?               uint32
            |  +--ro reconfigure-sent-count?               uint32
            |  +--ro information-request-received-count?   uint32
            |  +--ro unknown-message-received-count?       uint32
            |  +--ro unknown-message-sent-count?           uint32
            |  +--ro discarded-message-count?              uint32
            |  +--rw prefix-delegation! {prefix-delegation}?
            |     +--ro pd-leases* [ia-pd-prefix]
            |        +--ro ia-pd-prefix           inet:ipv6-prefix
            |        +--ro last-renew?            yang:date-and-time
            |        +--ro client-peer-address?   inet:ipv6-address
            |        +--ro client-duid?           binary
            |        +--ro server-duid?           binary
            +--ro relay-forward-sent-count?               uint32
            +--ro relay-forward-received-count?           uint32
            +--ro relay-reply-received-count?             uint32
            +--ro relay-forward-unknown-sent-count?       uint32
            +--ro relay-forward-unknown-received-count?   uint32
            +--ro discarded-message-count?                uint32

Cui, et al.                Expires 7 May 2020                  [Page 12]
Internet-Draft              DHCPv6 YANG Model              November 2019

         notifications:
           +---n relay-event
              +--ro topology-change
                 +--ro relay-if-name?
                 |       -> /dhcpv6-relay/relay-if/if-name
                 +--ro last-ipv6-addr?   inet:ipv6-address

                Figure 2: DHCPv6 Relay Data Model Structure

   Description of important nodes:

   *  dhcpv6-node-type: The different functional DHCPv6 elements each
      have their relevant identities.

   *  dhcpv6-relay: This container holds the relay's DHCPv6 specific
      configuration.

   *  relay-if: As a relay may have multiple client-facing interfaces,
      they are configured in a list.  The if-name leaf is the key and is
      an interface-ref to the applicable interface defined by the 'ietf-
      interfaces' YANG module.

   *  destination-addresses: Defines a list of IPv6 addresses that
      client messages will be relayed to.  May include unicast or
      multicast addresses.

   *  link-address: Allows the configuration of the value that the relay
      will put into the link-address field of Relay-Forward messages.

   *  prefix-delegation: As prefix delegation is not supported by all
      DHCPv6 relay implementations, it is enabled by this feature
      statement where required.

   *  pd-leases: Contains read only nodes for holding information about
      active delegated prefix leases.

   *  relay-options: As with the Server module, DHCPv6 options that can
      be sent by the relay are augmented here.

   Information about notifications:

   *  topology-changed: Raised when the topology of the relay agent is
      changed, e.g. a client facing interface is reconfigured.

Cui, et al.                Expires 7 May 2020                  [Page 13]
Internet-Draft              DHCPv6 YANG Model              November 2019

2.3.  DHCPv6 Client Tree Diagram

   The tree diagram in Figure 3 provides an overview of the DHCPv6
   client module.  The tree also includes the augmentations of the
   relevant option definitions from Section 3.4 and the common functions
   module Section 3.5.

    module: ietf-dhcpv6-client
      +--rw dhcpv6-node-type?   identityref
      +--rw dhcpv6-client
         +--rw client-if* [if-name]
            +--rw if-name
            |       if:interface-ref
            +--rw type-code?                           uint16
            +--rw (duid-type)?
            |  +--:(duid-llt)
            |  |  +--rw duid-llt-hardware-type?        uint16
            |  |  +--rw duid-llt-time?                 yang:timeticks
            |  |  +--rw duid-llt-link-layer-address?
            |  |          yang:mac-address
            |  +--:(duid-en)
            |  |  +--rw duid-en-enterprise-number?     uint32
            |  |  +--rw duid-en-identifier?            string
            |  +--:(duid-ll)
            |  |  +--rw duid-ll-hardware-type?         uint16
            |  |  +--rw duid-ll-link-layer-address?
            |  |          yang:mac-address
            |  +--:(duid-uuid)
            |  |  +--rw uuid?                          yang:uuid
            |  +--:(duid-unknown)
            |     +--rw data?                          binary
            +--ro active-duid?                         binary
            +--rw client-configured-options
            |  +--rw rfc8415:option-request-option
            |  |  +--rw rfc8415:oro-option*   uint16
            |  +--rw rfc8415:status-code-option
            |  |  +--rw rfc8415:status-code?      uint16
            |  |  +--rw rfc8415:status-message?   string
            |  +--rw rfc8415:rapid-commit-option!
            |  +--rw rfc8415:user-class-option
            |  |  +--rw rfc8415:user-class-data*
            |  |          [user-class-datum-id]
            |  |     +--rw rfc8415:user-class-datum-id    uint8
            |  |     +--rw rfc8415:user-class-datum?      string
            |  +--rw rfc8415:vendor-class-option
            |  |  +--rw rfc8415:vendor-class-option-instances*
            |  |          [enterprise-number]
            |  |     +--rw rfc8415:enterprise-number    uint32

Cui, et al.                Expires 7 May 2020                  [Page 14]
Internet-Draft              DHCPv6 YANG Model              November 2019

            |  |     +--rw rfc8415:vendor-class*
            |  |             [vendor-class-datum-id]
            |  |        +--rw rfc8415:vendor-class-datum-id    uint8
            |  |        +--rw rfc8415:vendor-class-datum?      string
            |  +--rw rfc8415:vendor-specific-information-option
            |  |  +--rw rfc8415:vendor-specific-information-option-inst
    ances*
            |  |          [enterprise-number]
            |  |     +--rw rfc8415:enterprise-number     uint32
            |  |     +--rw rfc8415:vendor-option-data*
            |  |             [sub-option-code]
            |  |        +--rw rfc8415:sub-option-code    uint16
            |  |        +--rw rfc8415:sub-option-data?   string
            |  +--rw rfc8415:reconfigure-accept-option!
            +--rw ia-na* [iaid]
            |  +--rw iaid             uint32
            |  +--rw ia-na-options
            |  +--ro lease-state
            |     +--ro ia-na-address?        inet:ipv6-address
            |     +--ro preferred-lifetime?
            |     |       dhcpv6-common:timer-value-seconds32
            |     +--ro valid-lifetime?
            |     |       dhcpv6-common:timer-value-seconds32
            |     +--ro lease-t1?
            |     |       dhcpv6-common:timer-value-seconds32
            |     +--ro lease-t2?
            |     |       dhcpv6-common:timer-value-seconds32
            |     +--ro allocation-time?      yang:date-and-time
            |     +--ro last-renew-rebind?    yang:date-and-time
            |     +--ro server-duid?          binary
            +--rw ia-ta* [iaid]
            |  +--rw iaid             uint32
            |  +--rw ia-ta-options
            |  +--ro lease-state
            |     +--ro ia-ta-address?        inet:ipv6-address
            |     +--ro preferred-lifetime?
            |     |       dhcpv6-common:timer-value-seconds32
            |     +--ro valid-lifetime?
            |     |       dhcpv6-common:timer-value-seconds32
            |     +--ro allocation-time?      yang:date-and-time
            |     +--ro last-renew-rebind?    yang:date-and-time
            |     +--ro server-duid?          binary
            +--rw ia-pd* [iaid]
            |  +--rw iaid             uint32
            |  +--rw ia-pd-options
            |  +--ro lease-state
            |     +--ro ia-pd-prefix?         inet:ipv6-prefix
            |     +--ro preferred-lifetime?

Cui, et al.                Expires 7 May 2020                  [Page 15]
Internet-Draft              DHCPv6 YANG Model              November 2019

            |     |       dhcpv6-common:timer-value-seconds32
            |     +--ro valid-lifetime?
            |     |       dhcpv6-common:timer-value-seconds32
            |     +--ro lease-t1?
            |     |       dhcpv6-common:timer-value-seconds32
            |     +--ro lease-t2?
            |     |       dhcpv6-common:timer-value-seconds32
            |     +--ro allocation-time?      yang:date-and-time
            |     +--ro last-renew-rebind?    yang:date-and-time
            |     +--ro server-duid?          binary
            +--ro solicit-count?                       uint32
            +--ro advertise-count?                     uint32
            +--ro request-count?                       uint32
            +--ro confirm-count?                       uint32
            +--ro renew-count?                         uint32
            +--ro rebind-count?                        uint32
            +--ro reply-count?                         uint32
            +--rw release-count?                       uint32
            +--ro decline-count?                       uint32
            +--ro reconfigure-count?                   uint32
            +--ro information-request-count?           uint32

      notifications:
        +---n invalid-ia-detected
        |  +--ro iaid           uint32
        |  +--ro description?   string
        +---n retransmission-failed
        |  +--ro failure-type    enumeration
        +---n unsuccessful-status-code
        |  +--ro status-code    uint16
        |  +--ro server-duid    binary
        +---n server-duid-changed
           +--ro new-server-duid         binary
           +--ro previous-server-duid    binary
           +--ro lease-ia-na?
           |       -> /dhcpv6-client/client-if/ia-na/iaid
           +--ro lease-ia-ta?
           |       -> /dhcpv6-client/client-if/ia-ta/iaid
           +--ro lease-ia-pd?
                   -> /dhcpv6-client/client-if/ia-pd/iaid

                Figure 3: DHCPv6 Client Data Model Structure

   Description of important nodes:

   *  dhcpv6-node-type: The different functional DHCPv6 elements each
      have their relevant identities.

Cui, et al.                Expires 7 May 2020                  [Page 16]
Internet-Draft              DHCPv6 YANG Model              November 2019

   *  dhcpv6-client: This container holds the client's DHCPv6 specific
      configuration.

   *  client-if: As a client may have multiple interfaces requesting
      configuration over DHCP, they are configured in a list.  The if-
      name leaf is the key and is an interface-ref to the applicable
      interface defined by the 'ietf-interfaces' YANG module.

   *  client-duid: Each DHCP client must have a DUID (DHCP Unique
      Identifier) to identify itself to clients.  A DUID consists of a
      two-octet type field and an arbitrary length (of no more than
      128-bytes) content field.  Currently there are four defined types
      of DUIDs in [RFC8415]: DUID-LLT, DUID-EN, DUID-LL, and DUID-UUID.
      DUID-Unknown is used for arbitrary DUID formats which do not
      follow any of these defined types. 'active-duid' is a read-only
      field that the client's current DUID can be retrieved from.  The
      DUID definitions are imported from the 'ietf-dhcpv6-common.yang'
      module.  DUID is configured under the 'client-if' to allow a
      client to have different DUIDs for each interface if required.

   *  ia-na, ia-ta, ia-pd: Contains configuration nodes relevant for
      requesting one or more of each of the lease types.  Also contains
      read only nodes related to active leases.

   Information about notifications:

   *  invalid-ia-detected: Raised when the identity association of the
      client can be proved to be invalid.  Possible condition includes
      duplicated address, illegal address, etc.

   *  retransmission-failed: Raised when the retransmission mechanism
      defined in [RFC8415] is failed.

   *  failed-status-turn-up: Raised when the client receives a message
      includes an unsuccessful Status Code option.

3.  DHCPv6 YANG Model

3.1.  DHCPv6 Server YANG Model

   This module imports typedefs from [RFC6991], [RFC8343].

   module ietf-dhcpv6-server {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-server";
     prefix "dhcpv6-server";

     import ietf-inet-types {

Cui, et al.                Expires 7 May 2020                  [Page 17]
Internet-Draft              DHCPv6 YANG Model              November 2019

       prefix inet;
     }
     import ietf-yang-types {
       prefix yang;
     }
     import ietf-dhcpv6-common {
       prefix dhcpv6-common;
     }

     organization "DHC WG";
     contact
       "cuiyong@tsinghua.edu.cn
       lh.sunlinh@gmail.com
       ian.farrer@telekom.de
       sladjana.zechlin@telekom.de
       hezihao9512@gmail.com
       godfryd@isc.org";

     description "This is a YANG data module for the configuration
       and management of DHCPv6 servers.

       Copyright (c) 2018 IETF Trust and the persons identified as
       authors of the code.  All rights reserved.

       Redistribution and use in source and binary forms, with or
       without modification, is permitted pursuant to, and subject
       to the license terms contained in, the Simplified BSD License
       set forth in Section 4.c of the IETF Trust's Legal Provisions
       Relating to IETF Documents
       (http://trustee.ietf.org/license-info).

       This version of this YANG module is part of RFC 8513; see
       the RFC itself for full legal notices.";

     revision 2018-09-04 {
       description "";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     revision 2018-03-04 {
       description "Resolved most issues on the DHC official
         github";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     revision 2017-12-22 {
       description "Resolve most issues on Ian's github.";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";

Cui, et al.                Expires 7 May 2020                  [Page 18]
Internet-Draft              DHCPv6 YANG Model              November 2019

     }

     revision 2017-11-24 {
       description "First version of the separated server specific
         YANG model.";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     /*
      * Typedef
      */

     identity server {
       base "dhcpv6-common:dhcpv6-node";
       description "DHCPv6 server.";
     }

     leaf dhcpv6-node-type {
       description "Type for a DHCPv6 server";
       type identityref {
         base "dhcpv6-server:server";
       }
     }

     feature prefix-delegation {
       description "Enable if the server implements prefix delegation.";
     }

     grouping resource-config {
       description "Nodes that are reused by multiple levels
         in the DHCPv6 server's addressing hierarchy.";
       leaf-list option-set-id {
         type leafref {
           path "/dhcpv6-server/option-sets/option-set/option-set-id";
         }
         description "The ID field of relevant option-set
           to be provisioned to clients of this network-range.";
       }
       leaf valid-lifetime {
         type dhcpv6-common:timer-value-seconds32;
         mandatory true;
         description "Valid lifetime for the IA.";
       }
       leaf renew-time {
         type dhcpv6-common:timer-value-seconds32;
         mandatory true;
         description "Renew (T1) time.";
       }

Cui, et al.                Expires 7 May 2020                  [Page 19]
Internet-Draft              DHCPv6 YANG Model              November 2019

       leaf rebind-time {
         type dhcpv6-common:timer-value-seconds32;
         mandatory true;
         description "Rebind (T2) time.";
       }
       leaf preferred-lifetime {
         type dhcpv6-common:timer-value-seconds32;
         mandatory true;
         description "Preferred lifetime for the IA";
       }
       leaf rapid-commit {
         type boolean;
         mandatory true;
         description "A value of 1 specifies that the pool supports
           client-server exchanges involving two messages.";
       }
     }

     grouping lease-information {
       leaf total-address-count {
         type uint64;
         mandatory true;
         description "count of total addresses in the pool";
       }
       leaf allocated-address-count {
         type uint64;
         mandatory true;
         description "count of allocated addresses in the pool";
       }
       list binding-info {
         key client-duid;
         description "Records binding information for each client that
           has previously been allocated IPv6 addresses.";
         leaf client-duid {
           description "Client DUID.";
           type binary;
         }
         list iaid {
           key iaid;
           description "Clients IAID.";
           leaf iaid {
             type uint32;
             mandatory true;
             description "IAID";
           }
           leaf allocation-time {
             description "Time and date that the lease was made.";
             type yang:date-and-time;

Cui, et al.                Expires 7 May 2020                  [Page 20]
Internet-Draft              DHCPv6 YANG Model              November 2019

           }
           leaf last-renew-rebind {
             description "Time of the last successful renew or rebind.";
             type yang:date-and-time;
           }
           leaf preferred-lifetime {
             description "The preferred lifetime expressed in units
               of seconds.";
             type dhcpv6-common:timer-value-seconds32;
           }
           leaf valid-lifetime {
             description "The valid lifetime for the leased prefix
               expressed in units of seconds.";
             type dhcpv6-common:timer-value-seconds32;
           }
           leaf lease-t1 {
             description "The time interval after which the client
               should contact the server from which the addresses
               in the IA_NA were obtained to extend the lifetimes
               of the addresses assigned to the IA_PD.";
             type dhcpv6-common:timer-value-seconds32;
           }
           leaf lease-t2 {
             description "The time interval after which the client
               should contact any available server to extend
               the lifetimes of the addresses assigned to the IA_PD.";
             type dhcpv6-common:timer-value-seconds32;
           }
         }
       }
     }

     grouping message-stats {
       description "Counters for DHCPv6 messages.";
       leaf solicit-count {
         config "false";
         type uint32;
         description "Number of Solicit (1) messages received.";
       }
       leaf advertise-count {
         config "false";
         type uint32;
         description "Number of Advertise (2) messages sent.";
       }
       leaf request-count {
         config "false";
         type uint32;
         description "Number of Request (3) messages received.";

Cui, et al.                Expires 7 May 2020                  [Page 21]
Internet-Draft              DHCPv6 YANG Model              November 2019

       }
       leaf confirm-count {
         config "false";
         type uint32;
         description "Number of Confirm (4) messages received.";
       }
       leaf renew-count {
         config "false";
         type uint32;
         description "Number of Renew (5) messages received.";
       }
       leaf rebind-count {
         config "false";
         type uint32;
         description "Number of Rebind (6) messages received.";
       }
       leaf reply-count {
         config "false";
         type uint32;
         description "Number of Reply (7) messages sent.";
       }
       leaf release-count {
         type uint32;
         description "Number of Release (8) messages received.";
       }
       leaf decline-count {
         config "false";
         type uint32;
         description "Number of Decline (9) messages received.";
       }
       leaf reconfigure-count {
         config "false";
         type uint32;
         description "Number of Reconfigure (10) messages sent.";
       }
       leaf information-request-count {
         config "false";
         type uint32;
         description "Number of Information-request (11) messages
           received.";
       }
     }

     /*
      * Data Nodes
      */
     container dhcpv6-server {
       container server-duid {

Cui, et al.                Expires 7 May 2020                  [Page 22]
Internet-Draft              DHCPv6 YANG Model              November 2019

         description "DUID of the server.";
         uses dhcpv6-common:duid;
       }
       container vendor-config {
         description "This container provides a location for augmenting
           vendor or implementation specific configuration nodes.";
       }
       container option-sets {
         description "A server may allow different option sets
           to be configured for clients matching specific parameters
           such as topological location or client type. The 'option-set'
           list is a set of options and their contents that
           will be returned to clients.";
         list option-set {
           key option-set-id;
           description "YANG definitions for DHCPv6 options are
             contained in separate YANG modules and augmented to this
             container as required.";
           leaf option-set-id {
             type uint32;
             description "Option set identifier.";
           }
           leaf description {
             type string;
             description "An optional field for storing additional
               information relevant to the option set.";
           }
         }
       }

       container class-selector {
         description "DHCPv6 servers use a 'class-selector' function
           in order to identify and classify incoming client messages
           so that they can be given the correct configuration.
           The mechanisms used for implementing this function vary
           greatly between different implementations such that they are
           not possible to include in this module. This container
           provides a location for server implementors to augment their
           own class-selector YANG.";
       }

       container network-ranges {
         description "This model supports a hierarchy to achieve dynamic
           configuration. That is to say we could configure the server
           at different levels through this model. The top level is
           a global level which is defined as the container
           'network-ranges'. The following levels are defined
           as sub-containers under it. The 'network-ranges' contains the

Cui, et al.                Expires 7 May 2020                  [Page 23]
Internet-Draft              DHCPv6 YANG Model              November 2019

           parameters (e.g. option-sets) that would be allocated to
           all the clients served by this server.";
         uses resource-config;
         list network-range {
           key network-range-id;
           description "Under the 'network-ranges' container,
             a 'network-range' list is defined to configure the server
             at a network level which is also considered as the second
             level. Different network are identified by the key
             'network-range-id'. This is because a server may have
             different configuration parameters (e.g. option sets)
             for different networks.";
           leaf network-range-id {
             type uint32;
             mandatory true;
             description "Equivalent to subnet ID";
           }
           leaf network-description {
             type string;
             mandatory true;
             description "Description of the network range.";
           }
           leaf network-prefix {
             type inet:ipv6-prefix;
             mandatory true;
             description "Network prefix";
           }
           uses resource-config;
           container address-pools {
             description
               "A container that describes the DHCPv6 server's
               address pools.";
             list address-pool {
               key pool-id;
               description "A DHCPv6 server can be configured with
                 several address pools. This list defines such address
                 pools which are distinguished by the key called
                 'pool-id'.";
               leaf pool-id {
                 type uint32;
                 mandatory true;
                 description "Pool ID";
               }
               leaf pool-prefix {
                 type inet:ipv6-prefix;
                 mandatory true;
                 description "Pool prefix";
               }

Cui, et al.                Expires 7 May 2020                  [Page 24]
Internet-Draft              DHCPv6 YANG Model              November 2019

               leaf start-address {
                 type inet:ipv6-address-no-zone;
                 mandatory true;
                 description "Start address";
               }
               leaf end-address {
                 type inet:ipv6-address-no-zone;
                 mandatory true;
                 description "End address";
               }
               leaf max-address-count {
                 type dhcpv6-common:threshold;
                 mandatory true;
                 description "Maximum count of addresses that can
                   be allocated in this pool. This value may be
                   less than count of total addresses.";
               }
               uses resource-config;
               container host-reservations {
                 description "Configuration for host reservations
                   in the address pool.";
                 list host-reservation {
                   key reserved-addr;
                   leaf client-duid {
                     type binary;
                     description "Client DUID.";
                   }
                   leaf reserved-addr {
                     type inet:ipv6-address;
                     description "reserved addr";
                   }
                   list prefix-reservation {
                     key reserv-prefix-id;
                     description "reserved prefix reservation";
                     leaf reserv-prefix-id {
                       type uint32;
                       mandatory true;
                       description "reserved prefix id";
                     }
                     leaf reserv-prefix {
                       type inet:ipv6-prefix;
                       mandatory true;
                       description "reserved prefix";
                     }
                     leaf reserv-prefix-len {
                       type uint8;
                       mandatory true;
                       description "reserved prefix length";

Cui, et al.                Expires 7 May 2020                  [Page 25]
Internet-Draft              DHCPv6 YANG Model              November 2019

                     }
                   }
                   uses resource-config;
                 }
               }
               list active-leases {
                 description "Holds state for active client leases.";
                 config false;
                 key leased-address;
                 leaf leased-address {
                   type inet:ipv6-address;
                 }
                 uses lease-information;
               }
             }
           }
           container prefix-pools {
             description "Defines IPv6 prefix pools to be delegated
               to clients.";
             if-feature prefix-delegation;
             list prefix-pool {
               key pool-id;
               description "A server can be configured with multiple
                 prefix pools.";
               leaf pool-id {
                 type uint32;
                 mandatory true;
                 description "Unique identifier for the pool.";
               }
               leaf prefix {
                 type inet:ipv6-prefix;
                 mandatory true;
                 description "IPv6 prefix";
               }
               leaf prefix-length {
                 type uint8;
                 mandatory true;
                 description "Length of prefixes that will be delegated
                   to clients.";
               }
               leaf max-pd-space-utilization {
                 type dhcpv6-common:threshold;
                 mandatory true;
                 description "Maximum utilization of PD space
                   in this pool";
               }
               uses resource-config;
               container host-reservations {

Cui, et al.                Expires 7 May 2020                  [Page 26]
Internet-Draft              DHCPv6 YANG Model              November 2019

                 description "Configuration for host reservations
                   in the prefix pool.";
                 list prefix-reservation {
                   description "reserved prefix reservation";
                   key reserved-prefix;
                   leaf client-duid {
                     type binary;
                     description "Client DUID.";
                   }
                   leaf reserved-prefix {
                     type inet:ipv6-prefix;
                     mandatory true;
                     description "reserved prefix";
                   }
                   leaf reserv-prefix-len {
                     type uint8;
                     mandatory true;
                     description "reserved prefix length";
                   }
                 }
                 uses resource-config;
                 list active-leases {
                   description "Holds state for active client leases.";
                   config false;
                   key leased-prefix;
                   leaf leased-prefix{
                     type inet:ipv6-prefix;
                   }
                   uses lease-information;
                 }
               }
             }
           }
           uses message-stats;
         }
       }
     }

     /*
      * Notifications
      */

     notification address-pool-running-out {
       description "Notification sent when the address pool is going to
         run out. A threshold for utilization ratio of the pool has
         been defined in the server feature so that it will notify the
         administrator when the utilization ratio reaches the
         threshold, and such threshold is a settable parameter";

Cui, et al.                Expires 7 May 2020                  [Page 27]
Internet-Draft              DHCPv6 YANG Model              November 2019

       leaf total-address-count {
         type uint64;
         mandatory true;
         description "Count of total addresses in the pool";
       }
       leaf max-address-count {
         type uint64;
         mandatory true;
         description "Maximum count of addresses that can be allocated
           in the pool. This value may be less than count of total
           addresses";
       }
       leaf allocated-address-count {
         type uint64;
         mandatory true;
         description "Count of allocated addresses in the pool";
       }
       leaf pool-id {
         type uint32;
         mandatory true;
         description "Pool ID";
       }
     }

     notification pd-pool-running-out {
       description "Notification sent when the address/prefix pool
         is going to run out. A threshold for utilization ratio
         of the pool has been defined in the server feature so that
         it will notify the administrator when the utilization ratio
         reaches the threshold, and such threshold is a settable
         parameter";
       leaf max-pd-space-utilization {
         type dhcpv6-common:threshold;
         mandatory true;
         description "Maximum PD space utilization";
       }
       leaf pd-space-utilization {
         type dhcpv6-common:threshold;
         mandatory true;
         description "Current PD space utilization";
       }
       leaf pool-id {
         type uint32;
         mandatory true;
         description "Pool ID";
       }
     }

Cui, et al.                Expires 7 May 2020                  [Page 28]
Internet-Draft              DHCPv6 YANG Model              November 2019

     notification invalid-client-detected {
       description "Notification sent when the server has found a client
         which can be regarded as a potential attacker. Some description
         could also be included.";
       leaf duid {
         description "Client's DUID";
         type binary;
       }
       leaf description {
         type string;
         description "Description of the event";
       }
     }

     notification decline-received {
       description "Notification sent when the server has received
         DECLINE message from a client.";
       leaf duid {
         description "Client's DUID";
         type binary;
       }
       leaf-list addresses {
         type inet:ipv6-address;
         description "List of suspicious addresses";
       }
     }

     notification non-success-code-sent {
       description "Notification sent when the server responded
         to a client with non-success status code.";
       leaf status-code {
         type uint16;
         mandatory true;
         description "Status code returned to a client";
       }
       leaf duid {
         description "Client's DUID";
         type binary;
       }
     }
   }

3.2.  DHCPv6 Relay YANG Model

   This module imports typedefs from [RFC6991], [RFC8343].

Cui, et al.                Expires 7 May 2020                  [Page 29]
Internet-Draft              DHCPv6 YANG Model              November 2019

   module ietf-dhcpv6-relay {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-relay";
     prefix "dhcpv6-relay";

     import ietf-inet-types {
       prefix inet;
     }
     import ietf-yang-types {
       prefix yang;
     }
     import ietf-dhcpv6-common {
       prefix dhcpv6-common;
     }
     import ietf-interfaces {
       prefix if;
     }

     organization
       "IETF DHC (Dynamic Host Configuration) Working group";

     contact
       "cuiyong@tsinghua.edu.cn
       lh.sunlinh@gmail.com
       ian.farrer@telekom.de
       sladjana.zechlin@telekom.de
       hezihao9512@gmail.com
       godfryd@isc.org";

     description
       "This model defines a YANG data model that can be
       used to configure and manage a DHCPv6 relay.

       Copyright (c) 2018 IETF Trust and the persons identified as
       authors of the code.  All rights reserved.

       Redistribution and use in source and binary forms, with or
       without modification, is permitted pursuant to, and subject
       to the license terms contained in, the Simplified BSD License
       set forth in Section 4.c of the IETF Trust's Legal Provisions
       Relating to IETF Documents
       (http://trustee.ietf.org/license-info).

       This version of this YANG module is part of RFC 8513; see
       the RFC itself for full legal notices.";

     revision 2019-09-20 {
       description "";

Cui, et al.                Expires 7 May 2020                  [Page 30]
Internet-Draft              DHCPv6 YANG Model              November 2019

       reference "I-D: draft-ietf-dhc-dhcpv6-yang-10";
     }

     revision 2018-03-04 {
       description "Resolved most issues on the DHC official
         github";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     revision 2017-12-22 {
       description
         "Resolve most issues on Ians Github.";
       reference
         "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     revision 2017-11-24 {
       description
         "First version of the separated relay specific
         YANG model.";
       reference
         "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     identity relay {
       base "dhcpv6-common:dhcpv6-node";
       description "DHCPv6 relay agent.";
     }

     leaf dhcpv6-node-type {
       description "Type for a DHCPv6 relay";
       type identityref {
         base "dhcpv6-relay:relay";
       }
     }

     feature prefix-delegation {
       description "Enable if the relay functions as a delegating router
         for prefix delegation.";
     }

     grouping pd-lease-state {
       description "State data for the relay";
       list pd-leases {
         config false;
         key ia-pd-prefix;
         description "Information about an active IA_PD prefix
           delegation.";

Cui, et al.                Expires 7 May 2020                  [Page 31]
Internet-Draft              DHCPv6 YANG Model              November 2019

         leaf ia-pd-prefix {
           description "Prefix that is delegated.";
           type inet:ipv6-prefix;
         }
         leaf last-renew {
           description "Time of the last successful refresh or renew
             of the delegated prefix.";
           type yang:date-and-time;
         }
         leaf client-peer-address {
           description "Peer-address of the client.";
           type inet:ipv6-address;
         }
         leaf client-duid {
           description "DUID of the client.";
           type binary;
         }
         leaf server-duid {
           description "DUID of the delegating server.";
           type binary;
         }
       }
     }

     grouping message-statistics {
       description "Contains counters for DHCPv6 messages.";
       leaf solicit-received-count {
         config "false";
         type uint32;
         description "Number of Solicit (1) messages received.";
       }
       leaf advertise-sent-count {
         config "false";
         type uint32;
         description "Number of Advertise (2) messages sent.";
       }
       leaf request-received-count {
         config "false";
         type uint32;
         description "Number of Request (3) messages received.";
       }
       leaf confirm-received-count {
         config "false";
         type uint32;
         description "Number of Confirm (4) messages received.";
       }
       leaf renew-received-count {
         config "false";

Cui, et al.                Expires 7 May 2020                  [Page 32]
Internet-Draft              DHCPv6 YANG Model              November 2019

         type uint32;
         description "Number of Renew (5) messages received.";
       }
       leaf rebind-received-count {
         config "false";
         type uint32;
         description "Number of Rebind (6) messages received.";
       }
       leaf reply-sent-count {
         config "false";
         type uint32;
         description "Number of Reply (7) messages received.";
       }
       leaf release-received-count {
         config "false";
         type uint32;
         description "Number of Release (8) messages sent.";
       }
       leaf decline-received-count {
         config "false";
         type uint32;
         description "Number of Decline (9) messages sent.";
       }
       leaf reconfigure-sent-count {
         config "false";
         type uint32;
         description "Number of Reconfigure (10) messages sent.";
       }
       leaf information-request-received-count {
         config "false";
         type uint32;
         description "Number of Information-request (11) messages
           received.";
       }
       leaf unknown-message-received-count {
         config "false";
         type uint32;
         description
           "Number of messages of unknown type that have been received."
   ;
       }
       leaf unknown-message-sent-count {
         config "false";
         type uint32;
         description
           "Number of messages of unknown type that have been sent.";
       }
       leaf discarded-message-count {

Cui, et al.                Expires 7 May 2020                  [Page 33]
Internet-Draft              DHCPv6 YANG Model              November 2019

         config "false";
         type uint32;
         description
           "Number of messages that have been discarded for any reason."
   ;
       }
     }

     grouping global-statistics {
       leaf relay-forward-sent-count {
         config "false";
         type uint32;
         description "Number of Relay-forward (12) messages sent.";
       }
       leaf relay-forward-received-count {
         config "false";
         type uint32;
         description "Number of Relay-forward (12) messages received.";
       }
       leaf relay-reply-received-count {
         config "false";
         type uint32;
         description "Number of Relay-reply (13) messages received.";
       }
       leaf relay-forward-unknown-sent-count {
         config "false";
         type uint32;
         description "Number of Relay-forward (12) messages containing
           a message of unknown type sent.";
       }
       leaf relay-forward-unknown-received-count {
         config "false";
         type uint32;
         description "Number of Relay-forward (12) messages containing
           a message of unknown type received.";
       }
       leaf discarded-message-count {
         config "false";
         type uint32;
         description "Number of messages that have been discarded
           for any reason.";
       }
     }

     /*
      * Data Nodes
      */

Cui, et al.                Expires 7 May 2020                  [Page 34]
Internet-Draft              DHCPv6 YANG Model              November 2019

     container dhcpv6-relay {
       description
         "This container contains the configuration data of the relay.";
       list relay-if {
         key if-name;
         leaf if-name {
           type if:interface-ref;
         }
         leaf-list destination-addresses {
           type inet:ipv6-address;
           description "Each DHCPv6 relay agent may be configured with
             a list of destination addresses for relayed messages.
             The list may include unicast addresses, multicast addresses
             or other addresses.";
         }
         leaf link-address {
           description "An address that may be used by the server
             to identify the link on which the client is located.";
           type binary {
             length "0..16";
           }
         }
         container relay-options {
           description "Definitions for DHCPv6 options that can be sent
             by the relay are augmented to this location from other YANG
             modules as required.";
         }
         uses message-statistics;
         container prefix-delegation {
           description "Controls and holds state information for prefix
             delegation.";
           presence "Enables prefix delegation for this interface.";
           if-feature prefix-delegation;
           uses pd-lease-state;
         }
       }
       uses global-statistics;
     }

     /*
      * Notifications
      */

     notification relay-event {
       description
         "DHCPv6 relay event";
       container topology-change {
         description "Raised if the entry for and interface with DHCPv6

Cui, et al.                Expires 7 May 2020                  [Page 35]
Internet-Draft              DHCPv6 YANG Model              November 2019

           related configuration or state is removed
           from if:interface-refs.";
         leaf relay-if-name {
           description "Name of the interface that has been removed.";
           type leafref {
             path "/dhcpv6-relay/relay-if/if-name";
           }
         }
         leaf last-ipv6-addr {
           type inet:ipv6-address;
           description "Last IPv6 address configured on the interface.";
         }
       }
     }
   }

3.3.  DHCPv6 Client YANG Model

   This module imports typedefs from [RFC6991], [RFC8343].

   module ietf-dhcpv6-client {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-client";
     prefix "dhcpv6-client";

     import ietf-inet-types {
       prefix inet;
     }
     import ietf-yang-types {
       prefix yang;
     }
     import ietf-dhcpv6-common {
       prefix dhcpv6-common;
     }
     import ietf-interfaces {
       prefix if;
     }

     organization "DHC WG";
     contact
       "cuiyong@tsinghua.edu.cn
       wangh13@mails.tsinghua.edu.cn
       lh.sunlinh@gmail.com
       ian.farrer@telekom.de
       sladjana.zechlin@telekom.de
       hezihao9512@gmail.com
       godfryd@isc.org";

Cui, et al.                Expires 7 May 2020                  [Page 36]
Internet-Draft              DHCPv6 YANG Model              November 2019

     description "This is a YANG data module for the configuration
       and management of DHCPv6 clients.

       Copyright (c) 2018 IETF Trust and the persons identified as
       authors of the code.  All rights reserved.

       Redistribution and use in source and binary forms, with or
       without modification, is permitted pursuant to, and subject
       to the license terms contained in, the Simplified BSD License
       set forth in Section 4.c of the IETF Trust's Legal Provisions
       Relating to IETF Documents
       (http://trustee.ietf.org/license-info).

       This version of this YANG module is part of RFC 8513; see
       the RFC itself for full legal notices.";

     revision 2019-09-20 {
       description "";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang-10";
     }

     revision 2018-09-04 {
       description "";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     revision 2018-03-04 {
       description "Resolved most issues on the DHC official github";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     revision 2017-12-22 {
       description "Resolve most issues on Ian's Github.";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     revision 2017-11-24 {
       description "First version of the separated client specific
         YANG model.";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     identity client {
       base "dhcpv6-common:dhcpv6-node";
       description "DHCPv6 client.";
     }

     leaf dhcpv6-node-type {

Cui, et al.                Expires 7 May 2020                  [Page 37]
Internet-Draft              DHCPv6 YANG Model              November 2019

       description "Type for a DHCPv6 client";
       type identityref {
         base "dhcpv6-client:client";
       }
     }

     /*
      * Groupings
      */

     grouping message-statistics {
       description "Counters for DHCPv6 messages.";
       leaf solicit-count {
         config "false";
         type uint32;
         description "Number of Solicit (1) messages sent.";
       }
       leaf advertise-count {
         config "false";
         type uint32;
         description "Number of Advertise (2) messages received.";
       }
       leaf request-count {
         config "false";
         type uint32;
         description "Number of Request (3) messages sent.";
       }
       leaf confirm-count {
         config "false";
         type uint32;
         description "Number of Confirm (4) messages sent.";
       }
       leaf renew-count {
         config "false";
         type uint32;
         description "Number of Renew (5) messages sent.";
       }
       leaf rebind-count {
         config "false";
         type uint32;
         description "Number of Rebind (6) messages sent.";
       }
       leaf reply-count {
         config "false";
         type uint32;
         description "Number of Reply (7) messages received.";
       }

Cui, et al.                Expires 7 May 2020                  [Page 38]
Internet-Draft              DHCPv6 YANG Model              November 2019

       leaf release-count {
         type uint32;
         description "Number of Release (8) messages sent.";
       }
       leaf decline-count {
         config "false";
         type uint32;
         description "Number of Decline (9) messages sent.";
       }
       leaf reconfigure-count {
         config "false";
         type uint32;
         description "Number of Reconfigure (10) messages received.";
       }
       leaf information-request-count {
         config "false";
         type uint32;
         description "Number of Information-request (11) messages
           sent.";
       }
     }

     /*
      * Data Nodes
      */

     container dhcpv6-client {
       description "DHCPv6 client configuration and state.";
       list client-if {
         key if-name;
         description "The list of interfaces that the client will be
           requesting DHCPv6 configuration for.";
         leaf if-name {
           type if:interface-ref;
           mandatory true;
           description "Reference to the interface entry that
             the requested configuration is relevant to.";
         }
         uses dhcpv6-common:duid;
         container client-configured-options {
           description "Definitions for DHCPv6 options that can be be
             sent by the client are augmented to this location from
             other YANG modules as required.";
         }
         list ia-na {
           key iaid;
           description "Configuration relevant for an IA_NA.";
           reference "RFC8415: Dynamic Host Configuration Protocol

Cui, et al.                Expires 7 May 2020                  [Page 39]
Internet-Draft              DHCPv6 YANG Model              November 2019

             for IPv6 (DHCPv6).";
           leaf iaid {
             type uint32;
             description "The unique identifier for this IA_NA.";
           }
           container ia-na-options {
             description "An augmenation point for additional options
               that the client will send in the IA_NA-options field
               of OPTION_IA_NA options.";
           }
           container lease-state {
             config "false";
             description "Information about the active IA_NA lease.";
             leaf ia-na-address {
               description "Address that is currently leased.";
               type inet:ipv6-address;
             }
             leaf preferred-lifetime {
               description "The preferred lifetime for the leased
                 address expressed in units of seconds.";
               type dhcpv6-common:timer-value-seconds32;
             }
             leaf valid-lifetime {
               description "The valid lifetime for the leased address
                 expressed in units of seconds.";
               type dhcpv6-common:timer-value-seconds32;
             }
             leaf lease-t1 {
               description "The time interval after which the client
                 should contact the server from which the addresses
                 in the IA_NA were obtained to extend the lifetimes
                 of the addresses assigned to the IA_NA.";
               type dhcpv6-common:timer-value-seconds32;
             }
             leaf lease-t2 {
               description "The time interval after which the client
                 should contact any available server to extend
                 the lifetimes of the addresses assigned to the IA_NA.";
               type dhcpv6-common:timer-value-seconds32;
             }
             leaf allocation-time {
               description "Time and date that the address was first
                 leased.";
               type yang:date-and-time;
             }
             leaf last-renew-rebind {
               description "Time of the last successful renew or rebind
                 of the leased address.";

Cui, et al.                Expires 7 May 2020                  [Page 40]
Internet-Draft              DHCPv6 YANG Model              November 2019

               type yang:date-and-time;
             }
             leaf server-duid {
               description "DUID of the leasing server.";
               type binary;
             }
           }
         }
         list ia-ta {
           key iaid;
           description "Configuration relevant for an IA_TA.";
           reference "RFC8415: Dynamic Host Configuration Protocol for
             IPv6 (DHCPv6).";
             leaf iaid {
               type uint32;
               description "The unique identifier for this IA_TA.";
             }
           container ia-ta-options {
             description "An augmenation point for additional options
               that the client will send in the IA_TA-options field
               of OPTION_IA_TA options.";
           }
           container lease-state {
             config "false";
             description "Information about an active IA_TA lease.";
             leaf ia-ta-address {
               description "Address that is currently leased.";
               type inet:ipv6-address;
             }
             leaf preferred-lifetime {
               description "The preferred lifetime for the leased
                 address expressed in units of seconds.";
               type dhcpv6-common:timer-value-seconds32;
             }
             leaf valid-lifetime {
               description "The valid lifetime for the leased address
                 expressed in units of seconds.";
               type dhcpv6-common:timer-value-seconds32;
             }
             leaf allocation-time {
               description "Time and date that the address was first
                 leased.";
               type yang:date-and-time;
             }
             leaf last-renew-rebind {
               description "Time of the last successful renew or rebind
                 of the address.";
               type yang:date-and-time;

Cui, et al.                Expires 7 May 2020                  [Page 41]
Internet-Draft              DHCPv6 YANG Model              November 2019

             }
             leaf server-duid {
               description "DUID of the leasing server.";
               type binary;
             }
           }
         }
         list ia-pd {
           key iaid;
           reference "RFC8415: Dynamic Host Configuration Protocol for
             IPv6 (DHCPv6).";
           description "Configuration relevant for an IA_PD.";
           leaf iaid {
             type uint32;
             description "The unique identifier for this IA_PD.";
           }
           container ia-pd-options {
             description "An augmenation point for additional options
               that the client will send in the IA_PD-options field
               of OPTION_IA_TA options.";
           }
           container lease-state {
             config "false";
             description "Information about an active IA_PD delegated
               prefix.";
             leaf ia-pd-prefix {
               description "Delegated prefix that is currently leased.";
               type inet:ipv6-prefix;
             }
             leaf preferred-lifetime {
               description "The preferred lifetime for the leased prefix
                 expressed in units of seconds.";
               type dhcpv6-common:timer-value-seconds32;
             }
             leaf valid-lifetime {
               description "The valid lifetime for the leased prefix
                 expressed in units of seconds.";
               type dhcpv6-common:timer-value-seconds32;
             }
             leaf lease-t1 {
               description "The time interval after which the client
                 should contact the server from which the addresses
                 in the IA_NA were obtained to extend the lifetimes
                 of the addresses assigned to the IA_PD.";
               type dhcpv6-common:timer-value-seconds32;
             }
             leaf lease-t2 {
               description "The time interval after which the client

Cui, et al.                Expires 7 May 2020                  [Page 42]
Internet-Draft              DHCPv6 YANG Model              November 2019

                 should contact any available server to extend
                 the lifetimes of the addresses assigned to the IA_PD.";
               type dhcpv6-common:timer-value-seconds32;
             }
             leaf allocation-time {
               description "Time and date that the prefix was first
                 leased.";
               type yang:date-and-time;
             }
             leaf last-renew-rebind {
               description "Time of the last successful renew or rebind
                 of the delegated prefix.";
               type yang:date-and-time;
             }
             leaf server-duid {
               description "DUID of the delegating server.";
               type binary;
             }
           }
         }
         uses message-statistics;
       }
     }

     /*
      * Notifications
      */

     notification invalid-ia-detected {
       description "Notification sent when the identity association
         of the client can be proved to be invalid. Possible conditions
         include a duplicate or otherwise illegal address.";
       leaf iaid {
         type uint32;
         mandatory true;
         description "IAID";
       }
       leaf description {
         type string;
         description "Description of the event.";
       }
     }

     notification retransmission-failed {
       description "Notification sent when the retransmission mechanism
         defined in [RFC8415] is unsucessful.";
       leaf failure-type {
         type enumeration {

Cui, et al.                Expires 7 May 2020                  [Page 43]
Internet-Draft              DHCPv6 YANG Model              November 2019

           enum "MRC-exceeded" {
             description "Maximum retransmission count exceeded.";
           }
           enum "MRD-exceeded" {
             description "Maximum retransmission duration exceeded.";
           }
         }
         mandatory true;
         description "Description of the failure.";
       }
     }

     notification unsuccessful-status-code {
       description "Notification sent when the client receives a message
         that includes an unsuccessful Status Code option.";
       leaf status-code {
         type uint16;
         mandatory true;
         description "Unsuccessful status code recevied by a client.";
       }
       leaf server-duid {
         description "DUID of the server sending the unsuccessful
           error code.";
         mandatory true;
         type binary;
       }
     }

     notification server-duid-changed {
       description "Notification sent when the client receives a lease
         from a server with different DUID to the one currently stored
         by the client.";
       leaf new-server-duid {
         description "DUID of the new server.";
         mandatory true;
         type binary;
       }
       leaf previous-server-duid {
         description "DUID of the previous server.";
         mandatory true;
         type binary;
       }
       leaf lease-ia-na {
         description "Reference to the IA_NA lease.";
         type leafref {
           path "/dhcpv6-client/client-if/ia-na/iaid";
         }
       }

Cui, et al.                Expires 7 May 2020                  [Page 44]
Internet-Draft              DHCPv6 YANG Model              November 2019

       leaf lease-ia-ta {
         description "Reference to the IA_TA lease.";
         type leafref {
           path "/dhcpv6-client/client-if/ia-ta/iaid";
         }
       }
       leaf lease-ia-pd {
         description "Reference to the IA_PD lease.";
         type leafref {
           path "/dhcpv6-client/client-if/ia-pd/iaid";
         }
       }
     }
   }

3.4.  DHCPv6 RFC8415 Options YANG Model

   This module imports typedefs from [RFC6991].

   module ietf-dhcpv6-options-rfc8415 {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-options-8415";
     prefix "rfc8415";

     import ietf-inet-types {
       prefix inet;
     }

     import ietf-dhcpv6-common {
       prefix dhcpv6-common;
     }

     import ietf-dhcpv6-server {
       prefix dhcpv6-server;
     }

     import ietf-dhcpv6-relay {
       prefix dhcpv6-relay;
     }

     import ietf-dhcpv6-client {
       prefix dhcpv6-client;
     }

     organization "DHC WG";
     contact
       "cuiyong@tsinghua.edu.cn
       wangh13@mails.tsinghua.edu.cn

Cui, et al.                Expires 7 May 2020                  [Page 45]
Internet-Draft              DHCPv6 YANG Model              November 2019

       lh.sunlinh@gmail.com
       ian.farrer@telekom.de
       sladjana.zechlin@telekom.de
       hezihao9512@gmail.com";

     description "This YANG module contains DHCPv6 options defined
       in RFC8415 that can be used by DHCPv6 clients, relays
       and servers.";

     revision 2019-06-07 {
       description "Major reworking to only contain RFC8415 options.
         if-feature for each option removed. Removed groupings
         of features by device or combination of devices. Added ";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     revision 2018-09-04 {
       description "";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     revision 2018-03-04 {
       description "Resolved most issues on the DHC official
         github";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     revision 2017-12-22 {
       description "Resolve most issues on Ian's github.";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     revision 2017-11-24 {
       description "First version of the separated DHCPv6 options
         YANG model.";
       reference "I-D:draft-ietf-dhc-dhcpv6-yang";
     }

     /*
      * Features

     /*
      * Groupings
      */
     grouping option-iaaddr-option {
       description "OPTION_IAADDR (5) IA Address Option.";
       reference "RFC8415: Dynamic Host Configuration Protocol for IPv6
         (DHCPv6)";

Cui, et al.                Expires 7 May 2020                  [Page 46]
Internet-Draft              DHCPv6 YANG Model              November 2019

       leaf IPv6-address {
         type inet:ipv6-address;
         description "An IPv6 address.  A client MUST NOT form
           an iplicit prefix with a length other than 128
           for this address.";
       }
       leaf preferred-lifetime {
         type uint32;
         description "The preferred lifetime for the address
           in the option, expressed in units of seconds.";
       }
       leaf valid-lifetime {
         type uint32;
         description "The preferred lifetime for the address
           in the option, expressed in units of seconds.";
       }
       container iaaddr-options {
         description "Definitions for DHCPv6 options that can be be sent
           by the client are augmented to this location from other YANG
           modules as required.";
       }
     }

     grouping option-request-option-group {
       container option-request-option {
         description "OPTION_ORO (6) Option Request Option. A client
           MUST include an Option Request option in a Solicit, Request,
           Renew, Rebind, or Information-request message to inform
           the server about options the client wants the server to send
           to the client.";
         reference "RFC8415: Dynamic Host Configuration Protocol for
           IPv6 (DHCPv6)";
         leaf-list oro-option {
           description "List of options that the client is requesting,
             identified by option code";
           type uint16 {
             range "17 | 21..24 | 27..36 | 39..42 | 49..52 | 54..60 |
               62..65 | 69..78";
           }
         }
       }
     }

     grouping preference-option-group {
       container preference-option {
         description "OPTION_PREFERENCE (7) Preference Option";
         reference "RFC8415: Dynamic Host Configuration Protocol for
           IPv6 (DHCPv6)";

Cui, et al.                Expires 7 May 2020                  [Page 47]
Internet-Draft              DHCPv6 YANG Model              November 2019

         leaf pref-value {
           type uint8;
           description "The preference value for the server
             in this message. A 1-octet unsigned integer.";
         }
       }
     }

     grouping auth-option-group {
       container auth-option {
         description "OPTION_AUTH (11) Authentication Option";
         reference "RFC8415: Dynamic Host Configuration Protocol
           for IPv6 (DHCPv6)";
         leaf protocol {
           type uint8;
           description "The authentication protocol used
             in this Authentication option.";
         }
         leaf algorithm {
           type uint8;
           description "The algorithm used in the authentication
             protocol.";
         }
         leaf rdm {
           type uint8;
           description "The replay detection method used
             in this Authentication option.";
         }
         leaf replay-detection {
           type uint64;
           description "The replay detection information for the RDM.";
         }
         leaf auth-information {
           type string;
           description "The authentication information, as specified
             by the protocol and algorithm used in this Authentication
             option.";
         }
       }
     }

     grouping server-unicast-option-group {
       container server-unicast-option {
         description "OPTION_UNICAST (12) Server Unicast Option";
         reference "RFC8415: Dynamic Host Configuration Protocol for
           IPv6 (DHCPv6)";
         leaf server-address {
           type inet:ipv6-address;

Cui, et al.                Expires 7 May 2020                  [Page 48]
Internet-Draft              DHCPv6 YANG Model              November 2019

           description "The 128-bit address to which the client
             should send messages delivered using unicast.";
         }
       }
     }

     grouping status-code-option-group {
       container status-code-option {
         description "OPTION_STATUS_CODE (13) Status Code Option.";
         reference "RFC8415: Dynamic Host Configuration Protocol
           for IPv6 (DHCPv6)";
         leaf status-code {
           type uint16;
           description "The numeric code for the status encoded
             in this option. See the Status Codes registry at
             <https://www.iana.org/assignments/dhcpv6-parameters>
             for the current list of status codes.";
         }
         leaf status-message {
           type string;
           description "A UTF-8 encoded text string suitable
             for display to an end user. MUST NOT be null-terminated.";
         }
       }
     }

     grouping rapid-commit-option-group {
       container rapid-commit-option {
         presence "Enable sending of this option";
         description "OPTION_RAPID_COMMIT (14) Rapid Commit Option.
           The presence node is used to enable the option.";
         reference "RFC8415: Dynamic Host Configuration Protocol for
           IPv6 (DHCPv6)";
       }
     }

     grouping user-class-option-group {
       container user-class-option {
         description "OPTION_USER_CLASS (15) User Class Option";
         reference "RFC8415: Dynamic Host Configuration Protocol
           for IPv6 (DHCPv6)";
         list user-class-data {
           key user-class-datum-id;
           min-elements 1;
           description "The user classes of which the client
             is a member.";
           leaf user-class-datum-id {
             type uint8;

Cui, et al.                Expires 7 May 2020                  [Page 49]
Internet-Draft              DHCPv6 YANG Model              November 2019

             description "User class datum ID";
           }
           leaf user-class-datum {
             type string;
             description "Opaque field representing a User Class
               of which the client is a member.";
           }
         }
       }
     }

     grouping vendor-class-option-group {
       container vendor-class-option {
         description "OPTION_VENDOR_CLASS (16) Vendor Class Option";
         reference "RFC8415: Dynamic Host Configuration Protocol
           for IPv6 (DHCPv6)";
         list vendor-class-option-instances {
           key enterprise-number;
           description "The vendor class option allows for multiple
             instances in a single message. Each list entry defines
             the contents of an instance of the option.";
           leaf enterprise-number {
             type uint32;
             description "The vendor's registered Enterprise Number
               as maintained by IANA.";
           }
           list vendor-class {
             key vendor-class-datum-id;
             description "The vendor classes of which the client
               is a member.";
             leaf vendor-class-datum-id {
               type uint8;
               description "Vendor class datum ID";
             }
             leaf vendor-class-datum {
               type string;
               description "Opaque field representing a vendor class
                 of which the client is a member.";
             }
           }
         }
       }
     }

     grouping vendor-specific-information-option-group {
       container vendor-specific-information-option {
         description "OPTION_VENDOR_OPTS (17) Vendor-specific
           Information Option";

Cui, et al.                Expires 7 May 2020                  [Page 50]
Internet-Draft              DHCPv6 YANG Model              November 2019

         reference "RFC8415: Dynamic Host Configuration Protocol
           for IPv6 (DHCPv6)";
         list vendor-specific-information-option-instances {
           key enterprise-number;
           description "The vendor specific information option allows
             for multiple instances in a single message. Each list entry
             defines the contents of an instance of the option.";
           leaf enterprise-number {
             type uint32;
             description "The vendor's registered Enterprise Number,
               as maintained by IANA.";
           }
           list vendor-option-data {
             key sub-option-code;
             description "Vendor options, interpreted by vendor-specific
               client/server functions.";
             leaf sub-option-code {
               type uint16;
               description "The code for the sub-option.";
             }
             leaf sub-option-data {
               type string;
               description "The data area for the sub-option.";
             }
           }
         }
       }
     }

     grouping interface-id-option-group {
       container interface-id-option {
         description "OPTION_INTERFACE_ID (18) Interface-Id Option";
         reference "RFC8415: Dynamic Host Configuration Protocol for
           IPv6 (DHCPv6)";
         leaf interface-id {
           type string;
           description "An opaque value of arbitrary length generated
             by the relay agent to identify one of the relay agent's
             interfaces.";
         }
       }
     }

     grouping reconfigure-message-option-group {
       container reconfigure-message-option {
         description "OPTION_RECONF_MSG (19) Reconfigure Message
           Option.";
         reference "RFC8415: Dynamic Host Configuration Protocol

Cui, et al.                Expires 7 May 2020                  [Page 51]
Internet-Draft              DHCPv6 YANG Model              November 2019

           for IPv6 (DHCPv6)";
         leaf msg-type {
           type uint8;
           description "5 for Renew message, 6 for Rebind message,
             11 for Information-request message.";
         }
       }
     }

     grouping reconfigure-accept-option-group {
       container reconfigure-accept-option {
         presence "Enable sending of this option";
         description "OPTION_RECONF_ACCEPT (20)  Rapid Commit Option.
           A client uses the Reconfigure Accept option to announce
           to the server whether the client is willing to accept
           Reconfigure messages, and a server uses this option to tell
           the client whether or not to accept Reconfigure messages.
           In the absence of this option, the default behavior is that
           the client is unwilling to accept Reconfigure messages.
           The presence node is used to enable the option.";
         reference "RFC8415: Dynamic Host Configuration Protocol
           for IPv6 (DHCPv6)";
       }
     }

     grouping option-iaprefix-option {
       description "OPTION_IAPREFIX (26) IA Address Option.";
       reference "RFC8415: Dynamic Host Configuration Protocol for IPv6
         (DHCPv6)";
       leaf preferred-lifetime {
         type uint32;
         description "The preferred lifetime for the prefix
           in the option, expressed in units of seconds.";
       }
       leaf valid-lifetime {
         type uint32;
         description "The preferred lifetime for the prefix
           in the option, expressed in units of seconds.";
       }
       leaf IPv6-prefix {
         type inet:ipv6-prefix;
         description "The IPv6 prefix delegated to the client.";
       }
       container iaprefix-options {
         description "Definitions for DHCPv6 options that can be
           sent by the client are augmented to this location from other
           YANG modules as required.";
       }

Cui, et al.                Expires 7 May 2020                  [Page 52]
Internet-Draft              DHCPv6 YANG Model              November 2019

     }

     grouping info-refresh-time-option-group {
       container info-refresh-time-option {
         description "OPTION_INFORMATION_REFRESH_TIME (32)
           Information Refresh Time option.";
         reference "RFC8415: Dynamic Host Configuration Protocol for
           IPv6 (DHCPv6)";
         leaf info-refresh-time {
           type dhcpv6-common:timer-value-seconds32;
           description "Time duration relative to the current time,
             expressed in units of seconds.";
         }
       }
     }

     grouping sol-max-rt-option-group {
       container sol-max-rt-option {
         description "OPTION_SOL_MAX_RT (82) sol max rt option";
         reference "RFC8415: Dynamic Host Configuration Protocol for
           IPv6 (DHCPv6)";
         leaf sol-max-rt-value {
           type dhcpv6-common:timer-value-seconds32;
           description "sol max rt value";
         }
       }
     }

     grouping inf-max-rt-option-group {
       container inf-max-rt-option {
         description "OPTION_INF_MAX_RT (83) inf max rt option";
         reference "RFC8415: Dynamic Host Configuration Protocol for
           IPv6 (DHCPv6)";
         leaf inf-max-rt-value {
           type dhcpv6-common:timer-value-seconds32;
           description "inf max rt value";
         }
       }
     }

     augment "/dhcpv6-server:dhcpv6-server/dhcpv6-server:option-sets/dhc
   pv6-server:option-set" {
       when "../../../dhcpv6-server:dhcpv6-node-type='dhcpv6-server:serv
   er'";
       uses preference-option-group;
       uses auth-option-group;
       uses server-unicast-option-group;
       uses status-code-option-group;

Cui, et al.                Expires 7 May 2020                  [Page 53]
Internet-Draft              DHCPv6 YANG Model              November 2019

       uses rapid-commit-option-group;
       uses vendor-specific-information-option-group;
       uses reconfigure-message-option-group;
       uses reconfigure-accept-option-group;
       uses info-refresh-time-option-group;
       uses sol-max-rt-option-group;
       uses inf-max-rt-option-group;
     }
     augment "/dhcpv6-relay:dhcpv6-relay/dhcpv6-relay:relay-if/dhcpv6-re
   lay:relay-options" {
       when "../../../dhcpv6-relay:dhcpv6-node-type='dhcpv6-relay:relay'
   ";
       uses auth-option-group;
       uses status-code-option-group;
       uses interface-id-option-group;
     }
     augment "/dhcpv6-client:dhcpv6-client/dhcpv6-client:client-if/dhcpv
   6-client:client-configured-options" {
       when "../../../dhcpv6-client:dhcpv6-node-type='dhcpv6-client:clie
   nt'";
       uses option-request-option-group;
       uses status-code-option-group;
       uses rapid-commit-option-group;
       uses user-class-option-group;
       uses vendor-class-option-group;
       uses vendor-specific-information-option-group;
       uses reconfigure-accept-option-group;
     }
   }

3.5.  DHCPv6 Common YANG Model

   This module imports typedefs from [RFC6991].

   module ietf-dhcpv6-common {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-common";
     prefix "dhcpv6-common";

     import ietf-inet-types {
       prefix inet;
     }
     import ietf-yang-types {
       prefix yang;
     }

     organization "DHC WG";
     contact

Cui, et al.                Expires 7 May 2020                  [Page 54]
Internet-Draft              DHCPv6 YANG Model              November 2019

       "yong@csnet1.cs.tsinghua.edu.cn
       lh.sunlinh@gmail.com
       ian.farrer@telekom.de
       sladjana.zechlin@telekom.de
       hezihao9512@gmail.com";

     description "This model defines a YANG data model that can be
       used to define some commonly used DHCPv6 types";

     revision 2018-09-04 {
       description "";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     revision 2018-01-30 {
       description "Initial revision";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     typedef threshold {
       type union {
         type uint16 {
           range 0..100;
         }
         type enumeration {
           enum "disabled" {
             description "No threshold";
           }
         }
       }
       description "Threshold value in percent";
     }

     typedef timer-value-seconds32 {
       type uint32 {
         range "1..4294967295";
       }
       units "seconds";
       description
         "Timer value type, in seconds (32-bit range).";
     }

     identity dhcpv6-node {
       description "Abstract base type for DHCPv6 functional nodes";
     }

     /*
      * Grouping

Cui, et al.                Expires 7 May 2020                  [Page 55]
Internet-Draft              DHCPv6 YANG Model              November 2019

      */

     grouping duid {
       description "Each server and client has only one DUID (DHCP
         Unique Identifier). The DUID here identifies a unique DHCPv6
         server for clients. DUID consists of a two-octet type field
         and an arbitrary length (no more than 128 bytes) content field.
         Currently there are four defined types of DUIDs in RFC3315
         and RFC6355 - DUID-LLT, DUID-EN, DUID-LL and DUID-UUID.
         DUID-Uknown represents those unconventional DUIDs.";
       reference "RFC3315: Section 9 and RFC6355: Section 4";
       leaf type-code {
         type uint16;
         default 65535;
         description "Type code of this DUID";
       }
       choice duid-type {
         default duid-unknown;
         description "Selects the format for the DUID.";
         case duid-llt {
           description "DUID Based on Link-layer Address Plus Time
             (Type 1 - DUID-LLT)";
           reference "RFC3315 Section 9.2";
           leaf duid-llt-hardware-type {
             type uint16;
             description "Hardware type as assigned by IANA (RFC826).";
           }
           leaf duid-llt-time {
             type yang:timeticks;
             description "The time value is the time that the DUID is
               generated represented in seconds since midnight (UTC),
               January 1, 2000, modulo 2^32.";
           }
           leaf duid-llt-link-layer-address {
             type yang:mac-address;
             description "Link-layer address as described in RFC2464";
           }
         }
         case duid-en {
           description "DUID Assigned by Vendor Based on Enterprise
             Number (Type 2 - DUID-EN)";
           reference "RFC3315 Section 9.3";
           leaf duid-en-enterprise-number {
             type uint32;
             description "Vendor's registered Private Enterprise Number
               as maintained by IANA";
           }
           leaf duid-en-identifier {

Cui, et al.                Expires 7 May 2020                  [Page 56]
Internet-Draft              DHCPv6 YANG Model              November 2019

             type string;
             description "Indentifier, unique to the device that is
               using it";
           }
         }
         case duid-ll {
           description "DUID Based on Link-layer Address
             (Type 3 - DUID-LL)";
           reference "RFC3315 Section 9.4";
           leaf duid-ll-hardware-type {
             type uint16;
             description "Hardware type as assigned by IANA (RFC826).";
           }
           leaf duid-ll-link-layer-address {
             type yang:mac-address;
             description "Link-layer address as described in RFC2464";
           }
         }
         case duid-uuid {
           description "DUID Based on Universally Unique Identifier
             (Type 4 - DUID-UUID)";
           reference "RFC6335 Defination of the UUID-Based Unique
             Identifier";
           leaf uuid {
             type yang:uuid;
             description "A Universally Unique IDentifier in the string
               representation defined in RFC 4122. The canonical
               representation uses lowercase characters";
           }
         }
         case duid-unknown {
           description "DUID based on free raw bytes";
           leaf data {
             type binary;
             description "The bits to be used as the identifier";
           }
         }
       }
       leaf active-duid {
         config "false";
         description "The DUID which is currently in use";
         type binary;
       }
     }

     // TODO: is it used anywhere? if not should it be removed?
     grouping portset-parameters {
       description "portset parameters";

Cui, et al.                Expires 7 May 2020                  [Page 57]
Internet-Draft              DHCPv6 YANG Model              November 2019

       container port-parameter {
         description "port parameter";
         leaf offset {
           type uint8;
           mandatory true;
           description "offset in a port set";
         }
         leaf psid-len {
           type uint8;
           mandatory true;
           description "length of a psid";
         }
         leaf psid {
           type uint16;
           mandatory true;
           description "psid value";
         }
       }
     }
   }

4.  Security Considerations (TBD)

   TBD

5.  IANA Considerations (TBD)

   This document registers the following YANG modules in the "YANG
   Module Names" registry [RFC6020].

   name:           ietf-dhcpv6
   namespace:      urn:ietf:params:xml:ns:yang:ietf-dhcpv6-common
   prefix:         dhcpv6
   reference:      TBD

   name:           ietf-dhcpv6
   namespace:      urn:ietf:params:xml:ns:yang:ietf-dhcpv6-server
   prefix:         dhcpv6
   reference:      TBD

   name:           ietf-dhcpv6
   namespace:      urn:ietf:params:xml:ns:yang:ietf-dhcpv6-client
   prefix:         dhcpv6
   reference:      TBD

   name:           ietf-dhcpv6
   namespace:      urn:ietf:params:xml:ns:yang:ietf-dhcpv6-relay
   prefix:         dhcpv6

Cui, et al.                Expires 7 May 2020                  [Page 58]
Internet-Draft              DHCPv6 YANG Model              November 2019

   reference:      TBD

   name:           ietf-dhcpv6
   namespace:    
                   urn:ietf:params:xml:ns:yang:ietf-dhcpv6-options-
                   rfc8415
   prefix:         dhcpv6
   reference:      TBD

6.  Acknowledgments

   The authors would like to thank Qi Sun, Lishan Li, Sladjana Zoric,
   Tomek Mrugalski, Marcin Siodelski, Bernie Volz and Bing Liu for their
   valuable comments and contributions to this work.

7.  Contributors

   The following individuals contributed to this effort:
     Hao Wang
     Tsinghua University
     Beijing 100084
     P.R.China
     Phone: +86-10-6278-5822
     Email: wangh13@mails.tsinghua.edu.cn

     Ted Lemon
     Nomium, Inc
     950 Charter St.
     Redwood City, CA 94043
     USA
     Email: Ted.Lemon@nomium.com

     Bernie Volz
     Cisco Systems, Inc.
     1414 Massachusetts Ave
     Boxborough, MA 01719
     USA
     Email: volz@cisco.com

8.  References

8.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

Cui, et al.                Expires 7 May 2020                  [Page 59]
Internet-Draft              DHCPv6 YANG Model              November 2019

   [RFC6355]  Narten, T. and J. Johnson, "Definition of the UUID-Based
              DHCPv6 Unique Identifier (DUID-UUID)", RFC 6355,
              DOI 10.17487/RFC6355, August 2011,
              <https://www.rfc-editor.org/info/rfc6355>.

   [RFC6020]  Bjorklund, M., Ed., "YANG - A Data Modeling Language for
              the Network Configuration Protocol (NETCONF)", RFC 6020,
              DOI 10.17487/RFC6020, October 2010,
              <https://www.rfc-editor.org/info/rfc6020>.

   [RFC6991]  Schoenwaelder, J., Ed., "Common YANG Data Types",
              RFC 6991, DOI 10.17487/RFC6991, July 2013,
              <https://www.rfc-editor.org/info/rfc6991>.

   [RFC7950]  Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language",
              RFC 7950, DOI 10.17487/RFC7950, August 2016,
              <https://www.rfc-editor.org/info/rfc7950>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8340]  Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams",
              BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018,
              <https://www.rfc-editor.org/info/rfc8340>.

   [RFC8342]  Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K.,
              and R. Wilton, "Network Management Datastore Architecture
              (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018,
              <https://www.rfc-editor.org/info/rfc8342>.

   [RFC8343]  Bjorklund, M., "A YANG Data Model for Interface
              Management", RFC 8343, DOI 10.17487/RFC8343, March 2018,
              <https://www.rfc-editor.org/info/rfc8343>.

   [RFC8415]  Mrugalski, T., Siodelski, M., Volz, B., Yourtchenko, A.,
              Richardson, M., Jiang, S., Lemon, T., and T. Winters,
              "Dynamic Host Configuration Protocol for IPv6 (DHCPv6)",
              RFC 8415, DOI 10.17487/RFC8415, November 2018,
              <https://www.rfc-editor.org/info/rfc8415>.

8.2.  Informative References

   [RFC3319]  Schulzrinne, H. and B. Volz, "Dynamic Host Configuration
              Protocol (DHCPv6) Options for Session Initiation Protocol
              (SIP) Servers", RFC 3319, DOI 10.17487/RFC3319, July 2003,
              <https://www.rfc-editor.org/info/rfc3319>.

Cui, et al.                Expires 7 May 2020                  [Page 60]
Internet-Draft              DHCPv6 YANG Model              November 2019

Appendix A.  Example of Adding New DHCPv6 Option Definitions

   The following section provides a example of how the DHCPv6 option
   definitions can be extended for additional option.  It is expected
   that additional specficication documents will be published in the
   future for this.

   The example YANG models OPTION_SIP_SERVER_D (21) and
   OPTION_SIP_SERVER_D (21) defined in [RFC3319].  The overall structure
   is as follows:

   *  A separate grouping is used for each option.

   *  The name of the option is taken from the registered IANA name for
      the option, with an '-option' suffix added.

   *  The description field is taken from the relevant option code name
      and number.

   *  The reference section is the number and name of the RFC in which
      the DHCPv6 option is defined.

   *  The remaining fields match the fields in the DHCP option.  They
      are in the same order as defined in the DHCP option.  Whereever
      possilbe, the format that is defined for the DHCP field should be
      matched by the relevant YANG type.

   *  Fields which can have multiple entries or instances are defined
      using list or leaf-list nodes.

   Below the groupings for option definitions, augment statements are
   used to add the option definitions for use in the relevant DHCP
   element's module (server, relay and/or client).  If an option is
   relevant to more than one element type, then an augment statement for
   each element is used.

   module example-dhcpv6-options-rfc3319 {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:example-dhcpv6-options-rfc33
   19";
     prefix "rfc3319";

     import ietf-inet-types {
       prefix inet;
     }

     import ietf-dhcpv6-server {
       prefix dhcpv6-server;

Cui, et al.                Expires 7 May 2020                  [Page 61]
Internet-Draft              DHCPv6 YANG Model              November 2019

     }

     organization "DHC WG";
     contact
       "ian.farrer@telekom.de
       godfryd@isc.org";

     description "This YANG module contains DHCPv6 options defined
       in RFC3319 that can be used by DHCPv6 servers.";

     revision 2019-10-18 {
       description "Initial version.";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     /*
      * Groupings
      */
     grouping sip-server-domain-name-list-option-group {
       container sip-server-domain-name-list-option {
         description "OPTION_SIP_SERVER_D (21) SIP Servers Domain Name
           List";
         reference "RFC3319: Dynamic Host Configuration Protocol
           (DHCPv6) Options for Session Initiation Protocol (SIP)
           Servers";
         leaf sip-serv-domain-name {
           type inet:domain-name;
           description "sip server domain name";
         }
       }
     }

     grouping sip-server-address-list-option-group {
       container sip-server-address-list-option {
         description "OPTION_SIP_SERVER_A (22) SIP Servers IPv6 Address
           List";
         reference "RFC3319: Dynamic Host Configuration Protocol
           (DHCPv6) Options for Session Initiation Protocol (SIP)
           Servers";
         list sip-server {
           key sip-serv-id;
           description "sip server info";
           leaf sip-serv-id {
             type uint8;
             description "sip server id";
           }
           leaf sip-serv-addr {
             type inet:ipv6-address;

Cui, et al.                Expires 7 May 2020                  [Page 62]
Internet-Draft              DHCPv6 YANG Model              November 2019

             description "sip server addr";
           }
         }
       }
     }

     augment "/dhcpv6-server:dhcpv6-server/dhcpv6-server:option-sets/dhc
   pv6-server:option-set" {
       when "../../../dhcpv6-server:dhcpv6-node-type='dhcpv6-server:serv
   er'";
       uses sip-server-domain-name-list-option-group;
       uses sip-server-address-list-option-group;
     }
   }

Appendix B.  Example Vendor Specific Server Configuration Module

   This section shows how to extend the server YANG module defined in
   this document for vendor specific configuration nodes, e.g.,
   configuring a database for storing leases.

   The example module defines additional server attributes such as name
   and description.  Storage for leases is configured using a lease-
   storage container.  It allows storing leases in one of three options:
   memory (memfile), MySQL and PosgreSQL.  For each case, the necessary
   configuration parameters are provided.

   At the end there is an augment statment which adds the vendor
   specific configuration defined in "dhcpv6-server-config:config" under
   "/dhcpv6-server:config/dhcpv6-server:vendor-config" mountpoint.

   module example-dhcpv6-server-config {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:example-dhcpv6-server-config
   ";
     prefix "dhcpv6-server-config";

     import ietf-inet-types {
       prefix inet;
     }
     import ietf-yang-types {
       prefix yang;
     }
     import ietf-interfaces {
       prefix if;
     }
     import ietf-dhcpv6-common {
       prefix dhcpv6-common;

Cui, et al.                Expires 7 May 2020                  [Page 63]
Internet-Draft              DHCPv6 YANG Model              November 2019

     }
     import ietf-dhcpv6-server {
       prefix dhcpv6-server;
     }

     organization "DHC WG";
     contact
       "cuiyong@tsinghua.edu.cn
       lh.sunlinh@gmail.com
       ian.farrer@telekom.de
       sladjana.zechlin@telekom.de
       hezihao9512@gmail.com";

     description "This model defines a YANG data model that can be
       used to configure and manage a DHCPv6 server.";

     revision 2019-06-04 {
       description "";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     /*
      * Configuration data
      */
     grouping config {
       description "Parameters necessary for the configuration
         of a DHCPv6 server";
       container serv-attributes {
         description
           "This container contains basic attributes of a DHCPv6 server
           such as IPv6 address, server name  and so on. Some optional
           functions that can be provided  by the server is also
           included.";
         container duid {
           description "Sets the DUID of server";
           uses dhcpv6-common:duid;
         }
         leaf name {
           type string;
           description "Name of the DHCpv6 server";
         }
         leaf description {
           type string;
           description "Description of the DHCPv6 server";
         }
         leaf-list ipv6-address {
           type inet:ipv6-address;
           description "List of IPv6 address(es) the server will ";

Cui, et al.                Expires 7 May 2020                  [Page 64]
Internet-Draft              DHCPv6 YANG Model              November 2019

         }
         leaf-list interfaces-config {
           // Note - this should probably be references to
           // entries in the ietf-interfaces model
           type if:interface-ref;
           description "A leaf list to denote which one or more
             interfaces the server should listen on. The default value
             is to listen on all the interfaces. This node is also used
             to set a unicast address for the server to listen with
             a specific interface. For example, if people want
             the server to listen on a unicast address with a specific
             interface, he can use the format like 'eth1/2001:db8::1'.";
         }
         container lease-storage {
           description "Indicates how the server stores the lease";
           choice storage-type {
             description "the type of lease storage";
             // leaf persist {
             //            type boolean;
             //            mandatory true;
             //            description "controls whether the new leases
   and updates to existing leases are
             //            written to the file";
             // }
             case memfile {
               description "Configuration for storing leases information
                 in a CSV file.";

               leaf memfile-name {
                 type string;
                 description "Specifies an absolute location
                   of the lease file in which new leases and lease
                   updates are recorded.";
               }

               leaf memfile-lfc-interval {
                 type uint64;
                 description "Specifies the interval in seconds,
                   at which the server will perform a lease file cleanup
                   (LFC).";
               }
             }
             case mysql {
               leaf mysql-name {
                 type string;
                 description "Name of the database.";
               }
               leaf mysql-host {

Cui, et al.                Expires 7 May 2020                  [Page 65]
Internet-Draft              DHCPv6 YANG Model              November 2019

                 type string;
                 description "If the database is located on a different
                   system to the DHCPv6 server, the database host name
                   must also be specified.";
               }
               leaf mysql-user {
                 type string;
                 description "User name of the account under which
                   the server will access the database.";
               }
               leaf mysql-password {
                 type string;
                 description "Password of the account under which
                   the server will access the database";
               }
               leaf mysql-port {
                 type uint8;
                 description "If the database is located on a different
                   system, the port number may be specified";
               }
               leaf mysql-lfc-interval {
                 type uint64;
                 description "Specifies the interval in seconds,
                   at which the server will perform a lease file cleanup
                   (LFC)";
               }
               leaf mysql-connect-timeout {
                 type uint64;
                 description "If the database is located on a different
                   system, a longer interval can be specified";
               }
             }
             case postgresql {
               leaf postgresql-name {
                 type string;
                 description "Name of the database.";
               }
               leaf postgresql-host {
                 type string;
                 description "If the database is located on a different
                   system to the DHCPv6 server, the database host name
                   must also be specified.";
               }
               leaf postgresql-user {
                 type string;
                 description "User name of the account under which
                   the server will access the database";
               }

Cui, et al.                Expires 7 May 2020                  [Page 66]
Internet-Draft              DHCPv6 YANG Model              November 2019

               leaf postgresql-password {
                 type string;
                 description "Password of the account under which
                   the server will access the database";
               }
               leaf postgresql-port {
                 type uint8;
                 description "If the database is located on a different
                   system, the port number may be specified";
               }
               leaf postgresql-lfc-interval {
                 type uint64;
                 description "Specifies the interval in seconds,
                   at which the server will perform a lease file cleanup
                   (LFC)";
               }
               leaf postgresql-connect-timeout {
                 type uint64;
                 description "If the database is located on a different
                   system, a longer interval can be specified";
               }
             }
             case cassandra {
               leaf cassandra-name {
                 type string;
                 description "Name of the database";
               }
               leaf cassandra-contact-points {
                 type string;
                 description "Cassandra takes a list of comma separated
                   IP addresses to contact the cluster";
               }
               leaf cassandra-user {
                 type string;
                 description "User name of the account under which
                   the server will access the database";
               }
               leaf cassandra-password {
                 type string;
                 description "Password of the account under which
                   the server will access the database";
               }
               leaf cassandra-lfc-interval {
                 type uint64;
                 description "Specifies the interval in seconds,
                   at which the server will perform a lease file cleanup
                   (LFC)";
               }

Cui, et al.                Expires 7 May 2020                  [Page 67]
Internet-Draft              DHCPv6 YANG Model              November 2019

               leaf cassandra-connect-timeout {
                 type uint64;
                 description "If the database is located on a different
                   system, a longer interval can be specified";
               }
             }
           }
         }
         uses dhcpv6-common:vendor-infor;
       }

     }

     augment "/dhcpv6-server:config/dhcpv6-server:vendor-config" {
       uses dhcpv6-server-config:config;
     }
   }

Appendix C.  Example definition of class selector configuration

   The module "example-dhcpv6-class-selector" provides an example of how
   vendor specific class selector configuration can be modeled and
   integrated with the ietf-dhcpv6-server module defined in this
   document.

   The example module defines "client-class-names" with associated
   matching rules.  A client can be classified based on "client id",
   "interface-id" (ingress inteface of the client's messages), packets
   source or destination address, relay link address, relay link
   interface-id and more.  Actually there is endless methods for
   classifying clients.  So this standard does not try to provide full
   specificiation for class selection, it only shows an example how it
   can be defined.

   At the end of the example augment statements are used to add the
   defind class selector rules into the overall DHCPv6 addressing
   heirarchy.  This is done in two main parts:

   *  The augmented class-selector configuration in the main DHCPv6
      Server configuration.

   *  client-class leafrefs augmented to "network-range", "address-pool"
      and "pd-pool", pointing to the "client-class-name" that is
      required.

   The mechanism is as follows: class is associated to client based on
   rules and then client is allowed to get address(es)/prefix(es) from
   given network-range/pool if the class name matches.

Cui, et al.                Expires 7 May 2020                  [Page 68]
Internet-Draft              DHCPv6 YANG Model              November 2019

   module example-dhcpv6-class-selector {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:example-dhcpv6-class-selecto
   r";
     prefix "dhcpv6-class-selector";

     import ietf-inet-types {
       prefix inet;
     }
     import ietf-interfaces {
       prefix if;
     }
     import ietf-dhcpv6-common {
       prefix dhcpv6-common;
     }
     import ietf-dhcpv6-server {
       prefix dhcpv6-server;
     }

     organization "DHC WG";
     contact
       "yong@csnet1.cs.tsinghua.edu.cn
       lh.sunlinh@gmail.com
       ian.farrer@telekom.de
       sladjana.zechlin@telekom.de
       hezihao9512@gmail.com";

     description "This model defines a YANG data model that can be
       used to define client class selector for DHCPv6 Server model.";

     revision 2019-06-13 {
       description "";
       reference "I-D: draft-ietf-dhc-dhcpv6-yang";
     }

     grouping client-class-id {
       description "Defintions for client classification for
         authorization and assignment purposes.";

       leaf client-class-name {
         type string;
         description "Unique Identifier for client class identification
           list entries.";
       }

       choice id-type {
         description "Definitions for different client identifier

Cui, et al.                Expires 7 May 2020                  [Page 69]
Internet-Draft              DHCPv6 YANG Model              November 2019

           types.";
         mandatory true;
         case client-id-id {
           description "Client class selection based on a string literal
             client identifier.";
           leaf client-id {
             description "String literal client identifier.";
             mandatory true;
             type string;
           }
         }
         case received-interface-id {
           description "Client class selection based on the incoming
             interface of the DHCPv6 message.";
           leaf received-interface {
             description "Reference to the interface entry
               for the incoming DHCPv6 message.";
             type if:interface-ref;
           }
         }
         case packet-source-address-id {
           description "Client class selection based on the source
             address of the DHCPv6 message.";
           leaf packet-source-address {
             description "Source address of the DHCPv6 message.";
             mandatory true;
             type inet:ipv6-address;
           }
         }
         case packet-destination-address-id {
           description "Client class selection based on the destination
             address of the DHCPv6 message.";
           leaf packet-destination-address {
             description "Destination address of the DHCPv6 message.";
             mandatory true;
             type inet:ipv6-address;
           }
         }
         case relay-link-address-id {
           description "Client class selection based on the prefix
             of the link-address field in the relay agent message
             header.";
           leaf relay-link-address {
             description "Prefix of the link-address field in the relay
               agent message header.";
             mandatory true;
             type inet:ipv6-prefix;
           }

Cui, et al.                Expires 7 May 2020                  [Page 70]
Internet-Draft              DHCPv6 YANG Model              November 2019

         }
         case relay-peer-address-id {
           description "Client class selection based on the value of the
             peer-address field in the relay agent message header.";
           leaf relay-peer-address {
             description "Prefix of the peer-address field
               in the relay agent message header.";
             mandatory true;
             type inet:ipv6-prefix;
           }
         }
         case relay-interface-id {
           description "Client class selection based on the incoming
             interface-id option.";
           leaf relay-interface {
             description "Reference to the interface entry
               for the incoming DHCPv6 message.";
             type string;
           }
         }
         case user-class-option-id {
           description "Client class selection based on the value of the
             OPTION_USER_CLASS(15) and its user-class-data field.";
           leaf user-class-data {
             description "Value of the enterprise-number field.";
             mandatory true;
             type string;
           }
         }
         case vendor-class-present-id {
           description "Client class selection based on the presence of
             OPTION_VENDOR_CLASS(16) in the received message.";
           leaf vendor-class-present {
             description "Presence of OPTION_VENDOR_CLASS(16)
               in the received message.";
             mandatory true;
             type boolean;
           }
         }
         case vendor-class-option-enterprise-number-id {
           description "Client class selection based on the value of the
             enterprise-number field in OPTION_VENDOR_CLASS(16).";
           leaf vendor-class-option-enterprise-number {
             description "Value of the enterprise-number field.";
             mandatory true;
             type uint32;
           }
         }

Cui, et al.                Expires 7 May 2020                  [Page 71]
Internet-Draft              DHCPv6 YANG Model              November 2019

         case vendor-class-option-data-id {
           description "Client class selection based on the value
             of a data field within a vendor-class-data entry
             for a matching enterprise-number field
             in OPTION_VENDOR_CLASS(16).";
           container vendor-class-option-data {
             leaf vendor-class-option-enterprise-number {
               description "Value of the enterprise-number field
                 for matching the data contents.";
               mandatory true;
               type uint32;
             }
             leaf vendor-class-data {
               description "Vendor class data to match.";
               mandatory true;
               type string;
             }
           }
         }
         case remote-id {
           description "Client class selection based on the value
             of Remote-ID .";
           container remote-id {
             leaf vendor-class-option-enterprise-number {
               description "Value of the enterprise-number field
                 for matching the data contents.";
               mandatory true;
               type uint32;
             }
             leaf remote-id {
               description "Remote-ID data to match.";
               mandatory true;
               type string;
             }
           }
         }
         case client-duid-id {
           description "Client class selection based on the value
             of the received client DUID.";
           uses dhcpv6-common:duid;
         }
       }
     }

     /* Augmentations of dhcpv6 server */

     augment "/dhcpv6-server:config/dhcpv6-server:class-selector" {

Cui, et al.                Expires 7 May 2020                  [Page 72]
Internet-Draft              DHCPv6 YANG Model              November 2019

       container client-classes {
         list class {
           description "List of the client class identifiers applicable
             to clients served by this address pool";
           key client-class-name;
           uses dhcpv6-class-selector:client-class-id;
         }
       }
     }

     augment "/dhcpv6-server:config/dhcpv6-server:network-ranges/dhcpv6-
   server:network-range" {
       leaf-list client-class {
         type leafref {
           path "/dhcpv6-server:config/dhcpv6-server:class-selector/clie
   nt-classes/class/client-class-name";
         }
       }
     }
     augment "/dhcpv6-server:config/dhcpv6-server:network-ranges/dhcpv6-
   server:network-range/dhcpv6-server:address-pools/dhcpv6-server:addres
   s-pool" {
       leaf-list client-class {
         type leafref {
           path "/dhcpv6-server:config/dhcpv6-server:class-selector/clie
   nt-classes/class/client-class-name";
         }
       }
     }
     augment "/dhcpv6-server:config/dhcpv6-server:network-ranges/dhcpv6-
   server:network-range/dhcpv6-server:pd-pools/dhcpv6-server:pd-pool" {
       leaf-list client-class {
         type leafref {
           path "/dhcpv6-server:config/dhcpv6-server:class-selector/clie
   nt-classes/class/client-class-name";
         }
       }
     }

   }

Authors' Addresses

   Yong Cui
   Tsinghua University
   Beijing

   Phone: +86-10-6260-3059

Cui, et al.                Expires 7 May 2020                  [Page 73]
Internet-Draft              DHCPv6 YANG Model              November 2019

   Email: cuiyong@tsinghua.edu.cn

   Linhui Sun
   Tsinghua University
   Beijing

   Phone: +86-10-6278-5822
   Email: lh.sunlinh@gmail.com

   Ian Farrer
   Deutsche Telekom AG
   CTO-ATI, Landgrabenweg 151
   53227 Bonn
   Germany

   Email: ian.farrer@telekom.de

   Sladjana Zechlin
   Deutsche Telekom AG
   CTO-IPT, Landgrabenweg 151
   53227 Bonn
   Germany

   Email: sladjana.zechlin@telekom.de

   Zihao He
   Tsinghua University
   Beijing

   Phone: +86-10-6278-5822
   Email: hezihao9512@gmail.com

   Michal Nowikowski
   Internet Systems Consortium
   Gdansk
   Poland

   Email: godfryd@isc.org

Cui, et al.                Expires 7 May 2020                  [Page 74]