Скачать презентацию William Stallings Data and Computer Communications Chapter 7 Скачать презентацию William Stallings Data and Computer Communications Chapter 7

60c51d854c254618efc3ad79742d4bba.ppt

  • Количество слайдов: 52

William Stallings Data and Computer Communications Chapter 7 Data Link Control William Stallings Data and Computer Communications Chapter 7 Data Link Control

Flow Control z Ensuring the sending entity does not overwhelm the receiving entity y. Flow Control z Ensuring the sending entity does not overwhelm the receiving entity y. Preventing buffer overflow z Transmission time y. Time taken to emit all bits into medium z Propagation time y. Time for a bit to traverse the link

Model of Frame Transmission Model of Frame Transmission

Parameters z a = Propagation Time / Transmission Time z a = (d/V) / Parameters z a = Propagation Time / Transmission Time z a = (d/V) / (L/R) yd - distance of the link y. V - velocity of propagation y. L - length of the frame (bits) y. R - data rate z U - utilization or efficency U = Tframe /Ttotal z for Stop & Wait U = 1 / (1 + 2 a)

Stop and Wait z Source transmits frame z Destination receives frame and replies with Stop and Wait z Source transmits frame z Destination receives frame and replies with acknowledgement z Source waits for ACK before sending next frame z Destination can stop flow by not send ACK z Works well for a few large frames

Fragmentation z Large block of data may be split into small frames y. Limited Fragmentation z Large block of data may be split into small frames y. Limited buffer size y. Errors detected sooner (when whole frame received) y. On error, retransmission of smaller frames is needed y. Prevents one station occupying medium for long periods z Stop and wait becomes inadequate

Stop and Wait Link Utilization Stop and Wait Link Utilization

Sliding Windows Flow Control z Allow multiple frames to be in transit z Receiver Sliding Windows Flow Control z Allow multiple frames to be in transit z Receiver has buffer W long z Transmitter can send up to W frames without ACK z Each frame is numbered z ACK includes number of next frame expected z Sequence number bounded by size of field (k) y. Frames are numbered modulo 2 k

Sliding Window Diagram Sliding Window Diagram

Example Sliding Window Example Sliding Window

Sliding Window Enhancements z Receiver can acknowledge frames without permitting further transmission (Receive Not Sliding Window Enhancements z Receiver can acknowledge frames without permitting further transmission (Receive Not Ready) z Must send a normal acknowledge to resume z If duplex, use piggybacking y. If no data to send, use acknowledgement frame y. If data but no acknowledgement to send, send last acknowledgement number again, or have ACK valid flag (TCP)

Error Detection z Additional bits added by transmitter for error detection code z Parity Error Detection z Additional bits added by transmitter for error detection code z Parity y. Value of parity bit is such that character has even (even parity) or odd (odd parity) number of ones y. Even number of bit errors goes undetected

Cyclic Redundancy Check z For a block of k bits transmitter generates n bit Cyclic Redundancy Check z For a block of k bits transmitter generates n bit sequence z Transmit k+n bits which is exactly divisible by some number z Receive divides frame by that number y. If no remainder, assume no error y. For math, see Stallings chapter 7

Error Control z Detection and correction of errors z Lost frames z Damaged frames Error Control z Detection and correction of errors z Lost frames z Damaged frames z Automatic repeat request ARQ y. Error detection y. Positive acknowledgment y. Retransmission after timeout y. Negative acknowledgement and retransmission

Automatic Repeat Request (ARQ) z Stop and wait z Go back N z Selective Automatic Repeat Request (ARQ) z Stop and wait z Go back N z Selective reject (selective retransmission)

Stop and Wait z Source transmits single frame z Wait for ACK z If Stop and Wait z Source transmits single frame z Wait for ACK z If received frame damaged, discard it y. Transmitter has timeout y. If no ACK within timeout, retransmit z If ACK damaged, transmitter will not recognize it y. Transmitter will retransmit y. Receive gets two copies of frame y. Use ACK 0 and ACK 1

Stop and Wait Diagram Stop and Wait Diagram

Stop and Wait - Pros and Cons z Simple z Inefficient Stop and Wait - Pros and Cons z Simple z Inefficient

Go Back N (1) z Based on sliding window z If no error, ACK Go Back N (1) z Based on sliding window z If no error, ACK as usual with next frame expected z Use window to control number of outstanding frames z If error, reply with rejection y. Discard that frame and all future frames until error frame received correctly y. Transmitter must go back and retransmit that frame and all subsequent frames

Go Back N - Damaged Frame z Receiver detects error in frame i z Go Back N - Damaged Frame z Receiver detects error in frame i z Receiver sends rejection-i z Transmitter gets rejection-i z Transmitter retransmits frame i and all subsequent

Go Back N - Lost Frame (1) z Frame i lost z Transmitter sends Go Back N - Lost Frame (1) z Frame i lost z Transmitter sends i+1 z Receiver gets frame i+1 out of sequence z Receiver send reject i z Transmitter goes back to frame i and retransmits

Go Back N - Lost Frame (2) z Frame i lost and no additional Go Back N - Lost Frame (2) z Frame i lost and no additional frame sent z Receiver gets nothing and returns neither acknowledgement nor rejection z Transmitter times out and sends acknowledgement frame with P bit set to 1 z Receiver interprets this as command which it acknowledges with the number of the next frame it expects (frame i ) z Transmitter then retransmits frame i

Go Back N - Damaged Acknowledgement z Receiver gets frame i and send acknowledgement Go Back N - Damaged Acknowledgement z Receiver gets frame i and send acknowledgement (i+1) which is lost z Acknowledgements are cumulative, so next acknowledgement (i+n) may arrive before transmitter times out on frame i z If transmitter times out, it sends acknowledgement with P bit set as before z This can be repeated a number of times before a reset procedure is initiated

Go Back N - Damaged Rejection z As for lost frame (2) Go Back N - Damaged Rejection z As for lost frame (2)

Go Back N Diagram Go Back N Diagram

Selective Reject z Also called selective retransmission z Only rejected frames are retransmitted z Selective Reject z Also called selective retransmission z Only rejected frames are retransmitted z Subsequent frames are accepted by the receiver and buffered z Minimizes retransmission z Receiver must maintain large enough buffer z More complex logic in transmitter

Selective Reject Diagram Selective Reject Diagram

High Level Data Link Control z HDLC z ISO 33009, ISO 4335 High Level Data Link Control z HDLC z ISO 33009, ISO 4335

HDLC Station Types z Primary station y. Controls operation of link y. Frames issued HDLC Station Types z Primary station y. Controls operation of link y. Frames issued are called commands y. Maintains separate logical link to each secondary station z Secondary station y. Under control of primary station y. Frames issued called responses z Combined station y. May issue commands and responses

HDLC Link Configurations z Unbalanced y. One primary and one or more secondary stations HDLC Link Configurations z Unbalanced y. One primary and one or more secondary stations y. Supports full duplex and half duplex z Balanced y. Two combined stations y. Supports full duplex and half duplex

HDLC Transfer Modes (1) z Normal Response Mode (NRM) y. Unbalanced configuration y. Primary HDLC Transfer Modes (1) z Normal Response Mode (NRM) y. Unbalanced configuration y. Primary initiates transfer to secondary y. Secondary may only transmit data in response to command from primary y. Used on multi-drop lines y. Host computer as primary y. Terminals as secondary

HDLC Transfer Modes (2) z Asynchronous Balanced Mode (ABM) y. Balanced configuration y. Either HDLC Transfer Modes (2) z Asynchronous Balanced Mode (ABM) y. Balanced configuration y. Either station may initiate transmission without receiving permission y. Most widely used y. No polling overhead

HDLC Transfer Modes (3) z Asynchronous Response Mode (ARM) y. Unbalanced configuration y. Secondary HDLC Transfer Modes (3) z Asynchronous Response Mode (ARM) y. Unbalanced configuration y. Secondary may initiate transmission without permission form primary y. Primary responsible for line yrarely used

Frame Structure z Synchronous transmission z All transmissions in frames z Single frame format Frame Structure z Synchronous transmission z All transmissions in frames z Single frame format for all data and control exchanges

Frame Structure Diagram Frame Structure Diagram

Flag Fields z Delimit frame at both ends z 01111110 z May close one Flag Fields z Delimit frame at both ends z 01111110 z May close one frame and open another z Receiver hunts for flag sequence to synchronize z Bit stuffing used to avoid confusion with data containing 01111110 y 0 inserted after every sequence of five 1 s y. If receiver detects five 1 s it checks next bit y. If 0, it is deleted y. If 1 and seventh bit is 0, accept as flag y. If sixth and seventh bits 1, sender is indicating abort

Bit Stuffing z Example with possible errors Bit Stuffing z Example with possible errors

Address Field z Identifies secondary station that sent or will receive frame z Usually Address Field z Identifies secondary station that sent or will receive frame z Usually 8 bits long z May be extended to multiples of 7 bits y. LSB of each octet indicates that it is the last octet (1) or not (0) z All ones (1111) is broadcast

Control Field z Different for different frame type y. Information - data to be Control Field z Different for different frame type y. Information - data to be transmitted to user (next layer up) x. Flow and error control piggybacked on information frames y. Supervisory - ARQ when piggyback not used y. Unnumbered - supplementary link control z First one or two bits of control filed identify frame type z Remaining bits explained later

Control Field Diagram Control Field Diagram

Poll/Final Bit z Use depends on context z Command frame y. P bit y Poll/Final Bit z Use depends on context z Command frame y. P bit y 1 to solicit (poll) response from peer z Response frame y. F bit y 1 indicates response to soliciting command

Information Field z Only in information and some unnumbered frames z Must contain integral Information Field z Only in information and some unnumbered frames z Must contain integral number of octets z Variable length

Frame Check Sequence Field z FCS z Error detection z 16 bit CRC z Frame Check Sequence Field z FCS z Error detection z 16 bit CRC z Optional 32 bit CRC

HDLC Operation z Exchange of information, supervisory and unnumbered frames z Three phases y. HDLC Operation z Exchange of information, supervisory and unnumbered frames z Three phases y. Initialization y. Data transfer y. Disconnect

Examples of Operation (1) Examples of Operation (1)

Examples of Operation (2) Examples of Operation (2)

Other DLC Protocols (LAPB, LAPD) z Link Access Procedure, Balanced (LAPB) y. Part of Other DLC Protocols (LAPB, LAPD) z Link Access Procedure, Balanced (LAPB) y. Part of X. 25 (ITU-T) y. Subset of HDLC - ABM y. Point to point link between system and packet switching network node z Link Access Procedure, D-Channel y. ISDN (ITU-D) y. ABM y. Always 7 -bit sequence numbers (no 3 -bit) y 16 bit address field contains two sub-addresses x. One for device and one for user (next layer up)

Other DLC Protocols (LLC) z Logical Link Control (LLC) y. IEEE 802 y. Different Other DLC Protocols (LLC) z Logical Link Control (LLC) y. IEEE 802 y. Different frame format y. Link control split between medium access layer (MAC) and LLC (on top of MAC) y. No primary and secondary - all stations are peers y. Two addresses needed x. Sender and receiver y. Error detection at MAC layer x 32 bit CRC y. Destination and source access points (DSAP, SSAP)

Other DLC Protocols (Frame Relay) (1) z Streamlined capability over high speed packet witched Other DLC Protocols (Frame Relay) (1) z Streamlined capability over high speed packet witched networks z Used in place of X. 25 z Uses Link Access Procedure for Frame-Mode Bearer Services (LAPF) z Two protocols y. Control - similar to HDLC y. Core - subset of control

Other DLC Protocols (Frame Relay) (2) z ABM z 7 -bit sequence numbers z Other DLC Protocols (Frame Relay) (2) z ABM z 7 -bit sequence numbers z 16 bit CRC z 2, 3 or 4 octet address field y. Data link connection identifier (DLCI) y. Identifies logical connection z More on frame relay later

Other DLC Protocols (ATM) z Asynchronous Transfer Mode z Streamlined capability across high speed Other DLC Protocols (ATM) z Asynchronous Transfer Mode z Streamlined capability across high speed networks z Not HDLC based z Frame format called “cell” z Fixed 53 octet (424 bit) z Details later

Required Reading z Stallings chapter 7 z Web sites on HDLC, frame relay, Ethernet Required Reading z Stallings chapter 7 z Web sites on HDLC, frame relay, Ethernet and ATM