Chapter 12
Chapter 12
Chapter 12
Media Access Control
(MAC)
Dr. Mznah Al-Rodhaan
Al Rodhaan
12.1
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.2
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12/12/2009
12.3
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.4
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12/12/2009
12.5
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12/12/2009
ALOHA Network
Developed at the Univ. of Hawaii
ACK
ACK
12.7
ACK
ACK
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
Pure Aloha
The node immediately transmits its frame completely
If the frame is collided it retransmits the frame again (after
completely
co
p e e y transmitting
a s
g its
s co
collided
ded frame)
a e) with the
ep
probability
obab y
p
12.8
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12/12/2009
12.9
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
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.
Now we can find the value of TB for different values of
K.
a. For K = 1, the range is {0, 1}. The station needs to|
generate a random number with a value of 0 or 1.
This
i
means that TB is either 0 ms (0 2) or 2 ms (1 2),
based on the outcome of the random variable.
12.10
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12/12/2009
12.11
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.12
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12/12/2009
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.13
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.14
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12/12/2009
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
per second b. 500 frames p
per second
a. 1000 frames p
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.
millisecond The load is 1.
1 In this case
S = G e2 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.15
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.16
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12/12/2009
12.17
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
Slotted Aloha
Assumptions
Frames are of the same size
time is divided into equal size slots
slots, time to transmit 1 frame
nodes start to transmit frames only at beginning of slots
nodes are synchronized
if 2 or more nodes transmit in slot, all nodes detect collision
Operation
when node obtains fresh frame
frame, it transmits in next slot
no collision, node can send new frame in next slot
if collision, node retransmits frame in each subsequent slot with
prob. p until success
12.18
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12/12/2009
12.19
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.20
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
10
12/12/2009
Slotted Aloha
Pros
single active node can
continuously transmit at full
rate of channel
highly decentralized: only
slots in nodes need to be in
sync
simple
12.21
Cons
collisions, wasting slots
idle slots
nodes may be able to
detect collision in less
time than to transmit
packet
clock synchronization
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
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
per second
a. 1000 frames p
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.
millisecond The load is 1.
1 In this case
G
S = G e
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.22
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
11
12/12/2009
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.23
ALOHA
12.24
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12
12/12/2009
CSMA:
CD (collision detection):
12.25
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
Area where
Cs signal exists
12.26
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
13
12/12/2009
CSMA
12.27
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.28
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
14
12/12/2009
12.29
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.30
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
15
12/12/2009
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.31
ALOHA
12.32
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
16
12/12/2009
12.33
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
Collision Detection
How the station detects a collision?
There are many collision detection methods!
M t off them
Most
th
are analog
l processes.
Examples:
detecting voltage level on the line
detecting power level
detecting simultaneous transmission & reception
12.34
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
17
12/12/2009
12.35
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.36
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
18
12/12/2009
12.37
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
Example 12.5
A network using CSMA/CD has a bandwidth of 10 Mbps. If the
maximum propagation time (including the delays in the devices and
ignoring the time needed to send a jamming signal, as we see later) is
25 6 s,
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
d t t the
detect
th collision.
lli i
Th minimum
The
i i
size
i off the
th frame
f
i 10 Mbps
is
Mb
51.2 s = 512 bits or 64 bytes. This is actually the minimum size of
the frame for Standard Ethernet.
12.38
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
19
12/12/2009
ALOHA
12.39
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.40
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
20
12/12/2009
CSMA/CA
12.41
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.42
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
21
12/12/2009
12.43
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
22
12/12/2009
12.45
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.46
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
23
12/12/2009
12.47
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12--3 CHANNELIZATION
12
Channelization is a multiple
multiple--access method in
which the available bandwidth of a link is
shared in time, frequency, or through code,
between different stations.
stations. In this section, we
discuss three channelization protocols
protocols..
Topics
p
discussed in this section:
Frequency-Division Multiple Access (FDMA)
Time-Division Multiple Access (TDMA)
Code-Division Multiple Access (CDMA)
12.48
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
24
12/12/2009
12.49
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.50
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
25
12/12/2009
12.51
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.52
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
26
12/12/2009
12.53
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.54
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
27
12/12/2009
12.55
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.56
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
28
12/12/2009
12.57
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.58
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
29
12/12/2009
12.59
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
12.60
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
30
12/12/2009
12.61
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
Example 12.6
Find the chips for a network with
a. Two stations
b. Four stations
Solution
We can use the rows of W2 and W4 in Figure 12.29:
a. For a two-station network, we have
[+1 +1]
and [+1 1].
b. For a four
four-station
station network we have
[+1 +1 +1 +1]
[+1 1 +1 1],
[+1 +1 1 1],
and [+1 1 1 +1].
12.62
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
31
12/12/2009
Example 12.7
What is the number of sequences if we have 90 stations in our
network?
Solution
The number of sequences needs to be 2m. We need to
choose m = 7 and N = 27 or 128. We can then use 90
of the sequences as the chips.
12.63
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
Example 12.8
Prove that a receiving station can get the data sent by a
specific sender if it multiplies the entire data on the
channel by the senders chip code and then divides it by
the number of stations.
Solution
Let us prove this for the first station, using our previous
four-station example. We can say that the data on the
channel
D = (d1 c1 + d2 c2 + d3 c3 + d4 c4).
The receiver which wants to get the data sent by station 1
multiplies these data by c1.
12.64
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
32
12/12/2009
12.65
Based on
th
Data Communications and Networking, 4 Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007
33