Data Comm T7

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 30

BIDC213 • Data Communication & Networking

CHAPTER 7

Data Link Control


Mr. T. Ramoleko
Email: thamisor@yahoo.com
Objectives
• To examine the mechanism of flow control
• To explain line disciple
• To compare Synchronous Protocol &
Asynchronous protocol
• To differentiate Character-oriented protocol
& Bit-oriented protocol

BIDC213 Data Communication & Networking 2


Topics covered
• Data Link Control
• Line Discipline
• Flow Control
• Synchronous Protocol
• Asynchronous Protocol
• Character-oriented protocol
• Bit-oriented protocol

BIDC213 Data Communication & Networking 3


Data Link Control
• Data link layer functions:
– Line discipline
• who should send now?
• Coordination of linked systems
– Flow control
• How much data may be sent?
• Transfer rate, acknowledgement of frames received
intact  error control
– Error control
• How can errors be corrected?
• Frames lost, damaged & retransmission

BIDC213 Data Communication & Networking


Line Discipline
• Line discipline functions of the data link
layer oversees:
– the establishment of links
– The right time of a particular device to
transmit at a given time
• Done in two ways:
– Enquiry/Acknowledgement (ENQ/ACK)
• Used in peer-to-peer communication
– Poll/Select
• Used in primary-secondary communication

BIDC213 Data Communication & Networking


Line Discipline – ENQ/ACK
• ENQ/ACK is used primarily in systems where
there is no question of the wrong receiver
getting the transmission – dedicated link
between 2 devices
• May be started by any devices as long as they
are equal rank.
• The initiator will send a frame call ENQ to ask if
the receiver is available to receive data. If yes,
ACK will be sent from receiver. If no, NAK
(negative acknowledgement) will be sent
• If no answer, initiator will assume ENQ frame is
lost in transit and it will send a replacement.
Three attempts will be tried before giving up.
BIDC213 Data Communication & Networking
Line Discipline – ENQ/ACK
Sender Receiver
Establishment ENQ
ACK

Data
Data Transfer
ACK


Data
ACK
Termination EOT

BIDC213 Data Communication & Networking


Line Discipline – Poll/Select
• Used in multipoint systems where more
than 2 devices are linked.
• System with one Primary device and few
Secondary devices
• Addressing is important
• Polling – Primary ask Secondaries if they
have anything to send to Primary
• Selecting – Primary wants to send data to a
specific Secondary

BIDC213 Data Communication & Networking


Line Discipline –Select
Primary Secondary

A B C

SEL
ACK

Data
ACK

BIDC213 Data Communication & Networking


Line Discipline – Poll
Primary Secondary

A B C

Poll
NAK

Poll
Data
ACK

Poll
NAK

BIDC213 Data Communication & Networking


Flow Control
• A set of procedure that tell the sender how much
data it can transmit before it must wait for an
acknowledgement from the receiver
• Two issues:
– The flow of data must not overwhelm the receiver. The
receiver must inform the sender before limits are
reached, either to slow down or temporarily stop.
Incoming data must be checked and processed.
– As frame come in, they are acknowledged (by ACK
frame), either frame by frame or several frames at a
time. If frame is damaged, the receiver will send an error
message (by NAK frame)
• Two methods developed to control the flow:
– Stop-and-wait – frame by frame
– Sliding
BIDC213 window – Several frames
Data Communication & Networkingat one time
Flow Control – Stop & Wait
Sender Receiver
Data
WT
ACK
Data
WT
ACK
Data
WT
ACK
EOT
WT = Wait Time

Time Time
BIDC213 Data Communication & Networking
Flow Control – Sliding Window
Sender Receiver
0 1 2 3 4 5 6 7 0 1 2 3 4 0 1 2 3 4 5 6 7 0 1 2 3 4
Data 0
0 1 2 3 4 5 6 7 0 1 2 3 4 0 1 2 3 4 5 6 7 0 1 2 3 4
Data 1

0 1 2 3 4 5 6 7 0 1 2 3 4 0 1 2 3 4 5 6 7 0 1 2 3 4
ACK 2

0 1 2 3 4 5 6 7 0 1 2 3 4 0 1 2 3 4 5 6 7 0 1 2 3 4
Data 2

0 1 2 3 4 5 6 7 0 1 2 3 4 0 1 2 3 4 5 6 7 0 1 2 3 4
ACK 3
0 1 2 3 4 5 6 7 0 1 2 3 4 0 1 2 3 4 5 6 7 0 1 2 3 4
Data 3
0 1 2 3 4 5 6 7 0 1 2 3 4 0 1 2 3 4 5 6 7 0 1 2 3 4

Data 4

0 1 2 3 4 5 6 7 0 1 2 3 4 0 1 2 3 4 5 6 7 0 1 2 3 4
Data 5

0 1 2 3 4 5 6 7 0 1 2 3 4 0 1 2 3 4 5 6 7 0 1 2 3 4
ACK 6

0 1 2 3 4 5 6 7 0 1 2 3 4 0 1 2 3 4 5 6 7 0 1 2 3 4

BIDC213 Data Communication & Networking


Error Correction
• Dealing with methods of error detection and
retransmission
• Cause of retransmission:
– Damaged frame
– Lost of data frame
– Lost of ACK frame
– Time out
• A few type of error correction:
– Automatic Repeat Request (ARQ)
– Stop-and Wait ARQ
– Sliding Window ARQ
– Go-back-n ARQ
– Selective-Reject ARQ

BIDC213 Data Communication & Networking


Automatic Repeat Request
(ARQ)
• When error detected, the receiver sends a
NAK frame therefore a specific frame has
to be retransmitted
• The process is called ARQ
• A frame may be so damaged that the
receiver does not recognize it at all. In this
case, ARQ allows us to say that the frame
has been lost.
• Auto retransmission of frame will happen
when lost ACK detected or NAK received
BIDC213 Data Communication & Networking
Stop-and-wait ARQ
• Four features added to basic flow control
mechanism for Stop-and-wait ARQ
– The sending device keep a copy of the last
frame transmitted until an ACK frame received
– Both data frame and ACK frame are numbered
alternately by 0 and 1. This is to identify
duplicate transmission caused by lost ACK frame
– When error happened, NAK frame without
number will be sent. Sender will retransmit the
frame with previous number
– The sender is equipped with a timer. Sender will
retransmit a frame if no acknowledgement is
received.
BIDC213 Data Communication & Networking
Stop-and-wait ARQ –
damaged frame
Sender Receiver
Data 1
ACK 1
Data 0
ACK 0
Data 1

NAK
Error in Frame 1
Data 1
ACK 1

Time
BIDC213 Data Communication & Networking
Stop-and-wait ARQ –
Lost data frame
Sender Receiver
Data 1 Lost
Time out

Data 1
ACK 1
Data 0

ACK 0

BIDC213 Data Communication & Networking


Stop-and-wait ARQ –
Lost ACK frame
Sender Receiver
Data 1 ACK 1 is
lost
ACK 1
Lost
Time
out

Data 1
1st copy
ACK 1 discarded
Data 0

ACK 0

BIDC213 Data Communication & Networking


Sliding Window ARQ
• Two most popular error control protocol for sliding
windows:
– Go-back-n ARQ
– Selective-reject ARQ
• Three features added to sliding window flow control
mechanism
– Sender keep copies of all transmitted frames until they
have been acknowledged
– Both ACK and NAK are numbered. NAK tells exactly which
frame is rejected. ACK tells which frame and the frames
before are accepted. If sender receives ACK3 and tehn
NAK 5, it means frame 1, 2, 3, 4, are accepted and only
frame 5 needs to be retransmitted
– Timer is equipped with sender. If all frames in a windows
have been sent out, timer will be started. If time out
happened, all frames will be transmitted again.
BIDC213 Data Communication & Networking
Go-Back n ARQ –
damaged frame
Sender Receiver
Data 0 Data 0
Data 1 Data 1
Data 2 Data 2
Data 3 ACK 3
Data 4 NAK 3 Error in frame 3
Data 5 Data 4 Discarded
Data 3 Data 5 Discarded
Data 4 Data 3
Data 5 Data 4
Data 5
BIDC213 Data Communication & Networking
Go-Back n ARQ –
Lost data frame
Sender Receiver
Data 0 Data 0
Data 1 Data 1
Data 2 Lost Expecting Data
Data 3 2, but Data 3
Data 3 received. So,
Data 4 Data 3, 4
NAK 2 discarded &
Data 2 NAK 2
Data 4 generated
Data 3 Data 2
Data 4 Data 3
Data 4

BIDC213 Data Communication & Networking


Go-Back n ARQ –
Lost ACK frame
Sender Receiver
Data 0 Data 0
Data 1 Data 1
Data 2 Data 2

Time Lost ACK 3


out

Data 0
Data 1 Data 0
Data 2 Data 1
Data 2

BIDC213 Data Communication & Networking


Selective-Reject ARQ
• In this ARQ, the specific damaged or lost frame is
retransmitted.
• If a frame is damaged, a NAK is returned and the frame is
resent out of sequence
• The receiver must be able to sort the frames it has and
insert the corrected frame into its proper place in sequence
• Additional feature added into the system:
– Receiver must have sorting logic to contain out of sequence frame.
Therefore, it must be able to store frames until it has been sorted
out
– Sender must contain a searching mechanism that allows it to find
and select only the requested frame for transmission
– ACK and NAK number must refer to the frame received (or lost)
instead of the next frame expected
– Smaller window size than go-back n ARQ so that it can work
efficiently. Window size recommended = (n+1)/2

BIDC213 Data Communication & Networking


Selective-reject ARQ
Sender Receiver
Data 0 Data 0
Data 1 Data 1
Data 2 Data 2
Data 3 NAK 2
Data 4 Data 3
Data 5 Data 4
Data 2 Data 5
Resend Data 2

BIDC213 Data Communication & Networking


Data Link Protocol
• Data Link Protocol are sets of specification
used to implement the data link layer:
rules for line discipline, flow control, error
handling and etc.
• Two group of DL protocols:
– Asynchronous Protocol – treats each character
in a bit stream independently
– Synchronous Protocol – takes the whole bit
stream and chop it into characters of equal
size

BIDC213 Data Communication & Networking


Asynchronous Protocols
• Implemented in modem – slow speed
devices.
• Simple and inexpensive
• No timer
• Receiver doesn’t know when data is sent.
It only recognize the start and the end of
the unit
• Few of the protocols
– XMODEM, YMODEM, ZMODEM, BLAST, Kermit
and etc
BIDC213 Data Communication & Networking
Asynchronous Protocols
• XMODEM – created in 1979 by Ward Christiansen. Designed for file
transfer protocol thru phone line between PCs. Half-duplex stop-and-
wait ARQ protocol. The frame start with 1 byte of SOH, 2 bytes of
header, 128 bytes of data field and 1 byte of CRC. It uses cancel signal
(CAN) to abort a transmission
• YMODEM – Different from XMODEM:
– data unit is 1024 bytes.
– Two CANs are sent to abort a transmission
– CRC-16 is used for error checking
– Multiple files can be sent simultaneously
• ZMODEM – Combining features from X & YMODEM
• BLAST – Blocked Asynchronous Transmission. Full-duplex with sliding
windows flow control. Allow the transfer of data & binary files
• Kermit – Widely used asynchronous protocol. File transfer protocol is
similar to XMODEM.

BIDC213 Data Communication & Networking


Synchronous Protocols
• Higher speed than asynchronous protocols
• Used in LAN, MAN & WAN technology
• Divided into 2 sub-classes:
– Bit-oriented – the frame or packet is
interpreted as a series of bits
– Character-oriented – the frame or packet is
interpreted as a series of characters (usually 8
bits for each character; ASCII or EBCDIC or
others)

BIDC213 Data Communication & Networking


Character-Oriented Protocol
• Not as efficient as bit-oriented protocol
• Easy to comprehend
• Same organization and logic as the bit-
oriented protocols
• Control info is inserted into the data
stream either as separate control frames
or as additions to existing data frames.
• The existing character sets such as ASCII
has been used in the form of code.
• Best known is IBM’s Binary Synchronous
Communication (BSC)
BIDC213 Data Communication & Networking

You might also like