21
Data link control

Data link control. Data Link Control –Flow Control how much data may sent –Error Control How can error be detected and corrected

Embed Size (px)

Citation preview

Data link control

Data Link Control

• Data Link Control – Flow Control

• how much data may sent

– Error Control • How can error be detected and corrected

Flow Control

• Flow control refers to a set of procedures used to restrict the amount of data the sender can send before wait for the ACK – Stop and Wait

• Send one frame at a time

– Sliding Window• send several frames at a time

Sliding Window• To keep tack of which frame have been transmitted and which received • In the sliding Window method of flow control , the sender can transmit several frames before needing an acknowledgment .• Frames from a sending station are numbered sequentially., • The sequence numbers range from 0 to 2m – 1• where m is the size of the sequence number field in bits.

Error Control

• Refers primarily to methods of error detection and retrasmisstion

• Automatic Repeat Request (ARq)– RETRAMISSION OF DATA IN THREE CASE

• damaged frame • Lost frame • Lost ack

ARQ Protocols

Stop-and-Wait ARQ

• Error correction in Stop-and-Wait ARQ is done by keeping a copy of the sent frame and retransmitting of the frame when the timer expires.

• Sequence Numbers– the protocol specifies that frames need to be numbered.– For example, if we decide that the field is m bits long, the

sequence numbers start from 0, go to 2m - 1, and then are repeated.

• In Stop-and-Wait ARQ: we use sequence numbers to number the frames. The sequence numbers are based on modulo-2 arithmetic.

• In Stop-and-WaitARQ:the acknowledgment number always announces in modulo-2 arithmetic the sequence number of the next frame expected.

Range of sequence numbers(In stop and wait)

• Assume we have used x as a sequence number; we only need to use x + 1 after that. There is no need for x + 2.1. The frame arrives safe and sound at the receiver site; the

receiver sends an acknowledgment. The acknowledgment arrives at the sender site, causing the sender to send the next frame numbered x + 1.

2. If the acknowledgment is corrupted or lost. The sender resends the frame (numbered x) after the time-out. Note that the frame here is a duplicate. The receiver can recognize this fact because it expects frame x + I but frame x was received.

3. The frame is corrupted or never arrives at the receiver site; the sender resends the frame (numbered x) after the time-out.

Example

• Shows an example of Stop-and- Wait ARQ. Frame a is sent and acknowledged. Frame 1 is lost and resent after the time-out. The resent frame 1 is acknowledged and the timer stops. Frame is sent and acknowledged, but the acknowledgment is lost. The sender has no idea if the frame or the acknowledgment is lost, so after the time-out, it resends frame 0, which is

• acknowledged.

Go back N ARQ

• To improve the efficiency of transmission , multiple frames must be in transition while waiting for acknowledgment.

• we keep a copy of these frames until the acknowledgments arrive .

• Sequence Numbers– Frames from a sending station are numbered

sequentially.– If the header of the frame allows m bits for the

sequence number, the sequence numbers range from 0 to 2m - 1

Sliding Window

• The sliding window is an abstract concept that defines the range of sequence numbers that is the concern of the sender and receiver.

• The range which is the concern of the sender is called the send sliding window.

• the range that is the concern of the receiver is called the receive sliding window

• The send window is an abstract concept defining an imaginarybox of size 2m - 1 with three variables: Sf Sn and Ssize

• The receive window is an abstract concept defining an imaginary box of size 1 with one single variable Rn.

• The receive window slideswhen a correct frame has arrived; sliding occurs one slot at a time.

Send Window for Go-Back-N ARQ

Receive window for Go-Back-N ARQ

Selective Repeat Automatic Repeat Request

• In a noisy link a frame has a higher probability of damage, which means the resending of multiple frames.This resending uses up the bandwidth and slows down the transmission.

• There is another mechanism that does not resend N frames when just one frame is damaged; only the damaged frame is resent. This mechanism is called Selective RepeatARQ.