# Implementation of a Cross-Layer Sensing Medium-Access Control Scheme
## 1 Introduction  
In wireless sensor networks (WSNs), medium-access control (MAC) is an essential protocol to regulate shared channels when multiple active sensor nodes send data to the fusion center (destination). The main function of the MAC protocol is to detect, resolve, and avoid collisions because packages in collision have to be discarded and a retransmission is required. Traditional studies on MAC mostly focused on a collision channel detection scheme where only one user is permitted to send its data at a time, such as carrier sense multiple access (CSMA) [1; 2]. However, it is inefficient in checking channels status frequently, which results in serious user latency when a network consists of a great number of users. Compressed sensing (CS) is an emerging technique for addressing sampling of sparse signals, which means that the signals are compressible in some proper basis [3; 4; 5]. It has now been widely used in communication filed ranging from data acquirement [6], data compression [7], and routing protocol design [8]. In WSNs, not all sensor nodes are active at the same time. It is inefficient to check channel status when only some nodes are active for transmitting data at a given time. This means the transmitted signals can be treated as a sparse vector. This phenomenon indicates that the sensor data is compressible. Therefore, CS has been used to increase the power efficiency of MAC by exploiting the correlation of the informed data to compress the transmitted data [9]. The throughput will be enhanced by adapting traditional protocol of R-ALOHA with compressed sensing to find the best user [10]. To increase the efficiency of MAC, various technologies based on CS have been proposed and can be classified into two categories: one focuses on CS-based MAC from a perspective of a physical layer [11; 12; 13; 14], while the other relies on adding extra user identification information fields from a data link layer [15; 16]. In the physical layer, by exploiting the correlation of the informed data in both time and space, CS is exploited in the MAC protocol to make the data recovery correctly [9; 11]. In [12; 13; 14], CS methodology is used to compress the transmitter identities into data transmissions. These literatures utilize the physical layer to compress the transmitted data without the identification of active users, so that the MAC protocols become simple. However, utilizing the time and space correlation of the data in the physical layer relates the scheme to the features of the data. Moreover, a measurement matrix is frequently required, which results in high complexity and delay. When it comes to the data link layer, there is little literature that focuses on adding extra user identification information fields in the data link layer. In [15], the sensors are equipped with a Bernoulli random generator. The data can be recovered by CS, and the Bernoulli matrix is used as a measurement matrix. However, the random binary bits of the measurement matrix results in more error in the reconstruction process of inactive node identification. In [16], compressive sensing MAC (CS-MAC) utilizes the sparsity of the request to implement a compressed request MAC scheme, to which an extra Bernoulli random matrix is added to packets. However, this literature considers this extra random matrix as the measurement matrix, which cannot represent the measurement process accurately in CS. Therefore, such a matrix decreases the accuracy in the reconstruction process. In this paper, we attempt to combine channel state estimation in the physical layer, the actual measurement matrix, with the requests/grants in the data link layer to improve the efficiency of the MAC scheme, an attempt that has not been made before. Here, a new, cross-layer CS-MAC (CL CS-MAC) scheme, which combines the channel state of the physical layer with requests in the MAC layer to deal with the collision of the multiple transmitted packets based on compressed sensing, is proposed.