The day before yesterday, my classmate Zhang Qingyu told me that it’s best to use Wi-Fi and turn off the 3G network when Wi-Fi is available, which can save a lot of power. Does 3G really consume more power than Wi-Fi? I looked up the literature and found that it is indeed the case. When the data to be transmitted is less, the difference in power consumption can be as much as 10 times.

Blue line: 3G power consumption; Green line: wifi power consumption (Source: TailEnder)Blue line: 3G power consumption; Green line: wifi power consumption (Source: TailEnder) Blue line: 3G power consumption; Green line: wifi power consumption; Purple line: power consumption considering wifi scanning and establishing connection (Source: TailEnder)

The reasons are mainly two-fold:

  1. After the 3G network completes data transmission, it needs to maintain a high power state for a period of time;
  2. The transmission power of the 3G network is much greater than that of the Wi-Fi network.

Cellular Networks and Wireless Local Area Networks

What is the essential difference between 3G and wifi? One is slow, the other is fast; one has a large coverage area, the other has a small coverage area. In fact, this represents two different forms of networks: cellular networks and wireless local area networks.

Whether it’s GSM (2G), GPRS (2.5G), EDGE (2.5G), CDMA (3G), HSPA (3.5G) or 4G LTE, they are all carrier networks, each base station is responsible for a certain area around it, and the coverage of the base station is similar to a honeycomb, hence the name cellular network (cellular network).

Cellular NetworkCellular Network Cellular Network

Because cellular networks cover a wide area and have powerful fixed base stations, it is assumed that all users can hear the base station, but users may not necessarily hear each other. This requires the base station to allocate non-interfering channels to users.

GSM (2G) initially used Time Division Multiplexing (TDM) technology, which divides time into several slices for different clients to use. To synchronize the division of time slices, it is necessary to periodically insert “heartbeats”, which are the cause of the harsh noise we hear when we put a 2G phone in front of a radio (of course, few people listen to the radio now). CDMA uses Code Division Multiplexing (CDM) technology, which uses different coding methods to transmit information, just like one person speaking English and another speaking Chinese in a hall, we can choose whether to listen to English or Chinese.

Comparison of multiplexing technologies (Source: DIFFERENCE BETWEEN GSM AND CDMA – EXPLAINED!!)Comparison of multiplexing technologies (Source: DIFFERENCE BETWEEN GSM AND CDMA – EXPLAINED!!) Comparison of multiplexing technologies (Source: DIFFERENCE BETWEEN GSM AND CDMA – EXPLAINED!!)

Wi-Fi represents another application scenario of wireless communication technology: Wireless Local Area Network (WLAN). The so-called local area network has a small coverage area (a few meters), a small number of users (a few dozen), and it is assumed that terminals can hear each other, so the “base station” is liberated, and it is not necessary to allocate channels for each terminal, but the terminals negotiate with each other when to send data to avoid conflicts. Therefore, the cost of a wireless local area network base station (access point) is much lower than that of a cellular network base station, which is not only a matter of mass production and transmission power, but more importantly, the different technologies used lead to different burdens on the base station. Of course, the assumption of a wireless local area network also makes its scalability not strong, and when the number of users increases, the method of clients negotiating to resolve conflicts on their own becomes inefficient.

Specifically, the method of negotiating to resolve conflicts in a wireless local area network is called Carrier Sense Multiple Access/Collision Avoidance (CSMA/CA). Before each client speaks, they must first listen to see if anyone else is speaking. If not, good, whistle (RTS), indicating that I am going to start sending data. If the receiver can hear this whistle, they will respond (CTS), and the sender can start sending data after receiving this response. After the receiver receives the data, they must reply with a “roger that” (ACK). You see, it’s so troublesome to send data once, and any stage is disturbed by other clients, it will lead to transmission failure.

WLAN Carrier Sense Multiple Access/Collision Avoidance Timing Diagram (Source: cs.stanford.edu)WLAN Carrier Sense Multiple Access/Collision Avoidance Timing Diagram (Source: cs.stanford.edu) WLAN Carrier Sense Multiple Access/Collision Avoidance Timing Diagram (Source: cs.stanford.edu)

After Wi-Fi receives the ACK, if there is no new data to be sent, it can go to sleep. After a while, it will wake up and ask the access point if there is any new data coming. If not, it will continue to sleep. Therefore, Wi-Fi only consumes power when there is data to be transmitted. Of course, the initial process of Wi-Fi scanning and connecting to the access point is also quite power-consuming, but we usually do not constantly switch Wi-Fi access points.

Channel Allocation in Cellular Networks

As mentioned earlier, cellular networks allocate channels through base stations, unlike wireless local area networks where clients negotiate on their own. If every mobile phone applies for a channel and monopolizes it as soon as it is turned on, it would result in a huge waste of resources. This is because mobile phones are mostly in a silent state, neither making calls nor sending data, and channels are scarce resources. Monopolizing channels would severely affect the number of users that the base station can support.

Therefore, all standards of cellular networks invariably use the method of “allocating channels when needed”. That is, there is a shared channel for applying for channels. When the client needs to send data:

  1. The client sends a channel borrowing request on the shared channel;
  2. If the base station can receive the request, it allocates a temporary exclusive channel to the client;
  3. The client uses the allocated channel to send data;
  4. After the data is sent, wait for a while (for the other party’s response or new data to be sent);
  5. If there is no data to be sent within a certain period of time, the channel is released.
    In the WCDMA standard adopted by Unicom, this process is called RRC (Radio Resource Control). WCDMA is taken as an example because it is the 3G standard with the highest market share internationally. Although other 3G standards have different channel multiplexing methods, the process of allocating channels is similar.

WCDMA (3G) power state diagram (source: High Performance Browser Networking)WCDMA (3G) power state diagram (source: High Performance Browser Networking) WCDMA (3G) power state diagram (source: High Performance Browser Networking)

From the perspective of power management, the client is usually in a very low power consumption dormant state (IDLE), enters a high power consumption transmission state (Cell DCH) when there is data to be transmitted, enters a lower power consumption standby state (Cell FACH) if there is no data to be sent within 5 seconds after the data transmission is completed, and returns to the dormant state (IDLE) if there is no data to be transmitted after another 12 seconds.

WCDMA power state timing (source: High Performance Browser Networking)WCDMA power state timing (source: High Performance Browser Networking) WCDMA power state timing (source: High Performance Browser Networking)

Why wait for several seconds and have an extra standby state? First, answer the question of waiting for a few seconds. This is because the allocation and release of channels is a troublesome and time-consuming task. From the dormant state (IDLE) to the connected state (Cell DCH) where data can be sent, it takes nearly 2 seconds (as shown in the figure below, it is 1.717 seconds). We won’t feel anything when making calls, sending text messages, etc., but for browsing web pages and instant messaging, this delay is somewhat unacceptable. More importantly, this connection process requires a lot of shared channels and base station resources, and also consumes a lot of client power, so it should be done as little as possible. Waiting for a few seconds after the data transmission is over is considering that there may be subsequent data to be sent after sending the data, or to receive the other party’s response.

HSPA control plane delay for connection establishment (source: Qualcomm)HSPA control plane delay for connection establishment (source: Qualcomm) HSPA control plane delay for connection establishment (source: Qualcomm)

Next, answer the question of the extra standby state. With the evolution of cellular network standards, the bandwidth is getting faster and faster, and high-speed data transmission is at the expense of increasing transmission power. For example, the transmission power of HSPA in the connected state is 1000~3500 mW, while the transmission power of GSM is only 800 mW. However, the development of the battery industry does not follow Moore’s Law, and the capacity of a unit volume battery is limited. Reducing client power consumption is becoming more and more important in cellular network communication. Therefore, HSPA has added a lower power consumption “standby state” (Cell FACH) based on CDMA. This standby state only consumes a few hundred mW of power, can transmit a small amount of data at a lower rate (20 kbps), or return to the full-speed data sending state (Cell DCH) within a time scale of 100 milliseconds. This makes a balance between client power consumption and response time for connection establishment.

3G, GSM transmission power (source: TailEnder)3G, GSM transmission power (source: TailEnder) 3G, GSM transmission power (source: TailEnder)

For 4G LTE, the transmission power is even higher, so more detailed power management is needed. Therefore, 4G LTE introduces two intermediate states between full-speed data sending and idle state: Short DRX (Short Discontinuous Reception) and Long DRX (Long Discontinuous Reception).

4G LTE power state diagram (source: High Performance Browser Networking)4G LTE power state diagram (source: High Performance Browser Networking) 4G LTE power state diagram (source: High Performance Browser Networking)

Battery Killer: Tail Energy

The standby state between full-speed data transmission and idle state is the battery killer of cellular networks. In 3G networks, these standby states, which do not transmit any effective data, consume 50% of the energy of the RF module, that is, about half of the energy is wasted. In 4G networks, this semi-sleeping and semi-awake intermediate state occupies a larger proportion in energy consumption. However, if the intermediate state is removed, the RF module will frequently wake up and sleep, which will not only increase the delay of data transmission, but may also consume more energy (because the complex process of establishing a connection and allocating channels is also power-consuming). That is to say, the duration of the intermediate state is actually the result of the protocol designer’s trade-off.

Energy consumption at various stages of 3G and 4G (Source: Comparing LTE and 3G Energy Consumption, AT&T)Energy consumption at various stages of 3G and 4G (Source: Comparing LTE and 3G Energy Consumption, AT&T) Energy consumption at various stages of 3G and 4G. Note in the 3G table, the DCH phase is not all used to send effective data, there is also tail waiting time (Source: Comparing LTE and 3G Energy Consumption, AT&T)

Wireless LAN laughed. Wireless LAN (WLAN) does not need a standby state, because it does not need to allocate exclusive channels, so it does not need to consider the delay and power consumption of “establishing a connection”. To transmit data, the client only needs to follow the Carrier Sense Multiple Access/Collision Avoidance (CSMA/CA) protocol, and can send data when no one else is sending data nearby. This self-organizing form of collision avoidance method does not have the overhead of tail energy, and greatly reduces the delay of connection establishment (this is another problem, WLAN is a few to tens of milliseconds, 3G needs hundreds to thousands of milliseconds), but it is not possible to enjoy the efficiency of exclusive channels: the network scale cannot be very large, a few dozen clients is the upper limit.

You can’t have your cake and eat it too, as can be seen in the design of cellular networks and wireless LANs.

Another influencing factor: Transmit Power

In addition to the aforementioned tail energy, there is another obvious factor: transmit power. WLAN access points are close, cellular network base stations are far away, in addition to the difference in frequency bands, the transmit power is also different. If you want to transmit far, you have to shout loudly. The RX in the table below represents receiving, TX represents transmitting, and each cell from top to bottom is 1, 2, 3 antennas, and you can see that the transmit power of a single antenna is around 1 W.

Power of 802.11n in different working modes (Source: Demystifying 802.11n Power Consumption)Power of 802.11n in different working modes (Source: Demystifying 802.11n Power Consumption) Power of 802.11n in different working modes (Source: Demystifying 802.11n Power Consumption)

What about the power of cellular networks? As mentioned earlier, the transmit power in HSPA (3.5G) is 1~3.5 W (depending on the signal strength), that is, at full speed transmission, the cellular network consumes more energy per unit time than the RF chip of the wireless LAN. But as you can see from the figure below, unless a large amount of data is being transmitted, for the case of sending small blocks of data at certain intervals, the power of the 3G RF chip is mostly around 1 W, and only a short time produces a high power transmission peak.

Changes in 3G RF chip power over time (Source: Power consumption analysis of constant bit rate data transmission over 3G mobile wireless networks)Changes in 3G RF chip power over time (Source: Power consumption analysis of constant bit rate data transmission over 3G mobile wireless networks) Changes in 3G RF chip power over time (Source: Power consumption analysis of constant bit rate data transmission over 3G mobile wireless networks)

In the case of good signal, the power consumption of 3G and WLAN sending small blocks of data is comparable; but don’t forget that 3G has tail energy and WLAN does not, so it is not surprising that 3G consumes power much faster than WLAN. So, even if you don’t care about the pitiful data fees, for the sake of your battery life, turn on Wi-Fi when you need it! Of course, when you don’t need it, especially in public places, it’s best to turn off Wi-Fi, otherwise searching for Wi-Fi hotspots is also very power-consuming, and if you accidentally connect to an unencrypted or untrusted Wi-Fi hotspot, be careful of the photo leak.

Suggestions for Application Developers

Having read this far, if you are an application developer, you should have realized that in cellular networks, each time a block of data is sent or received, the antenna will remain open for a few seconds, and these few seconds will consume more power than sending these data. We can play to our strengths and avoid our weaknesses:

  1. Play to our strengths: In these few seconds, we might as well let the phone do more work, such as prefetching images and other content that users might see immediately;
  2. Avoid weakness one: Some application developers follow the habit of desktop applications and send a heartbeat packet every minute to indicate “I am still alive”, which is a very luxurious behavior on mobile terminals. Use long connections, stop polling!
  3. Avoid weakness two: Try to use the system’s message push service, so that messages from different applications can be bundled and pushed, rather than each application pushing once independently, causing the RF module and other system components to wake up frequently.
  4. Avoid weakness three: If the application needs to regularly obtain user data updates, and it is not convenient to use server push, can we not use a fixed update frequency, but adjust the update frequency according to the user’s habits and network conditions?
  5. Avoid weakness four: If there are multiple scheduled tasks within the application, they should be grouped together as much as possible.
    Further power optimization, such as cross-application task bundling, and only sending background data when other applications are sending data, requires mobile operating system manufacturers to provide more APIs and work together with application developers.

References

I’m lazy, so I only listed the titles……

  1. High Performance Browser Networking
  2. [TailEnder] Energy Consumption in Mobile Phones: A Measurement Study and Implications for Network Applications
  3. Latency in HSPA Data Networks, Qualcomm
  4. Comparing LTE and 3G Energy Consumption, developer.att.com
  5. Power consumption analysis of constant bit rate data transmission over 3G mobile wireless networks
  6. Various network images

Comments