Mac Lecture 2
Mac Lecture 2
CS: 647
Advanced Topics in Wireless Networks
2-2
Contention-based Protocols
❒ ALOHA
❍ Developed in the 1970s for a packet radio
network by Hawaii University.
❍ Whenever a terminal (MS) has data, it
transmits. Sender finds out whether
transmission was successful or experienced a
collision by listening to the broadcast from the
destination station. Sender retransmits after
some random time if there is a collision.
❒ Slotted ALOHA
❍ Improvement: Time is slotted and a packet can
only be transmitted at the beginning of one
slot. Thus, it can reduce the collision duration.
2-3
Contention Protocols (Cont’d)
❒ CSMA (Carrier Sense Multiple Access)
❍ Improvement: Start transmission only if no
transmission is ongoing
❒ CSMA/CD (CSMA with Collision Detection)
❍ Improvement: Stop ongoing transmission if a
collision is detected
❒ CSMA/CA (CSMA with Collision Avoidance)
❍ Improvement: Wait a random time and try again
when carrier is quiet. If still quiet, then
transmit
❒ CSMA/CA with ACK
❒ CSMA/CA with RTS/CTS
2-4
Pure ALOHA
Collision mechanism in ALOHA
1 2 3 3 2
Time
Collision
Node 3
Packet
❒ when frame first arrives - transmit immediately
❒ collision probability increases:
❍frame sent at t0 collides with other frames sent in [t0-
1,t0+1] 2-5
Pure (unslotted) ALOHA
❒ collision probability increases:
❍ frame sent at t0 collides with other frames sent in [t0-1,t0+1]
2-6
Throughput of Pure ALOHA
The probability of successful transmission Ps is the probability
no other packet is scheduled in an interval of length 2T.
Ps = P(no _ collision)
= e−2 gT , where g is the packet rate of the traffic.
S = gTe−2gT
Defining G = gT to normalize offered load, we have
S th = Ge − 2 G
Differentiating Sth with respect to G and equating to
zero gives d S th
= − 2 G e −2G + e −2G = 0 o r G = 1 / 2
dG
The Maximum throughput of ALOHA is
1
S max = ≈ 0 .184
2e
2-7
Slotted ALOHA
Assumptions Operation
❒ all frames same size ❒ when node obtains fresh
❒ time is divided into frame, it transmits in next
equal size slots, time to slot
transmit 1 frame ❒ no collision, node can send
❒ nodes start to transmit new frame in next slot
frames only at ❒ if collision, node
beginning of slots retransmits frame in each
❒ nodes are synchronized subsequent slot with prob.
❒ if 2 or more nodes
p until success
transmit in slot, all
nodes detect collision
2-8
Slotted ALOHA
Pros Cons
❒ single active node can ❒ collisions, wasting slots
continuously transmit ❒ idle slots
at full rate of channel ❒ nodes may be able to
❒ highly decentralized: detect collision in less
only slots in nodes than time to transmit
packet
need to be in sync
❒ clock synchronization
❒ simple
2-9
Throughput of Slotted ALOHA
The probability of successful transmission Ps is the
probability no other packet is scheduled in an interval of
length T.
− gT
Ps = e
where g is the packet rate of the traffic.
The throughput Sth of pure Aloha as:
Sth = gTe− gT
Defining G= gT to normalize offered load, we have
Sth = Ge−G
• Differentiating Sth with respect to G and equating to zero
gives dS th
= − Ge − G + e − G = 0
dG
• The Maximum throughput of ALOHA is
1
S max = ≈ 0.368
e
2-10
Throughput
0.5
0.4 0.368
S: Throughput
0.3
Slotted Aloha
0.2 0.184
0.1
Aloha
00 2 4 6 8
G
2-11
CSMA (Carrier Sense Multiple
Access)
❒ Max throughput achievable by slotted
ALOHA is 0.368.
2-12
CSMA collisions spatial layout of nodes
collision:
entire packet transmission
time wasted
note:
role of distance & propagation
delay in determining collision
probability
2-13
Kinds of CSMA
Unslotted Nonpersistent
CSMA
Nonpersistent
CSMA Slotted Nonpersistent CSMA
CSMA
Unslotted persistent CSMA
Persistent CSMA
Slotted persistent CSMA
1-persistent
CSMA
p-persistent
CSMA
2-14
Nonpersistent CSMA Protocols
❒ Nonpersistent CSMA Protocol:
Step 1: If the medium is idle, transmit immediately
Step 2: If the medium is busy, wait a random amount of time
and repeat Step 1
❍ Random backoff reduces probability of collisions
❍ Waste idle time if the backoff time is too long
2-15
Nonpersistent CSMA Protocols
2-16
1-persistent CSMA Protocols
1-persistent CSMA Protocol:
❒ Step 1: If the medium is idle, transmit immediately
❒ Step 2: If the medium is busy, continue to listen until
medium becomes idle, and then transmit immediately
❍ There will always be a collision if two nodes want to
retransmit (usually you stop transmission attempts after
few tries)
2-18
How to Select Probability p
?
❒ Assume that N nodes have a packet to send and the
medium is busy
2-19
Throughput
1.0 0.01-persistent CSMA
0.9 Nonpersistent CSMA
0.8
S: Throughput
0.7
0.1-persistent CSMA
0.6
0.5-persistent CSMA
0.5
1-persistent CSMA
0.4
0.3
0.2 Slotted
Aloha Aloha
0.1
0
0 1 2 3 4 5 6 7 8 9
Traffic Load G
2-20