## 2 Communication Framework Description
### Protocol Routine  
At the core of the WBAN system is the utilization of the 2.4 GHz ESP-NOW protocol provided and defined by Espressif ([[https://www.espressif.com/en/solutions/low-power-solutions/esp-now](https://www.espressif.com/en/solutions/low-power-solutions/esp-now)]([https://www.espressif.com/en/solutions/low-power-solutions/esp-now](https://www.espressif.com/en/solutions/low-power-solutions/esp-now)) (accessed on 1 February 2024)), a latency-optimized 2.4 GHz-based transmission protocol.It facilitates real-time communication between a master unit and a network of sensor nodes, each playing a crucial role in data acquisition and transmission. The master unit, acting as the central controller, orchestrates the network's communication flow, ensuring synchronized and efficient data handling. The overall setup and communication of the protocol consist of three distinct phases, shown in Figure 2:  
Initialization: the master unit broadcasts a signal to wake sensor devices from standby mode, transmitting their data (like MAC address, data type, size, and interrogation or query time) to the master. Pathfinding: In this phase, the master calculates the round-trip time and confirms the successful enlistment of the sensor nodes, laying the groundwork for calculating bus schedules. A bus plan or schedule refers to the master's coordination of which sensor nodes are queried in the next round trip, based on the interrogation or query times previously transmitted by each sensor. Communication Routine: This phase involves data transmission throughout the network. The communication routine within the WBAN system begins with a broadcast signal from the master unit. This signal contains a'schedule' or 'plan' for the sensor nodes, informing them about their specific roles in the upcoming data transmission cycle. The plan, encoded in a 16-bit long string, dictates whether and when each sensor node will transmit data during the cycle. This strategic scheduling is crucial for maintaining the system's efficiency and reducing unnecessary data traffic. After the broadcast, the master unit initiates a unicast communication with the first sensor node. The node then attaches its data, along with a sensor-specific header providing details  
Figure 1: General overview of WBAN. The diagram delineates the wireless communication trajectories (illustrated with blue arrows) that commence at the master unit, extend to each sensor node, collating data, and then return to the master unit. The transmission of ‘full packages’ is depicted by green arrows, named wireless ‘overflow’ channel, activated when a cycle reaches the predefined maximum packet size. Furthermore, the red dotted lines define the HBC ‘wired’ channels, which exploit the body’s own capacitive features to create a secure and interception-resistant communication medium. The master unit is portrayed not only as the central node of the WBAN but also as a conduit to broader networks, connecting to cloud infrastructure and healthcare facilities, as indicated by the orange arrows. The design shows a holistic approach of next-generation WBAN systems, ensuring secure, efficient, and scalable health data management. about the time and length of the data packet, to the transmitted structure. If the combined data packet does not exceed the 250-byte limit, it is passed on to the next sensor node. Should the limit be exceeded, the packet is sent back to the master unit for processing, and the communication cycle continues with the next sensor node. The protocol's architecture is primarily designed for low data rates, allowing the combination of data from several sensors into a single message, but also capable of handling larger data packets. This system allows for dynamic flexibility in adding or removing sensor carriers, whereas an accompanying web application provides a bidirectional communication interface. Each sensor node in the WBAN is designed to capture specific medical data, such as vital signs or patient movement.