Skip to content

Instantly share code, notes, and snippets.

@thanhpk
Last active February 8, 2017 11:22
Show Gist options
  • Save thanhpk/cda08f095ccbbecd8c4736d6fff737cb to your computer and use it in GitHub Desktop.
Save thanhpk/cda08f095ccbbecd8c4736d6fff737cb to your computer and use it in GitHub Desktop.
*1 A die at 2
B cant send message 5 -> tell C to discard the previous package
message is stored in B, if A is the root -> B discard the message
else
2 B down at 2
A wait for ACK and retry on new B
*3 A down at 3
B can't send request 5
if A is root, B discard message, also, tell C to discard the message
if A is not (we dont care vs tell C to discard and wait for A to come back)
4 B down at 3
A waiting for request 5 but get timeout since B died
A retry the message on B'
5 C down at 1
B cant reach C -> try on C'
6 B down at 4
A wating for request 5 but get timeout -> retry on B'
C waiting for request 7 but get timeout -> discard the message
7 C down at 2
B don't get ACK so retry on C'
8 B die at 5
A timeout -> retry on B'
C timeout too -> discard the message
like 6
9 C down at 3
B cant send 7 -> retry on C'. C' got the message and run
10 B down at 6
A wait for timeout, reset the protocol on B'
C timeout for request 7. Discarding the message
*11 A die on 4
B dont get ACK. If A is root -> discard the message
C timeout and discard the message
if a is not root,
12 B down on 7
same as B down at 6
13 C down at 4
like C down a 3
14 B down at 8
nothing to worry, C waiting for B' and "reconnect"
15 C down at 5
B wait for C' to up
GOOD
A B C
|==>| |
1 2 |
|<--| 5
| 4 |
| |==>|
3 6 7
| |<--|
| 8 |
|<==| |
11 10 9
|-->| |
| 12 |
| |==>|
| 14 13
| |<--|
| | 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment