Title: Link Layer: Partitioning Dimensions; Media Access Control using Aloha
1Link LayerPartitioning DimensionsMedia Access
Control using Aloha
 Y. Richard Yang
 11/01/2012
2Outline
 Admin. and recap
 Intro to link layer
 Media access control
 ALOHA protocol
3Admin.
 Assignment 3
 Due date coming Monday
 Check web site for office hours and FAQs
 Project proposal (due Friday)
 Please send email to cs434ta_at_cs.yale.edu by end
of day  Subject Project Proposal
 Content
 Team members
 Topic
 One paragraph rough idea
 Exam next Tuesday in class
4Recap
 App layer
 Handles issues such as UI
 Uses lowerlayer provided abstractions, e.g.,
 network abstraction
 e.g., HttpURLConnection in GoogleSearch Example
 location service abstraction
 e.g., Location Manager, and Location Listener in
Assignment 3  Physical layer capability
 sender sends a seq. of bits to a receiver
5App Layer Logical Communications
 E.g. application
 provide services to users
 application protocol
 send messages to peer
6Physical Communication
7Protocol Layering and Meta Data
 Each layer takes data from above
 adds header (meta) information to create new data
unit  passes new data unit to layer below
8Link layer Context
 Datalink layer has responsibility of
transferring datagram from one node to another
node  Datagram may be transferred by different link
protocols over different links, e.g.,  Ethernet on first link,
 frame relay on intermediate links
 802.11 on last link
 transportation analogy
 trip from New Haven to San Francisco
 taxi home to union station
 train union station to JFK
 plane JFK to San Francisco airport
 shuttle airport to hotel
9Main Link Layer Services
 Framing
 encapsulate datagram into frame, adding header,
trailer and error detection/correction  Multiplexing/demultiplexing
 use frame headers to identify src, hop dest
 Media access control
 Reliable delivery between adjacent nodes
 seldom used on low bit error link (fiber, some
twisted pair)  common for wireless links high error rates
10Link Adaptors
datagram
receiving node
link layer protocol
sending node
adapter
adapter
 link layer typically implemented in adaptor
(aka NIC)  Ethernet card, modem, 802.11 card
 adapter is semiautonomous, implementing link
physical layers
 sending side
 encapsulates datagram in a frame
 adds error checking bits, rdt, flow control, etc.
 receiving side
 looks for errors, rdt, flow control, etc
 extracts datagram, passes to receiving node
11Outline
 Recap
 Introduction to link layer
 Wireless link access control
12Wireless Access Problem
 Single shared broadcast channel
 thus, if two or more simultaneous transmissions
by nodes, due to interference, only one node can
send successfully at a time
13Wireless Access Problem
 The general case is challenging and largely still
open  We start with the simplest scenario (e.g., 802.11
or cellular up links) in this class  a single receiver (the Access Point)
14Multiple Access Control Protocol
 Protocol that determines how nodes share channel,
i.e., determines when nodes can transmit  Communication about channel sharing must use
channel itself !  Discussion properties of an ideal multiple
access protocol.
15Ideal Mulitple Access Protocol
 Efficient
 Fair/rate allocation
 Simple
16MAC Protocols a Taxonomy
 Goals
 efficient, fair, simple
 Three broad classes
 channel partitioning
 divide channel into smaller pieces (time slot,
frequency, code)  nonpartitioning
 random access
 allow collisions
 takingturns
 a token coordinates shared access to avoid
collisions
17Outline
 Recap
 Introduction to link layer
 Wireless link access control
 partitioning dimensions
18FDMA
 FDMA frequency division multiple access
 Channel divided into frequency bands
 A transmission uses a frequency band
19TDMA
 TDMA time division multiple access
 Time divides into frames frame divides into
slots  A transmission uses a slot in a frame
20Example GSM
 A GSM operator uses TDMA and FDMA to divide its
allocated frequency  divide allocated spectrum into different physical
channels each physical channel has a frequency
band of 200 kHz  partition the time of each physical channel into
frames each frame has a duration of 4.615 ms  divides each frame into 8 time slots (also called
a burst)  each slot is a logical channel
 user data is transmitted through a logical channel
21GSM  TDMA/FDMA
22SDMA
 SDMA space division multiple access
 Transmissions at different locations, if far
enough, can transmit simultaneously (same freq.)  Example the cellular technique
Suppose 24 MHz spectrum, 30 K per user
Q why not divide into infinite small cells?
23CDMA
 CDMA (Code Division Multiple Access)
 Unique code assigned to each user i.e., code
set partitioning  All transmissions share the same frequency and
time each transmission uses DSSS, and has its
own chipping sequence (i.e., code) to encode
data  e.g. code 1 1 1 1 1 1 1
Examples Sprint and Verizon, WCDMA
24DSSS Revisited
tb
user data d(t)
1
1
X
tc
code c(t)
1
1
1
1
1
1
1
1
1
1
1
1
1
1
resulting signal
1
1
1
1
1
1
1
1
1
1
1
1
1
1
tb bit period tc chip period
25Illustration CDMA/DSSS Using BPSK
 Assume BPSK modulation using carrier frequency f
 yi(t) A xi(t)ci(t) sin(2? ft)
 A amplitude of signal
 f carrier frequency
 xi(t) data of user i in 1, 1
 ci(t) code of i (a chipping sequence in 1,
1)  Suppose only i transmits
 y(t) yi(t)
 Decode at receiver i
 incoming signal multiplied by ci(t) sin(2? ft)
 since, ci(t) ci(t) 1, yi(t)ci(t) sin(2?
ft) A xi(t) sin2(2?ft)
26Illustration Multiple User CDMA
 Assume M users simultaneously transmit y(t)
y1(t) y2(t) yM(t)  At receiver i, incoming signal y(t) multiplied by
ci(t) sin(2? ft)  consider the effect of js transmission
 yj(t)ci(t) sin(2? ft) A cj(t)ci(t)xj(t)
sin2(2? fct)
27CDMA Deal with MultipleUser Interference
 Two codes Ci and Cj are orthogonal, if
 , where we use . to denote inner
product, e.g.  If codes are orthogonal, multiple users can
coexist and transmit simultaneously with
minimal interference
C1 1 1 1 1 1 1
1 1 C2 1 1 1 1
1 1 1 1 
 C1 . C2 1 (1)
1 (1) 1 1 (1)(1)0
Analogy Speak in different languages!
28Capacity of CDMA
B
 In realistic setup, cancellation of others
transmission is incomplete  Assume the received power at base station from
all nodes is the same P (how?)  The power of the transmission with known code is
increased to N P, where N is chipping expansion
factor  The others remain on the order of P
 Assume a total of M users
 Then
For IS95 CDMA, N 1.25M/4800 260
29Generating Orthogonal Codes
 The most commonly used orthogonal codes in
current CDMA implementation are the Walsh Codes
30Walsh Codes
1,1,1,1,1,1,1,1
...
1,1,1,1
1,1,1,1,1,1,1,1
1,1
1,1,1,1,1,1,1,1
...
1,1,1,1
X,X
1,1,1,1,1,1,1,1
1
X
1,1,1,1,1,1,1,1
X,X
...
1,1,1,1
1,1,1,1,1,1,1,1
1,1
n
2n
1,1,1,1,1,1,1,1
...
1,1,1,1
1,1,1,1,1,1,1,1
1
2
4
8
31Orthogonal Variable Spreading Factor (OSVF)
 Variable codes Different users use different
lengths spreading codes  Orthogonal diff. users codesare orthogonal
1,1,1,1,1,1,1,1
...
1,1,1,1
1,1,1,1,1,1,1,1
1,1
1,1,1,1,1,1,1,1
...
1,1,1,1
X,X
1,1,1,1,1,1,1,1
1
X
1,1,1,1,1,1,1,1
X,X
...
1,1,1,1
1,1,1,1,1,1,1,1
1,1
SFn
SF2n
1,1,1,1,1,1,1,1
...
1,1,1,1
1,1,1,1,1,1,1,1
SF1
SF2
SF4
SF8
If user 1 is given code 1,1, what orthogonal
codes can we give to other users?
32WCDMA Orthognal Variable Spreading Factor (OSVF)
 Flexible code (spreading factor) allocation
 up link SF 4 256
 down link SF 4  512
WCDMA downlink
33Summary
 SDMA, TDMA, FDMA and CDMA are basic media
partitioning techniques  divide media into smaller pieces (space, time
slots, frequencies, codes) for multiple
transmissions to share  A remaining question is how does a network
allocate space/time/freq/code?
34Outline
 Recap
 Introduction to link layer
 Wireless link access control
 partitioning dimensions
 media access protocols
35GSM Logical Channels and Request
 Control channels
 Broadcast control channel (BCCH)
 from base station, announces cell identifier,
synchronization  Common control channels (CCCH)
 paging channel (PCH) base transceiver station
(BTS) pages a mobile host (MS)  random access channel (RACH) MSs for initial
access, slotted Aloha  access grant channel (AGCH) BTS informs an MS
its allocation  Dedicated control channels
 standalone dedicated control channel (SDCCH)
signaling and short message between MS and an MS  Traffic channels (TCH)
BTS
MS
SDCCH message exchange
Communication
36Slotted Aloha Norm Abramson
 Time is divided into equal size slots ( pkt
trans. time)  Node with new arriving pkt transmit at beginning
of next slot  If collision retransmit pkt in future slots with
probability p, until successful.
A
B
Success (S), Collision (C), Empty (E) slots
37Slotted Aloha Efficiency
 Q What is the fraction of successful slots?
 suppose n stations have packets to send
 suppose each transmits in a slot with probability
p   prob. of succ. by a specific node p
(1p)(n1) 
  prob. of succ. by any one of the N nodes
 S(p) n Prob (only one transmits)
 n p (1p)(n1)
38Goodput vs. Offered Load Curve
S throughput goodput (success rate)
1.5
2.0
0.5
1.0
Define G offered load np
 when G (pn) lt 1, as p (or n) increases
 probability of empty slots reduces
 probability of collision is still low, thus
goodput increases  when G (pn) gt 1, as p (or n) increases,
 probability of empty slots does not reduce much,
but  probability of collision increases, thus goodput
decreases  goodput is optimal when G (pn) 1
39Maximum Efficiency vs. n
1/e 0.37
40Dynamics of (Slotted) Aloha
 In reality, the number of stations backlogged is
changing  we need to study the dynamics when using a fixed
transmission probability p  Assume we have a total of m stations (the
machines on a LAN)  n of them are currently backlogged, each tries
with a (fixed) probability p  the remaining mn stations are not backlogged.
They may start to generate packets with a
probability pa, where pa is much smaller than p
41Model
n backlogged each transmits with prob. p
mn unbacklogged
each transmits with prob. pa
42Dynamics of Aloha Effects of Fixed Probability
  assume a total of
 m stations
 pa ltlt p
 success rate is thedeparture rate, the rate
the backlog is reducing
dep. and arrival rate of backlogged stations
n number of backlogged stations
m
0
offered load 1
Lesson if we fix p, but n varies, we may have an
undesirable stable point
43Backup Slides Error Corrections Codes
44ReedSolomon Codes
 Very commonly used, send nsymbols for k data
symbols  e.g., n 255, k 223
 We will discuss the original version (1960)
 modern versions are slightly different they use
generator polynomial, but the idea is essentially
the same  If the data we want to send is (x0, x1,, xk1),
where xi are data symbols, define polynomial
P(t) x0 x1t x2t xk1tk1  Assume ? is a generator of the symbol field
(i.e., ?i not equal to ?j if i not equal to j)  Then for the data sequence, send
 P(0), P(?), P(?2), P(?n1) to
receiver
45ReedSolomon Codes
 Receive the message P(0), P(?), P(?2), P(?n1)
 If no error, can recover data from any k
equations
since any k equations are independent, they have
a unique solution
46ReedSolomon Codes Handling Errors
 But, what if s errors occur during transmission?
 Keep a counter (vote) for each solution
 Enumerate all combinations of k equations, for
each combination, solve it, and increase the
counter of the solution  Identify the solution which gets the largest of
votes
47ReedSolomon Codes
 The transmitted data is the correct solution for
ns equations, and thus gets 
 votes (i.e., combinations of k equations)
 An incorrect solution can satisfy at most k1s
equations, and the of votes it can get is at
most
48ReedSolomon Codes
 If
 or (ns gt k 1 s) or (nk gt 2s 1) or (nk ?
s), it can correct any s errors
49ReedSolomon Codes
 The votingbased decoding algorithm proposed in
1960 is inefficient  1967  Berlekamp introduced first truly efficient
algorithm for both binary and nonbinary codes.
Complexity increases linearly with number of
errors  1975  Sugiyama, et al. Showed that Euclids
algorithm can be used to decode RS codes  Below is a typical current decoder
50Pure (unslotted) Aloha
 Unslotted Aloha simpler, no clock
synchronization  Whenever pkt needs transmission
 send without awaiting for the beginning of slot
 Collision probability increases
 pkt sent at t0 collide with other pkts sent in
t01, t01
51Pure Aloha (cont.)
 Assume a node transmit with probability p in one
unit of time  P(success by a given node) P(node transmits)

P(no other node transmits in t01,t0 
P(no other node transmits in t0, t01  p .
(1p)n1 . (1p)n1  p .
(1p)2(n1)  P(success by any of N nodes) n p . (1p)2(n1)

  Bound 1/(2e) .18
52Goodput vs. Offered Load
0.4
0.3
S throughput goodput (success rate)
0.2
0.1
1.5
0.5
1.0
2.0
G offered load Np