# Research on Networking Protocols for Large-Scale Mobile Ultraviolet Communication Networks
## 2 LSM-UVCN
### Neighbor Discovery Algorithm  
Owing to the low data rate of UV communication, the designed neighbor discovery algorithm should aim to minimize control overhead, thereby preventing excessive control overhead from impairing effective data transmission. The proposed neighbor discovery algorithm consists of two processes: distance determination and neighbor broadcasting. In these two processes, nodes transmit two types of control frames respectively. The first-type control frame consists of only a synchronization field (8 bits), a frame type field (2 bits), a source node ID field (8 bits), and a frame end field (8 bits), with a length of 26 bits. In addition to the above fields, the second-type control frame includes a neighbor node field (\(n\) bits, where \(n\) is the total number of nodes in the network), with a length of \(26+n\) bits. The proposed protocol employs a lossless competition mechanism, which can ensure the successful transmission of one control frame per time slot, avoiding channel resource waste caused by channel competition. The information payload required for the network to complete one neighbor discovery is \(2n\) bits. In a 100-node network, when the point-to-point communication rate is 10 Mbps and the number of relays required for communication between the farthest nodes in the network is 20, the time required for the network to complete one neighbor discovery is approximately 0.3 ms. In the distance determination phase, a node broadcasts a first-type control frame across the entire network. Upon receiving the distance determination frame, a node utilizes the time difference of arrival algorithm to identify neighbor nodes within a one-hop range. Subsequently, it generates a neighbor broadcast frame, as illustrated in Figure 1.  
Figure 1 presents an example of a network topology with six nodes. Assume that the maximum communication distance of a node is \(d\), and the propagation speed of ultraviolet light in the atmosphere is \(c\). Node 1 starts to transmit the first type of control frame at time \(t_{0}\). After other nodes receive the control frame, they determine the distance from the source node to their own node based on the time difference \(\Delta t\) between the moment when they first receive the signal and the starting moment \(t0\) of the time slot. For instance, Node 2 receives the signal at time \(t_{1}\), and at this time, \(\Delta t=(t_{1}-t_{0})\). Since \(\Delta t\times c\leq d\), Node 2 can confirm that the received signal is directly transmitted by the source node, and Node 1 is a neighbor within its one-hop range. Similarly, for other nodes such as Node 2 and Node 3, when they receive the signal, \(\Delta t\times c>d\). From this, it can be determined that the received signal is forwarded by a relay node, and the source node is beyond its one-hop range, as shown in Figure 1b. Nodes continuously determine the distance between the source node and themselves based on the distance determination frames transmitted by other nodes, and generate the second type of control frames. The second type of control frames mainly consists of three parts. The \"head of frame\" contains fields such as the frame type and the ID of the node itself, and the \"end of frame\" contains the frame end field. The \"neighbors segment\" serves as the core of the second type of control frame. Each of the six bits in it respectively indicates the connection relationships between the node itself and other nodes in the network. If a corresponding node is reachable within one hop from the node itself, the corresponding bit is set to \"1\"; otherwise, it is set to \"0\". As shown in Figure 1c, for the second type of control frame generated by Node 2, its neighbor nodes within one hop are Node 1, Node 4, and Node 6. Therefore, the first, third, and sixth bits of its \"neighbors segment\" are \"1\", and the remaining bits are \"0\". After the distance determination is completed, the neighbor discovery process enters the neighbor broadcasting process.