40
Eytan Modiano Slide 1 Packet Multiple Access Eytan Modiano Massachusetts Institute of Technology

Packet Multiple Accessmedard/new/6.02s/Thursday_AMem.pdf · Eytan Modiano Slide 2 Multiple Access • Shared Transmission Medium – a receiver can hear multiple transmitters –

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Eytan ModianoSlide 1

Packet Multiple Access

Eytan ModianoMassachusetts Institute of Technology

Eytan ModianoSlide 2

Multiple Access

• Shared Transmission Medium– a receiver can hear multiple transmitters– a transmitter can be heard by multiple receivers

• 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

Eytan ModianoSlide 3

Examples of Multiple Access Channels

• Local area networks (LANs)– Traditional Ethernet– Recent trend to non-multi-access LANs

• satellite channels

• Multi-drop telephone

• Wireless radio

NET

DLC

PHY

MAC

LLC

• Medium Access Control (MAC)– Regulates access to channel

• Logical Link Control (LLC)– All other DLC functions

Eytan ModianoSlide 4

Approaches to Multiple Access

• Fixed Assignment (TDMA, FDMA, CDMA)– each node is allocated a fixed fraction of bandwidth– Equivalent to circuit switching– very inefficient for low duty factor traffic

• Contention systems– Polling

– Reservations and Scheduling

– Random Access

Eytan ModianoSlide 5

Aloha

Single receiver, many transmitters

Receiver

Transmitters

....

E.g., Satellite system, wireless

Eytan ModianoSlide 6

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

Success CollisionIdle Idle Success

1 2 3 4 5

Eytan ModianoSlide 7

Slotted Aloha Assumptions

• Poisson external arrivals• No capture

– Packets involved in a collision are lost– Capture models are also possible

• Immediate feedback– Idle (0) , Success (1), Collision (e)

• If a new packet arrives during a slot, transmit in next slot• If a transmission has a collision, node becomes backlogged

– while backlogged, transmit in each slot with probability qr until successful

• Infinite nodes where each arriving packet arrives at a new node– Equivalent to no buffering at a node (queue size = 1) – Pessimistic assumption gives a lower bound on Aloha performance

Eytan ModianoSlide 8

0 1 2 3

P

P

PP34

10

0313

Markov chain for slotted aloha

• state (n) of system is number of backlogged nodes.

pi,i-1 = prob. of one backlogged attempt and no new arrival

pi,i =prob. of one new arrival and no backlogged attempts or no new arrival and no success

pi,i+1= prob of one new arrival and one or more backlogged attempts

pi,i+j = Prob. Of J new arrivals and one or more backlogged attempts or J+1 new arrivals and no backlogged attempts

• Steady state probabilities do not exists– Backlog tends to infinity => system unstable– More later

Eytan ModianoSlide 9

slotted aloha

• let g(n) be the attempt rate (the expected number of packets transmitted in a slot) in state n

g(n) = λ + nqr

• The number of attempted packets per slot in state n is approximately a Poisson random variable of mean g(n)

– P (m attempts) = g(n)me-g(n)/m!– P (idle) = probability of no attempts in a slot = e-g(n)

– p (success) = probability of one attempt in a slot = g(n)e-g(n)

– P (collision) = P (two or more attempts) = 1 - P(idle) - P(success)

Eytan ModianoSlide 10

Throughput of Slotted Aloha

• The throughput is the fraction of slots that contain a successful transmission = P(success) = g(n)e-g(n)

– When system is stable throughput must also equal the external arrival rate (λ)

– What value of g(n) maximizes throughput?

– g(n) < 1 => too many idle slots– g(n) > 1 => too many collisions– If g(n) can be kept close to 1, an external arrival rate of 1/e packets

per slot can be sustained

ddg(n)

g(n)e−g(n) = e−g(n) − g(n)e−g(n) = 0

⇒ g(n) = 1⇒ P(success) =g(n)e−g(n) = 1/ e ≈ 0.36

e

1

-1

Departure rateg(n)e-g(n)

g(n)

Eytan ModianoSlide 11

Instability of slotted aloha

• if backlog increases beyond unstable point (bad luck) then it tends to increase without limit and the departure rate drops to 0

• Drift in state n, D(n) is the expected change in backlog over one time slot

– D(n) = λ - P(success) = λ - g(n)e-g(n)

G=0

e

G=1

Ge-G

-1

λ

G = + nqλ r

Arrival rate

Departure rate

Stable Unstable

negative drift

positive drift

negative drift

positive drift

Eytan ModianoSlide 12

Stabilizing slotted aloha

• choosing qr small increases the backlog at which instability occurs ( since g(n) = λ + nqr), but also increases delay (since mean retry time is 1/qr)

• solution: estimate the backlog (n) from past feedback – Given the backlog estimate, choose qr to keep g(n) = 1

Assume all arrivals are immediately backlogged g(n) = nqr , P(success) = nqr (1-qr)n-1

To maximize P(success) choose qr = min{1,1/n}– When the estimate of n is perfect:

idles occur with probability 1/e, successes with 1/e, and collisions with 1-2/e.

– When the estimate is too large, too many idle slots occur– When the estimate is too small, too many collisions occur

• Nodes can use feedback information (0,1,e) to make estimates– A good rule is increase the estimate of n on each collision, and to

decrease it on each idle slot or successful slot note that the increase on a collision should be (e-2)-1 times as large as the

decrease on an idle slot

Eytan ModianoSlide 13

stabilized slotted aloha

• assume all arrivals are immediately backlogged – g(n) = nqr = attempt rate– p(success) = nqr (1-qr)n-1

for max throughput set g(n) = 1 => qr = min{1,1/n’}where n’ is the estimate of n

– Let nk = estimate of backlog after kth slot

max {λ, nk+λ-1} idle or successnk+1 =

nk+λ+(e-2)-1 collision

– Can be shown to be stable for λ < 1/e

Eytan ModianoSlide 14

TDM vs. slotted aloha

• Aloha achieves lower delays when arrival rates are low• TDM results in very large delays with large number of users, while

Aloha is independent of the number of users

0 0.2 0.4 0.6 0.8

ARRIVAL RATE

4

8

DELAY

ALOHA

TDM, m=8

TDM, m=16

Eytan ModianoSlide 15

Pure (unslotted) Aloha

• New arrivals are transmitted immediately (no slots) – No need for synchronization– No need for fixed length packets

• A backlogged packet is retried after an exponentially distributed random delay with some mean 1/x

• The total arrival process is a time varying Poisson process of rate g(n) = λ + nx (n = backlog, 1/x = ave. time between retransmissions)

• Note that an attempt suffers a collision if the previous attempt is not yet finished (ti-ti-1<1) or the next attempt starts too soon (ti+1-ti<1)

t t t1 2 3 t 4 t 5

Retransmission

New Arrivals

43τ τ

Collision

Eytan ModianoSlide 16

Throughput of Unslotted Aloha

• An attempt is successful if the inter-attempt intervals on both sides exceed 1 (for unit duration packets)

– P(success) = e-g(n) e-g(n) = e-2g(n)

– Throughput (success rate) = g(n) e-2g(n)

– For max throughput at g(n) = 1/2, Throughput = 1/2e ~ 0.18

– Stabilization issues are similar to slotted aloha

– Advantages of unslotted aloha are simplicity and possibility of unequal length packets

Eytan ModianoSlide 17

Splitting Algorithms

• More efficient approach to resolving collisions– Simple feedback (0,1,e)– Basic idea: assume only two packets are involved in a collision

Suppose all other nodes remain quiet until collision is resolved, and nodes in the collision each transmit with probability 1/2 until one is successful

On the next slot after this success, the other node transmits

The expected number of slots for the first success is 2, so the expected number of slots to transmit 2 packets is 3 slots

Throughput over the 3 slots = 2/3

– In practice above algorithm cannot really work Cannot assume only two users involved in collision Practical algorithm must allow for collisions involving unknown number

of users

Eytan ModianoSlide 18

Tree algorithms

• After a collision, all new arrivals and all backlogged packets not in the collision wait

• Each colliding packet randomly joins either one of two groups (Left and Right groups)

– Toss of a fair coin– Left group transmits during next slot while Right group waits

If collision occurs Left group splits again (stack algorithm) Right group waits until Left collision is resolved

– When Left group is done, right group transmits(1,2,3,4)

(1,2,3)4

successcollision

1

success(2,3)

collision

idle

collision

(2,3)

2 3success success

Notice that after the idle slot, collision between (2,3) was sure to happen and could have been avoided

Many variations and improvementson the original tree splitting algorithm

Eytan ModianoSlide 19

Throughput comparison

• stabilized pure aloha T = 0.184 = (1/(2e))

• stabilized slotted aloha T = 0.368 = (1/e)

• Basic tree algorithm T = 0.434

• Best known variation on tree algorithm T = 0.4878

• Upper bound on any collision resolution algorithm with (0,1,e) feedback T <= 0.568

• TDM achieves throughputs up to 1 packet per slot, but the delay increases linearly with the number of nodes

Eytan ModianoSlide 20

Carrier Sense Multiple Access (CSMA)

• In certain situations nodes can hear each other by listening to the channel - “Carrier Sensing”

• CSMA: Polite version of Aloha– Nodes listen to the channel before they start transmission

Channel idle => Transmit Channel busy => Wait (join backlog)

– When do backlogged nodes transmit?

When channel becomes idle backlogged nodes attempt transmission with probability qr= 1

Persistent protocol, qr= 1

Non-persistent protocol, qr< 1

Eytan ModianoSlide 21

CSMA

• Let τ = the maximum propagation delay on the channel– When a node starts/stops transmitting, it will take this long for all

nodes to detect channel busy/idle

• For initial understanding, view the system as slotted with "mini-slots" of duration equal to the maximum propagation delay

– Normalize the mini-slot duration to β = τ/Dtp and packet duration = 1

• Actual systems are not slotted, but this hypothetical system simplifies the analysis and understanding of CSMA

β <−−>minislotspacket

<----------- 1 ---------------->

Eytan ModianoSlide 22

Rules for slotted CSMA

• When a new packet arrives– If current mini-slot is idle, start transmitting in the next mini-slot– If current mini-slot is busy, node joins backlog– If a collision occurs, nodes involved in collision become backlogged

• Backlogged nodes attempt transmission after an idle mini-slot with probability qr < 1 (non-persistent)

– Transmission attempts only follow an idle mini-slot– Each”busy-period” (success or collision) is followed by an idle slot

before a new transmission can begin

• Time can be divided into epochs:– A successful packet followed by an idle mini-slot (duration = β+1)– A collision followed by an idle mini-slot (duration = β+1)– An idle minislot (duration = β)

Eytan ModianoSlide 23

�Analysis of CSMA

• Let the state of the system be the number of backlogged nodes

• Let the state transition times be the end of idle slots– Let T(n) = average amount of time between state transitions when the

system is in state nT(n) = β + (1 - e-λβ (1-qr)n)

When qr is small (1-qr)n ~ e-qrn => T(n) = β + (1 - e-λβ−nq

r )

• At the beginning of each epoch, each backlogged node transmits with probability qr

• New arrivals during the previous idle slot are also transmitted

• With backlog n, the number of packets that attempt transmission at the beginning of an epoch is approximately Poisson with rate

g(n) = λβ + nqr

Eytan ModianoSlide 24

Analysis of CSMA

• The probability of success (per epoch) is

Ps = g(n) e-g(n)

• The expected duration of an epoch is approximately

T(n) ~ β + (1 - e-g(n) )

• Thus the success rate per unit time is

λ < departure rate=g(n)e− g(n)

β +1− e− g(n)

Eytan ModianoSlide 25

Maximum Throughput for CSMA

• The optimal value of g(n) can again be obtained:

• Tradeoff between idle slots and time wasted on collisions

• High throughput when β is small

• Stability issues similar to Aloha (less critical)

Arrival rate

Departure rate1-¦2 β

β¦2g(n) = + nqλβ

r

g(n) ≈ 2β λ <1

1+ 2β

Eytan ModianoSlide 26

Unslotted CSMA

• Slotted CSMA is not practical– Difficult to maintain synchronization– Mini-slots are useful for understanding but not critical to the

performance of CSMA

• Unslotted CSMA will have slightly lower throughput due to increased probability of collision

• Unslotted CSMA has a smaller effective value of β than slotted CSMA

– Essentially β becomes average instead of maximum propagation delay

Eytan ModianoSlide 27

CSMA/CD

• CSMA with Collision Detection (CD) capability– Nodes able to detect collisions– Upon detection of a collision nodes stop transmission

Reduce the amount of time wasted on collisions

• Protocol:

– All nodes listen to transmissions on the channel

– When a node has a packet to send: Channel idle => Transmit Channel busy => wait a random delay (binary exponential backoff)

– If a transmitting node detects a collision it stops transmission Waits a random delay and tries again

Two way cable

WS WS WS WS WS WS

Eytan ModianoSlide 28

Time to detect collisions

• A collision can occur while the signal propagates between the two nodes

• It would take an additional propagation delay for both users to detect the collision and stop transmitting

• If τ is the maximum propagation delay on the cable then if a collision occurs, it can take up to 2τ seconds for all nodes involved in the collision to detect and stop transmission

WS WSττ = propdelay

Eytan ModianoSlide 29

Approximate model for CSMA/CD

• Simplified approximation for added insight

• Consider a slotted system with “mini-slots” of duration 2τ

• If a node starts transmission at the beginning of a mini-slot, by the end of the mini-slot either

– No collision occurred and the rest of the transmission will be uninterrupted

– A collision occurred, but by the end of the mini-slot the channel would be idle again

• Hence a collision at most affects one mini-slot

2τ <−−>minislotspacket

<----------- 1 ---------------->

Eytan ModianoSlide 30

Analysis of CSMA/CD

• Assume N users and that each attempts transmission during a free “mini-slot” with probability p

– P includes new arrivals and retransmissions

P(i users attempt) = Ni

⎝ ⎜ ⎜

⎠ ⎟ ⎟ Pi(1− P)N −i

P(exactly 1 attempt) = P(success) = NP(1-P)N-1

To maximize P(success),

ddp

[NP(1- P)N-1] = N(1-P)N-1 −N(N −1)P(1− P)N− 2 = 0

⇒ Popt =1N

⇒ Average attempt rate of one per slot

⇒ Notice the similarity to slotted Aloha

Eytan ModianoSlide 31

Analysis of CSMA/CD, continued

• Once a mini-slot has been successfully captured, transmission continues without interruption

• New transmission attempts will begin at the next mini-slot after the end of the current packet transmission

P(success) =NP(1- p)N-1 = (1−1N

)N −1

Ps = limit (N → ∞) P(success) = 1e

Let X = Average number of slots per succesful transmission

P(X = i) = (1- Ps)i −1Ps

⇒ E[X] = 1Ps

= e

Eytan ModianoSlide 32

Analysis of CSMA/CD, continued

• Let S = Average amount of time between successful packet transmissions

S = (e-1)2τ + DTp + τ

• Efficiency = DTp/S = DTp / (DTp + τ + 2τ(e-1))

• Let β = τ/ DTp => Efficiency ≈ 1/(1+4.4β) = λ < 1/(1+4.4β)

• Compare to CSMA without CD where

Ave time until start of next Mini-slot

Packet transmission timeIdle/collisionMini-slots

λ <1

1+ 2β

Eytan ModianoSlide 33

Notes on CSMA/CD

• Can be viewed as a reservation system where the mini-slots are used for making reservations for data slots

• In this case, Aloha is used for making reservations during the mini-slots

• Once a users captures a mini-slot it continues to transmit without interruptions

• In practice, of course, there are no mini-slots

– Minimal impact on performance but analysis is more complex

Eytan ModianoSlide 34

CSMA/CD examples

• Example (Ethernet)– Transmission rate = 10 Mbps– Packet length = 1000 bits, DTp = 10-4 sec– Cable distance = 1 mile, τ = 5x10-6 sec

– β = 5x10-2 and E = 80%

• Example (GEO Satellite) - propagation delay 1/4 second– β = 2,500 and E ~ 0%

• CSMA/CD only suitable for short propagation scenarios!

• How is Ethernet extended to 100 Mbps?

• How is Ethernet extended to 1 Gbps?

Eytan ModianoSlide 35

Token rings

• Token rings were developed by IBM in early 1980’s

• Token: a bit sequence– Token circulates around the ring

Busy token: 01111111 Free token: 01111110

• When a node wants to transmit– Wait for free token– Remove token from ring (replace with busy token)– Transmit message– When done transmitting, replace free token on ring

– Nodes must buffer 1 bit of data so that a free token can be changed to a busy token

• Token ring is basically a polling system Token does the polling

Token Ring

Eytan ModianoSlide 36

TOKEN BUSES

• Special control packet serves as a token• Nodes must have token to transmit• Token is passed from node to node in some order

– Conceptually, a token bus is the same as a token ring

– When one node finishes transmission, it sends an idle token to the next node (by addressing the control packet properly)

– Similar to a polling system• Issues

– Efficiency lower than token rings due to longer transmission delay for the packets and longer propagation delays

– Need protocol for joining and leaving the bus

WS WS WS WS WS WS

Eytan ModianoSlide 37

Large propagation delay(satellite networks)

• Satellite reservation system– Use mini-slots to make reservation for longer data slots– Mini-slot access can be inefficient (Aloha, TDMA, etc.)

• A crude approximation: delay is 3/2 times the propagation delay plus ideal queueing delay.

1 2 3 4 5

A = mv

Reservation Interval

Data Interval

Reservation Interval

Frame

Res Data Res Data DataRes Res

Arrival

Wait for Reser- vation Interval

Propagation Delay

Wait for Assigned Data Slot

Transmit

Eytan ModianoSlide 38

Satellite Reservations

• Frame length must exceed round-trip delay– Reservation slots during frame j are used to reserve data slots in

frame j+1– Variable length: serve all requests from frame j in frame j+1

Difficult to maintain synchronization Difficult to provide QoS (e.g., support voice traffic)

– Fixed length: Maintain a virtual queue of requests• Reservation mechanism

– Scheduler on board satellite– Scheduler on ground– Distributed queue algorithm

All nodes keep track of reservation requests and use the same algorithm to make reservation

• Control channel access– TDMA: Simple but difficult to add more users– Aloha: Can support large number of users but collision resolution

can be difficult and add enormous delay

Eytan ModianoSlide 39

Aloha Reservations

• Use Aloha to capture a slot • After capturing a slot user keeps the slot until done

– Other users observe the slot busy and don’t attempt• When done other users can go after the slot

– Other users observe the slot idle and attempt using Aloha• Method useful for long data transfers or for mixed voice and data

15 3 20 2

15 7 3 9 2

7 3 9

7 3 9 6

18 7 3 15 9 6

18

Slot 1 2 3 4 5 6

frame 1

frame 2

frame 3

frame 4

frame 5

idle

idle

idle

idle

Eytan ModianoSlide 40

Packet multiple access summary

• Latency: Ratio of propagation delay to packet transmission time– GEO satellite example: Dp = 0.5 sec, packet length = 1000 bits, R = 1Mbps

Latency = 500 => very high– LEO Satellite example: Dp = 0.1 sec

Latency = 100 => still very high– Over satellite channels data rate must be very low to be in a low latency

environment• Low latency protocols

– CSMA, Polling, Token Rings, etc.– Throughput ~ 1/(1+aα), α = latency, a = constant

• High latency protocols– Aloha is insensitive to latency, but generally low throughput

Very little delays– Reservation system can achieve high throughput

Delays for making reservations– Protocols can be designed to be a hybrid of Aloha and reservations

Aloha at low loads, reservations at high loads