![](https://csdnimg.cn/release/download_crawler_static/16521427/bg3.jpg)
of ping2 later) because they are impacted by the device’s energy
saving modes [6, 7, 14, 16], such as the low power suspend mode of
the processor [48] and the power saving mode of the WiFi chip [35].
In particular, if the device is in the energy saving mode, the ping
latency will be significantly inflated by the device wake-up time
and is thus inaccurate. Because there lacks a feasible WiFi latency
measurement tool, researchers and operators rarely know accurate
WiFi latencies in an EWLAN.
Design of ping2: To obtain more accurate WiFi latency, we
develop ping2, a ping based light-weight WiFi latency measure-
ment tool. The key idea of how ping2 avoids the additional
delay introduced by the energy saving mode is intuitive. As shown
in Fig. 2, ping2 runs on a server on the wired network in the
EWLAN, and sends two consecutive pings from the server to a
user’s device. The first ping is used to wake up the device. After the
first ping is returned, the second ping is immediately issued. Since
the device default active mode time (e.g., about 200 ms for Android
devices [36] and 100 ms for iPhone [35]) is usually longer than the
RTT (e.g., in Fig. 4, 98% of RTT is less than 200 ms, and 97% of
that is less than 100 ms), the second ping, in most cases, avoids the
device’s energy saving mode, and is able to measure WiFi latency
more accurately. Thus, the second ping (RTT 2 in Fig. 2) is deemed
as the measured result by ping2. Note that the wired part latency
(from the ping2 server to the AP) is negligible because the 99
th
percentile of wired part latency is less than 1 ms in THU-WLAN
according to our measurement.
Wireless
Wired
Server Mobile DeviceAP
Energy
saving mode
Wake up delay of CPU
RTT 1
Wake up delay of WiFi chip
RTT 2
PING frame
Beacon frame
NULL frame
1st ping
2nd ping
ping2
Active
mode
Figure 2: Time line of ping2.
We use ping2 to measure the WiFi latency of users’ devices that
connect to the EWLAN. In order to obtain a stable latency, we use
ping2 to measure the latency of each device every 10 seconds and
take the average of six measured results in a minute as one WiFi
latency record in the dataset. The IP addresses of the connected
devices are recorded by the EWLAN and can be obtained from the
SNMP data. To reduce bandwidth cost, ping2 uses ping packets
without any payloads.
Evaluation of ping2: We now evaluate ping2 in terms of its
accuracy, server overhead, and battery overhead of users’ devices.
In order to validate the accuracy of ping2, we conduct controlled
experiments on three different types of mobile devices in a small
testbed. The testbed has an AP, a Linux server connected to the
AP in a wired way, and three mobile devices including an Android
smartphone (LG Nexus 5), a Windows tablet (Surface Pro 3), and a
Linux laptop (Lenovo ThinkPad X1 Carbon). The testbed is set up
in an isolated environment where almost no traffic is on the wireless
channel we used. We restore the three devices to their factory
settings such that the devices will not be waken up by additional
installed softwares. Each time, we let only one mobile device
connect to the AP via WiFi, and then use the following methods to
measure WiFi latency in turn: M
1
uses ping2 to measure latency
every 10 s; M
2
pings from the server to the mobile device every
10 s; M
3
pings from the mobile device to the server every 10 s;
M
4
pings from the mobile device to the server every 1 ms; M
5
is MobiPerf, an app that is installed only for the smartphone and
pings from the smartphone to the server every 0.5 s and uses the
average of 10 pings as a latency result. We assume that WiFi
latency remains the same during the experiment, and consider the
result of M
4
as the ground truth of WiFi latency since the ping
of that high frequency prevents devices entering energy saving
mode [14, 16]. M
4
is a more general method to obtain the ground
truth of WiFi latency than manually turning off the energy saving
mode of devices, because the later depends on or may even not
be supported by devices. We use each method to measure latency
120 times and show their CDFs in Fig. 3. Among these methods,
M
1
(ping2) is the most similar to M
4
for different devices, which
indicates that ping2 can measure WiFi latency more accurately.
On the other hand, M
3
and M
5
introduce extra latency because if
the device is in energy saving mode, it needs several milliseconds
to wake up before sending the ping; M
2
is even worse because
according to the power saving strategy, waking up a device from the
AP side requires waiting for an AP beacon, which can be delayed
for as long as a beacon cycle [29], e.g., 100 ms in THU-WLAN.
In terms of server overhead, ping2 is extremely light-weight.
We implement ping2 using C++ multithreading, and run it on
an ordinary Linux server (with two Intel E5-2420 CPUs, 32 GB
memory, and a gigabit ethernet card). At peak hour, ping2 is
capable of measuring the WiFi latency of more than 15,000 online
users’ devices using less than 10% CPU utilization and 1MB/s
bandwidth (also including the overhead of SNMP data collection).
In addition, ping2 introduces relatively low and occasional
overhead on the batteries of users’ devices. We conduct A/B tests
on 6 different pairs of phones in our small testbed. For each pair,
one is measured by ping2 and the other is not. To evaluate the
worst case, that is, let ping2 wake up the phones from the energy
saving mode as much as possible, we set all the phones to their
factory settings and standby mode, so they are in energy saving
mode in most cases during the test. We find that ping2 costs
at most 7%–10% of the battery volume for different phones in a
persistent test of 24 hours (Table 1). In practice, the impact of
ping2 could be much less because users’ phones themselves are
not always in energy saving mode. Specifically, they are woken up
periodically by the background traffic of mobile apps [49], such
as the transmission of app logs and keep-alive packets. More
importantly, ping2 does not have to run all the time. WiFiSeer
only needs to periodically collect a dataset, e.g., for a week every
quarter, to build WiFi latency models.
In summary, ping2 is an accurate and low-cost tool for mea-
suring WiFi latencies in a large EWLAN. It also is very general
and can be plugged into an operational EWLAN without any
modifications to the existing APs or users’ devices.
Table 1: Maximum battery costs of ping2 in a persistent A/B
test of of 24 hours.
ID Brand Model Battery costs of ping2
1 Huawei Honor 6 7%
2 Xiaomi Mi 4 8%
3 Vivo X5 Pro 8%
4 Oppo R7 9%
5 Samsung Galaxy Note 3 10%
6 Meizu MX5 10%