0% found this document useful (0 votes)
20 views45 pages

Ceng210 SP25 LCN12

Uploaded by

ghhmfyv9vb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views45 pages

Ceng210 SP25 LCN12

Uploaded by

ghhmfyv9vb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

It has been said

CENG210
Chapter 03 – Lecture 12
Medium Access Control

Hassan Nasreddine
Spring 2025

1
It has been said

Objectives:
• Understand the need for Media-Access
Protocols.
• Discuss and explain random Media Access
Protocol such as:
– Pure ALOHA
– Slotted ALOHA
– CSMA/CD
– CSMA/CA

2
It has been said

Medium Access an Introduction


• When nodes or stations are connected and use a common
link, called a multipoint or broadcast link, we 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 sub-layer in the data-link
layer called media access control (MAC).

3
It has been said

Access control
• When two or more devices are connected to the same link,
data link layer protocols are necessary to determine which
device has control over the link at any given time.
• Examples of common packet mode multiple access
protocols for wired multi-drop networks are:
• CSMA/CD (used in Ethernet and IEEE 802.3)
• Token bus (IEEE 802.4)
• Token ring (IEEE 802.5)
• Token passing (used in FDDI)

• Examples of common multiple access protocols that may be


used in packet radio wireless networks are:
• CSMA/CA (used in IEEE 802.11/WiFi WLANs)
• Dynamic TDMA
• Mobile Slotted Aloha (MS-ALOHA)
• OFDMA

4
It has been said

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.
– No scheduled time for a station to transmit. Transmission is
random among the stations (Random).
– no rules specify which station should send next. Stations compete
with one another to access the medium (Contention) .
• In a random-access method, each station has the right to
the medium without being controlled by any other station.
However, if more than one station tries to send, there is
an access conflict—collision—and the frames will be
either destroyed or modified.

5
It has been said

Random Access
• When can the station access the medium?
• How can the station determine the success or
failure of the transmission?
• What can the station do if there is an access
conflict?
• What can the station do if the medium is busy?

6
It has been said

ALOHA
• ALOHA, the earliest random-access method, was
developed at the University of Hawaii in early 19701. It
was designed for a radio (wireless) LAN, but it can be
used on any shared medium.
• 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.
• There are mainly two types of ALOHA protocol: pure
ALOHA and slotted ALOHA.

1. N. Abramson (1970). "The ALOHA System - Another Alternative for Computer


Communications" (PDF). Proc. 1970 Fall Joint Computer Conference. AFIPS Press.

7
It has been said

Pure ALOHA
• In 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.

Station 1

Station 2

Station 3

Station 4

Collision Collision Time


variable toward collision
duration duration

8
It has been said

Pure ALOHA Operation Concept


• How pure ALOHA protocol Works
– If station has frame to send, it will send the frame
– 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 (backoff time) before
resending its frame.

9
It has been said

Procedure for Pure ALOHA Protocol

10
It has been said

Vulnerable Time for Pure ALOHA Protocol

• Vulnerable time: the length of time in which there is a


possibility of collision.
Tfr

Time
vulnerable time = 2 × Tfr

Pure ALOHA vulnerable time = 2 × Tfr

11
It has been said

Vulnerable Time for Pure ALOHA Protocol

12
It has been said

Vulnerable Time: An Example


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?
Solution
Average frame transmission time Tfr is
Tfr =200 bits/200 kbps =1 ms.

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

This means that other stations in the network should stop


sending their data at least 1 millisecond before this particular
station begins its transmission.
While this station is transmitting, which lasts for 1
millisecond, no other station should start sending their data.

13
It has been said

Throughput of Pure ALOHA


• Let us call G the average number of frames generated by the system
during one frame transmission time.
For pure and slotted ALOHA, the average number of frames generated
by the system during one frame transmission time is given by:
G = λ⋅T
where:
• λ is the average number of frames generated per unit time.
• T is the frame transmission time.

• Then it can be proven that the average number of successfully


transmitted frames for pure ALOHA is
S = G × e−2G
• The maximum throughput Smax is 0.184, for G = 1/2.
• We expect G = 1/2 to produce the maximum throughput because the
vulnerable time is 2 times the frame transmission time. Therefore, 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.

14
It has been said

Slotted ALOHA
• Pure ALOHA has a vulnerable time of 2 × 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 just before another station has finished.
• In slotted ALOHA we divide the time into slots of T fr
seconds and force the station to send only at the beginning
of the time slot.
Collision Collision
duration duration

Station 1

Station 2

Station 3
Slot 1 Slot 2 Slot 3 Slot 4 Slot 5

18
It has been said

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.
• 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.

19
It has been said

Vulnerable Time for Slotted ALOHA


Protocol

Slotted ALOHA vulnerable time = Tfr

20
It has been said

Vulnerable Time for Pure & Slotted ALOHA


Protocol

21
It has been said

Throughput of Slotted ALOHA


• Let us call G the average number of frames generated
by the system during one frame transmission time.
• It can be proven that the average number of successful
transmissions for slotted ALOHA is S = G × e−G.
• The maximum throughput Smax is 0.368, when G = 1.
• We expect G = 1 to produce maximum throughput
because the vulnerable time is equal to the frame
transmission time. Therefore, if a station generates only
one frame in this vulnerable time (and no other station
generates a frame during this time), the frame will reach
its destination successfully.

22
It has been said

Throughput of Slotted ALOHA: An G=λT

Example where:

λ = Frame arrival rate (frames per second)

T = Frame transmission time

A slotted ALOHA network transmits 200-bit frames using a


shared channel with a 200-kbps bandwidth. Find the
throughput if the system (all stations together) produces
T= Data Rate / Frame Size
= 200,000/200
a. 1000 frames per second. =1 ms=0.001 sec

b. 500 frames per second. G=λT


G=1000×0.001=1

c. 250 frames per second. S=1×e ^−1


=1×0.368=0.368

The frame transmission time is 200/200 kbps or 1 ms.


a. In this case G is 1. So 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.

23
It has been said

Throughput of Slotted ALOHA: An


Example
A slotted ALOHA network transmits 200-bit frames using a
shared channel with a 200-kbps bandwidth. Find the
throughput if the system (all stations together) produces
Frame transmission time
a. 1000 frames per second. T= Data Rate / Frame Size
= 200,000/200

b. 500 frames per second. =1 ms=0.001 sec

G=λT
c. 250 frames per second. G=500×0.001=0.5
S=0.5×e ^−0.5
=0.5×0.606=0.303

The frame transmission time is 200/200 kbps or 1 ms.


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.

24
It has been said

Throughput of Slotted ALOHA:


Slotted ALOHA improves efficiency compared to Pure ALOHA by ensuring that

An Example stations send only at the beginning of a time slot.

A slotted ALOHA network transmits 200-bit frames using a


shared channel with a 200-kbps bandwidth. Find the
throughput if the system (all stations together) produces
a. 1000 frames per second. Frame transmission time
T= Data Rate / Frame Size
b. 500 frames per second. = 200,000/200
=1 ms=0.001 sec

c. 250 frames per second. G=λT


G=250×0.001=0.25
S=0.25×e ^−0.25
=0.25×0.778=0.195

The frame transmission time is 200/200 kbps or 1 ms.


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.
Maximum throughput of Slotted ALOHA is 0.368 (36.8%) when G = 1

S = Throughput (successful transmissions per time slot)


G = Average number of frames sent per slot
e = Euler’s number (≈ 2.718)

25
It has been said

ALOHA Protocols: Performance

26
It has been said

What is Slotted ALOHA?


Time is divided into slots.

CSMA Stations can only send at the beginning of a time slot.


If only one station sends in a slot, the transmission is successful.
If two or more stations send in the same slot, collision occurs (data is lost).

• 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 can reduce the possibility of collision, but it cannot
eliminate it. WHY ?
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.

27
It has been said
It has been said

CSMA
‫ﺗﺎﻛد ﻗﺑل اﻻرﺳﺎل‬

• 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 can reduce the possibility of collision, but it cannot
eliminate it. WHY ?
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.

29
It has been said

Space/time model of a collision in CSMA

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.

30
It has been said

CSMA: Vulnerable Time


very weak ‫اﺿﻌف ﻟﺣظﮫ‬

• 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.

time taken to get from t1 to t2


- send only one at time

31
It has been said

CSMA Persistence Methods:


1-Persistent
1- mean probability 1 of the %
‫ ﻣﻠﺢ‬، ‫ﻣﺻر‬

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.

32
It has been said

CSMA Persistence Methods:


Nonpersistent
A station that has a frame
to send sensesemptythe line. If
the line is idle, it sends
immediately. If the line is
not idle, it waits a random
amount of time and then if its busy it wait randomly

senses the line again.

This method reduces the


efficiency of the network
because the medium remains
idle when there may be
stations with frames to send.

33
It has been said

CSMA Persistence Methods:


- its better but slow

P-Persistent
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, if the num of R = 0 to 1 is
less than p can send
message
the station waits for the
beginning of the next time
slot and checks the line
again. if i have waited twice
then there is collision
ocurred
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.

34
It has been said

Flow diagram for three persistence methods

35
It has been said

36
It has been said

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.
• In this method, 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 is detected if two stations transmit at the
same time.

Collision Detection and Propagation Delay:

- time taken for a signal to propagate between two


stations.

- start transmitting without knowing another station


has already started, leading to a collision.

CSMA/CD uses carrier sensing, but collisions can still


happen if two stations start before hearing each other’s
signals.

total time required for collision detection is


2Tp=20 µs

37
It has been said

Flow diagram for the CSMA/CD


CSMA (Carrier Sense Multiple Access) means a station
listens to the channel before transmitting.

38
It has been said

CSMA/CA
• Carrier sense multiple access with collision avoidance
(CSMA/CA) was invented for wireless networks. WHY?

39
It has been said

CSMA/CA
• 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.
• The IFS variable can also be used to prioritize stations or frame
types. A station that is assigned a shorter IFS has a higher
priority.

40
It has been said

CSMA/CA
• 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.
– This gives priority to the station with the longest waiting 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.

41
It has been said

CSMA/CA Flow Chart

42
It has been said

CSMA/CA Frame Exchange Time Line


DIFS: DCF Interframe
Space

DCF: Distributed
Coordination Function

SIFS: Short Interframe


Space

43
It has been said

CSMA/CA Frame Exchange Time Line


• 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 station, before sensing the physical medium to
see if it is idle, first checks its NAV to see if it has
expired.

44
It has been said

CSMA/CA Problems – Part 1


• Collision During Hand shanking
– 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.

45
It has been said

CSMA/CA Problems – Part 2


• Hidden-Station Problem
– The solution to the hidden station problem is the use of the handshake
frames (RTS and CTS). The figure below shows 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.

46
It has been said

CSMA/CA Problems – Part 3


• Exposed Station Problem
– Here, a station refrains from using a channel when it is, in fact, available.
• Station A is transmitting to station B. Station C has some data to send to station D, which can
be sent without interfering with the transmission from A to B. However, station C is exposed to
transmission from A; it hears what A is sending and thus refrains from sending.
• In other words, C is too conservative and wastes the capacity of the channel. The handshaking
messages RTS and CTS cannot help in this case.
• Station C hears the RTS from A and refrains from sending, even though the communication
between C and D cannot cause a collision in the zone between A and C; station C cannot
know that station A’s transmission does not affect the zone between C and D.

47
It has been said

Success Rate of CSMA and ALOHA Protocols

48

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