# BNS: A Framework for Wireless Body Area Network Realistic Simulations
## 3 Proposed BNS Framework
### Wireless Channel  
Ultra-wideband Physical Layer (UWB-PHY) allows low-power transmission, low-power consumption, high data rate, and robustness against multi-path fading. That makes it a suitable air interface for WBAN systems. The IEEE 802.15.6 standard includes UWB-PHY. There are many attempts to model the WBAN wireless channel [24; 44; 45; 46]. In [24], [PERSON] et al. experimentally determined a model for the path loss of on-body Ultra-wideband (UWB) channel. That model was statistically determined from measurement data and has parameters for link obstruction (Line-of-Sight (LOS) and Non-Line-of-Sight (NLOS)), different body shapes (underweight, normal, and overweight), and each UWB high band channel of the IEEE 802.15.6 standard. Therefore, we chose to implement the [PERSON] et al. channel modeling [24] to provide flexibility and different simulations scenarios. The Goswami channel model [24] provides a description of the channel behavior around the human body, since they used a considered number of receiving antennas spread over the body with a separation of 5 cm between two consecutive nodes. This model considers the LOS and NLOS channel conditions over the human body. It also considers the influence of people's physiques on the loss of path. For this, people with different weights and classified as 'thin', 'normal' and 'fat' participated in the experiment. With MatLab software, the frequency response and the average path loss for each sub-band defined in the WBAN standard were obtained. The path loss is modeled as a log-normal distribution, and the distance dependent path loss is expressed as in Equation (1). The reference distance (\(d_{0}\)) is 5 cm, the path loss for that reference distance (\(Pl(d_{0})\)), the path loss exponent (\(n\)), and the shadow fading (\(\chi\)) are given for different scenarios. \[Pl_{dB}(d)=Pl_{dB}(d_{0})+10\cdot n\cdot log_{10}\bigg{(}\frac{d}{d_{0}}\bigg{)}+\chi \tag{1}\]  
As part of our work, the Goswami channel model is implemented and now provided in the BNS framework. Figure 2 shows the Goswami channel class implemented. The attributes are the size of the network, the dimensions of the simulated area, a list of node positions, the channel used, the body size, a map of channel/body size to path loss parameters, a structure of path loss parameters for LOS and NLOS scenarios, the radio sensitivity, the transmission power, and the hub identifier. The _Pathloss_type_ structure stores parameters of the log-normal channel, which contains the loss exponent, the reception power at a given reference distance, the reference distance, and the standard deviation value to generate the random variable, for both LOS and NLOS channels. There are three main methods: the initialization method, which is responsible for reading the parameters from the configuration file and initializing the variables; the _handleMessage_ method that receives node movement messages from the mobility module, and messages of start and end of a wireless transmission; and the method that calculates the path loss between two nodes. In the implemented model, the hub is a position reference on the Cartesian axis and each node in front of it in the direction of the walking movement (\(+z\)) is considered to be in its LOS. When the node is behind the hub, the body is considered to be an obstruction and the channel model with NLOS is used for the path loss calculation. Previous studies only consider the Narrow Band Physical Layer (NB-PHY), using a David channel model [23] available in Castalia. David channel model is an advanced model based on empirically obtained data. This model defines a map of path losses, instead of simple connections between nodes. It consists of a model for temporary variation of path loss and supports node mobility. This model is the result of the work presented in [23], where experiments were carried out using transmitting and receiving antennas on the bodies of eight adults, simulating the transceiver of a WBAN node.