[func] fdupont
Added the new "adaptive-lease-time-threshold" parameter
for the FLQ (Free Lease Queue) allocator which reduces
- lifetime of leases when pools of a subnet have an
+ the lifetime of leases when pools of a subnet have an
occupancy rate above a configured threshold (new feature
from ISC DHCP).
(Gitlab #226)
// lease is returned as it was "cached".
"cache-max-age": 1000,
- // Adaptive lease time threshold = 1. (disabled).
- "adaptive-lease-time-threshold": 1.,
+ // Adaptive lease time threshold (1.0 is disabled).
+ "adaptive-lease-time-threshold": 0.8,
// Specify whether the server should look up global reservations.
"reservations-global": false,
// Subnet-level cache maximum.
"cache-max-age": 1000,
- // Adaptive lease time threshold = 1. (disabled).
- "adaptive-lease-time-threshold": 1.,
+ // Adaptive lease time threshold (1.0 is disabled).
+ "adaptive-lease-time-threshold": 0.8,
// List of static IPv4 reservations assigned to clients belonging
// to this subnet. For a detailed example, see reservations.json.
// Global cache maximum.
"cache-max-age": 1000,
- // Adaptive lease time threshold = 1. (disabled).
- "adaptive-lease-time-threshold": 1.,
+ // Adaptive lease time threshold (1.0 is disabled).
+ "adaptive-lease-time-threshold": 0.8,
// String of zero or more characters with which to replace each
// invalid character in the hostname or Client FQDN. The default
// lease is returned as it was "cached".
"cache-max-age": 1000,
- // Adaptive lease time threshold = 1. (disabled).
- "adaptive-lease-time-threshold": 1.,
+ // Adaptive lease time threshold (1.0 is disabled).
+ "adaptive-lease-time-threshold": 0.8,
// Specify whether the server should look up global reservations.
"reservations-global": false,
// Subnet-level cache maximum.
"cache-max-age": 1000,
- // Adaptive lease time threshold = 1. (disabled).
- "adaptive-lease-time-threshold": 1.,
+ // Adaptive lease time threshold (1.0 is disabled).
+ "adaptive-lease-time-threshold": 0.8,
// List of static IPv6 reservations assigned to clients belonging
// to this subnet. For a detailed example, see reservations.json.
// Global cache maximum.
"cache-max-age": 1000,
- // Adaptive lease time threshold = 1.0 (disabled)
- "adaptive-lease-time-threshold": 1.0,
+ // Adaptive lease time threshold (1.0 is disabled)
+ "adaptive-lease-time-threshold": 0.8,
// String of zero or more characters with which to replace each
// invalid character in the Client FQDN. The default
In Kea 3.1.1 a new parameter ``adaptive-lease-time-threshold`` was added.
It can be specified at global, shared network and subnet levels and
-takes a floating point value between ``0.`` (excluded) and ``1.``.
-It is disabled by default or when set to ``1.``. It is active only with
-he FLQ allocator and when the occupancy rate of pools of subnet is
+takes a floating point value between ``0.0`` (excluded) and ``1.0``.
+It is disabled by default or when set to ``1.0``. It is only supported
+by the FLQ allocator. When the occupancy rate of pools in a subnet is
above the specified value the server decreases the lease valid lifetime
to the applicable ``min-valid-lifetime`` for new clients. Clients
renewing an already existing lease get at least the remaining lifetime
In Kea 3.1.1 a new parameter ``adaptive-lease-time-threshold`` was added.
It can be specified at global, shared network and subnet levels and
-takes a floating point value between ``0.`` (excluded) and ``1.``.
-It is disabled by default or when set to ``1.``. It is active only with
-he FLQ allocator and when the occupancy rate of pools of subnet is
+takes a floating point value between ``0.0`` (excluded) and ``1.0``.
+It is disabled by default or when set to ``1.0``. It is only supported
+by the FLQ allocator. When the occupancy rate of pools in a subnet is
above the specified value the server decreases the lease valid lifetime
to the applicable ``min-valid-lifetime`` for new clients. Clients
renewing an already existing lease get at least the remaining lifetime
inited_ = true;
}
+double
+Allocator::getOccupancyRate(const asiolink::IOAddress&ddr,
+ const ClientClasses&) const {
+ return (0.);
+}
+
+double
+Allocator::getOccupancyRate(const asiolink::IOAddress&,
+ const uint8_t,
+ const ClientClasses&) const {
+ return (0.);
+}
+
}
}
/// @param client_classes list of classes client belongs to.
virtual double
getOccupancyRate(const asiolink::IOAddress& addr,
- const ClientClasses& client_classes) const {
- return (0.);
- }
+ const ClientClasses& client_classes) const;
/// @brief Returns the occupancy rate (v6 prefixes).
///
virtual double
getOccupancyRate(const asiolink::IOAddress& pref,
const uint8_t plen,
- const ClientClasses& client_classes) const {
- return (0.);
- }
+ const ClientClasses& client_classes) const;
/// @brief Check if the pool matches the selection criteria relative to the
/// provided hint prefix length.
// This test verifies the Subnet4 parser's validation logic for
// adaptive lease time parameter.
-TEST(CfgSubnets4Test, AdaptiveLeaseTimeParamValidation) {
+TEST(CfgSubnets4Test, adaptiveLeaseTimeParamValidation) {
// Describes a single test scenario.
struct Scenario {
// This test verifies the Subnet6 parser's validation logic for
// adaptive lease time parameter.
-TEST(CfgSubnets6Test, AdaptiveLeaseTimeParamValidation) {
+TEST(CfgSubnets6Test, adaptiveLeaseTimeParamValidation) {
// Describes a single test scenario.
struct Scenario {