###### Abstract  
Airtime fairness has emerged as a key approach to enhancing wireless throughput performance. However, existing research often overlooks the precise calculation of airtime, particularly in relation to TCP acknowledgments. This paper introduces a novel method, implemented on the access point side, for accurately calculating the airtime of TCP and UDP flows. Building on this, we propose a QoS-based scheduling algorithm designed to improve fairness between upload and download traffic. The effectiveness of the algorithm is validated through experiments that accurately measure both throughput and airtime for upload and download traffic. WiFi; airtime; fairness; QoS; scheduling; TCP; UDP; upload; download +
Footnote †: journal:  
0000-0000-0000-0000-0000-0000-0000-0000-0000-0000-00000-00000-00000-00000-00000-00000-00000-00000-00000-00000-000000-0000  
to distribute channel occupancy time fairly (system resource fairness) rather than just data transmission opportunities (individual throughput fairness). Airtime fairness mitigates the impact of slow devices on overall throughput and enhances network performance, and it has already been implemented in many commercial routers. Despite these advancements, challenges with airtime fairness remain. Traditional airtime fairness considers only direct airtime during data transmission and overlooks additional airtime introduced by the DCF, known as indirect airtime. This oversight can prevent accurate allocation of channel resources by the access point (AP). Furthermore, fairness at the MAC layer does not necessarily translate to fairness at the transport layer [2, 3, 4]. For example, TCP flows, which provide reliable transmission through acknowledgment packets (ACKs), consume part of the wireless channel resources without contributing to data transmission, unlike UDP flows. This discrepancy necessitates the design of algorithms at the MAC layer to balance airtime between TCP and UDP flows, ensuring accurate resource allocation and better airtime fairness. To improve wireless airtime fairness, we propose a quality of service (QoS) scheduling algorithm based at the access point. This algorithm assesses the wireless status of each flow to calculate its expected airtime, enabling the AP to select the appropriate data from the sending queue. The key contributions of this paper are as follows:  
* We extend the concept of airtime fairness by integrating both direct airtime elements of data transmission and indirect elements, including those related to wireless protocols and TCP acknowledgments. We develop precise methods for calculating airtime for TCP and UDP flows, considering factors such as the state of the wireless layer, transport layer, and traffic direction. Furthermore, we introduce a QoS scheduling algorithm at the access point that ensures airtime fairness for both upload and download traffic. * We propose an algorithm to achieve airtime fairness by integrating support logic and control logic. The control logic manages Wi-Fi QoS scheduling, determining the order of flows in the transmission queue. The support logic calculates each flow's quota, based on the accurate average airtime value of the flow. We demonstrate that the cooperation between support logic and control logic effectively ensures airtime fairness. * We implement and test our algorithms in the ns-3 simulation [5] environment. The experimental results reveal that, without the QoS scheduling algorithm, expected fairness cannot be guaranteed. Traditional airtime fairness algorithms, due to inaccurate airtime calculations, perform poorly in fairness indices. In contrast, our QoS scheduling algorithm successfully achieves airtime fairness for both upload and download traffic, with results closely approximating the optimal solution. This paper is organized as follows: Section 2 reviews related work and summarizes the development of Wi-Fi transmission fairness. In Section 3, we model and analyze the airtime components of TCP and UDP, deriving specific calculation methods.