# An Efficient Causal Group Communication Protocol for Free Scale Peer-to-Peer Networks
## 3 Results
### Protocol Composition
#### 3.1.4. Causal Protocol Description
* The \(CI\) does not contain an element for peer 1, so a new message dependency is inserted (see Listing 12, Line 10): \(CI=<\)1, 001\(>\), \(<\)2, 1\(>\). * \(m(e)_{3}.CI\) contains \(<\)2, 1\(>\), so this pair is removed from \(CI\) (see Listing 12, Line 19): \(CI=<\)1, 001\(>\)  
Diffusion of \(m_{4}\) at \(P(e)_{2}\)  
* First, an external peer increments its clock (see Listing 9, Line 1): \(VTx(p)=(111,2,1)\). An external peer generates a message \(m_{4}=(2,2,<\)1, 001\(>\), \(\O\), \(\O\), \(\O\)) (see Listing 9, Line 2), and the \(CI\) is cleared (see Listing 9, Line 3). Reception of \(m_{4}\) at \(P(e)_{3}\)  
* When a peer \(P(e)_{3}\) receives \(m_{4}\), it checks its delivery condition. The FIFO delivery condition is satisfied (see Listing 11, Line 1): 2 = 1 + 1 and \(m_{4}\)_CI_ contains \(<\)1, 001\(>\) and \(V\)Tx[1] is a bit vector, so this dependency is satisfied (see Listing 11, Line 2): 001 & 111 = 001. Both conditions are satisfied, and the message \(m_{4}\) can be delivered. * A clock component for peer 2 is updated with a new value (see Listing 12, Line 2): \(V\)Tx(\(p\)) = (111, 2, 1). * The _CI_ does not contain an element for peer 2, so a new message dependency is inserted (see Listing 12, Line 10): _CI_ = \(<\)1, 001\(>\), \(<\)2, \(2>\). * \(m_{4}\)_CI_ contains \(<\)1, 001\(>\) so this pair is modified (see Listing 12, Line 21): _CI_ = \(<\)1, 000\(>\), \(<\)2, \(2>\), and empty dependency \(<\)1, 000\(>\) is removed, so _CI_ = \(<\)2, \(2>\). Reception of \(m_{4}\) at \(Sp_{1}\)  
* When a super peer \(Sp_{1}\) receives \(m_{4}\), it checks its delivery condition. * The FIFO delivery condition is satisfied (see Listing 11, Line 1): 2 = 1 + 1. \(m_{4}\)_CI_ contains \(<\)1, 001\(>\) and this dependency is satisfied because \(id_{ext}\) = 1. Both conditions are satisfied and the message \(m_{4}\) can be delivered. * A clock component for peer 2 (see Listing 13, Line 29) and for this super peer (see Listing 13, Line 6) are updated with a new value: \(V\)Tx(\(p\)) = (4, 2, 1). Transformation of \(m_{4}\) at \(Sp_{1}\) to Internal Group  
* As \(m_{4}\)_CI_ contains an element for process 1 (see Listing 15, Line 1) \(DV\) is initialized to 001. In this case, \(m_{4}\)_CI_ does not contain other dependencies so \(m_{4}\) is transformed to an internal group: \(m(i)_{4}\) = (0, 4, 0, 001, _Data_) and \(TT\)[2] contains \(<\)1, \(2>\) (see Listing 15, Line 16). * \(m(i)_{4}\)_Last_ is updated to 2: \(m(i)_{4}\) = (0, 4, 2, 001, _Data_) and \(TT\) is updated with message identifiers before and after transformation (see Listing 15, Line 19): \(TT\)[2] = \(<\)1, \(2>\), \(<\)2, \(4>\)
* A bit for internal message is set in variable \(I\) (see Listing 15, Line 20): \(I\) = 0001. Reception of \(m(i)_{4}\) at \(P(i)_{2}\)  
* When a peer \(P(i)_{2}\) receives \(m(i)_{4}\), it checks its delivery condition. * The FIFO delivery condition is satisfied (see Listing 5, Line 1): \(RV\)[2] = 1, and the causal delivery condition (see Listing 5, Line 2) is also satisfied: 001 & 111 = 001. * Both conditions are satisfied, and the message \(m(i)_{4}\) can be delivered. * The receive vector is updated (see Listing 6, Line 1): \(RV\) = 1111. * The message dependency vector is updated as well (see Listing 6, Lines 3-5): \(DV\) = 0001. Reception of \(m(i)_{4}\) at \(P(i)_{1}\)  
* When a peer \(P(i)_{1}\) receives \(m(i)_{4}\), it checks its delivery condition. * The FIFO delivery condition is satisfied (see Listing 5, Line 1): \(RV\)[2] = 1, but the causal delivery condition (see Listing 5, Line 2) is violated: 001 & 11 = \(\O\)\(\
eq\) 001. Therefore, the message delivery condition is not satisfied, and message \(m(i)_{4}\) should be buffered. Reception of \(m(i)_{3}\) at \(P(i)_{1}\)  
* When a peer \(P(i)_{1}\) receives \(m(i)_{3}\), it checks its delivery condition. * The FIFO delivery condition is satisfied (see Listing 5, Line 1): \(RV\)[0] = 1. The causal delivery condition (see Listing 5, Line 2) is also satisfied: 01 & 11 = 01. Both conditions are satisfied, and the message \(m(i)_{3}\) can be delivered.