690 likes | 708 Views
15-446 Networked Systems Practicum. Lecture 4 – Wireless Basics. Overview. Internet mobility TCP over noisy links Link layer challenges. Cellular Reuse. Transmissions decay over distance Spectrum can be reused in different areas Different “ LANs ”
E N D
15-446 Networked Systems Practicum Lecture 4 – Wireless Basics
Overview • Internet mobility • TCP over noisy links • Link layer challenges
Cellular Reuse • Transmissions decay over distance • Spectrum can be reused in different areas • Different “LANs” • Decay is 1/R2 in free space, 1/R4 in some situations
802.11b 2.4-2.5 GHz unlicensed radio spectrum up to 11 Mbps direct sequence spread spectrum (DSSS) in physical layer all hosts use same chipping code widely deployed, using base stations 802.11a 5-6 GHz range up to 54 Mbps 802.11g 2.4-2.5 GHz range up to 54 Mbps 802.11n 2.4 or 5Ghz, multiple antennas (MIMO), up to 450Mbps (for 3x3 antenna configuration) All use CSMA/CA for multiple access All have base-station and ad-hoc network versions IEEE 802.11 Wireless LAN
IEEE 802.11 Wireless LAN • Wireless host communicates with a base station • Base station = access point (AP) • Basic Service Set (BSS) (a.k.a. “cell”) contains: • Wireless hosts • Access point (AP): base station • BSS’s combined to form distribution system (DS)
Ad Hoc Networks • Ad hoc network: IEEE 802.11 stations can dynamically form network without AP • Applications: • Laptops meeting in conference room, car • Interconnection of “personal” devices
CSMA/CD Does Not Work • Collision detection problems • Relevant contention at the receiver, not sender • Hidden terminal • Exposed terminal • Hard to build a radio that can transmit and receive at same time Hidden Exposed A A B B C C D
Hidden Terminal Effect • Hidden terminals: A, C cannot hear each other • Obstacles, signal attenuation • Collisions at B • Collision if 2 or more nodes transmit at same time • CSMA makes sense: • Get all the bandwidth if you’re the only one transmitting • Shouldn’t cause a collision if you sense another transmission • Collision detection doesn’t work • CSMA/CA: CSMA with Collision Avoidance
Medium Access Control • Think back to Ethernet MAC: • Wireless is a shared medium • Transmitters interfere • Need a way to ensure that (usually) only one person talks at a time. • Goals: Efficiency, possibly fairness • But wireless is harder! • Can’t really do collision detection: • Can’t listen while you’re transmitting. You overwhelm your antenna… • Carrier sense is a bit weaker: • Takes a while to switch between Tx/Rx. • Wireless is not perfectly broadcast
Example MAC Protocols • Pure ALOHA • Transmit whenever a message is ready • Retransmit when ACK is not received • Slotted ALOHA • Time is divided into equal time slots • Transmit only at the beginning of a time slot • Avoid partial collisions • Increase delay, and require synchronization • Carrier Sense Multiple Access (CSMA) • Listen before transmit • Transmit only when no carrier is detected
“Wireless Ethernet” • Collision detection is not practical. • Signal power is too high at the transmitter • So how do you detect collisions? • Signals attenuate significantly with distance. • Strong signal from nearby node will overwhelm the weaker signal from a remote transmitter • Capture effect: nearby node will always win in case of collision - receiver may not even detect remote node • Hidden transmitter • Two transmitters may not hear each other, which can cause collisions at a common receiver. • Hidden terminal problem • RTS/CTS is designed to avoid this
A B C Hidden Terminal Problem • B can communicate with both A and C • A and C cannot hear each other • Problem • When A transmits to B, C cannot detect the transmission using the carrier sense mechanism • If C transmits, collision will occur at node B • Solution • Hidden sender C needs to defer
A B C Possible Solution: RTS/CTS • When A wants to send a packet to B, A first sends a Request-to-Send (RTS)to B • On receiving RTS, B responds by sending Clear-to-Send (CTS), provided that A is able to receive the packet • When C overhears a CTS, it keeps quiet for the duration of the transfer • Transfer duration is included in both RTS and CTS
Collision Detection & Reliability • Impossible to detect collision using half-duplex radios • Wireless links are prone to errors. High packet loss rate detrimental to transport-layer performance. • Mechanisms needed to reduce packet loss rate experienced by upper layers
A B C Simple Solution • When B receives a data packet from A, B sends an Acknowledgement (ACK) to A. • If node A fails to receive an ACK, it will retransmit the packet
802.11 Frame Priorities • Short interframe space (SIFS) • For highest priority frames (e.g., RTS/CTS, ACK) • DCF interframe space (DIFS) • Minimum medium idle time for contention-based services DIFS contentwindow Frame transmission Busy SIFS Time
SIFS/DIFS SIFS makes RTS/CTS/Data/ACK atomic RTS Data Sender1 Time CTS ACK SIFS SIFS SIFS DIFS Time Receiver1 RTS DIFS Sender2 Time
802.11 RTS/CTS • RTS sets “duration” field in header to • CTS time + SIFS + CTS time + SIFS + data pkt time • Receiver responds with a CTS • Field also known as the “NAV” - network allocation vector • Duration set to RTS dur - CTS/SIFS time • This reserves the medium for people who hear the CTS
IEEE 802.11 RTS = Request-to-Send RTS A B C D E F assuming a circular range
IEEE 802.11 RTS = Request-to-Send RTS A B C D E F NAV = 10 NAV = remaining duration to keep quiet
IEEE 802.11 CTS = Clear-to-Send CTS A B C D E F
IEEE 802.11 CTS = Clear-to-Send CTS A B C D E F NAV = 8
IEEE 802.11 • DATA packet follows CTS. Successful data reception acknowledged using ACK. DATA A B C D E F
IEEE 802.11 ACK A B C D E F
IEEE 802.11 Reserved area ACK A B C D E F
Interference “range” Carrier sense range A F Transmit “range” IEEE 802.11 DATA A B C D E F
IEEE 802.11 MAC Protocol: CSMA/CA 802.11 CSMA: sender - If sense channel idle for DISF(Distributed Inter Frame Space) then transmit entire frame(no collision detection) - Ifsense channel busythen binary backoff 802.11 CSMA receiver: - If received OKreturn ACK after SIFS(Short IFS)(ACK is needed due tolack of collision detection)
IEEE 802.11 MAC Protocol 802.11 CSMA Protocol: others • NAV: Network Allocation Vector • 802.11 frame has transmission time field • Others (hearing data) defer access for NAV time units
Collision Avoidance Mechanisms • Problem: • Two nodes, hidden from each other, transmit complete frames to base station • Wasted bandwidth for long duration ! • Solution: • Small reservation packets • Nodes track reservation interval with internal “network allocation vector” (NAV)
Collision Avoidance: RTS-CTS Exchange • Explicit channel reservation • Sender: send short RTS: request to send • Receiver: reply with short CTS: clear to send • CTS reserves channel for sender, notifying (possibly hidden) stations • RTS and CTS short: • collisions less likely, of shorter duration • end result similar to collision detection • Avoid hidden station collisions • Not widely used/implemented • Consider typical traffic patterns
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 • Transmit when backoff interval reaches 0
B1 = 25 B1 = 5 wait data data wait B2 = 10 B2 = 20 B2 = 15 DCF Example B1 and B2 are backoff intervals at nodes 1 and 2 cw = 31
Backoff Interval • The time spent counting down backoff intervals is a part of MAC overhead • Important to choose CW appropriately • large CWlarge overhead • small CW may lead to many collisions (when two nodes count down to 0 simultaneously)
Backoff Interval (Cont.) • Since the number of nodes attempting to transmit simultaneously may change with time, some mechanism to manage contention is needed • IEEE 802.11 DCF: contention window CWis chosen dynamically depending on collision occurrence
Binary Exponential Backoff in DCF • When a node fails to receive CTS in response to its RTS, it increases the contention window • CW is doubled (up to an upper bound) • More collisions longer waiting time to reduce collision • When a node successfully completes a data transfer, it restores CW to CWmin
802.11 Overhead • Channel contention resolved using backoff • 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 • 802.11 has large room for improvement Random backoff RTS/CTS Data Transmission/ACK
Discussion • RTS/CTS/Data/ACK vs. Data/ACK • Why/when is it useful? • What is the right choice • Simulation vs. reality? • Understand Fig 4.
Frame Types • NAV information Or • Short Id for PS-Poll Upper layer data • 2048 byte max • 256 upper layer header • Protocol Version • Frame Type and Sub Type • To DS and From DS • More Fragments • Retry • Power Management • More Data • WEP • Order FC Duration /ID Address 1 Address 2 Address 3 Sequence Control Address 4 DATA FCS 2 2 6 6 6 2 6 0-2312 4bytes • IEEE 48 bit address • Individual/Group • Universal/Local • 46 bit address • MSDU • Sequence Number • Fragment Number • CCIT CRC-32 Polynomial • BSSID –BSS Identifier • TA - Transmitter • RA - Receiver • SA - Source • DA - Destination
Frame Subtypes • RTS • CTS • ACK • PS-Poll • CF-End & CF-End ACK CONTROL DATA MANAGEMENT • Data • Data+CF-ACK • Data+CF-Poll • Data+CF-ACK+CF-Poll • Null Function • CF-ACK (nodata) • CF-Poll (nodata) • CF-ACK+CF+Poll • Beacon • Probe Request & Response • Authentication • Deauthentication • Association Request & Response • Reassociation Request & Response • Disassociation • Announcement Traffic Indication Message (ATIM)
802.11 Management Operations • Scanning • Association/Reassociation • Time synchronization • Power management
Scanning & Joining • Goal: find networks in the area • Passive scanning • No require transmission saves power • Move to each channel, and listen for Beacon frames • Active scanning • Requires transmission saves time • Move to each channel, and send Probe Request frames to solicit Probe Responses from a network
Association in 802.11 1: Association request 2: Association response AP 3: Data traffic Client
Time Synchronization in 802.11 • Timing synchronization function (TSF) • AP controls timing in infrastructure networks • All stations maintain a local timer • TSF keeps timer from all stations in sync • Periodic Beacons convey timing • Beacons are sent at well known intervals • Timestamp from Beacons used to calibrate local clocks • Local TSF timer mitigates loss of Beacons
Power Management in 802.11 • A station is in one of the three states • Transmitter on • Receiver on • Both transmitter and receiver off (dozing) • AP buffers packets for dozing stations • AP announces which stations have frames buffered in its Beacon frames • Dozing stations wake up to listen to the beacons • If there is data buffered for it, it sends a poll frame to get the buffered data
Important Lessons • Many assumptions built into Internet design • Wireless forces reconsideration of issues • Link-layer • Spatial reuse (cellular) vs wires • Hidden/exposed terminal • CSMA/CA (why CA?) and RTS/CTS • Network • Mobile endpoints – how to route with fixed identifier? • Link layer, naming, addressing and routing solutions • What are the +/- of each? • Transport • Losses can occur due to corruption as well as congestion • Impact on TCP? • How to fix this hide it from TCP or change TCP
802.11 modes • Infrastructure mode • All packets go through a base station • Cards associate with a BSS (basic service set) • Multiple BSSs can be linked into an Extended Service Set (ESS) • Handoff to new BSS in ESS is pretty quick • Wandering around CMU • Moving to new ESS is slower, may require re-addressing • Wandering from CMU to Pitt • Ad Hoc mode • Cards communicate directly. • Perform some, but not all, of the AP functions
Discussion • RTS/CTS/Data/ACK vs. Data/ACK • Why/when is it useful? • What is the right choice • Why is RTS/CTS not used?
802.11 Rate Adaptation • 802.11 spec specifies rates not algorithm for choices • 802.11b 4 rates, 802.11a 8 rates, 802.11g 12 rates • Each rate has different modulation and coding Transmission Rate then Loss Ratio then Capacity Utilization Transmission Rate throughput decreases either way – need to get it just right
An IntuitionSISO Single Input Single Output Disclaimer: This Intuition is incomplete with respect to how communication signals are actually analyzed Forget about noise for now and the frequency domain transformation. Assume we have an antenna, which transmits a signal x at a frequency f. As the signal propagates through an environment, the signal is faded, which is modeled as a multiplicative coefficient h. The received signal y will be hx. x1 y1 = h1x1 fading h1 transmit receive