Lecture.5 Data Link Layer -Flow and Error Control
Lecture.5 Data Link Layer -Flow and Error Control
Lecture 5
Flow and Error Control
• Flow Control
• Flow control refers to a set of procedures used to restrict the amount of data that the
sender can send before waiting for acknowledgment (ACK) from the receiver
• The receiving device should be able to inform the sender before limits (processing speed
limit and temporal storage limits) are reached and request that the sender sends fewer
frames or stop temporarily.
• The rate of processing is often slower than the rate of transmission. The receiver has a
block of memory called buffer, reserved for storing incoming data until they are
processed.
▪ Two method to the flow of data across communication link are Stop-and-wait and
sliding window
Categories of flow control
Stop-and-Wait
Stop-And-Wait
Frame types
▪ Data: Contain information to be sent
▪ ACK: Acknowledges receipt of data
Rules:
▪ Source transmits Data frame
▪ Source waits for ACK frame before sending next Data frame
▪ Destination receives Data frame and replies with ACK frame
if ready for more
▪ Destination can stop flow of data by not sending ACK frame
Stop-And-Wait…..cont
▪ Disadvantage of Stop-and-Wait
Inefficiency: Stop-and-wait is slow. Each frame must travel all the
way to the receiver and the acknowledgement must travel all the
way back before the next frame can be sent
Sliding window
"Go-back-N" Protocols
▪ When errors occur in a continuous ARQ protocol, the simplest
solution is to repeat the frame in error and all subsequent frames,
thus:
How it works
▪ In Go-Back-N ARQ method, both sender and receiver maintain a
window.
▪ The sending-window size enables the sender to send multiple
frames without receiving the acknowledgement of the previous
ones. The receiving-window size enables the receiver to receive
multiple frames and acknowledge them. The receiver keeps track
of incoming frame’s sequence number.
▪ When the sender sends all the frames in window, it checks up to
what sequence number it has received positive acknowledgement.
If all frames are positively acknowledged, the sender sends next set
of frames. If sender finds that it has received NACK or has not
receive any ACK for a particular frame, it retransmits all the
frames after which it does not receive any positive ACK.
Go-back-n, damaged data frame
Go-back-in, lost data frame
Go-back-in, lost ACK
Selective-reject ARQ
Selective Reject
An alternative approach is to only repeat those frames received in
error. This is more complicated and is rarely implemented,
despite having the attraction of apparently greater efficiency.
Problems with selective reject include:
1. Receiver must have storage to save post-NAK frames until the
erroneous frame is received, and logic to re-insert it in the
correct sequence.
2. The sender must be able to send frames out of sequence.
3. The window size for a given size of sequence number is
somewhat less than for go-back-N.
Selective-reject, damage data frame
Medium Access Methods
Medium Access Control
MAC can be divided into two broad categories: Random access and
controlled access. See the figure below
Random Access
The procedure that station use to access the medium with Random
Access method must answer the following Questions:
33
Evolution of Random Access Methods
The first method , known as ALOHA, used a very simple
procedure called Multiple Access (MA). This Method was
improved with addition of procedure that forces the station to
sense the medium before transmitting . This was called Carrier
Sense Multiple Access (CSMA). This method was later evolved
into two parallel methods: CSMA/CD and CSMA/CA
▪ CSMA can reduce the possibility of collision, but can not eliminate it.
37
Collision in CSMA
Vulnerable Time:
39
Persistence Strategies
Two strategies:
Non-persistent Method
Non persistence Method: In the non persistence method, a
station with a frame to send, it senses the medium:
▪ If the medium is idle, it sends immediately
▪ If the medium is not idle it waits a random time and then
sense the medium again
1-Persistent Approach
45
Collision
50
CSMA/CA………cont
51
CSMA/CA Procedure
Controlled Access
53
Token Passing Network
55
Token Passing Procedure