3-MAC and 802.11

Post on 14-Dec-2014

886 views 1 download

Tags:

description

 

Transcript of 3-MAC and 802.11

Advanced Topics in Next-Generation Wireless Networks

Qian ZhangDepartment of Computer Science

HKUST

MAC and 802.11

Multiple Access Links and Protocols

Two types of “links”:• point-to-point

– PPP for dial-up access– point-to-point link between Ethernet switch and host

• broadcast (shared wire or medium)– old-fashioned Ethernet– upstream HFC– 802.11 wireless LAN

shared wire (e.g., cabled Ethernet)

shared RF (e.g., 802.11 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air, acoustical)

Multiple Access protocols

• Single shared broadcast channel • Two or more simultaneous transmissions by nodes:

interference – Collision if node receives two or more signals at the same

time

Multiple access protocol• Distributed algorithm that determines how nodes

share channel, i.e., determine when node can transmit

• Communication about channel sharing must use channel itself! – no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps1. When one node wants to transmit, it can send at

rate R.2. When M nodes want to transmit, each can send

at average rate R/M3. Fully decentralized:

– no special node to coordinate transmissions– no synchronization of clocks, slots

4. Simple

MAC Protocols: a Taxonomy

Three broad classes:• Channel Partitioning

– divide channel into smaller “pieces” (time slots, frequency, code)

– allocate piece to node for exclusive use

• Random Access– channel not divided, allow collisions– “recover” from collisions

• “Taking turns”– nodes take turns, but nodes with more to send can

take longer turns

Channel Partitioning MAC protocols: TDMA

TDMA: time division multiple access • access to channel in "rounds" • each station gets fixed length slot (length =

pkt trans time) in each round • unused slots go idle • example: 6-station LAN, 1,3,4 have pkt, slots

2,5,6 idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols: FDMA

FDMA: frequency division multiple access • channel spectrum divided into frequency bands• each station assigned fixed frequency band• unused transmission time in frequency bands go idle • example: 6-station LAN, 1,3,4 have pkt, frequency

bands 2,5,6 idle

frequ

ency

bands time

FDM cable

Random Access Protocols

• When node has packet to send– transmit at full channel data rate R.– no a priori coordination among nodes

• Two or more transmitting nodes ➜ “collision”,• Random access MAC protocol specifies:

– how to detect collisions– how to recover from collisions (e.g., via delayed

retransmissions)

• Examples of random access MAC protocols:– slotted ALOHA– ALOHA– CSMA, CSMA/CD, CSMA/CA

Slotted ALOHA

Assumptions:• all frames same size• time divided into

equal size slots (time to transmit 1 frame)

• nodes start to transmit only slot beginning

• nodes are synchronized

• if 2 or more nodes transmit in slot, all nodes detect collision

Operation:• when node obtains fresh

frame, transmits in next slot– if no collision: node

can send new frame in next slot

– if collision: node retransmits frame in each subsequent slot with prob. p until success

Slotted ALOHA

Pros• single active node can

continuously transmit at full rate of channel

• highly decentralized: only slots in nodes need to be in sync

• simple

Cons• collisions, wasting slots• idle slots• nodes may be able to

detect collision in less than time to transmit packet

• clock synchronization

Slotted Aloha Efficiency

• suppose: N nodes with many frames to send, each transmits in slot with probability p

• prob that given node has success in a slot = p(1-p)N-1

• prob that any node has a success = Np(1-p)N-1

• max efficiency: find p* that maximizes Np(1-p)N-1

• for many nodes, take limit of Np*(1-p*)N-1 as N goes to infinity, gives:

Max efficiency = 1/e = .37

Efficiency : long-run fraction of successful slots (many nodes, all with many frames to send)

At best: channelused for useful transmissions 37%of time!

!

Pure (unslotted) ALOHA

• unslotted Aloha: simpler, no synchronization• when frame first arrives

– transmit immediately

• collision probability increases:– frame sent at t0 collides with other frames sent in [t0-

1,t0+1]

Pure Aloha Efficiency

P(success by given node) = P(node transmits) .

P(no other node transmits in [p0-1,p0] .

P(no other node transmits in [p0-1,p0]

= p . (1-p)N-1 . (1-p)N-1

= p . (1-p)2(N-1)

… choosing optimum p and then letting n -> infty ...

= 1/(2e) = .18

even worse than slotted Aloha!

CSMA (Carrier Sense Multiple Access)

CSMA: listen before transmit:If channel sensed idle: transmit entire frame• If channel sensed busy, defer transmission

• human analogy: don’t interrupt others!

CSMA Collisions

collisions can still occur:propagation delay means two nodes may not heareach other’s transmissioncollision:entire packet transmission time wasted

spatial layout of nodes

note:role of distance & propagation delay in determining collision probability

CSMA/CD (Collision Detection)

CSMA/CD: carrier sensing, deferral as in CSMA– collisions detected within short time– colliding transmissions aborted, reducing channel

wastage

• collision detection: – easy in wired LANs: measure signal strengths,

compare transmitted, received signals– difficult in wireless LANs: received signal strength

overwhelmed by local transmission strength

• human analogy: the polite conversationalist

CSMA/CD Collision Detection

“Taking Turns” MAC protocols

channel partitioning MAC protocols:– share channel efficiently and fairly at high load– inefficient at low load: delay in channel access,

1/N bandwidth allocated even if only 1 active node!

Random access MAC protocols– efficient at low load: single node can fully

utilize channel– high load: collision overhead

“taking turns” protocolslook for best of both worlds!

“Taking Turns” MAC protocols

Polling: • master node

“invites” slave nodes to transmit in turn

• typically used with “dumb” slave devices

• concerns:– polling overhead – latency– single point of

failure (master)

master

slaves

poll

data

data

“Taking Turns” MAC protocols

Token passing:• control token

passed from one node to next sequentially.

• token message• concerns:

– token overhead – latency– single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocols

• channel partitioning, by time, frequency or code– Time Division, Frequency Division

• random access (dynamic), – ALOHA, S-ALOHA, CSMA, CSMA/CD– carrier sensing: easy in some technologies (wire),

hard in others (wireless)– CSMA/CD used in Ethernet– CSMA/CA used in 802.11

• taking turns– polling from central site, token passing– Bluetooth, FDDI, IBM Token Ring

Fixed-Assignment vs. Random Access

• Fixed-assignment methods – Make relatively efficient use of communications resources

when each user has a steady flow of information to be transmitted during each session

– Could be a waste of resources for intermittent traffic– Require an “arbitrator”

• Random access methods– Evolved around bursty data applications in computer networks– Provide more flexible and efficient ways of managing medium

access for short bursty messages– Could think of them as distributed statistical multiplexing

techniques

Why Not CSMA/CD?

• Carrier Sense Multiple Access with Collision Detection (CSMA/CD) is used in IEEE 802.3 but not IEEE 802.11. Why?

• CSMA/CD– “Sense” the medium, send as soon as the medium is free, and

listen to the medium to “detect collisions”

• CSMA/CD does not work in wireless networks – Signal strength decreases proportional to the square of the

distance Hidden Terminal and Exposed Terminal problems

– The sender would apply CS and CD, but the collisions happen at the receiver

– Might be the case that a sender cannot “hear” the collision or cannot “sense” another carrier at the receiver

Hidden Terminal Problem

• Hidden terminals– A and C cannot hear each other– A sends to B, C cannot receive A– C wants to send to B, C senses a “free”

medium (CS fails)– Collision occurs at B– A cannot hear the collision (CD fails)– A is “hidden” for C

• Solution?– Hidden terminal is peculiar to wireless (not found in wired)– Need to sense carrier at receiver, not sender!– “Virtual carrier sensing”: Sender (node C) “asks” receiver

(node B) whether it senses the channel is busy. If so, behave as if channel busy

Exposed Terminal Problem

• Exposed terminals– A valid comm can not take place because the sender is

exposed– A starts sending to B– C senses carrier, finds medium in use and has to wait for A->B

to end– D is outside the range of A, therefore waiting is not necessary– A and C are “exposed” terminals, i.e. A and C could

communicate to their receivers at the same time, but because A and C can exposed to each other, one of them needlessly refrains from transmitting

D

C

A B

• A->B and C->D transmissions could have taken place in parallel without collisions

CSMA/CA Algorithm

• Control packet transmissions precede data packet transmissions to facilitate collision avoidance

• Basic procedure– Sense channel (CS)– If busy

• Back-off to try again later– Else

• Send RTS (optional) • If CTS not received (optional)

– Back-off to try again later• Else

– Send Data– If ACK not received

» Back-off to try again later– Next packet processing

CSMA/CA Algorithm (Cont.)

• Maintain a value CW (Contention Window)

• If Busy,– Wait till channel is idle. Then choose a random

number between 0 and CW and start a back-off timer for proportional amount of time

– If transmissions within back-off amount of time, freeze back-off timer and start it once channel becomes idle again

• If Collisions (Control or Data)– Binary exponential increase (doubling) of CW

RTS/CTS Solution of Hidden Terminal Problem

•C knows B is listening to A•Will not attempt to transmit to B

• Can there be collisions?– Control packet collisions (C transmitting RTS at the same time as A)– C does not register B’s CTS – C moves into B’s range after B’s CTS

Basic of IEEE 802.11

IEEE 802.11

• IEEE working group 802.11 formed in 1990– Now the most popular and pervasive Wireless LAN

standard

Basic service set

Access point

Distribution system

• An isolated BSS is called an Independent BSS

• A set of AP’s connected with a LAN are called an Extended BSS

Infrastructure vs. Independent Mode

Infrastructure mode:All communications must be relayedby access point

Independent mode:Nodes communicate directly witheach other

Main Requirements

• Single MAC to support multiple PHYs– Support single and multiple channel PHYs, and

– PHYs with different Medium Sense characteristics

• Should allow overlap of multiple networks in the same area and channel space– Need to be able to share the medium

– Allow re-use of the same medium

• Need to be Robust for Interference– Microwave interferers

– Other un-licensed spectrum users

– Co-channel interference

• Need mechanisms to deal with Hidden Nodes

IEEE 802.11: Network Hierarchy

Layers 1 and 2

Layer

Application

TCP

IP

LLC

MAC

PHY802.11

One MAC and Multiple PHYs

MAC

DS FH IR .11a OFDM

.11b CCK

.11g OFDM

1 & 2 Mbps

5.5 & 11 Mbps

6 ~ 54 Mbps

.11n OFDM

6 ~ 54 Mbps

150 (?) Mbps

2.4 GHz5 GHz

e/h/i/k

Complementary Code Keying

A set of 64 eight-bit code words used to encode data of 5.5 and 11Mbps data rates

Applies sophisticated mathematical formulas to the DSSS codes, permitting the codes to represent a greater volume of information per clock cycle

IEEE 802.11 Wireless MAC

• Distributed and centralized MAC components– Centralized – Point Coordination Function (PCF)

• In infrastructure mode

• Contention-free access protocol with a controller (AP) called a point coordinator within the BSS

– Distributed – Distributed Coordination Function (DCF)• In ad-hoc mode

• DCF is a Carrier Sense Multiple Access/Collision Avoidance (CSMA/CA) protocol (distributed contention based protocol)

• Both the DCF and PCF can operate concurrently within the same BSS to provide alternative contention and contention-free periods

PCF in 802.11 MAC

• Its objective is to provide QoS guarantees – E.g. bound the max access delay, bound the minimum

guaranteed txmt rate

• Centralized MAC – infrastructure mode

• Key idea– The AP polls the nodes in its BSS

– A PC (point coordinator) at the AP splits the access time into super frame periods

– A super frame period consists of alternating contention free periods (CFPs) and contention periods (CPs)

– The PC then determines which station transmits at any point in time

DCF in 802.11 MAC

• The AP doesn’t control the medium access

• 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:

– Once channel becomes idle, the node waits for a randomly chosen duration before attempting to transmit

– Nodes hearing RTS or CTS stay silent for the duration of the corresponding transmission

DCF Illustration

• Before a node transmits, it listens for activity on the network

• If medium is busy, node waits to transmit• After medium is clear, don't immediately start

transmitting...• Otherwise all nodes would start talking at the same time!• Instead, delay a random amount of time (random backoff)

Interframe space (IFS)

Sender

Receiver

Time

Reliability and Hidden Terminal

• Uses ACK to achieve reliability– Receiver sends ACK after each successful transmission

– Sender will retransmit if no ACK is heard, after waiting for a random interval

• Uses RTS-CTS exchange to avoid hidden terminal problem– Network Allocation Vector (NAV): each message includes

length of time other nodes must wait to send

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

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

C FA B EDRTS

RTS = Request-to-Send

RTS-CTS and NAV

Pretending a circular range

C FA B EDRTS

RTS = Request-to-Send

RTS-CTS and NAV

NAV = 10

NAV = remaining duration to keep quiet

C FA B EDCTS

CTS = Clear-to-Send

RTS-CTS and NAV

C FA B EDCTS

CTS = Clear-to-Send

RTS-CTS and NAV

NAV = 8

C FA B EDDATA

•DATA packet follows CTS•Successful data reception acknowledged using ACK

RTS-CTS and NAV

C FA B EDACK

RTS-CTS and NAV

C FA B EDACK

RTS-CTS and NAV

Reserved area

Backoff Interval

• When transmitting a packet, choose a backoff interval in the range [0,cw]– cw is contention window

• Count down the backoff interval when medium is idle– Count-down is suspended if medium becomes busy

• When backoff interval reaches 0, transmit RTS

B1 = 25

B2 = 20

Backoff Interval Example

data

wait

B1 = 5

B2 = 15

data

wait

B1 and B2 are backoff intervals at nodes 1 and 2

cw = 31

B2 = 10

Backoff Interval (Cont.)

• The time spent counting down backoff intervals is a part of MAC overhead

• Contention windows, cw, selection– Large cw leads to large backoff intervals and can result in

larger overhead

– Small cw leads to a larger number of collisions (two nodes count down to 0 simultaneously)

• Need mechanism to manage contention– The number of nodes attempting to transmit simultaneously

may change with time

– IEEE 802.11 DCF: cw is chosen dynamically depending on collision occurrence

Binary Exponential Backoff in DCF

• cw follows a sawtooth curve• When a node fails to receive CTS in

response to its RTS, it increases the cw– cw is doubled (up to an upper bound)

• When a node successfully completes a data transfer, it restores cw to cwmin

• Potential inefficiency in 802.11– Backoff interval should be chosen

appropriately for efficiency– Backoff interval with 802.11 far from optimum

Other Topics

• Energy consumption– Power saving– Power control

• Directional antenna• User diversity

Power Management

• Mobile devices are battery powered

• Current LAN protocols assume stations are always ready to receive– Idle receive state dominates LAN adapter power consumption

over time

• How can we power off during idle periods, yet maintain an active session?

• 802.11 Power Management protocol– Allows transceiver to be off as much as possible

– Is transparent to existing protocols

– Is flexible to support different applications

• Possible to trade off throughput for battery life

Power Management Approach

• Allow idle stations to go to sleep– Station’s power save mode stored in AP

• APs buffer packets for sleeping stations– AP announces which stations have frames buffered

– Traffic Indication Map (TIM) sent with every Beacon

• Power saving stations wake up periodically– Listen for Beacons

• Time Synchronization Function (TSF) assures AP and power save stations are synchronized– Stations will wake up to hear a Beacon

– Synchronization allows extreme low power operation

Infrastructure Power Management

• Broadcast frames are also buffered in AP– Broadcasts/multicasts are only sent after DTIM– DTIM interval is a multiple of TIM interval

• Stations wake up prior to an expected (D)TIM• If TIM indicates frame buffered

– Station sends PS-Poll and stays awake to receive data

TIM

TIM-Interval

Time-axis

Busy Medium

AP activityTIM TIM TIM DTIMDTIM

DTIM interval

BroadcastBroadcast

PS Station

Tx operationPS-Poll

Power Control

• Power control has (at least) two potential benefits– Reduced interference & increased spatial reuse– Energy saving

Basic of Power Control

• When C transmits to D at a high power level, B cannot receive A’s transmission due to interference from C

A B C D

Basic of Power Control (Cont.)

• If C reduces transmit power, it can still communicate with D– Reduces energy consumption at node C– Allows B to receive A’s transmission (spatial reuse)

A B C D

More on Power Control

• Received power level is proportional to inverse square of distance

• If power control is utilized, potential energy savings

• Shorter hops typically preferred for energy consumption

• Transmit to C from A via B, instead of directly from A to C

A

B

Tradeoff between energy consumption and overall throughput

• Directional antenna gain higher than omni-directional antenna gain

• Increased range by limiting energy waste in unnecessary directions

• Number of hops to a destination may be smaller• Reach a given neighbor with less power than

omni-directional transmission

Directional Antennas

Directional Antennas (Cont.)

• Potential benefits– Higher spatial reuse– Larger range (for given transmit power)– Reduction in energy consumption

• Need new MAC protocols to best utilize directional antennas– Deafness

• Unable to hear RTS because directional in some other directions

– New hidden terminal problem• Directional CTSs may not be heard (the listener node in

omni mode/directional in another direction

User Diversity

• Location dependent and bursty errors– For the same wireless channel, a mobile station might

experience a clean channel while another might experience high error rates (not correlated)

APclient

client

client

client

• Negative efforts of channel variations– Head-of-Line blocking– False link breakage, thus

unnecessary rerouting– Rate adaptation or power control

try to mitigate rather than utilize channel variations (inefficient)

bestcurrent

User Diversity (Cont.)

• Using multiuser diversity– Node access the instantaneous channel condition of

each of multiple receivers – Select the receiver whose channel condition is the

best

• Improve overall network throughput

• How to leverage such diversity among multiple users, while maintain the user fairness– Both short-term and long-term fairness important