0% found this document useful (0 votes)
15 views

CN Lecture 4 Datalink Layer II Fall22

Uploaded by

woyecex875
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

CN Lecture 4 Datalink Layer II Fall22

Uploaded by

woyecex875
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Multiple Access Techniques II

Course Code: CSC 3116 Course Title: Computer Networks

Dept. of Computer Science


Faculty of Science and Technology

Lecturer No: 4 Week No: 4 Semester: Summer 21-22


Lecturer: Md. Sakir Hossain, Email: [email protected]
Lecture Outline

1. ALOHA
2. CSMA
3. CSMA/CD
4. CSMA/CA
ALOHA
Introduction
ALOHA….
Algorithm

Fig. 1 Flow chart of ALOHA


ALOHA….
Collision

R= Transmission
Rate

Fig. 2 Collision in ALOHA


ALOHA….
Throughput

 The throughput is the fraction of time, the channel carries useful information, namely
non-colliding packets.
 Under all number of frames, the throughput, S, is just the product of average number of
frames, G and the probability, P, of a transmission succeeding—that is,
 S = GP
 Consider a packet scheduled for transmission at some time ‘t’. This packet will be
successful if no other packet is scheduled for transmission in the interval (t-T, t+T) (this
period of 2T is called the vulnerable period). The probability of this happening, that is,
the probability of success, is that no packet is scheduled in an interval of length 2T.

2T

t-T t t+T
ALOHA….
Throughput

Fig. 3 Vulnerable time of ALOHA


ALOHA….
Throughput

Fig. 3 Vulnerable time of ALOHA


ALOHA….
Throughput

 Using Poisson distribution, Probability of generating ‘k’ interfering frames (when


average number of frames = G) is,
 P (k) = ( 𝑮𝒌 . 𝒆−𝑮 ) / k!
 The vulnerability of pure ALOHA is 2 time frames. For the time duration of two
time frames on an average 2G frames are produced. Thus, probability that no other
traffic is initiated in this duration (2T) is, that is probability of successful
transmission without interference, is;
 →P (0) = ((2𝐺)0 *𝑒 −2𝐺 ) / 0!
 →P = 𝑒 −2𝐺
 Using S = GP, we get, Throughput,

 S = G𝒆−𝟐𝑮
ALOHA….
Throughput

 Using Poisson distribution, Probability of generating ‘k’ interfering frames (when


average number of frames = G) is,
 P (k) = ( 𝑮𝒌 . 𝒆−𝑮 ) / k!
 The vulnerability of pure ALOHA is 2 time frames. For the time duration of two
time frames on an average 2G frames are produced. Thus, probability that no other
traffic is initiated in this duration (2T) is, that is probability of successful
transmission without interference, is;
 →P (0) = ((2𝐺)0 *𝑒 −2𝐺 ) / 0!
 →P = 𝑒 −2𝐺
 Using S = GP, we get, Throughput,

 S = G𝒆−𝟐𝑮
ALOHA….
Throughput

 We see that throughput S depends on occurrence of frames/frame time, G, to get


maximum throughput, we differentiate the throughput equations with respect to G.
 Pure ALOHA:
 S = G𝑒 −2𝐺
 S’ = 𝑒 −2𝐺 + G*(-2) 𝑒 −2𝐺 [ differentiation (S) = S’]
 For maxima, above equation is to be equated to zero. Therefore,
 dS/dG = 𝑒 −2𝐺 − G*(2) 𝑒 −2𝐺 = 0
 Gmax = 1/2
 Thus, S = 0.5/e
ALOHA….
Throughput

 We see that throughput S depends on occurrence of frames/frame time, G, to get


maximum throughput, we differentiate the throughput equations with respect to G.
 Pure ALOHA:
 S = G𝑒 −2𝐺
 S’ = 𝑒 −2𝐺 + G*(-2) 𝑒 −2𝐺 [ differentiation (S) = S’]
 For maxima, above equation is to be equated to zero. Therefore,
 dS/dG = 𝑒 −2𝐺 − G*(2) 𝑒 −2𝐺 = 0
 Gmax = 1/2
 Thus, S = 0.5/e
Carrier Sense Multiple Access
Introduction

 CSMA was developed to overcome the problems of ALOHA i.e. to


minimize the chances of collision.
 CSMA is based on the principle of “carrier sense”.
 The station sense the carrier or channel before transmitting a frame.
 It means the station checks whether the channel is idle or busy.
 The chances of collision reduces to a great extent if a station checks the
channel before trying to use it.
Carrier Sense Multiple Access
CSMA

 The chances of collision still exists


because of propagation delay.
 The frame transmitted by one station
takes some time to reach the other
station.
 In the meantime, other station may
sense the channel to be idle and
transmit its frames.
 This results in the collision.
Fig. 4 Flow chart of CSMA
Carrier Sense Multiple Access
Classification

 What should a station do if the channel is busy? What should a station do


if the channel is idle?
 Three methods have been devised for CSMA:
 I-persistent method,
 the nonpersistent method
 the p-persistent method
Carrier Sense Multiple Access
1-persistent

1-Persistent: The 1 (one) -persistent method is simple and straightforward. In


this method, after the station finds the line idle, it sends its frame immediately
(with probability 1).
This method has the highest chance of collision because two or more stations may
find the line idle and send their frames immediately.

Fig. 5 Carrier sense in 1-persistent Fig. 6 Flow chart of 1-persistent


Carrier Sense Multiple Access
Nonpersistent

 Nonpersistent: In the nonpersistent method, a station that has a frame to


send senses the line. If the line is idle, it sends immediately. If the line is not
idle, it waits a random amount of time and then senses the line again.
 The nonpersistent approach reduces the chance of collision because it is
unlikely that two or more stations will wait the same amount of time and
retry to send simultaneously.
 However, this method reduces the efficiency of the network because the
medium remains idle when there may be stations with frames to send.
Carrier Sense Multiple Access
Nonpersistent

Fig. 7 Carrier sense in nonpersistent Fig. 8 Flow chart of nonpersistent


Carrier Sense Multiple Access
P-Persistent

 p-Persistent: The p-persistent method is used if the channel has time slots with a
slot duration equal to or greater than the maximum propagation time. The p-
persistent approach combines the advantages of the other two strategies. It reduces
the chance of collision and improves efficiency.
 In this method, after the station finds the line idle it follows these steps:
 1.With probability p, the station sends its frame.
 2. With probability q = 1 - p, the station waits for the beginning of the next time slot and
checks the line again.
 a. If the line is idle, it goes to step 1.
 b. If the line is busy, it acts as though a collision has occurred and uses the
 back off procedure.
Carrier Sense Multiple Access
P-Persistent

Fig. 9 Carrier sense in p-persistent

Fig. 10 Flow chart of p-persistent


CSMA/CD
 In CSMA/CD, the station that sends its
data on the channel, continues to sense the
channel even after data transmission.
 If collision is detected, the station aborts
its transmission and waits for a random
amount of time & sends its data again.
 As soon as a collision is detected, the
transmitting station release a jam signal.
 Jam signal alerts other stations. Stations are
not supposed to transmit immediately after
the collision has occurred. Fig. 11 Flow chart of CSMA/CD
CSMA/CA
Introduction

• Carrier sense multiple access/collision


avoidance (CSMA/CA) protocol is used
in wireless networks because they
cannot detect the collision.
• So, the only solution is collision
avoidance.
▪ Worked based on three strategies
➢ Inter Frame Space
➢ Contention Window
➢ Acknowledgements
Fig. 12 Flow chart of CSMA/CA
CSMA/CA
Introduction

 Wireless Networks
CSMA/CA is used. CSMA/CD cannot be used because
• CSMA/CD requires continuous transmission and
reception for collision detection. Thus require full-
duplex operation, which can not be supported in
wireless due to short battery life
• Difficult to detect may not be detected because of
obstacle or range problem
• The distance between stations can be great. Signal
fading could prevent a station at Fig. 13 Illustration of difficulties
one end from hearing a collision at the other end. in collision detection in wireless
networks
CSMA/CA
Interframe Space

 Whenever the channel is found idle, the station does not transmit
immediately.
 It waits for a period of time called Interframe Space (IFS).
 When channel is sensed idle, it may be possible that some distant station
may have already started transmitting.
 Therefore, the purpose of IFS time is to allow this transmitted signal to
reach its destination.
 If after this IFS time, channel is still idle, the station can send the frames
CSMA/CA
Contention window

 Contention window is the amount of time divided into slots.


 Station that is ready to send chooses a random number of slots as its waiting
time.
 The number of slots in the window changes with time.
 It means that it is set of one slot for the first time, and then doubles each
time the station cannot detect an idle channel after the IFS time.
 In contention window, the station needs to sense the channel after each time
slot [1].
CSMA/CA
Acknowledgement

 Despite all the precautions, collisions may occur and destroy the data.
 Positive acknowledgement and the time-out timer helps guarantee that the
receiver has received the frame.

Fig. 14 Carrier sense in contention window


References

[1] B. A. Forouzan, Data Communication and Networking, 5th ed., The McGraw-Hill
Companies, Inc., USA, 2013, pp. 326-339.
Recommended Books

1. Data Communications and Networking, B. A. Forouzan, McGraw-Hill, Inc., Fourth


Edition, 2007, USA.
2. Computer Networking: A Top-Down Approach, J. F., Kurose, K. W. Ross, Pearson
Education, Inc., Sixth Edition, USA.
3. Official Cert Guide CCNA 200-301 , vol. 1, W. Odom, Cisco Press, First Edition, 2019,
USA.
4. CCNA Routing and Switching, T. Lammle, John Wily & Sons, Second Edition, 2016,
USA.
5. TCP/IP Protocol Suite, B. A. Forouzan, McGraw-Hill, Inc., Fourth Edition, 2009, USA.
6. Data and Computer Communication, W. Stallings, Pearson Education, Inc., Tenth
Education, 2013, USA.

You might also like