CS434/534: Topics in Networked (Networking) Systems Wireless Foundation: OFDM Implementation Wireless MAC Layer Design Yang (Richard) Yang Computer Science Department Yale University 208A Watson Email: yry@cs.yale.edu http://zoo.cs.yale.edu/classes/cs434/
Outline Recap Wireless background Wireless MAC design Frequency domain Modulation and demodulation Wireless channels Wireless PHY design design for flat fading design for ISI what is ISI band limited ISI symbol wave shaping multi-path ISI equalization (Viterbi) OFDM Wireless MAC design
Admin. PS2 on wireless posted Please see potential projects
Recap: Inter-Symbol Interference (ISI) ISI happens when the signaling for one symbol leaks into that of another symbol Why does ISI happen? Band limit produced ISI Multipath produced ISI 1 2
Recap: Band-Limited ISI a g(t) A design of p(t) has no ISI iff folded spectrum is flat
Recap: Multipath ISI The problem: given received y[m], m = 1, …, L+2, where L is frame size and assume 3 delay taps (it is easy to generalize to D taps): y[1] = x[1] h0 + w[1] y[2] = x[2]h0 + x[1] h1 + w[2] y[3] = x[3]h0 + x[2]h1 + x[3] h2 + w[3] y[4] = x[4]h0 + x[3]h1 + x[2] h2 + w[4] y[5] = x[5]h0 + x[4]h1 + x[3] h2 + w[5] … y[L] = x[L]h0 + x[L-1]h1 + x[L-2]h2 + w[L] y[L+1] = x[L]h1 + x[L-1]h2 + w[L+1] y[L+2] = x[L]h2 + w[L+2] determine x[1], x[2], … x[L] http://en.wikipedia.org/wiki/Andrew_Viterbi
observe y[1] observe y[2] observe y[3] observe y[4] s[0] s[1] s[2] s[3] s[4] x[1]=0 x[2]=0 x[3]=0 00 000 000 x[3]=1 001 001 x[1]=1 x[2]=1 x[3]=0 01 010 010 x[3]=1 011 011 x[2]=0 x[3]=0 1 10 100 100 x[3]=1 x[2]=1 101 101 x[3]=0 11 110 110 x[3]=1 111 111 prob. of observing y[1]: w[1] = y[1]-x[1]h0 prob. of observing y[2]: w[2] = y[2]-x[1]h0-x[2]h1 prob. of observing y[4]: w[4] = y[4]-x[4]h0-x[3]h1-x[2]h2
Recap: Multiple Carrier Modulation and OFDM j i Despite wave shaping, there can be leak from one subcarrier to another subcarrier if integer number of cycles in [0, T]
OFDM Modulation
OFDM Implementation Take N symbols and place one symbol on each subcarrier (freq.) Q: complexity of the implementation strategy? Freq0 FreqN-1 Ts: per sample time
OFDM: Implementation Issue Hardware implementation can be expensive if we use one oscillator for each subcarrier Software implementation requires N multiplications per time output => N2 multi. per N outputs Freq0 FreqN-1
OFDM: Key Idea 2 Assume N outputs per symbol time T, fsc=1/T Consider data as coefficients in the frequency domain, use inverse Fourier transform to generate time-domain sequence
OFDM Implementation: FFT channel
OFDM Implementation Parallel data streams are used as inputs to an IFFT IFFT does multiplexing and modulation in one step !
Guard Interval: Removing ISI Orthogonal subcarriers remove inter-carrier interference Slow symbol rate reduces inter-symbol interference, but may still have ISI Basic idea of GI: skip the first part “damaged” signal 1 2 1 2 More details: Chap. 13.1.4 Gast
OFDM Guard Interval
OFDM Implementation http://proquest.safaribooksonline.com/0596100523?tocview=true
OFDM in 802.11a: Channels+Subcarriers Symbol time T = 1/312.5KHz = 3.2us Each physical channel is 20 MHz Each channel is divided into subcarriers (48 data, 4 pilot (requirement on subcarrier freq?) 5150 [MHz] 5180 5350 5200 36 44 center frequency = 5000 + 5*channel number [MHz] channel# 40 48 52 56 60 64 149 153 157 161 5220 5240 5260 5280 5300 5320 5725 5745 5825 5765 5785 5805
OFDM in 802.11a: FFT + GI 64 samples FFT + 16 GI http://standards.ieee.org/getieee802/download/802.11a-1999.pdf OFDM in 802.11a: FFT + GI 64 samples FFT + 16 GI Office: delay spread 40-70 ns (up to 200 ns)
Other Multipath Techniques There are other techniques to handle multipath such as Rake Receiver See backup slides for some details
Summary of Wireless PHY
Wireless PHY Wireless PHY http://setemagali.com/2009/10/12/climbing-the-mountain-everyday/
Physical Communication in Context data application transport network link physical network link physical application transport network link physical data application transport network link physical application transport network link physical PHY considers only a sender sends a seq. of bits to a receiver
Outline Recap Wireless background Wireless MAC design Frequency domain Modulation and demodulation Wireless channels Wireless PHY design Wireless MAC design
Link Layer Services Framing separate bits into frames; each frame has header, trailer and error detection/correction Multiplexing/demultiplexing use frame headers to identify src, 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
Wireless 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
Multiple Access Control (MAC) Protocol Protocol that determines how nodes share channel, i.e., determines when nodes can transmit MAC is hard because communication about channel sharing must use channel itself ! We start with the simplest scenario (e.g., 802.11 or cellular up links) in this class: a single receiver (the Access Point)
Properties of Ideal MAC Protocol Efficient Fair/rate allocation Simple
MAC Protocols: a Taxonomy Goals efficient, fair, simple Three broad classes: channel partitioning divide channel into smaller “pieces” (time slot, frequency, code) non-partitioning random access allow collisions “taking-turns” a token coordinates shared access to avoid collisions
Outline Recap Wireless background Wireless MAC design Frequency domain Modulation and demodulation Wireless channels Wireless PHY design Wireless MAC design wireless access problem and taxonomy resource partitioning MAC
Example Partitioning: FDMA FDMA: frequency division multiple access Channel divided into frequency bands A transmission uses a frequency band frequency bands time 5 1 4 3 2 6
Example Partitioning: TDMA TDMA: time division multiple access Time divides into frames; frame divides into slots A transmission uses a slot in a frame
Recall: 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
Example Partitioning: CDMA 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
DSSS Revisited tb: bit period tc: chip period tb user data d(t) 1 -1 X 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
Illustration: 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(2ft)
Illustration: 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 j’s transmission yj(t)ci(t) sin(2 ft) = A cj(t)ci(t)xj(t) sin2(2 fct) Condition for signal from j on effect on i?
CDMA: Deal with Multiple-User 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!
Capacity 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 IS-95 CDMA, N = 1.25M/4800 = 260
Generating Orthogonal Codes The most commonly used orthogonal codes in current CDMA implementation are the Walsh Codes
Walsh 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
Orthogonal Variable Spreading Factor (OSVF) Variable codes: Different users use different lengths spreading codes Orthogonal: diff. users’ codes are 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 ... No parent-child on the code tree 1,-1,1,-1 1,-1,1,-1,-1,1,-1,1 1,-1 SF=n SF=2n 1,-1,-1,1,1,-1,-1,1 ... 1,-1,-1,1 1,-1,-1,1,-1,1,1,-1 SF=1 SF=2 SF=4 SF=8 If user 1 is given code [1,1], what orthogonal codes can we give to other users?
WCDMA Orthognal Variable Spreading Factor (OSVF) Flexible code (spreading factor) allocation up link SF: 4 – 256 down link SF: 4 - 512 WCDMA downlink No parent-child on the code tree
Summary 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?
Outline Recap Wireless background Wireless MAC design Frequency domain Modulation and demodulation Wireless channels Wireless PHY design Wireless MAC design wireless access problem and taxonomy resource partitioning MAC media access protocols
GSM Logical Channels and Request call setup from an MS 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) MS BTS RACH (request signaling channel) AGCH (assign signaling channel) SDCCH (request call setup) SDCCH message exchange SDCCH (assign TCH) Communication
Slotted 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
Slotted 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 (1-p)(n-1) - prob. of succ. by any one of the N nodes S(p) = n * Prob (only one transmits) = n p (1-p)(n-1)
Goodput vs. Offered Load Curve Slotted Aloha S = throughput = “goodput” (success rate) 0.5 1.0 1.5 2.0 Define G = offered load = np when G (=p*n) < 1, as p (or n) increases probability of empty slots reduces probability of collision is still low, thus goodput increases when G (=p*n) > 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 (=p*n) = 1
Maximum Efficiency vs. n At best: channel use for useful transmissions 37% of time!
Dynamics 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 m-n stations are not backlogged. They may start to generate packets with a probability pa, where pa is much smaller than p
each transmits with prob. p Model n backlogged each transmits with prob. p m-n: unbacklogged each transmits with prob. pa
Dynamics of Aloha: Effects of Fixed Probability - assume a total of m stations pa << p success rate is the departure rate, the rate the backlog is reducing desirable stable point successful transmission rate at offered load np + (m-n)pa dep. and arrival rate of backlogged stations new arrival rate: (m-n) pa undesirable stable point m n: number of backlogged stations offered load = 1 Lesson: if we fix p, but n varies, we may have an undesirable stable point
Summary of Problems of Slotted Aloha Advantages Simple, decentralized random access protocol Issues Low efficiency Only ~37% at optimal transmission rate Even lower efficiency at non-optimal (fixed p) No rate allocation/fairness
Outline Recap Wireless background Wireless MAC design Frequency domain Modulation and demodulation Wireless channels Wireless PHY design Wireless MAC design wireless access problem and taxonomy wireless resource partitioning dimensions media access protocols ALOHA protocol The Ethernet protocol
Ethernet Fix for Efficiency Introduce collision detection: instead of wasting the whole frame transmission time (a slot), we waste only the time needed to detect collision. Introduce adaptive probability: reduce probability of trans. as # of collisions increases If more collisions => p is high => should reduce p P P: packet size, C: contention window C
Q: Does Ethernet alg work well in wireless? Ethernet Fix: Carrier-Sense Multiple Access /Collision Detection/Exponential Backoff Carrier sense The Ethernet algorithm get a frame from upper layer; K := 0; n := 0; // K: control wait time; n: no. of collisions repeat: wait for K * 512 bit-time; while (network busy) wait; wait for 96 bit-time after detecting no signal; transmit and detect collision; if detect collision stop and transmit a 48-bit jam signal; n ++; m:= min(n, 10), where n is the number of collisions choose K randomly from {0, 1, 2, …, 2m-1}. if n < 16 goto repeat else give up else declare success Detect Collision Adapt Probability Q: Does Ethernet alg work well in wireless?
Rake Receiver
Multipath Diversity: Rake Receiver Instead of considering delay spread as an issue, use multipath signals to recover the original signal Used in IS-95 CDMA, 3G CDMA, and 802.11 Invented by Price and Green in 1958 R. Price and P. E. Green, "A communication technique for multipath channels," Proc. of the IRE, pp. 555--570, 1958
Multipath Diversity: Rake Receiver LOS pulse multipath pulses Use several "sub-receivers" each delayed slightly to tune in to the individual multipath components Each component is decoded independently, but at a later stage combined this could very well result in higher SNR in a multipath environment than in a "clean" environment
Rake Receiver Blocks Correlator Combiner Finger 1 Finger 2 Finger 3
Rake Receiver: Matched Filter Impulse response measurement Tracks and monitors peaks with a measurement rate depending on speeds of mobile station and on propagation environment Allocate fingers: largest peaks to RAKE fingers
Rake Receiver: Combiner The weighting coefficients are based on the power or the SNR from each correlator output If the power or SNR is small out of a particular finger, it will be assigned a smaller weight:
Comparison [PAH95] MCM is OFDM
Backup Slides: Error Corrections Codes
Reed-Solomon Codes Very commonly used, send n symbols 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,…, xk-1), where xi are data symbols, define polynomial P(t) = x0 + x1t + x2t + …xk-1tk-1 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(n-1) to receiver
since any k equations are independent, they have a unique solution Reed-Solomon Codes Receive the message P(0), P(), P(2), P(n-1) If no error, can recover data from any k equations: since any k equations are independent, they have a unique solution
Reed-Solomon 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”
Reed-Solomon Codes The transmitted data is the correct solution for n-s equations, and thus gets votes (i.e., combinations of k equations) An incorrect solution can satisfy at most k-1+s equations, and the # of votes it can get is at most:
Reed-Solomon Codes If or (n-s > k – 1 + s) or (n-k > 2s – 1) or (n-k s), it can correct any s errors
Reed-Solomon Codes The voting-based 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 Euclid’s algorithm can be used to decode R-S codes Below is a typical current decoder