# An Efficient Scalable Scheduling MAC Protocol for Underwater Sensor Networks +
## 5 Efficient Depth-Based MAC Protocol
### Normal Operational Phase  
In this phase, nodes wake up and sleep periodically. They are awake in some slots and asleep during the remaining slots when there is no data transmission or reception. This phase is divided into a number of rounds and each round is consisted of a number of slots. Every slot also has a number of sub-slots. These slots are reserved by the nodes in the scheduling phase. The sub-slots are selected randomly to deal with the possibility of collisions between two nodes, if they have selected the same slot. The length of each round, \(T_{r}\), has a reverse relationship with offered traffic, \(D_{rate}\), which is presented in terms of packet per second. The higher the offered traffic, the shorter the round time and, hence, the shorter sleeping time. The duration of each round is given by  
\[T_{r}=\frac{1}{D_{rate}}. \tag{3}\]  
Each \(T_{r}\) is divided into a number of slots, \(N_{s}\). The number of slots per round is proportional to the maximum number of nodes in a neighbourhood, \(N_{max}\). To exclude the possibility of concurrent data transmission from nodes located outside of one-hop neighbourhood and the node within the neighbourhood, the number of slots are doubled per round. We derive \(N_{s}\) by using  
\[N_{s}=2\times N_{max}, \tag{4}\]  
where \(N_{max}\) is the estimated maximum number of nodes in a particular one-hop neighbourhood. \(N_{max}\) can be estimated based on the network topology, number of sensor nodes, and network dimensions and it can also be known to all nodes during the deployment time. The length of each slot, \(T_{s}\), can be calculated using  
\[T_{s}=\frac{T_{r}}{N_{s}}. \tag{5}\]  
Our proposed algorithm is almost a collision-free algorithm for most of scenarios. However, one slot might be reserved, under a very specific circumstances, by two hidden nodes, which both are neighbouring nodes of another node with lower depth. This specific scenario is illustrated in Figure 4. Node \(A\) has reserved slot \(n,0\leq n\leq(N_{s}-1)\) and, consequently, slots \((n+1)\)_mod_\((N_{s}-1)\) and \((n+2)\)_mod_\((N_{s}-1)\) are reserved by its neighbouring nodes \(B\) and \(C\), respectively. As node \(D\) is not aware of the slot number reserved by node \(C\), it reserves the same slot, i.e., slot \((n+2)\)_mod_\((N_{s}-1)\). Now, transmitting a packet by nodes \(C\) and \(D\) may result in a collision in node \(E\). To address this issue, the concept of sub-slot is introduced here. Each slot is divided into a number of equal size sub-slots. To transmit a packet, a node randomly selects one sub-slot out of \(N_{s_{s}}\) available sub-slots to transmit its packet. The length of every sub-slot, \(T_{s_{s}}\), is longer than a signal propagation delay to ensure that a packet is entirely received at the destination before starting of data transmission by another node. The length of each sub-slot, \(T_{s_{s}}\), is given by  
\[T_{s_{s}}=T_{d}+T_{guard}, \tag{6}\]  
where \(T_{guard}\) indicates the guard time, which is used to ensure that distinct transmissions do not interfere with one another and \(T_{d}\) denotes the propagation delay of a transmitted packet which can also be calculated using  
\[T_{d}=\frac{R_{tr}}{U_{s}}, \tag{7}\]  
Figure 4: A specific scenario leading to a potential collision which has been addressed in ED-MAC. where \(R_{tr}\) denotes the transmission range of a sensor node, and \(U_{s}\) indicates the speed of sound in water. The number of sub-slots, \(N_{\mathrm{s}}\), can finally be calculated using the following equation:  
\[N_{\mathrm{s}_{\mathrm{s}}}=\frac{T_{s}}{T_{\mathrm{s}_{\mathrm{s}}}}. \tag{8}\]  
To show how our proposed MAC protocol provides a conflict-free scheduling, the simple network illustrated in Figure 5 is used. Once all sensor nodes, from \(A\) to \(L\), exchange their one-hop neighbouring information, each one has its neighbours' ID and depth. Hence, a deeper node, \(A\), has a higher priority to reserve the first available slot time sooner than its lower depth neighbouring nodes \(B\), \(C\), and \(D\).