Академический Документы
Профессиональный Документы
Культура Документы
ID: 201716050
Assignment
MATLAB Code:
T = 1;
SimulationTime = 100000;
TotalThroughput = zeros(length(0.02:0.02:0.3),1);
TotalArrivalRate = zeros(length(0.02:0.02:0.3),1);
index = 0;
end
end
for n = 1:NumberOfNodes
Throughput(n) = NumberOfSuccessfullyTransmittedPackets(n)/SimulationTime;
end
TotalThroughput(index) = sum(Throughput);
TotalArrivalRate(index) = sum(NumberOfGeneratedPackets)/SimulationTime;
end
subplot(1,2,1)
plot(TotalArrivalRate,TotalThroughput)
ylim([0 0.4])
title('Practical_analysis')
xlabel('TotalArrivalRate')
ylabel('TotalThroughput')
%%
G = TotalArrivalRate;
%G = 0.02:0.02:0.3;
s = G.*exp(-1.*G);
subplot(1,2,2)
plot(G,s)
ylim([0 0.4])
title('Theoritical_analysis')
xlabel('TotalArrivalRate')
ylabel('TotalThroughput')
%%
Graph
Comparison:
TotalThroughput Vs TotalArrivalRate curve is quite similar in practical analysis and theoretical analysis.
In practical scenario Maximum Throughput is slightly higher than the theoretical calculation
Varying Number of Nodes :
For NumberOFNOdes = 20
For NumberOFNOdes = 50
For NumberOFNOdes = 80
Discussion:
When we increases NumberOfNodes, TotalThroughput decreases. So, Slotted ALOHA is less number of
nodes.