MAC Protocol Lesson 2 Edited 2025 HOME Edition
MAC Protocol Lesson 2 Edited 2025 HOME Edition
School of Engineering,
Mechanical Department
Welcome !
Presented by
Mr Melele P
Goals of this Unit -MAC
Fundamentals of MAC Protocols for Wireless Sensor
Networks,
Low Duty Cycle Protocols And Wakeup Concepts
Contention –based protocol
Schedule – based protocol
SMAC
B-MAC Protocol,
TRAMAC
IEEE 802.15.4
2
Today’s Lesson Outline
Introduction to Contention – based protocols
Introduction of CSMA protocol
Nonpersistent
1-persistent
CSMA/CA protocol
RTS/CTS handshake principles
Illustrations of RTS/CTS protocols
Exposed and Hidden Terminal Problem
Comparison of CSMA/CA and TDMA protocols
3
Contention – Based Protocols
4
Contention – Based Protocols/Random access Schemes
Introduction
With contention-based protocols the success of any
transmission is not guaranteed because two or more
sources may be transmitting at the same time, which
results in the collision of their packets.
For this reason, packets may have to be transmitted and
retransmitted a number of times until they are successfully
transmitted.
Thus, the main concern of the random access schemes is
transmission scheduling to minimize the probability of
packet collision.
Protocols to be covered:
ALOHA and CSMA
5
Contention – Based Protocols/Random access Schemes
6
Contention – Based Protocols/Random access Schemes
7
Contention – Based Protocols/Random access Schemes
9
CSMA MAC Protocol - Introduction
As humans, we’ve evolved an elaborate set of protocols for
sharing the broadcast channel:
10
CSMA MAC Protocol - Introduction
Various multiple access channels
11
CSMA MAC Protocol - Introduction
As humans, we have human protocols that allow us not only to behave with
more civility, but also to decrease the amount of time spent “colliding” with
each other in conversation and, consequently, to increase the amount of
data we exchange in our conversations.
Specifically, there are two important rules for polite human conversation:
Listen before speaking. If someone else is speaking, wait until they are
finished. In the networking world, this is called carrier sensing—a node
listens to the channel before transmitting. If a frame from another node is
currently being transmitted into the channel, a node then waits until it
detects no transmissions for a short amount of time and then begins
transmission.
If someone else begins talking at the same time, stop talking. In the
networking world, this is called collision detection—a transmitting node
listens to the channel while it is transmitting. If it detects that another node
is transmitting an interfering frame, it stops transmitting and waits a random
amount of time before repeating the sense-and-transmit-when-idle cycle.
12
CSMA MAC Protocol
Basic principle: Listen ( if the channel is busy) before
transmitting…
CSMA protocol can be either Persistent or non-persistent
( further divided into 1-persistent or p-persistent)
This means – node listens persistently until the medium is free
Then immediately grabs the medium to transmit a packet…
These are highly time critical applications…if packet to be transmitted
as quickly as possible, the node persistently listens to the medium if its
free
Energy consumption is not high – listening simply accepting
electromagnetic signals, amplify, process…to see if medium is free
13
CSMA MAC Protocol
Non – persistent
A node does not continually sense a channel for the
purpose of seizing it immediately upon detecting the end of
the previous transmission
Node is not in hurry to transmit a packet--- that means , it
tries to listen if the medium is occupied,
it postponed the transmission for some other periodic time
And then, at some random time in the future, listen to the
medium again
… this how non-persistent MAC protocol algorithm works
Energy efficiency is more important than latency,
A trade-off can be achieved by implementing p-persistent
14
CSMA MAC Protocol
Summary of the Non-persistent CSMA Operation
15
CSMA MAC Protocol
1- persistent
Never allows the channel to remain idle if a node is ready
to transmit
16
CSMA MAC Protocol
Summary of the 1-Persistent CSMA Operation
17
CSMA MAC Protocol
P-persistent
The p-persistent algorithm represents a compromise between the
nonpersistent and 1-persistent schemes
Based on this algorithm, a node that senses the channel idle
transmits its packet with probability p.
With probability (1-p), the station waits for a specific time period
before attempting to transmit the packet again
Means, a node persists to listen to the medium with a probability
of 1 – p, it goes to sleep
Depending on the balance to achieve between energy efficiency
and latency, p can be determined…
o If latency is more important, then p could be more greater than 0.5
o If energy if more important, then p could be below 0.5
How does this work????????????
18
CSMA MAC Protocol
Imagine we have 4 sensors nodes and wish to have these
sensors fully connected in a WSN
A packet originating from any of these sensor nodes can
reach any of other sensor nodes
Then, they need to be within certain range
Ideally, this is how the nodes should be placed
19
CSMA MAC Protocol
Assuming that sensor nodes have same – hardware and software
configurations --- the goal is to achieve the arbitration in as far as
medium is concerned without centralized node
All sensor nodes here are equal--no node will assume the role of
centralized node
Hence transmission range and power consumption is the same
20
CSMA / CA
Establishes a brief handshake between the sender and the
receiver before actual data transmission takes place
The handshake begins when the sender sends a short
Request-to-Send (RTS) packed; the receiver then replies
with a Clear-to-send (CTS) packet.
A node farther away from the sender may not receive its
RTS during carrier sense, it will, however, receive the CTS
which prompts it to back off.
22
CSMA / CA
23
CSMA / CA – Handshake Principle
Before actual communication can take place, A can send a RTS if the
medium is free to B – B knows whether C is active or not, determine
whether the medium is free
When B sends a CTS , both A and C will be able to receive it--- C will
interpret that medium is busy, hence refrain from sending
This type of communication handshake increase listening range of A
by way of B
Packets needed for this purpose are called Control Packets – Very
insignificant…..
24
CSMA / CA - RTS/CTS illustration
S1 & S2 – Transmitters
R - Receiver
25
CSMA / CA - RTS/CTS illustration
S1 & S2 – Transmitters
R - Receiver
26
CSMA / CA
How does this take place – Technically????? Recall…….
WS node is both transmitter and Receiver … has one
antenna!
For Transmission and Receiving it uses one antenna
Components for TX and RX are different
Therefore…
When S1 sends RTS its in Transmission mode and when it
Receives CTS, in receiving mode
That means, there is a time difference needed for switching
between transmission and receiving
SIFS is required to do the adjustment –[Short Inter-frame Spaces]
27
CSMA / CA
CCA: Clear Channel Access
RBO: Random Back Off
SIFS: Short Inter-frame Spaces
30
CSMA / CA
More pictorially, this is what happens
We have 2 sensor nodes that wishes to communicate to
each other
31
CSMA / CA
S1 sense free medium, sends RTS, takes sometime to reach the receiver–
RX is in receiving mode
If medium free, it will switch back to TX and sends CTS to S1– at the same
time S2 will also listen to the CTS message
S2 will indirectly know that S1 is going to communicate
S2 can approximate how long this coms will take place– during the time it
can switch off radio and sleep to save energy
Only to wake up at the time to receive ACK packets and know that coms
between S1 and R is over and seizes the medium – energy is saved!
32
CSMA / CA
What happens if two sensor nodes sense free medium at
the same time????
If both S1 and S2 senses CCA and RBO at the same time, will send
CTS and there will be collision
R will send CTS – again both have to sense a free medium, meaning,
CCA has to be conducted plus RBO..
33
CSMA / CA
This time, the probability of them choosing RBO time will be different– one
of them ( S1 & S2) will sense medium free first
In this case, S2 will pickup CTS, assuming it has picked a longer RBO time
and immediately know that coms is taking place and refrain from
communicating
Sleep to save medium
Between S1 and R, will follow procedure and commences to successfully
transfer data packets
34
Exposed Terminal of MAC Protocol
while node B is transmitting to node A, node C has a packet intended
for node D.
Because node C is in range of B, it senses the channel to be busy and
is not able to send.
However, in theory, because D is outside of the range of B, and A is
outside of the range of C, these two transmissions would not collide
with each other.
The deferred transmission by C causes bandwidth wastage.
A B C D
A B C D
37
summary
38
The End.
39