Abstract
In P2P systems, each peer has to obtain information of other peers and propagate the information to other peers through neighboring peers. Thus, it is important for each peer to have some number of neighbor peers. Moreover, it is more significant to discuss if each peer has reliable neighbor peers. In reality, each peer might be faulty or might send obsolete, even incorrect information to the other peers. We have implemented a P2P platform called JXTA-Overlay, which defines a set of protocols that standardize how different devices may communicate and collaborate among them. It abstracts a new layer on the top of JXTA through a set of primitive operations and services that are commonly used in JXTA-based applications and provides a set of primitives that can be used by other applications, which will be built on top of the overlay, with complete independence. JXTA-Overlay provides a set of basic functionalities, primitives, intended to be as complete as possible to satisfy the needs of most JXTA-based applications. In this paper, we present two fuzzy-based systems (called FRS1 and FRS2) to improve the reliability of JXTA-Overlay P2P platform. We make a comparison study between the fuzzy-based reliability systems. Comparing the complexity of FRS1 and FRS2, the FRS2 is more complex than FRS1. However, it considers also the security; therefore, it can be used in real application for secure systems.
Introduction
The Internet is growing every day and the performance of computers is increased exponentially. However, the Internet architecture is based on Client/Server (C/S) topology, therefore cannot use efficiently the clients features. Also, with appearance of new technologies such as ad-hoc networks, sensor networks, body networks, home networking, new network devices and applications will appear. Therefore, it is very important to monitor, control and optimize these network devices via communication channels. However, in large-scale networks such as Internet, it is very difficult to control the network devices, because of the security problems.
In order to make the networks secure many security devices are used. The firewalls are used for checking the information between private and public networks. The information is transmitted according to some decided rules and it is very difficult to change the network security policy. Also, there are many small networks and Intranets that do not allow the information coming from other networks. Therefore, recently many researchers are working on Peer-to-Peer (P2P) networks, which are able to overcome the firewalls, NATs and other security devices without changing the network policy. Thus, P2P architectures will be very important for future distributed systems and applications. In such systems, the computational burden of the system can be distributed to peer nodes of the system. Therefore, in decentralized systems users become themselves actors by sharing, contributing and controlling the resources of the system. This characteristic makes P2P systems very interesting for the development of decentralized applications [4,26].
In [26], it is proposed a JXTA-based P2P system. JXTA-Overlay is a middleware built on top of the JXTA specification, which defines a set of protocols that standardize how different devices may communicate and collaborate among them. It abstracts a new layer on the top of JXTA through a set of primitive operations and services that are commonly used in JXTA-based applications and provides a set of primitives that can be used by other applications, which will be built on top of the overlay, with complete independence. JXTA-Overlay provides a set of basic functionalities, primitives, intended to be as complete as possible to satisfy the needs of most JXTA-based applications.
In P2P systems, each peer has to obtain information of other peers and propagate the information to other peers through neighboring peers. Thus, it is important for each peer to have some number of neighbor peers. Moreover, it is more significant to discuss if each peer has reliable neighbor peers. In reality, each peer might be faulty or might send obsolete, even incorrect information to the other peers. If a peer is faulty, other peers which receive incorrect information on the faulty peer might reach a wrong decision. Therefore, it is critical to discuss how a peer can trust each of its neighbor peers [1,25].
The heuristic approaches based on intelligent algorithms can prove to be efficient for optimization in wireless networks [2,3,5,7,8,15,17,19–22].
The reliability of peers is very important for safe communication in P2P system. The reliability of a peer can be evaluated based on the reputation and interactions with other peers to provide services. However, in order to decide the peer reliability are needed many parameters, which make the problem NP-hard.
Fuzzy Logic (FL) is the logic underlying modes of reasoning which are approximate rather then exact. The importance of FL derives from the fact that most modes of human reasoning and especially common sense reasoning are approximate in nature. FL uses linguistic variables to describe the control parameters. By using relatively simple linguistic expressions it is possible to describe and grasp very complex problems. A very important property of the linguistic variables is the capability of describing imprecise parameters.
The concept of a fuzzy set deals with the representation of classes whose boundaries are not determined. It uses a characteristic function, taking values usually in the interval
The fuzzy set theory uses the membership function to encode a preference among the possible interpretations of the corresponding label. A fuzzy set can be defined by exemplification, ranking elements according to their typicality with respect to the concept underlying the fuzzy set [24].
In this paper, we present two fuzzy-based systems to improve the reliability of JXTA-Overlay P2P platform. We make a comparison study between the fuzzy-based reliability systems.
The structure of this paper is as follows. In Section 2, we introduce the Project JXTA and JXTA-Overlay. In Section 3, we introduce FL used for control. In Section 4, we present the proposed fuzzy-based systems. In Section 5, we discuss the simulation results. Finally, conclusions and future work are given in Section 6.
JXTA technology and JXTA-Overlay
JXTA technology

P2P communication. (Colors are visible in the online version of the article;
JXTA technology is a generalized group of protocols that allow different devices to communicate and collaborate among them. JXTA offers a platform covering basic needs in developing P2P networks [6].
By using the JXTA framework, it is possible that a peer in a private network can be connected to a peer in the Internet by overcoming existing firewalls as shown in Fig. 1. In this figure, the most important entity is the router peer. A router peer is any peer which supports the peer endpoint protocol and routing messages between peer in the JXTA networks. The procedure to overcome the firewall is as follows.
In the Router Peer is stored the private address of Peer1 by using the HTTP protocol to pass the firewall from Peer1.
The Router Peer receives the data from Peer2 and access the Private address of Peer1 to transmit the data.
JXTA is an interesting alternative for developing P2P systems and groupware tools to support online teams of students in virtual campuses. In particular, it is appropriate for file sharing given that the protocols allow to develop either pure or mixed P2P networks. This last property is certainly important since pure P2P systems need not the presence of a server for managing the network.
JXTA-Overlay project is an effort to use JXTA technology for building an overlay on top of JXTA offering a set of basic primitives (functionalities) that are most commonly needed in JXTA-based applications [12,16,23]. The proposed overlay comprises the following primitives:
peer discovery,
peer’s resources discovery,
resource allocation,
task submission and execution,
file/data sharing, discovery and transmission,
instant communication,
peer group functionalities (groups, rooms etc.),
monitoring of peers, groups and tasks.
This set of basic functionalities is intended to be as complete as possible to satisfy the needs of JXTA-based applications. The overlay is built on top of JXTA layer and provides a set of primitives that can be used by other applications, which on their hand, will be built on top of the overlay, with complete independence. The JXTA-Overlay project has been developed using the ver-2.3 JXTA libraries. In fact, the project offers several improvements of the original JXTA protocols/services in order to increase the reliability of JXTA-based distributed applications and to support group management and file sharing.

Structure of JXTA-Overlay system. (Colors are visible in the online version of the article;
The architecture of the P2P distributed platform we have developed using JXTA technology has two main peers: Broker and Client. Altogether these two peers form a new overlay on top of JXTA. The structure of JXTA-Overlay system is shown in Fig. 2.

Internal architecture of JXTA-Overlay. (Colors are visible in the online version of the article;
Except Broker and Client peers, the JXTA-Overlay has also SimpleClient peers as shown in Fig. 3. The control layer interacts with the JXTA layer, and is divided into two parts: a lower part with functionality common to any kind of peer, and a higher part with functionality specific to Brokers and Clients.
The common part provides functionality for doing JXTA messaging, discovery and advertisement.
The Broker specific part provides functionality for managing groups of Brokers and keeping broker statistics.
The Client specific part provides functionality for managing groups of Clients, keeping client statistics, managing its shareable files, managing the user configuration and creating the connection with a Broker.
The lower part enqueues the JXTA messages to be sent. Whenever a message arrives, the JXTA layer fires an event to the lower layer, which in turn fires a notifications to the upper layers.
The ability of fuzzy sets and possibility theory to model gradual properties or soft constraints whose satisfaction is matter of degree, as well as information pervaded with imprecision and uncertainty, makes them useful in a great variety of applications.
The most popular area of application is Fuzzy Control (FC), since the appearance, especially in Japan, of industrial applications in domestic appliances, process control and automotive systems, among many other fields.
FC
In the FC systems, expert knowledge is encoded in the form of fuzzy rules, which describe recommended actions for different classes of situations represented by fuzzy sets.
In fact, any kind of control law can be modeled by the FC methodology, provided that this law is expressible in terms of “if … then …” rules, just like in the case of expert systems. However, FL diverges from the standard expert system approach by providing an interpolation mechanism from several rules. In the contents of complex processes, it may turn out to be more practical to get knowledge from an expert operator than to calculate an optimal control, due to modelling costs or because a model is out of reach.
Linguistic variables
A concept that plays a central role in the application of FL is that of a linguistic variable. The linguistic variables may be viewed as a form of data compression. One linguistic variable may represent many numerical variables. It is suggestive to refer to this form of data compression as granulation [9].
The same effect can be achieved by conventional quantization, but in the case of quantization, the values are intervals, whereas in the case of granulation the values are overlapping fuzzy sets. The advantages of granulation over quantization are as follows:
it is more general; it mimics the way in which humans interpret linguistic values; the transition from one linguistic value to a contiguous linguistic value is gradual rather than abrupt, resulting in continuity and robustness.
FC rules
FC describes the algorithm for process control as a fuzzy relation between information about the conditions of the process to be controlled, x and y, and the output for the process z. The control algorithm is given in “if … then …” expression, such as:
If x is small and y is big, then z is medium;
If x is big and y is medium, then z is big.
These rules are called FC rules. The “if” clause of the rules is called the antecedent and the “then” clause is called consequent. In general, variables x and y are called the input and z the output. The “small” and “big” are fuzzy values for x and y, and they are expressed by fuzzy sets.
Fuzzy controllers are constructed of groups of these FC rules, and when an actual input is given, the output is calculated by means of fuzzy inference.
Control knowledge base
There are two main tasks in designing the control knowledge base. First, a set of linguistic variables must be selected which describe the values of the main control parameters of the process. Both the input and output parameters must be linguistically defined in this stage using proper term sets. The selection of the level of granularity of a term set for an input variable or an output variable plays an important role in the smoothness of control. Second, a control knowledge base must be developed which uses the above linguistic description of the input and output parameters. Four methods [13,18,27,28] have been suggested for doing this:
expert’s experience and knowledge;
modelling the operator’s control action;
modelling a process;
self-organization.
Among the above methods, the first one is the most widely used. In the modelling of the human expert operator’s knowledge, fuzzy rules of the form “If Error is small and Change-in-error is small then the Force is small” have been used in several studies [10,14]. This method is effective when expert human operators can express the heuristics or the knowledge that they use in controlling a process in terms of rules of the above form.
Defuzzification methods
The defuzzification operation produces a non-FC action that best represent the membership function of an inferred FC action. Several defuzzification methods have been suggested in literature. Among them, four methods which have been applied most often are:
Tsukamoto’s Defuzzification method; The Center of Area (COA) method; The Mean of Maximum (MOM) method; Defuzzification when Output of Rules are Function of Their Inputs.
Proposed fuzzy-based peer reliability systems
To complete a certain task in JXTA-Overlay network, peers often have to interact with unknown peers. Thus, it is important that peers must select reliable peers to interact. The number of interactions that a peer has with other peers in JXTA-Overlay P2P network is a very important factor that affects the peer reliability. Another important parameter that is connected with peer reliability is the number of authentic files. In every transaction, peers receive a file and evaluate trustworthiness of the senders with local score from the file. Selfish peers that benefits from the system without contributing any resources to the network have a low reliability. Every time a peer joins JXTA-Overlay, parameters are fuzzified using fuzzy system, and based on the decision of fuzzy system a reliable peer is selected. After peer selection, the data for this peer are saved in the database as shown in Fig. 4.

Proposed peer reliability system.

FRS1 structure.

Membership functions of FRS1.
In [11], we already proposed a peer reliability system with three parameters: Local Score (LS), Number of Authentic Files (NAF) and Number of Interactions (NI) to decide the Peer Reliability (PR). The structure of this system called Fuzzy Reliability System (FRS1) is shown in Fig. 5 and the membership functions for FRS1 are shown in Fig. 6. The Fuzzy Rule Base (FRB) of FRS1 is shown in Table 1 and consists of 27 rules.
FRB of FRS1
FRB of FRS2

Structure of FRS2.

Membership functions of FRS2.
The input parameters for peer-reliability assessment are: NAF, LS, NI, S, while the output linguistic parameter is PR. The term sets of NAF, LS, NI and S are defined respectively as:

Peer reliability for

Peer reliability for
In this section, we present the simulation results for our proposed systems. In our systems, we decided the number of term sets by carrying out many simulations. These simulation results were carried out in MATLAB.
For FRS1, we show the relation between NAF, LS, NI and PR in Fig. 9. In this simulation, we consider the NAF as a constant parameter. From the simulation results we can clearly distinguish 3 zones. When LS is less than 2.5 units the PR is very small. A middle zone (more than 2.5 units but less than 7.5 units), where the PR increases proportionally with the increase of LS. For more than 8 units there is a third zone where the PR is high. As shown by this figure, with the increase of LS and NI, the PR increases.

Peer reliability for
In Figs 10 and 11, we increase the NAF value to 5 and 10 units, respectively. When the peer provides a big number of authentic files with high probability it can be considered as a reliable peer.
In Fig. 12(a), we show the relation between NAF, LS, NI, S and PR when NAF and S are considered as constant parameters. With the increase of LS and NI, the PR increases, the same as the FRS1.
In Fig. 12(b) and 12(c), we increase the NAF value to 5 and 10 units, respectively. When the peer provides a big number of authentic files with high probability, the reliability is increased. However because the security is low, the PR values of FRS2 are lower than FRS1.

Peer reliability for different NAF when the

Peer reliability for different NAF when the

Peer reliability for different NAF when the
In Figs 13 and 14, we increase the S value to 5 and 10 units, respectively. When the peer provides a high security, the reliability is increased much more.
Comparing the complexity of FRS1 and FRS2, the FRS2 is more complex than FRS1. However, it considers also the security; therefore, it can be used in real application for secure systems.
We have implemented a P2P platform called JXTA-Overlay, which defines a set of protocols that standardize how different devices may communicate and collaborate among them. It abstracts a new layer on the top of JXTA through a set of primitive operations and services that are commonly used in JXTA-based applications and provides a set of primitives that can be used by other applications, which will be built on top of the overlay, with complete independence. JXTA-Overlay provides a set of basic functionalities, primitives, intended to be as complete as possible to satisfy the needs of most JXTA-based applications. In this paper, we presented two fuzzy-based systems (called FRS1 and FRS2) to improve the reliability of JXTA-Overlay P2P platform. We make a comparison study between the fuzzy-based reliability systems.
From the simulations results, we conclude as follows.
Peer reliability is high when the peer interacts with other peers to exchange their resources.
With the increasing of LS and NI, the PR is increased.
When number of authentic files is high, the reliability is high.
When the increasing of security, the PR is increased.
The proposed system can choose reliable peers to connect in JXTA-Overlay platform.
Comparing the complexity of FRS1 and FRS2, the FRS2 is more complex than FRS1. However, it considers also the security; therefore, it can be used in real application for secure systems.
In the future, we would like to make extensive simulations and carry out experiments with JXTA-Overlay platform.
