




已阅读5页,还剩109页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
5: DataLink Layer,5a-1,Chapter 5: The Data Link Layer,Our goals: understand principles behind data link layer services:error detection, correctionsharing a broadcast channel: multiple accesslink layer addressingreliable data transfer, flow control: done!instantiation and implementation of various link layer technologies,Overview:link layer serviceserror detection, correctionmultiple access protocols and LANslink layer addressing, ARPspecific link layer technologies:Ethernethibs, bridges, switchesIEEE 802.11 LANsPPPATM,5: DataLink Layer,5a-2,Link Layer: setting the context,5: DataLink Layer,5a-3,Link Layer: setting the context,two physically connected devices:host-router, router-router, host-hostunit of data: frame,networklinkphysical,M,frame,phys. link,data linkprotocol,adapter card,5: DataLink Layer,5a-4,Link Layer Services,Framing, link access: encapsulate datagram into frame, adding header, trailerimplement channel access if shared medium, physical addresses used in frame headers to identify source, dest different from IP address!Reliable delivery between two physically connected devices: we learned how to do this already (chapter 3)!seldom used on low bit error link (fiber, some twisted pair)wireless links: high error ratesQ: why both link-level and end-end reliability?,5: DataLink Layer,5a-5,Link Layer Services (more),Flow Control: pacing between sender and receiversError Detection: errors caused by signal attenuation, noise. receiver detects presence of errors: signals sender for retransmission or drops frame Error Correction: receiver identifies and corrects bit error(s) without resorting to retransmission,5: DataLink Layer,5a-6,Link Layer: Implementation,implemented in “adapter” e.g., PCMCIA card, Ethernet card typically includes: RAM, DSP chips, host bus interface, and link interface,networklinkphysical,M,frame,phys. link,data linkprotocol,adapter card,5: DataLink Layer,5a-7,Error Detection,EDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking, may include header fields Error detection not 100% reliable! protocol may miss some errors, but rarely larger EDC field yields better detection and correction,5: DataLink Layer,5a-8,Parity Checking,Single Bit Parity:Detect single bit errors,Two Dimensional Bit Parity:Detect and correct single bit errors,0,0,5: DataLink Layer,5a-9,Internet checksum,Sender:treat segment contents as sequence of 16-bit integerschecksum: addition (1s complement sum) of segment contentssender puts checksum value into UDP checksum field,Receiver:compute checksum of received segmentcheck if computed checksum equals checksum field value:NO - error detectedYES - no error detected. But maybe errors nonethless? More later .,Goal: detect “errors” (e.g., flipped bits) in transmitted segment (note: used at transport layer only),5: DataLink Layer,5a-10,Checksumming: Cyclic Redundancy Check,view data bits, D, as a binary numberchoose r+1 bit pattern (generator), G goal: choose r CRC bits, R, such that exactly divisible by G (modulo 2) receiver knows G, divides by G. If non-zero remainder: error detected!can detect all burst errors less than r+1 bitswidely used in practice (ATM, HDCL),5: DataLink Layer,5a-11,CRC Example,Want:D.2r XOR R = nGequivalently:D.2r = nG XOR R equivalently: if we divide D.2r by G, want reminder R,R = remainder ,D.2rG,5: DataLink Layer,5a-12,Multiple Access Links and Protocols,Three types of “links”:point-to-point (single wire, e.g. PPP, SLIP)broadcast (shared wire or medium; e.g, Ethernet, Wavelan, etc.)switched (e.g., switched Ethernet, ATM etc),5: DataLink Layer,5a-13,Multiple Access protocols,single shared communication channel two or more simultaneous transmissions by nodes: interference only one node can send successfully at a time multiple access protocol:distributed algorithm that determines how stations share channel, i.e., determine when station can transmitcommunication about channel sharing must use channel itself! what to look for in multiple access protocols: synchronous or asynchronous information needed about other stations robustness (e.g., to channel errors) performance,5: DataLink Layer,5a-14,Multiple Access protocols,claim: humans use multiple access protocols all the time class can guess multiple access protocols multiaccess protocol 1:multiaccess protocol 2:multiaccess protocol 3:multiaccess protocol 4:,5: DataLink Layer,5a-15,MAC Protocols: a taxonomy,Three broad classes:Channel Partitioningdivide channel into smaller “pieces” (time slots, frequency)allocate piece to node for exclusive useRandom Accessallow collisions“recover” from collisions“Taking turns”tightly coordinate shared access to avoid collisions,Goal: efficient, fair, simple, decentralized,5: DataLink Layer,5a-16,Channel Partitioning MAC protocols: TDMA,TDMA: time division multiple access access to channel in rounds each station gets fixed length slot (length = pkt trans time) in each round unused slots go idle example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle TDM (Time Division Multiplexing): channel divided into N time slots, one per user; inefficient with low duty cycle users and at light load.FDM (Frequency Division Multiplexing): frequency subdivided.,5: DataLink Layer,5a-17,Channel Partitioning MAC protocols: FDMA,FDMA: frequency division multiple access channel spectrum divided into frequency bandseach station assigned fixed frequency bandunused transmission time in frequency bands go idle example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle TDM (Time Division Multiplexing): channel divided into N time slots, one per user; inefficient with low duty cycle users and at light load.FDM (Frequency Division Multiplexing): frequency subdivided.,frequency bands,time,5: DataLink Layer,5a-18,Channel Partitioning (CDMA),CDMA (Code Division Multiple Access) unique “code” assigned to each user; ie, code set partitioningused mostly in wireless broadcast channels (cellular, satellite,etc)all users share same frequency, but each user has own “chipping” sequence (ie, code) to encode dataencoded signal = (original data) X (chipping sequence)decoding: inner-product of encoded signal and chipping sequenceallows multiple users to “coexist” and transmit simultaneously with minimal interference (if codes are “orthogonal”),5: DataLink Layer,5a-19,CDMA Encode/Decode,5: DataLink Layer,5a-20,CDMA: two-sender interference,5: DataLink Layer,5a-21,Random Access protocols,When node has packet to sendtransmit at full channel data rate R.no a priori coordination among nodestwo or more trasnmitting nodes - “collision”,random access MAC protocol specifies: how to detect collisionshow to recover from collisions (e.g., via delayed retransmissions)Examples of random access MAC protocols:slotted ALOHAALOHACSMA and CSMA/CD,5: DataLink Layer,5a-22,Slotted Aloha,time is divided into equal size slots (= pkt trans. time)node with new arriving pkt: transmit at beginning of next slot if collision: retransmit pkt in future slots with probability p, until successful.,Success (S), Collision (C), Empty (E) slots,5: DataLink Layer,5a-23,Slotted Aloha efficiency,Q: what is max fraction slots successful?A: Suppose N stations have packets to sendeach transmits in slot with probability pprob. successful transmission S is:by single node: S= p (1-p)(N-1) by any of N nodes S = Prob (only one transmits) = N p (1-p)(N-1) choosing optimum p as n - infty . = 1/e = .37 as N - infty,5: DataLink Layer,5a-24,Pure (unslotted) ALOHA,unslotted Aloha: simpler, no synchronizationpkt needs transmission: send without awaiting for beginning of slotcollision probability increases:pkt sent at t0 collide with other pkts sent in t0-1, t0+1,5: DataLink Layer,5a-25,Pure Aloha (cont.),P(success by given node) = P(node transmits) . P(no other node transmits in p0-1,p0 . P(no other node transmits in p0-1,p0 = p . (1-p) . (1-p) P(success by any of N nodes) = N p . (1-p) . (1-p) choosing optimum p as n - infty . = 1/(2e) = .18,S = throughput = “goodput” (success rate),5: DataLink Layer,5a-26,CSMA: Carrier Sense Multiple Access),CSMA: listen before transmit:If channel sensed idle: transmit entire pktIf channel sensed busy, defer transmission Persistent CSMA: retry immediately with probability p when channel becomes idle (may cause instability)Non-persistent CSMA: retry after random intervalhuman analogy: dont interrupt others!,5: DataLink Layer,5a-27,CSMA collisions,collisions can occur:propagation delay means two nodes may not yearhear each others transmission,collision:entire packet transmission time wasted,spatial layout of nodes along ethernet,note:role of distance and propagation delay in determining collision prob.,5: DataLink Layer,5a-28,CSMA/CD (Collision Detection),CSMA/CD: carrier sensing, deferral as in CSMAcollisions detected within short timecolliding transmissions aborted, reducing channel wastage persistent or non-persistent retransmissioncollision detection: easy in wired LANs: measure signal strengths, compare transmitted, received signalsdifficult in wireless LANs: receiver shut off while transmittinghuman analogy: the polite conversationalist,5: DataLink Layer,5a-29,CSMA/CD collision detection,5: DataLink Layer,5a-30,“Taking Turns” MAC protocols,channel partitioning MAC protocols:share channel efficiently at high loadinefficient at low load: delay in channel access, 1/N bandwidth allocated even if only 1 active node! Random access MAC protocolsefficient at low load: single node can fully utilize channelhigh load: collision overhead“taking turns” protocolslook for best of both worlds!,5: DataLink Layer,5a-31,“Taking Turns” MAC protocols,Polling: master node “invites” slave nodes to transmit in turnRequest to Send, Clear to Send msgsconcerns:polling overhead latencysingle point of failure (master),Token passing:control token passed from one node to next sequentially.token messageconcerns:token overhead latencysingle point of failure (token),5: DataLink Layer,5a-32,Reservation-based protocols,Distributed Polling: time divided into slotsbegins with N short reservation slots reservation slot time equal to channel end-end propagation delay station with message to send posts reservationreservation seen by all stations after reservation slots, message transmissions ordered by known priority,5: DataLink Layer,5a-33,Summary of MAC protocols,What do you do with a shared media?Channel Partitioning, by time, frequency or codeTime Division,Code Division, Frequency DivisionRandom partitioning (dynamic), ALOHA, S-ALOHA, CSMA, CSMA/CDcarrier sensing: easy in some technoligies (wire), hard in others (wireless)CSMA/CD used in EthernetTaking Turnspolling from a central cite, token passing,5: DataLink Layer,5a-34,LAN technologies,Data link layer so far:services, error detection/correction, multiple access Next: LAN technologiesaddressingEthernethubs, bridges, switches802.11PPPATM,5: DataLink Layer,5a-35,LAN Addresses and ARP,32-bit IP address: network-layer addressused to get datagram to destination network (recall IP network definition)LAN (or MAC or physical) address: used to get datagram from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM,5: DataLink Layer,5a-36,LAN Addresses and ARP,Each adapter on LAN has unique LAN address,5: DataLink Layer,5a-37,LAN Address (more),MAC address allocation administered by IEEEmanufacturer buys portion of MAC address space (to assure uniqueness)Analogy: (a) MAC address: like Social Security Number (b) IP address: like postal address MAC flat address = portability can move LAN card from one LAN to anotherIP hierarchical address NOT portable depends on network to which one attaches,5: DataLink Layer,5a-38,Recall earlier routing discussion,Starting at A, given IP datagram addressed to B:look up net. address of B, find B on same net. as Alink layer send datagram to B inside link-layer frame,Bs MACaddr,As MACaddr,As IPaddr,Bs IPaddr,IP payload,datagram,frame,frame source,dest address,datagram source,dest address,5: DataLink Layer,5a-39,ARP: Address Resolution Protocol,Each IP node (Host, Router) on LAN has ARP module, tableARP Table: IP/MAC address mappings for some LAN nodes TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min),5: DataLink Layer,5a-40,ARP protocol,A knows Bs IP address, wants to learn physical address of B A broadcasts ARP query pkt, containing Bs IP address all machines on LAN receive ARP query B receives ARP packet, replies to A with its (Bs) physical layer address A caches (saves) IP-to-physical address pairs until information becomes old (times out) soft state: information that times out (goes away) unless refreshed,5: DataLink Layer,5a-41,Routing to another LAN,walkthrough: routing from A to B via RIn routing table at source Host, find router 111.111.111.110In ARP table at source, find MAC address E6-E9-00-17-BB-4B, etc,A,R,B,5: DataLink Layer,5a-42,A creates IP packet with source A, destination B A uses ARP to get Rs physical layer address for 111.111.111.110A creates Ethernet frame with Rs physical address as dest, Ethernet frame contains A-to-B IP datagramAs data link layer sends Ethernet frame Rs data link layer receives Ethernet frame R removes IP datagram from Ethernet frame, sees its destined to BR uses ARP to get Bs physical layer address R creates frame containing A-to-B IP datagram sends to B,A,R,B,5: DataLink Layer,5a-43,Ethernet,“dominant” LAN technology: cheap $20 for 100Mbs!first wildey used LAN technologySimpler, cheaper than token LANs and ATMKept up with speed race: 10, 100, 1000 Mbps,Metcalfes Etheretsketch,5: DataLink Layer,5a-44,Ethernet Frame Structure,Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet framePreamble: 7 bytes with pattern 10101010 followed by one byte with pattern 10101011 used to synchronize receiver, sender clock rates,5: DataLink Layer,5a-45,Ethernet Frame Structure (more),Addresses: 6 bytes, frame is received by all adapters on a LAN and dropped if address does not matchType: indicates the higher layer protocol, mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC: checked at receiver, if error is detected, the frame is simply dropped,5: DataLink Layer,5a-46,Ethernet: uses CSMA/CD,A: sense channel, if idle then transmit and monitor the channel; If detect another transmission then abort and send jam signal; update # collisions; delay as required by exponential backoff algorithm; goto A else done with the frame; set collisions to zeroelse wait until ongoing transmission is over and goto A,5: DataLink Layer,5a-47,Ethernets CSMA/CD (more),Jam Signal: make sure all other transmitters are aware of collision; 48 bits; Exponential Backoff: Goal: adapt retransmission attemtps to estimated current loadheavy load: random wait will be longerfirst collision: choose K from 0,1; delay is K x 512 bit transmission timesafter second collision: choose K from 0,1,2,3after ten or more collisions, choose K from 0,1,2,3,4,1023,5: DataLink Layer,5a-48,Ethernet Technologies: 10Base2,10: 10Mbps; 2: under 200 meters max cable lengththin coaxial cable in a bus topologyrepeaters used to connect up to multiple segmentsrepeater repeats bits it hears on one interface to its other interfaces: physical layer device only!,5: DataLink Layer,5a-49,10BaseT and 100BaseT,10/100 Mbps rate; latter called “fast ethernet”T stands for Twisted PairHub to which nodes are connected by twisted pair, thus “star topology”CSMA/CD implemented at hub,5: DataLink Layer,5a-50,10BaseT and 100BaseT (more),Max distance from node to Hub is 100 metersHub can disconnect “jabbering adapterHub can gather monitoring information, statistics for display to LAN administrators,5: DataLink Layer,5a-51,Gbit Ethernet,use standard Ethernet frame formatallows for point-to-point links and shared broadcast channelsin shared mode, CSMA/CD is used; short distances between nodes to be efficientuses hubs, called here “Buffered Distributors”Full-Duplex at 1 Gbps for point-to-point links,5: DataLink Layer,5a-52,Token Passing: IEEE802.5 standard,4 Mbps max token holding time: 10 ms, limiting frame length,SD, ED mark start, end of packet AC: access control byte: token bit: value 0 means token can be seized, value 1 means data follows FC priority bits: priority of packet reservation bits: station can write these bits to prevent stations with lower priority packet from seizing token after token becomes free,5: DataLink Layer,5a-53,Token Passing: IEEE802.5 standard,FC: frame control used for monitoring and maintenance source, destination address: 48 bit physical address, as in Ethernet data: packet from network layer checksum: CRC FS: frame status: set by dest., read by sender set to indicate destination up, frame copied OK from ring DLC-level ACKing,5: DataLink Layer,5a-54,Interconnecting LANs,Q: Why not just one big LAN? Limited amount of supportable traffic: on single LAN, all stations must share bandwidth limited length: 802.3 specifies maximum cable length large “collision domain” (can collide with many stations)limited number of stations: 802.5 have token passing delays at each station,5: DataLink Layer,5a-55,Hubs,Physical Layer devices: essential
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 高职汽车专业学生自主学习能力与终身学习意识的培养
- 广东省广州市2025届高三下学期物理练习卷2(含解析)
- 于松建琥珀课件
- 乐享太平课件
- 收款账号的合同(标准版)
- 企业福利合同(标准版)
- DMU759-生命科学试剂-MCE
- 公司司机安全培训教材课件
- 公司卫生安全培训课件
- 公司劳动安全培训资料课件
- 开学第一课+课件-2025-2026学年人教版(2024)七年级英语上册
- 人教版数学三年级上册第五单元《 第02课时 求一个数是另一个数的几倍 》(听评课记录)
- 医院医疗收费培训课件
- 抢救药品的使用规范及观察要点
- 大一农业基础化学课件
- 2025年中国地震局事业单位公开招聘考试历年参考题库含答案详解(5卷)
- 大咯血的急救和护理
- 劳动保障监察条例课件
- 名学快问快答题目及答案
- 2025年党员干部廉政知识中央《八项规定》知识测试题及答案
- 《人工智能基础与应用(第2版)》完整全套教学课件
评论
0/150
提交评论