A method and apparatus for controlling an optical switch. The switch includes a switching fabric and optical amplifiers for amplifying optical signals. A configuration for the switching fabric is generated and implemented. The configuration indicates a set of optical paths between switching fabric input ports and the output ports. Optical path losses through the switching fabric vary based on the configuration. An amplifier control signal for controlling gains of the optical amplifiers, is also provided. The configuration for the switching fabric is generated based on the gains of the optical amplifiers, the amplifier control signal is generated based on the configuration for the switching fabric, or both.
展开▼