💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥1 概述
由Heinzelman等人提出的LEACH协议(低能耗自适应聚类层次)假设了一个由密集的、能量受限的同质节点组成的传感器网络,这些节点需要将它们的数据报告给一个汇聚节点。在LEACH中,采用了基于TDMA的介质访问协议,结合了聚类和简单的“路由”协议。详细文档见第四部分。
LEACH(Low Energy Adaptive Clustering Hierarchy)是一种针对无线传感器网络(WSN)的介质访问协议,它是一种基于聚类的协议,旨在实现高效的能源消耗和避免碰撞。LEACH协议通过在传感器节点之间形成簇(cluster)来组织网络,每个簇有一个临时的簇头(cluster head),负责收集和汇总该簇中其他节点的数据,并将汇总后的数据传输给基站或者网络的其他部分。
LEACH协议的主要特点包括:
1. 能量均衡:LEACH通过随机选择临时簇头的方式,实现了节点间的能量均衡,避免了少数节点因频繁传输数据而过早耗尽能量的问题。
2. 簇头轮换:LEACH采用了周期性轮换簇头的机制,以分担网络中各个节点的负载,延长整个网络的生命周期。
3. 分布式协议:LEACH协议是一种分布式协议,不需要全局信息,只依赖于节点之间的局部通信和协作,因此适用于大规模、密集部署的传感器网络。
4. 自适应性:LEACH具有一定的自适应性,能够根据节点的能量状态和通信负载动态调整簇头的选择和数据传输策略。
总的来说,LEACH协议在无线传感器网络中具有重要的研究和应用价值,能够有效地提高网络的能源利用率和数据传输效率,延长网络的生命周期,适用于各种环境下的传感器网络应用。
📚2 运行结果
部分代码:
SRP=zeros(1,Model.rmax); %number of sent routing packets
RRP=zeros(1,Model.rmax); %number of receive routing packets
SDP=zeros(1,Model.rmax); %number of sent data packets
RDP=zeros(1,Model.rmax); %number of receive data packets
%total_energy_disipated=zeros(1,Model.rmax);
Sum_DEAD=zeros(1,Model.rmax); % Sum of dead nodes for each round
CLUSTERHS=zeros(1,Model.rmax); % Number of cluster heads for each round
AllSensorEnergy=zeros(1,Model.rmax); % Total energy of all sensors for each round
%%%%%%%%%%%%%%%%%%%%%%%%% Start Simulation %%%%%%%%%%%%%%%%%%%%%%%%%
global srp rrp sdp rdp %declearing variables
srp=0; %counter number of sent routing packets
rrp=0; %counter number of receive routing packets
sdp=0; %counter number of sent data packets
rdp=0; %counter number of receive data packets
%Sink broadcast start message to all nodes
Sender=n+1; %Sink
Receiver=1:n; %All nodes
Sensors=sendReceivePackets(Sensors,Model,Sender,'Hello',Receiver);
% All sensor send location information to Sink .
Sensors=disToSink(Sensors,Model);
Sender=1:n; %All nodes
Receiver=n+1; %Sink
Sensors=sendReceivePackets(Sensors,Model,Sender,'Hello',Receiver);
%Save metrics
SRP(1)=srp; %updating routing pakets
RRP(1)=rrp;
SDP(1)=sdp; %updating data packets
RDP(1)=rdp;
x=0; %variable
%% Main loop program
for r=1:1:Model.rmax %loop from 1 to number of circles
%%%%%%%%%%%%%%%%%%%%%%%%%%%% Initialization %%%%%%%%%%%%%%%%%%%%%
%This section Operate for each epoch
member=[]; %Member of each cluster in per period
countCHs=0; %Number of CH in per period
%counter for bit transmitted to Bases Station and Cluster Heads
🎉3 参考文献
文章中一些内容引自网络,会注明出处或引用为参考文献,难免有未尽之处,如有不妥,请随时联系删除。