# Energy-Efficient Hosting Rich Content from Mobile Platforms with Relative Proximity Sensing
## 6 Architecture of _T-Wing_  
We have implemented _T-Wing_ as a combination of an application of mobile platform and a service in the cloud. We explain both of these in more detail in the rest of this section.  
* _T-Wing Client_: The architecture of a _T-Wing_ client is illustrated in Figure 5. It has three main components: the service, management and network layers. The service layer implements the web server functionality, the network layer establishes the connection between nearby mobile platforms, and the management layer coordinates interactions between the two and also communicates with the _T-Wing_ proxy server. For the service layer, we implemented our own version of a web server on the mobile platform. Since the processes of the web server on the mobile platform tend to consume a lot of memory as the number of parallel connections grows, it's important to keep memory usage down. The web server on the mobile platform limited the maximum number of parallel connections to three for keeping a small memory footprint. The maximum number of parallel connections can be modified in the environment setting of _T-Wing_. The network layer provides a number of wrapping functions to set the IP address, IP routing table, and to enable/disable NIC. The management component reports the mobile platform's location to the proxy server, and also communicates with it when the user requests to see nearby _T-Wing_ users. Also, if a nearby mobile platform is interested in accessing content hosted on the mobile platform, the proxy server contacts the management framework to enable Wi-Fi and set up a network connection.
* _T-Wing Proxy Server_: The proxy server consists of a database and a web service. The database maintains the miniaturized web page for every object, its location and cellular signal strengths from base stations. The web service takes requests from clients, determines nearby mobile platforms and coordinates connectivity among the mobile platforms as described in the previous section. _T-Wing_ proxy server is an indispensable component, which means that _T-Wing_ clients cannot be operated in case that there is no coverage of cellular network. The main advantage of depending on the _T-Wing_ proxy server is that users allow to host content from their mobile platform not only in an energy and but also in a cost-efficient manner. And data-intensive content can be downloaded directly from nearby mobile platforms using the high-bandwidth Wi-Fi interface.
* _T-Wing Screenshots_: Figure 4 shows screenshots of _T-Wing_ on an embedded platform, BeagleBoard-xm. Figure 4a-c show screenshots which enable mobile devices to communicate peer-to-peer over Wi-Fi to share large content. Figure 4d presents a screenshot of a _T-Wing_ web provider with log messages.
* _Nearby Searching_: It allows users to search the available _T-Wing_ objects near them. It uses signal fingerprint to get the nearby object's information and shows the surrounding _T-Wing_ objects. When a user has chosen the _T-Wing_ object the user wants, the user can make a direct connection to the _T-Wing_ host by coordinating with the _T-Wing_ Proxy Server.
* _T-Wing Web Browsing_: _T-Wing_ provides the user with two kind of connection options, enabling the user to see the miniaturized web page over cellular network or enabling the user to see the entire web page over direct Wi-Fi connection as shown in Figure 4e,f, respectively.  
Figure 4: Screenshots of _T-Wing_ on an embedded platform: (**a**) Searching nearby users; (**b**) Connecting over Wi-Fi network interface; (**c**) Established connection over Wi-Fi in a peer-to-peer manner; (**d**) _T-Wing_ web provider with log messages; (**e**) Miniaturized web page; (**f**) Web browsing with rich content.