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 {
prefix inet;
reference
"RFC 6991: Common YANG Data Types";
}
import ietf-yang-types {
prefix yang;
reference
"RFC 6991: Common YANG Data Types";
}
import ietf-dhcpv6-common {
prefix dhcpv6-common;
reference
"RFC XXXX: To be updated on publication";
}
import ietf-netconf-acm {
prefix nacm;
reference
"RFC 8341: Network Configuration Access Control Model";
}
organization
"IETF DHC (Dynamic Host Configuration) Working Group";
contact
"WG Web:
WG List:
Author: Yong Cui
Author: Linhui Sun
Editor: Ian Farrer
Author: Sladjana Zeichlin
Author: Zihao He
Author: Michal Nowikowski ";
description "This YANG module defines components for the
configuration and management of DHCPv6 servers.
Copyright (c) 2021 IETF Trust and the persons identified as
authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject
to the license terms contained in, the Simplified BSD License
set forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents
(http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX; see
the RFC itself for full legal notices.";
revision 2021-02-22 {
description "Version update for draft -18 publication.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang-18";
}
revision 2021-01-29 {
description "Version update for draft -17 publication.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang-17";
}
revision 2021-01-06 {
description "Version update for draft -16 publication.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang-16";
}
revision 2020-12-22 {
description "Version update for draft -13 publication.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang-15";
}
revision 2020-12-10 {
description "Version update for draft -13 publication.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang-13";
}
revision 2020-12-01 {
description "Version update for draft -12 publication.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang-12";
}
revision 2020-05-26 {
description "Version update for draft -11 publication and
to align revisions across the different modules.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang-11";
}
revision 2019-12-02 {
description "Major reworking of the module.";
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 server specific
YANG model.";
reference "I-D: draft-ietf-dhc-dhcpv6-yang";
}
/*
* Features
*/
feature prefix-delegation {
description "Denotes that the server implements DHCPv6 prefix
delegation.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 6.2";
}
/*
* Groupings
*/
grouping resource-config {
description "Nodes that are reused at 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 set of DHCPv6 options
(option-set) to be provisioned to clients of this
network-range.";
}
leaf valid-lifetime {
type dhcpv6-common:timer-seconds32;
description "Valid lifetime for the Identity Association
(IA).";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 6";
}
leaf renew-time {
type dhcpv6-common:timer-seconds32;
description "Renew (T1) time.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 4.2";
}
leaf rebind-time {
type dhcpv6-common:timer-seconds32;
description "Rebind (T2) time.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 4.2";
}
leaf preferred-lifetime {
type dhcpv6-common:timer-seconds32;
description "Preferred lifetime for the Identity Association
(IA).";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 6";
}
leaf rapid-commit {
type boolean;
description "When set to 'true', Specifies that the pool
supports client-server exchanges involving two messages.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 5.2";
}
}
grouping lease-information {
description "Binding information for each client that has
been allocated an IPv6 address or prefix.";
leaf client-duid {
type dhcpv6-common:duid;
description "Client DUID.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 11";
}
leaf iaid {
type uint32;
mandatory true;
description "Client's IAID";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 12";
}
leaf allocation-time {
type yang:date-and-time;
description "Time and date that the lease was made.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 18";
}
leaf last-renew-rebind {
type yang:date-and-time;
description "Time of the last successful renew or
rebind.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 18";
}
leaf preferred-lifetime {
type dhcpv6-common:timer-seconds32;
description "The preferred lifetime expressed in
seconds.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 6";
}
leaf valid-lifetime {
type dhcpv6-common:timer-seconds32;
description "The valid lifetime for the leased prefix
expressed in seconds.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 6";
}
leaf lease-t1 {
type dhcpv6-common:timer-seconds32;
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.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 4.2";
}
leaf lease-t2 {
type dhcpv6-common:timer-seconds32;
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.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 4.2";
}
}
grouping message-stats {
description "Counters for DHCPv6 messages.";
leaf solicit-count {
type uint32;
config "false";
description "Number of Solicit (1) messages received.";
}
leaf advertise-count {
type uint32;
config "false";
description "Number of Advertise (2) messages sent.";
}
leaf request-count {
type uint32;
config "false";
description "Number of Request (3) messages received.";
}
leaf confirm-count {
type uint32;
config "false";
description "Number of Confirm (4) messages received.";
}
leaf renew-count {
type uint32;
config "false";
description "Number of Renew (5) messages received.";
}
leaf rebind-count {
type uint32;
config "false";
description "Number of Rebind (6) messages received.";
}
leaf reply-count {
type uint32;
config "false";
description "Number of Reply (7) messages sent.";
}
leaf release-count {
type uint32;
config "false";
description "Number of Release (8) messages received.";
}
leaf decline-count {
type uint32;
config "false";
description "Number of Decline (9) messages received.";
}
leaf reconfigure-count {
type uint32;
config "false";
description "Number of Reconfigure (10) messages sent.";
}
leaf information-request-count {
type uint32;
config "false";
description "Number of Information-request (11) messages
received.";
}
}
grouping preference-option-group {
description "OPTION_PREFERENCE (7) Preference Option.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 21.8";
container preference-option {
description "OPTION_PREFERENCE (7) Preference Option
container.";
leaf pref-value {
type uint8;
description "The preference value for the server in this
message. A 1-octet unsigned integer.";
}
}
}
grouping server-unicast-option-group {
description "OPTION_UNICAST (12) Server Unicast Option.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 21.12";
container server-unicast-option {
description "OPTION_UNICAST (12) Server Unicast Option
container.";
leaf server-address {
type inet:ipv6-address;
description "The 128-bit address to which the client
should send messages delivered using unicast.";
}
}
}
grouping reconfigure-message-option-group {
description "OPTION_RECONF_MSG (19) Reconfigure Message
Option.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 21.19";
container reconfigure-message-option {
description "OPTION_RECONF_MSG (19) Reconfigure Message
Option.";
leaf msg-type {
type uint8;
description "5 for Renew message, 6 for Rebind message,
11 for Information-request message.";
}
}
}
grouping info-refresh-time-option-group {
description "OPTION_INFORMATION_REFRESH_TIME (32)
Information Refresh Time Option.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 21.23";
container info-refresh-time-option {
description "OPTION_INFORMATION_REFRESH_TIME (32)
Information Refresh Time option container.";
leaf info-refresh-time {
type dhcpv6-common:timer-seconds32;
description "Time duration relative to the current time,
expressed in units of seconds.";
}
}
}
grouping sol-max-rt-option-group {
description "OPTION_SOL_MAX_RT (82) sol max rt Option.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 21.24";
container sol-max-rt-option {
description "OPTION_SOL_MAX_RT (82) sol max rt option
container.";
leaf sol-max-rt-value {
type dhcpv6-common:timer-seconds32;
description "sol max rt value";
}
}
}
grouping inf-max-rt-option-group {
description "OPTION_INF_MAX_RT (83) inf max rt Option.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 21.25";
container inf-max-rt-option {
description "OPTION_INF_MAX_RT (83) inf max rt option
container.";
leaf inf-max-rt-value {
type dhcpv6-common:timer-seconds32;
description "inf max rt value";
}
}
}
/*
* Data Nodes
*/
container dhcpv6-server {
description "Configuration nodes for the DHCPv6 server.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 18.3";
leaf enabled {
type boolean;
default true;
description "Enables the DHCP server function.";
}
leaf server-duid {
type dhcpv6-common:duid;
description "DUID of the server.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 11";
}
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.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 21";
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.";
}
uses preference-option-group;
uses dhcpv6-common:auth-option-group;
uses server-unicast-option-group;
uses dhcpv6-common:status-code-option-group;
uses dhcpv6-common:rapid-commit-option-group;
uses dhcpv6-common:vendor-specific-information-option-group;
uses reconfigure-message-option-group;
uses dhcpv6-common:reconfigure-accept-option-group;
uses info-refresh-time-option-group;
uses sol-max-rt-option-group;
uses inf-max-rt-option-group;
}
}
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 is based on an address and parameter
allocation hierarchy. The top level is 'global' - which
is defined as the container for all network-ranges. Under
this are the individual network-ranges.";
uses resource-config;
list network-range {
key id;
description "Network-ranges are identified by the
'id' key.";
leaf id {
type uint32;
mandatory true;
description "Equivalent to subnet ID.";
}
leaf description {
type string;
mandatory true;
description "Description for the network range.";
}
leaf network-prefix {
type inet:ipv6-prefix;
mandatory true;
description "Network prefix.";
}
uses resource-config;
container address-pools {
description "Configuration for the DHCPv6 server's
address pools.";
list address-pool {
key pool-id;
description "List of address pools for allocation to
clients, distinguished by 'pool-id'.";
leaf pool-id {
type uint32;
mandatory true;
description "Unique identifier for the pool.";
}
leaf pool-prefix {
type inet:ipv6-prefix;
mandatory true;
description "IPv6 prefix for the pool.";
}
leaf start-address {
type inet:ipv6-address-no-zone;
mandatory true;
description "Start IPv6 address for the pool.";
}
leaf end-address {
type inet:ipv6-address-no-zone;
mandatory true;
description "End IPv6 address for the pool.";
}
leaf max-address-count {
type dhcpv6-common:threshold;
mandatory true;
description "Maximum number of addresses that can
be simultaneously allocated from this pool.";
}
uses resource-config;
container host-reservations {
description "Configuration for host reservations from
the address pool.";
list host-reservation {
key reserved-addr;
description "List of host reservations.";
leaf client-duid {
type dhcpv6-common:duid;
description "Client DUID for the reservation.";
}
leaf reserved-addr {
type inet:ipv6-address;
description "Reserved IPv6 address.";
}
uses resource-config;
}
}
container active-leases {
config false;
description "Holds state related to active client
leases.";
leaf total-count {
type uint64;
mandatory true;
description "The total number of addresses in the
pool.";
}
leaf allocated-count {
type uint64;
mandatory true;
description "The number of addresses or prefixes
in the pool that are currently allocated.";
}
list active-lease {
key leased-address;
description "List of active address leases.";
leaf leased-address {
type inet:ipv6-address;
description "Active address lease entry.";
}
uses lease-information;
}
}
}
}
container prefix-pools {
if-feature prefix-delegation;
description "Configuration for the DHCPv6 server's
prefix pools.";
list prefix-pool {
key pool-id;
description "List of prefix pools for allocation to
clients, distinguished by 'pool-id'.";
leaf pool-id {
type uint32;
mandatory true;
description "Unique identifier for the pool.";
}
leaf pool-prefix {
type inet:ipv6-prefix;
mandatory true;
description "IPv6 prefix for the pool.";
}
leaf client-prefix-length {
type uint8;
mandatory true;
description "Length of the prefixes that will be
delegated to clients.";
}
leaf max-pd-space-utilization {
type dhcpv6-common:threshold;
mandatory true;
description "Maximum percentage utilization of the
prefix pool in this pool.";
}
uses resource-config;
container host-reservations {
description "Configuration for host reservations
from the prefix pool.";
list prefix-reservation {
key reserved-prefix;
description "reserved prefix reservation";
leaf client-duid {
type dhcpv6-common:duid;
description "Client DUID for the reservation.";
}
leaf reserved-prefix {
type inet:ipv6-prefix;
description "Reserved IPv6 prefix";
}
leaf reserved-prefix-len {
type uint8;
description "Reserved IPv6 prefix length.";
}
}
uses resource-config;
}
container active-leases {
config false;
description "Holds state related to for active client
prefix leases.";
leaf total-count {
type uint64;
mandatory true;
description "The total number of prefixes in
the pool.";
}
leaf allocated-count {
type uint64;
mandatory true;
description "The number of prefixes in the pool
that are currently allocated.";
}
list active-lease {
key leased-prefix;
description "List of active prefix leases.";
leaf leased-prefix {
type inet:ipv6-prefix;
description "Active leased prefix entry.";
}
uses lease-information;
}
}
}
}
}
uses message-stats;
}
}
/*
* Notifications
*/
notification address-pool-utilization-threshold-exceeded {
description "Notification sent when the address pool
utilization exceeds the configured threshold.";
leaf pool-id {
type leafref {
path "/dhcpv6-server/network-ranges/network-range/" +
"address-pools/address-pool/pool-id";
}
description "Leafref to the address pool which the notification
is being generated for.";
}
leaf total-address-count {
type uint64;
mandatory true;
description "Count of the 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.";
}
}
notification prefix-pool-utilization-threshold-exceeded {
if-feature prefix-delegation;
description "Notification sent when the prefix pool
utilization exceeds the configured threshold.";
leaf pool-id {
type leafref {
path "/dhcpv6-server/network-ranges/network-range/" +
"prefix-pools/prefix-pool/pool-id";
}
mandatory true;
description "Unique identifier for the pool.";
}
leaf max-pd-space-utilization {
type leafref {
path "/dhcpv6-server/network-ranges/network-range/" +
"prefix-pools/prefix-pool/max-pd-space-utilization";
}
mandatory true;
description "PD space utilization threshold.";
}
leaf pd-space-utilization {
type uint64;
description "Current PD space utilization";
}
}
notification invalid-client-detected {
description "Notification sent when the server detects an
invalid client.";
leaf duid {
type dhcpv6-common:duid;
description "Client DUID.";
}
leaf description {
type string;
description "Description of the event (e.g. and error code or
log message).";
}
}
notification decline-received {
description "Notification sent when the server has received a
Decline (9) message from a client.";
leaf duid {
type dhcpv6-common:duid;
description "Client DUID.";
}
list declined-resources {
description "List of declined addresses and/or prefixes.";
choice resource-type {
description "Type of resource that has been declined.";
case declined-address {
leaf address {
type inet:ipv6-address;
description "Address that has been declined.";
}
}
case declined-prefix {
leaf prefix {
type inet:ipv6-prefix;
description "Prefix that has been declined.";
}
}
}
}
}
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 the client.";
}
leaf duid {
type dhcpv6-common:duid;
description "Client DUID.";
}
}
/*
* RPCs
*/
rpc delete-address-lease {
nacm:default-deny-all;
description "Deletes a client's active address lease from the
server's lease database. Note, this will not cause the address
to be revoked from the client, and the lease may be refreshed
or renewed by the client.";
input {
leaf lease-address-to-delete {
type inet:ipv6-address;
mandatory true;
description "IPv6 address of an active lease that will be
deleted from the server.";
}
}
output {
leaf return-message {
type string;
description "Response message from the server.";
}
}
}
rpc delete-prefix-lease {
nacm:default-deny-all;
description "Deletes a client's active prefix lease from the
server's lease database. Note, this will not cause the prefix
to be revoked from the client, and the lease may be refreshed
or renewed by the client.";
input {
leaf lease-prefix-to-delete {
type inet:ipv6-prefix;
mandatory true;
description "IPv6 prefix of an active lease that will be
deleted from the server.";
}
}
output {
leaf return-message {
type string;
description "Response message from the server.";
}
}
}
}