Simulation Analysis of leaching & LEACH-C (2)

Source: Internet
Author: User

From Prince space http://272387537.qzone.qq.com/

 

There are too many steps to introduce the simulation of leaching on the Internet, and there are also a lot of contrast between the node death trend chart of leaching and LEACH-C! Apply the protocol of the leaching protocol to the NS2. 27 simulation came out, do not know how to do LEACH-C simulation, but after a day's efforts, it seems that only use the simulation of the two script files to make the corresponding modifications. Because the files implemented by the LEACH-C function already exist under MIT! Next we will briefly introduce the modification process of the two script files! First. test file open, (Path: C:/cygwin/home/Administrator/ns-allinone-2.27/ns-2.27 test file leach_test and leach-c_test are put under this path) add in the last line. /leach-c_test.

.......

Cd ../../
./Leach_test
/Leach-c_test

Here I used the LEACH-C_TEST, next I want to write the leach-c_test file, I COPY its own leach_test file, and then modify it based on. Open the file and modify it as follows:

The first line of this file is changed to alg = leaching-c, which seems to be changed!

Then enter the path ns-allinone-2.27/ns-2.27 in startxwin. bat because the environment variables and MAKEFILE files have been configured in the leaching simulation path! So no configuration is required here! OK, directly perform./test. Then wait until the simulation is complete (wait 500 seconds), observe the leach-c.alive file size does not change. We can compare the simulation of leaching. alive and leach-c.alive!

Extract data Graph

Cd mit/leach_sims go to the mit/leach_sims directory

Gawk-f test. awk leaching. alive> the data of leaching. gnuplot is stored in leaching. gnuplot.

Gawk-f test. awk leach-c.alive> data of leachc. gnuplot leaching-c is put in leachc. gnuplot

 

Gnuplot carriage return

After gnuplot>, enter the command maid, and press ENTER

Draw multiple curves on a graph separated by commas (,).

The following figure shows the simulated comparison:

Figure is out, but as if with the online simulation of the figure is not very similar, LEACH-C in 70 seconds began to have nodes died! It seems abnormal! However, no reason is found! If a friend who has learned NS2! Thank you!

Leaching & LEACH-C (Xu)

 

 

I read some articles and summarized them myself! The simulation of the LEACH-C and leaching and found that the effect of their use and LEACH-C and BS position has a great relationship! In the previous article, our BS coordinates were in bs_x = 50 bs_y = 175. During this simulation, I only made a small change to make some changes to the BS position. Bs_x = 0 bs_y = 0. That is, BS is at the coordinate origin! Other steps remain unchanged! After the simulation, we found that we were not talking nonsense.
Compared with the previous figure, we can see that, when BS is exploring outside the region, the time for the node to die has been extended from 70 seconds to 370, and the effect is better! However, the leaching protocol does not seem to have any impact! However, when the node begins to die, the trend is steep! The specific cause is not analyzed yet! Analyzed and sent again!

 

Write your personal opinion on the "Steep" problem of this simulation. I personally understand this, the energy of each node and all nodes of the LEACH-C and leaching are the same, we analyze the trend of node survival, we should start from two aspects. First, the longer the node trend stays at 100, the better the protocol in this scenario. Second, when the node begins to die, the less time the curve goes to 0, that is, the closer it is to the vertical line, close to 0 (so-called steep ). The Protocol is also superior.
In theory, we want our node trend graph to look like this, which is the best! Therefore, I personally think that in the above simulation process and scenario, the leaching is more in line with the two points I have summarized, so it is better.
I don't know if the analysis is correct. If someone has a new idea, leave a message to discuss it!


 

Leaching & LEACH-C(XuXu)

 

Modify BS to put the 200,200 bs_x = 200 bs_y = 200 leach_test leach-c_test file in .. /Test

After many experiments, I replaced the BBS position in many places, and finally I could draw a picture to prove my thoughts on the materials I read! Continue


 

 

In this simulation result, I put BS at the position of 200,200, because in our simulation script file, nodes are scattered within the range of X, our entire simulation scenario is set to 1000X1000. Therefore, when BS is set to 200,200, BS is outside the detection area.

So I can also draw the following conclusion, when BS is located inside the probe node range, leaching is superior than the LEACH-C, but when BS outside the probe area, LEACH-C will be more superior than leaching!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.