An optical amplifier includes first and second optical amplifier units, a
variable optical attenuator optically coupled between the first and
second optical amplifier units, a first control unit to control gains of
the first and second optical amplifier units based on an input of the
first optical amplifier unit and an output of the second optical
amplifier unit, and a second control unit to control an attenuation
quantity of the variable optical attenuator based on the input and an
output of the first optical amplifier unit and an input and the output of
the second optical amplifier unit.