2. 2
Local Area Networks and
Medium Access Control Protocols
• A local area network (LAN) is a data communication system that allows a
number of independent devices to communicate directly with each other in
a limited geographic area.
Area diameter · few km
Data rate = several Mbps
Owned by a single organization
• LANs are broadcast networks. A single transmission medium is shared by a
community of users. All information is received by all users. LANs are also
called multiple access networks (with low-cost and simplicity).
• The medium access control (MAC) protocols are to coordinate the access
to the channel so that information gets through from a source to a
destination in the same broadcast network.
3. Other layers
Network
Physical
Logical link control (LLC)
Media access control (MAC)
Project 802
Other layers
Network
Data link
Physical
OSI model
3
• In 1985, the Computer Society of the IEEE started a project, called
Project 802, to set up standards so that LAN equipments
manufactured by different companies is compatible.
• Project 802 divides the data link layer into sub-layers:
• Logical link control (LLC)
• Media access Control
• LAN compared with the OSI model
4. 4
• The LLC is the upper sublayer and is same for all LANs. Its functions
include error detection and retransmission.
• The MAC sublayer coordinates the data link tasks within a specific
LAN.
• The MAC sublayer is manufacturer-specific and dependent on the
LAN type.
• For LANs specified by project 802 are following:
• Ethernet (802.3)
• Token bus (802.4)
• Token ring (802.5)
• Wireless LANs (802.11)
5. 5
Sharing a transmission medium
• Static sharing (channelization schemes) is a collision-free sharing
• Dynamic sharing (MAC schemes) minimizes the incidence of
collision
Medium sharing techniques
Static channelization Dynamic medium access control
scheduling Random access
• Random access methods constitute the first major class of MAC
procedures
6. 6
ALOHA random access scheme
• It was developed at the University of Hawaii in the early 1970s to
connect computers situated on different Hawaiian islands. The
computers of the ALOHA network transmit on the same radio channel
whenever they have a packet to transmit. From time-to-time packet
transmission will collide, but these can be treated as transmission
errors, and recovery can take place by retransmission. When traffic is
very light, the probability of collision is very small, and so
retransmissions need to be carried out infrequently.
• ALOHA scheme requires stations to use a random retransmission
time. (This randomization is intended to spread out the retransmission
and reduces the likelihood of additional collisions between stations. )
• ALOHA is the father of multiple access protocols.
7. 7
Pure ALOHA (unslotted ALOHA):
1. Protocol
● A user transmits whenever it has packets to transmit
● When two or more packet transmissions overlap in time, a
collision occurs and all the packets involved in the collision are
destroyed. (non-capture)
● If ACK not received within timeout, then a user picks random
backoff time (to avoid repeated collision)
● User retransmits packet after backoff time
t
t0t0-X t0+X t0+X+2tprop
t0+X+2tprop + B
Time-out
Backoff period B
First transmission Retransmission
8. 8
Analysis (Throughput and delay)
1. Definitions and assumptions
1. X: packet transmission time (assume constant)
2. S: throughput (average # successful packet transmissions per X seconds)
3. G: load (average # transmission attempts per X sec)
4. Traffic traffic (new arrivals + retransmissions) is a Poisson process with
rate G packet/slot
Xt 0 0t Xt 0
Vulnerable
period
2. The probability of a successful transmission is the probability
that they are no additional packet transmission in the vulnerable
period.
10. 10
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
0.2
0
0.0078125
0.015625
0.03125
0.0625
0.125
0.25
0.5 1 2 4
G
S
Throughput S versus load G for pure ALOHA
184.02/1 e
S reaches a peak value of 1/2e at G=0.5, and then declines back toward
0. For a given value of S, say, S=0.05, there are two associated values
of G.
For small G, S ¼ G.
For large G, there are many backlogged users.
ALOHA system cannot achieve throughput higher than 18.4 percent
(1/2e).
11. 11
The average (delay) number of transmission attempts/packet is
G/S=e2G attempts per packet
The avergae number of unsuccessful attempts per packet is
=G/S-1=e2G-1
The first transmission requires X+tprop seconds, and each
subsequent retransmission requires 2tprop+X+B, where B is the
average backoff time and tprop is the one way propagation delay.
Thus the average packet transmission time is approximately given
by
E[Taloha]=X+tprop+(e2G-1)(X+2tprop+B)
Express delay in multiples of X
E[Taloha]/X=1+a+(e2G-1)(1+2a+B/X)
Where a=tprop/X is the one way normalized propagation delay. If the
backoff time is uniformly distributed between 1 and K packet
transmission times, then B=(K+1)X/2
13. 13
Slotted ALOHA
Slotted ALOHA is to constrain the user to transmit in
synchronized fashion. All users keep track of transmission
slots and are allowed to initiate transmission only at the
beginning of a time slot (the time axis is divided into time
slots with durations equal to the time to transmit a packet)
t
(k+1)XkX t0 +X+2tprop+ B
Vulnerable
period
Time-out
Backoff period B
t0 +X+2tprop
Only packets that arrive during prior X seconds collide.
14. Throughput of Slotted ALOHA
GG
eGe
G
G
GPGPS
!0
)(
seconds]Xinarrivalsno[]collisionno[
0
14
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.015…
0.03125
0.0625
0.125
0.25
0.5
1
2
4
8
Ge-G
Ge-2G
G
S
0.184
0.368
15. 15
Smax=1/e=36.8%
Efficiency=throughput · 36% (upper bound=36%)
The average packet delay in slotted ALOHA
E[Tslotted-aloha]/X=1+a+(eG-1)(1+2a+B/X)
Example – ALOHA and Slotted ALOHA
Suppose that a radio system uses a 9600 bps channels for sending call
setup request messages to a base station. Suppose that packets are 120
bits long, that the timeout is 20ms, and that the backoff is uniformly
distributed between 1 and 7. What is the maximum throughput possible
with ALOHA and slotted ALOHA? Compare the average delay in
ALOHA and slotted ALOHA when the load when the load is 40 percent
of the maximum possible throughput of the ALOHA system.
16. 16
The system transmits packets at a rate of 9600 bits/second£1
packet/120bits = 80 packets/second. The maximum throughput for
ALOHA is then 80(0.184) ¼ 15 packets/second. The maximum
throughput for slotted ALOHA is then ¼ 30 packets/second.
The load at 40 percent of the maximum of the ALOHA system is 15
£ 0.40 = 6 packets/second. G is expressed in packet arrivals/packet
transmission time, therefore, G=6/80. Assuming that the propagation
delay is negligible, the average packet delay for ALOHA in multiples
of X is then
1+(e12/80-1)(1+(1+7)/2)=1.81 packet transmission time.
The slotted ALOHA system with a load of 6 packets/second
1+(e6/80-1)(1+(1+7)/2)=1.39 packet transmission time.
17. Application of Slotted ALOHA
Reservation protocol allows a large number of stations with
infrequent traffic to reserve slots to transmit their packets in
future cycles
Each cycle has mini-slots allocated for making reservations
Stations use slotted ALOHA during mini-slots to request slots
17
cycle
X-second slotReservation
mini-slots
. . .. . .
18. 18
Carrier Sense Multiple Access with Collision Detection
The access mechanism used in an Ethernet is called CSMA/CD, standardized
in IEEE 802.3
CSMA/CD is the result of an evolution from multiple access (MA) to carrier
sense multiple access (CSMA), and finally, to CSMA/CD.
In MA, there was no provision for traffic coordination.
In a CSMA system, any user (work station) wishing to transmit must first listen
to the existing traffic on the line. A device listens by checking for a voltage. No
voltage means the line is idle. CSMA cuts down on the number of collisions
but does not eliminate them.
In CSMA/CD system, the station listens again after each packet transmission.
The extremely high voltages indicate a collision.
MA
CSMA
CSMA/CD
19. Carrier Sensing Multiple Access (CSMA)
19
A
Station A begins
transmission at t
= 0
A
Station A captures
channel at t = tprop
• A station senses the channel before it starts transmission
– If busy, either wait or schedule backoff (different options)
– If idle, start transmission
– Vulnerable period is reduced to tprop (due to channel capture effect)
– When collisions occur they involve entire frame transmission times
– If tprop >X (or if a>1), no gain compared to ALOHA or slotted ALOHA
(another station) BS
20. CSMA Options
Transmitter behavior when busy channel is sensed
1-persistent CSMA (most greedy)
Start transmission as soon as the channel becomes idle
Low delay and low efficiency
Non-persistent CSMA (least greedy)
Wait a backoff period, then sense carrier again
High delay and high efficiency
p-persistent CSMA (adjustable greedy)
Wait till channel becomes idle, transmit with prob. p; or wait one tprop
time & re-sense with probability 1-p
Delay and efficiency can be balanced
20
Sensing
(spread out the
transmission attempts)
23. 23
Analysis of CSMA/CD protocol
• In CSMA/CD protocol, a node with a packet to transmit must
proceed as follows:
1. Wait until the channel is idle;
2. When the channel is idle, transmit and listen while
transmitting
3. In case of a collision, stop the packet transmission, and then
wait for a random delay and go to (1).
• Note: when a node “goes back to (1)” after its waiting time, it
senses the signal from the other nodes and must then wait until the
end of that transmission before transmitting.
• In CSMA, collisions result in wastage of X seconds spent
transmitting an entire frame
• CSMA-CD reduces wastage of time (or bandwidth) to detect
collision and abort transmission
24. CSMA/CD reaction time
24
It takes 2 tprop to find out if channel has been captured
(The reaction time in CSMA-CD is 2tprop)
A begins to
transmit at
t = 0
A B B begins to
transmit at
t = tprop- ;
B detects
collision at
t = tprop
A B
A B
A detects
collision at
t= 2 tprop-
25. 25
Efficiency (throughput):
The nodes attempt to transmit at discrete times, in time slots with a
duration of 2tpropeach. The slot duration of 2tprop is used to guarantee that, if
nodes select to transmit at the beginning of two different slots, then they
can’t collide.
Let be the probability that during a given time slot there is no collision
and that one node starts transmitting. Let N (N ¸ 2) nodes compete for a
time-slotted channel by transmitting packets with probability p,
independently of one another, in any given time slot.
26. 26
Let A be the average number of time slots that are wasted
before a successful transmission
A=0 + (1-)(1+A)
First time slot
is successful
First time slot
is wasted
) A=-1-1
With =0.4 ) A=1.5 slots
where is the time to transmit a packet.
27. Throughput for Random Access MACs
For small a: CSMA-CD has best throughput
For larger a: Aloha & slotted Aloha better throughput
27
0
0.2
0.4
0.6
0.8
1
0.01 0.1 1
ALOHA
Slotted ALOHA
1-P CSMA
Non-P CSMA
CSMA/CD
a
max
(throughput)
28. 28
Tree Protocol for Collision Resolution
(divide-and-conquer approach)
Base Station
0 1 7
There are 8 users in a radio cell.
At a given epoch, users 0, 1, 2, 5, and 7 have packets ready for
transmission, while users 3, 4, and 6 are idle. When the ready users
transmit simultaneously, collisions will occur. The interval of time
within which the collisions are resolved is referred to as the
collision resolution interval (CRI).
29. 29
Collision resolution can be performed on a per collision resolution
interval basis. The channel states are described by the 3-tuple {idle,
collision, success}. Assume that the users can detect the channel
states.
With 8 users, the binary tree has 4 levels, with the root at level 0
and the leaves at level 3, where ready users are indicated by the
underline.
0 1 2 3 4 5 6 7
A
B C
D E F G
Level 0
Level 1
Level 2
Level 3
30. 30
Consider that, at the end of the (i-1)th collision resolution
interval, and hence the start of the ith collision resolution
interval, users 0, 1, 2, 5 and 7 are ready for packet
transmission. At the root node A, collisions occur. Split the
tree into two halves and resolve the left half first. Then at
intermediate node B (level 1), users 0, 1, and 2 transmit,
resulting in collision. Divide the subtree into two halves and
search the left half. Users 0 and 1 transmit and collision
occurs. Further divide the subtree with node D as the root, into
two halves. Since each of the halves only has the leaf node,
transmission by user 0, and then by user 1, will both be
successful. This completes the search of the left half of the
subtree with node D as the root. The algorithm next searchs
the right half of the subtree with node B as the root. The
procedure is repeated with the entire tree has been searched
and all ready users have successfully transmitted.
31. 31
C C C S CS S S S
0 1 2 5 7
A B D E C F G
time
CRIi
At start of CRIi users 0, 1, 2, 5 and 7 are ready
32. Scheduling approaches to MAC
About random access:
Simple and easy to implement
In low-traffic, packet transfer has low-delay
However, limited throughput and in heavier traffic,
packet delay has no bound. A station of bad luck may
never have a chance to transfer its packet.
Scheduling approach:
provides orderly access to shared medium so that every
station has chance to transfer
32
33. Scheduling approach—reservation protocol
The time line has two kinds of periods:
Reservation interval of fixed time length
Data transmission period of variable frames.
Suppose there are M stations, then the reservation interval
has M minislots, and each station has one minislot.
Whenever a station wants to transfer a frame, it waits for
reservation interval and broadcasts reservation bit in its
minislot.
33
34. Scheduling approach—reservation protocol
(Cont.)
By listening to the reservation interval, every station
knows which stations will transfer frames, and in which
order.
The stations having reserved for their frame transfer their
frames in that order
After data transmission period, next reservation interval
begins.
34
36. Scheduling approach—polling protocol
Stations take turns accessing the medium:
At any time, only one station has access right to transfer
into medium
After this station has done its transmission, the access
right is handed over (by some mechanism) to the next
station.
If the next station has frame to transfer, it transfers the
frame, otherwise, the access right is handed over to the
next next station.
After all stations are polled, next round polling from the
station 1 begins.
36
37. Centralized polling vs. distributed polling
Centralized polling: a center host which polls the
stations one by one
Distributed polling: station 1 will have the access right
first, then station 1 passes the access right to the next
station, which will passes the access right to the next
next station, …
37
38. 38
t
1 32 4 5 1 2
polling messages
packet transmissions
… M
Figure 6.28
Interaction of polling messages and transmissions in polling systems
39. 39Figure 6.30
Token-passing rings – a distributed polling network
Station interfaces: are connected to form a
ring by point-to-point lines
Stations: are attached to the ring
by station interfaces.
Note: point-to-point lines, not a shared bus.
Station interfaces have important functions.
Token: a small frame, runs around the ring, whichever gets
the token, it has the right to transmit data frames.
The information flows in one direction.
token
40. Comparison of scheduling & random access
Scheduling
Methodical orderly access: dynamic form of time
division multiplexing, round-robin (only) when the
stations have information to send.
Less variability in delay, supporting applications with
stringent delay requirement. In high load, performance
is good. E.g., token-ring may reach nearly 100 percent of
performance when all stations have plenty of
information to send.
Some channel bandwidth carries explicit scheduling
information.
40
41. Comparison of scheduling & random access
(Cont.)
Random access
Chaotic, unordered access
If rich bandwidth and light load, random access has low
delay, otherwise, delay is undeterminably large.
Quite a lot bandwidth is used in collision to alert
stations of the presence of other transmissions.
41