[RFC - odhcpd stateful] 3-digit IPv6 suffix (IID)

Noticed that DHCPv6 stateful client exhibitis a 3-digit suffix (IID), e.g.

<prefix>::350

for both, ULA and GUA. Whilst that might be considered convenient for the user and not much of a concern with ULA its seems somewhat questionable for GUA.

Thus the questions:

  • what is the purpose of a 3-digit IID?

  • which part of the code is generating this short IID, supposedly something related to DHCPV6_OPT_IA_NA?

  • how random/stable and unique/reliable/robust (duplication potential) are those short IID?

  • which DHCPv6 IID standard is this methodology following, or being a case of [1]

    A common operational practice for well-known servers is to manually assign a small number as the IID, in which case "u" and "g" are both zero.

  • if not derived from the Client Identifier (MAC/DUID) then what is the base for this short IID construct?


[1] https://tools.ietf.org/html/rfc7136#section-2

Oddly the IID length for stateful clients seems to be determined by

  • netifd's option ip6ifaceid ''

Albeit [2] mentioned under the heading

Protocol "static" with IPv6

one would expect this being only applicable to a local interface on the router it however changes the IID length for stateful clients if set to

  • random
  • eui64

[2] https://openwrt.org/docs/guide-user/network/ipv6/start

Allocating a unique address I guess?

Most likely https://lxr.openwrt.org/source/odhcpd/src/dhcpv6-ia.c#L660

Same methodology as dnsmasq; initialize a PRNG with a seed derived from a client identifier (for DHCPv4 usually the MAC, for DHCPv6 in odhcpd's case a naive checksum of the DUID) then follow the pseudorandom number sequence until a non-used IP is found and use that.

The original author of odhcpd has been inactive in OpenWrt for years so I can only speculate, but my guess is that he mimicked the logic of other DHCPv6 servers.

True, but seeing the methodology for constructing the IID of 3 digits I was wondering

I mean with max. three digits the odds for duplicates are basically 1:999 and perhaps increased with what is procured as seed data and number of clients in the network.

But then there is DAD which supposedly should prevent a collision in the first place.


How does

ties into all of this (IID length)? Considering