Trust Evaluation Model for P 2 P Networks based on Time and Interaction

The traditional centralized trusting mechanism does not meet the requirements of the modern P2P network, so it is necessary to establish a distributed trusting mechanism to strengthen the system’s reliability. Factors including time attenuation factor, interactive frequency factor, interactive size factor and average online time factor markedly influence the trust of the nodes in a P2P network. This paper defines the precise effects of these factors on trust and proposes a comprehensive trust model and global trust model based on direct trust and indirect trust.


Background
P2P networks have become the focus of the Internet due to their application in file distribution, streaming media transmission, distributed computing, and more [1].The sharp increase in the number of P2P network users and the openness of P2P networks themselves has created an increasing complexity of trust between network nodes.In 1994, Marsh first extended the "trust relationship" concept from the social network to the computer network and research on trust management in computer networks began in earnest [2].The traditional centralized trusting mechanism does not meet P2P network requirements, so it is necessary to establish a new distributed trusting mechanism to build trust relationships between nodes, as the basis of the interaction among them.
The interactive success rate of nodes that select interactive objects with higher trust is higher.The block chain [3][4], a relatively new P2P network application, is a mode of distributed data storage [5], a point-to-point transmission consensus mechanism, and an encryption algorithm [6], The consensus mechanism is a method of building trust between nodes and accessing rights in a block chain system [7].

Related Work
Many P2P-based trust models have been proposed in recent years.EigenTrust [8][9], for example, is one of the first models of dynamic computing the global trust value of nodes.In EigenTrust, the local trust value of a node is calculated after its interactions; the results are fed back to calculate the global trust value of the node.When applied to a large-scale network, EigenTrust suffers poor scalability, inappropriate convergence, and high computational complexity.FCTrust [10] also uses the feedback concept, under which the trust of nodes is determined by interaction frequency.However, it equally assigns weight to all the transactions instead of giving more importance to recent ones in calculating local trust, resulting in an inaccurate evaluation of the target node.
Based on the above literature review, we examined the factors which significantly influence the trust among nodes including time attenuation [11], interactive frequency, interactive size and average online time.We established a novel model of trust evaluation based on time and interaction accordingly, discussed in detail below.

Time Attenuation Factor
Definition 1 (Time Attenuation Factor): The attenuation of the influence of nodes' interaction history on its trust over time is represented by h and calculated as follows: . ( where tn is for the current moment; th is for the historical moment of interaction.The closer to the current moment the moment of historical interaction this, more influence the interaction has on the trust evaluation values.Conversely, there is less impact to the trust evaluation farther from the current moment [12][13].The EigenTrust 89 model ignores the impact of time attenuation on trust calculation and thus is not sufficiently objective.In our model, the time attenuation factor is introduced into the calculation of each trust factor.is the base of the exponential attenuation function.takes the value e, i.e., =e.The time attenuation is always less than or equal to 1.The time attenuation factor is greater, approaching to 1 when the moment of historical interaction is closer to the current time.When the moment of historical interaction occurred a long time ago, the time attenuation factor value approaches infinitesimal.Time attenuation factor h is represented by and according to a successful or failing result, respectively.
：The time attenuation factor in the case of a successful interaction.In this case, represents the historical moment of a successful interaction.
：The time attenuation factor in the case of a failing interaction.In this case, th represents the historical moment of a failing interaction.
The moment of historical interaction has a great influence on trust value.The effect of historical interaction between nodes on the trust evaluation values attenuates gradually as time goes by, and this attenuation is not linear.When the historical interaction occurred a long time ago, the influence on trust shrinks towards zero [14].The difference between the moments of historical interaction and the current moment is rounded down unlike the calculation method of time attenuation factor in previous studies [14].Each time attenuation factor is matched with a corresponding time period.The time attenuation factor is h when the interaction occurs within the period from to .

Interactive Frequency Factor
Definition 2 (Interactive Frequency Factor): The interactive evaluation factor measures the effect of successful interaction frequency and failing interaction frequency on trust degree.It is calculated as follows: , . ( Based on the time attenuation factor, the definition of and is : , . ( 5) sat(i,j) represents the number of successful interactions between node i and node j having taken time attenuation factor into consideration.Node i is a requesting node and node j is a requested node.In sat(j,i), node j is a requesting node and node i is a requested node.Therefore, sat(i,j) is different from sat(j,i), and their values may differ.unsat(I,j) represents the number of failing interactions between node i and node j with time attenuation factor taken into consideration.Node i is a requesting node and node j is a requested node.In the same way, unsat(i,j) is different from unsat(j,i).
k represents a period from to approaching the current moment; k has the same meaning in the post.
represents the number of successful interactions between node i and node j within the period k. represents the number of failing interactions between node i and node j within the period of k.
In order to avoid unfairness to new nodes and to distinguish new nodes from bad nodes, node i is considered to be a new node if: Because the new nodes have no interaction with any other node, the trust evaluation of new nodes to other nodes can only be evaluated by the indirect trust degree and the attributes of the nodes.No node has interacted with a new node in the network, so each new node is given an initial global trust which is equal to the global trust value of its invitation node, that is to say, the higher the global trust of its invitation node, the higher the initial global trust that the new node is given.If Node i is not a new node.The interactive evaluation factor for node i and node j is calculated according to (2) and (3).

Interactive Size Factor
Definition 3 (Interactive Size Factor): The interactive size factor measures the impact of interactive data volume on trust degree between node.It is denoted as and calculated as follows: , . (9) where data(i,j) represents the interactive data volume between node i and node j.
represents the data volume of successful interaction between node i and node j.
represents the data volume of failing interaction between node i and node j.
The time attenuation factor is also calculated during calculation of the interactive data volume.The definitions of and are: , . (11) represents the data volume of successful interaction between node i and node j within period k.
represents the data volume of failing interaction between node i and node j within period k.
The interactive size factor can prevent malicious nodes from performing well in smaller-sized interactions, but cheating in larger interactions while the trust is still good.The EigenTrust89 model ignores the impact of interactive size on trust calculation.

Average Online Time Factor
The node is more likely to be online in the future, and considered to be generally more reliable, when it has a longer average online time.The average online time factor reflects the influence of average online time on trust.Again, the EigenTrust89 model ignores the impact of time factor on trust calculation.
Definition 4 (Average Online Time Factor): Average online time factor measures the impact of the node's average online time on its trust degree.It is represented by Tj and calculated as follows: (12) tj represents the total online time of node j.Nj represents the number of times that node j has gone online.The following penalty function is introduced into the direct trust model: .( 15) Pen(i,j) is the penalty function of node i to node j. unsat(i,j) is the number of failing interactions between node i and node j, and sat(i,j) is the number of successful interactions between node i and node j.The more the node fails to interact and the less it succeeds, the greater the punishment.

Trust Model
When calculating direct trust, EigenTrust89 adopts an iterative approach, which requires excess computation resources.FCTrust10 equally assigns weight to all the factors, which obscures the importance of each factor.
The greater the interactive frequency factor, the greater the interactive size factor, the greater the average online time factor, and the greater the direct trust value of this node, here, we built a direct trust model by multiplying these factors.The mathematical definition of direct trust of Pi to Pj is : .( 16) represents the accelerating factor and .When the node's behavior becomes malicious, the acceleration factor reduces the trust value rapidly.When the node's behavior becomes normal, the trust value slowly increases.

Indirect Trust
Definition 6 (Indirect Trust): Indirect trust[16], also referred to as recommendation trust, is represented by ITrust(i,j); it is the trust degree that nodes build through indirect interactive history.
When Pi has no direct interaction or very few direct interactions with Pj, the trust degree of Pi to Pj .depends on the recommendations from other nodes that have direct interaction with Pj.
For any , the direct trust degree of Pk to Pj can be calculated according to (16).The definition of indirect trust ITrust(i,j) of Pi to Pj: , (19) (20) , the weight of STrust(i,j) is a dynamic value.is related to the frequency of interaction between Pi and Pj.
The more frequently Pi interacts with Pj, the greater is, the smaller is and the more important the direct trust is.The less frequently Pi interacts with Pj, the greater is, the smaller is and the more important the indirect trust is.
indicates that Pi does not interact with Pj .Therefore and .The trust value to Pj is measured by the indirect trust.
When Pi only interacts with Pj and has no interaction with other nodes, then and .The trust value is measured by the direct trust.

Global Trust
Definition 8 (Global Trust): To measure the trust of each node based on the entire network, the global trust of Pi is calculated according to the comprehensive trust of other nodes in the network to Pi.The global trust degree of Pi is represented by GTrust(i).
Definition 9 (Approve): When the comprehensive trust degree of Pi to Pj exceeds a certain value, Pj is approved by Pi and denoted by R(i,j)=true.Otherwise, Pj is not approved by Pi and denoted by R(i,j)=false.When STrust(i,j)>λ, Pj is approved by Pi and denoted by R(i,j)=true.When STrust(i,j)<λ,Pj is not approved by Pi and denoted by R(i,j)=false.
The λ variable mentioned above is an approbation threshold which distinguishes good nodes from bad nodes.If the threshold is too high, the global trust of nodes in the network is generally low.Conversely, if the threshold is too low, the global trust is generally high and good nodes may not be sufficiently distinguishable from bad nodes.We setλ=0.2 in our experiment.
The greater the proportion of nodes that recognize this node in the network, the higher the global trust degree the node has; therefore the global trust degree of Pi can be calculated by the percentage of the nodes approve Pi in the entire network.The global trust degree has global uniqueness.
A node set Wi is defined to represent the set of nodes that approve Pi in the network.Definition of Wi is shown in .
(21) The global trust of Pi is calculated by the percentage of the approve nodes with all nodes in the network.The global trust degree is defined as follows: . (22)

Experiment And Analysis
We designed several nodes to simulate the application scenarios of a P2P network in order to verify the proposed trust evaluation model.The historical interaction records of nodes served as inputs to calculate the trust degree.
In the number of initial nodes is too large, the calculation is may be overly complex and the result may not be conducive to observation and comparison.If the number of nodes is too small, the advantages of the model are not effectively reflected.We set the number of nodes to 10 in our experiment.Node 5 and node 10 are bad nodes which provide one bad service for every two good services.Other nodes are normal nodes which consistently provide good service.In the P2P network, all shared files are randomly distributed evenly.The nodes in the network randomly download or upload files from other nodes.During the experiment, online status of nodes, number of interactions, requesting node, requested node, volume of interactive data and results of interaction were recorded.These records were then used as input data to calculate the direct trust, indirect trust, comprehensive trust and global trust of each node in the network.For the sake of comparison, we choose a normal node and a bad node for separate recordings of changes in global trust over defined time period.We also selected a node to record the attenuation of the node global trust degree as time progressed.
Figure 1 shows the global trust between nodes after a period of interaction as-calculated using the proposed model and EigenTrust, respectively.Node 5 and node 10 showed the lowest global trust degree, as each provided bad service once time.We found it much easier to distinguish the good nodes from the bad nodes using the proposed model compared to EigenTrust.
Figure 2 shows the changes in global trust degree of nodes 3 and 5.One period is defined as the end of the previous service to the completion of the present service.Node 3 is a normal node and always provides good service; node 5 provides two good services followed by a bad one.Node 3's global trust degree continually increased over the observation period, while the global trust of node 5 fluctuated.When providing a good service, node 5's global trust rebounded to some extent before decreasing when it subsequently provided bad service.The amplitude of its decline was always greater than the amplitude of increase due to the penalty function.When the node is behaving badly, the node is punished and the trust degree quickly drops.When node's behavior gets better, its trust degree increases, but slowly.Figure 3 shows the change curve of the global trust degree of node 3. The closer to the current moment, the greater impact the interaction of nodes on trust degree.The farther from the current moment, the smaller the impact the interaction has on the trust degree.Node 3 appears to provide good service in the previous interaction and has a high level of trust.Once node 3 has not provided any service for a long time, its trust degree drops off.

Conclusion
There is no third-party authentication in the P2P network, so it is necessary to judge and select appropriates node with which to interact to ensure system reliability.This paper proposed a trust evaluation model based on time and interaction which resolves trust problems in P2P networks.Multiple factors including the time attenuation factor, interactive frequency factor, interactive size factor and average online time factor were introduced to calculate the direct trust degree and indirect trust degree respectively.The comprehensive trust degree and global trust degree can be obtained according to the direct trust degree and indirect trust degree.
In the future, we plan to apply the trust evaluation model in actual P2P networks, including the block chain.We will choose appropriate trust nodes for effective and safe interactions to download and upload files, and thus realize distributed storage and access for files in the P2P network.

ADefinition 5 (
P2P network can be modeled as a directed graph G={V,E}.The vertex set is represented by V={P1,P2, … ,Pn} where n represents the number of nodes in the network.The edge set is represented by E={(Pi,Pj)|i,j=1,2…,n}, where . is the weight of edge (Pi,Pj) calculated by the number of interactions between Pi and Pj having taken the time attenuation into consideration.Pi is a requesting node and Pj is a requested node.It is defined as follows: .(13) We also introduced the concept of a set Qj into the trust model, where Qj represents a collection of nodes that have interactions with .The definition of set Qj is: Direct Trust): Direct trust[15] ， also referred to as local trust, is represented by DTrust(i,j).It is the trust degree that Pi has established over the history of direct interaction with Pj.

Definition 7 (
Comprehensive Trust): Comprehensive trust is the trust established by direct trust and indirect trust.The comprehensive trust of Pi to Pj is represented by STrust(i,j) and calculated as follows: ,

Fig 2 .
Fig 2. Changes in global trust after interaction.

Fig 3 .
Fig 3. Changes in global trust over time.