The optical amplifier according to the present invention includes a first optical
amplifying unit, a second optical amplifying unit, a variable optical attenuator
optically connected between the first and second optical amplifying units and a
first control unit for controlling the gains of the first and second optical amplifying
units according to an input to the first optical amplifying unit and an output
from the second optical amplifying unit, and a second control unit for controlling
the attenuation of the variable optical attenuator according to an input to and
an output from the first optical amplifying unit and an input to and an output
from the second optical amplifying unit.