1. generate test task 𝑇 𝑗 with sequence number 𝑗 ;
2.  broadcast test request TEST_REQ( 𝑐 𝑖 . C H , 𝑗 , 𝑇 𝑗 ) to its
  member nodes 𝑐 𝑖 . C M s ;
3. generate the expected result 𝑅 ( 𝑐 𝑖 . C H , 𝑗 ) for 𝑇 𝑗 ;
4. set the timer to be 𝑇 o u t ;
5. Initialize the faulty CM set 𝑐 𝑖 . 𝑆 𝐹 _ C M and fault-free
  CM set 𝑐 𝑖 . 𝑆 F F _ C M with NULL;
6. Each CM sends test response TEST_RES( 𝑐 𝑖 . C M , 𝑗 , 𝑇 𝑗 )
 in random back-off time 𝑡 < 𝑇 o u t ;
7. while receiving test response TEST_RES from any
node 𝑐 𝑖 . C M in 𝑐 𝑖 . C M s
8.  if ( 𝑅 ( 𝑐 𝑖 . C H , 𝑗 ) = 𝑅 ( 𝑐 𝑖 . C M , 𝑗 )) then
9.       𝑐 𝑖 . 𝑆 F F _ C M 𝑐 𝑖 . 𝑆 F F _ C M { 𝑐 𝑖 . C M } ;
10.  else
11.    𝑐 𝑖 . 𝑆 𝐹 _ C M 𝑐 𝑖 . 𝑆 𝐹 _ C M { 𝑐 𝑖 . C M } ;
12. end while
13. send TURNDEAD message to 𝑐 𝑖 . 𝑆 𝐹 _ C M ;
Algorithm 2: Lower layer diagnosis algorithm executed by cluster head 𝑐 𝑖 .CH.