Download as pdf or txt
Download as pdf or txt
You are on page 1of 63

Wireless Ad hoc Network

Associate Prof. Wei Liu ()


Dept. of Electronics and Information Eng. Huazhong University of Science and Technology

2009.04

Lecture 3
l

Chapter 2. MAC Layer Protocols


l l l l

2.1 Introduction 2.2 Important Issues and the Need 2.3 Classification of MAC Protocols 2.4 Summary

Wireless Ad hoc network Lecture 3

Layering in Ad hoc network


Application Layer Presentation Layer Session Layer Transport Layer Network Layer Data link layer Physical Layer
Medium access control sub-layer deals with how to subcontrol access to the shared medium
Wireless Ad hoc network Lecture 3

Logical Link Control Medium Access Control

MAC layer
l

The data-link layer l involves the functions and procedures necessary to transfer data between two or more nodes of the network. l error correction, framing, physical addressing, and flow and error controls. MAC sub-layer l is responsible for resolving conflicts among different nodes for channel access. l the MAC layer has a direct bearing on how reliably and efficiently data can be transmitted between two nodes, it affects the quality of service (QoS) of the network.
Wireless Ad hoc network Lecture 3

Shared wireless media


l

Shared wireless media in ad hoc networks


l

l l

Each node can only be a transmitter (TX) or a receiver (RX) at a time, share the same frequency domain to communicate Communication among mobile nodes is limited within a certain transmission range. Within such a range,only one transmission channel is used, covering the entire bandwidth. Additional delay introduced in wireless senarcio, packet delay is caused by the traffic load at the neighboring nodes, which is called traffic interference.
Wireless Ad hoc network Lecture 3

Wireless MAC
l

A MAC protocol
l

defines how each mobile unit can share the limited wireless bandwidth resource in an efficient manner to provide an orderly and efficient use of the common spectrum
l

Design objective
l

per-link connection establishment and per-link connection cancellation

to increase the overall network throughput while maintaining low energy consumption for packet processing and communications
Wireless Ad hoc network Lecture 3

Performance Metrics - 1
l

Throughput and delay: l Throughput is generally measured as the percentage of successfully transmitted radio-link level frames per unit time. l Transmission delay is defined as the interval between the frame arrival time at the MAC layer of a transmitter and the time at which the transmitter realizes that the transmitted frame has been successfully received by the receiver. Fairness: l Generally, fairness measures how fair the channel allocation is among the flows in the different mobile nodes. l The node mobility and the unreliability of radio channels are the two main factors that impact fairness.
Wireless Ad hoc network Lecture 3

Performance Metrics - 2
l

Energy efficiency: l Generally, energy efficiency is measured as the fraction of the useful energy consumption (for successful frame transmission) to the total energy spent. Multimedia support: l This is the ability of a MAC protocol to accommodate traffic with different service requirements, such as throughput, delay, and frame loss rate.

Wireless Ad hoc network Lecture 3

Lecture 3
l

Chapter 2. MAC Layer Protocols


l l

2.1 Introduction 2.2 Important Issues and the Need


l

2.2.1 Need for Special MAC Protocols

l l

2.3 Classification of MAC Protocols 2.4 Summary

Wireless Ad hoc network Lecture 3

Several important issues


l

Controlled wireless medium


l l

Industrial, Scientific and Medical (ISM) band a limited channel bandwidth much smaller than that of wirednetworks an unreliable time-varying channe multiple access, signalfading,and noise and interference the effective throughput in wireless networks is significantly lower MAC dealswith unidirectional links nodes are mostly rely on batteries, which requre energy conservation design open media upon attacks
Wireless Ad hoc network Lecture 3

Error prone channel


l l l

Mobile network topology


l l

Security
l

Review: Typical MAC protocols


l

ALOHA
l l

Pure ALOHA, max channel utilization 18.4% Slotted ALOHA, double max channel utilization

CSMA
l l l

Carrier Sense Multiple Access Listen Before Talk, LBT CSMA-series

Wireless Ad hoc network Lecture 3

Review: CSMA
l

Carrier Sense Multiple Access


l

Every station senses the carrier before transmitting If channel appears free
l

Transmit (with a certain probability)

l l

Otherwise, wait for some time and try again Different CSMA protocols:
l l

Sending probabilities Retransmission mechanisms

Wireless Ad hoc network Lecture 3

Review: Ingredients of CSMA


l

Carrier sense (CS)


l

Hardware capable of sensing whether transmission taking place in vicinity Hardware capable of detecting collisions Protocol for avoiding collisions When collision detection not possible, link-layer mechanism for identifying failed transmissions Method for estimating contention and deferring transmissions
Wireless Ad hoc network Lecture 3

l l l

Collision detection (CD)


l

Collision avoidance (CA)


l

Acknowledgments
l

Backoff mechanism
l

Node Model
l

Carrier sensing range


l

nodes in the carrier sensing zone can sense a transmission, but cannot decode packet correctly nodes in transmission range can receive and decode packet correctly.

Transmission range
l

Wireless Ad hoc network Lecture 3

Hidden Terminal Problem


l

CSMA for Ad Hoc Networks


l l l

In CSMA, sender decides to transmit based on carrier strength in its vicinity Collisions occur at the receiver Carrier strengths at sender and receiver may be different:

l l l l

Node B can communicate with A and C both A and C cannot hear each other When A transmits to B, C cannot detect the transmission using the carrier sense mechanism If C transmits, collision will occur at node B

Hidden Terminal A B C

Wireless Ad hoc network Lecture 3

Exposed Terminal Problem


l

CSMA for Ad Hoc Networks


l l l

In CSMA, sender decides to transmit based on carrier strength in its vicinity Collisions occur at the receiver Carrier strengths at sender and receiver may be different:

l l l l

Node B can communicate with A and C both A and C cannot hear each other When A transmits to B, C cannot detect the transmission using the carrier sense mechanism If C transmits, collision will occur at node B

Exposed Terminal A B C D

Wireless Ad hoc network Lecture 3

Lecture 3
l

Chapter 2. MAC Layer Protocols


l l l

2.1 Introduction 2.2 Important Issues and the Need 2.3 Classification of MAC Protocols
l l

l l l

2.3.1 Contention-Based MAC Protocols 2.3.2 Contention-Based MAC Protocols with Reservation Mechanisms 2.3.3 MAC Protocols Using Directional Antennas 2.3.4 Multiple-Channel MAC Protocols 2.3.5 Power-Aware or Energy-Efficient MAC Protocols

2.4 Summary Ad hoc network Lecture 3 Wireless

Classification of MAC Protocols

Wireless Ad hoc network Lecture 3

Other Classifications
l l l l l

Energy-efficient Qos-aware Equiped With directional antennas Support unidirectional links Support multiple channels
l

single channel vs. multiple channels

Wireless Ad hoc network Lecture 3

Lecture 3
l

Chapter 2. MAC Layer Protocols


l l l

2.1 Introduction 2.2 Important Issues and the Need 2.3 Classification of MAC Protocols
l l

l l l

2.3.1 Contention-Based MAC Protocols 2.3.2 Contention-Based MAC Protocols with Reservation Mechanisms 2.3.3 MAC Protocols Using Directional Antennas 2.3.4 Multiple-Channel MAC Protocols 2.3.5 Power-Aware or Energy-Efficient MAC Protocols
Wireless Ad hoc network Lecture 3

2.4 Summary

2.3.1 Contention-Based MAC Contentionl

Random Access Protocols l ALOHA l a node may access the channel as soon as it is ready l ALOHA is more suitable under low system loads with a large number of potential senders
l

Slotted ALOHA l introduces synchronized transmission time slots similar to TDMA l nodes can transmit only at the beginning of a time slot, doubles the throughput as compared to the pure ALOHA scheme CSMA-based schemes further l reduce the possibility of packet collisions and improve the throughput.
Wireless Ad hoc network Lecture 3

Lecture 3
l

Chapter 2. MAC Layer Protocols


l l l

2.1 Introduction 2.2 Important Issues and the Need 2.3 Classification of MAC Protocols
l l

l l l

2.3.1 Contention-Based MAC Protocols 2.3.2 Contention-Based MAC Protocols with Reservation Mechanisms 2.3.3 MAC Protocols Using Directional Antennas 2.3.4 Multiple-Channel MAC Protocols 2.3.5 Power-Aware or Energy-Efficient MAC Protocols
Wireless Ad hoc network Lecture 3

2.4 Summary

2.3.2 Contention-Based MAC Protocols Contentionwith Reservation Mechanisms


l

Motivation
l l

To solve the hidden and exposed-terminal problems in CSMA use the request-to-send/clear-to-send (RTS/CTS) control packets to prevent collisions

Dynamic Reservation
l

The dynamic reservation approach involves setting up some sort of a reservation prior to data transmission. sender-initiated protocol: a node that wants to send data takes the initiative of setting up this reservation receiver-initiated protocol: the receiving node polls a potential transmitting node for data

Wireless Ad hoc network Lecture 3

Multiple Access Collision Avoidance


l

MACA (Multiple Access Collision Avoidance )


l

When node A wants to send a packet to node B, node A first sends a Request-to-Send (RTS) to B On receiving RTS, node B responds by sending Clear-to-Send (CTS), provided node B is able to receive the packet When a node (such as C) overhears a CTS, it keeps quiet for the duration of the transfer
l

Transfer duration is included in RTS and CTS both

Wireless Ad hoc network Lecture 3

MACA in Action
l

If C also transmits RTS, collision at B

RTS

Wireless Ad hoc network Lecture 3

MACA in Action
l

C knows the expected DATA length from CTS

CTS

C Defers until DATA


completion

Wireless Ad hoc network Lecture 3

MACA in Action
l

Avoids the hidden terminal problem

DATA

Wireless Ad hoc network Lecture 3

MACA in Action
l

CTS packets have fixed size

Defers until CTS

RTS

Wireless Ad hoc network Lecture 3

MACA in Action
l

C does not hear a CTS

CTS

Wireless Ad hoc network Lecture 3

MACA in Action
l

C is free to send to D; no exposed terminal

DATA

Wireless Ad hoc network Lecture 3

MACA in Action
l

Is C really free to send to D?

DATA

C
RTS

Wireless Ad hoc network Lecture 3

MACA in Action
l

In fact, C increases its backoff counter!

DATA

C
CTS

Wireless Ad hoc network Lecture 3

IEEE 802.11 standard


l l

802.11 refers to a set of WLANs that was approved by IEEE in 1997. Specifies the lowest two layers of the OSI model.
Standard 802.11 802.11b 802.11a 802.11g Data rate 1-2 Mbps 11 Mpbs Max. 54 Mbps Max. 54 Mbps Max. Physical Layer FHSS/DSSS DSSS/HRDSSS OFDM OFDM Operating Frequency 2.4 GHz 2.4 GHz 5.5 GHz 2.4 GHz

Wireless Ad hoc network Lecture 3

Modes of operation
1. Infrastructure-based:
l l l

The main most mature technology for WLANs Most commonly used to construct Wi-Fi hotspots Costly for dynamic environments

2. Infrastructurelessbased:
l l

Also called Ad Hoc mode Stations form an Independent Basic Service Set (IBSS) Any stations within the same transmission range can communicate

Wireless Ad hoc network Lecture 3

IEEE 802.11 Architecture


l
l l

Physical Layer:
infrared, FHSS, or DSSS in 1997 OFDM and HR-DSSS were added in 1999

l
1.

MAC Layer:
Distributed Coordination Function (DCF): l Provides the basic access method to the 802.11 MAC protocol l Based on CSMA/CA l Uses random backoff time following a busy signal Point Coordination Function (PCF): l Based on polling scheme l Only used in infrastructure-based
Wireless Ad hoc network Lecture 3

2.

IEEE 802.11
l

IEEE 802.11 was first designed for wireless fixed networks Many problems occur when building ad hoc networks with the IEEE 802.11 standard as the lowest two layers Solutions for different problems were studied Until now, IEEE 802.11 doesnt function well in wireless ad hoc netwroks
Wireless Ad hoc network Lecture 3

IEEE 802.11 Wireless MAC


l

Distributed and centralized MAC components


l l

Distributed Coordination Function (DCF) Point Coordination Function (PCF)

l l

DCF is suitable for multi-hop ad hoc networking DCF is a Carrier Sense Multiple Access/Collision Avoidance (CSMA/CA) protocol

Wireless Ad hoc network Lecture 3

DCF Basic Access Mechanism


l l l l

Uses CSMA/CA mechanism to check if medium is idle or busy. If idle -> wait for Distributed InterFrame Space (DIFS), then send If busy -> use the random backoff time Backoff timer is decreased if the channel is idle and reactivated if busy

Wireless Ad hoc network Lecture 3

Uses RTS-CTS RTSl

Uses RTS-CTS exchange to avoid hidden terminal problem


l

Any node overhearing a CTS cannot transmit for the duration of the transfer

Any node receiving the RTS cannot transmit for the duration of the transfer
l l

To prevent collision with ACK when it arrives at the sender When B is sending data to C, node A will keep quite
A B C

Wireless Ad hoc network Lecture 3

Uses ACK to achieve reliability


l

Wireless links are prone to errors. High packet loss rate detrimental to transport-layer performance. Mechanisms are needed to reduce packet loss rate experienced by upper layers When node B receives a data packet from node A, node B sends an Acknowledgement (Ack). This approach adopted in many protocols If node A fails to receive an Ack, it will retransmit the packet
A B C

Wireless Ad hoc network Lecture 3

Collision Avoidance
l

With half-duplex radios, collision detection is not possible CSMA/CA: Wireless MAC protocols often use collision avoidance techniques, in conjunction with a (physical or virtual) carrier sense mechanism Carrier sense: When a node wishes to transmit a packet, it first waits until the channel is idle. Collision avoidance: Nodes hearing RTS or CTS stay silent for the duration of the corresponding transmission. Once channel becomes idle, the node waits for a randomly chosen duration before attempting to transmit.
Wireless Ad hoc network Lecture 3

Avoiding collisions (more)


idea: allow sender to reserve channel rather than random
l

l l

access of data frames: avoid collisions of long data frames sender first transmits small request-to-send (RTS) packets to BS using CSMA l RTSs may still collide with each other (but theyre short) BS broadcasts clear-to-send CTS in response to RTS CTS heard by all nodes l sender transmits data frame l other stations defer transmissions
avoid data frame collisions completely using small reservation packets!

Collision Avoidance: RTS-CTS exchange


A AP B

reservation collision

DATA (A)

defer

time

IEEE 802.11

RTS = Request-to-Send

RTS A B C D E F

Pretending a circular range

Wireless Ad hoc network Lecture 3

IEEE 802.11

RTS = Request-to-Send

RTS A B
NAV = 10

NAV = Network Allocation Vector, remaining duration to keep quiet


Wireless Ad hoc network Lecture 3

IEEE 802.11

CTS = Clear-to-Send

CTS A B C D E F

Wireless Ad hoc network Lecture 3

IEEE 802.11
CTS = Clear-to-Send

CTS A B C D E
NAV = 8

Wireless Ad hoc network Lecture 3

IEEE 802.11
DATA packet follows CTS. Successful data reception acknowledged using ACK.

DATA A B C D E F

Wireless Ad hoc network Lecture 3

IEEE 802.11

ACK A B C D E F

Wireless Ad hoc network Lecture 3

IEEE 802.11
Reserved area

ACK A B C D E F

Wireless Ad hoc network Lecture 3

IEEE 802.11

Interference range

Carrier sense range

DATA A B C D E F

Transmit range
Wireless Ad hoc network Lecture 3

CSMA/CA
l l

Physical carrier sense, and Virtual carrier sense using Network Allocation Vector (NAV), a counter NAV is updated based on overheard RTS/CTS/DATA/ACK packets, each of which specified duration of a pending transmission Nodes stay silent when carrier sensed (physical/virtual) Backoff intervals used to reduce collision probability

Wireless Ad hoc network Lecture 3

CSMA/CA
l

Add carrier sense; C will sense Bs transmission and refrain from sending RTS

DATA

Wireless Ad hoc network Lecture 3

Backoff Interval
l

When transmitting a packet, choose a backoff interval in the range [0,cw]


l

cw is contention window

Count down the backoff interval when medium is idle


l

Count-down is suspended if medium becomes busy

When backoff interval reaches 0, transmit RTS


Wireless Ad hoc network Lecture 3

DCF Example

B1 = 25 wait data B2 = 20

B1 = 5 data wait B2 = 15 B2 = 10

cw = 31

B1 and B2 are backoff intervals at nodes 1 and 2


Wireless Ad hoc network Lecture 3

Protocol Overhead
l

The time spent counting down backoff intervals is a part of MAC overhead Choosing a large cw leads to large backoff intervals and can result in larger overhead Choosing a small cw leads to a larger number of collisions (when two nodes count down to 0 simultaneously)

Wireless Ad hoc network Lecture 3

Binary Exponential Backoff in DCF


l

IEEE 802.11 DCF: contention window cw is chosen dynamically depending on collision occurrence When a node fails to receive CTS in response to its RTS, it increases the contention window
l

cw is doubled (up to an upper bound)

When a node successfully completes a data transfer, it restores cw to Cwmin cw follows a sawtooth curve
Wireless Ad hoc network Lecture 3

MILD Algorithm in MACAW


l

MACAW (Medium Access Collision Avoidance Wireless) When a node successfully completes a transfer, reduces cw by 1
l l l

In 802.11 cw is restored to cwmin In 802.11, cw reduces much faster than it increases MACAW: cw reduces slower than it increases Exponential Increase Linear Decrease

MACAW can avoid wild oscillations of cw when large


number of nodes contend for the channel
Wireless Ad hoc network Lecture 3

Contention Resolution Overhead


l

Channel contention resolved using backoff


l

Nodes choose random backoff interval from [0, CW] Count down for this interval before transmission

Backoff and (optional) RTS/CTS handshake before transmission of data packet


Random backoff
RTS/CTS

Data Transmission/ACK

Wireless Ad hoc network Lecture 3

Inefficiency of IEEE 802.11


l

Backoff interval should be chosen appropriately for efficiency Backoff interval with 802.11 far from optimum

Wireless Ad hoc network Lecture 3

Observation
l

Backoff and RTS/CTS handshake are unproductive:


l

Do not contribute to throughput

Unproductive
Random backoff
RTS/CTS

Data Transmission/ACK

Wireless Ad hoc network Lecture 3

Homework
l

Reading paper
l

Performance Issues with IEEE 802.11 in Ad hoc Networking, IEEE Communication Magazine, July 2005 Explain the working procedures of IEEE 802.11 protocol operation in Figure. 1 What are the shortages of IEEE 802.11 performance, and how does the author prove them in the simulation results? What are the possible solutions?
Wireless Ad hoc network Lecture 3

Question
l

Thank you!
LIU Wei, Ph.d Associate Professor
ITEC Center, EI@HUST Mobile: 13986224922 Email: liuwei@hust.edu.cn Homepage: http://itec.hust.edu.cn

You might also like