Experiment no. 7 Aim: To write a C++ program to compute the throughput for pure Aloha. Software used



Yüklə 50,22 Kb.
tarix11.07.2018
ölçüsü50,22 Kb.
#55428

EXPERIMENT NO.- 7

AIM: To write a C++ program to compute the throughput for pure Aloha.

SOFTWARE USED: Turbo C++

THEORY: Pure ALOHA is introduced by Norman Abramson and his associates at the University of Hawaii in early 1970. The Pure ALOHA  just allows every station to transmit the data whenever they have the data to be sent. When every station transmits the data without checking whether the channel is free or not there is always the possibility of the collision of data frames. If the acknowledgment arrived for the received frame, then it is ok or else if the two frames collide (Overlap), they are damaged.

If a frame is damaged, then the stations wait for a random amount of type and retransmits the frame till it transmits successfully. The waiting time of the each station must be random and it must not be same just to avoid the collision of the frames again and again. The throughput of the Pure ALOHA is maximized when the frames are of uniform length. The formula to calculate the throughput of the Pure ALOHA is S=G*e^-2G, the throughput is maximum when G=1/2 which is 18% of the total transmitted data frames.



SOURCE CODE:

#include

#include

#include

void main()

{

clrscr();



cout<<"\t\t Throughput of Pure Aloha\n";

float g;


cout<<"Enter the value of G:";

cin>>g;


double t;

t=g*exp(-2*g);

cout<<"\n\nThroughput for given pure aloha protocol is (S):" <

getch() ;



}

OUTPUT:


Yüklə 50,22 Kb.

Dostları ilə paylaş:




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə