0% found this document useful (0 votes)
4 views70 pages

Ch03-Data Link Layer Protocols

The document outlines the principles and protocols of Data Communication and Networking, focusing on the Data Link Layer, including flow control, error control, and framing techniques. Key topics include the implementation of protocols such as Automatic Repeat Request (ARQ) and the differences between Idle RQ and Continuous RQ methods for data transmission. It also discusses the implications of error handling and link utilization in various scenarios, providing a comprehensive overview of data link layer operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views70 pages

Ch03-Data Link Layer Protocols

The document outlines the principles and protocols of Data Communication and Networking, focusing on the Data Link Layer, including flow control, error control, and framing techniques. Key topics include the implementation of protocols such as Automatic Repeat Request (ARQ) and the differences between Idle RQ and Continuous RQ methods for data transmission. It also discusses the implications of error handling and link utilization in various scenarios, providing a comprehensive overview of data link layer operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 70

Data Communication and Networking 3-Mar-25

Data Communication and


Networking

Dept. of Telecoms Engineering 1


Data Communication and Networking 3-Mar-25

Content
❑Chapter 3: Data Link Layer Protocols
❖Flow Control
❖Error Control
❖Connection Management
❖Data Link Protocols
❑Chapter 4: Telecommunication Networks
❖802.x standard and TCP/IP Model
❖Ethernet, Token Pass, Token Ring
❖IP Addressing: Classfull and VLSM
❖Network devices
❖Switching and Routing
❖STP, VLAN

Dept. of Telecoms Engineering 2


Data Communication and Networking 3-Mar-25

Framing
❑The data link layer needs to pack bits into frames, so
that each frame is distinguishable from another.
❖Fixed-Size Framing
❖Variable-Size Framing

Dept. of Telecoms Engineering 3


Data Communication and Networking 3-Mar-25

Flow and Error Control


❑The most important responsibilities of the data link
layer are flow control and error control. Collectively,
these functions are known as data link 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.
❖Error control in the data link layer is based on Automatic
Repeat Request (ARQ), which is the retransmission of data.
❑ Now let us see how the data link layer can combine framing,
flow control, and error control to achieve the delivery of data
from one node to another. The protocols are normally
implemented in software by using one of the common
programming languages.

Dept. of Telecoms Engineering 4


Data Communication and Networking 3-Mar-25

Error Control
❑Forward Error Control (FEC)
❖Usually used in real-time application (e.g. voice, video)
❖Accept errors if can not correct
❖List some FEC methods? (e.g. BSC, Hamming)
❑Error Detection + ARQ (Automatic Retransmission Request)
❖Require absolutely correct data transmission
❖Used in non real-time application (e.g. email, file
transmission)
❖2 basic ARQ protocols:
• Stop-and-Wait (Idle) ARQ: Bisync (IBM), XModem
• Continuous RQ:
– Go-back N: e.g. HDLC, V.42
– Selective-Repeat: TCP, Service Specific Connection Oriented
Protocol

Dept. of Telecoms Engineering 5


Data Communication and Networking 3-Mar-25

Notations
I -frame
P S
ACK frame or NAK frame

❑ P: Primary, sending data frames


❑ S: Secondary, receiving data frames and sending ACK back to
Primary
❑ I frame: data/Information frame
❑ I(N): Data frame with sequence N
❑ ACK (Acknowledge) frame: response/reply sent from S back to
P, confirm receiving a good I-frame
❑ NAK (Negative Acknowledge) frame: response/reply sent from
S back to P, confirm receiving a corrupted I-frame (error
frame)

Dept. of Telecoms Engineering 6


Data Communication and Networking 3-Mar-25

Idle RQ
❑ Principle:
❖ P can have only 1 I-frame
outstanding (awaiting for
an ACK) at a time
❖ On receipt of an error-free
ACK frame, P transmits
another I-frame
❖ If S receives an I-frame or
P receives an ACK
containing transmission
error: the frame is
discarded
❖ If P does not receive an
ACK within a given timeout
interval: retransmits the
waiting I-frame
❖ If an ACK is corrupted, the
S receives another copy of
the frame and it is rejected
by S.

Dept. of Telecoms Engineering 7


Data Communication and Networking 3-Mar-25

Idle RQ
❑ Implicit retransmission
❖ P has to wait a timeout
interval before retransmission
❖ What is the drawback of this
mechanism? How to improve
❑ Explicit retransmission
❖ If S receives a corrupted I-
frame: return an NAK to P
❖ If P receives an ACK, stop the
timer, and transmit the next
frame.
❖ If P receives a NAK, retransmit
the I-frame
❖ If P does not receives ACK or
NAK during a timeout interval,
do the retransmission by timer

Dept. of Telecoms Engineering 8


Data Communication and Networking 3-Mar-25

Idle RQ
❑Advantages :
❖Send and Wait (Stop and Wait)
❖Small buffers: both P and S
keeps only 1 frame
❑Disadvantages:
❖Low link utilization
❖Used in transmission of
printable characters
❖Half-duplex applications
❑Notation:
❖N(S): send sequence number
❖N(R): receive sequence
number

Dept. of Telecoms Engineering 9


Data Communication and Networking 3-Mar-25

Idle-RQ
❑ Link utilization:

❑ In case BER=0:
Tix Tix 1 1
U=  = =
Tt Tix +2Tp 1+2Tp /Tix 1+2a

❑ What is the meaning of parameter a?

Dept. of Telecoms Engineering 10


Data Communication and Networking 3-Mar-25

Idle-RQ
❑ Remember:
Tp
a= (length of the link in bits)
Tix
▪ If a < 1 (i.e. Tix > Tp ): when
1st transmitted bit reaches S,
P will still be transmitting.
Hence U is close 100%
▪ If a > 1 (i.e. Tix < Tp) frame
transmission is completed
before 1st bit reaches S.
Hence U is low.
a>1 a<1
❑ Idle-RQ is efficient for links
where a << 1 (long frames
compared to propagation
time)

Dept. of Telecoms Engineering 11


Data Communication and Networking 3-Mar-25

Idle-RQ
❑ In case BER>0 (channel with errors): in order to transmit 1 I-
frame successfully, sender needs to retransmit Nr frames:
Tix Tix 1 1
U= = = =
Nr .Tt Nr (Tix +2Tp ) Nr (1+2Tp /Tix ) Nr (1+2a)
❑ If we call Pf is the FER, and 1 frame has Ni bits:
Pf =1-(1-BER)Ni
❑ Probability that i transmission are needed to deliver frame
successfully ( i-1 transmission in error and the ith transmission is
error free ):

E[# of transmission in error]= (i-1).Pr [ # of trans. in error = i-1]
i=1
 
Pf
=  (i-1).P .(1-Pf ) = (1-Pf ).Pf  (i-1).P =
f
i-1
f
i-2

i=1 i=1 1-Pf

Dept. of Telecoms Engineering 12


Data Communication and Networking 3-Mar-25

Idle-RQ
❑ Number of transmissions:
Pf 1
Nr =1+ =
1-Pf 1-Pf
❑ Utilization:
1-Pf
U=
(1+2a)
❑ Total average delay per frame if using Implicit scheme?s
❑ Utilization Performance when working with high speed and long
propagation delay?

Tt

Dept. of Telecoms Engineering 13


Data Communication and Networking 3-Mar-25

Idle-RQ: Example
❑A series of 1000-bit frames is to be transmitted using
an idle RQ protocol. Determine the link utilization for
the following types of data link assuming a data
transmission rate of (i) 1 kbps and (ii) 1 Mbps. The
velocity of propagation of the link is 2.108 m/s and
the BER is negligible
❖A twisted pair cable 1 km in length
❖A leased line 200 km in length
❖A satellite link of 50,000 km
❑Solution?

Dept. of Telecoms Engineering 14


Data Communication and Networking 3-Mar-25

Idle-RQ: Communication
❑Usually, Idle-RQ is used in
unidirectional communication.
❑If using bidirectional
communication?
❖Both sender and receiver have to
send and acknowledge data
❑Piggy back methods:
❖outstanding ACKs are placed in the
header of information frames
❖save bandwidth since the overhead
from a data frame and an ACK
frame (addresses, CRC, etc) can be
combined into just one frame

Dept. of Telecoms Engineering 15


Data Communication and Networking 3-Mar-25

Continuous RQ
❑ Continuous RQ improves the link utilization at the expense of
increased buffer storage requirements.
❑ Principle:
❖ P sends I-frames continuously without waiting for an ACK to be returned
❖ Since more than 1 I-frames is waiting ACK, P retains a copy of each I-frame
transmitted in a retransmission list (using FIFO)
❖ S returns an ACK for each correctly received I-frame
❖ Each I-frame contains a unique identifier which is returned is the
corresponding ACK-frame
❖ On receipt of an ACK, the corresponding I-frame is removed from the
retransmission list by P
❖ Frames received free of errors are placed in the link receive list to wait
processing
❖ On receipt of the next in-sequence I-frame expected, S delivers the
information content within the frame to the upper layer
❖ In the event of frames being received out of sequence, S retains these in
the link receive list until the next in-sequence frame is received.

Dept. of Telecoms Engineering 16


Data Communication and Networking 3-Mar-25

Continuous RQ

Dept. of Telecoms Engineering 17


Data Communication and Networking 3-Mar-25

Continuous RQ
❑In the absent of errors, the link utilization of
continuous RQ is approximately 100%
❑In all continuous RQ schemes, corrupt frames are
discarded and retransmission requested only after
the next error-free frame.
❑When errors occur:
❖S detects and requests the retransmission of just those
frames in the sequence that are corrupted: Selective
Repeat
❖S detects the receipt of an out-of-sequence I-frame and
requests P to retransmit all outstanding unacknowledged I-
frames from the last correctly received: Go-back-N

Dept. of Telecoms Engineering 18


Data Communication and Networking 3-Mar-25

Continuous RQ
❑Selective Repeat: can be implemented in 2 ways:
❖S acknowledges correctly received frames and P
determines from the sequence of ACK-frames received
that a frame has been lost: implicit retransmission
❖Or S returns NAK for a frame that is missing from the
sequence: explicit request

Dept. of Telecoms Engineering 19


Data Communication and Networking 3-Mar-25

Continuous RQ
❑ Selective Repeat: implicit retransmission, I-frame is corrupted
❖ Assume I-frame N+1 is corrupted
❖ S returns a ACK for each correctly received I-frame as before
❖ S returns ACK-frame for I-frames N,N+2,N+3,…
❖ On receipt of ACK for I-frame N+2, P detects that frame N+1 has not
been acknowledged
❖ To allow for the possibility of more than one I-frame being corrupted,
on detecting an unacknowledged frame P enter the retransmission
state.
❖ When in this state, the transmission of the new frames is suspended
until all unacknowledged frames have been retransmitted
❖ P removes I-frame N+2 from the retransmission list and retransmits I-
frame N+1 before transmitting frame N+5
❖ On receipt of I-frame N+1, the contents of the queued frames in the link
receive list are delivered by S

Dept. of Telecoms Engineering 20


Data Communication and Networking 3-Mar-25

Continuous RQ
❑ Selective Repeat:
implicit retransmission
❖ Corrupted I-frame

Dept. of Telecoms Engineering 21


Data Communication and Networking 3-Mar-25

Continuous RQ
❑Selective Repeat: implicit retransmission, ACK(N) is
corrupted
❖On receipt of ACK-frame N+1, P detects that I-frame N is
still awaiting acknowledged and hence retransmits it
❖On receipt of the retransmitted I-frame N, S determines
from its receive sequence variable that this has already
been received correctly and is therefore a duplicate
❖S discards the frame but returns an ACK for it to ensure P
removes the frame from the retransmission list.

Dept. of Telecoms Engineering 22


Data Communication and Networking 3-Mar-25

Continuous RQ
❑ Selective Repeat:
implicit retransmission
❖ Corrupted ACK-frame

Dept. of Telecoms Engineering 23


Data Communication and Networking 3-Mar-25

Continuous RQ
❑Selective Repeat: explicit retransmission
❖ Use an explicit NAK to request for a specific frame to be retransmitted.
The NAK-frame is also known as selective reject.
❑Principle:
❖ An ACK acknowledges all frames in the retransmission list up to and
including the I-frame with the sequence number the ACK contains
❖ Assume I-frame N+1 is corrupted
❖ S returns an ACK for I-frame N
❖ When S receives I-frame N+2 it detects I-frame N+1 is missing and hence
returns a NAK containing the identifier of the missing I-frame N+1
❖ On receipt of NAK N+1, P interprets this as S is still awaiting I-frame N+1
and hence retransmits it
❖ When S returns a NAK, it enters the retransmission state
❖ When in the retransmission state, the return of ACK-frames is suspended.

Dept. of Telecoms Engineering 24


Data Communication and Networking 3-Mar-25

Continuous RQ
❑ Principle:
❖ On receipt of I-frame N+1,
S leaves the retransmission
state and resumes
returning ACK-frames.
❖ ACK N+4 acknowledges all
frames up to including
frame N+4
❖ A timer is used with each
NAK to ensure that if it is
corrupted (and hence
frame N+1 is not received),
it is retransmitted
❑ Selective Repeat: explicit
request:
❖ Correct Operation

Dept. of Telecoms Engineering 25


Data Communication and Networking 3-Mar-25

Continuous RQ
❑ Effect of NO retransmission
state:
❖ Assume I-frame N+1 is again
corrupted
❖ S returns NAK N+1 but this
time it is corrupted
❖ On receipt of ACK N+3, this
would acknowledges all
frames including I-frame
N+1 and hence this frame
will not be retransmitted
❖ I-frame N+1 would be lost
❖ Although S receives a
correct copy of each frame
sent by P, the order of
reception is not maintained
(S receives frames
N+2,N+3,N+4 and N+1)

Dept. of Telecoms Engineering 26


Data Communication and Networking 3-Mar-25

Continuous RQ
❑ Selective Repeat is used primarily when either the frames
being transmitted are self-contained entities (the order is not
important)
❑ In many application, frames must be delivered in order. Hence,
Selective Repeat requires large buffer for storing ordered
frames

Dept. of Telecoms Engineering 27


Data Communication and Networking 3-Mar-25

Continuous RQ
❑ Go-back-N: the secondary detects an out-of-order sequence frame, it informs
the primary to start to retransmit frames from a specified frame number. It
does this be returning a special NAK frame known as a reject.
❑ Principle:
❖ Assume I-frame N+1 is corrupted
❖ S receives I-frame N+2 out of sequence
❖ On receipt of I-frame N+2, S returns NAK N+1 informing P to go back and
start retransmit from I-frame N+1
❖ On receipt of NAK N+1, P enters the retransmission state
❖ When in this state, it suspends sending new frames and starts to retransmit
the frames waiting acknowledgement in the retransmission list
❖ S discards frames until it receives I-frame N+1
❖ On receipt of I-frame N+1, S resumes accepting frames and returning
acknowledgements
❖ A timeout is applied to NAK frames by S and a second NAK is returned if
the correct in-sequence I-frame is not received in the timeout interval

Dept. of Telecoms Engineering 28


Data Communication and Networking 3-Mar-25

Continuous RQ
❑ Go-back-N:
❖ I-frame
corrupted

Dept. of Telecoms Engineering 29


Data Communication and Networking 3-Mar-25

Continuous RQ
❑ Go-back-N:
❖ Corrupted ACK
❑ Principle:
❖S receives each transmitted I-
frame correctly
❖Assume ACK-frames N and N+1
are both corrupted
❖On receipt of ACK N+2, P detects
that there are 2 outstanding I-
frames in the retransmission list
(N and N+1)
❖Since it is an ACK rather than
NAK, P assumes that the 2 ACKs
for I-frames N and N+1 have both
been corrupted and hence
accepts ACK-frame N+2 also as
an acknowledgement for the
outstanding frames

Dept. of Telecoms Engineering 30


Data Communication and Networking 3-Mar-25

Continuous RQ
❑ Link Utilization:
❖ In general, the link utilization U for a send window K:
• If K  1+2a :
U=1
• If K  1+2a :
K.Tix K.Tix K
U= = =
Tt (Tix +2Tp ) (1+2a)

❖ Using Selective Repeat: impact by choosing K


• If K  1+2a :
U = 1-Pf
• If K  1+2a :
K.Tix K.Tix K.(1-Pf )
U= = =
Nr .Tt Nr .(Tix +2Tp ) (1+2a)

Dept. of Telecoms Engineering 31


Data Communication and Networking 3-Mar-25

Continuous RQ
❑ Link Utilization:
❖ Using Go-back-N: impact by choosing K
• If K  1+2a:
(1+2a).(1-Pf ) 1-Pf
U= =
(1+2a).(1+Pf (K-1)) 1+Pf (K-1)
• If K  1+2a:
K.(1-Pf ) K.(1-Pf )
U= =
(1+2a)+(1+2a).Pf .(K-1) (1+2a).(1+Pf (K-1))

Dept. of Telecoms Engineering 32


Data Communication and Networking 3-Mar-25

Example of sliding window: perfect link


❑ A series of 1000-bit frames is to be transmitted using a
continuous RQ protocol. Determine the link efficiency for
the following type of data link if the velocity of
propagation is 2.108 m/s and the bit error rates of the
links are all negligibly low:
❖A 1 km link of 1 Mbps and a send window K = 2
❖A 10 km link of 200 Mbps and a send window K=7
❖A 50 000 km satellite link of 2 Mbps, a send window K
=127

❑ Solution?

Dept. of Telecoms Engineering 33


Data Communication and Networking 3-Mar-25

Example of link utilization: lossy link


❑A series of 1000-bit frames is to be transmitted
across a data link 100 km in length at 20 Mbps. If the
link has a velocity of propagation is 2.108 m/s and a
BER of 4.10-5, determine the link utilization using the
following protocols:
❖Idle RQ
❖Selective Repeat and a send window of 10
❖Go-back-N and a send window of 10

❑Solution?

Dept. of Telecoms Engineering 34


Data Communication and Networking 3-Mar-25

Timeout
❑ Timeout mechanism:
❖A separate timer is started each time I-frame is transmitted
by P, and is stopped when an ACK indicating its correct
receipt is received
❖If an ACK for an I-frame is not received before it timeout
interval expires, the frame is retransmitted
❖The timeout interval must be greater than the worst-case
propagation delay between transmitting a frame and
receiving the associated ACK
❖S may receive multiple copies due to corrupted ACK-frames
• With Go-back-N: this is not the problem. The N(S) in the duplicate
frames will not equal to the current V(R) held by S and will be
discarded
• With Selective Repeat: S retains a ordered list of the last N correctly
received I-frames. In this way, S can check if a received frame is a
duplicate of an already correctly received frame or a new frame.

Dept. of Telecoms Engineering 35


Data Communication and Networking 3-Mar-25

Timeout

Dept. of Telecoms Engineering 36


Data Communication and Networking 3-Mar-25

Flow control
❑ Control the data transmission rates of characters or
frames on a link so that the receiver always has
sufficient buffer storage resources to accept them prior
to processing
❑ Two kinds: X-ON/X-OFF and Sliding Window
❑ X-ON/X-OFF:
❖When the receive buffer at S is overflowed, S sends X-OFF
back to P, P stops the data transmission
❖When S escape the overload state, it will return X-ON to P
to inform its ready state for receiving data. P will continue
to transmit data to S
❖For example: in RS232, CTS/RST pins are used for flow
control

Dept. of Telecoms Engineering 37


Data Communication and Networking 3-Mar-25

Flow control
❑ Sliding window:
❖ Send window size
(K): define the
maximum number
of frames can be
transmitted
❖ Has UWE and LWE
to control the
window length
❖ Receive window: the
maximum number
of frame buffers
required at S

Dept. of Telecoms Engineering 38


Data Communication and Networking 3-Mar-25

Sequence Number
❑ All previous example: assuming that the next frame sequence
is simply equal to the last sequence + 1: sequence number go
to infinitive
❑ Need to define the maximum limit on the number of I-frames
being transferred across a link: limit the size of the link
retransmission and receive list, and limit the range of
sequence numbers to define frames uniquely
❖ Idle RQ: both send and receive window are 1. Hence 2 identifiers are
required to allow S to determine the last I-frame and the new I-frame.
❖ Go-back-N: send window is K: the identifier must be K+1.
❖ Selective Repeat: send and receive windows are K. Hence the
identifiers must not be less than 2K

Dept. of Telecoms Engineering 39


Data Communication and Networking 3-Mar-25

Sequence Number
❑ The send window is 3
❑ P sends full of window: 3
I-frames
❑ 3 ACKs returned by S are
all corrupted
❑ P times-out each I-frame
and retransmits them
❑ S discards each duplicate
I-frame and returns a NAK
indicating I(3) is the next
frame
❑ Since the sequence
number in the NAK is
equal to V(S), P takes this
as an acknowledgement
for the 3 waiting frames,
therefore reopening the
windows

Dept. of Telecoms Engineering 40


Data Communication and Networking 3-Mar-25

Sequence Number
❑ In practice, since the
identifier of a frame is in
binary form, a set number of
binary digits must be
reserved for its use.
❑ For example, with a send
window of 3 and Go-back-N is
used, 2 binary digits are
required for the send and
receive sequence numbers
yielding 8 possible identifiers:
0..7. The send and receive
sequence variables are then
incremented modulo-8 by P
and S, respectively

Dept. of Telecoms Engineering 41


Data Communication and Networking 3-Mar-25

Sequence Number
lower
Window size = 7 window
edge upper
window
7 0 0 edge
7 7 0
6 1 6 1 6 1
5 2 5 2
tx 1 frame tx 1 frame 5 2
4 3 4 3 4 3

tx 1 frame

7 0 7 0
tx 1 frame 7 0
6 1 6 1 6 1
5 2 5 2
receive ACK0 5 2
4 3 4 3 4 3
max window size
max window size can’t transmit
can’t transmit

Dept. of Telecoms Engineering 42


Data Communication and Networking 3-Mar-25

Connection Management

Dept. of Telecoms Engineering 43


Data Communication and Networking 3-Mar-25

Data Link Control Protocols


❑ The data link control layer is concerned with the transfer of data
over a serial data link.
❑ The link can be:
❖ point-to-point physical circuit (twisted-pair wire, coaxial cable or optical
fiber),
❖ radio-based channel (satellite, or logical channels over physical circuits)
❑ Transmission mode can be asynchronous or synchronous
❑ Service offered by data link:
❖ Connectionless service
❖ Connection-oriented
❑ Data link Control Protocols provides:
❖ Flow control
❖ Error control

Dept. of Telecoms Engineering 44


Data Communication and Networking 3-Mar-25

Data Link Protocol Application


DTE DTE DTE: Data Terminal Equipment
DLP: Data Link Protocol
DCE: Data Circuit Terminating Equipment
DLP
: Communication Subsystem

DTE DCE DCE DTE


PSTN
Modem Modem

DLP

Dept. of Telecoms Engineering 45


Data Communication and Networking 3-Mar-25

Data Link Protocol Application


DTE Master

DLP

DTE DTE DTE DTE

DTE DTE DTE

Share bus
DLP

DTE DTE DTE DTE

Dept. of Telecoms Engineering 46


Data Communication and Networking 3-Mar-25

Protocol Classification
❑ Character-oriented Protocols:
❖ Asynchronous transmission
• XMODEM, YMODEM
• Simplex Protocol: Kermit protocol
❖ Synchronous transmission:
• Half-duplex protocol: BSC
• Full-duplex protocol: APRANET IMP-to-IMP protocol
❑ Bit-oriented Protocols
❖ High-level Data Link Control: single link procedure
❖ Link access procedure version B (LAPB): extension of LAPA, used in
X.25 networks
❖ Multilink procedure: extension of LAPB
❖ Link access procedure for modems (LAPM): used in error correction
modems (e.g. V32)
❖ Link access procedure for D-channel (LAPD): used in ISDN networks

Dept. of Telecoms Engineering 47


Data Communication and Networking 3-Mar-25

Binary Synchronous Communication


❑BSC Protocol:
❖Character-oriented
❖Error control: Idle RQ
❖Synchronous transmission control
❖Connection-oriented
❖Half-duplex
❖Topology: Point-to-point, Multipoint, Multi-drop network
❖Data transparency: using DLE character to transmit pure
binary data (DLE/STX, DLE/ETX)
❑Frame formats
❖Data frame
❖Supervisory

Dept. of Telecoms Engineering 48


Data Communication and Networking 3-Mar-25

BSC Control Characters

Dept. of Telecoms Engineering 49


Data Communication and Networking 3-Mar-25

Binary Synchronous Communication


❑Data frame:
Simple frame
SYN SYN STX Data (128bytes) ETX BCC

Simple frame
with header SYN SYN SOH Header Data (128bytes) ETX BCC

Multi-block SYN SYN SOH Header STX Data IBT BCC STX Data ETX ETX
BCC
frame
Data block

Frame First frame


SYN SYN SOH Header STX Data ETB BCC
structure of
Multi-frame
Last frame
SYN SYN SOH Header STX Data ETX BCC

SOH – Start of Header STX – Start of Text ETX – End of Text


BCC – Block (sum) Check Character ETB – End of Tranmission Block

Dept. of Telecoms Engineering 50


Data Communication and Networking 3-Mar-25

Binary Synchronous Communication


❑ Supervisory frame: the
ACK and NAK control
characters have 2
functions:
❖ As an acknowledgement:
one or other is returned to
a previously transmitted
data block and hence
contains an sequence
number.
❖ AS a response to a select
control message: an ACK
indicates that the selected
station is able to receive a
data block whereas a NAK
indicates that it is not

Dept. of Telecoms Engineering 51


Data Communication and Networking 3-Mar-25

Binary Synchronous Communication


❑ Supervisory frame:
❖The ENQ control character is used in both Poll and Select
control frames. The address of the polled or selected slave
station is followed by either a P (for Poll) or an S( for Select)
character, which is in turn followed by the ENQ character
❖The EOT control character has 2 functions:
• To signal the end of a complete message exchange
sequence and clear the logical link between the 2
communicating parties
• To provides a means of resetting the link to the idle state

Dept. of Telecoms Engineering 52


Data Communication and Networking 3-Mar-25

Binary Synchronous Communication


❑ Protocol operation:
❖ Poll and Select schematic

❑ Select operation
❖ Master sends data to a specific slave
❖ Put the slave address in the Select control
frame
❖ If the Slave is unready: reply by NAK.
Otherwise, return ACK

Dept. of Telecoms Engineering 53


Data Communication and Networking 3-Mar-25

Binary Synchronous Communication


❑ Polling mechanism:

❑ Protocol performance:
❖ Low link utilization (Idle RQ),
used with multi-drop links,
operating at data rates up to
64 kbps
❖ Average time to poll each
station:
Tmin
Tavr =
1-Mr .Tix
❖ Tmin: the minimum time to poll
all stations, Mr is the average
rate at which messages are
generated

Dept. of Telecoms Engineering 54


Data Communication and Networking 3-Mar-25

Example
❑ A BSC protocol is to be used to control the flow of messages between a
computer (Master station) and 10 block-mode terminals (secondaries) over
a multipoint data link. The link data rate, R, is 10 kbps and the average
length of a message, Ni, is 1000 bits. If a poll message and its associated ACK
is 30 bits and the total time to process these messages is 1ms, determine
the average time each terminal will be polled if the average rate at which
messages are generated is:
❖ 1 message per minute
❖ 6 message per second
The bit error rate and signal propagation delay times of the link can be assumed
to be negligible
❑ Solution:
❖ Tix=100ms
❖ Time to transmit a poll and its ACK: 30/104=3 ms
❖ Time to poll a single secondary: 3 + 1 = 4 ms
❖ Minimum time to poll all secondaries: Tmin=10x4 = 40 ms
❖ Mr = 1 msg/minute = 10-3/60 msg/ms: Tavr=40 ms

Dept. of Telecoms Engineering 55


Data Communication and Networking 3-Mar-25

HDLC
❑ High-level Data Link Control (HDLC) is a
bit-oriented protocol for communication
over point-to-point and multipoint links.
❑ Support full-duplex, transparent mode
operation
❑ Variations: LAPB, LAPD, LAPM
❑ Used in Frame Relay, PPP
❑ Primary station
❖ Control the operation of the data link
❖ Send the command frames
❑ Secondary station
❖ Controlled by Primary station
❖ Send the response frames
❑ Combined station (Both Primary and
Secondary)
❖ Can send commands or responses

Dept. of Telecoms Engineering 56


Data Communication and Networking 3-Mar-25

HDLC
❑ Operational modes:
❖ Normal Response Mode (NRM)
• Used in unbalanced configuration
• Slave stations (secondaries) can transmit only when specially instructed
by the master (primary) station.
• The link may be point-to-point, multipoint (only 1 primary allowed)
❖ Asynchronous Response Mode (ARM)
• Used in unbalanced configuration
• Allow a secondary to initiate a transmission without receiving
permission from the primary
• Normally used in point-to-point configuration and duplex links
❖ Asynchronous Balanced Mode (ABM)
• Mainly used on duplex point-to-point links
• Each station has an equal status and performs both primary and
secondary functions

Dept. of Telecoms Engineering 57


Data Communication and Networking 3-Mar-25

HDLC
❑ Frame formats: both data and control messages are carried in a standard format
frame.

❑ Flag Field (0x7E):


❖ determine the beginning and the end of a frame
❖ Receiver must hunt this value for synchronization
❖ Bit stuffing if there is a 5 continuous bits “1”
❖ If receiver detects 5 continuous bits “1”:
• If the next bit is bit 0, it will be removed
• If the next bit is bit 1, and 7th bit is bit 0: Flag
• If the next bit is bit 1, and 7th bit is bit 1: continue to count number of bits 1
– If number of bits 1<15: receiver stops
– If number of bits 1>=15: idle channel

Dept. of Telecoms Engineering 58


Data Communication and Networking 3-Mar-25

HDLC
❑ Address Field:
❖Depending on operational mode. In NRM mode, multi-drop line: each
station has 1 unique address. If the primary wants to connect with the
slave, it will put the slave address in this address field. Certain
addresses known as group address can be assigned to more than one
secondary. If the address is all bits 1: broadcast address.
❖Not used in ABM mode (point-to-point). Instead, it is used to indicate
the direction of commands and their associated responses
❖8 bit in length, can be expanded with multiple of 7 bits. Last octet will
have the first bit equal to 1

Dept. of Telecoms Engineering 59


Data Communication and Networking 3-Mar-25

HDLC
❑Control field: There are 3 frame types in HDLC:
❖ Unnumbered frames (U—frame): used for such functions as link setup
and disconnection. They do not contain any acknowledgement
information
❖ Information frame (I-frame): carry the actual information. I-frames can
be used to piggyback acknowledgement information if the operational
mode is ABM or ARM
❖ Supervisory frame (S-frame): are used for error and flow control and
hence contain send and receive sequence numbers

Dept. of Telecoms Engineering 60


Data Communication and Networking 3-Mar-25

HDLC
❑ Control field:
❖1 byte or 2 bytes in length
❖1 or 2 first bits define the frame type (S,I,U)
❖N(S): send sequence number
❖N(R): receive sequence number
❖P/F: Poll or Select depending on the context:
• Command: bit P, request the response from a secondary
• Response: bit F, indicating this is the response to a command

o Primary to Secondary: If
P=1, address is destination
00
o Secondary to Primary: If 10
F=1, address is source 01
11

Dept. of Telecoms Engineering 61


Data Communication and Networking 3-Mar-25

HDLC

Dept. of Telecoms Engineering 62


Data Communication and Networking 3-Mar-25

HDLC
❑Extended control bit field definitions

Dept. of Telecoms Engineering 63


Data Communication and Networking 3-Mar-25

HDLC
❑Information field:
❖Contained in I-frame and U-frame
❖Variable length
❖Multiple of bytes
❑FCS field:
❖Error detection
❖CRC 16 or CRC32

Dept. of Telecoms Engineering 64


Data Communication and Networking 3-Mar-25

HDLC
❑Link Management
❖Setup connection
❖Disconnection

Dept. of Telecoms Engineering 65


Data Communication and Networking 3-Mar-25

HDLC
❑ Data transfer:
❖ V(S) indicates the next
send sequence
number N(S), which is
allocated to an I-frame
transmitted by that
station
❖ V(R) is the send
sequence number of
the next in-sequence
I-frame expected by
that station
❖ At receiver, if N(S)=
V(R): receive correct
sequenced frame
❖ Bit P means: this
frame needs an
response from the
receiver (by bit F) a. with RR frames only and Go-back-N strategy

Dept. of Telecoms Engineering 66


Data Communication and Networking 3-Mar-25

HDLC
❑ Data transfer:
❖ Negative
Acknowledgement
❖ Go-back-N
❖ Using REJ/RR

b. with NAK frames and Go-back-N strategy

Dept. of Telecoms Engineering 67


Data Communication and Networking 3-Mar-25

HDLC
❑ Piggyback without errors:
❖ Example: an exchange using piggybacking. Node A
begins the exchange of information with an
I-frame 0 followed by another I-frame 1.
❖ Node B piggybacks its acknowledgment of both
frames onto an I-frame of its own. Node B’s first I-
frame is also numbered 0 [N(S) field] and contains a 2
in its N(R) field, acknowledging the receipt of A’s
frames 1 and 0 and indicating that it expects frame 2
to arrive next. Node B transmits its second and third I-
frames (numbered 1 and 2) before accepting further
frames from node A. Its N(R) information, therefore,
has not changed: B frames 1 and 2 indicate that node
B is still expecting A’s frame 2 to arrive next. Node A
has sent all its data. Therefore, it cannot piggyback an
acknowledgment onto an I-frame and sends an S-
frame instead. The RR code indicates that A is still
ready to receive. The number 3 in the N(R) field tells
B that frames 0, 1, and 2 have all been accepted and
that A is now expecting frame number 3.

Dept. of Telecoms Engineering 68


Data Communication and Networking 3-Mar-25

HDLC
❑ Piggyback with errors:
❖ Example: an exchange in which a frame is
lost. Node B sends three data frames (0, 1,
and 2), but frame 1 is lost.
❖ When node A receives frame 2, it discards it
and sends a REJ frame for frame 1. Note that
the protocol being used is Go-Back-N with
the special use of an REJ frame as a NAK
frame. The NAK frame does two things here:
It confirms the receipt of frame 0 and
declares that frame 1 and any following
frames must be resent.
❖ Node B, after receiving the REJ frame,
resends frames 1 and 2. Node A
acknowledges the receipt by sending an RR
frame (ACK) with acknowledgment number
3.

Dept. of Telecoms Engineering 69


Data Communication and Networking 3-Mar-25

HDLC
❑ Some other cases:

Dept. of Telecoms Engineering 70

You might also like