T-110.5111 Computer Networks II Energy efficiency 18.11.2012

Matti Siekkinen

23.9.2010

Outline

• Motivation • Measuring energy • Modeling energy consumption • Optimizing energy consumption Green ICT

Source: Google image

What is Green ICT?

• Green ICT – Reduce the energy consumption of ICT • What’s involved? – Networked Equipment • PCs, mobile phones, data centers, set-top boxes... – Network Equipment (infrastructure) • Routers, switches, wireless access points…

Why we give a damn

• ICT energy consumption – About 12% of global power consumption – 60billion KWh wasted by inefficient computing every year – Telecom data volume increases approximately by a factor of 10 every 5 years, which corresponds to an increase of the associated energy consumption of 16-20% every year • CO2 – At least 2% of global CO2 emission – As much as airplanes, and ¼ of cars • €€¥££ – Data center and network operators – Large part of operation costs

Another viewpoint: Quality of experience

• Energy constrained devices – Smartphones • Need to recharge more and more often – Sensors and sensor networks • Don’t want to or cannot change batteries often • Quality of experience and availability issue – Not directly about money – Not so much a ”greenness” issue either • Although scale is very large... • Mobile network infrastructure draws far more power than the phones • We focus today mostly on these issues Some questions worth asking

• How much energy does it cost when you – make a phone call, – watch YouTube, or – send an email? • How much of that energy could be saved? • How to achieve these energy savings?

7

Outline

• Motivation • Measuring energy • Modeling energy consumption • Optimizing energy consumption Power measurement

• System-level power measurement Measure the total power consumption of the whole .

• Component-level power measurement

9 Measuring with software

• Simplest way to measure • Energy Profiler – Easy to use – Sampling frequency is low (4Hz) – Get accurate information about, e.g. voltage(V), current(Am) • Measured error just a few % in active cases, more for low power cases (idle) – Only for Symbian L

10 Measuring with software (cont.)

• PowerTutor – A power monitor for Android-based mobile platforms – Uses models to estimate power consumption • Accuracy may vary depending on usage (check their paper for details) http://ziyang.eecs.umich.edu/projects/powertutor/

11 Glance at the power consumption

3.000 (5,2.249)

2.500 (211,2.516) ?

2.000 ?

(10,1.281) 1.500 (113,1.494)

Power(Watt) Power(Watt) ? 1.000

0.500 WLAN WCDMA

0.000 1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 110 115 100 105 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200 205 210 215 220 225 230 235 240 243 245 249 Time(second)

Watching YouTube from N95

12 Using external instruments

13 Power measurement

• System-level power measurement Measure the total power consumption of the whole mobile phone.

• Component-level power measurement Example: Given a mobile phone, measure the power consumption of each CPU, network interface, and display separately.

14 Component-level power measurement

• Requires information about power distribution network at the circuit level • Very few off-the-shelf devices can be measured on component-level – e.g. Neo Freerunner – See: Aaron Carroll and Gernot Heiser. An analysis of power consumption in a smartphone. In Proceedings of the USENIXATC 2010.

15

Outline

• Motivation • Measuring energy • Modeling energy consumption • Optimizing energy consumption Where does the energy go?

• Hardware consumes the energy • Amount of energy consumed depends on – Hardware physical characteristics – Hardware operating mode – Workload generated by software running on top of hardware

17 Power modeling

• Allows to estimate energy/power consumption even when direct measurement is impossible – Impractical: external instruments usable only in lab settings – Software not available • Why interesting? – Understand and improve energy consumption behavior of existing protocols and services • Also in setups which aren’t possible in a lab • Help redesign for better energy efficiency – Develop energy-aware protocols and applications • Run-time estimation of energy consumption • E.g., choose energy efficient paths, peers, servers

• 18 Power modeling (cont.)

• Power models describe – Transmission energy, computational energy, other energy expenditure – Power consumption of each hardware component or software component – Power consumption of a service • Methodology – Deterministic modeling – Statistical modeling

Power measurement is needed for both methods.

19 Example: Transmission energy

• Which one consumes less energy? – 3G, WLAN, or LTE? – Lumia 920 or iPhone 5? – P2P or C/S? – ...

• No simple answers...

20 Transmission energy metrics

Two metrics • How many Joules are needed for transmitting or receiving one Bit (energy utility)? – Not constant – Depends on how you send or receive the data – Depends on how you control the operating mode of the network interface – Contextual dependency • E.g. poor signal strength requires more transmit power • How many Bits do you need to transmit or receive? – In bad network conditions, you also need to consider the power consumed by data retransmission (TCP)

21 Transmission: WNI states and transitions • Managing wireless network interface happens through different states – Set of states are technology specific • WNI transitions from state to another according to some rules – Usually timer specified transitions • What states? – E.g. receive, idle, and sleep in WiFi – CELL_DCH, CELL_PCH etc. for 3g • Correspond to different kind of resource allocation (i.e. channel type) • States have different power characteristics – Part of circuitry can be powered off at run time (sleep) CHAPTER 2. LTE 13

For real-time streaming applications such as voice calls, the data sent during every transmission and the bandwidth utilized are very small. For Wi-Fi, 3G, LTE: different powerapplications transmitting states small amount of data for many times semi persis- tent scheduling is more adaptable in which the UE does not need to request for a Grant each time for transmissionTraffic of data. Instead,RRC the Inactivity UE is provided with a transmission pattern which it follows and transmits the data during that particular time slot. For example,burst during a voicetimer call running the UE sends an initial SR and gets the transmission pattern from the scheduler after which the data is sent on the allocated time. This reduces the complexities and overhead of the scheduler and the UE. There are many di↵erent types of scheduling algorithms which are de- signed based on the need of vendors. Commonly used algorithms include Round Robin [42], Proportional Fair [47], Maximum Channel Quality Index (CQI) [43], Channel aware scheduling algorithmRRC_IDLE [42].

2.3 LTE UE and RRC States

In LTE, a UE can shift between three states namely, RRC DISCONNECTED, RRC CONNECTED and RRC IDLE.

SLEEP

RECEIVE PSM TRANSMIT Timeout

IDLE

Figure 2.4: States of LTE UE

Initially, when the UE is in the OFF state, it does not hold any ac- tive connection with the eNodeB. The state at which the UE is turned on and is searching for a possible base station for registration or the phase when the UE is in Airplane mode could be termed as RRC DETACHED Transmission: Tail energy

• All wireless network interfaces exhibit tail energy – Energy spent being idle with radio on à wasted energy • Due to inactivity timers – Mandate how long radio remains in active state (rx on) before state transition to inactive state (rx (partly) off) • Timers help with interactive apps and limit signaling – Sporadic communication – Switching radio on and off causes some delay – State transitions require signaling between phone and and base station • Timer values vary between technology – Wifi≈100-200ms – 3G≈11s (varies between ISPs) – LTE≈10s (varies between ISPs) How to minimize tail energy

• Wi-Fi tail is already short • 3G has Fast Dormancy – Phone requests the network to transition to CELL_PCH – Network maintains control and allows or denies (e.g. too frequent requests) – Cuts tail duration down to 3-5s • LTE has DRX/DTX (discontinuous reception/ transmission) – 3G has also CPC (continuous packet connectivity) which is similar (not (yet) fully supported by deployed networks) 2

RRC IDLE. DRX being activated, the transmission and reception of data happens in the RRC CONNECTED mode. When the UE does not receive any data for a certain time, it enters the DRX cycle phase and activates the Short DRX cycle with Short DRX timer (Ts). In the Short DRX cycle state, the UE monitors the How to get rid of tail energyPDCCH (cont.) during the DRX OnTimer period.

• DRX works in LTE’s Fig.connected 1. States of LTE UE state – Hence, also called cDRX (connected Initially, when the UE is in the OFF state, it does not hold mode DRX)any active connection with the eNodeB. The state at which the UE is turned on and is searching for a possible base station • DRX operatesfor registration in cycles or the phase when the UE is in Airplane mode could be termed as RRC DISCONNECTED state. Once the – Check periodicallyUE finds base if station new coverage, data it registers is waiting to the Mobility Management Entity (MME) through the LTE Attach proce- – Very similardure. to AfterPSM the registration in 802.11 is successful, the UE moves to the RRC CONNECTEDRRCstate. In inactivity the RRC CONNECTED timerstate (T the ) arriving data UE has a Radio Resource Control (RRC) connection with theidle eNodeB and maintains an active connection through various Fig. 2. RRC State transition of LTE UE CONNECTED STATE IDLE STATE Rx on signaling messages. Once the UE sleeps for a longer duration without any data transmission, it moves to the RRC IDLE state after the expiry of inactivity timer (Inactivity). When The Short DRX timer is active for a time period called as the Short DRX timer period (TS)after which the UE activates Rx off the UE is out of coverage area, or during the process of area update it de-registers with the eNodeB and moves to the Long DRX timer (Tl). In Long DRX cycle, the wakeup DRXRRC inactivityDISCONNECTED state. duration of the UEtransition for monitoring the PDCCH is less frequent DRX cycle DRX on-durationthan the Short DRX cycle. Once the UE enters the Long DRX timer DRX(DRX is theidle power) saving mechanism in LTE,timer that was (DRX ) to Idle introduced in order to reduce(DRX the powerc) consumption by cycle, iton shifts from the RRC CONNECTED to RRC IDLE making the UE to move to sleep and idle states when there mode if the Inactivity timer expires. When the UE gets an is no data transmission to and from the UE based on specific intimation about data to be received through the PDCCH, or timers. when it needs to transmit data, it moves from RRC IDLE RRC CONNECTED In order to obtain information about scheduling, the User mode to mode. Once all the data is Equipment (UE) monitors the physical down-link control transmitted, the UE again activates the DRX cycle in the RRC CONNECTED RRC IDLE channel (PDCCH) information every TTI. Performing this mode and then moves to the every TTI consumes lot of energy as the UE wakes up very mode after inactivity timer expiry. frequently even though there is no scheduled data for it to receive. Hence in order to have a solution for overcoming this issue, Discontinuous Reception (DRX) was introduced. DRX is a proprietary power saving mechanism for LTE, through which the User Equipment (UE) is made to sleep for a longer duration by shutting its wireless RF modem off for a maximum possible time without compromising the Quality of Service Fig. 3. LTE DRX (QoS), latency and user experience. The explanation for DRX in LTE 3GPP was first released with T.36.300, Release 8. DRX is configured on the UE by Radio Resource Control A. OnDuration Timer (RRC) [?], i.e. the eNodeB, which provides the information on various parameters and its timer values based on which the On Duration, is the time period an UE is awake for listening UE wakes and listens to the PDCCH control information. The to the PDCCH frame that specifies whether it has any down- most important part is that, a LTE device can move to DRX link data transfer to happen. It happens during the start of a state in both RRC CONNECTED mode and in RRC IDLE DRX Long cycle, DRX Short cycle and spans the duration mode. specified for the timer. After the end of OnDuration, the UE When DRX is deactivated in the network, the UE listens to goes to the sleep mode if there is no DL data assignment or every sub frame in the RRC CONNECTED mode. On expiry triggers the inactivity timer if it has a DL data assignment in of inactivity timer, the UE moves to RRC IDLE mode. With the near future. Case study 1: Deterministic modeling

Power modeling of data transmission over 802.11g

• Xiao, Y., Savolainen, P., Karppanen, A., Siekkinen, M., and Ylä-Jääski, A. Practical power modeling of data transmission over 802.11g for wireless applications. In Proceedings of the e-Energy 2010.

27 Power consumption of 802.11 wireless network interface (WNI) • Power consumption depends on operating mode Energy = Power(operating mode)* Duration(operating mode)

Power Saving Mode(PSM) Continuously Active Mode (CAM)

SLEEP PS IDLE

RECEIVE PSM TRANSMIT PR Timeout PT

RECEIVE TRANSMIT IDLE PI

Tsleep = TI - Ttimeout

28 WNI operating modes and power

• Order of magnitude less power drawn in sleep state

WNI operating mode Average Power (W) Nokia N810 HTC G1 Nokia N95

IDLE 0.884 0.650 1.038 SLEEP 0.042 0.068 0.088 TRANSMIT 1.258 1.097 1.687 RECEIVE 1.181 0.900 1.585 Operating modes and traffic patterns

• Problem: No common open API for querying the current operating mode • Idea: Estimate the operating modes & durations from observed traffic patterns – Take into account 802.11 Power Saving Mode(PSM)

Figure: I/O graph of YouTube traffic (Byte/tick)

Per-burst computation

• TCP style bursty traffic naturally fits to this model • Reduce computational work Burst

– If CBR -> use 1 pkt bursts Interval TI • Definitions – Burst: Pkt interval < t • t is a predefined threshold

– Burst size SB

– Bin rate r = SB/T = SB/(TB+TI) Burst Duration T B Packet Interval

• 31 Taking PSM into account

• Scenario 1: no time to sleep • Scenario 2: catch some sleep in between bursts between bursts

E = PRTB+ PITI E = PRTB+ PITtimeout + PSTsleep

Pd(r) = E/T = PI + r(PR – PI) TB/SB Pd(r) = E/T =PS + r[(PR – PS) TB/SB+ (PI – PS) Ttimeout/SB] Power Power

PR PR

P I P I

TB TB+ TI Time TB TB+ TI TB+ TI+ Tsleep Time Trying out model: power vs. throughput

Download, CAM 1.2 1.0 0.8 0.6 0.4 Measured

Avg Power(W) Power(W) Avg 0.2 Estimated 0.0 Q: What’s this? 0 32 64 96 128 160 192 224 256 Measurements Data rate limit(KB/s) A: Effect of PSM: using Nokia N810 Download, PSM manage to catch 1.2 sleep in between 1.0 packets/bursts when 0.8 rate is low enough 0.6 0.4 Measured When rate ≥

Avg Power(W) Power(W) Avg 0.2 Estimated 64KB/s, PSM 0.0 0 32 64 96 128 160 192 224 256 has no effect! Data rate limit(KB/s)

33 11

50 Measured(N810) 240 Measured(N810) 700 Measured(G1) Estimated(N810) Estimated(N810) Estimated(G1) 45 220 Measured(N95) 600 Measured() 40 Measured(N95) 200 Estimated(N95) Estimated(Nexus S) Estimated(N95) 180 500 35 160 400 30 140 25 120 300 100 Energy Utility(KB/J) 20 Energy Utility(KB/J) Energy Utility(KB/J) 200 80 15 100 60 10 40 0 16 16(PSM) 32 32(PSM) 16 16(PSM) 32 32(PSM) 64 96 128 160 192 224 256 16 32 64 96 128 160 192 224 256 Data rate(KB/s) Data rate(KB/s) Data rate(KB/s) (a) On N810 and N95(16-32KBps). (b) On N810 and N95(64-256KBps). (c) On HTC G1 and Nexus S

Fig. 5. Energy utility of TCP download with single flow at rate between 16KBps and 256KBps.

50 Measured(N810) 260 Measured(N810) 700 Measured(G1) 45 Estimated(N810) 240 Estimated(N810) Estimated(G1) Measured(N95) Measured(Nexus S) 220 600 40 Measured(N95) Estimated(N95) Estimated(Nexus S) Estimated(N95) 200 500 35 180 400 30 160 140 300 25 120

Energy Utility(KB/J) 20 Energy Utility(KB/J) 100 Energy Utility(KB/J) 200 80 15 100 60 10 40 0 16 16(PSM) 32 32(PSM) 16 16(PSM) 32 32(PSM) 64 96 128 160 192 224 256 16 32 64 96 128 160 192 224 256 Data rate(KB/s) Data rate(KB/s) Data rate(KB/s) (a) On N95 and N810(16-32KBps). (b) On N95 and N810(64-256KBps). (c) On HTC G1 and Nexus S. 11/18/13 Fig. 6. Energy utility of TCP upload with single flow at data rate from 16KBps to 256KBps. N810: Energy utility 2500 2500 Download (PSM) 2500 2000 2000 Measurements 2000 using 1500Samsung 1500 Nexus S 1500

1000 1000 1000 Energy Utility(KB/J) Energy Utility(KB/J) Energy Utility(KB/J) Measured Measured Measured 500 Estimated 500 Estimated 500 Estimated 512 1024 1536 2048 2854(no-trickle) 512 1024 1536 2048 2854(no-trickle) 512 1024 1536 2048 2854(no-trickle) Data rate(KBps) Data rate(KBps) Data rate(KBps) (a) TCP download. (b) TCP upload. (c) TCP download and upload. • How many bytes can be transferred per Joule spent • RoughlyFig. 7. linearly Energy dependent utility of on TCP throughput download/upload on Nexus S. The X-axis represents the aggregated data rate of all the à TCPshould flows. always The transmit biggest as fast value as onpossible! the X-axis is the maximum throughput achieved without any rate limit. Each data point shows the mean and the standard deviation of the measured or the estimated Power.

TABLE 9 of the number of TCP flows. MAPE of power models for Nexus S

No. No. MAPE No. No. MAPE 5.4 TCP Download/Upload in Congested Network downlink uplink (%) downlink uplink (%) 1 0 3.4 2.0! 0 1 2.6 1.5! We connected the Nexus S to a public AP in our cam- 4.2± 1.7 4.1± 4.4 ± ± pus and measured the power consumption during TCP 2 0 3.3 1.7! 0 2 2.9 2.0! 2.4± 1.1 0 2 5.1± 4.0 download and upload. The phone tried to send/receive ± ± 4 0 2.9 2.0 0 4 5.1 1.5 data as fast as possible without any data rate limit or ± ± 8 0 2.2 1.4 0 8 5.9 1.8 ± ± traffic shaping. Due to the interference caused by the 1 1 2.1 1.8! 1 1 2.7 1.9 ± ± 2 2 5.0 2.8 4 4 4.8 2.1 neighbouring APs, MAC layer retransmissions could ! The display was turned off.± The data rate was between 16± and not be left ignored. Based on the collected MAC layer 256KBps. traffic traces, we calculated the retransmission ratio Rr and the expected value of retransmitted packet interval E(Tir). The samples of retransmitted packet intervals As shown in Fig. 7, the standard deviation is very small used for calculating E(Tir) seem to follow the Inverse compared to the value of the mean. As the processing Gaussian distribution. The overhead of retransmitting overhead for maintaining more TCP flows is included packets was computed following (22). Because the CPU in the measured Power, the small standard deviation of frequency was always 400MHz during the measurement, the measured Power shows that the processing overhead no extra cost was caused by DVFS. The final results can be safely ignored. Fig. 7 also shows that the power are shown in Table 10. In upload cases, taking into models presented in Section 3 can provide generally ac- account the retransmission overhead can improve the curate energy estimation of TCP transmission, regardless power estimation accuracy by almost 50%. Case study 2: statistical modeling

• A system-level power model – Include main components • Processors, wireless network interfaces, display – Build using system-level measurements • Difficult to measure components separately – Generic model • Not tied to specific application • Statistical modeling using linear regression – Impossible to track exactly what happens e.g. within CPU – Cannot apply deterministic method

35 Modeling power with Linear Regression

• Linear regression widely used for processor power modeling – Build a linear relationship between the p predictor variables and power consumption based on n observations variable preprocessing function coefficients p f (yi ) = β0 + ∑ j=1 β j g j (xi, j )

intercept predictor variables • Need to: – select regression variables – train and evaluate the model Regression variables

• Target: reflect resource consumption of a mobile application – Diverse, capture all components • Computation: Hardware performance counters (HPC) – Set of special registers in modern CPUs – 17 counters about hardware-related activities (CPU activity, memory access) • Network I/O – Download data rate – Upload data rate – CAM switch • Effect of 802.11 power saving mechanism • Display – Brightness level

Regression variables (cont.)

• Problem: Mobile devices can only monitor a subset of HPCs at a time – E.g., 3 out of 17 HPCs in Nokia N810 • Solution: reduce the set of HPCs – Make an assumption: increasing activity (HPC value) never implies reduction in power draw – Thus, coefficient indicates that variable’s contribution to power – Select only three variables with highest coefficients Model training and evaluation: input data

• Need data for both training and evaluation – Must not use same data set for both! • Desired data characteristics: – Stresses all selected variables – Explores the space of their cross product – Use different kinds of smartphone applications (video player, file dl, idle,…) • What to collect from test cases? – Variable values (the x’s in the equation) – Power consumption (the y in the equation) • Limited monitoring capabilities – Only 3 HPCs monitored at a time à Need to run many iterations to cover all 17 HPCs Model training

• Figure out model coefficients with non-negative least squares:

– Standard minimization problem n 2 S(β0 ,...,β p ) = ∑i=1 (yi − f (yi )) – Use existing tools (e.g. Matlab) CPU_CYCLES

Power(W ) = 0.7655 + 0.2474 × g0 (x0 ) + 0.0815 × g1(x1) DCACHE_WB 0.0606 g (x ) 0.0011 g (x ) + × 2 2 + × 17 17 dl rate TLB_MISS + 0.0015 × g18(x18) + 0.3822 ×g19 (x19 )

+ 0.125 × g20(x20). CAM switch ul rate

brightness € level Model evaluation

Median Error(%) failed to fully 13.7 14 capture video 12 camera impact 10 8 6 4.8 3.7 3.8 4 2.0 2 0.2 0.8 0 Radio LiveTV YouTube Audio Video upload download recorder recorder • Finally, need to evaluate accuracy of the model • Evaluation based on similar data used for model fitting – But not the same!

41

Outline

• Motivation • Measuring energy • Modeling energy consumption • Optimizing energy consumption How to save energy?

• Switch off unnecessary hardware

• Reduce the Joule per Bit, per Cycle, per instruction

• Reduce the workload – Amount of bytes to transmit – Number of instructions to execute

43 Switch off unnecessary hardware

Not working = Zero Watt

• What can be turned off?

• When can it be turned off?

• How to leverage the difference in power consumption among the operating modes?

44 11/13/13 Example 1: Sleeping

• Save network equipment (i.e. routers) energy – PSM equivalent for WLAN clients • Observation 1: Networks are provisioned for peak load – Average utilization remains relatively low • Observation 2: Routers and switches are usually far from energy proportional – Roughly the same power draw with any load • Idea: turn (parts of) lightly loaded routers off occasionally – Power draw is somewhat proportional to nb of active ports – Switch off some routers and route traffic around 11/13/13 Sleeping routers

• Time driven sleeping – If router sleeps when packets arrive -> packet loss • Need to carefully consider when a link can sleep • Wake on arrival – Link sleeps when idle, awakes upon arriving packet, goes back to sleep – Require specific technology • Not currently implemented in OTS routers • Some implications on network mgmt – How to know if a router is sleeping or if it has crashed? • These mechanisms are currently on research level – Not commercially deployed (AFAIK) Example 2: Wake-on-LAN

• Reduce the energy consumption of networked equipment – E.g. workstations within an enterprise network • Go to sleep while idle • Q: When to wake up? • A: Proxy sends a “magic” packet that triggers wake- up – Some part of NIC must remain powered up – Requires explicit support from the NIC • Optimize further: Proxy handles some traffic on behalf of sleeping host – No need to wake up host for each request – Proxy replies on behalf of the sleeping host • Wake-on-Wireless-LAN also exists

• 47 Reducing per-unit power consumption

• Low-power hardware – Necessary especially in longer term – We take advantage of these but we’ll ignore here on how they are designed and built • Power management of hardware devices – E.g. DVFS (CPU), PSM (Wi-Fi) – Important that protocols leverage these properly!

48 Example 3: Dynamic voltage and frequency scaling (DVFS) • Dynamic power(switching power) of microprocessor C·V2·f, – C=capacitance being switched per clock cycle, V=voltage, and f=switching frequency • DVFS – Adjust the CPU frequency level on-the-fly based on workload – Reduce dynamic power – Reduce the cooling cost (generate less heat) • Both voltage and frequency usually adjusted simultaneously – Combination is called P-state • Governors in smartphones control switching policies – May have some impact on performance – E.g. aggressive vs. timid

• 49 Dynamic Modulation Scaling (DMS)

• Reduce communication energy per bit • Trade-off between energy and data rate – Traditionally BER vs. data rate • Change modulation dynamically – Slows down transmission in a certain rate if MAX rate is not required • Scale power consumption accordingly – Transmit power – Frequency of electronic circuitry for filtering, modulation, etc. Energy delay tradeoff of QAM (b is nb if bits per symbol)

50 11/13/13 Dynamic resource scaling

• In general, two opposing approaches exist – “Race to sleep” • Idea is to use all available resources when have work to do • Sleep rest of the time, i.e. get to sleep as fast as possible – Scaling proportionally • Scale resource consumption all the time • Example: multimedia streaming – Race to sleep: transmit data in bursts, sleep in between – Scaling: transmit CBR traffic and adjust modulation to match the stream rate 11/13/13 Example 4: Traffic shaping

• Mobile media streaming drains battery quickly – Constant bit rate multimedia traffic is not energy friendly – Forces the network interface to be active all the time Datarate Start-up WLAN power (W) 3G power (W) (kBps) Time (s) Mobile Radio PSM CAM 48kBps 2Mbps power draw on E-71 (TCP-based streaming) 8 18 0.53 1.06 1.30 1.30 16 10 0.99 1.07 1.30 1.30 24 10 1.04 1.07 1.27 1.35 • Idea: Shape traffic into bursts so that it is more energy efficient to receive – Remember the linear relationship with throughput – “Race to sleep” Traffic Shaping with Proxy

• Client sends request to proxy • Proxy – forwards request to radio server – receives and buffers media stream – repeatedly sends in a single burst to client • 802.11 – PSM is enabled – WNI wakes up to receive a burst at a time – Waste only one timeout per burst • 3G & LTE – Long enough burst interval à inactivity timers expire à switch to lower power state or activate DRX in between bursts

53 What is the right burst size?

• Use as large as burst size as possible – Maximize sleep time in between bursts • Burst size that offer maximal energy savings exists – Option 1: Due to limited buffer size at mobile device • Max burst size = playback buffer size +TCP receive buffer size • Larger burst will be received at stream rate à lower energy utility – Option 2: Max burst interval & size limited by amount of initially buffered content • Cannot let the playback buffer run dry How much energy can be saved? cell info: energy savings(%)–stream rate (kbps)–optimal burst interval Samsung Nexus S (, Nokia E-71 HTC Velocity App / Network type (Android, 3G) 3G) (Symbian, 3G) (Android, LTE)

Internet Radio/Wi-Fi 23%–128–14 s 62%–128–14 s 65%–128–6 s –

Internet Radio/3G/LTE 36%–128–14 s 24%–128–14 s 2%–128–4 s 60%–128–18 s

YouTube Bro/Wi-Fi 14%–912–36 s 20%–328 –39 s 18%–280–4 s –

YouTube Bro/3G/LTE 20%–328–38 s 14%–328–39 s 4%–280–3 s 50%-2000-31 s

YouTube App/ Wi-Fi 13%–458–39 s – – –

YouTube App/3G/LTE 27%–458–39 s – – 54%–2000–39 s

Dailymotion/Wi-Fi 15%–452–33 s – – –

Dailymotion/3G/LTE 30%–452–33 s – – 55%–452–33 s • Wi-Fi: 65% for audio streaming, 20% for video streaming • 3G: 36% for audio streaming, 30% for video streaming • LTE: 60% for audio streaming, 55% for video streaming How much energy can be saved? (cont.)

• Savings depend largely on network type – 3G has long inactivity timers and no discontinuous reception (yet) • Network parameters have also a large impact – They determine the tail energy that can be saved • Stream rate matters as well – Bursting lower rate stream yields larger savings • Smaller savings with video streaming compared to audio – Display draws significant amount of power – Video decoding is more work than audio decoding How to save energy?

• Can we just turn off unnecessary hardware?

• Can we reduce the Joule per Bit, per Cycle, per instruction?

• Can we reduce the workload (e.g traffic size)?

57 How can we reduce the workload?

• Getting by with less traffic – Clever transport protocols – Smart application design • Doing less computation – Offload the work • Trading transmission to computation

58 Example 5: Data compression

• Communication energy consumption ~ Traffic size • Compression can reduce amount of traffic generated – But computation costs also energy • Tradeoff always exists

Communications cost (reduced traffic size)

Computational cost (compression, decompression) Compression vs. communication

• Compress ratio differs between data type – Same work but varying savings in bytes • Must make decision beforehand whether compression would be beneficial – Should we spend energy trying to compress or not? – Must compare communication energy savings (compress ratio) and energy to compress/decompress – Can use model based estimates • Compression Effectiveness: ce Evaluation (mobile E-mail)

File Extension/ With compression Without Compression ce Type Energy Duration Energy Duration (J) (s) (J) (s) .doc 9.61 7.0 18.31 11.8 6.90 .bmp 5.86 5.4 15.74 9.7 2.67 .pdf 25.55 22.8 28.45 23.0 1.03 .txt 13.80 12.2 18.97 13.0 2.68 Binary data 12.8 11 17.57 11.8 2.68

10 – 60% energy savings

61 Example 6: Computation offloading • Consider apps designed and implemented to be run on standalone mobile OS • Execute part of the application code in a remote machine

Offloading Offloading framework app framework return result app app callMethod() app app app app app app Mobile OS Mobile OS Virtualization Smartphone Remote server (Cloud) Offloading work to save energy • Main objective is to save energy – Tradeoff: less computing with some extra communication – Transfer state back and forth between smartphone and cloud

Energy for communication

Energy for computation

• Often involves dynamic decision making because the tradeoff is not constant • May also improve other performance metrics (response time) – High performance computing in cloud Offloading frameworks • Most rely on having source code available – MAUI at Mobisys’10 (Duke, UMass, UCLA, MSR) – Cuckoo at MobiCASE’10 (Vrije Universiteit) – ThinkAir at Infocom’12 (DT Labs, Cambridge, Nottingham, Huawei) • One modifies the underlying system (VM) – CloneCloud at EuroSys’11 (Intel Labs) • Impressive results with computationally intensive apps – 45% energy savings for chess AI [MAUI] – 20x speedup and energy savings for a large image search [CloneCloud] • Several challenges remain – Many constraints that prevent offloading with existing apps • Access to specific hw • Software structures preventing remote execution – Computation intensive apps are in the minority What else could be done?

• Data centers – Liquid cooling for servers, use the hot water to heat other premises – Run servers in (freezing) cold areas – Renewable energy – Execute things where energy is cheap • Mobile devices – Smarter (cooperative) scheduling to reduce contention – Leverage alternative low-power radios (e.g. Zi-Fi or Blue-Fi) – Energy harvesting • Kinetic, solar, ambient radiation, … – Detect and quarantine energy bugs • Check out Carat (http://carat.cs.berkeley.edu)

65

Summary

• Energy efficiency is a hot topic for several reasons – Saving energy means saving money and saving the planet J – Battery operated devices benefit from energy efficient protocols • Measuring and modeling energy consumption necessary – Understand how energy is consumed – Improve energy efficiency of protocols and apps – Develop energy aware protocols and apps • Several ways to save energy – Switch off hardware dynamically – Reduce joules per bit, per cycle, per instruction • Low-power hardware & smart power management – Reduce workload • Trade some computation to communication New course next Spring

• Special course on energy consumption of smartphones – Detailed look at modern smartphone energy consumption, techniques for energy management and optimization – Intensive course on fifth period (14.4. – 30.5.) • Based on a book published next Spring (hopefully): – S. Tarkoma, M. Siekkinen, E. Lagerspetz, Y. Xiao: Smartphone Energy Consumption: Modeling and Optimization – Publisher: Cambridge University Press Additional reading

• Mohammad Ashraful Hoque, Matti Siekkinen, and Jukka K. Nurminen. 2013. Using crowd-sourced viewing statistics to save energy in wireless video streaming. In ACM MobiCom 2013. • Barr, K. C. and Asanović, K.,"Energy-aware lossless data compression," ACM Trans. Comput. Syst. vol. 24, no. 3, pp. 250-291. August 2006. • Byung-Gon Chun, Sunghwan Ihm, Petros Maniatis, Mayur Naik, and Ashwin Patti. CloneCloud: elastic execution between mobile device and cloud. In ACM EuroSys 2011. • Yu Xiao, Yong Cui, Petri Savolainen, Matti Siekkinen, An Wang, Liu Yang, Antti Ylä- Jääski, Sasu Tarkoma. Modeling Energy Consumption of Data Transmission over Wi-Fi. In IEEE Transactions on Mobile Computing (accepted). 2013 • Mikko Pervilä and Jussi Kangasharju. Running servers around zero degrees. In Green Networking 2010. • Asfandyar Qureshi, Rick Weber, Hari Balakrishnan, John Guttag, and Bruce Maggs. 2009. Cutting the electric bill for internet-scale systems. In ACM SIGCOMM 2009.

68