## 1 Introduction  
Opportunistic communications [1; 2; 3; 4; 5] are increasingly considered a promising Smart City enabling communication technology. They are applicable to situations when, for example, the cellular network infrastructure has become inefficient due to too many requests, or when no communication infrastructure is available at all [6; 7]. Due to the intermittent contacts, [PERSON] et al. [8] refer to such networks as Partially Connected Networks. Some authors [9] consider opportunistic networks as a subclass of Delay Tolerant Networks (DTNs) [10]. Communications in mobile opportunistic networks take place upon the establishment of ephemeral contacts among mobile nodes using direct communication via Bluetooth or WiFi direct instead of using the internet infrastructure. Based on this concept, new contact-based messaging applications have recently been developed, such as Firechat (Open Garden, San Francisco, CA, USA) or Meshme (Meshme Inc., New Castle, DE, USA). Firechat, for example, a messaging application initially meant for music festivals, became popular in 2014 in Iraq due to the government restrictions on internet use, and after that during the Hong Kong protests. In these kinds of disruptive wireless networks, where the communication between mobile devices is ephemeral, and links are typically asymmetric and unstable, sending and receiving information depends on mobility and the opportunity of contacting other devices, as long they are willing to collaborate. The duration of the contacts between the nodes is a key factor in the dissemination of messages; if the contact time is too low, there will not be enough time for nodes to retrieve all pending messages. Moreover, the management of the internal device resources, basically the buffer occupancy, is critical to provide an efficient service. Authors of [11; 12; 13; 14] offer a wide taxonomy of the protocols designed for these types of networks. The most straightforward solution is the Epidemic protocol [8]. This protocol is widely used as a reference technique, and its operations are based on the store, carry, and forward approach combined with message flooding. In this paper, we analyse an opportunistic network solution based on a novel messaging diffusion approach, called _Friendly-Sharing_. This approach aims to increase the message delivery probability by interacting with the user in order to extend the contact duration. We specifically focus on evaluating the impact on the effectiveness of this approach for: (1) the buffer size; (2) the buffer management strategy; and (3) the contact duration time. Our objective is to determine the best approach for forwarding stored messages and which method is optimal when the buffer gets full. The Friendly-Sharing approach aims to increase the contact duration by notifying the users about the time needed to interchange the messages when a new contact starts. This way, the users can decide to wait a little longer, in order to receive (and send) more messages. We implemented this approach in our testbed messaging application GRChat (Uniessitat Politecnica de Valencia, Valencia, Spain) [15]. By varying the contact duration time, buffer size and message TTL (Time To Live), we compared the performance of the basic Epidemic protocol against the Friendly-Sharing solution by using the ONE (Opportunistic Network Environment) simulator (Helsinki University of Technology, Espoo, Finland) [16]. This simulator was designed and built to specifically evaluate DTN protocols and applications, and focuses on the network layer without considering the details of lower layers such as media access control (MAC) or physical. In order to get realistic results, the movement data is based on the set of human geotagged traces experimentally obtained at the NCCU campus (National Chengchi University, Taipei, Taiwan) [17]; the message generation patterns (frequency and size) are based on statistics related to social networking applications [18]. We also characterise the mobility and the structure of this trace.