Photonic packet switching using cascaded semiconductor optical amplifier gates