Lect2 MAC
Lect2 MAC
MAC protocols:
design goals, challenges,
contention-based
and contention-free protocols
1
Why do we need MAC protocols?
• Wireless medium is shared
• Many nodes may need to access the wireless medium to send
or receive messages
• Concurrent message transmissions may interfere with each
other => collisions => message drops
• A MAC protocol is needed to allow the efficient sharing of the
wireless medium by multiple nodes
2
Design goals
• To ensure reliable communication across wireless links
(not end-to-end reliability, only 1-hop reliability)
• To maximize the use of available bandwidth
(keep control overhead as low as possible)
• To ensure fair bandwidth allocation to contending nodes
• To minimize delay of sending/receiving messages
• To minimize energy-consumption of sending/receiving
messages
3
Challenges
• Error-prone channel
• Limited bandwidth
• Limited communication range
• Limited energy (for remote battery-powered nodes)
• Node mobility
• Lack of central coordination
• Lack of tight time synchronisation
4
Protocol classification
• Contention-based MAC protocols
– Contention arises when two or more nodes attempt to transmit at the
same time over a shared channel.
– A contention-based protocol assumes that packet collisions may
occur, and tries to detect, avoid or deal with them.
• Contention-free MAC protocols
– A contention-free protocol tries to divide the wireless channel into
logical channels that do not interfere with each other (e.g. TDMA,
FDMA, CDMA).
– Nodes transmit packets using different logical channels, and as a
result, there is no contention in the network.
– Contention-free schemes are more applicable to fixed networks or
networks with centralized control.
• In this course, we focus on contention-based MAC protocols
5
Some contention-based protocols
• ALOHA, slotted-ALOHA
• CSMA
• MACA
• MACAW
• IEEE 802.11 (DCF)
• …
6
ALOHA, slotted-ALOHA
• Pure ALOHA
– Nodes access the channel when they have data to transmit.
– If a transmission is unsuccessful (e.g. no ACK is sent from
the destination node), the source node retransmits after a
random amount of time.
• Slotted-ALOHA
– Time is divided into equal size slots
– A node transmission always starts at the beginning of a slot
– If a transmission is unsuccessful, the source node
retransmits at a future slot with a certain probability.
7
ALOHA slotted-ALOHA
Node 1
Node 2
Node 3
Node 4
Node 5
Node 6
Node 7
time time
successful packet
8
unsuccessful packet
CSMA - physical sensing
9
CSMA/CA implementation
• Before transmitting a frame, a node senses the channel
• If the channel is idle for longer than DIFS (Distributed Interframe
Space), the node continues with its transmission.
• Otherwise, if the medium is busy, the transmission is deferred until the
end of the ongoing transmission. Then a backoff procedure is started.
backoff backoff
started ended
FRAME
Node 3
11
DIFS DIFS DIFS
CSMA/CA implementation - backoff
• Binary Exponential Backoff (BEB)
12
CSMA/CA with ACK
• Acknowledgement scheme:
– The destination node waits for SIFS (Short Interframe Space) after
receiving a frame. Typically, SIFS is shorter than DIFS.
– The destination node sends an ACK to the source node.
FRAME
Source
ACK
Destination
DIFS SIFS
A B C D
B transmits to A.
C hears the transmission from B to A.
C unnecessarily refrains from sending a message to D
even though no collision would occur.
14
The hidden node problem
CSMA does not avoid the hidden node problem.
B C B C
A A
A transmits to B. A tries to transmit to B.
B receives the message. C also tries to transmit to B.
C does not hear the transmission. Both messages are dropped at B.
15
MACA – virtual sensing
16
RTS-CTS handshake
CTS
A A A
A sends RTS to B.
B sends a CTS to A (C overhears it).
A sends Data to B.
18
MACAW
RTS
CTS
DS
Data
ACK
19
MACAW
20
IEEE 802.11
• Standard MAC and physical protocol for wireless LANs
• The MAC layer offers two types of services:
– Distributed Coordination Function (DCF)
– Point Coordination Function (PCF)
contention-free
services contention
services
PCF
DCF
Physical Layer
• DCF combines
– physical sensing (CSMA/CA) and
– virtual sensing (RTS-CTS-Data-ACK)
21
IEEE 802.11 DCF - virtual sensing
• RTS and CTS include the busy channel duration
• Nodes that overhear RTS/CTS set timer NAV (Network
Allocation Vector) to the busy channel duration
• A node starts backoff after NAV becomes zero
RTS Frame
Source node
CTS ACK
Destin. node
23
Contention-free multiple access
• TDMA (Time Division Multiple Access)
– Time is divided into timeslots
– Nodes transmit one after the other using their own timeslot
– TDMA requires good time synchronization
• FDMA (Frequency Division Multiple Access)
– The available bandwidth is divided into multiple frequency channels /
bands.
– A transmitter-receiver pair uses a dedicated frequency channel for
communication
• CDMA (Code Division Multiple Access)
– Every transmitter uses the entire spectrum (not a specific frequency)
– The transmissions are differentiated through a unique code assigned
to each node (that is independent of the data being transmitted)
24
IEEE 802.11 PCF
• IEEE 802.11 PCF (Point Coordination Function)
• One node, called Access Point (AP), coordinates the
transmissions of its neighbors
• The AP polls neighbors one after the other, and allows them to
transmit in a round robin manner
• PCF is not suitable for large multi-hop networks
25
Bluetooth
• Piconet: One node, called the master can communicate with up
to 7 nodes called the slaves
• Bluetooth uses 79 channels (each 1 MHz wide) and changes
channels up to 1600 times per second
• Each channel is divided into time slots of 625 μsecs
• The master switches from slave to slave in a round-robin
fashion
– Time-Division Duplex (TDD): master (downlink) and slave (uplink)
transmissions occur in alternative slots
– Slaves can talk back to the master immediately after they are polled
by the master
26
Summary
Contention-based protocols
– Aloha, slotted-Aloha: no physical sensing
– CSMA: physical sensing
– CSMA/CA: physical sensing and backoff
– MACA and MACAW: virtual sensing using control packets
(RTS/CTS)
– IEEE 802.11 DCF: physical and virtual sensing
Contention-free protocols
– IEEE 802.11 PCF
– Bluetooth
– …
27
Related reading
• Standard textbook:
– Section 2.3
– Section 2.5
– Sections 6.1-6.5.1
• Internet sources:
– http://www.utdallas.edu/~mxw013200/MAC_ADHOC.html
– http://sss-mag.com/pdf/802_11tut.pdf
– http://attila.sdsu.edu/~kumar/MAC_Survey.pdf
28