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

10 - MAC Layer 1

The document discusses medium access control (MAC) sublayer protocols for broadcast channels. It describes the key issues in determining which station gets to use a shared broadcast channel when multiple stations want to transmit. It then summarizes the ALOHA and slotted ALOHA random access protocols, analyzing their throughput efficiency. Specifically, pure ALOHA has a maximum efficiency of 18% while slotted ALOHA doubles this to 37% by imposing time slots.

Uploaded by

pranjalcracku
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)
39 views

10 - MAC Layer 1

The document discusses medium access control (MAC) sublayer protocols for broadcast channels. It describes the key issues in determining which station gets to use a shared broadcast channel when multiple stations want to transmit. It then summarizes the ALOHA and slotted ALOHA random access protocols, analyzing their throughput efficiency. Specifically, pure ALOHA has a maximum efficiency of 18% while slotted ALOHA doubles this to 37% by imposing time slots.

Uploaded by

pranjalcracku
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/ 45

The Medium Access Control

Sublayer
Sachin Gajjar
sachin.gajjar@nirmauni.ac.in
Reading Material for this topic
• Computer Networks, Fourth Edition by
Andrew S Tanenbaum
– Chapter 4, Topic 4.1, 4.2.1, 4.2.2, 4.2.6

2
Network categories:
1. Those using point-to-point channels
2. Those using broadcast channels
• In broadcast network, key issue is to determine who
gets to use channel when there is competition for it.
• Broadcast channels = multiaccess channels
• Eg. conference call – chaos in who goes next
• Eg. Face to face meeting – raise hands when you want
to speak
• protocols used to determine who goes next on a
multiaccess channel belong to a sublayer of data link
layer called MAC (Medium Access Control) sublayer
Static Channel Allocation in LANs and MANs
• Static channel – FDM
• N users BW divided into N equal size portion
• All users may not access channel – a waste
• More than N users want to communicate some
may be denied due to lack of BW
• OK for small fixed no. users with heavy load
• When users more and traffic bursty – not ok
• computer systems peak : mean traffic = 1000:1
• Channel idle for most of time
• Same for TDM – user may not use allotted time
Dynamic Channel Allocation in LANs and MANs
• Key assumptions
• Station Model
• Consists of N independent stations, each
generates frames for transmission.
• Once a frame has been generated, station is
blocked and does nothing until the frame has
been successfully transmitted
• Single Channel Assumption
• Single channel is available for all communication
• All stations can transmit on it and all can receive
from it.
• Hardware at all stations are equivalent,
• Protocol software may assign priorities to them.
• Collision Assumption.
• If 2 frames are transmitted simultaneously, they
overlap in time and resulting signal is garbled.
• This event is called a collision.
• All stations can detect collisions.
• A collided frame must be transmitted again later.
• There are no errors other than those generated
by collisions.
• Carrier = electrical signal on cable
• Continuous Time. Frame transmission can begin at any
instant. No master clock dividing time into discrete
intervals.
• Slotted Time. Time is divided into discrete intervals
(slots). Frame transmissions always begin at start of a
slot. A slot may contain 0, 1, or more frames,
corresponding to an idle slot, a successful transmission,
or a collision, respectively.
• Carrier Sense. Stations can tell if channel is in use before
trying to use it. If channel is sensed as busy, no station
will attempt to use it until it goes idle.
• No Carrier Sense. Stations cannot sense channel before
trying to use it. They just go ahead and transmit. Only
later can they determine whether transmission was
successful.
Multiple Access Protocols
• ALOHA
• In 1970s, Norman Abramson, University of
Hawaii devised method to solve channel
allocation problem.
• Work used ground-based radio broadcasting
• Basic idea is applicable to any system in which
uncoordinated users are competing for use of
a single shared channel.
• Two versions of ALOHA here: pure and slotted.
Pure ALOHA
• Let users transmit whenever they have data to be sent.
• There will be collisions, colliding frames will be damaged.
• Due to feedback property of broadcasting, sender can
always find out whether its frame was destroyed by
listening to channel
• If listening while transmitting is not possible for some
reason, acknowledgements are needed.
• If frame was destroyed, sender just waits a random
amount of time and sends it again.
• Waiting time must be random or same frames will collide
over and over, in lockstep.
Frame generation in an ALOHA system
• Frames of same length
Efficiency of an ALOHA channel
• Frame time = amount of time needed to transmit
standard, fixed-length frame
• Frame time = Frame length/bit rate
• Infinite number of users generates new frames
according to Poisson’s distribution with average N
frames per frame time
• If N > 1, users generating frames at a higher rate
than channel can handle and most frames will
suffer a collision
• To reduce collision we would expect 0 < N < 1
• In addition to new frames, stations also generate retransmissions
of frames that previously suffered collisions.
• Let there be k transmission attempts (including retransmissions)
per frame time.
• The probability of k transmissions per frame time is also
Poisson.
• Let the mean of these transmissions be G per frame time.
• Clearly, G ≥N (old (duplicate) and new frames will be more than
new frames)
• At low load (N≈0), few collisions, few retransmissions, so G ≈ N.
• At high load there will be many collisions, so G > N
• For all loads, Throughput per frame time = S = G x Probability
that a frame doesn't suffer collision = GP0
• We find P0
Vulnerable time for the shaded frame

• What is the condition for shaded frame to arrive


undamaged without collision? (for finding P0)
• t = time required to send a frame
• If any other user has generated a frame
between time t0 and t0 + t, end of that frame
will collides with beginning of shaded one
• any other frame started between t0 + t and t0
+ 2t, beginning of that frame will collide with
end of shaded frame
• Vulnerable period = t0 + 2t - t0 = 2t
Generalized Poisson Distribution for frame
generation
• Probability that k frames are generated during
time t is given by Poisson distribution
• P[k]=[Gk e-G]/k!
• Probability of generating zero frames i.e. k= 0
(when 0 frame generated no collision and so no
frame damaged)
• P[k]=[G0 e-G]/0!
• P[k]= e-G (i.e 0!=1)
Poisson Distribution for frame generation during
vulnerable period
• If interval is two frame time long (2t, vulnerable
period), mean number of frames generated will
be 2G (t-> G frames, 2t->2G frames)
• Probability of generating zero frames i.e. k= 0
during 2t (no collision and so no frame damaged
when 0 frame generated)
• P0=[(2G)0 e -2G]/0!
• P0 = e -2G
• Using S = GP0,
• Throughput per frame time = S=G e -2G
Offered traffic (G) and throughput (S)
Pure ALOHA
• maximum throughput (S) occurs at G = 0.5,
S=G e -2G

• e = constant=2.71828
• We get efficiency of 18 percent in Pure Aloha
Example
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 t = frame length/bit rate
= 200 bits/200 kbps = 1 ms.
Vulnerable time = 2t = 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 one 1-ms period that this station is
sending.
Example
A pure ALOHA network transmits 200-bit frames on a
shared channel of 200 kbps. What is the throughput in
terms of number of frames/percentage if 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 = 200 (frame length)/200 kbps (bit
rate)=1 ms.
a. If system creates 1000 frames per second, this is 1
frame per millisecond. The load offered by system i.e G
is 1. Thus S = G× e−2 G or S = 1 × e−2*1 = 1/(2.71828)2=0.135
(13.5 percent). From 100 frames 13.5 will not collide, how many
from 1000 frames will be successfully transmitted without collision.
Throughput = 1000 × 13.5/100 = 135 frames. Only 135 frames out
of 1000 will probably survive.
Example 12.3 (continued)
b. If 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.23
Slotted ALOHA
• In 1972, Roberts published a method for doubling
efficiency of an ALOHA system
• Divide time into discrete intervals, each interval
corresponding to one frame
• All users are to agree on slot boundaries.
• For synchronization one special station transmit a
signal at the start of each interval, like a clock.
• User is not permitted to send whenever he wants
• it is required to wait for beginning of the next slot
• If misses to start at start of slot wait for begin of
next slot
Frames in a slotted ALOHA network
Vulnerable time for slotted ALOHA protocol

t0 t0 + t t0+2 t
=t
• If interval is one frame time long (t, vulnerable
period), mean number of frames generated
will be G (transmission attempts)
• Probability of generating zero frames i.e. k= 0
during t (when 0 frame generated no collision
and so no frame damaged)
• P0=[(G)0 e -G]/0!
• P0 = e -G
• Using S = GP0,
• S=G e -G
offered traffic (G) and throughput (S)
Slotted ALOHA
• maximum throughput (S) occurs at G = 1,
S=G e -G
S=1/e-1
• e = constant=2.71828
S = 1/2.71828 = 0.3678
• We get efficiency of 37 percent in Slotted
Aloha, twice that of pure ALOHA.
Carrier Sense Multiple Access Protocols
• In LAN, it is possible for stations to detect
what other stations are doing, and adapt their
behavior accordingly.
• Protocols in which stations listen for a carrier
(i.e., a transmission) and act accordingly are
called carrier sense protocols.
• CSMA is based on the principle "sense before
transmit" or "listen before talk”
Persistence Methods

• What should a station do if channel is busy?


• What should a station do if channel is idle?
• Three methods have been devised to answer
these questions: 1-persistent method,
nonpersistent method, p-persistent method.
1-Persistent CSMA
• When a station has data to send, it first listens to channel to see if
anyone else is transmitting
• If channel is busy, station continuously senses it waiting for it to
becomes idle
• When station detects an idle channel, it transmits a frame (with
probability 1)
• If a collision occurs, station waits a random amount of time and
starts all over again.
• Has highest chance of collision because two or more stations may
find channel idle and send their frames immediately
Role of propagation delay in CSMA
• propagation delay has an important effect on
performance CSMA
• just after a station begins sending, another station
becomes ready to send and sense the channel.
• If first station's signal has not yet reached second one,
latter will sense an idle channel and will also begin
sending, resulting in a collision.
• longer propagation delay, more important this effect
becomes, and worse the performance of the protocol
• Even if propagation delay is zero, two stations become
ready in middle of a third station's transmission, both
will wait until transmission ends and then both will
begin transmitting exactly simultaneously, resulting in a
collision
Vulnerable time in CSMA = Propagation time

longer propagation delay, more important this effect becomes, and worse is the
performance of the protocol
nonpersistent CSMA
• attempt is made to be less greedy
• Before sending, a station senses the channel.
• If no one else is sending, the station begins doing so itself.
• However, if channel is already in use, station does not continually
sense it for purpose of seizing it immediately upon detecting end of
previous transmission.
• Instead, it waits a random period of time and then repeats the
algorithm.
• Consequently, this algorithm leads to better channel utilization but
longer delays than 1-persistent CSMA
p-persistent CSMA
• Used if channel has time slots with a slot duration ≥
maximum propagation time
• When a station becomes ready to send, it senses the
channel.
• If station finds channel idle it follows these steps:

• If station initially senses the channel busy, it waits


until the next slot and applies the above algorithm.
Flow diagram of p-persistence method
Behavior of three persistence methods
computed throughput versus offered traffic
CSMA with Collision Detection
• Augmentation to handle collision
• station monitors channel after it sends a
frame to see if transmission was successful
• If so, the station is finished.
• If, there is a collision, the frame is sent again.
• stations to abort their transmissions as soon
as they detect a collision
• widely used on LANs in the MAC sublayer.
• Ethernet LAN uses it
Collision Detection
• station's hardware must listen to the channel while it is
transmitting.
• If what it reads back is different from what it is putting out, it
knows that a collision is occurring.
• Signal encoding must allow collisions to be detected (e.g., a
collision of two 0-volt signals cannot be detected, 1 = 5 V, 0=0
V is better).
• a sending station must continually monitor the channel,
listening for noise bursts that might indicate a collision.
Collision Detection
• Collisions can be detected by looking at power or pulse
width of received signal and comparing it to transmitted
signal
• After station detects a collision, it aborts its transmission,
waits a random period of time, and then tries again

Power level
Minimum Frame Size
• If two stations involved in a collision are maximum distance apart,
signal from first takes time Tp (propagation time) to reach second
• Effect of collision takes another time Tp to reach the first
• So requirement is that first station must still be transmitting after
2Tp (i.e. active to know collision has occurred)

Tp (Message)

Tp (Collision)
Example
A network using CSMA/CD has a bandwidth of 10 Mbps.
If maximum propagation time (including the delays in the
devices) is 25.6 μs, what is minimum size of frame?

Solution
• The frame transmission time is Tfr = 2 × Tp = 51.2
μs.
• This means, in worst case, a station needs to
transmit for a period of 51.2 μs to detect collision.
• Transmission time=Message size/BW
• Minimum size of frame = 10 Mbps × 51.2 μs = 512
bits or 64 bytes
• This is frame size of Ethernet
CSMA/CD
procedure
Thank You!

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy