A technique for maintaining a required value of power per optical communication channel in a chain of optical nodes (112, 114, 118, 116) connected by optical fiber spans (111, 119, 121), wherein at least some of the nodes include optical amplifiers (112, 114, 116) with controllable gains, the technique comprises performing automatic gain control at the optical amplifiers so that, in the frame of power gain of each particular optical amplifier (114, 116), to compensate a preceding span loss. The span loss is calculated as power loss on an optical fiber span (111,121) incoming the particular amplifier.