# Physical Layer Latency Management Mechanisms: A Study for Millimeter-Wave Wi-Fi
## 4 Simulation Environment  
A simulation framework has been designed as part of the present work. It consists of both latency probing, described in [45], and data transmission over a noisy channel. Together, they allow joint latency and BER analysis.  
The RX DBB, discussed in Section 3.2, is implemented alongside the TX DBB, forming the IEEE 802.11 ad transmission chain together with an AWGN channel (CH). The TX includes scrambling, encoding and mapping of the data bits, while providing all additional PPDU overhead structures in preparing PHY frames for transmission. The AWGN CH adds noise, and the inverse of PPDU generation is carried out at the RX. The latter also implements the time delay functionalities of individual components, described in Sections 3.2.1-3.2.4. The simulation framework is written in Python, and apart from SimPy, relies on conventional scientific computing libraries such as Numpy, Pandas, and Xarray. It implements unit tests to verify the correctness of individual component definitions. Where possible, the results of these are evaluated against those obtained using MATLAB's Communication Toolbox.  
Transmitting millions of data bits upon every possible change in the TX-CH-RX chain can be a daunting task. The use of the SimPy discrete-event simulation framework may provide accurate latency tracking, yet, it further increases the already long computation time. We have split the simulation into error tracking and separate latency probing to accelerate execution. Moreover, it provides easier reproducibility of results by allowing better control over the simulated scenario and its input arguments. Summarized in Figure 6, the first part tracks the quality of the received data in different channel conditions while also storing the number of incurred decoding iterations. These are then used to initialize the latency simulation. The decoupled approach alleviates the need to run numerous event-based packet transmission simulations for each input parameter combination.  
Figure 6 shows the simulation workflow for assessing PHY latency. It is initially used to assess latency and the incurred BER in presence of an AWGN CH, using the decision threshold demapper and limiting the number of decoding iterations to 10. It is afterwards used in an exploratory study, focusing on RX tuning by switching the demapping algorithm and allowing up to 100 iterations. In sequence, the ideal scenario study is referred to as study step 1, while the two simulation steps are referred to as steps 2 and 3. The naming is used in the following subsections to describe how the simulations are configured during the different study steps. The simulation framework is publicly accessible (individual repositories are located at [[https://github.com/PhyPy-802](https://github.com/PhyPy-802) dot11 ad]([https://github.com/PhyPy-802](https://github.com/PhyPy-802) dot11 ad), accessed on 31 May 2021) and consists of: IEEE 802.11 ad component functionalities, the latency simulator, and the BER simulator.  
Figure 6: Two-part error and latency simulation framework. Blocks with a dashed outline change depending on the study step, while the number of decoder iterations is passed on between the two parts.