# BNS: A Framework for Wireless Body Area Network Realistic Simulations
## 3 Proposed BNS Framework  
Our proposed BNS framework for WBAN simulations (Available online: [[https://github.com/midiacom/BNS-Framework](https://github.com/midiacom/BNS-Framework)]([https://github.com/midiacom/BNS-Framework](https://github.com/midiacom/BNS-Framework)) (accessed on 10 August 2021)) has a hierarchical structure based on modules. The BNS framework structure is shown in Figure 1. There are three main interconnected modules: the node, the wireless channel and the physical process. In the BNS framework, the nodes are not directly connected to each other, but through the wireless channel module. When a node has a packet to send, it goes to the wireless channel, which decides which nodes should receive the packet. Additionally, nodes are linked to the physical process, from which they obtain information about some physical magnitude collected by the sensor.  
The BNS framework represents each WBAN node as a composite module, which is formed by several sub-modules that represent the different layers of the WBAN network, and others auxiliary sub-modules that model important features of WBAN. As it can be seen in Figure 1, each node module contains: Temperature Manager, Resource Manager, Mobility Manager, Sensor Manager, Application and Communication sub-modules. In addition, Communication sub-module contains Routing, MAC and Radio sub-modules. In this figure, the solid arrows represent the exchange of messages between the different sub-modules and the dashed arrows represent simple function calls. For example, most modules call a resource manager function to indicate that the energy has been consumed.  
The BNS framework is an extension of Castalia and, in this proposal, new available modules are represented in Figure 1 with grey boxes. A model of channel behavior for WBAN proposed by [PERSON] et al. (2014) is implemented. The Mobility Model for Wireless Body Area Networks (MoBAN) proposed by [PERSON] et al. (2015) is implemented as a new Mobility Manager sub-module. A new temperature module is implemented. This allows estimation of the temperature of the nodes based on their activity. The Temperature Manager module makes function calls to the resource manager and radio modules to have the activity information of the node and to be able to calculate the temperature of the node. In addition, sub-modules of the Communication module can cons  
Figure 1: The BNS framework structure.  
The MAC layer sub-module corresponding to the draft WBAN standard is updated with features and requirements of the IEEE 802.15.6 standard published in 2012. In the routing sub-module, the Link-Quality Aware and Thermal Aware On-Demand Routing (LATOR) protocol proposed in [9] is added. This protocol uses the temperature calculated by the Temperature Manager module to avoid overheating the nodes. In the Application module, a Healthcare Application sub-module is added. This one implements data representation and a communication protocol of PHD recommended in the ISO/IEEE 11073 standard. Details of these implementations will be presented in the following sections. The BNS framework uses an infrastructure of abstract classes and interfaces. This infrastructure is extensible, new modules, sub-modules and functionalities can be implemented and added to the existing framework.