# Channel Access in Wireless Smart Grid Networks Operating under ETSI Frame-Based Equipment Rules
## 4 Simulation Model
### Simulator  
Discrete-event simulators are an appropriate tool for evaluating channel access mechanisms. In contrast to analytical models, e.g., Markov chains, these simulators allow each contending node to be treated independently. As we later show, with this approach we can easily identify improper channel access behavior, e.g., domination by a single node (Figure 9). Furthermore, we can rapidly conduct a performance analysis, evaluating upper bounds, as well as a coexistence analysis between competing FBE variants.  
To the best of our knowledge, there are no open-source network simulators available that implement FBE channel access or any of its variants. Therefore, we contribute our open-source simulator ([[https://github.com/marcink2138/NRUSharp](https://github.com/marcink2138/NRUSharp)]([https://github.com/marcink2138/NRUSharp](https://github.com/marcink2138/NRUSharp)), accessed on 24 December 2023), implemented in SimSharp ([[https://github.com/heal-research/SimSharp](https://github.com/heal-research/SimSharp)]([https://github.com/heal-research/SimSharp](https://github.com/heal-research/SimSharp)), accessed on 24 December 2023), with a.NET port of SimPy--a Python-based discrete-event simulation framework. Our simulator acts as an easily extensible library, which allows users to create their own test scenarios by creating simple C# scripts, with the.NET framework in version 7.0 or higher. The simulator is designed to be free of hard-coded variables, which means that the user can configure the node parameters. Furthermore, we design a set of utility classes which expedites the process of scenario configuration. We follow the operation principles of the NR-U SimPy simulator ([[https://github.com/marekzajac97/nru-channel-access](https://github.com/marekzajac97/nru-channel-access)]([https://github.com/marekzajac97/nru-channel-access](https://github.com/marekzajac97/nru-channel-access)), accessed on 24 December 2023), a discrete-event simulator successfully used in studies of NR-U operating in LBE mode [41; 42].  
In terms of implementation, our code works as follows. Each variant of FBE is represented by its own class that extends AbstractFbeNode. The AbstractFbeNode class contains basic definitions of methods defined in the INode interface and holds common properties, e.g., the objects responsible for storing node simulation results, while the FBE variant classes are focused on implementing the particular algorithms described in Section 3.2. Each node stores the same references to the IChannel interface and the Simulation class, which is responsible for holding queues, scheduling, and processing events generated by nodes. In our case, the IChannel interface is implemented by the Channel class, which holds a list of objects performing CCA (ccaList) and a list of each node with ongoing transmissions (transmissionList) along with the current timestamp. If the FBE node wants to sense the channel, then it has to append a reference to itself to ccaList and leave this list, regardless of status, at the end of CCA. During transmission, this node notifies all nodes in ccaList and transmissionList by interrupting their current simulation processes. An interruption of the transmission process is treated as a collision, whereas an interruption  
Figure 9: Validation of standard FBE. COT is normalized with respect to FFP.  
of the CCA process denotes the detection of an ongoing transmission. Furthermore, each simulation scenario can be described by the SimulationDescription class, which stores information about the retransmission counter, simulation time, and simulation matrix. The simulation matrix holds information about simulation runs and references to configured nodes in a particular simulation run. The simulator also supports various logging verbosity levels to help users during validation and debugging.