6. Conclusion
In this work we presented the architecture and design of a mobile peer-to-peer content distribution system based on a publish/subscribe paradigm. Content spreads via sharing and direct interest-based dissemination and our design includes a set of basic mechanisms to discover and download contents efficiently in opportunistic networks. The system uses a decentralized content solicitation scheme that allows the distribution of contents between mobile devices without requiring Internet connectivity and infrastructure support. This scheme is efficient in the presence of intermittent contacts and short contact durations. The system design addresses key issues, in particular the structuring of contents to facilitate efficient lookup and matching of contents. We believe that our design is general and facilitates the implementation of advanced content-centric applications. As a proof of concept, we have implemented our middleware on the Android platform along with a set of applications. We have demonstrated our system publicly and verified its correctness and experimentally evaluated performance on a small scale. We have also implemented our system in a simulator environment and performed a large-scale evaluation in terms of both application throughput (i.e., goodput) and energy consumption. The simulator implementation consists of a detailed node and protocol implementation and uses a realistic mobility model of pedestrians in a city. Our results confirm that the system performance scales well with the number of nodes since performance improves when more nodes participate. We have further evaluated two features on top of our design: caching and energy-saving mechanisms. We presented three relay request strategies, and showed that caching contents on behalf of other nodes can significantly increase resource consumption for downloading and storage but often does not lead to any considerable increase in system performance in terms of goodput. We also introduced three energy-saving mechanisms, and showed that energy consumption in nodes could be decreased by 80% without greatly harming the system performance in terms of goodput. Thus, we claim that energy-saving mechanisms should be considered as part of the system design, whereas caching should be regarded as an add-on application-specific feature; if implemented, caching mechanisms should be such that they increase system performance while still being light on resource consumption.