EE122:ErrordetectionandreliabletransmissionIonStoicaSeptember16,[email protected] 2HighLevelViewGoal:transmitcorrectinformationProblem:bitscangetcorrupted- Electricalinterference,thermalnoiseSolution- Detecterrors- Recoverfromerrors• Correcterrors• [email protected] 3OverviewErrordetectionReliable[email protected] 4ErrorDetectionProblem:detectbiterrorsinpackets(frames)Solution:addredundancy bitstoeachpacketGoals:- Reduceoverhead,i.e.,reducethenumberofredundancybits- IncreasethenumberandthetypeofbiterrorpatternsthatcanbedetectedExamples:- Two-dimensionalparity- Checksum- CyclicRedundancyCheck(CRC)[email protected] 5Two-dimensionalParityAddoneextrabittoa7-bitcodesuchthatthenumberof1’sintheresulting8bitsiseven(forevenparity,andoddforoddparity)AddaparitybyteforthepacketExample:five7-bitcharacterpacket,evenparity01101001011010001011011101011001011101101000110 [email protected] 6HowManyErrorsCanyouDetect?All1-biterrorsExample:01101001011010000011011101011001011101101000110 1errorbitoddnumberof1’[email protected] 7HowManyErrorsCanyouDetect?All2-biterrorsExample:01101001011010000011111101011001011101101000110 1errorbitsoddnumberof1’son[email protected] 8HowManyErrorsCanyouDetect?All3-biterrorsExample:01101001011010000011111001011001011101101000110 1errorbitsoddnumberof1’son[email protected] 9HowManyErrorsCanyouDetect?Most4-biterrorsExampleof4-biterrorthatisnot detected:01101001011010000011111001001001011101101000110 1errorbitsHowmanyerrorscanyou[email protected] 10ChecksumSender:addallwordsofapacketandappendtheresult(checksum)tothepacketReceiver:addallwordsofapacketandcomparetheresultwiththechecksumCandetectall1-biterrorsExample:Internetchecksum- Use1’scomplement[email protected] 111’sComplementRevisitedNegativenumber–xisxwithallbitsinvertedWhentwonumbersareadded,thecarry-onisaddedtotheresultExample:-15+16;assume8-bitrepresentation15= 00001111-15=1111000016=00010000+000000001+100000001-15+16=[email protected] 12CyclicRedundancyCheck(CRC)Representa(n+1)-bitmessagebyann-degreepolynomialM(x)- E.g.,10101101M(x)=x7+x5+x3+x2+x0Chooseadivisork-degreepolynomialC(x)ComputereminderR(x)ofM(x)*xk/C(x),andthencomputeT(x)=M(x)*xk- R(x)- T(x)isdivisiblebyC(x)- FirstncoefficientsofT(x)representM(x)Sender:- ComputeandsendT(x),i.e.,thecoefficientsofT(x)Receiver:- LetT’(x)bethe(n+k)-degreepolynomialgeneratedfromthereceivedmessage- IfC(x)dividesT’(x)noerrors;otherwise[email protected] 13SomePolynomialArithmeticModulo2PropertiesIfC(x)dividesB(x),thendegree(B(x))>=degree(C(x))SubtractingC(x)fromB(x)reducestoperformanXORoneachpairofmatchingcoefficientsofC(x)andB(x)- E.g.:B(x)=x7+x5+x3+x2+x010101101C(x)=x3+x1+x000001011B(x)- C(x)=x7+x5+x2+x1[email protected] 14ComputingT(x)ComputethereminderR(x)ofM(x)*xk/C(x)T(x)=M(x)*xk- R(x)Example:sendpacket110111,assumeC(x)=101- k=2,M(x)*xK11011100- ComputeR(x)- T(x)=M(x)*xk- R(x)11011100xor1=11011101101)110111001011111011011011001011R(x)[email protected] 15CRCPropertiesDetectallsingle-biterrorsifcoefficientsofxkandx0ofC(x)areoneDetectalldouble-biterrors,ifC(x)hasafactorwithatleastthreetermsDetectallnumberofodderrors,ifC(x)containsfactor(x+1)Detectallburstoferrorssmallerthankbits[email protected] 16OverviewErrordetectionReliable[email protected] 17ReliableTransmissionProblem:obtaincorrectinformationonceerrorsaredetectedSolutions:- Useerrorcorrectioncodes(canyougiveanexampleoferrordetectioncodethatcanalsocorrecterrors?)- Useretransmission(we’lldothisindetails)Algorithmicchallenges:- Achievehighlinkutilization,andlow[email protected] 18Latency,Bandwidth,Round-TripTimeLatency=propagation+transmit+queue- Propagation:timeittakesthesignaltopropagatealongthelink- Transmit:timeittakestotransmitthepacket=(packet_size)/(link_bandwidth)- Queue:timeforwhichthepacketwaitsintotheadapteratthesenderbeforebeingtransmittedNote:nextwe’llassumeshortpackets,i.e,transmittermcanbeneglected!Round-TripTime(RTT)=timeittakestoapackettotravelfromsendertodestinationandback- RTT=one-waylatencyfromsendertoreceiver+one-waylatencyfromreceiverto[email protected] 19AutomaticRepeatRequest(ARQ)AlgorithmsUsetwobasictechniques:- Acknowledgements(ACKs)- TimeoutsTwoexamples:- Stop-and-go- Sliding[email protected]
View Full Document