On global clustering algorithm: layer-oriented approach for First - Last node dying applications in wireless sensor networks