Medium Access Control Sublayer

Download Report

Transcript Medium Access Control Sublayer

Medium Access Control
Sublayer
Static Channel Allocation

FDM

TDM
Wastage of resources when some of the
users are idle.
What if the number of users increase
Dynamic Channel Allocation :
Systems in which multiple users share a
common channel in a way that can lead to
conflicts are called contention systems.
Basic Assumptions
1.
2.
3.
Station model : N independent stations. Once a
frame has been generated, the station is
blocked, does nothing until the frame has been
successfully transmitted
Single Channel : All channel can transmit on it
and all can recv from it.
Collisions : when more than one station try to
transmit a frame and they overlap in time, both
of them are garbled and we say that a collision
has occurred. Both the frames must be
transmitted again.. There r no errors other than
collision
Basic assumptions contd…
4. Continous time / Discrete time
5. Carrier Sense/ No carrier sense
Multiple Access Protocols
•
•
•
•
•
•
ALOHA (by Norman Abramson in 1970) – No
carrier Sense
Carrier Sense Multiple Access Protocols
Collision-Free Protocols
Limited-Contention Protocols
Wavelength Division Multiple Access
Protocols
Wireless LAN Protocols
PURE ALOHA

Continuous Time

No Carrier Sense
Pure ALOHA contd…

We assume that all the frame lengths are
same because ,
it makes the study easier , and
the performance of the system is best
when the frames are of fixed size.
Pure ALOHA contd…



Let N : average number of frames created a new
per frame time
G : average number of frames transmitted ( new
frames + retransmission due to collision) per
frame time
Let both follow Poisson distribution I.e. for eg.
Pr[k] = G^k e^{-G} / k! Is the probability of
transmitting k frames in a given frame time.
Pure ALOHA contd…

Throughput S = fraction of all the frames
transmitted that escape the collision, per frame
time
For eg . If the throughput is 18% and If frame time
= 1/100 sec
Then though 100 frames can be transmitted in one
second only (at most) 18 of them are transmitted
successfully.
Pure ALOHA contd…
S = GP_0
Average number of frames transmitted X
the probability that it will not suffer a
collision.
Where P_0 is the probability that a frame
doesn’t suffer a collision

Pure ALOHA contd…
Contd..


The frames that collide with the shaded
frame are generated in the intervals to –
to+t and to+t – to + 2t. Average number of
frames generated in these two time
intervals is 2G.
Probability that no frame is transmitted in
these two intervals is therefore e^{-2G}
Pure ALOHA contd…

Since Pr[k] = G^k e^-G / k!
Therefore , P_0 = e^-2G, for two frames and
S = G e^-2G
The max thruput occurs at G = 0.5 with S = 1/2e =
.184
Slotted ALOHA

S = G e^-G
Max at G =1, with S = 1/e = .368 ~ .37
Probability that a slot is idle = P_0 = 1/e ~
.37
Hence 37% idle, 37 % success and
remaining 26% collisions.
Slotted ALOHA contd…
Slotted ALOHA

Higher values of G reduces the empty
slots but increases collisions
exponentially.
CSMA : Carrier Sense Multiple
Access Protocols

1 – persistent CSMA
when a station is ready to send a frame , it
senses the channel :
if busy : continuously sense it and waits for it to
become free
if idle : sends it (with probability 1) ..hence the
name 1 -persistent
if collision : waits for random time and tries again
CSMA contd…

Effect of propagation delay in CSMA – if signal
from station A has not reached station B and
station B is ready to send, it will sense the
channel to be idle and send its frame.

Collision can be there even when propagation
delay is zero and carrier sense is also there –
Two stations wait for a third station to finish and
then transmit simultaneously.
1-persistent contd..

Better than Pure ALOHA but would have
been better if the two stations were more
patient.
Nonpersistent CSMA
Less greedy than 1 persistent , hence better
channel utilization but longer delays
when a station is ready to send a frame , it senses
the channel :
if busy : waits for random time rather than
continuously sense it for the purpose of seizing it
if idle : sends it .
if collision : waits for random time and tries again

p- persistent CSMA
Applies to slotted channels
 Senses the channel when ready
If busy : waits for the next slot
If idle : sends its frame with probability p and
defers it with probability q = 1 – p to the next
slot : Note that it defers even when the channel
is idle
Repeats above until either it or some other station
grabs the channel. In case some other channel
grabs it ..it treats it like a collision I.e. waits for a
random time and starts again

Comparison
CSMA/CD: CSMA with Collision
Detection


Suppose after a station has finished
sending its frame, say at time to, other
stations try to sense the channel for
collision. In case, collision is detected, it
refrains from transmitting, waits for a
random amount of time and tries again.
The above procedure is repeated until the
station gets a chance to transmit its frame.
CSMA with Collision Detection
CSMA/CD can be in one of three states:
contention, transmission, or idle.
What should be the size of the
contention interval?

How long does it take for a channel to detect a
collision (max time)?






Let the time it takes for a signal to travel between the
two farthest stations, say A and B, is t
At t0, A starts transmitting.
At t-epsilon, an instant before the signal reaches B, B
also starts transmitting, collision occurs
But the collided signal reaches back to A not before
additional t time .. I.e. at an instant 2t-epsilon
Hence it takes about 2t time for A to detect a
collision
Hence the contention interval must be 2t.
CSMA/CD contd..

If a station detects collision in the midway
of generating its frame, it stops
immediately rather than generating the
entire frame.

Widely used

Also in Ethernet LAN.
CSMA/CD

Collisions do not occur in CSMA/CD once
a station has acquired a channel.
However, the collisions can still occur
during the contention periods.
Collision-Free Protocols

Not used these days in major systems but
possess some nice properties.
Collision-Free Protocols
The basic bit-map protocol.
Performance

Under light load, few frames and more
contention slots, so overhead is high




Let one time unit = time for contention bit slot
Let one frame time = d time units
Efficiency is roughly = d/(d+N) where N is the number
of contention slots, assuming roughly 1 frame per N
contention slots
Under heavy loads, lots of frames, so overhead
per frame is low, assuming N frames for every N
contention slots, efficiency = dN/(dN + N) =
d/(d+1)
Collision-Free Protocols (2)
The binary countdown protocol. A dash
indicates silence.
Channel efficiency

= d/(d + log N)

Disadv :
Biased towards higher numbered
stations
A Variation of Binary countdown –
by Mok and Ward(1979)

Use round-robin
A station which has been served is numbered
lower (say given lower priority) and others
behind it are moved up.
Revisit p-persistent Protocol
It is symmetric .I.e each station acquires a
channel with the same probability p.
 Suppose k stations are contending
probability that some station acquires the channel
in a given slot is
k p (1 – p)^(k-1)

What should be the value of p so that this
probability is maximum?
Ans : p = 1/k
and the max probability is ( 1 – 1/k)^(k-1)
when k is small I.e. limited
contention
Performance Comparison

Contention Protocols



Low delays, better channel efficiency at low
load
Poor channel efficiency at heavy load
Collision- free Protocols


High delays, poor efficiency at low load
Better channel efficiency at heavy loads.
Limited- Contention Protocols



Combine the benefits of both the
strategies
Divide the number of contending stations
into groups
stations in group 0 contend for slot 0



If one of them acquires, it transmits the frame
Else, stations in group 1 contend for slot 1
And so on
Assign stations to groups
dynamically

Assign many stations to a group under light load
( slotted ALOHA types)


Competition is more (actually light under light load)
but the bit map and hence the overhead is less
Assign few (may be one) station to a group
under heavy loads ( close to bit map)

Competition per slot is less but the bit map size
increases but that’s fine because overhead per frame
is not much under heavy loads.
Adaptive Tree Walk Protocol

Think of the stations as the leaves of a
binary tree
How far down the tree the search
must begin?



Does it make sense to allot slot 0 to node
1 at heavy load ?
Assume that each station has a good
estimate of the number of stations q
contending at any point of time
Further assume that the ready stations are
uniformly distributed at the leaves of the
binary tree.



At a node at level i the expected number
of ready channels under it is q/2^i
Intuitively, the optimal level to begin
search is the one for which q/2^i is 1
I.e. i = log q.
WDMA: Wavelength Division
Multiple access : MAC sub-layer
in optical networks



The spectrum is divided in to channels
(wavelength bands)
Each channel is divided into groups of
time slots
Each station is assigned two channels


Narrow channel – control channel
Wide channel – data channel
Contd..



There is no relation between the number of time
slots in the control channel (say m), the number
of time slots in the data channel (say n + 1) and
the number of stations.
Each data channel has one slot as the status
slot.. Which tells other stations about its free
slots.
A station might use zero, one or more of the time
slots in data or control channels.
More topics for presentation(1
person each)



MAC Sublayer in Optical Networks.
MAC Sublayer in WLANs (802.11)
MAC Sublayer in Broadband
Wireless(802.16)
Wavelength Division Multiple Access
Protocols
Wavelength division multiple access.
3 types of traffic



Constant data rate CO traffic
variable data rate CO traffic
Data-gram traffic
Dynamic WDMA contd…

Each Station has two transmitting channels and
two receiving channels as follows :




Fixed wavelength receiver for listening to its own
control channel
Tunable transmitter for sending on other stations’
control channels
Fixed wavelength transmitter for outputting data
frames
Tunable receiver for selecting a data transmitter to
listen to
Variable Data Rate CO traffic




Connection is established to exchange control
information but not for data.
“There is a frame for you in slot 3”
Collision in establishing a connection in the
control slot : no problem  try again
Problem is : 2 stations establish connection with
B say in slots 4 and 5, but both send “There is a
frame for you in slot 3” …. B chooses one of
them by tuning itself to one of them and the
frame from the other is discarded.
Constant Data Rate COO


A connection is established in a data slot
also
When A asks for a connection it also says
something like : Is it all right if I send you a
frame in every occurrence of slot 3. If A is
free in that slot, a guaranteed bandwidth
connection is established
Data-gram traffic


Instead of writing a CONNECTION
REQUEST message into the control slot, it
writes data for you in slot 3. No connection
is established even in control slot. If B is
free during that slot, it accepts the frame
else it is lost.
Whichever slot is found free is used to
send a control message.
MAC Sub-layer in Wireless LANs

There is a fixed base station
Wireless LANs


(a) Bluetooth configuration
(b) Wireless LAN
WLANs contd..

Unlike cellular system, each room or LAN
has only one channel, covering the entire
available bandwidth and covering all
stations in its cell.

It is important to know that in WLANs not
all stations may be within the range of one
another.
Can we use CSMA?


Hidden Station Problem
Exposed Station Problem
Wireless LAN Protocols
A wireless LAN. (a) A transmitting. (b) B
transmitting.
Problem near the receiver

CSMA only tells problem near the sender
and not near the receiver .. The point is
scene near the receiver may be different
from the scene near the sender.. Which
was not the case in traditional wired
(Ethernet type) networks.
Simultaneous transmissions are
possible in WLANs

In contrast to wired (Ethernet type of)
networks.
Wireless LAN Protocols (2)
The MACA protocol. (a) A sending an RTS
to B.
(b) B responding with a CTS to A.
MACA : Multiple Access with
Collision Avoidance



A sends an RTS (Request to send) – a
short frame (30 bytes long).. It contains
the length of the data frame that will follow.
B sends CTS (Clear to send) – again a
short frame.. Also containing the length of
the data frame (copied from RTS)
On receiving CTS, A starts transmitting
Effect of MACA on other stations

Suppose C is in the range of A, hence hears
RTS .. Must wait until A receives CTS else will
collide with CTS

Suppose D is in the range of B, hence hears
CTS .. Must wait until B receives the data frame
.. From the length of the data frame(contained in
the CTS) .. the time for the data frame is
estimated
Collisions may still occur

When two stations try to send an RTS at
the same time to the same station.

In case of collision, sender waits a random
time and starts again later. Binary
exponential backoff method is used.
Data Link Layer Switching
•
•
•
•
•
•
Bridges from 802.x to 802.y
Local Internetworking
Spanning Tree Bridges
Remote Bridges
Repeaters, Hubs, Bridges, Switches,
Routers, Gateways
Virtual LANs
Data Link Layer Switching
Multiple LANs connected by a backbone to
handle a total load higher than the
capacity of a single LAN.
Why LAN of LANs?





Each deptt : own LAN
Each buliding : own LAN
Each discipline within a deptt : own LAN to
accommodate the load
For more reliability : if there is a single LAN in
the entire organization and, at time there is a
node which is generating frames continuously, it
will cripple the entire LAN .. By keeping multiple
LANs one can save the rest of the nodes.
Security : rather than promiscuous mode use
intelligent bridges on the gateway.
Bridges from 802.x to 802.y
Operation of a LAN bridge from 802.11 to
802.3.
Difficulties in bridging 802.x with
802.y




Requires reformatting – takes CPU time, new
checksum => possibility of errors due to bad
memory bits in the bridge’s memory.
Difference in speed may lead to Swamping
Different max. frame length : splitting n
assembly is generally not done in the DLL..
Frames that are too large for the next LAN to
handle are dropped.
Security
Bridges from 802.x to 802.y (2)
The IEEE 802 frame formats. The drawing
is not to scale.
Local Internetworking
A configuration with four LANs and two
bridges.
Routing in Interconnected LANs


Use MAC Address
A hash table of MAC address is
maintained : (dest., outgoing LAN)




Initially empty
Initially flooding
Learns about a node when a frame comes
from it – backward learning.
Entries updated and purged from time to time
Routing in Interconnected LANs



If destination and source are on same
LAN, discard
If on different, forward
If destination LAN is not known, flood
Problem of parallel bridges
between 2 LANs  cycle
Two parallel transparent bridges.
Spanning Tree Bridges (2)
(a) Interconnected LANs. (b) A spanning tree
covering the LANs. The dotted lines are not
part of the spanning tree.
Remote Bridges
Remote bridges can be used to interconnect
distant LANs.
Repeaters, Hubs, Bridges,
Switches, Routers and Gateways
(a) Which device is in which layer.
(b) Frames, packets, and headers.
Repeaters and Hubs : Physical
Layer



They do not understand frames, packets
or headers, understand only volts.
Repeaters amplify the signal and pass it
onto the next LAN .. No collision
Hubs do not amplify .. They broadcast the
signal they receive to all the nodes.. If two
or more nodes try to send at the same
time they collide.
Switches and Bridges : DLL




Bridges connect LANs, Switches connect
individual machines.
In switched networks..no collision, each node
has its own port, own buffer space etc. In
Bridged networks, Collision may occur in
individual LANs
Both do routing
Today, there isn’t much difference between
switches and bridges and they are used
interchangeably.
Repeaters, Hubs, Bridges,
Switches, Routers and Gateways
(2)
(a) A hub. (b) A bridge. (c) a switch.
Virtual LANs (2)
(a) Four physical LANs organized into two VLANs,
gray and white, by two bridges. (b) The same 15
machines organized into two VLANs by switches.
The IEEE 802.1Q Standard
Transition from legacy Ethernet to VLANaware Ethernet. The shaded symbols are
VLAN aware. The empty ones are not.
The IEEE 802.1Q Standard (2)
The 802.3 (legacy) and 802.1Q Ethernet
frame formats.
Summary
Channel allocation methods and systems for a common
MACAW (MACA for wireless) by
Bhargavan et al

Some improvements over MACA.


Ack for successful transmission was
introduced.
Carrier sense was introduced so that if one
RTS is in progress another station abstain
itself from doing so.
I Acknowledge
•
Help from the following site
•
http://www.cs.vu.nl/~ast/
•
In preparing this lecture.