Thursday, 26 May 2016

WiFi 802.11ac/n/g speed in theory and practice

When you are looking for a new fancy WiFi router, you can see a lot of bloated numbers in their model name. There are several technologies specified in IEEE 802.11, such as a, g, b, n, ac (the latter, the newer).

WiFi manufacturer put those alphabets to the model name to make customer easy to recognize up to which technology it supports, and most times put a number after that, such as N600, AC1300, AC1600, etc., to indicate what their maximum speed is.

Customers, like me, easily believe that N600, for example, would support 600 Mbps max speed for a connection between one device and the router theoretically. You probably have heard that this 600 Mbps is not a realistic, but still theoretically possible.

Wrong.

This number does not provide much information about the speed of 'a single connection'. It rather gives theoretical maximum speed that the router can support for 'all connections'.

For example, the maximum speed of a single connection in WD MyNet N600 is 300Mbps, not 600Mbps. They used N600 in the model name because the device can support up to 300 Mbps for 2.4Ghz and 5Ghz respectively. The maximum speed (more like throughput) of the router, 600Mbps, can be achieved when two devices are connected at 300Mbps on 2.4Ghz and 5Ghz respectively.

This is tricky and hard to be aware for a non-professionals, as many people would just believe that AC1900 would perform much better than N300 with their MacBook Air or Nexus 5.

In addition to the WiFi technology, like AC or N, there is another crucial part that determines the maximum WiFi speed of a device: the number of radios.

For the older 802.11 technologies, such as a/b/g, a device can only use a single radio. Therefore, the maximum speed was fixed to 54Mbps in 802.11g for example.

On the other hand, newer technologies including n and ac employ MIMO concept which can utilize multiple radios to achieve higher speed. (Note that this is a different concept from dual-band support like 2.4Ghz and 5Ghz). Only when both of your mobile device and WiFi router are equipped with multiple radios, you can get a higher speed. It totally depends on how many radios your mobile device is equipped with.

For example, if you connect your Nexus 5X (2x2 MIMO support) to a N600 (300 for 2.4GHz plus 300 for 5GHz, 2x2 antenna) router with 802.11n 5Ghz, the maximum speed can be up to 300 Mbps. However, if you connect the old Nexus 5 (no MIMO) to the same router, the maximum speed is only 150 Mbps, because 150 Mbps is the max speed at 1x1 radio of the Nexus 5. Nexus 5 supports 802.11ac though. If the Nexus 5 is connected to AC1300 router, for example, it can have at most 433 Mbps (Max speed of 802.11ac with 1x1 radio).

The table below shows the maximum speed of 802.11 standards at different radio settings.

Radio configuration1x12x23x3
802.11ac 5GHz4338661300
802.11n 5GHz150300450
802.11n 2.4GHz72144

Also, the radio configuration of a few well-known devices are presented.

DeviceSupport modeRadio confMax speed (ac)
Nexus 5n, ac1x1433
iPad Air, iPhone 6n, ac2x2866
Macbook Airn, ac2x2866
Nexus 5Xn, ac2x2866

At last, I should emphasize again that all these speeds are theoretical. In practice, it's not rare that 144Mbps speed at Macbook Air (connected with 802.11n, 2.4Ghz) is far quicker than 300Mbps-connected Nexus 5X. This is because laptops usually embed a big antenna compared to the smaller mobile devices. Also, laptops can have higher power range at WiFi chip-set which performs better.

For your information, this is a bench-marked network speed in reality. All devices are connected to N600 router which supports only 802.11n up to 300Mbps (2x2 config).

Band2.4 (144/72)5 (300/150)
Macbook Air (2x2)103113
iPad (2x2)78110
Nexus5 (1x1)4599

Although theoretical max-speed of Macbook and iPad, 300Mbps, is twice as the Nexus 5's max speed (150Mbps), the actual speed is almost same across all the three devices.

Wednesday, 18 May 2016

Battery capacity comparison from MacBook to Xiaomi Powerbank to Eneloop.

All portable devices need a battery for their power source. We learned basic electric units such as Watts, Ampere, Voltage, Watts-Hour, etc. However, when the device specification listed 2700mAh, or 54Wh battery, we get somewhat confused what it literally means. Here I want to compare those different units and the actual capacity of the batteries.

First of all, there are two different units the manufacturers use to describe the battery capacity: Watts and Amperes. You remember the equation to calculate Watts from Ampere.

Watts (W) = Ampere (A) * Voltage (V)

Apple uses Watts, instead of Ampere, to describe their charger capacity instead of Ampere. For example, Apple's 12W iPad charger is equivalent to 2.4A adapter, as the output of this charger is 5V (standard USB voltage). Similarly 5W iPhone charger outputs 1A at maximum. This is why you can't use iPhone charger for iPad as the output currents is too low for iPad, while you can use iPad charger to charge iPhones.

Similarly Watts-hours can be calculated with Ampere-hours because the voltage is constant regardless of time for the device.

Watt-hours (Wh) = Ampere-hours (Ah) * Voltage (V)

Most mobile devices nowadays use lithium-ion battery. A single cell of the lithium-ion battery has around 3.7 Volts, which is applicable to the most mobile phones and tablets. Therefore, iPhone 6s' 1715 mAh battery is equivalent to 6.35 Wh. We can use Wh or mAh interchangeably for the most case if the device is equipped with 3.7V single cell (or multi-cell with parallel connectivity) battery.

However, laptops needs more power than other portable devices to run the many integrated functions, which is the reason why MacBook Air's battery has higher voltage: 7.4V. This is actually equivalent to the dual cell lithium ion battery in serial connection. Therefore, 54 Wh MacBook Air battery's Ampere-hour is 7300 mAh, not 14,600 mAh.

The attached 'hours' in these unit mean that it can constantly provide such amount of Watts or Amperes for one hour. For example, 54 Wh means the battery can provide 54 Watts power for an hour. If the device consumes only 5.4 Watts, this device can survive for 10 hours with the 54 Wh battery. Power adapter does not use these 'hours' units, as they can supply unlimited power, whereas batteries can provide only for a certain amount of hours.

MacBook Air 13": 54 Wh = 7.4 V * 7,300 mAh
MacBook Pro 13": 74.9 Wh = 7.4 V * 10,120 mAh

iPhone 6s: 1,715 mAh * 3.7V = 6.35 Wh
iPhone 6s Plus: 2,750 mAh * 3.7V = 10.18 Wh
Nexus 5X: 2,700 mAh * 3.7V = 9.99 Wh
Nexus 6P: 3,450 mAh * 3.7V = 12,77 Wh
iPad Air 2: 7,340 mAh * 3.7V = 27.16 Wh
Xiaomi Powerbank 16000mAh: 16,000mAh * 3.7V = 59.2 Wh

Eneloop AA (NiMH): 2000mAh * 1.2V = 2.4 Wh

Note that Xiaomi's 16000 mAh powerbank specifies 16000 mAh capacity based on the battery cell, not the output level. Its output Volt is 5V, not 3.7V, thus it has 11840 mAh output capacity.

Android Battery Drain issue - How to dig and find the root cause?

Mobile phones is getting more and more powerful silicons and processors, which causes more and more issues on battery management. It is unav...