# CoFi: Coding-Assisted File Distribution over a Wireless LAN
## 1 Introduction  
The IEEE 802.11 (Wi-Fi) based wireless media access control (MAC) protocol has become a dominant technology that provides convenient access to the internet in a wireless LAN, in which a single access point (AP) can serve the file requests from multiple clients [1]. However, the effective performance of Wi-Fi, in terms of throughput, delay, and stability, is still incomparable to its wireline counterpart. This is mainly because of its sensitivity to ambient interference and the volatile wireless link condition [2]. In particular, the persistent-retransmission based loss protection schemes, and a backoff scheme that does not differentiate losses from congestion, have been identified as the main reasons for the inefficiency of 802.11 [3; 4]. Alternative protocols have been proposed. In Reference [5] a new MAC algorithm, called multiple access with salvation army (MASA), which adopts a less sensitive carrier sensing to promote more spatial reuse of the channel, was proposed. The MASA alleviates the problem of a high collision probability by adaptively adjusting the communication distance via \"packet salvaging\" at the MAC layer. The performance of throughput and packet delivery rate was improved significantly. In Reference [6] authors presented the design, implementation, and evaluationof a system that opportunistically caches overhead data to improve subsequent transfer throughput in wireless mesh networks. A new backoff scheme which performs well for dense networks resulting in a low collision probability was proposed by [PERSON] et al. [7]. The backoff scheme opportunistically gives higher priority to users with a high traffic load and better channel conditions, and thus reduced unnecessary contention. A simple window adaptation scheme for backoff in 802.11 MAC protocol was proposed by [PERSON] et al. [8]. The scheme used constant step size stochastic approximation to adjust collision probabilities to set values. Using an approximate analytic relationship between this probability and the backoff window ensured a high throughput and fairness. Protocols in all the above references replaced these two reasons with other schemes to provide a best-effort packet level service. In this paper, we propose CoFi, a MAC level file distribution protocol that aims at improving the WLAN throughput and delay performance under harsh channel conditions. CoFi masks the wireless channel variations using coding based batch transmission. Instead of striving to improve per-packet reliability via retransmission, the AP in CoFi continuously transmits random linear combinations of original packets, which are grouped into batches. Once the receiver accumulates a sufficient number of linearly independent packets, it sends a single ACK to acknowledge the successful reception of the entire batch of data. The rationale of random linear network coding lies in removing packet ordering by mixing the information inside each batch [9; 10; 11]. With this technique, the scheduling problem within each batch can be avoided since the receiver does not have to be halted because of the failure of a single transmission and the subsequent retransmission attempts. As long as the receiver can collect a sufficient number of coded blocks, it will be able to recover the original file. This advantage provides a natural solution to the notorious fairness problem in 802.11, which degrades the throughput of all clients once one of them is experiencing a severe loss [12]. A further optimization that CoFi uses to improve performance is coding based MAC layer caching. The basic idea of MAC layer caching is to take advantage of the wireless broadcast nature [13]. Each client can overhear the coded packets that are intended for another client. When one of the (AP client) links suffers from a harsh channel condition, CoFi allows another client who has overheard packets intended for the weak client to serve as a relay. The relay replaces the role of the AP, and transmits random linearly combined packets to the weak client, until it can successfully decode.