You are on page 1of 28

EE 534/CSC534: Communication and

Computer Network Simulation


Spring 2021

Lecture 2-WLAN
Last Experiment
Ethernet
Ethernet Overview
• CSMA/CD
• Evolution: Bus topology (90’s)  Star topology (now)

Hub or switch

Advance

Octets 8 6 6 2 46-1500 4

Preamble Dest Src Type Body CRC


addr addr
64-1518
72-1526
MAC Address
• MAC Addresses
– unique, 48-bit unicast address assigned to each adapter
• example: 38:10:2b:e4:b1:02
– broadcast: all 1s, ff:ff:ff:ff:ff:ff
– multicast: multicast flag (the lowest bit of the 1st octet)= 1
• 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicast
– IP multicast group address mapped to the lower order 23
bits of MAC address (not one-to-one mapping)
– Unique MAC address allocation administered by IEEE
• manufacturer buys portion of MAC address space
• the first three octets as vendor-specific
Ethernet CSMA/CD
1. If sender senses channel idle, it starts to transmit frame. If it
senses channel busy, waits until channel idle and then
transmits (1-persistent CSMA)
• Inter-frame gap: time to send 96 bits (9.6 s for 10Mbps)

2. If adapter transmits entire frame without detecting another


transmission, the adapter is done with frame !

3. If adapter detects another transmission while transmitting,


aborts and sends a jam signal (collision detection)

4. After aborting, sender enters exponential backoff


– after the mth collision, adapter chooses a K at random from
{0,1,2,…,2m-1}. Then waits K·512 bit times (k x 51.2 us in
10 Mbps Ethernet) and returns to Step 1
– give up after several tries (usually 16)
Ethernet CSMA/CD (Cont)
Exponential Backoff:
Jam Signal:
• Goal: adapt retransmission
• make sure all other
attempts to the estimated current
transmitters are aware of
# of active stations or load
collision;
– heavy load: random wait will be
• 32 bits longer
• Frame: 64 (preamble) + 32 • first collision: choose K from
(jamming sequence) = 96 {0,1}; delay is K·512 bit (51.2 s
bits – Runt Frame in 10 Mbps) transmission times
• after second collision: choose K
from {0,1,2,3}…
• after n collisions, choose K from
{0,1,2,3,4,…,2n-1}
Today’s Lecture
• Wireless Local Area Networks (WLANs)
– Medium Access Control for Wireless
Stations
Wireless Link
• Wireless link characteristics
– Error prone: noise, fading, interference
• Link layer must address reliability
– Power: energy consumption
– Shared medium: require medium access
control
– Security
Wireless Networks
• Bluetooth (IEEE 802.15.1)
– 10m, 2 Mbps
– Unlicensed frequency band, 2.4 GHz
• Wi-Fi (IEEE 802.11)
– 100 m, 54 Mbps to >1 Gbps
– Unlicensed frequency band, 2.4 GHz, 5GHz
• Cellular
– Tens of meters to tens of kilometers
– Up to several tens of Mbps peak data rate (shared) for
3G, more than 1 Gbps peak data rate (shared) for 4G
LTE-Advanced
– Licensed frequency band
Topology
• A wireless network using a • A wireless ad hoc or mesh network
base station or access
point (infrastructure
network)
Wireless LANs
• 802.11 a/b/g different physical-layer (PHY) technologies
– 802.11 b/g: 20 MHz channel in 2.4 GHz, up to 11 Mbps (802.11b),
54 Mbps (802.11g) phy data rate with OFDM
– 802.11a: 20 MHz channel in 5GHz, up to 54 Mbps phy data rate
with OFDM
• 802.11n:
– 130 Mbps phy data rate on 20 MHz channel (2 x 2 MIMO)
– 600 Mbps phy data rate on 40 MHz channel (channel bonding with
4 x 4 MIMO)
• 802.11ac:
– Very high throughput: 1 Gbps (multi-station), 500 Mbps (single
link)
– Bandwidth: up to 160 MHz channel, more MIMO antennas up to 8,
multi-user MIMO, and high-density modulation up to 256-QAM
IEEE 802.11 Specifications

LLC MAC Mgmt


MAC
Service Service
Interface Interface
LLC
MAC MAC Layer
WEP
sublayer Management
MAC
MAC Mgmt
PHY Service PHY Mgmt Service
Interface Interface
MIB
PHY PLCP Sublayer
PHY layer
DSSS FH IR OFDM Management
PMD Sublayer
802.11 System Architecture
Basic Service Set (BSS): a set of stations which communicate with
one another

Independent Basic Service Set Infrastructure Basic Service Set


(IBSS) (BSS)

• only direct communication • AP provides


possible • connection to wired network
• no relay function • relay function
• stations not allowed to
communicate directly
Extended Service Set
ESS: a set of BSSs interconnected by a distribution system (DS)

Distributed System

• AP communicate among themselves to forward traffic


• Station mobility within an ESS is invisible to the higher layers
IEEE 802.11 WLANs
• Two medium access control (MAC) methods
– DCF: Distributed Coordination Function (implemented in all
stations)
• Carrier Sensing Medium Access with Collision Avoidance
(CSMA/CA)
– PCF: Point Coordination Function (optional, not much support)
• Polling
Wireless LANs
• Collision detection no longer works in WLANs
– Typically, a wireless station cannot listen when transmitting
(half-duplex).
• How can a node detect collision if it cannot listen while talking?
• Collision Avoidance
– Random Back-off (instead of 1-persistent)
– Request-to-send (RTS)/clear-to-send (CTS)
• WLAN Distributed Coordination Function (DCF)
– Carrier Sensing Medium Access with Collision Avoidance
(CSMA/CA)
802.11 MAC protocol: CSMA/CA

contention
window
DIFS

Busy medium Next Frame


slot time
Defer access

 Use CSMA with collision Avoidance


 Based on carrier sense function in PHY called Clear Channel Assessment
(CCA)
 Reduce collision probability where mostly needed
 Efficient back-off algorithm stable at high loads
802.11 MAC : Contention window

1023
CW max

511

255
127
63
CW min 31

Fifth retransmission
Fourth retransmission
Third retransmission
Second retransmission
First retransmission
Initial attempt

https://blogs.arubanetworks.com/industries/understanding-802-11-medium-contention/
Backoff procedure
DIFS DIFS DIFS DIFS DIFS

CWindow CWindow
Frame Frame
A
defer
Frame
B
defer
Frame
C
defer
Frame
D

 Immediate access when medium is free >= DIFS


 When medium is not free, defer until the end of current frame trasnsmission + DIFS period
 To begin backoff procedure
 Choose a random number in ( 0, Cwindow)
 Use carrier sense to determine if there is activity during each slot
 Decrement backoff time by one slot if no activity is detected during that slot
 Resume backoff procedure after the end of current frame transmission + DIFS
CSMA/CA + ACK protocol
DIFS

Data
Sender SIFS

Receiver ACK
DIFS contention
window

Other Next Frame

 Receiver of directed frames to return an ACK immediately when


CRC is correct
 When no ACK received then retransmit frame after a random backoff
802.11 - MAC layer
 Priorities
 defined through different inter frame spaces
 SIFS (Short Inter Frame Spacing)
 highest priority, for ACK, CTS, polling response
 PIFS (PCF IFS)
 medium priority, for time-bounded service using PCF
 DIFS (DCF, Distributed Coordination Function IFS)
 lowest priority, for asynchronous data service

DIFS DIFS
PIFS
SIFS
medium busy contention next frame
t
direct access if
medium is free  DIFS

P. Bhagwat
Carrier Sensing
• Carrier sensing (CS) also has problems
– Rules:
• carrier ==> do not transmit
• no carrier ==> OK to transmit
– But the above rules do not always apply to wireless.
Problems with carrier sensing
Hidden terminal problem

Z
Y
W
W finds that medium is free
and it transmits a packet to Z

/ OK to transmit
no carrier ===>
Problems with carrier sensing
Exposed terminal problem
W
Z is transmitting
to W
Z

X Y

Y will not transmit to X


even though it cannot interfere

/ hold off transmission


Presence of carrier ===>
Solving Hidden Node problem with RTS/CTS

- listen RTS RTS CTS


- wait long enough
for the requested
X Z
station to respond
with CTS - send CTS
Y
W - wait long enough
for the transmitter
to send its data

Note: RTS/CTS does not solve exposed terminal problem. In the example
above, X can send RTS, but CTS from the responder may collide with Y’s data.
RTS/CTS exchange example
SIFS
DIFS

RTS Frame
Transmitter

CTS ACK
Receiver
352 304 8192 s 304
µs 10 µs 10 µs
10
µs µs µs
Other 1 NAV

Other 2 NAV

• RTS + CTS + Frame + ACK exchange invoked when frame size is


large
• NAV (Network Allocation Vector)
– NAV maintains prediction of future traffic on the medium based
on duration information that is announced in RTS/CTS frames
prior to actual exchange of data
IEEE 802.11 PCF
• Superframe: consist of contention free period (CFP) and contention
period (CP).
• Beacon: AP sends a beacon at the beginning of every CFP
• All stations set their NAV and not send any packet in the CFP after
receiving a beacon.
Association (Selecting an AP)

• Active Scanning
– node sends Probe frame
– all AP’s w/in reach reply with ProbeResponse frame
• Passive scanning:
– AP periodically sends Beacon frame
– Listen to beacons
• Association
– node selects one AP; sends it AssociateRequest frame
– AP replies with AssociationResponse frame

You might also like