Chapter 3 Digital Transmissin Fundamentals Errr Detectin and Crrectin CSE 3213, Winter 2010 Instructr: Frhar Frzan
Mdul-2 Arithmetic Mdul 2 arithmetic is perfrmed digit y digit n inary numers. Each digit is cnsidered independently frm its neighurs. Numers are nt carried r rrwed. 2
Data Link layer 3
Chapter 3 Digital Transmissin Fundamentals Errr Detectin and Crrectin
Errr Cntrl Why Errr Cntrl? data sent frm ne cmputer t anther shuld e transferred relialy unfrtunately, the physical link cannt guarantee that all its, in each frame, will e transferred withut errrs errr cntrl techniques are aimed at imprving the errr-rate perfrmance ffered t upper layer(s), i.e. end-applicatin Praility f Single-Bit Errr Appraches t Errr Cntrl aka it errr rate (BER) : wireless medium: p =10-3 cpper-wire: p =10-6 fire ptics: p =10-9 (1) Errr Detectin + Autmatic Retransmiss. Request (ARQ) fewer verhead its return channel required lnger errr-crrectin prcess and waste f andwidth when errrs are detected (2) Frward Errr Crrectin (FEC) errr detectin + errr crrectin
Errr Cntrl Types f Errrs (1) Single Bit Errrs nly ne it in a given data unit (yte, packet, etc.) gets crrupted (2) Burst Errrs tw r mre its in the data unit have een crrupted errrs d nt have t ccur in cnsecutive its urst errrs are typically caused y eternal nise (envirnmental nise) urst errrs are mre difficult t detect / crrect
Key Idea redundancy!!! add enugh etra infrmatin (its) fr detectin / crrectin f errrs at the destinatin redundant its = cmpressed versin f riginal data its errr crrectin requires mre redundant its than errr detectin mre redundancy its etter errr cntrl mre verhead Infrmatin its Received infrmatin its Calculate check its k its Sent check its n k its Channel Received check its Recalculate check its Cmpare Infrmatin accepted if check its match 1 0 0 1 1 0 1 0 f(s) 1 0 1 0 0 1 1 0 1 0 1 0 1 0 0 1 1 0 1 0 f(s ) 1 0 cmp 0 0
Hamming Distance Hamming Distance etween 2 Cdes numer f differences etween crrespnding its can e fund y applying XOR n tw cdewrds and cunting numer f 1s in the result Minimum Hamming Distance (d min ) in a Cde minimum Hamming distance etween all pssile pairs in a set f cdewrds d min it errrs will make ne cdewrd lk like anther larger d min etter rustness t errrs Eample [ k=2, n=5 cde ] Cde that adds 3 redundant its t every 2 infrmatin its, thus resulting in 5-it lng cdewrds.
Hamming Distance Minimum Hamming Distance fr Errr Detectin t guarantee detectin f up t s errrs in all cases, the minimum Hamming distance must e d min =s+1 Eample [ cde with d min =2 is ale t detect s=1 it-errrs ] 9
Hamming Distance Minimum Hamming Distance fr Errr Crrectin t guarantee crrectin f up t t errrs in all cases, the minimum Hamming distance must e d min =2t+1 Eample [ Hamming distance ] A cde scheme has a Hamming distance d min =4. What is the errr detectin and errr crrectin capaility f this scheme? The cde guarantees the detectin f up t three errrs (s=3), ut it can crrect nly 1-it errrs! 10
What is a gd cde? Many channels have preference fr errr patterns that have fewer # f errrs These errr patterns map transmitted cdewrd t neary n-tuple If cdewrds clse t each ther then detectin failures will ccur Gd cdes shuld maimize separatin etween cdewrds = cdewrds = nncdewrds Pr distance prperties Gd distance prperties
Errr Detectin: Single Parity Check Errr Detectin Techniques Single Parity Check (Even Parity) Append an verall parity check t k infrmatin its Inf Bits: 1, 2, 3,, k Check Bit: k+1 = 1 + 2 + 3 + + k mdul 2 Cdewrd: ( 1, 2, 3,, k,, k+! ) receiver checks if numer f 1s is even receiver CAN DETECT all single-it errrs and urst errrs with dd numer f crrupted its single-it errrs CANNOT e CORRECTED psitin f crrupted it remains unknwn all even-numer urst errrs are undetectale!!!
Eample f Single Parity Cde Infrmatin (7 its): (0, 1, 0, 1, 1, 0, 0) Parity Bit: 8 = 0 + 1 +0 + 1 +1 + 0 = 1 Cdewrd (8 its): (0, 1, 0, 1, 1, 0, 0, 1) If single errr in it 3 : (0, 1, 1, 1, 1, 0, 0, 1) # f 1 s =5, dd Errr detected If errrs in its 3 and 5: (0, 1, 1, 1, 0, 0, 0, 1) # f 1 s =4, even Errr nt detected
Errr Detectin: Single Parity Check Eample [ single parity check cde C(5,4) ] Single Parity Check Cdes fr ALL parity check cdes, d min = 2 and Minimum Hamming Distance (d min ) 14
Errr Detectin: Single Parity Check Effectiveness f Single Parity Check riginal cdewrd: received cdewrd: = [ ' ' = [1 1 2 3 ' 2 ' 3... n ]... errr vectr: e = [e e e ] ' n... n 1 2 3 e ] 1 0 0 1 1 0 0 1 1 1 0 1 1 1 0 1 0 1 0 0 0 1 0 0 e k 1, = 0, if if k k ' k = ' k (1) Randm Errr Vectr Channel Mdel there are 2 n pssile errr vectrs all errr are equally likely e.g. e=[0 0 0 0 0 0 0 0] and e=[1 1 1 1 1 1 1 1]are equally likely 50% f errr vectrs have an even # f 1s, 50% f errr vectrs have an dd # f 1s praility f errr detectin failure = 0.5 nt very realistic channel mdel!!!
Errr Detectin: Single Parity Check (2) Randm Bit Errr Channel Mdel it errrs ccur independently f each ther p = praility f errr in a single-it transmissin (2.1) praility f single it errr (w(e)=1) where w(e) represents the numer f 1s in e it-errr ccurs at an aritrary (ut particular) psitin 1 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 e 1 =0 e 2 =0 e 3 =1 e n-2 =0 e n-1 =0 e n =0 P( w(e) = 1) = (1 p ) (1 p ) p... (1 p ) (1 p ) (1 p ) praility f crrectly transmitted it n-1 P( w(e) = 1) = (1 p ) p
Errr Detectin: Single Parity Check (2.2) praility f tw it errrs: w(e)=2 P( w(e) = 2) = (1 p ) n-2 (p ) 2 = (1 p ) n-1 p p 1 p <1, since p <0.5 p P( w(e) = 2) = P( w(e) = 1) < P( w(e) = 1) 1 p (2.3) praility f w(e)=k it errrs: w(e)=k n-k k n-1 p P( w(e) = k) = (1 p ) (p ) = (1 p ) p = P( ) 1 p w(e) = 1 k 1 ( ) k a 1 P( w(e) = k) <... < P( w(e) = 2) < P( w(e) = 1) 1-it errrs are mre likely 2-it errrs, and s frth! 17
Errr Detectin: Single Parity Check (2.4) praility that single parity check fails?! P( errr detectin failure) = P( errr = P( any patterns with even numer f 1s) = 2 it errr ) + P( any 4 it errr ) + P( any = (#f 2 it errrs)*p( w(e) = 2) + + (#f 4 it errrs)* P( w(e) = 4) + + (#f 6 it errrs)*p( w(e) = 6) +... 6 it errr ) +... = numer f cminatins n chse k : n (#f k it errrs) = = k n! k!(n k)! 1 0 0 1 1 0 1 0 1 1 0 0 1 1 0 0 P( errr detectin failure) n 2 n 2 n 4 n 4 n 6 = p (1 p ) + p (1 p ) + p (1 p ) 2 4 6 n 6 prgressively smaller cmpnents +... 18
Errr Detectin: Single Parity Check Eample [ praility f errr detectin failure ] Assume there are n=32 its in a cdewrd (packet). Praility f errr in a single it transmissin p =10-3. Find the praility f errr-detectin failure. P( errr detectin failure) 32 2 30 32 4 28 32 6 = p (1 p ) + p (1 p ) + p(1 p) 2 4 6 26 +... 32 2 30 32* 31 3 2 p(1 p ) (10 ) = 496 * 10 2 2 32 4 28 32* 31* 30 * 29 3 4 p (1 p ) (10 ) = 35960 * 10 4 2* 3 * 4 P( errr detectin failure) = 496 *10 6 6 12 = 4.96 *10 4 1 2000 Apprimately, 1 in every 2000 transmitted 32-it lng cdewrds is crrupted with an errr pattern that cannt e detected with single-it parity check. 19
Errr Detectin: 2-D Parity Check Tw Dimensinal Parity Check a lck f its is rganized in a tale (rws + clumns) a parity it is calculated fr each rw and clumn 2-D parity check increases the likelihd f detecting urst errrs all 1-it errrs CAN BE DETECTED and CORRECTED all 2-, 3- it errrs can e DETECTED 4- and mre it errrs can e detected in sme cases drawack: t many check its!!! 20
Tw-Dimensinal Parity Check Eample [ effectiveness f 2-D parity check ] 0 0 0 0 0 0 21