Research on Blockchain Availability Modeling in P2P Network

## Publications

/ Export Citation / / / Text size:

#### International Journal of Advanced Network, Monitoring and Controls

Xi'an Technological University

Subject: Computer Science, Software Engineering

eISSN: 2470-8038

32
106
Visit(s)
0
Comment(s)
0
Share(s)

SEARCH WITHIN CONTENT

FIND ARTICLE

Volume / Issue / page

Archive
Volume 6 (2021)
Volume 5 (2020)
Volume 4 (2019)
Volume 3 (2018)
Volume 2 (2017)
Volume 1 (2016)
Related articles

VOLUME 5 , ISSUE 1 (Apr 2020) > List of articles

### Research on Blockchain Availability Modeling in P2P Network

Keywords : lockchain, P2p, Markov, Availability

Citation Information : International Journal of Advanced Network, Monitoring and Controls. Volume 5, Issue 1, Pages 36-43, DOI: https://doi.org/10.21307/ijanmc-2020-006

Published Online: 02-April-2020

### ARTICLE

#### ABSTRACT

Blockchain establishes reliable trust among parties that do not know each other and achieves credible data sharing and point-to-point value transmission in an epoch-making way. The requirement of the availability of block chain network becomes more and more important due to the dynamic and changeable characteristics of block chain P2P network. Therefore, for the characteristics of block chain P2P network system, this paper constructs a availability model based on Markov stochastic process theory, analyzes the steady-state availability and instantaneous availability of the model, and finally carries out experimental verification through simulation, hoping to provide beneficial inspiration and guidance for future research on block chain network.

## I. INTRODUCTION

Block chain is a distributed system composed of encryption mechanism, storage mechanism, consensus mechanism, which can realize the peer-to-peer trading function of mutual trust without central server. The biggest feature of blockchain is decentralization and distribution, and the consensus mechanism of blockchain enables participating nodes to jointly provide services for the system and realizes similar functions of financial intermediaries in the central system. As shown in Figure 1, blockchain system can achieve fast synchronization of data without central server and consistency of consensus mechanism through P2P network. P2P realizes the sharing of data resources and cooperation of services among terminal devices by means of direct exchange. However the dynamic and changeable of blockchain P2P network, the requirement of the availability of block chain network becomes more and more important.

##### Figure 1.

The architecture of p2p networks in the blockchain

From the development trend of p2p network, the demand of modeling and verification evaluation on the availability of p2p network is more and more common and urgent. The establishment of high availability network is the basis of accurate and timely information exchange, so as to meet the demand of network system to provide high reliable services for various users.

## II. RELATED WORK

The traditional concept of availability is a typical measure of reliability in reliability theory. It is an important parameter in reliability engineering that combines maintainability to represent the effectiveness of the system. “Reliability” can only reflect the probability of failure of the network system or components, while “availability” can reflect the quality of the network by considering the repairability of the network. Therefore, analyzing the availability of tact network system is an important index to evaluate the design of system networking, system stability and maintenance ability.

At present, availability studies mainly focus on the reliability and maintainability of the engineering capability of complex systems, and also on the availability of mission capability. Lianhong Zhou established the availability model of optical fiber communication system by using the state transfer equation[1]. Hailin Feng used Markov theory to study the steady-state availability of repairable network system, and analyzed the fuzzy availability of repairable network system and continuous kn(F) network. Fenghua Xie studied the availability of “N+X” UPS system and pointed out that the availability of parallel system was positively correlated with the number of redundant modules[2]. Jingle Zhang proposed a workflow availability modeling method based on random Petri net and studied and established the SPN model of e-commerce system[3]. Jikun Yang fused sample data with prior information, used fuzzy variables to deal with the uncertainty of sample data, and proposed a usability analysis method of navigation weapon system based on fuzzy Bayes[4].

Above all of these, we can find that the research on the availability of p2p network is relatively few and not very mature now. Therefore, research available technology based on P2P distributed collaborative network under different environmental conditions, analyze the unified modeling and expression of information, build a new generation of block chain network usability evaluation model, improve the information interaction and collaboration ability of block chain platform, and ensure the performance of system service and the formation of stable and reliable operation ability through availability technology.

## III. DISTRIBUTED P2P NETWORK STRUCTURE BASEDON BLOCK CHAIN

Block chain technology is the first kind that can be globally distributed deployment of consensus agreement. Block chain system achieves efficient consensus through simple unauthenticated broadcast channel and block chain length competition mechanism. The typical blockchain system consists of network layer, consensus layer, data layer, intelligent contract layer and application layer[5]. The network layer is usually based on P2P protocol for communication between nodes; the consensus layer implements the consensus protocol, which can be freely selected according to the actual scenario, such as PoW based on workload proof, and PoS based on equity proof; the data layer is the data structure of the block chain, whose structural design is usually closely coupled with the application scenario according to the actual needs, each computing node is responsible for maintaining its own storage system; the intelligent contract layer can perform different operations for different data input, this process is automatically executed based on the code, and consensus is reached across the network; the application layer is the basic business of the block chain system, such as financial services and data traceability, etc.

There is no central node in the block chain network based p2p, and any two nodes can be directly traded, each node is free to join and exit at any time. Therefore, the block chain platform usually chooses the P2P protocol which is completely distributed and can tolerate single point of failure as the network transmission protocol. Block chain network nodes have the characteristics of equality, autonomy and distribution, presenting a flat topology without any centralized authority nodes or hierarchical structure (as shown in Figure 2). Each node has such functions as route discovery, broadcast transaction, and broadcast block and find new nodes[6]. In the blockchain network, the P2P protocol of the blockchain network is mainly used for the transfer of transaction data and block data between nodes. The node listens to the data broadcast in the network all the time. It can only be processed after by verifying the validity of these transactions and blocks when receives new transactions and new blocks sent by the neighbor node.

##### Figure 2.

P2P network topology

## IV. AVAILABILITY DEFINITION

Reliability is defined as the ability of a product to perform specified functions under specified conditions and within specified time periods. The higher the reliability, the lower the failure rate of the product. The simplest expression for reliability can be expressed as an exponential distribution, which expresses random failure.

##### (1)
$R=e−λt$

Where, t is mission time, λ is failure rate.

Availability is defined as the ability to be in a state of executable function under specified conditions and at specified times or time intervals, provided that the required external resources are guaranteed. It is the comprehensive reflection of product reliability, maintainability and maintenance guarantee. The formula is as follows:

##### (2)
$A=MTBFMTBF+MTTR$

MTBF(Mean Time Between Failure)refers to the average working time between two adjacent failures and is a reliability indicator of a product.

MTTR(Mean Time To Repair)describes the average repair time when a product changes from a failure state to a working state. In engineering, MTTR is a measure of the maintainability of a product, which is common in maintenance contracts and is used as a measure of service charges.

According to the above analysis, “reliability” only reflects the probability of failure of the network system or components, while “availability” considers the repairability of the network and better reflects the quality of the network. Steady-state availability and instantaneous availability are two characteristic quantities that reflect availability. Therefore, analyzing the steady state availability and instantaneous availability of blockchain P2P network system is an important index to evaluate the design of system networking, system stability and maintenance ability.

## V. MARKOVAVAILABILITY MODELING

P2P network system is a complex system, its nodes states are changing at anytime, while the factors causing the change of the state of nodes mainly include hardware and software errors, human errors, natural disasters, malicious attacked, causing serious consequences to the network system, and even causing the entire network paralysis. The probability of occurrence of the first several factors is relatively small, while as an artificial means, the probability of occurrence of malicious attack is very high in the real war environment.

### A. Markov Chain Model of the System

In this paper, the P2P network system targeted is a multi-state Markov repairable system, assuming that its failures are caused by malicious attacks. The system is composed of several network nodes and several repair equipment. The life distribution of each node is 1 — e-λt, t ≥ 0, λ > 0, and the repair time after node failure is 1 — e-μt, t ≥ 0, μ>0. All of these random variables are independent of each other, and after the fault node is repaired, its life will be the same as the new node. Multi-state means that the nodes of the network system are damaged by attack, which may break one, two or more nodes; the number of fault nodes is different means the system state is different.

In the process of system design, it is usually necessary to chose availability model to describe the availability of the system. The availability model adopted in this paper is the voting system model of take k in n. There are two types of voting system models of take k in n: one is a system of take k good nodes in n, which requires k or more of the n nodes of the system to be normal in order for the system to work normally, which is denoted as k/n[G]. The other kind is the system of take k bad nodes in n, which means that the system cannot work properly if k or more of the n nodes of the system fail, which is denoted as k/n[F][7].This paper chose the second system model. When the fault nodes are less than k, the system works normally and repairs the fault nodes. When there are k node failures, the system will fail. At this time, the remaining normal working nodes will also stop working and will not fail. The system will work again until one node under repair is repaired and there are less than k nodes under repair.

The system studied in this paper simplifies the actual situation, the n nodes of the system are considered to be one type of node. For example, because the importance of each node is different in practice, the life distribution and repair time of the node may be different, so the node types are not all the same. Another example is that when a node fails, its workload must be borne by other nodes, thus accelerating the loss of other nodes. Therefore, these idealized conditions are temporarily listed as assumptions, called the basic type for analysis.

The number of fault nodes in the system is defined as the state of the system, i.e. E = { 0, 1, … …, n — k + 1 }, where the working states of the system are W = {0, 1,… …, nk}, obviously, the working quality (quality of service) of the different working nodes included in these working states is different, but it is not differentiated in the basic type analysis, and all of them are considered as normal working.

X(t)=j indicates that there are j node faults in the system at time t that need to be repaired, i.e. it is in the state of j, where j = { 0,1, … …, n — k + 1}. Node life and maintenance time obey the exponential distribution, according to the above, can prove to be time continuous multi-state time homogeneous Markov chain, state transition probability in Δt time is shown in the following Formula (3).

Pj represents the probability that the system is in state j at time t. This is the Markov model of P2P network multi-state repairable system. The state transition probability diagram of the system is shown in Figure 3: (the state of transition to itself is not shown in the figure)

##### (3)
${Pj,j+1(Δt)=(n−j)Δt+o(Δt),j=0,1,Λ,n−kP1,j−1(Δt)=jμΔt+o(Δt),j=1,2,Λ,n−k+1P1,j+1(Δt)=−(n−j)λΔt−jμΔt+o(Δt),j=1,2,Λ,n−kPn−k+1,n−k+1(Δt)=−(n−k+1)μPj,k(Δt)=o(Δt)$

The state transition probability matrix is represented by A, as follow:

##### (4)
$[-nλnλμ-(n-1)λ−μ2μ-(n-2)λ-2μΛ(n-k)μ-kλ-(n-k)μkλ(n-k+1)μ-(n-k+1)μ]$

##### Figure 3.

State transition diagram

### B. Steady-State Availability of the System

Steady-state availability is one of the reliability characteristics of markov repairable system, which means the proportion of the whole running time of the network without dismemberment when the network reaches the steady-state, it is the probability of the network being connected. This index is essentially the probability of connectivity at any time in the steady state. According to the properties of homogeneous Markov process:

##### (5)
$limt→∞Pj′(t)=0,limt→∞Pj(t)=πj$

According to formula (5), we get

##### (6)
$πA=0,∑πj=1$

Where π is the probability distribution vector of state in steady state, π = (π0, πί,… …, πn-k+1), Matrix A is substituted into Equation (6), and we get

##### (7)
${−nλπ0+μπ0=0nλπ0−((n−1)λ+μ)π1+2μπ2=0nλπ1−((n−2)λ+2μ)π2+3μπ3=0ΛΛ(n−j)λπj−((n−j+1)λ+(j+1)μ)πj+1+(j+2)μπj+2=0ΛΛkλπn−k−(n−k+1)μπn−k+1=0$

The value can be obtained by solving the linear equations, and the steady-state availability of the system is

##### (8)
$A=∑πi,i=0,1,2,……,n−k$

### C. Instantaneous availability of the system

Instantaneous availability is also one of the reliability characteristics of markov repairable system. For some high-reliability systems like P2P networks, it takes a long time to reach their stable state, and the steady-state availability may also be disturbed during the system operation. Therefore, it is not enough to calculate the steady-state availability, but to consider the instantaneous index of the system.

From the C-K equation, we can obtain that the instantaneous probability is:

##### (9)
${Pij(S+t)=∑Pir(s)Prj(t)P0(0)=1,P1(0)=0,ΛΛ,Pk(0)=0$

The intuitive meaning of the C-K equation is start from state i and arrive at state j after s+ttime, and must first arrive at any state r after s time, and then transfer from state r to state j after t time.

P0(0) = 1, P1(0) = 0,… …, Pk(0) = 0, means that π0 has a probability of 1 and the other states have a probability of 0 at the initial moment. Equation (9) is expressed as a matrix differential equation in the following form:

##### (10)
${P′(t)=P(t)Ainitial⁢ conditionsP(0)$

P(t) = P0(t),P1(t),… …, Pn-k+1(t) represents the distributed probability of the system in various states at time t, is the row vector, and is also a one-dimensional matrix. P′(t) represents the derivative matrix of instantaneous probability of the system at time t

This is a system of first order linear differential equations, the general form of its solution is:

##### (11)
$P(t)=P(0)eAt=P(0)∑n=0∞tnn!An$

Since P and A are matrices, it is difficult to find the analytic expression of the above equation, we can use the Laplace transform to find A simpler expression, and let

$Pj∗(s)=∫0∞Pj(t)e−stdt,s>0$

The Laplace transform of Formula (10) simplifies to

##### (12)
$P∗(s)=∫0∞Pj(t)e−stdt=P(0)(SI−A)−1,s>0$

Where I is the identity matrix, P(t) can be obtained by inverting transform P* (s), then the instantaneous availability of the system is

##### (13)
$A(t)=∑j⊆WPj(t)$

However, it is difficult to obtain analytic expressions by *( ) inverse transformation. Results can be obtained by means of calculation tools, such as Matlab, Maple and other scientific calculation software.

## VI. EXAMPLES VALIDATE

Take Figure 2 as an example, the number of network nodes is 6, and the minimum number of network nodes that can work normally is 4, that is4/6[F] voting system. According to Equation (7), steady-state availability πi of each state is obtained, and then according to Equation (8), steady-state availability A of the network system is obtained. Table 1 is for steady-state availability of each states and the system when μ=0.5 hours and λ =2000 hours, Table 2 is for steady-state availability of each states and the system when μ=0.5 hours and λ =500 hours, and Table 3 is for steady-state availability of each states and the system when μ=1 hours and λ =100 hours.

##### TABLE III

As can be seen from Table 1, 2 and 3, As can be seen from Table 1, 2 and 3, the probability of π0 is the largest, and the probability of π2 and π3 are very small, even negligible.

Table 4 is the steady-state availability of a different μ and lambda system. Figure 1 is the curve trend diagram of Table 4, a more intuitive reflection of how steady-state availability varies with μ and λ

##### TABLE IV

In Table 4, the upper parameter is the node average failure parameter λ, the left parameter is μ. The x-coordinate of Figure 4 is the average node failure parameter λ, the y-coordinate is steady-state availability, and the four different curves are the average node repair time μ. As can be seen from Table 4 and Figure 4, under the Markov model, the steady-state availability of the system is very high, close to 1. The larger the λ, the smaller the μ, the more stable the system can be, which is consistent with the changing rules of P2P networks.

##### Figure 4.

According to the analysis of 5.3, P2P network availability cannot be fully reflected by calculating steady-state availability. Therefore, we also need to calculate the instantaneous availability of the system, and calculate the instantaneous availability of the system according to Equations (12) and (13) with the parameters used in Table 1. The results are shown in the following Figure 5.

##### Figure 5.

Instantaneous availability graphs of multiple states

In Figure 5, the horizontal axis is time and the vertical axis is instantaneous availability. Since k=4, there are four curves in the instantaneous curves of multiple states, corresponding toπ0, π1,π2 and π3 respectively. In order to make the graph more intuitive to reflect the change of the curve, the graph is divided into two parts, the left one are π1, π2 and π3, with the vertical coordinate of 0 to 0.004, and the right one is π0, with the vertical coordinate of 0.996 to 1. When four nodes fail, the entire network system is down and the network is unavailable. From the figure, we can see that π0 i.e. the zero nodes that are damaged gradually decrease from probability 1, and become stable after reaching a certain time point. The instantaneous availability of is very high, which is close to 1 indefinitely. While the instantaneous availability of other states is relatively small, π1 gradually increases with time until it becomes stable, while the instantaneous availability of π2 and π3 are very small, approaching 0 infinitely. It can be seen that the probability of system failure is very small.

## VII. CONCLUSION

For P2P networks, the discrete time Markov chain method is used to establish a model of state transition in P2P networks in this paper, and the repairability of network nodes is considered. The calculation formulas of steady-state availability and instantaneous availability are given by using the model, and the results of the above calculation are obtained. The results are compared with the changing rules of the network system, which conforms to the availability requirements of the P2P network. It shows that this model has certain reference value in the availability test of tactical P2P network.

## References

1. Lianhong Zhou. Availability of fiber optic systems[J]. Tsinghua Univ (Sci & Tech). 2002. 01
2. Fenghua Xie. Modular UPS reliability calculation and analysis[J]. Fuzzy Systems & Mathematics, 2002.
3. Jingle Zhang. Availability Analysis of Flexible Workflow Based on Stochastic Petri Net[J]. Computer Engineering. 2010.11
4. Jikun Yang. Reliability and Availability Analysis of Missile Weapon System Based on Fuzzy Bayesian Theory[J]. Journal of Naval Aeronautical and Astronautical. 2013
5. Qifeng Shao. Block chain: Architecture and Research Progress[J]. Chinese Journal of Computers. 2018, 41(5):769-788
6. Antonopoulos A M. Mastering Bitcoin: Unlocking Digital Cryptocurrencies[M]. California: O’Reilly Media, 2014: 137-172.
7. Yongnian Wang. Reliability evaluation of k/n[G] system Availability Analysis of Flexible Workflow Based on Stochastic Petri Net. reliability analysis. 2015:1-3
8. Geng Yan. Markov modeling method for availability of twoitem system under passivation[J]. Chinese Journal of Scientific Instrument. 2016:1-6
9. Yinan Jiang. The method of network reliability and availability simulation based on Monte Carlo[J]. ICQR2MSE.2012:1-5
10. Patrick Wüchner. Queueing Networks & Markov Chains[M]. Wiley-Interscience. 1998: 104-108
11. Du Haidong. Simulation Assessment of Degradation System Reliability under Imperfect Maintenance[J]. Journal of System Simulation. 2018, 30(8):2834-2840
12. Ivanovitch, Silva, Luiz Affonso, Guedes, Paulo, Portugal, et al. Reliability and availability evaluation of Wireless Sensor Networks for industrial applications[J]. Sensors, 2012, 12(1):806-838.
[PUBMED] [CROSSREF]
13. Datta A. An overview of codes tailor-made for better repairability in networked distributed storage systems[J]. AcmSigact News, 2013, 44(1):89-105.
[CROSSREF]
14. YUAN Yong. Blockchain: The State of the Art and Future Trends [J]. ACTAAUTOMATICASINICA, 2016, 42(4)481-494
15. Wenli Zhou. Survey of P2P technologies[J]. Computers Engineering and Design, 2006, 27(1):76-79
16. Xuelong Wang, Jing Zhang, et al. Survey on peer-to-peer key technologies[J]. Application Research of Computers, 2010, 27(3): 801-805, 823.

### FIGURES & TABLES

Figure 1.

The architecture of p2p networks in the blockchain

Figure 2.

P2P network topology

Figure 3.

State transition diagram

Figure 4.

Figure 5.

Instantaneous availability graphs of multiple states

### REFERENCES

1. Lianhong Zhou. Availability of fiber optic systems[J]. Tsinghua Univ (Sci & Tech). 2002. 01
2. Fenghua Xie. Modular UPS reliability calculation and analysis[J]. Fuzzy Systems & Mathematics, 2002.
3. Jingle Zhang. Availability Analysis of Flexible Workflow Based on Stochastic Petri Net[J]. Computer Engineering. 2010.11
4. Jikun Yang. Reliability and Availability Analysis of Missile Weapon System Based on Fuzzy Bayesian Theory[J]. Journal of Naval Aeronautical and Astronautical. 2013
5. Qifeng Shao. Block chain: Architecture and Research Progress[J]. Chinese Journal of Computers. 2018, 41(5):769-788
6. Antonopoulos A M. Mastering Bitcoin: Unlocking Digital Cryptocurrencies[M]. California: O’Reilly Media, 2014: 137-172.
7. Yongnian Wang. Reliability evaluation of k/n[G] system Availability Analysis of Flexible Workflow Based on Stochastic Petri Net. reliability analysis. 2015:1-3
8. Geng Yan. Markov modeling method for availability of twoitem system under passivation[J]. Chinese Journal of Scientific Instrument. 2016:1-6
9. Yinan Jiang. The method of network reliability and availability simulation based on Monte Carlo[J]. ICQR2MSE.2012:1-5
10. Patrick Wüchner. Queueing Networks & Markov Chains[M]. Wiley-Interscience. 1998: 104-108
11. Du Haidong. Simulation Assessment of Degradation System Reliability under Imperfect Maintenance[J]. Journal of System Simulation. 2018, 30(8):2834-2840
12. Ivanovitch, Silva, Luiz Affonso, Guedes, Paulo, Portugal, et al. Reliability and availability evaluation of Wireless Sensor Networks for industrial applications[J]. Sensors, 2012, 12(1):806-838.
[PUBMED] [CROSSREF]
13. Datta A. An overview of codes tailor-made for better repairability in networked distributed storage systems[J]. AcmSigact News, 2013, 44(1):89-105.
[CROSSREF]
14. YUAN Yong. Blockchain: The State of the Art and Future Trends [J]. ACTAAUTOMATICASINICA, 2016, 42(4)481-494
15. Wenli Zhou. Survey of P2P technologies[J]. Computers Engineering and Design, 2006, 27(1):76-79
16. Xuelong Wang, Jing Zhang, et al. Survey on peer-to-peer key technologies[J]. Application Research of Computers, 2010, 27(3): 801-805, 823.