0% found this document useful (0 votes)
12 views

Data Link

Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Data Link

Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 30

Data Link Control

Protocols

Computer Networks and Data


Communication

A Regional University Transcending Boundaries


Introduction
Because of the possibility of transmission errors, and
because the receiver of data may need to regulate the
rate at which data arrive, synchronization and
interfacing techniques are insufficient by themselves.

It is necessary to impose a layer of control in each


communicating device that provides functions such as
flow control, error detection, and error control.

This layer of control is known as a data link control


protocol.
Data Link Control Protocols
need layer of logic above Physical
to manage exchange of data over a link
– frame synchronization
– flow control
– error control
– addressing
– control and data
– link management
Flow Control
Ensure sending entity does not overwhelm
receiving entity
– by preventing buffer overflow
Influenced by:
– transmission time
• time taken to emit all bits into medium
– propagation time
• time for a bit to traverse/pass through
the link
Model of Frame Transmission
Stop and Wait flow control
It is the simplest form of flow control. It works as
follows
Source transmits frame (no need for seq. #)
Destination receives frame and replies with
acknowledgement (ACK)
Source waits for ACK before sending the next
frame
Destination can stop flow by not sending ACK
It works well for a few large frames
Stop and wait becomes inadequate if large block
of data is split into small frames
Stop and Wait Link Utilization

a>1 the propagation time is less than the transmission time. In this case, the frame is sufficiently long that the
first bits of the frame have arrived at the destination before the source has completed the transmission of the
frame. When a <1, the propagation time is greater than the transmission time. In this case, the sender
completes transmission of the entire frame before the leading bits of that frame arrive at the receiver.
Sliding Windows Flow Control
The problems described so far is that only one frame at a time can
be in transit. And in situations where the bit length of the link is
greater than the frame length (a>1) serious inefficiencies result.
Efficiency can be greatly improved by allowing multiple frames to
be in transit at the same time
allows multiple numbered frames to be in transit
receiver has buffer W long
transmitter sends up to W frames without ACK
ACK includes number of next frame expected
receiver can ack frames without permitting further transmission
(Receive Not Ready)
must send a normal acknowledge to resume
Sliding Window Diagram
3-bit seq. #, Win size = 7
Sliding Window Example
Sliding Window Utilization
Window size W, transmission time = 1, propagation
time = a
Case 1: W >= 2a + 1
– Sender A can transmit continuously with no
pause and normalized throughput is 1.0
Case 2: W < 2a + 1
– Sender A exhausts its window at t = W and
cannot send additional frames until t = 2a + 1.
– Normalized throughput is W / (2a+1)
Error Control
Is the mechanism of detection and correction of errors that occur in
the transmission of frames. Errors such as:
– lost frames; frames fail to arrive to the other side
– damaged frames; a recognizable frame arrives, but some of the bits in the
frame are in error or have been altered during transmission
Techniques for error control are based on the use of the following :
– error detection
– positive acknowledgment; The destination returns a positive
acknowledgment to successfully received, error-free frames
– retransmission after timeout; The source retransmits a frame that has not
been acknowledged after a predetermined amount of time
– negative acknowledgement & retransmission; The destination returns a
negative acknowledgment to frames in which an error is detected. The
source retransmits such frames.
Note: collectively all these mechanisms are all referred to as automatic
repeat request (ARQ)
Automatic Repeat Request (ARQ)
Versions of ARQ include
– stop and wait
– go back N
– selective reject (selective retransmission)
Stop and Wait
It is based on the stop-and wait flow control technique
Source transmits a single frame and then must await an ACK
two sorts of error could occur
1. Received frame damaged, receiver detects this by using an error detection
technique and discards it
• transmitter has timeout
• if no ACK within timeout, retransmit
2. A damaged ACK, transmitter will not recognize it
• transmitter will retransmit
• receive gets two copies of frame
• use alternate numbering and ACK0 / ACK1
Stop and Wait
see example with both
types of errors
pros and cons
– simple
– inefficient
Go Back N
based on sliding window
if no error, ACK as usual
use window to control number of outstanding
frames
if error, reply with rejection
– discard that frame and all future frames until error
frame received correctly
– transmitter must go back and retransmit that frame
and all subsequent frames
Go Back N - Handling
The go-back-N technique takes into account of the
following incidents;
1. Damaged Frame
– error in frame i so receiver rejects frame i
– transmitter retransmits frames from i
2. Lost Frame
– frame i lost and either
• transmitter sends i+1 and receiver gets frame i+1 out of seq
and rejects frame i
• or transmitter times out and send ACK with P bit set which
receiver responds to with ACK i
– transmitter then retransmits frames from i
Go Back N - Handling
3. Damaged Acknowledgement
– receiver gets frame i, sends ACK (i+1) which is lost
– ACK are cumulative, so next ACK (i+n) may arrive before
transmitter times out on frame i
– if transmitter times out, it sends ACK with P bit set
– can be repeated a number of times before a reset
procedure is initiated
4. Damaged Rejection
– reject for damaged frame is lost
– handled as for lost frame when transmitter times out
Selective Reject

also called selective retransmission


only rejected frames are retransmitted
subsequent frames are accepted by the receiver and
buffered
minimizes retransmission
receiver must maintain large enough buffer
more complex logic in transmitter
hence less widely used
useful for satellite links with long propagation delays
Go Back N vs
Selective
Reject
Selective-reject ARQ
Window-size limitation
– E.g. 3 bit sequence number, window size = 7
– Station A sends frames 0 ~ 6 to station B
– Station B receives all seven frames and cumulatively
acknowledges with RR7
– If RR 7 is lost
– A times out and retransmit frame 0 (w/o P-bit timer?
Can P-bit mechanism be used in SR-ARQ?)
High Level Data Link Control
(HDLC)
an important data link control protocol
specified as ISO 33009, ISO 4335
HDLC defines three station types:
– Primary - controls operation of link
– Secondary - under control of primary station
– Combined - issues commands and responses
It also defines two link configurations
– Unbalanced - 1 primary, multiple secondary
– Balanced - 2 combined stations
HDLC also defines three data transfer modes
– Normal Response Mode (NRM)
– Asynchronous balanced mode (ABM)
– Asynchronous response mode (ARM)
HDLC Transfer Modes
Normal Response Mode (NRM)
– Used with an unbalanced configuration.
– The primary may initiate data transfer to a secondary, but a
secondary may only transmit data in response to a command
from the primary.
– used on multi-drop lines, eg host + terminals
Asynchronous Balanced Mode (ABM)
– Used with a balanced config, combined station may initiate
transmission without receiving permission from the other
combined station. ABM is the most widely used of the 3 modes
Asynchronous Response Mode (ARM)
– Used with an unbalanced config, the secondary may initiate
transmit without permission from primary, rarely used
HDLC Frame Structure
synchronous transmission of frames
single frame format used
Fields in the HDLC structure.
Flag Fields; delimit frame at both ends with a unique
pattern 01111110. Receiver hunts for flag sequence to
synchronize on the start of the frame. While receiving
a frame, a station continues to hunt for a sequence to
determine the end of the frame.

Address Field; Defines the address of the secondary


station which is sending the frame or the destination of
the frame sent by the primary station.
Fields in the HDLC structure….
Control field ; Serves to identify the type of the frame. In addition, it
includes sequence numbers, control features and error tracking
according to the frame type.
Frame types include;
– Information frame (I-Frame); The frame is used to transmit end-
user data between two devices.
– Supervisory frame (S-Frame); Performs control functions such
as acknowledgment of frames requests for re-transmission, and
requests for temporary suspension of frames being transmitted.
– Unnumbered frame (U-Frame); Used for control purposes. It is
used to perform link initialization, link disconnection and other
link control functions.
Fields in the HDLC structure….
Information field ; is present only in I-frames and some
U-frames. The information field contains the actually
data the sender is transmitting to the receiver

Frame Check Sequence Field (FCS); This field contains a


16 bit, or 32 bit cyclic redundancy check. It is used for
error detection.
HDLC Operation
HDLC operation consists of exchange of information (I-frames), supervisory (S-
frames) and unnumbered (U-frames) frames between two or more stations
The HDLC involves three phases
– Initialization
• one side or another initializes the data link so that frames may be
exchanged in an orderly fashion. During this phase, the options
that are to be used are agreed upon.
– Data transfer
• the two sides exchange user data and the control information to
exercise flow and error control
– Disconnect
• one of the two sides signals the termination of the operation.
HDLC Operation Example
HDLC Operation Example

You might also like