## 1 Introduction  
Sensing, processing and communication are integrated into a tiny wireless sensor network (WSN) device. They are used in inaccessible environments and maintenance is typically inconvenient or impossible because wireless sensor networks are robust and distributed. WSNs are widely used in residential, industrial, and environmental monitoring. WSNs are being more and more used in outdoor environments to monitor weather conditions, the natural habitat, the scene of disasters, ecological systems, nuclear accident sites, _etc._ Compared to traditional wired networks, WSNs are relatively simple and inexpensive. In addition, such networks can be easily extended by simply adding more devices without reworking and reconfiguring the whole network. The most direct application of sensor networks is in remote environmental monitoring. For example, large numbers of sensors can be deployed in a remote forest area to immediately report any incident such as a fire. Ideally, the sensor node of a set of batteries can run for a year. Considering the cost of sensor nodes (SNs), discarding sensor nodes without electricity is not feasible, and it may be impossible to replace the batteries of SNs. Therefore, there is a huge demand for an energy conservation scheme to reduce energy consumption and prolong the lifetime of wireless sensor nodes [1,2]. At present, wireless microsensor nodes are about the size of a quarter dollar. Meeting the energy demands is the biggest challenge in WSNs. Therefore, the sensor network platform must provide an energy-efficient protocol to greatly reduce power consumption. The energy efficiency is defined as the ratio between the number of data transmissions and the energy consumption. Table 1 shows the power measurement of a typical sensor node in an active, sleep, transmit, and receive modes [3]. The wireless network is time-varying. If a number of error packets are dropped at the receiving end, this will result in retransmissions resulting in a waste of bandwidth and finally lead to energy consumption. Therefore, reducing the number of retransmissions can help minimize the energy consumption. The main reason for his is framing errors. There are three main types: interference, slow fading and fast fading. Interference is due to white Gaussian noise or other users using the same frequency channel. The path loss and shadows are the main reason for slow fading. Fast fading is \begin{table}
\begin{tabular}{c c} \hline
**State** & **Energy Consumptions** \\ \hline \multirow{2}{*}{Transmit} & 10.8 mA (radio) \\  & 8 mA (cpu) \\ \hline \multirow{2}{*}{Idle/Receive} & 7.5 mA (radio) \\  & 8 mA (cpu) \\ \hline \multirow{2}{*}{Sleep} & 1 uA (Radio) \\  & 1 uA (cpu) \\ \hline \end{tabular}
\end{table} 
Table 1: Power measurements of a sensor node [3]. mainly due to spread delays or Doppler frequency. As mentioned above, the retransmission is the main cause of wasted energy [4; 5; 6]. This paper presents a link adaptive mechanism to improve the energy efficiency and extend the whole network life. Our focus is to improve the MAC layer protocol. MAC is in charge of transmitting data over the physical channel. Because the frame error rate is dependent on the packet size, we need to revise the amount of data sent according to the channel quality at any time. We use variable frame sizes to replace the fixed frame size. Variable frame size can improve throughput; if the network state is good, sensor nodes can transmit big data packets. Otherwise, they transmit small data packets if the network state is bad. According to the channel quality we use a multi-armed bandit (MAB) model to optimize the frame size to improve the energy efficiency. We introduce bandwidth estimation based on ACK interval to evaluate the wireless channel quality and use the multi-armed bandit (MAB) model to find the optimal packet size for data transmissions. This paper proposes three important aspects:  
* The frame size adaptive adjustment replaces the fixed frame transmission according to the channel quality.