data link layers: medium access protocolportal.unimap.edu.my/portal/page/portal30/lecture notes...a...
TRANSCRIPT
DATA LINK LAYERS:
MEDIUM ACCESS PROTOCOLPART 1: MEDIUM ACCESS PROTOCOL , CHANNELIZATION, SCHEDULING,
RANDOM ACCESS
Overview
SWITCHED NETWORKS
Provide interconnection between users by means of transmission lines,
Transfer information across such networks requires routing table to direct the information from source to destination .
The addressing scheme is switched networks is typically hierarchical task.
BROADCAST NETWORKS
Because all information is received by all users, routing is not necessary.
A nonhierarchical addressing scheme is sufficient to indicate which users the information is destined.
However, broadcast networks require a medium access control protocol to orchestrate the transmissions from the various users.
CHARACTERISTSICS OF BROADCAST CHANNEL
When only one node has data to send, that node has a throughput of R
bps
When M nodes have data to send, each of these nodes has a throughput
of R/M bps. This need not necessarily imply that each of the M nodes
always has an instantaneous rate of R/M, but rather that each node
should have an average transmission rate of R/M over some suitably
defined interval of time
The protocol is decentralized: that is there is not master node that
represents a single point of failure for the network
The protocol is simple, so that it is inexpensive to implement
What we will learn?
PART I
Introduction to multiple access information
Random Access – MAC, ALOHA, CSMA-CD
Scheduling
Channelization
Delay performance
PART II
Overviews of LAN,
LAN Standards
LAN bridges
PART I: MEDIUM ACCESS
CONTROL PROTOCOL
PREVIOUSLY: DATA LINK LAYER
Point-to-point Link
Consists of a single sender at one end of the link and single
receiver at the other end of the link
Framing techniques to indicate boundaries
Retransmission algorithms to provide a reliable service. (ARQ)
Stop and Wait ARQ
Go Back N ARQ
Selective Repeat ARQ
Flow Control to regulate the rate of data transfer from transmitter to the receiver
BROADCAST LINK
Can have multiple sending and receiving nodes all connected to the same, single,
shared broadcast channel.
Broadcast – when any one node transmits a frame, the channel broadcasts the frame
and each of the other nodes receive a copy.
Example: Ethernet and LAN
Thus?. Additional Issues
How to efficiently share the access to the medium
How to coordinate the access of multiple and receiving nodes to a shared broadcast channel
Multitapped Bus
MULTIPLE ACCESS COMMUNICATIONS
Transmit when ready
Crash!!
Collision can occur; need retransmission strategy
MULTIPLE ACCESS COMMUNICATIONS
Shared wireless
medium (2.4HGz
radio)
Collision!
Packet drop
MULTIPLE ACCESS COMMUNICATIONS
The major problem with multi-access is allocating the channel between the
users; the nodes do not know when the other nodes have data to send
› Need to coordinate transmissions
› To avoid collision
multiple access protocol – Medium Access Control Protocol
› distributed algorithm that determines how nodes share channel, i.e., determine
when node can transmit
Medium Access Control
Channelization Scheduling Random access
MULTIPLE ACCESS TECHNIQUES
Partition medium
/channel
(TDMA, FDMA)
Dedicated
allocation to users
E.g. Satellite
transmission,
Cellular Telephone
Polling: take turns
Reservation Protocol
Request for slot in
transmission
schedule
E.g. Token ring,
Wireless LANs
Loose coordination
(no partition, allow
collisions)
Send, wait, retry if
necessary
E.g. Aloha, Ethernet
MAC: CHANNELIZATION
Channelization
› Semi-static bandwidth allocation of portion of shared medium to a given user
Approaches
› Frequency Division Multiple Access (FDMA)
Frequency band allocated to users
Broadcast radio & TV, analog cellular phone
› Time Division Multiple Access (TDMA)
Periodic time slots allocated to users
Telephone backbone, GSM digital cellular phone
› Code Division Multiple Access (CDMA)
Code allocated to users
Cellular phones, 3G cellular
MAC: CHANNELIZATION
PRO
Highly efficient for constant-bit rate traffic
Preferred approach in
Cellular telephone networks
Terrestrial & satellite broadcast radio & TV
CONS Inflexible in allocation of bandwidth to users with different requirements
Inefficient for bursty traffic
Does not scale well to large numbers of users
Average transfer delay increases with number of users M
MAC : ChannelizationTime Division Multiple Access (TDMA)
access to channel in "rounds"
each station gets fixed length slot (length = pkt trans time) in each round
unused slots go idle
example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle
1 3 4 1 3 4
6-slot
frame
6-slot
frame
time
MAC: ChannelizationFrequency Division Multiple Access (FDMA)
channel spectrum divided into frequency bands
each station assigned fixed frequency band
unused transmission time in frequency bands go idle
example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle
frequency
bands
FDM cable
Satellite communication: Shared radio using two frequency
bands, one for transmitting and one for receiving
MAC: ChannelizationEg: Satellite Transmission
uplink fin downlink fout
MAC: ChannelizationEg: Cellular Network
uplink f1 ; downlink f2
uplink f3 ; downlink f4
Cellular telephony: Two frequency bands
shared by a set of mobile users
MAC: ChannelizationEg: Cellular Network
Cellular networks use frequency reuse
Band of frequencies reused in other cells that are sufficiently far that
interference is not a problem
Cellular networks provide voice connections which is steady stream
Techniques implemented in cellular network
FDMA used in LTE, WiMax
TDMA used in GSM,EDGE
CDMA used in UMTS (3G),HSPA+
MAC: Random Access Protocol
when node has packet to send
› transmit at full channel data rate R.
› no a priori coordination among nodes
two or more transmitting nodes ➜ “collision”,
Each node involved in the collision repeatedly retransmit its frame (packet) until its frame gets through without collision.
Doesn’t necessarily retransmit the frame right away. Instead it waits a random delay before retransmitting the frame.
random access MAC protocol specifies:
› how to detect collisions
› how to recover from collisions (e.g., via delayed retransmissions)
examples of random access MAC protocols:
› ALOHA
› slotted ALOHA
› CSMA, CSMA/CD, CSMA/CA
MAC: Random Access Protocol
MAC: Random Access ProtocolALOHA
Simplest solution: just do it
A station transmits whenever it has data to transmit
If ACK arrived –done
ELSE
If more than one frames are transmitted, they interfere with each other (collision) and are lost
If ACK not received within timeout, then a station picks random backoff time (to avoid repeated collision)
Station retransmits frame after backoff time (after completely transmitting its collided frame)
tt0t0-X t0+X t0+X+2tprop
t0+X+2tprop + B
Vulnerable period Time-out
Backoff period BFirst transmission Retransmission
All frames consist of exactly L bits
Time is divided into slots of size L/R seconds (that is, a slot equals the time to
transmit one frame)
Nodes start to transmit frames only at the beginning of slots.
The nodes are synchronized so that each node knows when the slots begin.
If two or more frames collided in a lot, then all the nodes detect the collision
event before the slots ends
MAC: Random Access Protocol Slotted ALOHA
MAC: Random Access Protocol Slotted ALOHA
Time is divided into “slots” of one packet duration
E.g., fixed size packets
When a node has a packet to send, it waits until the start of the next slot to
send it
Requires synchronization
If no other nodes attempt transmission during that slot, the transmission is
successful
Otherwise “collision”
Collided packet are retransmitted after a random delay
Let p be the probability, that is, a number between 0 and 1
When the node has a fresh frame to send, it waits until the beginning of the next
slot and transmits the entire frame in the slot
If there isn’t a collision, the node has successfully transmitted its frame, and thus
need not to consider retransmitting the frame.
If there is a collision, the node detects the collision before end of the slot. The
node retransmits its frame in each subsequent slot with probability p until the
frame is transmitted without a collision.
P – retransmits which occurs with probability p
(1-p) – skip the slot, and retransmit at the next slot
ADVANTAGES & DISADVANTAGES
ADVANTAGES
Superior to fixed assignments when there is a large number of burst stations.
Adapts to varying number of stations
DISADVANTAGES
Theoretically proven throughput maximum of 18.4%
Requires queuing buffers for retransmissions of packet.
Video: Pure ALOHA
ALOHA Model
Definitions and assumptions
X frame transmission time (assume constant)
S: throughput (average # successful frame transmissions per X seconds)
G: load (average # transmission attempts per X sec.)
Psuccess : probability a frame transmission is successful
successGPS
XX
frame
transmission
Prior interval
Any transmission that
begins during
vulnerable period
leads to collision
Success if no arrivals
during 2X seconds
Abramson’s Assumption
What is probability of no arrivals in vulnerable period?
Abramson assumption: Effect of backoff algorithm is that frame arrivals are equally likely to occur at any time interval
G is avg. # arrivals per X seconds
Divide X into n intervals of duration D=X/n
p = probability of arrival in D interval, then
G = n p since there are n intervals in X seconds
n as )1(p)-(1
intervals]2n in arrivals 0[
seconds] 2Xin arrivals 0[
222n Gn
success
en
G
P
PP
Throughput of ALOHA
G
success GeGPS 2
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
0.2
0
0.00
78125
0.01
5625
0.03
125
0.06
25
0.12
50.
25 0.5 1 2 4
G
S
Collisions are means
for coordinating
access
Max throughput is
rmax= 1/2e (18.4%)
Bimodal behavior:
Small G, S≈G
Large G, S↓0
Collisions can
snowball and drop
throughput to zero
e-2 = 0.184
EXERCISE
THE STATIONS ON A WIRELESS ALOHA NETWORK ARE A MAXIMUM OF 600KM
APART. IF WE ASSUME THAT SIGNALS PROPAGE AT 3 X 10³ m/s, WE FIND?.
A PURE ALOHA NETWORK TRANSMITS 200-BIT FRAMES ON SHARED CHANNEL
OF 200kpbs. WHAT IS THE THROUGHPUT IF THE SYSTEM (ALL STATIONS
TOGETHER) PRODUCED:
1000 FRAMES PER SECOND
500 FRAMES PER SECOND
250 FRAMES PER SECOND
SLOTTED ALOHA
Throughput of PURE ALOHA = 18.4%
Time is divided into frame sized slot
Transmission can start only at the beginning of the slot
By the frame(s) that arrive in the previous slot
Increased the maximum throughput to 36%
Since the sensitive period decreased from 2T to T
SLOTTED ALOHA
Time is divided into “slots” of one packet duration
› E.g., fixed size packets
When a node has a packet to send, it waits until the start of the next slot
to send it
› Requires synchronization
If no other nodes attempt transmission during that slot, the transmission is
successful
› Otherwise “collision”
› Collided packet are retransmitted after a random delay
MAC: Random Access Protocol Slotted ALOHA
Pros:
single active
node can
continuously
transmit at full
rate of channel
simple
Cons:
collisions, wasting slots
idle slots
clock synchronization
1 1 1 1
2
3
2 2
3 3
node 1
node 2
node 3
C C CS S SE E E
• The only ‘unwasted’ slots will be those in which exactly one node transmits.
• A slot in which exactly one node transmits is said to be a successful slot
• The efficiency of a slotted multiple access protocol is defined to be the long run
fraction of successful slots in the case when there are a large number of active nodes
each always having a large number of frames to send.
ADVANTAGES & DISADVANTAGES
ADVANTAGES
Allows a node to transmit continuously at the full rate, R, when that node is the only active node ( a node is said to be active if it has frames to send)
Highly decentralized, because each node detects collisions and independently decides when to retransmits
Works well when there is only one active node, but how efficient is it when there are multiple active nodes?.
DISADVANTAGES
When there are multiple active nodes, a certain fraction of the slots will have collisions and will therefore be ‘wasted’,
Another fraction of the slots will be empty because all active nodes refrain from transmitting as a result of the probabilistic transmission policy.
Throughput of Slotted ALOHA
Gnn
success
Gen
GGpG
GP
GPGPS
)1()1(
intervals]n in arrivals no[
seconds] Xin arrivals no[
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.0
156
…
0.0
312
5
0.0
625
0.1
25
0.2
5
0.5 1 2 4 8
Ge-G
Ge-2G
G
S0.184
0.368
MAC: CARRIER SENSE MULTIPLE
ACCESS (CSMA)
ALOHA protocols are quite like a boorish party goer who continues to chatter away regardless of whether other people are talking.
Important rules :
Carrier sensing - Listen before speaking. A node listens to the channel before transmitting. If a frame from another node is currently being transmitted into the channel, a node ten waits until it detects no transmissions for a short amount of time and then begin transmission.
Collision detection – If someone else begins talking at the same time, stop talking. A transmitting node listens to the channel while it is transmitting. If it detects that another node is transmitting an interfering frame, it stops transmitting and waits a random amount of time before repeating the sense-and-transmit-when-idle cycle.
MAC: Random Access Protocol Carrier
Sensing Multiple Access (CSMA)
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, no gain compared to ALOHA or slotted ALOHA
By listening before transmitting, stations try to reduce the vulnerability
period to one propagation delay
MAC: Random Access Protocol Carrier Sensing Multiple Access (CSMA)
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 mini-slot time & re-sense with probability 1-p
Delay and efficiency can be balanced
Sensing
1-PERSISTEN CSMA
If the channel is busy, they sense the channel continuously, waiting until
the channel becomes idle.
As soon as the channel is sensed idle, they transmit their frames
If more than one station is waiting, a collision will occur
Stations involved in a collision perform the back-off algorithm
‘Greedy’ – attempting to access the medium as soon as possible.
Has a relatively high collision rate.
NON-PERSISTENT CSMA
Attempts to reduce the incidence of collisions
Stations with a frame to transmit sense the channel
If the channel is busy, the stations immediately run the back-off algorithm
and reschedule a future re-sensing time
If idle, the stations transmit
By immediately rescheduling a re-sensing time and not persisting, the
incidence of collisions is reduced.
Resulted longer delays
P-PERSISTENT CSMA
Combination of both 1-Persistent and Non-Persistent
Stations with a frame to transmit sense the channel, and if the channel is
busy, they persist with sensing until the channel becomes idle
If the channel is idle
With probability p, the station transmits its frame
With probability 1-p, the station decides to wait an additional propagation
delay tprop before again sensing the channel
MAC: Random Access Protocol CSMA with Collision Detection (CSMA/CD)
Monitor for collisions & abort transmission
› Stations with frames to send, first do carrier sensing
› After beginning transmissions, stations continue listening to the medium to detect collisions
› If collisions detected, a short jamming signal is transmitter to ensure all station knows there is a collision, abort transmission, reschedule random backofftimes, and try again at scheduled times
In CSMA collisions result in wastage of X seconds spent transmitting an entire frame
CSMA-CD reduces wastage to time to detect collision and abort transmission
Disadvantages of CSMA: Once a packet is sent, feedback occurs a roundtrip
time after the entire packet is transmitted
SUMMARY CSMA/CD OPERATION
FROM THE PERSPECTIVE OF AN
ADAPTER
The adapter obtains a datagram from the network layer, prepare a link-layer frame, and puts the frame adapter buffer
If the adapter sense that the channel is idle (that is there is no signal energy entering the adapter from the channel), it starts to transmit the frame. If on the other hand, the adapter sense the channel is busy, it waits until it senses no signal energy and then starts to transmit the frame
While transmitting, the adapter monitors for the presence of signal energy coming from other adapters using the broadcast channel.
If the adapter transmit the entire frame without detecting signal energy from other adapters, the adapter is finished with the frame. If, on the other hand, the adapter detects signal energy from other adapters while transmitting, it aborts the transmission.
After aborting, the adapter waits a random amount of time and then returns to step 2.
MAC: Random Access Protocol CSMA-CD
Application: Ethernet
First Ethernet LAN standard used CSMA-CD
1-persistent Carrier Sensing
R = 10 Mbps
tprop = 51.2 microseconds
512 bits = 64 byte slot
accommodates 2.5 km + 4 repeaters
Truncated Binary Exponential Backoff
After nth collision, select backoff from {0, 1,…, 2k – 1}, where k=min(n, 10)
MAC: Random Access Protocol Throughput for Random Access MACs
For small propagation delay, a: CSMA-CD has best throughput
For larger a: Aloha & slotted Aloha better throughput
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
rmax
MAC: Random Access Protocol -
Summary
when node has packet to send
› transmit at full channel data rate R.
› no a priori coordination among nodes
two or more transmitting nodes ➜ “collision”,
random access MAC protocol specifies:
› how to detect collisions
› how to recover from collisions (e.g., via delayed retransmissions)
examples of random access MAC protocols:
› ALOHA
› slotted ALOHA
› CSMA, CSMA/CD, CSMA/CA
Comparison of MAC approaches
Aloha & Slotted Aloha
Simple & quick transfer at very low load
Accommodates large number of low-traffic bursty users
Highly variable delay at moderate loads
CSMA-CD
Quick transfer and high efficiency for low delay-bandwidth
product
Can accommodate large number of bursty users
Variable and unpredictable delay
MAC: Scheduling
Schedule frame transmissions to avoid collision in shared medium
More efficient channel utilization
Less variability in delays
Can provide fairness to stations
Increased computational or procedural complexity
Two main approaches
› Reservation
› Polling
MAC: Scheduling Reservation Systems
TimeCycle n
Reservation
intervalFrame
transmissions
r d d d r d d d
Cycle (n + 1)
r = 1 2 3 M
Stations take turns transmitting a single frame at the full rate R bps
Transmissions organized into cycles
Cycle: reservation interval + frame transmissions
Reservation interval has a minislot for each station to request reservations for frame transmissions
Cycle length (variable) based on the number of stations that have a frame to transmit.
MAC: Scheduling Reservations Systems
Centralized systems: A central controller accepts requests from stations and issues grants to transmit
› Frequency Division Duplex (FDD): Separate frequency bands for uplink & downlink
› Time-Division Duplex (TDD): Uplink & downlink time-share the same channel
Distributed systems: Stations implement a decentralized algorithm to determine transmission order
Central
Controller
tr 3 5 r 3 5 r 3 5 8 r 3 5 8 r 3
(a)
tr 3 5 r 3 5 r 3 5 8 r 3 5 8 r 3
8(b)
MAC: Scheduling Example
Initially stations 3 & 5 have reservations to transmit frames
Station 8 becomes active and makes reservation
Cycle now also includes frame transmissions from station 8
MAC: Scheduling Example: GPRS
General Packet Radio Service
Packet data service in GSM cellular radio
GPRS devices, e.g. cellphones or laptops, send packet data over radio and
then to Internet
Slotted Aloha MAC used for reservations
Single & multi-slot reservations supported
MAC: Scheduling Polling Systems
Reservation systems required stations to make reservation to gain access to the transmission medium
Polling system :- stations take turns accessing the medium
› Requires one of the nodes to be designated as a master node. The master node polls each of the nodes in a round-robin fashion.
› Master node sends a message to node 1, saying that node 1 can transmit up to some maximum number of frames.
› Centralized polling systems: A central controller transmits polling messages to stations according to a certain order
› Distributed polling systems: A permit for frame transmission is passed from station to station according to a certain order
› A signaling procedure exists for setting up order
Inbound line
Outbound lineHost
computer
Stations
MAC: SchedulingPolling
1 2 3M
Poll 1
Data from 1
Poll 2
Data from 2
Data to M
Host computer issues polling messages to each terminal,
providing it with permission to transmit on the inbound line
MAC: SCHEDULING TOKEN RING
No master node
A small, special-purpose frame known as a token is exchanged among the nodes in some fixed order.
When a node receives a token, it holds onto the token only if it has some frames to transmit; otherwise it immediately forwards the token to the next node.
If a node does have frames to transmit when it receives the token, it sends up to a maximum number of frames and then forward the token to the next node.
Drawback?. The failure of one node can crash the entire channel
Or a node accidentally neglects to release the token, then some recovery procedure must be invoked to get the token back in circulation.
Ring networks
MAC: SchedulingToken Passing
token
Station that holds token transmits into ring
tokenData to M
MAC: Scheduling Application Examples
Single-frame reinsertion
IEEE 802.5 Token Ring LAN @ 4 Mbps
Single token reinsertion
IBM Token Ring @ 4 Mbps
Multitoken reinsertion
IEEE 802.5 and IBM Ring LANs @ 16 Mbps
FDDI Ring @ 50 Mbps
All of these LANs incorporate token priority mechanisms
Comparison of MAC approaches
Reservation
› On-demand transmission of bursty or steady streams
› Accommodates large number of low-traffic users with slotted Aloha reservations
› Can incorporate QoS
› Handles large delay-bandwidth product via delayed grants
Polling
› Generalization of time-division multiplexing
› Provides fairness through regular access opportunities
› Can provide bounds on access delay
› Performance deteriorates with large delay-bandwidth product