In network, error is detected when transmitted and received data are not the same. It happens when there is some kind of interruption, magnetic field, interference or system failure.
parity check
Checksum
CRC(cyclic redundancy check)
It is done by including extra bit(parity bit). It ensures that the total number of 1-bits in the string is even or odd(whether it should be even or odd is predecided).
As one dimensional parity check is susceptible to errors that occur even number of times, two-dimensional parity check could be applied although it too cannot guarantee 100%.
A checksum is a block of data from input segments. Input data goes through checksum function, by which it is fragmented and passed together with fragmented data(segments) to receiver.
The receiver then adds bits of segments AND checksum value, and gets the 1's complement, which must be 0. If it is not 0, it means there was transmission error.
Blocks of data get a small amount of value attached. CRC is generated by adding 0 or 1 * X^n where n is position in bits. So for example, 100101 is represented as:
1xX^5 + 0xX^4 + 0xX^3 + 1xX^2 + 0xX^1 + 1xX^0
= X^5 + X^2 + 1 = G(X)
And then if the transmitted data is 101101001, we just take leading coefficient from G(X) and multiply that to given data, which becomes 10110100100000.
And on the reception of the data on receiver side, it checks error by reapplying G(X) by dividing given data by G(X) which must be 0 if no error happened.