Abstract:Underwater sensor network (UWSN) adopts acoustic communication, characterized by high delay, low bandwidth, high error rate etc., resulting in communication protocols designed for radio channels are unsuitable for underwater acoustic channels, which brings significant challenges to the protocol design for UWSN. So, we propose a distributed probability-based CDMA code dynamic assignment protocol for underwater sensor networks which can avoid conflict between the spread codes with high probability. This algorithm does not require accurate time synchronization and can adapt to the dynamic topology of underwater sensor networks. The algorithm can be used for both the transmitter oriented and receiver oriented code assignment. Simulation indicates that our proposed algorithm performs better than the traditional code assignment algorithm due to highlight the personalization of each node, further reducing the risk of interference.