Download presentation
Presentation is loading. Please wait.
1
Link Layer; Media Access Control
Y. Richard Yang 2/2/2011
2
Outline Admin. and recap Intro to link layer Media access control
3
Admin. Hw2 to be posted later today
4
Summary: Challenges and Techniques of Wireless Design
Performance affected Mitigation techniques Shadow fading (large-scale fading) Fast fading (small-scale, flat fading) Delay spread (small-scale fading) received signal strength use fade margin—increase power or reduce distance bit/packet error rate at deep fade diversity equalization; OFDM; directional antenna ISI
5
Delay Spread as Transmit Diversity
Delay spread is really a type of transmit diversity
6
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 Invented by Price and Green in 1958 R. Price and P. E. Green, "A communication technique for multipath channels," Proc. of the IRE, pp , 1958
7
DSSS Multipath Choose chipping sequence with good autocorrelation, e.g., Barker code () used in
8
Multipath Diversity: Rake Receiver
Use several "sub-receivers" each delayed slightly to tune in to the individual multipath components
9
Rake Receiver Blocks Correlator Combiner Finger 1 Finger 2 Finger 3
10
Outline Recap Introduction to link layer
11
Link Layer Services Framing: Flow control:
encapsulate bits into frame, adding header, trailer multiplexing: frame header to identify source, dest example: MAC address error detection and correction Flow control: pacing between adjacent sending and receiving nodes Link access (interference and quality of service control) media access control (also called multiplexing)
12
Outline Recap Introduction to link layer
Error detection and correction
13
Example: Reed-Solomon Codes
Very commonly used, e.g., CD/DVD/BlueRay/DSL/WiMAX 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 Why Error Detection and Correction?
14
Reed-Solomon Codes If the data we want to send is (x0, x1,…, xk-1), where xi are data symbols, define polynomial P(t) = x0 + x1t + x2t2 + …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
15
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
16
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”
17
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:
18
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
19
Reed-Solomon Codes The voting-based decoding algorithm proposed in 1960 is inefficient Berlekamp introduced first truly efficient algorithm for both binary and nonbinary codes. Complexity increases linearly with number of errors Sugiyama, et al. Showed that Euclid’s algorithm can be used to decode R-S codes Below is a typical current decoder
20
Link Layer Services Framing: Flow control:
encapsulate bits into frame, adding header, trailer multiplexing: frame header to identify source, dest example: MAC address error detection and correction Flow control: pacing between adjacent sending and receiving nodes Link access (interference and quality of service control) media access control (also called multiplexing)
21
Outline Recap Introduction to link layer
Error detection and correction Media access control
22
Dimension for multiplexing
Multiple Access Control Dimension for multiplexing Frequency Time Space Code Two transmissions cannot conflict in all dimensions !
23
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
24
TDMA TDMA: time division multiple access
Time divides into frames; frame divides into slots A transmission uses a slot in a frame
25
Q: why not divide into infinite small cells?
SDMA SDMA: space division multiple access Transmissions at different locations, if far enough, can transmit simultaneously (same freq.) Example: the cellular technique 1 2 3 4 Suppose 24 MHz spectrum, 30 K per user #user supported: = Using cell #user supported: = Q: why not divide into infinite small cells?
26
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 = Examples: Sprint and Verizon, 3G WCDMA and CDMA2000
27
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
28
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)
29
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)
30
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: C2: C1 . C2 = (-1) (-1) (-1)+(-1)=0 Analogy: Speak in different languages!
31
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
32
Generating Orthogonal Codes
The most commonly used orthogonal codes in current CDMA implementation are the Walsh Codes Property of Walsh : every row is orthogonal to every other row and the log NOT of every other row
33
Walsh CDMA Code Assignment
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 If user 1 is given code [1,1,-1,-1], what codes can we give to other users?
34
WCDMA Orthognal Variable Spreading Factor (OSVF)
Flexible code (spreading factor) allocation up link SF: 4 – 256 down link SF: 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
35
W-CDMA Down Link Capacity
36
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?
37
General Allocation Problem
Each transmission i (si->di) is specified by transmission power pi time ti frequency band fi code ci Given any two transmissions (si->di; pi, ti, fi, ci) and (sj->dj; pj, tj, fj, cj), we can determine if they conflict MAC scheduling objectives: to maximize resource efficiency to allocate resource fairly to satisfy app requirements e.g. real time app (such as VoIP) need access with a bounded delay e.g. s wants to talk to d, but cannot reach d directly
38
MAC The general case is challenging and largely still open
We start with the simplest scenario (e.g., or cellular up links) in this class: time sharing the same frequency and code a single receiver (the Access Point)
39
How to Do Time Sharing? Fixed allocation
Centralized authority, e.g., polling Taking turns, e.g., token passing Distributed random access discussion: compare the schemes in terms of efficient utilization of resources delay to access channel quality of service (e.g., a guaranteed rate)
40
Slotted Aloha [Norm Abramson]
Used in GSM initial access channel: when you dial a number. Time is divided into equal size slots (= pkt trans. time) Node with new arriving request: transmit at beginning of next slot If collision: retransmit request in future slots with probability p, until successful. A B
41
Success (S), Collision (C), Empty (E) slots
Slotted Aloha Success (S), Collision (C), Empty (E) slots
42
Slotted Aloha Efficiency
S = throughput = “goodput” (success rate) G = offered load = np 0.5 1.0 1.5 2.0 Slotted Aloha when p n < 1, as p (or n) increases probability of empty slots reduces probability of collision is still low, thus goodput increases when 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 p n = 1
43
Pros and Cons of Slotted Aloha
Pros: simple Cons: need clock sync low efficiency: utilization at ~1/e
44
Dynamics of Aloha: Effects of Fixed Probability
- assume a total of m stations; - An idle station starts a frame with prob. pa 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
45
Ethernet Fix: Carrier-Sense Multiple Access /Collision Detection/Exponential Backoff
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
46
Does collision detection work well in wireless?
Efficiency of CSMA/CD Given collision detection, instead of wasting the whole packet transmission time (a slot), we waste only the time needed to detect collision. P: packet size, C: contention window C C C P Does collision detection work well in wireless?
47
The Hidden Terminal Problem
C A is sending to B, but C cannot detect the transmission Therefore C sends to B In summary, A is “hidden” from C
48
CSMA/CD + Hidden Terminals
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 Q: what is the outcome of CSMA/CD + hidden terminals?
49
Handling Hidden Terminals: Avoid
Hidden terminals -> collision detection is not reliable -> if do not detect collision, there is still a chance of collision -> transmit with only prob. CSMA/CD -> CSMA/CA (congestion avoidance) default in even if media is not sensed busy, transmits with a probability in real implementation, with a random delay
50
Handling Hidden Terminals: Detect
Develop techniques to detect hidden terminals Why cannot C detect potential collision? Collision is spatially dependent C is at a different location than B B should tell C that it is receiving A B C
51
Hidden-Terminal Detection
Busy-tone multiple access used in CDPD (cellular digital packet data) the base station sends a busy tone on the down link when receiving data Virtual carrier sense
52
Virtual Carrier Sense: RTS/CTS
Short signaling packets (virtual carrier sense) RTS (request to send) and CTS (clear to send) contain sender address, receiver address, transmission duration, called network allocation vector (NAV) A node keeps quiet for NAV in CTS DATA RTS A B C D CTS
53
CSMA+RTS/CTS/DATA/ACK
Summary Use RTS/CTS for virtual carrier sense Use ACK to improve reliability Missing CTS/ACK considered as collision Protocol begin: while (channel busy) wait if channel idle send RTS if receive CTS send DATA wait for ACK if ACK return exponential backoff wait for the backoff period goto begin;
54
Comparisons: Media Access Techniques Handling Hidden Terminals
Slotted Aloha very simple to implement but need clock sync; low efficiency CSMA/CD (Ethernet alg.) hidden terminal causes collapse CSMA/CA simple to implement low efficiency
55
Comparisons: Media Access Techniques Handling Hidden Terminals
Busy tone simple to implement but need a channel for busy signal Virtual carrier sensing (RTS/CTS) energy consumption can be high because a node needs to monitor the environment all the time Idle:receive:send: 1:1.05:1.4 [Stemm and Katz 1997]; Digitan 2 Mbps WLAN 1:2:2.5 many measurements show that overhead hurts performance
56
Question for Thought: Is the preceding the best we can do?
57
CSMA/CD/ACK + Hidden Terminals Revisited
No ACK Collision! Alice Bob Assume CSMA/CD but add ACK; Missing ACK considers as collision
58
CSMA/CD/ACK + Hidden Terminals Revisited
Retransmission One more Collision Alice Bob The problem does not stop here. Alice and Bob retransmit their packets after increasing their contention window. But this does not help. Their transmissions still overlap causing more collisions. Alice and Bob will continue increasing their contention window and retransmitting, until after many trials they get a packet through or they time out. Question to think about during weekend: Anything we can do?
59
Backup Slides
60
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:
61
Forward Error Correction Code: Block Erasure Code
Basic idea: encode k symbols to n symbols so that if the receiver receives any k symbols, it can recover the original x y
62
FEC/Block: Example Implementation
Suppose data signal is x, and the encoded signal y = Gx, where G is the generator matrix; assume receives only a subset of y The y-symbols in yellow are received; other y-symbols are dropped by demodulator
63
FEC: An Example using Vandermonde Matrix
Suppose gij are the entries after the identify matrix gij= aij-1, where ai are distinct numbers Suppose k=3, and n=5
64
An Example using Vandermonde Matrix
Suppose y2 and y3 are dropped, then we have y1, y4, and y5. Given the relationship (we know they are y1, y4, y5) Since the matrix is not singular, we can recover x1, x2, and x3 from y1, y4, y5
65
Other Codes Many other types of codes are commonly used in networks, e.g., Reed-Solomon codes where we consider each symbol (e.g., 8 bits) as the coefficient of a polynomial, c(x) is the parity check polynomial representing the parity correction symbols, d(x) the data polynomial, and g(x) the generator polynomial in the format:
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.