# An Emergency Message Routing Protocol for Improved Congestion Management in Hybrid RF/VLC VANETs
## 4 Algorithm Description
### Proposed Routing Protocol  
Algorithm 1 presents a high-level overview of the proposed routing protocol algorithm. ```
0: Traffic data \(T\), interference maps \(I\) at each RSU \(r_{i}\)
0: Optimal channel/beam assignments \(C\), \(V\)
1: Each RSU \(r_{i}\) initializes current assignments \(C_{i},V_{i}\)
2:Repeat
3:\(r_{i}\) calculates local cost \(J_{i}(C_{i},V_{i}|T_{i},I_{i})\)
4:\(r_{i}\) exchanges \(C_{i},V_{i},J_{i}\) messages with neighbors \(N(r_{i})\)
5:\(r_{i}\) computes \[(C_{i}^{\prime},V_{i}^{\prime})=\operatorname*{argmin}_{C_{i},V_{i}},\;\sum_{r _{j}\in N(r_{i})}J_{j}(C_{i},V_{i}|T_{j},I_{j})\]
6:\(r_{i}\) updates assignments \((C_{i},V_{i})\leftarrow(C_{i}^{\prime},V_{i}^{\prime})\)
7:Until convergence or max iterations reached
8:return optimal global assignments \((C,V)\)
```  
**Algorithm 1** Proposed Routing Protocol  
VLC can supplement RF for direct line-of-sight V2I links between vehicles and RSUs. This provides an additional path for message dissemination when vehicles are in proximity to an RSU. Both RF channels and VLC frequencies/beams are uniquely assigned to zones based on traffic, interference metrics, and availability of reflective surfaces, using graph coloring/bin packing algorithms. Schedules define hopping sequences for assigned RF/VLC resources and synchronize vehicles. Schedules defining RF/VLC resource hopping sequences are broadcast regularly by RSUs. Vehicles associate with the best RSU and synchronize to its schedule to know when/how to transmit and receive the assigned resources. In normal operation, beacons can be split between RF and VLC depending on LoS/NLoS between vehicle and RSU or the availability of reflective surfaces. Topology maps are built from beacons over both RF and VLC links, accounting for nodes reachable via reflections off surfaces. Topology maps enable the selection of optimal alternate relay paths between zones if direct links are obstructed, to extend the message dissemination. During incidents, the source simultaneously broadcasts over all assigned RF/VLC resources to maximize coverage, including via reflections to extend range. Nearby vehicles switch radios to emergency mode over RF to receive/relay messages via multi-hop routing. If the direct VLC link fails, reflective multipath VLC paths or the RF beam can be used based on maps to maintain connectivity. Multi-hop relays extend connectivity between zones using both RF and VLC paths, depending on direct/reflective link availability. In detail, our proposed routing protocol has the following steps:  
**Zones Identification**: RSUs partition coverage into zones \(ROI=ROI_{1},ROI_{2},...ROI_{l}\). **RSU Interference Maps**: The interference maps at each RSU represent the interference conditions at that location and would need to be determined through measurement and modeling. The interference map would contain interference level measurements (\(I_{i}\) metric) for each zone \(ROI_{i}\) over time. These measurements are likely collected by the RSUs periodically through RSSI/noise scans on different frequencies/channels in each zone. The maps provide input to the channel/frequency assignment functions \(f(T_{i},I_{i})\) and \(g(T_{i},I_{i})\) to account for interference limitations. Higher interference levels \(I_{i}\) in a zone would mean fewer channels could be reused there safely. The RSU interference maps collect RSSI, noise floor, and packet loss rate measurements. RSUs periodically scan channels by transmitting probing packets on each channel for a short time duration, while nearby vehicles listen and record signal strength, noise levels, and packet receipt success. These measurements are associated with spatial zones divided into grids, and stored in the map as averaged values per channel per zone over a given period. For new zones without vehicle data, typical values are assigned based on street proximity. The maps undergo rescan updates periodically, or more frequently if RSSI/noise exceeds thresholds. During updates, RSUs aggregate new vehicle measurement logs to refresh the averaged values.