You are on page 1of 11

NAME: NYASHA TECLA ASHTON T. CHIPO A. MOSES T. TAKUDZWA I.

MANDIZVIDZA MUTEMA SIBANDA CHIGOVERA CHIPANDA ZIVANAI


REG M191832 M192063 M191861 M190488 M192246 M191934
NUMBER:

SEMESTER: 2.1

PROGRAMME: INFORMATION SYSTEMS

COURSE: DATA COMMUNICATIONS AND COMPUTER NETWORKING

COURSE CODE: IS 202

LECTURER: L. WINJI

YEAR: 2020
TYPES OF ERRORS

Any time data are transmitted from one node to the next, they can become corrupted in passage.
Many factors can alter one or more bits of a message. Some applications require a mechanism for
detecting and correcting errors. Whenever bits flow from one point to another, they are subject to
unpredictable changes because of interference. This interference can change the shape of the signal.
There are three main types of errors namely
1. Single bit error
This is where one bit of data changes from 0 to 1 and 1 to 0, for example, an 8-bit data
0 0 0 0 0 0 1 0 is being sent by the sender and when the data reaches its destination
0 0 0 0 1 0 1 0 it changes to

0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0
sender receiver

 In frame, there is only one bit located anywhere which is corrupt.

2. Multiple bits error


Two or more non-consecutive (not in a sequence) bits in a data unit changes from 1 to 0 and 0 to 1.
For example
Sent 0 0 0 0 0 0 1 1

Received 1 0 0 1 0 0 1 0
 The frames are received with more than one bit in
corrupted state.

3. Burst error
Two or more consecutive (in a sequence) bits changes from 0 to 1 and 1 to 0.
For example
sent 0 0 0 0 0 0 1 0

received 0 1 1 1 0 0 1 0

 Frame contains more than 1 bits corrupted.

Coding

Coding in data communications and computer networks is are a system of rules that converts
information into another form. Its technical term is encoding and it converts information from a
source into symbols for communication or storage.
Types of codes are

i. Data compression
 This removes the redundancy from the data from a source in order to transmit it more
effectively. Has the ability to make data files smaller for reducing internet traffic
ii. Error detection
 These are a sequence of numbers that are generated by specific procedures for detecting
errors in data that has been transmitted over computer networks. When bits are transmitted
over the computer network, they are subject to get corrupted.
iii. Cryptographic coding
 It is a practice and a study of techniques for secure communication in the presence of third
parties.
 It constructs protocols that adversaries are central to modern cryptography.
iv. Line coding

It is a code chosen for use within a communications system for baseband transmission
purposes. It is often used for digital transport.

Modular arithmetic

Modular arithmetic is a system of arithmetic for integers, where values reset to zero and begin
to increase again, after reaching a certain predefined value, called the modulus (modulo). Modular
arithmetic is widely used in computer science and cryptography. The values are limited rom 1 and 0
and the upper limit is defined as N and we have 0 to N-1
 Zn be a set of all non-negative integers that are smaller than N:
    ZN = {0,1, 2..., N-1}
where:
 N  is a positive integer,
 if  N is a prime, it will be denoted  p  (and the whole set as  Z p).
In this system. When an integer is greater than N, it is divided by N where the remainder is the
result.

Block Coding

It is also known as block-based programming, which is a type of programming where instructions are
mainly represented as blocks. Messages are divided into blocks each of Kbits called data words.
These codes can also be applied in the domains of telecommunications, information theory and
coding theory. We add r redundant bits to each block to make the length n = k + r. The resulting n-bit
blocks are called code words.

For example, we have a set of data words, each of size k, and a set of code words, each of size of n.
With k bits, we can create a combination of 2k data words, with n bits; we can create a combination
of 2n code words. Since n > k, the number of possible code words is larger than the number of
possible data words.
The block coding process is one-to-one; the same data word is always encoded as the same code
word. This means that we have 2n-2k code words that are not used. We call these code words
invalid or illegal.

Hamming Distance

This is a metric for comparing two binary data strings. It is used for error detection or error
correction

In order to calculate the Hamming distance between two strings, we perform their XOR operation,
(a⊕ b), and then count the total number of 1s in the resultant string. Note that the Hamming
distance is a value greater than zero.

1. The Hamming distance d (000, 011) is 2 because 000 ⊕ 011 is 011 (two 1s).
2. The Hamming distance d (10101, 11110) is 3 because 10101 ⊕ 11110 is 01011 (three 1s).

The central concepts in coding for error control are the idea of the Hamming distance. The Hamming
distance between two words (of the same size) is the number of differences between the
corresponding bits. We show the Hamming distance between two words x and y as d (x, y). When
data is transmitted over computer networks and it uses a coding theory for comparing equal length
data words. Mainly found when using a mutually exclusive OR gate pathways on the corresponding
bits. Suppose there are two stings 1101 1001 and 1001 1101 then 1101 1001 ⊕ 1001 1101 =
01000100 since this contains two 1’s, the hammering distance d (11011001, 10011101) = 2.

Hamming Distance and Error

When a code word is corrupted during transmission, the Hamming distance between the sent and
received code words is the number of bits affected by the error. In other words, the Hamming
distance between the received code word and the sent code word is the number of bits that are
corrupted during transmission. For example, if the code word 00000 is sent and 01101 is received, 3
bits are in error and the Hamming distance between the two is d (00000, 01101) =3.

Minimum Hamming Distance

The minimum Hamming distance is the smallest Hamming distance between all possible pairs. We
use "d min" to define the minimum Hamming distance in a coding scheme. To find this value, we find
the Hamming distances between all words and select the smallest one.

Suppose there are four strings 010, 011, 101 and 111.

010 ⊕ 011 = 001, d (010, 011) = 1.

010 ⊕ 101 = 111, d (010, 101) = 3.

010 ⊕ 111 = 101, d (010, 111) = 2.

011 ⊕ 101 = 110, d (011, 101) = 2.

011 ⊕ 111 = 100, d (011, 111) = 1.

101 ⊕ 111 = 010, d (011, 111) = 1.

Hence, the Minimum Hamming Distance, dmin = 1.

Minimum Distance for Error Detection:


The minimum Hamming distance is the smallest Hamming distance between all possible pairs. It
uses "d min" to define the minimum Hamming distance in a coding scheme. To find this value, it
locates the Hamming distances between all words and select the smallest one. If S errors occur
during transmission, the Hamming distance between the sent code word and received code word is
S. If our code is to detect up to S errors, the minimum distance between the valid codes must be s +
1, so that the received code word does not match a valid code word.

Minimum Distance for Error Correction:

Error correction is more complex than error detection, a decision is involved. When a received code
word is not a valid code word, the receiver needs to decide which valid code word was actually sent.
The decision is based on the concept of territory, an exclusive area surrounding the code word. Each
valid code word has its own territory. We use a geometric approach to define each territory. We
assume that each valid Code word has a circular territory with a radius of t and that the valid code
word is at the centre. For example, suppose a code word x is corrupted by t bits or less. Then this
corrupted code word is located either inside or on the perimeter of this circle. If the receiver
receives a code word that belongs to this territory, it decides that the original code word is the one
at the centre. Note that we assume that only up to t errors have occurred; otherwise, the decision is
wrong.

LINEAR BLOCK CODES

A linear block code is a block code in which the exclusive-or of any two codewords results in another
code word. Linear block coding is a generic coding method. Other coding methods, such as Hamming
and BCH codes, are special cases of linear block coding. The code word vector of a linear block code
is a linear mapping of the message vector. The code word x and the message m have the relationship

x =mG

Where G is a K-by-N matrix and is known as the generator matrix. Linear block code is called a
systematic linear code if the generator matrix has the form

G = [P Ik ]

Where P is an (n-k)-by-k matrix and Ik is a k-by-k identity matrix. A systematic linear code renders a
length k message into a length n code word where the last k bits are exactly the original message
and the first (n-k) bits are redundant. These redundant bits serve as parity-check digits.

Parity Checking

A parity check is the process that ensures accurate data transmission between nodes during
communication. A parity bit is appended to the original data bits to create an even or odd bit
number; the number of bits with value one. The source then transmits this data via a link, and bits
are checked and verified at the destination. Data is considered accurate if the number of bits (even
or odd) matches the number transmitted from the source.

Parity checking, which was created to eliminate data communication errors, is a simple method of
network data verification and has an easy and understandable working mechanism.

As an example, if the original data is 1010001, there are three 1s. When even parity checking is used,
a parity bit with value 1 is added to the data’s left side to make the number of 1s even; transmitted
data becomes 10100011. However, if odd parity checking is used, then parity bit value is zero;
10100010.
If the original data contains an even number of 1s (1101001), then parity bit of value 1 is added to
the data’s left side to make the number of 1s odd, if odd parity checking is used and data
transmitted becomes 11010011. In case data is transmitted incorrectly, the parity bit value becomes
incorrect; thus, indicating error has occurred during transmission.

You can also use XOR gate

0 xor 0 = 0

0 xor 1= 1

1 xor 0= 1

1 xor 1= 0

Single Parity Error Detection

In the Single Parity error detection method, a single even or odd parity bit is attached with the
message bit. If a one or more bit error takes place then the receiver will receive the message with
the changed parity bit. It indicates that some error has taken place which means the error is
detected.

7 bits of data (count of 1-bits) Even(8 bits including parity) Odd(8 bits including parity)
0000000 0 00000000 00000001
1010001 3 10100011 10100010
1101001 4 11010010 11010011
1111111 7 11111111 11111110

Even Parity

If number of 1’s is even, parity bit value is 0, And if number of 1’s is odd, parity bit value is 1

Suppose a user wants to send data having 7 Bit: 1000000

Number of 1’s in data bit: 1

Number of 0’s in data bit: 6

Taking 1 as a parity bit, as we are sending the data using even parity method so, the number of 1’s
should be even.

In this case, we have: Number of 1’s in data bit – 1

So we will add a single bit as we are using the Single Parity bit method this is 1 will be added with
data bits so that the number of 1’s become even.

Data transmitted is: 10000001

Parity bit: 1

If the data is received by the receiver is having a one-bit error at 5th bit from the left-hand side then,

Data Received is: 10001001

The receiver will check for the parity, as the parity is Odd this is Number of 1’s = 3.

So the error is detected.


NOTE: The sender will inform the Receiver about the type of parity which is used. An error can also
take place in the parity bit.

Odd Parity

If number of 1’s is odd, parity bit value is 0, And if number of 1’s is even, parity bit value is 1

Suppose a user wants to send data having 7 Bit: 1001010

Number of 1’s in data bit: 3

Number of 0’s in data bit: 4

Taking 1 as a parity bit, as we are sending the data using odd parity method so, the no of 1’s should
be odd.

In this case, we have: Number of 1’s in data bit – 3

So we will add a single bit as we are using the Single Parity bit method this is we will add 0 as the
number of 1’s are odd already.

Data transmitted is: 10010100

Parity bit: 0

If the data is received by the receiver is having a one-bit error at 7th bit from the left-hand side then,

Data Received is: 10010110

The receiver will check for the parity, as the parity is Even this is Number of 1’s = 4.

So the error is detected.

NOTE: The sender will inform the Receiver about the type of parity which is used. An error can also
take place in the parity bit.

Single Parity: Disadvantages

1. Only odd number of bit errors can be detected.


For example: Suppose a user sends data having 5 Bit: 10010
Number of 1’s in data bit: 2
Number of 0’s in data bit: 3
As we are sending the data using odd parity method so, the number of 1’s should be odd.
In this case, we have: Number of 1’s in data bit – 2
so we will add a single bit as we are using the Single Parity bit method this is we will add 1 as
the number of 1’s will become odd.
Data transmitted is: 100101
Parity bit: 1
If the data is received by the receiver is having an even number of bit error at 2nd and 3rd
bit from the left-hand side then,
Data Received is: 111101
The receiver will check for the parity, as the parity is odd this is Number of 1’s = 5.
So the receiver will think there is no error in the data but there is even number bit error.
2. It doesn’t determine in which bit error has taken place.
3. An error can only be detected not corrected.
Single Parity: Advantage

Easy to Implement.

Two Dimensional Parity

Two Dimensional Parity can detect as well as correct one or more bit errors. If a one or more bit
error takes place then the receiver will receive the message with the changed parity bit. It indicates
that some error has taken place which means the error is detected then, we will make a Two
Dimensional array from the message bit. After that, according to the even or odd parity, we will fill
make the last column and last row of the matrix.

Total Parity Bits – i + j + 1 (Row+Column+1)

Here Parity Bit = 3 + 5 +1 = 9

One point is to be Remember that the Value of (i, j) should be of message array this is in spite of
having the value of i = 4, j = 6 (which is of array with parity bits). We will take value of message array
this is i= 3, j= 5.

Row and column parity bits are known as Redundant Bits this is i+j+1.

The code that is to be transmitted will be the whole message included Redundant Bits.

For example:

Now, this code is transmitted and reaches the receiver side, where the receiver will again form a
similar Two Dimensional array.
CASES OCCURS IN TWO DIMENSIONAL PARITY

CASE 1:

Suppose a bit is in error. Then it can be easily detected and the code is corrected. As shown in fig.

CASE 2:

When two erroneous bits are detected and corrected. The undesired part is that two other bits also
detected as an incorrect bit.

CASE 3:

When odd number of errors takes place in a particular row or particular column.
CASE 4:

When even number of errors takes place in a particular row.

CASE 5:

Where the error is not detected so not corrected.

Disadvantages
In some cases, an only odd number of bit errors can be detected and corrected but even number of
errors can only be detected but not corrected.

In some cases, this method is not able to detect even no bit error.

You might also like