Medium Access Control in Networks
Medium Access Control in Networks
Access Control
Sublayer
CS2008-Computer Networks
(Dr. V. K. Jain ) 1
The Medium Access Control Sublayer
XP
CS2008-Computer Networks
(Dr. V. K. Jain ) 2
XP
Channel Allocation Problem
• Static channel allocation
• Dynamic channel allocation.
XP
Static Channel Allocation
❑ Traditionally capacity of the channel is
split among multiple competing users
(e.g., TDM or FDM).
❑ Example: FM radio stations.
CS2008-Computer Networks
(Dr. V. K. Jain ) 3
XP
Static Channel Allocation
❑ If the spectrum is cut up into N regions and
❑ Fewer than N users are currently interested in
communicating, a large piece of valuable
spectrum will be wasted.
❑ More than N users want to communicate
some of them will be denied permission for
lack of bandwidth.
❑ Dividing the channel into constant number
of users of static sub channels is inherently
inefficient.
XP
Static Channel Allocation
❑ A static allocation is poor fit to most
computer systems, in which data traffic is
extremely bursty:
❑ Peak traffic to mean traffic ratios of 1000:1
are common.
❑ Consequently most of the channels will be
idle most of the time.
CS2008-Computer Networks
(Dr. V. K. Jain ) 4
XP
Static Channel Allocation
❑ Example:
❑ Mean Time delay T seconds,
❑ Channel capacity C bps,
XP
Static Channel Allocation
❑ C = 100 Mbps,
❑ 1/m = 10,000 bits 1
❑ l = 5000 frames/sec
𝑇 =
𝜇𝐶 − l
❑ T = 200 msec
10
CS2008-Computer Networks
(Dr. V. K. Jain ) 5
XP
Static Channel Allocation
❑ Divide a single channel into N independent
channels:
❑ C/N = 100/N Mbps, 1
❑ 1/m = 10,000 bits 𝑇 =
𝑁 𝐶 l
𝜇 −
❑ l/N = 5000/N frames/sec 𝑁 𝑁
❑ TN = Nx200 msec
𝑁
= = NT
❑ For N=10 => TN = 2 msec.
𝜇𝐶 − l
11
XP
Assumptions for Dynamic Channel Allocation
❑ Before we get to the first of the many channel
allocation methods, it is worthwhile to carefully
formulate the allocation problem.
❑ Underlying all the work done in this area are the
following five key assumptions:
1. Independent traffic
2. Single channel
3. Observable Collisions
4. Continuous or slotted time
5. Carrier sense or no carrier sense
12
CS2008-Computer Networks
(Dr. V. K. Jain ) 6
XP
Assumptions for Dynamic Channel Allocation
❑ Independent Traffic:
❑ The model consists of N independent
stations.
❑ The expected number of frames generated in
an interval of length Δ𝑡 is 𝜆Δ𝑡. 𝜆 – is arrival
rate of new frames.
❑ Once the frame has been generated, the
station is blocked and does nothing until the
frame has been successfully transmitted.
13
XP
Assumptions for Dynamic Channel Allocation
❑ Single Channel:
❑ The single channel is available for all
communication.
❑ All stations can transmit on it and all can
receive from it.
❑ The stations are assumed to be equally
capable though protocols may assign them
different roles (i.e., priorities)
14
CS2008-Computer Networks
(Dr. V. K. Jain ) 7
XP
Assumptions for Dynamic Channel Allocation
❑ Observable Collisions:
❑ If two frames are transmitted simultaneously,
they overlap in time and the resulting signal is
garbled.
❑ This event is know as collision.
15
XP
Assumptions for Dynamic Channel Allocation
❑ Continuous or Slotted Time:
❑ Time may be assumed continuous. In which
case frame transmission can begin at any
instant.
❑ Alternatively, time may be slotted or divided into
discrete intervals (called slots).
❑ Frame transmission must then begin at the start
of a slot.
❑ A slot may contain 0, 1 or more frames,
corresponding to an idle slot, a successful
transmission, or collision, respectively.
16
CS2008-Computer Networks
(Dr. V. K. Jain ) 8
XP
Assumptions for Dynamic Channel Allocation
❑ Carrier Sense or No Carrier Sense:
❑ With the carrier sense assumption, stations
can tell if the channel is in use before trying to
use it.
❑ No station will attempt to use the channel while
it is sensed as busy.
❑ If there is no carrier sense, stations cannot
sense the channel before trying to use it.
❑ They will transmit then. Only later they can
determine whether the transmission was
successful.
17
XP
Multiple Access Protocols
❑ ALOHA
❑ Carrier Sense Multiple Access
❑ Collision-free protocols
❑ Limited-contention protocols
18
CS2008-Computer Networks
(Dr. V. K. Jain ) 9
ALOHA XP
❑ 1970 Hawaii
❑ Norman Abramson and colleagues have
enabled wireless communication between
users in a remote island to the central
computer in Honolulu.
❑ Two versions of the protocol now called
ALOHA:
❑ Pure ALOHA and
❑ Slotted ALOHA
19
XP
Pure ALOHA
❑ Each user is free to transmit whenever they have
data to be sent.
❑ There will be collisions
20
CS2008-Computer Networks
(Dr. V. K. Jain ) 10
XP
Pure ALOHA
❑ In other wired systems the sender might be
able to listen for collisions while transmitting.
❑ If the frame is destroyed, the sender just waits
a random amount of time and sends it again.
❑ Waiting time must be random or the sending
frames will collide over and over.
❑ Systems in which multiple users share a
common channel in a way that can lead to
conflicts are known as Contention Systems.
21
User
Collision
Collision Time
22
CS2008-Computer Networks
(Dr. V. K. Jain ) 11
Pure ALOHA XP
23
Pure ALOHA XP
24
CS2008-Computer Networks
(Dr. V. K. Jain ) 12
Pure ALOHA XP
25
XP
Pure ALOHA
❑ Under all loads the throughput S is just the offered
load, G, times the probability P0 of a transmission
succeeding:
𝑆 = 𝐺𝑃0
26
CS2008-Computer Networks
(Dr. V. K. Jain ) 13
ALOHA (2) XP
27
28
CS2008-Computer Networks
(Dr. V. K. Jain ) 14
Pure ALOHA XP
𝑆 = 𝐺𝑒 −2𝐺 .
29
Pure ALOHA XP
30
CS2008-Computer Networks
(Dr. V. K. Jain ) 15
ALOHA (3) XP
31
32
CS2008-Computer Networks
(Dr. V. K. Jain ) 16
Pure ALOHA Example XP
33
34
CS2008-Computer Networks
(Dr. V. K. Jain ) 17
Pure ALOHA Example XP
25 Dr Salman Ali
AlQahtani
Example 2: Solution
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−2 G or
S = 0.184 (18.4 percent). This means that the throughput is
500 × 0.184 = 92 frames 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−2 G or
S = 0.152 (15.2 percent). This means that the throughput is
250 × 0.152 = 38 frames and that only 38 frames out of 250
will probably survive.
35
Slotted ALOHA XP
❑ Synchronization is required:
❑ One special station emit a pip at the start of
each interval, like clock.
36
CS2008-Computer Networks
(Dr. V. K. Jain ) 18
Slotted ALOHA XP
37
Slotted ALOHA XP
Node 1
Packet Nodes 2 & 3
Packets
No Retransmission Retransmission
transmission
1 2 3 2 3
Time
Slot Collision
38
CS2008-Computer Networks
(Dr. V. K. Jain ) 19
Frames in a slotted ALOHA network XP
28 Dr Salman Ali
AlQahtani
39
XP
Vulnerable time for slotted ALOHA protocol
29 Dr Salman Ali
AlQahtani
40
CS2008-Computer Networks
(Dr. V. K. Jain ) 20
Slotted ALOHA XP
❑ Slotted ALOHA
❑ peaks at the G = 1
❑ Throughput S = 1/e = 0.367 or 37%.
❑ 26% collisions.
41
42
CS2008-Computer Networks
(Dr. V. K. Jain ) 21
Slotted ALOHA Example XP
25 Dr Salman Ali
AlQahtani
Example 2: Solution
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. (18.4 percent). This means that the throughput is 500
× 0.184 = 92 frames 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−G or
S = 0.195 (19.5 percent). This means that the throughput is
250 × 0.195 = 49 frames and that only 49 frames out of 250
will probably survive.
43
0.5
pure - ALOHA : S = Ge - 2 G
Vulnerable period
for slotted ALOHA slotted - ALOHA : S = Ge - G
0.4 0.368
Throughput
P P
S: Throughput
0.3
Slotted Aloha
Time 2P 0.184
0.2
G=gT
44
CS2008-Computer Networks
(Dr. V. K. Jain ) 22
Carrier Sense Multiple Access Protocols XP
34 Dr Salman Ali
AlQahtani
❑ We have seen that maximum throughputs of
pure and slotted ALOHA protocols, are equal to
0.184 and 0.368, respectively.
❑ We need to find another way of improving
throughputs and supporting high-speed
communication networks.
❑ We could achieve better throughput if we can
prevent potential collision in a shared channel
by simply listening to the channel before
transmitting a packet.
45
46
CS2008-Computer Networks
(Dr. V. K. Jain ) 23
Carrier Sense Multiple Access(CSMA) Protocols
XP
34 Dr Salman Ali
❑ C SMA gives improved throughput comparedAlQahtani to Aloha
protocols
❑ C SMA protocols are based on the fact that each terminal on
the network is able to monitor the status of the channel before
transmitting information.
❑ Listens to the channel before transmitting a packet (avoid
avoidable collisions)
❑ I n CSMA, detection delay and propagation delay are
two important parameters.
❑ Detection delay is the time required for a terminal to sense whether or
not the channel is idle.
❑ Propagation delay is a relative measure of how fast it takes for a packet
to travel from a source station to a destination station.
47
48
CS2008-Computer Networks
(Dr. V. K. Jain ) 24
Persistent and Non-persistent CSMA XP
49
50
CS2008-Computer Networks
(Dr. V. K. Jain ) 25
Persistent and Non-persistent CSMAXP
❑ Non-persistent CSMA - In this protocol
the transmitting stations are less greedy.
❑ The transmitting station will send the packet if
the channel is found to be idle.
❑ However, if the channel is already in use the
station does not continuously sense it for
transmission. Instead it waits a random
amount of time and then repeats the
algorithm.
51
1 2 3 4 5 Time
Delay for MS 4 Collision
MS 4 senses
52
CS2008-Computer Networks
(Dr. V. K. Jain ) 26
Persistent and Non-persistent CSMAXP
❑ P-persistent CSMA.
❑ The transmitting station will send the packet if
the channel is found to be idle with a
probability of p (q = 1-p; it defers that action
until the next slot).
❑ If the slot is still empty it does or not transmit
with the probability of p and q respectively.
❑ If the channel in use the station will treat this
as being a collision (waits random amount of
time)
53
54
CS2008-Computer Networks
(Dr. V. K. Jain ) 27
CSMA/CD (CSMA with Collision Detection) XP
55
56
CS2008-Computer Networks
(Dr. V. K. Jain ) 28
CSMA/CD (CSMA with Collision Detection) XP
57
58
CS2008-Computer Networks
(Dr. V. K. Jain ) 29
CSMA/CD (CSMA with Collision Detection) XP
59
CSMA/CD (Cont’d) XP
T0 A begins transmission
A B
60
CS2008-Computer Networks
(Dr. V. K. Jain ) 30
CSMA/CD (CSMA with Collision Detection) XP
61
XP
Collision-Free Protocols
❑ In CSMA/CD collisions do not occur once
the station has unambiguously captured
the channel, but they still occur during the
contention period.
❑ These collisions adversely affect the
system performance (e.g., bandwidth-
delay product is large – long cable that
has a large propagation delay and
frames are short).
62
CS2008-Computer Networks
(Dr. V. K. Jain ) 31
Collision-Free Protocols XP
❑ Teleconferencing, etc.
63
Collision-Free Protocols XP
64
CS2008-Computer Networks
(Dr. V. K. Jain ) 32
Basic Bit-Map Protocol XP
65
66
CS2008-Computer Networks
(Dr. V. K. Jain ) 33
Collision-Free Protocols (1) XP
67
XP
Bit-Map Protocol
❑ Protocols that broadcast their intention before that
actually transmission are called reservation protocols.
❑ Low-load conditions:
❑ Average wait conditions for low-numbered stations:
➢ N/2 slots for current scan to finish, and
➢ N slots for the following scan to run to completion before it
may begin transmitting.
➢ 1.5N slots wait time.
❑ Average wait conditions for high-numbered stations:
➢ 0.5N slots wait time.
❑ Mean of all stations is N times.
68
CS2008-Computer Networks
(Dr. V. K. Jain ) 34
Bit-Map Protocol XP
❑ Efficiency:
❑ Overhead bits N 𝑑
❑ Data bits d 𝑑+𝑁
❑ High-load
❑ N bit contention period is prorated over N frames,
yielding an overhead of only 1 bit per frame:
❑ Efficiency: 𝑑
𝑑+1
❑ Mean delay for a frame:
❑ Sum of the time it queues inside the station +
69
XP
Token Passing
❑ The essence of the bit-map protocol is that it lets every
station transmit a frame in turn in a predefined order.
❑ Another way to accomplish the same thing is to pass a
small message called token form one station to the next
in the same predefined order.
❑ The token represents permission to send.
❑ If a station has a frame queued for transmission when it
receives the token, it can send that frame before it passes
the token to the next station.
❑ If it has no queued frame, it simply passes the token.
❑ In a token ring protocol, the topology of the network is
used to define the order in which stations send.
70
CS2008-Computer Networks
(Dr. V. K. Jain ) 35
Collision-Free Protocols (2) XP
Token
Station
Direction of
transmission
Token ring.
71
XP
Token Passing
❑ To stop the frame circulating indefinitely (like the
token), one has to pay attention to remove the frame
from the ring.
❑ Typically it will be removed by the receiving station
and/or sending station.
❑ We do not need a physical ring to implement token
passing.
❑ The channel connecting the stations might instead be a
single long bus.
❑ Token Ring or Token Bus protocols work the same
way.
72
CS2008-Computer Networks
(Dr. V. K. Jain ) 36
XP
Token Passing
❑ The performance of token passing is similar to that of
the bit-map protocol, though the contention slots and
frames of one cycle are now intermingled.
❑ After sending a frame, each station must wait for all N
stations (including itself) to send the token to their
neighbors and the other N − 1 stations to send a frame,
if they have one.
❑ A subtle difference is that, since all positions in the
cycle are equivalent, there is no bias for low- or high-
numbered stations.
73
Binary Countdown XP
74
CS2008-Computer Networks
(Dr. V. K. Jain ) 37
XP
Binary Countdown
❑ Arbitration rule: As soon as a station sees that a high-
ordered bit position that is 0 in its address has been
overwritten with 1 it gives up.
❑ Example:
❑ If stations 0010, 0100, 1001, and 1010 are all trying
to get the channel, in the first bit time the stations
transmit 0, 0, 1, and 1, respectively.
❑ They are OR-ed together to get 1.
75
XP
Binary Countdown
❑ The next bit is 0 so both stations continue.
❑ The next bit is 1 so the station 1001 gives up and
station 1010 wins the bidding.
❑ This gives it a right to transmit the frame, after
which a new cycle starts.
76
CS2008-Computer Networks
(Dr. V. K. Jain ) 38
Binary Countdown XP
77
Limited-Contention Protocols XP
78
CS2008-Computer Networks
(Dr. V. K. Jain ) 39
XP
Limited-Contention Protocols
❑ Contention (Pure or Slotted ALOHA) protocols
are preferred under
❑ The low load conditions:
➢ Low delay and
➢ practically collision free.
❑ But, the high load conditions:
➢ High Delay due to High number of collisions or contentions
79
Limited-Contention Protocols XP
80
CS2008-Computer Networks
(Dr. V. K. Jain ) 40
Limited-Contention Protocols XP
81
Limited-Contention Protocols XP
82
CS2008-Computer Networks
(Dr. V. K. Jain ) 41
Limited-Contention Protocols XP
83
XP
Limited-Contention Protocols
❑ From the figure in previous slide it is fairly obvious that
probability that some stations will acquire the channel
can be increased only by decreasing the amount of
competition.
❑ The limited contention protocols do just that by:
1. Dividing the stations into (not necessarily disjoint) groups.
2. Only the members of group 0 are permitted to compete
for slot 0.
3. If one of them succeeds, it acquires the channel and
transmits its frame.
4. If there is a collision the members of the group 1 contend
for slot 1. etc.
84
CS2008-Computer Networks
(Dr. V. K. Jain ) 42
Limited-Contention Protocols XP
85
XP
Limited-Contention Protocols
❑ If more stations are assigned to the same slot, the
probability of a collision grows, but the length of the
bit-map needed to give everyone a chance shrinks.
❑ The limiting case is a single group containing all
stations (i.e., slotted ALOHA).
❑ We need a way to assign station slots dynamically:
➢ Many stations per slot when the load is low, and
➢ Few (or just one) station per slot when the load is high.
86
CS2008-Computer Networks
(Dr. V. K. Jain ) 43
The Adaptive Tree Walk Protocol XP
❑ One particularly simple way of performing the
necessary assignment is to use the algorithm devised
by the U.S. Army for testing soldiers for syphilis during
World War II (Dorfman, 1943) :
❑ Blood samples from N soldiers
87
88
CS2008-Computer Networks
(Dr. V. K. Jain ) 44
The Adaptive Tree Walk Protocol XP
❑ In the first contention slot following the successful
transmission, slot 0, all stations were permitted to try to
acquire the channel.
❑ If there is a collision then during slot 1 only those
stations falling under node 2 in the tree (previous slide)
may compete.
❑ If one of them acquires the channel the slot following
the frame (i.e., slot 2 ) is reserved for those stations
under node 3.
❑ If on the other hand two or more stations under node 2
want to transmit, there will be a collision during slot 1, in
which case it is node 4’s turn during slot 2.
89
90
CS2008-Computer Networks
(Dr. V. K. Jain ) 45
The Adaptive Tree Walk Protocol XP
❑ When a load on the system is high it is
not worth to dedicate slot 0 to node 1.
❑ Similarly one would argue that nodes 2
and 3 should be skipped.
❑ In general the question is at what level in
the tree should we began the search?
❑ Heavier load the farther down the tree the
search should begin.
91
92
CS2008-Computer Networks
(Dr. V. K. Jain ) 46
The Adaptive Tree Walk Protocol XP
❑ If the q ready stations are uniformly
distributed.
❑ Expected number of the stations below a
specific node at level i is just 2-iq
❑ Optimal number of contending station per
slot should be 1 and hence 2-iq = 1.
❑ Solving this equation, we find:
𝑖 = 𝑙𝑜𝑔2 𝑞
93
94
CS2008-Computer Networks
(Dr. V. K. Jain ) 47
The Adaptive Tree Walk Protocol XP
❑ Numerous improvements to the basic algorithm have
been discovered by Bertsekas and Gallager (1992).
❑ For example, consider the case of stations G and H
being the only ones wanting to transmit.
❑ At node 1 a collision will occur, so 2 will be tried and
discovered idle.
❑ It is pointless to probe node 3 since it is guaranteed to
have a collision (we know that two or more stations
under 1 are ready and none of them are under 2, so
they must all be under 3).
❑ The probe of 3 can be skipped and 6 tried next. When
this probe also turns up nothing, 7 can be skipped and
node G tried next.
95
XP
Wireless LAN Protocols
❑ A system of laptop computers that
communicate by radio – wireless LAN.
❑ It also has somewhat different properties
than a wired LAN.
❑ Leads to different MAC protocols.
96
CS2008-Computer Networks
(Dr. V. K. Jain ) 48
XP
Wireless LAN Protocols
❑ Common configuration of wireless
LAN:
❑ Office Building with Access Points (APs)
❑ APs Strategically placed
97
98
CS2008-Computer Networks
(Dr. V. K. Jain ) 49
Wireless LAN Protocols XP
99
XP
Wireless LAN Protocols
❑ Additional, and even more important,
difference between wireless LAN and
wired LAN:
❑ Wireless LAN: A station may not be able to
transmit or receive frames to or from all other
stations due to limited radio range.
❑ Wired LAN: Once the one station sends a
frame, all other stations receive it.
100
CS2008-Computer Networks
(Dr. V. K. Jain ) 50
Wireless LAN Protocols XP
❑ Simplifying assumptions:
❑ Each radio transmitter has some fixed range.
❑ Its range is represented by an ideal circular
coverage region
❑ within that region station can sense and
receive the station’s transmission.
101
❑ Naïve approach:
❑ Use CSMA:
➢Just listen for other transmissions.
➢If none is doing it then transmit.
❑ Problem:
➢What matters for reception is interference at the
receiver and not at the sender.
102
CS2008-Computer Networks
(Dr. V. K. Jain ) 51
Wireless LAN Protocols (1) XP
103
104
CS2008-Computer Networks
(Dr. V. K. Jain ) 52
Wireless LAN Protocols XP
105
106
CS2008-Computer Networks
(Dr. V. K. Jain ) 53
Wireless LAN Protocols XP
108
109
CS2008-Computer Networks
(Dr. V. K. Jain ) 54
Wireless LAN Protocols XP
110
RTS/CTS handshake… XP
111
CS2008-Computer Networks
(Dr. V. K. Jain ) 55
RTS/CTS failure… XP
112
RTS/CTS failure…2 XP
113
CS2008-Computer Networks
(Dr. V. K. Jain ) 56