Presentation is loading. Please wait.

Presentation is loading. Please wait.

2.10 Flow and Error Control Before that ...

Similar presentations


Presentation on theme: "2.10 Flow and Error Control Before that ..."— Presentation transcript:

1 2.10 Flow and Error Control Before that ...
BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

2 2.10 Flow and Error Control Flow control
Flow control coordinates the amount of data that can be sent before receiving an acknowledgement. In most protocols used in flow control, the procedures tell the sender how much data it can transmit before it must wait for an acknowledgement from the receiver. The flow of data must not be allowed to overwhelm the receiver. Any receiving device has a limited speed at which it can process the incoming data, and a limited amount of memory in which to store the incoming data. The receiving device must be able to inform the sending device before those limits are reached and request the sender to send fewer frames or stop temporarily. The incoming data must be checked and processed before they can be used, and the rate of such processing is normally slower than the rate of transmission. For this reason, each receiving device has a block of memory, called a buffer, reserved for storing incoming data until they are processed. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

3 2.10 Flow and Error Control Error Control
Error control is both error detection and error correction. Error control allows the receiver to inform the sender of any frames lost or damage in transmission and coordinates the retransmission of those frames by the sender. In the data link layer, the term error control refers to primarily to methods of error detection and retransmission. Any time error is detected, the specified frames are retransmitted – automatic repeat request (ARQ). BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

4 2.10 Flow and Error Control Protocols in Flow and Error Control
The discussion on protocols used in the flow and error control can be divided into 2 categories : for noiseless channel & noisy channel. Protocols in the first categories cannot be used in real life and serve as a basis for understanding the protocols for noisy channels. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

5 2.10 Flow and Error Control Stop-and-Wait ARQ
To detect and correct corrupted frames, redundancy bits are added to the data frame. When the frames arrive at the receiver site, they are checked and if found corrupted, they are silently discarded. So how the sender knows if there were corrupted/lost frames at the receiver ? The sender keeps a copy of the sent frame. At the same time it starts a timer, and if the timer expires and there is no ACK for the sent frame, the frame is resent, the copy is held and the times is restarted. In Stop-and-Wait ARQ, a sequence number is used to number the frames. The sequence numbers are based on modulo-2 arithmetic i.e. 0, 1, 0, 1, 0 ... The acknowledgement numbers always announce the sequence number of the next frame expected by the receiver. Ex : if frame 0 has arrived safe and sound, the receiver sends and ACK frame with acknowledgement 1 (meaning frame 1 is expected next). If frame 1 has arrived safe and sound, the receiver sends and ACK frame with acknowledgement 0 (meaning frame 0 is expected) BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

6 2.10 Flow and Error Control Stop-and-Wait ARQ
BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

7 2.10 Flow and Error Control Ex of Stop-and-Wait ARQ
First, frame 0 is sent and acknowledged. Frame 1 is lost and resent after time out. The resent frame 1 is acknowledge and the timer stops Frame 0 is sent and acknowledge, but the acknowledgement is lost. The sender has no idea if the frame or the acknowledgement is lost, so after the time out, it resends frame 0, which is acknowledged. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

8 2.10 Flow and Error Control Efficiency of Stop-and-Wait ARQ
Ex : Assume that, in a Stop-and-Wait ARQ System, the bandwidth of the line is 1 Mbps, and 1 bit takes 20 ms to make a round trip. What is the bandwidth-delay product ? If the system data frames are 1000 bits in length, what is the utilization percentage of the link ? Answer : The bandwidth delay product is (1 x 106) x (20 x 10-3) = bits The system can send bits during the time it takes for the data to go from the sender to the receiver and then back again. However, the system only sends 1000 bits. It can be said that the link utilization is only 1000/20000, or 5 %. For this reason, for a link with a high bandwidth or long delay, the use of Stop-and-Wait ARQ wastes the capacity of the link. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

9 2.10 Flow and Error Control Go-Back-N ARQ
Use the pipelining technique - a task is begun before the previous task has ended. Multiples frames are already in transmission while waiting for acknowledgement to improve the efficiency of the transmission. Send several frames before receiving acknowledgement to keep the channel busy, and the copy of these frames are kept until the acknowledgement arrive. Go-Back-N ARQ : Sequence Numbers frames from a sending station are numbered sequentially with a limit. If the header of the frame allow m bits for the sequence number, the sequence number range from 0 to 2m – 1. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

10 2.10 Flow and Error Control Go-Back-N ARQ : Sliding Window
The send window is an abstract concept defining an imaginary box of size 2m − 1 with three variables: Sf, Sn, and Ssize. The send window can slide one or more slots when a valid acknowledgment arrives. The send window can slide one or more slots when a valid acknowledgement arrives. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

11 2.10 Flow and Error Control Go-Back-N ARQ : the receive sliding window
The receive window is an abstract concept defining an imaginary box of size 1 with one single variable Rn. The window slides when a correct frame has arrived; sliding occurs one slot at a time. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

12 2.10 Flow and Error Control Go-Back-N ARQ : Timer
Use only one timer for the first outstanding frame. Go-Back-N ARQ : Acknowledgement The receiver sends an acknowledgement if a frame has arrived safe and sound in order. If a frame is damaged or is received out of order, the receiver is silent and will discard all subsequent frames until it receives the one it is expecting The silence of the receiver causes the timer of the unacknowledged frame at the sender site to expire. This causes the sender to go back and resend all frames beginning with the one with the expired timer. The receiver does not have to acknowledge each frame received, it can send one cumulative acknowledgement for several frames. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

13 2.10 Flow and Error Control Go-Back-N ARQ : Resending a frame
When the time expires, the sender resends all outstanding frames. Ex : suppose the sender has already sent up to frame 6, but the timer for frame 3 expired. This means that frame 3 has not been acknowledged; the sender goes back and sends frames 3, 4, 5 and 6 again. That is why the protocol is called Go-Back-N ARQ. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

14 2.10 Flow and Error Control Go-Back-N ARQ : the design
BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

15 2.10 Flow and Error Control Go-Back-N ARQ : Example 1 ex of case where the forward channel is reliable, but the reverse is not. No data frames are lost, but some ACKs are delayed and lost. Request events are triggered by data from network layer, arrival events are triggered by acknowledgement from the physical layer. No time-out event as all outstanding frames are acknowledged before the timer expires. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

16 2.10 Flow and Error Control Go-Back-N ARQ : Example 2
Frames 0,1,2,3 are sent, however frame 1 is lost. The receiver receives frame 2 & 3 but they are discarded due to out of order (expecting frame 1). The sender receives no ACK about frame 1,2 & 3and timer finally expires. The sender then resent frame 1,2 & 3 BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

17 2.10 Flow and Error Control Selective Repeat ARQ
The Go-Back-N ARQ is considered inefficient for a noisy link. In a noisy link, a frame has a higher possibility of damage, which means the resending of multiples frames. The resending uses up the bandwidth and slows down the transmission. In the Selective Repeat ARQ, only the damaged frame is resent – more efficient but more complex processing at the receiver. Selective Repeat ARQ : the windows (sender) BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

18 2.10 Flow and Error Control Selective Repeat ARQ : the windows (receiver) The size of the receive window is the same as the size of the send window. This protocol allows as many frames as the size of the receive window to arrive out of order and be kept there until there is a set of in-order frames to be delivered to the network layer. In the above case, the colored frames are the one that has arrive out of order and waiting for their neighbors to arrive. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

19 2.10 Flow and Error Control Selective Repeat ARQ : the design
BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

20 2.10 Flow and Error Control Selective Repeat ARQ : Ex
Each frame sent or resent need a timer. Ex : timer for frame 0 starts at the 1st request and stops when the ACK for this frame arrives. At the receiver, only after frame 1 is resent, the whole frames 0,1,2,3 are delivered to the network layer. The NAK 1 is sent to inform the sender to resent the frame 1 The ACKs are sent when data are delivered to the network layer. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

21 2.10 Flow and Error Control Piggybacking
The 3 protocols discussed previously are all unidirectional : data frames flow in only one direction. In real life, data frames are normally flowing in both directions : from node A to B and from node B to A. Means that the control information also needs to flow in both directions. A technique called piggybacking is used to improve the efficiency bidirectional protocols. When frames is carrying data from A to B, it can also carry control information about arrive (or lost) frames from B. When frames is carrying data from B to A, it also carry control information about arrive (or lost) frames from A. For the Go-Back-N using piggybacking, each node has two windows : one send window and one receive window. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

22 2.10 Flow and Error Control Piggybacking in Go-Back-N ARQ
BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

23 2.11 Application of Data Flow Control
HDLC (High Level Data Link Control) A bit-oriented protocol for communication over point-to-point and multipoint links. Implements the ARQ mechanisms. HDLC : Configurations & Transfer Modes HDLC provides two common transfer modes that can be used in different configurations : Normal Response Mode (NRM) Asynchronous Balanced Mode (ABM) BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

24 2.11 Application of Data Flow Control
HDLC : Normal Response Mode (NRM) The station configuration is unbalanced. Consist of one primary station and multiple secondary stations. A primary station can send commands; a secondary station can only respond. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

25 2.11 Application of Data Flow Control
HDLC : Asynchronous Balance Mode (ABM) The configuration is balanced. The link is point-to-point, and each station can function as a primary and secondary (acting as peers) To common mode used today. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

26 2.11 Application of Data Flow Control
HDLC : the frames HDLC defines 3 types of frames : Information frames (I-frames) Supervisory frames (S-frames) Unnumbered frames (U-frames) Each type of frame serves as an envelope for the transmission of a different type of message. I-frames : used to transport user data and control information relating to user data (piggybacking). S-frames : used only to transport control information. U-frames : reserved for system management. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

27 2.11 Application of Data Flow Control
HDLC : the fields in the frame Flag field : 8 bit sequence with the bit pattern that identifies both the beginning and the end of a frame and serves as a synchronization pattern for the receiver. Address field : contains the address of the secondary station. Can be 1 byte or several bytes long depending on the needs of the network. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

28 2.11 Application of Data Flow Control
HDLC : the fields in the frame Control field : for flow and error control. Information field : the user’s data from the network layer or management information. FCS field : frame check sequence. (error detection field). BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

29 2.11 Application of Data Flow Control
Ex of HDLC : Connection /Disconnection U-frames can be used for connection establishment and connection release. Node A asks for a connection wit a set asynchronous balanced mode (SABM) frame. Node B gives a positive response with unnumbered acknowledgement (UA) frame. After these 2 exchanges, data can be transferred between the 2 nodes. After data transfer, node A sends a DISC (disconnect) frame to release the connection. It is confirmed by node B responding with UA (unnumbered acknowledgement). BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications

30 2.11 Application of Data Flow Control
Ex of HDLC : Piggybacking w/o error Node A begins with I-frame numbered 0 followed by I-frame numbered 1. Node B piggybacks its acknowledgement of both frames onto an I-frame of its own. Node B’s first I-frame numbered 0 acknowledging the receipt of A’s frames 1 and 0 and indicating that it expect frame 2 to arrive next. Node B transmits its second and third I-frames (numbered 1 & 2) before accepting further frame from A. BENG 4522 Data Communications & Computer Networks Chapter 2 : Data Communications


Download ppt "2.10 Flow and Error Control Before that ..."

Similar presentations


Ads by Google