Burst Errors in Data Transmission
Burst Errors in Data Transmission
Data link layer is the 2nd layer in the internet model. The job of the data linker is to transmit to the destination machine
Data link layer providing services to the network layer & utilizes the and handover to the network layer.
services of physical layer. The data link layer receives packets from the network layer and
Data link layer organize data in the form of frames. encapsulate them in to frames for transmission.
Design Issues The data link layer at the receiver side, extract packet from the
1. Providing well-defined service interface to the network layer. frame, forward to the network layer.
2. Framing how to organize group of bits? The following diagram shows the relationship between packet &
3. Error control how to detect & correct errors? frame.
4. Flow control how much data may be sent? Packet Packet
5. Access control who should send now ?
The primary duty of the data link layer is to transfer data from the Header payload tail Frame Header payload tail
network layer source machine to network layer on the destination
machine.
The source machine entity, called process on the network layer
handover some bits(packet) to data link layer for transmission.
JPR COMPUTER NETWORKS JPR COMPUTER NETWORKS
1
Data Link Layer Data Link Layer
If newly computed checksum is differ from the one contained in Character Count
the frame indicates error in the frame. In this mechanism first filed in the frame specify the number of
Breaking the bit stream into frames is the more complex task. characters in the frame.
One way to achieve this framing is to insert time gap between the At the destination, DLL receives based on the count in the header.
frames, like gap between words in text. The following diagram shows character count method.
It is very difficult to maintain proper time gap between the Character count
systems.
5 1 2 3 4 5 6 7 8 9 8 0 1 2 3 4 5 6 7 7 8 9 0 1 2
There four different other methods
1. Character Count.
2. Flag byte with byte Stuffing. Frame 1 Frame 2 Frame 3 Frame 4
5 characters 5 characters 8 characters 7 characters
3. Starting & ending flags with bit Stuffing.
4. Physical Layer Coding Violations.
2
Data Link Layer Data Link Layer
The following examples shows the Byte Stuffing The major disadvantage of this framing method is that of using 8-
Original Data After Stuffing bit characters.
Not all character codes are 8-bit, for example UNICODE uses 16-
A FLAG B A ESC FLAG B
bit characters.
Bit Stuffing
A ESC B A ESC ESC B It defines to insert extra bits in frame, instead of extra characters.
Each frame begin with bit sequence 01111110(flag) and end with
flag.
A ESC FLAG B A ESC ESC ESC FLAG B
Whenever the senders data encounters the five consecutive 1’s , it
automatically stuffs a 0 bit in the out going stream.
When the receiver sees five consecutive incoming 1 bits followed
A ESC ESC B A ESC ESC ESC ESC B
by a o bit, it automatically destuffs the 0 bit.
Consider the following example, the original data is
0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0
3
Data Link Layer Data Link Layer
Burst Errors Error Detection
Two or more bits in data unit are in error, not necessarily Need to detect before a message is processed.
consecutive in order Redundancy may be used in the message for error control
Most likely in parallel/serial transmissions.
Process (error detection) must be handled at the destination.
Number of bits affected depend on data rate and noise duration.
Redundancy
Extra bits added to the frame is called redundancy bits.
The redundancy bits added by the sender and are removed by the
receiver.
The following diagram shows the redundancy bits in that data
during transmission.
4
Data Link Layer Data Link Layer
In even-parity, a redundant bit (parity bit) is appended to every For Ex:
data unit so total number of 1 bits is even; odd-parity – total 1 bits Suppose the sender wants to send the following data
should be odd. 1110111 1101111 1110010 1101100 1100100
The following shows the actual bits sent
11101110 11011110 11100100 11011000 11001001
Suppose receiver receives with out corruption.
11101110 11011110 11100100 11011000 11001001
The receiver counts the 1s in each character and comes up with
even numbers (6, 6, 4, 4, 4). The data are accepted.
Now suppose corrupted during transmission.
11111110 11011110 11101100 11011000 11001001
The receiver counts the 1s in each character and comes up with
even and odd numbers (7, 6, 5, 4, 4). The receiver knows that the
data are corrupted and discards them.
5
Data Link Layer Data Link Layer
Performance These bits are later used in calculations to detect whether or not an
Burst errors can be detected more often. error had occurred.
As shown in the example, an LRC of ‘n, bits can easily detect a At its destination, the data unit is divided by the same number.
burst error of ‘n’ bits At this step, remainder is zero, the incoming data unit is assumed
If two bits in one data unit are changed and two bits in exactly the to be intact and is therefore accepted.
same place in another data unit are also damaged, it unable to A remainder is non zero. indicates that a data unit has been
detect. damaged and therefore must be rejected.
Cyclic Redundancy Check Deriving the CRC
Most powerful of checking techniques A string of 0s is appended to the data unit, n is one less than
VRC and LRC are based on Addition number of bits in predetermined divisor.
CRC is based on Binary Division New data unit is divided by the divisor using binary division,
A sequence of redundant bits called CRC or CRC remainder is remainder is CRC
appended to the end of the data unit. CRC of n bits replaces appended 0s at end of data unit.
6
Data Link Layer Data Link Layer
CRC Calculation Data during transmission are
100 100001
CRC Checker
Performed by receiver.
Data is appended with CRC.
Same modulo-2 division.
If remainder is 0, data are accepted.
Otherwise, an error has occurred.
7
Data Link Layer Data Link Layer
Selecting divisor from the polynomial. CRC Performance
Can detect all burst errors affecting an odd number of bits
Can detect all burst errors of length less than or equal to degree of
polynomial
Can detect with high probability burst errors of length greater than
degree of the polynomial
8
Data Link Layer Data Link Layer
The following diagram shows the checksum process Ex: the following data to be sent
1000 0110 0101 1110 1010 1100 0110 0000 0111 0001 0010 1010
1000 0001 1011 0101.
The data is divided into 4 units each with 16 bits
1000 0110 0101 1110
1010 1100 0110 0000
0111 0001 0010 1010
1000 0001 1011 0101
Its sum are
0010 0101 1001 1111
Its 1’s compliment are
1101 1010 0110 0000
The data to be transmitted are
JPR COMPUTER NETWORKS JPR COMPUTER NETWORKS
9
Data Link Layer Data Link Layer
The minimum hamming distance method are For correct one bit error in 7bits unit requires 4 redundancy bits.
2r >= m+r+1 The redundancy bits are placed in the part of the data unit
Where m is no. of bits in data unit. systematically.
r is the number of bits are required. The total number of bits are 11.
r value is calculated using trail & error method. The redundancy bits are r1,r2,r4 & r8.
If m = 7 The data bits are d3,d5,d6,d7,d9,d10,d11.
Assume r = 2 The r1 is placed, if first bit is 1 & remaining are zero.
22 >= 7+2+1 4 >= 10 The r2 is placed, if second bit is 1 & remaining are zero.
Assume r = 3 The r4 is placed, if third bit is 1 & remaining are zero.
23 >= 7 + 3 + 1 8 >= 11 The r8 is placed, if fourth bit is one & remaining are zero.
Assume r = 4 The d3 to d11 are placed in other positions from right to left.
24 >= 7 + 4 + 1 16 >= 12 The following diagram shows the position of bits
0100
0001
1010
0110
0011
1001
0101
1011
0111
For Ex:1001101
10
Data Link Layer Data Link Layer
Elementary Data Link Protocols The flow control & error control protocols are divided into
Protocol – set of rules governing communication between devices. following categories.
Data link protocols define the rules to implement data link layer protocols
functions
Contain rules for flow control and error control etc.
For Noiseless For Noise
The follow control refers to a set of procedures used to restrict the channel channel
amount of data that the sender can send before waiting for an
acknowledgement. Stop&Wait Go-Back N Selective-
Simplex Stop & Wait ARQ Repeat ARQ
Error control refers an automatic repeat request, for retransmission ARQ
of data when the frame is lost or damaged.
11
Data Link Layer Data Link Layer
The following diagram of simplex protocol Stop-and-Wait Protocol
sender Receiver If frames arrive faster than they can be processed.
Request The frames must be store until the their use.
Normally receiver does not have enough storage space.
Arrival
Request This may results discard of frames.
Arrival To prevent the discarding of frames, somehow need to tell the
Request
sender to slow down.
There must be a feedback from receiver to sender.
Arrival
The stop-and-wait protocol send one frame, stop until it receives
time time conformation (ACK) from receiver.
The following diagram shows the design of stop-and-wait
protocol.
12
Data Link Layer Data Link Layer
Noise Channels A field added to the frame for holding sequence number of the
There are three protocols for noise channels. frame.
Stop-and-Wait Automatic Repeat Request(ARQ) The range of the sequence numbers is depends on number of bits
allocated to it.
Added simple error control mechanism to the noiseless stop-and-
If m bits allocated, sequence number from 0 to 2m – 1.
wait protocol.
Stop-and-Wait ARQ use x as the initial sequence number, we need
Lost frames are more difficult to handle than damaged frames. x+1 only after that.
For error correction keep a copy of the frame for retransmission. Suppose, sender sent a frame with x sequence number and
When a frame is lost or damage receiver does not respond. received successfully.
At the time of sending a frame sender starts timer, if the timer Receiver sent ACK with x+1 Sequence Number.
expires and no ACK for the sent frame, the frame is resent. Sender sent a frame with x+1 sequence number and received
Sequence Number successfully.
The frames are numbered using sequence numbers. Receiver sent ACK with x sequence number.
Two sequences are required to distinguish the frames, so x is 0
and x+1 is 1.
JPR COMPUTER NETWORKS JPR COMPUTER NETWORKS
ACK
13
Data Link Layer Data Link Layer
Flow Diagram of stop-and-wait ARQ Normal Operation Flow Diagram lost or damaged Frames
14
Data Link Layer Data Link Layer
Stop-and-Wait ARQ Performance Bidirectional Transmission
Advantage:
Simplicity: each frame is checked and ACK’d before next frame is Possible if two parties have separate channels for full-duplex
sent transmission or share same channel for half-duplex transmission.
Numbering of frames prevents duplication
Method of combining data frame and acknowledgement is called
Disadvantage:
Inefficiency and slow piggybacking.
Frame and ACKs use entire bandwidth It saves bandwidth due to combine data & ACK in a single frame.
If distance is long between devices, waiting time is more.
In Piggybacking method sender & receiver maintains both S & R
Variables.
15
Data Link Layer Data Link Layer
Go-back N ARQ The range of the sequence numbers is depends on number of bits
Allows more efficient transmission. allocated to it.
Sender send multiple frames before waiting for an ACK. If m bits allocated, sequence number from 0 to 2m – 1.
Sliding window is an imaginary shadow on the sequence of For ex: m = 3;
frames. The sequence numbers are
The frames right side of the window specifies, cannot be sent. 0 1 2 3 4 5 6 7 0 1 2 3 4 ------
The frames on the window specifies, frames are sent & wait for an The sender window of size 2m -1 with three variables namely Sf,
ACK. Sn and Ssize.
The frames left side of the window specifies, frames already Sf is sending window first outstanding frame.
ACKed.
Sn is sending window next frame to send.
Sequence Numbers
Ssize is the size of the window.
The frames are numbered using sequence numbers.
The sender window can slides one or more slots when ACK
A field added to the frame for holding sequence number of the
arrives.
frame.
JPR COMPUTER NETWORKS JPR COMPUTER NETWORKS
The following diagram shows the sender & receiver windows with Receive send
variables. DLL frame DLL
frame
Send
PHY PHY
Frame Data Frames Receive Frame
ACK
16
Data Link Layer Data Link Layer
Sender: Go-Back-N Operation
Event: Request from network Layer. Timers: sender sets a timer for each frame.
Repeat forever algorithm for sender site. No timer needed for receiver.
Event : Time out Acknowledgement - receiver sends positive ACK when frame
Event: Notification from physical layer. received successfully.
Receiver Silent on damaged & lost frames .
Repeat algorithm for receiver site. Resending Frames – All the frames.
Event: notification from physical layer. Note: In go-back-N ARQ size of the sender window must be <= 2m -
Event: generate Ack. 1 and receiver window must be of size 1.
17
Data Link Layer Data Link Layer
Go-Back N window size must be <= 2m -1. Selective Repeat ARQ
Go-Back-N is less efficient, all out of order or damaged frames
must be resent in order
Selective Repeat is a more efficient method but requires more
processing.
Sender window and control variables are same as Go-Back-N.
Receiver window is same size of sender.
Receiver look for range of frames unlike go-back-N.
Receiver window requires two control variables to define window
boundaries: RF and RL
It also uses negative acknowledgement (NAK) to report sequence
number of damaged frame.
Note : Window size of sender & receiver must be <= 2m / 2.
Send
PHY PHY
Frame Data Frames Receive Frame
ACK or NAK
18
Data Link Layer Data Link Layer
The following diagram shows the sender & receiver windows The following diagram shows the handling process of lost Frame.
19
Data Link Layer Data Link Layer
HDLC PROTOCOL NRM
High-level Data Link Control – protocol supporting half-duplex The station configuration is unbalanced.
and full-duplex communication over point-to-point and multipoint In the network, one primary station and multiple secondary
links stations.
The old DLL protocols is SDLC(Synchronous data link control) A Primary Station can send commands.
protocols and is used in IBM mainframes. The Secondary station can only respond.
IBM submitted to ANSI and ISO, and ANSI modified to It is used for both point-point & multipoint links.
ADCCP(Advanced Data Communication Control Protocol).
The following diagram shows the structure of NRM
ISO modified to HDLC.
HDLC supports two common transfer modes and can be used in
any configuration.
1. Normal Response Mode(NRM).
2. Asynchronous Response Mode(ARM).
20
Data Link Layer Data Link Layer
Flag filed : defines the beginning & ending of the frame. The following diagram shows control filed of different frames
Address:
It always contains the address of the Secondary Station.
If Primary Station Creates frame, it contains to address.
If Secondary Station Creates frame, it contains from address.
Address filed may be 1 byte to several bytes.
Control Field:
The control filed is either 1 or 2 bytes.
The systematic interpretation of bits specify the type of the frame.
The control filed first bit is 0, indicates I-Frame.
The control field first is 1 and second bit is 0, indicates S-Frame.
The control filed first is 1 and second bit is 1, indicates U-Frame.
21
Data Link Layer Data Link Layer
Different S-Frames are Control Field of U-Frames
22
Data Link Layer Data Link Layer
Framing Checksum: it is normally 2 or 4 byte filed.
PPP frame format consist of following fields Following diagram shows PPP communication process
23