A method and a device are provided for swapping optical labels in an optical communication network. Optical information, including payload data and label data digitally encoded into the optical information, is received. At least one group of bits within the optical information is selectively inverted to rewrite the label data with new label data without changing the payload data. Each of the at least one group of inverted bits includes at least two bits and all bits of each of the at least one group of inverted bits are contiguous bits.