Professional Documents
Culture Documents
How it works
Each wireless station/user first listens to the wireless medium
to detect transmissions. If the medium is sensed to be busy,
the user waits until the ongoing transmission is over. If the
medium is detected to be idle for a Distributed Inter-Frame
Space (DIFS) interval, the user enters a backoff procedure. In
the backoff procedure, the user selects a random backoff time
(in slots) from a contention window, and starts decrementing a
backoff counter for each slot that is sensed to be idle. If, while
counting down, another user begins transmitting, the user in
backoff mode suspends its counting, until the transmitting user
finishes and the medium is sensed to be idle for a DIFS
duration, and resumes its countdown thereafter. Once the
backoff interval expires, the user begins transmission. The
value of the random backoff interval is chosen from an interval
called the Contention Window (CW), which lies between two
preconfigured values, CW_min and CW_max. The contention
window is set to CW_min at the first transmission attempt, and
doubles after each unsuccessful attempt, until it reaches
CW_max (after which it remains at CW_max). The contention
window is reset to CW_min after every successful
transmission.
What we want
Results
Algorithm
for i=1:1:n
S(i).xd=rand(1,1)*xm; %generates a random no. use to randomly
distibutes nodes on x axis
XR(i)=S(i).xd;
S(i).yd=rand(1,1)*ym; %generates a random no. use to randomly
distibutes nodes on y axis
YR(i)=S(i).yd;
S(i).G=0; %node is elegible
talhar=rand*a
S(i).E=Eo*(1+talhar);
S(i).A=talhar;
E(i)= S(i).E;
if (E(i)>Echeck)
mony=mony+1;
end
Et=Et+E(i); %estimating total energy of the network
%initially there are only nodes
S(i).type='N';
end
Two sinks
100 nodes
Energy
Probability
Transmitter
Receiver
Compression of signal
Distance
Randomly distributed nodes
Total energyof the network
Distance between initial and farthest point \