CSE461UniversityofWashington 1
HammingCode• Givesamethodforconstruc=ngacodewithadistanceof3– Usesn=2k–k–1,e.g.,n=4,k=3– Putcheckbitsinposi=onspthatarepowersof2,star=ngwithposi=on1
– Checkbitinposi=onpisparityofposi=onswithaptermintheirvalues
• Plusaneasywaytocorrect[soon]
CSE461UniversityofWashington 2
HammingCode(2)• Example:data=0101,3checkbits– 7bitcode,checkbitposi=ons1,2,4– Check1coversposi=ons1,3,5,7– Check2coversposi=ons2,3,6,7– Check4coversposi=ons4,5,6,7
_______ 1234567
CSE461UniversityofWashington 3
HammingCode(3)• Example:data=0101,3checkbits– 7bitcode,checkbitposi=ons1,2,4– Check1coversposi=ons1,3,5,7– Check2coversposi=ons2,3,6,7– Check4coversposi=ons4,5,6,7
0100101p1=0+1+1=0,p2=0+0+1=1,p4=1+0+1=0
1234567
CSE461UniversityofWashington 4
HammingCode(4)• Todecode:– Recomputecheckbits(withparitysumincludingthecheckbit)
– Arrangeasabinarynumber– Value(syndrome)tellserrorposi=on– Valueofzeromeansnoerror– Otherwise,flipbittocorrect
CSE461UniversityofWashington 5
HammingCode(5)• Example,con=nued
0100101p1=p2=p4=
Syndrome=Data=
1234567
CSE461UniversityofWashington 6
HammingCode(6)• Example,con=nued
0100101p1=0+0+1+1=0,p2=1+0+0+1=0,p4=0+1+0+1=0
Syndrome=000,noerrorData=0101
1234567
CSE461UniversityofWashington 7
HammingCode(7)• Example,con=nued
0100111p1=p2=p4=
Syndrome=Data=
1234567
CSE461UniversityofWashington 8
HammingCode(8)• Example,con=nued
0100111p1=0+0+1+1=0,p2=1+0+1+1=1,p4=0+1+1+1=1
Syndrome=110,flipposi=on6Data=0101(correcta^erflip!)
1234567
CSE461UniversityofWashington 9
OtherErrorCorrec=onCodes• Codesusedinprac=cearemuchmoreinvolvedthanHamming
• Convolu=onalcodes(§3.2.3)– Takeastreamofdataandoutputamixoftherecentinputbits
– Makeseachoutputbitlessfragile– DecodeusingViterbialgorithm(whichcanusebitconfidencevalues)
CSE461UniversityofWashington 10
OtherCodes(2)–LDPC• LowDensityParityCheck(§3.2.3)– LDPCbasedonsparsematrices– Decodeditera=velyusingabeliefpropaga=onalgorithm
– Stateofthearttoday• InventedbyRobertGallagerin1963aspartofhisPhDthesis– Promptlyforgofenun=l1996…
Source:IEEEGHN,©2009IEEE
CSE461UniversityofWashington 11
Detec=onvs.Correc=on• Whichisbeferwilldependonthepafernoferrors.Forexample:– 1000bitmessageswithabiterrorrate(BER)of1in10000
• Whichhaslessoverhead?
CSE461UniversityofWashington 12
Detec=onvs.Correc=on• Whichisbeferwilldependonthepafernoferrors.Forexample:– 1000bitmessageswithabiterrorrate(BER)of1in10000
• Whichhaslessoverhead?– Its=lldepends!Weneedtoknowmoreabouttheerrors
CSE461UniversityofWashington 13
Detec=onvs.Correc=on(2)1. Assumebiterrorsarerandom
– Messageshave0ormaybe1error
• Errorcorrec=on:– Need~10checkbitspermessage– Overhead:
• Errordetec=on:– Need~1checkbitspermessageplus1000bit
retransmission1/10ofthe=me– Overhead:
CSE461UniversityofWashington 14
Detec=onvs.Correc=on(3)2. Assumeerrorscomeinburstsof100
– Only1or2messagesin1000haveerrors
• Errorcorrec=on:– Need>>100checkbitspermessage– Overhead:
• Errordetec=on:– Need32?checkbitspermessageplus1000
bitresend2/1000ofthe=me– Overhead:
CSE461UniversityofWashington 15
Detec=onvs.Correc=on(4)• Errorcorrec=on:– Neededwhenerrorsareexpected– Orwhenno=meforretransmission
• Errordetec=on:– Moreefficientwhenerrorsarenotexpected
– Andwhenerrorsarelargewhentheydooccur
CSE461UniversityofWashington 16
ErrorCorrec=oninPrac=ce• Heavilyusedinphysicallayer
– LDPCisthefuture,usedfordemandinglinkslike802.11,DVB,WiMAX,LTE,power-line,…
– Convolu=onalcodeswidelyusedinprac=ce
• Errordetec=on(w/retransmission)isusedinthelinklayerandaboveforresidualerrors
• Correc=onalsousedintheapplica=onlayer– CalledForwardErrorCorrec=on(FEC)– Normallywithanerasureerrormodel– E.g.,Reed-Solomon(CDs,DVDs,etc.)
Topic• Mul=plexingisthenetworkwordforthesharingofaresource
• Classicscenarioissharingalinkamongdifferentusers– TimeDivisionMul=plexing(TDM)»– FrequencyDivisionMul=plexing(FDM)»
CSE461UniversityofWashington 17
TimeDivisionMul=plexing(TDM)
• Userstaketurnsonafixedschedule
CSE461UniversityofWashington 18
2 2 2 2
FrequencyDivisionMul=plexing(FDM)• Putdifferentusersondifferentfrequencybands
CSE461UniversityofWashington 19
OverallFDMchannel
CSE461UniversityofWashington 20
TDMversusFDM• InTDMausersendsatahighrateafrac=onofthe=me;inFDM,ausersendsatalowrateallthe=me
Rate
TimeFDM
TDM
CSE461UniversityofWashington 21
TDMversusFDM(2)• InTDMausersendsatahighrateafrac=onofthe=me;inFDM,ausersendsatalowrateallthe=me
Rate
TimeFDM
TDM
CSE461UniversityofWashington 22
TDM/FDMUsage• Sta=callydividearesource– Suitedforcon=nuoustraffic,fixednumberofusers
• Widelyusedintelecommunica=ons– TVandradiosta=ons(FDM)– GSM(2Gcellular)allocatescallsusingTDMwithinFDM
CSE461UniversityofWashington 23
Mul=plexingNetworkTraffic• Networktrafficisbursty
– ON/OFFsources– Loadvariesgreatlyover=me
Rate
TimeRate
Time
CSE461UniversityofWashington 24
Mul=plexingNetworkTraffic(2)• Networktrafficisbursty– InefficienttoalwaysallocateusertheirONneedswithTDM/FDM
Rate
TimeRate
Time
R
R
Mul=plexingNetworkTraffic(3)• Mul=pleaccessschemesmul=plexusersaccordingtotheirdemands–forgainsofsta=s=calmul=plexing
CSE461UniversityofWashington 25
Rate
TimeRate
Time
Rate
Time
R
R
R’<2R
Twousers,eachneedR TogethertheyneedR’<2R
CSE461UniversityofWashington 26
Mul=pleAccess• Wewilllookattwokindsofmul=ple
accessprotocols1. Randomized.Nodesrandomizetheir
resourceaccessafempts– Goodforlowloadsitua=ons
2. Conten=on-free.Nodesordertheirresourceaccessafempts– Goodforhighloadorguaranteed
qualityofservicesitua=ons
CSE461UniversityofWashington 27
Topic• Howdonodesshareasinglelink?Whosendswhen,e.g.,inWiFI?– Explorewithasimplemodel
• Assumeno-oneisincharge;thisisadistributedsystem
CSE461UniversityofWashington 28
Topic(2)• Wewillexplorerandommul=pleaccesscontrol(MAC)protocols– ThisisthebasisforclassicEthernet– Remember:datatrafficisbursty
Zzzz..Busy! Hohum
CSE461UniversityofWashington 29
ALOHANetwork• Seminalcomputernetworkconnec=ngtheHawaiianislandsinthelate1960s– Whenshouldnodessend?– AnewprotocolwasdevisedbyNormAbramson…
Hawaii
CSE461UniversityofWashington 30
ALOHAProtocol• Simpleidea:– Nodejustsendswhenithastraffic.– Iftherewasacollision(noACKreceived)thenwaitarandom=meandresend
• That’sit!
CSE461UniversityofWashington 31
ALOHAProtocol(2)• Someframeswillbelost,butmanymaygetthrough…
• Goodidea?
CSE461UniversityofWashington 32
ALOHAProtocol(3)• Simple,decentralizedprotocolthatworkswellunderlowload!
• Notefficientunderhighload– Analysisshowsatmost18%efficiency– Improvement:divide=meintoslotsandefficiencygoesupto36%
• We’lllookatotherimprovements
CSE461UniversityofWashington 33
ClassicEthernet• ALOHAinspiredBobMetcalfetoinventEthernetforLANsin1973– Nodesshare10Mbpscoaxialcable– Hugelypopularin1980s,1990s
:©2009IEEE
CSE461UniversityofWashington 34
CSMA(CarrierSenseMul=pleAccess)• ImproveALOHAbylisteningforac=vitybeforewesend(Doh!)– Candoeasilywithwires,notwireless
• Sodoesthiseliminatecollisions?– Whyorwhynot?
CSE461UniversityofWashington 35
CSMA(2)• S=llpossibletolistenandhearnothingwhenanothernodeissendingbecauseofdelay
CSE461UniversityofWashington 36
CSMA(3)• CSMAisagooddefenseagainstcollisionsonlywhenBDissmall
X
CSE461UniversityofWashington 37
CSMA/CD(withCollisionDetec=on)• Canreducethecostofcollisionsbydetec=ngthemandabor=ng(Jam)therestoftheframe=me– Again,wecandothiswithwires
XXXXXXXXJam! Jam!
CSE461UniversityofWashington 38
CSMA/CDComplica=ons• Wanteveryonewhocollidestoknowthatithappened– Timewindowinwhichanodemayhearofacollisionis2Dseconds
X
CSE461UniversityofWashington 39
CSMA/CDComplica=ons(2)• Imposeaminimumframesizethatlastsfor2Dseconds– Sonodecan’tfinishbeforecollision– Ethernetminimumframeis64bytes
X
CSE461UniversityofWashington 40
CSMA“Persistence”• Whatshouldanodedoifanothernodeissending?
• Idea:Waitun=litisdone,andsend
Whatnow?
CSE461UniversityofWashington 41
CSMA“Persistence”(2)• Problemisthatmul=plewai=ngnodeswillqueueupthencollide– Moreload,moreofaproblem
Now! Now!Uhoh
CSE461UniversityofWashington 42
CSMA“Persistence”(3)• Intui=onforabefersolu=on– IfthereareNqueuedsenders,wewanteachtosendnextwithprobability1/N
Sendp=½WhewSendp=½
CSE461UniversityofWashington 43
BinaryExponen=alBackoff(BEB)• Cleverlyes=matestheprobability
– 1stcollision,wait0or1frame=mes– 2ndcollision,waitfrom0to3=mes– 3rdcollision,waitfrom0to7=mes…
• BEBdoublesintervalforeachsuccessivecollision– Quicklygetslargeenoughtowork– Veryefficientinprac=ce
ClassicEthernet,orIEEE802.3• MostpopularLANofthe1980s,1990s– 10Mbpsoversharedcoaxialcable,withbasebandsignals– Mul=pleaccesswith“1-persistentCSMA/CDwithBEB”
CSE461UniversityofWashington 44
EthernetFrameFormat• Hasaddressestoiden=fythesenderandreceiver• CRC-32forerrordetec=on;noACKsorretransmission• Startofframeiden=fiedwithphysicallayerpreamble
CSE461UniversityofWashington 45
PacketfromNetworklayer(IP)
CSE461UniversityofWashington 46
ModernEthernet• Basedonswitches,notmul=pleaccess,buts=llcalledEthernet– We’llgettoitinalatersegment
Switch
TwistedpairSwitchports