Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Lab report on to plot efficiency of pure and slotted aloha in matlab a data communication and networking project by Alamgir Hossain
1. P a g e | 1
CONTENT
Page
Abstract ------------------------------------------------------------------------------------------------ 2
Chapter 1: Introduction
1.1 Introduction-------------------------------------------------------------------------- 3
1.2 Objectives---------------------------------------------------------------------------- 3
1.3 Methodology------------------------------------------------------------------------- 4
Chapter 2: Project Description
2.1 System Analysis-------------------------------------------------------------------- 5
2.1.1 Pure ALOHA----------------------------------------------------------------- 5
2.1.2 Slotted ALOHA-------------------------------------------------------------- 6
2.2 Implementation --------------------------------------------------------------------- 7
2.2.1 Pure ALOHA in matlab----------------------------------------------------- 7
2.2.3 Slotted ALOHA in matlab-------------------------------------------------- 9
2.2.5 Pure ALOHA and Slotted ALOHA in matlab-------------------------- 10
Chapter 3: System Architecture
3.1 Flowchart-------------------------------------------------------------------------- 15
3.2 System Hardware----------------------------------------------------------------- 16
3.2.1 Key Features ---------------------------------------------------------------- 17
Chapter 4: Advantage & Conclusion
4.1 Advantage -------------------------------------------------------------------------- 18
4.1.1 Advantage of pure ALOHA protocol------------------------------------- 18
4.1.2 Advantage of slotted ALOHA protocol---------------------------------- 18
4.2 Conclusion-------------------------------------------------------------------------- 19
2. P a g e | 2
Abstract
ALOHA is the earliest random access method. It has design for a radio (wireless) LAN, but it
can be used on any shared median. This method is shared between the stations. When the station
send data, another station may attempt to do so at the same time. The data from the two stations
collide and become garbled. In ALOHA has two part that’s are pure ALOHA and slotted
ALOHA. we work the efficiency of pure ALOHA and slotted ALOHA in Matlab software. We
also show that how to generate the efficiency curve of both method using Matlab. Both
technique has been implemented and we can see that the slotted ALOHA method has better
efficiency than pure ALOHA method. we use those technique for passing/transferring packet
using shared channel. In report we show their graph, flowchart, system architecture and system
hardware. we apply this technique to minimize the number of collision and improve the network
efficiency.
3. P a g e | 3
Chapter 1
Introduction
1.1 Introduction
ALOHA, the earliest random access method. It was developed for a radio (wireless) LAN, but it
can be used on any shared memory. It is obvious that there are potential collision in this
argument. The medium is shared between the stations. When a station sends data, another station
may attempt to do so at the same time. The data from the two stations collide and become
garbled.
The ALOHA protocol is an OSI layer 2 protocol for LAN networks with broadcast topology.
The first version of protocol is basic:
If we have to data send, send data.
If the message collides with another transmission, try resending “later”
1.2 Objective:
By this experiment we know:
To compare the efficiency of pure ALOHA and slotted ALOHA
To plot the efficiency in MATLAB
4. P a g e | 4
1.3 Methodology
We work on plot efficiency of pure ALOHA and slotted ALOHA in MatLab. We see in our
project how we can get pure ALOHA and slotted ALOHA efficiency graph generating by
MatLab. In our MatLab coding we get at first get a array. Them we use slotted ALOHA rule
S=G*e-G
. After that we insert the graph generating instruction on the code. We also define the X
axis and Y axis symbol. Here we can also select the graph carve color. Then we input the
maximum efficiency value in the code. We also level the X(Load offered) axis and
Y(Throughput) axis. We add the graph tittle in the code. It is to be noted that, we are seeing the
pure ALOHA and Slotted ALOHA graph in same graph so we use a function ‘hold on’. On the
other we have also a Slotted ALOHA. In the slotted ALOHA we use the same procedure as like
as Pure ALOHA. But the rule of the slotted ALOHA is S=G*e-2G
.All of them we use legend
function, because we can easily different our pure ALOHA and Slotted ALOHA curve by seeing
the color. After that we compile the code and we get the expected output. This is the
methodology of our project
5. P a g e | 5
Chapter 2
Project Description
2.1 System Analysis
2.1.1 Pure ALOHA
The original ALOHA protocol is called pure ALOHA. This is a simple, but elegant protocol. The
idea is that each station sends a frame whenever it has a frame to send. However, since there is
only one channel to share, there is the possibility of collision between frames from different
stations.
Figure 2.1: Frames in Pure ALOHA
From above figure there are four stations that contend with one another for access to the shared
channel. The figure shows that each stations sends two frames; there are a total of eight frames
on the shared memory. Some of these frames collide because multiple frames are in contention
for the shared channel.
6. P a g e | 6
It is obvious that we need to resend the frames that have been destroying during transmission.
The pure ALOHA protocol relies acknowledgement from the receiver. When a station sends a
frame, it expects the receiver to send an acknowledgment. If the acknowledgment does not arrive
after a time-out period, the station assumes that frame has been destroyed and resends the frame.
A collision involves two or more stations. If all these stations try to resend their frame after the
time-out, the frames will collide again. Pure ALOHA dictates that when the time-out period
passes, each station waits a random amount of time before resending frames.
Throughput :
The Throughput of pure ALOHA is S = G x e-2G
The maximum throughput Smax = 0.184 when G = 1/2
2.1.2 Slotted ALOHA
Pure ALOHA has a vulnerable time of 2 x Tfr. This is so because there is no rule that defines
when the station can send. A station may send soon after another station has started or soon
before another station has finished. Slotted ALOHA was invented to improve the efficiency of
Pure ALOHA.
In slotted ALOHA we divided the time into slots of Tfr s and force the station to send only at the
beginning of the time slot. Figure 2.2 shows an example of frame collisions in slotted ALOHA.
7. P a g e | 7
Figure 2.2: Frame in Slotted ALOHA
Because a station is allowed to send only at the beginning of the synchronized time slot, if a
station misses this moment, it must wait until the beginning of the next time slot. This means that
the station which started at the beginning of this slot has already finished sending its frame. Of
course, there is still the possibility of collision if two stations try to send at the beginning of the
same time slot. However, the vulnerable time is now reduced to one-half, equal to Tfr above
figure shows the situation.
Throughput:
The throughput of slotted ALOHA is S = G x e-G
The maximum throughput Smax = 0.368 when G = 1.
2.2 Implementation
2.2.1 Pure ALOHA
To implement the maximum throughtput with the value of G (Average number of frames), we
use MATLAB. Shows the code of the efficiency of pure ALOHA in below:
8. P a g e | 8
Program 2.1: Pure ALOHA
2.2.2 Output
In MATLAB we show the output in a plot. Different output for different value of G. Following
figure shows the different output .
Figure 2.3: Output of maximum throughput for G = 0:0.1:5
9. P a g e | 9
From the Figure 2.3 the output curve show different throughput for different value of G. The
value of G started with 0 increases by 0.1 and end in 5.
2.2.3 Slotted ALOHA
To implement the maximum throughput with the value of G (Average number of frames), we use
MATLAB. Shows the code of the efficiency of slotted ALOHA in below :
Program 2.2: Slotted ALOHA
2.2.4 Output
In MATLAB we show the output in a plot. Different output for different value of G. Following
figure shows the different output .
10. P a g e | 10
Figure 2.4: Output of maximum throughput for G = 0:0.1:5
From the Figure 2.4 the output curve show different throughput for different value of G. The
value of G started with 0 increases by 0.1 and end in 5.
2.2.5 Pure ALOHA and Slotted ALOHA
To implement the maximum throughput with the value of G (Average number of frames), we use
MATLAB. Shows the code of the efficiency of pure ALOHA and slotted ALOHA in below :
11. P a g e | 11
Program 2.1: Pure ALOHA and Slotted ALOHA
2.2.6 Output
In MATLAB we show the output in a plot. Different output for different value of G. Following
figure shows the different output .
Figure 2.5: Output of maximum throughput for G = 0:0.1:5
12. P a g e | 12
From the Figure 2.5 the output curve show different throughput for different value of G. The
value of G started with 0 increases by 0.1 and end in 5.
Figure 2.6: Output of maximum throughput for G = 0:0.3:5
From the figure 2.6 the maximum throughput of pure ALOHA and slotted ALOHA are different
from the figure2.5. Because the value of G. The value of G started with 0 increases by 0.3 and
end in 5.
13. P a g e | 13
Figure2.7: Output of maximum throughput for G = 0:0.4:7
From the Figure2.7 the output curve show different throughput for different value of G. The
value of G started with 0 increases by 0.4 and end in 7.
Figure 2.8: Output of maximum throughput for G = 0:0.5:10
14. P a g e | 14
From the Figure 2.8 the output curve show different throughput for different value of G. The
value of G started with 0 increases by 0.5 and end in 10.
The throughput of pure ALOHA and slotted ALOHA are different for different value of G, and
show the different curve and different maximum throughput Smax which is showed in above
figures.
15. P a g e | 15
Chapter 3
System Architecture
3.1 Flowchart
Flowchart of maximum throughput of pure ALOHA is given below :
Figure 3.1: Flow chart of pure ALOHA maximum throughput
Flowchart of maximum throughput of Slotted ALOHA is given below:
Figure 3.2: Flow chart of slotted ALOHA maximum throughput
16. P a g e | 16
3.2 System Hardware
For plotting the efficiency of pure ALOHA and slotted ALOHA we use MATLAB software. By
using MATALAB we can show the maximum through put of pure ALOHA and slotted ALOHA
by curve.
MATLAB (matrix laboratory) is a multi-paradigm numerical computing environment and fourth
generation programming language. A proprietary programming language developed by Math
Works, MATLAB allows matrix manipulations, plotting of functions and data, implementation
of algorithms, creation of user interfaces, and interfacing with programs written in other
languages, including C, C++, Java, Fortran and Python.
Although MATLAB is intended primarily for numerical computing, an optional toolbox uses
the MuPAD symbolic engine, allowing access to symbolic computing abilities. An additional
package, Simulink, adds graphical multi-domain simulation and model-based
design for dynamic and embedded systems.
The MATLAB platform is optimized for solving engineering and scientific problems. The
matrix-based MATLAB language is the world's most natural way to express computational
mathematics. Built-in graphics make it easy to visualize and gain insights from data. A vast
library of pre-built toolboxes lets you get started right away with algorithms essential to your
domain. The desktop environment invites experimentation, exploration, and discovery. These
MATLAB tools and capabilities are all rigorously tested and designed to work together.
MATLAB helps you take your ideas beyond the desktop. You can run your analyses on larger
data sets, and scale up to clusters and clouds. MATLAB code can be integrated with other
languages, enabling you to deploy algorithms and applications within web, enterprise, and
production systems.
17. P a g e | 17
3.2.1 Key Features
(1) High-level language for scientific and engineering computing.
(2) Desktop environment tuned for iterative exploration, design, and problem-solving.
(3) Graphics for visualizing data and tools for creating custom plots.
(4) Apps for curve fitting, data classification, signal analysis, control system tuning, and many
other tasks.
(5) Add-on toolboxes for a wide range of engineering and scientific applications.
(6) Tools for building applications with custom user interfaces.
(7) Interfaces to C/C++, Java®
, .NET, Python, SQL, Hadoop, and Microsoft®
Excel®
(8) Royalty-free deployment options for sharing MATLAB programs with end users.
(9) Graphics for visualizing data and tools for creating custom plots.
(10) Apps for curve fitting, data classification, signal analysis, control system tuning, and many
other tasks.
(11) Add-on toolboxes for a wide range of engineering and scientific applications.
18. P a g e | 18
Chapter 4
Advantage & Conclusion
4.1 Advantage
4.1.1 Advantage of pure ALOHA protocol
(1) Superior to fixed assignment when there is a large number of burst stations.
(2) Useful when ‘a’ is large and carrier sensing doesn’t help often used for satellite
links.
(3) Adapts to varying number of stations.
(4) Simple there is no carrier sensing; no token, and no time based synchronization.
(5) Pure ALOHA does not require global time synchronization
4.1.2 Advantage of slotted ALOHA protocol
In cooperative systems, users achieve spatial diversity and multi-hop gains by transmitting
packets over multiple independent fading paths provided by their partners. Most previous works
on cooperative communications focus on the physical layer aspects such as coding, modulation,
and transceiver signal processing techniques. In this work, we study the advantages of user
cooperation from a MAC layer perspective and devise queuing strategies to exploit cooperative
gains in random access networks. Based on the conventional slotted ALOHA protocol, we
propose a simple cooperative transmission mechanism for a two-user cooperative pair. We
derive the two-user stability region of the proposed system and show the improvements
compared to non-cooperative systems. The benefits can be attributed to both physical layer
cooperation, where users with good channels may relay for those with bad channels, and MAC
layer cooperation, where system parameters can be chosen to enhance cooperation and reduce
competition. Then, we extend the proposed strategy to a finite-user system that consists of
19. P a g e | 19
multiple cooperative pairs. By treating each pair as a single transmission entity, we derive inner
bounds for the finite-user stability region and propose a ranking system to characterize the
transmission entities' relative tendency of being stable (or unstable).
4.2 Conclusion
In a wireless broadcast system or a half-duplex two-way link, Aloha works perfectly. But as
networks become more complex, for example in an Ethernet system involving multiple sources
and destinations that share a common data path, trouble occurs because data frames collide
(conflict). The heavier the communications volume, the worse the collision problems become.
The result is degradation of system efficiency, because when two frames collide, the data
contained in both frames is lost.
To minimize the number of collisions, thereby optimizing network efficiency and increasing the
number of subscribers that can use a given network, a scheme called slotted ALOHA was
developed. This system employs signals called beacons that are sent at precise intervals and tell
each source when the channel is clear to send a frame. Further improvement can be realized by a
more sophisticated protocol called Carrier Sense Multiple Access with Collision Detection
(CSMA/CD).
Present By :
Md. Alamgir Hossain
Department of Computer Science and Engineering
Jessore University of Science and Technology