资源描述:
《tcp ip协议new》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
ComputerNetworks(CS422)DouglasComerComputerScienceDepartmentPurdueUniversityWestLafayette,IN47907http://www.cs.purdue.edu/people/comerÓCopyright2003.Allrightsreserved.Thisdocumentmaynotbereproducedbyanymeanswithouttheexpresswrittenconsentoftheauthor. COMPUTERNETWORKS(CS422)2003ProfessorDouglasComerCS422--PART112003 PARTIIntroductionCS422--PART122003 TopicAndScopeComputernetworksandinternets:anoverviewofconcepts,terminology,andtechnologiesthatformthebasisfordigitalcommunicationinprivatecorporatenetworksandtheglobalInternetCS422--PART132003 YouWillLearn Terminology Communicationbasics±Mediaandsignals±Asynchronousandsynchronouscommunication±Relationshipsamongbandwidth,throughput,andnoise±Frequency-divisionandtime-divisionmultiplexingCS422--PART142003 YouWillLearn(continued) Networkingandnetworktechnologies±Packetswitching±Framing,parity,anderrordetection±Localandwideareatechnologies±Networkaddressing±Connectionandextension(repeaters,bridges,hubs,switches)±Topologiesandwiring(star,ring,bus)±Next-hopforwarding±Shortestpathcomputation±Measuresofdelayandthroughput±ProtocollayersCS422--PART152003 YouWillLearn(continued) InternetsandInternetworking±Motivationandconcept±InternetProtocol(IP)datagramformatandaddressing±Internetroutersandrouting±Addressbinding(ARP)±Internetcontrolmessages(ICMP)±UserDatagramProtocol(UDP)±TransmissionControlProtocol(TCP)±ProtocolportsanddemultiplexingCS422--PART162003 YouWillLearn(continued) Networkapplications±Client-serverparadigm±Domainnamesystem(DNS)±Filetransfer(FTP)±Mailtransfer(SMTP)±IPTelephony±Remotelogin(TELNET)±Webtechnologiesandprotocols(HTTP,CGI)±NetworksecurityCS422--PART172003 WhatYouWillNotLearn Commercialaspects±Products±Vendors±Prices±Networkoperatingsystems Howtopurchase/con®gure/operate Howtodesign/implementprotocolsoftwareCS422--PART182003 BackgroundRequired AbilitytoprograminC Knowledgeoflow-levelprogrammingconstructs±Pointers±Bit®eldsinstructures±Printf Familiaritywithbasictools±Texteditor±Compiler/linker/loaderCS422--PART192003 BackgroundRequired(continued) Basicknowledgeofoperatingsystems±Terminology±Functionality±Processesandconcurrentprocessing DesiretolearnCS422--PART1102003 ScheduleOfTopics Signals,media,bandwidth,throughput,andmultiplexing(~1weeks) Networking:concepts,technologies(~4weeks) Internetworkingfundamentals(~5weeks) Internetapplications(~5weeks)CS422--PART1112003 Labs Anessentialpartofthecourse Youwillgainhands-onexperiencewith±Networkprogrammingandapplications±Packetanalysis±Networkmeasurement±Socketprogramming Labswillstartwithnetworkapplicationsrightaway!CS422--PART1122003 MotivationForNetworking Informationaccess Interactionamongcooperativeapplicationprograms ResourcesharingCS422--PART1132003 PracticalResults E-mail Filetransfer/access Webbrowsing Remotelogin/execution IPTelephony TheInternetCS422--PART1142003 WhatANetworkIncludes Transmissionhardware Special-purposehardwaredevices±Interconnecttransmissionmedia±Controltransmission±Runprotocolsoftware Protocolsoftware±Encodesandformatsdata±DetectsandcorrectsproblemsCS422--PART1152003 WhatANetworkDoes Providescommunicationthatis±Reliable±Fair±Ef®cient±Secure±FromoneapplicationtoanotherCS422--PART1162003 WhatANetworkDoes(continued) Automaticallydetectsandcorrects±Datacorruption±Dataloss±Duplication±Out-of-orderdelivery Automatically®ndsoptimalpathfromsourcetodestinationCS422--PART1172003 NetworkProgramming Networkallowsarbitraryapplicationstocommunicate Programmerdoesnotneedtounderstandnetworktechnologies NetworkfacilitiesaccessedthroughanApplicationProgramInterfaceCS422--PART1182003 BasicParadigmForInternetCommunication Establishcontact Exchangedata(bi-directional) TerminatecontactCS422--PART1192003 EstablishingContact Performedbypairofapplications Oneapplicationstartsandwaitsforcontact(calledserver) Otherapplicationinitiatescontact(calledclient)CS422--PART1202003 IdentifyingAWaitingApplication Conceptuallytwoitemsspeci®ed±Computer±Applicationonthatcomputer Terminology±Computeridenti®edbydomainname±Applicationidenti®edbyprogramnameCS422--PART1212003 RepresentationsAndTranslations Humansusenamessuchas±www.netbook.cs.purdue.edu(computer)±ftp(application) Networkprotocolsrequirebinaryvalues LibraryroutinesexisttotranslatefromnamestonumbersCS422--PART1222003 ExampleAPIOperationMeaningawait_contactusedbyaservertowaitforcontactfromaclientmake_contactusedbyaclienttocontactaservercname_to_compusedtotranslateacomputernametoanequivalentinternalbinaryvalueappname_to_appnumusedtotranslateaprogramnametoanequivalentinternalbinaryvaluesendusedbyeitherclientorservertosenddatarecvusedbyeitherclientorservertoreceivedatasend_eofusedbybothclientandserveraftertheyhavefinishedsendingdataCS422--PART1232003 Example#1:Echo Usefulfornetworktesting Serverreturnsexactcopyofdatasent UseroncomputerXrunsechoserver22000 UseronanothercomputerrunsechoclientX22000CS422--PART1242003 Example#2:Chat MiniatureversionofInternetchatservice Allowstwouserstocommunicate UseroncomputerXrunschatserver25000 UseronanothercomputerrunschatclientX25000CS422--PART1252003 ExampleApplication:WebServer UseroncomputerXrunswebserver27000 UseronanothercomputerrunsbrowserandentersURL:http://X:27000/index.htmlCS422--PART1262003 ExampleCodeUsingAPI:Echoserver/*echoserver.c*/#include#include#include#include"win32.h"#defineBUFFSIZE256/*-----------------------------------------------------------------------**Program:echoserver*Purpose:waitforaconnectionfromanechoclientandechodata*Usage:echoserver**-----------------------------------------------------------------------*/intmain(intargc,char*argv[]){connectionconn;intlen;charbuff[BUFFSIZE];if(argc!=2){(void)fprintf(stderr,"usage:%s ",argv[0]);exit(1);}CS422--PART1272003 Echoserver(2of2)/*waitforaconnectionfromanechoclient*/conn=await_contact((appnum)atoi(argv[1]));if(conn<0)exit(1);/*iterate,echoingalldatareceiveduntilendoffile*/while((len=recv(conn,buff,BUFFSIZE,0))>0)(void)send(conn,buff,len,0);send_eof(conn);return0;} ActuallyworksontheInternet APIcallsreplaceconventionalI/O NonetworkingknowledgerequiredCS422--PART1282003 ExampleCodeUsingAPI:Webserver/*webserver.c*/#include#include#include#include#include"win32.h"#ifdefined(LINUX)||defined(SOLARIS)#include#endif#defineBUFFSIZE256#defineSERVER_NAME"CNAIDemoWebServer"#defineERROR_400"Error400
Theservercouldn'tunderstandyourrequest. "#defineERROR_404"
Error404
Document otfound. "#defineHOME_PAGE"
WelcometotheCNAIDemoServer
Whynotvisit:
- NetbookHomePage
- ComerBooksHomePage
"#defineTIME_PAGE"Thecurrentdateis:%s
"intrecvln(connection,char*,int);CS422--PART1292003 Webserver(2of6)/*-----------------------------------------------------------------------**Program:webserver*Purpose:servehard-codedwebpagestowebclients*Usage:webserver**-----------------------------------------------------------------------*/intmain(intargc,char*argv[]){connectionconn;intn;charbuff[BUFFSIZE],cmd[16],path[64],vers[16];char*timestr;#ifdefined(LINUX)||defined(SOLARIS)structtimevaltv;#elifdefined(WIN32)time_ttv;#endifif(argc!=2){(void)fprintf(stderr,"usage:%s ",argv[0]);exit(1);}CS422--PART1302003 Webserver(3of6)while(1){/*waitforcontactfromaclientonspecifiedappnum*/conn=await_contact((appnum)atoi(argv[1]));if(conn<0)exit(1);/*readandparsetherequestline*/n=recvln(conn,buff,BUFFSIZE);sscanf(buff,"%s%s%s",cmd,path,vers);/*skipallheaders-readuntilwegetr alone*/while((n=recvln(conn,buff,BUFFSIZE))>0){if(n==2&&buff[0]=='r'&&buff[1]==' ')break;}/*checkforunexpectedendoffile*/if(n<1){(void)send_eof(conn);continue;}CS422--PART1312003 Webserver(4of6)/*checkforarequestthatwecannotunderstand*/if(strcmp(cmd,"GET")||(strcmp(vers,"HTTP/1.0")&&strcmp(vers,"HTTP/1.1"))){send_head(conn,400,strlen(ERROR_400));(void)send(conn,ERROR_400,strlen(ERROR_400),0);(void)send_eof(conn);continue;}/*sendtherequestedwebpageora"notfound"error*/if(strcmp(path,"/")==0){send_head(conn,200,strlen(HOME_PAGE));(void)send(conn,HOME_PAGE,strlen(HOME_PAGE),0);}elseif(strcmp(path,"/time")==0){#ifdefined(LINUX)||defined(SOLARIS)gettimeofday(&tv,NULL);timestr=ctime(&tv.tv_sec);#endif(void)sprintf(buff,TIME_PAGE,timestr);send_head(conn,200,strlen(buff));(void)send(conn,buff,strlen(buff),0);}else{/*notfound*/send_head(conn,404,strlen(ERROR_404));(void)send(conn,ERROR_404,strlen(ERROR_404),0);}(void)send_eof(conn);}}CS422--PART1322003 Webserver(5of6)/*-----------------------------------------------------------------------*send_head-sendanHTTP1.0headerwithgivenstatusandcontent-len*-----------------------------------------------------------------------*/voidsend_head(connectionconn,intstat,intlen){char*statstr,buff[BUFFSIZE];/*convertthestatuscodetoastring*/switch(stat){case200:statstr="OK";break;case400:statstr="BadRequest";break;case404:statstr="NotFound";break;default:statstr="Unknown";break;}CS422--PART1332003 Webserver(6of6)/**sendanHTTP/1.0responsewithServer,Content-Length,*andContent-Typeheaders.*/(void)sprintf(buff,"HTTP/1.0%d%sr ",stat,statstr);(void)send(conn,buff,strlen(buff),0);(void)sprintf(buff,"Server:%sr ",SERVER_NAME);(void)send(conn,buff,strlen(buff),0);(void)sprintf(buff,"Content-Length:%dr ",len);(void)send(conn,buff,strlen(buff),0);(void)sprintf(buff,"Content-Type:text/htmlr ");(void)send(conn,buff,strlen(buff),0);(void)sprintf(buff,"r ");(void)send(conn,buff,strlen(buff),0);}CS422--PART1342003 Summary Studyingnetworksisimportantbecause±Theworldisinterconnected±Applicationsnowoperateinadistributedenvironment Thiscourse±Coversallofnetworkingandinternetworking±Explainsthemystery±WillbehardworkCS422--PART1352003 Summary(continued) Computernetworks±Deliverdatafromsourcetodestination±Automatically®ndoptimalpaths±Handleproblemsthatoccur WewilllearnhownetworksdotheaboveCS422--PART1362003 PARTIISignals,Media,andDataTransmissionCS422--PART212003 TransmissionOfInformation Well-understoodbasics Fromphysics±Energy±Electromagneticwavepropagation Frommathematics±CodingtheoryCS422--PART222003 TransmissionMedia Copperwire±Needtwowires±Possibilities*Twistedpair*Coaxialcable Optical®ber±Flexible±Light``staysin'' Air/space±UsedforelectromagnetictransmissionCS422--PART232003 FormsOfEnergyUsedToTransmitData Electriccurrent Audiblesounds Omni-directionalelectromagneticwaves±RadioFrequency(RF)±InfraredCS422--PART242003 FormsOfEnergyUsedToTransmitData(continued) Directionalelectromagneticwaves±Point-to-pointsatellitechannel±Limitedbroadcast(spotbeam)±Microwave±LaserbeamCS422--PART252003 TypesOfSatellites GeosynchronousEarthOrbit(GEO) LowEarthOrbit(LEO)±ArrayneededCS422--PART262003 TwoImportantPhysicalLimitsOfATransmissionSystem Propagationdelay±Timerequiredforsignaltotravelacrossmedia±Example:electromagneticradiationtravelsthroughspaceatthespeedoflight(C=3´108meterspersecond) Bandwidth±MaximumtimespersecondthesignalcanchangeCS422--PART272003 TransmissionOfData Networkhardwareencodesinformationfortransmission Twotypesofencoding±Analog(amountofenergyproportionaltovalueofitemsent)±Digital(twoformsofenergytoencode0and1) ComputernetworksusethelatterCS422--PART282003 ExampleDigitalEncoding Medium±Copperwire Energyform±Electriccurrent Encoding±Negativevoltageencodes1±Positivevoltageencodes0CS422--PART292003 IllustrationOfDigitalEncodingvoltage+0...............................................................................................time-101001 Knownaswaveformdiagram X-axiscorrespondstotime Y-axiscorrespondstovoltageCS422--PART2102003 EncodingDetails Alldetailsspeci®edbyastandard Severalorganizationsproducenetworkingstandards±IEEE±ITU±EIA HardwarethatadherestostandardinteroperableCS422--PART2112003 TheRS-232CStandard Exampleuse±Connectiontokeyboard/mouse±SerialportonPC Speci®edbyEIA Voltageis+15or-15 Cablelimitedto~50feet NewerEIAstandardisRS-422(ITUstandardisV.24) UsesasynchronouscommunicationCS422--PART2122003 AsynchronousCommunication Senderandreceivermustagreeon±Numberofbitspercharacter±Durationofeachbit Receiver±Doesnotknowwhenacharacterwillarrive±Maywaitforever Toensuremeaningfulexchangesend±Startbitbeforecharacter±OneormorestopbitsaftercharacterCS422--PART2132003 IllustrationOfRS-232voltage+15........................0....................................................................................................time......................-15..idlestart1011010stopidle Startbit±Sameas0±Notpartofdata Stopbit±Sameas1±FollowsdataCS422--PART2142003 DurationOfABitInRS-232C Determinedbybaudrate±Examplebaudrates:9.6Kbaud,28.8Kbaud,33.6Kbaud±Durationofbitis1/baud_rate Senderandreceivermustagreeapriori Receiversamplessignal DisagreementresultsinframingerrorCS422--PART2152003 Two-WayCommunication Desirableinpractice Requireseachsidetohavetransmitterandreceiver CalledfullduplexCS422--PART2162003 IllustrationOfFull-DuplexCommunicationdatadataTTRRGG Transmitterononesideconnectedtoreceiveronother Separatewiresneededtocarrycurrentineachdirection Commongroundwire DB-9,DB-15,orDB-25connectorused±Pin2istransmit±Pin3isreceiveCS422--PART2172003 ElectricalTransmission(TheBadNews) It'sanuglyworld±Electricalenergydissipatesasittravelsalong±Wireshaveresistance,capacitance,andinductancewhichdistortsignals±Magneticorelectricalinterferencedistortssignals±DistortioncanresultinlossormisinterpretationCS422--PART2182003 IllustrationOfDistortedSignalForASingleBitrealideal Inpractice±DistortioncanbemuchworsethanillustratedCS422--PART2192003 Consequences RS-232hardwaremusthandleminordistortions±Takemultiplesamplesperbit±Toleratelessthanfullvoltage Cannotuseelectricalcurrentforlong-distancetransmissionCS422--PART2202003 Long-DistanceCommunication Importantfact:anoscillatingsignaltravelsfartherthandirectcurrent Forlong-distancecommunication±Sendasinewave(calledacarrierwave)±Change(modulate)thecarriertoencodedata Note:modulatedcarriertechniqueusedforradioandtelevisionCS422--PART2212003 IllustrationOfACarriersignal...............................................................................................time Carrier±Usuallyasinewave±Oscillatescontinuously Frequencyofcarrier®xedCS422--PART2222003 TypesOfModulation Amplitudemodulation(usedinAMradio) Frequencymodulation(usedinFMradio) Phaseshiftmodulation(usedfordata)CS422--PART2232003 IllustrationOfAmplitudeModulationdata0...............................................................................................time1(a)signal...............................................................................................time(b) Strengthofsignalencodes0or1 Onecycleofwaveneededforeachbit DataratelimitedbycarrierbandwidthCS422--PART2242003 IllustrationOfPhase-ShiftModulationsignal...............................................................................................time ChangeinphaseencodesKbits DataratehigherthancarrierbandwidthCS422--PART2252003 Phase-ShiftExamplesignal...........................................................................................timesignal...........................................................................................time Sectionofwaveisomittedatphaseshift DatabitsdeterminesizeofomittedsectionCS422--PART2262003 Modem Hardwaredevice Usedforlong-distancecommunication Containsseparatecircuitryfor±Modulationofoutgoingsignal±Demodulationofincomingsignal Nameabbreviatesmodulator/demodulatorCS422--PART2272003 IllustrationOfModemsUsedOverALongDistancelong-distanceconnectionmodem(4wires)modemcomputerMMcomputeratsite1atsite2DDRS-232RS-232canbecanbeusedused Onemodemateachend Separatewirescarrysignalsineachdirection ModulatorononemodemconnectstodemodulatoronotherCS422--PART2282003 TypesOfModems Conventional±Usefourwires±Transmitmodulatedelectricalwave Optical±Useglass®bers±Transmitmodulatedlight Wireless±Useair/space±TransmitmodulatedRFwaveCS422--PART2292003 TypesOfModems(continued) Dialup±Usevoicetelephonesystem±Transmitmodulatedaudiotone Note:inpractice,adialupmodemusesmultipletonessimultaneouslyCS422--PART2302003 IllustrationOfDialupModemmodemmodemcomputerVoiceTelephonecomputeratsite1Systematsite2RS-232RS-232canbecanbeusedused Modemcan±Dial±Answer CarrierisaudiotoneCS422--PART2312003 ModemTerminology Full-duplexmodem±Provides2-waycommunication±Allowssimultaneoustransmission±Usesfourwires Half-duplexmodem±Provides2-waycommunication±Transmitsinonedirectionatanytime±UsestwowiresCS422--PART2322003 Recall Propagationdelay±Determinedbyphysics±Timerequiredforsignaltotravelacrossmedium Bandwidth±Electricalpropertyofphysicaltransmissionsystem±MaximumtimespersecondsignalcanchangeCS422--PART2332003 FundamentalMeasuresOfADigitalTransmissionSystem Delay±Theamountoftimerequiredforabitofdatatotravelfromoneendtotheother±Usuallythesameasthepropagationdelayinunderlyinghardware Throughput±Thenumberofbitspersecondthatcanbetransmitted±RelatedtounderlyinghardwarebandwidthCS422--PART2342003 RelationshipBetweenDigitalThroughputAndBandwidth GivenbyNyquist'stheorem:D=2Blog2Kwhere±Dismaximumdatarate±Bishardwarebandwidth±KisnumberofvaluesusedtoencodedataCS422--PART2352003 ApplicationsOfNyquist'sTheorem ForRS-232±Kis2becauseRS-232usestwovalues,+15or-15volts,toencodedatabits±Dis2Blog22=2B Forphase-shiftencoding±SupposeKis8(possibleshifts)±Dis2Blog28=2B´3=6BCS422--PART2362003 MoreBadNews Physicstellsusthatrealsystemsemitandabsorbenergy(e.g.,thermal) Engineerscallunwantedenergynoise Nyquist'stheorem±Assumesanoise-freesystem±Onlyworksintheory Shannon'stheoremcorrectsfornoiseCS422--PART2372003 Shannon'sTheorem Givescapacityinpresenceofnoise:C=Blog2(1+S/N)where±Cistheeffectivechannelcapacityinbitspersecond±Bishardwarebandwidth±Sistheaveragepower(signal)±Nisthenoise S/Nissignal-to-noiseratioCS422--PART2382003 ApplicationOfShannon'sTheorem Conventionaltelephonesystem±Engineeredforvoice±Bandwidthis3000Hz±Signal-to-noiseratioisapproximately1000±Effectivecapacityis3000log2(1+1000)=~30000bps Conclusion:dialupmodemshavelittlehopeofexceeding28.8KbpsCS422--PART2392003 TheBottomLine Nyquist'stheoremmeans®ndingawaytoencodemorebitspercycleimprovesthedatarate Shannon'stheoremmeansthatnoamountofcleverengineeringcanovercomethefundamentalphysicallimitsofarealtransmissionsystemCS422--PART2402003 Multiplexing Fundamentaltonetworking Generalconcept Usedin±Lowestleveloftransmissionsystems±Higherlevelsofnetworkhardware±Protocolsoftware±ApplicationsCS422--PART2412003 TheGeneralConceptOfMultiplexingsourcesdestinations112233multiplexorsharedchanneldemultiplexor Separatepairsofcommunicationstravelacrosssharedchannel Multiplexingpreventsinterference EachdestinationreceivesonlydatasentbycorrespondingsourceCS422--PART2422003 MultiplexingTerminology Multiplexor±Deviceormechanism±Acceptsdatafrommultiplesources±Sendsdataacrosssharedchannel Demultiplexor±Deviceormechanism±Extractsdatafromsharedchannel±SendstocorrectdestinationCS422--PART2432003 TwoBasicTypesOfMultiplexing TimeDivisionMultiplexing(TDM)±Onlyoneitematatimeonsharedchannel±Itemmarkedtoidentifysource±Demultiplexorusesidentifyingmarktoknowwheretodeliver FrequencyDivisionMultiplexing(FDM)±Multipleitemstransmittedsimultaneously±Usesmultiple``channels''CS422--PART2442003 TransmissionSchemes Basebandtransmission±Usesonlylowfrequencies±Encodesdatadirectly Broadbandtransmission±Usesmultiplecarriers±Canusehigherfrequencies±Achieveshigherthroughput±HardwaremorecomplexandexpensiveCS422--PART2452003 Scienti®cPrincipleBehindFrequencyDivisionMultiplexingTwoormoresignalsthatusedifferentcarrierfrequenciescanbetransmittedoverasinglemediumsimultaneouslywithoutinterference.Note:thisisthesameprinciplethatallowsacableTVcompanytosendmultipletelevisionsignalsacrossasinglecable.CS422--PART2462003 WaveDivisionMultiplexing Facts±FDMcanbeusedwithanyelectromagneticradiation±Lightiselectromagneticradiation Whenappliedtolight,FDMiscalledwavedivisionmultiplexing±InformallycalledcolordivisionmultiplexingCS422--PART2472003 Summary Varioustransmissionschemesandmediaavailable±Electricalcurrentovercopper±Lightoverglass±Electromagneticwaves Digitalencodingusedfordata Asynchronouscommunication±Usedforkeyboardsandserialports±RS-232isstandard±SenderandreceiveragreeonbaudrateCS422--PART2482003 Summary(continued) Modems±Usedforlong-distancecommunication±Availableforcopper,optical®ber,dialup±Transmitmodulatedcarrier*Phase-shiftmodulationpopular±Classi®edasfull-orhalf-duplex Twomeasuresofdigitalcommunicationsystem±Delay±ThroughputCS422--PART2492003 Summary(continued) Nyquist'stheorem±Relatesthroughputtobandwidth±Encouragesengineerstousecomplexencoding Shannon'stheorem±Adjustsfornoise±Speci®eslimitsonrealtransmissionsystemsCS422--PART2502003 Summary(continued) Multiplexing±Fundamentalconcept±Usedatmanylevels±Appliedinbothhardwareandsoftware±Twobasictypes*Time-divisionmultiplexing(TDM)*Frequency-divisionmultiplexing(FDM) Whenappliedtolight,FDMiscalledwave-divisionmultiplexingCS422--PART2512003 PARTIIIPackets,Frames,Parity,Checksums,andCRCsCS422--PART312003 TheProblem Cannotaffordindividualnetworkconnectionperpairofcomputers Reasons±Installingwiresconsumestimeandmoney±Maintainingwiresconsumesmoney(esp.long-distanceconnections)CS422--PART322003 SolutionACsharedresourceBD Networkhas±Sharedcentralcore±ManyattachedstationsCS422--PART332003 TheProblemWithSharing Demandhigh Someapplicationshavelargetransfers Someapplicationscannotwait NeedmechanismforfairnessCS422--PART342003 PacketSwitchingPrinciple Solutionforfairness±Dividedataintosmallunitscalledpackets±Alloweachstationopportunitytosendapacketbeforeanystationsendsanother Formoftime-divisionmultiplexingCS422--PART352003 IllustrationOfPacketSwitchingmultiplexingoccursComputer1usingchanneltosendapacketcomputer1computer2computer3(a)Computer2usingchanneltosendapacketcomputer1computer2computer3(b) Acquiresharedmedium Sendonepacket AllowotherstationsopportunitytosendbeforesendingagainCS422--PART362003 PacketDetails Dependonunderlyingnetwork±Minimum/maximumsize±Format HardwarepacketcalledaframeCS422--PART372003 ExampleFrameFormatUsedWithRS-232sohblockofdatainframeeot RS-232ischaracter-oriented Specialcharacters±Startofheader(soh)±Endoftext(eot)CS422--PART382003 WhenDataContainsSpecialCharacters Translatetoalternativeform Calledbytestuffing ExampleCharacterCharactersInDataSentsohescxeotescyescesczCS422--PART392003 IllustrationOfFrameWithByteStuf®ngescsoheotesc(a)sohesczescxescyesczeot(b) Stuffedframelongerthanoriginal NecessaryevilCS422--PART3102003 HandlingErrors Datacanbecorruptedduringtransmission±Bitslost±Bitvalueschanged Frameincludesadditionalinformationtodetect/correcterror±Setbysender±Checkedbyreceiver StatisticalguaranteeCS422--PART3112003 ErrorDetectionAndRecoveryTechniques Paritybit±Oneadditionalbitpercharacter±Canuse*Evenparity*Oddparity±CannothandleerrorthatchangestwobitsCS422--PART3122003 ErrorDetectionAndRecoveryTechniques(continued) Checksum±Treatdataassequenceofintegers±Computeandsendarithmeticsum±Handlesmultiplebiterrors±CannothandleallerrorsCS422--PART3132003 ErrorDetectionAndRecoveryTechniques(continued) CyclicRedundancyCheck(CRC)±Mathematicalfunctionfordata±Morecomplextocompute±HandlesmoreerrorsCS422--PART3142003 ExampleChecksumComputationHelloworld.48656C6C6F20776F726C642E4865+6C6C+6F20+776F+726C+642E+carry=71FC Checksumcomputedoverdata ChecksumappendedtoframeCS422--PART3152003 IllustrationOfErrorsAChecksumFailsToDetectDataItemChecksumDataItemChecksumInBinaryValueInBinaryValue0001100113001020000000113000110001100113totals77 Secondbitreversedineachitem ChecksumisthesameCS422--PART3162003 BuildingBlocksForCRC Exclusiveoraboutouta000011b101110(a)(b) Shiftregistershiftregistershiftregister11011011001101outputvaluetobeoutputinputvalueshiftedinchangesshiftsin(a)(b)±ashowsstatusbeforeshift±bshowsstatusaftershift±OutputsameastopbitCS422--PART3172003 ExampleOfCRCHardware0000000000000000input Computes16-bitCRC Registersinitializedtozero Bitsofmessageshiftedin CRCfoundinregistersCS422--PART3182003 ExampleCRCComputation0111111111111111inputofall1's1111111111111111inputofall1's1110111111011110inputofall1's Inputdataisall1bits CRCshownafter15,16,and17bitsshifted FeedbackintroduceszeroesinCRCCS422--PART3192003 IllustrationOfFrameUsingCRCsohblockofdatawithbytestuffingeotCRC CRCcoversdataonlyCS422--PART3202003 Summary Packettechnology±Inventedtoprovidefairaccessinsharednetwork±Senderdividesdataintosmallpackets Hardwarepacketscalledframes Canusepacket-switchingwithRS-232±Specialcharactersdelimitbeginningandendofframe±Byte-stuf®ngneededwhenspecialcharactersappearindataCS422--PART3212003 Summary(continued) Todetectdatacorruption±Senderaddsinformationtopacket±Receiverchecks Techniques±Paritybit±Checksum±CyclicRedundancyCheck(CRC)±ProvidestatisticalguaranteesCS422--PART3222003 PARTIVLocalAreaNetworks(LANs)CS422--PART412003 Classi®cationTerminology Networktechnologiesclassi®edintothreebroadcategories LocalAreaNetwork(LAN) MetropolitanAreaNetwork(MAN) WideAreaNetwork(WAN) LANandWANmostwidelydeployedCS422--PART422003 TheLocalAreaNetwork(LAN) Engineeringclassi®cation Extremelypopular(mostnetworksareLANs) ManyLANtechnologiesexistCS422--PART432003 KeyFeaturesOfALAN Highthroughput Relativelylowcost Limitedtoshortdistance OftenrelyonsharedmediaCS422--PART442003 Scienti®cJusti®cationForLocalAreaNetworksAcomputerismorelikelytocommunicatewithcomputersthatarenearbythanwithcomputersthataredistant. KnownasthelocalityprincipleCS422--PART452003 Topology Mathematicalterm Roughlyinterpretedas``geometryforcurvedsurfaces''CS422--PART462003 NetworkTopology Speci®esgeneral``shape''ofanetwork Handfulofbroadcategories OftenappliedtoLAN Primarilyreferstointerconnections HidesdetailsofactualdevicesCS422--PART472003 StarTopologycomputersconnectedhubtonetwork Centralcomponentofnetworkknownashub EachcomputerhasseparateconnectiontohubCS422--PART482003 RingTopologyconnectionfromonecomputertoanother Nocentralfacility ConnectionsgodirectlyfromonecomputertoanotherCS422--PART492003 BusTopologyBus(sharedcable) Sharedmediumformsmaininterconnect EachcomputerhasaconnectiontothemediumCS422--PART4102003 ExampleBusNetwork:Ethernet MostpopularLAN Widelyused IEEEstandard802.3 Severalgenerations±Sameframeformat±Differentdatarates±DifferentwiringschemesCS422--PART4112003 SharedMediumInALAN Sharedmediumusedforalltransmissions Onlyonestationtransmitsatanytime Stations``taketurns''usingmedium MediaAccessControl(MAC)policyensuresfairnessCS422--PART4122003 IllustrationOfEthernetTransmissionEthernetCable(sharedbus)SendingcomputerdestinationcomputerSignalpropagatestransmitsbitsreceivesacopyalongtheentireofaframeofeachbitcable Onlyonestationtransmitsatanytime Signalpropagatesacrossentirecable Allstationsreceivetransmission CSMA/CDmediaaccessschemeCS422--PART4132003 CSMA/CDParadigm MultipleAccess(MA)±Multiplecomputersattachtosharedmedia±Eachusessameaccessalgorithm CarrierSense(CS)±Waituntilmediumidle±Begintotransmitframe SimultaneoustransmissionpossibleCS422--PART4142003 CSMA/CDParadigm(continued) Twosimultaneoustransmissions±Interferewithoneanother±Calledcollision CSMAplusCollisionDetection(CD)±Listentomediumduringtransmission±Detectwhetheranotherstation'ssignalinterferes±BackofffrominterferenceandtryagainCS422--PART4152003 BackoffAfterCollision Whencollisionoccurs±Waitrandomtimet1,0£t1£d±UseCSMAandtryagain Ifsecondcollisionoccurs±Waitrandomtimet2,0£t2£2d Doublerangeforeachsuccessivecollision CalledexponentialbackoffCS422--PART4162003 MediaAccessOnAWirelessNetddcomputer1computer2computer3 Limitedrange±Notallstationsreceivealltransmissions±CannotuseCSMA/CD Exampleindiagram±Maximumtransmissiondistanceisd±Stations1and3donotreceiveeachother'stransmissionsCS422--PART4172003 CSMA/CA UsedonwirelessLANs Bothsidessendsmallmessagefollowedbydatatransmission±``XisabouttosendtoY''±``YisabouttoreceivefromX''±DataframesentfromXtoY Purpose:informallstationsinrangeofXorYbeforetransmission KnownasCollisionAvoidance(CA)CS422--PART4182003 Wi-FiWirelessLANTechnology Popular UsesCSMA/CAformediaaccess StandardssetbyIEEE±802.11b(11Mbps,sharedchannel)±802.11a(54Mbps,sharedchannel) NamedWi-Fibyconsortiumofvendors(toenhancepopularappeal)CS422--PART4192003 IdentifyingADestination Allstationsonshared-mediaLANreceivealltransmissions Toallowsendertospecifydestination±Eachstationassigneduniquenumber±Knownasstation'saddress±EachframecontainsaddressofintendedrecipientCS422--PART4202003 EthernetAddressing StandardizedbyIEEE Eachstationassignedunique48-bitaddress Addressassignedwhennetworkinterfacecard(NIC)manufacturedCS422--PART4212003 EthernetAddressRecognition Eachframecontainsdestinationaddress Allstationsreceiveatransmission Stationdiscardsanyframeaddressedtoanotherstation Important:interfacehardware,notsoftware,checksaddressCS422--PART4222003 PossibleDestinations Packetcanbesentto:±Singledestination(unicast)±Allstationsonnetwork(broadcast)±Subsetofstations(multicast) AddressusedtodistinguishCS422--PART4232003 AdvantagesOfAddressAlternatives Unicast±Ef®cientforinteractionbetweentwocomputers Broadcast±Ef®cientfortransmittingtoallcomputers Multicast±Ef®cientfortransmittingtoasubsetofcomputersCS422--PART4242003 BroadcastOnEthernet All1saddressspeci®esbroadcast Sender±Placesbroadcastaddressinframe±Transmitsonecopyonsharednetwork±Allstationsreceivecopy Receiveralwaysacceptsframethatcontains±Station'sunicastaddress±ThebroadcastaddressCS422--PART4252003 MulticastOnEthernet Halfofaddressesreservedformulticast Networkinterfacecard±Alwaysacceptsunicastandbroadcast±Canacceptzeroormoremulticastaddresses Software±Determinesmulticastaddresstoaccept±InformsnetworkinterfacecardCS422--PART4262003 PromiscuousMode Designedfortesting/debugging Allowsinterfacetoacceptallpackets AvailableonmostinterfacehardwareCS422--PART4272003 IdentifyingFrameContents Integertypefieldtellsrecipientthetypeofdatabeingcarried Twopossibilities±Self-identifyingorexplicittype(hardwarerecordstype)±Implicittype(applicationsendingdatamusthandletype)CS422--PART4282003 ConceptualFrameFormatFrameFrameDataAreaHeaderorPayload Header±Containsaddressandtypeinformation±Layout®xed Payload±ContainsdatabeingsentCS422--PART4292003 IllustrationOfEthernetFrameDest.SourceFramePreambleAddressAddressTypeDataInFrameCRC866246-15004HeaderPayload Senderplaces±Sender'saddressinsource±Recipient'saddressindestination±Typeofdatainframetype±CyclicredundancycheckinCRCCS422--PART4302003 ExampleEthernetTypesValueMeaning0000-05DCReservedforusewithIEEELLC/SNAP0800InternetIPVersion40805CCITTX.250900Ungermann-BassCorporationnetworkdebugger0BADBanyanSystemsCorporationVINES1000-100FBerkeleyUNIXTrailerencapsulation6004DigitalEquipmentCorporationLAT6559FrameRelay8005HewlettPackardCorporationnetworkprobe8008AT&TCorporation8014SiliconGraphicsCorporationnetworkgames8035InternetReverseARP8038DigitalEquipmentCorporationLANBridge805CStanfordUniversityVKernel809BAppleComputerCorporationAppleTalk80C4-80C5BanyanSystemsCorporation80D5IBMCorporationSNA80FF-8103WellfleetCommunications8137-8138NovellCorporationIPX818DMotorolaCorporationFFFFReservedCS422--PART4312003 WhenNetworkHardwareDoesNotIncludeTypes Sendingandreceivingcomputersmustagree±Toonlysendonetypeofdata±Toputtypeinformationin®rstfewoctetsofpayload MostsystemsneedtypeinformationCS422--PART4322003 IllustrationOfTypeInformationAddedToDataframeheaderframedatatypeinformation Inpractice±Typeinformationsmallcomparedtodatacarried±FormatoftypeinformationstandardizedCS422--PART4332003 AStandardForTypeInformationLLCSNAPAAAA0300000008003-octetOUIidentifies2-octetTYPEvalueastandardsdefinedbythatorganizationorganization De®nedbyIEEE Usedwhenhardwaredoesnotincludetype®eld CalledLLC/SNAPheaderCS422--PART4342003 DemultiplexingOnType Networkinterfacehardware±Receivescopyofeachtransmittedframe±Examinesaddressandeitherdiscardsoraccepts±Passesacceptedframetosystemsoftware Networkdevicesoftware±Examinesframetype±PassesframetocorrectsoftwaremoduleCS422--PART4352003 NetworkAnalyzer Deviceusedfortestingandmaintenance Listensinpromiscuousmode Produces±Summaries(e.g.,%ofbroadcastframes)±Speci®citems(e.g.,framesfromagivenaddress)CS422--PART4362003 EthernetWiring Threeschemes±Correspondtothreegenerations±AllusesameframeformatCS422--PART4372003 OriginalEthernetWiringthickEthernetcabletransceiverterminatorAUIcable Usedheavycoaxialcable Formalname10Base5 CalledthicknetCS422--PART4382003 SecondGenerationEthernetWiringthinEthernetcableBNCconnectorterminator Usedthinnercoaxialcable Formalname10Base2 CalledthinnetCS422--PART4392003 ModernEthernetWiringhubtwistedpairwiringRJ-45connector Usesahub Formalname10Base-T CalledtwistedpairEthernetCS422--PART4402003 EthernetWiringInAnOf®cewiringclosetoffice1office2office3office4office5office6office7office8(a)office1office2office3office4office5office6office7office8(b)huboffice1office2office3office4office5office6office7office8(c)CS422--PART4412003 ANoteAboutEthernetTopology Apparently±OriginalEthernetusedbustopology±ModernEthernetusesstartopology Infact,modernEthernetis±Physicalstar±Logicalbus±Calledstar-shapedbusCS422--PART4422003 HigherSpeedEthernets FastEthernet±Operatesat100Mbps±Formally100Base-T±Twowiringstandards±10/100Ethernetdevicesavailable GigabitEthernet±Operatesat1000Mbps(1Gbps)±SlightlymoreexpensiveCS422--PART4432003 AnotherLANUsingBusTopology LocalTalk±DevelopedbyAppleCorp.±Simpletouse±SlowbycurrentstandardsCS422--PART4442003 IllustrationOfLocalTalkshortcabletransceiver Transceiverrequiredperstation TransceiverterminatescableCS422--PART4452003 RingTopologyconnectionfromonecomputertoanother OnceapopulartopologyforLANs Bits¯owinsingledirectionCS422--PART4462003 TokenPassing Designedforringtopology Guaranteesfairaccess Token±Special(reserved)message±Small(afewbits)CS422--PART4472003 TokenPassingParadigm Station±Waitsfortokentoarrive±Transmitsonepacketaroundring±Transmitstokenaroundring Whennostationhasdatatosend±TokencirculatescontinuouslyCS422--PART4482003 TokenPassingRingTransmissioncomputernotholdingsenderholdingtokentokenpassesbitstransmitsbitsofframedestinationpassessenderreceivesandmakesacopybitsofframe Stationwaitsfortokenbeforesending Signaltravelsaroundentirering SenderreceivesitsowntransmissionCS422--PART4492003 StrengthsOfTokenRingApproach Easydetectionof±Brokenring±Hardwarefailures±InterferenceCS422--PART4502003 WeaknessesOfTokenRingApproach Brokenwiredisablesentirering Point-to-pointwiring±Awkwardinof®ceenvironment±Dif®culttoadd/movestationsCS422--PART4512003 FailureRecoveryInRingNetworks Automaticfailurerecovery IntroducedbyFDDI Usestworings Terminology±Dual-attached±Counterrotating±SelfhealingCS422--PART4522003 IllustrationOfFailureRecoveryouterringusedfordatainnerringunusedexceptduringfailure(a) NormaloperationusesoneoftworingsCS422--PART4532003 IllustrationOfFailureRecoverystationsadjacenttoouterringusedfordatafailedstationfailureloopbackinnerringunusedexceptduringfailure(a)(b) Normaloperationusesoneoftworings SecondringusedforloopbackduringfailureCS422--PART4532003 TokenPassingRingTechnologies ProNet-10±Operatedat10Mbps IBMTokenRing±Originallyoperatedat4Mbps±Laterversionoperatedat16Mbps FiberDistributedDataInterconnect(FDDI)±Operatesat100Mbps AllarenowvirtuallyobsoleteCS422--PART4542003 ExampleOfAPhysicalStarTopology AsynchronousTransferMode(ATM) Designedbytelephonecompanies Intendedtoaccommodate±Voice±Video±DataCS422--PART4552003 ATMcomputersattachedtoswitchATMswitch(electronic) BuildingblockknownasATMswitch Eachstationconnectstoswitch SwitchescanbeinterconnectedCS422--PART4562003 DetailsOfATMConnectioncomputerfibercarryingfibercarryingdatatoswitchdatatocomputerATMswitch Full-duplexconnections Two®bersusedCS422--PART4572003 ATMCharacteristics Highdatarates(e.g.155Mbps) Fixedsizepackets±Calledcells±Importantforvoice Cellsizeis53octets±48octetsofdata±5octetsofheaderCS422--PART4582003 Summary LocalAreaNetworks±Designedforshortdistance±Usesharedmedia±Manytechnologiesexist Topologyreferstogeneralshape±Bus±Ring±StarCS422--PART4592003 Summary(continued) Address±Uniquenumberassignedtostation±Putinframeheader±Recognizedbyhardware Addressforms±Unicast±Broadcast±MulticastCS422--PART4602003 Summary(continued) Typeinformation±Describesdatainframe±Setbysender±Examinedbyreceiver Frameformat±Headercontainsaddressandtypeinformation±PayloadcontainsdatabeingsentCS422--PART4612003 Summary(continued) CurrentlypopularLANtechnology±Ethernet(bus) OlderLANtechnologies±IBMTokenRing±FDDI(ring)±ATM(star)CS422--PART4622003 Summary(continued) Wiringandtopology±Candistinguish*Logicaltopology*Physicaltopology(wiring)±Huballows*Star-shapedbus*Star-shapedringCS422--PART4632003 PARTVExtendingNetworks(Repeaters,Bridges,Switches)CS422--PART512003 Motivation Recall±EachLANtechnologyhasadistancelimitation±Example:CSMA/CDcannotworkacrossarbitrarydistance However±Usersdesirearbitrarydistanceconnections±Example:twocomputersacrossacorporatecampusarepartofoneworkgroupCS422--PART522003 ExtensionTechniques Mustnotviolatedesignassumptions Oftenpartoforiginaldesign Exampletechnique±UseconnectionwithlowerdelaythancopperCS422--PART532003 IllustrationOfExtensionForOneComputerAUIconnectionEthernetfromcomputeropticalfibersAUIconnectiontotransceiverfibermodemfibermodem Optical®ber±Haslowdelay±Hashighbandwidth±Canpasssignalswithinspeci®edboundsCS422--PART542003 Repeatermaximum-sizeEthernetsegmentmaximum-sizeEthernetsegmentdirectconnectionR Hardwaredevice ConnectstwoLANsegments Copiessignalfromonesegmenttotheother ConnectioncanbeextendedwithFiberOpticIntra-RepeaterLinkCS422--PART552003 Repeater(continued) Ampli®essignalsfromonesegmentandsendstotheother Operatesintwodirectionssimultaneously PropagatesnoiseandcollisionsCS422--PART562003 RepeatersAndTheOriginalEthernetWiringSchemesegmentonfloor3R1verticalsegmentsegmentonfloor2R2segmentonfloor1R3 Designedforof®ce OnlytworepeatersbetweenanypairofstationsCS422--PART572003 Hub Physically±Smallelectronicdevice±Hasconnectionsforseveralcomputers(e.g.,4or20) Logically±Operatesonsignals±Propagateseachincomingsignaltoallconnections±Similartoconnectingsegmentswithrepeaters±Doesnotunderstandpackets ExtremelylowcostCS422--PART582003 ConnectionMultiplexing Concept±Multiplestationsshareonenetworkconnection Motivation±Cost±Convenienceofwiring HardwaredevicerequiredCS422--PART592003 IllustrationOfConnectionMultiplexingthickEthernetcabletransceiverAUIcablesmultiplexor Multiplexingdeviceattachedtonetwork Stationsattachtodevice PredateshubsCS422--PART5102003 ModernEquivalentOfConnectionMultiplexing Hubsusednow Connectionsonahub±Oneforeachattachedcomputer±Oneforanotherhub Multiplehubs±Canbeinterconnectedinadaisychain±Operateasonegianthub±CalledstackingCS422--PART5112003 Bridge Hardwaredevice ConnectstwoLANsegments Forwardsframes Doesnotforwardnoiseorcollisions Learnsaddressesand®lters AllowsindependenttransmissionCS422--PART5122003 BridgeAlgorithm Listeninpromiscuousmode Watchsourceaddressinincomingframes Makelistofcomputersoneachsegment Onlyforwardifnecessary Alwaysforwardbroadcast/multicastCS422--PART5132003 IllustrationOfABridgestandardconnection(sameasothercomputers)segment1segment2BUVWXYZEventSegment1ListSegment2ListBridgeboots––UsendstoVU–VsendstoUU,V–ZbroadcastsU,VZYsendstoVU,VZ,YYsendstoXU,VZ,YXsendstoWU,VZ,Y,XWsendstoZU,V,WZ,Y,X Bridgeusessourceaddresstolearnlocationofcomputers LearningiscompletelyautomatedCS422--PART5142003 ExtendingABridgebuilding1building2bridgeopticalfibersfiberbetweenbuildingsfibermodemmodem Typicallyoptical®ber CanspanbuildingsCS422--PART5152003 SatelliteBridgingsatellitesegmentsegmentatsite1bridgebridgeatsite2 CanspanarbitrarydistanceCS422--PART5162003 ApparentProblemsegmentasegmentbB1B2B3segmentcsegmentdB4B5B6B7segmentesegmentfsegmentgsegmenth Complexbridgeconnectionsmaynotbeapparent Addingonemorebridgeinadvertentlyintroducesacycle ConsiderabroadcastframeCS422--PART5172003 SpanningTreeAlgorithm Allowscycles Usedbyallbridgesto±Discoveroneanother±Breakcycle(s) KnownasDistributedSpanningTree(DST)CS422--PART5182003 Switch Electronicdevice Physicallysimilartoahub Logicallysimilartoabridge±Operatesonpackets±Understandsaddresses±Onlyforwardswhennecessary Permitsseparatepairsofcomputerstocommunicateatthesametime HighercostthanhubCS422--PART5192003 ConceptualSwitchFunctionportsforcomputersswitch Conceptualoperation±OneLANsegmentperhost±Bridgeinterconnectseachpairofsegments NOTanactualimplementationCS422--PART5202003 Summary LANs±Havedistancelimitations±Canbeextended FibercanbeusedbetweencomputerandLAN Repeater±ConnectstwoLANsegments±Repeatsandampli®esallsignals±ForwardsnoiseandcollisionsCS422--PART5212003 Summary(continued) Bridge±ConnectstwoLANsegments±Understandsframes±Usesaddresses±Doesnotforwardnoiseorcollisions±AllowssimultaneoustransmissiononsegmentsCS422--PART5222003 Summary(continued) Hub±Centralfacilityinstar-shapednetwork±Operateslikearepeater Switch±Centralfacilityinstar-shapednetwork±OperateslikeasetofbridgedsegmentsCS422--PART5232003 PARTVILong-DistanceandLocalLoopDigitalConnectionTechnologiesCS422--PART612003 Motivation Connectcomputersacross±Largegeographicdistance±Publicright-of-way*Streets*Buildings*RailroadsCS422--PART622003 Long-DistanceTransmissionTechnologies Generalsolution:leasetransmissionfacilitiesfromtelephonecompany±Point-to-pointtopology±NOTpartofconventionaltelephonesystem±Copper,®ber,microwave,orsatellitechannelsavailable±CustomerchoosesanalogordigitalCS422--PART632003 EquipmentForLeasedConnections Analogcircuit±Modemrequiredateachend Digitalcircuit±DSU/CSUrequiredateachendCS422--PART642003 DigitalCircuitTechnology Developedbytelephonecompanies Designedforuseinvoicesystem±Analogaudiofromuser'stelephoneconvertedtodigitalformat±Digitalformatsentacrossnetwork±DigitalformatconvertedbacktoanalogaudioCS422--PART652003 IllustrationOfDigitizedSignal7.................................................................................................................6.................................................................................................................5.................................................................................................................4.................................................................................................................3.................................................................................................................2.................................................................................................................1.................................................................................................................0time Picknearestdigitalvalueforeachsample TelephonestandardknownasPulseCodeModulation(PCM)CS422--PART662003 DSU/CSU Performstwofunctions;usuallyasingle``box'' Neededbecausetelephoneindustrydigitalencodingdiffersfromcomputerindustrydigitalencoding DSUportion±Translatesbetweentwoencodings CSUportion±Terminatesline±AllowsformaintenanceCS422--PART672003 IllustrationOfDSU/CSUDSU/CSUDSU/CSUPhoneCompanycomputerconnectiondigitalcircuitcomputerusingcomputerusingtelephonestandardsstandards Costofdigitalcircuitdependson±Distance±CapacityCS422--PART682003 TelephoneStandardsForDigitalCircuits Speci®edbythetelephoneindustryineachcountry Differaroundtheworld Areknownbytwo-characterstandardname Note:engineersrefertocircuitcapacityas``speed''CS422--PART692003 ExampleCircuitCapacitiesNameBitRateVoicecallsLocation–0.064Mbps1T11.544Mbps24NorthAmericaT26.312Mbps96NorthAmericaT344.736Mbps672NorthAmericaE12.048Mbps30EuropeE28.448Mbps120EuropeE334.368Mbps480Europe Note:T2notpopularCS422--PART6102003 CommonDigitalCircuitTerminology MostcommoninNorthAmerica±T1circuit±T3circuit(28timesT1) Alsoavailable±FractionalT1(e.g.,64Kbpscircuit)CS422--PART6112003 InverseMultiplexing Combinestwoormorecircuits Producesintermediatecapacitycircuit Specialhardwarerequired±Neededateachend±CalledinversemultiplexorCS422--PART6122003 ExampleOfInverseMultiplexinginversemuxinversemuxPhoneCompanyconnectiontopairofT1computercomputercircuits Canalternatebetweencircuitsfor±Everyotherbit±EveryotherbyteCS422--PART6132003 High-CapacityDigitalCircuits Alsoavailablefromphonecompany Useoptical®ber ElectricalstandardscalledSynchronousTransportSignal(STS) OpticalstandardscalledOpticalCarrier(OC)CS422--PART6142003 High-CapacityCircuitsStandardOpticalBitVoiceNameNameRateCallsSTS-1OC-151.840Mbps810STS-3OC-3155.520Mbps2430STS-12OC-12622.080Mbps9720STS-24OC-241,244.160Mbps19440STS-48OC-482,488.320Mbps38880 STS-isstandardforelectricalsignals OC-isstandardforopticalsignals EngineersusuallyuseOC-terminologyforeverything OC-3popularCS422--PART6152003 LocalLoop Telephoneterminology Referstoconnectionbetweenresidence/businessandcentralof®ce Crossespublicright-of-way OriginallyforanalogPOTS(PlainOldTelephoneService)CS422--PART6162003 DigitalLocalLoopTechnologies IntegratedServicesDigitalNetwork(ISDN)±Handlesvoiceanddata±Relativelyhighcostforlowbandwidth DigitalSubscriberLine(DSL) Cablemodems HybridFiberCoaxCS422--PART6172003 AsymmetricDigitalSubscriberLine(ADSL) PopularDSLvariant RunsoverconventionalPOTSwiring Highercapacitydownstream UsesfrequenciesabovePOTSCS422--PART6182003 IllustrationOfADSLWiringstandardtwistedpairconnectingresidenceADSLCO’sADSLmodemmodemdigitalconnectiondigitalconnectiontolocalnetworktoanalogtotelephonetoproviderphoneswitchResidenceTelephoneCentralOffice Downstreamcanreach6.4Mbps Upstreamcanreach640KbpsCS422--PART6192003 CableModems Send/receiveoverCATVwiring UseFDM GroupofsubscribersinneighborhoodsharebandwidthCS422--PART6202003 HybridFiberCoax Wiringschemeforcabletoallowdigitalaccess Optical®ber±Highestbandwidth±Extendsfromcentralof®cetoneighborhoodconcentrationpoints Coaxialcable±Lessbandwidth±Extendsfromneighborhoodconcentrationpointtoindividualsubscribers(e.g.,residence)CS422--PART6212003 Summary Technologiesexistthatspanlongdistances±Leasedanaloglines(requiremodems)±Leaseddigitalcircuits(requireDSU/CSUs) Digitalcircuits±Availablefromphonecompany±Costdependsondistanceandcapacity±PopularcapacitiescalledT1andT3±FractionalT1alsoavailableCS422--PART6222003 Summary(continued) Highcapacitycircuitsavailable±PopularcapacitiesknownasOC-3,OC-12 Localloopreferstoconnectionbetweencentralof®ceandsubscriber Locallooptechnologiesinclude±DSL(especiallyADSL)±CablemodemsCS422--PART6232003 PARTVIIWideAreaNetworks(WANs),Routing,andShortestPathsCS422--PART712003 Motivation Connectmultiplecomputers Spanlargegeographicdistance Crosspublicright-of-way±Streets±Buildings±RailroadsCS422--PART722003 BuildingBlocks Point-to-pointlong-distanceconnections PacketswitchesCS422--PART732003 PacketSwitch Hardwaredevice Connectsto±Otherpacketswitches±Computers Forwardspackets UsesaddressesCS422--PART742003 IllustrationOfAPacketSwitchusedtoconnectpacketusedtoconnecttootherpacketswitchtocomputersswitches Special-purposecomputersystem±CPU±Memory±I/Ointerfaces±FirmwareCS422--PART752003 BuildingAWAN Placeoneormorepacketswitchesateachsite Interconnectswitches±LANtechnologyforlocalconnections±Leaseddigitalcircuitsforlong-distanceconnectionsCS422--PART762003 IllustrationOfAWANswitchswitchatatsite1site2high-speedconnectionsbetweenswitchescomputersconnectedtonetworkswitchswitchatatsite3site4 Interconnectionsdependon±Estimatedtraf®c±ReliabilityneededCS422--PART772003 StoreAndForward Basicparadigmusedinpacketswitchednetwork Packet±Sentfromsourcecomputer±Travelsswitch-to-switch±Deliveredtodestination Switch±Storespacketinmemory±Examinespacket'sdestinationaddress±ForwardspackettowarddestinationCS422--PART782003 AddressingInAWAN Need±Uniqueaddressforeachcomputer±Ef®cientforwarding Two-partaddress±Packetswitchnumber±ComputeronthatswitchCS422--PART792003 IllustrationOfWANAddressingaddress[2,1]address[1,2]switchswitch12address[1,5]address[2,6] Two-partaddressencodedasinteger±High-orderbitsforswitchnumber±Low-orderbitsforcomputernumberCS422--PART7102003 Next-HopForwardinginterface1interface4[1,2]AC[3,2]destinationnexthopswitchswitch13[1,2]interface1[1,5]BD[3,5][1,5]interface1[3,2]interface4switch2[3,5]interface4[2,1]computerE[2,1]EF[2,6][2,6]computerF(a)(b) Performedbypacketswitch Usestableofroutes TablegivesnexthopCS422--PART7112003 ForwardingTableAbbreviationsDestinationNextHop(1,anything)interface1(3,anything)interface4(2,anything)localcomputer Manyentriespointtosamenexthop Canbecondensed(default) Improveslookupef®ciencyCS422--PART7122003 SourceOfRoutingTableInformation Manual±Tablecreatedbyhand±Usefulinsmallnetworks±Usefulifroutesneverchange Automaticrouting±Softwarecreates/updatestable±Neededinlargenetworks±ChangesrouteswhenfailuresoccurCS422--PART7132003 RelationshipOfRoutingToGraphTheory12123434destin-nextdestin-nextdestin-nextdestin-nextationhopationhopationhopationhop1-1(2,3)1(3,1)1(4,3)2(1,3)2-2(3,2)2(4,2)3(1,3)3(2,3)3-3(4,3)4(1,3)4(2,4)4(3,4)4-node1node2node3node4 Graph±Nodemodelsswitch±EdgemodelsconnectionCS422--PART7142003 ShortestPathComputation Algorithmsfromgraphtheory Nocentralauthority(distributedcomputation) Aswitch±Mustlearnroutetoeachdestination±OnlycommunicateswithdirectlyattachedneighborsCS422--PART7152003 IllustrationOfMinimumWeightPath3111234968235567 Labelonedgerepresents``distance'' Possibledistancemetric±Geographicdistance±Economiccost±Inverseofcapacity Darkenedpathisminimum4to5CS422--PART7162003 AlgorithmsForComputingShortestPaths DistanceVector(DV)±Switchesexchangeinformationintheirroutingtables Link-state±Switchesexchangelinkstatusinformation BothusedinpracticeCS422--PART7172003 DistanceVector Periodic,two-wayexchangebetweenneighbors Duringexchange,switchsends±Listofpairs±Eachpairgives(destination,distance) Receiver±Compareseachiteminlisttolocalroutes±ChangesroutesifbetterpathexistsCS422--PART7182003 DistanceVectorAlgorithmGiven:alocalroutingtable,aweightforeachlinkthatconnectstoanotherswitch,andanincomingroutingmessageCompute:anupdatedroutingtableMethod:Maintainadistancefieldineachroutingtableentry;Initializeroutingtablewithasingleentrythathasthedestinationequaltothelocalpacketswitch,thenext-hopunused,andthedistancesettozero;Repeatforever{waitforthenextroutingmessagetoarriveoverthenetworkfromaneighbor;LetNbethesendingswitch;foreachentryinthemessage{LetVbethedestinationintheentryandletDbethedistance;ComputeCasDplustheweightassignedtothelinkoverwhichthemessagearrived;Examineandupdatethelocalroutingtable:if(norouteexiststoV){addanentrytothelocalroutingtablefordestinationVwithnext-hopNanddistanceC;}elseif(arouteexiststhathasnext-hopN){replacethedistanceinexistingroutewithC;}elseif(arouteexistswithdistancegreaterthanC){changethenext-hoptoNanddistancetoC;}}CS422--PART7192003 DistanceVectorIntuition Let±Nbeneighborthatsenttheroutingmessage±Vbedestinationinapair±Dbedistanceinapair±CbeDplusthecosttoreachthesender IfnolocalroutetoVorlocalroutehascostgreaterthanC,installaroutewithnexthopNandcostC ElseignorepairCS422--PART7202003 ExampleOfDistanceVectorRouting3111234968235567 ConsidertransmissionofoneDVmessage Node2sendstonodes3,5,and6 Node6installscost8routetonode2 Later,node3sendsupdate Node6changesroutetomakenode3thenexthopfordestination2CS422--PART7212003 Link-StateRouting OvercomesinstabilitiesinDV Pairofswitchesperiodically±Testlinkbetweenthem±Broadcastlinkstatusmessage Switch±Receivesstatusmessages±Computesnewroutes±UsesDijkstra'salgorithmCS422--PART7222003 ExampleOfLink-StateInformation3111234968235567 Assumenodes2and3±Testlinkbetweenthem±Broadcastinformation Eachnode±Receivesinformation±RecomputesroutesasneededCS422--PART7232003 Dijkstra'sShortestPathAlgorithm Input±Graphwithweightededges±Noden Output±Setofshortestpathsfromntoeachnode±Costofeachpath CalledShortestPathFirst(SPF)algorithmCS422--PART7242003 Dijkstra'sAlgorithmGiven:agraphwithanonnegativeweightassignedtoeachedgeandadesignatedsourcenodeCompute:theshortestdistancefromthesourcenodetoeachothernodeandanext-hoproutingtableMethod:InitializesetStocontainallnodesexceptthesourcenode;InitializearrayDsothatD[v]istheweightoftheedgefromthesourcetovifsuchanedgeexists,andinfinityotherwise;InitializeentriesofRsothatR[v]isassignedvifanedgeexistsfromthesourcetov,andzerootherwise;while(setSisnotempty){chooseanodeufromSsuchthatD[u]isminimum;if(D[u]isinfinity){nopathexiststonodesinS;quit;}deleteufromsetS;foreachnodevsuchthat(u,v)isanedge{if(visstillinS){c=D[u]+weight(u,v);if(c