1 Introduction

Today, wireless-based mobile devices have become a daily necessity of the society and seamless mobile communication gives wing to it. The mobile P2P networks have attracted many researchers due to the increase in mobile-based Internet applications. These networks give freedom to users to share their files/data without the arbitration of a central server. Basically, a P2P network provides an environment where users in the network collaboratively perform computing tasks and share their resources without the help of a central server. Mainly, there are two types of P2P networks that are designed for wired networks—centralized and distributed. The distributed P2P networks are further classified into two categories—structured and unstructured. Napster (2019) is an example of a centralized P2P system where the file search process is carried in a centralized server that stores the indices for files. The provision of a centralized server causes a single point of failure problem in case the server is overloaded. To overcome this problem distributed P2P systems were developed to replace the centralized P2P systems. The structured P2P systems have no central directory server. These decentralized systems have a significant network structure (overlay) imposed over the participating users and it is tightly controlled using DHT (Distributed Hash Table) based protocols as proposed in Dabek (2005). Files and users’ IP addresses are mapped on the same address space using simple Hash Algorithm-1 (SHA-1). For example, in structured P2P systems like Freenet P2P network (Freenet 2019), the placement of files is based on hints. In an unstructured P2P network like Gnutella (2019) and Bit Torrent (2019) resiliency against nodes’ dynamics is there and there is no centralized administrative entity to control the P2P operations of the users. The overlay of the unstructured P2P networks is loosely controlled as compared to structured P2P networks.

Traditional P2P systems suffer from many challenges like churn (random join or leave of peers), malicious content distribution, free riding, whitewashing, poor search scalability, lack of a robust trust model, etc. When traditional P2P protocols are implemented for mobile networks, it adds more challenges specially the mobility of the users, intermittent connection, limited battery power, limited memory, limited bandwidth, etc. Most of the file discovery protocols in structured P2P networks like Chord (Stoica et al. 2003), Pastry (Rowstron and Druschel 2001); Tapestry (Zhao et al. 2001), etc. are based on the DHT (Dabek 2005), but these protocols do not work efficiently for mobile P2P networks due to the mobility of users and limited resources like limited battery power, limited memory, limited bandwidth, intermittent connection, etc. The DHT is a resource searching and retrieval protocol used in structured P2P networks. It shares a large identifier space that is shared by both participating users and files in the networks. The participating users and files are mapped on the same identifier space using SHA-1 (Standard Hash Algorithm-1). When a user wants to look up a resource in the structured P2P network, a key lookup message is sent to participating users. This message is forwarded from node to node till the resource is found or query time is expired. The resource lookup operation consists of locating the file or user for a given key. The major resources which are shared in P2P networks are files, CPU cycles, storage, and bandwidth.

Today cellular networks are providing 2G, 3G, 4G and futuristic 5G services to the subscribers. Locating mobile users and providing services in cellular networks is not a big issue today, but it is still an issue in wireless multi-hop networks. Wireless multi-hop networks such as Mobile Ad hoc Networks (MANETs), Wireless Mesh Networks (WMNs), Wireless Sensor Networks (WSNs), Vehicular Ad hoc Networks (VANETs) have huge potential in many areas like disaster management, fast infrastructure replacement, an extension of the hotspots, etc. MANETs and WMNs can easily replace the infrastructure based communications without any pre-existing infrastructure or with very little infrastructure. In a MANET, autonomous mobile nodes communicate with each other without support from pre-existing infrastructure. WMNs are formed over mesh backbone, which comprises of quasi-stationary or stationary wireless mesh routers to communicate with mobile nodes. Apart from these networks, Wireless LAN (WLAN) and Wireless MAN (WMAN) are also deployed for mobile communication with very little pre-existing infrastructure.

The rest of the paper is organized as follows.

  1. 1.

    The literature survey and limitations of the existing schemes in the related fields are given in Sect. 2.

  2. 2.

    The proposed scheme and modelling have been discussed in Sect. 3.

  3. 3.

    The analytical modelling of the performance of proposed and existing schemes is given in Sect. 4.

  4. 4.

    The conclusion about the performance of the proposed scheme is given in Sect. 5 followed by the references.

2 Related work

Mobile robust chord (MR-Chord) scheme has been proposed in Woungang et al. (2014). In this scheme additional information such as lookup success/failure rate and weak node (true or false) are stored in the finger table along with chords. The maintenance of the finger table comprises of two schemes—real-time fix and by-detect fix. Real-time fix scheme is responsible for updating the chords when lookup failure occurs by fixing the errors in the finger table of each chord. By-detect fix scheme decides whether more finger node detections should be performed or not based on the collected statistics on lookups. More precisely, when some mobile node sends a key lookup procedure, it records the result of the lookup in its finger table as success or failure. If the lookup procedure is successful, the success rate is incremented by 1 otherwise failure rate is incremented by 1. The cumulative values of success and failure rates are calculated for a node-i and if Failure[i] − Success[i] > 2, the chord (finger) to node-i is said to be weak. After detection of the weak finger, the check procedure is called to fix the error caused by the weak finger in the finger tables of the other nodes. MR-Chord scheme (Woungang et al. 2014) faces the problem of detecting too many failures and fixes thereafter for the mobile users having high mobility and therefore induces high update cost of finger table. In Liu et al. (2010), authors have proposed a cross-layer Chord-based design scheme called Mobile Chord, which enhances the P2P lookup performance over Vehicular Ad hoc Networks (VANETs). In this scheme, each node maintains the Chord overlay in a distributed manner and provides a reduction in the protocol’s overhead.

A topology-aware Chord protocol has been proposed in Dao and Kim (2006) for structured mobile P2P networks and there are two tables proposed namely finger table and neighbourship table. These tables are proposed to improve routing efficiency and lookup accuracy. The neighbourship table stores information about the closest known nodes. A bidirectional routing has been proposed in Hailun et al. (2013) named as Bidirectional Neighbour’s Neighbour Chord. This scheme is intended to improve the Chord lookup performance. In this scheme, the lookup is processed through both directions, clockwise and anticlockwise, to improve the lookup performance. The proposed scheme relies on the idea of extending the finger table of each mobile node using the learn table. The table maintains the information of all successors of a successor of a node. This scheme is not successful for mobile P2P systems due to too many updates in the finger table during neighbour’s neighbour learning process.

In Wu et al. (2008), authors have proposed a two Chord-based scheme which is called Enhanced Bidirectional Chord (EB-Chord). This scheme proposed to minimize the query path length and the lookup average latency in P2P networks. This scheme is based on the idea of using two-finger tables with dual directions. A single key is assigned to more than two nodes at a time. A network-aware P2P file discovery scheme for the wireless mobile network has been proposed in Huang et al. (2007). The entire network is divided into clusters. Nodes in a cluster share similar characteristics. A super node maintains the index of all the shared files in the cluster and the client node requests the same from the super node. The network-aware P2P file-sharing architecture enables the files to be searched first with nearby nodes. This proposal comprises a provision of super node to maintain the file index and hence susceptible to a single point of failure in case of failure of super node.

In Chen et al. (2013), one scheme to find out the cardinality of the nodes in large mobile P2P networks has been proposed. In this scheme, authors have proposed two methods namely circled random walk and tokened random walk to find out the number of nodes in the large mobile P2P systems. In Wang et al. (2013) a scheme to deal with intermittently connected nodes in mobile P2P networks has been proposed. The proposed scheme includes two opportunistic routing algorithms, which exploit the spatial locality, spatial regularity and activity heterogeneity of human mobility to select relays. In Shen et al. (2014) have proposed a routing mechanism for hybrid wireless networks based on P2P based Market-guided Distributed Routing (MDR) mechanism. MDR mechanism consists of widespread base stations to coordinate the routing. The packets from a source node are transmitted to base stations directly or indirectly and then packets are transmitted to the destination. The widespread base stations help in building mobile P2P structure, avoiding local information exchanges and managing the services among nodes. This scheme requires assistance from well-deployed network elements like base stations to transmit the packets to the destination. In Rahmani and Benchaïba (2018) a multihop Proximity aware Clustering Scheme based on the physical proximity of peers for Mobile peer-to-peer systems (PCSM) has been proposed.

The file search efficiency is dependent on the availability of file in the neighbour nodes in mobile P2P networks. Replication/caching of files is done in P2P networks to enhance the search performance (Kumar and Lee 2013; Chow et al. 2007; Bok et al. 2017; Khan et al. 2017; Bhatia and Rai 2017; Hasimoto-Beltran et al. 2019; Zheng et al. 2016; Kim et al. 2019). The only provision of replication/caching does not guarantee lookup efficiency. Indexing of the replication/caching must be distributed among neighbour nodes to enable cooperating caching and it enhances the search efficiency. In Khan et al. (2017), all the nodes inside a cluster replicate the content which enable higher lookup success rate but it also creates a burden on each node in terms of storage. In mobile communication, devices have limited storage, limited power and limited processing capability. Cooperative replication/caching avoids redundant replication/caching. In Liu and Lai (2018), data synchronization in mobile P2P networks based on Mobile Ad hoc Network (MANET) has been proposed. Authors have proposed an inverted indexing structure for data synchronization based on group-based data synchronization. A group consists of one super node and many member nodes. Participating nodes communicate with each other using Wi-Fi direct (ad-hoc) mode.

P2P networks based on Internet infrastructure and mobile ad-hoc networks (MANETs) share many common characteristics like self-organization and decentralization due to the common nature of the distributed components (Wu 2005; Babaei et al. 2014). These networks also share a high degree of dynamicity in topology formation as nodes can join and depart at any time. P2P networks rely on IP infrastructure for routing whereas MANETs rely on hop-by-hop connection and have limited bandwidth and high traffic maintenance costs. MANETs rely on two types of routing protocols: reactive and proactive. Reactive routing protocols like Ad hoc on Demand (AODV), Distance Vector (Perkins et al. 2003) and Dynamic Source Routing (DSR) as proposed in Johnson and Maltz (1996) create routes when required by the source node. A proactive routing protocol like Optimized Link State Routing (OLSR) protocol maintains update routing information from each node to any other node in the MANET.

Mobility pattern of the mobile users in mobile P2P applications has not been considered at a larger level in the existing schemes for P2P services. In urban cities, the mobility pattern of mobile users plays an important role in locating the users and delivering the data packets. Many mobile users follow a fixed mobility pattern while attending their office or doing business. It has been reported in the existing work that mobile users in urban cities follow up to 90% fixed mobility pattern. We can explore the mobility pattern of the users for P2P applications for mobile networks. Mobile users can store the mobility pattern and hence availability of files among participating users can be enhanced. We have proposed a Local P2P Group (LPG) based on the mobility pattern of the mobile users. Participating mobile users who are in communication range (1-hop wireless communication) form an LPG. Mobile users in one LPG also communicate with mobile users in another LPG. The proposed system is useful in disaster management also. We have analytically evaluated the proposed scheme using fluid flow and RWP mobility models and found that the proposed scheme performs better than MR-Chord (Woungang et al. 2014) and MobiStore (Khan et al. 2017).

3 Proposed system model

We have proposed local P2P group (LPG) based P2P application system for mobile networks. The proposed system utilizes the mobility pattern of the mobile users. An LPG is formed over nodes that are present in a particular area at a particular time. It has been observed that most of the mobile users in the urban cities follow fixed mobility pattern (Nath and Kumar 2014) as illustrated in Fig. 1. The mobile users who are present in a particular area at a particular time are also represented in Fig. 1. The circle represents the communication range of mobile user N22.

Fig. 1
figure 1

Mobility pattern of mobile user N22

The mobility pattern of office working mobile user N22 has been illustrated in Fig. 1. The house and office of N22 are shown in Fig. 1. Mobile user N22 starts the journey to his/her office at time t1 and reaches office at time t5. Between t5 and t6, N22 works in the office and leaves the office at t6. At different times namely t2, t3, t4, t7, t8, and t9, mobile user N22 passes through different communication range (LPG) and encounters different mobile users. At time t10, N22 reaches his/her house back. Time periods t1 to t10 are recorded by N22 as per his/her mobility pattern and assumed to have little deviation. The participating mobile users along with N22 form LPG for N22. For example, between time t4–t3 mobile user N22 is in communication range with other mobile users N11, N15, N17, N18 and N31 and mobile users namely N11, N15, N17, N18, N22 and N31 form LPG3. Mobile users in an LPG during a specific time period are known as regular members of that LPG. Regular members are present in the respective LPG formation most of the time because most of the members follow a fixed mobility pattern on a routine basis. New members may join the LPG or regular members may leave the LPG. Some members become unreachable due to many reasons like out of communication range, switch off or any other reason. Such members are marked as unreachable. This happens frequently due to the mobility of the users and other reasons. Similarly, N22 forms other LPG at a different time with different mobile users as given in Table 1. LPG5 is there for illustration but N22 is not a member of this LPG. Since each mobile user has mobility so a mobile user may be a member of different LPGs at different times. Some mobile users are a member of two or more LPGs depending on their communication range and mobility pattern. Each mobile user stores its LPG table based on its mobility pattern.

Table 1 Node N22’s mobility pattern based LPG

The members in an LPG communicate with each other directly and hence members of an LPG are in 1-hop communication. Sometimes, a member in an LPG is graceful enough to act as a bridge between two LPGs and other members can communicate with other mobile users in different LPGs. Such bridging is formed among two or more LPGs and hence enables 2-hop or n-hop (n ≥ 2) communication. For example, n-hop communication between LPG1, LPG2, LPG3, and LPG4 has been illustrated in Fig. 2. As shown in Fig. 2, mobile users N26 (LPG2) and N22 (LPG1) communicate with each other through bridge N33 (LPG1) using 2-hop communication. Mobile user N50 (LPG4) communicates with mobile user N31 (LPG3) through bridges N42 (LPG4) and N11 (LPG3) using 3-hop communication. The bridges between two LPGs are also stored in Table 1 for assisting possible communication between two LPGs. Bridges are designated based on their participation in two or more LPGs and past services received. For example, mobile user N43 is a member of LPG1 and LPG2 and hence it is a possible bridge between LPG1 and LPG2. Bridge N33 is not a member of LPG2 but it has been used as a bridge in the past.

Fig. 2
figure 2

n-hop communication in mobile P2P users

Such a communication model is very much useful in disaster management. Participating mobile users in LPG are well aware of the presence of other mobile users. Thus, at the time of disaster condition in a particular area, a mobile user in that particular area can communicate with other mobile users present in that area as per information stored in Table 1. Bridges play a crucial role in n-hop communication while disaster situation occurs. Flag provision can be made for showing disaster situation so that participating users can communicate across different LPGs.

3.1 Local P2P group (LPG) formation and maintenance

Mobile users form LPG as per their mobility pattern and time span as given in Table 1. LPG formation is dynamic and keeps on changing as per the joining or departure of the participating users. An LPG for a mobile user Ni is formed over those mobile users who are in communication range with Ni over a particular time period. Two or more LPGs may be overlapping depending on the participating users as shown in Figs. 1 and 3. Each mobile user announces his presence (its IP address and ID as per hashed value as defined in Chord) in the LPG periodically and so other mobile users in the group are aware of the presence. If any mobile user doesn’t announce its presence for a certain time period then it is assumed that the mobile user has crossed the boundary of LPG or switched off the power or unavailable due to any reason. In such a situation, the status of that mobile user is marked as unreachable as shown in Tables 1 and 2. If any new mobile user joins the LPG then it announces its presence and members of the LPG enter the new mobile user in the Table 1. Old members of the LPG send acknowledgement as acceptance to a new member and new member updates its LPG table.

Fig. 3
figure 3

Join/leave of mobile users

Table 2 Node N22’s updated LPG table

For example, as illustrated in Fig. 3, mobile user N52 crosses the boundary of LPG5 and enters LPG3 during time period t4–t3 and mobile user N18 crosses the boundary of LPG3 in the same period. In this situation, members of LPG5 update their LPG table and mark N52 as unreachable. Members of LPG3 also update their LPG table and enter N52 as a new member and N18 as unreachable. Since mobile user N18 is a regular member, therefore, N18 is not deleted from the member list. As given in Table 2, mobile user N22 updates its LPG Table 1 and enters N52 as a new member. Similarly, members of LPG3 and LPG5 update their LPG tables as addition or deletion of a new member. A new member becomes a regular member if a new member joins the LPG twice or more at the same time period.

When mobile user N22 starts a new day, it has his previously updated LPG table as per its previous visit to the office. N22 leaves his home at time t1 and returns at time t10. During time periods (t2–t1), (t10–t9), and (t10–t1), N22 has LPG1. So during these periods, if N22 finds that member N24 is unreachable again then N24 is deleted from the member list. The bridge list is also updated accordingly. Similarly, N22 updates his other LPG namely LPG2, LPG3, and LPG4.

Fluid flow model has been proposed in Thomas (1988) to compute the rate of boundary-crossing of mobile users who reside in the closed region. We assume that LPGs are circular and exist in closed region. As per fluid flow model proposed in Thomas (1988), there are two assumptions made. First, mobile users are uniformly distributed over the closed region. Second, the movement of each mobile user is uniformly distributed on [0, 2π] and the velocity of each mobile is independent in different places and identically distributed. Suppose parameters λm and V are the rate of boundary-crossing per unit time and velocity (m/s) respectively. The crossing rate (λff) per mobile user is defined as follows:

$$\lambda_{ff} = \frac{{P_{LPG} \times V}}{{\pi \times A_{LPG} }} = \frac{2V}{\pi R} ,$$
(1)

where communication range of a mobile user (LPG) is a circle with radius R and PLPG and ALPG are perimeter and area of the circle respectively.

Random Way Point (RWP) mobility model has been proposed in Bettstetter et al. (2004), Hyytiä and Virtamo (2007), Lin et al. (2013). In Lin et al. (2013), authors have proposed improved RWP in which the random direction of mobile user is uniformly distributed on [0, 2π] and waypoints are chosen as Markov process rather than independent identically distributed. The mobile user may travel in a straight line like on the highway and residence time in a cell is inversely proportional to the speed. As per (Lin et al. 2013), the mean residence time in a cell without pause time at the exit of the cell is given as below:

$$R_{{res\left( {rwp} \right)}} \approx \beta \times \frac{{P_{LPG} }}{V},$$
(2)

where P is perimeter of cell and \(\beta \in \left\{ {\frac{\sqrt 3 }{2}, 1} \right\}\) is a constant. If β = 1, both (1) and (2) are equivalent.

Sometimes, mobile user moves in zigzag motion and residence time is different than (2). Suppose γ is the mobility factor such that 0 ≤ γ ≤ 1 and V is uniformly distributed on [Vmax, Vmin], then mean residence time in an LPG is given below:

$$R_{{res\left( {rwp} \right)}}^{mean} = \frac{{\log V_{max} - \log V_{min} }}{{2\sqrt \gamma \left( {V_{max} - V_{min} } \right)}} \times P_{LPG} .$$
(3)

If the speed of the mobile user is constant and suppose it is v m/sec then mean residence time is given below:

$$R_{{res\left( {rwp} \right)}}^{mean} = \frac{{P_{LPG} }}{2\sqrt \gamma v},$$
(4)

The value of the mobility factor (γ) decides the movement patterns. The larger value γ indicates shorter transition length and the lower value of γ indicates a higher length transition. The shorter transition length implies that the change in the movement direction of the mobile user is higher. Sometimes it happens when a mobile user goes shopping and switches its direction frequently. A larger value of transition length implies less change in the movement direction of the mobile user. It happens when a mobile user travels on the highway. So, the value of mobility factor (γ) decides a different kind of mobility of the mobile users.

Suppose Navg is an average number of mobile users per LPG and the cost of updating LPG table is CLPG (sec). The cost of updating LPG table by each mobile user per unit time is expressed as below:

$$C_{LPG}^{t} = N_{avg} \times C_{LPG} \times \lambda_{m}$$
(5)

where λm = λff or \(\lambda_{m} = {\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 {R_{{res\left( {rwp} \right)}} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${R_{{res\left( {rwp} \right)}} }$}}\) depending on the selected mobility models—fluid flow or RWP.

Suppose the size of the broadcast message by a mobile user in an LPG for announcing its presence or acknowledgement is Cmsg (Byte). The messaging overhead in an LPG for a mobile user per unit time due to the mobility of users is expressed as follows:

$$C_{msg}^{t} = N_{avg} \times \lambda_{m} \times C_{msg}$$
(6)

Suppose, the average time variance of a mobile user with respect to its mobility pattern is Δt (s) and mean residence time in an LPG is \({\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 {\lambda_{m} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${\lambda_{m} }$}}\). Let ρm is the probability that a mobile user follows its mobility pattern. The total cost of updating LPG table by each mobile user over residence time due to the mobility of users is expressed as below:

$$\begin{aligned} C_{LPG}^{T} &= {\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 {\lambda_{m} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${\lambda_{m} }$}} \times \rho_{m} \times N_{avg} \times \lambda_{m} \times C_{LPG} \\ &\quad\pm \left( {1 - \rho_{m} } \right) \times \Delta t \times \lambda_{m} \times N_{avg} \times C_{LPG} \hfill \\ &= N_{avg} C_{LPG} \left\{ {\rho_{m} \pm \left( {1 - \rho_{m} } \right)\Delta t\lambda_{m} } \right\} \hfill \\ \end{aligned}$$
(7)

The total messaging overhead in an LPG over residence time is expressed as follows:

$$\begin{aligned} C_{msg}^{T} &= {\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 {\lambda_{m} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${\lambda_{m} }$}} \times \rho_{m} \times N_{avg} \times \lambda_{m} \times C_{msg} \pm \left( {1 - \rho_{m} } \right) \\ &\quad\times \Delta t \times \lambda_{m} \times N_{avg} \times C_{msg} \hfill \\& = N_{avg} C_{msg} \left\{ {\rho_{m} \pm \left( {1 - \rho_{m} } \right)\Delta t\lambda_{m} } \right\} \hfill \\ \end{aligned}$$
(8)

It is noticeable that sometimes a mobile user does not follow his mobility pattern and enters an LPG before or later as compared to its routing entry. Thus, when a mobile user enters an LPG before or after and spends more or less time in an LPG, say Δt unit time then the total cost is increased or reduced accordingly as expressed in (7) and (8). We consider the time variation \(\Delta t\infty \left( {1 - \rho_{m} } \right)\). It means that if a mobile user follows its mobility pattern exactly then its time variation Δt in an LPG will be very less. It is also pertinent to mention here that the CR (churn rate) of the mobile user has not been considered in cost expressions (58).

3.2 File lookup procedure

When a new mobile user joins an LPG, it publishes its list of files and regular members of that LPG update their file table. When a regular member downloads a file then it publishes the file name and ID (identity as per SHA-1) to other members in LPG and other members update their file table. Each mobile user stores a file table as given in Table 3.

Table 3 Node N22’s File table

Referring to Table 3, file F1, IDF1 is stored by N24 and N43 mobile users and these users belong to LPG1. File F6, IDF6 is stored by N13, N24, N26, N31, N42 and N50 and these users belong to LPG1, LPG2, LPG3 and LPG4. When a mobile user publishes a file, the entry must be in Table 1 and then Table 3 is updated. For new mobile user entry, must be made in Tables 1 and 3.

Files are stored in decreasing or increasing order of file IDs. Therefore, the file lookup process is carried out in binary search. So, even in the worst condition file lookup process requires O(log2 n) comparison in Table 3 where n is the number of files. But files must be stored in some numerical order and each row in Table 3 must be directly accessible. New entry or deletion in Table 3 is more complex and requires extra cost which is O(n) in the worst condition. When a mobile user is no longer member of an LPG, entry of that mobile user in Tables 1 and 3 must be deleted.

The file lookup process is carried out in a hop-by-hop manner. For example, suppose N22 wants to download a file named Fi. First N22 searches its file table (Table 3). If Fi is there then N22 finds the owner of the file and current location as per information stored in Table 1. Suppose mobile user Ni stores the file and present in current LPG then N22 sends file requests to Ni directly and Ni uploads desired file to N22. If Ni is in other LPG then N22 checks Table 1 for the possible bridge. If the bridge (Nj) is there then N22 sends a file request to Ni through Nj and Ni uploads the desired file to N22 through Nj. Otherwise, N22 waits for its entry inappropriate LPG where Ni may be present or Ni may be communicated through some bridge. If the desired file is not downloaded completely during an LPG formation period then either N22 waits for next entry in the same LPG or searches for the possible bridge. If the bridge is available then the remaining part of the file is downloaded through that bridge. It is pertinent to mention here that such file sharing is possible if Cooperative File System (CFS) is used.

If the desired file is not present in the file table or not available due to any reason, N22 looks in the members of the current LPG. File name Fi is hashed using SHA-1 as defined in Chord (Stoica et al. 2003) and N22 broadcasts lookup request in its current LPG. This is 1-hop communication. All the members of N22 check their file table. Only those members who store the desired file send the response back to N22 and then N22 sends a file download request to all the members who have the desired file or link to owners. If a member Nb does not store the file but has an entry in its file table (link to the owner) then it forwards the request to the owner mobile user Nw. If Nw sends a response back to Nb then Nb sends a response back to N22 if it is willing to act a bridge. The response from Nb includes the acknowledgement to upload a file from Nw and path to the owner of the file. A file can be downloaded from multiple mobile users using CFS. If no one replies within Time-to-live Query (TTLQ), N22 assumes that the desired file is not available in current LPG. In brief, the file download is carried out in 1-hop (same LPG) or n-hop (other LPG) communication. If the desired file is not completely downloaded then N22 keeps owner information and path to the owner for future communication. When N22 enters same LPG where it has downloaded the file partially, it sends file request (unicast) to the owner. If the owner is unavailable then N22 broadcasts fresh file request and downloads the remaining part of the file.

We assume that each mobile user has at least one uplink and one or more downlinks capacity. So, a mobile user can receive maximum download from (Navg–1) mobile users where Navg is the total number of users in an LPG. The total cost of updating LPG and file tables by each mobile user over residence time due to the mobility of users, files download, and joining of new members is expressed as below:

$$\begin{aligned} C_{LPG}^{Total} &= C_{LPG}^{T} + \frac{{C_{LPG} }}{{\lambda_{m} }} \times \frac{{\left( {N_{avg} - 1} \right) \times W_{avg} }}{{F_{Size} }} \hfill \\ &= N_{avg} C_{LPG} \left\{ {\rho_{m} \pm \left( {1 - \rho_{m} } \right)\Delta t\lambda_{m} } \right\} + \frac{{C_{LPG} \left( {N_{avg} - 1} \right) \times W_{avg} }}{{\lambda_{m} F_{Size} }} \hfill \\ \end{aligned}$$
(9)

The total messaging overhead in an LPG over residence time is expressed as follows:

$$\begin{aligned} C_{msg}^{Total} &= C_{msg}^{T} + \frac{{C_{msg} }}{{\lambda_{m} }} \times \frac{{\left( {N_{avg} - 1} \right) \times W_{avg} }}{{F_{Size} }} \hfill \\ &= N_{avg} C_{msg} \left\{ {\rho_{m} \pm \left( {1 - \rho_{m} } \right)\Delta t\lambda_{m} } \right\} + \frac{{C_{msg} \left( {N_{avg} - 1} \right) \times W_{avg} }}{{\lambda_{m} F_{Size} }} \hfill \\ \end{aligned}$$
(10)

3.3 Route setup cost to download a file (Croute)

We assume that underlying routing protocols are AODV (Perkins et al. 2003) and DSR (Johnson and Maltz 1996) defined for MANETs. AODV protocol maintains a single route from each pair of nodes whereas DSR maintains multiple routes. Suppose mobile user N22 broadcasts request message to download a file in its LPG and m number mobile users send a response back. Using AODV protocol, the cost involved in broadcasting the request to set up a route and deciding an appropriate route to the destination node to download the file is given below:

$$C_{{route\left( {AODV} \right)}}^{Proposed} = C_{b} + mC_{u}$$

For simplification purpose, let Cb = Cu = Cmsg, so

$$C_{{route\left( {AODV} \right)}}^{Proposed} = \left( {{\text{m}} + 1} \right)C_{msg}$$
(11)

where Cb and Cu are the size (Byte) of broadcast message and size (Byte) of unicast message respectively.

DSR protocol maintains at least one route from source to destination for each pair of users. So, DSR creates more overhead as compared to AODV but enables more reliability to download the file. Suppose there are average β numbers of routes for each pair of users. Using DSR protocol, the cost involved in selecting an appropriate route to the owner user to download a file is given below:

$$C_{{route\left( {DSR} \right)}}^{Proposed} = \beta \left( {C_{b} + mC_{u} } \right) = \beta C_{msg} \left( {m + 1} \right)$$
(12)

3.4 Lookup success rate (LSR)

Lookup success rate (LSR) is defined as the percentage of chance to find the desired file in an LPG or communication area. We have defined the lookup performance of the finger table for MR-Chord (Woungang et al. 2014), MobiStore (Khan et al. 2017) and proposed a scheme in terms of LSR. We consider m entries (chords) in the finger table, churn rate (CR) of a mobile user per unit time and λm is the mobility rate of a mobile user per unit time. We define the lookup success rate as the ratio (percentage) of the total number of active mobile users to the total number of mobile users (N) addressed with m-bit ID such that N × m ≤ 2m, where N is the total number of active users and m is the number of chords in the finger table. The LSR of MR-Chord (Woungang et al. 2014), MobiStore (Khan et al. 2017) and the proposed scheme are defined as follows:

$$LSR_{Proposed} = \frac{{\left( {N_{avg} + N_{bg} \times N_{avg} } \right) \times \left( {F_{Ref} - {\text{CR}}} \right) - \lambda_{m} \left( {N_{avg} + N_{bg} \times N_{avg} } \right)}}{{2^{\text{m}} }}$$
(13)

where Nbg is the number of bridges in an LPG and each bridge can communicate with maximum Navg number of mobile users in different LPGs such that Nbg ≤ Navg.

$$LSR_{MR - Chord} = \frac{{{\text{N}}\left( {{\text{m}} - {\text{CR}}} \right) + {\text{N}}\left( {\alpha - \lambda_{m} } \right)}}{{2^{\text{m}} }}$$
(14)
$$LSR_{MobiStore} = \frac{{{\text{N}}\left( {{\text{m}} - {\text{CR}}} \right) - {\text{N}}\lambda_{m} }}{{2^{\text{m}} }}$$
(15)

where 0 ≤ α ≤ m is the number of bad chords fixing in the finger table as defined in MR-Chord scheme (Woungang et al. 2014). The average number of files reference in file table (Table 3) per mobile user in proposed scheme is FRef.

3.5 Cost of downloading a file (CFile)

We have defined the cost of downloading a file in the proposed scheme using CFS. Suppose Fsize, Nd and Wavg are the file size, the number of available donors and average bandwidth (mb/s) available per donor respectively. The cost of downloading a file CFile (s) is expressed as follows:

$$C_{File} = \frac{{F_{size} }}{{N_{d} \times W_{avg} }}$$
(16)

3.6 Cost of storing/replicating files (CFile/Store)

The proposed scheme and MR-Chord (Woungang et al. 2014) apply a different procedure than MobiStore (Khan et al. 2017) to store the files. The proposed scheme and MR-Chord (Woungang et al. 2014) follow the same procedure to store the files as defined in Chord (Stoica et al. 2003). But in MobiStore (Khan et al. 2017), all the users replicate the file to improve the content availability. This procedure creates too much burden on the mobile users who have limited storage and limited processing capability. Replication of file to each mobile user appears to be infeasible or requires too many resources (bandwidth, storage, processing power, battery backup, etc.) in mobile P2P environment where resources are very limited.

Suppose Nf is the average number of files stored by each mobile user in MR-Chord (Woungang et al. 2014), MobiStore (Khan et al. 2017) and proposed scheme. The total memory space CFile/Store (in Mb) per user required to store the files is expressed as below:

$$C_{File/Store}^{Proposed} = N_{f} \times F_{size}$$
(17)
$$C_{File/Store}^{MR - Chord} = N_{f} \times F_{size}$$
(18)
$$C_{File/Store}^{MobiStore} = N_{avg} \times N_{f} \times F_{size}$$
(19)

4 Analytical modelling and performance analysis

In this section, we have expressed the different cost/overhead involved in existing schemes MR-Chord (Woungang et al. 2014) and MobiStore (Khan et al. 2017). Later in this section, we have analysed the performance of the proposed scheme, MR-Chord (Woungang et al. 2014) and MobiStore (Khan et al. 2017). Mobility management is a tough challenge in mobile P2P applications. So, in MR-Chord (Woungang et al. 2014) scheme, authors have proposed to fix the bad chord entries created by the mobility of users or other reasons. In MobiStore (Khan et al. 2017), authors have proposed the notion of P2P group and replication of files at each user in the group to enhance the availability of the files. In order to balance the load among users, intergroup transfer of user is also suggested. In both the schemes MR-Chord (Woungang et al. 2014) and MobiStore (Khan et al. 2017) communication area is wider and not limited to the communication range of a mobile user.

4.1 Cost of updating finger table and sharing

The cost of updating the finger table in MR-Chord (Woungang et al. 2014) is dependent on the number of files downloaded and entry update due to the mobility of mobile users. MR-Chord (Woungang et al. 2014) comprises procedures to fix bad chord entries in the finger table. In MobiStore (Khan et al. 2017), the finger table update cost depends upon the number of files downloaded, the mobility rate of mobile users and the number of nodes shifted from one group to another to balance the load among the groups. If λm is the mobility rate of a mobile user then its mean residence time in a communication area is \({\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 {\lambda_{m} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${\lambda_{m} }$}}\). Suppose the cost of updating the finger table once is Ct (sec) and Navg is the average of mobile users to upload or download files. We assume that each mobile user has at least one uplink and downlink capacity. So, a mobile user can receive maximum download from (N − 1) or (Navg − 1) mobile users where N is the total number of users. The maximum total cost of updating the finger table during residence time by each mobile user is expressed as below for MR-Chord (Woungang et al. 2014) and MobiStore (Khan et al. 2017):

$$C_{MobiStore}^{Total - Finger} = \frac{1}{{\lambda_{m} }}\left\{ {\frac{{\left( {N_{avg} - 1} \right) \times W_{avg} }}{{F_{Size} }} + N_{avg} \times \lambda_{m} + \frac{{N_{avg} }}{{T_{L} }} + \frac{N}{{T_{G} }}} \right\}C_{t}$$
(20)

where TL and TG are local and global finger table update interval respectively.

$$C_{MR - Chord}^{Total - Finger} = \frac{1}{{\lambda_{m} }}\left\{ {\frac{{\left( {N - 1} \right) \times W_{avg} }}{{F_{Size} }} + N \times \left( {\lambda_{m} - \alpha } \right)} \right\}C_{t}$$
(21)

where N and Navg are number of nodes in the communication area and average number of nodes in a group respectively.

The total messaging overhead incurred in sharing updated finger table in MobiStore (Khan et al. 2017) and MR-Chord (Woungang et al. 2014) per mobile user is expressed as below:

$$C_{MobiStore}^{Total - msg} = \frac{1}{{\lambda_{m} }}\left\{ {\frac{{\left( {N_{avg} - 1} \right) \times W_{avg} }}{{F_{Size} }} + N_{avg} \times \lambda_{m} + \frac{{N_{avg} }}{{T_{L} }} + \frac{N}{{T_{G} }}} \right\}C_{msg}$$
(22)
$$C_{MR - Chord}^{Total - msg} = \frac{1}{{\lambda_{m} }}\left\{ {\frac{{\left( {N - 1} \right) \times W_{avg} }}{{F_{Size} }} + N \times \left( {\lambda_{m} - \alpha } \right)} \right\}C_{msg}$$
(23)

4.2 Performance analysis

In this section, we have analyzed the performance of the proposed scheme and existing schemes MR-Chord (Woungang et al. 2014) and MobiStore (Khan et al. 2017). The values of the different parameters (Table 4) are taken in consistence with MR-Chord (Woungang et al. 2014) and MobiStore (Khan et al. 2017).

Table 4 Parameters and values

The residence time of a mobile user in the area of a circle with a 100 m radius has been illustrated in Fig. 4. The speed of the mobile user varies from 1 to 20 m/s and the mobility factor is considered zero (γ = 0). Referring to Fig. 5, the mobility factor (γ) varies from 0.1 to 1 and the speed of the mobile user varies from 1 m/sec to 20 m/s. We can observe from Fig. 5 that when γ = 0.1, the residence time of the mobile user is maximum in LPG with radius R = 100 m. But as γ increases, residence time decreases. This is because of the effect of the mobility factor over the residence time which is inversely augmented. It is also noticeable that when the speed of the mobile is higher (say V = 20 m/s) then the effect of γ over residence time is lesser as compared to speed. When γ = 1, the mobile user travels in a straight line most of the time and hence residence time in LPG is lowest. Referring to (1) to (4), the residence time in fluid flow and random waypoint mobility models is inversely proportionate to the speed but residence time in fluid flow model is less augmented as compared to RWP model. So, the residence time of the mobile user is less in fluid flow model as compared to RWP model.

Fig. 4
figure 4

Residence time of mobile user

Fig. 5
figure 5

Residence time of mobile user

The cost of updating the LPG table and Finger table has been illustrated in Fig. 6a, b. The number of mobile users in a group or LPG (Navg) varies from 2 to 10 in Fig. 6a and 10–50 in Fig. 6b. Other parameters like Ct = CLPG = 1 s, λm = 0.006, Wavg = 1 Mb/s, Fsize = 50 Mb, ρm = 0.9, Δt = 200 s, TL = 30 s, TG = 120 s and α = 0.006. Since the number of mobile users in an LPG is less than the total number of users in the communication area, therefore, the value of N is considered as six-times of Navg. If the value of N is 5-times of Navg then table update cost in MobiStore (Khan et al. 2017) and MR-Chord (Woungang et al. 2014) is almost equal.

Fig. 6
figure 6

a Table update cost. b Table update cost

The update cost in MobiStore (Khan et al. 2017) includes local update as well global update costs. The local update interval is 30 s whereas global update interval is 120 s as mentioned in MobiStore (Khan et al. 2017). MR-Chord (Woungang et al. 2014) includes global type update and it also includes bad chord fixing. File table is also updated when a file is completely downloaded in the proposed scheme, MR-Chord (Woungang et al. 2014) and MobiStore (Khan et al. 2017). The deviation time (Δt) is also added in LPG table update cost in the proposed scheme and it depends upon the probability ρm.

We have considered Δt = 200 s and ρm = 0.9. If ρm is higher, then Δt is lower and vice versa. The proposed scheme only includes the local update of LPG table when a user joins or leaves or a file is downloaded. So, the update cost in the proposed scheme is up to 79.55% and 75% less than MR-Chord (Woungang et al. 2014) and MobiStore (Khan et al. 2017) respectively.

The LPG and finger tables update cost while varying the mobility rate of the mobile user has been illustrated in Fig. 7. The mobility rate (λm) varies from 0.001 to 0.01 and other parameters, Ct = CLPG = 1 s, Wavg = 1 Mb/s, Fsize = 50 Mb, ρm = 0.9, Δt = 200 s, TL = 30 s, Navg = 10, N = 60, TG = 120 s and α = 0.006. Since the number of mobile users in an LPG is less than the total number of users in the communication area, therefore, the value of N is considered as 6-times of Navg. The table update cost in all three schemes proposed, MR-Chord (Woungang et al. 2014), and MobiStore (Khan et al. 2017) decreases as the mobility rate increases. When the mobility rate (λm) increases the residence time decreases.

Fig. 7
figure 7

Table update cost while varying mobility rate

So, when λm = 0.001, the residence time is 1000 s. So the local update, global update and the number of files downloaded are more and these enable more table update cost. Since the table update cost in the proposed scheme depends upon local update and number of files downloaded and hence it is up to 78.5% and 81.5% less than the cost involved in MR-Chord and MobiStore respectively. It is noticeable here that the local update of the finger table in MobiStore is periodic whereas in the proposed scheme it depends upon join/leave of a member.

The LPG and finger tables update cost while varying the communication range (R) of the mobile user has been illustrated in Fig. 8. The communication range (R) varies from 10 m to 100 m and other parameters, Ct = CLPG = 1 s, Wavg = 1 Mb/s, Fsize = 50 Mb, ρm = 0.9, Δt = 200 s, TL = 30 s, Navg = 10, N = 60, TG = 120 s, and α = 0.006. Since the number of mobile users in an LPG is less than the total number of users in the communication area, therefore the value of N is considered as 6-times of Navg. The update cost in the proposed scheme decreases as R increases up to 21 m but increases afterward using fluid flow mobility model. The update cost in the proposed scheme using RWP mobility model increases as R increases.

Fig. 8
figure 8

Table update cost while varying communication range

The update cost in MR-Chord and MobiStore increases as R increases using both the mobility models fluid flow and RWP. The growth rate of update cost in all the three schemes is more while using RWP mobility model as compared to fluid flow mobility model. It is due to the mobility pattern of the mobile user. In fluid flow model, the mobile user travels in a straight line with constant velocity whereas RWP model considers zigzag type mobility pattern and hence residence time is more in RWP model. When R increases then the residence time of mobile user also increases. It has been already explained in the previous illustration that when residence time increases then table update cost increases. The LPG table update cost in the proposed scheme is up to 79.5% and 80.55% less than cost incurred in MR-Chord and MobiStore respectively.

The LPG and finger tables update cost while varying the probability (ρm) to follow the mobility pattern by a mobile user, this has been illustrated in Fig. 9. The probability (ρm) varies from 0.1 to 1.0. It means that the chance of a mobile user to follow its mobility pattern varies from 10 to 100%. Other parameters, CLPG = 1 s, Wavg = 1 Mb/s, Fsize = 50 Mb, Navg = 10, λm = 0.006, and the time variation Δt≈(1-ρm)T, where T = 600 s. When ρm = 0.1, it means a mobile user follows its mobility pattern 10% and deviated from its mobility pattern 90%. So, LPG table update cost is more due to more deviation from the mobility pattern. When a mobile user follows its mobility pattern 90% (ρm = 0.9), its LPG update cost is less. It has been reported in existing work that mobile users in urban cities follow their mobility pattern up to 90% of the time (Ma et al. 2007). As per the parameters selected, the numbers of files downloaded and update cost thereafter is constant. So, the LPG table update cost in the proposed scheme has a trade-off with ρm.

Fig. 9
figure 9

Table update cost while varying probability (ρm)

The Lookup Success Rate (LSR) while the varying number of mobile users has been illustrated in Fig. 10. The number of users, Navg varies from 2 to 9 whereas N varies from 12 to 54. N has been considered 6-times more than Navg. Other parameters, m = Fref = 10, CR = 0.002 per unit time per user, λm = α=0.006 and 1 ≤ Nb≤Navg. Referring to Fig. 10, the minimum and maximum LSR of the proposed scheme has been shown. The LSR within an LPG without any bridge is the minimum LSR and LSR while considering all possibilities of bridges is the maximum. In an ideal situation, all users in an LPG can work as a bridge and facilitate inter LPGs communication. In ideal condition, Nb = Navg. It is obvious from Fig. 10, the LSR in MR-Chord and MobiStore is much higher (up to 83%) than the minimum LSR in the proposed scheme. The LSR in MR-Chord is a little bit higher than LSR in MobiStore. In an ideal condition, the maximum LSR in the proposed scheme is up to 40% higher than MR-Chord and MobiStore form Navg ≥ 5.

Fig. 10
figure 10

Lookup success rate (LSR) while varying N and Navg

One thing noticeable here that the feasibility of n-hop communication in mobile P2P networks. Mobile P2P networks are formed over Ad hoc Wireless Networks and users have mobility and frequently enter and cross the communication range. There are other limitations of Ad hoc Wireless Networks like limited battery backup, bandwidth, limited processing power, etc. Suppose there are 9 users in a communication area of 100 m circle. In other words, each LPG with a 100 m radius has 9 users. If there are 54 mobile users in the entire communication area, there may be 6 numbers of LPGs. At extended length, there may be 5-hop communication between first LPG and sixth LPG. Stability and maintenance of 5-hop communication links in ad-hoc wireless communication is very difficult. If we discard the mobility of the users then we may think of such n-hop communication. So, it is very much obvious that having n-hop communication links in mobile P2P networks is a challenging task and existing MR-Chord and MobiStore assume to have n-hop communication links.

The storage cost (memory) per user required for storing the files in the proposed scheme, MR-Chord and MobiStore has been illustrated in Figs. 11 and 12. Referring to Fig. 11, the number of files (Nf) varies from 1 to 10 while other parameters Navg = 10 and Fsize = 1 Mb. The Nf represents an average number of files stored by each mobile user in the mobile P2P network. The number of users in a group (MobiStore), Navg = 10 and every user stores every files in the group to enable higher LSR. So, the cost of storing files in MobiStore is Navg times more than the cost of storage in the proposed scheme and MR-Chord. The cost of storage per user while varying file size (Fsize) from 1 Mb to 100 Mb has been shown in Fig. 12. The cost of storage in MobiStore is Navg times more than the cost of storage in the proposed scheme and MR-Chord. So, it is obvious that the LSR in MobiStore is higher, but it comes at the cost of extra storage which is Navg times more. The storage size in mobile equipment is limited and hence we should select the replication strategy judiciously.

Fig. 11
figure 11

Storage cost per user while varying no. of files

Fig. 12
figure 12

Storage cost per user while varying file size

5 Conclusion

We have proposed an LPG communication scheme for structured mobile P2P networks. The mobility pattern of mobile users has been considered in the formation of LPG. Today, many mobile users follow a fixed mobility pattern while doing their jobs, business, etc. In urban cities, mobile users leave their home at a certain time and follow the same route to reach their workplace at a fixed time period. We have considered the mobility pattern of such users with certain time deviation. Each mobile user forms its own LPG based on its mobility and time periods. Size of an LPG is circular and it is the transmission range of the mobile user. Mobile users present in an LPG are known as members and stored in LPG table for reference. Each mobile user also stores the list of files stored by members of an LPG and it helps in the lookup process of the files. The cost of updating LPG table in the proposed scheme is up to 81% less than MR-Chord and MobiStore while varying the transmission range, mobility rate, number of users and probability of mobility pattern. The LSR is up to 40% higher than MR-Chord and MobiStore when the number of users Navg ≥ 5 and each mobile user can act as a bridge. Although the LSR in MobiStore is higher than the proposed scheme, it comes at a cost of extra storage which is Navg times more than the proposed scheme. We have analysed the proposed scheme and existing schemes like MR-Chord and MobiStore using fluid flow and RWP mobility models. Fluid flow model is useful when a mobile user travels in a straight line most of the time with uniform velocity whereas RWP is useful in zigzag type mobility. We have observed that residence time in an LPG using RWP model is more than fluid flow model. The intermittent nature of wireless links in mobile P2P networks and its effect over LSR and file download can be considered for future work.