MAC & Physical Layers
(1 September, 2006)
February 2005
Coypright 2005 All Rights Reserved
1
Objectives
Upon completion of this chapter you will be able to:
q Explain how a client joins a network
q Describe the modes of operation wireless
LANs use to communicate
q Explain how wireless LANs avoid collisions
on the network
q Define the Request-to-Send / Clear-to-Send
transmission protocol
q Explain the effects of fragmentation on a
network
February 2005
Coypright 2005 All Rights Reserved
2
Communication Modes
q Wireless LANs vs. Ethernet
q Joining a network
Passive scanning
Active scanning
q Distributed Coordination Function (DCF)
q Point Coordination Function (PCF)
February 2005
Coypright 2005 All Rights Reserved
3
IEEE 802.3 - Ethernet
February 2005
Coypright 2005 All Rights Reserved
4
IEEE 802.3
PROCESS DATA
DATA
DSAP SSAP CNTRL
LLC-PDU
1
ETHERNET
DESTINATION
ADDRESS
PREAMBLE
8
IEEE 802.3
CSMA/CD
PREAMBLE
7
1
DA
SA
2/6
2/6
q THIS FIELD IS NOT IN ETHERNET.
q ETHERNET HAS A TYPE FIELD
q
q
q
q
q
1
1-2
FIELD
TYPE
2
6
6
SFD
SOURCE
ADDRESS
PROCESS DATA
LENGTH
2
LLC-PDU
LLC PDU
FCS
0-1500
4
LLC PDU
LLC-PDU
0-1500
4
q THIS FIELD IS NOT PRESENT IN ETHERNET.
q ETHERNET LENGTH MUST BE >= 64 OCTETS
Ethernet was developed by Bob Metcalf, Xerox Corp.
Standardized in 1980 as IEEE 802.3
CSMA/CD algorithm is same for both Ethernet and 802.3
Frame format differs between Ethernet and 802.3
Frame format differs between Ethernet and 802.11
February 2005
PAD FCS
Coypright 2005 All Rights Reserved
5
IEEE 802.3 FORMAT
q 802.3 Ethernet
Frame size of 1518 bytes (1500 for payload).
Jumbo Frames are 9000 bytes
Fragmented at 1518 bytes by Host or Routers
(IPv4).
q 802.11 Wireless Ethernet
Frame size 2346 (3212 for payload)
Fragmented by Access Point to 1518 for traversing
wired system.
February 2005
Coypright 2005 All Rights Reserved
6
IEEE 802.11 – Wireless Ethernet
February 2005
Coypright 2005 All Rights Reserved
7
Generic 802.11 Frame
2
Frame
Control
2
6
6
Duration Rec
ID
Addr
Xmit
Addr
6
Dest
Addr
2
Seq
Cntl
6
Src
Addr
0-2312
4
Frame
Body
FCS
q Frame Control. Specifies control information unique to
wireless transmission.
q Duration. Generally indices how may microseconds the
medium is expected to stay busy during transmission.
q Addresses. These are the MAC address of the MS, AP
and Ethernet nodes.
q Sequence Field. The number of each transmitted frame.
q Frame Body. The higher layer payload transmitted from
station to station.
q Frame Check Sequence (FCS). Used to validate the
integrity of the transmitted data.
February 2005
Coypright 2005 All Rights Reserved
8
802.11 Frames/Protocols
q Three major 802.11 frame types exist.
Data frames carry higher level protocol data in
the Frame body.
Control frames are used to assist in the delivery
of data frames, administer access to the medium
and to provide MAC layer reliability.
Management frames perform supervisory
functions such as joining/ leaving a wireless
network and move associations from AP to AP.
February 2005
Coypright 2005 All Rights Reserved
9
802.11 Frame Types
Management Frames
Association Request frame
Association Response frame
Reassociation Request frame
Probe request Frame
Probe Response frame
Beacon frame
ATIM frame
Disassociation frame
Authentication frame
Deauthentication frame
February 2005
Control Frames
Request to Send (RTS)
Clear to Send (CTS)
Acknowledgement (ACK)
Power-Save Poll (PS Poll)
Contention-Free End (CF End)
CF-End + CF ACK
Coypright 2005 All Rights Reserved
10
CSMA/CA
q The Wireless medium similar to Ethernet is a shared
medium. That is, many clients attempt to access (share) the
same medium.
When many clients share the same medium it is inevitable
that two or more will want to transmit at the same time.
When this occurs a transmission collision occurs resulting
a an error condition
In order to prevent collisions from occurring an access
method is required that arbitrates who can access the shared
medium
q For Ethernet this is Carrier Sense Multiple Access with
Collision Detection (CSMA/CD)
q For 802.11 this is Carrier Sense Multiple Access with
Collision Avoidance (CSMA/CA) Reserved
February 2005
Coypright 2005 All Rights
11
Carrier Sensing
q Carrier sensing is used to determine if the medium
is available.
q 802.11 employs two types of carrier-sensing
functions.
Physical Carrier Sensing.
Transceiver must receive and transmit
simultaneously.
Virtual carrier Sensing
February 2005
Coypright 2005 All Rights Reserved
12
Carrier Sensing
q Virtual Carrier-Sensing
Virtual Carrier Sensing is provided by Network Allocation Vector
(NAV).
802.11 frames carry a duration field which reserves the medium for
a fixed time.
The NAV is a timer that indicates the amount of time the medium is
to be reserved.
Stations set their NAV timer upon receipt of a frame containing a
duration field.
Stations cannot transmit during that period.
When the NAV timer reaches zero the Virtual Carrier-Sensing
indicates the medium is idle and the station can transmit.
q For the station to transmit both the physical and virtual carrier
sense must report an idle condition otherwise the station must enter a
deferral condition.
q If the station can transmit it must observe Interframe spacing (IFS)
February 2005
Coypright 2005 All Rights Reserved
13
Interframe Spacing
February 2005
Coypright 2005 All Rights Reserved
14
Interframe Spacing
q Interframe Spacing (IFS) ensures the medium is idle for a minimum
period of time prior to transmission.
q IFS Serves two primary functions.
First, IFS ensures that all frames are spaced in time such that they will
be received as distinct frames.
Secondly, it provides a priority access mechanism whereby certain types
of frames are able to preempt other frames.
Priority access is provided to frames by allowing them to be preceded
by shorter interframe spacing.
q There are four main lengths of interframe spacing.
Short Interframe Spacing (SIFS)
Point Coordination Function (PCF) Interframe Spacing (PIFS)
Extended Interframe Spacing (EIFS)
Distributed Coordination Function (DCF) Interframe Spacing (DIFS)
February 2005
Coypright 2005 All Rights Reserved
15
Interframe Spacing
q There are four different types of interframe spacing.
Short Interframe Space (SIFS).
SIFS is used for high priority traffic such as RTS/CTS and
ACK.
Higher priority traffic begins immediately after the expiration of
SIFS.
SIFS is normally used at the following times:
To send an ACK in response to a data frame.
To send a CTS in response to an RTS frame.
To send a data frame following a CTS frame.
To send all other fragments following the first fragment.
All frames exchanged during the PCF mode.
February 2005
Coypright 2005 All Rights Reserved
16
Interframe Spacing
q There are four different types of interframe spacing.
PCF Interframe Space (PIFS)
PIFS is used by PCF during contention-free operation.
Access points only use PIFS when the network is in PCF mode
which must be manually configured by the administrator.
The PCF mode allows the AP to control which stations may
transmit.
I No known vendor implements PCF.
PIFS only works with DCF (BSS, ESS, IBSS) and not Ad-hoc
mode.
Extended Interframe Space (EIFS).
EIFS is used when there is an error in transmission and has
no fixed interval.
February 2005
Coypright 2005 All Rights Reserved
17
Interframe Spacing
There are four different types of interframe
spacing.
q
DCF Interframe Space (DIFS)
DIFS is used for contention based services and is the
default interframe space on all 802.11 stations.
Each station in DCF mode waits until DIFS has expired
before contending for the network.
DCF transmission have lower priority than PCF based
transmissions.
A contention period immediately follows the DIFS
February 2005
Coypright 2005 All Rights Reserved
18
Interframe Spacing contd
IFS
DSSS
FHSS
infrared
SIFS
10 uS
28 uS
7 uS
PIFS
30 us
78 uS
15 uS
DIFS
50 uS
128 uS
23 uS
February 2005
Coypright 2005 All Rights Reserved
19
Interframe Spacing Relationship
DIFS
Busy
February 2005
PIFS
SIFS
Contention
Window
Coypright 2005 All Rights Reserved
Frame
Transmission
20
Contention Window
February 2005
Coypright 2005 All Rights Reserved
21
Contention Window
q The interframe spacing time is followed by a contention
window.
q During the contention window all stations desiring to transmit
data chooses random backoff time (time to wait).
q Each station uses a random back off algorithm to determine
how long to wait before transmitting.
A contention period (CP) immediately follows the
(DIFS).
The station chooses a random number and multiplies it
by the slot time to get a length of time to wait.
The station performs a Clear Channel Assessment
(CCA) after each time slot to see if the medium is busy.
The station can transmit provided:
(1) the medium is clear and
(2) the NAV is zero
February 2005
Coypright 2005 All Rights Reserved
22
Slot Times
The slot time multiplied by the random number to
obtain the wait time is dependent upon the particular
physical layer (DSSS, FHSS, OFDM ,etc)
Slot Times
FHSS
50 uS
DSSS
20 us
Infrared
8 uS
PIFS = SIFS + 1 Slot Time
DIFS = PIFS + 1 slot Time
February 2005
Coypright 2005 All Rights Reserved
23
The Contention Window
Contention Window = 31 Slots
802.11b
Initial
Frame
DIFS
Contention Window = 63 Slots
1st Retrans
Frame
DIFS
Contention Window = 127 Slots
2nd Retrans
Frame
DIFS
q The Contention Window is divided into time slots.
The length of each slot is medium dependent.
Stations pick a random slot and wait for that time slot before
attempting to access the medium.
The station with the lowest random number (slot) accesses first.
The number of slots will always be 1 less than the power of 2.
25-1, 26-1, 27-1, etc
February 2005
Coypright 2005 All Rights Reserved
24
Station Backoff with DCF
q Stations contend to transmit after expiration of the DIFS.
q The Contention Window (Backoff Window) follows the
DIFS.
The CW is divided into slots with the slot length depending
upon the medium, e.g., DSSS = 20 uS.
The station chooses a random number and multiplies it by the
slot time to get a length of time to wait.
The station counts down the slot times until its slot arrives.
Each time transmission fails (stations picked the same time slot)
the backoff time is selected from a larger range.
25-1 = 31, 26-1=63, etc., timeslots
February 2005
Coypright 2005 All Rights Reserved
25