《(5.2.2)--Ch4 介质访问子层计算机网络最基本概念.pdf》由会员分享,可在线阅读,更多相关《(5.2.2)--Ch4 介质访问子层计算机网络最基本概念.pdf(92页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、The Medium Access Control Sublayer123DATA LINK LAYER SWITCHING MAC Address物理地址.:D4-DE-D9-99-2A-E5MULTIPLE ACCESS PROTOCOLS THE CHANNEL ALLOCATION PROBLEMStatic Channel Allocation MultiplexingDynamic Channel Allocation Multiplex Access ProtocolsALOHAMULTIPLE ACCESS PROTOCOLS ALOHA Pure ALOHA Slotted
2、ALOHA Carrier Sense Multiple Access Protocols 1-Persistent CSMA nonPersistent CSMA P-Persistent CSMAALOHAPure ALOHA pure Aloha:simpler,no synchronization,a node can transmit data whenever it wantsALOHACollision of ALOHAALOHASlotted ALOHA time is divided into equal size slots(=pkt trans.time)node wit
3、h new arriving pkt:transmit at beginning of next slot if collision:retransmit pkt in future slots with probability p,until successful.ALOHAPerformance of ALOHACarrier Sense Multiple Access Protocols 1-persistent CSMAnonpersistent CSMAp-persistent CSMACarrier Sense Multiple Access Protocols1-persiste
4、nt Carrier Sense Multiple AccessWhen a station has data to send,it first listens to the channel to see if anyone else is transmitting at that moment.If the channel is busy,the station waits until it becomes idle.When the station detects an idle channel,it transmits a frame.If a collision occurs,the
5、station waits a random amount of time and starts all over again.The protocol is called 1-persistent because the station transmits with a probability of 1 when it finds the channel idle.Carrier Sense Multiple Access Protocolsnonpersistent Carrier Sense Multiple AccessIn this protocol,a conscious atte
6、mpt is made to be less greedy than in the previous one.Before sending,a station senses the channel.If no one else is sending,the station begins doing so itself.However,if the channel is already in use,the station does not continually sense it for the purpose of seizing it immediately upon detecting
7、the end of the previous transmission.Instead,it waits a random period of time and then repeats the algorithm.p-persistent Carrier Sense Multiple AccessIt applies to slotted channels and works as follows.When a station becomes ready to send,it senses the channel.If it is idle,it transmits with a prob
8、ability p.With a probability q=1-p,it defers until the next slot.If that slot is also idle,it either transmits or defers again,with probabilities p and q.This process is repeated until either the frame has been transmitted or another station has begun transmitting.In the latter case,the unlucky stat
9、ion acts as if there had been a collision(i.e.,it waits a random time and starts again).If the station initially senses the channel busy,it waits until the next slot and applies the above algorithm.Carrier Sense Multiple Access ProtocolsPerformance of CSMACarrier Sense Multiple Access ProtocolsOutli
10、ne The basic idea of an ALOHA system is simple:let users transmit whenever they have data to be sent.There will be collisions,of course,and the colliding frames will be damaged.In the carrier sense multiple-access(CSMA)method,a station must listen to the medium prior to sending data onto the lineAnd
11、rew S.Tanenbaum,David J.Wetherall著.严伟,潘爱民译.计算机网络(第5版).清华大学出版社Behrouz A.Forouzan.Data Communications and Networking.机械工业出版社http:/http:/ Medium Access Control Sublayer123DATA LINK LAYER SWITCHING ETHERNETEthernet CablingThe most common kinds of classic Ethernet cabling.Ethernet CablingThree Kinds of E
12、thernet Cabling(a)10Base5.(b)10Base2.(c)10Base-T.The Ethernet MAC Sublayer Frame formats MAC sublayer protocolThe Ethernet MAC Sublayer ProtocolEthernet Frame-1 Sending adapter encapsulates IP datagram(or other network layer protocol packet)in Ethernet frame Preamble:7 bytes with pattern 10101010 fo
13、llowed by one byte with pattern 10101011used to synchronize receiver,sender clock ratesThe Ethernet MAC Sublayer ProtocolEthernet Frame-2 Addresses:6 bytes,frame is received by all adapters on a LAN and dropped if address does not match Type:indicates the higher layer protocol,mostly IP but others m
14、ay be supported such as Novell IPX and AppleTalk)CRC:checked at receiver,if error is detected,the frame is simply droppedThe Ethernet MAC Sublayer ProtocolEthernet Frame-3 Data:valid frames must be at least 64 bytes long,up to 1500 bytesThe Ethernet MAC Sublayer ProtocolA Minimum Length Frame To mak
15、e it easier to distinguish valid frames from garbage to prevent a station from completing the transmission of a short frame before the first bit has even reached the far end of the cableThe Ethernet MAC Sublayer ProtocolEthernet MAC ProtocolA:sense channel,if idle then transmit and monitor the chann
16、el;If detect another transmission then abort and send jam signal;update#collisions;delay as required by exponential backoff algorithm;goto Aelse done with the frame;set collisions to zeroelse wait until ongoing transmission is over and goto Amake sure all other transmitters are aware of collision;48
17、 bits;The Ethernet MAC Sublayer ProtocolThe Binary Exponential Backoff Algorithm After the first collision,each station waits either 0 or 1 slot times before trying again.If two stations collide and each one picks the same random number,they will collide again.After the second collision,each one pic
18、ks either 0,1,2,or 3 at random and waits that number of slot times.If a third collision occurs(the probability of this happening is 0.25),then the next time the number of slots to wait is chosen at random from the interval 0 to 23-1.Ethernet EvolutionEthernet EvolutionSwitched Ethernet-1Ethernet Evo
19、lutionSwitched Ethernet-2Ethernet EvolutionEthernet CablingNameCableMax.segmentAdvantages100Base-T4Twisted pair100 mUses category 3 UTP100Base-TXTwisted pair100 mFull duplex at 100 Mbps(Cat 5 UTP)100Base-fXFiber optic2000 mFull duplex at 100 Mbps;long runsFigure 4-19.The original fast Ethernet cabli
20、ngEthernet EvolutionEthernet CablingEthernet EvolutionEthernet CablingEthernet EvolutionProject 802&OSI Model-1Ethernet EvolutionProject 802&OSI Model-2Ethernet Evolution802 Working GroupEthernet EvolutionExampleOutline Ethernet is the most widely used local area network protocol.The IEEE 802.3 stan
21、dard defines 1-persistent CSMA/CD as the access method for first-generation 10-Mbps Ethernet.The data link layer of Ethernet consists of the LLC sublayer and the MAC sublayer.The MAC sublayer is responsible for the operation of the CSMA/CD access method.Each station on an Ethernet network has a uniq
22、ue 48-bit address imprinted on its network interface card(NIC).Fast Ethernet has a data rate of 100 Mbps.Gigabit Ethernet has a data rate of 1000 Mbps.Andrew S.Tanenbaum,David J.Wetherall著.严伟,潘爱民译.计算机网络(第5版).清华大学出版社Behrouz A.Forouzan.Data Communications and Networking.机械工业出版社http:/http:/ Medium Acce
23、ss Control Sublayer123DATA LINK LAYER SWITCHING DATA LINK LAYER SWITCHING Bridges Repeaters,Hubs,Bridges,Switches,Routers,and Gateways Virtual LANs Bridges Repeaters,Hubs,Bridges,Switches,Routers,and Gateways Virtual LANsReason of Using Bridges Many organizations have multiple LANs and wish to conne
24、ct them.LANs can be connected by devices called bridges,which operate in the data link layer.Bridges examine the data layer link addresses to do routing.Bridges from 802.x to 802.yOperation of a LAN bridge from 802.11 to 802.3.Bridges from 802.x to 802.y802 Working GroupTransparent Bridge Operating
25、Bridges in OSI ModelTransparent Bridge Operating Local InternetworkingA configuration with four LANs and two bridges.Transparent Bridge Operating ABB1B2FGDECLAN1LAN2LAN3LAN4AF1.If destination and source LANs are the same,discard the frame.2.If the destination and source LANs are different,forward th
26、e frame.3.If the destination LAN is unknown,use flooding.A at LAN1Backward LearningTransparent Bridge Operating ABB1B2FGDECLAN1LAN2LAN3LAN41.If destination and source LANs are the same,discard the frame.2.If the destination and source LANs are different,forward the frame.3.If the destination LAN is
27、unknown,use flooding.A at LAN2Backward LearningTransparent Bridge Operating ABB1B2FGDECLAN1LAN2LAN3LAN41.If destination and source LANs are the same,discard the frame.2.If the destination and source LANs are different,forward the frame.3.If the destination LAN is unknown,use flooding.Transparent Bri
28、dge Operating ABB1B2FGDECLAN1LAN2LAN3LAN41.If destination and source LANs are the same,discard the frame.2.If the destination and source LANs are different,forward the frame.3.If the destination LAN is unknown,use flooding.F at LAN4Backward LearningTransparent Bridge Operating ABB1B2FGDECLAN1LAN2LAN
29、3LAN41.If destination and source LANs are the same,discard the frame.2.If the destination and source LANs are different,forward the frame.3.If the destination LAN is unknown,use flooding.Transparent Bridge Operating ABB1B2FGDECLAN1LAN2LAN3LAN41.If destination and source LANs are the same,discard the
30、 frame.2.If the destination and source LANs are different,forward the frame.3.If the destination LAN is unknown,use flooding.F at LAN2Backward LearningTwo Parallel BridgesTwo Parallel BridgesTwo Parallel BridgesTreesTwo Parallel BridgesSpanning Tree Bridges Bridge ExampleOutline A bridge is a connec
31、ting device that operates in the physical and data link layers of the Internet model.A transparent bridge can forward and filter frames and automatically build its forwarding table.A bridge can use the spanning tree algorithm to create a loopless topology.Andrew S.Tanenbaum,David J.Wetherall著.严伟,潘爱民
32、译.计算机网络(第5版).清华大学出版社Behrouz A.Forouzan.Data Communications and Networking.机械工业出版社http:/http:/ Medium Access Control Sublayer123DATA LINK LAYER SWITCHING DATA LINK LAYER SWITCHING Bridges Repeaters,Hubs,Bridges,Switches,Routers,and Gateways Virtual LANs Bridges Repeaters,Hubs,Bridges,Switches,Routers
33、,and Gateways Virtual LANsRepeaterWhich device in which layerRepeaterNetworking Devices&OSIRepeaterRepeater in OSIAt the bottom,in the physical layer,we find the repeaters.These are analog devices that work with signals on the cables to which they are connected.RepeaterFunction of RepeaterA signal a
34、ppearing on one cable is cleaned up,amplified,and put out on another cable.Repeaters do not understand frames,packets,or headers.They understand the symbols that encode bits as volts.HubsA hub has a number of input lines that it joins electrically.Frames arriving on any of the lines are sent out on
35、all the others.If two frames arrive at the same time,they will collide,just as on a coaxial cable.All the lines coming into a hub must operate at the same speed.HubRepeaters VS HubsHubs differ from repeaters in that they do not(usually)amplify the incoming signals and are designed for multiple input
36、 lines,but the differences are slight.Like repeaters,hubs are physical layer devices that do not examine the link layer addresses or use them in any way.BridgeNow let us move up to the data link layer,where we find bridges and switches.We just studied bridges at some length.A bridge connects two or
37、more LANs.Like a hub,a modern bridge has multiple ports,usually enough for 4 to 48 input lines of a certain type.Unlike in a hub,each port is isolated to be its own collision domain.BridgeUnlike in a hub,each port is isolated to be its own collision domain.BridgeWhen a frame arrives,the bridge extra
38、cts the destination address from the frame header and looks it up in a table to see where to send the frame.For Ethernet,this address is the 48-bit destination address.BridgeBridges were originally intended to be able to join different kinds of LANs,for example,an Ethernet and a Token Ring LAN.Moder
39、n bridges usually work for one network type,and routers,which we will come to soon,are used instead to join networks of different types.SwitchSwitches are modern bridges by another name.The differences are more to do with marketing than technical issues.Bridges have relatively few ports.On the other
40、 hand,a switch may refer to an Ethernet switch or a completely different kind of device that makes forwarding decisions,such as a telephone switch.SwitchSwitches are modern bridges by another name.The differences are more to do with marketing than technical issues.When a switch port receives an Ethe
41、rnet frame from a station,the switch checks the Ethernet addresses to see which port the frame is destined for.RouterRouter in OSIRouterNow we move up to routers,which are different from all of the above.When a packet comes into a router,the frame header and trailer are stripped off and the packet l
42、ocated in the frames payload field is passed to the routing software.This software uses the packet header to choose an output line.The routing software does not see the frame addresses and does not even know whether the packet came in on a LAN or a point-to-point line.We will study routers and routi
43、ng in Chap.5.RouterRouter in InternetRouterGateway in OSIGatewayTransport GatewayGatewayUp another layer,we find transport gateways.These connect two computers that use different connection-oriented transport protocols.For example,suppose a computer using the connection-oriented TCP/IP protocol need
44、s to talk to a computer using a different connection-oriented transport protocol called SCTP.The transport gateway can copy the packets from one connection to the other,reformatting them as need be.Application GatewayFinally,application gateways understand the format and contents of the data and can
45、 translate messages from one format to another.An email gateway could translate Internet messages into SMS messages for mobile phones,for example.Gateway Bridges Repeaters,Hubs,Bridges,Switches,Routers,and Gateways Virtual LANsVirtual LANsA building with centralized wiring using hubs and a switch.Vi
46、rtual LANsVLANIn response to customer requests for more flexibility,network vendors began working on a way to rewire buildings entirely in software.The resulting concept is called a VLAN(Virtual LAN).Virtual LANsVLANSThe first one is the VLAN protocol ID.It always has the value 0 x8100.The second 2-
47、byte field contains three subfields.The main one is the VLAN identifier,occupying the low-order 12 bits.Outline In the Physical Layer,there are repeaters and hubs.In the Data Link Layer,there are bridges and switches.Routers work in the Network Layer.We find gateways in the Transport Layer or the Application Layer.