A virtually nonblocking self-routing permutation network which routes packets in O(logN) time