Extending the ns-3 spatial channel model for vehicular scenarios

The next generation of wireless systems will enable vehicles to communicate among themselves and with the surrounding environment, thus providing the possibility to build cooperative and intelligent transportation systems. To design communication technologies that can cope with the requirements envisioned for future vehicular services, we need specific simulation tools to evaluate the system performance from an end-to-end perspective. Being one of the best known open-source network simulators, ns-3 represents the perfect candidate to perform this task. In this work, we describe the extension of the ns-3 Spatial Channel Model to enable the modeling of wireless channels in vehicular environments. Such extension is compliant with the 3GPP TR 37.885 specification and has been designed to be flexible and modular, thus improving the support for the simulation of next generation wireless systems.


INTRODUCTION
including the European Union [5]. Indeed, the benefits brought by C-ITS will have a significant impact on the society. For example, by jointly optimizing the route plans of the vehicles in the system it will be possible to avoid traffic congestion, thus saving driving hours and carbon emissions. Also, information received from other vehicles and road infrastructures can be used to enhance self-perception, thereby improving safety and awareness. Finally, fully automated driving will be a paradigm shift in transportation and public safety, reducing the risk of accidents and allowing people to use the time spent in their commutes.
Communication is a fundamental requirement to achieve the C-ITS vision, since vehicles need to exchange information and share the data captured by their on-board sensors with neighboring entities. Although different technologies for vehicular communications already exist, they are not able to satisfy the requirements envisioned to support future vehicular services [19]. For this reason, different standardization bodies, such as the 3rd Generation Partnership Project (3GPP) and the Institute of Electrical and Electronics Engineers (IEEE), have recently started to design new communication standards specific for vehicular scenarios.
In this context, network simulators such as ns-3 could play an important role, e.g., by allowing experts to evaluate the performance of their solutions without the need for a real prototype, thus saving money and time. However, the reliability of simulation tools strongly depends on the accuracy of the models used, which should be detailed enough to capture all the phenomena affecting the system behavior [20]. In case of wireless systems, the modeling of the communication channel is of primary importance to perform reliable simulations, since the overall performance depends on how signals propagate through the environment. This aspect is critical in vehicular scenarios, where both the transmitter and the receiver may move and cause fast variations of the channel impulse response.
Recently, ns-3 has been enriched with the addition of a stochastic Spatial Channel Model (SCM) [21] implementing the 3GPP TR 38.901 specifications [3]. Thanks to the wide frequency range, which goes from 0.5 to 100 GHz, and the possibility to model different propagation environments (e.g., urban, rural, and indoor scenarios), this framework represents a flexible and complete tool for the simulation of cellular systems. However, despite being very general, this model lacks support for mobility of both ends and is not able to characterize the peculiarities of vehicular environments. To fill this gap, the 3GPP published TR 37.885 [4], which extends TR 38.901 to include the support for the modeling of vehicular channels. In this work, we describe the extension of the ns-3 SCM following the guidelines provided in TR 37.885. The models described in this paper have already been integrated in the ns-3 codebase and have been included in the latest release, ns-3.33. Thanks to this extension, ns-3 now features the modeling of Vehicle-to-Everything (V2X) links in different propagation scenarios.
This paper is structured as follows. In Section 2 we review the state of the art about channel modeling in vehicular environments. In Section 3 we describe the 3GPP channel modeling framework and its extension for vehicular scenarios. In Section 4 we describe how we extended the ns-3 SCM to enable the simulation of vehicular communications. In Section 5 we provide some examples and discuss about the possible use cases. Finally, in Section 6 we draw the conclusions and discuss about future works.

VEHICULAR CHANNEL MODELS
Channel modeling is a fundamental task for the design and evaluation of future wireless networks. While channel modeling for wireless communications has been widely studied since the introduction of personal and mobile communications (considering fixed-to-mobile communications), vehicular channel modeling has only a decade of investigation that started with the introduction of C-ITS and Public Safety concepts into the vehicular environments. In case of mobile-to-mobile communications, both the transmitter and the receiver can be in motion, leading to a higher temporal variability of the channel compared to traditional cellular networks, and the elevation of the antennas is much lower, leading to a higher probability of a link being blocked due to the presence of surrounding elements (buildings, other vehicles, pedestrians, platforms, etc.). As such, vehicular channel modeling is more peculiar and challenging. In addition, with the recent evolution and progresses of radio access technologies that enable V2X communications (i.e., Dedicated Short Range Communications (DSRC), standardized by IEEE in 802.11p and 802.11bd, Cellular V2X (C-V2X), based on 3GPP LTE Rel-14 and Rel-15, and NR V2X, standardized by 3GPP in Rel-16 based on 3GPP NR Rel-15), new technology enablers have been included into the vehicular environment. For example, the use of antenna arrays at the vehicles is considered to improve the communication reliability and range. Also, both IEEE 802.11bd and NR V2X envision the use of high carrier frequencies in the millimeter wave (mmWave) spectrum for some V2X applications, like those that require a short transmission range and high to very high throughput, which needs again the use of large antenna arrays to overcome pathloss at high frequencies. These new enablers call for a channel model that considers the spatial dimension, with a full 3D model, capable of characterizing the diversity of the channel paths for each pair of antenna elements between the transmitter and the receiver.
These different challenges have motivated considerable efforts in vehicular channel modeling. Several measurement campaigns have been carried out to model the propagation and fading in the 5.9 GHz ITS band [6,7,10,14,17]. Other more recent works have performed measurement-based modeling in the unlicensed 2.4 GHz and 5 GHz bands, as well as in mmWave bands [15,18]. These measurement campaigns have then led to different families of channel characterizations for vehicular networks, generally given by the combination of propagation loss, shadowing and small-scale fading models. The different approaches differ for their degree of abstraction, simplicity and accuracy. Analytical studies generally use simple propagation loss models, combined with a statistical model for the small-scale fading, using Rayleigh, Rician, and Nakagami-m fading [12]. Tapped delay line (TDL) models use different statistical models for the different multipath components, so that each multipath component is treated separately, and can also account for the Doppler effect, thus leading to a better accuracy [7,8,17]. The statistical models and TDL models are generically referred to as non-geometry based stochastic channel models, because the vehicular channel is described by statistical parameters without reference to the geometry of the scenario [12]. These models are computationally efficient, but fail to capture the spatial dimension of the channel and the specific environment that surrounds the vehicle, such as different buildings or objects that appear as the vehicle moves.
On the other hand, geometry-based channel models do consider the environment scenario and can encompass multi-antenna systems due to the use of clusters and rays to characterize the channel. They can follow deterministic or stochastic models [13]. In geometry-based deterministic models, the actual geometry of the scenario is considered thanks to the use of ray tracing tools. As such, they are very accurate in specific scenarios, but their complexity increases dramatically with the number of interactions with surrounding objects. In geometry-based stochastic channel models, the geometry of the propagation environment is generated according to specified statistical distributions that take into account the geometric description of the environment, thus achieving a better balance between complexity and accuracy. 3GPP has developed geometry-based stochastic channel models, for both typical cellular scenarios (TR 38.901) [3] and vehicular scenarios (TR 37.885) [4].
The only ns-3 models available for device-to-device communications are included in the buildings module, wrapped up in the Hybrid3gppPropagationLossModel class and stored in a separate codebase [16]. Such models are aligned with 3GPP TR 36.843 [1] and TR 36.814 [2], valid for 0.15 to 2 GHz carrier frequencies. The class combines different propagation conditions, including indoorto-indoor, outdoor-to-outdoor, and outdoor-to-indoor propagation models for device-to-device communications. Although models are available for pathloss and shadowing, they do not include smallscale fading nor the Doppler effect, and cannot be applied to other carrier frequencies envisioned for V2X.

3GPP V2X CHANNEL MODEL
3GPP TR 38.901 [3] describes a stochastic modeling framework which enables the simulation of 3D Multiple-Input Multiple-Output (MIMO) channels. It has been obtained by combining multiple models developed by different groups and projects, resulting in a flexible and modular tool, which can be used to evaluate the performance of emerging communication technologies. Indeed, it supports carrier frequencies between 0.5 and 100 GHz and provides an accurate characterization of signal propagation in different environments, including urban, rural, and indoor scenarios. Also, it includes a custom model for antenna arrays, which accounts for the non-isotropic behavior of real radiators. This framework accounts for both large  scale (pathloss and shadowing) and small scale (fast fading) phenomena, and allows users to select different models and parameters depending on the scenario that needs to be simulated. In this framework, the wireless channel between two devices is represented by a U × S complex matrix H(t, τ ), where U and S correspond to the number of transmit and receive antenna elements. Each entry H u,s (t, τ ) represents the impulse response of the channel between the u-th element of the transmit antenna and the s-th element of the receive antenna as a function of time t and delay τ . To model the presence of reflections from the scattering environment, the impulse responses are generated through the superposition of different multipath components, which arrive/depart from the antenna array with certain power and angles. The multipath components are grouped into N clusters, each including M rays. Rays belonging to the same cluster have similar characteristics.
The overall framework has three main components: (i) the channel condition model, which determines the Line of Sight (LOS)/Non Line of Sight (NLOS) channel state, (ii) the propagation loss model, which accounts for the pathloss and shadowing effects, and (iii) the fast fading model, which accounts for the Doppler effect and the presence of multipath propagation. A step-wise procedure describes how to apply the different components in order to generate the channel matrix.
Despite representing one of the most general tools in this field, this framework still has some limitations which may prevent its applicability in certain contexts. For instance, as a design choice, it supports mobility at a single end of the link, and therefore is not suitable for the simulation of Vehicle-to-Vehicle (V2V) or deviceto-device communications, where both end points can move. To overcome this constraint, it is possible to follow the guidelines described in Section 6.3 of TR 37.885 [4], which extends TR 38.901 by adding the possibility to model V2V links. The extended model supports mobility of both end terminals and specifies an additional Doppler component to account for the presence of scattering in high mobility environments. For a better modeling of vehicular blockages, the standard introduces a new channel state, i.e., Non Line of Sight-v (NLOSv), which represents a situation in which the direct path between the transmitter and the receiver is obstructed by a vehicle.
Moreover, it defines two new scenarios to model V2V propagation, i.e., V2V-Urban, which targets vehicular channels in urban environments, and V2V-Highway, which instead targets vehicular channels in highway environments. For each scenario, new channel condition models, propagation models, and fast fading parameters capturing the characteristics of the two environments have been defined.
TR 37.885 also indicates which channel models (including pathloss, shadowing, and fast fading modeling) are used for V2X links different than V2V. This includes all the different node pairs that can be encountered in V2X scenarios, i.e., V2P (vehicle to pedestrian), P2P (pedestrian to pedestrian), V2R (vehicle to road side unit), R2R (road side unit to road side unit), V2B (vehicle to base station), P2B (pedestrian to base station), and B2R (base station to road side unit). In particular, TR 37.885 defines the models for V2V, and then states the V2X links for which the V2V model applies and which models are used otherwise. A summary is provided in Table 1.

NS-3 IMPLEMENTATION
In our previous work [21], we introduced a new spatial channel model for ns-3 which implements the guidelines described in TR 38.901. This model, first released in ns-3.31, has been developed using the interfaces provided by the propagation and spectrum modules, thus obtaining a flexible tool which can be easily adopted by any other ns-3 module. Also, its modular design allows users to customize it depending on the specific use case, for example by adjusting the parameters to obtain a tradeoff between accuracy and computational time, or by adding new scenarios of interest.
In the following, we will review the different components of the model and describe how they have been modified or extended to enable the simulation of vehicular propagation environments. Thanks to this extension, ns-3 now supports the modeling of the different V2X links reported in Table 1, both in urban and highway scenarios. An overview of the changes we made is provided in Figure 1, which shows a UML diagram representing the code architecture, where we highlighted the new classes and those that have been modified.

Channel Condition Models
The 3GPP TR 38.901 framework characterizes the wireless channel between two nodes using a two-state definition. The LOS state represents a situation in which the direct path between the transmitter and the receiver is not obstructed, while the NLOS state accounts for blockages due to buildings. The state is randomly drawn with a certain LOS probability, which depends on the propagation scenario and on the distance between the two nodes.
To capture the peculiarities of signal propagation in vehicular environments, TR 37.885 extends this definition by introducing a new state, referred to as NLOSv, whose aim is to represent a situation in which the direct path is blocked by a vehicle. Moreover, it defines a new procedure to determine the channel state. First, the model checks whether the direct path is blocked or not by looking at possible obstructions due to buildings. If the path intercepts one or more buildings, the channel is in the NLOS state. Instead, if there are no buildings along the path, the model computes the LOS probability and randomly chooses between LOS and NLOSv states. As can be seen in Table 2, the LOS probability depends on the distance between the communicating vehicles (d) and the formula is different depending on the scenario of interest.
To represent the state of the channel between two nodes, the ns-3 SCM uses the class ChannelCondition, which has been extended to account for the new NLOSv state. Also, we extended the ThreeGpp-ChannelConditionModel interface by developing two new classes, ThreeGppV2vUrbanChannelConditionModel and ThreeGppV2vHigh-wayChannelConditionModel, which implement the procedure to determine the channel state for the V2V-Urban and V2V-Highway scenarios, respectively.
To determine the presence of obstructions due to buildings, these classes exploit the functionalities provided by the ns-3 buildings module. Indeed, by creating an instance of the Building class, ns-3 makes it possible to model the presence of a building in the scenario. The proposed models look through the list of Building objects that have been instantiated, and compute the interceptions between the perimeter of each building and the path connecting the communicating nodes.
Clearly, the computation time needed to determine the channel state increases with the number of buildings, making it difficult to simulate large scale scenarios. To overcome this limitation, we developed the classes ProbabilisticV2vUrbanChannel-ConditionModel and ProbabilisticV2vHighwayChannelCondi-tionModel which implement the fully probabilistic model described in [9], thus removing the need for the deterministic characterization of the NLOS state. These classes can be used as an alternative to ThreeGppV2vUrbanChannelConditionModel and Three-GppV2vHighwayChannelConditionModel.

Pathloss and Shadowing
The pathloss and shadowing models included in TR 37.885, reported in Table 3, are specifically designed to account for the propagation loss of V2V wireless links as a function of the carrier frequency (f ) and the distance between the two nodes (d). While the characterization of the LOS and NLOSv state is different for V2V-Urban and V2V-Highway, the NLOS pathloss equation is the same for both scenarios. Moreover, NLOSv is modeled as LOS, but with the addition of a loss component defined as B v = max{0, B v }, where B v is a random variable with log-normal distribution and whose parameters depend on the height of the blocking vehicle. If the blocker is taller than both vehicles, B v has mean 12.5 dB and standard deviation 4.5 dB. Instead, if the blocker is taller than only one of the vehicles, B v has mean 5 dB and standard deviation 4 dB. Finally, if the blocker does not intercept the direct path between the communicating vehicles, no additional loss is considered. The blocker height is selected between 1.6 m, if it is a passenger vehicle, or 3 m, if it is a truck. The choice is random and depends on the percentage of trucks in the scenario, which is a model parameter.
The shadowing effect is characterized through the addition of the log-normal loss component X , with zero mean and a standard deviation of 3 dB if the channel state is LOS or NLOSv, or 4 dB if the state is NLOS. Also, the shadowing component is spatially correlated with an exponential autocorrelation function which accounts for the distance between vehicles, as well as the channel state and the propagation environment.
To implement the pathloss and shadowing models described in TR 37.885 we used the base class ThreeGppPropagationLossModel, provided by the ns-3 SCM, which handles the main logic for the computation of the different loss components. In particular, we developed the classes ThreeGppV2vUrbanPropagationLossModel and ThreeGppV2vHighwayPropagationLossModel which extends the base class and implements the models for V2V-Urban and V2V-Highway scenarios, respectively. The attribute PercType3Vehicles, common to both classes, can be used to specify the percentage of trucks in the scenario.

Fast Fading
As represented in Equation 1, the channel impulse response H u,s (t, τ ) at time t and delay τ is obtained through the superposition of N clusters, each composed of M rays. Rays belonging to the same cluster have similar characteristics, i.e., they have similar angle of arrival (θ A n,m , ϕ A n,m ) and departure (θ D n,m , ϕ D n,m ), and experience the same power P n and propagation delay τ n . The terms F(θ n,m , ϕ n,m ) represent the transmitter and receiver antenna field patterns, which account for the non-isotropic behavior of real antennas, while the term K −1 n,m accounts for the cross polarization effect between the vertical and horizontal field components. The terms exp(jk Td ) represent the array responses of the transmitting and receiving antennas, wherek is the wave vector andd is the element location vector. Finally, the term ν n,m accounts for the phase shift caused by the Doppler effect and is equal to: T r x ,n,mvr x +r T t x ,n,mvt x λ 0 if n is the LOS cluster r T r x ,n,mvr x +r T t x ,n,mvt x +2α n,m D n,m λ 0 otherwise wherer T r x ,n,m andr T t x ,n,m are the spherical unit vectors corresponding to the arrival and departure angles,v r x andv t x are the velocity vectors of the receiver and the transmitter, D n,m is a random variable with uniform distribution in [−v scat t , v scat t ] (v scat t corresponds to the maximum speed of the vehicles in the layout), α n,m is a random variable with uniform distribution in [0, 1], and λ 0 is the wavelength corresponding to the carrier frequency. The addition of a random component in the Doppler term for the reflected paths has been made to consider the strong environmental scattering that can be experienced in vehicular scenarios, where the metal coating of the cars may completely reflect the signal.
To deal with the 3GPP fast fading model, the ns-3 SCM provides the classes ThreeGppChannelModel, implementing the procedure to compute the channel impulse response, and ThreeGpp-SpectrumPropagationLossModel, which interacts with the fast fading and antenna models to compute the channel gain. We modified these classes to include the features provided by TR 37.885, without changing the default model behavior to ensure complete backward compatibility. In particular, we included the new sets of parameters for V2V channels, which can be selected by setting the attribute Scenario to "V2V-Urban" or "V2V-Highway." Also, we updated the computation of the Doppler component and defined the attribute Vscatt in the class ThreeGppSpectrumPropaga-tionLossModel, through which users can configure the parameter v scat t . The default value is set to 0, so that no additional random component is considered in the Doppler term.

EXAMPLES AND USE CASES
In this section, we present a preliminary performance evaluation which showcases the use of the proposed model and discusses possible use cases.

Examples
In our evaluation, we focused on corroborating the quality of the implemented model while, at the same time, highlighting the available features. To do so, in Section 5.1.1 we present the results obtained with three-gpp-v2v-channel-example, a script that has been included among the ns-3 examples to demonstrate how the proposed model can be used to extract channel metrics. In addition, using MilliCar [11], the ns-3 module for NR V2X networks, we designed a schematic scenario to acquire full-stack results using the new vehicular channel model, which we described in Section 5.1.2.  . It provides the possibility to configure the distance between the communicating nodes, carrier frequency, transmission power, noise figure, and select the V2V-Urban or V2V-Highway propagation scenario. By making use of the classes described in Section 4, it computes the channel state, the propagation loss (which includes both pathloss and shadowing), and the SNR. In our evaluation, we considered a transmitter with transmission power of 30 dBm and antenna height of 1.7 m, and a receiver with noise figure of 9 dB and height of 1.5 m. First, we placed the two nodes at a distance of 40 m and computed the average propagation loss by varying the carrier frequency between 0.5 and 100 GHz. Then, we set the carrier frequency to 28 GHz and evaluated the same metric by varying the distance between the nodes, from 40 to 600 m. In both cases, we performed 1000 independent simulations.
In Figures 2 and 3, we show the results obtained for different channel states in the V2V-Urban and V2V-Highway scenarios, respectively. It can be seen that the propagation loss increases with the distance and the carrier frequency, and is highest in NLOS conditions. The propagation loss experienced in NLOSv is between the LOS and NLOS states, as expected, and increases with the percentage of trucks in the scenario. To check the correctness of our implementation, we compared the average propagation loss in LOS and NLOS with the pathloss curves obtained using the equations in Table 3 and plotted as black-dashed lines.
Moreover, we used the same example to visualize the average LOS probability, propagation loss and SNR as 2D heatmaps. In this case, we performed 150 independent simulations. For the V2V-Highway scenario, we considered a road segment of 400 m, while for the V2V-Urban scenario we considered a 680× 680 m grid with 16 buildings of size 150×150 m and with a height of 10 m. In both cases, the transmitter was placed at position (0,30) for V2V-Highway and (0,0) for V2V-Urban. The results we obtained are reported in Figures 4 and 5.
It has to be highlighted that a LOS probability equal to 0 corresponds to the NLOSv condition, as NLOS is determined in a deterministic way, based on the presence of buildings, as indicated by the red areas in Figure 4a. We notice that as the distance between the communicating devices increases, the LOS path will almost certainly be blocked by another vehicle and, as a consequence, pathloss grows and SNR sinks.   In our evaluation, we considered two devices located in an urban grid, as represented in Figure 6. The transmitter generates UDP packets of 1024 bytes with an inter-packet interval of 60 µs, for an overall traffic of 137 Mbps. The channel was configured to operate at a frequency of 28 GHz, using a 100 MHz bandwidth, and was set to use the V2V-Urban equations. During the simulation, the Modulation and Coding Scheme (MCS) is adapted based on the channel estimates. The two vehicles start at a distance of 1 m, the transmitter in front of the receiver positioned at (0,0). The receiver proceeds at a 30 km/h speed, while the transmitter at 60 km/h, increasing in this way the inter-vehicle distance as the simulation goes on. At the first crossroads, after 10.3 s from the beginning of the simulation, the transmitter turns to the left and a building obstructs the LOS path.
In Figure 7 we represented the behavior of the SNR, as well as the end-to-end throughput and delay, experienced during the simulation. The SNR decreases as the distance between the vehicles increases, and experiences variations that are caused by the multipath and Doppler effects. When the transmitter turns left, the SNR suddenly drops from 50 to 19 dB because the channel state condition passes from LOS to NLOS. A degradation of the SNR leads to a higher packet loss, which causes a deterioration of the end-to-end communication performance: indeed, the throughput decreases by as much as 70%, while the delay increases progressively up to 300 ms. In addition, small scale fading variations introduce further variability in the SNR, which translates in sudden changes in the used MCS as we can see from the throughput spike around 13 s.

Use Cases
The main goal of the developed model is to enable system-level simulations of 3GPP V2X scenarios through a 3GPP-compliant channel model that is valid for a wide range of carrier frequencies and is compatible with multi-antenna systems.
Moreover, it provides a common framework for simulations and coexistence studies of different technologies that share the spectrum resources, such as 3GPP and IEEE Radio Access Technologies (RATs) in dedicated/unlicensed spectrum bands. For example, it can be used to evaluate the 3GPP and IEEE RATs coexistence of IEEE 802.11p, IEEE 802.11bd, 3GPP LTE C-V2X, and 3GPP NR V2X.

CONCLUSIONS AND FUTURE WORK
In this paper, we described an extension of the ns-3 SCM to support the modeling of wireless channels in vehicular environments. The wide frequency range and the availability of models for urban and highway scenarios make this tool an excellent choice for the simulation of vehicular communication technologies. In Section 1 we introduced the importance of channel modeling and simulation tools, and in Section 2 we reviewed the state of the art about channel modeling for vehicular communications. In Section 3 we reviewed the 3GPP channel modeling framework and its extension for vehicular channels, and in Section 4 we described how this model has been implemented in ns-3. Finally, in Section 5 we presented some examples and discussed possible use cases.
We plan to further improve this work by developing a fully deterministic channel condition model, able to set the NLOSv and NLOS channel conditions based on the presence of other vehicles and buildings.