Title: EEL 4781
1EEL 4781
- Lecture Notes June 05
- CSMA/CA
- CSMA/CD
2Wireless Networks Taxonomy
LAN
MAN
Wireless Networks
WAN
PAN
3WLAN Architecture
- Infrastructure-less (Ad hoc)
- Nodes communicate with each other without base
station (BS). - Infrastructure based
- Nodes communicate with an access point (AP).
- Set of computers within range of a given AP form
a Basic Service Set (BSS)
4Ad hoc Network
4
5Infrastructure Based
BSS 2
BSS 1
5
6802.11 Channel Access
- Contention-free Point Coordination Function
(PCF) - AP controls the stations in the BSS
- AP uses, e.g., FDM to assigns different
frequencies to the stations in the BSS - Not used in practice
- Contention-based Distributed Coordination
Function (DCF) - Each station in the DCF runs a random access
protocol i.e. CSMA/CA
7Carrier Sense Multiple Access with Collision
Avoidance (CSMA/CA)
- DIFS distributed inter-frame space
- If medium is free, wait for DIFS
- CW Contention window
- After DIFS, backoff for a random number in the CW
before sending the initial packet. - SIFS short inter-frame space
- This is the time the AP waits before sending
reply - DIFS SIFS (2 Slot Time)
- Collision is detected if no ACK is received
8Node A sends to Access Point B
rA 4
- CW Contention Window. Starts only after DIFS.
- Random number r picked form range CWmin to
CWmax - r can be decremented only in CW
- CW grows with every collision as follows
- CWRANGE 0 , 2 2i 1 ,
i is the transmission attempt - So, initially, CW 0 7, after 1st
collision, CW 0 15, etc.
8
9A and C send to Access Point B
Case No collision
rA becomes 0
rA4
DIFS
DATAA
ACKB
DATAC
A
DIFS
SIFS
rc becomes 0
rc6
freeze
DATAC
C
DIFS
DIFS
- What if rA and rC had both been picked as 4 ?
- What if rA and rC has collided and DATAA length
was 10 while - DATAC length were 15 ?
802.11
9
10A and C send to Access Point B
Case Collision
DATAC
rA4, rc4
rA4, rc6
DATAA
DIFS
SIFS
DIFS
- Length (DATAA) 10 Slot times
- Length (DATAC) 15 Slot times
A and C time out
802.11
10
11NAV Network Allocation Vector
NAV is an indicator of time periods when the node
will not initiate a new transmission
rA2
DIFS
STAA
DATA
SIFS
ACK
STAB
NAVB
STAC
DIFS
DIFS
rc3
NAVC
11
12The Hidden Node Problem
STAC
STAB
STAA
12
13Solution for the Hidden Node Problem
- RTS/CTS
- RTS (Request To Send) - (Approx 20 bytes)
- CTS (Clear To Send) - (Approx 16 bytes)
- Use of RTS/CTS is optional
- Solves two problems
- Hidden Node Problem
- Wastage of time due to collisions
- Maximum MSDU is 2304 bytes
13
14Preventing Collision
Step 1 A sends RTS to B Step 2 B broadcasts
CTS Ste 3 C and D receive Bs CTS and know that
the A is going to be transmitting
RTS
CTS
C
B
A
CTS
CTS
D
14
15Preventing Collision
RTS and CTS have packet duration information. C
and D use the CTS to set their NAV. B can set its
NAV upon receiving RTS.
RTS
CTS
C
B
A
CTS
CTS
D
15
16DIFS
SIFS
SIFS
SIFS
DIFS
CW
STAA
RTS
DATA
STAB
CTS
ACK
NAV
DIFS
NAV
STAC
DIFS
STAD
NAV
DIFS
16
17Ethernet (802.3)
18CSMA/CD in 802.3
- If a node A has data to send, it first senses the
medium. - If medium is idle, A transmits its frame.
- If medium is busy, A defers transmission until
medium is free, then transmits. - A collision occurs if two frames sense medium as
idle at the same time and send their data at the
same time.
19Collision recovery
- After collision, each colliding node employs a
Binary Exponential Backoff (BEB). - The contention window grows as follows
- CW 0 , 2i - 1, i is the collision number.
- So, after the 1st collision, CW 0 , 1
- After the 2nd collision, CW 0 , 4
- After the 3rd collision, CW 0 , 7
- Note that contrary to 802.3, 802.11 employs
backoff for every transmission.
20A and B have data to send
Case No collision
At this time, A has data to send
DATAA
A
IFG
defer
DATAB
B
IFG
At this time, B has data to send
20
21A, B send data at the same time
Case Collision
rA0
DATAA
DATAA
A
IFG
rB1
defer
DATAB
DATAB
B
IFG
rB becomes 0
- IFG Inter-frame gap
- DataA 5 Slot times, DataB 5 Slot times
21