EE206A Lecture #5 Sharing The Wireless Link: Part II: Mani Srivastava
EE206A Lecture #5 Sharing The Wireless Link: Part II: Mani Srivastava
EE206A Lecture #5 Sharing The Wireless Link: Part II: Mani Srivastava
Mani Srivastava [email protected] University of California at Los Angeles Electrical Engineering Department
Packet Oriented
Copyright 2002 Mani Srivastava
Transmitter # 1
Packet B
Packet C
Transmitter # 2
Packet A
Time
Pure ALOHA (random access channel) - channel accessed as soon as message ready - wait for ACK on same or separate channel - if collision (time-out or NACK), retransmit after a random back-off - more collisions as number of users increases
Slotted ALOHA - time is divided into equal time slots of length > - transmitters are synchronized, and only transmit at beginning of slot - vulnerable period reduced to from 2 - maximum channel utilization (1/e =.3679) is x2 of pure ALOHA (1/2e =.1839) under Poisson traffic
retransmission Pure ALOHA retransmission
collision
Assume that G represents the mean number of packet arrivals during a packet transmission time interval in a Poisson packet traffic model, i.e. k G P ( k packets generated in a packet transmission time ) = P ( k ) = G e --------------k! Then, for Pure ALOHA, S = GP ( no collision during 2 x packet transmission time ) = Ge 2G Maximum value of S occurs for G = 0.5 , and is S max = 1 ( 2e ) = 0.184 . A packet is retransmitted with a probability 1 e 2G Mean # of times a packet is retransmitted N is 1 ( 1 ( 1 e 2G ) ) = e 2G So that, the delay throughput characteristic is S = ln(N) ( 2N ) Similarly, for Slotted ALOHA S = Ge G with maximum value of S at G = 1.0 , is 0.368. The delay-throughput relation is S = ln(N) N
Copyright 2002 Mani Srivastava 6
5 4 3 2 1 0 0.05 0.1
0.15
0.2
0.25
0.3
0.35
0.4
G = offered load, S = channel utilization, N = mean # of retransmissions Stability problem once the operating point wanders to the right side - increase in G leads to reduction in S which leads to further increase in G ... - backoff algorithm becomes important to ensure stability
Listen before transmit scheme - ALOHA protocols transmit blindly - CSMA listens for carrier before transmitting, transmit only if channel idle
Detection delay - time needed for terminal receiver to sense whether or not channel is idle Propagation delay - relative measure of how fast the packet travels - effects performance because another transmitter may sense an idle channel and begin to send data if the packet does not reach it
Several variations of CSMA 1-persistent: on channel idle, transmit with probability 1 non-persistent: on collision, wait a random time before retransmitting (used in WLANs where packet transmit interval >> propagation delay) p-persistent: on idle, transmit with prob. p in first slot and 1-p on next slot CSMA/CD: listen-while-talk - monitor transmission & abort on collision (in wireless need to interrupt transmission to sense the channel)
while (1) { while (channel_sense()==BUSY) continue; send_packet(); if (waitfor(ACK,time_threshold)==TIMEOUT) { waitfor(random_time); continue; } else break; }
Better than ALOHA due to channel sensing, but... - collisions are not eliminated - performance depends on propagation delay - multiple waiting users may transmit on busy-to-free transition
Does not continuously sense the channel - waits a random time before sensing again Waiting time eliminates most of collisions on busy-to-free transition - maximum throughput of 80% or higher under typical delays - but causes performance when only few users
10
Generalization of 1-persistent CSMA, for slotted channels - slot length == maximum propagation delay - parameter p needs to be chosen carefully - for low-to-medium delays, throughput is between slotted & unslotted non-persistent CSMA - for long propagation delays, it works the best
11
Problem: does not work with RF wireless - cannot easily sense the channel while transmitting MHs signal will dominate need different receiving and transmitting antenna patterns
But, does work well with infrared wireless... directional receivers Wireless networks stick with the ACK/NACK approach - popularly called CSMA/CA - but, not really a strictly defined scheme... many variants some implement as CSMA + exponential backoff + ACK some use DSMA or even reservation
12
13
Near-far effect - characterized by capture ratio of the receiver - strongest (nearby) transmitter can capture the intended receiver - weaker (far away) transmitters get ignored by the receiver - depends on receiver and modulation used - fairness problem Hidden terminal problem - terminal hidden from the transmitter may disrupt the receiver - makes carrier sensing ineffective - A cannot detect collisions at B due to transmissions from C - solve by using RTS/CTS control frames to reserve medium (AppleTalk)
RTS range CTS range
A
RTS CTS Data
B
CTS
A
ACK
C hidden terminal
14
More on RTS/CTS
RTS/CTS serve to reserve the medium - RTS contains length of proposed transmission - CTS also contains length of proposed transmission - MHs overhearing RTS defer all transmissions until after CTS would have finished (including receiver turnaround time) - MHs overhearing CTS defer for length of data packet transmission - RTS and CTS are short... their collisions dont hurt that much - retransmissions happen only if no CTS is received in response to RTS e.g. MACA (Phil Karn) in Packet Radio - uses binary exponential backoff for retransmission (backoff increased exponentially up to BOmax on failure, reset to BOmin success)
Binary exponential backoff (BEB) has problems - does not provide fairness if every MH generates enough traffic to consume the channel - after collisions, the less-backed-off mobile wins eventually all but one MH are backed-off to BOmax
15
Cs range
D A B C exposed terminal
C will sense channel busy, and defer, but doesnt need to - the C to D transmission can take place but is delayed
16
Fixing the backoff 1. MHs exchange values of their back-off counters BO - carried in packet headers, and copied by MHs that are listening problem: mobiles need to be up all the time! - but, a single number is bad idea... congestion not homogeneous regions may have different levels of congestion 2. multiplicative backoff on failure, and decrease by 1 on success MACAs exponential backoff on failure, and reset on success resulted in large variations, and unfair conditions
Fixing the signalling: RTS-CTS-DS-DATA-ACK and RRTS 1. Adding ACK helps in faster recovery MACA relied on transport layer for retransmissions 2. DS sent before sending DATA - tells other MHs that RTS-CTS was successful - defer until after ACK - avoids doing carrier sensing... DS is like a virtual carrier - helps at exposed terminals... no need to do futile RTS and backoff 3. RRTS (Request for RTS) - a MH receiving a RTS to which it cannot, it later sends RRTS - useful at MHs that are deferring, for example, due overhearing a CTS
17
Support for multiple PHYs - single and multiple channel PHYs - PHYs with different Medium Sense characteristics - available PHY layers: original 802.11: 900M and 2.4G ISM band DSSS & FHSS, IR @ 1 and 2 Mbps 802.11b: 2.4 GHz DSSS @ 5.5 & 11 Mbps 802.11a: 5 GHz OFDM @ 6-54 Mbps Efficient medium sharing without overlap restrictions - multiple networks in same area and channel space - Distributed Coordination Function: using CSMA /CA - based on carrier sense mechanism called Clear Channel Assessment (CCA) Robust against interferers (e.g. co-channel interference, microwave + other non 802.11 interferers) - CSMA/CA+ACK for unicast frames with MAC level retransmission Protection against Hidden Terminal problem: Virtual Carrier Sense - via parameterized use of RTS/CTS frames with duration information Provision for Time Bounded Services via Point Coordination Function
18
ad hoc network
distribution system
infrastructure network
Two Configurations: ad hoc & distribution system connecting access points Roaming: mobile-controlled hand-offs with registration at new basestation Power management Authentication and privacy
19
SYNC 128bits
SFD 16 bits
SIGNAL 8 bits
SERVICE 8 bits
LENGTH 16 bits
CRC 16 bits
MPDU
1 DBSK Barker 2 DQPSK Barker 5.5 or 11 Mbps CCK
PPDU
20
Packet Fields
SYNC - 128 scrambled 1 bits - used for: gain setting, energy detection, antenna selection, frequency offset compensation SFD (Start Frame Delimiter) - 16 bit (0xF3A0), used for bit synchronization Signal field - rate indication: 0x0A (1 Mbps DBPSK), 0x14 (2 Mbps DQPSK), etc. Service field - reserved for future use, 0x00 indicates 802.11 compliance Length field - indicates numbers of octets to be transmitted in MPDU - used for end of frame detection, MPDU CRC sync CRC field - CCITT CRC-16 - protects signal, service, and length field All bits are scrambled to whiten the spectrum - scrambling polynomial G(z) = z^-7 + z^-4 + 1
Copyright 2002 Mani Srivastava 21
CSMA/CA: direct access if medium free for > DIFS, else defer & back-off
DIFS DIFS PIFS DATA SIFS defer access
source other
contention window
CSMA/CA + ACK: receiver sends ACK immediately if CRC okay - if no ACK, retransmit frame after a random back-off
DIFS
contention window DATA SIFS ACK DIFS defer access DATA select slot & decrement back-off as long as idle
RTS/CTS with duration: distribute medium reservation information - also used in the defer decision (virtual carrier sensing)
22
Timing parameters dictate access priority - SIFS = short interframe space - PIFS = PCF interframe space - DIFS = DCF interframe space
Backoff time is decremented only when channel is idle - frozen when channel is busy - resumed after busy-to-free transition only after DIFS
Backoff timer is chosen = int(CW[] * random()) * slot_time - CW is an integer between CWmin=7 and CWmax=255 CW assignment - for every fresh frame, CW is CWmin - on each unsuccessful transmission, CW is incremented until CWmax
23
Fragmentation
DIFS PIFS
SIFS NAV (RTS) NAV (CTS) NAV (Fragment 0) NAV (ACK 0) Backoff-Window
Fragment 0
Fragment 1
CTS
ACK 0
ACK 1
Burst of Fragments which are individually acknowledged. - For Unicast frames only. Random backoff and retransmission of failing fragment when no ACK is returned. Duration information in data fragments and Ack frames used by medium reservation mechanism.
24
MAC Header format differs per Type: - Control Frames (several fields are omitted) - Management Frames - Data Frames
Bytes: 2
Frame Control
2
Duration ID
2
Sequence Control
6 Addr 4
4 CRC
2 Type
4 SubType
1 To DS
1 From DS
1 More Frag
1 Retry
1 Pwr Mgt
1 More Data
1 WEP
1 Rsvd
25
Addr 1 = All stations filter on this address. Addr 2 = Transmitter Address (TA) Identifies transmitter to address the ACK frame to. Addr 3 = Dependent on To and From DS bits. Addr 4 = Only needed to identify the original source of WDS (Wireless Distribution System) frames.
26
Reversing the collision avoidance handshake - most collision avoidance protocols (MACA, MACAW, 802.11, FAMA) are sender-initiated - another scheme: receiver-initiated with correct collision avoidance
Design issues - carrier sensing or not - polling dependent or independent of polling nodes data rate - polling to one, some, or all neighbors - polling with extra request for transmission, or not
27
RTR (DC)
DATA (BA )
C) DATA (D
Data Collision !
After sensing the channel, a polling node sends a RTR packet (Request To Receive) to one other node The polled node responds by sending a DATA packet
28
B
RTR (BA)
) RTR (DC
C
RTR (DC)
C) DATA (D
Polling and polled node sense the channel for a period after sending/receiving the RTR If a polled node senses the channel busy, it does not transmit the data
29
Polling and polled node sense the channel for a period after sending/receiving the RTR If a polling node senses the channel busy, it sends a NTR packet Transmission Request) Collision avoidance if maximum transmission delay (No
30
A
RTR (BA)
CTS (AB)
B (has no data)
A) DATA (B
DATA (AB )
DATA (AB )
Dual purpose of RTR: request for data from polled node and transmission request of the polling node New control packet CTS: polled node has no data Collision avoidance conditions specify and CTS size
31
A
RTR (?A)
RTS (BA)
A
RTR (?A)
RTS (BA)
RTS (CA)
NTR (CA)
NTR (BA)
) DATA (BA
Broadcast polling New control packet RTS: to avoid users sending data at the same time Collision avoidance conditions specify
32
Delay Jitter Capacity Bursty traffic Support for variable b/w traffic
Low Low Low Efficient Good Fast Channel resources not locked needlessly 33
Response to changes in b/ Slow w requirements Key Problem Channel resources locked even if no traffic
Next Topic
Copyright 2002 Mani Srivastava
Packet Oriented
Exercise more control over the access method than random access - avoid inefficiencies of uncontrolled access with collisions
... but, not the rigid control of fixed channel assignment - avoid inefficiencies of static resource allocation
Some approaches: 1. Token passing 2. Polling 3. Auctioning 4. Reservation-based with distributed control 5. Reservation-based with centralized control - scheduled access
35
Polling Techniques
Controller periodically polls MHs to see if they have data to transmit - BS may be the controller - polling done according to a polling list
MH transmits if it has something to transmit, otherwise NACK (or no reply) Controller then polls the next MH in the list Constraints on efficient polling: - roundtrip delay must be small - overhead due to polling messages is low - user population is not large and bursty
Performance degrades as number of (bursty) users increases New MH needs to register to participate in polling But, centralized control provides robustness - even in presence of fading and dynamic channel characteristics Not widely used... but used in 802.11
36
Async
Contention Service
PCF
DCF
(CSMA/CA)
PHY
802.11 Contention Free Service uses Point Coordination Function (PCF) on a CSMA/CA Distributed Coordination Function (DCF) foundation - PCF is optional - PCF can provide lower jitter to support Time Bounded Services - mix asynchronous data, voice etc. - PCF resides in AP
PCF (optional)
DCF
contention period
CF-Burst
PCF defer
Alternating Contention Free and Contention operation under PCF control Net Allocation Vector (NAV) prevents Contention traffic until reset by last PCF transfer - so variable length Contention Free period per interval - NAV acts as virtual carrier sense, and distributed by RTS/CTS in DCF
Both PCF and DCF defer to each other causing PCF Burst start variations
38
PCF Burst
CFP repetition interval contention free burst
PIFS PIFS PIFS PIFS PIFS
D1 U1
SIFS
D2 U2
SIFS
D3
No Up
D4 D4
SIFS CF_End
CF-burst by Polling bit in CF-Down frame Immediate response by MH on a CF_Poll MH maintain NAV to protect CF-traffic Responses can be variable length Reset NAV by last (CF_End) frame from BS (access point in 802.11) ACK Previous Frame bit in Header
39
Also called Demand Assigned Multiple Access Central agent that acts as a slot scheduler Senders request reservations for future time slots - reservations done using random access such as ALOHA (conflict) - or, by piggy backing on data packets (conflict free)
Central agent assigns a slot - scheduling may be done slot-by-slot or on a frame basis - may also have permanently reserved TDMA-like slots
Data transmission in the assigned slot is done without contention Assumption is that data packets >> reservation request packets Overhead of reservation and acknowledgment messages Trades higher throughput (up to 80% utilization) for higher latency
40
app 2
MH2
app 1 app n
MAC PHY
app 2
MH1
app 1
Design issues - service models and parameters - per flow (VC) vs. per-MH allocations (joint MAC & multiplexing?) - admission control policy (schedulability) - bandwidth allocation policy (scheduling) - peer to peer vs. MH-BS communication - request mechanism, frame structure
Optimum in: - energy efficiency no collision, transmitter & receivers wake up only when need be! - system throughput no needless idle time, no collision
But, ability to meet QoS (e.g. latency) depends on: - scheduling algorithm - and, schedulability analysis at admission control time
TB BH B MH to BS
- contention-free - scheduled access
TC CH C MH to BS
- contention-based - slotted ALOHA - new MH registration requests - bandwidth reservation requests - singleton data packets - ACKs from BS
Features/constraints: - MSBH data flow - TA & TB adjusted on a frame-by-frame basis - but, TA+TB+TC is fixed TC has a lower bound TC_MIN = 20% - MH needs to register with a BS - two service types: isochronous (CBR) & non-isochronous (UBR) isochronous implies repeating every frame until cancelled - assumes a fixed bitpipe channel model (all slots are good) - no scheduling algorithm specified
43
44
45
Bluetooth
Support both voice (synchronous connection oriented) and data (asynchonous connectionless) Use small and low-power radio transceiver in ISM band Frequency hop, time-division duplex with one packet per slot Channel shared by a master unit and multiple slave units - called Piconet - hop frequency selection based on master unit
46
47
Bluetooth Baseband
Packet may occupy 1, 3, or 5 slots Segmentation and reassembly to handle large data packets Link level fast unnumbered ARQ Link level FEC - header protected by 1/3 rate FEC - data optionally protected by 2/3 rate FEC
Two types of links - Synchronous Connection Oriented (SCO) for voice point-to-point, established by reservation of duplex slots at regular intervals - Asynchronous Connectionless (ACL) for packet data point-to-multipoint between master and all its slaves
48
49
Link Manager Protocol (LMP) - manages connection state - enforces fairness among slaves - power management, and other management tasks
Logical Link Control & Adaptation Protocol (L2CAP) - higher level protocol multiplexing baseband doesnt support any type field identifying the higher layer protocol - packet segmentation and reassembly (SAR) - conveys QoS information - permits higher level protocols and applications to transmit and receive L2CAP data packets up to 64 kB in length
50
MAC Scheduling
MAC scheduling because - multiple piconet slaves active - slave has multiple data connections
Scheduling approaches - simple master-driven round robin scheduling - Other scheduling, e.g. in [Das01] at Infocom 2001
51
Radio channel allocation and sharing is done under harsh conditions fading, noise, transmit power control, error control
Channel dynamics may make it hard to talk about QoS e.g. fading can be several 10s of ms at pedestrian speeds cant really talk about delay guarantees better than that e.g. what to do if a slot belonging to a constant bit rate stream is lost? retransmit? discard? e.g. what to do if total channel goodput is reduced due to interference? drop some users? renegotiate with everybody?
Question: is it meaningful to do reservation or scheduled access at fine time granularity in a wireless link? - might, therefore, a simpler random access MAC (which do give throughput and delay assurances in a long term average sense) work as well?
52
Mobile nodes in power saving mode switch off their radios for some period - sender nodes meanwhile buffer the frames
Nodes are synchronized to wake up at the same time when the sender announces buffered frames - nodes with frames for them in the announcement stay up until frame is delivered - timing synchronization function (TSF)
Easy to do in PCF, but hard to do in DCF - centralized vs distributed buffering & TSF
53
AP activity
PS Station
AP generates time-stamped beacons & transmits them every beacon interval (~100 ms) - beacon transmission is deferred if channel busy - nodes wake up before the end of beacon interval and stay up until beacon is received - nodes adjust their local timers to the timestamp Beacon carries a traffic-indication map (TIM) - all unicast packets for nodes in sleep mode at announced in the TIM - mobile nodes with entries in TIM request packets from AP Broadcast packets are announced by a delivery TIM (DTIM) and send immediately afterwards - DTIM interval is a multiple of TIM interval
Copyright 2002 Mani Srivastava 54
Timers are adjusted in a distributed fashion - every node generates beacons - all nodes compete to transfer the beacon using DCF - the first node to transmit the beacon is the winner - other nodes cancel their beacons & adjust timers
Packets for sleeping nodes are buffered by the sender until the end of beacon interval - announced using ad hoc TIMs (ATIMs) sent via DCF transmitted in an ATIM window (~ 4 ms) after the beacon acked by the receiver receiver stays up and waits for the packet
55
Scheduling access via a schedule or a directory - 802.11s TIM is like a directory - this concept also used in pagers - also suggested in the literature for application level
Several TDMA-based MAC protocols around this idea - frame with directory or schedule carrying beacon in the first slot - mobile nodes wake up only in the right slots
56