1 / 67

Learning Outcome

EEC4113 Data Communication & Multimedia System Chapter 4: Flow Control by Muhazam Mustapha, October 2011. Learning Outcome. By the end of this chapter, students are expected to be able to explain link level flow control of transmission involving various protocols and techniques. Chapter Content.

holli
Download Presentation

Learning Outcome

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EEC4113Data Communication &Multimedia SystemChapter 4: Flow Controlby Muhazam Mustapha, October 2011

  2. Learning Outcome • By the end of this chapter, students are expected to be able to explain link level flow control of transmission involving various protocols and techniques

  3. Chapter Content • Stop-and-Wait ARQ • Go-Back-N ARQ • Selective Reject ARQ • Line Utilization • High-level Data Link Control

  4. Automatic Repeat Request (ARQ) CO1

  5. Stop-and-Wait ARQ • Data and acknowledgement (ACK) frames are numbered. • For each correctly received data frame, there will be an ACK frame. • Only on receiving an ACK, sender sends the next frame. CO1

  6. Stop-and-Wait ARQ • If there is a damaged data frame • Receiver discards the frame and NAK frame is returned. • On receiving NAK, sender re-transmits the frame. • If ACK or NAK is damaged or never reach sender • Sender re-transmits on wait time-out. CO1

  7. Stop-and-Wait ARQ Normal operation diagram: Sender Receiver Frame1 Wait ACK1 Frame2 Wait ACK2 Frame3 Time Wait ACK3 Frame4 Wait ACK4 ... CO1

  8. Stop-and-Wait ARQ Event of damage frame: Sender Receiver Frame1 Wait ACK1 × Frame2 Error occur Wait NAK2 Retransmit Frame2 Time Wait ACK2 Frame3 Wait ACK3 ... CO1

  9. Stop-and-Wait ARQ Event of damage ACK: Sender Receiver Frame1 Wait ACK1 Frame2 ACK2 × Error occur Wait Time Time out Frame2 ... Retransmit Wait ACK2 CO1

  10. Stop-and-Wait ARQ Event of frame lost: Sender Receiver Frame1 Wait ACK1 × Frame2 Frame lost Wait Time Time out Frame2 ACK2 Retransmit ... CO1

  11. Stop-and-Wait ARQ Event of lost ACK: Sender Receiver Frame1 Wait ACK1 Frame2 ACK2 × ACK Lost Wait Time Time out Frame2 Wait ACK2 Retransmit ... CO1

  12. Go-Back-N ARQ • A pipelined protocol. • Inefficiency of Stop-and-Wait: Sender has to wait for ACK for each and every data frame sent. • In Go-Back-N, sender doesn’t wait for ACK. • Instead, sender keeps sending but not too rapidly – sliding window constrained. • Sender will respond to ACK as it comes. CO1

  13. Go-Back-N ARQ • At receiver, all good, in-sequence frames must be ACK as normal. • All out-of-sequence frames will be discarded even if they are good. • On receiving bad frame, receiver sends NAK and requests for re-transmission of that frame. CO1

  14. Go-Back-N ARQ • At sender, on receiving an NAK, it re-transmits that frame, and all subsequence frames. • If sender finishes sending frames within its window, but lagging behind in receiving ACK, it re-transmits in-sequence starting from earliest frame not ACK-ed. CO1

  15. Go-Back-N ARQ Normal operation diagram: Sender Receiver Frame1 Frame2 ACK1 Frame3 ACK2 Frame4 ACK3 Frame5 ACK4 Frame6 ACK5 ACK6 Time ... CO1

  16. Go-Back-N ARQ Event of damage frame: Error occur Time Receiver Frame1 Frame2 Frame3 Frame4 Frame5 Frame6 Frame3 Frame4 Frame5 × . . . ACK1 ACK2 NAK3 ACK3 ACK4 ACK5 Sender Retransmit CO1

  17. Go-Back-N ARQ Event of lost frame: (sender window = 6 frames) Retransmitafter time-out Frame lost Time Receiver Frame1 Frame2 Frame4 Frame5 Frame6 Frame7 Frame8 Frame3 Frame4 Frame5 Frame6 Frame7 Frame8 × . . . Frame3 ACK1 ACK2 ACK3 ACK4 ACK5 Sender 1 frame buffered 1 frame buffered 2 frames buffered 3 frames buffered 4 frames buffered 4 frames buffered 4 frames buffered 5 frames buffered 6 frames buffered 2 frames buffered 3 frames buffered 4 frames buffered 4 frames buffered 4 frames buffered CO1

  18. Go-Back-N ARQ Event of lost ACK: (sender window = 6 frames) ACK damaged or lost Time Receiver Frame10 Frame11 Frame14 Frame13 Frame5 Frame12 Frame1 Frame2 Frame3 Frame4 Frame6 Frame7 Frame8 Frame9 × × . . . ACK6 ACK2 ACK11 ACK10 ACK1 ACK3 ACK4 ACK5 ACK7 ACK9 ACK8 Sender 1 frame buffered 2 frames buffered 3 frames buffered 4 frames buffered 4 frames buffered 5 frames buffered 4 frames buffered 4 frames buffered 4 frames buffered 5 frames buffered 4 frames buffered 4 frames buffered 4 frames buffered 4 frames buffered CO1

  19. Selective Reject ARQ • An extension of Go-Back-N but now the sender is asked to re-transmit only the damaged or lost frames. • Now the receiver is required to have buffer too (same size as the sender), and to respond to any subsequence frames after the error within its buffer limit. • The receiver will respond with a SREJ (or SREQ) upon a damaged or lost frame. CO1

  20. Selective Reject ARQ • The receiver will buffer the subsequence frames after the damaged or lost frames. • Once the missing one is obtained, the receiver buffer is flushed up to the next missing frame (or all if no more missing). • If the receiver run out of buffer before receiving the missing frame, it will stop responding, and this reduces the whole protocol to Go-Back-N ARQ. CO1

  21. Selective Reject ARQ • At sender side, sender is required to respond to SREJ immediately, then continue to normal frame sequence. • If it reaches to a condition where all its buffered frames are not ACK-ed, it is too will reduce to Go-Back-N ARQ and re-transmit them all in sequence. CO1

  22. Selective Reject ARQ Event of lost frame: Frame damaged Frame lost 1 3 43 543 5432 7 7 87 987 9876 10 11 Receiver Frame8 Frame9 Frame11 Frame10 Frame5 Frame6 Frame1 Frame2 Frame3 Frame4 Frame2 Frame7 × × . . . Time Frame6 ACK1 ACK3 ACK4 ACK5 ACK2 ACK9 ACK6 ACK8 SREJ2 SREP6 ACK7 1 21 321 4321 5432 5432 6543*2 7654*3*2 765*4*3*2 876 9876 987*6 10987*6 111098*7*6 11109*8*7*6 1110 Sender CO1

  23. Windowed & Pipelined Processing • Go-Back-N and Selective Reject are pipelined and windowed ARQ. • Pipelined means they don’t wait for the transmitted frames to be ACK-ed, instead continue with transmission of next frame in buffer. • In Go-Back-N ARQ, only sender needs buffers, receiver doesn’t. CO1

  24. Windowed & Pipelined Processing • In Selective Reject ARQ, both sender and receiver need buffers. • For both sides, the buffer (window) size must be the same so that flushing can be properly timed. • And the window size <= half of possible frame number = 2n-1, n is the no. bits available to encode the frames – to avoid ambiguity in the frame numbers. CO1

  25. Detailed Window Processing • Sender sends frames to receiver • Sender’s windows shrinks according to the no. frames sent • Sent frames would still be kept in sender’s buffer • Receiver receives frames from sender • Receiver’s windows shrinks according to the no. frames received CO1

  26. Detailed Window Processing • Receiver sends ACK to sender • Receiver’s windows expands according to the no. ACK sent • Receiver’s windows restores to the original size • Sender receives ACK-s from receiver • Sender’s windows expands according to the no. ACK-s received • Sender’s windows restores to the original size CO1

  27. Detailed Window Processing Window SenderBuffer Initial 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 ReceiverBuffer After 3 frames sent and received 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 SenderBuffer 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 ReceiverBuffer After 3 ACK received 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 SenderBuffer 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 ReceiverBuffer 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 CO1

  28. Piggyback Transmission • There are times where the receiver too has to transmit data to the sender besides the acknowledgement data. • E.g. AJAX transaction, HTML page with many images (request for next image is made before the currently sending finished) • To improve efficiency of such bi-directional transmission, piggyback technique is used • Data frame with additional field to carry ACK CO1

  29. Piggyback Transmission • If the receiver wants to send both data and ACK to sender, it will send both fields. • If the receiver wants to send only ACK, a separate ACK frame is sent – not a piggybacked data. • If the receiver wants to send only data, the data is sent with the previous ACK which is ignored by the sender side due to duplication. CO1

  30. Line Utilization CO2

  31. Line Utilization • A measure (a) of ratio between no. bits present on a physical link (B) over no. bits per frame (L) a = B / L • a is to be made as close to 1 as possible for the line to be utilized optimally. • This can be achieved by adjusting L. • Value of L needs to be optimized for various protocols so that a is close enough to 1. CO2

  32. Line Utilization • B can be computed from data rate (R in bps), physical distance (d in meters) and velocity of propagation (V in ms-1): B = R × d/V CO2

  33. Line Utilization • Consider 1Mbps (R) link between 2 ground stations communicating through satellite relay. • Geo-satellite: altitude of 36000km (d) • Propagation velocity: 3×108 ms-1 (V) • B = 240,000 bits • For a frame length of 8000 bits, a = 30 CO2

  34. Line Utilization • Sender finishes sending long before first bit physically arrived at receiver. • This is a serious inefficiency in link utilization. 8000bits 8000bits 240,000 bits CO2

  35. Line Utilization • Consider 200 m (d) optical fiber operating at 1 Gbps (R). • Propagation velocity: 2×108 ms-1 (V) • B = 1000 bits • For a frame length of 8000 bits, a = 0.125 CO2

  36. Line Utilization 8000bits • Sender doesn’t finish sending long after first bit physically arrived at receiver. • This is also an inefficiency because the rest of the circuitry might need wait too long for this operation to finish. 8000bits 1000 bits CO2

  37. High-level Data Link Control CO1

  38. HDLC • High-level Data Link Control • A set of control commands made by OSI to control data link communication. • To accomplish the data link control task, HDLC defines the following: • 3 types of stations • 2 link configurations • 3 data transfer modes CO1

  39. HDLC Station Types • Primary station • Controls operation of link • Frames sent-out are called commands • Maintains separate logical link to each secondary station • Secondary station • Under control of primary station • Frames sent out are called responses • Combined station • May send out commands and responses CO1

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

  41. HDLC Transfer Modes • Three HDLC transfer modes • Normal Response Mode (NRM) • Asynchronous Response Mode (ARM) • Asynchronous Balanced Mode (ABM) CO1

  42. Normal Response Mode (NRM) • One primary and one or more secondary (point-to-point or multicast) • Used with unbalanced configuration • Primary initiates transfer to secondary • Secondary may only transmit data in response to command from primary • Host computer as primary • Terminals as secondary CO1

  43. Normal Response Mode (NRM) Primary Secondary Command Response Unicast / Point-to-point Secondary Secondary Primary Command Response Response Multicast CO1

  44. Asynchronous Response Mode (ARM) • One primary and one secondary (point-to-point) • Used with unbalanced configuration • Primary sends commands, secondary can respond at any time Primary Secondary Command Response CO1

  45. Asynchronous Balanced Mode (ABM) • Two combined stations • Used with balanced configuration • Either station may initiate transmission without receiving permission • Most widely used • No polling overhead Combined Combined Command/Response Command/Response CO1

  46. HDLC Frame Structure • HDLC uses synchronous transmission • All transmissions in frames • Single frame for all data and control exchanges Flag Address Control Information FCS Flag 8 bits 8 bits extendable 8 or 16 bits variable 16 or 32 bits 8 bits CO1

  47. Flag Fields • Delimit a frame at both ends • An 8 bit sequence with a pattern 01111110 • Each frame has 1 opening and 1 closing flag • Receiver hunts for flag sequence to synchronize • Bit stuffing used to avoid confusion with data containing 01111110 Flag Address Control Information FCS Flag 8 bits 8 bits CO1

  48. Bit Stuffing • Bit stuffing used to avoid confusion with data containing 01111110 • Insert a 0 after every five consecutive 1-s • If receiver reads five 1-s, it checks the next bit: • If it is 0, it is ignored • If it is 1, and the next is 0, then it is a flag • If it is 1, and the next is 1, then it is abort flag CO1

  49. Bit Stuffing Before bit stuffing 111111111111011111101111110 1111101111101101111101011111010 After bit stuffing Inserted bits CO1

  50. Address Field • Identifies secondary station that sent or receive frame • Usually 8 bits long with binary 1 in LSB • LSB indicates if the byte is the last byte (binary 1) or not (binary 0) • MSB binary 0: unicast • MSB binary 1: multicast / broadcast Flag Address Control Information FCS Flag 8 bits extendable CO1

More Related