6 data linkcontrol

1,123 views
987 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,123
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
33
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

6 data linkcontrol

  1. 1. Data Communications - Data Link Control Protocols Key Points
  2. 2. Flow Control <ul><li>Flow control : </li></ul><ul><li>Ensuring the sending entity does not overwhelm the receiving entity with data </li></ul><ul><ul><li>Preventing buffer overflow </li></ul></ul><ul><li>Transmission time </li></ul><ul><ul><li>Time taken to emit all bits into medium </li></ul></ul><ul><li>Propagation time </li></ul><ul><ul><li>Time for a bit to traverse (merentasi) the link </li></ul></ul>
  3. 3. Model of Frame Transmission (mengelirukan)
  4. 4. Stop and Wait Flow Control <ul><li>The simplest form of flow control </li></ul><ul><li>Source transmits frame </li></ul><ul><li>Destination receives frame and replies with acknowledgement (ready to accept another frame) </li></ul><ul><li>Source waits for ACK before sending next frame </li></ul><ul><li>Destination can stop flow by not send ACK </li></ul><ul><ul><li>As long as there are no ACK from dest., source do not sends frame </li></ul></ul><ul><li>Works well for a message sent in a few large frames </li></ul>
  5. 5. Fragmentation <ul><li>Large block of data may be split into small frames </li></ul><ul><ul><li>Limited buffer size </li></ul></ul><ul><ul><li>Errors detected sooner (when whole frame received) </li></ul></ul><ul><ul><li>On error, retransmission of smaller frames is needed </li></ul></ul><ul><ul><li>Prevents one station occupying medium for long periods (causing long delays at other sending station) </li></ul></ul><ul><li>With multiple frames for a single message  inadequate </li></ul><ul><ul><li>Only one frame at a time can be transit </li></ul></ul><ul><li>Stop and wait becomes inadequate when the bit length of the link is greater than the frame length (a>1) </li></ul>
  6. 6. Bit length of link B=R x d/V B = length of the link in bits , this is the number of bits present on the link at an instance in time when a stream of bits fully occupies the link R = data rate of the link, in bps d = length, or distance of the link in meter V = velocity of propagation, in m/s Propagation delay a = B/L L = number of bits in the frame (length of the frame in bits)
  7. 7. Stop and Wait Link Utilization length of link > length of frame (1 frame/time =Inefficient) length of link < length of frame
  8. 8. Example
  9. 9. Sliding Windows Flow Control <ul><li>Allow multiple frames to be in transit (improve efficiency ) </li></ul><ul><li>Receiver has buffer W long </li></ul><ul><li>Transmitter can send up to W frames without ACK from receiver </li></ul><ul><li>Each frame is numbered (sequence of order) </li></ul><ul><li>Receiver sends ACK includes number of next frame expected </li></ul><ul><li>Transmitter maintains list of sequence no. to send, </li></ul><ul><li>Receiver maintains list of sequence no. to receive. </li></ul><ul><li>Sequence number bounded by size of field (k) </li></ul><ul><ul><li>Frames are numbered modulo 2 k – numbered 0 to k-1 </li></ul></ul><ul><ul><ul><li>Eg: if 2 k =8(3 bits), frames are numbered 0,1,2,3,4,5,6,7,0,1,2,3…..7,0.. </li></ul></ul></ul>
  10. 10. Sliding Window Diagram- Sender Assume using 2 3 = 8,no. = 0,1,2,3,4,5,6,7,0… Each time a frame is sent  window shrink (# of frames may be transmitted) Each time ACK is received  window grows (to end side (total of 7 frames)) acknowledged Sent but not yet acknowledged
  11. 11. Sliding Window Diagram-receiver ACK must includes F0 (RR 0) “ Receiver has received all frames up to F7 and is ready to receive F0.” Each time a frame is received  window shrink (# of frames available) Each time ACK is sent  window grows (to end side (total of 7 frames)) *RR = Ready Receive
  12. 12. Example Sliding Window A may transmits 7 frames, beginning with F0 A transmits F0,F1,F2 (no ACK) A shrunk its window to 4 frames, maintains copy of F0,F1,F2 A may transmits 4 frames, beginning with F3 B transmits RR 3 frames (received frames up to F2, ready to receive 7 more frames starts from F3) B grows back to 7 frames, starts from F3 A discards copy of F0,F1,F2 A transmits F3,F4,F5,F6 B returns RR 4 (ACK F3, allows A transmits from F4 – F2) By the time RR 4 reaches A, A already transmitted F4,F5,F6,So A can only transmits 4 frames starts from F7. B may receives 7 frames, beginning with F0 B shrunk its window to 4 frames (available frames)
  13. 13. Sliding Window Enhancements <ul><li>Receiver can acknowledge frames without permitting further transmission (Receive Not Ready, RNR) </li></ul><ul><ul><li>EG: RNR 5 = “I have received all frames up through no. 4 but unable to accept any more at this time” </li></ul></ul><ul><li>Must send a normal acknowledge to restart transmission </li></ul><ul><li>If duplex, </li></ul><ul><ul><li>2 stations exchange data, both maintain 2 windows (to transmit and to receive) </li></ul></ul><ul><ul><li>To support this requirement, use piggybacking </li></ul></ul><ul><ul><ul><li>If no data to send, use acknowledgement frame (RR @ RNR) </li></ul></ul></ul><ul><ul><ul><li>If data but no acknowledgement to send, send last acknowledgement number again, or have ACK valid flag (TCP) </li></ul></ul></ul>
  14. 14. Error Control <ul><li>Mechanisms of detection and correction of errors </li></ul><ul><ul><li>Types of errors </li></ul></ul><ul><ul><ul><li>Lost frames </li></ul></ul></ul><ul><ul><ul><li>Damaged frames </li></ul></ul></ul><ul><li>Automatic repeat request (ARQ) – to turn an unreliable data link to a reliable one </li></ul><ul><li>ARQ mechanisms: </li></ul><ul><ul><li>Error detection </li></ul></ul><ul><ul><ul><li>parity check, CRC, etc. </li></ul></ul></ul><ul><ul><li>Positive acknowledgment </li></ul></ul><ul><ul><ul><li>Dest. ACK source received error-free frames. </li></ul></ul></ul><ul><ul><li>Retransmission after timeout </li></ul></ul><ul><ul><ul><li>Source retransmits frame not ACK </li></ul></ul></ul><ul><ul><li>Negative acknowledgement and retransmission </li></ul></ul><ul><ul><ul><li>Dest. ACK source received error- detected frames. </li></ul></ul></ul><ul><ul><ul><li>Source retransmits frame </li></ul></ul></ul>
  15. 15. Automatic Repeat Request (ARQ) <ul><li>Three versions of ARQ have been standardized: </li></ul><ul><ul><li>Stop and wait </li></ul></ul><ul><ul><li>Go back N </li></ul></ul><ul><ul><li>Selective reject (selective retransmission) </li></ul></ul>
  16. 16. (a) Stop and Wait <ul><li>Source transmits single frame </li></ul><ul><li>Wait for ACK </li></ul><ul><li>If receiver received frame damaged, discard it </li></ul><ul><ul><li>Transmitter has timeout (transmitter occupied with timer) </li></ul></ul><ul><ul><li>If no ACK within timeout, retransmit frame </li></ul></ul><ul><li>If ACK damaged (but arrived), transmitter will not recognize it </li></ul><ul><ul><li>Transmitter will retransmit </li></ul></ul><ul><ul><li>Receiver gets two copies of frame </li></ul></ul><ul><ul><li>Use ACK0 and ACK1 </li></ul></ul>
  17. 17. Stop and Wait - Diagram # of frame : Labeled alternately 0 and 1 ACK0 : Receiver received frame 1, Ready to receive frame 0. ACK1 : Receiver received frame 0, Ready to receive frame 1.
  18. 18. Stop and Wait - Pros and Cons <ul><li>Simple </li></ul><ul><li>Inefficient </li></ul>
  19. 19. (b) Go Back N (1) <ul><li>Based on sliding window </li></ul><ul><li>If no error, ACK as usual with next frame expected </li></ul><ul><li>Use window to control number of outstanding frames </li></ul><ul><li>If error, reply with rejection (REJ) </li></ul><ul><ul><li>Discard that frame and all future frames until error frame received correctly </li></ul></ul><ul><ul><li>Transmitter must go back and retransmit that frame and all subsequent frames </li></ul></ul>
  20. 20. Go Back N - Damaged Frame <ul><li>Receiver detects error in frame i </li></ul><ul><li>Receiver sends rejection- i (REJ i ) </li></ul><ul><li>Transmitter gets rejection- i </li></ul><ul><li>Transmitter retransmits frame i and all subsequent </li></ul>
  21. 21. Go Back N - Lost Frame (1) <ul><li>Case 1: </li></ul><ul><li>Frame i lost </li></ul><ul><li>Transmitter sends i+1 </li></ul><ul><li>Receiver gets frame i+1 out of sequence </li></ul><ul><li>Receiver send reject i (REJ i ) </li></ul><ul><li>Transmitter goes back to frame i and retransmits </li></ul>
  22. 22. Go Back N - Lost Frame (2) <ul><li>Case 2: </li></ul><ul><li>Frame i lost and no additional frame sent </li></ul><ul><li>Receiver gets nothing and returns neither acknowledgement nor rejection </li></ul><ul><li>Transmitter times out and sends acknowledgement frame with P bit set to 1. ( RR(P bit =1) ) </li></ul><ul><li>Receiver interprets this as command which it acknowledges with the number of the next frame it expects (frame i ) . (RR i ) </li></ul><ul><li>Transmitter then retransmits frame i </li></ul>
  23. 23. Go Back N –Damaged Acknowledgement (RR @ RNR@ REJ) <ul><li>Receiver gets frame i and send acknowledgement ( i+1 ) which is lost </li></ul><ul><li>(RR i+1 ) is sent to transmitter but lost in transmission </li></ul><ul><li>Acknowledgements are cumulative, so next acknowledgement ( i+n ) may arrive before transmitter times out on frame i </li></ul><ul><li>If transmitter times out, it sends acknowledgement with P bit set as before </li></ul><ul><li>( RR(P bit =1) ) </li></ul><ul><li>This can be repeated a number of times before a reset procedure is initiated </li></ul>
  24. 24. Go Back N - Damaged Rejection <ul><li>*Same as for lost frame (2) </li></ul><ul><li>Receiver gets nothing and returns neither acknowledgement nor rejection </li></ul><ul><li>Transmitter times out and sends acknowledgement frame with P bit set to 1. </li></ul><ul><li>( RR(P bit =1) ) </li></ul><ul><li>Receiver interprets this as command which it acknowledges with the number of the next frame it expects (frame i ) . (RR i ) </li></ul><ul><li>Transmitter then retransmits frame i </li></ul>
  25. 25. Go Back N - Diagram RR 2: REJ 4: RR(P bit=1)
  26. 26. (c) Selective Reject <ul><li>Also called selective retransmission </li></ul><ul><li>Only rejected frames are retransmitted </li></ul><ul><li>Subsequent frames are accepted by the receiver and buffered </li></ul><ul><li>Minimizes retransmission </li></ul><ul><li>Receiver must maintain large enough buffer </li></ul><ul><li>More complex login in transmitter </li></ul>
  27. 27. Selective Reject - Diagram
  28. 28. High Level Data Link Control <ul><li>The important data link control is High Level Data Link Control (HDLC) </li></ul><ul><li>ISO 33009, ISO 4335 </li></ul><ul><li>Widely used, basis for some other data link control protocols </li></ul>
  29. 29. HDLC Basic Characteristics <ul><li>Stations type: </li></ul><ul><li>Primary station </li></ul><ul><ul><li>Controls operation of link </li></ul></ul><ul><ul><li>Frames issued are called commands </li></ul></ul><ul><ul><li>Maintains separate logical link to each secondary station </li></ul></ul><ul><li>Secondary station </li></ul><ul><ul><li>Under control of primary station </li></ul></ul><ul><ul><li>Frames issued called responses </li></ul></ul><ul><li>Combined station </li></ul><ul><ul><li>May issue commands and responses </li></ul></ul>
  30. 30. HDLC Link Configurations <ul><li>Link configurations: </li></ul><ul><li>Unbalanced </li></ul><ul><ul><li>One primary and one or more secondary stations </li></ul></ul><ul><ul><li>Supports full duplex and half duplex </li></ul></ul><ul><li>Balanced </li></ul><ul><ul><li>Two combined stations </li></ul></ul><ul><ul><li>Supports full duplex and half duplex </li></ul></ul>
  31. 31. HDLC Transfer Modes (1) <ul><li>Data transfer modes of operation: </li></ul><ul><li>Normal Response Mode (NRM) </li></ul><ul><li>Asynchronous Balanced Mode (ABM) </li></ul><ul><li>Asynchronous Response Mode (ARM) </li></ul>
  32. 32. HDLC Transfer Modes (1) <ul><li>Normal Response Mode (NRM) </li></ul><ul><ul><li>Unbalanced configuration </li></ul></ul><ul><ul><li>Primary initiates transfer to secondary </li></ul></ul><ul><ul><li>Secondary may only transmit data in response to command from primary </li></ul></ul><ul><ul><li>Used on multi-drop lines </li></ul></ul><ul><ul><li>Host computer as primary </li></ul></ul><ul><ul><li>Terminals as secondary </li></ul></ul>
  33. 33. HDLC Transfer Modes (2) <ul><li>Asynchronous Balanced Mode (ABM) </li></ul><ul><ul><li>Balanced configuration </li></ul></ul><ul><ul><li>Either station may initiate transmission without receiving permission </li></ul></ul><ul><ul><li>Most widely used </li></ul></ul><ul><ul><li>No polling overhead </li></ul></ul>
  34. 34. HDLC Transfer Modes (3) <ul><li>Asynchronous Response Mode (ARM) </li></ul><ul><ul><li>Unbalanced configuration </li></ul></ul><ul><ul><li>Secondary may initiate transmission without permission form primary </li></ul></ul><ul><ul><li>Primary responsible for line </li></ul></ul><ul><ul><li>rarely used </li></ul></ul>
  35. 35. Frame Structure HDLC uses synchronous transmission (frames) header trailer END!!
  36. 36. Key Points <ul><li>Why do we need data link control protocol? </li></ul><ul><ul><ul><li>Because of the possibility of transmission errors </li></ul></ul></ul><ul><ul><ul><li>Because the receiver may need to regulate the rate of the data arrive </li></ul></ul></ul><ul><ul><ul><li>Because synchronization and interfacing techniques are insufficient by themselves </li></ul></ul></ul><ul><ul><li>So, we need a layer of control that provide </li></ul></ul><ul><ul><ul><li>Flow control, error detection and error control </li></ul></ul></ul>
  37. 37. Key Points -2 <ul><li>Flow control </li></ul><ul><ul><li>Enables a receiver to regulate the flow of data from a sender so that the receiver’s buffers do not overflow. </li></ul></ul><ul><li>Error control </li></ul><ul><ul><li>Achieved by retransmission of damaged frames that have not been acknowledged or for which the other side requests a retransmission </li></ul></ul><ul><li>High-level data link control (HDLC) </li></ul><ul><ul><li>Widely used data link control protocol. </li></ul></ul>
  38. 38. Sliding Window Diagram

×