NT Unit - II
NT Unit - II
ERROR CONTROL
Error control can be done in two ways
¢ Error detection — Error detection involves checking whether any error has
occurred or
not. The number of error bits and the type oferror does not matter.
¢ Error correction — Error correction involves ascertaining the exact number ofbits
that has
been corrupted and the location ofthe corrupted bits.
For both error detection and error correction, the sender needs to send some
additional bits along
with the data bits. The receiver performs necessary checks based upon the
additional redundant
bits. If it finds that the data is free from errors, it removes the redundant bits
before passing the
message to the upper layers.
Error Detection Techniques
There are three main techniques for detecting errors in frames: Parity Check,
Checksum and
Cyclic Redundancy Check (CRC).
Parity Check
The parity check is done by adding an extra bit, called parity bit to the data to
make a number of
1s either even in case ofeven parity or odd in case ofodd parity.
While creating a frame, the sender counts the number of Is in it and adds the
parity bit in the
following way
¢ Incase ofeven parity: If a number of 1s is even then parity bit value is 0. If
the number of
1s is odd then parity bit value is 1.
e Incase of odd parity: If a number of 1s is odd then parity bit value is 0. If a
number of 1s
is even then parity bit value is 1.
e On receiving a frame, the receiver counts the number of 1s in it. In case of even
parity
check, if the count of 1s is even, the frame is accepted, otherwise, it is
rejected. A similar
tule is adopted for odd parity check.
e The parity check is suitable for single bit error detection only.
Checksum
In this error detection scheme, the following procedure is applied
¢ Data is divided into fixed sized frames or segments.
¢ The sender adds the segments using 1’s complement arithmetic to get the sum. It
then
complements the sum to get the checksum and sends it along with the data frames.
Dr.K.Sankar /Networking Technologies / IIIBCA-B
Page 2 of 9
e The receiver adds the incoming segments along with the checksum using |’s
complement
arithmetic to get the sum and then complements it.
e If the result is zero, the received frames are accepted; otherwise, they are
discarded.
Cyclic Redundancy Check (CRC)
Cyclic Redundancy Check (CRC) involves binary division of the data bits being sent
by a
predetermined divisor agreed upon by the communicating system. The divisor is
generated using
polynomials.
e Here, the sender performs binary division of the data segment by the divisor. It
then
appends the remainder called CRC bits to the end of the data segment. This makes
the
resulting data unit exactly divisible by the divisor.
e The receiver divides the incoming data unit by the divisor. If there is no
remainder, the data
unit is assumed to be correct and is accepted. Otherwise, it is understood that the
data is
corrupted and is therefore rejected.
Error Correction Techniques
Error correction techniques find out the exact number of bits that have been
corrupted and as well
as their locations. There are two principle ways
¢ Backward Error Correction (Retransmission) — If the receiver detects an error in
the
incoming frame, it requests the sender to retransmit the frame. It is a relatively
simple
technique. But it can be efficiently used only where retransmitting is not
expensive as in
fiber optics and the time for retransmission is low relative to the requirements of
the
application.
¢ Forward Error Correction — If the receiver detects some error in the incoming
frame, it
executes error-correcting code that generates the actual frame. This saves
bandwidth
required for retransmission. It is inevitable in real-time systems. However, if
there are too
many errors, the frames need to be retransmitted.
* DATA LINK CONTROL
Data Link Control is that the service provided by the Link Layer to supply reliable
data transfer
over the physical medium. For instance, within the half-duplex transmission mode,
one device can
only transmit the info at a time.
Ifboth the devices at the top ofthe links transmit the info simultaneously, they’re
going to collide
and results in the loss of knowledge. The info link layer provides the coordination
among the
devices in order that no collision occurs.
Dr.K.Sankar /Networking Technologies / IIIBCA-B
Page 3 of 9
e Line discipline.
¢ Flow control.
¢ Error control.
i).LINEDISCIPLINE
In-Line Discipline is a functionality of the Data link layer that provides
coordination among the
link systems. It determines which device can send, and when it can send the data.
There are also
some categories ofline discipline.
Categories ofLine Discipline
¢ Enquiry/Acknowledgment (ENQ/ACK)
¢ Poll / Select
The first method is employed in peer to see communication; the second method is
employed in
primary secondary communication.
Enquiry/Acknowledgment (ENQ/ACK)
Is employed primarily during a system where there’s no doubt ofthe incorrect
receiver getting the
transmission, that is, when there’s a fanatical link between two devices in order
that the sole
device capable ofreceiving the transmission is that the intended one.
ENQ/ACK coordinates which device may start transmission and whether or not.
StationA
Station B
Who should start?
'
How can one station be sure that
the order is ready
'
a)
SS
Working OfENQ/ACK
The initiator first transmits a frame called an inquiry (ENQ) asking ifthe receiver
is out there to
receive data. The receiver must answer either with an acknowledgment (ACK) frame if
it is ready
to receive or with a negative acknowledge (NAK) frame if it is not.
ii).FLOWCONTROL
e Ensuring the sending entity doesn’t overwhelm the receiving entity
—Preventing buffer overflow
¢ Transmission time
—Time is taken to emit all bits into the medium at the sender’s side
—Determined by the data rate
Dr.K.Sankar /Networking Technologies/ IIIBCA-B
Page 4 of9
e Propagation time
—Time for a touch to traverse the link and reach the destination
—Determined by the transmission distance
e We first assume error-free transmission.
Flow control -For speed mismatch (sender faster than receiver), finite receiver
buffer, or
occasional unavailability ofthe receiver feedback mechanism is usually required.
CATEGORIES OF FLOW CONTROL
We are going to talk about categories ofFlow control.
e Stop-and-wait
¢ Sliding window
FLOW CONTROL
STOP-AND-WAIT
SLIDING WINDOW
Send one frame ata time
Send several frames at a time
STOP-AND-WAIT
« The source transmits a frame.
e The destination receives the frame and replies with a small frame called
acknowledgment
(ACK).
e The
source
waits
for
—This is the core ofthe protocol!
the ACK before
sending
the
next
frame.
SENDER
RECEIVER
DATA
waIT
TIME
watt
TIME
Ls
sire
TIME
2.
Vv
TIME
Vv
TIME
ACK
Le
ACK
DATA
ACK
DATA
Dr.K.Sankar /Networking Technologies/ IIIBCA-B
Page 5 of9
e The destination can stop the flow by not sending an ACK (e.g., ifthe destination
is busy ... )
e Performance ofStop-and-Wait
e« STOP-AND-WAIT Flow control is not efficient for the end of the day transmission
and high-
speed transmission. Another sort of protocol called “sliding-window” is meant for
this
situation.
SLIDING WINDOW
Sliding window flow control-
Idea: allow multiple frames to transmit
—The receiver has a buffer ofW frames
—tThe transmitter can send up to W frames without receiving the ACK
Each frame must be numbered: sequence number is included within the frame header
ACK includes the sequence number ofthe subsequent expected frame by the receiver
WINDOW
~j6| 7[o]1]2]3[4[s[e]7fo]1{2{3f4a]s]
iii).ERRORCONTROL
Error control: detection and correction oferrors
We consider two types of errors:
—Lost frames
The receiver cannot recognize that this is often a frame.
—Damaged frames
The receiver can recognize the frame, but some bits are in error.
ERROR CONTROL
SLIDING WINDOW
ARQ
‘SELECTIVE-REJECT
Dr.K.Sankar /Networking Technologies / IIIBCA-B
Page 6 of 9
STOP-AND-WAIT ARQ
Based on stop-and-wait flow control
The source station is equipped with a timer.
The source transmits a single frame and waits for an ACK
Ifthe frame is lost...
—the timer eventually fires, and therefore the source retransmits the frame.
If the receiver receives a damaged frame, discard it
—the timer eventually fires, and therefore the source retransmits the frame.
If everything goes right, but the ACK is broken or lost, the source won’t recognize
it
—the timer eventually fires, the source will retransmit the frame
—the receiver gets two copies ofan equivalent frame!
—Solution: use sequence numbers, | bit is enough, i.e., frameO and framel, ACKO and
ACK1
mek
FRAME LOST: — eames |
A RETRANSMITS
ACK
TIMEOUT
FRAME 0
yuME
TIMEOUT
ACK O LOST:
A RETRANSMITS
ACKO
Y
GO-BACK-n ARQ
Based on sliding-window flow control
Use window size to regulate the number ofunacknowledged frames outstanding
If no error, the destination will send ACK as usual with the next frame expected
(positive
ACK, RR: receive ready)
If error, the destination will reply with rejection (negative ACK, REJ: reject)
— the receiver discards that frame and all future frames until the erroneous frame
is
received correctly.
—tThe source must go back and retransmit that frame and all succeeding frames that
were
transmitted in the interim.
— This makes the receiver simple but decreases the efficiency
Dr.K.Sankar /Networking Technologies/ IIIBCA-B
Page 7 of9
B DISCARDS
DUPLICATE FRAME
I
provides best-effort unreliable service and also reliable service. HDLC isa bit-
oriented
protocol that is applicable for point-to-point and multipoint communications both.
. Serial Line Interface Protocol (SLIP)
SLIP is generally an older protocol that is just used to add a framing byte at end
ofIP
packet. It is basically a data link control facility that is required for
transferring IP packets
usually among Internet Service Providers (ISP) and a home user overa dial-up link.
It is an
encapsulation ofthe TCP/IP especially designed to work with over serial ports and
several
router connections simply for communication.
. Point to Point Protocol (PPP)
PPP is a protocol that is basically used to provide same functionality as SLIP. It
is most
robust protocol that is used to transport other types ofpackets also along with IP
Packets. It
can also be required for dial-up and leased router-router lines. It basically
provides framing
method to describe frames. It is a character-oriented protocol that is also used
for error
detection.
. Link Control Protocol (LCP)
It was originally developed and created by IEEE 802.2. It is also used to provide
HDLC
style services on LAN (Local Area Network). LCP is basically a PPP protocol that is
used
for establishing, configuring, testing, maintenance, and ending or terminating
links for
transmission of data frames.
. Link Access Procedure (LAP)
LAP protocols are basically a data link layer protocols that are required for
framing and
transferring data across point-to-point links. It also includes some reliability
service features.
There are basically three types ofLAP i.e. LAPB (Link Access Procedure Balanced),
LAPD
(Link Access Procedure D-Channel), and LAPF (Link Access Procedure Frame-Mode
Bearer Services). It is actually originated from IBM SDLC, which is being submitted
by
IBM to the ISP simply for standardization.
. Network Control Protocol (NCP)
NCP was also an older protocol that was implemented by ARPANET. It basically allows
users to have access to use computers and some ofthe devices at remote locations
and also
to transfer files among two or more computers. It is generally a set ofprotocols
that is
forming a part ofPPP. NCP is always available for each and every higher-layer
protocol that
is supported by PPP. NCP was replaced by TCP/IP in the 1980s.
~~~~~ The End: Unit-II ~~~~~
Dr.K.Sankar /Networking Technologies / IIIBCA-B
Page 9 of 9