Transcript UNIT 2

UNIT 2
Medium Access sub layer: Medium Access sub layer Channel Allocations, LAN protocols - ALOHA
protocols(PURE AND SLOTTED ALOHA),CSMA/CA,CSMA/CD
- Overview of IEEE standards - FDDI. Data Link Layer Elementary Data Link Protocols, Sliding Window protocols,
Error Handling.
Medium Access sub layer
(Introduction)
A network of computers based on multi-access medium requires a protocol
for effective sharing of the media. As only one node can send or transmit
signal at a time using the broadcast mode, the main problem here is how
different nodes get control of the medium to send data, that is “who goes
next?”. The protocols used for this purpose are known as Medium Access
Control (MAC) techniques. The key issues involved here are - Where and
How the control is exercised.
A centralized scheme has a number of advantages as mentioned below:
• Greater control to provide features like priority, overrides, and guaranteed
bandwidth.
• Simpler logic at each node.
• Easy co-ordination.
Goals of MACs
Medium Access Control techniques are designed with the following goals in
mind
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Initialisation
Fairness
Priority
Limitations to one station
Receipt
Error Limitation
Recovery
Reconfigurability
Compatibility
Reliability
Medium Access sub layer
MAC(Medium Access Control)
Function:
a. To perform the control of access to media
b. It performs the unique addressing to stations directly connected to LAN.
c. Detection of errors
LLC(Logical Link Control)
Function:
a. Error recovery
b. Flow control operation
c. User addressing
MAC Techniques
Round Robin Techniques
Each and every node is given the chance to send or transmit by rotation
1. Polling
• The message contains the address of the node being selected for
granting access.
• No data =“poll reject” message send back
Round Robin Techniques
2. Token Passing
• All stations are logically connected in the form of a ring and control of
the access to the medium is performed using a token .
• Token Ring
• Problems like lost token, duplicate token, and insertion of a node,
removal of a node .
Fig: A token ring network
The Channel Allocation Problem
•Static Channel Allocation in LANs and MANs
•Dynamic Channel Allocation in LANs and WANs
Static Channel Allocation in LANs and MANs
• FDM
• TDM
• Simple queuing theory
- Processing Delay
- Queuing Delay
- Transmission Delay
- Propagation Delay
- Retransmission Delay
Disadv.
When the number of users is large and continuously varying, or the traffic
is busy,FDM presents some problem
Static Channel Allocation in LANs
and MANs
A simple queuing theory calculation
For a channel of capacity C bps, with an arrival rate of l
frames/sec, each frame having a length drawn from an
exponential probablity density function with mean 1/m
bits/frame, the mean time delay
1
T
mC  l
Now let us divide the single channel up into N independent
subchannels, each with capacity C/N bps. The mean input
rate on each of the subchannel will now be l/N.
1
Recomputing T, we get T
 NT
FDM 
m (C / N )  ( l / N )
Dynamic Channel Allocation Parameters
• Station Model.
– N independent stations, each acting as a Poisson Process for the
purpose protocol analysis
• Single Channel Assumption.
– A single channel is available for all communication.
• Collision Assumption.
– If transmitted frames overlap in time, the resulting signal is
garbled.
• Transmission Discipline:
– Continuous time
• Frames can be transmitted at any time
– Slotted time
• Frames can be transmitted at particular time points
• Sensing capability:
– Station cannot sense the channel before trying to use it.
– Stations can tell if the channel is in use before trying to use it
Multiple Access Protocols
•ALOHA
- Pure ALOHA
- Slotted ALOHA
•Carrier Sense Multiple Access Protocols
- CSMA/CD
- CSMA/CA
•Collision-Free Protocols
- Bitmap Protocol
- Binary Countdown
•Limited-Contention Protocols
•Wavelength Division Multiple Access Protocols
•Wireless LAN Protocols
ALOHA PROTOCOL
Transmission technology can be categorized into two
categories :
Point-to point networks
Broadcast networks
Point-to-point networks
Point-to-point networks are those in which when a message is
sent from one computer to another, it usually has to be sent via
other computers in the network. A point-to-point network consists
of many connections between individual pairs of computers.
Broadcast networks
Broadcast networks have a single communication channel that is shared by all the
machines on the network. A packet sent by one computer is received by all the
other computers on the network. The packets that are sent contain the address of
the receiving computer; each computer checks this field to see if it matches its
own address. If it does not then it is usually ignored; if it does then it is read.
Broadcast channels are sometimes known as multi-access channel.
Shared channel
Poisson Process
• The Poisson Process is a celebrated model used in
Queuing Theory for “random arrivals”. Assumptions
leading to this model include:
– The probability of an arrival during a short time interval Δt
is proportional to the length of the interval, and does not
depend on the origin of the time interval (memory-less
property)
– The probability of having multiple arrivals during a short
time interval Δt approaches zero.
Poisson Distribution
The probability of having k arrivals during a time
interval of length t is given by:
(l t ) e
Pk (t ) 
k!
k
 lt
where λ is the arrival rate. Note that this is a singleparameter model; all we have to know is λ.
Slotted ALOHA
Assumptions
• all frames same size
• time is divided into equal
size 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, 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
5: DataLink Layer
5-19
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
Cons
• collisions, wasting slots
• idle slots
• nodes may be able to
detect collision in less
than time to transmit
packet
• clock synchronization
5: DataLink Layer
5-20
Slotted Aloha efficiency
Efficiency is the long-run
fraction of successful slots
when there are many nodes, each
with many frames to send
• Suppose N nodes with
many frames to send,
each transmits in slot with
probability p
• prob that node 1 has
success in a slot
= p(1p)N-1
• prob that any node has a
success = Np(1-p)N-1
5: DataLink Layer
• For max efficiency with N
nodes, find p* that
maximizes
Np(1-p)N-1
• For many nodes, take limit
of Np*(1-p*)N-1 as N goes
to infinity, gives 1/e = .37
At best: channel
used for useful
transmissions 37%
of time!
5-21
Pure (unslotted) ALOHA
• unslotted Aloha: simpler, no synchronization
• when frame first arrives
– transmit immediately
• collision probability increases:
– frame sent at t0 collides with other frames sent in [t0-1,t0+1]
5: DataLink Layer
5-22
Pure Aloha efficiency
P(success by given node) = P(node transmits) .
P(no other node transmits in [p0-1,p0] .
P(no other node transmits in [p0-1,p0]
= p . (1-p)N-1 . (1-p)N-1
= p . (1-p)2(N-1)
… choosing optimum p and then letting n -> infty ...
Even worse !
= 1/(2e) = .18
5: DataLink Layer
5-23
CSMA (Carrier Sense Multiple Access)
CSMA: listen before transmit:
If channel sensed idle: transmit entire frame
• If channel sensed busy, defer transmission
• Human analogy: don’t interrupt others!
5: DataLink Layer
5-24
Carrier Sense Multiple Access (CSMA)
• Additional assumption:
– Each station is capable of sensing the medium to
determine if another transmission is underway
1-persistent CSMA
Station can transmit
1-persistent CSMA
While there is a new frame A to send do
1. Check the medium
2. If the medium is busy, go to 1.
3. (medium idle) Send frame A and wait for
ACK
4. If after some time ACK is not received
(timer times out), wait a random amount
of time and go to 1.
End.
Non-persistent CSMA
Station can transmit
Non-persistent CSMA
While there is a new frame A to send DO
1. Check the medium
2. If the medium is busy, wait some time, and go to
1.
3. (medium idle) Send frame A and wait for ACK
4. If after some time ACK is not received (timer
times out), wait a random amount of time and
go to 1.
End
p-persistent CSMA
p-persistent CSMA
While there is a new frame A to send do
1. Check the medium
2. If the medium is busy, go to 1.
3. (medium idle) With probability p send frame A
and the go to 4, and probability (1- p) delay one
time slot and go to 1.
4. If after some time ACK is not received (timer
times out), wait a random amount of time and
go to 1.
End.
CSMA Summary
 Nonpersistent
 1-persistent
 p-persistent
Constant or variable
Delay
Channel busy
CSMA persistence and backoff
Non-persistent:
Transmit if idle
Otherwise, delay, try again
Time
Ready
1-persistent:
Transmit as soon as
channel goes idle
If collision, back off and try again
p-persistent:
Transmit as soon as channel goes
idle with probability p
Otherwise, delay one slot, repeat process
32
Carrier Sense Multiple Access Protocols
CSMA with collision detection (CSMA/CD)
Abort a transmission as soon as they detect a collision. Quickly
terminating damaged frames saves time and bandwidth.
After a station detects a collision, it aborts its transmission,
waits a random period of time, and then tries again, assuming
that no other station has started transmitting in the meantime.
Contt.
A conceptual model for CSMA/CD
(How long should each slot be?)
CSMA collisions
spatial layout of nodes
collisions can still occur:
propagation delay means
two nodes may not hear
each other’s transmission
collision:
entire packet transmission
time wasted
note:
role of distance & propagation delay
in determining collision probability
5: DataLink Layer
5-35
CSMA/CA
• Identical to CSMA/CD but used when listening
is not possible while transmitting
• Idle channel reservation is done by sending a
short request message asking other nodes to
defer transmission
• If collison is detected then, then random wait
is used
• Wireless IEEE 802.11 uses CSMA/CA with an
RTS/CTS mechanism
Chapter 4 The Medium Access Sublayer
421 Multiple Access Protocols
4.2.2 Carrier Sense Multiple Access Protocols
For this reason we will model the contention interval as a
slotted ALOHA system with slot width 2t (t is the end to end
delay). On a 1-km long coaxial cable, t5msec.
It is important to realize that collision detection is an analog
process. The station’s hardware must listen to the cable while
it is transmitting. The signal encoding must allow collisions to
be detected (e.g., a collision of two 0-volt signals may well be
impossible to detect). For this reason, special encoding is
commonly used.