• Nem Talált Eredményt

4.3.1 Home routers as proxies

As an alternative solution to hosting the proxies in the Internet, we investigate the use of broadband routers as platforms for running BitTorrent proxies. Broadband routers that connect homes to the Internet via ADSL or other technology are commonly available. It should be noted that even if the routers are located at home they do not limit the mobility of the users because they are accessible from everywhere via the Internet. If the mobile user happens to be at home he could use the local WiFi connection but he can also connect to the proxy remotely through cellular data connection or through a public WiFi access point.

The router platform is attractive for a number of reasons. Since most homes are equipped with broadband routers the installed base is large and the routers are frequently idle when their owners are on the move. Routers are typically powered up all the time and the energy consumption of the router is almost constant no matter how actively it is used. There is thus plenty of spare capacity that could

be taken into use without additional costs for the users. From the technical point of view, the firmware of many routers can be changed, which allows extending the original functionality of the router.

Nevertheless, a number of new problems arise because broadband routers have limited resources. Although some models allow hardware extensions with USB devices, and some high-end router models even have built-in support for torrent download, typically, the memory size is limited and no mass storage is available.

Future routers are likely to be more capable but we think that targeting minimal-istic hardware is important both for utilization present router base and for the generality of the idea.

4.3.2 ProxyTorrent memory management

Forwarding the data to the mobile device in one burst, as CloudTorrent does, is only possible if the proxy has enough storage capacity for the whole torrent. When we use the router hardware, or some other proxy solution with small amount of resources, the limited memory allows us to store only part of the content. This raises the question: which pieces and how long should be stored in the router’s memory to ensures fast and fair torrent download and energy-efficient transfers to the phone?

A key assumption of BitTorrent operation is that when a peer has completely downloaded a piece it announces the availability of the piece to its peers. The peers can then assume that the announced piece is available for downloading. This is, however, not the case if only part of the content fits the router memory. To be able to download the whole torrent, the router has to delete some pieces after they have been sent to the mobile device, and then reuse the memory to download additional pieces. The assumption that all downloaded pieces are available for others is thus no longer valid.

The trivial solution to this problem would be to ignore it. The BitTorrent client in the router would announce the pieces normally. Then, it would later receive requests for pieces that have already been deleted from the memory, and which cannot anymore be uploaded to peers. This would have a negative effect on the download speed because the tit-for-tat mechanism would rank the peer lower

Chapter 4. Resource Limited Proxies for Energy-efficient Mobile

BitTorrent 37

if it cannot serve a requested piece. Moreover, most clients are likely to disconnect the peer when the request times out.

Another trivial alternative is to announce no pieces at all and miss the oppor-tunity to serve other peers. However, this free-rider behavior is bad for the proxy itself because BitTorrent’s tit-for-tat algorithm ranks it low resulting in slow down-load speed. Furthermore, if the number of such proxies in the BitTorrent swarm is high, it can also have a negative effect on the download speed of other peers.

Figure 4.2. ProxyTorrent architecture with an example of memory contents

The solution we have adopted is illustrated in Figure 4.2. In order to both serve other peers and ensure that all announcements the proxy peer makes are valid, the memory is divided into two buffers.

Definition 4.1 (Download buffer). The download buffer holds transient data on the way to the mobile; the pieces are downloaded from peers, sent to the mobile device, and finally discarded. The same memory space is reused to download other pieces.

Definition 4.2 (Upload buffer). The upload buffer stores pieces that are served to the swarm. After a piece in the upload buffer has been downloaded and sent to the mobile device, it remains in the memory and is made available for other peers with the normal BitTorrent piece transfer mechanism. Only the pieces in the upload buffer are announced to the other peers.

The content of the download buffer is thus constantly changing as the download of the torrent progresses. The pieces stored in the upload buffer match the standard BitTorrent rules and are not deleted while the torrent transfer is active. The upload buffer is filled with the first pieces the client downloads.

The system also needs decide how frequently the accumulated pieces are sent to the mobile device. We use a parameter, chunk size, to indicate how many pieces should be completely available in the download buffer before they are sent to the mobile. Sending a larger set of data to the mobile phone in one pass would improve energy-efficiency by reducing the number of bursts and the overhead related to the bursts. On the other hand, a bigger chunk size would reduce BitTorrent download speed and waste memory because a number of completely downloaded pieces would wait for other pieces to complete before they can be transferred to the phone and their memory reused.