802.11 Wireless LANs and Ad-hoc networks IFI Master - Ubinet G. Urvoy-Keller
Sources of document Matthew Guast, 802.11 Wireless Networks, the definitive guide O'Reilly 2005. Matti Siekkinen, Aalto University 110.5111 Computer Networks II Wireless Local Area networks Dino Lopez, Univ. of Nice Wireless Networks 1 2
Outline 802 and 802.11 standard family 802.11 primer MAC operations Framing Association Physical Layer Time vs. Access Fairness MANET 3
The big picture: Wireless networks and standards IEEE 802.20 (iburst) WWAN 3GPP/3GPP2: GSM, CDMA2000, UMTS, LTE WMAN IEEE 802.16 (WiMax) WLAN IEEE 802.11 (Wi-Fi) WPAN IEEE 802.15 (Bluetooth, ZigBee,...) 4
802 standard family 802.3: CSMA/CD (~ Ethernet) 802.5: Token Ring 802.11 flavors differ in physical and not MAC/LLC layer 802.1 D: bridging/spanning tree and 802.1 Q: VLAN 802.11b (11 Mb/s) hit the market in 2011, 802.11a (54 Mb/s) around 2005. 5
IEEE 802.11 Wireless LAN: Some history 1997: IEEE approved 802.11, which specified the characteristics of devices with a signal rate of 1 and 2 Mb/s Standard specifies the MAC and the physical layers for transmissions in the 2.4 GHz band 1999: IEEE ratified IEEE 802.11b, which works at additional signal rates of 5.5 and 11 Mb/s 1999: IEEE approved the specifications of 802.11a, which uses the 5 Ghz band. The signal rates are 6, 9, 12, 18, 24, 36, 48 and 54 Mb/s. 2003: IEEE approved 802.11g as a further evolution of the 802.11 standard. Same performance as 802.11a but works in the 2.4 GHz band Compatible with 802.11b devices.... 6
802.11: Overview of the many amendments PHY (.11, a, b, g, j, n, p, y, ac, ad, af, ah) Change data rate options Change spectrum MAC Security (i, w) Measurement and Management (k, v) Flow control and QoS (e, aa, ae) Time required to establish connection (r, ai) Spectral Efficiency Regulatory behavior (d, h) Radio node connection topology (s, z) Connection with other networks (u) 7
What are we talking about Distribution system : the network among access points Generally, a single VLAN Access points : bridging between wired and wireless. Current trend : thin AP and a central controller 8
Infrastructure vs. ad-hoc Basic Service Set (BSS) : set of communicating stations Two flavors : Infrastructure (WLAN) - all transfers go through AP. AP store frames if stations go in power-saving mode Independent (Ad-hoc) stations must route! 9
Extended Service Set Multiple APs offering the same SSID (Service Set Identifier) Looks like a single layer 2 connections stations may communicate with each other Technologies to interconnect APs : VLANs or tunneling A station associated with a single. Need a protocol for inter-ap communication 10
Virtual APs A single AP can feature 32 to 64 different SSID Each SSID is associated to a different VLAN 11
MAC Operations 12
Just to be sure... MAC: Medium Access Control When to transmit Manage collisions, retransmissions,etc Implemented in physical card with a small hook in the OS 13
Challenges for the MAC: Radio Link Quality 802.11 operates in unlicensed band Has to cope with noise and interference A single transmission at a time (half duplex) Relies on positive ACK Atomic operation: must complete before turning to the next transmission Unicast are all acknowledged. Broadcast frames are not! 14
Challenges for the MAC: hidden nodes Stations can hear AP but may not hear each other 15
Challenges for the MAC: hidden nodes Stations may ask permission to send (RTS: Request to Send) and the AP answer (CTS: Clear To Send) reaching all other stations CTS (2) RTS (1) 16
RTS/CTS Not used in practice Significantly prolong data transmission time Plenty of bandwidth in most cases, can afford a few collisions. Stations are not sending continuously 17
MAC Access Modes DCF (Distributed Coordination Function): CSMA/CA mode of operation Sender uses random backoff after each frame transmission Listen before talk PCF (Point Coordination Function): contention free Master/slave approach Unused in practice! 18
MAC Access Modes EDCA (Enhanced Distribution Channel Access) Evolution of DCF with different traffic priorities (voice, video, best effort, background application) A FIFO stack for each priority 19
Carrier Sensing 2 types: Physical carrier sensing Virtual carrier sensing Physical carrier sensing performed by the physical layer before transmission Important: cards are not full duplex. Not possible to hear (e.g., for collision) during transmission 20
Carrier Sensing Virtual carrier sensing provided by the Network Allocation Vector (NAV) 802.11 frames carry duration field, which is used to reserve medium Example with RTS/CTS 21
Inter-frame spacing SIFS (Short Interframe Space) for high priority traffic, RTS/CTS and ACKs DIFS (DCFS Interframe Space) A machine that senses the medium idle can send immediately after its back-off PIFS: for PCF don't care 22
Exercise A station arrives during : RTS In between RTS and CTS During frame transmission Q: what is going to happen neglecting NAV? Q: what does the NAV further enable? 23
Frame loss recovery in DCF Rule 1: a frame that is not acknowledged is resent Rule 2: if a frame is lost, the station uses a backoff approach to determine next transmission time When is it triggered? After frame transmission + DIFS and no ACK 24
Back-off window Contention window are 2^n-1: 31,63,127, etc... Its units is slot time, which decreases with the maximum rate achievable for the standard 802.11b: 20 microseconds 802.11: 9 (or 20) microseconds 25
Back-off window 26
Framing 27
802.11 frame and addressing 2 2 frame control duration 6 6 6 address address address 1 2 3 Address 1(receiver): MAC address of wireless host or AP to process this frame 2 seq control 6 address 4 0-2312 4 payload CRC Address 4: used only in ad hoc mode Address 3: MAC address of router interface to which AP is attached Address 2(transmitter): MAC address of wireless host or AP transmitting this frame 28
802.11 frame and addressing Internet R1 router H1 AP 802.3 frame R1 MAC addr dest. address H1 MAC addr source address 802.11 frame AP MAC addr H1 MAC addr R1 MAC addr address 1(rcv) address 2 (tx) address 3 29
802.11 frame and addressing Q: Why are three addresses needed? Can t sender just specify router s MAC address as receiver? A: Must address frame to AP so that it processes it Otherwise, AP does not know it is supposed to process it 30
Association, power saving 31
Association Host must associate with an AP Scan channels listening for beacon frames containing AP s name (SSID) and MAC address Select AP to associate with Optionally perform authentication Typically run DHCP to get IP address in AP s subnet 32
Passive/active scanning BBS 1 AP 1 BBS 2 1 1 2 AP 2 BBS 1 AP 1 BBS 2 1 2 3 2 3 AP 2 4 H1 H1 Passive Scanning: Active Scanning: (1) Beacon frames from APs (2) Association Request frame from H1 to selected AP (3) Association Response frame from AP to H1 (1) Probe Request frame broadcast from H1 (2) Probes response frame from APs (3) Association Request frame from H1 to selected AP (4) Association Response frame from AP to H1 Q: Which one is better? A: Passive probing usually takes longer time prefer active probing (handovers and energy consumption) 33
Power saving PSM = Power Saving Mode Allows Rx/Tx circuitry to be temporarily shut down Coordinated with the AP Node-to-AP: I am going to sleep until next beacon frame AP knows not to transmit frames to this node, buffers them Node wakes up before next beacon frame Beacon frame: contains list of mobiles with AP-to-mobile frames waiting to be sent Node will stay awake and request frames buffered at AP if any; otherwise sleep again until next beacon frame Sleep mode consumes ten times less power than idle mode 34
PHY 35
Wireless Networks: The Frequency bands In 1985, the FCC designated 3 frequency band for the Industry, Scientific and Medical purposes. Used without license The ISM bands (adopted later in several countries) are 902-928MHz, 2.400-2.4835GHz and 5.725-5.850GHz In Europe, the frequency band between 890MHz and 915MHz is reserved for mobile communication (GSM). Only the bands at 2.4GHz and 5GHz can be used without license
802.11 in practice: PHY 802.11g 802.11b 2.4 GHz band up to 11 Mbps Uses DSSS legacy 802.11a 5 GHz band up to 54 Mbps Uses OFDM Different frequency bands OFDM is dominant MIMO (multiple antenna) has entered practical use OFDM for 2.4 GHz band up to 54 Mbps Still most widespread(?) 802.11n: 2.4/5 GHz range OFDM with multiple antennas (MIMO) 2 channel widths (20/40MHz) up to 600 Mbps Widely supported now by commercial products 802.11ac: 5GHz band Even wider channels (80 and 160 MHz) MIMO using max. 8 spatial streams Multi-user MIMO Up to 7Gb/s aggregate throughput 37
DSSS Direct-sequence systems spread Spread signal in a controlled way 38
OFDM OFDM divides an available channel into several subchannels encodes a portion of the signal across each subchannel in parallel Signals are orthogonal 39
PHY: Channels and interference 2.4GHz-2.485GHz spectrum divided into 14 channels Interference possible Channel can be same as that chosen by neighboring AP Channels overlap Only three non-overlapping channels Admin chooses channels for APs No self configuration 2.417 1 2.412 2 2.427 3 4 2.437 5 6 2.422 2.447 2.432 7 2.442 8 2.467 2.457 9 10 11 2.452 2.462 12 13 2.472 14 2.484 40
PHY: 2.4 vs. 5 GHz bands 802.11n can make a choice between the two Which is better? 2.4GHz band enables longer range 2.4GHz band more crowded Interference from microwave ovens, cordless phones, garage door openers Bluetooth, Zigbee 5GHz band is wider More non-overlapping channels 41
Why 54 is not 54? 42
A typical cycle Delayed ack in TCP 2 data for one ack 43
A typical cycle 44
For the 802.11 b case Even with no contention, we reach 6.5 and not 11. 45
Time fairness against Access Fairness 46
Rate Anomaly 54Mbps Rate anomaly is well-known in WiFi 802.11 networks 18Mbps A Low-rate stations degrade throughput of high-rate stations Why does rate anomaly exist? AP Stations reduce data rates when signal B 30 Throughput (Mbps) strength is poor Low-rate stations packets consume more airtime Per-packet fairness in basic 802.11 Higher-rate stations receive less airtime throughput degrades 54Mbps 20 A 10 B 0 A, B near AP A B A far from AP 47
The TCP unfairness problem 48
Reference Scenario TCP connections wired wireless TCP connections to wireless stations Downloads and upload Sporadic UDP traffic with real-time requirements (VoIP) Hypothesis: wireless LAN is the bottleneck Reasonable for enterprise/campus networks Possible in home networking for in-home flows but a priori not at ADSL/wifi boundary 49
TCP Unfairness Problem Upload/download asymmetry: Long lived flows Stations performing uploads obtain higher TCP throughput 50
802.11 DCF characteristics Access Point (AP) behaves like a station Equal channel access opportunity for all contending entities (AP and N stations) Statistical share of 1/(N+1) 51
N TCP Uploads ACK segments DATA segments wired N=3 2N data segments at stations, N ACKs at AP AP share needs to be N/(N + 2N)= 1/3 DCF share of 1/(1+N)= 1/4 Losses of ACKs segments, but ACKs are cumulative 52
N TCP Downloads DATA segments ACK segment wired N=3 2N data segments at AP, N ACKs at stations AP share needs to be 2N/(N + 2N)=2/3 DCF share of 1/(1+N)=1/4 Losses, limited by congestion control 53
Mixed upload-download wired AP share needs to be something between 1/3 and 2/3 With DCF, the share is ¼ for N=3! Losses that impact more downloads than uploads 54
Exercise Assume N TCP downloads Q: what is the maximum amount of in-flight IP packets, assuming MSS packets No window scaling Q: what if one sets the buffer size to this value? 55
MANET - Routing 56
Routing Routing protocol is the basis for multihop communication Ad hoc mode of 802.11 does not natively support routing protocol The historic problem of the community Around 40 different routing protocols has been proposed http://en.wikipedia.org/wiki/ad_hoc_protocol_list MANET WG at IETF Mobility: links are not permanent 57
Objectives of routing protocols Minimize control traffic Minimize bandwidth utilization Minimize energy (optimize battery usage) Minimize processing Again : optimize battery usage Refreshing of routes Avoid routing loops 58
Routing Routing in mobile ad hoc networks can be Proactive protocols (traditional routing protocols are proactive). Routes are built even in the absence of traffic Ex. DSDV (Destination Sequenced Distance Vector) Reactive protocols. Routes are built only when it is required Ex. AODV (Ad-hoc On Demand Distance Vector) [RFC3561] Hybrids protocols. Hierarchical protocols, Geographical protocols... 59
AODV A node knows all its neighbors Hello packets periodically sent A Route Request (RREQ) message is broadcasted when a node does not know how to reach a destination broadcasts Where is Node 3? The RREQ message contains several key bits of information: the source, the destination, the broadcast id, hop count, lifespan, source sequence number, destination sequence number. The source address and the broadcast id serves as a unique ID. Charles E. Perkins and Elizabeth M. Royer. "Ad hoc On-Demand Distance Vector Routing." Proceedings of the 2nd IEEE Workshop on Mobile Computing Systems and Applications, New Orleans, LA, February 1999, pp. 90-100. 60
AODV Route Reply (RREP) contains a lifetime which indicates the time for which nodes consider a route to be valid RREQ contains also a Sequence number. Every time a node sends out any type of message it increase its own Sequence number. Each node records the Sequence number of all the other nodes it talks to. A higher Sequence number means a fresher route. In case of Link failure, an Route Error (RERR) is sent back to the source. All routes to the Destination Address are erased 61
1 DSDV Destination Sequenced Distance Vector (DSDV) protocol Route advertisement Each mobile node advertises its own route tables to its current neighbors Routing tables are updated periodically to reflect the network dynamics and maintain a consistent routing table Route advertisement will contain the new sequence number of the transmitter node and the following information for each new route The destination s address The cost (number of hops) to reach the destination The sequence number of the information received,originally stamped by the destination. 1. Perkins, Charles E. & Bhagwat, Pravin: Highly dynamic Destination-Sequenced Distance-Vector routing (DSDV) for mobile computers In: SIGCOMM Comput. Commun. Rev., Vol. 24, Nr. 4 New York, NY, USA: ACM 62 (1994), S. 234-244.
DSDV 63
Responding to Topology changes in DSDV Two types of packets defined for route updates full dump packets Carry all available routing information Will require multiple network protocol data units (NPDUs) Occasionally transmitted Incremental packets Carry only information changed since last full dump Should use only one NPDU Frequently transmitted 64
AODV vs 1 DSDV 1. Performance Comparison of AODV, DSDV and I-DSDV Routing Protocols in Mobile Ad Hoc Networks, European Journal of Scientific Research, ISSN 1450-216X Vol. 31 No. 4 (2009), pp. 566-576, EuroJournals 65 Publishing, Inc. 2009, http://www.eurojournals.com/ejsr.htm