## 2 Materials and Methods
### Neighbor RSU Discovery
In order to avoid repeating the same NDP packet on the same street, after a certain RSU sends out a broadcast packet \(pkt\) for discovering its RSU neighbors, vehicle nodes that receive this broadcast packet on newly detected streets do not immediately forward the packet, but keep silent for a period of random time before relaying the packet. If an NDP with the same \(SRC\_RSU\_ID\) and \(serial\_Number\) value as \(pkt\) is received again during the silent period, it indicates that the some vehicle node on the same street has forwarded the packet \(pkt\), so the vehicle node cancels forwarding each of them, otherwise it forwards \(pkt\) immediately after the silent period. For example, as shown in Figure 7, the dotted circle, the dashed circle, and the half-dashed circle are the signal coverage of \(RSU1\), vehicle node \(A\), and vehicle node \(B\), respectively. \(A\) and \(B\) on the street segment between \(RSU1\) and \(RSU2\) are within the signal coverage of \(RSU1\), so they can receive the broadcast packet sent by \(RSU1\). Suppose that \(A\) and \(B\) receive the packet \(rp\) sent by \(RSU1\), they do not immediately forward it, but each keep silent for a random period of time. Suppose \(A\) first ends the silent period and forwards \(rp\), and \(B\) receives the \(rp\) sent by \(A\) during the silent period and cancels the forwarding of each of them. Figure 6: Relay mode. The vehicle node forwarding packet will search the vehicle node on the same street, which is the farthest neighbor from the source RSU as the next hop. The operation continues until the packet is transmitted to the neighbor RSU. This procedure is shown in Algorithm 3, where the mode field of the NDP packet plays an important role, as explained from the following two aspects. ```
1:\(rp\leftarrow\) NDP packet received
2:\(sid\leftarrow\)this car's street ID;
3:\(cid\leftarrow\)this car's ID;
4:if\(sid\) is not in the set \(rp.set\_of\_Street\_ID\)then
5:if\(rp.mode\)==0 then
6: wait a random time;
7:if this car receives another NDP packet with the same value for \(rp.SRC\_RSU\_ID\) and \(rp.serial\_Number\)then
8: return;
9:endif
10:endif
11:endif
12:if\(rp.mode\)==1 and\(rp.DST\_CAR\_ID==cid\) or\(rp.mode\)==0 then
13:if a non-source RSU in the neighbor table then
14:\(rid\leftarrow\)the ID of the non-source RSU;
15:\(rp.DST\_RSU\_ID\gets rid\);
16:\(rp.SRC\_CAR\_ID\gets cid\);
17:\(rp.DST\_CAR\_ID\leftarrow\)empty;
18:\(rp.new\)\(Street\_ID\gets sid\);
19:\(rp.mode\gets 2\)
20:else
21:if a car \(dc\) that is in the neighbor table of this car, on the same street as this car, further away from the source RSU than this car, and farthest from the source RSU then
22:\(rp.DST\_RSU\_ID\leftarrow\)empty;
23:\(rp.DST\_CAR\_ID\leftarrow\)the ID of \(dc\);
24:\(rp.SRC\_CAR\_ID\gets cid\);
25:\(rp.new\)\(Street\_ID\gets sid\);
26:\(rp.mode\gets 1\)
27:else
28: store \(rp\) to message buffer queue of this car, and check the buffer queue and resend \(rp\) periodically
29:endif
30:endif
31:endif

Figure 7: Vehicle node forwarding. Firstly, when the source RSU starts to broadcast the NDP packet, the value of the mode field is set to 0. In this mode, the NDP packet will be broadcast from the RSU node to the nearby vehicle nodes, and the NDP packet has no determined forwarding target vehicle. There may be several vehicles receiving the NDP packets on the same street segment, and only one of them needs to forward it on the same street segment. Therefore, vehicle nodes will use a backoff algorithm to avoid repeating the forwarding of NDP packets on the same street segment. Assuming that the first vehicle selected for forwarding the NDP packet on a certain street segment is called \(SC\), if there is a non-source RSU in the neighbor table of \(SC\), it means that the distance between the two RSUs is very close, and the neighbor RSU can be reached by forwarding packets through only one vehicle (of course, it is very rare for these RSUs to be so close in actual deployment).