Module 4_Medium_Access_Control
Module 4_Medium_Access_Control
12.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
2.1 Data link layer divided into two functionality-oriented subla
12.2
Figure 12.1: Taxonomy of multiple-access protocols
12.3
Multiple Access
Problem: When two or more nodes transmit at the same time, their
frames will collide and the link bandwidth is wasted during collision
How to coordinate the access of multiple sending/receiving
nodes to the shared link???
Solution: We need a protocol to coordinate the transmission of the
active nodes
These protocols are called Medium Access Control (MAC)
Protocols belong to a sublayer of the data link layer called MAC
(Medium Access Control)
What is expected from Multiple Access Protocols:
Main task is to minimize collisions in order to utilize the bandwidth by:
Determining when a station can use the link (medium)
what a station should do when the link is busy
what the station should do when it is involved in collision
How can the station determine success/failure of transmission
12-1 RANDOM ACCESS
12.6
Pure ALOHA Protocol
All frames from any station are of fixed length (L bits)
Stations transmit at equal transmission time (all stations produce
frames with equal frame lengths).
A station that has data can transmit at any time
After transmitting a frame, the sender waits for an
acknowledgment for an amount of time (time out) equal to the
maximum round-trip propagation delay = 2* tprop(see next slide)
If no ACK was received, sender assumes that the frame or ACK
has been destroyed and resends that frame after it waits for a
random amount of time
If station fails to receive an ACK after repeated transmissions, it
gives up
12.7
gure 12.3 Frames in a pure ALOHA network
h station send 2 frames…….Even if 1 bit of a frame coexist on ch
with 1 bit from another frame…collision..
12.9
Example 12. 1
The stations on a wireless ALOHA network are a maximum
of 600 km apart. If we assume that signals propagate at
3 × 108 m/s,
find Tb if K=2
12.10
Example 12. 1
The stations on a wireless ALOHA network are a maximum
of 600 km apart. If we assume that signals propagate at
3 × 108 m/s,
12.11
Figure 12.4: Vulnerable time for pure ALOHA protocol
If the frame transmission time is T sec, then the vulnerable time is = 2 T sec.
This means no station should send during the T-sec before this station starts
transmission and no station should start sending during the T-sec period that
the current station is sending.
12.12
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 period (1 ms) that this station is sending.
12.13
Channel utilization or Efficiency or
Throughput
Percentage of the transmitted frames that arrive
successfully (without collisions) or the
percentage of the channel bandwidth that will be
used for transmitting frames without collisions
Note
12.16
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, or 1 frame
12.18
250 will probably survive
Random Access – Slotted
ALOHA
Time is divided into slots equal to a frame transmission
time (Tfr)
A station can transmit at the beginning of a slot only
If a station misses the beginning of a slot, it has to wait
until the beginning of the next time slot.
A central clock or station informs all stations about the
start of a each slot
Maximum channel utilization is 37%
gure 12.6 Frames in a slotted ALOHA network
12.20
nger time for slotted ALOHA protocol
Note
Solution
This situation is similar to the previous exercise except that
the network is using slotted ALOHA instead of pure
ALOHA. The frame transmission time is 200/200 kbps or 1
ms.
12.23
Example 12.4 (continued)
a) In this case G is 1. So S = G × e−G = 0.368 (36.8
percent). This means that the throughput is 1000 ×
0.0368 = 368 frames. Only 368 out of 1000 frames will
probably survive. Note that this is the maximum
throughput case, percentage-wise.
b) Here G is 1/2. In this case S = G × e−G = 0.303 (30.3
percent). This means that the throughput is 500 × 0.0303
= 1512. Only 151 frames out of 500 will probably
survive.
c) Now G is 1/4. In this case S = G × e−G = 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.24
Efficiency of Aloha
S = throughput =(success
0.4
0.3
Slotted Aloha
0.2
0.1
Pure Aloha
rate)
12.28
Random Access – Carrier Sense Multiple
Access (CSMA)
Vulnerable time for CSMA is the maximum
propagation time
The longer the propagation delay, the worse the
performance of the protocol
Types of CSMA
Protocols
Different CSMA protocols that determine:
What a station should do when the medium is idle?
What a station should do when the medium is busy?
1. Non-Persistent CSMA
2. 1-Persistent CSMA
3. p-Persistent CSMA
1-persistent CSMA
To avoid idle channel time, 1-persistent protocol used
Station wishing to transmit listens to the medium:
1. If medium idle, transmit immediately;
2. If medium busy, continuously listen until medium becomes idle; then
transmit immediately with probability 1
Performance
1-persistent stations are selfish
If two or more stations becomes ready at the same time, collision
guaranteed
Nonpersistent CSMA
A station with frames to be sent, should sense the medium
1. If medium is idle, transmit; otherwise, go to 2
2. If medium is busy, (backoff) wait a random amount of time and
repeat 1
Performance:
Random delays reduces probability of collisions because two stations
with data to be transmitted will wait for different amount of times.
Bandwidth is wasted if waiting time (backoff) is large because
medium will remain idle following end of transmission even if one
or more stations have frames to send
Random Waiting
times
Wasted
time
p-persistent CSMA
Time is divided to slots where each Time unit (slot) typically equals
maximum propagation delay
Station wishing to transmit listens to the medium:
1. If medium idle,
transmit with probability (p), OR
wait one time unit (slot) with probability (1 – p), then repeat 1.
2. If medium busy, continuously listen until idle and repeat step 1
3. Performance
Reduces the possibility of collisions like nonpersistent
Reduces channel idle time like 1-persistent
diagram for three persistence methods
12.1.3 CSMA/CD
12.35
CSMA/CD (Collision
Detection)
CSMA (all previous methods) has an inefficiency:
If a collision has occurred, the channel is unstable until
collisions.
Sender stops transmission if collision has occurred reducing
channel wastage .
CSMA/CD is Widely used for bus topology LANs (IEEE
802.3, Ethernet).
Figure 12.11: Collision of the first bits in CSMA/CD
t1 , t2 – persistence
Collision after t2
12.37
Figure 12.12: Collision and abortion in CSMA/CD
12.40
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 minimum frame transmission time is T fr = 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.41
CSMA/CD Protocol
Use one of the CSMA persistence algorithm
(non-persistent, 1-persistent, p-persistent) for transmission
If a collision is detected by a station during its transmission
12.43
gure 12.14 Flow diagram for the CSMA/CD
12.47
Figure 12.16 Timing in CSMA/CA
• 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 to be idle, it may be possible that same distant station may have already
started transmitting and the signal of that distant station has not yet reached other stations.
• Therefore the purpose of IFS time is to allow this transmitted signal to reach other stations.
• If after this IFS time, the channel is still idle, the station can send, but it still needs to wait a time equal
to contention time.
• IFS variable can also be used to define the priority of a station or a frame.
12.49
Contention window
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 is very similar to the p-persistent method except
that a random outcome defines the number of slots
taken by the waiting station.
1. In contention window the station needs to sense the
channel after each time slot.
2. If the station finds the channel busy, it does not
restart the process. It just stops the timer & restarts
it when the channel is sensed as idle.
12.50
gure 12.17 Flow diagram for CSMA/CA
12.51
Note
Despite all the precautions,
collisions may occur and destroy
the data. Positive
acknowledgment and the time-
out timer can help guarantee that
receiver has received the frame
12.52
Performance of Random Access Protocols
Simple and easy to implement
Decentralized (no central device that can fail and bring down the
entire system)
In low-traffic, packet transfer has low-delay
However, limited throughput and in heavier traffic, packet delay has
no limit.
In some cases, a station may never have a chance to transfer its packet.
(unfair protocol)
A node that has frames to be transmitted can transmit continuously
at the full rate of channel (R) if it is the only node with frames
If (M) nodes want to transmit, many collisions can occur and the rate
for each node will not be on average R/M
12-2 CONTROLLED ACCESS
12.54
Controlled Access or Scheduling
12.56
1-Reservation access method
Stations take turns transmitting a single frame at a full rate ( R )
bps
Transmissions are organized into variable length cycles
Each cycle begins with a reservation interval that consists of (N)
minislots. One minislot for each of the N stations
When a station needs to send a data frame, it makes a
reservation in its own minislot.
By listening to the reservation interval, every station knows
which stations will transfer frames, and in which order.
The stations that made reservations can send their data frames
after the reservation frame.
gure 12.18 Reservation access method
12.58
12.2.2 Polling
12.59
2- Polling
Stations take turns accessing the medium
Centralized polling
One device is assigned as primary station and the
others as secondary stations
All data exchanges are done through the primary
When the primary has a frame to send it sends a
select frame that includes the address of the intended
secondary
When the primary is ready to receive data it send a
Poll frame for each device to ask if it has data to send
or not. If yes, data will be transmitted otherwise NAK
is sent.
Polling can be done in order (Round-Robin) or based
on predetermined order
Figure 12.19: Select and poll functions in polling-
access method
2 Tx/Rx Ports
-High Speed Token Ring
12.66
FDDI / CDDI use this topology
gical ring and physical topology in token-passing access method