Ad Hoc & Sensor Wireless Networks, Vol. 21, pp. 327–351 Reprints available directly from the publisher Photocopying permitted by license only
©2014 Old City Publishing, Inc. Published by license under the OCP Science imprint, a member of the Old City Publishing Group.
Fuzzy Inference-based Super Peer Selection for a Practical Double-layered Mobile Peer-to-peer System K WANG -J O L EE , JAE -H O C HOI AND S UNG -B ONG YANG Department of Computer Science, Yonsei University, Korea E-mail:
[email protected],
[email protected],
[email protected] Received: December 10, 2011. Accepted: May 15, 2012.
Mobile ad hoc networks have received increasing attention as mobile technology advances and more applications are developed. Mobile peerto-peer (P2P) systems are becoming useful in mobile network applications where installation of infrastructure may be difficult or even infeasible. To realize a mobile P2P system, the double-layered mobile P2P systems that consider both the mobility and energy status of users were introduced. Although the double-layered systems significantly reduce the network traffic, they cannot adequately handle ever changing mobile environments, since they use a fixed mobility-to-energy ratio for hybridization in periodic reconfigurations of the network. Moreover, to determine the optimal fixed ratio, every possible ratio of the two factors should be examined before the system is implemented. In this paper, we propose a more practical mobile P2P system that utilizes a fuzzy method with both mobility and energy as the fuzzy inputs. During each reconfiguration of the network, the proposed system selects super peers adaptively using the fuzzy method to more effectively reflect the current environment. The performance of the proposed system was compared with those of the previous works on the Network Simulator NS-3. Our proposed fuzzy-based system achieves almost the same performance as the fixed ratio system that delivers the optimal performance. A large number of experiments are required to determine the optimal fixed ratio for every single environment. Keywords: Peer-to-peer, mobility, energy, fuzzy, super peer, MANET
1 INTRODUCTION A mobile ad hoc network (MANET) is a collection of autonomous mobile nodes that are able to move freely and independently, forming a temporary
327
328
K WANG -J O L EE et al.
network without any infrastructure, such as base stations. Each node in a MANET acts as a router and communicates with other nodes. Because of its minimal configuration and rapid deployment, there are a large variety of MANET applications. For example, a MANET is suitable for emergency situations like natural disasters or military conflicts, where installing infrastructure may be difficult or even infeasible [10] [13]. A mobile peer-to-peer (P2P) file sharing system is yet another interesting application. In a MANET, since mobile nodes move freely, disconnections occur frequently and may lead to such problems as a low query success ratio and heavy communication traffic. These problems are critical in some MANET applications such as mobile P2P file sharing systems because a majority of users may not be eager to participate in a system with such problems. Consequently, much research has been conducted to overcome these system problems. The P2P file sharing systems in a MANET can be classified into two types, single-layered and double-layered systems. The optimized routing independent overlay network (ORION) is a typical single-layered system [9]. In the system, each peer node plays the same role during communications, including file searching. Above all, ORION shows a high query success ratio. However, it suffers from excessive network traffic because its communications are based on the flooding among all mobile peers. To alleviate the network traffic, double-layered systems have been proposed. In a double-layered system, peers are classified into two types, super peers (or cluster heads) and subpeers. Communications for file query processing in the system are performed among the super peers and some sub-peers who connect them; most sub-peers only communicate with their own super peers. Since super peers should execute more processing and communications for file sharing than sub-peers, they should be selected very carefully in the double-layered systems. Recently, a considerable amount of research has been conducted on the selection of super peers in double-layered systems [4] [7] [8]. The research focused on the mobility and energy of mobile peers to select the super peers in the systems. The philosophy behind the research is that the peers who move slowly and have more energy than other peers should become super peers in order to achieve more stable network connectivity. Our previous work [8] proposed a hybrid system in which both mobility and energy are simultaneously considered to select super peers. However, the hybrid system cannot properly handle the dynamic changes of the mobility and energy level of peers. The ratio of mobility to energy∗ is very important because the system performances (e.g., query success ratio, communication traffic, and life time of peers) are strongly related to the ratio. However, it is very difficult to ∗
Note that the ratio of mobility to energy is the ratio of their respective weights for hybridization, where the mobility of a peer is the cumulative sum of its moving distance within a certain period of time, and the energy is the remaining energy of a peer.
S UPER P EER S ELECTION
329
7#
7# 5#
4#
6#
6# 7#
5#
Time 100
6# 4#
7#
Time 150
5#
6#
4#
4#
5#
Time 200
Time 250
(a) mobility:energy = 8:2
7#
7# 4#
6#
5# 6#
7#
Time 100
5#
6# 4#
7#
Time 150
6# 4#
5#
Time 200
5#
4#
Time 250
(b) mobility:energy = 8:2 (at time 100), 4:6 (at time 200)
FIGURE 1 Importance of adaptive super peer selection
determine the optimal ratio of mobility to energy because the optimal ratio changes with time as the peers in a MANET move freely and the energy level of the peers diminishes. Figure 1 illustrates the importance of handling the dynamic changes of the mobility and energy level of peers. In the figure, the number in each small circle denotes a peer’s ID, and the circle indicates the communication area of a peer at its center. There are four illustrations of a network with four peers P1 , P2 , P3 , and P4 at time 100, 150, 200, and 250, respectively. In this example, the super peers are selected based on both the mobility and energy of each peer. In Figure 1(a), super peers are selected primarily based on the mobility (mobility:energy=8:2); P1 is selected as a super peer at time 100 and is reselected at time 200, assuming that P1 has the lowest mobility and network reconfiguration is performed every 100 time units. However, at time 250, P1 has exhausted all of its energy because super peers have to communicate more frequently than sub-peers and hence consume much more energy. Note that super peers mainly communicate with other super peers via some special sub-peers called r elay peer s in a double-layered mobile P2P system. Consequently, at time 250, the peers in Figure 1(a) fail to communicate with other due to the energy exhaustion of P1 . Such a problem can be avoided by selecting super peers with a different ratio of mobility to energy at time 200. In Figure 1(b), P1 is selected as a super peer based on the ratio of 8:2 at time 100, as in Figure 1(a). However, at time 200, P3 becomes a super peer at the ratio of 4:6, since energy becomes more crucial than mobility as time
330
K WANG -J O L EE et al.
goes by. As can be seen in Figure 2(b), if we can properly adjust the ratio at each network reconfiguration, more peers would be able to remain active for a longer period of time, resulting in a more robust network as well as a higher query success ratio. Based on this example, we believe that a pertinent ratio of mobility to energy should be adaptively determined at each network reconfiguration. With this intuition in mind, we devise a novel fuzzy-based method to determine the ratio. Because the fuzzy method can deal with uncertainties in the system parameters, it can be used adaptively to determine the ratio. In our method, each mobile peer calculates the ratio periodically and independently to adaptively change the ratio. Our fuzzy method consists of three steps: fuzzification, fuzzy inference, and defuzzification. Both the mobility and energy of peers are used as the fuzzy inputs. The proposed method adaptively adjusts the ratio based on the fuzzy outputs computed in accordance with the state of each mobile peer. We also propose a practical double-layered mobile P2P system which utilizes the novel fuzzy inference method. The technical contributions of this paper can be summarized as follows:
r A novel fuzzy inference system: Devise a novel fuzzy-based method to adaptively determine the ratio of mobility to energy at each network reconfiguration. r A practical double-layered mobile P2P system: We propose an effective mobile P2P system in a MANET that utilizes the novel fuzzy inference method. r Verification of the proposed method: For evaluation purposes, we implement the proposed system and its competitors using the Network Simulator NS-3 and accurately evaluate the systems. The remainder of this paper is organized as follows. Sections 2 briefly describes the related mobile P2P systems as well as our previous works. Section 3 describes our system model, and the proposed fuzzy method and system are presented in Section 4. Section 5 evaluates the performance of the proposed system. Finally, Section 6 concludes the paper.
2 RELATED WORKS 2.1 Single-layered Mobile P2P System A single-layered mobile P2P system is a pioneering P2P system in a MANET. One of the typical single-layered P2P systems in a MANET is ORION, in which each peer has two tables, a routing table and a file routing table. Note that a routing table is similar to the ad-hoc on-demand distance vector
S UPER P EER S ELECTION
331
(AODV) [12] and also contains a local file table whose entries are the files (data items) that it currently contains. The file routing table stores the I Ds of the peers who hold the files that the current peer does not have. However, ORION results in excessive network traffic because its communications are based on the flooding among all peers. This leads to a considerable amount of traffic as the number of peers increases in the network, thus overloading the network very quickly. 2.2 Double-layered Mobile P2P Systems Figure 2 illustrates a simple example of a double-layered mobile P2P system, showing the connections between two neighboring super peers and their subpeers. The solid lines in the figure represent management connection lines between a super peer and each of its sub-peers; these connections form a cluster . A dotted line indicates a relay connection line which links two super peers in different clusters. In a double-layered P2P system, most of the communications are performed between super peers and relay peers so that the network traffic of the system can be reduced to avoid network flooding. In the system, the entire network should be periodically updated by selecting new super peers and their sub-peers as well as establishing routing paths to reflect the current locations of the peers in the network. We call such a reconfiguration of the network a networ k update. There are three types of double-layered systems: the MIS system [4], the MOB system [7], and the Hybrid system [8]. Each system has a different method for super peer selection during a network update. Suppose that P7 wants a file owned by P9 . First, P7 sends a query to its super peer P1 . If P1 or one of the peers in its cluster (i.e., P4 or P8 ) also has the file, P1 sends a response message to P7 . Note that a super peer maintains the information regarding the files owned by the peers in its cluster. Otherwise,
3
4 1
7
5
2
9
8
relay connection line management connection line FIGURE 2 Routing paths between a pair of super peers
: super peer : sub-peer : relay peer
332
K WANG -J O L EE et al.
P1 sends the query to the relay peers, i.e. P5 so that it can send it to the neighboring super peer. Thus P4 sends the query to another relay peer P3 , which then sends it to super peer P2 , which also receives the message from relay peer P5 . Finally, super peer P2 sends a response message to P7 via back tracing, to convey that P9 has the target file. The Maximal Independent Set (MIS) System In the MIS system, random numbers are used for selecting super peers with the Luby’s randomized maximal independent set algorithm discussed in [11]. For super peer selection, each peer simultaneously chooses a random number. The peer with the largest random number is selected as a super peer, and its neighboring peers become its sub-peers. Afterward, the same selection process is repeated with the rest of peers until each peer in the network is assigned as either a super peer or a sub-peer. Upon completion of the super peer selection, the relay peers should be determined in order to establish the routing paths among the super peers. To do so, each sub-peer P broadcasts a request message to its neighboring peers outside of its cluster—each of these peers is either a super peer or a subpeer managed by other super peer—to obtain the information about the super peer that can be linked. If a super peer receives the message, then it sends its information back to P. When a sub-peer receives the message, it sends the information about itself and its super peer to P. Then, P reports all the information to its super peer. After each super peer collects all the information from its sub-peers, it selects some of its sub-peers as relay peers to connect to other neighboring super peers and stores the routing paths associated with the relay peers in its routing table. The Mobility (MOB) System The MOB system considers the mobility of each peer for super peer selection, where the mobility of a peer is computed as the total moving distance between two consecutive network updates. In this system, the peer who has the lowest mobility among neighboring peers is selected as a super peer. Suppose that a peer has very high mobility. If the peer happens to be a sub-peer, then it may cause a local reliability problem. But if the peer is a super peer, the problem will affect a much larger area of the network. For super peer selection during a network update, each peer calculates its own mobility. As in the MIS system, each peer sends its mobility value to its neighbors and receives the values from them. The peer with the lowest mobility value becomes a super, peer and other neighboring peers become its sub-peers. This process is repeated until all the peers in the network become either super peers or sub-peers. The process of determining relay peers is the same as that of the MIS system.
S UPER P EER S ELECTION
333
The MOB system improves the network reliability by enhancing the stability of clusters. Lower mobility of a super peer contributes to the robustness of clusters in the system. The experimental results in [7] showed that the MOB system outperformed other systems without considering energy in terms of the query success ratio. The Hybrid System A double-layered P2P system may select super peers considering both mobility and energy. In the Hybrid system [8], each peer computes a value, the h-value, with the following equation. h-value = w1 × M + w2 × E, wher e current mobility , M = 1.0 − maximum mobility remaining energy E= , maximum energy w1 + w2 = 1.0, and w1 , w2 > 0.
(1)
In the above equation, w1 and w2 are the weights for hybridization, M is a normalized value for mobility, the curr ent mobility is the moving distance during the time period between the previous network update and the current network update, and the maximum mobility is the largest mobility value over all time periods. Each peer computes Equation (1) using its mobility value and energy level to obtain its h-value just before each network update. The peer with the largest h-value among neighboring peers becomes a super peer. If w1 > w2 , mobility is considered a more important factor than energy, and vice versa. Although the Hybrid system seems to be more realistic than the aforementioned systems, the optimal ratio is extremely time-consuming to obtain since extensive experiments should be performed for a given mobile environment. Above all, such optimal ratios themselves may not guarantee the best performance for different environments in the real world because environments change dynamically and sometimes unpredictably.
3 SYSTEM MODEL A double-layered P2P system has two layers, the upper layer and the lower layer. The peers in the upper layer are called super peer s. Each super peer manages its neighboring sub- peer s in the lower layer. Each super peer maintains a route table for routing paths and a file table whose entries contain the
334
K WANG -J O L EE et al.
ID, address, and file list of each of its sub-peers. A super peer sends a query message to neighboring super peers via relay peers, each of which connects a pair of neighboring super peers. Note that a relay peer is itself a sub-peer who is managed by a super peer. In this paper, we assume that each peer has local memory space and acts as a data provider of several data items and as a data consumer. Each peer holds some data items and does not update the shared data items. There are three possible roles that a peer can play: a super peer, a sub-peer, or a relay peer. Roles are periodically changed by the negotiation. There are m peers P1 , P2 , P3 , ..., Pm and no central server for controlling the peers. Every peer participates in creating a MANET. We make the following assumptions for our double-layered P2P system.
r Each peer and each data item in a MANET has a unique identifier. All r r r
r
r r
peers in the MANET are denoted by P = {P1 , P2 , P3 , ..., Pm }, where m is the total number of peers. Each peer acts in one of the three roles—a super peer, a sub-peer, or a relay peer. Sub-peers and relay peers are supposed to issue queries to their own super peers. Super peers are selected periodically based on the negotiation of all peers. After super peers are selected, relay peers are selected among sub-peers to connect neighboring super peers. We assume that the network update time is synchronized. This assumption is for the sake of simplicity; that is, we do not have to address the synchronization problem in this paper. This assumption is widely accepted in MANET environments [2] [7] [15] [5]. At each network update time, super peers are selected and the network is reorganized. Data items are not updated. This assumption is for the sake of simplicity (i.e., we do not have to address data consistency or currency issues). Many applications satisfying this feature have been introduced in previous research [9] [7] [2]. Each peer moves freely within the maximum speed range, varying from 1 m/s to 5 m/s for the simulation. Notice that 5 m/s is considered to be the maximum running speed of human. Each peer has limited energy and memory space to hold data items. This assumption is widely accepted in the literature [3] [8].
For query processing in the system, suppose that a peer P1 issues a query to find a file. If P1 is a super peer, the query is sent to neighboring super peers via relay peers. Otherwise, if P1 is either a sub-peer or a relay peer, the query is sent to P1 ’s super peer. If a peer who owns the target file receives the query, it sends a response message to P1 by back tracing the path. If P1 receives the
S UPER P EER S ELECTION
335
response, the query processing is regarded as being ‘successful.’ Otherwise, it fails. Note that the query processing is finished at the moment when P1 receives the first positive response.
4 THE PROPOSED SYSTEM 4.1 Overview The proposed double-layered mobile P2P system adaptively determines the ratio of mobility to energy. At each network update, the proposed system determines super peers among all peers in a MANET utilizing a fuzzy inference mechanism which is suitable for obtaining the degrees of mobility and energy for the ratio. Our fuzzy inference system consists of three steps: fuzzification, fuzzy inference, and defuzzification. In the first step, each peer converts its own input values, called crisp values (i.e., its mobility and energy values), into the membership degrees of the fuzzy sets. In the second step, each peer performs the fuzzy inference based on a set of i f -then rules with the membership degrees obtained in the fuzzification step. The last step is defuzzification, in which the results of the fuzzy inference are converted into a crisp value which is a degree of fitness for being a super peer. Our system is based on the Mamdani fuzzy inference system [6], the most common fuzzy methodology. 4.2 Fuzzification Fuzzification is performed to use the inputs to determine the degrees of membership for the appropriate fuzzy sets, each of which is characterized by a membership function. In our system, there are two inputs, mobility and energy, and three fuzzy sets, high, medium, and low, for each input. An input is a crisp numerical value limited to the universe of discourse of the input (in our case, the interval between 0 and 500 for mobility and the interval between 0 and 100 for energy), and the output is a set of membership degrees in the fuzzy sets, where a membership degree is always between 0 and 1. Note that the maximum value of mobility is set to 500 m, since we assume that 5 m/s is the maximum speed of a peer, the period between two consecutive network updates is 100 sec, and the maximum value of energy is 100 since the maximum energy of a peer is 100 J. Fuzzification, therefore, provides an answer to the question “to what extent is a peer suitable to act as a super peer?” Figure 3 gives the answers to the question (rated on a scale of 0 to 500) via three membership functions of mobility. For example, a mobility of 100 m, given our graphical definition of mobility membership functions, corresponds to μlow = 0.8, μmedium = 0.4, and μhigh = 0.2, where μ is a membership function.
336
K WANG -J O L EE et al.
Membership degree
1 high
0.8
medium low
0.6 0.4
0.2 0 0
100
200 300 400 mobility(m)
500
FIGURE 3 The mobility membership functions
Fuzzification of an input usually amounts to either a table lookup or a function evaluation. When defining (membership) functions, there are several methods such as triangular , trapezoidal, Gaussian, and generali zed bell membership functions [6]. Although each has its own merits, we use the triangular membership function formulation because it is the most lightweight method, since our fuzzy inference system operates on mobile devices. Note that the membership function graphs in Figure 3 are defined according to Equation (2). ⎧ ⎨ 500 − x , 0 ≤ x ≤ 500 μlow (x) = 500 ⎩0 , 500 ≤ x ⎧ ⎪ 0 ,x ≤ 0 ⎪ ⎪ ⎪ x ⎪ ⎪ , 0 ≤ x ≤ 250 ⎪ ⎨ 250 μmedium (x) = ⎪ 500 − x ⎪ ⎪ , 250 ≤ x ≤ 500 ⎪ ⎪ 250 ⎪ ⎪ ⎩0 , 500 ≤ x ⎧ ⎨0 , 500 ≤ x μhigh (x) = x ⎩ , 0 ≤ x ≤ 500 500
(2)
The above functions are based on the triangular membership function formulation (TMFF) [6] [14], specified by three parameters, a, b, and c as follows: ⎧ 0 ⎪ ⎪ ⎪ ⎪x − a ⎪ ⎪ ⎨ b−a triangle(x; a, b, c) = c −x ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩c − b 0
,x ≤ a ,a ≤ x ≤ b ,b ≤ x ≤ c ,c ≤ x
, wher e a < b < c
(3)
S UPER P EER S ELECTION
337
Membership degree
1
high medium low
0.8 0.6 0.4
0.2 0 0
20
40 60 energy(J)
80
100
FIGURE 4 The energy membership functions
Similarly, we can obtain the energy membership functions based on TMFF as below. ⎧ ⎨ 100 − x , 0 ≤ x ≤ 100 μlow (x) = 100 ⎩0, 100 ≤ x ⎧ ⎪ 0, x ≤ 0 ⎪ ⎪ ⎪ x ⎪ ⎪ ⎪ ⎨ 50 , 0 ≤ x ≤ 100 μmedium (x) = (4) ⎪ 100 − x ⎪ ⎪ , 50 ≤ x ≤ 100 ⎪ ⎪ 50 ⎪ ⎪ ⎩0, 100 ≤ x ⎧ ⎨0, 100 ≤ x μhigh (x) = x ⎩ , 0 ≤ x ≤ 100 100 For example, an energy of 40 J corresponds to μlow = 0.6, μmedium = 0.8, μhigh = 0.4 for the energy membership functions in Figure 4. 4.3 Fuzzy Inference Fuzzy inference is the reasoning step for the fuzzy values (membership degrees) based on the r ules. In our previous works [4] [7] [8], we observed that slow peers with high energy should be super peers. Based on this observation, our fuzzy i f -then rules have been developed. Generally, a fuzzy i f then rule is expressed as “if x is A, then y is B,” where A and B are linguistic values (good, fair, and bad) defined by the fuzzy sets. The i f -then rules for the fuzzy inference of our system are defined below:
r rule 1: If mobility is low, then the result is good. r rule 2: If mobility is medium, then the result is fair.
338
r r r r
K WANG -J O L EE et al.
rule 3: If mobility is high, then the result is bad. rule 4: If energy is high, then the result is good. rule 5: If energy is medium, then the result is fair. rule 6: If energy is low, then the result is bad.
For the above rules, we associate a variable called control with the result, indicating the suitability of a peer to become a super peer. The control variable has three linguistic values; good, fair, and bad. For defining the control membership functions for these linguistic values, we also use TMFF. The control membership functions are given in Equation (5), and their corresponding graphs are shown in Figure 5. μbad (x) =
1 − x, 0 ≤ x ≤ 1
0, 1 ≤ x ⎧ ⎪ ⎪ ⎪0, x ≤ 0 ⎪ ⎨ x ,0 ≤ x ≤ 1 μ f air (x) = 0.5 ⎪ 1−x , 0.5 ≤ x ≤ 1 ⎪ 0.5 ⎪ ⎪ ⎩0, 1 ≤ x 0, 1 ≤ x μgood (x) = x, 0 ≤ x ≤ 1
(5)
In our fuzzy inference system, we apply the min-max inference of the Mamdani fuzzy inference system in which the AND (minimization) and the OR (maximization) operations are used. Because the decisions are based on the
Membership degree
1
good fair bad
0.8 0.6 0.4
0.2 0 0
0.2
FIGURE 5 The control membership functions
0.4 0.6 Control
0.8
1
1
1
0.9
0.9
0.8
0.8 Membership degree
Membership degree
S UPER P EER S ELECTION
0.7 0.6 0.5 0.4 0.3
0.7 0.6 0.5 0.4 0.3
0.2
0.2
0.1
0.1
0
339
0 0
50 100 150 200 250 300 350 400 450 500 mobility(m) (a)
0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Control (b)
FIGURE 6 Result of applying rule 1 with μlow = 0.8 of mobility
1
1
0.9
0.9
0.8
0.8 Membership degree
Membership degree
testing of all the rules in the system, the fuzzy sets, each of which represents the truncated output function of each rule, are combined into a single fuzzy set using the OR operation. This combining process is called aggr egation. Since we have two input variables, mobility and energy, aggregation is performed for the results produced by applying six rules with respect to each variable. The results of both aggregations are then combined to produce the final fuzzy set using the AND operation. For example, if a peer has mobility 100 m and energy 40 J, then the peer finds that μlow = 0.8, μmedium = 0.4, μhigh = 0.2 for mobility and μlow = 0.6, μmedium = 0.8, μhigh = 0.4 for energy by performing fuzzification. Next, the peer applies rule 1 with μlow = 0.8 of mobility. Figure 6 shows how to apply rule 1 when mobility is low; the shaded area in Figure 6(b) is obtained with the AND operation. Similarly, Figures 7 – 11 show the results of applying rules 2 – 6 when μmedium = 0.4, μhigh = 0.2 of mobility and when μhigh = 0.4, μmedium = 0.8, of energy, μlow = 0.6. The peer now can compute the shaded
0.7 0.6 0.5 0.4 0.3
0.7 0.6 0.5 0.4 0.3
0.2
0.2
0.1
0.1
0
0 0
50 100 150 200 250 300 350 400 450 500 mobility(m) (a)
0
FIGURE 7 Result of applying rule 2 with μmedium = 0.4 of mobility
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Control (b)
K WANG -J O L EE et al.
1
1
0.9
0.9
0.8
0.8 Membership degree
Membership degree
340
0.7 0.6 0.5 0.4 0.3
0.7 0.6 0.5 0.4 0.3
0.2
0.2
0.1
0.1 0
0 0
50 100 150 200 250 300 350 400 450 500 mobility(m) (a)
0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Control (b)
0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Control (b)
0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Control (b)
1
1
0.9
0.9
0.8
0.8 Membership degree
Membership degree
FIGURE 8 Result of applying rule 3 with μhigh = 0.2 of mobility
0.7 0.6 0.5 0.4 0.3
0.7 0.6 0.5 0.4 0.3
0.2
0.2
0.1
0.1
0
0 0
10 20 30 40 50 60 70 80 90 100 energy(J) (a)
1
1
0.9
0.9
0.8
0.8 Membership degree
Membership degree
FIGURE 9 Result of applying rule 4 with μhigh = 0.4 of energy
0.7 0.6 0.5 0.4 0.3
0.7 0.6 0.5 0.4 0.3
0.2
0.2
0.1
0.1 0
0 0
10 20 30 40 50 60 70 80 90 100 energy(J) (a)
FIGURE 10 Result of applying rule 5 with μmedium = 0.8 of energy
1
1
0.9
0.9
0.8
0.8 Membership degree
Membership degree
S UPER P EER S ELECTION
0.7 0.6 0.5 0.4 0.3
341
0.7 0.6 0.5 0.4 0.3
0.2
0.2
0.1
0.1 0
0 0
10 20 30 40 50 60 70 80 90 100 energy(J) (a)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Control (b)
FIGURE 11 Result of applying rule 6 with μlow = 0.6 of energy
1 0.9 Membership degree
0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Control
FIGURE 12 Aggregation of the results in Figures 6(b) – 8(b)
1 0.9 Membership degree
0.8 0.7 0.6 0.5
0.4 0.3 0.2 0.1 0 0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Control
FIGURE 13 Aggregation of the results in Figures 9(b) – 11(b)
area in Figure 12 through the aggregation process of the results in Figures 6(b) – 8(b); note that the OR operations are performed at this time. Similarly, Figure 13 is obtained by the aggregation of the results in Figures 9(b) – 11(b). Finally the peer calculates the shaded area in Figure 14(b) by performing the AND operation on the shaded areas of Figures 12 and 13.
K WANG -J O L EE et al. 1
1
0.9
0.9
0.8
0.8 Membership degree
Membership degree
342
0.7 0.6 0.5
0.4 0.3
0.7 0.6 0.5 0.4 0.3
0.2
0.2
0.1
0.1 0
0 0
0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Control (a)
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Control (b)
FIGURE 14 The final fuzzy set obtained by the aggregation of Figures 12 and 13
4.4 Defuzzification Defuzzification—which is the reverse process of fuzzification—is conducted to produce a quantifiable result in fuzzy logic, given a fuzzy set, as shown in Figure 14(b). Notice that, in this figure, we do not use the shaded area but do use the curve on the upper boundary of the area. The membership degrees of the fuzzy set are interpreted into a specific value during the defuzzification process. For the defuzzification in our system, we use the center of gravity (COG), which is one of the most common and useful techniques for defuzzification. Using the COG, each peer computes an f -value using Equation (6). This value is used for super peer selection during each network update. s × degr ee(s) , f -value = degr ee(s)
(6)
where s is a sample point of control, and degree(s) is the membership degree of control at s. For computing a f -value, first, we should decide the number of sample points. For our fuzzy system, we use 100 sample points {0.01, 0.02, 0.03, ..., 1.0}. Table 1 shows the sampling results using ten sample points {0.1, 0.2, ..., 1.0} for the sake of simplicity. Note that each degr ee(s) in the table
s degree(s)
0.1 0.2
TABLE 1 Sampling results
0.2 0.4
0.3 0.4
0.4 0.4
0.5 0.5
0.6 0.6
0.7 0.6
0.8 0.4
0.9 0.4
1.0 0.4
S UPER P EER S ELECTION
343
is obtained from Figure 14(b); that is, for each s on the x-axis, we obtain the corresponding membership degree on the y-axis. The f -value for the example is 0.58, as shown below. (0.1 × 0.2 + 0.2 × 0.4 + ... + 1.0 × 0.4) (0.2 + 0.4 + ... + 0.4) 2.49 = 0.58 = 4.30
f -value =
(7)
Table 2 shows the super peer selection values (h-values and f -values) of the peers in Figure 1 for the Hybrid (mobility:energy = 8:2) and Fuzzy systems. In the table, ‘mob,’ ‘eng,’ and ‘val’ indicate mobility, energy, and a value for super peer selection, respectively. The larger is a peer’s value, the more suitable it is to be super peer. Recall that a network update is performed every 100 seconds. In the Hybrid system, P1 is selected as a super peer at time 100 and is reselected at time 200 because its value is greater than those of other peers at each time. Observe that P1 exhausts its energy at time 250 due to excessive serve time as. However in the Fuzzy system, we can avoid such a problem since P3 becomes a super peer at time 200 instead of P1 , as shown in Table 2(b). In the above example, we use the values (h-value and f -value) for super peer selection for the systems. During each network update period, the peer with the largest value among neighboring peers becomes a super peer. The
(a)
Hybrid system (mobility:energy = 8:2)
Time 100 P1 P2 P3 P4
mob 10 120 200 420
eng 90 95 95 98
Time 150 val 0.96 0.80 0.67 0.32
P1 P2 P3 P4
mob 24 65 70 210 (b)
Time 100 P1 P2 P3 P4
mob 10 120 200 420
eng 90 95 95 98
Time 200 eng 60 80 75 80
P1 P2 P3 P4
P1 P2 P3 P4
mob 24 65 70 210
eng 35 60 70 75
val 0.79 0.68 0.78 0.39
P1 P2 P3 P4
mob 20 65 80 170
eng 0 60 50 70
Fuzzy system
Time 150 val 0.69 0.68 0.65 0.57
mob 50 150 100 350
Time 250
Time 200 eng 60 80 75 80
P1 P2 P3 P4
mob 50 150 100 350
TABLE 2 Super peer selection values in the Fuzzy and Hybrid systems
eng 35 60 70 75
Time 250 val 0.61 0.62 0.64 0.56
P1 P2 P3 P4
mob 20 65 80 170
eng 20 50 60 70
344
K WANG -J O L EE et al.
relay peer selection and file query processing of the proposed fuzzy system are exactly the same as those of other double-layered systems. 5 EXPERIMENTAL RESULTS 5.1 Experimental Environments The experiments were performed using a mobile network simulation tool, the Network Simulator NS-3 v3.10 [1]. In the simulation, the number of peers is set to 100. The maximum speed of peers varies from 1 m/s to 5 m/s. The network area is a 1,000 m × 1,000 m flat area. The communication range of a peer is set to 130 m and the channel type is set to the YansWifiChannelHelper [1]. The movement patterns of peers follow the random waypoint model [16]. Our power consumption is based on the NS-3 default values; power consumption on the NS-3 is based on the CC2420 ratio chip with 17.5mA for TX, 18.8mA for RX, and 4.26mA for IDLE [1]. Each peer is supposed to measure its mobility every 10 seconds and accumulates the value during each 100 second period. The energy level is measured right before each network update so that each peer can compute its super peer selection value. The super peers are selected every 100 seconds based on the computed values such as f -value, h-value, mobility, energy, and a random number, depending on the systems. For query processing, a peer is randomly selected with a uniform distribution for issuing one query per second, and the file to be searched is also randomly chosen; hence, there were a total of 1,000 queries. The simulation parameters and their values are summarized in Table 3.
parameter
value
(m 2 )
network area number of peers communication range (m) maximum speed of a peer (m/s) simulation period (sec) network update period (sec) period of calculating values (sec) number of files in a peer channel type network interface energy consumption (mA) query issue rate (query/sec) TABLE 3 Experimental environment
Send Receive Idle
1,000 × 1,000 100 130 1∼5 1,000 100 10 5 YansWifiChannel WIFI PHY STANDARD 80211g 17.50 18.80 4.26 1
S UPER P EER S ELECTION
345
During 1,000 seconds, we simulate and compare the proposed system with the following double-layered P2P systems. Note that we tested 25 different datasets for each system, and the average values were obtained as the experiment results; 25 datasets were generated from five different speed patterns with five random seeds.
r MIS: The random numbers chosen by the peers are compared to select super peers using the Luby’s MIS algorithm.
r MOB: The accumulated mobility, the total moving distance during the specified time period, is compared for super peer selection.
r ENERGY: Super peers are selected in the same way as in MOB, except that the current energy of each peer is used instead of mobility.
r HYBRID: Super peers are selected according to h-value obtained from a fixed ratio of mobility to energy, e.g., mobility and energy are 0.42 and 0.58, respectively; this ratio showed the best overall performance in [8]. We evaluate the proposed fuzzy system (FUZZY) and its competitors using the following five performance metrics introduced in the traditional works [4] [7] [8]:
r Success ratio: This is the ratio of the number of successful queries to the r r r r
total number of issued queries by all peers in the system. When a peer issues a query and receives a response, the query is said to be “successful.” Number of exhausted peers: This is the total number of peers with no energy. Query overhead: This is the total number of packets for the entire query process, as described in Section 2. Update overhead: This is the total number of packets required for updating the network during the entire simulation. System warm-up time: This is the time for determining the system parameters (i.e., the maximum speed of peers, the maximum energy of peers, and the optimal ratio of mobility to energy) of the double-layered P2P system in our simulation environments.
The processing overhead for selecting supers peers in each system (i.e., MIS, MOB, ENERGY, HYBRID and FUZZY) is negligible because each peer measures its own energy level and cumulative moving distance without any communication with other peers. In our system, each peer needs to compute a fuzzy value ( f -value) based on its own energy level and cumulative moving distance. However, the f -value is used to compute the COG, and its computation time depends on the number of sampling points, not on the number of nodes. Hence, its time complexity can be regarded as O(1) time.
346
K WANG -J O L EE et al.
70
60
60
50
50
Success Ratio(%)
40 MIS MOB ENERGY HYBRID FUZZY
10
(a) Maximum speed = 1 m/s
Success Ratio(%)
35 30 25 MIS MOB ENERGY HYBRID FUZZY
10 5
(c) Maximum speed = 5 m/s
FIGURE 15 Success ratio with varying maximum peer speeds
950
1000
900
850
800
Time (Seconds)
750
700
650
600
550
500
450
400
350
300
250
0 200
950
900
1000
850
800
750
700
650
(b) Maximum speed = 3 m/s
40
15
600
Time (Seconds)
45
20
550
500
450
0 200
950
900
Time (Seconds)
1000
850
800
750
700
650
600
550
500
450
400
350
300
250
200
0
400
10
MIS MOB ENERGY HYBRID FUZZY
20
350
20
30
300
30
40
250
Success Ratio(%)
5.2 Simulation Results Success ratio We first evaluate the query success ratio by varying the maximum speed of mobile peers from 1 m/s to 5 m/s. Note that we omit the graphs for 2 m/s and 3 m/s from Figure 15 and from Figures 16 – 18 due to the page limit. Our intuition is that FUZZY shows the best performance when the mobility of peers is medium—when the maximum speed is 3 m/s. The reason is that either mobility or energy is highly likely to be a dominating factor on the query success ratio when the mobility of peers is high or low, respectively. We also expect that the success ratio will decrease as the simulation progresses because the number of exhausted peers inevitably increases. The intuition and expectation are confirmed by the results in Figure 15. FUZZY shows an improved performance in most cases; in particular, when the maximum speed is 3 m/s, FUZZY outperforms all the competitors. However, when the maximum speed is 5 m/s, HYBRID and MOB give better success ratios than FUZZY for about half of the simulation. When the mobility is dominant over energy. Peers with lower mobility are likely to be repeatedly chosen as super peers; hence, their success ratios drop faster than that of FUZZY. However, during the entire simulation, FUZZY shows an overall satisfactory performance. On the average, FUZZY improves the success
S UPER P EER S ELECTION 50 40
35 30
MIS MOB ENERGY HYBRID FUZZY
40 Number of Exhusted Peer
25 20
15 10
35 30 25
20 15 10 5
5 0
Number of Exhusted Peer
950
900
1000
850
800
750
700
650
600
550
500
450
400
350
Time (Seconds)
(a) Maximum speed = 1 m/s 35
300
200
950
900
1000
850
800
750
700
650
600
550
500
450
400
350
300
250
200
0 Time (Seconds)
250
Number of Exhuasted Peer
45
MIS MOB ENERGY HYBRID FUZZY
45
347
(b) Maximum speed = 3 m/s
MIS MOB ENERGY HYBRID FUZZY
30 25
20 15 10 5
950
1000
900
850
800
Time (Seconds)
750
700
650
600
550
500
450
400
350
300
250
200
0
(c) Maximum speed = 5 m/s
FIGURE 16 The number of exhausted peers with varying maximum peer speeds.
ratio by 10.07%, 9.03%, 3.87%, and 0.75% over MIS, MOB, ENERGY, and HYBRID, respectively. Notice that the shapes of the curves in Figure 15 are similar to one other; each curve oscillates up and down repeatedly, although it declines as the simulation progresses. Each curve increases right after each network update since the network has been reconfigured. However since peers continue to change, the curve will eventually decrease until the next network update. Similar curve shapes can be seen in Figure 16—although they ascend—due to the same effect of network updates. Number of exhausted peers The number of exhausted peers is the cumulative number of ‘dead’ peers. In the beginning of our simulation, 100 peers have 100 J of energy each. As time goes by, peers with no energy appear due to energy consumption in communications. We obtained the average number of ‘exhausted’ peers in each system, varying the maximum speed from 1 m/s to 5 m/s. Figure 16 compares the numbers of exhausted peers of the systems when the maximum speeds are 1 m/s, 3 m/s, and 5 m/s. We expect that FUZZY has more exhausted peers than other systems because higher successful query processing requires more energy consumption. Figures 16(a) and (b) confirm our intuition. However,
348
K WANG -J O L EE et al.
interestingly, when the maximum speed is 5m/sec, the number of exhausted peers in FUZZY is smaller than those in MOB and HYBRID before 800 seconds; that is, slow peers in both MOB and HYBRID systems are exhausted in the earlier stage of the simulation due to more frequent network communication compared to that of fast peers. Figure 15 (c) shows that the MOB system has lower success ratios after 400 seconds because there are more exhausted peers. Lower success ratios can be interpreted as fewer communications, which results in less energy consumption. Hence, after 800 seconds, MOB has fewer exhausted peers than FUZZY, as shown in Figure 16 (c). On the average, FUZZY shows 23.59%, 2.43%, and 23.31% more live peers than MIS, MOB, and ENERGY, respectively, although FUZZY has 2.70% more exhausted peers than HYBRID. Query overhead Query overhead is measured by counting all packets issued for the entire query processing during the simulation. Figure 17 shows the average query overhead in terms of the number of packets. We expect that FUZZY will incur more query overhead because of its higher success ratio. In figure 17, ENERGY shows more query overhead than FUZZY because there are more live peers in ENERGY and they process more queries. On average, FUZZY
37000 QueryOverhead (Packets)
Query Overhead (Packets)
37000 35000 33000 31000 29000 27000 25000
35000 33000 31000 29000 27000 25000
MIS
MOB
ENERGY HYBRID
FUZZY
MIS
(a) Maximum speed = 1 m/s
MOB
(b) Maximum speed = 3 m/s
Query Overhead (Packets)
37000 35000 33000 31000 29000 27000 25000 MIS
ENERGY HYBRID
MOB
ENERGY HYBRID
(c) Maximum speed = 5 m/s
FIGURE 17 Query overhead with varying maximum peer speeds
FUZZY
FUZZY
9000
9000
8500
8500
Update Overhead (Packets)
Update Overhad (Packets)
S UPER P EER S ELECTION
8000
7500 7000 6500 6000
349
8000
7500 7000 6500 6000 5500
5500
5000
5000
MIS
MOB
ENERGY HYBRID
MIS
FUZZY
(a) Maximum speed = 1 m/s
MOB
ENERGY HYBRID
FUZZY
(b) Maximum speed = 3 m/s
9000 Update Overhead (Packets)
8500 8000
7500 7000 6500 6000 5500 5000 MIS
MOB
ENERGY HYBRID
FUZZY
(c) Maximum speed = 5 m/s
FIGURE 18 Update overhead with varying maximum peer speeds
has 5.59%, 13.01%, and 1.31% higher query overhead than MIS, MOB, and HYBRID, respectively, but shows 3.57% lower overhead than ENERGY. Update overhead Update overhead is measured by counting all packets issued for all network updates during the entire simulation. Figure 18 compares the average update overhead over the maximum speeds. Since only live peers participate in network updates, update overhead is strongly related with the results shown in Figure 16. Figure 18 confirms our expectation. On average, FUZZY has 5.13%, 1.96%, and 4.20% higher update overhead than MIS, MOB and ENERGY, respectively, but shows 0.67% lower overhead than HYBRID. System warm-up time A few system parameters should be determined to operate the double-layered P2P systems. We measure the system warm-up time for calculating the system parameters such as the maximum speed of peers, the maximum energy of peers, and the optimal ratio of mobility to energy. We expect that MOB, ENERGY and FUZZY may require a very limited amount of time to find the parameters, while MIS does not require any time. Since MIS selects super peers randomly, it does not need such parameters. Figure 19 shows the system
350
K WANG -J O L EE et al. 10000
Time (minutes)
1000
100
10
1 MIS
MOB
ENERGY HYBRID
FUZZY
FIGURE 19 System warm-up time
warm-up time of each system. MOB, ENERGY, and FUZZY have almost the same system warm-up times, while MIS requires no time. MOB, ENERGY, and FUZZY have to determine only the maximum speed of peers and/or the maximum energy of peers. In order to obtain the optimal ratio of mobility to energy, HYBRID requires almost 100 times longer than other systems in our simulation environments. Moreover, whenever the environment is changed, HYBRID needs to adjust the system parameters, incurring much longer system warm-up time. This time is not required by the other methods. Consequently, FUZZY is the optimal choice for a practical system that undergoes dynamic changes in its nature, since it can adaptively adjust the parameters.
6 CONCLUSIONS In this paper, we suggest a more realistic double-layered mobile P2P system. Specifically, we propose a novel fuzzy inference method for the suggested mobile P2P system. Using the proposed fuzzy inference method, each live peer adaptively determines the ratio of mobility to energy for super peer selection at each network reconfiguration. Consequently, the proposed system overcomes the Hybrid system’s defects that the optimal ratio has to be determined for each and every environment and the requirement for a large number of experiments. Extensive simulation results show that our proposed system achieves a similar performance to the Hybrid system optimized to our simulation environment. The results demonstrate that the proposed system can adaptively and effectively adjust the ratio of mobility to energy. We are currently working on applications that can utilize our fuzzy-based super peer selection method.
S UPER P EER S ELECTION
351
ACKNOWLEDGEMENT This research was supported by the Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education, Science and Technology (2011–0002851). REFERENCES [1] The Network Simulator NS-3. http://www.nsnam.org. [2] Jae-Ho Choi, Kyu-Sun Shim, SangKeun Lee, and Kun-Lung Wu. (02 2012). Handling selfishness in replica allocation over a mobile ad hoc network. IEEE Transactions on Mobile Computing, 11(2):278–291. [3] Carlos de Morais Cordeiro and Dharma Prakash Agrawal. (2006). AD HOC & SENSOR NETWORKS. World Scientific Publishing Co. Pte. Ltd. [4] Jung-Suk Han, Kwang-Jo Lee, Jin-Woo Song, and Sung-Bong Yang. (2008). Mobile peerto-peer systems using super peers for mobile environments. In International Conference on Information Networking, pages 1–4. [5] T. Hara and S.K. Madria. (2009). Consistency management strategies for data replication in mobile ad hoc networks. Mobile Computing, IEEE Transactions on, 8(7):950–967. [6] Jyh-Shing Roger Jang, Chuen-Tsai Sun, and Eiji Mizutani. (1996). Neuro-fuzzy and Soft Computing. Prentice-Hall, Inc., Upper Saddle River, NJ. [7] Ji-Hoon Kim, Jin-Woo Song, Taek-Hun Kim, and Sung-Bong Yang. (2011). An enhanced double-layered p2p system for the reliability in the dynamic mobile environments. Computing and Informatics, 30(3):1001–1023. [8] Sun-Kyum Kim, Kwang-Jo Lee, and Sung-Bong Yang. (2011). An enhanced super-peer system considering mobility and energy in mobile environments. In Wireless and Pervasive Computing, pages 1–5. [9] A. Klemm, C. Lindemann, and O.P. Waldhorst. (2003). A special purpose peer-to-peer file sharing system for mobile ad hoc networks. In Vehicular Technology Conference, volume 4, pages 2758–2763. [10] Jae-Suk Lee and Sung-Bong Yang. (2010). An effective emergency escape system using context-aware services in mobile ad-hoc networks. In International Conference On Internet, pages 9–14. [11] Michael Luby. (1986). A simple parallel algorithm for the maximal independent set problem. SIAM Journal of Computing, 15(4):1036–1055. [12] Charles E. Perkins, Elizabeth M. Belding-Royer, and Samir R. Das. (2002). Ad hoc On-Demand Distance Vector (AODV) Routing. IETF Internet Draft, http://tools.ietf.org/ html/draft-ietf-manet-aodv-11. [13] Wolfgang Wiess and Martin Mauve. (2007). A survey on real-world implementations of mobile ad-hoc networks. AD HOC & NETWORKS, 5(3):324–339. [14] L. A. Zadeh. (1965). Fuzzy sets. Information and Control, 8:338–353. [15] Y. Zhang, J. Zhao L. Yin, and G. Cao. (2012). Balancing the tradeoffs between query delay and data availability in manets. Mobile Computing, IEEE Transactions on, 23(4):640–650. [16] Chen Zhao and Mihail L. Sichitiu. (2010). Contact time in random walk and random waypoint: Dichotomy in tail distribution. AD HOC & NETWORKS, 9(2):152–163.