# Virtual Sensing Directional Hub MAC (VSDH-MAC) Protocol with Power Control
## 2 Medium Access Control Protocol
#### VSDH-MAC Channel Access Algorithm
Operation of the protocol at the hub is slightly more complex as it has multiple antennas and corresponding transceivers. The hub algorithm differs in the following manner. It is assumed to be capable of communicating via all antennas simultaneously and listening continuously from any that is not transmitting. It is assumed that the hub will not initiate a transmission to the node. If transmission of messages from the hub to the nodes is required, it can be included in the ACK packet at the end of each exchange. If the hub receives an RTS on one or more antennas from a node it will note which of the antennas provides the highest SINR and use that antenna for subsequent communications with the node until a packet arrives at a different antenna with higher SINR from the same node. If the hub has received the same packet from multiple antennas with equal SINR, then the subsequent transmission will use a random antenna selection between them until an optimum antenna is established. When an RTS is received from a node, and if no other RTS has reserved the optimum antenna, the hub will reserve the optimum antenna for a period indicated as NAV (network allocation vector) in the RTS (NAV) and then transmit a CTS to the node from the optimum antenna. The CTS also contains a NAV which will cause any listening node to delay its transmission. As nodes do not continuously listen there is still a probability of collision by a node that does not hear the ongoing exchange when it is ready to transmit. Algorithm 1 summaries the steps of the proposed virtual sensing approach for WSNs with a directional hub node. A modified VSDH-MAC protocol with an additional physical channel sensing (DIFS long) is also considered in this paper (DIFS-VSDH-MAC), in which nodes sense the channel prior to transmission of an RTS. If any signal above the SIR threshold is received, it will pause the DIFS counter and enter the back-off stage according to the NAV. This improves the overall throughput performance of the protocol y reducing the probability of RTS/CTS collision, at the cost of increased sensor node energy consumption and transmission delays. ```
1 for each packet arriving queue do
2 whilecd_CW = 0 do
3 if ongoing transmission = 0 then
4 Send RTS to receiver
5 Start countdown timer (cd_RTS)
6 ifCTS received && cd_RTS > 0 then
7 update P_tx based on the CTS received power
8 Send DATA to receiver
9 Start countdown timer (cd_DATA)
10 if ACK received && cd_DATA > 0 then
11 Packet transmission successful
12 else
13 Update P_tx to maximum
14 elseifCTS for other nodes received && cd_RTS > 0 then
15 Update cd_NAV based on overhead CTS
16 cd_CW = a random CW value (where CW = [0, CW_max - 1]
17 Start countdown timer (cd_CW = cd_NAV + cd_CW)
18 else
19 Update P_tx to maximum
20 cd_CW = a random CW value (where CW = [0, CW_max - 1]
21 Start countdown timer (cd_CW)

## 3 Simulation Methodology

### Network Configuration

To fairly characterize the performance of the protocols, a series of randomly generated configurations are considered, and an example is shown in Figure 1. We chose a single hop star topology with half duplex (HDX) operation on a single frequency channel as this is simple and common in WSNs. A HDX operation is defined as a system supporting communication in both directions, but only one direction at a time. A two-dimensional distribution of sensor nodes is considered in the study. The star topology allows for a continuously powered hub where energy usage and complexity are not considered to be an issue. By adding directional antennas to the hub, we can improve throughput, and range or energy consumption. We consider \(n\) nodes randomly distributed in a \(100\times 100\) m\({}^{2}\) grid, where the x and y-coordinates are each chosen using a pseudorandom number generator with a uniform distribution between plus and minus 50 m. The single hub base station node is positioned at the center of the grid.