Chapter3 Datalink Layer



Comments



Description

Chapter 3The Data Link Layer Functions of the Data Link Layer • • • Provide service interface to the network layer Dealing with transmission errors Regulating data flow • Slow receivers not swamped by fast senders Functions of the Data Link Layer (2) Relationship between packets and frames. Data Link Layer Design Issues • • • • Services Provided to the Network Layer Framing Error Control Flow Control Services Provided to the Network Layer a) Principal Service Function of the data link layer is to transfer the data from the network layer on the source machine to the network layer on the destination machine. . . (b) Actual communication.Services Provided to Network Layer (a) Virtual communication. Possible Services Offered Data link layer provides three types of services: • Unacknowledged connectionless service. • Acknowledged connectionless service. • Acknowledged connection-oriented service. . in all the communication channel were real time operation is more important that quality of transmission. etc.Unacknowledged Connectionless Service a) b) No logical connection is established and if a frame is lost due to noise on the line. no attempt is made to detect the loss or recover from it in the data link layer. Voice over IP. Example: Ethernet. . This service is useful over unreliable channels such as wireless systems. imposed by the hardware and network layer does not.Acknowledged Connection less Service • • • No logical connection used but each frame sent is individually acknowledged. . Frames usually have a strict maximum length. Acknowledged Connection Oriented Service a) b) Source and Destination establish a connection first. . etc. c) Examples: – Satellite channel communication. – It guarantees that each frame is received only once and that all frames are received in the correct order. – Long-distance telephone communication. Each frame sent is numbered – Data link layer guarantees that each frame sent is indeed received. Acknowledged Connection Oriented Service Three distinct phases: 1. 2. and other resources used to maintain the connection. One or more frames are transmitted. the connection is released – freeing up the variables. 3. . Finally. Connection is established by having both side initialize variables and counters needed to keep track of which frames have been received and which ones have not. buffers. .Services Provided to Network Layer (2) Placement of the data link protocol. the envelope serves as the delimiter. In addition each envelope defines the sender and receiver addresses since the postal system is a many-to-many carrier facility. so that each frame is distinguishable from another.Two approaches 1.Bit –oriented protocols . Ex: Our postal system practices a type of framing. Fixed-Size Framing Variable-Size Framing : Define the end of the frame and the beginning of the next.Character oriented protocols 2. The simple act of inserting a letter into an envelope separates one piece of information from another.  FRAMING The data link layer needs to pack bits into frames. with bit stuffing.Four Methods: a) Character count b) Flag bytes with byte stuffing c) Starting and ending flags. d) Physical layer coding violations . redundant bits. an 8-bit (1-byte) flag is added at the beginning and the end of a frame.signlas the start/end of a frame .A frame in a character-oriented protocol Source and destination information Error detection and correction. • The Flag. composed of protocol-dependent special characters. •To separate one frame from the next. Byte stuffing and unstuffing . .Byte stuffing is the process of adding 1 extra byte whenever there is a flag or escape character in the text. A frame in a bit-oriented protocol . .Bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a 0 in the data. so that the receiver does not mistake the pattern 0111110 for a flag. Bit stuffing and unstuffing . (a) Without errors. (b) With one error.Framing A character stream. . (b) Four examples of byte sequences before and after stuffing.Framing (2) (a) A frame delimited by flag bytes. . Framing (3) Bit stuffing (a) The original data. (b) The data as they appear on the line. (c) The data as they are stored in receiver’s memory after destuffing. . 2. 7. then the sender sends the frame again. 6. To overcome this we use TIMER. . Receiver has to send positive or negative acknowledgements. If the sender receives a positive acknowledgements about a frame. and the frame must be transmitted again.Error Control: 1. 4. Negative acknowledgements means that something has gone wrong. How to make sure all frames are eventually delivered to the network layer at the destination and in the upper layer. so we assign sequence numbers to outgoing frames. If timer expires. If sender sends same frames multiple times then also problem. If a frame vanishes completely. 8. then the receiver will not react at all. 5. it knows the frame has arrived safely. since it has no reason to react & sender transmits a frame and then waits for an ACK. 3. The sender keeps pumping the frames out at a high rate until the receiver is completely swamped.Flow Control : 1. . 3. This situation can usually occur when the sender is running on a fast (or light loaded) computer and the receiver is running on a slow (or heavily loaded) machine. 2. 4.4. at certain point the receiver will simply be unable to handle the frames as they arrive and will start to lose some. Another design occurs in the data link layer (and higher layers as well) is what to do with a sender that systematically wants to transmit frames faster than the receiver can accept them. Even if the transmission is error free. b) Rate-based flow control: The protocol has built-in mechanism that limits the rate at which senders may transmit data. without using feedback from the receiver. .Two approaches are commonly used to avoid this situation: a) Feedback –based flow control: The receiver sends back information to the sender giving it permission to send more data or at least telling the sender how the receiver is doing. Error Detection and Correction • Error-Correcting Codes • Error-Detecting Codes . Error-Correcting Codes Use of a Hamming code to correct burst errors. Cyclic Redundancy Check CRC Cyclic Redundancy Check a) b) Given a k-bit frame or message, the transmitter generates an n-bit sequence, known as a frame check sequence (FCS), so that the resulting frame, consisting of (k+n) bits, is exactly divisible by some predetermined number. The receiver then divides the incoming frame by the same number and, if there is no remainder, assumes that there was no error. Polynomial Polynomial and Divisor . Standard Polynomials . Error-Detecting Codes Calculation of the polynomial code checksum. . When a frame arrives at the receiver . 4.the hardware computes the checksum.If the inbound frame arrived undamaged. 5. the data link layer is so informed (event= cksum_err). some control information (in the header) and a checksum(in the trailer). it encapsulates(captures) the packet in a frame by adding a data link header and trailer to it. the data link layer is also informed(event= frame_arrival) so that it can acquire the frame for inspection using from_physical_layer. but not the problems caused by computers crashing and rebooting. . 6. If the checksum is incorrect.Elementary Data Link Protocols : 1.There exist suitable library procedures to-physical-layer to send a frame and from-physical-layer to receive a frame.When the data link layer accepts a packet. 3.Frame consists of an embedded packet.These protocols deals with communication errors. 2. The receiving data link layer has acquired an undamaged frame.ack & info control info data these control fields collectively called Frame Header 8. it checks the control information in the header. To-n/w-layer and from-n/w-layer deal with the interface between layers 2&3.from-physical-layer and to-physical-layer deal with the interface between layers 1&2 10. Where as .seq.7. and if everything is all right .turn the timer on&off.Start –timer. 9. 7. Frame consists of 4 fields: Kind.passes the packet portion to the network layer. .Stop-timer. Protocol Definitions Some definitions needed in the protocols to follow. These are located in the file protocol.h. . These are located in the file protocol.) Some definitions needed in the protocols to follow.Protocol Definitions (ctd. .h. 3. 5. An Unrestricted Simplex Protocol : Data are transmitted in one direction only .Elementary Data Link Protocols • 1. 4.both the transmitting and receiving layers are always ready. No sequence numbers or acknowledgement's are used here. . The sender runs in the data link layer of the source machine. Infinite buffer space is available and communication channel never loses or damages. 2. Processing time can be ignored. The receiver runs in the data link layer of the destination machine. . • 1. Bi –directional channel is needed. A simple stop-and-wait Protocol: Sender inserts delay into Protocol1. 4. 3. . Receiver provides feedback / ack /dummy frames to sender Protocols in which the sender sends one frame and then waits for an acknowledgement before processing are called Stop-andWait. 2. . Protocols in which the sender waits for positive acknowledgement before advancing to the next data item are often called PAR(Positive acknowledgement with retransmission) or ARQ(Automatic Repeat Request). 5. 3. A simplex protocol for a noisy channel: Adding a timer to protocol2. 2. 6. 4.the receiver expects a particular sequence number next. A 1-bit sequence number(0 or 1) is therefore sufficient.• 1. At each instant of time . . The sender puts a sequence number in the header of each frame. If acknowledgement gets lost then duplicate frame arrives at network layer. A Simplex Protocol for a Noisy Channel . ) A positive acknowledgement with retransmission protocol. .A Simplex Protocol for a Noisy Channel (ctd. a) Sliding Window Protocols: At any instant of time. Similarly. the receiver also maintain a receiving window corresponding to the set of frames it is permitted to accept. the sender maintains a set of sequence numbers corresponding to frames it is permitted to send. These frames are said to fall within the sending window. . Sliding Windows a) b) Each outbound frame contain a sequence number ranging from 0 to 2n-1 Sending window – – c) Maintained by the sender A set of sequence numbers corresponding to frames the sender is permitted to send Receiving window – – Maintained by the receiver Corresponds the set of frames the receiver is permitted to accept . Maintain Sliding Windows a) Sending window – When a frame is sent. the window is rotated by one . the upper edge of the window is advanced by one – When an acknowledgement is received. the lower edge of the window is advanced by one b) Receiving window – Any received frame the sequence number outside the window is discarded – When a frame whose sequence number is equal to lower edge of the window is received. Sliding Window Protocols (2) A sliding window of size 1. (a) Initially. (b) After the first frame has been sent. (c) After the first frame has been received. with a 3-bit sequence number. (d) After the first acknowledgement has been received. . Sliding Window Protocols a) b) c) One bit sliding window protocol ( Stop-and-Wait) Go-back-N Protocol Selective Repeat Protocol . One Bit Sliding Window Protocol a) Stop –and-Wait – A protocol in which the sender sends one frame and then waits for an acknowledgement before proceeding. 1} is sufficient c) Frame header fields – Seq : the sequence number of this frame – Ack : the number of the last frame is received . b) a sliding window protocol with maximum window size = 1 – Sequence number {0. ack. (b) Abnormal case.A One-Bit Sliding Window Protocol (2) Two scenarios for protocol 4. packet number). . (a) Normal case. The notation is (seq. An asterisk indicates where a network layer accepts a packet. Efficiency of Stop-and-Wait Stop-and-Wait 50 kbps data rate 500 msec round-trip delay 1000 bits per frame time (msec) t=0 start sending t=20 completely sent t=250 frame arrival t=270 completely received t=270 acknowledge without delay t=520 acknowledgement arrival 26000 bits could be transmitted in 520 msec. Efficiency: 1000/26000=20/520 < 4% used . Efficiency of Stop-and-Wait . Pipelining time (msec) t=0 start sending the first frame t=20 the first completely sent t=250 frame arrival t=270 the first completely received t=270 acknowledge without delay t=520 acknowledgement arrival 50 kbps data rate 500 msec round-trip delay 1000 bits per frame To pipeline frames without waiting for acknowledgements. . pipelining . piggybacking Temporarily delaying outgoing acknowledgements so that they can be hooked onto the next outgoing data frame is Piggybacking  . Line of Utilization for Stop-and-Wait a) Capacity : b bits/sec. round-trip delay : R seconds – Transmission time : l/b – Total duration : R + l/b – Utilization : (l/b) / (R + l/b) = l / (l+bR) . frame size : l bits. Go-back-N a) Sender’s window size is n (n >1) – At most n outstanding frames can be sent b) After receiving a damaged frame – Receiver discards all subsequent frames – Sender retransmits the damaged frame and all its successors after the times out . Go-back-N : An Example . Selective Repeat a) Receiver’s window size is n ( n >1 ) – At most n frames can be buffered b) Receiver stores all the correct frames following the bad one c) The sender retransmits only the bad frame not all its successors . Selective Repeat : An Example . . c) Both Go-back-N and Selective-repeat ARQs uses the pipelining technique. – Stop-and-wait ARQ – Go-back-N continuous ARQ – Selective-repeat continuous ARQ b) All of them belong to the sliding window protocols. the receiver requests that the frame be retransmitted.Retransmission with Sliding Window Protocols a) ARQ (Automatic Repeat reQuest): When an error is detected. Sliding Window Protocol Using Go Back N Continued  . Sliding Window Protocol Using Go Back N . Sliding Window Protocol Using Go Back N (2) Simulation of multiple timers in software. . A Sliding Window Protocol Using Selective Repeat Continued  . A Sliding Window Protocol Using Selective Repeat (2) Continued  . A Sliding Window Protocol Using Selective Repeat (3) Continued  . A Sliding Window Protocol Using Selective Repeat (4) . but not acknowledged. but not acknowledged.A Sliding Window Protocol Using Selective Repeat (5) (a) Initial situation with a window size seven. (b) After seven frames sent and received. (c) Initial situation with a window size of four. (d) After four frames sent and received. . Example Data Link Protocols • HDLC – High-Level Data Link Control • The Data Link Layer in the Internet . IBM submitted it to ANSI and ISO for acceptance as U. After developing SDLC.25 network interface standard but latter modified it again to LAPB . CCITT then adopted and modified HDLC for its LAP(Link Access Protocol) as part of the X.S and international standards respectively. 3. They all are derived from the data link protocol first used in the IBM mainframe word:SDLC (synchronous data link control ) protocol. 4.to make it more compatible with a later version of HDLC. . ANSI modified it to become ADCCP(Advanced Data Communication Control Procedure) and ISO modified it to HDLC.HDLC : 1. 2. Example Data Link Protocols a) HDLC – bit oriented – bit stuffing b) SLIP c) PPP – character oriented – character stuffing – multiprotocol framing . On idle point-to-point lines.HDLC Frame Format a) A frame is delimited with the flag sequence 01111110. b) Address – to identify one of multiple terminals for pointto-multipoint lines – to distinguish commands from responses for point-to-point lines . flag sequences are transmitted continuously. PtP: examples a) HDLC: High Level Data Link Control – Frame structure: • Address – for multi-point line – distinguish responses from redirected frames • Control field Information frame Supervisory frames Unnumbered frames 76 . 77 .PtP: examples a) HDLC – Kind of frames: • Information frame • Supervisory frames: • – Reject = nack – Receive ready = ack – Receive not ready = ack + stop sending – Selective reject = resend 1 frame Unnumbered frames – Initialisation – Polling – Status reporting – …. PtP: examples a) Data Link layer in the Internet – Context: • • Dial-up Leased lines between routers . g. negotiate options.PtP: examples a) PPP – Point-to-Point Protocol – PPP provides • • Framing + error detection Link control protocol (LCP) for bringing up lines. get IP address PC = Internet host! . bringing down lines • Network control Protocol (NCP) to negotiate options independent of the network protocol used – Scenario • • • • • PC calls router of provider via modem Router’s modem answers phone  physical connection Series of LCP packets to select PPP parameters Series of NCP packets to e. test lines. The Data Link Layer in the Internet A home personal computer acting as an internet host. . PPP – Point to Point Protocol The PPP full frame format for unnumbered mode operation. . .PPP – Point to Point Protocol (2) A simplified phase diagram for bring a line up and down. PPP – Point to Point Protocol (3) The LCP frame types. . Documents Similar To Chapter3 Datalink LayerSkip carouselcarousel previouscarousel nextReliable Transmission.Introduction to the BSC6900 V900R014 Feature – Transmission Resource Pool in RNC-BSCMod. 1 WAN aCisco_Config_MakerPPP - Point to Point ProtocolPPPPractice Skills AssessmentScrambling and Encrypting- Based Authenticating for Open Networkn Communications1.FLOW CONTROLNivel Retealab_3_3_3AIX - From New User to Technical Expert3.4.1.4 Packet Tracer - Troubleshooting PPP With Authentication Instructions-2300qs4-2Lista de Comandos IOS.docDCNA User ManualDigital Subscriber Line (xDSL)What Is VPNRoutBsc SystemHG 1500 V7.0 Data SheetCcie Rs NoteAdvanced Computer Networks Practical FileData Comm & Comp Networks Mcqs_solvedQuidway AR18-1x Series RoutersShow Screens With Macros13 2 Network SecurityipCdma Cdma BscMore From Yaswanth JupudiSkip carouselcarousel previouscarousel nextBasics of Banking1xikifvwuo_sbi Clerks Result June July 2014AO_Advertisement_Correted_27.10.pdfHow to Solve a Rubik.docxJaiib-Low.pdfReasoning1392118883233 Sbi Specialist Cadre Officers Adkvrnotes-3.pdfHotspot ManualAssignments - PGDGPS - 2013-14 Online Test Result Bmsb 2014 15AO_Advertisement_Correted_27.10.pdfcircuit theory introductionClericalStaff-VoucherConsultants List 695 (1)Syndicate Bank Manipal Po QuestionsGk Power Capsule Sbi Associate Po 2014Building a ComputerCircuit Theory IntroductionHow to Solve a Rubik.docxHomeguards Application for CID (Telugu) (1)Dear MadamTechnical_issues Pending CasesFooter MenuBack To TopAboutAbout ScribdPressOur blogJoin our team!Contact UsJoin todayInvite FriendsGiftsLegalTermsPrivacyCopyrightSupportHelp / FAQAccessibilityPurchase helpAdChoicesPublishersSocial MediaCopyright © 2018 Scribd Inc. .Browse Books.Site Directory.Site Language: English中文EspañolالعربيةPortuguês日本語DeutschFrançaisTurkceРусский языкTiếng việtJęzyk polskiBahasa indonesiaSign up to vote on this titleUsefulNot usefulMaster Your Semester with Scribd & The New York TimesSpecial offer for students: Only $4.99/month.Master Your Semester with a Special Offer from Scribd & The New York TimesRead Free for 30 DaysCancel anytime.Read Free for 30 DaysYou're Reading a Free PreviewDownloadClose DialogAre you sure?This action might not be possible to undo. Are you sure you want to continue?CANCELOK
Copyright © 2024 DOKUMEN.SITE Inc.