360 likes | 545 Views
PHY and DLL. Doug Young Suh suh@khu.ac.kr Last update : Aug 1, 2009. PHY (Physical Layer). Analog bandwidth W[Hz] digital [bps] Nyquist theorem with V levels/sample maximum data rate = 2W log 2 V bits/sec Shannon ’ s theorem in noisy channel maximum data rate = W log 2 (1+S/N) bits/sec
E N D
PHY and DLL Doug Young Suh suh@khu.ac.kr Last update : Aug 1, 2009 PHY MAC
PHY (Physical Layer) • Analog bandwidth W[Hz]digital [bps] • Nyquist theorem with V levels/sample maximum data rate = 2W log2 V bits/sec • Shannon’s theorem in noisy channel maximum data rate = W log2 (1+S/N) bits/sec ex) W=3kHz, S/N=30dB 30kbps PHY MAC
Nyquist Criterion • A theoretically sufficient condition to allow an analog signal to be reconstructed completely from a set of uniformly spaced discrete-time samples • Nyquist rate • Speech : 8kHz sampling > 2 X 3.2kHz • Audio : 44.1kHz sampling > 2 X 20kHz
Sampling (Cont.) Aliasing!!
Spectrum -1 -1 -1 -1 -1 -1 -1 1 1 1 1 1 1 • Symbol rate • fs = 1/Ts where Ts =symbol duration ex) Binary 1Mbps, fs = 106Hz, Ts = 10-6sec • Spectrum with main lobe = 2fs Main lobe Fourier transform === Ts side lobe -2fs -fs 0 fs 2fs PHY MAC
Quantization • L-level quantizer consists of L codewords • A codeword of L-level quantizer is represented by B-bit binary digits. • Quantization error Δ = {dynamic range}/2L • fs symbols/sec B·fs bits/sec = R [bps]
Entropy and transmission rate Shannon’s coding theory “No loss of information if R(X)>H(X)” Entropy : average of information amount of symbols, uncertainty Ex) Dice Information Theory
Noise and Detection of signals • Two conditional pdfs : likelihood of s1(s2) PHY MAC
Digital modulation • Modulation • High-frequency carrier • Binary M-ary for narrower baseband Ex) M-ary PSK : Eb/N0 vs BER (bit error rate) M=2 fb M=4 fb/2 M=16 fb/4 PHY MAC
Packingproblem • “How many balls can you pack in a jar?” • Dependent on size of the jar • Dependent on size of each ball PHY MAC
Error Probability Plane What happens in PB if the bandwidth efficiency Rb/W increases? • Coherently Detected M-ary Signaling: • tradeoff between PB and Eb/N0 with fixed W • tradeoff between PB and W with fixed Eb/N0 • tradeoff between W and Eb/N0 with fixed PB MFSK MPSK
Bandwidth Efficiency of M-ary Signaling • Bandwidth Efficiency R/W bits/s/Hz: • Measure of how much data can be communicated in a specified bandwidth within a given time, reflecting how efficiently the bandwidth resources is utilized. • M-ary Signaling: • Data rate: • Bit duration: • Bandwidth efficiency: Digital Communications 2
Shannon Capacity Theorem Shannon Capacity: C = W log2(1+S/N) [bps] W: Bandwidth, S: Average received signal power, N: Average noise power • Limited by the signal power and bandwidth. • 3dB increase in SNR 1 bps/Hz increase in capacity • Analog TV digital TV • Cable TV (C/W=6~7), satellite TV(~3), • terrestrial TV(1~2) Digital Communications 2
Bandwidth-Efficiency Plane • tradeoff between PB and Eb/N0 with fixed R/W • tradeoff between PB and R/W with fixed Eb/N0 • tradeoff between R/W and Eb/N0 with fixed PB well-designed Digital Communications 2
Data Link LayerError control Flow control MAC (Medium Access Control) Doug Young Suh suh@khu.ac.kr Last updated : Aug. 1, 2009 PHY MAC
IEEE 802.2: Logical Link Control (a) Position of LLC. (b) Protocol formats. PHY MAC
Error control • ED/ARQ • Error Detection and Automatic Repeat Request • CRC (Cyclic Redundancy Check) • FEC (Forward Error Correction) • Bit error correction : BCH, convolution code • Byte error correction : Reed Solomon, LDPC • Packet loss recovery : Reed Solomon, Raptor MediaLab , Kyunghee University
Bit error and transmission rate X 0 0 Y 1 1 • Binary Symmetric Channel (BSC): • For an error-free channel (p=0): (no uncertainty in X with the knowledge of Y) H(X|Y) 0.5 p=0 1 Digital Communications 2
X Y Effective Transmission Rate • Bit error loss of information • For a BSC channel with PB=0.01: • If Rs=1000 symbols/s: (1000-919=81 for channel coding) • What happens if PB=0.5? Digital Communications 2
Error detection • Checksum with CRC (Cyclic Redundancy Code) • Example with generator G(X)=X4+X+1 All XOR operation Send C(X)=S(X)·X4 + [S(X)·X4 % G(X)]. Let S(X)= 1101011011, then C(X)= 11010110111110 Note that C(X)%G(X)=0 cf) For any integer n, [n - (n%3)]%3 = 0 PHY MAC
Error correction • Example with Hamming (7,4) code • generator G(X)=X3+X+1 • Send C(X)=M(X)·X3 + [M(X)·X3 % G(X)]. • Let M(X)= 1110, then C(X)= 1110100 (C(X)%G(X)=0) • If error E(X) = 0010000, then receive R(X) = 1100100 • S(X) = R(X)%G(X) = E(X)%G(X) • Unique syndrome • 1 bit error correction!! Channel Encode C(X) R(X) Channel Decode M(X) Error prone channel M’(X) E(X) PHY MAC
Flow control • Different capacity of the both parties • Available bitrate • Buffer size • Tools • ACK, Seq_Num, timer, piggy-back • Protocols • Stop-and-wait protocol : simple & slow (satellite) • Sliding-window protocol over noisy channel • Sliding window : limited window size • Go-back-N protocol • Selective repeat protocol PHY MAC
Sliding window (size 1, seq #c3 bits) (a) initially, (b) after Packet 0 sent, (c) after Packet 0 received, (d) after ACK1 received Readyto retransmit Pkt0 Readyto send Pkt1 Readyto receive Pkt0 Readyto receive Pkt1 PHY MAC
Go-back-N vs selective repeat Window size 1 : “Go-back-N” Timeout interval 0 1 2 3 4 5 6 7 8 2 3 4 5 6 7 8 9 10 Ack 2 Ack 0 Ack 1 Ack 3 Ack 4 Ack 5 Ack 6 Ack 7 0 1 E D D D D D D 2 3 4 5 6 7 8 Error Discarded by datalink layer Sufficient window size : “selective repeat” Timeout interval 0 1 2 3 4 5 6 7 8 2 9 10 11 12 13 14 Ack 9 Ack 10 Ack 11 Ack 1 Ack 1 Ack 1 Ack 1 Ack 2 Ack 0 Ack 1 Ack 1 Ack 8 Ack 1 0 1 E 3 4 5 6 7 8 2 9 10 11 12 Packets 2-8 passed to network layer Error buffered by datalink layer PHY MAC
Simple queueing theory • Delay T = 1/(α-λ) • Exponential distribution p(t)= λ e-λt • Poission distribution p[k] = (λT)k e-λT/ k! λ frames/sec Queue (e.g. router, station, AP) α frames/sec • For an AP, 1/(μC –λ) • Departure : 1/u[bits/frame], C [bps] • Arrival : λ[frames/sec] bandwidth Frame length PHY MAC
Channel Allocation? • (Static divided by N) vs (Dynamic allocation) • Delay TFDM =1/(μC/N-λ/N) >> T=1/(μC-λ) =TFDM/N • Static : TDM, FDM • Dynamic Allocation Issues • Station model • generation period transmission period • Single channel : sharing with the same right • Collision assumption • Continuous/slotted time • Carrier sense or not PHY MAC
ALOHA (1970s) • Contention system contention-free • No carrier sense • G attempts/frametime throughput S = G P0 • Where P0 is probability of no collision • Pure ALOHA S=Ge-2G • No collision when no frame during 2t : • Slotted ALOHA S=Ge-G S (throughput) 0.4 Collision with the end of the shaded frame Collision with the start of the shaded frame 0.2 t 0.5 1.0 t t+3t0 t+t0 t+2t0 Load G vulnerable PHY MAC
CSMA/CD 01. 0.01 persistent CSMA Nonpersistent CSMA S (throughput) 0.4 Slotted ALOHA 0.2 Pure ALOHA 0.5 1.0 Load G • Carrier Sense Multiple Access • Persistent(고집하는) and non-persistent • Non-persistent • Send as soon as no carrier is sensed. • p-persistent • Send with a probability of p. • Optimal when pN=1 • Collision Detection • ∵ propagation delay • Stop as soon as collision is detected : 2τ=10μs/1km PHY MAC
Persistent and Nonpersistent CSMA Comparison of the channel utilization versus load for various random access protocols. PHY MAC
CSMA/CD : 3 states t0 contention slots Frame Frame Frame contention period Idle period Transmission period time • At t0, a station begins transmitting • At τ-ε, the frame arrives at the most distant station, which begins transmitting. • At τ-ε, the original station detects collision and stops transmitting. PHY MAC
Ethernet MAC Protocol PHY MAC
Gigabit Ethernet (switched) • A two-station Ethernet. • A multistation Ethernet. PHY MAC
Collision-Free Protocols • Bit-map protocol • Optimal groupingwhen N·p ≈ 1 Collision-free protocol Contention protocol in each group N1P1 ≈ 1 N2P2 ≈ 1 N3P3 ≈ 1 PHY MAC
Bit-map protocol • reservation protocol • delay =N(d+1)/2, maximum efficiency d/(N+d) • Limited-contention protocol • Two important performance measures • Delay at low load, channel efficiency at high load • Bit-map for groups then contention • Optimal when pN=1 N=8 contention slots frames 8 contention slots frames 1 d 1 1 1 1 3 7 1 1 2 5 1 1 PHY MAC
Conclusions: MAC protocol • Load and protocol • Contention protocol at low load • Contention-free protocol at high load • Two important performance measures • Delay at low load • channel efficiency at high load PHY MAC