In this paper, we present a novel labeling scheme to provide multiservice path switching in a generalized multiprotocol label switching (GMPLS) network. The idea is based on optical code division multiplexing (OCDM) scheme in GMPLS network using multilength variable-weight optical orthogonal codes (MLVW-OOC) as signature sequences. The router architecture of the proposed multiservice GMPLS network is also presented. To provide a requested service, the length and the weight of codes are designed based on the service characteristics. Furthermore, to guarantee the desired service, we propose to limit the number of connections based on the activity coefficient of the connected paths. In order to analyze the network performance, the end-to-end bit error rate (e - e BER) of a connection and the probability of QoS degradation (P-deg) are considered as benchmarks. To obtain the e - e BER of the connected path, a closed-form relation describing the BER of the MLVW-OOC-based OCDM system is derived, and the Erlang's model is used to examine the P-deg. As a case study, a four-class network is designed with the proposed labeling scheme and the performance of each class is investigated. The numerical results reveal that users with high-weight code-word acquire better performance. Furthermore, by increasing the number of intermediate routers, the e - e BER is increased and the performance can be improved by limiting the number of connected paths.