Download Chapter 6 slides, Computer Networking, 3rd edition

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Network tap wikipedia , lookup

IEEE 802.1aq wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

Spectrum reallocation wikipedia , lookup

Airborne Networking wikipedia , lookup

Computer network wikipedia , lookup

Zero-configuration networking wikipedia , lookup

IEEE 1355 wikipedia , lookup

MIMO wikipedia , lookup

CAN bus wikipedia , lookup

Wi-Fi wikipedia , lookup

Wireless USB wikipedia , lookup

Wake-on-LAN wikipedia , lookup

List of wireless community networks by region wikipedia , lookup

IEEE 802.11 wikipedia , lookup

Policies promoting wireless broadband in the United States wikipedia , lookup

Wireless security wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

Piggybacking (Internet access) wikipedia , lookup

Transcript
Elements of a wireless network
network
infrastructure
wireless hosts
 laptop, PDA, IP phone
 run applications
 may be stationary
(non-mobile) or mobile

wireless does not
always mean mobility
Csci 183/183W/232: Wireless LAN
1
Elements of a wireless network
network
infrastructure
base station
 typically connected to
wired network
 relay - responsible
for sending packets
between wired
network and wireless
host(s) in its “area”
 e.g., cell towers
for cellular
networks, 802.11
access points
Csci 183/183W/232: Wireless LAN
2
Elements of a wireless network
network
infrastructure
wireless link
 typically used to
connect mobile(s) to
base station
 also used as backbone
link (WiMAX)
 multiple access
protocol coordinates
link access
 various data rates,
transmission distance
Csci 183/183W/232: Wireless LAN
3
Elements of a wireless network
network
infrastructure
infrastructure mode
 base station connects
mobiles into wired
network
 handoff: mobile
changes base station
providing connection
into wired network
Csci 183/183W/232: Wireless LAN
4
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
Csci 183/183W/232: Wireless LAN
5
Wireless Link Characteristics
Differences from wired link ….
 decreased
signal strength: radio signal
attenuates as it propagates through media
(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 at destination at
slightly different times
…. make communication across (even a point to point)
wireless link much more “difficult”
Csci 183/183W/232: Wireless LAN
6
Wireless network characteristics
Multiple wireless senders and receivers create
additional problems (beyond multiple access):
C
A
B
A
C’s signal
strength
A’s signal
strength
B
Hidden terminal problem
C
space
 B, A hear each other
Signal fading:
 A, C can not hear each other
 B, C hear each other
 B, C hear each other
 B, A hear each other
means A, C unaware of their
interference at B
 A, C can not hear each other
interferring at B
Csci 183/183W/232: Wireless LAN
7
Special challenge for Wireless MAC
 Collision detection is difficult
• Transmission power is much higher than receiving power
 Hidden station problem
• 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,
thus falsely concludes that it can transmit.
 Exposed station problem
• 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.
Csci 183/183W/232: Wireless LAN
8
IEEE 802.11 Wireless LAN
 802.11b
 2.4-2.485 GHz
unlicensed radio
spectrum
 up to 11 Mbps
 direct sequence spread
spectrum (DSSS) in
physical layer
• all hosts use same
chipping code
(insensitive to
multipath fading)
 widely deployed, using
base stations
 802.11a
 5.1-5.8 GHz range
 up to 54 Mbps
 OFDM
 802.11g
 2.4-2.485 GHz range
 up to 54 Mbps
 DSSS
 All use CSMA/CA for
multiple access
 All have base-station
and ad-hoc network
versions
Csci 183/183W/232: Wireless LAN
9
Spread Spectrum
 Idea
 spread signal over wider frequency band than
required
 originally deigned to thwart jamming
 Frequency Hopping
 transmit over random sequence of frequencies
 sender and receiver share…
• pseudorandom number generator
• seed

802.11 uses 79 x 1MHz-wide frequency bands
Csci 183/183W/232: Wireless LAN
10
Spread Spectrum (cont)
 Direct Sequence
 for each bit, send XOR of that bit and n
random bits
 random sequence known to both sender and
receiver
 called n-bit chipping code
 802.11 defines an 11-bit chipping code
1
0
Data stream: 1010
1
0
Random sequence: 0100101101011001
1
0
XOR of the two: 1011101110101001
Csci 183/183W/232: Wireless LAN
11
OFDM
 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-carrier. Each sub-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.
Csci 183/183W/232: Wireless LAN
12
Base Station Approach
 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 via a distribution system (DS)


The DS runs at layer 2 of the ISO architecture!
Csci 183/183W/232: Wireless LAN
13
Ad Hoc Network Approach
 No access point (i.e., base station)
 “peer-to-peer” mode
 wireless hosts communicate with each other
to get packet from wireless host A to B may
need to route through wireless hosts X,Y,Z
 Applications:
 “laptop” meeting in conference room, car
 interconnection of “personal” devices
 battlefield

 IETF MANET
(Mobile Ad hoc Networks)
working group
Csci 183/183W/232: Wireless LAN
14
802.11: Channels, association
 802.11b/g: 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
 will typically run DHCP to get IP address in AP’s
subnet
Csci 183/183W/232: Wireless LAN
15
Definitions
 Definitions
 MAC-level Acknowledgement
• Indicate the received frame is correct
• The source should wait ACKTimeout amount of time for ACK

Inter-frame Space (IFS)
•
•
•
•
SIFS: short IFS
PIFS: PCF IFS
DIFS: DCF IFS
DIFS>PIFS>SIFS
Csci 183/183W/232: Wireless LAN
16
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
C
A
B
B
C
C’s signal
strength
A’s signal
strength
space
Csci 183/183W/232: Wireless LAN
17
IEEE 802.11 MAC Protocol: CSMA/CA
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 counts down while channel idle;
transmits when timer expires;
if no ACK, increase random backoff
interval, repeat 2
sender
receiver
DIFS
802.11 receiver
- if frame received OK
data
SIFS
ACK
return ACK after SIFS (ACK needed due
to hidden terminal problem)
Csci 183/183W/232: Wireless LAN
18
Avoiding collisions – Option I
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
 RTS heard by all nodes
 sender transmits data frame
 other stations defer transmissions
Avoid data frame collisions completely
using small reservation packets!
Csci 183/183W/232: Wireless LAN
19
Collision Avoidance: RTS-CTS exchange
A
AP
B
reservation collision
DATA (A)
defer
time
Csci 183/183W/232: Wireless LAN
20
IEEE 802.11 MAC Layer – Option II
 Protocol Architecture
Distributed Coordination Function (DCF)
 Point Coordination Function (PCF)

Csci 183/183W/232: Wireless LAN
21
802.11 MAC Layer Carrier Sensing
 Carrier sense at two levels
 Physical carrier sense: done by physical layer
 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
Exposed terminal
• The Duration field reserves the media!

Reduces collision by deferring transmission if any of the
carrier sense mechanisms sense the channel busy
Csci 183/183W/232: Wireless LAN
22
DCF Basic Access
 Basic Access



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
Csci 183/183W/232: Wireless LAN
23
DCF
 Backoff Procedure





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
DCF
 Recovery procedures
 Collision may happen during contention
 When collision happens, retransmission
 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
Csci 183/183W/232: Wireless LAN
25
DCF
 Random backoff
time=random()xaSlotTime
 aSlotTime: the value of the
correspondingly named PHY
characteristic (20s for DSSS)
 Random(): a random integer
uniformly distributed over [0, CW]
 CW (contention window)



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
Csci 183/183W/232: Wireless LAN
26
DCF RTS/CTS Scheme
 RTS/CTS Scheme
 Four way handshake: RTS-CTS-DATA-ACK
 NAV (Network Allocation Vector)
 An indicator, maintained at each STA, for the period that transmission will
not be initiated
 Setting and resetting NAV according to “Duration” in MAC header when
receiving a valid frame
Csci 183/183W/232: Wireless LAN
27
DCF -- Fragmentation
 Control of the channel

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
 Duration field


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
28
DCF
 Directed (Unicast) MPDU
 STA uses RTS/CTS for directed MPDU only when the
length of a MPDU >= dot11RTSThreshold
• Always use RTS/CTS: set dot11RTSThreshold=0
• Don’t use RTS/CTS: set dot11RTSThreshold=maximum
MPDU length=2304 octets
 Broadcast and multicast
 Regardless of the length of frame, no RTS/CTS
 No ACK
 No MAC layer recovery
Csci 183/183W/232: Wireless LAN
29
PCF
 Point Coordinator
 PCF provides contention free frame transfer
 PC resides in AP; It is an option of AP to become PC
 Fundamental Access
 PC senses the medium
 When medium is idle for PIFS, PC transmit a Beacon frame
 After beacon, PC shall wait for SIFS, and then transmit
• Data frame
• CF-Poll (contention free poll) frame
• Data + CF-Poll frame
Csci 183/183W/232: Wireless LAN
30
PCF
 Polling list


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


Each STA set the NAV to CFPMaxDuration
PC shall transmit a CF-End frame at the end of CFP
Csci 183/183W/232: Wireless LAN
31
PCF
 Only available for infrastructured
architecture, why?
 PCF is on top of DCF
 Super frame contains a contention-free
period and a contention period
 Question: how time-bounded service is
provided?
Csci 183/183W/232: Wireless LAN
32
802.11 frame: addressing
2
2
6
6
6
frame
address address address
duration
control
1
2
3
Address 1: MAC address
of wireless host or AP
to receive this frame
2
6
seq address
4
control
0 - 2312
4
payload
CRC
Address 4: for Intra
DS communication
Address 3: MAC address
of router interface to
which AP is attached
Address 2: MAC address
of wireless host or AP
transmitting this frame
Csci 183/183W/232: Wireless LAN
33
802.11 frame: more
frame seq #
(for reliable ARQ)
duration of reserved
transmission time (RTS/CTS)
2
2
6
6
6
frame
address address address
duration
control
1
2
3
2
Protocol
version
2
4
1
Type
Subtype
To
AP
6
2
1
seq address
4
control
1
From More
AP
frag
1
Retry
0 - 2312
4
payload
CRC
1
1
Power More
mgt
data
1
1
WEP
Rsvd
Frame subtype (RTS, CTS, ACK, Beacon, etc.)
frame type
(management, control, data)
Csci 183/183W/232: Wireless LAN
34
Interpretation of the MAC Addrs
To AP
From
AP
Addr 1
Addr 2 Addr 3 Addr 4
0
0
DA
SA
0
1
DA
BSSID SA
1
0
BSSID SA
DA
-
1
1
RA
DA
SA
TA
BSSID -
Csci 183/183W/232: Wireless LAN
-
35
802.11 frame: addressing
R1 router
H1
Internet
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
Csci 183/183W/232: Wireless LAN
36
Supporting Mobility
 Case 1: ad hoc net working
 Case 2: access points (AP)
 tethered
 each mobile node associates with an AP
Distribution system
AP-1
AP-3
F
AP-2
A
B
G
H
C
E
D
Csci 183/183W/232: Wireless LAN
37
Mobility (cont)
 Scanning (selecting an AP)
 node sends Probe frame
 all AP’s w/in reach reply with ProbeResponse
frame
 node selects one AP; sends it AssociateRequest
frame
 AP replies with AssociationResponse frame

new AP informs old AP via tethered network
 When
 active: when join or move
 passive: AP periodically sends Beacon frame
Csci 183/183W/232: Wireless LAN
38