440 likes | 646 Views
Chapter 11 – Data Link Control and Protocols. CIS 321 Data Communications & Networking. Introduction. Protocol – set of rules governing communication specific to one or more layers of the OSI model Data link protocols define the rules devices use to implement data link layer functions
E N D
Chapter 11 – Data Link Control and Protocols CIS 321Data Communications & Networking
University of South Alabama Computer and Information Sciences Introduction Protocol – set of rules governing communication specific to one or more layers of the OSI model Data link protocols define the rules devices use to implement data link layer functions Contain rules for line discipline, flow control, and error control
University of South Alabama Computer and Information Sciences Data Link Layer Functions
University of South Alabama Computer and Information Sciences Flow Control Coordinates amount of data sent before receiving acknowledgement Purpose: prevent overwhelming receiver Buffer overflow
University of South Alabama Computer and Information Sciences Error Control Error detection and error correction Receiver informs sender of any frames lost or damaged and coordinates retransmission of those frames by the sender Usually handled via automatic repeat request (ARQ)
University of South Alabama Computer and Information Sciences Flow and Error Control Mechanisms Stop-and-Wait ARQ Go-back-N ARQ Selective-Repeat ARQ
University of South Alabama Computer and Information Sciences 11.2 Stop-and-Wait ARQ Sender keeps copy of last frame sent and waits for ACK for that frame Next frame cannot be sent until ACK has been received Frames are numbered alternately 0 and 1 Damaged or lost frames are resent Repeats until EOT is sent
University of South Alabama Computer and Information Sciences Stop-and-Wait Normal Operation
University of South Alabama Computer and Information Sciences Lost or Damaged Frame
University of South Alabama Computer and Information Sciences Lost Acknowledgement
University of South Alabama Computer and Information Sciences Delayed Acknowledgement
University of South Alabama Computer and Information Sciences Stop-and-Wait Advantage: simplicity; each frame is checked and ACK’d before next frame is sent Numbering of frames prevents duplication Disadvantage: inefficiency; slow Frame and ACKs use entire bandwidth If distance is long between devices, time spent waiting can be significant
University of South Alabama Computer and Information Sciences Bidirectional Transmission Possible if two parties have separate channels for full-duplex transmission or share same channel for half-duplex transmission
University of South Alabama Computer and Information Sciences Piggybacking Method of combining data frame and acknowledgement Saves bandwidth due to less overhead from separate data frame and ACK frame into one frame
University of South Alabama Computer and Information Sciences Piggybacking
University of South Alabama Computer and Information Sciences Sliding Window Sender may transmit several frames before needing an ACK Much more efficient; receiver may use a single ACK to confirm multiple frames Sliding window refers to upper and lower limit on number of frames that may be transmitted before ACK is required Frames must be numbered to allow receiver to identify which frame is acknowledged
University of South Alabama Computer and Information Sciences 11.3 Go-Back-N ARQ Allows for more efficient transmission – send multiple frames before requiring an ACK Specify a window or range of sequence numbers of frames that may be received
Sliding Window • Receiver includes number of next frame it expects to receive in ACK • Sender then knows all previous frames through that number have been received University of South Alabama Computer and Information Sciences
Sender Window • Window contains 0to2m -1 frames • Window shrinks as frames are sent out • Once ACK arrives, window expands equal to number of frames acknowledged by ACK University of South Alabama Computer and Information Sciences
Receiver Window • Size of window is always 1 • Receiver expects the next ordered frame (must always be in order) • Any frame arriving out of order is discarded University of South Alabama Computer and Information Sciences
Control Variables • Sender : S – sequence number of recently sent frame; SF - sequence number of first frame in window; SL – sequence number of last frame in window • Window size is W = SL - SF + 1 • Receiver :R – sequence number of next frame expected University of South Alabama Computer and Information Sciences
University of South Alabama Computer and Information Sciences Go-Back-N Operation Timers: sender sets a timer for each frame (none for receiver) Acknowledgement – receiver sends positive ACK; silent on damaged or out of order frames Resending Frames – sender sends set of frames from damaged up to last one sent and ACK’d
University of South Alabama Computer and Information Sciences 11.4 Selective Repeat ARQ Go-Back-N less efficient since all out of order or damaged frames must be resent in order Selective Repeat is a more efficient method, yet required more processing
University of South Alabama Computer and Information Sciences Sender and Receiver Windows Sender window and control variables are same as Go-Back-N Receiver window is same size; looks for range of sequence numbers Requires two control variables to define window boundaries: RFand RL Also defines a negative acknowledgement (NAK) to report sequence number of damaged frame
University of South Alabama Computer and Information Sciences Selective Repeat ARQ
University of South Alabama Computer and Information Sciences Selective Repeat ARQ, Lost Frame
University of South Alabama Computer and Information Sciences Comparisons between Go-back-n and Selective-Reject Sending only specific damaged or lost frames requires complexity of sorting and more storage is required in select-reject Go-back-n is typically used due to simplicity
University of South Alabama Computer and Information Sciences 11.5 HDLC High-level Data Link Control – protocol supporting half-duplex and full-duplex communication over point-to-point and multipoint links
University of South Alabama Computer and Information Sciences HDLC Modes of Communication Relationship between two devices involved in an exchange Defines who controls the link Two modes: Normal response mode (NRM) Asynchronous balanced mode (ABM)
University of South Alabama Computer and Information Sciences Normal Response Mode Refers to standard primary-secondary relationships Used for all exchanges in unbalanced configurations Primary can issues commands Secondary must have permission from primary before responding or sending data
University of South Alabama Computer and Information Sciences NRM
Asynchronous Balanced Mode • All stations are equal • Stations in point-to-point configurations act as both primary and secondary University of South Alabama Computer and Information Sciences
University of South Alabama Computer and Information Sciences HDLC Frames Three types; each functions as an envelope to transmit a specific type of message Information frames (I-frames) – transports user data and control info relating to user data Supervisory frames (S-frames) – used to transport control info for data link layer flow and error controls Unnumbered frames (U-frames) – used for system mgmt and link mgmt
University of South Alabama Computer and Information Sciences HDLC Frame
University of South Alabama Computer and Information Sciences Flag Field Marks the beginning and end of frame and provides synchronization with 01111110
University of South Alabama Computer and Information Sciences Address Field Contains address of secondary station that is originator or destination of the frame If created by primary, contains a to address If created by secondary, contains a from address May be one byte or several bytes long
University of South Alabama Computer and Information Sciences Control Field One- or two-byte segment for flow management Fields differ depending on frame type First or first and second bits identify type of frame All three frame types contain a poll/final (P/F) bit; used to identify whether frame was sent by primary to a secondary or from secondary to primary
Information Field • Contains user’s data in an I-frame; network management in a U-frame; not included in an S-frame • Often used in a data frame to acknowledge receipt of another separate frame – called piggybacking University of South Alabama Computer and Information Sciences
FCS Field • Error detection field • Stores either two- or four-byte CRC University of South Alabama Computer and Information Sciences
University of South Alabama Computer and Information Sciences Different Control Frames I-frame – used for user information and transport and piggyback acknowledgements S-frame – used for acknowledgement, flow control, and error control when piggybacking is not appropriate U-frame – used to exchange session management and control information between devices
University of South Alabama Computer and Information Sciences Data Transparency To address the possibility that a bit pattern may match flag field indicator and be misinterpreted, bit stuffing may be used Anytime 5 consecutive 1s are encountered, a redundant 0 is inserted Identifies that the current sequence is not a flag
University of South Alabama Computer and Information Sciences Bit Stuffing and Removal
University of South Alabama Computer and Information Sciences Coming Up… Ch 12 Point-to-Point Access: PPP (brief)
University of South Alabama Computer and Information Sciences Credits All figures obtained from publisher-provided instructor downloads Data Communications and Networking, 3rd edition by Behrouz A. Forouzan. McGraw Hill Publishing, 2004