Double-Scale Adaptive Transmission in Time-Varying Channel for Underwater Acoustic Sensor Networks

The communication channel in underwater acoustic sensor networks (UASNs) is time-varying due to the dynamic environmental factors, such as ocean current, wind speed, and temperature profile. Generally, these phenomena occur with a certain regularity, resulting in a similar variation pattern inherited in the communication channels. Based on these observations, the energy efficiency of data transmission can be improved by controlling the modulation method, coding rate, and transmission power according to the channel dynamics. Given the limited computational capacity and energy in underwater nodes, we propose a double-scale adaptive transmission mechanism for the UASNs, where the transmission configuration will be determined by the predicted channel states adaptively. In particular, the historical channel state series will first be decomposed into large-scale and small-scale series and then be predicted by a novel k-nearest neighbor search algorithm with sliding window. Next, an energy-efficient transmission algorithm is designed to solve the problem of long-term modulation and coding optimization. In particular, a quantitative model is constructed to describe the relationship between data transmission and the buffer threshold used in this mechanism, which can then analyze the influence of buffer threshold under different channel states or data arrival rates theoretically. Finally, numerical simulations are conducted to verify the proposed schemes, and results show that they can achieve good performance in terms of channel prediction and energy consumption with moderate buffer length.


Introduction
In recent years, the development of underwater acoustic sensor networks (UASNs) has boosted a wide range of emerging applications, such as ocean observation, ecosystem monitoring, disaster warning, etc. [1][2][3]. Compared with terrestrial wireless sensor networks, the transmission in UASNs suffers from low data rates due to large propagation attenuation, limited bandwidth, and time-varying channels [4]. Generally, the transmission data rate highly depends on the selection of modulation method, coding rate, and transmission power, which will be referred to as transmission configuration in this paper. As battery replacement or charging is quite difficult in the underwater environment, in order to improve the transmission efficiency, the energy cost and data rate should be jointly optimized in UASNs.
Given specific transmission configuration, the energy efficiency of data transmission will be affected by different channel states. Considering the time-varying communication channels in UASNs, it is crucial to learn the channel variation characteristics for determining the optimized transmission configuration. The underwater channels could be affected by various environmental factors, including water temperature, wind speed, tidal, ocean swell, and so on. These natural phenomena occur at different time scales, such as seasonal, diurnal, minutes, and seconds [5][6][7][8]. The overlay of these time scales forms the complex fluctuation in underwater communication channels. Figure 1 presents an example of the channel states in an underwater communication experiment [9]. Obviously, the fluctuation of the received signal-to-noise rate (SNR) is roughly consistent with that of the wind speed.  Based on the above observation, we propose to take advantage of the historical channel state series and analyze the fluctuation characteristics for channel state prediction, so that an optimized configuration scheme can be derived and the energy efficiency of data transmission would be enhanced accordingly. However, it is quite challenging to schedule the optimal configuration scheme dynamically due to the following reasons. First of all, the prediction of underwater channels is difficult as they are impacted by multiple factors, such as underwater geology, salinity and depth, environmental factors (ocean current, surface wind, sea wave, solar radiation, etc.), human-being activities, and fish behaviors, and it is hard to model the fluctuation by just using long time-scale historical channel state data or just using short time-scale cycle information. Secondly, to improve the overall performance of underwater sensor networks, the transmission rate and energy cost should be jointly optimized based on the predicted channel states. Thirdly, considering the limited computational and storage capability of underwater sensor nodes, how to balance the network quality and reducing complexity is essential. For example, even though the quality of network service, such as network throughput, can be improved with a fine-grained transmission scheme, the frequent change of transmission modes might cause extra computational complexity and energy cost.
In the literature, adaptive transmission according to channel state has become a hot topic. The rule-based adaptive modulation and coding (AMC) methods usually utilize fixed thresholds for transmission mode determination [1,[10][11][12]. These methods are easy for implementation and could be used in the resource-constrained networks, while the threshold selection should be carefully designed. Learning strategies [13][14][15][16] have been proposed to provide intelligent transmission decisions to characterize the dynamic communication channel, and the Markov chain is widely adopted. However, the state space would be enlarged with a large channel fluctuation amplitude, which may increase the training burden and computational complexity. Optimization [17,18] schemes have also been investigated for adaptive transmission, but fine-grained optimization will lead to greater computational complexity.
To provide energy-efficient transmission for UASNs, we propose a double-scale adaptive transmission mechanism in this paper. The historical channel state series will first be decomposed into large-scale and small-scale series; then, real-time channel state can be predicted according to different fluctuation features with each time scale. In order to solve the problem of long-term transmission configuration with modulation and coding mode selection, an energy-efficient transmission algorithm is designed on the basis of channel state prediction. The contributions of this paper can be summarized as follows: • To improve the energy efficiency and reliability of data transmission, we propose a double-scale adaptive transmission mechanism for UASNs. Specifically, the historical channel state series is used for channel state prediction, and then the transmission mode is determined adaptively. • To balance the accuracy and computational complexity of channel states prediction, we propose to decompose the channel state series with two different time scales. For the large-scale channel state, a k-nearest neighbor algorithm with sliding window is designed to predict the fluctuation tendency, and then a small-scale channel state prediction algorithm is developed to enhance the accuracy. • To determine the specific configuration of data communication in UASNs, we design an energy-efficient transmission algorithm. In particular, the long-term modulation and coding problem is formulated and optimized with the constraint of limited energy cost.
The paper is organized as follows. In Section 2, the related works are presented. Section 3 illustrated the framework of our proposed transmission method, and then the double-scale channel prediction and transmission scheduling are given in Sections 4 and 5, respectively. Quantitative performance analysis and computational complexity are presented in Section 6. Simulation results are analyzed in Section 7, and, finally, the paper is concluded in Section 8.

Related Works
In this section, existing prediction methods and adaptive transmission methods designed for the dynamic communication environment are briefly reviewed.

Channel State Prediction
To resolve the inefficient and unstable communication caused by time-varying channel conditions, prediction methods for future channel states have been widely studied in recent years. Specifically, existing works can be classified into direct prediction and decompositionbased prediction methods, and direct prediction methods include linear and non-linear channel prediction methods.
Linear prediction models have been used for channel prediction in wireless communication. The auto-regressive (AR) model was proposed in Reference [19] to predict the channel impulse response, which was expressed as a linear combination of current and past channel states. Liu et al. [20] employed a channel prediction framework based on autoregressive predictors to exploit both the spatial and temporal correlations among antennas. An improved adaptive Kalman estimator was proposed in Reference [21] for the adaptive fading channel. A recursive approximated structure with filter bank and discrete cosine transform was proposed in Reference [22] for channel prediction. For underwater channel state forecast, linear prediction models, such as statistical analysis [23] and exponential moving average (EMA) [24], were utilized, as well. In Reference [11], auto-regression was used every several symbols for the adaptive modulation of underwater communication. Zhang et al. [25] proposed an adaptive channel prediction scheme based on the exponential weighted recursive least square (EWRLS) algorithm, which used current and past estimated channel parameters in the delay-Doppler domain.
Compared with linear prediction methods, non-linear channel prediction can achieve a smaller mean square error (MSE). A support vector machine (SVM) was employed in Reference [26] to predict channel state in airplane cabin scenarios. In Reference [27], an echo state network (ESN) was utilized for fast channel prediction in Ricean fading scenarios, which obtained smaller prediction error than previous designs. Tripathi et al. [28] proposed novel channel prediction frameworks by using stochastic modeling, as well as data-driven learning of channel variability. A deep learning-based algorithm was proposed in Reference [29] to predict future channel state information (CSI) and received signal levels. Due to the complex fluctuation of underwater channel state with environmental noise, non-linear prediction methods can significantly improve accuracy [30]. Diao et al. [30] introduced a channel prediction model based on nearest neighbor regression for underwater acoustic networks, where a fast search algorithm and a statistical storage compression method were used to optimize the time and space complexity of the prediction scheme. However, non-linear prediction methods usually show high computational complexity, while the computational capacity of underwater sensor nodes is limited.
Due to the advantage of significant prediction accuracy, decomposition-based prediction methods have become promising solutions for channel prediction in the most recent years. Long et al. [31] introduced multi-resolution wavelet analysis to predict the received signal strength in the fast varying wireless environment. In Reference [5], the change process of underwater acoustic channel state was modeled as the sum of an environmental process affected by measurable environmental parameters and a Markov process explaining the contribution of unknown physical mechanisms. Based on the historical channel state sequence and recorded environmental parameters, a recursive algorithm was proposed to estimate the combination coefficient of the environmental parameters and the Markov process for channel prediction. The decomposition-based prediction methods show good performance [32] and the reason is as follows. From the perspective of divide and conquer, the prediction based on decomposition can enhance the prediction ability of the model [33], as the original non-linear and non-stationary sequence is decomposed into a finite number of subsequences, which have simpler frequency components. Thus, the difficult prediction task is divided into several relatively easy subtasks [34].

Adaptive Data Transmission
Adaptive transmission schemes have been studied in terrestrial wireless communications to improve communication performance. Huang [35] investigated cross-layer scheduling and power control combined with adaptive modulation for wireless ad hoc networks. Reinforcement learning (RL) has also been used for adaptive transmission in terrestrial wireless communication. A transmission scheduling strategy based on deep Q-learning (DQN) was proposed in Reference [36] to maximize the system utility composed of throughput, buffer pressure, and power consumption for the cognitive Internet of Things. Li et al. [37] studied a throughput maximization problem based on deep Qlearning in a wireless communication system with energy harvesting and energy limited transmitter. For hybrid satellite-terrestrial relay networks, the performance of adaptive transmission was investigated in Reference [38] with a decode-and-forward relay. Ekerete et al. [39] investigated adaptive margins for AMC in broadband satellite links during the actual rain event. To increase system throughput and improve transmission efficiency, an adaptive coding transmission (ACT) scheme was proposed in Reference [40] over the satellite-terrestrial channel based on the analog fountain code (AFC), achieving a seamless performance across all channel states.
Underwater acoustic communication surfs from the following difficulties: large amplitude of channel variation, large propagation delay, narrow bandwidth, and low bit rate. Compared with terrestrial wireless sensor networks, the design of UASNs is more challenging.
Adaptive transmission schemes based on rules have been investigated for underwater acoustic communication. Wan et al. [1] proposed an AMC system to maximize the transmission rate with a given transmission power for underwater communication using orthogonal frequency-division multiplexing (OFDM). And the system utilized a finite number of transmission modes which were switched based on the effective signal-to-noise ratio (ESNR). Different modulation methods were used in Reference [10] for opportunistic cooperative transmission of underwater networks under various environmental conditions to achieve the best compromise between robustness and data rate. Kuai et al. [11] proposed a fixed threshold adaption algorithm and the required SNR of different modulation methods were presented to meet the target bit error rate (BER). An adaptive OFDM transmission system was proposed in Reference [12] based on the SNR while maintaining a certain bit error rate (BER). Although these rule-based schemes are convenient to operate, fixed thresholds are not applicable for complex channel fluctuations and varying data transmission requirements, which will result in performance degradation.
Some researchers investigated adaptive transmission based on learning algorithms for underwater acoustic communication. In Reference [41], Xiao et al. proposed an RLbased antijamming relay scheme, as well as a deep-RL-based relay scheme, for UWSNs to optimize the relay mobility and power allocation. Tomasi et al. [13] designed two transmission schemes based on dynamic programming (DP) and a heuristic strategy to send a specified number of packets before a deadline while minimizing transmission attempts. To maximize the expected total amount of delivered data in finite time, energy management was investigated in Reference [14] for underwater acoustic nodes. And a stochastic dynamic programming algorithm was used to solve the optimal solution in energy allocation and a suboptimal algorithm was presented with reduced complexity. Reinforcement learning can be used to derive optimal actions for adaptive transmission in dynamic environments. A RL-based protocol was developed in Reference [42] for underwater acoustic communication to minimize a cost function which combined delay and energy consumption and ensure reliable transmission. Wang et al. [15] formulated the adaptive transmission problem as a partially observable Markov decision process for underwater acoustic communication systems. And a model-based reinforcement learning strategy was used to develop an online algorithm, which could derive the optimal transmission actions to minimize a long-term cost. A reinforcement learning-based adaptive modulation and coding algorithm was proposed in Reference [16] for underwater communications based on the network states. However, the learning-based methods have high training complexity and usually need a long time to converge. Moreover, the reward function should be designed reasonably, which is also a problem to be studied.
Some optimization-based adaptive transmissions have been studied for underwater acoustic communication. In Reference [17], adaptive OFDM modulation and power allocation were investigated to maximize the throughput while maintaining a target average bit error rate (BER). Two schemes were developed with different levels of adaptivity based on a greedy algorithm: One scheme could adjust only the modulation levels and adopted a unified power allocation, while the other scheme could adjust both the modulation levels and the power allocated to each subcarrier. Wang et al. [18] investigated the energy efficiency maximization problem in underwater acoustic channels with periodic dynamics. Assuming that the future channel states were known, a water-filling algorithm was designed to schedule the optimal transmission actions. For channels with causal knowledge, the optimal actions were scheduled based on the predicted channel states and the packet queue condition. However, the computational complexity was relatively high to schedule actions for all time slots.

System Model
Most UASNs can be modeled as a multi-hop clustered network as shown in Figure 2. The clustered UASN consists of a surface sink node and underwater sensor nodes. Generally, the sensor nodes can be classified into cluster headers (CH) or cluster members (CM). The CM nodes gather environmental information and forward the data to its CH. Then, each CH transmits collected data to the sink node through single-hop or multi-hop transmission. The transmission slots of all sensors are scheduled based on media access control (MAC) algorithms, such as Time Division Multiple Access (TDMA). Each node sends at the scheduled slot, and the time interval between two transmissions is assumed to be equal.
The signal-to-noise ratio (SNR) can be considered as an indicator of the channel state, which is defined as the received SNR corresponding to a transmission power of one unit. We assume that the channel state remains stable in each slot and would change in the next slot. In each time slot, some packets arrive at the transmitter node and enter the data buffer. B max denotes the buffer capacity of the transmitter. At the beginning of slot i, the existing buffer length is B i . Let the number of arriving packets be g i , and the number of transmitted packets be l i , the new buffer length can be expressed as The amount of arrival data in the future can be predicted by recursive least squares (RLS) filter [43] and artificial neural network [44]. So, in this paper, for the sake of simplicity, it is assumed that the sensors collect sensory data at certain time intervals for a period of time so that each node can know the data arrival rate in the future period. The set of modulation and coding modes is defined as {m 0 , m 1 , . . . , m M }, which is sorted in ascending order of transmission rate. In this set, m 0 means stop transmission and m M yields max transmission rate. P max denotes the maximum transmission power of the transmitter and M represents the number of modulation and coding modes.

Underwater Acoustic Channel Model
Throughout this article, a shallow-water acoustic propagation environment is considered. According to the principle of underwater acoustic, the signal-to-noise ratio of an underwater acoustic signal at the receiver can be calculated using the passive sonar equation as follows [45]: where SL is the source level, PL is the transmission loss, NL is the noise level, DI is the directive index, and DT is the detection threshold of the sonar for specific modulation and coding mode. All these quantities are in dB re µPa, where the reference value of 1 µPa equals to 0.67 × 10 −18 Watts/m 2 [45]. For the convenience of expression, the notation dB is used to signify dB re µPa in the rest of this paper. The path loss for a signal over distance d is given by Reference [46] as where f s is the spreading factor, which can be taken as 1.5 for a practical scenario, and α is the absorption coefficient, which can be modeled by Thorp's formula [45] as follows: where α is given in dB/km, and f is in kHz. The power spectrum density of the ambient noise in the ocean can be calculated by where and N ther ( f ) in dB per Hz represent the turbulence noise, the shipping noise, the waves noise, and the thermal noise, respectively. These noises can be modeled by the following empirical formulas [46]: 10log where s and w denote the shipping activity factor and wind speed, respectively. The channel state h t is defined as the received signal-to-noise ratio corresponding to a source level SL 0 with a transmission power of one unit. When the source level is SL 1 and the signal-to-noise ratio at the receiver is SNR 1 , channel state is recorded as According to the above formula, channel state can vary with the dynamic environmental factors. The underwater channels could be affected by various environmental factors, such as water temperature, wind speed, tidal, ocean swell, and so on, and these natural phenomena occur at different time scales, such as seasonal, diurnal, minutes, and seconds. These environmental factors result in complex fluctuation of the underwater acoustic channel on various time scales. Specially, the well-known "afternoon effect" caused by the diurnal and seasonal change in water surface temperature can result in the diurnal and seasonal change in the signal and noise strength [9]. As a result, the fluctuation characteristics of channel state can be analyzed for channel state prediction, and an optimized configuration scheme can be derived to improve the energy efficiency of data transmission.

Adaptive Transmission Framework
To improve energy efficiency and reliability of underwater acoustic communication, a double-scale adaptive transmission mechanism is proposed based on the fluctuation characteristics of underwater channel, as shown in Figure 3. The transmission framework consists of two parts, namely double-scale prediction and adaptive transmission. In doublescale prediction, the historical channel state series is decomposed into large-scale and residual series, which will be predicted by a novel k-nearest neighbor search algorithm with sliding window and auto-regressive algorithm, respectively. In adaptive transmission, an energy-efficient transmission algorithm is designed to solve the problem of long-term modulation and coding optimization.
To reduce the complexity of scheduling, the transmitter of a CH or a CM node uses the same modulation and coding mode in a large-scale time. In this way, the modulation and coding mode only needs to be scheduled once for each large-scale period. For the convenience of description, epoch and slot are used to refer to large-scale and small-scale time, respectively. A large-scale epoch consists of N large slots, as shown in Figure 4.
In detail, the large-scale decision aims to predict large-scale channel states and determine the modulation and coding mode for each large-scale epoch. As it is difficult to predict the future channel state in each slot, the average channel state of each large-scale epoch in the future is predicted for schedule. Large-scale channel state is defined as the average channel state in a large-scale epoch. Then, based on the present buffer state and predicted large-scale channel states, the modulation and coding mode in each future large-scale epoch will be scheduled.
Then, given the scheduled modulation and coding mode, the small-scale decision operates to predict the channel state of the next slot and control the transmission power. To improve the accuracy of prediction, the channel state in each slot is predicted based on series decomposition.

Small-Scale Slot
Large-Scale Epoch Large-Scale Epoch In a large-scale epoch, the average channel change should be less than a certain threshold D t , so that the same modulation and coding mode can be allocated for the slots in this large-scale epoch. Thus, the algorithm calculates the average time T large required for channel state change D t and takes T large as the length of large-scale epoch. D t is given as where h max and h min are the best channel state and worst channel state, respectively, and M is the number of modulation and coding modes. At the beginning of a slot, packets are sent by the transmitter. Before the end of the slot, an acknowledgment packet is sent from the receiver to the transmitter via an error-free channel, including the number of packets successfully decoded and the received signal-to-noise ratio (SNR) of each packet.

Double-Scale Channel State Prediction
In this section, the proposed prediction algorithms for the large-scale and small-scale channel states are presented, respectively.

Large-Scale Channel State Prediction
To predict large-scale channel states, a k-nearest neighbor algorithm with sliding window is designed based on subsequence matching. Furthermore, in order to reduce the computational complexity, the length of time series to be reserved is calculated according to the characteristics of channel fluctuation.

k-Nearest Neighbor Prediction Algorithm with Sliding Window
Large-scale channel state is represented as the average channel state in a large-scale epoch, as shown in Figure 5. Large-scale channel state of epoch j is where N large is the number of slots in a large-scale epoch. h S i is the channel state of the i-th slot during the epoch j in dB. For the convenience of expression, the notation h j is used to signify h L j in Section 4.1. Assuming that the current time is in the u-th large-scale epoch, and the stored historical series of large-scale channel state can be represented as where h i denotes the large-scale channel state in epoch i.
The scheme of large-scale channel prediction is shown in Algorithm 1. The input elements of the algorithm include the training set which consists of training vectors and a test vector. And the output of the algorithm is the predicted large-scale channel state after v-th epochs.
The training set Y = [S n , S n+1 , . . . , S u−v ] contains a group of training vectors and their labels. Training vectors are obtained from H L by a sliding window with a length of n, which is the order of the prediction model, as shown in Figure 5b. The label is the v-th value after the corresponding vector in H L . Training vector S i and its label h i+v is given as Test vector S u contains channel state of n large-scale epochs before current large-scale epoch, Firstly, each training vector is matched according to its last value. In detail, training vector S i is selected if the last values of S i and S u are similar, meeting the following condition, if last value of S i and S u are similar then 3 Calculate distance of S i and S u 4 end if 5 end for 6 Choose nearest k vectors with labels 7 Calculate weight of chosen vectors 8 Obtain predicted channel state If this condition is not satisfied, S i is filtered out. Most of the training vectors are filtered out by this condition, so the computational complexity is greatly reduced.
To reduce the computational complexity, the L1 metric is calculated as the distance between S i and S u . The L1 metric is represented as

v1 v2 v3
Sliding window  Inverse distance weight of chosen vector c j is calculated as Finally, the predicted channel state is calculated with inverse distance weight, which is represented asĥ

Calculation of Stored Series Length
Since historical channel state series increases with time and will consume large storage space and increase the prediction complexity, we propose to take advantage of the fluctuation features. Considering the certain changing cycle in a long-time period, only a few cycles of historical channel state series need to be stored to reduce the amount of storage and accelerate the prediction speed.
To calculate the spectrum of historical channel state series, the Fourier transform is used. Then, the frequency f max with maximum amplitude is selected. The time T p corresponding to f max represents the characteristic time of channel fluctuation. The historical channel state series with a length of T p can reflect the characteristics of channel fluctuation. Thus, the historical channel state series with a length of βT p is stored for channel prediction, β > 1.

Small-Scale Channel State Prediction
To accurately regulate transmission power in time-varying acoustic channels, a decomposition-based prediction algorithm is proposed.

Small-Scale Channel Fluctuating Features
Due to the complex fluctuation of underwater acoustic channel state, direct prediction usually suffer from large prediction error. Over-estimation of the channel state will lead to packet loss, while under-estimation will lead to energy efficiency deterioration.
To improve the accuracy of prediction, a decomposition-based prediction model is proposed. The advantage of this model is that it adopts a series decomposition method with low complexity to improve the prediction accuracy, and a large-scale channel state only needs to be predicted once in a large-scale epoch.
Firstly, the large-scale channel state H L is subtracted from the original channel state series H to obtain the high frequency residual series H re , as shown in Figure 6.
The residual series can represent small-scale fluctuating features of the underwater acoustic channel. Although prediction models based on other decomposition methods, such as discrete wavelet decomposition [31] and empirical mode decomposition [32][33][34], can further improve the prediction accuracy, the advantage of the decomposition method in this paper is its lower complexity.

Residual Series Prediction
Then, after decomposition of the original channel state series, the auto-regression (AR) model is used to predict the residual series due to the low computational complexity. The AR prediction model is presented aŝ h re t+1 represents the predicted value of residual series in slot t + 1, and h re t is the value of the residual series in slot t. L AR denotes the prediction order. a i represents the i-th coefficient of AR prediction model and and b t+1 is a noise term. The coefficients of the AR model can be calculated by the least squares algorithm [5,11,25]. Finally, given the predicted large-scale channel state valuesĥ L t+1 in Section 4.1.2, and the prediction value of residual seriesĥ re t+1 , the predicted channel state of the next slot iŝ h t+1 =ĥ L t+1 +ĥ re t+1 .

Energy-Efficient Transmission Algorithm
Based on the predicted large-scale channel states, an energy-efficient transmission algorithm is proposed to schedule the modulation and coding modes.

Problem Formulation
Since the large-scale channel states in the future have been predicted, transmission configuration can be scheduled. The objective of the energy efficiency optimization problem is to minimize the ratio of energy cost to the amount of data successfully delivered, which can be formulated as: subject to Constraint (24) means that the expected amount of successfully delivered data should be larger than the amount of data requested to be transmitted in the scheduling period. Constraint (25) means that the transmission power should not exceed the maximum power of the transmitter. Constraint (26) means that the transmission mode should be selected from the available modulation and coding modes.
In order to calculate the amount of data to be sent, a threshold B c is set to distinguish the buffer states. When the data queue exceeds this threshold, the transmitter will transmit as many packets as possible to make the data queue length lower than this threshold. M max is the max transmitted bits of all modulation and coding modes in a large-scale epoch. STP is the successful transmission probability under the current channel prediction accuracy, which is obtained by statistical method. Thus, M max * STP represents the maximum transmission capacity. According to the data arrival rate, transmission requirements can be divided into three cases: (1) When the bits arrival rate is less than the maximum transmission capacity, and the buffer size is less than the buffer threshold, the amount of successfully transmitted bits should be more than the expected arrival bits. (2) When the bits arrival rate is less than the maximum transmission capacity, and the buffer size is greater than the buffer threshold, the amount of successfully transmitted bits should be more than the expected arrival bits plus a certain proportion ε of the buffer length, 0 < ε < 1. (3) When the bits arrival rate is greater than the maximum transmission capacity, the message should be sent according to the maximum transmission capacity.
As mentioned above, the amount of data required to be transmitted is given as λ represents the amount of arrival data in each large-scale epoch. B i denotes the buffer state at present.
The buffer threshold B c can influence the corresponding energy cost, as well as average transmission delay. The transmission delay is reduced with the decrease of buffer threshold at the cost of increasing energy consumption, while, with the increase of buffer threshold, more packets can be allowed to stay in the buffer until the channel state becomes good, which will reduce the energy consumption and increase the transmission delay. In practice, the buffer threshold can be adjusted according to the application scenarios. When the transmission is delay tolerant, and the energy consumption is more important, the buffer threshold can be set as a large value. In applications that require relatively low latency, the buffer threshold should be reduced. The impact of buffer threshold on transmission performance will be presented in quantitative analysis and simulation, which can be used to select buffer threshold.

Modulation Coding Method Selection
Problem (23) is an integer programming problem. This kind of problem can be solved by heuristic algorithms, such as particle swarm optimization and genetic algorithm. In this paper, an improved genetic algorithm is designed to solve the problem as shown in Algorithm 2. To accelerate the speed of obtaining the optimal solution, a rearrangement process is used.
Firstly, G chromosomes are generated as the initial population. Modulation and coding modes are encoded as genes, and each chromosome is in the following form, MC = [mc 1 , mc 2 , . . . , mc L ], (28) where mc i is a modulation and coding mode for epoch i. In order to ensure the diversity of the population, the combinations of various transmission modes are used as the initial population, while the required amount of delivered data are met. A rearrangement process is utilized on each chromosome to adjust the positions of genes according to the predicted large-scale channel states. The lower modulation coding methods are allocated to worse channel states, and higher modulation coding methods are adopted for better channel states, as shown in Figure 7. The rearrangement process accelerates the convergence speed of the algorithm.  Then, the estimated energy cost and the expected amount of delivered data will be calculated. The packet error rate (PER) can be determined based on the received SNR by using an information-theoretic approach [47] or an empirical formula estimated by real data [1]. So, according to the scheduled modulation coding methods, the predicted large-scale channel states, and target PER, the transmission power can be set. Thus, energy cost and amount of delivered data can be estimated.
For each chromosome, fitness is defined as E e andR e are the estimated energy cost and the expected amount of delivered data for the scheduling time, respectively. Large fitness means that the chromosome has high energy efficiency, and the required amount of transmission data is satisfied.
K chromosomes with large fitness scores are preserved. (G − K)/2 pairs of chromosomes are selected with a probability according to fitness. Each pair of the selected chromosomes are crossed and mutated to produce two new chromosomes as offspring. For a pair of chromosomes, the standard crossover operation recombines them by interchanging portions of them, producing divergent solutions to explore the search space. The mutation operation is performed on a chromosome by changing an element at a random position of the chromosome. After crossover and mutation, the rearrangement process is utilized on each new chromosome.
K preserved chromosomes and G − K new chromosomes form the next generation of the population. As the algorithm continues and the new population evolves, the fitness scores of chromosomes improve. Finally, after several rounds of selection, crossover, and mutation, a good solution is obtained.
Before each transmission, given the scheduled modulation and coding mode for this large-scale epoch, the predicted channel state of the next slot, and target PER, the transmission power can be determined.

Algorithm 2: Modulation and coding mode scheduling
Input: predicted large-scale channel state, buffer state, data arrival rate Output: modulation and coding modes 1 Generate initial population 2 Rearrange chromosomes 3 for crosstime = 1:MaxCrossTime do 4 Calculate fitness 5 Choose chromosomes with good fitness 6 Crossover and mutation 7 Rearrange new chromosomes 8 end for 9 Choose the chromosome with the best fitness

Performance Analysis
In this subsection, quantitative analysis is presented about the impact of buffer threshold on communication performance, and a reasonable buffer threshold is derived for a special channel state series.

Special Channel State Series
In this section, a linearly varying channel state series is presented in Figure 8, and the corresponding transmission performance will be analyzed. It is assumed that only the buffer threshold limits the data queue length, so the buffer length can grow without other restrictions. Moreover, the transmitter does not discard any data packets. Based on this situation, the transmission action of energy cost minimization will be derived. And the impacts of buffer threshold and data arrival rate on communication performance will be analyzed, in terms of energy consumption, average buffer length, and transmission delay. In Section 5.1, the buffer threshold is used to set the amount of data that needs to be sent once every N sch epochs, while, in this section, the buffer threshold always limits the buffer length. Because the channel fluctuation in the first half cycle (from t 0 to t 5 ) is similar to that of the second half cycle (from t 5 to t 6 ), only the transmission actions from t 0 to t 5 need to be analyzed. Let k h be the change rate of the channel state during t 0 and t 5 , where h m = h t 5 is the best channel state, and h 0 = h t 0 is the worst channel state. At time t, the transmission rate is where P t is the transmission power, and c t is the channel gain at time t. And ρ is the ratio of real transmission rate and upper bound of the achievable transmission rate. The logarithmic channel gain, i.e., the channel state at time t is And this equation is equivalent to

Energy Cost Minimization Problem
The objective is to minimize energy consumption and deliver a certain amount of data, subject to where R t is the transmission rate at time t, N t 5 t 0 is the amount of arrival data from t 0 to t 5 , and λ is the data arrival rate. If the buffer threshold B c is long enough, according to the water-filling algorithm, the optimal transmission power is

Reasonable Buffer Threshold
The transmission action with sufficiently large buffer threshold is shown in Figure 9. In order to use the optimal transmission power of Equation (36), which is the optimal solution of (34), the buffer threshold should be large enough. In this paper, the minimum buffer threshold required for obtaining the best solution of (34) is called the reasonable buffer threshold B r = 2B 1 . And B 1 will be derived below.  Constraint (35) can be derived as where T s = t 5 − t 1 is the length of transmission time during the time of t 0 to t 5 . Assume that the transmission rate becomes positive from t 1 , so P t 1 = µ − 1 c t 1 = 0, and Combining (37) and (38), t 1 can be calculated as And µ is calculated by (38) and (40).
If the buffer threshold B c is long enough, the transmission action is shown in Figure 9. The transmission rate will gradually increase from zero and eventually exceed the data arrival rate. The buffer length will rise to a maximum at t 3 ; so, at t 3 , the transmission rate is equal to the arrival rate, t 3 can be calculated as From t 0 to t 3 , the transmission amount of data is From t 0 to t 3 , the amount of arrival data is (t 3 − t 0 )λ, so the increment of buffer length is In order to use the optimal transmit power of Equation (36) from t 0 to t 5 , the minimum buffer threshold required, i.e., the reasonable buffer threshold is B r = 2B 1 . Then, the transmission performance will be derived in three cases, which are divided according to the buffer threshold.

Performance with Large Buffer Threshold
Case 1: If buffer threshold B c is greater than 2B 1 , the transmission action is shown in Figure 9. The energy consumption from t 0 to t 5 is The average transmission energy consumption per unit of data is The average buffer length is The average transmission delay is

Performance with Small Buffer Threshold
Case 2: If the buffer threshold B c is less than 2B 1 and greater than 2λt 1 , the transmission action is shown in Figure 10. During t 0 to t 1 , the node does not transmit; during t 1 to t 2 , the transmission power is ( µ − 1 c t ) + ; during t 2 to t 4 , the transmission rate is equal to the data arrival rate; during t 4 to t 5 , the transmission power is ( µ − 1 c t ) + .

t1 t3 t5
Channel state (dB)  From t 0 to t 2 , the buffer increases from B 2 to 2B 2 , where B 2 = B c /2. Based on (49), t 2 can be calculated as Similarly, t 4 can be calculated as From t 0 to t 5 , the energy consumption is The three items are calculated as follows: From t 2 to t 4 , the transmission rate is equal to the data arrival rate, so the energy cost is The average energy consumption per unit of data is The average buffer length is The average transmission delay is Case 3: If buffer threshold B c is less than 2λt 1 , the transmission action is shown in Figure 11. During t 0 to t 7 , the node does not transmit; during t 7 to t 8 , the transmission rate is equal to the data arrival rate; during t 8 to t 5 , the transmission power is ( µ − 1 c t ) + . From t 0 to t 7 , the amount of arrival data is B 2 , which is half of the buffer threshold B c . t 7 is calculated as t3 t5 Channel state (dB)  Figure 11. Transmission action when B c < 2λt 1 , for case 3.
where B 2 = B c /2. From t 8 to t 5 , the buffer length decreases from 2B 2 to B 2 . Similar to (51), t 8 can be calculated as Similar to case 2, the energy consumption is The two items are calculated as follows: The average energy consumption per unit of data is The average buffer length is The average transmission delay is These quantitative analysis will be calculated in simulation Section 7.4, and impacts of buffer threshold and data arrival rate on communication performance will be presented.

Computational Complexity
The prediction process is composed of large-scale channel state prediction and smallscale channel state prediction. In large-scale channel state prediction, N sch large-scale channel state should be predicted, and, for each prediction, k-nearest neighbor prediction algorithm should act on N rl reserved large-scale channel states. So, the computational complexity of the large-scale channel state prediction is O(N sch N rl ). In small-scale channel state prediction, the number of slots in a large-scale epoch is N large , and N sch N large smallscale channel state should be predicted; so, the computational complexity of the smallscale channel state prediction is O(N sch N large ). In general, N large N rl ; so, the total complexity of the prediction process is CC 1 = O(N sch N rl ). This also explains the content in Section 4.1.2, that the amount of storage can be reduced, and the prediction can be speed up, with the decrease of the length of stored historical channel state series.
In terms of the improved genetic algorithm for modulation coding method selection, N c is the number of evolution cycles, and, in each evolution cycle, the fitness of G chromosomes should be calculated. Because each chromosome represents modulation and coding modes of N sch large-scale epochs, the performance of N sch large-scale epochs should be summed. So, the computational complexity of the improved genetic algorithm for modulation coding method selection is CC 2 = O(N c GN sch ). As described in Section 3.3, in a large-scale epoch, the average channel change should be less than a certain threshold, so that the same modulation and coding mode can be allocated for the slots in this large-scale epoch. In this way, the modulation and coding mode only needs to be scheduled once for each large-scale epoch; so, the number of scheduled parameters will decrease, and complexity of scheduling is reduced. Hence, the total complexity of prediction and scheduling schemes is O(CC 1 + CC 2 ).

Simulation Setting
Simulations are conducted to verify the effectiveness of the double-scale adaptive transmission mechanism in terms of channel prediction and communication performance. The proposed scheme and contrast schemes are evaluated through simulation under the same parameters setting.
The channel state sequence is generated with large-scale and small-scale dynamics. In each slot, the sender transmits one block for 2 s, and the block has 1000 symbols. Unless otherwise specified, the simulation parameters are shown in Table 1. Multiple sets of channel state series with large-scale and small-scale fluctuations are generated by the superposition of multiple signal sources with the MATLAB toolbox. The generated channel state series combines certain regularity and randomness, which conforms to the channel state fluctuation characteristics described in the literature. For example, if the component of large-scale fluctuation is f t , and that of small-scale fluctuation is g t , the generated channel state series for simulation can be calculated as where C is the coefficient to adjust the mean value of the series so that the channel state approximately satisfies the attenuation and distance relationship of the underwater acoustic channel.

Channel Prediction Performance
Multiple sets of channel state series have been generated for simulation, and each series has 3000 channel measurements. And the results of two sets of series will be shown, which are called Data 1 and Data 2. The fluctuation of Data 1 is relatively regular, while the varying of Data 2 is relatively complicated. Figures 12 and 13 show the large-scale channel state prediction results of Data 1 and Data 2, respectively. The predicted large-scale channel states are very close to the real large-scale channel states. The root mean square error (RMSE) of large-scale channel state prediction are 1.25 dB for Data 1 and 1.32 dB for Data 2, respectively. The results reveal that the predicted large-scale channel states can reflect the channel trend in the future. Figures 14-17 show the large-scale channel prediction performance of Data 1 corresponding to the different lengths of storage series as training set and different lengths of the sliding window. The longer the stored historical series is, the smaller the prediction error is. When the stored historical series exceeds 2T p , increasing the length of the reserved series has a smaller effect on improving the prediction accuracy. However, the longer the reserved historical series is, the more time the prediction consumes.  As the length of the sliding window increases, the RMSE of prediction decreases gradually. When the length of the sliding window exceeds 6, the RMSE of prediction almost no longer decreases. The effect of the sliding window length on prediction performance can be explained as follows. Each channel state value is affected by previous channel states. In other words, the channel state might display certain time-delay effects on subsequent channel states. Obviously, the larger the vector length is, the more information it contains. Therefore, in order to cover the time-delay effects, the sliding window length n (number of selected values) should be large enough. However, overly large length of the sliding window may significantly increase computational complexity for prediction and lead to overfitting, which may cause poor performance [48,49].
The small-scale channel state is predicted by the decomposition-based prediction model and AR prediction separately. Figures 18 and 19 show the small-scale channel state prediction results of Data 1 and Data 2, respectively. The RMSEs of decomposition-based prediction is 15.7% and 9.2% lower than that of AR prediction for Data 1 and Data 2, respectively. In the same epoch, channel states of the decomposition-based prediction are relatively stable, while the predicted channel states of the auto-regression prediction fluctuate violently.   In Figure 20, the performances of small-scale channel prediction by two methods are shown for Data 1. The predicted small-scale channel state is used to determine the actual transmission power. RMSE of decomposition-based prediction is smaller than RMSE of AR prediction. The decomposition-based prediction shows better performance.

Data Transmission Performance Comparison
Four modulation and coding modes are used, which is indexed in order of increasing rate, as shown in Table 2. Mode 0 refers to no transmission. The maximal amount of bits that can be carried during one slot is computed based on the transmission mode with the highest data rate, namely Mode 4, as 1000 × 1/2 × log 2 16, where 1000 is the number of symbols per block.
The double-scale adaptive transmission mechanism is compared with the contrast schemes in terms of communication performance. Contrast schemes include combination adaptive transmission (AT), channel-based adaptive transmission, and buffer-based adaptive transmission, as shown in Table 3. Each adaptive transmission scheme consists of an adaptive modulation coding strategy and a channel prediction method for power regulation. Channel-based AMC schedules modulation and coding mode according to the predicted channel state of next slot, as shown in Table 4. Buffer-based AMC schedules modulation and coding mode based on the buffer state at the beginning of the transmitting slot, as shown in Table 5. Both the predicted channel state and the buffer state are utilized to determine modulation and coding mode in combination AMC, as shown in Table 6. In Tables 4 and 6, ∆h = h max − h min . Input vector length Figure 20. RMSE of small-scale channel state prediction with different input vector length.  When the packet arrival rate is 2 kb/slot, the predicted large-scale channel states and the scheduled future modulation and coding modes of Data 1 and Data 2 are shown in Figures 21 and 22, respectively. When the predicted channel state is good, the higher modulation and coding mode is scheduled; otherwise, the lower modulation and coding mode is adopted. The energy overhead of transmitting a certain amount of data in a good channel state is smaller than that of sending when the channel state is bad. Therefore, in order to improve energy efficiency, the transmitter should send more when the channel is good, and send less or stop sending when the channel is bad.  In Figures 23 and 24, the energy cost per kb of all schemes are compared with data arrival rate from 0.2 kb/slot to 1.0 kb/slot. Overall, compared with the comparison algorithm, the energy cost of double-scale adaptive transmission is the lowest. In other words, double-scale adaptive transmission achieves higher energy efficiency than contrast schemes. The good energy efficiency results from the reasonable schedule of modulation and coding mode, as shown in Figure 21.   In Figures 25 and 26, the average buffer length of each scheme is shown with data arrival rate from 0.2 kb/slot to 1.0 kb/slot. The average buffer length of DSAT is longer than that of other schemes. This reflects that the transmitter often waits until the channel is good. With the increase of the data arrival rate, the average buffer length of each scheme increases.  In Figures 27 and 28, the average transmission delay of each scheme is shown with data arrival rate from 0.2 kb/slot to 1.0 kb/slot. The average transmission delay of DSAT is longer than that of other schemes. The average transmission delay of DSAT decreases with the increase of data arrival rate, and the reason is as follows. When the data arrival rate is very low, packets stay in the buffer until the channel state gets better, which makes the average transmission delay relatively long. With the increase of data arrival rate, some packets have to be transmitted, although the channel state is not good, in order to send a predetermined amount of data. Thus, the average transmission delay will be reduced.

Influence of Buffer Threshold
Through the simulation of Data 1, the impacts of buffer threshold on communication performance is obtained. Based on the quantitative theoretical analysis of transmission performance which is described in Section 6.1, the theoretical results of the impact of buffer threshold on communication performance are obtained. The parameters of the linearly varying channel state series used for theoretical analysis is as follows: h 0 = 1 dB, h m = 15 dB, t 5 − t 0 = 30 slots. Simulation results and theoretical analysis are presented.
Simulation results and theoretical analysis of the impact of buffer threshold and data arrival rate on the average energy cost per kb are shown in Figures 29 and 30. The average energy cost decreases as the buffer threshold increases, but the decrease becomes slower and slower. After the buffer threshold exceeds a critical value, the average energy cost hardly decreases. This critical value is positively correlated with the data arrival rate. The buffer threshold can be set based on this critical value to improve energy efficiency and prevent excessive delay.
Simulation results and theoretical analysis of the impact of buffer threshold and data arrival rate on the average buffer length are shown in Figures 31 and 32. The average buffer length increases rapidly with the increase of buffer threshold. Obviously, there is a strong correlation between buffer threshold and average buffer length, which can be obtained from theoretical analysis.
Simulation results and theoretical analysis of the impact of buffer threshold and data arrival rate on the average transmission delay are shown in Figures 33 and 34. When the data arrival rate is very low, the average delay increases rapidly with the increase of the buffer threshold; when the data arrival rate is high, the average delay increases relatively slowly as the buffer threshold increases. With a certain buffer threshold, the transmission delay decreases as the data arrival rate increases. And this is consistent with the result of theoretical analysis.

Conclusions
In this paper, a double-scale adaptive transmission mechanism has been proposed for UASNs with time-varying channels. Firstly, the historical channel state series has been decomposed into large-scale and small-scale series, which can then be predicted by a novel k-nearest neighbor search algorithm with sliding window and auto-regressive algorithm, respectively. Since only a few historical channel state series are needed for channel prediction, the proposed mechanism can ensure the prediction performance with a greater reduction of the computation complexity and the storage size. Then, an energy-efficient transmission algorithm is designed to solve the problem of long-term modulation and coding optimization, and an improved genetic algorithm is designed to accelerate the convergence speed. With the theoretical analysis for the transmission impact of buffer threshold adopted in our proposed mechanism, we have optimized the selection of buffer length. Numerical simulation results show that the proposed methods achieve good performance in terms of channel prediction and energy efficiency. The predicted large-scale channel states can reflect the channel trend in the future, and the adaptive transmission mechanism can significantly reduce the energy consumption of communication. Meanwhile, the simulation results of buffer threshold impact on average energy cost and average transmission delay are consistent with the theoretical analysis. For our future work, we will investigate the combination of the double-scale adaptive transmission mechanism and media access control protocol to further improve the overall performance of underwater acoustic sensor networks.