Applications of multi-port encoder/decoders in photonic MPLS and CDMA networks