Sensor networks are established of many inexpensive sensors with limited energy and computational resources and memory. Each node can sense special information, such as the temperature, humidity, pressure and so on and then send them to the central station. One of the major challenges in these networks, is limit energy consumption and one of the ways for reducing energy consumption in wireless sensor networks, is reducing the number of packets that are transmitted in the network.