module ietf-dhcpv6-server {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-server";
prefix "dhc6-srv";
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 dhc6;
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
(https://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-10-25 {
description
"Initial Revision.";
reference
"XXXX: YANG Data Model for DHCPv6 Configuration";
}
/*
* Features
*/
feature na-assignment {
description
"Denotes that the server implements DHCPv6 non-temporary
address assignment.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 6.2";
}
feature prefix-delegation {
description
"Denotes that the server implements DHCPv6 prefix
delegation.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 6.3";
}
/*
* 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 using the allocation-range.";
}
leaf valid-lifetime {
type dhc6: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 dhc6:timer-seconds32;
description
"Renew (T1) time.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 4.2";
}
leaf rebind-time {
type dhc6:timer-seconds32;
description
"Rebind (T2) time.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 4.2";
}
leaf preferred-lifetime {
type dhc6: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.1";
}
}
grouping lease-information {
description
"Binding information for each client that has been allocated
an IPv6 address or prefix.";
leaf client-duid {
type dhc6:duid;
description
"Client DUID.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 11";
}
leaf ia-id {
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 dhc6: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 dhc6:timer-seconds32;
description
"The valid lifetime for the lease expressed in seconds.";
reference "RFC 8415: Dynamic Host Configuration Protocol for
IPv6 (DHCPv6), Section 6";
}
leaf lease-t1 {
type dhc6: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 dhc6: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";
}
uses dhc6:status;
}
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 dhc6: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 (Max Solicit timeout
value).";
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 dhc6:timer-seconds32;
description
"sol max rt value";
}
}
}
grouping inf-max-rt-option-group {
description
"OPTION_INF_MAX_RT (83) INF_MAX_RT Option (Max
Information-request timeout value).";
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 dhc6: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;
description
"Enables the DHCP server function.";
}
leaf server-duid {
type dhc6: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 dhc6:auth-option-group;
uses server-unicast-option-group;
uses dhc6:rapid-commit-option-group;
uses dhc6:vendor-specific-information-option-group;
uses reconfigure-message-option-group;
uses dhc6: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 it is not
possible to include in this module. This container provides
a location for server implementors to augment their own
class-selector YANG.";
}
container allocation-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 allocation-ranges. Under
this are the individual allocation-ranges.";
uses resource-config;
list allocation-range {
key id;
description
"Network-ranges are identified by the 'id' key.";
leaf id {
type uint32;
mandatory true;
description
"Unique identifier for the allocation range.";
}
leaf description {
type string;
description
"Description for the allocation range.";
}
leaf network-prefix {
type inet:ipv6-prefix;
mandatory true;
description
"Network prefix.";
}
uses resource-config;
container address-pools {
if-feature na-assignment;
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 string;
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
"Starting IPv6 address for the pool.";
}
leaf end-address {
type inet:ipv6-address-no-zone;
mandatory true;
description
"Ending IPv6 address for the pool.";
}
leaf max-address-utilization {
type dhc6:threshold;
description
"Maximum amount of the addresses in the
pool which can be simultaneously allocated,
calculated as a percentage of the available
addresses (end-address minus start-address plus
one).";
}
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 dhc6: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 string;
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 {
range "1 .. 128";
}
mandatory true;
description
"Length of the prefixes that will be delegated
to clients.";
}
leaf max-pd-space-utilization {
type dhc6:threshold;
description
"Maximum amount of the prefixes in the
pool which can be simultaneously allocated,
calculated as a percentage of the available
prefixes, rounded up.";
}
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 dhc6: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 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;
}
}
/*
* RPCs
*/
rpc delete-address-lease {
nacm:default-deny-all;
if-feature na-assignment;
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 leafref {
path "../../dhcpv6-server/allocation-ranges/" +
"allocation-range/address-pools/address-pool" +
"/active-leases/active-lease/leased-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;
if-feature prefix-delegation;
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 leafref {
path "../../dhcpv6-server/allocation-ranges/" +
"allocation-range/prefix-pools/prefix-pool" +
"/active-leases/active-lease/leased-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.";
}
}
}
/*
* Notifications
*/
notification address-pool-utilization-threshold-exceeded {
if-feature na-assignment;
description
"Notification sent when the address pool
utilization exceeds the threshold configured in
max-address-utilization.";
leaf pool-id {
type leafref {
path "../../dhcpv6-server/allocation-ranges/" +
"allocation-range/address-pools/address-pool" +
"/pool-id";
}
mandatory true;
description
"Leafref to the address pool that the notification
is being generated for.";
}
leaf total-pool-addresses {
type uint64;
mandatory true;
description
"Total number of addresses in the pool
(end-address minus start-address plus one).";
}
leaf max-allocated-addresses {
type uint64;
mandatory true;
description
"Maximum number of addresses that can be simultaneously
allocated from the pool. This value may be less than
count of total addresses. Calculated as the
max-address-utilization (percentage) of the
total-pool-addresses, rounded up.";
}
leaf allocated-address-count {
type uint64;
mandatory true;
description
"Number of addresses allocated from the pool.";
}
}
notification prefix-pool-utilization-threshold-exceeded {
if-feature prefix-delegation;
description
"Notification sent when the prefix pool utilization
exceeds the threshold configured in
max-pd-space-utilization.";
leaf pool-id {
type leafref {
path "../../dhcpv6-server/allocation-ranges" +
"/allocation-range/prefix-pools/prefix-pool/pool-id";
}
mandatory true;
description
"Unique identifier for the pool.";
}
leaf total-pool-prefixes {
type uint64;
mandatory true;
description
"Total number of prefixes in the pool.";
}
leaf max-allocated-prefixes {
type uint64;
mandatory true;
description
"Maximum number of prefixes that can be simultaneously
allocated from the pool. This value may be less than
count of total prefixes. Calculated as the
max-prefix-utilization (percentage) of the
total-pool-prefixes, rounded up.";
}
leaf allocated-prefixes-count {
type uint64;
mandatory true;
description
"Number of prefixes allocated from the pool.";
}
}
notification invalid-client-detected {
description
"Notification sent when the server detects an
invalid client.";
leaf message-type {
type enumeration {
enum solicit {
description
"Solicit (1) message.";
}
enum request {
description
"Request (3) message.";
}
enum confirm {
description
"Confirm (4) message.";
}
enum renew {
description
"Renew (5) message.";
}
enum rebind {
description
"Rebind (6) message.";
}
enum release {
description
"Release (8) message.";
}
enum decline {
description
"Decline (9) message.";
}
enum info-request {
description
"Information request (11) message.";
}
}
description
"The message type received by the server that has caused
the error.";
}
leaf duid {
type dhc6:duid;
description
"Client DUID.";
}
leaf description {
type string;
description
"Description of the event (e.g., and error code or log
message).";
}
}
notification decline-received {
if-feature na-assignment;
description
"Notification sent when the server has received a
Decline (9) message from a client.";
leaf duid {
type dhc6: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 duid {
type dhc6:duid;
description
"Client DUID.";
}
uses dhc6:status;
}
}