# A MAC Protocol to Support Monitoring of Underwater Spaces +
## 3 Description of the UWSO-TDMA Protocol
### Initialization Phase
#### 3.2.2 Slot Allocation  
Once the nodes in the network are synchronized, the slot selection process can begin. This phase is again performed in a hierarchical way, beginning with the SB. The synchronization nodes are already selected for each sub-frame. The length of each sub-frame and the slot in which each node transmits should be defined. As the synchronization nodes already know which nodes are within their domain,  
Figure 2: Example of the synchronization process: (**a–l**). they are able to setup the sub-frame length. With this information, they are able to allocate the slots in the following sub-frame. Messages sent by synchronization nodes are listened to both by downstream and upstream nodes; therefore, the network topology and sub-frames structure is propagated in both directions during the initialization phase. We need to re-define the concept of simultaneous transmission. Two nodes transmit simultaneously if their messages produce a collision at some other node listening to both. To prevent this, the distance to the synchronizing node, or transmission delay already measured during the synchronization phase, should be used for ordering the slot allocation. The first slot is for the closer node and the last one for the one further away. In the case of Figure 2, Nodes B and A would use the first and second slots, respectively. Although this allocation order prevents the hidden station problem while transmitting messages from the nodes in sub-frame \(i\) towards the synchronizing node in sub-frame \(i-1\), there may be collisions between nodes in the same sub-frame, but with different synchronizing nodes when a node (like C) uses more than one node for the synchronization. In Figure 3, the previous example is extended. In red, we mark a synchronization branch and in blue, the other. In this case, although Node C is synchronized by Node A and therefore the slot allocation is decided by Node A, the possible hidden station problem should be considered in Node B, as Nodes F or G may transmit simultaneously with C.  
The described situation should be addressed by Nodes A and B. Both nodes know that C is within transmission range of each other, so they have to share the slot allocated to C in such a way that no collisions are produced. In these cases, the slot allocation criteria are changed. For each sub-frame level, a set of slots is reserved for those nodes that are connected with more than one synchronizing node (shared nodes). The amount of slots reserved for them is two times the number of nodes in that situation. The rest of the nodes are allocated after these reserved slots following the delay criteria. Within the reserved slots, each synchronizing node allocates the possible conflicting nodes. This allocation repeats the previous criteria. The first node in the previous sub-frame allocates first the possible conflicting nodes, leaving empty the rest of the reserved slots. The procedure is repeated for the rest of the synchronizing nodes. If a collision is detected after this allocation process, the nodes detecting it inform the previous layer of the situation, and the conflicting nodes are rearranged. In the case described in Figure 3, the synchronization nodes share the same sub-frame, as both of them are synchronized by the same node. In Figure 4, the situation is repeated, but in this case, both possible synchronization nodes are in different sub-frames, as they are not synchronized by the SB, but by Nodes 1 and 2, respectively. In this case, as explained in Section 3.2.1, Nodes A and B are aware of the presence of each other, because C informs about the presence of both of them in the _asynch_ message. Since they are not under the same synchronization node, they know that they are in different sub-frames, as well. This information is passed to Nodes 1 and 2, so they should include as many empty slots as shared nodes exist in the subsequent sub-frames to avoid the hidden station problem. In the example, Node 1 will generate a two-slot sub-frame for Node A, and Node 2 will do the same with Node B.