KEA DHCP6 Feature Request

Started by IsaacFL, May 16, 2025, 01:33:03 AM

Previous topic - Next topic
I couldn't get the dnsmasq/unbound combination to work well in my situation as I have a real domain with Cloudflare as my Name Servers.

So I have been using the new KEA DHCP6 and it seems to work well, and was noticing that by default it assigns ip addresses sequentially.

One option in KEA is to use the "random" allocation instead. The "allocator": "random" option might be more performant in an HA setup especially. It could be a selectable option per subnet or just be the default.

From the documentation:

{
    "Dhcp6": {
        "allocator": "iterative",
        "pd-allocator": "random",
        "subnet6": [
            {
                "id": 1,
                "subnet": "2001:db8:1::/64",
                "allocator": "random"
            },
            {
                "id": 2,
                "subnet": "2001:db8:2::/64",
                "pd-allocator": "iterative"
            }
        ]
    }
}



From the Docs:
-----------------------------
9.21.2. Iterative Allocator

This is the default allocator used by the Kea DHCPv6 server. It remembers the last offered lease and offers the following sequential lease to the next client. For example, it may offer addresses in this order: 2001:db8:1::10, 2001:db8:1::11, 2001:db8:1::12, and so on. Similarly, it offers the next sequential delegated prefix after the previous one to the next client. The time to find and offer the next lease or delegated prefix is very short; thus, this is the most performant allocator when pool utilization is low and there is a high probability that the next selected lease is available.

The iterative allocation underperforms when multiple DHCP servers share a lease database or are connected to a cluster. The servers tend to offer and allocate the same blocks of addresses to different clients independently, which causes many allocation conflicts between the servers and retransmissions by clients. A random allocation addresses this issue by dispersing the allocation order.

9.21.3. Random Allocator

The random allocator uses a uniform randomization function to select offered addresses and delegated prefixes from subnet pools. It is suitable in deployments where multiple servers are connected to a shared database or a database cluster. By dispersing the offered leases, the servers minimize the risk of allocating the same lease to two different clients at the same or nearly the same time. In addition, it improves the server's resilience against attacks based on allocation predictability.

The random allocator is, however, slightly slower than the iterative allocator. Moreover, it increases the server's memory consumption because it must remember randomized leases to avoid offering them repeatedly. Memory consumption grows with the number of offered leases; in other words, larger pools and more clients increase memory consumption by random allocation.

-----------------------------



Please push this request to GitHub.  Thanks!

Cheers,
Franco

Quote from: franco on May 16, 2025, 09:26:16 AMPlease push this request to GitHub.  Thanks!

Cheers,
Franco

Created Issue "KEA DHCP6 Option to select for Random vs Iterative Allocation of ipv6 Addresses" #8677

I noted that Issue #8506 was the same request but for ipv4. I also noted that the same solution of "allocator": "random" works for ipv4 so possibly change could be incorporated in both dhcpv4 and dhcpv6.