Leach: Effect of round length on transferring images using the DWT compression technique

. The advancements in electronics has permitted the production of small devices called sensors. These nodes can capture different types of data like images. The network that performs this role is called WMSN (wireless multimedia sensor network). In this kind of networks, a routing protocol is very important. One of the key features of Leach is the efficient management of energy. However, when it comes to send images, we have to verify the energy efficiency. In fact, we use transferring images using WMSN like agriculture and surveillance among others in multiple areas. In this paper, we are going to simulate this protocol using Omnet++/ Castalia. We are also going to see the effect of round length on energy consumption and the number of transferring images.


Introduction
Recently, the sensors have experienced very significant improvements in terms of miniaturization and low price.All of these features are achieved through microchip industry.They are composed of the following elements: a detection unit, a transmission equipment, a processor and energy control [1].When we linked them together, they form a WSN.The following figure shows a WSN structure.

Fig. 1. A wireless sensor network
Nodes use equipment's that can detect images, videos and audio from what we have called the Wireless Multimedia Sensor Network (WMSN).This type of network could be made up of a number of nodes.In fact, they capture multimedia content (images, voice or video) or scalar data (heart beat or blood pressure).Then they send the collected data to Sink using the network.Actually, WMSNs are applied in many fields: health care [2], security [3], agriculture [4], etc... .The nodes have the capacity to deal with the environment by using multimedia sensors such as cameras or microphones.It suffers from many constraints: the limited Resources, the suitable applications and the big consumption of bandwidth [5].One of the ways to manage the limited energy is to use clustered routing protocols.In this article, we will use Leach as our routing protocol [6].This protocol uses the notion of clustering, which lasts a certain time.After that, they are trained again, and so on.In this protocol, for each formation of the cluster, the cluster leaders are chosen at random.
In this work we will see the following chapters.First, we will detail the Leach protocol.Second, we will show and analyze the simulation results.After that we will conclude our article.The Leach routing protocol uses self-organizing and adaptive clustering.This routing protocol is very efficient in energy consumption.However, transmitting from the cluster-head to the sink in a hope poses problems such as congestion and packet loss.The following figure shows the transmission between the cluster-head (CH) and the sink.When creating each tower, this protocol follows the following steps: advertising phase, cluster configuration phase, schedule creation and data transmission.

Advertisement Phase
In the creation of a cluster, each node will decide to be a CH or not by applying the formula 1.A node picks a random number between 0 and 1.The node decides to be a CH when the number is inferior to the threshold T(n). (1) In this formula, P is the probability of being chosen as a cluster head among all nodes, r is the actual round that has not been chosen as a cluster-heads in the last 1/P rounds.If a node is not a Cluster-Head, It transmits a message that inform other nodes of its existence.

Cluster Set-Up Phase
After receiving the broadcasting message, the node will decide which cluster CH to join using a CSMA MAC.In this process, Cluster-heads are active.

Creation of schedule
After the CH receives signals from nodes that want to join the cluster.It creates a schedule for each node called TDMA.It allows each node to send its data in a predefined timing.Then, the TDMA is sent to the nodes that belongs to the concerned CH.

Data Transmission
After receiving the TDMA, the nodes that belong to each cluster transmit their packets to the CH.This transmission respects the timing defined by the TDMA.Then the cluster-Head transmits its data to the sink.

Application layer
In our application, we transmit images randomly in the time.In addition, they process the captured images by compressing them before transmitting them.That is why, we used an application in the application layer to apply the compression/ decompression technique of Haar transform [7].In transmission phase, we load images in gray.Then, we apply the Haar wavelet transform method for two levels on the image.Then, we divide the LL2 sub-band into 8×8 blocks, and we implement the quantization on each block.After that, we apply a threshold value.At the end, we apply the entropy coding (RLE) on each block.At the end, we transmit the vector of values with its meta-data to the Sink.Once it receives the packet, we use the quantization matrix to apply the inverse RLE.Then, we obtain the 8×8 matrix by using the inverse quantization process.When the sink receives all the packets, it applies the inverse the Haar wavelet transform method for two levels.The figure 4 shows this process.

Fig. 3. Compression and decompression of images process used in our simulation
The figure 3 represents the DWT transform technique.This technique is illustrated by the figure 4.

Analysis of simulation results
In our work, we used Leach routing protocol to transmit compressed images using DWT.We simulated this protocol by using Omnet++\Castalia framework.This framework is characterized by implementing the radio model CC2240 [8].The table 1 displays the parameters that we used in our simulations.

Size of Image 128x128
Quantization percentage 85% Then, the round length 50s consumes less than 30s.We can explain these results by the fact that in 70s round length the process of cluster creation is less than other round lengths.Thus, the energy is saved for future cluster creation.These results are confirmed by the figure 6.This figure shows that in 70s round length the last node dies in 1550 s.But, in the 50 s the last node dies in 1100 s.Lastly, in 30s round length the last node dies in 1040s.As a result, we can conclude that the more round time is, the less energy is consumed by the network.Thus, the lifetime of the nodes is extended.The figure 7 displays the quantity of received images per round length.It shows clearly that by using a 70 s round length, we got more received images.Then 50s rounds, length.Lastly, in the 30s round length we got the last received images.We can explain these results by the fact that the more round period is longer, the longer period of TDMA we will get.So, the TDMA time will allow nodes to send more packets.Thus, we will have more received images.

CONCLUSION:
In this paper, we used Leach protocol in image transmission.We, also, applied different round lengths to see their effect on energy consumption and the number of received images.We noticed that when we have a long round length, we have a better life network extension and more received images.In a future work, we can test leach in video transmission to check its ability to transport video.

Number of received images
Round time length in …

Fig. 7 .
Fig. 7. Received images by the Sink per round length