PBFT (Practical Byzantine Fault Tolerance) Practical Byzantine Fault Tolerance Algorithm
The Practical Byzantine Fault Tolerant System (PBFT) reduces the complexity of the Byzantine protocol, from exponential level to polynomial level (Polynomial) , making the application of Byzantine protocol in distributed systems possible.
Node role:
Primary node and ordinary node, the Primary node of the PBFT system is elected in turn, which is different from zab and raft
- Master node p = v mod |R|
- p: Primary node number
- v: View number
- |R|Number of nodes
Primary role analysis
The role of the Primary node:
- When working normally, receive the client's transaction request, after verifying the identity of the request, set the number for the request, and broadcast the pre-prepare message
- When the new Primary is elected, send View-New information according to the View-Change messages collected by itself to let other nodes synchronize data
- Primary maintains heartbeat with all other nodes
The status of the Primary node is the same as that of the follower node, and there is no privilege
If the Primary goes down, it will trigger a re-election due to the heartbeat timeout, ensuring stable system operation
If the Primary maliciously sends a message with the wrong number, it will be detected by the follower in the subsequent operations, because the prepare and commit phases will be broadcast. Once they are inconsistent, the view-change
If the primary does not send the received request, the client will re-send the request to all replicas when the client does not reply after the timeout. The kids find that the primary hides the message privately, view-change
If the primary node tampered with the message, because there are data and client signatures in the Request, the primary cannot tamper with the message, and other replicas will first verify the validity of the message, otherwise it will be discarded, view-change
In summary, if a primary node with restricted permissions is down, or no message occurs, or a message with an incorrect number is sent, or a message is tampered with, it will be sensed by other nodes and trigger view-change.
Algorithm introduction
Fault tolerance
The fault tolerance of raft algorithm only supports fault-tolerant faulty nodes, and does not support fault-tolerant malicious nodes, so the fault tolerance rate is high, and more than half of the nodes are normal.
The PBFT algorithm can tolerate less than 1/3 invalid or malicious nodes
Evil node: In addition to deliberately not responding to requests from other nodes in the cluster, it can also deliberately send wrong data, or send different data to different other nodes, so that the nodes of the entire cluster cannot finally reach a consensus. This kind of node It is a malicious node.
Paper source
Chinese address: https://blog.csdn.net/DeveloperRen/article/details/82771710
The address of the original paper: http://pmg.csail.mit.edu/papers/osdi99.pdf
Secondary blog: https://www.jianshu.com/p/cf1010f39b84
-------------End of this article Thank you for reading-------------