Each of a plurality of semiconductor optical amplifiers operates as an
optical gate switch and selects an optical signal indicated by a gate
control signal from an optical gate switch control unit. A plurality of
photodetectors monitor the power of an optical signal input through a
corresponding input port. A VOA control unit calculates an amount of
attenuation corresponding to each input port based on the power of each
optical signal. A variable optical attenuator attenuates the selected
optical signal according to the calculated amount of attenuation in
synchronization with the gate control signal.