The structure of cellular network is similar to our common cellular, which is composed of one base station after another. Ideally, our cellular network should look like the following. Of course, the distribution of network resources in real life is not so uniform.

Wi-fi is an unlimited local area network technology. Wi-fi signals need to be provided by a wired network, such as the broadband Internet we use at home, which is converted from a wired signal to a Wi-Fi signal.

Difference in billing

We usually use cellular networks based on data charges, such as 10 yuan 30 MEgabytes data plan, but Wi-Fi is generally free, why this difference?

Wi-fi signal access to the Internet needs to rely on broadband and other wired networks, and the broadband network we have paid an annual fee or a monthly fee, within the specified time can access to test exclusive broadband resources, must be in this period of time to use the traffic to access the Internet. Cellular networks is the use of operator stations such as communications equipment to the Internet, in the process of the Internet need to occupy the public wireless resource such as spectrum, and operators through some infrastructure provides wireless resources for use by the users, users should be clearly pay related fees, everyone has experience at the same time, the use of cellular networks when many people in the same area, the network will slow down obviously, This is due to the lack of wireless resources. In this sharing model, it makes more sense to charge for traffic, which is how much resources are consumed.

Resource control

Wireless resources are scarce and expensive, so how do mobile devices control them today? This is RRC (Wireless Resource Control). RRC not only saves wireless resources, but also saves power for users.

Since I am not a communication-related developer, I will give you a general idea. Details of the RRC state machine can be found here. RRC will have related states, which can be simply understood as idle state and active state. When the mobile phone is in standby state, it can be regarded as idle state. In this state, wireless signal will be turned off, and the RRC will be adjusted to active state when data transmission is needed. This delay is part of the data transmission delay of our mobile network, which is perceived by users (the delay is divided into RRC state switch, DNS resolution, TCP handshake, SSL handshake, network transmission, etc.). The figure below comes from the Internet and can help to understand to some extent (the data may not be accurate).

In addition to latency, there’s also the matter of battery life on your mobile device. After switching from the idle state to the active state, the active state will remain for a period of time. If there is no data transmission, it will enter the idle state again. Compared with the active state, our equipment consumes more electricity. So for each network request, we need to consider its rationality, if the RRC state is frequently switched, the active state will consume more power.

However, there is no multi-state switch for Wi-Fi, which is always on. However, due to its own mechanism, Wi-Fi can save more power than mobile cellular network when conducting a large amount of data transmission.

How do you save electricity in theory?

Based on the discussion just now, some theoretical power saving methods can be summarized:

  • Avoid ineffective rotation training, which will make the mobile phone constantly wake up and make the device in a high consumption state
  • If there are long connections, set a reasonable heartbeat time and should not be reconnected indefinitely
  • To reduce the frequency of network data acquisition, we can combine network requests and prepull cache
  • Wi-fi is more suitable for big data transmission in terms of stability, delay, power and flow

The resources

  • Introduction to mobile Networking with RRC
  • Android Performance Optimization -Battery
  • Power saving for performance optimization on mobile Networks
  • How does RRC status affect cell phone power consumption?
  • Exploration and practice of Mars, a cross-platform component of wechat terminal in mobile network