#I Monitor
#I Monitor
Abstract—In this paper, we propose the first traffic monitoring Jie et al. made a contribution to P2P traffic classification by
and labeling system for iOS devices, named iMonitor, which not simply counting flows [9] and clustering flows [10]; Enck et
just captures mobile network traffic in .pcap files, but also pro- al. [11] and Song et al. [12] proposed their solutions to privacy
vides comprehensive APP-related and user-related information
of captured packets. Through further analysis, one can obtain leakage detection in mobile network traffic.
the exact APP or device where each packet comes from. The Before studying mobile network traffic, a problem we
labeled traffic can be used in many research areas for mobile should solve is how to capture mobile network traffic effi-
security, such as privacy leakage detection and user profiling. ciently and provide detailed information (user-related or APP-
Given the implementation methodology of NetworkExtension related) for further analysis. Current solutions have three
framework of iOS 9+, APP labels of iMonitor are reliable enough
so that labeled traffic can be regarded as training data for shortcomings: 1) OS limitation: Android and iOS are both
any traffic classification methods. Evaluations on real iPhones primary operating systems for mobile phones and previous
demonstrate that iMonitor has no notable impact upon user methods for mobile traffic monitoring are mostly for Android
experience even with slight packet latency. Also, the experiment devices. However, due to different OS implementation, traffic
result supports our motivation that mobile traffic monitoring generated by iOS and Android devices may differ significantly
for iOS is absolutely necessary, as traffic generated by different
OSes like Android and iOS are different and unreplaceable in and are unreplaceable in research [13], which means a novel
researches. monitoring method for iOS devices is desperately needed. 2)
Index Terms—iOS, traffic label, network monitor, mobile APP, Coarse-grained information: Neither on-device monitoring
mobile network tools for iPhones nor packet capturing tools like Wireshark
can offer fine-grained information of the captured network
I. INTRODUCTION traffic. To perform per-APP investigation such as Information
It has been years since we first used mobile phones as tools Leakage Detection, APP-level traffic labeling is necessary. 3)
to access the Internet. As a survey from Bright Edge indicates, Limited capturing scale: There are still no available methods
mobile network traffic generated by phones or tablets takes to capture network traffic of iPhones with detailed information
62% of all online traffic in 2018 [1]. A report [2] from Smart and on a large scale.
Insights also shows that mobile network traffic is taking a In this paper, we present iMonitor system, which provides
dominant place in minutes spent online across countries, and a solution to monitor, collect and label traffic on iOS devices
over 80% of that mobile traffic is generated by APPs. There with detailed information. Contributions of this paper are listed
are also millions of APPs that can be downloaded by iPhone as follows:
users from Apple APP store of China, which is quite a large • The first mobile traffic monitoring prototype for iOS
number. With mobile devices becoming popular as a tool to devices, called iMonitor system, is presented. This system
access the Internet, the scale of mobile network traffic is ever- offers a new approach for mobile traffic data capturing
increasing, as shown in Cisco research [3]. on iOS devices. Given a pre-set bundleID list of APPs,
With a series of sensors installed, mobile phones are getting iMonitor system can effectively capture all traffic gener-
more and more powerful. Meanwhile, those sensors can be ated by those APPs out of overall traffic of that iPhone,
utilized by APPs installed on mobile phones, and information which fills the gap in traffic monitoring of iOS devices.
obtained from sensors can be uploaded to remote servers ex- • A prior approach to acquiring APP-level information of
plicitly or implicitly. From that information, offenders are able mobile traffic is proposed and integrated into iMonitor
to track every move of a victim, such as location data. There is system. As iMonitor system gets detailed information
already a study [4] using sensors installed on mobile phones from a trusted framework in iOS, all APP labels are
to profile users by stress recognition and many researchers fully credible and can be used as a reliable training set
are working on mobile network traffic to protect users from for traffic classification. iMonitor also provides user-level
threats. Wei et al. [5] built a 4-layer (Static layer, user layer, information for researches like user profiling.
operating system layer, and network layer) model to profile • We comprehensively evaluate the impacts of the pro-
APPs of Android OS; Iliofotou et al. [6], Shuba et al. [7] and posed client of iMonitor system on devices and users.
Vallina et al. [8] built their models for network monitoring; The in-depth analysis of network throughput, resource
consumption, and label effectiveness demonstrates that will be routed to this VPN server to be handled, which means
our iMonitor system has no notable influence upon user that phone will do a lot of work processing those packets,
experience and can run in nearly a user-transparent style. and store those packets on the phone if needed. This kind of
As a proof-of-concept, we implemented a prototype of VPN requires phones’ performance and may consume lots of
iMonitor system and evaluated the performance of it. We con- battery to complete its jobs. With packets captured are stored
nected our iPhones to iMonitor system and use them in real- on phones, it also needs a mechanism to upload those captured
life scenarios, in the meanwhile, we collected mobile network packets to a given server.
traffic with detailed information, with which we applied to
B. OS-based Traffic Monitoring
mobile traffic classification implemented with Random Forest
and verified the conclusion of research [13] by Hasan et al OS-based traffic monitoring approaches monitor and capture
as a use case (see Section IV-C). Performance evaluation network traffic actively using API provided by OS, such
measured network throughput of proxied iPhones and resource as tcpdump, which is used by ProfileDroid [5]. Using this
consumption of them. We made contrasts between proxied and approach to monitor network traffic of mobile devices requires
unproxied network throughput and resource consumption, and system-level privilege, which means that the device needs
results show that iMonitor system has good performance and to be rooted. With devices rooted, one has full access to
little interference to normal use of network. all the information of those devices, thus making monitor
Rest of the paper is organized as follows. Section II network traffic of mobile devices easier. However, most users
discusses related work. Section III describes the design and are unwilling to have their devices rooted, and if users regret
implementation of iMonitor system. Section IV describes to have their devices rooted, the only method to restore their
evaluation of effectiveness, network throughput and resource devices unrooted is to reinstall the OS, which causes a lot of
consumption of iMonitor. Section V concludes this paper and problems, moreover, for iPhones, if their former installed iOS
describes the future work. is too old, they will not be able to reinstall that version of iOS
back to their iPhones, because the verification channel of that
II. RELATED WORK version of iOS may have been closed.
A. VPN-based Traffic Monitoring C. On-device measurements
In VPN-based traffic monitoring approaches, mobile devices On-device measurements mean to collect information of
are connected to a VPN proxy and network traffic is routed network status on the devices with some installed apps or pro-
to the VPN proxy to be handled, thus making VPN proxy vided web pages, such as Mobilyzer [19], speedtest [20]. This
knows the detailed information of traffic. Privacy Guard [12] kind of collection often does not require root privileges, but
and AntMonitor [14] are two representative results on Android the information collected is not detailed enough for research.
devices and iMonitor also used VPN-based traffic monitoring.
Basically, in Android, people have two alternatives to im- D. Passive Monitoring
plement a VPN, client-server VPN and mobile-only VPN. Passive Monitoring approaches are used on network nodes,
1) Client-Server VPN, such as Meddle [15], which is built such as gateways of LANs. For ISPs and other organizations
with StrongSwan [16], as its name indicates, has two major that provide network services to the public, they have control
parts, a client and a server. Usually, people use an app on the over the network they are providing, thus making it possible
phone as a client, and some programs running on a remote for them to capture packets via their network interfaces [21].
computer or VPS as a server. Between client and server, Weakness of this approach is obvious. For that network traffic
there should be a tunnel obeying some specific protocols, are captured outside the devices, one cannot get fine-grained
which is used to transmit packets between client and server. information of captured network traffic.
Developers of this kind of VPN will be free to use any kind of
protocols, which may provide encryption or private browsing E. Application of Traffic Monitoring
functions, to implement their tunnel, thus making it possible In this section, we roughly enumerate three main applica-
to ensure the security of data transmitting between client tions of mobile traffic monitoring.
and server. However, when people use Client-Server VPN Traffic Classification: Mobile traffic classification is a
to monitor mobile networks, the separation between network topic of mobile network research, and many jobs have been
traffic and information of that network traffic will appear, done before. Researchers have tried to recognize apps using
because information of network traffic, such as which app the packet headers or HTTP request headers [22]–[24], statistical
network traffic comes from, is only accessible on the phone. characteristics of packets [25]. Nevertheless, the encryption of
This requires some mechanism of communication between network traffic is absolutely a trend in the network. Encryption
client and server. 2) Mobile-only VPN, such as Privacy Guard is an excellent way to ensure the security of the network
[11] and Haystack [17], [18], different from Client-Server while protecting information of network users; it makes it a
VPN, requires only one participant, which is the phone itself. tough thing to analyze network traffic. To deal with encrypted
With the support of Android’s VPNService API, people are network traffic, some researchers tried to use machine learning
able to build a VPN server on the phone, and all the packets to recognize apps from HTTPS/TLS network flows. All the
jobs done above are all based on traffic captured from Android
devices, although there are some attempts on network traffic
captured from iOS devices, their collection of iOS network
traffic is restricted to the laboratory environment. There is still
a lack of a solution to capture iOS network traffic on a large
scale.
User Profiling: Mobile APPs now cover almost every single
part of our lives. People have got used to ordering meals,
paying for groceries, chatting with friends, watching movies
Fig. 1. System Architecture
with APPs on phones, in other words, by analyzing what kind
of apps a man is using, we can figure out what kind of people
he is. Taking advantage of this, polices or intelligence agencies the limitation of iOS. 2) CoM (Client of iMonitor system)
will be capable of identifying underlying threats using the should not consume too many resources. In order to reduce the
HMM classifier on network flow records [26] or re-identify burden CoM cast on users’ devices, CoM needs to do its job
users over different web sessions [27]. efficiently and we have to control its resource consumption. 3)
Information Leakage Detecting: Smartphones now have CoM itself should not be too complicated to be used. In the
been installed with a large set of sensors, such as gravity best scenario, users just need to connect to server of iMonitor
sensors, fingerprinting sensors, GPS modules. With network system by a single tap on a toggle switch, and they do not
flows collected by our system, researchers will be able to need to care about CoM anymore after this.
detect information leakage of different APPs on iOS with
network traffic captured by our system. PrivacyGuard [12] and B. System Design
Recon [28] are examples of this application. The iMonitor system consists of a client-side part, CoM,
which is installed as an APP on iOS devices, and a server-side
III. I MONITOR SYSTEM
part, SoM, which is deployed on remote servers. Basically,
A. Design Rationale iMonitor system needs a MDM (Mobile Device Management
Before giving details of iMonitor system, some design ) Server to distribute configurations, but for the reason that
objectives are listed as follows: iMonitor system is built for demonstration at current stage,
Objective 1: Large-scale traffic collection: We are im- MDM server will not appear in this paper. We have already
plementing iMonitor as a system to monitor and collect large- written configurations in CoM before it is compiled and
scale network traffic of iOS devices, which poses requirements distributed. The System architecture of iMonitor is shown in
on iMonitor system. 1) User group of iMonitor is the larger the Figure 1. The CoM includes a PerAppProxy (PAP in short )
better because more users means more mobile network traffic to intercept network traffic of a given list of APPs, a Pack-
we are collecting. For this reason, iMonitor system should etTunnel (PT in short ) to forward those intercepted packets,
provide great user experience. 2) Performance on both client and a Controller Module to deal with user interactions and
and server of iMonitor system should be excellent, thus giving communicate with QueryServer (QS in short ) of SoM. On the
iMonitor system the ability to process more network traffic at server-side, there are different servers responsible for different
the same time. missions. We divide them into three parts, ProxyServer (PS in
Objective 2: Fine-grained traffic information: Informa- short ), DataManageServer (DMS in short ) and QueryServer
tion that iMonitor system collects should be as detailed as (QS in short ). In the following paragraphs, we will discuss
possible. Other than normal properties of a packet, APP label the design of the client and server in detail.
and device identifier of network traffic are also meaningful and Client-side: The client-side is charged with interacting with
should be recorded. All that information should be organized users, collecting information about mobile network traffic,
well so that researchers can use the information conveniently. uploading collected information and forwarding intercepted
Objective 3: Multiple APP traffic monitoring: The iMon- packets in the iMonitor system. To accomplish those missions,
itor system should be able to monitor and collect information we need to implement a Controller Module, a PAP and a PT
of all kinds of APPs, no matter how they are implemented. in CoM. 1) PAP (PerAppProxy ): PAP is a Per-App Proxy
As we all know, communication mechanisms of TCP and containing a list of APPs, which is called rule list. All the
UDP are quite different from each other, for example, TCP is network traffic from those APPs will be directed to PAP in the
connection-oriented but UDP is connectionless. To offer mul- form of network flows. According to different types of packets,
tiple APP traffic monitoring service, iMonitor system should network flows can be divided into TCP network flows and
not only handle TCP packets but also have UDP datagrams UDP network flows. By reading properties of TCP network
well handled. flows and UDP network flows, we can get detailed information
Objective 4: User transparency: User transparency cov- about them. If we want to get specific information about
ers a lot of aspects. 1) Mobile device should remain non- transmitted packets, such as source IP-Port and destination IP-
jailbroken. Most of the users resist to have their Apple devices Port, things are different for each kind of network flow. For
jailbroken, so we have to implement iMonitor system within TCP flows, we are aware of its local address and destination
Fig. 3. Log item
C. Preliminary Application