Longitudinal Redundancy Check (LRC) is an error detection technique used by the TCP/IP protocol suite to detect errors in a block of data. Unlike Vertical Redundancy Check (VRC), which operates on a column-wise basis, LRC checks for errors horizontally across the entire block of data.
In Longitudnal Redundancy Check (LRC), also called 2-dimensional parity, a block of bits is organized in rows and columns. A parity bit is then calculated for each column.
How does Longitudinal Redundancy Check work?
To understand better, let’s take an example. Suppose we want to transmit:
11101001 | 01100101 | 10101001 | 11100110 |
Let’s see how the Longitudinal Redundancy Check (LRC) would handle it:
Sender’s Side
- Organize the data bits in rows and columns. In this case:
1 | 1 | 1 | 0 | 1 | 0 | 0 | 1 |
0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 |
1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 |
1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 |
- Calculate the parity bit for each column
Each column is checked for parity. The total number of ‘1’s is counted in each column. If the total is odd, bit 1 is added. If it is even bit 0 is added. In this case the original data is:
1 | 1 | 1 | 0 | 1 | 0 | 0 | 1 |
0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 |
1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 |
1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 |
Calculating parity column wise gives us:
1 | 1 | 1 | 0 | 1 | 0 | 0 | 1 |
0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 |
1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 |
1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 |
1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 |
- A new block of parity bits is made. This block is called the parity block or the LRC code. In this case the parity block is 11000011:
1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 |
- This block is transmitted along with the data. In this case, the original data to be transmitted was:
11101001 | 01100101 | 10101001 | 11100110 |
Now the parity block is added and the data to be transmitted becomes:
11000011 | 11101001 | 01100101 | 10101001 | 11100110 |
Parity Block | Original Data |
NOTE: The data transmission in Longitudinal Redundancy Check (LRC) occurs in such a way that the last block to be transmitted is the parity block.
Receiver’s Side
- The receiving device, receives the following data:
11000011 | 11101001 | 01100101 | 10101001 | 11100110 |
Parity Block | Original Data |
- Receiver seperates the transmitted LRC code or parity block and the original data.
- The receiver organizes the remaining data bits into rows and columns. It then calculates the parity block. The calculation is done in the same manner as it was done by the sender (Table 1, Table 2 and Table 3). This gives the receiver the calculated LRC code.
- The receiver compares the transmitted LRC code and the calculated LRC code. If they are identical, this indicated that there was no error during network transmission. If however, they aren’t identical, an error has occured.
Advantages:
- Comprehensive error detection: LRC can detect errors across multiple positions within a data block, including both single-bit and multiple-bit errors.
- Relatively simple implementation: While LRC requires XOR operations, it can be implemented efficiently with minimal computational overhead.
Limitations:
Inefficiency for burst errors: The biggest drawback of LRC is that if 2 bits in one data unit are damaged and two bits in exactly the same position in another data unit are also damaged, no error would be detected. Let’s take an example:
Suppose the sender is transmitting:
1100 | 0101 |
The sender organizes the data into rows and columns and calculates the parity:
1 | 1 | 0 | 0 |
0 | 1 | 0 | 1 |
1 | 0 | 0 | 1 |
Thus, the partity block or the LRC code is 1001.
Thus, the sender transmits 1001 1100 0101 to the receiver:
1001 | 1100 | 0101 |
Parity Block | Data unit 2 | Data unit 1 |
Now, during transmission, error occurs such that the 1st and last bit of Data unit 1 AND the 1st and last bit of Data unit 2 both are flipped. The data now becomes: 0101 1100 (Bold bits are the erroneous ones).
Thus the data received is :
1001 | 0101 | 1100 |
Parity Block | Data unit 2 | Data unit 1 |
The receiver removes the received or transmitted LRC code and calculates the LRC code
0 | 1 | 0 | 1 |
1 | 1 | 0 | 0 |
1 | 0 | 0 | 1 |
The calculated LRC code is 1001. This code is compared with the transmitted LRC code. As the two codes are identical, the receiver concludes that there was no error in transmission. This, however, is untrue.
Applications of Longitudinal Redundancy Check:
LRC finds applications in various communication systems and storage devices where comprehensive error detection is required. It is commonly used in protocols such as asynchronous transmission protocols (e.g., asynchronous serial communication) and in some disk storage systems.
I know this if ᧐ff topіc but I’m looking into starting my own blog and was
wondering what all is required to get set up?
I’m assuming having a bⅼog like yours would cost a pretty penny?
I’m not very internet savvy so I’m not 100% sure. Any suggestions or
adviϲе would be greatlʏ appreciated. Appreciate it
Would love to help. It’s a simple wordpress blog. Doesn’t cost much to set up.