Chap 4, Multiaccess Communication

Download Report

Transcript Chap 4, Multiaccess Communication

Chap 4
Multiaccess Communication
(Part 2)
Ling-Jyh Chen
Classification of Multiple Access
Protocols
Multiple access protocols
Contention-based
Random access
Conflict-free
Collision resolution
ALOHA,
TREE,
FDMA,
CSMA,
WINDOW,
etc
TDMA,
BTMA,
etc
CDMA,
Token Bus,
etc
BTMA: Busy Tone Multiple Access
2
Contention Protocols
 ALOHA


Developed in the 1970s for a packet radio network
by Hawaii University.
Whenever a station has a data, it transmits.
Sender finds out whether transmission was
successful or experienced a collision by listening
to the broadcast from the destination station.
Sender retransmits after some random time if
there is a collision.
 Slotted ALOHA

Improvement: Time is slotted and a packet can
only be transmitted at the beginning of one slot.
Thus, it can reduce the collision duration.
3
Slotted ALOHA
Node 1 Packet
Nodes 2 & 3 Packets
Retransmission
1
2&3
Slot
2
Retransmission
3
Time
Collision
4
Slotted ALOHA (cont.)
Pn ,n i
Qa (i, n),
Q (1, n)[1  Q (0, n)],

r
 a
Qa (1, n)Qr (0, n)  Qa (0, n)[1  Qr (1, n)],
Qa (0, n)Qr (1, n),
2  i  ( m  n)
i 1
i0
i  1
P succ  Qa (1, n)Qr (0, n)  Qa (0, n)Qr (1, n)
5
Throughput of Slotted ALOHA
• The probability of no collision is given by
P0  eG
• The throughput S is
S  G  P0  G  eG
• The Maximum throughput of slotted ALOHA is
S max 
1
 0.368
e
6
ALOHA
Waiting a random time
Node 1 Packet
Node 2 Packet
Retransmission
1
2
3
3
Retransmission
2
Time
Collision
Node 3 Packet
7
Throughput of ALOHA
• The probability that n packets arrive in two packets time is given by
Pn  
n
(2G) e2G
n!
where G is traffic load.
• The probability P(0) that a packet is successfully received without
collision is calculated by letting n=0 in the above equation. We get
P0  e2G
• We can calculate throughput S with a traffic load G as follows:
S  G  P0  G  e2G
• The Maximum throughput of ALOHA is
S max 
1
 0.184
2e
8
Comparison of Aloha and S-Aloha
0.5
0.4
0.368
0.3
S
Slotted Aloha
0.2
0.1
00
0.184
Aloha
2
4
G
G
6
8
9
CSMA: Carrier Sense Multiple Access
10
Contention Protocols
 CSMA (Carrier Sense Multiple Access)

Improvement: Start transmission only if no
transmission is ongoing
 CSMA/CD (CSMA with Collision Detection)

Improvement: Stop ongoing transmission if a
collision is detected
 CSMA/CA (CSMA with Collision Avoidance)

Improvement: Wait a random time and try again
when carrier is quiet. If still quiet, then transmit
11
Carrier Sense Multiple Access
 In many multiaccess systems--e.g., LANs--ready
station can determine if medium is idle before
transmitting


if medium is sensed as busy, ready station defers until
it becomes idle
collisions are still possible if two (or more) ready
stations sense idle at same time
Node 5 sense
Node 1 Packet
Node 2 Packet
Delay
Node 3 Packet
1
2
3
Delay
4
5
Collision
Time
12
Node 4 sense
CSMA
13
CSMA Slotted Aloha
 The major difference between CSMA Slotted Aloha
and ordinary slotted Aloha is that idle slots in CSMA
have a duration β.
 If a packet arrives at a node while a transmission is in
progress, the packet is regarded as backlogged and
begins transmission with probability qr after each
subsequent idle slot.
 Packets arriving during an idle slot are transmitted in
the next slot as usual.
 a.k.a. nonpersistent CSMA
14
nonpersistent CSMA
Idle Period
Collision!!
Time
Busy Period
15
CSMA Slotted Aloha Variations
 persistent CSMA



frames arriving during an idle slot β are transmitted at end of
the minislot
arrivals during busy period are transmitted as soon as
medium is sensed as idle (after β)
backlogged stations (holding collided frames) retransmit at
end of each idle minislot with probability qr
 P-Persistent CSMA



frames arriving during an idle minislot are transmitted at end
of the minislot
arrivals during busy period are transmitted at end of each
idle minislot with probability p
backlogged stations retransmit at end of each idle minislot
with probability qr < p
16
Mathematical analysis of nonpersistent
 Markov chain model (discrete time)
 state is number n of backlogged stations

each busy (success or collision) slot has unit length

each busy slot is followed by one (idle) minislot

each time step in the MC corresponds to a real
time interval of either b if no station transmits) or
1+ b if at least one station transmits)
17
CSMA Slotted Aloha Analysis
 At a transition into state n (i.e., at the end of
an idle slot), the prob. of no transmissions in
the following slot is e-λβ(1-qr)n.


The first term is the prob of no arrivals in the
previous idle slot
The second term is the prob of no
transmissions by the backlogged nodes
18
CSMA Slotted Aloha Analysis (cont.)
 The expected time (T) between state
transitions in the state n is β+(1-e-λβ(1-qr)n).
 Clearly, β ≦T ≦ β+1
 Using Little’s Theorem, the expected number
of arrivals between state transitions is:
E{arrival} = λ (β+1-e-λβ(1-qr)n)
19
CSMA Slotted Aloha Analysis (cont.)
 The expected number of departure between state
transitions in state n is simply the probability of a
successful transmission, that is given by:
Psucc  P[one arrival,no ret x]  P[ no arrival,one ret x]
(b )1 b
(b ) 0 b
n

e (1  qr ) 
e n(1  qr ) n 1 qr
1!
0!

qn 
  b  r e b (1  qr ) n
1  qr 

 The drift in state n is defined as the expected number
of arrivals less the expected number of departures
between state transitions.

qn
Dn   b  1  e b (1  qr ) n   b  r
1  qr



 b
e (1  qr ) n

20
CSMA Slotted Aloha Analysis (cont.)
 For small qr, (1- qr)n-1≒(1- qr)n ≒e-qrn
 Therefore,
Dn  (b  1  e g (n) )  g (n)e g (n)
 where g(n) = λβ+ qrn is the expected number of
attempted transmissions following a transition to state
n
 g (n)
g
(
n
)
e
 The drift is negative if  
b  1  e g ( n)
 The numerator is the expected number of departures
per state transition, and the denominator is the
expected duration of a state transition period; thus the
ratio can be interpreted as departure rate.
21
Departure Rate (i.e., throughput)
1
ge g
Departure rate:
b 1  e g
1  2b
λ
Arrival rate
Equilibrium
large backlog
g  2b
22
Throughput vs β
 Using GNUPlot
23
4.4.2: skip
CSMA unslotted Aloha
 When a packet arrives, the transmission starts
immediately if the channel is sensed to be idle.
 If the channel is sensed to be busy, or if the
transmission results in a collision, the packet is
regarded as backlogged.
 Each backlogged packet repeatedly attempts to
retransmit at randomly selected times separated by
independent, exponentially distributed random delays
τ, with prob density xe-xτ
24
CSMA unslotted Aloha (cont.)
 We assume a propagation and detection delay of β,
so that if one transmission starts at time t, another
node will not detect that the channel is busy until t+β,
thus causing the possibility of collisions.
 Consider an idle period that starts with a backlog of
n. The time until the first transmission starts is an
exponentially distributed R.V. with rate G(n)=λ+nx
 G(n) is the attempt rate in packets per unit time.
25
CSMA unslotted Aloha (cont.)
 A collision occurs if the next sensing is done
within time β. Thus, the prob that this busy
period is a collision is 1-e-βG(n)
 The prob of a transmission following an idle
period is e-βG(n)
 The expected time from the beginning of one
idle period until the next is 1/G(n) + (1+ β)


The first term is the expected time until the first
transmission starts
The second term is the time until the first
transmission ends and the channel is detected
as being idle again.
26
CSMA unslotted Aloha (cont.)
 The departure rate when the backlog is n is given by:
e  bG ( n )
1 / G(n)  (1  b )
 For small β, the maximum value occurs when
G(n)≒β-1/2, and the value is
1
1 2 b
 The MAX value is slightly smaller than the MAX
value of CSMA slotted Aloha. The reason is when
CSMA is not being used, collisions are somewhat
more likely fit a given attempt rate in an unslotted
system than a slotted system.
27
CSMA unslotted Aloha (cont.)
 However, in a slotted system, β would have to
be larger than in an unslotted system to
compensate for synchronization inaccuracies
and worst-case propagation delay.
 Thus, unslotted Aloha appears to be the
natural choice for CSMA.
28
4.4.4: skip
CSMA/CD: CSMA + Collision detection
29
CSMA/CD
 In CSMA protocols
 If two stations begin transmitting at the same time,
each will transmit its complete packet, thus wasting the
channel for an entire packet time
 In CSMA/CD protocols
 The transmission is terminated immediately upon the
detection of a collision
 CD = Collision Detect
30
CSMA/CD
31
CSMA/CD (cont’d)
 Sense the channel
 If idle, transmit immediately
 If busy, wait until the channel becomes idle
 Collision detection
 Abort a transmission immediately if a collision is
detected
 Try again later after waiting a random amount of time
32
CSMA/CD (cont’d)
 Carrier sense

reduces the number of collisions
 Collision detection

reduces the effect of collisions, making the
channel ready to use sooner
33
Slotted CSMA/CD
 We visualize S-CSMA/CD in terms of slots and
minislots.
 The minislots are of duration β, which denotes the
time required for a signal to propagate from one end
of the cable to the other and to be detected.
 If the nodes are all synchronized into minislots of this
duration, and if one node transmits in a minislot, all
the other nodes will detect the transmission and not
use subsequent minislots until the entire packet is
completed.
34
Slotted CSMA/CD (cont.)
 If more than one node transmits in a minislot,
each transmitting node will detect the
condition by the end of the minislot and cease
transmitting.
 Thus, the minislots are used in a contention
mode, and when a successful transmission
occurs in a minislot, it effectively reserves the
channel for the completion of the packet.
35
Slotted CSMA/CD (cont.)
 We assume each backlogged node transmits
after each idle slot with prob qr
 The node transmitting rate after an idle slot is
Poisson with parameter g(n)=λβ+ qrn
 Consider state transitions at the ends of idle
slots: if no transmissions occur, the next idle
slot ends after time β; if one transmission
occurs, the next idle slot ends after 1+ β
36
Slotted CSMA/CD (cont.)
 Variable-length packets are allowed here, but
the packet durations should be multiples of
the idle slot durations.
 For simplicity, we assume the expected
packet duration is 1.
 Finally, if a collision occurs, the next idle slot
ends after 2β, i.e. nodes must hear an idle
slot after the collision to know that it is safe to
transmit.
37
Slotted CSMA/CD (cont.)
 The expected length of the interval between
state transitions is:
E{interval}=β+g(n)e-g(n)+β[1-(1+g(n)) e-g(n)]


The second term is 1 times the success prob
The third term is the additional β times the
collision prob
 The prob of success is g(n)e-g(n)
 The drift in state n is λE{interval} - Psucc
38
Slotted CSMA/CD (cont.)
 The departure rate in state n is
g ( n )e  g ( n )
b  g (n)e  g ( n )  b 1  (1  g (n))e  g ( n )


 This quantity is maximized over g(n) at g(n)=0.77, and
the resulting value is 1/(1+3.31β)
 The constant (i.e. 3.31) is dependent on the detailed
assumptions of the system. However, if β is very small,
this constant is not very important.
 Unslotted CSMA/CS makes more sense due to the
difficulty of perfect synchronizing on short minislots.
39
Unslotted CSMA/CD
 Suppose a node at one end starts to transmit, and
then, almost β time units later, a node at the other
end starts. The 2nd node ceases its transmission
almost immediately upon hearing the 1st node, but
nonetheless causes errors in the first packet and
forces the 1st node to stop transmission another β
time units later.
Node 1 starts
Node 2 heard
Node 1 stops
Time
Propagation
delay
Node 2 starts
Node 1 heard
Node 2 stops
40
Unslotted CSMA/CD (cont.)
 Nodes closer together on the cable detect collisions
faster than those more spread apart.
 As a result, the MAX throughput achievable with
Ethernet depends on the arrangement of nodes on
the cable and is very complex to calculate exactly.
 Goal: to find bounds on all the relevant parameters
from the end of one transmission to the end of the
next in order to get a conservative bound on max
throughput!
41
Unslotted CSMA/CD (cont.)
 Assume that each node initiates transmissions according to an
independent Poisson process whenever it senses the channel
idle, and the overall rate is G.
 All nodes sense the beginning of an idle period at most β after the
end of a transmission.
 The expected time to the beginning of the next transmission is at
most 1/G.
 The next packet will collide with some later starting packet with
prob at most 1-e-βg
 The colliding packet will cease transmission after at most 2β
 The packet will be successful with prob at least e-βg and will
occupy 1 time unit.
42
Unslotted CSMA/CD (cont.)
 The departure rate S for a given G is the success
prob divided by the expected time of a success or
collision; so
 bG
S
e
b  1 / G  2b (1  e bG )  e bG
 The MAX occurs at
bG 
13  1
 0.43
6
 The corresponding MAX value is
S
1
1  6 .2 b
 This analysis is very conservative, but if β is very
small, throughputs very close to 1 can be achieved.
43
Unslotted CSMA/CD (cont.)
 The MAX stable throughput approaches 1 with decreasing
β; whereas the approach is as a constant times β1/2 for
CSMA.
 The reason for the difference is that collisions are not very
costly with CSMA/CD, and thus much higher attempt rates
can be used.
 CSMA/CD (and CSMA) becomes increasingly inefficient
with increasing bus length (i.e. β), with increasing data rate
(i.e. C), and with decreasing data packet size (i.e. L). ps:
C
b
L
44
IEEE 802 LANs
 LAN: Local Area Network
 What is a local area network?


A LAN is a network that resides in a
geographically restricted area
LANs usually span a building or a campus
45
Characteristics of LANs
 Short propagation delays
 Small number of users
 Single shared medium (usually)
 Inexpensive
46
Common LANs
 Bus-based LANs
 Ethernet (*)
 Token Bus (*)
 Ring-based LANs
 Token Ring (*)
 Switch-based LANs
 Switched Ethernet
 ATM LANs
(*) IEEE 802 LANs
47
OSI Layers and IEEE 802
OSI layers
Higher Layers
IEEE 802 LAN standards
Higher Layers
802.2 Logical Link Control
Data Link Layer
Physical Layer
802.3 802.4 802.5
Medium Access Control
CSMA/CD Token-passing Token-passing
bus
bus
ring
48
IEEE 802 Standards
802.1: Introduction
802.2: Logical Link Control (LLC)
802.3: CSMA/CD (Ethernet)
802.4: Token Bus
802.5: Token Ring
802.6: DQDB
802.11: CSMA/CA (Wireless LAN)
49
Summary
50
4.5.1, 4.5.3, 4.5.4, 4.5.5, 4.5.6, 4.6: skip