# Energy-Efficient Hosting Rich Content from Mobile Platforms with Relative Proximity Sensing
## 5 Design of _T-Wing_
### Handling Multiple Clients  
If several users want to simultaneously access the same content from a mobile device, several optimizations are possible. One is the concept of _content proxying_, which allows a popular content provider mobile device to increase its upload fan-out by replying to a new requestor with a list of other mobile devices that have previously downloaded the same content. In case any of these mobile  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Content Type** & **Compression Strategy** \\ \hline Text & Compression by LZO \\ Image & Trans-encode image to 640 \(\times\) 280 \\ Audio & Full audio file \(\rightarrow\) cutting up first 5 s \\ Video & Full video file \(\rightarrow\) cutting up first 5 s \(\rightarrow\) trans-encode from.wmv to animated.gif \\ \hline \hline \end{tabular}
\end{table}
Table 1: Compression strategy for each content type.  
devices is still in Wi-Fi range of the new requestor, it may be faster for the new requestor to download the content from there. Further optimizations include smart IP-address management by the proxy server, as well as changes to the Wi-Fi scheduling policy to avoid the rate anomaly problem.
* _IP-Address Management_: As mentioned above, the proxy server assigns IP addresses to mobile devices upon request. If a second requestor device wants to access content from a mobile device that is already serving content, then the proxy server must not, of course, assign a new IP address to this device. Instead, this server device's IP address is simply conveyed to the requestor, who can then access this device by connecting via Wi-Fi. In order to be able to assign the same IP address to a subsequent requestor, the server thus needs to keep track of the IP addresses that are currently in use, and more generally, it needs to know which device has its Wi-Fi in use, and which device does not. For this purpose, we use a concept of 'IP-address leases': a device, after having been assigned an IP address, needs to report to the proxy server whether it is still actively using its Wi-Fi radio. If the device does not renew its lease on time, the server knows that the Wi-Fi is no longer in use and returns the IP address to the pool.
* _Content Proxying_: If many mobile devices attempt to access the same content from the same device, this device may be unable to serve all requestors efficiently due to lack of bandwidth. In _T-Wing_, we use the concept of _content proxying_ to alleviate this problem to some degree. Assume that three mobile devices \(A\), \(B\), and \(C\) access the same content from device \(S\), but that \(A\) was the first to successfully complete the download because its request was issued before the two others. Now, when \(B\) and \(C\) request the same files, the device \(S\) can serve one of the requests itself, say request \(B\), but it can also tell device \(C\) that \(C\) might be able to download the file faster from content proxy \(A\). If device \(C\) is within Wi-Fi reach of device \(A\), \(C\) can then request the file from \(A\), rather than requesting it from the original device \(S\) directly, which enables the transfers from \(S\) to \(B\), and from \(A\) to \(C\) to go in parallel, rather than having \(S\) serve both requestors \(B\) and \(C\) sequentially. In other words, _T-Wing_ uses the concept of content proxying to opportunistically increase the fan-out of the serving device, and thus increase the overall distribution speed.