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.
cout<<"\t\t Throughput of Pure Aloha\n";
cout<<"Enter the value of G:";
cout<<"\n\nThroughput for given pure aloha protocol is (S):" <