610 likes | 627 Views
Advanced Topics in Next-Generation Wireless Networks. Qian Zhang Department 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
E N D
Advanced Topics in Next-Generation Wireless Networks Qian Zhang Department 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 humans at a cocktail party (shared air, acoustical) shared wire (e.g., cabled Ethernet) shared RF (e.g., 802.11 WiFi) shared RF (satellite)
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 bps 1. 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/M 3. 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 6-slot frame 3 3 4 4 1 1
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 time frequency bands 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
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
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 Slotted Aloha Efficiency Efficiency : long-run fraction of successful slots (many nodes, all with many frames to send) At best: channel used 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 hear each other’s transmission collision: entire packet transmission time wasted note: role of distance & propagation delay in determining collision probability spatial layout of nodes
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
“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” protocols look for best of both worlds!
data data poll “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
“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 (nothing to send) T data
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 • A->B and C->D transmissions could have taken place in parallel without collisions D A B C
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
IEEE 802.11 • IEEE working group 802.11 formed in 1990 • Now the most popular and pervasive Wireless LAN standard 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 Basic service set
Infrastructure vs. Independent Mode Independent mode: Nodes communicate directly with each other Infrastructure mode: All communications must be relayed by access point
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 One MAC and Multiple PHYs • 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 Layer MAC e/h/i/k Application DS FH IR .11a OFDM TCP 6 ~ 54 Mbps 1 & 2 Mbps IP .11b CCK .11n OFDM LLC 5.5 & 11 Mbps 150 (?) Mbps MAC 802.11 5 GHz .11g OFDM PHY 2.4 GHz 6 ~ 54 Mbps
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 Interframe space (IFS) • 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) 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
RTS-CTS and NAV RTS = Request-to-Send RTS A B C D E F Pretending a circular range
RTS-CTS and NAV RTS = Request-to-Send RTS A B C D E F NAV = 10 NAV = remaining duration to keep quiet
RTS-CTS and NAV CTS = Clear-to-Send CTS A B C D E F
RTS-CTS and NAV CTS = Clear-to-Send CTS A B C D E F NAV = 8
RTS-CTS and NAV • DATA packet follows CTS • Successful data reception acknowledged using ACK DATA A B C D E F
RTS-CTS and NAV ACK A B C D E F
RTS-CTS and NAV Reserved area ACK A B C D E F
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 B1 = 5 wait data data wait B2 = 10 B2 = 20 B2 = 15 Backoff Interval Example B1 and B2 are backoff intervals at nodes 1 and 2 cw = 31
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 • cwis 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