Redundancy and Fault Tolerance
AP Computer Science Principles · Unit 4 — Computer Systems and Networks
More than one way through
Redundancy is the inclusion of extra components that can be used to mitigate failure of a system if other components fail. In a network, redundancy means extra connections or devices so that there is more than one path between devices. A system is fault-tolerant when it can continue to operate (perhaps more slowly) after some of its components fail.
The Internet is fault-tolerant because routing is dynamic: when a connection fails, routers stop sending packets over it and use another available path. Fault tolerance therefore depends on whether another path exists, not on how fast the remaining paths are.
A connection or device whose failure alone disconnects two parts of a network is a single point of failure. To find one, remove the candidate in your head and ask whether every remaining pair of devices still has a path. To measure how fault-tolerant a connection between X and Y is, find the minimum number of connections that must fail before X and Y cannot communicate. A useful shortcut: that number is at most the number of connections attached to X (or to Y), because cutting all of them certainly isolates it.
Counting failures and paying for redundancy
To show that a set of failed connections disconnects X from Y, it is enough to exhibit it and check that no path survives. To show that fewer failures are not enough, find that many paths from X to Y that share no connection: each failure can break at most one of them. When the number of connection-disjoint paths equals the size of a disconnecting set, both numbers are the answer.
Redundancy is not free. Every extra connection costs money to build and maintain, and some designs add many links while leaving the real weak point untouched. The most valuable new connection is one that creates a second route around an existing single point of failure, ideally around several of them at once: a link that closes one long loop through a chain of weak points removes all of them together.
Fault tolerance is also a matter of devices, not only cables. A home connected to the Internet through one router has a single point of failure no matter how redundant the backbone beyond it is; the chain is only as fault-tolerant as its least redundant segment.
Worked example: chọn một dây để thêm
Một mạng có các đường nối A–B, B–C, C–A, C–D, D–E, E–F, F–D, F–G. Nhà thiết kế chỉ được thêm một đường nối. Hãy chọn đường để sau khi thêm, hỏng bất kỳ một đường nối nào thì mọi cặp thiết bị vẫn liên lạc được.
Solution
Bước 1 — tìm điểm hỏng đơn hiện có. A, B, C tạo tam giác, D, E, F tạo tam giác; mỗi dây trong tam giác đều có lối vòng. Còn C–D là dây duy nhất nối hai tam giác, và F–G là dây duy nhất của G. Vậy có hai điểm hỏng đơn: C–D và F–G.
Bước 2 — một dây phải "vòng" qua cả hai. Dây mới cần tạo một chu trình chứa cả C–D lẫn F–G, nghĩa là một đầu nằm phía tam giác A, B, C và đầu kia là G. Chẳng hạn A–G: chu trình A–C–D–F–G–A chứa cả hai dây.
Bước 3 — loại các lựa chọn hấp dẫn nhưng thiếu. C–F chỉ tạo vòng C–D–F–C, cứu C–D nhưng G vẫn treo trên F–G. E–G cứu F–G nhưng C–D vẫn đơn độc. Các lựa chọn B–G hay C–G cũng đạt yêu cầu như A–G.