1 of 22

Project Stuff and Power Management

2 of 22

Project 2 Debrief

  • Why so resistant to the WakefulIntent pattern?
  • Did you learn anything?
  • Android vs iOS
    • periodic wake versus notification
    • availability of information
  • Make sure to read the mailing list

3 of 22

Project 3

  • Asks you to utilize some different skills
  • Three parts
    • Part 1 must be complete by 3/3!
  • Part 1 - write some code
  • Part 2 - run some experiments
  • Part 3 - analyze your data

4 of 22

Project 3 - Part 1

  • Look at characteristics of the networks to which you connect
  • You know IP address (and maybe location)
    • How do networks perform?

5 of 22

Project 3 - Part 1

  • Latency - delay between your host and the destination
  • Loss - packets for which there is no reply from the destination
  • Jitter - packet delay variation
    • simplest: max-min delay
  • Bandwidth - part 2

6 of 22

Project 3 - Part 1

  • Measuring Latency
    • avoid as much network overhead as possible
  • Measuring Loss
    • TCP socket hides details
    • UDP?
  • Measuring Jitter
    • again, avoid as much network overhead as possible

7 of 22

Project 3 - Part 1

  • ping - packet internet groper
  • Sends Internet Control Message Protocol (ICMP) ECHO_REQUEST
  • Destination responds with an ICMP ECHO_REPLY
  • Recall, ICMP runs at the network layer!

8 of 22

Project 3 - Part 1

  • ICMP packet format
  • ICMP also used for traceroute, time
  • Notice, no transport header!

9 of 22

Project 3 - Part 1

  • Send 4 pings to a well-known host
    • recommended 8.8.8.8
  • Calculate latency, loss, and jitter
  • Android
    • standard Java sockets will not allow you to "bypass" the transport layer
      • sockets are either TCP or UDP
      • no raw sockets available unless you use JNI
    • instead, execute /system/bin/ping
    • also see blog by developer of Net Ping

10 of 22

Project 3 - Part 1

  • iOS
    • use native (raw) socket
    • SimplePing takes care of this for you

  • Complete part 1 by 3/3!

11 of 22

Project 3 - Part 2

  • Throughput would also be useful
    • how much data (kbps) is actually being received?
  • Hard to measure
    • shouldn't include network headers
    • lots of variation
      • getting a good measurement without having to download lots of data
  • You will explore a similar metric: page load time
    • how long does it take for your app to load a web page (of known size)

12 of 22

Project 3 - Part 2

  • You are NOT required to measure page load time at every sample point
    • you will conduct a controlled experiment and report the results
  • You will run the experiment under at least two different network "conditions"

13 of 22

Project 3 - Part 2

  • Experimental design
    • Goal: determine your page download time under varied network conditions
  • Relevant setup
    • specs of phone
    • service provider
  • Metric: time to load the page
  • Parameters
    • size of the page
    • network condition
      • latency, loss, maybe jitter
      • wifi vs data
      • location of server

14 of 22

Project 3 - Part 3

  • Part 2 Writeup
    • experimental setup
    • graph
    • analysis of results
      • were the results expected?
      • does network condition affect throughput as expected?
      • is the throughput higher or lower than predicted?

15 of 22

Project 3 - Part 3

  • Part 1 Analysis
  • Choose a question to address
    • correlation between loss rate and network (determined by IP or SSID of network to which you are connected)
    • correlation between location and number of access points seen
    • impact of project 3 metrics on battery (compared to previous battery data)
  • A question using Project 1/Project 2 data may be fine, too

16 of 22

Power Management

  • Enter a low-power state (sleep, hibernate, standby) whenever possible
  • Lots of contributors to energy consumption
    • Display
    • WiFi
    • CPU
  • Not always just on/off
    • WiFi: off, standby, listen, receive, transmit
  • Power consumption of an 'all knobs on' phone = 4-6W, laptop = 50W

17 of 22

Power Management

  • Turning components off means less availability
    • screen off means phone not available for most tasks
    • wifi off means no access to network services
  • From:
    • http://synrg.ee.duke.edu/papers/manweiler11sleepwell.pdf
    • http://users.eecs.northwestern.edu/~bas667/papers/micro09-jamlogger.pdf

18 of 22

Power Usage - G1

19 of 22

802.11 PSM

  • Overview: AP batches packets to deliver to host
  • Host wakes periodically to listen to beacons from AP
  • If beacon indicates host has packets buffered at AP, host will download packets

20 of 22

Nexus One WiFi Power Consumption

21 of 22

Impact of AP Contention

22 of 22

Energy Management

  • Batching work
    • 802.11 PSM - wake up periodically and see if the AP has any data to deliver
  • Hierarchical Power Management
    • use a lower-power method of completing the same task when possible
      • WiFi versus 3G
      • Turducken
  • Adaptive Energy Management
    • do you have battery to spare?
    • can you adaptively determine how much work to do?