This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Data and Computer Communications Communications
Chapter 7 – Data Link Control Chapter Protocols Protocols
Eighth Edition by William Stallings Lecture slides by Lawrie Brown Data Link Control Protocols Link
"Great and enlightened one," said Ten-teh, as soon as his stupor was lifted, "has this person delivered his message competently, for his mind was still a seared vision of snow and sand and perchance his tongue has stumbled?" "Bend your ears to the wall," replied the Emperor, "and be assured." —Kai Lung's Golden Hours, Earnest Bramah Data Link Control Protocols Link need layer of logic above Physical to manage exchange of data over a link frame synchronization flow control error control addressing control and data link management Flow Control Flow ensure sending entity does not overwhelm ensure receiving entity receiving by preventing buffer overflow transmission time
• time taken to emit all bits into medium influenced by: propagation time
• time for a bit to traverse the link assume here no errors but varying delays Model of Frame Transmission Model Stop and Wait Stop source transmits frame destination receives frame and replies with destination acknowledgement (ACK) acknowledgement source waits for ACK before sending next destination can stop flow by not send ACK works well for a few large frames Stop and wait becomes inadequate if large Stop block of data is split into small frames Stop and Wait Link Utilization Stop Sliding Windows Flow Control Sliding allows multiple numbered frames to be in transit receiver has buffer W long transmitter sends up to W frames without ACK ACK includes number of next frame expected sequence number is bounded by size of field (k) frames are numbered modulo 2k giving max window size of up to 2k - 1 receiver can ack frames without permitting receiver further transmission (Receive Not Ready) further must send a normal acknowledge to resume if have full-duplex link, can piggyback ACks Sliding Window Diagram Sliding Sliding Window Example Sliding Error Control Error detection and correction of errors such as: lost frames damaged frames error detection positive acknowledgment retransmission after timeout negative acknowledgement & retransmission common techniques use: Automatic Repeat Request (ARQ) (ARQ) collective name for such error control collective mechanisms, including: mechanisms, stop and wait go back N selective reject (selective retransmission) Stop and Wait Stop source transmits single frame wait for ACK if received frame damaged, discard it transmitter has timeout if no ACK within timeout, retransmit transmitter will retransmit receive gets two copies of frame use alternate numbering and ACK0 / ACK1 if ACK damaged,transmitter will not recognize it Stop and Wait Stop see example with see both types of errors both pros and cons pros simple inefficient Go Back N Go based on sliding window if no error, ACK as usual use window to control number of use outstanding frames outstanding if error, reply with rejection discard that frame and all future frames until discard error frame received correctly error transmitter must go back and retransmit that transmitter frame and all subsequent frames frame Go Back N - Handling Damaged Frame error in frame i so receiver rejects frame i error transmitter retransmits frames from i transmitter frame i lost and either frame
• transmitter sends i+1 and receiver gets frame i+1 transmitter and i+1 out of seq and rejects frame i • or transmitter times out and send ACK with P bit or set which receiver responds to with ACK i Lost Frame transmitter then retransmits frames from i transmitter Go Back N - Handling Go Damaged Acknowledgement receiver gets frame i, sends ack (i+1) which is lost receiver acks are cumulative, so next ack (i+n) may arrive may before transmitter times out on frame i if transmitter times out, it sends ack with P bit set can be repeated a number of times before a reset can procedure is initiated procedure reject for damaged frame is lost handled as for lost frame when transmitter times out Damaged Rejection Selective Reject Selective also called selective retransmission only rejected frames are retransmitted subsequent frames are accepted by the receiver subsequent and buffered and minimizes retransmission receiver must maintain large enough buffer more complex logic in transmitter hence less widely used useful for satellite links with long propagation useful delays delays Go Back N vs vs Selective Selective Reject Reject High Level Data Link Control (HDLC) (HDLC) an important data link control protocol specified as ISO 33009, ISO 4335 station types: Primary - controls operation of link Secondary - under control of primary station Combined - issues commands and responses Unbalanced - 1 primary, multiple secondary Balanced - 2 combined stations link configurations HDLC Transfer Modes HDLC Normal Response Mode (NRM) unbalanced config, primary initiates transfer used on multi-drop lines, eg host + terminals balanced config, either station initiates transmission, balanced has no polling overhead, widely used has unbalanced config, secondary may initiate transmit unbalanced without permission from primary, rarely used without Asynchronous Balanced Mode (ABM) Asynchronous Response Mode (ARM) HDLC Frame Structure HDLC synchronous transmission of frames single frame format used Flag Fields and Bit Stuffing Flag delimit frame at both ends with 01111110 seq receiver hunts for flag sequence to synchronize bit stuffing used to avoid confusion with data bit containing flag seq 01111110 containing 0 inserted after every sequence of five 1s if receiver detects five 1s it checks next bit if next bit is 0, it is deleted (was stuffed bit) if next bit is 1 and seventh bit is 0, accept as flag if sixth and seventh bits 1, sender is indicating abort Address Field Address iidentifies secondary station that sent or will dentifies receive frame receive usually 8 bits long may be extended to multiples of 7 bits LSB indicates if is the last octet (1) or not (0) all ones address 11111111 is broadcast Control Field Control different for different frame type Information - data transmitted to user (next layer up)
• Flow and error control piggybacked on information frames Supervisory - ARQ when piggyback not used Unnumbered - supplementary link control first 1-2 bits of control field identify frame type Control Field Control use of Poll/Final bit depends on context iin command frame is P bit set to1 to solicit (poll) n response from peer response iin response frame is F bit set to 1 to indicate n response to soliciting command response seq number usually 3 bits can extend to 8 bits as shown below Information & FCS Fields Information Information Field Information in information and some unnumbered frames must contain integral number of octets variable length used for error detection either 16 bit CRC or 32 bit CRC Frame Check Sequence Field (FCS) HDLC Operation HDLC consists of exchange of information, consists supervisory and unnumbered frames supervisory have three phases initialization
• by either side, set mode & seq data transfer
• with flow and error control • using both I & S-frames (RR, RNR, REJ, SREJ) disconnect disconnect
• when ready or fault noted HDLC Operation Example HDLC HDLC Operation Example HDLC Summary Summary introduced need for data link protocols flow control error control HDLC ...
View Full Document
This note was uploaded on 04/06/2011 for the course EE 5363 taught by Professor Kang during the Spring '09 term at NYU Poly.
- Spring '09