Aloha

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 70

Media Access

Control (MAC)
• When nodes or stations are connected and use a
common link, called a multipoint or broadcast link,
need a multiple-access protocol to coordinate access to
the link.
• Many protocols have been devised to handle access to a
shared link.
• All of these protocols belong to a sublayer in the data-
link layer called media access control (MAC).
RANDOM ACCESS
• In random-access or contention methods, no station is
superior to another station and none is assigned control
over another.
• At each instance, a station that has data to send uses a
procedure defined by the protocol to make a decision on
whether or not to send.
• This decision depends on the state of the medium (idle or
busy).
• Each station can transmit when it desires on the condition
that it follows the predefined procedure, including testing
the state of the medium.
• Two features give this method its name.
• First, there is no scheduled time for a station to
transmit.
• Transmission is random among the stations.
• Second, no rules specify which station should send
next.
• Stations compete with one another to access the
medium.
• That is why these methods are also called contention
methods.
• However, if more than one station tries to send, there is an
access conflict—collision—and the frames will be either
destroyed or modified.
• To avoid access conflict or to resolve it when it happens,
each station follows a procedure that answers the
following questions:
1. When can the station access the medium?
2. What can the station do if the medium is busy?
3. How can the station determine the success or failure of
the transmission?
4. What can the station do if there is an access conflict?
ALOHA
• ALOHA, the earliest random access method, was
developed at the University of Hawaii in early 1970.
• It was designed for a radio (wireless) LAN, but it
can be used on any shared medium.
• It is obvious that there are potential collisions in
this arrangement.
• The medium is shared between the stations.
Pure ALOHA
• Each station sends a frame whenever it has a frame
to send (multiple access).
• However, since there is only one channel to share,
there is the possibility of collision between frames
from different stations.
• The pure ALOHA protocol relies on acknowledgments
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 the frame (or the
acknowledgment) has been destroyed and resends the
frame.
• A collision involves two or more stations. If all these
stations try to resend their frames 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 its frame.
• The randomness will help avoid more collisions.
• This time is the backoff time TB
• Pure ALOHA has a second method to prevent
congesting the channel with retransmitted frames.
• After a maximum number of retransmission attempts
Kmax a station must give up and try later.
• The time-out period is equal to the maximum possible
round-trip propagation delay, which is twice the amount
of time required to send a frame between the two most
widely separated stations (2 × Tp).
• The backoff time TB is a random value that normally
depends on K (the number of attempted unsuccessful
transmissions).
• The formula for TB depends on the implementation.
• One common formula is the binary exponential backoff.
• In this method, for each retransmission, a
multiplier R = 0 to 2K − 1 is randomly chosen and
multiplied by Tp (maximum propagation time) or Tfr
(the average time required to send out a frame) to
find TB.
• Note that in this procedure, the range of the
random numbers increases after each collision.
• The value of Kmax is usually chosen as 15
• K = maximum number of retransmission attempts
a station must try
• R = 0 to 2K − 1 is randomly chosen
• TB = backoff time R × Tp or R x Tf
• Tp = maximum propagation time
• Tfr = the average time required to send out a frame
Vulnerable time
• The vulnerable time, the length of time in which
there is a possibility of collision.
• The stations send fixed-length frames with each
frame taking Tfr seconds to send.
• A pure ALOHA network transmits 200-bit frames on
a shared channel of 200 kbps. What is the
requirement to make this frame collision-free?

• Average frame transmission time Tfr is 200 bits/200 kbps


or 1 ms.

• The vulnerable time is 2 × 1 ms =2 ms.


• This means no station should send later than 1 ms
before this station starts transmission and
• no station should start sending during the period (1
ms) that this station is sending.
Throughput

• G the average number of frames generated by the


system during one frame transmission time.
• if a station generates only one frame in this
vulnerable time (and no other stations generate a
frame during this time), the frame will reach its
destination successfully.
• A pure ALOHA network transmits 200-bit
frames on a shared channel of 200 kbps.
What is the throughput if the system (all
stations together) produces
a. 1000 frames per second?
b. 500 frames per second?
c. 250 frames per second?
• The frame transmission time is 200/200 kbps or
1 ms.
a. If the system creates 1000 frames per second, or
1 frame per millisecond, then G = 1.
e−2 = 1/e2, e = 2.71828,
e−2 = 1/7.3891 = 0.1353
In this case S = G × e−2G = 0.135 (13.5 percent).
This means that the throughput is
1000 × 0.135 = 135 frames.
Only 135 frames out of 1000 will probably
survive.
b. If the system creates 500 frames per second, or
1/2 frames per millisecond, then G = 1/2.
• In this case S = G × e−2G = 0.184 (18.4 percent).
• This means that the throughput is
500 × 0.184 = 92
• 92 frames out of 500 will probably survive.
• Note that this is the maximum throughput case,
percentagewise.
c. If the system creates 250 frames per second,
or 1/4 frames per millisecond, then G = 1/4.
• In this case S = G × e−2G = 0.152 (15.2 percent).
• This means that the throughput is
250 × 0.152 = 38.
• Only 38 frames out of 250 will probably
survive.
Slotted ALOHA
• Pure ALOHA has a vulnerable time of 2 × Tfr
• Because there is no rule that defines when the station
can send.
• A station may send soon after another station has started
or just before another station has finished.
• Slotted ALOHA was invented to improve the efficiency of
pure ALOHA.
• In slotted ALOHA, the time into divided into slots of Tfr
seconds and force the station to send only at the
beginning of the time slot.
Vulnerable time for slotted ALOHA protocol
• A slotted ALOHA network transmits 200-bit
frames on a shared channel of 200 kbps. What is
the throughput if the system (all stations
together) produces
a. 1000 frames per second?
b. 500 frames per second?
c. 250 frames per second?
• The frame transmission time is 200/200 kbps or 1
ms.
a. In this case G is 1.
S = G × e−G = 0.368 (36.8 percent).
• This means that the throughput is
1000 × 0.0368 = 368 frames.
• Only 368 out of 1000 frames will probably survive.
• Note that this is the maximum throughput case,
percentagewise.
b. Here G is 1/2.
In this case S = G × e−G = 0.303 (30.3 percent).
• This means that the Throughput is
500 × 0.0303 = 151.
• Only 151 frames out of 500 will probably survive.
c. Now G is 1/4.
In this case S = G × e−G = 0.195 (19.5 percent).
• This means that the throughput is
250 × 0.195 = 49.
• Only 49 frames out of 250 will probably survive.
CSMA
• To minimize the chance of collision and, therefore, increase
the performance, the CSMA method was developed.
• The chance of collision can be reduced if a station senses
the medium before trying to use it.
• Carrier sense multiple access (CSMA) requires that each
station first listen to the medium (or check the state of the
medium) before sending.
• CSMA is based on the principle “sense before transmit”
or “listen before talk.”
• CSMA can reduce the possibility of collision, but it cannot
eliminate it.
• The possibility of collision still exists because of
propagation delay
• When a station sends a frame, it still takes time
(although very short) for the first bit to reach every
station and for every station to sense it.
• A station may sense the medium and find it idle,
only because the first bit sent by another station
has not yet been received.
Vulnerable Time
• The vulnerable time for CSMA is the propagation
time Tp.
• This is the time needed for a signal to propagate from
one end of the medium to the other.
• When a station sends a frame and any other station
tries to send a frame during this time, a collision will
result.
• But if the first bit of the frame reaches the end of the
medium, every station will already have heard the bit
and will refrain from sending.
Persistence Methods
• What should a station do if the channel is busy?
• What should a station do if the channel is idle?
• Three methods have been devised to answer these
questions:
• the 1-persistent method,
• the nonpersistent method, and
• the p-persistent method.
1-Persistent
• The 1-persistent method is simple and straightforward.
• In this method, after the station finds the line idle, it
sends its frame immediately (with probability 1).
• This method has the highest chance of collision
because two or more stations may find the line idle and
send their frames immediately.
Nonpersistent
• In the nonpersistent method, a station that has a frame to
send senses the line.
• If the line is idle, it sends immediately.
• If the line is not idle, it waits a random amount of time and
then senses the line again.
• The nonpersistent approach reduces the chance of collision
because it is unlikely that two or more stations will wait
the same amount of time and retry to send simultaneously.
• However, this method reduces the efficiency of the network
because the medium remains idle when there may be
stations with frames to send.
p-Persistent
• The p-persistent method is used if the channel has time
slots with a slot duration equal to or greater than the
maximum propagation time.
• The p-persistent approach combines the advantages of
the other two strategies.
• It reduces the chance of collision and improves
efficiency.
• In this method, after the station finds the line idle it
follows these steps:
1. With probability p, the station sends its frame.
2. With probability q = 1 − p, the station waits for the
beginning of the next time slot and checks the line
again.
a. If the line is idle, it goes to step 1.
b. If the line is busy, it acts as though a collision has
occurred and uses the backoff procedure.
CSMA/CD
• The CSMA method does not specify the procedure
following a collision.
• Carrier sense multiple access with collision
detection (CSMA/CD) augments the algorithm to
handle the collision.
• A station monitors the medium after it sends a frame to
see if the transmission was successful.
• If so, the station is finished.
• If, however, there is a collision, the frame is sent again.
Collision of the first bits in CSMA/CD
Minimum Frame Size
• For CSMA/CD to work, we need a restriction on the
frame size.
• Before sending the last bit of the frame, the sending
station must detect a collision, if any, and abort the
transmission.
• This is so because the station, once the entire frame is
sent, does not keep a copy of the frame and does not
monitor the line for collision detection.
• Therefore, the frame transmission time Tfr must be at
least two times the maximum propagation time Tp.
• A network using CSMA/CD has a bandwidth of 10
Mbps. If the maximum propagation time
(including the delays in the devices and ignoring
the time needed to send a jamming signal) is 25.6
μs, what is the minimum size of the frame?

• The minimum frame transmission time is


• Tfr = 2 × Tp = 51.2 μs.
• In the worst case, a station needs to transmit for a
period of 51.2 μs to detect the collision.
• The minimum size of the frame is 10 Mbps × 51.2 μs =
512 bits or 64 bytes.
CSMA/CD
• The first difference is the addition of the persistence
process.
• Need to sense the channel before start sending the frame
by using one of the persistence processes.
• The second difference is the frame transmission.
• In ALOHA, first transmit the entire frame and then wait
for an acknowledgment.
• In CSMA/CD, transmission and collision detection are
continuous processes.
• Do not send the entire frame and then look for a collision.
• The third difference is the sending of a short
jamming signal to make sure that all other stations
become aware of the collision.
Energy Level
• The level of energy in a channel can have three values:
zero, normal, and abnormal.
• At the zero level, the channel is idle.
• At the normal level, a station has successfully captured
the channel and is sending its frame.
• At the abnormal level, there is a collision and the level of
the energy is twice the normal level.
• A station that has a frame to send or is sending a
frame needs to monitor the energy level to
determine if the channel is idle, busy, or in collision
mode.
Energy level during transmission, idleness,
or collision
Throughput
• The throughput of CSMA/CD is greater than that of
pure or slotted ALOHA.
• The maximum throughput occurs at a different
value of G and is based on the persistence method
and the value of p in the p-persistent approach.
• For the 1-persistent method, the maximum
throughput is around 50 percent when G = 1.
• For the nonpersistent method, the maximum
throughput can go up to 90 percent when G is
between 3 and 8.
CSMA/CA
• Carrier sense multiple access with collision
avoidance (CSMA/CA) was invented for wireless
networks.
• Collisions are avoided through the use of
CSMA/CA’s three strategies:
• the interframe space,
• the contention window, and
• acknowledgments
Interframe Space (IFS)
• First, collisions are avoided by deferring transmission
even if the channel is found idle.
• When an idle channel is found, the station does not send
immediately.
• It waits for a period of time called the interframe space
or IFS.
• After waiting an IFS time, if the channel is still idle, the
station can send, but it still needs to wait a time equal to
the contention window.
• The IFS variable can also be used to prioritize stations or
frame types.
Contention Window
• The contention window is an amount of time divided
into slots.
• A station that is ready to send chooses a random number
of slots as its wait time.
• The number of slots in the window changes according to
the binary exponential backoff strategy.
• This means that it is set to one slot the first time and then
doubles each time the station cannot detect an idle
channel after the IFS time.
Acknowledgment
• With all these precautions, there still may be a
collision resulting in destroyed data.
• In addition, the data may be corrupted during the
transmission.
• The positive acknowledgment and the time-out
timer can help guarantee that the receiver has
received the frame.
Frame Exchange Time Line
1. Before sending a frame, the source station senses
the medium by checking the energy level at the carrier
frequency.
a. The channel uses a persistence strategy with
backoff until the channel is idle.
b. After the station is found to be idle, the station
waits for a period of time called the DCF
interframe space (DIFS); then the station sends a
control frame called the request to send (RTS).
2. After receiving the RTS and waiting a period of time
called the short interframe space (SIFS), the destination
station sends a control frame, called the clear to send (CTS),
to the source station.
This control frame indicates that the destination station is
ready to receive data.
3. The source station sends data after waiting an amount of
time equal to SIFS.
4. The destination station, after waiting an amount of time
equal to SIFS, sends an acknowledgment to show that the
frame has been received.
Acknowledgment is needed in this protocol
Network Allocation Vector
• How do other stations defer sending their data if one
station acquires access?
• How is the collision avoidance aspect of this protocol
accomplished?
• The key is a feature called NAV.
• When a station sends an RTS frame, it includes the
duration of time that it needs to occupy the channel.
• The stations that are affected by this transmission create a
timer called a network allocation vector (NAV) that
shows how much time must pass before these stations are
allowed to check the channel for idleness.
• Each time a station accesses the system and sends
an RTS frame, other stations start their NAV.
• Each station, before sensing the physical medium to
see if it is idle, first checks its NAV to see if it has
expired.
Collision During Handshaking
• What happens if there is a collision during the time when
RTS or CTS control frames are in transition, often called
the handshaking period?
• Two or more stations may try to send RTS frames at the
same time.
• These control frames may collide.
• However, because there is no mechanism for collision
detection, the sender assumes there has been a collision
if it has not received a CTS frame from the receiver.
• The backoff strategy is employed, and the sender tries
again.
Hidden-Station Problem
• The solution to the hidden station problem is the use of
the handshake frames (RTS and CTS).
• That the RTS message from B reaches A, but not C.
• However, because both B and C are within the range of A,
the CTS message, which contains the duration of data
transmission from B to A, reaches C.
• Station C knows that some hidden station is using the
channel and refrains from transmitting until that duration
is over.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy