Easiest way to split users into separate classes?

Peter Rathlev peter at rathlev.dk
Wed Feb 23 07:35:56 UTC 2011


On Tue, 2011-02-22 at 21:31 -0800, Christ Schlacta wrote:
> forgive me if I'm mistaken, but this scheme can only scale to powers
> of 2.  that can be a potential inhibition to future expansion..  you
> have to scale from 2 to 4 servers, then to 8, then to 16...

If you could accept uneven distribution it can scale to any number of
servers. Imagine you have a class selecting the last three bits, i.e. 8
possible outcomes:

  match suffix(binary-to-ascii (2, 8, ":", suffix (hardware,1)), 3);

That can be split in three groups with:

 subclass "server_1" "000";
 subclass "server_1" "001";
 subclass "server_1" "010";
 
 subclass "server_2" "011";
 subclass "server_2" "100";
 subclass "server_2" "101";
 
 subclass "server_3" "110";
 subclass "server_3" "111";

Which gives you a 3:3:2 distribution if the last three bits of the MAC
address can be considered random.

-- 
Peter





More information about the dhcp-users mailing list