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

Module 4_Medium_Access_Control

The document discusses Medium Access Control (MAC) protocols, which are essential for coordinating access to shared communication links to minimize collisions and optimize bandwidth usage. It covers various random access methods like Pure ALOHA and Slotted ALOHA, detailing their operational principles and throughput calculations. Additionally, it introduces Carrier Sense Multiple Access (CSMA) and its variants, including CSMA/CD, which enhance performance by reducing collision occurrences and managing post-collision scenarios.

Uploaded by

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

Module 4_Medium_Access_Control

The document discusses Medium Access Control (MAC) protocols, which are essential for coordinating access to shared communication links to minimize collisions and optimize bandwidth usage. It covers various random access methods like Pure ALOHA and Slotted ALOHA, detailing their operational principles and throughput calculations. Additionally, it introduces Carrier Sense Multiple Access (CSMA) and its variants, including CSMA/CD, which enhance performance by reducing collision occurrences and managing post-collision scenarios.

Uploaded by

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

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

In random-access or contention no station is


superior to another station and none is
assigned control over another.

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.

This decision depends on the state of the medium


(idle or busy).
• No scheduled time for a station to transmit
• Txn is random among stations.
• No rules to specify which station should send next
• Stations compete with one another to access medi
12.5
Pure ALOHA

ALOHA, the earliest random access method, was


developed at the University of Hawaii in early 1970.
It was designed for a radio (wireless) LAN, but it
can be used on any shared medium. It is obvious
that there are potential collisions in this
arrangement. The medium is shared between the
stations. When a station sends data, another station
may attempt to do so at the same time. The data from
the two stations collide and become garbled.

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

Multiple frames in contention in shared mediu


12.8
gure 12.4 Procedure for pure ALOHA protocol

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,

we find Tp = (600 × 103) / (3 × 108) = 2 ms. For


K = 2, the range of R is {0, 1, 2, 3}. This means that T B can
be 0, 2, 4, or 6 ms, based on the outcome of the random
variable R.

12.11
Figure 12.4: Vulnerable time for pure ALOHA protocol

Length of time for possibility of collision

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

 ALOHA Maximum channel utilization



18% (i.e, if the system produces F frames/s, then
0.18 * F frames will arrive successfully on
average without the need of retransmission).
12.14
One-half frame generated during one frame txn tim
Or 1 frame during 2 frame txn time.
Station generating only 1 frame in vulnerable time

Note

The throughput ( S) for pure ALOHA is


S = G × e −2G .
The maximum throughput
Smax = 0.184 when G= (1/2).
G = Average number of frames generated by the system (all stations)
during one frame transmission time
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?

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

per millisecond, then G = 1. In this case S = G × e−2G =


0.135 (13.5 percent). This means that the throughput is
1000 × 0.135 = 135 frames. Only 135 frames out of 1000
12.17
Example 12.3 (continued)
b. If the system creates 500 frames per second, or 1/2 frames

per millisecond, then G = 1/2. In this case S = G × e −2G


= 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, percentage-wise.

c. If the system creates 250 frames per second, or 1/4


frames per millisecond, then G = 1/4. In this case S =
G × e−2G = 0.152 (15.2 percent). This means that the
throughput is 250 × 0.152 = 38. Only 38 frames out of

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

The throughput for slotted ALOHA is


S = G × e−G .
The maximum throughput
Smax = 0.368 when G = 1.
Example 12.4
A slotted ALOHA network transmits 200-bit frames using a
shared channel with a 200-kbps bandwidth. Find 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
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)

0.5 1.0 1.5 2.0


G = offered load rate= new frames+ retransmitted
= Total frames presented to the link per
the transmission time of a single frame
12.1.2 CSMA

• To minimize the chance of collision and, therefore,


increase the performance, the CSMA method was
developed.

• The chance of collision can be reduced if a station


senses the medium before trying to use it.

• Carrier sense multiple access (CSMA) requires that


each station first listen to the medium (or check
the state of the medium) before sending. In other
words, CSMA is based on the principle “sense
before transmit” or “listen before talk.”
12.26
Random Access – Carrier Sense Multiple Access
(CSMA)
 To improve performance, avoid transmissions that are certain to cause
collisions
 Based on the fact that in LAN propagation time is very small
  If a frame was sent by a station, All stations knows immediately so they
can wait before start sending
  A station with frames to be sent, should sense the medium for the
presence of another transmission (carrier) before it starts its own
transmission
 This can reduce the possibility of collision but it cannot eliminate it.
 Collision can only happen when more than one station begin transmitting
within a short time (the propagation time period)
Figure 12.7: Space/time model of a collision in CSMA

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

The CSMA method does not specify the procedure


following a collision. Carrier sense multiple access
with collision detection (CSMA/CD) augments the
algorithm to handle the collision.

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, however,
there is a collision, the frame is sent again.

12.35
CSMA/CD (Collision
Detection)
 CSMA (all previous methods) has an inefficiency:
 If a collision has occurred, the channel is unstable until

colliding packets have been fully transmitted


 CSMA/CD (Carrier Sense Multiple Access with Collision
Detection) overcomes this as follows:
 While transmitting, the sender is listening to medium for

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

Minimum Frame size?


12.38
Minimum Frame Size
 For CSMA/CD to work
 Restriction in Frame size
 Before sending last bit of frame
 Sending station must detect a collision
(if any)
 Abort the transmission
 Once frame is sent, does not keep
copy of frame and does not monitor
the line for collision detection
12.39
Frame Transmission
Time
 Must be atleast 2 times the
maximum propagation time

 Worst cast scenario


 Effect of collision takes another Tp time
 Requirement is to keep transmitting
after 2Tp

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

then it should do the following:


 Abort transmission and
 Transmit a jam signal (48 bit) to notify other stations of collision
so that they will discard the transmitted frame also to make sure
that the collision signal will stay until detected by the furthest
station
 After sending the jam signal, backoff (wait) for a random amount
of time, then
 Transmit the frame again
 Frame transmission time should be at least as long as the
time needed to detect a collision (2 * maximum propagation
delay
e 12.15 Energy level during transmission, idleness, or collision

3 levels of energy in channel

Zero, Normal (successfully captured), Abnormal

12.43
gure 12.14 Flow diagram for the CSMA/CD

Make sure all stations are aware


of collision
12.44
Exponential Backoff Algorithm
 Ethernet uses the exponential backoff algorithms to determine the
best duration of the random waiting period after the collision
happens
 Algorithm:
 After Kth collision, select a random number (R) between 0 and
2k –1 and wait for a period equal to (R*slot time) then retransmit
when the medium is idle, for example:

After first collision (K=1), select a number (R) between 0 and 2 1 –1
{0 ,1} and wait for a period equal to R*slot times (Wait for a period 0
usec or 1x51.2 usec) then retransmit when the medium is idle
 Do not increase random number range, if K=10

 Maximum interval {0 – 1023}
 Give up after 16 unsuccessful attempts and report failure to higher
layers
Exponential Backoff Algorithm
 Reduces the chance of two waiting stations picking the
same random waiting time
 When network traffic is light, it results in minimum
waiting time before transmission
 As congestion increases ( traffic is high), collisions
increase, stations backoff by larger amounts to reduce the
probability of collision.
 Exponential Back off algorithm gives last-in, first-out
effect
 Stations with no or few collisions will have the chance to transmit
before stations that have waited longer because of their previous
unsuccessful transmission attempts.
CSMA/CA Protocol
 Wired Network
 Received signal energy ~ sent signal energy
 Length of cable short
 Repeaters (PHY)
 Collision detected – OK!
 Wireless Network
 Received signal energy – lost in txn
 CD not effective
 basic principles of CSMA/CA are listen before
talk and contention
 IFS (Avoid collisions by deferring txns even if channel is
idle), Contention Window, Acknowledgements

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.

Contention window is an amount of time divided


12.48 into slots.
Note
In CSMA/CA, the IFS 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

Stations consult one another to


find which station has the right to
send.
A station cannot send unless it
has been authorized by other
stations.
Topics discussed in this section:
Reservation
Polling
Token Passing

12.54
Controlled Access or Scheduling

 Provides in order access to shared medium so that every


station has chance to transfer (fair protocol)

 Eliminates collision completely


 Three methods for controlled access:
 Reservation
 Polling
 Token Passing
12.2.1 Reservation

In the reservation method, a station needs to make


a reservation before sending data.

Time is divided into intervals.

In each interval, a reservation frame precedes the


data frames sent in that interval.

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

 Polling works with topologies in which


 one device is designated as a primary station and the other
devices are secondary stations.
 All data exchanges must be made through the primary
device even when the ultimate destination is a
secondary device.
 Primary device controls the link;
 Secondary devices follow its instructions.
 It is up to the primary device to determine which
device is allowed to use the channel at a given time.

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

primary wants to send


data primary wants to receive
data
12.61
12.2.3 Token Passing

In the token-passing method, the stations in a


network are organized in a logical ring.

For each station, there is a predecessor and a


successor.

The current station is the one which is accessing


the channel now

Right to access the channel – Passed from one


station to another – Special Packet – TOKEN
• WAIT until receive the token from Predecessor
• HOLD Token and send data ; Release : no more data
12.62
Figure 13.13 Token-passing procedure
Token Management
 Stations limited in time for possession
of token
 Monitor token to ensure it has not been
lost/destroyed
 Station holding token fails : token
disappears
 Assign Priorities to stations : type of data
being transmitted
 Token management : release token from
low-priority to high priority
12.64
gical ring and physical topology in token-passing access method

Whole system fails if medium bet fails!

Station sends token to it’s successor


; Token cannot be seen by other stations
; Address of next successor not needed
12.65
gical ring and physical topology in token-passing access method

Auxiliary Ring – reverse direction

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

lease the token – insert address of successor

12.67 Token Bus LAN

You might also like