4.3 System Design
4.3.2 Optimization for smartphones
Given the data transfer performance observed in our war-driving and war- walking experiments (Section 4.2.1), it is challenging for smartphones to use WiFi networks to offload data traffic even at walking speed (i.e., for pedestrians). MADNet adopts several mechanisms dedicated for smart- phones to improve the performance in WiFi offloading.
Content Prefetching
We use content prefetching to improve the wireless access performance. The effect of content prefetching has been studied and considered suitable for mobile devices [189]. The prefetching approach is important especially for traffic offloading on smartphones, given the limited size of smartphones where internal antennas can restrict the wireless access performance.
Since our system focuses on mobile streaming, we leverage the pre- dictable feature of streaming content to achieve effective prefetching. In MADNet, the Smart-Client manages the content play lists for the mobile user. Once the location context is ready and there is a demand for streaming services, Smart-Client will convey this information to Cellular-Agent. By selecting a suitable MADNet-enabled AP for offloading, Cellular-Agent will push the play list to the target AP on which WiFi-Agent is installed. WiFi-Agent will prefetch the pending content in the list from the Internet and then serves the prefetched content once the smartphone successfully connects to this AP. We note that the overhead of prefetching can increase if the prediction is incorrect [189], making the content fetched by a WiFi AP redundant. To minimize the negative impact of inaccurate prediction, WiFi-Agent will remove the prefetched content in its local storage accord- ing to a pre-defined time threshold, and thereby saves storage space.
Positioning
To identify the target AP for traffic offloading, MADNet utilizes the user location as a key context to make offloading decisions. To be en- ergy efficient, MADNet leverages different technologies to provide location information under different environment contexts. For example, GPS is
regarded as power-hungry and can drain the battery of mobile phones in a few hours [260]. Therefore, MADNet utilizes a WiFi positioning scheme to save energy if such context is available (i.e., in commercial areas with WiFi coverage). To make our system versatile and capable for different environ- ments, Smart-Client will use GPS if the WiFi positioning scheme can not locate the end user. Regarding GPS positioning, it takes 14 seconds on the average for a cold-start GPS to get the first accurate fix using AGNSS ac- cording to our measurement on N900. For the location method using only internal GPS (i.e., GNSS), the cold-start duration on N900 is around 20 seconds with 6.30 Joules of energy consumption. We hence prefer AGNSS for positioning in MADNet.
The WiFi-based positioning scheme in MADNet is based on RADAR [77], which uses WiFi fingerprints with reference radio-map. Smart-Client conducts WiFi scanning three times at the beginning to collect three groups of samples. It then filters the scanning results by voting, so that only those APs that appear at least twice in the results are kept. Smart-Client then sends the aggregated samples to Cellular-Agent via cellular connec- tion. Cellular-Agent compares the sampled values to its WiFi fingerprint database and selects a location with the highest similarity as the estimated user location.
We note that a single WiFi scanning sometimes exhibits arbitrary re- sults regarding signal strength and number of APs nearby. This affects the accuracy of location estimation. MADNet hence demands Smart-Client to conduct three WiFi scannings to assist the positioning process. The overhead of WiFi scanning for three times is obviously higher than scan- ning once, but compared with the impact of incorrect positioning, which may result in missing the opportunity to use a WiFi AP for offloading, our method aims to strike a balance between the positioning accuracy and scanning overhead.
Mobility and Target AP Prediction
Selecting a suitable WiFi AP for offloading requires the MADNet system to predict the mobility of end users. Inspired by the K Nearest Trajectories (KNT) algorithm that uses history trace to predict vehicle mobility [7], we design a prediction algorithm for MADNet, Average Nearest Trajectories (ANT), to help select a suitable WiFi AP for offloading.
Given that the basic KNT algorithm only utilizes historic traces (i.e., position of a user in the previous 20 seconds or 1 minute) to predict future location, it does not take into account the regularity of human mobility
[216]. Our ANT algorithm is dedicated for smartphones in the traffic off- loading scenario. The major steps of ANT are illustrated as follows:
• Determine the average nearest trajectories: ANT utilizes an estab- lished database for location coordinates that reflect the mobility his- tory of end users (e.g., collected by cellular operators from collabo- rative users with energy-efficient technique [211]). Each entry inside the database contains a pair of values (T , C), where T is the recorded time in a day formatted as “Hour:Minute:Second”, and C is the co- ordinates of the recorded spot. A trajectory in ANT is a number of consecutive entries in the database following the time-line sequence, such as [(T1, C1), (T2, C2) .. (Tn, Cn)].
MADNet utilizes WiFi/GPS positioning to infer the current location, which serves as an input for the ANT algorithm. By calculating the distance of the estimated current location against a set of coordinates in historic trajectories (HT ), ANT seeks the average nearest trajec- tories in the database, which are essentially a set of trajectories that have the shortest average distance from the estimated current loca- tion to all the entries on each trajectory. We then select those average nearest trajectories (i.e., nearest neighbors) for mobility and target AP prediction.
• Predict the future mobility and vote for a candidate AP: Based on the average nearest trajectories determined in the previous step, ANT conducts a linear search in each trajectory to find an entry (T , C) with the closest T matching the current time of the day. After finding such an entry in a trajectory, ANT infers the future mobility based on the trajectory where this entry is located. By using a WiFi location database containing the coordinates of MADNet-enabled APs, ANT uses the selected entry as a starting point to check the next entries on the trajectory that are within a time interval (e.g., by considering user’s moving speed). ANT then infers a group of APs visited by the end user along the trajectory within that interval. A WiFi AP is determined to be a visited one when its distance to a location on the trajectory is within a pre-defined range. ANT adopts a voting process on the selected APs to check whether they have been visited by at least half of the average nearest trajectories. We then report all the APs that fulfill such requirements as the candidate APs. This algorithm differentiates from KNT in a couple of respects. First, we use the current location only, while KNT assumes the device constantly
records its previous GPS location, which is inefficient in terms of energy consumption. Second, we use more efficient linear search rather than linear interpolation because once we have determined the average nearest trajec- tories, the future mobility trajectories can be deduced from the database by considering the regularity of human mobility [216]. Finally, the goal of ANT is to find the suitable WiFi APs for offloading. The candidate APs will serve as input for the energy-aware offloading algorithm (Section 4.3.3) to select a final WiFi AP which is the most energy efficient one to offload mobile traffic.
The main reason we design ANT for MADNet is for the fact that smart- phones can not afford continuous WiFi scanning due to the high energy cost. Enabled by the collaborative design (e.g., operator’s knowledge on AP location, mobility history of end users), MADNet only requires a few scanning samples for positioning. Based on such location input, ANT sug- gests a group of candidate APs that will be potentially visited by the end user. We note that with the limited number of location input, MADNet may suffer from prediction inaccuracy especially when an end user is at a crossroad. One approach is to use mobile sensors to obtain orientation context to compensate the limited number of positioning samples, which can be integrated on the Smart-Client.
Since mobility prediction is a challenging task [261], we aim to minimize the negative impact when a prediction is incorrect. In MADNet, even if the prediction is inaccurate, Smart-Client can detect that there is no suitable AP to associate with (e.g., WiFi association failed). In such a case, Smart-Client continues to use cellular connection to fetch streaming content, without interrupting the ongoing data flows.