In a computer network that consists of M subnetworks, the L-bit address of a machine consists of two parts: A prefix si that contains the address of the subnetwork to which the machine belongs, and a suffix (of length L-IsiI) containing the address of that particular machine within its subnetwork. In fixed-length subnetwork addressing, IsiI is independent of I, whereas, in variable length subnetwork addressing, IsiI varies from one subnetwork to another. To avoid ambiguity when decoding addresses, there is a requirement that no si be a prefix of another si. The practical problem is how to find a suitable set of sis in order to maximize the total number of addressable machines, when the ith subnetwork contains ni machines. Not all of the ni machines of a subnetwork i need be addressable in a solution: If ni >2(L-|si|), then only 2(L-|sj|) machines of that subnetwork are addressable (none is addressable si the solution assigns no address si to that subnetwork). The abstract problem implied by this formulation is: Given an integer L, and given M (not necessarily distinct) positive integers n1,…,nM, find M binary strings s1,…,sM (some of which may be empty) such that (1) no nonempty string si is prefix of another string s j, (2) no si is more than L bits long, and (3) the quantity Σ(|sk|≠0) min{nk,2(L-|sk |)} is maximized. We generalize the algorithm to the case where each ni also has a priority pi associated with it and there is an additional constraint involving priorities: Some subnetworks are then more important than others and are treated preferentially when assigning addresses. The algorithms can be used to solve the case when L itself is a variable; that is, when the input no longer specifies L but, rather, gives a target integer γ for the number of addressable machines, and the goal is to find the smallest L whose corresponding optimal solution results in at least γ addressable machines

### Published in:

Computers, IEEE Transactions on  (Volume:47 ,  Issue: 6 )

Jun 1998