Chuong 4 Wireless Lan

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

3/24/2016

Chapter 4

WIRELESS LAN

1
3/24/2016

IEEE 802.11

 IEEE has defined the specifications for a


wireless LAN, called IEEE 802.11, which covers
the physical and data link layers.
 Topics discussed in this section:
 Architecture
 MAC Sublayer
 Physical Layer

2
3/24/2016

 Scope of IEEE 802.11 is limited to Physical and


Data Link Layers.

Characteristics of wireless LANs

 Advantages
 Flexibility: very flexible within the reception area
 Planning: Ad-hoc networks without previous
planning possible
 Design: (almost) no wiring difficulties (e.g. historic
buildings, firewalls)
 Robustness: more robust against disasters like, e.g.,
earthquakes, fire or users pulling a plug
 Cost: Adding additional users to a wireless network
will not increase the cost.
6

3
3/24/2016

 Disadvantages
 Quality of service: typically very low bandwidth
compared to wired networks (1-10 Mbit/s)
 Proprietary solutions: many proprietary solutions,
especially for higher bit-rates, standards take time
(e.g. IEEE 802.11). Now, 802.11g is a popular
solution.
 Restrictions: products have to follow many national
restrictions if working wireless, it takes long time to
establish global solutions like, e.g., IMT-2000
 Safety and security: Precautions have to be taken to
prevent safety hazards. Secrecy and integrity must be
7
assured.

Wireless LAN Standard

Standard Modulation Spectrum Max physical Working


Rate distance

802.11 WDM, FHSS 2.4 GHz 2 Mbps ≈100 m


DSSS
802.11a OFDM 5 GHz 54 Mbps ≈ 50 m

802.11b HR-DSSS 2.4 GHz 11 Mbps ≈ 200 m

802.11g OFDM 2.4 GHz 54 Mbps ≈ 200 m

4
3/24/2016

Elements of a wireless network

wireless hosts
 laptop, PDA, IP phone
 run applications
 may be stationary (non-
mobile) or mobile
network  wireless does not
infrastructure always mean mobility

6-9

Elements of a wireless network

base station
 typically connected to
wired network
 relay - responsible for
sending packets
between wired
network network and wireless
infrastructure host(s) in its “area”
 e.g., cell towers,
802.11 access
points

6-10

5
3/24/2016

Elements of a wireless network

wireless link
 typically used to
connect mobile(s) to
base station
 also used as backbone
link
network  multiple access
infrastructure protocol coordinates
link access
 various data rates,
transmission distance

6-11

802.11 - Architecture of an infrastructure network

802.11 LAN  Station (STA)


802.x LAN
• terminal with access mechanisms to
the wireless medium and radio
STA1 contact to the access point
BSS1
Portal  Basic Service Set (BSS)
Access
Point • group of stations using the same
radio frequency
Distribution System
 Access Point (AP)
Access
ESS Point • station integrated into the wireless
LAN and the distribution system
BSS2  Portal
• bridge to other (wired) networks
 Distribution System
STA2 802.11 LAN STA3 • interconnection network to form
one logical network (EES:
Extended Service Set) based
on several BSS 12

6
3/24/2016

802.11 - Architecture of an ad-hoc network

802.11 LAN  Direct communication


within a limited range
STA1
IBSS1 STA3
 Station (STA):
terminal with access
mechanisms to the
STA2
wireless medium
 Independent Basic
IBSS2 Service Set (IBSS):
STA5 group of stations using
the same radio
STA4 802.11 LAN
frequency
13

Elements of a wireless network

infrastructure mode
 base station connects
mobiles into wired
network
 handoff: mobile
changes base station
network providing connection
infrastructure into wired network

6-14

7
3/24/2016

Elements of a wireless network

ad hoc mode
 no base stations
 nodes can only
transmit to other
nodes within link
coverage
 nodes organize
themselves into a
network: route among
themselves

6-15

16

8
3/24/2016

17

IEEE standard 802.11


fixed
terminal
mobile terminal

infrastructure
network

access point
application application
TCP TCP
IP IP
LLC LLC LLC
802.11 MAC 802.11 MAC 802.3 MAC 802.3 MAC
802.11 PHY 802.11 PHY 802.3 PHY 802.3 PHY

9
3/24/2016

Wireless Link Characteristics (1)


Differences from wired link ….
 decreased signal strength: radio signal attenuates as it
propagates through matter (path loss)
 interference from other sources: standardized wireless
network frequencies (e.g., 2.4 GHz) shared by other
devices (e.g., phone); devices (motors) interfere as
well
 multipath propagation: radio signal reflects off
objects ground, arriving ad destination at slightly
different times

…. make communication across (even a point to point) wireless link


much more “difficult”

6-19

Wireless Link Characteristics (2)


 SNR: signal-to-noise ratio 10-1

 larger SNR – easier to extract


10-2
signal from noise (a “good
thing”) 10-3
BER

10-4
 SNR versus BER tradeoffs
 given physical layer: increase
10-5

power -> increase SNR- 10-6

>decrease BER
10-7
10 20 30 40
 given SNR: choose physical SNR(dB)
layer that meets BER
QAM256 (8 Mbps)
requirement, giving highest
QAM16 (4 Mbps)
thruput
 SNR may change with mobility: BPSK (1 Mbps)

dynamically adapt physical layer 6-20


(modulation technique, rate)

10
3/24/2016

Wireless network characteristics


Multiple wireless senders and receivers create additional
problems (beyond multiple access):

A B C
C

A’s signal C’s signal


B strength strength
A

space
Hidden terminal problem
 B, A hear each other Signal attenuation:
 B, C hear each other  B, A hear each other
 A, C can not hear each other  B, C hear each other
means A, C unaware of their  A, C can not hear each other
interference at B interfering at B

6-21

The Exposed Station Problem

 This is the inverse problem.


 B wants to send to C and listens to the channel.
 When B hears A’s transmission, B falsely
assumes that it cannot send to C.

22

11
3/24/2016

802.11 LAN Architecture

• Access Point (AP)


– Base station that
Internet communicates with the
wireless hosts
• Basic Service Set (BSS)
– Coverage of one AP
– AP acts as the master
hub, switch
– Identified by an “network
or router
AP name” known as an SSID

BSS 1
AP

BSS 2 SSID: Service Set Identifier 23

Channels and Association

 Multiple channels at different frequencies


 Network administrator chooses frequency for AP
 Interference if channel is same as neighboring AP
 Access points send periodic beacon frames
 Containing AP’s name (SSID) and MAC address
 Host scans channels, listening for beacon frames
 Host selects an access point to associate with

•Beacon frames from APs


•Associate request from host
•Association response from AP

12
3/24/2016

 IEEE 802.11 defines two MAC sublayers : the


distributed coordination function (DCF)
and point coordination function (PCF)

25

Distributed coordination function (DCF)

 DCF use CSMA/CA as access method


 Wireless Lan can not use CSMA/CD for 3
reasons :
 For collision detection a station must be able to send
data and receive collision signals at the same time.
This can mean costly stations and increased
bandwidth requirements.
 Collision may not be detected because of the hidden
station problem.
 The distance between stations can be great. Signal
fading could prevent a station at one end from
hearing a collision at the other end. 26

13
3/24/2016

CSMA/CA flowchart

27

 Before sending a frame, the source station senses


the medium by checking the energy level at the
carrier frequency
 The channel uses a persistence strategy (chiến lược
kiên trì) with back-off until the channel is idle
 After the station is found to be idle, the station waits
for a period of time called the distributed interframe
space (DIFS); then the station sends a control frame
called the request to send (RTS)

28

14
3/24/2016

 After receiving the RTS and waiting a period of


time called the short interframe space (SIFS), the
destination station sends a control frame, called
the clear to send (CTS), to the source station.
This control frame indicates that the destination
station is ready to receive data.
 The source station sends data after waiting an
amount of time equal to SIFS.
 The destination station, after waiting an amount
of time equal to SIFS, sends an acknowledgment
to show that the frame has been received. 29

Network Allocation Vector (NAV)

 Used in order to collision avoidance


 When a station sends an RTS frame, it includes the
duration of time that it needs to occupy the channel.
 The stations that are affected by this transmission
create a timer called a network allocation vector that
shows how much time must pass before these
stations are allowed to check the channel for idleness
 each station, before sensing the physical medium to
see if it is idle, first checks its NAV to see if it has
expired

30

15
3/24/2016

CSMA/CA and NAV

31

Collision During Handshaking


 What happens if there is collision during the time
when RTS or CTS control frames are in
transition, often called the handshaking period?
 Two or more stations may try to send RTS
frames at the same time.These control frames
may collide
 However, because there is no mechanism for
collision detection, the sender assumes there has
been a collision if it has not received a CTS
frame from the receiver. The back-off strategy is
employed, and the sender tries again. 32

16
3/24/2016

Point Coordination Function (PCP)


 The point coordination function (PCF) is an optional
access method that can be implemented in an
infrastructure network (not in an ad hoc network). It is
implemented on top of the DCF and is used mostly for
time-sensitive transmission.
 PCF has a centralized, contention-free polling access
method
 The AP performs polling for stations that are capable of
being polled. The stations are polled one after another,
sending any data they have to the AP.

33

 To give priority to PCF over DCF, another set of


interframe spaces has been defined: PIFS and SIFS. The
SIFS is the same as that in DCF, but the PIFS (PCF
IFS) is shorter than the DIFS. This means that if, at the
same time, a station wants to use only DCF and an AP
wants to use PCF, the AP has priority.
 Due to the priority of PCF over DCF, stations that only
use DCF may not gain access to the medium
 To prevent this, a repetition interval has been designed
to cover both contention-free (PCF) and contention-
based (DCF) traffic
34

17
3/24/2016

 The repetition interval, which is repeated


continuously, starts with a special control frame,
called a beacon frame.
 When the stations hear the beacon frame, they
start their NAV for the duration of the
contention-free period of the repetition interval

35

Example of repetition interval

36

18
3/24/2016

 During the repetition interval, the PC (point


controller) can send a poll frame, receive data,
send an ACK, receive an ACK, or do any
combination of these (802.11 uses
piggybacking). At the end of the contention-free
period, the PC sends a CF end (contention-free
end) frame to allow the contention-based stations
to use the medium.

37

Fragmentation

 The wireless environment is very noisy; a


corrupt frame has to be retransmitted. The
protocol, therefore, recommends fragmentation-
the division of a large frame into smaller ones. It
is more efficient to resend a small frame than a
large one.

38

19
3/24/2016

Frame Format

 The MAC layer frame consists of nine fields, as


shown in Figure

39

Subfields in FC field

40

20
3/24/2016

 D field :In all frame types except one, this field defines the duration
of the transmission that is used to set the value of NAY. In one
control frame, this field defines the ID of the frame.
 Addresses. There are four address fields, each 6 bytes long. The
meaning of each address field depends on the value of the To DS
and From DS subfields
 Sequence control. This field defines the sequence number of the
frame to be used in flow control.
 Frame body. This field, which can be between 0 and 2312 bytes,
contains information based on the type and the subtype defined in
the FC field.
 FCS. The FCS field is 4 bytes long and contains a CRC-32 error
detection sequence.

41

Frame Types

 A wireless LAN defined by IEEE 802.11 has three


categories of frames: management frames, control
frames, and data frames.
 Management Frames Management frames are used for
the initial communication between stations and access
points.
 Control Frames Control frames are used for accessing
the channel and acknowledging frames
 Control frames :

42

21
3/24/2016

43

Addressing Mechanism

 The IEEE 802.11 addressing mechanism


specifies four cases, defined by the value of the
two flags in the FC field, To DS and From DS.

44

22
3/24/2016

 Note that address 1 is always the address of the


next device. Address 2 is always the address of the
previous device. Address 3 is the address of the
final destination station if it is not defined by
address 1. Address 4 is the address of the original
source station if it is not the same as address 2
 Case 1: 00 In this case, To DS = 0 and From DS = 0.
This means that the frame is not going to a distribution
system (To DS = 0) and is not coming from a
distribution system (From DS =0)
45

Addressing mechanisms

46

23
3/24/2016

 Case 2: 01 In this case, To DS = 0 and From DS = 1.


This means that the frame is coming from a
distribution system (From DS = 1). The frame is
coming from an AP and going to a station
 Case 3: 10 In this case, To DS = 1 and From DS = O.
This means that the frame is going to a distribution
system (To DS = 1). The frame is going from a
station to an AP.
 Case 4:11 In this case, To DS =1 and From DS = 1.
TIus is the case in which the distribution system is
also wireless. The frame is going from one AP to
another AP in a wireless distribution system
47

Hidden and Exposed Station Problems

 Hidden Station Problem


 Assume B send data to A
 station C is out of B's range and transmissions from
B cannot reach C
 Therefore C thinks the medium is free. Station C
sends its data to A, which results in a collision at A

48

24
3/24/2016

Use of handshaking to prevent hidden station problem

 The solution to the hidden station problem is the


use of the handshake frames (RTS and CTS)

49

Exposed Station Problem


 In this problem a station refrains (tránh) from using a
channel when it is, in fact, available
 station A is transmitting to station B
 Station C has some data to send to station D
 However, station C is exposed to transmission from
A; it hears what A is sending and thus refrains from sending.
In other words, C is too conservative and wastes the capacity
of the channel.

50

25
3/24/2016

51

Physical layer

 All implementations, except the infrared, operate


in the industrial, scientific, and medical (ISM)
band, which defines three unlicensed bands in
the three ranges 902-928 MHz, 2.400--4.835
GHz, and 5.725-5.850 GHz

52

26
3/24/2016

Industrial, scientific, and medical (ISM) band

53

IEEE 802.11 FHSS

 IEEE 802.11 FHSS uses the frequency-hopping


spread spectrum (FHSS) method
 FHSS uses the 2.4-GHz ISM band
 The band is divided into 79 subbands of 1 MHz
(and some guard bands).
 A pseudorandom number generator selects the
hopping sequence.
 The modulation technique in this specification is
either two-level FSK or four-level FSK with I or
2 bitslbaud, which results in a data rate of 1 or 2
Mbps, as shown 54

27
3/24/2016

55

IEEE 802.11 DSSS

 IEEE 802.11 DSSS uses the direct sequence


spread spectrum (DSSS) method
 DSSS uses the 2.4-GHz ISM band
 The modulation technique in this specification is
PSK at 1 Mbaud/s
 The system allows 1 or 2 bitslbaud (BPSK or
QPSK), which results in a data rate of 1 or 2
Mbps

56

28
3/24/2016

802.11 LAN architecture

 wireless host communicates


Internet with base station
 base station = access
point (AP)
 Basic Service Set (BSS) (aka
“cell”) in infrastructure mode
hub, switch
or router contains:
AP
 wireless hosts
 access point (AP): base
BSS 1
station
AP
 ad hoc mode: hosts only

BSS 2
6-57

802.11: Channels, association

 802.11b: 2.4GHz-2.485GHz spectrum divided into 11 channels at


different frequencies
 AP admin chooses frequency for AP
 interference possible: channel can be same as that
chosen by neighboring AP!
 host: must associate with an AP
 scans channels, listening for beacon frames
containing AP’s name (SSID) and MAC address
 selects AP to associate with
 may perform authentication [Chapter 8]
 will typically run DHCP to get IP address in AP’s
subnet
6-58

29
3/24/2016

802.11: passive/active scanning

BBS 1 BBS 2 BBS 1 BBS 2

AP 1 AP 2 AP 1 1 AP 2
1 1 2 2
2 3
3 4

H1 H1

Passive Scanning: Active Scanning:


(1) beacon frames sent from APs (1) Probe Request frame broadcast
(2) association Request frame sent: from H1
H1 to selected AP (2) Probes response frame sent from
(3) association Response frame sent: APs
H1 to selected AP (3) Association Request frame sent:
H1 to selected AP
(4) Association Response frame
sent: H1 to selected AP
6-59

IEEE 802.11: multiple access


 avoid collisions: 2+ nodes transmitting at same time
 802.11: CSMA - sense before transmitting
 don’t collide with ongoing transmission by other node
 802.11: no collision detection!
 difficult to receive (sense collisions) when transmitting due to weak
received signals (fading)
 can’t sense all collisions in any case: hidden terminal, fading
 goal: avoid collisions: CSMA/C(ollision)A(voidance)

A B C
C
A’s signal C’s signal
B strength strength
A
space
6-60

30
3/24/2016

IEEE 802.11 MAC Protocol: CSMA/CA

802.11 sender
1 if sense channel idle for DIFS then sender receiver
transmit entire frame (no CD)
2 if sense channel busy then DIFS

start random backoff time


timer counts down while channel idle data
transmit when timer expires
if no ACK, increase random backoff interval,
SIFS
repeat 2
802.11 receiver ACK

- if frame received OK
return ACK after SIFS (ACK needed due to hidden
terminal problem)
6-61

Avoiding collisions (more)

idea: allow sender to “reserve” channel rather than random access of


data frames: avoid collisions of long data frames
 sender first transmits small request-to-send (RTS) packets to BS using
CSMA
 RTSs may still collide with each other (but they’re short)

 BS broadcasts clear-to-send CTS in response to RTS


 CTS heard by all nodes
 sender transmits data frame

 other stations defer transmissions

avoid data frame collisions completely


using small reservation packets!

6-62

31
3/24/2016

Collision Avoidance: RTS-CTS exchange

A B
AP

reservation collision

DATA (A)
defer

time

6-63

802.11 frame: addressing

2 2 6 6 6 2 6 0 - 2312 4
frame address address address seq address
duration payload CRC
control 1 2 3 control 4

Address 4: used only in


ad hoc mode
Address 1: MAC address
of wireless host or AP Address 3: MAC address
to receive this frame of router interface to which
AP is attached
Address 2: MAC address
of wireless host or AP
transmitting this frame

6-64

32
3/24/2016

802.11 frame: addressing

Internet
H1 R1 router
AP

R1 MAC addr H1 MAC addr


dest. address source address

802.3 frame

AP MAC addr H1 MAC addr R1 MAC addr


address 1 address 2 address 3

802.11 frame
6-65

802.11 frame: more


frame seq #
duration of reserved
(for RDT)
transmission time (RTS/CTS)

2 2 6 6 6 2 6 0 - 2312 4
frame address address address seq address
duration payload CRC
control 1 2 3 control 4

2 2 4 1 1 1 1 1 1 1 1
Protocol To From More Power More
Type Subtype Retry WEP Rsvd
version AP AP frag mgt data

frame type
(RTS, CTS, ACK, data)

6-66

33

You might also like