You are on page 1of 32

NETW 501 Communication

Networks
Tutorial 6
By: Mariham Wasfy
Outline
• Random Access Dynamic MAC
Outline
• Random Access Dynamic MAC
 ALOHA
 Slotted ALOHA
o CSMA
o CSMA/CD
Random Access MAC
 ALOHA
 Slotted ALOHA
o CSMA
o CSMA/CD
Random Access MAC
 ALOHA
 Slotted ALOHA
o CSMA
o CSMA/CD
CSMA
• Carrier Sense
SENSE Medium
Medium Access
Access

Busy
Don’t send the frame
Idle (Free)
Send the frame
CSMA
• Vulnerable Period = Tprop
A 0 2
A B
Ttrans = 2
Tprop = 1 B
0 1 3

C
1 3

D
1 3
D C
CSMA
• Types:
P 1-P
Success Failure
1-
1- Non-
Non- P-
P-
Persistent
Persistent Persistent
Persistent Persistent
Persistent
Run
Exponential
Backoff
Algorithm
CSMA
• Collision
Run Exponential
Backoff Algorithm

1-
1- Non-
Non- P-
P-
Persistent
Persistent Persistent
Persistent Persistent
Persistent
CSMA
• Example
Ttrans = 2 A 0 2
A B
Tprop A-B = 2
Tprop A-C = 1 B
0 1 2 3 4

C
1 3

C
Random Access MAC
 ALOHA
 Slotted ALOHA
o CSMA
o CSMA/CD
CSMA/CD
• Carrier Sense Medium Access / Collision
COLLISION Detection
DETECTION

A 0 2
A B
Ttrans = 2
Tprop = 1 B
0 1 2 3 4

C
1 3
Abort transmission
when collision detected
C
CSMA/CD
• Vulnerable Period = Tprop
A 0 2
A B
Ttrans = 2
Tprop = 1 B
0 1 3

C
1 3

D
1 3
D C
NB: Number of trials NB = 0
CSMA and CSMA/CD CW: Clear window
BE: Backoff window
CW = 2
BE = min_BE
• Exponential Backoff Algorithm
Choose and wait
R value from 0 to R (time)

CCA: Clear Channel Assessment Perform 2 CCA


Yes NB > No Yes CW No
SUCCESS
ABORT max_NB = 0?
?
CCA
Yes
CW = CW -1 Success
NB = 1
?
CW = 2
BE = min(BE+1, max_BE) No
Tutorial
1. Consider an Ethernet of diameter 300 m, frame size 1500 bytes, Speed of 2.1 108
m/sec and transmission rate of 1 Mbps.
a. Calculate the vulnerable period in CSMA.
b. If CSMA/CD is used. Stations A & B are located at the edges of the network.
Given that station A starts transmission at t and station B starts transmission at t +
0.5 µsec.
i. At what time will B abort transmission?
ii. At what time will A abort transmission?
Given:
• D = 300 m
• Lframe = 1500 B
• C = 2.1 108 m/sec
• R = 1 Mbps

Tprop = = 1.428 µsec A B

Ttrans = = 12 msec

a. Vulnerable period in CSMA = Tprop = 1.428 µsec


Given:
• A starts transmission at t
• B starts transmission at t + 0.5 µsec A B

Tprop = = 1.428 µsec


t + 1.928 µs
Ttrans = = 12 msec
t + 1.928 µs t + 2.856 µs A
t t + 12 ms
t + 0.5 µs
b. i. B aborts transmission @: t + Tprop = t + 1.428 µs B
ii. A aborts transmission @: t + 0.5 µs + Tprop = t + 1.928 µs t + 1.428 µs t + 12 ms
2. A channel using random access protocols has three stations on a bus with end-to-end
propagation delay t. Station A is located at one end of the bus and stations B & C are
located together at the other end of the bus. Frames arrive at the three stations and
are to be transmitted at stations A, B & C at the respective time tA = 0, tB = 0.5 t and tC
= 1.5 t. Frames require transmission time of 4t. in appropriate figures, with time at
the horizontal axis, show the transmission activity of each of the three stations for:

a. Non-persistent CSMA
b. Non-persistent CSMA/CD
tB = 0.5 t
a. Non-persistent CSMA ttrans = 4 t
B
tprop A-B = tprop A-C = t
tprop B-C = 0 t
A
A tA = 0 t
0 1.5 t 4t 5.5 t
C
B tC = 1.5 t
0.5 tt 4.5 t5 t
Busy doesn’t send and will back off
C
0.5 tt 4.5 t5 t
1.5 t
tB = 0.5 t
a. Non-persistent CSMA ttrans = 4 t
B
tprop A-B = tprop A-C = t
tprop B-C = 0 t
A
A tA = 0 t
0 4t
C
B tC = 1.5 t
0.5 t 4.5 t

C
tB = 0.5 t
b. Non-persistent CSMA/CD ttrans = 4 t
B
tprop A-B = tprop A-C = t
tprop B-C = 0 t
A
A tA = 0 t
0 1.5 t 2 t 4t
C
B tC = 1.5 t
0.5 t t 5t
Busy doesn’t send and will back off
C
0.5 t tt 5t
1.5 t
tB = 0.5 t
b. Non-persistent CSMA/CD ttrans = 4 t
B
tprop A-B = tprop A-C = t
tprop B-C = 0 t
A
A tA = 0 t
0 1.5 t
C
B tC = 1.5 t
0.5 t t

C
3. Consider the network shown below where terminals A, B, C and D are
communicating over a bus with a central station. The transmission time for packets
from terminal B and C is t units while the transmission time for packets from
terminals A and D is 0.5 units.

a. What is the vulnerable period in the following scenarios: (Calculate based on


worst case scenario)
i. 1-persistent CSMA
ii. Non-Persistent CSMA/CD
b. Provided that terminals A,B,C and D start their transmission at tA=1.5t, tB=0.5t, tC=2t
and tD=2t respectively. Assuming that A & C implement 1-persistant CSMA/CD while
B & D implement Non-persistent CSMA/CD. Show the transmission activity for the
four stations in the plot below until 6t. (Assume that back-off interval is equal to 1.5t
for all terminals)
c. Indicate the time interval during which node D senses the channel to be idle.
d. Indicate which of the four packets will be received correctly at central station and
which will suffer from collision on timing diagram.
a. The vulnerable period:
i. 1-persistent CSMA
ii. Non-Persistent CSMA/CD

Vulnerable period 1-persistent CSMA = Vulnerable period Non-Persistent CSMA/CD = Tprop_MAX


3t
TpropA-B = t TpropD-C = t
TpropA-Central Station = 1.5 t TpropD-Central Station = 1.5 t
TpropA-C = 2t TpropD-B = 2t
TpropA-D = 3t TpropD-A = 3t
b.

back-off interval is equal to 1.5 t for all terminals


A B C D
Send
1.5
2.5 tt 0.5 t 2tt
2.5 2t
at
Tt 0.5 t t t 0.5 t
A-Bt B-At C-A2t D-A3t
Tp A-C2t B-Ct C-Bt D-B2t
A-D3t B-D2t C-Dt D-Ct
1- Non- 1- Non-
Proto
persistant persistent persistant persistent
col
CSMA/CD CSMA/CD CSMA/CD CSMA/CD
c. Node D will sense the channel idle at:

From 0 to 2 t
From 4 t to 5.5 t
From 6 t to further
d. All 4 packets received correctly at
central station

A B C D
Send
1.5 t 0.5 t 2t 2t
at 2.5 t 2.5
5ttt
4.5
Tt 0.5 t t t 0.5 t Backoff

Tp 1.5 t 0.5 t 0.5 t 1.5 t


1- Non- 1- Non-
Proto
persistant persistent persistant persistent
col
CSMA/CD CSMA/CD CSMA/CD CSMA/CD
4. Four stations are located on a bus network as shown below. The distance between station
A and B is 2d meters. The distance between A and H is d meters. The distance between
station H and C is 3d meters. The propagation delay between A and C is t sec.
Frames arrive at the four stations A, B, C and H at times tA=0, tB= 0.75 t, tC= 2.5 t and
tH=2.75 t respectively.
All frames require transmission time of t sec.

If we assume that the stations A, C, H apply 1-persistent CSMA/CD while station B


applies Non-Persistent CSMA/CD. Show the transmission activity for the four stations in
the plot below until 6t. (Assume that if collision is detected or occurs for terminals A & C
the back-off window size is 2 slots while if collision is detected or occurs for terminal B
& H the back-off window size is 1 slot)
A B H C
A-B2d B-A2d H-Ad C-A4d
D A-Hd B-Hd H-Bd C-B2d
A-C4d B-C2d H-C3d C-H3d

Tprop A-C t

Cross multiplication

Distance Tprop
4d t
xx== == =
3dd
2 x
A B H C
Send
0 0.75
1.75 tt 2.75
3t t 2.5 ttt
3.25
5.75
at
Tt t t t t
Backoff
A - B 0.5t B - A 0.5t H-A2t C-At
Tp A - H 0.25t B – H 0.25t H - B 0.25t C - B 0.5 t
A-Ct B - C 0.5t H - C 0.75t C - H 0.75t
1- Non- 1- 1-
Prot Backoff
persistant persistent persistant persistant
ocol
CSMA/CD CSMA/CD CSMA/CD CSMA/CD
Back
2 slots 1 slot 1 slot 2 slots
off

You might also like