Modeling and analyzing performance of software for wireless sensor networks