Você está na página 1de 20

Medium Access Control (MAC)

Protocols for Ad hoc Wireless


Networks - II

CS: 647
Advanced Topics in Wireless Networks

Drs. Baruch Awerbuch & Amitabh Mishra


Department of Computer Science
Johns Hopkins University
© 2-1
Outline
❒ Wireless MAC Issues
❍ Hidden terminal problem
❍ Exposed terminal problem
❍ Capture
❒ MAC Performance Metrics
❒ Wireless MAC Classification
❒ Distributed Wireless MAC Protocols
❍ Aloha
❍ Slotted Aloha
❍ CSMA
❍ CSMA/CA
❍ 802.11 MAC
‰ DCF
‰ Backoff
❍ Hiper Lan MAC

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

Node 1 Waiting a random time


Packet Node 2
Packet
Retransmission Retransmission

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.

‰ The throughput Sth of pure Aloha as:

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.

❒ CSMA gives improved throughput


compared to Aloha protocols.

❒ Listens to the channel before transmitting


a packet (avoid avoidable collisions).

2-12
CSMA collisions spatial layout of nodes

collisions can still occur:


propagation delay means
two nodes may not hear
each other’s transmission

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

For unslotted nonpersistent CSMA, the throughput is given


by:
Ge−2αT
Sth =
G(1+ 2α ) + e−αG
Here τ is the propagation delay, and T is the packet transmission time.
S is the throughput and G is offered load. Also, τ
α=
T

2-15
Nonpersistent CSMA Protocols

‰For slotted nonpersistent CSMA, the throughput is given


by:
−2α T
α Ge
S th =
(1 − e − α G + α )

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)

For unslotted 1-persistent CSMA, the throughput is given by:


G [1 + G + α G (1 + G + α G / 2 ) ]e − G (1 + 2 α )
S th =
G (1 + 2 α ) − (1 − e − α G ) + (1 + α G ) e − G (1 + α )

For slotted 1-persistent CSMA, the throughput is given by:


G (1 + α − e −α G ) e − G (1+α )
S th =
(1 + α )(1 − e −α G ) + α e − G (1+α )
2-17
p-persistent CSMA Protocols
❒ p-persistent CSMA Protocol:
Step 1: If the medium is idle, transmit with probability p,
and delay for worst case propagation delay for one packet with
probability (1-p)

Step 2: If the medium is busy, continue to listen until medium


becomes idle, then go to Step 1

Step 3: If transmission is delayed by one time slot, continue


with Step 1

❒ A good tradeoff between nonpersistent and 1-


persistent CSMA

2-18
How to Select Probability p
?
❒ Assume that N nodes have a packet to send and the
medium is busy

❒ Then, Np is the expected number of nodes that will


attempt to transmit once the medium becomes idle

❒ If Np > 1, then a collision is expected to occur


Therefore, network must make sure that Np ≤ 1 to
avoid collision, where N is the maximum number of
nodes that can be active at a time

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