# Virtual Sensing Directional Hub MAC (VSDH-MAC) Protocol with Power Control
## 2 Medium Access Control Protocol
#### VSDH-MAC Channel Access Algorithm  
When a node has no data packet to transmit, i.e., its packet queue is empty, it will remain in sleep state to conserve energy. When a node wishes to transmit a data packet, it will send a short RTS packet to the hub immediately, using its maximum transmit power. The maximum transmit power is used because we have assumed sensor nodes might move, and we require the RTS to reach the hub regardless of the current node position, which is assumed unknown. Extensive simulations implemented in Riverbed Modeler have shown that although the RTS packets are sent with maximum power, there is no significant impact to the node energy consumption and overall network throughput. If it receives a CTS packet from the hub, in response to the RTS packet, it may then transmit a data packet to the hub. The node is assumed to know the hub transmit power and uses the received power of the CTS to compute the path loss and thereby choose the least required packet transmit power to successfully transmit the data packet, assuming a reciprocal channel. This is done in order to minimize both the interference to other nodes and the node power consumption, although it is of course simple to introduce an appropriate link margin by increasing the transmit power above the calculated minimum if desired, to account for uncertainties and variation in the channel, e.g., due to shadowing. In this study, we assumed the same background noise at both the transmitter and receiver. In a real network, while the reciprocal path is the same, the noise might not. Hence, in a practical protocol it would be necessary for the hub to calculate the required transmit power with its background noise and include the value in the CTS as a reference for the sensor node. RTS and CTS packets both contain a network allocation vector (NAV) which defines the time required to complete the subsequent data packet transmission and associated handshaking. Other nodes hearing a CTS above a certain amplitude threshold will delay their transmission to avoid collision. The threshold is defined as the product of the packet transmit power and 2.1 the receiving antenna gain at angle \(\theta\) (\(G_{\theta}\)), where \(\theta=\frac{360}{M}\), and \(\mathbf{M}\) is denoted as the number of directional antenna at the hub. Nodes only listen for a CTS during the time when they are awaiting a reply for their own RTS. This also maximizes the chance of avoiding collisions between active nodes, whilst minimizing node energy consumption, as a node does not need to listen for a CTS except when it is likely to be transmitting data. After sending an RTS the node waits for a time slightly larger than the expected round trip time (RTT). If a node receives no response to its RTS within this time, it will enter a back-off state, which delays transmission of another RTS for the same data by a random delay in the range \([0,CW-1]\) where \(CW\) is an interval called the Contention Window. Subsequent failures to receive a CTS increase the back-off time range exponentially by a factor of two in each case. The value of the random back-off interval is chosen from the \(CW\), which lies between two preconfigured values, \(CW\_min\) and \(CW\_max\). The values for these are identical to the IEEE 802.11 CSMA/CA/DCF protocol. The contention window is set to \(CW\_min\) at the first transmission attempt, and doubles after each unsuccessful attempt, until it reaches \(CW\_max\). The contention window is reset to \(CW\_min\) after every successful transmission. After the counter reaches \(CW\_max\) the packet transmission would be abandoned, and the error would also be reported to the layer above. Once a packet is transmitted, if an acknowledgment is not received within the specified RTT time for the data packet, a re-transmission with maximum transmission power for the data packet will be performed following the same RTS/CTS/DATA/ACK sequence. Thus, the node protocol is designed to require minimal electrical and processing power.