A new design scheme for a distributed algorithm for routing and wavelength assignment (RWA) is developed in this paper, and the communication rules between the nodes to exchange signaling packets are discussed. The Adaptive-Alternate-Routing-Least-Load (AARLL) algorithm is implemented in the distributed scheme for the first time. Under dynamic traffic circumstances, the influence of the race condition, which does not exist in centralized scheme, on the network performance is analyzed and the analyzed results show that the race condition has a major impact on network performance only under light traffic load, while under medium and heavy traffic load the impact is very small. To analyze the performance loss caused by adopting the distributed algorithm for RWA, the capacity loss factor (CLF) is introduced and the calculated results show that CLF does not exceed 6% under medium traffic load.