Elements of a wireless network network infrastructure Elements of a wireless network wireless hosts r laptop, PDA, IP phone r run applications r may be stationary (non-mobile) or mobile m network infrastructure wireless does not always mean mobility Csci 183/183W/232: Wireless LAN Csci 183/183W/232: Wireless LAN 1 Elements of a wireless network wireless link typically used to connect mobile(s) to base station r also used as backbone link (WiMAX) r multiple access protocol coordinates link access r various data rates, transmission distance Csci 183/183W/232: Wireless LAN infrastructure mode base station connects mobiles into wired network r handoff: mobile changes base station providing p g connection into wired network r network infrastructure Csci 183/183W/232: Wireless LAN 3 4 Wireless Link Characteristics Elements of a wireless network Ad hoc mode r no base stations r nodes can only transmit to other nodes within link coverage r nodes organize themselves into a network: route among themselves Differences from wired link …. m m m Csci 183/183W/232: Wireless LAN 2 Elements of a wireless network r network infrastructure base station typically connected to wired network r relay - responsible for sending packets between wired network and wireless host(s) in its “area” m e.g., cell towers for cellular networks, 802.11 access points r decreased signal strength: radio signal attenuates as it propagates through media (path loss) interference from other sources: standardized wireless l network k frequencies f ((e.g., 2.4 4 GH GHz)) shared by other devices (e.g., phone); devices (motors) interfere as well multipath propagation: radio signal reflects off objects, ground, arriving at destination at slightly different times …. make communication across (even a point to point) wireless link much more “difficult” 5 Csci 183/183W/232: Wireless LAN 6 1 Wireless network characteristics Special challenge for Wireless MAC Multiple wireless senders and receivers create additional problems (beyond multiple access): C A B A C’s signal strength A’s signal strength t th B Hidden terminal problem B, A hear each other B, C hear each other r A, C can not hear each other means A, C unaware of their interference at B r r C Collision detection is difficult r Hidden station problem r Exposed station problem • Transmission power is much higher than receiving power • A station is not able to detect a potential competitor for the medium because the competitor is too far away • Example: A is transmitting to B. C cannot hear the transmission, y concludes that it can transmit. thus falsely • A station hears the on-going transmission, and falsely assume it cannot transmit • Example: B tis transmitting to A. C hears the transmission, thus falsely concludes that it cannot transmit o D. space Signal fading: B, A hear each other B, C hear each other r A, C can not hear each other interferring at B r r Csci 183/183W/232: Wireless LAN r Idea m spread signal over wider frequency band than required m originally deigned to thwart jamming r 802.11g m 2.4-2.485 GHz range m up to 54 Mbps m DSSS r Frequency Hopping m transmit over random sequence of frequencies m sender and receiver share… r All use CSMA/CA for • pseudorandom number generator • seed multiple access r All have base-station and ad-hoc network versions m Data stream: 1010 Random sequence: 0100101101011001 1 0 XOR of the two: 1011101110101001 Csci 183/183W/232: Wireless LAN Csci 183/183W/232: Wireless LAN 10 OFDM r Direct Sequence m for each bit, send XOR of that bit and n random bits m random sequence known to both sender and receiver m called n-bit bit chipping code m 802.11 defines an 11-bit chipping code 1 0 802.11 uses 79 x 1MHz-wide frequency bands 9 Spread Spectrum (cont) 1 0 8 Spread Spectrum r 802.11a m 5.1-5.8 GHz range m up to 54 Mbps m OFDM Csci 183/183W/232: Wireless LAN Csci 183/183W/232: Wireless LAN 7 IEEE 802.11 Wireless LAN r 802.11b m 2.4-2.485 GHz unlicensed radio spectrum m up to 11 Mbps m direct sequence spread spectrum (DSSS) in physical layer • all hosts use same chipping code (insensitive to multipath fading) m widely deployed, using base stations r r A large number of closely-spaced orthogonalsub-carriers are used to carry data. The data are divided into several parallel data streams or channels, one for each sub sub-carrier carrier. Each sub sub-carrier carrier is modulated with a conventional modulation scheme (such as quadrature amplitude modulation or phase shift keying) at a low symbol rate, maintaining total data rates similar to conventional single-carrier modulation schemes in the same bandwidth. 11 Csci 183/183W/232: Wireless LAN 12 2 Base Station Approach Ad Hoc Network Approach r Wireless host communicates with a base station m base station = access point (AP) r No access point (i.e., base station) m “peer-to-peer” mode r Basic Service Set (BSS) (a.k.a. “cell”) contains: r wireless hosts communicate with each other wireless hosts m access point (AP): base station r BSS BSS’ss combined via a distribution system (DS) to get packet from wireless host A to B may need to route through wireless hosts X,Y,Z r Applications: m “laptop” meeting in conference room, car m interconnection of “personal” devices m battlefield m m m The DS runs at layer 2 of the ISO architecture! r Csci 183/183W/232: Wireless LAN r Definitions m MAC-level Acknowledgement into 11 channels at different frequencies m AP admin chooses frequency for AP m interference possible: channel can be same as that chosen by y neighboring g g AP! • Indicate the received frame is correct • The source should wait ACKTimeout amount of time for ACK m r host: must associate with an AP m scans channels, listening for beacon frames containing AP’s name (SSID) and MAC address m selects AP to associate with m may perform authentication m will typically run DHCP to get IP address in AP’s subnet 802.11 sender 1 if sense channel idle for DIFS then transmit entire frame (no CD) 2 if sense channel busy then start random backoff timer; timer i counts d down while hil channel h l idl idle; transmits when timer expires; if no ACK, increase random backoff interval, repeat 2 r 802.11: no collision detection! m difficult to receive (sense collisions) when transmitting due to weak rece received ved ssignals gnals (fading) (fad ng) m can’t sense all collisions in any case: hidden terminal, fading m goal: avoid collisions: CSMA/C(ollision)A(voidance) C A B C sender receiver data SIFS ACK return ACK after SIFS (ACK needed due to hidden terminal problem) space Csci 183/183W/232: Wireless LAN 16 DIFS 802.11 receiver - if frame received OK C’s signal strength A’s signal strength Csci 183/183W/232: Wireless LAN IEEE 802.11 MAC Protocol: CSMA/CA nodes transmitting at same time B SIFS: short IFS PIFS: PCF IFS DIFS: DCF IFS DIFS>PIFS>SIFS 15 r 802.11: CSMA - sense before transmitting m don’t collide with ongoing transmission by other node A Inter-frame Inter frame Space (IFS) • • • • IEEE 802.11: multiple access r avoid collisions: 14 Definitions r 802.11b/g: 2.4GHz-2.485GHz spectrum divided 2+ Csci 183/183W/232: Wireless LAN 13 802.11: Channels, association Csci 183/183W/232: Wireless LAN IETF MANET (Mobile Ad hoc Networks) working group 17 Csci 183/183W/232: Wireless LAN 18 3 Collision Avoidance: RTS-CTS exchange Avoiding collisions – Option I A idea: allow sender to “reserve” channel rather than random access of data frames: avoid collisions of long data frames r sender first transmits small request-to-send (RTS) packets to BS using CSMA m RTSs may still collide with each other (but they’re short) r BS broadcasts b d sts clear-to-send l t s d CTS in i response s s to t RTS r RTS heard by all nodes m sender transmits data frame m other stations defer transmissions B reservation collision DATA (A) Avoid data frame collisions completely using small reservation packets! Csci 183/183W/232: Wireless LAN AP defer time Csci 183/183W/232: Wireless LAN 19 IEEE 802.11 MAC Layer – Option II 20 802.11 MAC Layer Carrier Sensing r Protocol Architecture m Distributed Coordination Function (DCF) m Point Coordination Function (PCF) r Carrier sense at two levels m Physical carrier sense: done by physical layer m Virtual carrier sense at MAC layer using Network Allocation Vector (NAV) set while RTS/CTS/Data/Ack are overheard: partially solves problem of Hidden and E Exposed d terminal t i l • The Duration field reserves the media! m Csci 183/183W/232: Wireless LAN m m r Backoff Procedure When a STA has data to send, it senses medium The STA may transmit a MAC Protocol Data Unit (MPDA) when medium idle time is greater or equal to DIFS If medium is busy, wait for a random backoff time m m m m m Csci 183/183W/232: Wireless LAN 22 DCF Basic Access m Csci 183/183W/232: Wireless LAN 21 DCF Basic Access r Reduces collision by deferring transmission if any of the carrier sense mechanisms sense the channel busy 23 Backoff procedure is invoked for a STA to transfer a frame but the medium is busy Set Backoff Timer to be random backoff time Backoff Timer start decreasing after an idle time of DIFS following the medium busyness Backoff Timer is suspended when medium is busy, and won’t resume until the medium is idle for DIFS A frame may be transmitted immediately when Backoff Timer is 0 Csci 183/183W/232: Wireless LAN 24 4 DCF DCF r Recovery procedures m Collision may happen during contention m When collision happens, retransmission m STAs maintain a station short retry counter (SSRC) and long retry counter (SLRC) for each MSDU and MMPDU • SSRC increases by one for each failed RTS or MPDU whose length is <= dot11RTSThreshold • SLRC increases by one for each failed MPDU whose length is > dot11RTSThreshold • Both counter is reset upon a successful MPDU • Retry is aborted when SSRC>=dot11ShortRetryLimt =7 or SLRC>=aLongRetryLimit r Random backoff r CW (contention window) time=random()xaSlotTime m aSlotTime: the value of the correspondingly named PHY characteristic (20s for DSSS) m Random(): a random integer uniformly if l dist distributed ib t d over [0, [0 CW] m m m Csci 183/183W/232: Wireless LAN RTS/CTS Scheme r NAV (Network Allocation Vector) r m Four way handshake: RTS-CTS-DATA-ACK m An indicator, maintained at each STA, for the period that transmission will not be initiated Csci 183/183W/232: Wireless LAN 25 DCF RTS/CTS Scheme r Increases exponentially after each retry fails (so does average backoff time. Why to do this?) Keep constant after reaching the maximum Reset after a successful transmission 26 DCF -- Fragmentation r Control of the channel m Setting and resetting NAV according to “Duration” in MAC header when receiving a valid frame Once the STA has contented for the channel, it shall continue to send fragments until • All fragments of a MSDU or MMPDU have been sent • An ACK is not received • STA is restricted from sending additional fragments by PHY layer r Duration field m m RTS/CTS: time till the end of ACK0 Fragments/ACK: time till the end of the ACK for the next fragment • Last fragment/ACK: length of ACK/0 Csci 183/183W/232: Wireless LAN Csci 183/183W/232: Wireless LAN 27 DCF PCF r Directed (Unicast) MPDU m STA uses RTS/CTS for directed MPDU only when the length of a MPDU >= dot11RTSThreshold r Point Coordinator m PCF provides contention free frame transfer m PC resides in AP; It is an option of AP to become PC r Fundamental Access m PC senses the medium m When medium is idle for PIFS, PIFS PC transmit a Beacon frame m After beacon, PC shall wait for SIFS, and then transmit • Always use RTS/CTS: set dot11RTSThreshold=0 • Don’t use RTS/CTS: set dot11RTSThreshold=maximum g octets MPDU length=2304 r Broadcast and multicast m Regardless of the length of frame, no RTS/CTS m No ACK m No MAC layer recovery Csci 183/183W/232: Wireless LAN 28 • Data frame • CF-Poll (contention free poll) frame • Data + CF-Poll frame 29 Csci 183/183W/232: Wireless LAN 30 5 PCF r Polling list m m r PCF STA indicates its CF-Pollability via Association and Reassociation PC shall send a CF-Poll to at least one STA when there are entries in the polling list NAV m m Each STA set the NAV to CFPMaxDuration PC shall transmit a CF-End CF End frame at the end of CFP Csci 183/183W/232: Wireless LAN 2 2 6 6 6 frame address address address duration control 1 2 3 2 seq address 4 control 0 - 2312 4 payload CRC 2 Address 3: MAC address of router interface to which AP is attached 2 Protocol version 2 6 6 6 4 1 Subtype To AP 1 1 From More AP frag 1 0 - 2312 4 payload CRC 1 Retry 1 Power More mgt data 1 1 WEP Rsvd frame type (management, control, data) From AP Addr 1 Addr 2 Addr 3 Addr 4 0 0 DA SA 0 1 DA BSSID SA BSSID SA TA Csci 183/183W/232: Wireless LAN 33 To AP RA 2 Type 6 2 seq address 4 control Frame subtype (RTS, CTS, ACK, Beacon, etc.) DA R1 router H1 BSSID - DA 34 802.11 frame: addressing Interpretation of the MAC Addrs 1 frame seq # (for reliable ARQ) duration of reserved transmission time (RTS/CTS) frame address address address duration control 1 2 3 Csci 183/183W/232: Wireless LAN 1 32 802.11 frame: more Address 2: MAC address of wireless host or AP transmitting this frame 0 Csci 183/183W/232: Wireless LAN Address 4: for Intra DS communication Address 1: MAC address of wireless host or AP to receive this frame 1 architecture, why? r PCF is on top of DCF r Super frame contains a contention-free contention free period and a contention period r Question: how time-bounded service is provided? 31 802.11 frame: addressing 6 r Only available for infrastructured Internet AP - R1 MAC addr H1 MAC addr dest. address - source address 802.3 frame AP MAC addr H1 MAC addr R1 MAC addr SA address 1 address 2 address 3 802.11 frame Csci 183/183W/232: Wireless LAN 35 Csci 183/183W/232: Wireless LAN 36 6 Supporting Mobility Mobility (cont) ad hoc net working r Case 2: access points (AP) r Case 1: m m r Scanning (selecting an AP) m node sends Probe frame m all AP’s w/in reach reply with ProbeResponse frame m node selects one AP; sends it AssociateRequest frame m AP replies with AssociationResponse frame tethered each mobile node associates with an AP Distribution system AP-1 AP-3 m F AP-2 A B G C new AP informs old AP via tethered network r When H m E D m Csci 183/183W/232: Wireless LAN 37 active: when join or move passive: AP periodically sends Beacon frame Csci 183/183W/232: Wireless LAN 38 7