a method for distributing addressed data packets from an input channel to a multiplicity of packet queues includes receiving said addressed data packets and , responsive to first hashed addresses , distributing the addressed data packets to said queues in accordance with said first hashed addresses . a first hash function is applied to selected address data of each of said addressed data packets to produce said first hashed addresses . at the same time a succession of different hash functions is applied to said selected address data in each of the packets to produce second hashed addresses and occurrences of each of the second hashed addresses are counted so as to obtain for each of said different hash functions a respective one of a plurality of set of counts , each such set representing the distribution of said packets that would occur in said queues if the respective one of the different hash functions had been applied to said addressed data packets . the sets of counts are analyzed to determined which one of them represents a best distribution of said packets and the hash function associated with the best distribution is applied to incoming packets in place of the said first hash function .