Constructing N-to-N shared optical queue with switches and fiber delay lines