My GSoC 2022 experience

Final thoughts on my participation to the 2022 edition of the Google Summer of Code for the ns-3 organization

During the summer of 2022 I have been participating in the Google Summer of Code initiative, aiming to contribute to the ns-3 organization with a project titled “A simplified channel and beamforming model for ns-3”. In this blog post I am sharing a final report on the project and my overall experience.


Goals

The overall objective of my proposal was twofold:

My project plan proposed to meet such objectives by performing the following tasks:

For additional details, please refer to the complete project proposal.


Results, Two-Ray fading model

The model aims to provide a performance-oriented alternative to the 3GPP TR 38.901 framework which is implemented in the ThreeGppSpectrumPropagationLossModel and ThreeGppChannelModel classes and whose implementation is described in . The overall design follows the general approach of , with aim of providing the means for computing a 3GPP TR 38.901-like end-to-end channel gain by combining several statistical terms. The frequency range of applicability is the same as that of , i.e., 0.5 - 100 GHz.

TwoRaySpectrumPropagationLossModel implementation

The computation of the channel gain is taken care of by the TwoRaySpectrumPropagationLossModel class. In particular, the latter samples a statistical term which combines:

Calibration

The model parameters are automatically picked once the simulation scenario is set, using a lookup table which associates the simulation parameters (such as carrier frequency and LOS condition) to the FTR parameters providing the best fit to the corresponding TR 38.901 channel statistics. As a consequence, this channel model can be used for all the frequencies which are supported by the 38.901 model, i.e., 0.5-100 GHz.
The calibration has been done by first obtaining the statistics of the channel gain due to the small-scale fading in the 3GPP model, using an ad hoc simulation script (src/spectrum/examples/three-gpp-two-ray-channel-calibration.cc). Then, this information has been used as a reference to estimate the FTR parameters yielding the closest (in a goodness-of-fit sense) fading realizations, using a custom Python script (src/spectrum/utils/two-ray-to-three-gpp-ch-calibration.py).

Note:

Testing

The test suite TwoRaySplmTestSuite includes three test cases:


Results, 38.901 framework optimizations

For the second part of my project, I introduced support for the open-source linear algebra Eigen, with the goal of bringing performance improvements to the 3GPP TR 38.901 framework which is currently available in the ns-3 mainline. Moreover, the installation of Eigen is set as optional, and the code runs as usual whenever the library is not installed in the system.

The library has been integrated in ns-3 by mimicking the support for other third-party libraries such as SQLite. In particular, the Eigen library is set as an optional dependency in the build-support/macros-and-definitions.cmake file and its presence in the system is shown to the user by exposing whether it has been found or not int the build-support/custom-modules/ns3-configtable.cmake file. The linking of the Eigen’s sources with the ns3 source files is taken care of using the FindEigen3.cmake file provided by the library itself, as suggested in the related ns-3 guide.

The main design goal has been minimizing the portion of the code which varies based on Eigen’s availability in the system (dictated by the value of the CMake-defined HAVE_EIGEN3 flag). Since most of the needed operators can not be overloaded for STL C++ vectors (for instance, ()), a uniform interface for both Eigen and STL’s based vectors and matrices has been implemented by defining ad-hoc structs with custom operators. In particular, this interface has been implemented for the PhasedArrayModel::ComplexVector and the MatrixBasedChannelModel::Complex2DVector data structures, since they are involved in computationally intensive linear algebra operations.

The interface has been designed with Eigen’s API in mind, striving to provide the same API also for STL C++ data-structures, whenever Eigen’s is not installed in the system. Specifically, yhe main differences are:

Moreover, this MR includes also the optimizations to the channel matrix generation procedure for the ThreeGppChannelModel originally presented in MR !897.


Results, TLDR

All the main objectives of the project i.e., the speed-up of the channel matrix generation procedure in the ThreeGppChannelModel class, the optional support for the Eigen linear algebra library and its use for the spectrum model matrix/vector operations and the design, and the implementation and calibration of the simplified 3GPP 39.901-based channel model have been met. Due to time constraints, the 3GPP TR 38.901 calibration was left as future work.