My question is how is the expiry time chosen? Is it at multiples of 24 hours after the last boot? Or it is tied to the local timezone (and happens overnight)? Or is it at random, with some jitter from a 24-hour schedule? Or something else?
This is determined by looking at the elapsed time since the address was created.
RFC 8981, Section 3.4 describes the generation of temporary addresses:
- lifetime of the temporarily generated address will not exceed the valid or preferred lifetime of the address (whichever is earlier)
- a “creation time” value is used to assist in calculating elapsed time and comparing it to valid tine and/or preferred time
- There is a
DESYNC_FACTOR
value that is randomly generated that prevents clients from syncing at fixed intervals - this is the “jitter” reference.
This is a very broad explanation and for the purposes of this question, you can think of the address expiry time like the lease time for an address on IPv4. The major difference being that on lease expiry IPv4 will attempt to renew the address whereas IPv6 will regenerate the address. That time is calculated in elapsed seconds ignoring time zones, daylight savings time, etc. At it’s most basic level, it’s a countdown timer.