Attenuation in optical communications