## 2 Adaptive Streaming Algorithm for Internet of Autonomous Vehicles
### Real-Time Streaming Bandwidth Allocation at the RSU  
When the RSU receives bandwidth requests for real-time streaming applications from autonomous vehicle passengers with scheduled arrivals at its managed segment, it initiates a preliminary evaluation. This assessment is conducted to verify whether the bandwidth provided by the base stations along the traversed segment is sufficient to meet the requirements of the streaming service. Should the available bandwidth upon the autonomous vehicle's arrival at the managed RSU segment prove inadequate for the streaming service requirements, this module engages in a reallocation process. It reassigns the previously designated bandwidth, which was initially allocated for concurrent on-demand streaming or 360-degree streaming preloads occurring during the same timeframe. This reallocation is aimed at accommodating the exigencies of the real-time streaming requirement. If, despite the mentioned bandwidth reassignment, the requirement for real-time streaming bandwidth remains unmet, the RSU employs an alternative approach. It establishes connections between the autonomous vehicle and other vehicles that have arrived at the same segment and are within the range of V2V communication. Through the establishment of a cooperative vehicle fleet, the final vehicle within the fleet acquires sufficient bandwidth from the base stations capable of meeting the streaming service requirements. Subsequently, the harvested bandwidth is transmitted from the last vehicle in the fleet to the requested vehicle via V2V communication. This collaborative strategy guarantees that the requested autonomous vehicle receives the essential bandwidth to effectively support the streaming service for its passenger, thereby enhancing the overall streaming experience. The steps executed by this module are as follows. * This module gives precedence to distributing the remaining bandwidth of base stations within the coverage area of the autonomous vehicle's route to the specific real time streaming service. If the service is a videotelephony, the module also allocates any unused upload bandwidth of the base stations to facilitate that videotelephony. If the available base station bandwidth is sufficient to fulfill the real-time streaming service's bandwidth requirement, the module completes its execution. If not, it moves to the next step. * This module reallocates the originally designated bandwidth, which is initially intended for other on-demand streaming or 360-degree streaming preloads occurring within the same time frame, to address the bandwidth requirements of the essential real-time streaming. * If the revised allocation effectively satisfies the bandwidth prerequisites of the real-time streaming service, this module advances to Step 6. However, if the adjusted allocation falls short of fulfilling the requirements, this module proceeds to the subsequent step in the sequence. * When the bandwidth needed for the real-time streaming service remains insufficient, the RSU communicates with any autonomous vehicle traversing the same road segment within the designated time frame. Through established connections between the vehicle utilizing the streaming service application and other autonomous vehicles, this module utilizes the equations listed below to identify base stations capable of providing the required bandwidth for the real-time streaming service. By harnessing the interconnections within this fleet of vehicles, the essential bandwidth is relayed from base stations possessing sufficient bandwidth capabilities to the passenger's autonomous vehicle using V2V communication. This collaborative strategy facilitates the delivery of the required bandwidth for the real-time streaming service. \[ \begin{split}\mathit{sbr}^{\sigma,A}_{\sigma^{\prime},A}=\left\{ \begin{matrix}\mathrm{b}\mathrm{r}^{\sigma,A}_{\sigma^{\prime},A}-1&\text{if }1\leq q^{\sigma,A},\;1\leq s^{\sigma,A}\leq S^{\sigma,A},\\ \underline{\mathrm{b}\mathrm{r}}^{A}&else\end{matrix}\right.\end{split}