Ceng210 SP25 LCN12
Ceng210 SP25 LCN12
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
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)
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.
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
8
It has been said
– 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
10
It has been said
Time
vulnerable time = 2 × Tfr
11
It has been said
12
It has been said
13
It has been said
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
20
It has been said
21
It has been said
22
It has been said
Example where:
23
It has been said
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
24
It has been said
25
It has been said
26
It has been said
27
It has been said
It has been said
CSMA
ﺗﺎﻛد ﻗﺑل اﻻرﺳﺎل
29
It has been said
30
It has been said
31
It has been said
32
It has been said
33
It has been said
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
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.
37
It has been said
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
42
It has been said
DCF: Distributed
Coordination Function
43
It has been said
44
It has been said
45
It has been said
46
It has been said
47
It has been said
48