第3章:OSI层次:数据链路层-2015简化版_第1页
第3章:OSI层次:数据链路层-2015简化版_第2页
第3章:OSI层次:数据链路层-2015简化版_第3页
第3章:OSI层次:数据链路层-2015简化版_第4页
第3章:OSI层次:数据链路层-2015简化版_第5页
已阅读5页,还剩60页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

OSILayer2:

DataLinkLayerLayer2:DataLinkLayerOverviewoftheDataLinkLayerEthernetandCSMA/CDLLCandMACSub-layersMediaAccessControlinMACSub-layerWirelessLANandCSMA/CALayer2DevicesDataLinkLayerProblem:Howtotransferdatacorrectlyonainstablelink?TheDATALINKLAYERprovides:Access

tothenetworkingmediaPhysical

transmissionacrossthemediaLayer2protocols(procedures)define:TheformatofdataexchangedonalinkTheactionofthetwonodesonthelinkInDataLinkLayer,‘procedure’=‘protocol’NodeNodeframeframeNode:HostandrouterinthenetworkLink:ThechannelconnectstheadjacentnodesLANSandtheDataLinkLayerMaintasks:Error

notificationNetwork

topologyFlow

controlDifferencesbetweenLayer1andLayer2:Layer1cannotcommunicatewiththeupper-levellayers;Layer2doesthatwithLogicalLinkControl(LLC).Layer1cannotdecidewhichhost

willtransmitorreceivebinarydatafromagroup;Layer2doesthatwithMediaAccessControl(MAC)Layer1cannotnameoridentifycomputers;Layer2usesanaddressing(ornaming)process.Layer1canonlydescribestreamsofbits;Layer2usesframingtoorganizeorgroupthebits.Threeservicesprovidedtothenetworklayer(byLLC)Connectionlessservicewithnoacknowledgement,usedon:Reliablelinks(upperlayerstoensurethedatacorrectness)Real-timetasksMostofLANsConnectionlessservicewithacknowledgements:unreliablelink,suchasthewirelessnetworkConnection

servicewithacknowledgementsServicesprovidedbyLayer2MediaAccessControlinCommonLANsEthernet

-logicalbustopology(informationflowisonalinearbus)andphysicalstarorextendedstar(wiredasastar)TokenRing-logicalringtopology(informationflowisinaring)andaphysicalstartopology(wiredasastar)FDDI-logicalringtopology(informationflowisinaring)andphysicaldual-ringtopology(wiredasadual-ring)AccessMethodsforMedia-AccessControlTwobroadcategories:Deterministic—takingturnsTokenRingandFDDINon-deterministic(probabilistic)—firstcome,firstservedEthernet/802.3DeterministicMACProtocolsAspecialdatatokencirculatesthering.Whenahostreceivesthetoken,itcantransmitdatainsteadofthetoken.Thisiscalledseizingthetoken.Whenthetransmittedframecomesbackaroundtothetransmitter,thestationtransmitsanewtoken;theframeisremovedorstrippedfromthering.Non-DeterministicMACProtocolsThisMACprotocoliscalledCarrierSenseMultipleAccesswithCollisionDetection(CSMA/CD)Tousethisshared-mediumtechnology,Ethernetallowsthenetworkingdevicestoarbitratefortherighttotransmit.LANTransmissionMethodsLANdatatransmissionsfallinto3classifications:unicast--asinglepacketissentfromthesourcetoasingledestinationonanetworkmulticast--consistsofasingledatapacketthatissenttoaspecificsubsetofnodesonthenetwork.broadcast--consistsofasingledatapacketthatistransmittedtoallnodesonthenetwork.Layer2:DataLinkLayerOverviewoftheDataLinkLayerEthernetandCSMA/CDLLCandMACSub-layersMediaAccessControlinMACSub-layerWirelessLANandCSMA/CALayer2DevicesLANStandardsDefinethephysicalmediaandtheconnectorsusedtoconnectdevicestomediaDefinethewaydevicescommunicateattheDATALINKLAYERTheDATALINKLAYERdefineshowdataistransportedoveraphysicalmedia.TheDATALINKLAYERalsodefineshowtoencapsulateprotocol-specifictrafficinsuchawaythattrafficgoingtodifferentupper-layerprotocolscanusethesamechannelasitgoesupthestack.LANStandardsDatalinklayerisbrokenintotwopartsbyIEEE:MediaAccessControl

(MAC)(transitionsdowntomedia)

LogicalLinkControl

(LLC)(transitionsuptothenetworklayer)

TheIEEEstandardappears,atfirstglance,toviolatetheOSImodelintwoways.

First,itdefinesitsownlayer(LLC),includingitsinterfaces,etc.

Second,itappearsthattheMAClayerstandards,802.3and802.5,crossovertheLayer2/Layer1interface.However,802.3and802.5definethenaming,framing,andMediaAccessControlrulesaroundwhichspecifictechnologieswerebuilt.LANStandardsMACsublayer(802.3)DefineshowtotransmitframesonthephysicalwireHandlesphysicaladdressing

Define

networktopologyDefine

linediscipline.LLC

sublayer(802.2)logicallyidentifiesdifferentprotocoltypesandthenencapsulatesthem.UseSAPidentifiertoperformthelogicalidentificationThetypeofLLCframedependsonwhatidentifiertheupperlayerprotocolexpects.LANStandardsMediaAccessControlSublayerPreambleDest.add.Sourceadd.LengthDataFCS#ofbytes8662Variable4EthernetIIuses“Type”hereanddoesnotuse802.20000.0CXX.XXXXIEEEassignedVendorassignedMACaddressMACLayer802.3MACSub-layer:FieldsinaFrameBeginwithanalternatingpatternof1sand0scalledapreamble.(10101011)Thepreambletellsreceivingstationsthataframeiscoming.PreambleDest.add.Sourceadd.LengthDataFCS#ofbytes8662Variable4EthernetIIuses“Type”hereanddoesnotuse802.20000.0CXX.XXXXIEEEassignedVendorassignedMACSub-layer:FieldsinaFrameDestinationandsourcephysicaladdressfieldssourceaddress:alwaysaunicastaddressdestinationaddress:unicast,multicast,orbroadcast.PreambleDest.add.Sourceadd.LengthDataFCS#ofbytes8662Variable4EthernetIIuses“Type”hereanddoesnotuse802.20000.0CXX.XXXXIEEEassignedVendorassignedMACSub-layer:FieldsinaFramelength

field

indicatesthenumberofbytesofdatathatfollowthisfieldandprecedetheframechecksequencefield.Thedatafieldcontainstheinformationyouwanttosend.PreambleDest.add.Sourceadd.LengthDataFCS#ofbytes8662Variable4EthernetIIuses“Type”hereanddoesnotuse802.20000.0CXX.XXXXIEEEassignedVendorassignedMACSub-layer:FieldsinaFrameFCSfield(fourbytes)containsacyclicredundancycheckvalueThesendingdevicecreatestheCRCThereceivingdevicerecalculatestheCRCtocheckfordamagethatmighthaveoccurredtotheframeintransit.PreambleDest.add.Sourceadd.LengthDataFCS#ofbytes8662Variable4EthernetIIuses“Type”hereanddoesnotuse802.20000.0CXX.XXXXIEEEassignedVendorassignedLogicalLinkControlSublayerTheLogicalLinkControl(LLC)sublayermanagescommunicationbetweendevicesoverasinglelinkLLCisdefinedintheIEEE802.2specificationandsupportsbothconnectionlessandconnect-orientedservices.LLCsublayerallowspartoftheDATALINKLAYERtofunctionindependentlyfromexistingtechnologies.AsingleLLCsub-layercanbecompatiblewithdifferentMACsub-layers.LLCSub-layer:Encapsulation(a)PositionofLLC (b)EncapsulationLLCMACDataLinkLayerPhysicalLayerNetworkLayerLLCPacketMACLLCPacketMACMediaPacketLLCSub-layer:EncapsulationTheLLCtakesthenetworkprotocoldata(packet),andaddsmorecontrolinformationtohelpdeliverthepackettoitsdestination.Itaddstwoaddressingcomponentsofthe802.2specificationtoidentifytheupperlayerprotocolateachend:TheDestinationServiceAccessPoint(DSAP)TheSourceServiceAccessPoint(SSAP)ThisrepackageddatathentravelstotheMACforfurtherencapsulationofthedata.Layer2:DataLinkLayerOverviewoftheDataLinkLayerEthernetandCSMA/CDLLCandMACSub-layersMediaAccessControlinMACSub-layerWirelessLANandCSMA/CALayer2DevicesHexadecimalNumbersasMACAddressesMACaddressesare48bitsandarealwaysexpressedas12hexadecimaldigits.Thefirst6hexadecimaldigits(fromlefttoright),whichtheIEEEadministers,identifythemanufacturerorvendorandcomprisetheOrganizationalUniqueIdentifier(OUI).Theremaining6hexdigitscomprisetheinterfaceserialnumber,administeredbyspecificvendor.0000.0c12.3456or00-00-0c-12-34-56Ethernet802.3BroadcastBroadcastThedestinationMAC:all1s(FFFF.FFFF.FFFF)BroadcastingcanseriouslyaffecttheperformanceofstationsbyinterruptingthemunnecessarilySobroadcastsshouldbeusedonlywhen:TheMACaddressofthedestinationisunknownThedestinationisallhostsFramingFramingistheLayer2encapsulationprocess.AframeisaLayer2protocoldataunit(PDU).Aframehassectionscalledfields,andeachfieldiscomposedofbytes.datafieldframechecksequencefieldframestopfieldframestartfield addressfieldlength/type/controlfieldEthernetMediaAccessControl——CSMA/CD:HistoryEthernet/IEEE802.3MACmechanism:CSMA/CD.CSMA/CDstemsfromALOHAIn1970s,NormanAbramsondesignedALOHAPureALOHA:Hostsalwayscansendthedataiftheywant:Ifthesignalscollided,backoffappropriateamountoftimeandresendSlottedALOHA:Hostsalwayscansendthedataiftheywant,buttheymustwaitforanewslot:Ifthesignalscollided,backoffappropriateamountoftimeandresendEthernetMediaAccessControl——CSMA/CD:HistoryQuestion:Whydon’twelistentothechannelfirsttomakesurethatthechannelisfree?ThatisCSMA(CarrierSenseMultipleAccess)1-persistCSMA:Hostsalwayscansendthedata(havetheprobabilityof1)iftheyfindthechannelisfree;ifthechannelisbusy,theywilllistentothechannelandwait:Ifthesignals

collided,backoffappropriateamountoftimeandresendEthernetMediaAccessControl——CSMA/CD:Historynon-persistCSMA:Hostsalwayscansendthedata(havetheprobabilityof1)iftheyfindthechannelisfree.ifthechannelisbusy,theywillwaitforawhiletolistento

thechannelagain:Ifthesignalscollided,backoffappropriateamountoftimeandresendp-persistCSMA(workingonslottedchannel):Ifthehostsfindthechannelisfree,theywillsendthedatainthisslotataprobabilityofp,orproponethesendingoperationtothenextslotataprobabilityof1-p;ifthechannelisbusy,theywillwaituntilthenextslot:Ifthesignalscollided,backoffappropriateamountoftimeandresendEthernetMediaAccessControl——CSMA/CDAnotherimprovementofALOHA:Listentothechannelwhiletransmittingdata.Ifacollisiondetected,alltransmissionswillbecancelledatonceCSMA/CD(CarrierSenseMultipleAccess)UseCSMAmechanismtojudgeifthehostshouldsendthedataInthetransmittingprocess,listentothechannelatthesametimeWhenacollisiondetected,broadcastthejamsignalBackoffalgorithmsdeterminewhenthecollidingstationscanretransmit.EthernetOperation1234Ethernetisbroadcast

network—thatis,eachstationcanseealltheframes,regardlessofwhethertheyarethedestinationWhetherastationisthedestinationisjudgedbyMACaddressDestinationstationsendsdataupOSIlayers.OthernodesdiscardframeEthernetOperationListenthentransmitBroadcastjamsignalCollisionoccursDevicesbackoffappropriateamountoftimeandthenretransmit1234Layer2:DataLinkLayerOverviewoftheDataLinkLayerEthernetandCSMA/CDLLCandMACSub-layersMediaAccessControlinMACSub-layerWirelessLANandCSMA/CALayer2DevicesWirelessLANWirelessLANCommunicationsbasedoncellsThesignalssentbyastationcanonlybereceivedbythestationsnearbyShort-distancetransmissionWirelessLANStandardIEEE802.11IEEE802.11bIEEE802.11aIEEE802.11gIEEE802.11nWirelessLANStandardIEEE802.11Akeytechnology:DirectSequenceSpreadSpectrum(DSSS)DSSSappliestowirelessdevicesoperatingwithina1to2Mbpsrange.DSSSmayoperateatupto11Mbpsbutwillnotbeconsideredcompliantabove2MbpsIEEE802.11bAlsocalledWi-Fi™Itincreasedtransmissioncapabilitiesto11MbpsAll802.11bsystemsarebackwardcompliantinthattheyalsosupport802.11for1and2MbpsdataratesforDSSSonlyAchieveshigherdatathroughputratebyusingadifferentcodingtechniquefrom802.11Operatewithin2.4GHzWirelessLANStandardIEEE802.11aCoversWLANdevicesoperatinginthe5GHztransmissionband.Usingthe5GHz802.11aiscapableofsupplyingdatathroughputof54Mbpsandwithproprietarytechnologyknownas"ratedoubling"hasachieved108Mbps.Inpractice,amorestandardratingis20-26Mbps.WirelessLANStandardIEEE802.11gprovidesthesamethroughoutas802.11a(54Mbps)butwithbackwardscompatibilityfor802.11busingOthogonalFrequencyDivisionMultiplexing(OFDM)technology.IEEE802.11n:nextgenerationWLANprovidedoublebandwidththan802.11g,thatis,108Mbps,andtheoreticallyupto500-600MbpsWirelessLANTopologyInfrastructuremode

andad-hocmodeFig.InfrastructureModeWirelessLAN:InfrastructureModeABasicServiceSet(BSS)includesaBaseStation(BS)andseveralwirelesshostsAllhostscancommunicatewitheachotherdirectlyinlocalBSSAccessPoint(AP)actsasaBaseStation(BS)forinfrastructuremodeAPishardwiredtothecabledLANtoprovideInternetaccessandconnectivitytothewirednetworkWhenanAPisinstalled,aServiceSetIdentifier(SSID)andachannelareassignedTherangeofthecellwillbefrom91.44to152.4meters(300to500feet)ABSScanconnecttoanotherBSSviaaDistributionSystem(DS),andconstructsanExtendedServiceSet(ESS)AccessingProcedureWhenaclientisactivatedwithintheWLANitwillstart"listening"foracompatibledevicewithwhichto"associate“Thisisreferredtoas"scanning"ActivescanningPassivescanningActivescanningCauseaproberequesttobesentfromthewirelessnodeseekingtojointhenetwork.TheproberequestwillcontaintheServiceSetIdentifier(SSID)ofthenetworkitwishestojoinWhenanAPwiththesameSSIDisfound,theAPwillissueaproberesponseTheauthenticationandassociationstepsarecompleted.PassivescanningListenforbeaconmanagementframes(beacons),whicharetransmittedbytheAP(infrastructuremode)orpeernodes(adhoc)WhenanodereceivesabeaconthatcontainstheSSIDofthenetworkitistryingtojoin,anattemptismadetojointhenetwork.PassivescanningisacontinuousprocessandnodesmayassociateordisassociatewithAPsassignalstrengthchanges.FramesinWLANWLANsdonotuseastandard802.3frame.TherearethreetypesofframesControlFramesManagementframesDataframes(Onlydataframesaresimilarto802.3frames)Thepayloadofwirelessdataframesand802.3framesis1500bytesHowever,anEtherframemaynotexceed1518byteswhereasawirelessframecouldbeaslargeas2346bytes.UsuallytheWLANframesizewillbelimitedto1518bytesasitismostcommonlyconnectedtoawiredEthernetnetwork.WhyWeNeedCSMA/CA?CollisionscanoccurinWLAN,butthestationscanonlyknowthetransmissionnearby,soCSMA/CDisnotagoodchoice.HiddenStationProblemWhenAistransmittingdatatoB,Ccan’tdetectthetransmissionbetweenAandB,soperhapsCwilldecidetotransmitdatatoBandresultinacollisionatB.ExposedStationProblemWhenBistransmittingdatatoA,Ccandetectthetransmission,soCwillnottransmitdatatoD.Butthatisamistake.ABCDBACDMultipleAccessingMechanismEthernetSignalsistransmittedtoallstationsonthecable.

Thesendingstationdetectsthecollisions.Atatime,onlyaneffectiveframecanbetransmittedonthechannel.WLANSignalsistransmittedtostationsneartothesendingstationonthecableTheMAC

protocolmusttryitbesttoensureonlyasendingstationneartothereceivingstationThereceivingstationdetectsthecollisions.Atatime,multipleeffectiveframescanbetransmittedonthechannel.CSMA/CACSMA/CA(CarrierSenseMultipleAccesswithCollisionAvoidance)发送站点在发送数据前,以控制短帧刺激接收站点发送应答短帧,使接收站点周围的站点监听到该帧,从而在一定时间内避免数据发送基本过程A向B发送RTS(RequestToSend)帧,A周围的站点在一定时间内不发送数据,以保证CTS帧返回给A;B向A回答CTS(ClearToSend)帧,B周围的站点在一定时间内不发送数据,以保证A发送完数据;A开始发送若控制帧RTS或CTS发生冲突,采用二进制指数后退算法等待随机时间,再重新开始。TheActualThroughputWhenasourcenodesendsaframe,thereceivingnodereturnsapositiveacknowledgment(ACK).Thiscancauseconsumptionof50%oftheavailablebandwidth.Thisreducestheactualdatathroughputtoamaximumof5.0to5.5Mbpsonan802.11bwirelessLANratedat11Mbps.PerformanceofthenetworkwillalsobeaffectedbysignalstrengthAsthesignalbecomesweaker,AdaptiveRateSelection(ARS)maybeinvokedThetransmittingunitwilldropthedataratefrom11Mbpsto5.5Mbps,from5.5Mbpsto2Mbpsor2Mbpsto1Mbps.Layer2:DataLinkLayerOverviewoftheDataLinkLayerEthernetandCSMA/CDLLCandMACSub-layersMediaAccessControlinMACSub-layerWirelessLANandCSMA/CALayer2DevicesLayer2Devices—NICsNICsperformimportantLayer2datalinklayerfunctions:LogicalLinkControl-communicateswithupperlayersinthecomputerMediaAccessControl-providesstructuredaccesstosharedaccessmedianaming-providesauniqueMACaddressidentifierframing-partoftheencapsulationprocess,packagingthebitsfortransportsignaling-createssignalsandinterfacewiththemediabyusingbuilt-intransceiversLayer2Devices—BridgesBridgesdividetrafficintosegmentsandfilterstrafficbasedontheMACaddress,notbasedonprotocols.Bridgescanimprovenetworkperformancebyreducinglargecollisiondomains.Bridgesworkbestwheretrafficislowfromonesegmentofanetworktoothersegments.Whentrafficbetweennetworksegmentsbecomesheavy,bridgescanbecomeabottleneckandslowdowncommunication.

Layer2Devices—BridgesTransparentBridge“透明”是指局域网上的站点并不知道所发送的帧将经过哪几个网桥,因为网桥对各站来说是看不见的透明网桥是一种即插即用设备,其标准是IEEE802.1D目前以太网中使用得最多的网桥SourceroutingBridge源路由(sourceroute)网桥在发送帧时将详细的路由信息放在帧的首部中,从而使每个经过的网桥都了解帧的路径在令牌环网络中被广泛使用Layer2Devices—Bridges站表接口管理软件网桥协议实体缓存接口1接口2①②③网段B网段A1112①③⑤2②④⑥2站地址接口网桥网桥④⑤⑥接口1接口212以太网网桥的工作原理(透明网桥)TransparentBridge若从A发出的帧从接口x进入了某网桥,那么从这个接口出发沿相反方向一定可把一个帧传送到A。网桥每收到一个帧,就记下其源地址和进入网桥的接口,作为转发表中的一个项目。在收到一个新的帧时,将转发表中已收集到的地址记录取出,与此帧的目的地址匹配,找到对应的接口,并向该接口转发。在网桥的转发表中写入的信息除了地址和接口外,还有帧进入该网桥的时间,其原因是:拓扑可能经常变化站点也可能会更换适配器(这就改变了站点的地址)工作站并非总是处于工作状态把每个帧到达网桥的时间登记下来,就可以在转发表中只保留网络拓扑的最新状态信息,使得网桥中的转发表能反映当前网络的最新拓扑Transparent

BridgeProblem:Whenadeviceonanetworkwantstosenddata,butdoesnotknowthedestinationaddress.Sendoutabroadcasttoalldevicesonanetwork.Sinceeverydeviceonthenetworkhastopayattentiontosuchbroadcasts,bridgesalwaysforwardthem.Toomanybroadcastscanresultinabroadcaststorm,anditcancause:networktime-outstrafficslowdownslessthanacceptableperformance.SourceRouteBridge

透明网桥容易安装,但网络资源的利用不充分源路由(sourceroute)网桥在发送帧时将详细的路由信息放在帧的首部中源站以广播方式向欲通信的目的站发送一个发现帧,每个发现帧都记录所经过的路由发现帧到达目的站时就沿各自的路由返回源站源站在得知这些路由后,从所有可能的路由中选择出一个最佳路由凡从该源站向该目的站发送的帧的首部,都必须携带源站所确定的这一路由信息Layer2Devices—SwitchesPerformtwobasicoperations:switchingdataframes:aframeisreceivedonaninputmediumandthentransmittedtoanoutputmediummaintenanceofswitchingoperations:Switchesbuildandmaintainswitchingtablesandsearchforloops.Routersbuildandmaintainbothroutingtablesandservicetables.Layer2Devices—SwitchesSwitchingisatechnologythatalleviatescongestioninEthernetLANsbyreducingtrafficandincreasingbandwidth.Switchescreatededicatednetworksegments,orpoint-to-pointconnections,andconnectingthesesegmentsinavirtualnetworkwithintheswitch.Thisiscalledavirtualcircuitbecauseitexistsonlywhentwonodesneedtocommunicate

andisestablishedwithintheswitchYouca

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论