## 3 Medium Access Control Layer
### Code-Division Multiple Access  
The basic principle of the CDMA scheme is the use of binary codes to modulate the signal using a spread-spectrum technique. When different nodes transmit using different codes with low cross-correlation, their data can be received simultaneously in the same frequency band by the other nodes in the network without collision. The advantage of this scheme over FDMA is that it does not suffer from selective fading, because it uses the entire frequency band. Its advantage over TDMA is that the transmission medium can be accessed at the same time by all users. However, low cross-correlation implies long codes, which greatly reduce the available data rate [37].  
It is shown in [37] how the available data rate per user (\(V_{tx}\)) depends on the code length (\(L\)) and the actual modem data rate (\(V_{tx}^{\prime}\)):  
\[V_{tx}=\frac{V_{tx}^{\prime}}{L} \tag{9}\]  
It is also shown how code length (\(L\)) depends only on the number of different codes (\(N\)), as shown in expression Equation (10):  
\[L=4^{\log_{2}N}-1 \tag{10}\]  
Using expression Equations (9) and (10), the effective transmission speed (\(V_{tx}\)) of different users of a network can be calculated. For example, given a network of only eight nodes equipped with an acoustic modem capable of transmitting at 1,000 bps, the effective transmission speed of each node would roughly be 16 bps.  
Nonetheless, different authors use the properties of CDMA to their advantage. [PERSON] _et al_. proposed a combination of CDMA and aloha in [64]. A node willing to transmit dynamically calculates the transmission power and spreading code length in order to efficiently communicate with its intended receiver. This spreading code is then sent using aloha without any sort of coding. Immediately after that, the data packet is sent using the spreading code.  
CDMA codes can be used for intra-cluster communication in a clustered network. In [65], the authors propose a cluster-based network in which each cluster has its own CDMA spreading code assigned. Communication inside each cluster is executed by exchanging request-to-send (RTS) and clear-to-send (CTS) packets, and cluster heads communicate with the sink node using TDMA.  
Another cluster-based approach is presented in [66], in which, similar to the previous work, each cluster uses its own CDMA spreading code for intra-cluster communication. Transmissions inside the cluster are scheduled using TDMA. Instead of directly communicating to the sink node, cluster heads arrange themselves in a tree structure in order to send their collected data to the sink.  
Following this cluster-based proposal, the hybrid reservation-based MAC protocol (HRMAC) [67] utilizes an adaptive TDMA along with CDMA spreading codes. Each node with data to transmit sends a _notice_ packet with sender and destination IDs and data size to the cluster head. With this information, the cluster head computes a sending schedule and populates it. Upon receiving the transmission schedule, nodes send their data packets in their assigned slots. Afterwards, the receivers of the data packets send a _reply_ message back to the sender with the amount of data received. The CDMA codes are used for the _notice_ and _reply_ packets, because they are not scheduled and can collide.