# Supporting Immersive Video Streaming via V2X Communication
## 2 Bandwidth Allocation for Diverse Streaming Services in V2X Communication
### Bandwidth Allocation for Non-Real-Time Applications  
Since the video content of a non-real-time application is stored on the servers of application software providers, video segments can be pre-downloaded to the memory of the requesting passenger's vehicle when bandwidth is abundant. This module adjusts the ratio of pre-downloaded video segments based on the remaining travel time and network conditions, and inversely adjusts according to the proportion of remaining segments stored in the vehicle. When the network is uncongested, RSUs can allocate more bandwidth to pre-download additional segments for the passenger's later viewing. This approach helps avoid yielding bandwidth to real-time applications in congested road segments and prevents service interruptions or quality degradation of non-real-time videos. Conversely, when the network is crowded, this module reduces the number of pre-downloaded segments to free up bandwidth for serving more users. The execution steps of this module are as follows:  
* Considering the specifications of the base and enhancement layers of the non-real-time video, network conditions, the remaining travel time of the vehicle, and the number of remaining segments stored in the vehicle's memory, the bandwidth allocated to the non-real-time application \(v\) for the remaining route can be calculated as follows: \[\text{Max}(\overline{s}^{\sigma,v}),\] (35) subject to: \[\delta_{\tau_{\varsigma}^{\sigma,v}}\cdot\Delta\cdot\sum_{\emptyset\sigma^{ \prime}}db_{\tau_{\varsigma}^{\sigma,v}}^{\sigma,v}\geq sl_{\varsigma}^{\sigma,v}\cdot\left(dvr_{\overline{t}_{\varsigma}^{\sigma,v}}^{\beta}+dvr_{\overline{ t}_{\varsigma}^{\sigma,v}}^{\varepsilon}\right)\cdot\text{f}^{\sigma,v},\quad 1 \leq\delta_{\tau_{\varsigma}^{\sigma,v}},\;is^{\sigma,v}\leq s\leq\overline{s}^{ \sigma,v},\] (36) \[1\leq is^{\sigma,v}\leq\overline{s}^{\sigma,v}\leq\overline{s}^{ \sigma,v}\leq S^{\sigma,v},\] (37) \[\tau_{1}^{\sigma,v}=spt^{\sigma,v},\] (38) \[rt_{\varsigma_{1}^{\sigma}}<spt^{\sigma,v}<ept^{\sigma,v}\leq rt_{ \varsigma_{1}^{\sigma}},\] (39) \[CurTime<\tau_{is^{\sigma,v}}^{\sigma,v},\] (40) \[ept^{\sigma,v}\leq rt_{\varsigma_{1}^{\sigma}}\leq CurTime+\sum_{s=1\
eq v,s}^{\sigma,v}sl_{\varsigma}^{\sigma,v},\] (41) \[spt^{\sigma,v}\leq\tau_{\varsigma}^{\sigma,v}<\tau_{\varsigma}^{\sigma,v}+ \delta_{\tau_{\varsigma}^{\sigma,v}}\cdot\Delta<ept^{\sigma,v},\;is^{\sigma,v} \leq s\leq\overline{s}^{\sigma,v},\] (42) \[rt_{\varsigma_{1}^{\sigma}}\leq\tau_{\varsigma}^{\sigma,v}\leq rt_{ \varsigma_{1}^{\sigma}+1},\;\text{if}\;\rho_{\varsigma_{1}^{\sigma},t_{1}^{ \sigma}}\leq\varrho,\;1\leq i<h^{\sigma}\] (43) \[dvr_{\varsigma_{1}^{\sigma},v}^{\beta}=dvr_{\varsigma_{1}^{\sigma},v}^{ \Sigma}=vl_{\sigma_{1}^{\sigma,v}},\quad is^{\sigma,v}\leq s\leq\overline{s}^{ \sigma,v},\] (44)\[\delta_{\tau_{\varsigma}^{\sigma,v}}\cdot\Delta\cdot\sum_{\emptyset\sigma^{ \prime}}db_{\tau_{\varsigma}^{\sigma,v}}^{\sigma,v}\geq sl_{\varsigma}^{\sigma,v}\cdot\left(dvr_{\overline{t}_{\varsigma}^{\sigma,v}}^{\beta}+dvr_{\overline{ t}_{\varsigma}^{\sigma,v}}^{\varepsilon}\right)\cdot\text{f}^{\sigma,v},\quad 1 \leq\delta_{\tau_{\varsigma}^{\sigma,v}},\;is^{\sigma,v}\leq s\leq\overline{s}^{ \sigma,v},\]0  
where \(\overline{s}^{\sigma,v}\) represents the number of video segments of \(v\) that this module allows pre-downloading, \(\tau_{s}^{\sigma,v}\) is the time for pre-downloading video segment \(s\) of non-real-time application \(v\), \(S^{\sigma,v}\) denotes the total number of video segments for \(v\), and \(is^{\sigma,v}\) stands for the index of the first video segment that has not been downloaded yet. \(db_{\tau_{s}^{\sigma,v}}^{\sigma,v}\) is the bandwidth provided by the CF XL-MIMO access point \(\vartheta^{\sigma,v}\) for pre-downloading \(v\) during time \(\tau_{s}^{\sigma,v}\) over duration \(\Delta\), and \(\delta_{\tau_{s}^{\sigma,v}}\) is the number of time slots for consecutive downloading of video segments within the communication range of \(db_{\tau_{s}^{\sigma,v}}^{\sigma,v}\).