Module 3 MAC

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 121

Medium Access Protocol

  Overview!
  Wireless MAC protocols!
  Carrier Sense Multiple Access!
  Multiple Access with Collision Avoidance (MACA) and MACAW!
  MACA By Invitation!
  IEEE 802.11!
  IEEE 802.15.4 and ZigBee!
  Characteristics of MAC Protocols in Sensor Networks!
  Energy Efficiency!
  Scalability!
  Adaptability!
  Low Latency and Predictability!
  Reliability!
  Contention-Free MAC Protocols!
  Contention-Based MAC Protocols!
  Hybrid MAC Protocols!
Medium Access Control

  In most networks, multiple nodes share a communication medium for


transmitting their data packets! Controlling when to send a packet and when to
listen for a packet are perhaps the two most important operations in a wireless
network- Especially, idly waiting wastes huge amounts of energy
Suitable to mobile and wireless networks
Emphasize energy-efficient operation
  The medium access control (MAC) protocol is primarily responsible for
regulating access to the shared medium!
  The choice of MAC protocol has a direct bearing on the reliability and
efficiency of network transmissions!
  due to errors and interferences in wireless communications and to other
challenges!
  Energy efficiency also affects the design of the MAC protocol!
  trade energy efficiency for increased latency or a reduction in throughput
or fairness!
Overview

  Responsibilities of MAC layer include:!


  decide when a node accesses a shared medium!
  resolve any potential conflicts between competing nodes!
  correct communication errors occurring at the physical layer!
  perform other activities such as framing, addressing, and flow
control!
  Second layer of the OSI reference model (data link layer) or the IEEE 802
reference model (which divides data link layer into logical link control and
medium access control layer)!

Fundamentals of Wireless Sensor Networks: Theory and Practice


MAC vs LLC
• MAC deals with when and how to access medium
– unicast and broadcast message sending

• LLC (Logic link control) main task is Error and Flow Control (next chapter)
• Energy efficiency is important
• Put a node to SLEEP whenever possible
• Contention based and Scheduling based approaches
• IEEE 802.15.4 combines both
• IEE 802.11 and Bluetooth are not the first choice
– Performance Requirements
- throughput
- stability
- low access delay
- low overhead

Overhead due to :
- per-packet overhead (headers , trailers)
- collisions – happens when 2 nodes Txmit
- exchange of extra control packets
- use priority based Tx for real-time
MAC Protocol Categorization

5!
Contention-Free Medium Access
  Collisions can be avoided by ensuring that each node can use its allocated
resources exclusively!
  Examples of fixed assignment strategies:!
  FDMA: Frequency Division Multiple Access!
 the frequency band is divided into several smaller frequency bands!
 the data transfer between a pair of nodes uses one frequency band !
 all other nodes use a different frequency band!
  TDMA: Time Division Multiple Access!
 multiple devices to use the same frequency band!
 relies on periodic time windows (frames)!
–  frames consist of a fixed number of transmission slots to separate the
medium accesses of different devices!
–  a time schedule indicates which node may transmit data during a certain
slot!
Contention-Free Medium Access
  Examples of fixed assignment strategies (contd.):!
  CDMA: Code Division Multiple Access!
 simultaneous accesses of the wireless medium are supported using different
codes!
 if these codes are orthogonal, it is possible for multiple communications to
share the same frequency band!
 forward error correction (FEC) at the receiver is used to recover from
interferences among these simultaneous communications!
  Fixed assignment strategies are inefficient!
  it is impossible to reallocate slots belonging to one device to other devices if not
needed in every frame!
 generating schedules for an entire network can be a taunting task !
 these schedules may require modifications every time the network topology or
traffic characteristics in the network change
Types of Channels

• Control channel
– Forward (Downlink) control channel
– Reverse (Uplink) control channel
• Traffic channel
– Forward traffic (traffic or information) channel
– Reverse traffic (traffic or information) channel

8
Types of Channels (Cont’d)
Reverse channel (Uplink) Control channels
f’

f1’
f2’

fn’
f1
f2


fn

Forward channels
MS Traffic channels BS
(Downlink)
9
FDMA

f1’ f1
MS #1

f2’ f2
MS #2 …


fn’ fn
MS #n

BS
Reverse channels Forward channels
(Uplink) (Downlink)

10
FDMA: Channel Structure
Guard Band Wg Sub Band Wc


1 2 3 4 N
Frequency

Total Bandwidth W=NWc

f1’ f2’ fn’ f1 f2 fn

… …
Frequency
Reverse channels Forward channels
Protecting bandwidth

11
TDMA
Frequency f ’ Slot Frequency f

… … … … … …
#1

#1

#1
#1
MS #1 t t
… … … … … …
#2

#2

#2

#2
MS #2 t t

… … … … … …

#n

#n
#n

#n

MS #n t t

Frame Frame Frame Frame BS

Reverse channels Forward channels


(Uplink) (Downlink)

12
TDMA: Channel Structure
f
Frame Frame Frame

… … … t
#1

#2

#1

#2
#n
#1

#2

#n

#n
(a). Forward channel

f’
Frame Frame Frame

… … … t
#1

#2

#1

#2
#n
#1

#2

#n

#n
(b). Reverse channel

13
TDMA: Frame Structure (Cont’d)

Frequency
f=f’
Frame Frame

… … … …
#1

#2

#1

#2
#n

#1

#2

#n

#n

#1

#2

#n
Time

Forward Reverse Forward Reverse


channel channel channel channel

Channels in Simplex Mode

14
TDMA: Frame Structure (Cont’d)

Frequency
Frame Frame Frame

… … …
#1

#2

#1

#2
#n
#1

#2

#n

#n
Time

Head Data
Guard
time

15
Code Division Multiple Access (CDMA)
Frequency f ’ Frequency f

MS #1 C1’ C1

MS #2 C2’ C2


Cn’ Cn
MS #n

BS
Reverse channels Forward channels
(Uplink) (Downlink)

Note: Ci’ x Cj’ = 0, i.e., Ci’ and Cj’ are orthogonal codes, Ci
x Cj = 0, i.e., Ci and Cj are orthogonal codes
16
Comparisons of FDMA, TDMA, and CDMA (Example)

Operation FDMA TDMA CDMA


Allocated Bandwidth 12.5 MHz 12.5 MHz 12.5 MHz
Frequency reuse 7 7 1
Required channel BW 0.03 MHz 0.03 MHz 1.25 MHz
No. of RF channels 12.5/0.03=416 12.5/0.03=416 12.5/1.25=10
Channels/cell 416/7=59 416/7=59 12.5/1.25=10
Control channels/cell 2 2 2
Usable channels/cell 57 57 8
Calls per RF channel 1 4* 40**
Voice channels/cell 57x1=57 57x4=228 8x40=320
Sectors/cell 3 3 3
Voice calls/sector 57/3=19 228/3=76 320
Capacity vs FDMA 1 4 16.8
Delay ? ? ?
* Depends on the number of slots ** Depends on the number of codes
17
Distributed, contention-based MAC
• Basic ideas for a distributed MAC
– ALOHA – no good in most cases
– Listen before talk (Carrier Sense Multiple Access, CSMA) – better, but
suffers from sender not knowing what is going on at receiver, might
destroy packets despite first listening for a
! Receiver additionally needs some possibility to inform possible senders in its
vicinity about impending transmission (to “shut them up” for this duration)

Hidden
terminal Also:
scenario: recall
exposed
terminal
A B C D
scenario
Ad hoc & sensor networs - Ch 5:
SS 05 18
MAC protocols
Main options to shut up senders

• Receiver informs potential interferers while a reception is on-going


– By sending out a signal indicating just that

– Problem: Cannot use same channel on which actual reception takes


place

! Use separate channel for signaling


– Busy tone protocol

• Receiver informs potential interferers before a reception is on-going


– Can use same channel

– Receiver itself needs to be informed, by sender, about impending


transmission
– Potential interferers need to be aware of such information, need to store
it
19
RTS/CTS
• RTS/CTS ameliorate, but do not solve hidden/exposed terminal problems
• Example problem cases:
A B C D A B C D
RTS RTS

RTS
CTS CTS
RTS

Data RTS Data CTS

CTS Data

Ack

Ad hoc & sensor networs - Ch 5:


SS 05 20
MAC protocols
Receiver informs interferers before transmission – MACA
A B C D
• Sender B asks receiver C
whether C is able to receive a
transmission RTS

Request to Send (RTS)


• Receiver C agrees, sends out a
CTS
Clear to Send (CTS)
• Potential interferers overhear
either RTS or CTS and know Data

about impending transmission


NAV indicates
and for how long it will last busy medium

– Store this information in a NAV indicates


busy medium
Network Allocation Vector
• B sends, C acks Ack

! MACA protocol (used e.g. in IEEE


802.11)

Ad hoc & sensor networs - Ch 5:


SS 05 21
MAC protocols
Figure 1 Taxonomy of multiple-access protocols

22
RANDOM ACCESS

In random access or contention methods, no station is


superior to another station and none is assigned the
control over another. No station permits, or does not
permit, another station to send. 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.

ALOHA
Carrier Sense Multiple Access
Carrier Sense Multiple Access with Collision Detection
Carrier Sense Multiple Access with Collision Avoidance
23
ALOHA
• Wireless link to provide data transfer between main
campus & remote campuses of University of Hawaii
• Simplest solution: just do it
– A station transmits whenever it has data to transmit
– If more than one frames are transmitted, they interfere with
each other (collide) and are lost
– If ACK not received within timeout, then a station picks random
backoff time (to avoid repeated collision)
– Station retransmits frame after backoff time

First transmission Retransmission


Backoff period B
t
t0-X t0 t0+X t0+X+2tprop t0+X+2tprop + B
Vulnerable Time-out
period
24
ALOHA Model
• Definitions and assumptions
– X frame transmission time (assume constant)
– S: throughput (average # successful frame transmissions per X
seconds)
– G: load (average # transmission attempts per X sec.)
– Psuccess : probability a frame transmission is successful
S  GPsuccess • Any transmission
that begins during
vulnerable period
leads to collision
X X • Success if no
Prior interval frame arrivals during 2X
transmission seconds 25
Abramson’s Assumption
• What is probability of no arrivals in vulnerable period?
• Abramson assumption: Effect of backoff algorithm is that frame arrivals
are equally likely to occur at any time interval
• G is avg. # arrivals per X seconds
• Divide X into n intervals of duration D=X/n
• p = probability of arrival in D interval, then
G = n p since there are n intervals in X seconds

Psuccess  P[0 arrivals in 2X seconds] 


 P[0 arrivals in 2n intervals]
G 2n
 (1 - p)  (1  )  e  2G as n  
2n

n 26
Throughput of ALOHA
2 G
S  GPsuccess  Ge
• Collisions are
0.2 e-2 = 0.184 means for
0.18 coordinating
0.16
0.14
access
0.12 • Max throughput is
0.1
S

0.08 rmax= 1/2e (18.4%)


0.06
0.04 • Bimodal behavior:
0.02
0
Small G, S≈G
0 5 5 25 25 5 25 0.
5 1 2 4 Large G, S↓0
812 5 62 1 6 . 12 0.
03 0 0
00
7
.0
1
0. 0. • Collisions can
0. 0

G
snowball and drop
throughput to zero
27
Figure 3 Frames in a pure ALOHA network

28
Figure 4 Procedure for pure ALOHA protocol

29
Example 1

The stations on a wireless ALOHA network are a


maximum of 600 km apart. If we assume that signals
propagate at 3 × 108 m/s, we find
Tp = (600 × 105 ) / (3 × 108 ) = 2 ms.
Now we can find the value of TB for different values of
K.

a. For K = 1, the range is {0, 1}. The station needs to|


generate a random number with a value of 0 or 1. This
means that TB is either 0 ms (0 × 2) or 2 ms (1 × 2),
based on the outcome of the random variable.

30
Example 1 (continued)

b. For K = 2, the range is {0, 1, 2, 3}. This means that TB


can be 0, 2, 4, or 6 ms, based on the outcome of the
random variable.

c. For K = 3, the range is {0, 1, 2, 3, 4, 5, 6, 7}. This


means that TB can be 0, 2, 4, . . . , 14 ms, based on the
outcome of the random variable.

d. We need to mention that if K > 10, it is normally set to


10.

31
Figure 5 Vulnerable time for pure ALOHA protocol

32
Example 2

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 200 bits/200 kbps or
1 ms. The vulnerable time is 2 × 1 ms = 2 ms. This means
no station should send later than 1 ms before this station
starts transmission and no station should start sending
during the one 1-ms period that this station is sending.

33
Note

The throughput for pure ALOHA is


S = G × e −2G .
The maximum throughput
Smax = 0.184 when G= (1/2).

34
Example 3
A pure ALOHA network transmits 200-bit frames on a
shared channel of 200 kbps. What is the throughput if the
system (all stations together) produces
a. 1000 frames per second b. 500 frames per second
c. 250 frames per second.
Solution
The frame transmission time is 200/200 kbps or 1 ms.
a. If the system creates 1000 frames per second, this is 1
frame per millisecond. The load is 1. In this case
S = G× e−2 G or S = 0.135 (13.5 percent). This means
that the throughput is 1000 × 0.135 = 135 frames. Only
135 frames out of 1000 will probably survive.
35
Example 3 (continued)
b. If the system creates 500 frames per second, this is
(1/2) frame per millisecond. The load is (1/2). In this
case S = G × e −2G or S = 0.184 (18.4 percent). This
means that the throughput is 500 × 0.184 = 92 and that
only 92 frames out of 500 will probably survive. Note
that this is the maximum throughput case,
percentagewise.

c. If the system creates 250 frames per second, this is (1/4)


frame per millisecond. The load is (1/4). In this case
S = G × e −2G or S = 0.152 (15.2 percent). This means
that the throughput is 250 × 0.152 = 38. Only 38
frames out of 250 will probably survive.
36
Slotted ALOHA
• Time is slotted in X seconds slots
• Stations synchronized to frame times
• Stations transmit frames in first slot after frame
arrival
• Backoff intervals in multiples of slots
Backoff period B

t
kX (k+1)X t0 +X+2tprop t0 +X+2tprop+ B
Time-out
Vulnerable
period

Only frames that arrive during prior X seconds


collide 37
Figure 6 Frames in a slotted ALOHA network

38
Note

The throughput for slotted ALOHA is


S = G × e−G .
The maximum throughput
Smax = 0.368 when G = 1.

39
Figure 7 Vulnerable time for slotted ALOHA protocol

40
Example 4
A slotted ALOHA network transmits 200-bit frames on a
shared channel of 200 kbps. What is the throughput if the
system (all stations together) produces
a. 1000 frames per second b. 500 frames per second
c. 250 frames per second.
Solution
The frame transmission time is 200/200 kbps or 1 ms.
a. If the system creates 1000 frames per second, this is 1
frame per millisecond. The load is 1. In this case
S = G× e−G or S = 0.368 (36.8 percent). This means
that the throughput is 1000 × 0.0368 = 368 frames.
Only 386 frames out of 1000 will probably survive.
41
Carrier Sensing Multiple Access (CSMA)
• A station senses the channel before it starts transmission
– If busy, either wait or schedule backoff (different options)
– If idle, start transmission
– Vulnerable period is reduced to tprop (due to channel capture effect)
– When collisions occur they involve entire frame transmission times
– If tprop >X (or if a>1), no gain compared to ALOHA or slotted
ALOHA

Station A begins
transmission at t
=0 A

Station A captures
channel at t = tprop
A 42
Figure 8 Collision of the first bit in CSMA/CD

43
Figure 9 Collision and abortion in CSMA/CD

44
CSMA Options
• Transmitter behavior when busy channel is
sensed
– 1-persistent CSMA (most greedy)
• Start transmission as soon as the
channel becomes idle
• Low delay and low efficiency
– Non-persistent CSMA (least greedy)
• Wait a backoff period, then sense
carrier again
• High delay and high efficiency
– p-persistent CSMA (adjustable greedy)
• Wait till channel becomes idle,
transmit with prob. p; or wait one
mini-slot time & re-sense with
probability 1-p
• Delay and efficiency can be balanced 45
Flow diagram for three persistence methods

The p-persistent method is used if the


channel has time slots with a slot duration
equal to or greater than the maximum
propagation time. The p-persistent
approach combines the advantages of the
other two strategies. It reduces the chance
of collision and improves efficiency. In this
method, 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, the station
waits for the beginning of the next time slot
and checks the line again.
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 back­
off procedure.
Example 5

A network using CSMA/CD has a bandwidth of 10 Mbps.


If the maximum propagation time (including the delays in
the devices and ignoring the time needed to send a
jamming signal, as we see later) is 25.6 μs, what is the
minimum size of the frame?
Solution
The frame transmission time is Tfr = 2 × Tp = 51.2 μs.
This means, in the worst case, a station needs to transmit
for a period of 51.2 μs to detect the collision. The
minimum size of the frame is 10 Mbps × 51.2 μs = 512
bits or 64 bytes. This is actually the minimum size of the
frame for Standard Ethernet.
47
Collision of the first bit in CSMAlCD

At time t 1, station A has executed its persistence procedure and starts sending the bits of
its frame. At time t2, station C has not yet sensed the first bit sent by A. Station C executes
its persistence procedure and starts sending the bits in its frame, which propa­gate both to
the left and to the right. The collision occurs sometime after time t2' Station C detects a
collision at time t3 when it receives the first bit ofA's frame. Station C immedi­ately (or after
a short time, but we assume immediately) aborts transmission. Station A detects collision
at time t4 when it receives the first bit of C's frame; it also immediately aborts
transmission. Looking at the figure, we see that A transmits for the duration t4 – t1; C
transmits for the duration t3 - t2' Later we show that, for the protocol to work, the length
of any frame divided by the bit rate in this protocol must be more than either of these
durations. At time t4, the transmission of A:s frame, though incomplete, is aborted; at time
t3, the transmission of B's frame, though incomplete, is aborted.
Figure 10 Flow diagram for the CSMA/CD

49
CSMA/CA
Figure 11 Energy level during transmission, idleness, or collision

51
Figure 12 Timing in CSMA/CA

Need to avoid collisions on wireless networks because they cannot be detected. Carrier
sense multiple access with collision avoidance (CSMA/CA) was invented for this network.
Collisions are avoided through the use of CSMAICA's three strategies: the inter­frame space,
the contention window, and acknowledgments, as shown in Figure.

52
Figure 13 Flow diagram for CSMA/CA
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. Even though the channel may
appear idle when it is sensed, a distant station may have already started transmitting.
The distant station's signal has not yet reached this station. The IFS time allows the
front of the transmitted signal by the distant station to reach this station. If after the IFS
time the channel is still idle, the station can send, but it still needs to wait a time equal
to the contention time.
Contention Window
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 back-off 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 is very similar to the p-persistent method except
that a random outcome defines the number of slots taken by the waiting station. One
interesting point about the contention window is that the station needs to sense the
channel after each time slot. However, if the station finds the channel busy, it does not
restart the process; it just stops the timer and restarts it when the channel is sensed as
idle. 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
acknowl­edgment and the time-out timer can help guarantee that the receiver has
received the frame.

53
MACA: Multiple Access
with Collision
Avoidance
• Carrier sense became adopted in radio
packet

• But distances (cell size) remained


large

• Hidden and Exposed abounded


terminals

• Simple solution: use receiver’s medium state to


determine transmitter behavior

14
RTS/CTS
• Exchange of two short messages: Request to Send (RTS)
and Clear to Send (CTS)
• Algorithm
1. A sends an RTS (tells B to
2. prepare)
B replies an CTS message length)
3. (echoes
A sends its Data
1. “RTS, k bits”
defers
A 3. “Data” B C
2. “CTS, k bits”

15
Deference to
CTS
• Hear CTS à Defer for length of expected data
transmission time

– Solves hidden problem


terminal
1. “RTS, k bits”
defers
A 3. “Data” B C
2. “CTS, k bits”

16
Deference to
RTS
• Hear RTS à Defer one CTS-time (why?)

• MACA: No carrier sense before sending!


– Karn concluded useless because of hidden
terminals
• So exposed terminals can transmit
concurrently:
1. “RTS, k bits”

A 3. “Data” B C D
2. “CTS, (No
k bits” deferen
ce after
17
Collision!
• A’s collides with C’s RTS, are lost at B
RTS both
• B will
not reply with a CTS
RTS Collision RTS

A B C
• Might collisions involving packets occur?
– Not data
according to our (unrealistic)
assumptions
– But Karn acknowledges interference range
communication
>
range
18
BEB in
MACA
• When collisions arise, MACA senders randomly
backoff like Ethernet senders then retry the
RTS
• How long do collisions take to detect in
the
Experimental Ethernet?
• What size should we make MACA backoff slots?

19
BEB in
MACA
• Current backoff constant:
CW
• MACA
sender:
– CW0 = 2 and CWM = 64
– Upon successful RTS/CTS, CW ß CW0
– Upon failed RTS/CTS, CW ß min[2CW, CWM]

• Before retransmission, wait a uniform random of


number
RTS lengths (30 bytes) in [0, CW]
– 30 bytes = 240 μs

20
1. MACA

2. MACAW

3. 802.11 MAC layer

21
MACAW:
Context
• Published in SIGCOMM 1994, work
’93/’94
• Wi-Fi standards proceeded in parallel (IEEE ‘97)
standard
– 802.11 draws on MACAW, which draws on
MACA
• Assumptions and goals: Same as
MACA
• Setting: Wireless LAN
– Packet radio cell size: circa 100 mi. μs)
(528 ns)
– Wireless LAN cell size: circa 100 ft.
(100
22
Fairness in
BEB/MACA
• MACA’s BEB can lead to unfairness: backed-off sender
has
decreasing chance to acquire medium (“the poor get
• poorer”)
Simple example: C each sending at a rate thatcan alone
A,
saturate the
network A B C
CW= CW
32 =4
• C more likely to the backoff and set CW=2
win minimum
• A more likely to defer CW)
(maintain
23
BEB in MACAW:
Copy
• MACAW proposal: senders write their CW into
packets
– Upon hearing a packet, copy and adopt its CW
• Result: Dissemination of congestion level of
“winning”
transmitter to its competitors
• Is this a good
idea?
• RTS failure rate at one node propagates far and
wide
– Ambient noise? Regions with different loads?

24
BEB in
•MACAW
Integrates with MACAW’s ACK
mechanism
• Multiplicative increase, linear (MILD)
decrease
• MACAW
sender:
– CW0 = 2 and CWM = 64
– Upon failed RTS/CTS
• CW ß min[1.5CW, CWM]
– Upon successful RTS/CTS but failed ACK, no change
– Upon successful RTS/CTS/DATA/ACK
• CW ß CW−1

25
Reliability:
•ACK
MACAW introduces an ACK after DATA packets; not in
MACA
• Sender resends if RTS/CTS succeeds no ACKreturns
but
• Sender resends Two
RTS. cases:
1. DATA was
–lostReceiver sends CTS, sender
DATA
2. Receiver already has the DATA (reverse- ACK loss)
–linkReceiver sends
ACK

26
ACK:
•Considerations
Avoid TCP window reductions when
interference
• Useful when there’s ambient noise (microwave
ovens…)
• Why are sequence numbers in DATA packets
now important (not mentioned directly in paper!)

• Are ACKs for multicast packets? Consequences for,


useful e.g.,
ARP?

27
MACAW and Exposed
•Terminals
C can proceed only if it can hear a CTS from
D
– But B’s DATA will likely clobber
• So B sends a Data Sending (DS) after CTS
packet
– So C knows that B received CTS
a• C defers after ACK
until
Conservative:
1. “RTS, k bits” Doesn’t leverage exposed
terminal opportunities for concurrency
A 2. “CTS, B C D
k bits” Defer
3. “DS”
4.
“Data”
28
Need for
Synchronization
• Suppose D has a smaller CW, ongoing
• transmission
• B can not reply to A’s RTS
A doesn’t know when the contention periods are
• So, A’s backoff will increase:
unfair

• MACAW’sapproach: let B contend “on behalf of” A

A B C D

29
MACAW:
RRTS
• But B knows when the gaps for contention are
• B sends a Request for RTS (RRTS) packet to A when
DATA completes (hears an ACK from C)
• C defers transmissions for two slot periods (why?)
• A sends aRTS immediately without backoff

RRTS
CTS
A B C D

DRA
DRAT
TTS
TSA
30
A Problem not Solved by
RRTS
• What happens in this
scenario?
– Assume C is successful, ongoing
– transmission
When A sends RTS to B, B just can’t it
– hear
So this problem is not solved by RRTS

A B C D

31
Today: Wi- Above the PHY
Fi MACA
1.

2. MACAW

3. 802.11 MAClayer
– Contention and backoff
– Frame aggregation
– Selective retransmission Acknowledgement
and

32
802.11’s
•MAC
Adopts MACAW’s MAC from a high
level:
– Same RTS/CTS/DATA/ACK
• RTS/CTS optional
– Different contention window control

• Adopts CS and Deference from Ethernet:


– But not collision detection
• Transmit signal power ≫ receive signal power

• Adds design elements for high data rates, TCP


above
33
Deference times for
Prioritization
• Fixed-time deference + CS = prioritization > SIFS)
(DIFS
Distributed Coordination Function Short Interframe
(DCF) Interframe Space (DIFS) Space (SIFS)

Sender: Data

Receiver: CW ACK

Overhead Overhea
d

• So, overhead of fixed time per Wi-Fi


duration Frame: SIFS,
– RTS/CTS (if present), DIFS, CW, preamble,
ACK 802.11 ac: SIFS = 16 μs, DIFS = 34 μs

34
Backoff: Pausing and
Resuming
• 802.11 backoff slot time Physical CS time + 802.11 ac:
switch radio from slot time = 9 μs
=
propagation time + time
• to
No No “copy,” MILD, no DS, noRRTS
receive
MACAW: to transmit
no
B1 = 25 B1 = 5
Node 1: wait data
pause @ 5
Node 2: data wait
B2 = 20 B2 = 15 B2 = 10

B1 and B2 are backoff intervals


CW = 31
at nodes 1 and 2 35
802.11’s
•Pause
Adaptively sets CW with BEB
– Start with CW = 31, double if no CTS or ACK
received
– Reset to 31 on successful transmission
• Not fair in the short term
– Under contention, losers will use larger CW
than winners (winners reset)
– Winners may be able to transmit several
packets while unlucky nodes are still
counting down
• Could adopt MACAW’s copy & MILD, but has
drawbacks

36
1. MACA

2. MACAW

3. 802.11 MAClayer
– Contention and backoff
– Frame aggregation
– Selective retransmission and
Acknowledgement

37
Motivation: MAC Scaling
Incommensurate with Bitrate
PHY
Preamble
Payload (1,500 byte packet)
(% overhead)
6 Mbps
1% (20 MHz, 1
x 1)
8% 54 Mbps
(20 MHz, 1
29% x 1)
130 Mbps
45% (20 MHz, 2 x 2)
270 Mbps
73% (40MHz,
(40 M
MHz, 2
4 xx 2)
4)
540 Mbps
Problem: Drop in efficiency with increasing data rate from
fixed overheads in the preamble and inter-frame spaces

38
Aggregation Fixed
Amortizes Overheads
• Without aggregation:
DIFS DIFS DIFS

Data Data Data


…...
CW ACK CW ACK CW ACK

SIFS SIFS SIFS

• With aggregation:Multiple frames/channel


acquisition
– Block ack (BA) tells sender which arrived
DIFS DIFS

Data Data Data Data Data Data

CW BA CW BA

SIFS SIFS
39
802.11: Selective
•Retransmission
802.11 adopts TCP’s selective retransmission, but:
– Primary consideration is performance at the link
layer
– Protocol is only semi-reliable: may drop packets
• Receiver-side reorder buffer for in-order
delivery
• Receiver-side scoreboard for feedback to
sender
• Sender transmits Block ACK request (BAR)
1. If needed, sender can solicit a Block ACK response
frames:
(BA response) from receiver

2. Sender may direct receiver to drop (i.e., fail to


deliver
to the network layer) frames it deems old 40
Wi-Fi Above the
PHY: Concluding
Thoughts
•Hard to understate the influence of ALOHAnet,Ethernet,
MACA, and MACAW on Wi-Fi

– CS, deference, RTS/CTS,


BEB...

• Wi-Fi’s scoreboarding & selective retransmission


serve as an example of the corollary to the E2E
Principle
– Implement just enough of a function at the lower layer
to get a performance advantage

46
2 CONTROLLED ACCESS

In controlled access, the stations consult one another


to find which station has the right to send. A station
cannot send unless it has been authorized by other
stations. We discuss three popular controlled-access
methods.

Topics discussed in this section:


Reservation
Polling
Token Passing
82
Reservations Systems
• Centralized systems: A central controller accepts requests from
stations and issues grants to transmit
– Frequency Division Duplex (FDD): Separate frequency bands for uplink &
downlink
– Time-Division Duplex (TDD): Uplink & downlink time-share the same channel
• Distributed systems: Stations implement a decentralized algorithm
to determine transmission order

Central
Controller

83
Reservation Systems
Reservation Frame
interval transmissions

r d d d r d d d Time
Cycle n Cycle (n + 1)

r = 1 2 3 M

• Transmissions organized into cycles


• Cycle: reservation interval + frame transmissions
• Reservation interval has a minislot for each station to
request reservations for frame transmissions 84
Reservation System Options
• Centralized or distributed system
– Centralized systems: A central controller listens to reservation
information, decides order of transmission, issues grants
– Distributed systems: Each station determines its slot for transmission
from the reservation information
• Single or Multiple Frames
– Single frame reservation: Only one frame transmission can be
reserved within a reservation cycle
– Multiple frame reservation: More than one frame transmission can be
reserved within a frame
• Channelized or Random Access Reservations
– Channelized (typically TDMA) reservation: Reservation messages from
different stations are multiplexed without any risk of collision
– Random access reservation: Each station transmits its reservation
message randomly until the message goes through

85
Example
• Initially stations 3 & 5 have reservations to transmit
frames
(a)
r 3 5 r 3 5 r 3 5 8 r 3 5 8 r 3
t

• Station 8 becomes active and makes reservation


• Cycle now also includes frame transmissions from station
8
(b) 8

r 3 5 r 3 5 r 3 5 8 r 3 5 8 r 3
t

86
Efficiency of Reservation Systems
• Assume minislot duration = vX
• TDM single frame reservation scheme
– If propagation delay is negligible, a single frame transmission requires (1+v)X
seconds
– Link is fully loaded when all stations transmit, maximum efficiency is:

MX 1
 max  
Mv  MX 1  v
• TDM k frame reservation scheme
– If k frame transmissions can be reserved with a reservation
message and if there are M stations, as many as Mk
frames can be transmitted in XM(k+v) seconds
– Maximum efficiency is:
MkX 1
 max  
Mv  MkX 1  v
k 87
Random Access Reservation Systems
• Large number of light traffic stations
– Dedicating a minislot to each station is inefficient
• Slotted ALOHA reservation scheme
– Stations use slotted Aloha on reservation minislots
– On average, each reservation takes at least e minislot
attempts
– Effective time required for the reservation is 2.71vX

1 1
ρmax = X X(1+ev)
=
+ 2.71v
88
Polling Systems
• Centralized polling systems: A central controller transmits
polling messages to stations according to a certain order
• Distributed polling systems: A permit for frame
transmission is passed from station to station according
to a certain order
• A signaling procedure exists for setting up order

Central
Controller

89
Polling System Options
• Service Limits: How much is a station allowed to transmit per
poll?
– Exhaustive: until station’s data buffer is empty (including
new frame arrivals)
– Gated: all data in buffer when poll arrives
– Frame-Limited: one frame per poll
– Time-Limited: up to some maximum time
• Priority mechanisms
– More bandwidth & lower delay for stations that appear
multiple times in the polling list
– Issue polls for stations with message of priority k or higher

90
Figure 14 Select and poll functions in polling access method

91
Comparison of MAC approaches
• Aloha & Slotted Aloha
– Simple & quick transfer at very low load
– Accommodates large number of low-traffic bursty users
– Highly variable delay at moderate loads
– Efficiency does not depend on a
• CSMA-CD
– Quick transfer and high efficiency for low delay-bandwidth
product
– Can accommodate large number of bursty users
– Variable and unpredictable delay

92
Comparison of MAC approaches
• Reservation
– On-demand transmission of bursty or steady streams
– Accommodates large number of low-traffic users with slotted Aloha
reservations
– Can incorporate QoS
– Handles large delay-bandwidth product via delayed grants
• Polling
– Generalization of time-division multiplexing
– Provides fairness through regular access opportunities
– Can provide bounds on access delay
– Performance deteriorates with large delay-bandwidth product

93
Overview

• Schedule-based protocols
– SMACS
– LEACH
– TRAMA
• IEEE 802.15.4

Ad hoc & sensor networs - Ch 5:


SS 05 94
MAC protocols
MACA Problem: Idle listening
• Need to sense carrier for RTS or CTS packets
– In some form shared by many CSMA variants; but e.g. not by busy tones
– Simple sleeping will break the protocol
• IEEE 802.11 solution: ATIM windows & sleeping
– Basic idea: Nodes that have data buffered for receivers send traffic
indicators at pre-arranged points in time
– Receivers need to wake up at these points, but can sleep otherwise
• Parameters to adjust in MACA
– Random delays – how long to wait between listen/transmission
attempts?
– Number of RTS/CTS/ACK re-trials?
–…

Ad hoc & sensor networs - Ch 5:


SS 05 95
MAC protocols
Sparse topology and energy management
(STEM)
Sensor-MAC (S-MAC)
• MACA’s idle listening is particularly unsuitable if average data rate is low
– Most of the time, nothing happens
• Idea: Switch nodes off, ensure that neighboring nodes turn on
simultaneously to allow packet exchange (rendez-vous)

– Only in these active periods,


packet exchanges happen Active period
– Need to also exchange wakeup Wakeup period
schedule between neighbors
– When awake, essentially perform Sleep period
RTS/CTS
• Use SYNCH, RTS, CTS phases

For SYNCH For RTS For CTS

Ad hoc & sensor networs - Ch 5:


SS 05 97
MAC protocols
S-MAC synchronized islands
• Nodes try to pick up schedule synchronization
from neighboring nodes
• If no neighbor found, nodes pick some schedule
to start with
• If additional nodes join, some node might learn
A Aabout two different
A
schedules
A
from different
A A
nodesB B B B B
– “Synchronized
E islands”
E E E E E E
• ToC bridge this gap, it has to follow both schemes
C C C C
SS 05
D Ad hoc & sensor networs - Ch 5:
D MAC protocols D D Time
98
S-MAC
The mediation device protocol
Timeout-MAC (T-MAC)
• In S-MAC, active period is of
constant length A B C D
RTS
• What if no traffic actually happens?
– Nodes stay awake needlessly long CTS
• Idea: Prematurely go back to sleep
mode when no traffic has happened May not
for a certain time (=timeout) ! T- send
DAT
MAC A
– Adaptive duty cycle!
• One ensuing problem: Early sleeping ACK Timeout,
– C wants to send to D, but is hindered
go back to
by transmission A! B
sleep as
– Two solutions exist – homework!
nothing
happened
RTS

Ad hoc & sensor networs - Ch 5:


SS 05 101
MAC protocols
Preamble Sampling

• So far: Periodic sleeping supported by some


means to synchronize wake up of nodes to
ensure rendez-vous between sender and receiver
• Alternative option: Don’t try to explicitly
Start transmission:
synchronize nodes Long preamble Actual packet
– Have receiver sleep and only periodically sample the
channel Check Check Check Check
channel channel channel channel
• Use long preamblesStay
to awake!
ensure that receiver stays
awake to catch Adactual
SS 05
packet
hoc & sensor networs - Ch 5:
102
MAC protocols
B-MAC
• Combines several of the above discussed ideas
– Takes care to provide practically relevant solutions

• Clear Channel Assessment


– Adapts to noise floor by sampling channel when it is assumed to be free
– Samples are exponentially averaged, result used in gain control
– For actual assessment when sending a packet, look at five channel samples
– channel is free if even a single one of them is significantly below noise
– Optional: random backoff if channel is found busy

• Optional: Immediate link layer acknowledgements for received


packets

Ad hoc & sensor networs - Ch 5:


SS 05 103
MAC protocols
B-MAC II
• Low Power Listening (= preamble sampling)
– Uses the clear channel assessment techniques to decide whether there is
a packet arriving when node wakes up
– Timeout puts node back to sleep if no packet arrived

• B-MAC does not have


– Synchronization
– RTS/CTS
– Results in simpler, leaner implementation
– Clean and simple interface

• Currently: Often considered as the default WSN MAC protocol


Ad hoc & sensor networs - Ch 5:
SS 05 104
MAC protocols
Power Aware Multiaccess with Signaling –
PAMAS
• Idea: combine busy tone with RTS/CTS
– Results in detailed overhearing avoidance, does not
address idle listening
– Uses separate data and control channels
• Procedure
– Node A transmits RTS on control channel, does not sense
Controlchannel
RTS CTS Busy tone
– NodeAB! receives
channel B B ! ARTS,sent
sendsby BCTS on control channel if it can
Time
receive and does not know about ongoing transmissions
Data– Data
B sends busy tone as itAstarts
! B to receive data
channel

Ad hoc & sensor networs - Ch 5:


SS 05 105
MAC protocols
PAMAS – Already ongoing transmission
? B
• Suppose a node C in vicinity of A isC already
A
receiving a packet when A initiates RTS
• Procedure
– A sends RTS to B
– C is sending busy tone (as it receives Similarly:
data) Ongoing
Busy tone by C transmission near B
– CTSRTS
Control and busy
CTS
tone collide, A receives no CTS,RTS
destroys doesby
channel not A
send
! B data
B!A busy tone
Time
Data No data!
channel

Ad hoc & sensor networs - Ch 5:


SS 05 106
MAC protocols
Overview

• Schedule-based protocols
– SMACS
– LEACH
– TRAMA
• IEEE 802.15.4

Ad hoc & sensor networs - Ch 5:


SS 05 107
MAC protocols
Low-Energy Adaptive Clustering Hierarchy
(LEACH)
• Given: dense network of nodes, reporting to a central sink, each
node can reach sink directly
• Idea: Group nodes into “clusters”, controlled by clusterhead
– Setup phase; details: later
– About 5% of nodes become clusterhead (depends on scenario)
– Role of clusterhead is rotated to share the burden
– Clusterheads advertise themselves, ordinary nodes join CH with strongest
signal
– Clusterheads organize
• CDMA code for all member transmissions
• TDMA schedule to be used within a cluster
• In steady state operation
– CHs collect & aggregate data from all cluster members
– Report aggregated data to sink using CDMA

Ad hoc & sensor networs - Ch 5:


SS 05 108
MAC protocols
LEACH rounds
Fixed-length round

……….. Setup phase Steady-state phase ………..

Time slot Time slot Time slot Time slot


….. ….. …..
1 2 n 1

Advertisement phase Cluster setup phase Broadcast schedule

Clusterheads Members
compete with compete
Self-election of
CSMA with CSMA
clusterheads

Ad hoc & sensor networs - Ch 5:


SS 05 109
MAC protocols
SMACS
• Given: many radio channels, superframes of known length
(not necessarily in phase, but still time synchronization
required!)
• Goal: set up directional links between neighboring nodes
– Link: radio channel + time slot at both sender and receiver
– Free of collisions at receiver
– Channel picked randomly, slot is searched greedily until a
collision-free slot is found
• Receivers sleep and only wake up in their assigned time
slots, once per superframe
• In effect: a local construction of a schedule
Ad hoc & sensor networs - Ch 5:
SS 05 110
MAC protocols
SMACS link setupX
• Case 1: Node X, Y both so far unconnected
Y

– Node X sends invitation message Type1 (X, unconnected)


– Node Y answers, telling X that is unconnected to
any other node
– Node X tells Y to pick slot/frequency for the link Type2(X, Y, unconnected)
– Node Y sends back the link specification
• Case 2: X has some neighbors, Y not
– Node X will construct link specification and Type3 (Y, --)
instruct Y to use it (since Y is unattached)
• Case 3: X no neighbors, Y has some
– Y picks link specification Type4(LinkSpec)

• Case 4: both nodes already have links


– Nodes exchange their schedules and pick free
slots/frequencies in mutual agreement
Message exchanges
protected by
randomized backoff
Ad hoc & sensor networs - Ch 5:
SS 05 111
MAC protocols
TRAMA
• Nodes are synchronized
• Time divided into cycles, divided into
– Random access periods
– Scheduled access periods
• Nodes exchange neighborhood information
– Learning about their two-hop neighborhood
– Using neighborhood exchange protocol: In random access period, send
small, incremental neighborhood update information in randomly
selected time slots
• Nodes exchange schedules
– Using schedule exchange protocol
– Similar to neighborhood exchange

Ad hoc & sensor networs - Ch 5:


SS 05 112
MAC protocols
TRAMA – adaptive election
• Given: Each node knows its two-hop neighborhood and their
current schedules
• How to decide which slot (in scheduled access period) a node
can use?
– Use node identifier x and globally known hash function h
– For time slot t, compute priority p = h (x © t)
– Compute this priority for next k time slots for node itself and all two-
hop neighbors
– Node uses those time slots for which it has the highest priority
Priorities of t=0 t=1 t=2 t=3 t=4 t=5
node A and A 14 23 9 56 3 26
its two
B 33 64 8 12 44 6
neighbors B
&C C 53 18 6 33 57 2

Ad hoc & sensor networs - Ch 5:


SS 05 113
MAC protocols
TRAMA – possible conflicts
• When does a node have to receive?
– Easy case: one-hop neighbor has won a time slot and announced a
packet for it
– But complications exist – compare example
· What does B
believe?
· A thinks it can send
· B knows that D has
higher priority in its A D
2-hop B C
neighborhood!
· Rules for resolving
such conflicts are
part of TRAMA Prio 100 Prio 95 Prio 79 Prio 200

Ad hoc & sensor networs - Ch 5:


SS 05 114
MAC protocols
Comparison: TRAMA, S-MAC
• Comparison between TRAMA & S-MAC
– Energy savings in TRAMA depend on load situation
– Energy savings in S-MAC depend on duty cycle
– TRAMA (as typical for a TDMA scheme) has higher
delay but higher maximum throughput than
contention-based S-MAC

• TRAMA disadvantage: substantial memory/CPU


requirements for schedule computation
Ad hoc & sensor networs - Ch 5:
SS 05 115
MAC protocols
Overview

• Principal options and difficulties


• Contention-based protocols
• Schedule-based protocols
• IEEE 802.15.4

Ad hoc & sensor networs - Ch 5:


SS 05 116
MAC protocols
IEEE 802.15.4
• IEEE standard for low-rate WPAN applications
• Goals: low-to-medium bit rates, moderate delays without too
stringent guarantee requirements, low energy consumption
• Physical layer
– 20 kbps over 1 channel @ 868-868.6 MHz
– 40 kbps over 10 channels @ 905 – 928 MHz
– 250 kbps over 16 channels @ 2.4 GHz
• MAC protocol
– Single channel at any one time
– Combines contention-based and schedule-based schemes
– Asymmetric: nodes can assume different roles

Ad hoc & sensor networs - Ch 5:


SS 05 117
MAC protocols
IEEE 802.15.4 MAC overview
• Star networks: devices are associated with
coordinators
Coordinator Device
– Forming a PAN, identified by a PAN identifier
Beacon
• Coordinator Data

– Bookkeeping
Active period
of devices, address assignment,
Inactive period
request

generate beacons Acknowledgement

– Talks to devices and peer coordinators Data


• Beacon-mode
Contention
access
superframe
Guaranteed time structure
slots (GTS) Acknowledgement
– GTS assigned to devices upon request
Beacon period

Ad hoc & sensor networs - Ch 5:


SS 05 118
MAC protocols
Wakeup radio MAC protocols
• Simplest scheme: Send a wakeup “burst”, waking up all neighbors !
Significant overhearing
– Possible option: First send a short filter packet that includes the actual
destination address to allow nodes to power off quickly
• Not quite so simple scheme: Send a wakeup burst including the
receiver address
– Wakeup radio needs to support this option
• Additionally: Send information about a (randomly chosen) data
channel, CDMA code, … in the wakeup burst
• Various variations on these schemes in the literature, various further
problems
– One problem: 2-hop neighborhood on wakeup channel might be different
from 2-hop neighborhood on data channel
– Not trivial to guarantee unique addresses on both channels

Ad hoc & sensor networs - Ch 5:


SS 05 119
MAC protocols
Further protocols
• MAC protocols for ad hoc/sensor networks is one
the most active research fields
– Tons of additional protocols in the literature
– Examples: STEM, mediation device protocol, many CSMA
variants with different timing optimizations, protocols
for multi-hop reservations (QoS for MANET), protocols
for multiple radio channels, …
– Additional problems, e.g., reliable multicast

• This chapter has barely scratched the surface…


Ad hoc & sensor networs - Ch 5:
SS 05 120
MAC protocols

You might also like