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

4-Data Link

Data Link

Uploaded by

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

4-Data Link

Data Link

Uploaded by

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

Data Communication &

Computer Networks

3. Data Link Control


Data Link Layer
 Responsible for node-
to-node (hop-to-hop)
communication.
 The two main functions
of the data link layer are
 Data link control
 Media access control

RQ 2
Data Link Control
 Deals with the design and procedures
for communication between two
adjacent nodes (node-to-node
communication)
 Data link control functions include
 framing
 flow control
 error control
RQ 3
Framing
 The data link layer packs bits into
frames, so that each frame is
distinguishable from another.
 The data link layer adds a sender
address and a destination address to
the frames.

RQ 4
Framing
 Fixed-size framing
 no need for defining the boundaries of the
frames
 Variable-size framing
 need a way to define the end of the frame
and the beginning of the next frame
 A flag (typically an 8-bit pattern) is used to
define frame boundaries.

RQ 5
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
 Ensuring the sending entity does not
overwhelm the receiving entity
 Preventing buffer overflow (giving ample time
to the processor to process)
RQ 6
Error Control
 Error control in the data link layer is
based on automatic repeat request,
which is the retransmission of data.
 Automatic repeat request (ARQ)
 Error detection (Damaged Frames, Lost Frames)
 Positive acknowledgment

 Negative acknowledgement and

retransmission
 Retransmission after timeout

RQ 7
Model of Frame Transmission

RQ 8
Data Link Control

RQ 9
Noiseless Channel
 Let us assume we have an ideal
channel in which no frames are lost,
duplicated, or corrupted.
 For such a channel we have…
 Simplest Method (no flow control)
 Stop-and-Wait Method (with flow control)
 None of the above have error control as
they are for noiseless (ideal) channel
RQ 10
Simplest Method

RQ 11
Stop-and-Wait
 The sender sends
one frame
 Stops and Waits
until it receives
confirmation from
the receiver
 Then sends the next
frame
 Thus Flow Control
RQ 12
Stop-and-Wait Method

RQ 13
Noisy Channel
 In reality noiseless (error-free)
channels do not exist.
 Therefore, in noisy channel, we need
error control as well.
 Error control in the data link layer is
based on Automatic Repeat Request
(ARQ).

RQ 14
Automatic Repeat Request
(ARQ)
 Stop and wait

 Go back N

 Selective repeat

RQ 15
Stop and Wait ARQ
 It is the simplest flow and error control
mechanism
 Source transmits frame & keeps a copy
 Destination receives frame and replies
with acknowledgement
 Source waits for ACK before sending
next frame

RQ 16
Stop and Wait ARQ
 If received frame damaged, discard it
 Transmitter has timeout
 If no ACK within timeout, retransmit

 Numbering the frames prevents the


retaining of duplicate frames
 ACK number defines the number of next
expected frame
 Use ACK0 and ACK1

RQ 17
Operation of Stop and Wait
 We can have four different situations
in the transmission of a frame:
1. Normal operation
2. Loss of frame
3. Loss of ACK
4. Delay of ACK

RQ 18
1. Normal Operation

RQ 19
2. Lost or damaged frame
 Lost or damaged
frames are
handled in the
same manner (No
ACK)

RQ 20
3. Lost or damaged ACK
 If ACK damaged
transmitter will not
recognize it
 Transmitter will
retransmit
 Receive gets two
copies of frame
 Use ACK0 and
ACK1

RQ 21
4. Delayed ACK

RQ 22
Piggybacking
 In bidirectional transmission both parties keep record
of sent and expected frame numbers
 Piggybacking
saves
bandwidth
(reduces
overheads
like CRC,
addresses,
etc.)

RQ 23
Go-back-N ARQ
 Stop-and-Wait ARQ is simple but inefficient
 To improve efficiency multiple frames should
be in transition while waiting for ACK
 Transmitter can send W frames without ACK
 A copy of each frame is kept until ACK arrives
 Each frame is numbered
 Sequence number bounded by size of field
 If frame header allows m bits for sequence
number, number range will be 0 to 2m - 1

RQ 24
Sender sliding window
 Sender uses a window to hold frames until ACK
 Frames on left of window are acknowledged
 Frames on right can’t be sent until window
slides over

RQ 25
Receiver sliding window
 The size of window at receiver is 1
 The receiver is always waiting for a specific
frame to arrive in a specific order

RQ 26
Go-Back-N Control variables
Sender Variables
 S = recently sent frame  Receiver has only 1
 S =1st frame in window variable R that hold
F
the sequence no. of
 SL=last frame in window the expected frame
W = Size of sliding window
= SL – SF + 1

RQ 27
Go-Back-N Acknowledgment
 If no error, ACK as usual with next
frame expected
 Receiver can send one cumulative
ACK for several frames
 If error,
 Discard that frame and all future frames
until error frame received correctly
 Transmitter must go back and retransmit

that frame and all subsequent frames


RQ 28
Operation of Go-back-N
 We can have four different situations
in the transmission of a frame:
1. Normal operation
2. Loss of frame
3. Loss of ACK
4. Delay of ACK

RQ 29
1. Normal Operation

RQ 30
2. Lost or damaged frame

RQ 31
3. Lost or delayed ACK
 If next ACK arrives before expiration of
any timer then no retransmission
 If next ACK arrives after timeout, the
frame and all later frames will be
retransmitted.

RQ 32
Sender window size

In Go-Back-N ARQ, the size of the


sender window must be less than 2m.

RQ 33
Piggybacking
 Go-back-N ARQ can also be
bidirectional and can also use
piggybacking to improve efficiency
 In such a case, each direction needs
both sender window and a receiver
window

RQ 34
Selective Repeat ARQ
 Go-back-N ARQ
 simplifies the process at receiver site
 very inefficient for a noisy channel
(resending many frames when only one
was damaged)
 Selective Repeat ARQ
 Processing at receiver is complex
 More efficient for noisy links (resends
damaged frames only)
RQ 35
Sender and Receiver windows
 Control variables same as Go-back-N
 Window size at most half of 2m (W <= 2m-1)
 Receiver expects a “range” of frames
 -ve ACK (NAK) reports the sequence number
of the damaged frame

RQ 36
Sender and Receiver windows

RQ 37
Lost frame

RQ 38
Sender window size

RQ 39
Piggybacking
 Selective Repeat ARQ can also be
bidirectional and can also use
piggybacking to improve efficiency
 In such a case, each direction needs
both sender window and a receiver
window

RQ 40
Bandwidth-Delay Product
 Efficiency of an ARQ system can be
measured by the product of bandwidth
(bps) and round-trip delay (sec)
 It is a measure of the number of bits
that can be sent out of a system while
waiting for ACKs

RQ 41
Example
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?
Solution
The bandwidth-delay product is

1  106  20  10-3 = 20,000 bits

The system can send 20,000 bits during the time it takes for the data to
go from the sender to the receiver and then back again. However, the
system sends only 1000 bits. We can say that the link utilization is only
1000/20,000, or 5%. For this reason, for a link with high bandwidth or long
delay,
RQ use of Stop-and-Wait ARQ wastes the capacity of the link. 42
Example
What is the utilization percentage of the link in
the previous example if the link uses Go-Back-
N ARQ with a 15-frame sequence?

Solution
The bandwidth-delay product is still 20,000. The
system can send up to 15 frames or 15,000 bits during
a round trip. This means the utilization is
15,000/20,000, or 75 percent. Of course, if there are
damaged frames, the utilization percentage is much
less because frames have to be resent.
RQ 43
HDLC
 Configurations and Transfer Modes
 Frame Format
 Frame Types
 Examples
 Data Transparency

RQ 44
HDLC
 High-level Data Link Control
 A bit-oriented protocol for
communication over point-to-point and
multipoint links.
 It implements the ARQ mechanisms
discussed before

RQ 45
Configurations & Transfer Modes
1. NRM – Normal Response Mode
 Station configuration is unbalanced

RQ 46
Configurations & Transfer Modes
2. ABM – Asynchronous Balanced Mode
 Station configuration is balanced
 Point-to-point link
 Each station can function as primary and
secondary

RQ 47
Frame Format
 Each frame in HDLC may contain up
to 6 fields

Frame Check Sequence

RQ 48
Frame Format
 Flag Field
 Contains an 8-bit sequence 01111110
 Used to identify beginning and end of a
frame
 Serves as a synchronization pattern for
the receiver
 In multiple frame transmissions, the
ending flag of one frame can serve as the
beginning flag of the next frame
RQ 49
Frame Format
 Address Field
 When primary/secondary configuration is
used, it contains address of the
secondary station
 When primary/secondary configuration is
not used, it contains source and
destination addresses
 All address bytes but the last one end
with 0, only the last byte ends with 1

RQ 50
Frame Format
 Control Field
 1 or 2 bytes for flow and error control
 Information Field
 Contains user data from network layer or
network management information
 FCS Field
 Contains 2 or 4 byte ITU-T CRC

RQ 51
HDLC Frame Types

RQ 52
I-frame (Information)
 Carries user data from network layer
 Can carry flow and error control information
(piggybacking)
 N(S) = the sequence number
 N(R) = the ack number when piggybacking is used

RQ 53
S-frame (Supervisory)
 Used for flow and error control whenever
piggybacking can not be used
 Code field defines whether
 Receive ready (RR)
 Receive not ready (RNR)
 Reject (REJ)
 Selective reject (SREJ)

RQ 54
U-frame (Unnumbered)

RQ 55
U-frame control command and response
Command/response Meaning
SNRM Set normal response mode
SNRME Set normal response mode (extended)
SABM Set asynchronous balanced mode
SABME Set asynchronous balanced mode (extended)
UP Unnumbered poll
UI Unnumbered information
UA Unnumbered acknowledgment
RD Request disconnect
DISC Disconnect
DM Disconnect mode
RIM Request information mode
SIM Set initialization mode
RSET Reset
XID Exchange ID
FRMR Frame reject
RQ 56
Example 1

RQ 57
Example 2
In previous example,
suppose frame 1 sent
from station B to station
A has an error. Station A
informs station B to
resend frames 1 and 2
(the system is using the
Go-Back-N mechanism).
Station A sends a reject
supervisory frame to
announce the error in
frame 1.
RQ 58

You might also like