Novel radio environment map for the ns-3 NR simulator

Radio Environmental Map (REM) is a useful tool to visualize the network coverage, including signal quality and interference, in multi-cell scenarios. Although REM maps for omnidirectional transmissions/receptions and tools to visualize the spatial shape of a single directional transmission are available in ns-3, for example in the Long Term Evolution (LTE) and WiGig modules, respectively, REM maps for directional transmissions/receptions in multi-cell scenarios are not available yet, despite the fact that they constitute an extremely useful tool for the beam design phase in complex realistic settings. In this paper, we present a REM map implementation that includes various REM map definitions for multi-cell scenarios with directional transmissions/receptions. This includes Beam Shape REM maps, in which a pre-configured beam at each transmitting device is used, and Coverage Area REM maps, in which a worst-case propagation scenario is considered for each location, assuming the worst-case directional interference towards each point of reception of the REM map. We particularize REM maps for Downlink (DL) and Uplink (UL) communications, as well as for heterogeneous networks and scenarios with blockages originated by the surrounding environment. Finally, we present multiple illustrative images as examples of each of the possible REM maps that can be extracted with the newly developed tool. The work presented in this paper is publicly available in the 5G-LENA module.

directional transmissions, such as the Q-D Visualizer presented in [3] and [4], while works on visualization tools for multi-cell directional transmissions are still lacking design and implementation. As a result, in this paper we present a novel design for a REM implementation in the ns-3 5G-LENA module through the class NrRadioEnvironmentMapHelper, which takes into consideration the following aspects: • Antenna array configuration • A pair of devices and their corresponding antenna array Another limitation of the LENA REM implementation, inherently related to LENA current capabilities, is that it does only support Frequency Division Duplexing (FDD) mode, in Downlink (DL), while the NR module supports both FDD and Time Division Duplexing (TDD) modes. As such, we have opted for a flexible implementation that allows the visualization of various types of maps, considering both DL and Uplink (UL). For this reason, NrRadioEnviron-mentMapHelper has been designed to be independent of the type of transmitting device (gNB/UE), while LENA REM offers only the eNB perspective. More details behind this choice are given in the next sections.
Based on the above, we define two general cases for the 5G-LENA REM: (1) Beam Shape REM: the REM is generated for a user-defined configuration of beamforming vectors for each transmitting device, i.e. the REM shows the actual/effective coverage map in the user's scenario (like how REM feature is used in LENA). (2) Coverage area REM: the beams are reconfigured for each REM Point in order to visualize the coverage area in terms of SNR and SINR (5G-LENA specific REMs).
The rest of the paper is organized as follows. Section 2 presents the different REM maps that can be generated and explains each one of them in detail. Section 3 gives the implementation details. A description of the examples and use cases is given in Section 4. Section 5 includes examples of the various REM maps, as well as illustrates the importance of these maps. Finally, the most important conclusions are drawn in Section 6.

RADIO ENVIRONMENT MAP FOR NR MODULE
The design of the 5G-LENA REM has been envisioned to provide a mechanism that allows the network status visualization through various types of maps, depending on the specific user's requirements. In order to provide this flexibility, the following terminology has been introduced: As such, RTD and RRD can be any device (either gNB or UE), opening the possibility to visualize various types of maps, such as DL, UL and mixed case REMs, useful for example for TDD deployments.
Notice that for the case of DL REM, RTDs will be the gNBs of the network, while RRD will be the UE of interest. For the UL REM, RTDs will be the UEs of the network, and RRD will be the gNB of interest, while for the mixed DL/UL case RTDs can be a mix of gNBs and UEs and RRD can be either the gNB or the UE of interest.
With this approach 5G-LENA REM supports FDD/TDD scenarios, only DL or only UL, and mixed DL/UL representations (maps). Moreover, we define as REM Point a point in the map that corresponds to the positions for which the calculations will take place (these positions are defined by the user using the parameters: x Min, x Max, y Min, y Max, and Resolution), considering as receiving device at that point the RRD defined by the user, and as REM Value the metric that is represented on the REM map. The metrics that can be represented are: 1) the SNR, 2) the SINR, and 3) the Interference Power Spectral Density (IPSD). The desired metric(s) to visualize is chosen by the user. SNR and SINR metrics are widely used in 3GPP and IEEE evaluations. However, we have also included IPSD [14], which is a metric that can be particularly useful for cases of spectrum sharing scenarios, where we want to understand the level of aggregated interference in a certain frequency band and in every point of the map.
The SNR is calculated at the -th REM Point based on the following formula: where SNR , is the SNR computed at the -th REM Point considering the signal from the -th RTD, , is the received power at the -th REM Point from the -th RTD, and is the noise power. Note that the received power , (w tx, , w rx, ) is a function of the beamforming vector of the -th RTD (w tx, ) and the beamforming vector of the RRD device at the -th REM point (w rx, ). In the expression, for each -th REM Point, we select the maximum SNR among the different possible RTDs (i.e., among different ).
On the other hand, the SINR at the -th REM Point is calculated according to: where SINR , is the SINR computed at the -th REM Point considering the signal from the -th RTD as useful signal and the rest of RTDs as interferences. , is the interference power received at the -th REM Point from the -th RTD. Note that each of the interference power terms ( , , ≠ ) depends on the beamforming vector used at each of the interfering RTDs (w tx, ). Also for the SINR computation, we select the maximum SINR among the different possible RTDs.
The IPSD corresponds to the aggregated received power of all signals at the -th REM Point (treated as interference) and is calculated according to: where corresponds to the total number of RTDs. As such, with this metric we can represent the total aggregated interference seen in a certain point of the map. Let us notice that REMs are calculated in the XY plane, and the height of the plane is the height of the selected RRD (gNB or UE). Based on the above, we have defined the specific REM cases: DL/UL Beam Shape, DL Coverage Area and UE UL Coverage, which are presented in detail in the following subsections. The REM Helper can be easily extended to support additional types of maps.

DL Beam Shape Map
The Beam Shape map considers a specific configuration of the beamforming vectors for each device (for each RTD in DL), as defined by the user in the scenario script for which the REM maps (SNR/SINR/IPSD) are generated. The Beam Shape map is a multidevice single-beam REM type, i.e., the user can visualize, in terms of SNR/SINR, the shape of the configured beams.
The map shows the shape of a specific beam for a specific UE and for a specific scenario (i.e., the scenario for which the REM is created) with respect to the SNR/SINR (REM Value) in each REM Point. For example, the user can select a specific pair of gNB and UE, and then create the DL Beam Shape map. In case there is a single transmitting device, only the SNR map will be generated according to equation (1). This kind of REM can be a useful tool for the user in order to configure the antenna array parameters through visualization of the current configuration, such as antenna array dimensions (rows, columns), bearing and down-tilt angles, element gain, horizontal/vertical spacing, etc.
In addition, the user can select multiple gNB devices and represent a specific beam configuration for each one of them. In this case two maps are generated, one where the REM value is the SNR and another one where the REM Value is the SINR. In the former case, the beams of the selected gNBs of the network towards the selected UEs are visualized as if no interference is present in the network (according to equation (1)), while in the latter case, calculations include the interference among the selected gNBs based on equation (2).

DL Coverage Area
The Coverage Area REM is a multi-device multi-beam REM type (in DL), where the beams are reconfigured during the map generation for each REM Point in order to visualize the coverage area in terms of SNR, SINR and IPSD.
Two general case maps are provided: • Best SNR Coverage Area map considers and visualizes, the best available beam in the ideal case where interference is not present in the network and the RRD can attach to the best RTD at each time. Calculations of the best SNR are carried out according to (1), where, for each -th RTD, we select the beamforming vector (w tx, ) that maximizes the SNR , . That is, assuming each RTD (gNB in the DL case) it steers its antennas towards the REM Point. • Worst-case SINR Coverage Area map considers a worst case scenario where all the other RTDs (gNBs in the DL case) are steering its antenna arrays towards the RRD device at each REM point and transmitting at the same time. As a result, this map shows the coverage area for a beam-pair in high interference conditions. The SINR for this kind of map is calculated, for the -th REM Point, according to (2), where SINR , is derived assuming that all the beamforming vectors (of useful RTD and interfering RTDs, i.e., w tx, and {w tx, }) point towards the -th REM Point, and so we have a worst-case interference condition.
These types of maps help identify the best gNB to associate with, and offer a general picture of the signal and interference under good and bad conditions. On the other hand, the IPSD map provides information related to the aggregated interference that the tested network topology can generate to nodes of the same or other technologies in spectrum sharing environments.

UL Maps
As already discussed, the NrRadioEnvironmentMapHelper offers the opportunity to generate maps either for the DL or the UL direction. An UL map can be generated by passing to the REM Helper as desired transmitting device(s) (RTD(s)) the UE(s) of interest and as receiving device (RRD) the gNB of interest. In this way, the user can visualize the SNR, SINR and IPSD of the UE(s) signal(s) received at the gNB side. From a network information perspective what has more sense in the UL is the Beam Shape map, however, the simulator allows the configuration of both maps also in the UL (Beam Shape and Coverage Area). This kind of UL Beam Shape map provides the user with a visualization of the UL network interference, while it is of particular interest for the study of the IPSD in spectrum sharing scenarios [8,11].

UE UL Coverage
UE UL Coverage is an UL map where the RTD is the UE of interest and the RRD is the gNB to which it is connected each time, while the rest of gNBs (if they are present) are pointing their beams towards each REM Point. This map allows the visualization of the coverage area of the UE of interest, while at the same moment gives the possibility to add interference from the DL gNB device(s) to study a worst-case mixed FDD-TDD scenario. Notice that the UE UL Coverage map is different from the DL Coverage Area map since the receiver is a fixed or static device, in this case the gNB, and the transmitter is a selected UE device whose UL coverage we would like to visualize. Hence, this map shows the metrics for the UL signals of the selected UE device for the selected area with respect to the selected receiving gNB device.

Coverage Hole Visualization
Finally, NrRadioEnvironmentMapHelper allows also the visualization of coverage holes created when buildings are included in the network deployment. The user is able to evaluate the impact of the buildings in the signal transmission and how the ideal beam coverage area is affected in case of directional transmissions (i.e. when beamforming is employed).

NR NS-IMPLEMENTATION CONSIDERATIONS
The implementation of the REM Helper in the 5G-LENA module follows the design depicted in Figure 1. In particular, the class NrRa-dioEnvironmentMapHelper gets as inputs the parameters defined in the user script for which the user intends to generate the REM maps. These parameters include the map resolution, the area, the type (DL/UL Beam Shape/Coverage Area/UE UL Coverage), the desired gNB(s)/UE(s) used to configure the RTD(s) and RRD, the antenna configuration, the frequency, etc. Taking into account the definition of the REMs, according to which it is necessary for each point of the REM map to perform various calculations of the received signal for different configurations of the beamforming vectors at the receiving (RRD) devices, e.g., worst-case SINR, it is necessary that the REM Helper calls directly the PropagationLossModel, ThreeGppSpectrumPropaga-tionLossModel, and ChannelConditionModel. To achieve this, NrRadioEnvironmentMapHelper takes as input these models that have been configured by the user in the simulation scripts and creates deep copies of them. Additionally, for some of the calculations it is necessary to change the configuration of the ThreeGppAnten-naArrayModel, e.g., when calculating the REM Values for the Beam Shape map, where it is necessary to configure the beamforming vector of the RRD to quasi-omnidirectional reception, or when creating the Coverage Area maps and it is necessary to perform calculations for different directional beamforming vector configurations at the RTD and RRD devices. As such, to avoid changing the antenna object that is attached to the gNB or UE device that is defined by the user in the script, NrRadioEnvironmentalMapHelper creates its own RRD and RTD(s) RemDevice objects and populates them with a copy of the ThreeGppAntennaArrayModel and Spec-trumModel object instances. In this way, REM helper uses these copied objects when it has to update the beamforming vectors and perform the necessary calculations in simulations. RemDevice has also its own SimpleNetDevice, Node, and MobilityModel object instances, which are required to be provided (passed) when calling the ThreeGppSpectrumPropagationLossModel and Prop-agationLossModel functions for pathloss calculations.
The final result of the NrRadioEnvironmentMapHelper is a csv file that contains the SNR/SINR/IPSD values for each REM Point, which is then plotted using the gnuplot tool. The REM helper also generates gnuplot scripts for generating the figures from csv files.
Notice that for the implementation of the REM Helper it was necessary to perform an extensive study with respect to the randomness of the channel due to the fact that the high frequency bands that are supported in the 3GPP spatial channel model, result in significant variations in the channel realizations in different instants. Moreover, there is spatial-temporal correlation considered in 3GPP spatial channel model. To cope with the above, NrRadioEn-vironmentMapHelper includes the following features: • Averaging of REM Values: Due to the randomness of the channel, SNR, SINR and IPSD calculations are the average of iterations for each point, where is specified by the user. • 3GPP channel spatial/temporal correlations: To avoid spatial and temporal dependencies among independent REM Point calculations, we have opted to re-create the 3GPP channel matrix for each REM Point.
Finally, different numerology configurations are also supported at the gNBs in a multi-cell scenario, and for this purpose NrRa-dioEnvironmentMapHelper performs spectrum model conversions in order to calculate the REM Values.

EXAMPLES AND USAGES
The 5G-LENA REM map can be generated using any scenario script designed by the user by adding a simple piece of code with which the NrRadioEnvironmentMapHelper will be configured and instantiated. However, we have additionally implemented a specific example that gives the flexibility to set various parameters that have direct impact on the radiation pattern. This example is rem-example.cc. It provides the possibility to configure, among others, the number of gNBs, UEs per gNB, the antenna rows and columns, ISO (isotropic)/3GPP (directional radiation defined by 3GPP TR 38.901) antenna elements, the scenario type (UMa, RMa, Indoor, etc.), the type of REM map to be generated, the frequency, bandwidth and numerology, the transmit power and the possibility to add buildings in the scenario.
Moreover, for the study of the channel randomness we have created the cttc-channel-randomness.cc example. This example is useful to test if we can reproduce the same channel realization within the same simulation run and therefore evaluate the need for averaging the calculations for various iterations due to this randomness.  The implemented REM Helper targets 5G NR with directional transmissions at either Frequency Range 1 (sub 6 GHz bands) or Frequency Range 2 (mmWave bands). However, with proper modifications it can be easily extended to support scenarios involving other technologies that make use of the ns-3 spectrum module (whether they employ directional transmissions or not), such as 4G LTE, Wi-Fi, and WiGig. Also, it is a useful tool for spectrum sharing scenarios, in which various technologies coexist in the same spectrum band, such as NR/Wi-Fi coexistence, and in which the new REM map can help visualize inter-RAT interference. Also, it may be useful to test the effectiveness of interference and radio resource management procedures.

SIMULATION RESULTS
In order to be able to visualize the different REMs presented in the previous sections, we first use the rem-example.cc, for an Urban Macro (UMa) scenario where we vary the number, the position,the frequency and the antenna configurations of the gNBs. In each case, each gNB has 1 UE associated to it. Successively, we also generate maps for an hexagonal deployment using an example script provided by the 5G-LENA module.
We start analyzing the Beam Shape map for the DL direction. Figure 2 depicts the multi-device single-beam SNR and SINR REMs for 2 gNBs (DL) with antenna array configuration of 8x8 (rows x columns). The two figures on the top are for ISO elements (2a-2b), while the two figures on the bottom (2c-2d) correspond to 3GPP element configuration. The antenna configuration for the UEs is set to 1x1 with ISO elements. The rest of the parameters are given in Table 1 1 . Notice that for visualization purposes we have changed . From these figures it can be observed that thanks to the REM Helper the user can visualize the radiation patterns of the scenario of interest, gaining a clearer view of the signal quality, the interference in the network and more importantly, the beam radiation. Moreover, one can appreciate the difference between ISO and 3GPP elements, where for the ISO elements it can be noticed that there is the effect of mirroring the beam. As such, the NrRadioEnvironmentMapHelper provides a valuable tool that can help the user adjust the configuration of the antenna array parameters in order to achieve the desired network performance. Examples for the DL Coverage Area maps for two gNBs are presented in Figure 3. Figures 3a and 3b correspond to an 8x8 antenna configuration with ISO elements at the gNBs, where 3a depicts the SNR and 3b the SINR, while Figures 3c and 3d correspond to the SNR and SINR, respectively, for antenna configuration of 8x8 with 3GPP elements. The simulation parameters are defined in Table 1, as for the previous examples, with the only difference that the position of UE 2 is not varied in this case (since the coverage area map of the gNB in this case will not be affected by the UE position).
We observe that the choice of ISO or 3GPP elements can have significant impact in the coverage area of a gNB and in the network interference. In particular, in Figures 3c and 3d we can see clearly the effect of the 3GPP elements employed with which no radiation is emitted towards the back part of the antenna array (dark area in the left part of the figure). As such, the REM Helper is proven to be a useful tool for studying the network status and estimating the most appropriate network planning. -3 -WNS3 2021 -ISBN: 978-1-4503-9034-7 Virtual Event, USA -June 23-24, 2021  fig.) 50, -15 , 1.5 UE 2 position (bottom fig.) 25, -15 , 1.5 UE antenna array 1x1 (ISO elements) Noise power spectral density -174 dBm/Hz Noise Figure  5 dBi The visualization of coverage holes is represented in Figure 4, where we consider the configuration parameters reported in Table 1, with ISO antenna elements for both gNBs, and where two buildings have been deployed in specified positions. Figure 4a corresponds to the SNR, while Figure 4b to the SINR. From these figures we can see how a user can study the impact that various obstacles can have in the signal transmission and that it can use this knowledge in order to configure adequately the beams in order to achieve adequate performances.

Workshop on ns
For the generation of the UL map presented in Figure 5 we have used another example included in the 5G-LENA module (used in [7]), where a hexagonal topology is simulated for an UMa scenario. The topology includes 19 sites, 3 sectors per site and 6 UEs per sector deployed randomly following a uniform distribution. The antenna configuration for the gNBs is set to 5x2 with 3GPP elements, while for the UEs is set to 1x1 with ISO elements. The rest of the simulation parameters are presented in Table 2. We also represent the IPSD map resulting from the transmit power of all the 342 UEs, aggregated across all the UEs of the network in the UL direction. This kind of map can provide the user with a general view of the total UL network interference at each point of the map. This information can be then used to make decisions related to the most beneficial network deployment in terms of interference  We have also used the same example to generate Beam Shape maps in the DL direction in order to visualize the network status in terms of SNR and SINR in such hexagonal deployment (presented in Figure 6). Figures 6a and 6b on the top, depict the SNR and the SINR maps, respectively, for an Urban scenario, while the bottom figures in 6c and 6d depict the SNR and the SINR maps, respectively, for a Rural (RMa) scenario. Notice that for the UMa scenario the Inter-Site Distance (ISD) has been set to 1732m, while for the RMa case it has been set to 7000m. The rest of the simulation parameters are given in Table 3.
From these figures one can notice the importance of having such a visualization tool in this kind of deployments where the interference can have great impact among the neighboring sites and/or sectors. This information can be exploited in order to configure adequately the antennas of the scenario and to improve the network planning and cell deployment.
Finally, we provide an example of the Heterogeneous Network deployment presented in Figure 7, where macrocells and small cells    Figure  9 dBi coexist. The figure shows the DL SINR in a scenario with 7 trisectorial sites and 3 small cells randomly deployed. This map has been generated with the hexagonal deployment example presented above for a UMa scenario, with additional simulation parameters as presented in Table 4.  Figure 7, it can be seen that the REM can provide us with useful information related to the interference when small cells are deployed in the network that can be used for efficient resource management in order to improve the network capacity and reduce the network interference.
Overall, through the above illustrations it is demonstrated that the proposed REM tool can enrich the users' knowledge with respect to the simulated scenario and the network interference, as well as it can provide the means for the user to understand better the actual radio propagation environment especially in situations where unexpected simulation results are obtained. Moreover, thanks to the visualization of the antenna radiation patterns it provides, the users can improve the network performance by adequately configuring the employed antennas in their scenarios, estimating the network planning and cell deployment, and employing more suitable radio resource and interference management techniques.

CONCLUSIONS
In this paper, we present a novel implementation for the ns-3 5G-LENA module of a REM map as a visualization tool for multi-cell directional scenarios. The REM map is implemented through the Nr-RadioEnvironmentMapHelper class (REM Helper) already openly available in 5G LENA module. This REM helper goes beyond tools currently available in ns-3, in that it offers opportunities for visualization in typical 5G scenarios operating in both FR1 and FR2 (mmWave bands), with directional beams in transmission and reception, and for both FDD and TDD modes. The REM helper is designed to provide the flexibility to generate various types of maps depending on the user's needs, such DL/UL, Beam Shape and Coverage Area maps, among others, and represents multiple metrics. The functionality of the REM Helper is demonstrated through multiple figures of the possible maps in various scenario settings with different topologies, where it is proven that such a visualization tool can provide the user with critical information related to the network environment in terms of signal strength, propagation conditions and the inter-cell interference.