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

Unit 3C - Medium Access Sublayer - Protocols

COMPUTER NETWORKS
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)
16 views

Unit 3C - Medium Access Sublayer - Protocols

COMPUTER NETWORKS
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/ 41

Multiple Access Sub-

layer

12.1
Figure 12.1 Data link layer divided into two functionality-oriented sublayers

12.2
Figure 12.2 Taxonomy of multiple-access protocols discussed in this chapter

12.3
12-1 RANDOM ACCESS

In random access or contention methods, no station is


superior to another station and none is assigned the
control over another. No station permits, or does not
permit, another station to send. At each instance, a
station that has data to send uses a procedure defined
by the protocol to make a decision on whether or not to
send.
Topics discussed in this section:
ALOHA
Carrier Sense Multiple Access (CSMA)
Carrier Sense Multiple Access with Collision Detection (CSMA-CD)
Carrier Sense Multiple Access with Collision Avoidance (CSMA-CA)
12.4
Q1

12.5
12.6
Figure 12.3 Frames in a pure ALOHA network

12.7
G = Average number of frames generated by the system during one frame
transmission time

12.8
Figure 12.5 Vulnerable time for pure ALOHA protocol

12.9
Note

The throughput for pure ALOHA is


S = G × e −2G .
The maximum throughput
Smax = 0.184 when G= (1/2).

12.10
Slotted Aloha

• G = Average number of frames generated by the system during one frame


transmission time

12.11
Figure 12.6 Frames in a slotted ALOHA network

12.12
Figure 12.7 Vulnerable time for slotted ALOHA protocol

12.13
Note

The throughput for slotted ALOHA is


S = G × e−G .
The maximum throughput
Smax = 0.368 when G = 1.

12.14
12.15
Figure 12.9 Vulnerable time in CSMA

12.16
Carrier Sense Multiple Access (CSMA)
• The chance of collision can be reduced if a station senses the medium before
sending.
• CSMA can reduce the possibility of collision, but it cannot eliminate it.
• Stations are connected to a shared channel (usually a dedicated medium) as
shown in Figure 12.9.
• The possibility of collision still exists because of propagation delay, when a
station sends a frame, it still takes time (although very short) for the first bit to
reach every station and for every station to sense it.
• In other words, a station may sense the medium and find it idle, only because the
first bit sent by another station has not yet been received.
• At time t1 station B senses the medium and finds it idle, so it sends a frame.
• At time t2 (t2> t1) station C senses the medium and finds it idle because, at this
time, the first bits from station B have not reached station C.
• Station C also sends a frame.
• The two signals collide and both frames are destroyed.

12.17
Vulnerable time in CSMA

• The vulnerable time for CSMA is the propagation time Tp .


• This is the time needed for a signal to propagate from one end of the
medium to the other.
• When a station sends a frame, and any other station tries to send a
frame during this time, a collision will result.
• But if the first bit of the frame reaches the end of the medium, every
station will already have heard the bit and will refrain from sending.
• Figure 12.9 shows the worst case. The leftmost station A sends a frame
at time t1 which reaches the rightmost station D at time t1 + Tp .
• The gray area shows the vulnerable area in time and space.

12.18
Figure 12.10 Behavior of three persistence methods

12.19
Persistence Methods
Figure 12.10 shows the behavior of three persistence methods when a station finds a
channel busy.

1-Persistent : 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.

Nonpersistent : 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.

12.20
Persistence Methods
P-Persistent : This 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 backoff
procedure.

12.21
Figure 12.12 Collision of the first bit in CSMA/CD

12.22
Carrier Sense Multiple Access with Collision Detection
(CSMA/CD)
• In this method, a station monitors the medium after it sends a frame to see if the
transmission was successful. If so, the station is finished. If there is a collision, the
frame is sent again.
• Each station continues to send bits in the frame until it detects the collision
• In Figure 12.12, stations A and C are involved in the collision.
• At time t1, station A has executed its persistence procedure and starts sending the
bits of its frame.
• At time t2, station C has not yet sensed the first bit sent by A.
• Station C executes its persistence procedure and starts sending the bits in its
frame, which propagate both to the left and to the right.
• The collision occurs sometime after time t2 . Station C detects a collision at time
t3 when it receives the first bit of A's frame.
• Station C immediately aborts transmission.
• Station A detects collision at time t4 when it receives the first bit of C's frame; it
also immediately aborts transmission.
• Looking at the figure, we see that A transmits for the duration t4 – t1; C
transmits for the duration t3 - t2.
12.23
Figure 12.13 Collision and abortion in CSMA/CD

12.24
Example 12.5

A network using CSMA/CD has a bandwidth of 10 Mbps.


If the maximum propagation time is 25.6 μs, what is the
minimum size of the frame?

Solution
The frame transmission time is Tfr = 2 × Tp = 51.2 μs.
This means, in the worst case, a station needs to transmit
for a period of 51.2 μs to detect the collision. The
minimum size of the frame is 10 Mbps × 51.2 μs = 512
bits or 64 bytes. This is actually the minimum size of the
frame for Standard Ethernet.
12.25
Carrier Sense Multiple Access with Collision Avoidance
(CSMA/CA)
• In this method, we need to avoid collisions in wireless networks because they
cannot be detected.
• Three strategies to avoid the collision as shown in fig. 12.16
• Interframe space (IFS)
• Contention window
• Acknowledgement

12.26
Figure 12.16 Timing in CSMA/CA (Collision Avoidance)

12.27
Carrier Sense Multiple Access with Collision Avoidance
(CSMA/CA)
Interframe space (IFS)
• First, collisions are avoided by deferring transmission even if the channel is
found idle.
• When an idle channel is found, the station does not send immediately. It waits for
a period of time called the interframe space or IFS. Even though the channel may
appear idle when it is sensed, a distant station may have already started
transmitting.
• The distant station's signal has not yet reached this station. The IFS time allows
the front of the transmitted signal by the distant station to reach this station.
• If after the IFS time the channel is still idle, the station can send, but it still needs
to wait a time equal to the contention time. The IFS variable can also be used to
prioritize stations or frame types. For example, a station that is assigned a shorter
IFS has a higher priority.

12.28
Note

In CSMA/CA, the IFS can also be used to


define the priority of a station or a frame.

12.29
Carrier Sense Multiple Access with Collision Avoidance
(CSMA/CA)
Contention window
• The contention window is an amount of time divided into slots. A station that is
ready to send chooses a random number of slots as its wait time. The number of
slots in the window changes according to the binary exponential back-off
strategy. This means that it is set to one slot the first time and then doubles each
time the station cannot detect an idle channel after the IFS time. This is very
similar to the p-persistent method except that a random outcome defines the
number of slots taken by the waiting station.
• Station needs to sense the channel after each time slot. However, if the station
finds the channel busy, it does not restart the process; it just stops the timer and
restarts it when the channel is sensed as idle. This gives priority to the station
with the longest waiting time.

12.30
Note

In CSMA/CA, if the station finds the


channel busy, it does not restart the
timer of the contention window;
it stops the timer and restarts it when
the channel becomes idle.

12.31
Carrier Sense Multiple Access with Collision Avoidance
(CSMA/CA)
Acknowledgement
• With all these precautions, there still may be a collision resulting in destroyed
data.
• In addition, the data may be corrupted during the transmission. The positive
acknowledgment and the time-out timer can help guarantee that the receiver has
received the frame.

Procedure
• Figure 12.17 shows the procedure. Note that the channel needs to be sensed
before and after the IFS. The channel also needs to be sensed during the
contention time. For each time slot of the contention window, the channel is
sensed. If it is found idle, the timer continues; if the channel is found busy, the
timer is stopped and continues after the timer becomes idle again.

12.32
Figure 12.17 Flow diagram for CSMA/CA

12.33
Figure 12.4 Procedure for pure ALOHA protocol

12.34
Example 12.2

A pure ALOHA network transmits 200-bit frames on a


shared channel of 200 kbps. What is the requirement to
make this frame collision-free?

Solution
Average frame transmission time Tfr is 200 bits/200 kbps or
1 ms. The vulnerable time is 2 × 1 ms = 2 ms. This means
no station should send later than 1 ms before this station
starts transmission and no station should start sending
during the one 1-ms period that this station is sending.

12.35
Example 12.3
A pure ALOHA network transmits 200-bit frames on a
shared channel of 200 kbps. What is the throughput if the
system (all stations together) produces
a. 1000 frames per second b. 500 frames per second
c. 250 frames per second.
Solution
The frame transmission time is 200/200 kbps or 1 ms.
a. If the system creates 1000 frames per second, this is 1
frame per millisecond. The load is 1. In this case
S = G× e−2 G or S = 0.135 (13.5 percent). This means
that the throughput is 1000 × 0.135 = 135 frames. Only
135 frames out of 1000 will probably survive.
12.36
Example 12.3 (continued)
b. If the system creates 500 frames per second, this is
(1/2) frame per millisecond. The load is (1/2). In this
case S = G × e −2G or S = 0.184 (18.4 percent). This
means that the throughput is 500 × 0.184 = 92 and that
only 92 frames out of 500 will probably survive. Note
that this is the maximum throughput case,
percentagewise.

c. If the system creates 250 frames per second, this is (1/4)


frame per millisecond. The load is (1/4). In this case
S = G × e −2G or S = 0.152 (15.2 percent). This means
that the throughput is 250 × 0.152 = 38. Only 38
frames out of 250 will probably survive.
12.37
Slotted Aloha

• G = Average number of frames generated by the system during one frame


transmission time

12.38
Example 12.4
A slotted ALOHA network transmits 200-bit frames on a
shared channel of 200 kbps. What is the throughput if the
system (all stations together) produces
a. 1000 frames per second b. 500 frames per second
c. 250 frames per second.

12.39
Example 12.4
A slotted ALOHA network transmits 200-bit frames on a
shared channel of 200 kbps. What is the throughput if the
system (all stations together) produces
a. 1000 frames per second b. 500 frames per second
c. 250 frames per second.
Solution
The frame transmission time is 200/200 kbps or 1 ms.
a. If the system creates 1000 frames per second, this is 1
frame per millisecond. The load is 1. In this case
S = G× e−G or S = 0.368 (36.8 percent). This means
that the throughput is 1000 × 0.0368 = 368 frames.
Only 386 frames out of 1000 will probably survive.
12.40
Example 12.4 (continued)
b. If the system creates 500 frames per second, this is
(1/2) frame per millisecond. The load is (1/2). In this
case S = G × e−G or S = 0.303 (30.3 percent). This
means that the throughput is 500 × 0.0303 = 151.
Only 151 frames out of 500 will probably survive.

c. If the system creates 250 frames per second, this is (1/4)


frame per millisecond. The load is (1/4). In this case
S = G × e −G or S = 0.195 (19.5 percent). This means
that the throughput is 250 × 0.195 = 49. Only 49
frames out of 250 will probably survive.

12.41

You might also like