Thursday, 25 July 2013

USB storage speed test

Speed tested using different reader and different media. (Reading speed)

- WD MyPassport 750G USB 2.0: 36.1 MB/s R / 27.1 MB/s W
- WD MyPassport 750G USB 3.0: 89.1 MB/s R / 88.6 MB/s W

- Free Generic USB Storage 2G from Uni Library: 20.3 MB/s R / 5.6 MB/s W

- Free Generic USB Stroage 4G from Accenture: 9.73 MB/s ~ 0.9 MB/s (Broken!)

- Transcend SDHC 8G Cl6 + Laptop reader: 16.4 MB/s R / 7.5 MB/s W
- Transcend SDHC 8G Cl6 + Generic reader: 13.9 MB/s

- Sandisk SD 2G (Cl 1?) + Laptop Embedded reader: 11.2 MB/s R / 5.2 MB/s W
- Sandisk SD 2G (Cl 1?) + Generic reader: 9.82 MB/s

- Sandisk MicroSDHC 8G Cl2 + (Adapter) Laptop reader: 6.39 MB/s
- Sandisk MicroSDHC 8G Cl2 + (Adapter) Generic reader: 6.06 MB/s
- Sandisk MicroSDHC 8G Cl2 + Androboy reader: 6.05 MB/s
- Sandisk MicroSDHC 8G Cl2 + SGS2 USB connect:  6 MB/s

- SGS2 Internal storage + USB2.0 connection: 15 MB/s R / 20 MB/s W
- SGS2 Internal storage + Android internal usage AnTuTu: 20.7 MB/s / 11.3 MB/s W
- SGS2 Internal storage + WIFI g Hotspot connection: 0.9 MB/s
- SGS2 Internal storage + WIFI g connection through router: 0.3 MB/s

- SSD Macbook Air '13 PCIe: 720 MB/s R / 450 MB/s W
- Sandisk CZ80 USB Storage 32G USB3.0: 190 MB/s R / 110 MB/s W
- PQI Tiffy USB Storage 32G USB 3.0: 210 MB/s R / 80 MB/s W
- PQI i-tiff/i-lock/i-series USB Storage 32G USB 3.0: 150 MB/s R / 45 MB/s W
- PQI i-lock mini USB Storage 32G USB 3.0: 110 MB/s R / 10 MB/s W
- Transcend MicroSDXC 64G UHS1: 90 MB/s R / 45 MB/s W

Wednesday, 24 July 2013

Transfer speed for various standards

For almost all computer resources the performance is measured by transfer rate. However, they use various units for speed. Let's make it simple using the most common units in today's computers, MB/s.

These values are not calculated very accurately. I just assume that 1 byte needs 10 bits for transport including some control bits. Some methods may use more control bits, while some use less. Only for your reference and practical purpose. Please do not put any weigh on a penny MB :)

- SATA3: 550 MB/s (= 6 Gb/s)
- SATA2: 270 MB/s (= 3 Gb/s)
- USB3.0: 400 MB/s (= 5 Gb/s)
- USB2.0: 35 MB/s (= 480 Mb/s)

- Sasmung SSD 840 basic: 530 / 200 MB/s 
- 5400 rpm HDD: 85 MB/s

- Samsung SDHC UHS1 Plus: 48 / 20 MB/s
- Samsung SDHC UHS1 Pro: 70 / 20 MB/s
- Samsung SDHC Class10: 24 / 21 MB/s

- Mobile phone file transfer: 20 MB/s

- Gigabit Ethernet: 100MB/s (= 1 Gbps)
- Wifi n: 30 MB/s (= 300 Mbps)
- Wifi g: 5 MB/s (= 54 Mbps)

- Highspeed-internet: 10 MB/s (= 100 Mbps)
- ADSL2+: 0.8 MB/s (= 10 Mbps)

- LTE Single: 1.5 MB/s (= 15 Mbps)
- 3G+ : 0.5 MB/s (= 5 Mbps)

- Bluetooth 2.0 EDR: 0.2 MB/s (= 2.1 Mbps)
- Bluetooth 3.0 HS: 2 MB/s (= 24 Mbps)

- HDMI v1.2(1080p): 400 MB/s (= 4 Gbps)
- HDMI v1.3: 800 MB/s (= 8 Gbps)

First of all, if you want to use the recent SSD for your laptop or desktop, you'd better to have SATA3 interface in your computer. SATA2 doesn't support the full speed of new SSD.

Similarly, your external HDD is fully functional when you connect it with USB 3.0 port, if the HDD supports USB 3.0 interface.

UHS1 class SDHC cards should be inserted to USB 3.0 compatible card reader with USB 3.0 port, while Class 10 doesn't seem to need USB 3.0 support.

Mobile phones still support only USB 2.0, thus there's little difference between using wifi N and USB cable (30 vs 35) when you transfer transfer files from your mobile to PC. However, if either your mobile or your computer doesn't support wifi N, definitely you'd better to use USB since wifi G provides maximum 5 MB/s, while you can get 30 MB/s when you use USB cable.

If you don't share any files using your home network, and just use low speed internet, such as ADSL, you don't actually need wifi N or Gigabit Ethernet.

SSH connection through http proxy, or another SSH tunnel

In my university, all computers in the computer labs are connected to the internet behind the firewall, and the firewall blocks every port. All traffics should go through a http proxy, and it allows only port 80 and 443 in the proxy server. What if you want to connect to a server via Internet with another protocol other than http or https? There are various ways depending on the configuration of your organisation's network.

1. Use CONNECT command of proxy server
You can use the proxy's "CONNECT" command from your proxy server. This command, however, is not supported in all proxy servers. It may be blocked in the proxy server by the organisation rule. If your proxy supports it, you can simply use http proxy to connect to the other services like ssh on port 22. For example, you can set it up from proxy settings menu on putty if you want to use SSH connection.

Unfortunately, the proxy server in my university doesn't support this command. You can simply test it using telnet command, explained in this document: http://www.anta.net/misc/telnet-troubleshooting/http-proxy.shtml

What is next option?

2. Use VPN through http proxy server
Some VPN supports connecting VPN through http proxy server. What I used was OpenVPN, and the client of OpenVPN supports http proxy. However, there is still some considerations on this method.

First of all, you need another server running OpenVPN server program out there on internet. One simple and cheap way is using a virtual machine on a cloud provider, such as Amazon's AWS. They provide one smallest instance for free for one year. For individual usage, you don't really need a powerful machine, so the smallest virtual machine is enough for it. Once you got an virtual machine, or using your own PC in your home, just configure OpenVPN server on that machine.

Secondary, you should consider the port number of OpenVPN server. As the proxy server in my university allows to connect only to port 80 and 443, OpenVPN server should use either port 80 or 443. If I use another port number, all traffic is blocked by proxy server.

Finally, you should have a administrator privilege for the computer running OpenVPN client. Since VPN changes all traffic route to go through VPN, you need root privilege to change the route table.

In my university, I cannot change the route table of the computers in the lab. I simply don't have enough permission to do it. So, I could use this method only with my own laptop using in the university's wireless.

3. Using SSH tunnelling
The last option is to use SSH tunnelling. This method is only possible if you have a server (1) that can be connected from your computer using SSH protocol, and (2) that can connect to the internet using a port number for your usage.

In my university, I can access to the internal UNIX server using SSH on port 22. This is possible because the server is not outside of the firewall. However, weirdly, I can connect to almost all ports without proxy from the internal server, such as 22. I just realise that the internal server is behind different firewall rules, and that's how this method is working in my situation.

If you could find a port opened in your firewall to the internet, you can run SSH server using that port event if the port is not 22.

Once you have a SSH server, you can simply use SSH tunnelling. It can be set up using putty without administrator privilege. In putty, you can set up SSH tunnelling on dynamic mode, or local mode.
If you use dynamic mode, you can use the tunnel as a SOCK5 proxy server from any programs once it supports SOCK5 proxy setting. The server will be just the local host, and use the port number you set up at the putty.

If the program does not support SOCK5 proxy, you can still use the local mode tunnelling. It specifies the local port and the remote port, so that you can use the localhost with the local port to connect to the remote server. For example, I set up the local port to 3000, and the remote host to "example.com:21", you can connect to example.com using FTP protocol by connecting to localhost:3000 from your FTP client program.

Better way... 
I think the VPN is the best way to bypass the firewall. It's secure as it provides secure connection between your client and the server. Also, it provides full network services as the VPN makes your client as like it's located in the same network of the VPN server. It can use all network port that can be used from the server. You can use it very convenient as well, once you have configured the server and client. You don't have to change any other settings from other programs. Use it simply as you use it normally, then the VPN client will make all traffic detour through the VPN server. If you have a root privilege to install the client software on the computer, just find a nice server with high-speed network bandwidth and go with VPN.

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...