Fact-checked by Grok 2 weeks ago

Longitudinal redundancy check

A longitudinal redundancy check (LRC), also known as a horizontal redundancy check, is an error-detection technique in data communications that verifies the of a of transmitted by generating and appending a check character based on preset rules applied uniformly to each character in the . The receiving station recomputes the check on the received using the same rules and compares it to the received check character; a match confirms successful transmission of the without detected errors. In operation, LRC organizes data into a two-dimensional of rows (representing characters or bytes) and columns (representing bit positions), computing a for each column across all rows to form the LRC byte, which is then transmitted with the data block. This , often implemented as an XOR operation on corresponding bits across the block, detects single-bit errors and burst errors up to the block length but fails to identify even-numbered errors in the same bit position ( of 2). When combined with a vertical redundancy check (VRC), LRC enables both detection and correction of single-bit errors by isolating the faulty bit at the intersection of mismatched row and column parities. LRC has been widely applied in legacy telecommunication protocols, industrial control systems like RTU for , and early data transmission standards to ensure reliability with minimal overhead. Its simplicity allows efficient computation in resource-constrained environments, though modern systems often prefer (CRC) for superior error-detection performance against multi-bit and burst errors. Despite limitations in undetected error rates (e.g., 3.125% for 32-bit chunks), LRC remains relevant in specific and applications where low computational cost is prioritized.

Overview

Definition and Purpose

The Longitudinal Redundancy Check (LRC) is a form of redundancy check that is applied independently to each of a parallel group of bit streams within a , typically employing a single for each stream. This method organizes into rows and columns, where the check is computed longitudinally across the rows for each bit position, generating a check byte that captures the of corresponding bits across the entire block. The primary purpose of LRC is to detect errors in block-based data transmission, enabling the identification of faults such as single-bit flips or burst errors within the block by appending the check byte to the . In practice, data is divided into fixed-size blocks—for instance, sequences of bytes—and the LRC byte is appended to each block to facilitate verification at the receiver, ensuring overall without correcting the errors. LRC operates as a longitudinal along the length of the block, in contrast to vertical checks that apply to individual characters or bytes. As an extension, LRC can be combined with vertical redundancy checks (VRC) to enable not only detection but also correction of single-bit errors. XOR-based variants of LRC are employed in specific communication protocols to compute the check value efficiently.

Historical Development

The Longitudinal redundancy check (LRC) emerged as an extension of basic techniques for detection in . Developed alongside the vertical redundancy check (VRC), which applies to individual characters, LRC addressed the limitations of VRC by computing across entire blocks of , enabling detection of burst errors in bit streams. This combination formed a two-dimensional scheme, enhancing reliability in and environments. Formalization of LRC occurred through international standards, with the first edition of ISO 1155 published in 1973, replacing the earlier ISO/R 1155 recommendation of 1969 and specifying its use for detecting errors in information messages via a longitudinal check in 7-bit coded systems. This standard was revised in 1978 to refine procedures for synchronous and asynchronous , emphasizing even across bit positions in starting from like STX or SOH. By standardizing LRC, ISO 1155 facilitated its integration into information processing systems, marking a key step in its adoption for reliable exchange. A significant milestone in LRC's adoption came in the mid-1980s with its inclusion in (IETF) documents for network protocols. RFC 935 (1985), outlining reliable protocols, described LRC as a character-oriented method involving the exclusive-OR of all characters in a frame to ensure an even number of 1 bits, suitable for asynchronous links but noted as weaker than (CRC). This positioned LRC within early efforts, alongside protocols like DDCMP, though it was recommended primarily for low-overhead scenarios. LRC's evolution saw initial widespread use in both serial transmission for character streams and parallel transmission for block data in storage and communication systems. By the 1990s, however, it was largely supplemented in new designs by more robust methods like CRC, which offered superior burst-error detection with polynomial-based computations, while LRC persisted in legacy block-oriented protocols and simple checksum applications.

Mechanism

Computation Process

The computation of the Longitudinal Redundancy Check (LRC) involves organizing the data into a two-dimensional , with rows representing individual bytes (or characters) and columns representing bit positions (0 to 7). For each column, a is calculated across all rows, typically using an even or XOR , to form the 8-bit LRC byte. This LRC byte is then appended to the data for . The assumes fixed-width 8-bit bytes and applies to the entire , such as headers, , and control characters. The resulting LRC ensures that the (or XOR) of each bit position across the entire , including the LRC, is even (or zero for XOR). This provides a form of detection by verifying bit-wise consistency at the receiver. The step-by-step algorithm proceeds as follows: Initialize an 8-bit LRC value to zero. For each byte b_i (where i = 1 to n, and n is the number of bytes in the block excluding LRC), update the LRC by performing a bitwise XOR operation: LRC = LRC XOR b_i. After processing all bytes, the final LRC value is appended to the block. Equivalently, the LRC can be viewed as the XOR of all data bytes, such that including the LRC yields a total XOR of zero. This operation is performed independently on each bit position, aligning with the column in the 2D array representation. Mathematically, let the data bytes be b_1, b_2, \dots, b_n. The LRC is given by: \text{LRC} = \bigoplus_{i=1}^n b_i where \oplus denotes bitwise XOR. Thus, the total XOR including LRC, \bigoplus_{i=1}^n b_i \oplus \text{LRC} = 0. This property enables detection of errors that alter the parity in any bit position.

Verification and Error Detection

At the receiving end, the LRC verification process involves recomputing the LRC value over the received data block, excluding the received LRC byte itself, using the identical algorithm applied by the sender. The recomputed value is then compared to the received LRC byte; if they match, the block is deemed valid and accepted, whereas a mismatch indicates an error, prompting the receiver to discard the block and request retransmission. Alternatively, the XOR of the entire block including the received LRC can be computed; it should equal zero for valid transmission. This step ensures data integrity without correcting the errors, relying instead on higher-layer protocols for recovery. The LRC exhibits strong error detection capabilities for certain error patterns, reliably detecting all single-bit errors within the block due to its of 2. It also detects all odd-numbered bit errors across the block, as these alter the in at least one bit position. However, its effectiveness is limited for even-numbered burst errors exceeding the block size, where such errors may align in ways that preserve the parity across columns, potentially going undetected. A key validation criterion in LRC implementations is that the total XOR (or ) of all block bytes including the LRC byte equals zero; any deviation from this condition signals an and triggers retransmission. Undetected in LRC occur with low probability under random conditions, where the fraction of undetected two-bit errors is approximately 3.125% for typical chunk sizes, but this probability rises significantly for systematic burst errors compared to more robust polynomial-based methods like , which offer better coverage for structured fault patterns.

Variants

Basic LRC

The basic Longitudinal Redundancy Check (LRC) applies longitudinal across all bytes in a data block, generating an 8-bit check byte in which each bit corresponds to the parity of the aligned bit positions from every byte in the block. This check byte is appended to the block for transmission, enabling the to verify the of the entire data unit by recomputing the parities. In contrast to the Vertical Redundancy Check (VRC), which calculates parity vertically within each individual byte to detect errors in single characters, LRC operates horizontally across the sequence of bytes in the block; the basic form functions independently without requiring VRC integration. This horizontal approach ensures that errors affecting multiple bytes can be identified through changes in the block-wide bit parities. Fundamentally, basic LRC serves as a checksum based on , detecting errors when the recomputed of the received differs from the transmitted byte due to bit flips or other alterations. It is particularly suited to 8-bit systems, where longitudinal is evaluated separately for each of the eight bit positions spanning the 's bytes. The byte can be derived by aggregating the bits in each position, often using even or conventions to maintain consistency across the system.

Optimal Rectangular Code

The Optimal Rectangular Code (ORC) is an enhanced variant of the (LRC) that incorporates transverse redundancy checks (TRC) to enable correction within rectangular blocks. It structures as an n by (n-1) array, where n represents the number of tracks (typically 9 for systems), with each row consisting of bytes followed by an LRC check byte computed as the modulo-2 sum of the preceding bytes to ensure even . Orthogonal to this, a dedicated track runs vertically across all bytes in each column, providing TRC bits that maintain even for every horizontal position, including the LRC check bytes themselves. This dual mechanism forms tracks along both dimensions of the rectangular block, adding minimal overhead—approximately 25% for a 9-track —while enabling comprehensive localization. For error correction, ORC identifies single-bit errors through syndrome calculations derived from the parity mismatches. The LRC syndrome, computed by re-summing the bytes in each row against the stored check byte, pinpoints the erroneous byte by indicating which row fails ; meanwhile, the TRC syndrome, obtained by checking the vertical parity against the received data columns, identifies the faulty bit position within that byte by flagging the specific in error. These two syndromes together form an error locator that precisely indicates the row and column of the single-bit fault, allowing correction via bit inversion at that intersection without affecting other data. An overall parity check across the entire , including the LRC row and TRC column, verifies the integrity of the parity bits themselves, ensuring even for the complete rectangular . This process corrects any single-bit error per reliably. ORC was developed for high-density storage and transmission systems, such as IBM's 6250 bits-per-inch 3420 series units using 9-track formats, where it addressed error-prone environments like tape wear or signal degradation. It corrects one per but can detect (though not correct) multiple errors by identifying failures beyond a single mismatch, alerting systems to potential for retransmission or further processing. This capability made ORC a practical choice for early reliable data handling in batch-oriented tape drives.

Implementation

Pseudocode

The pseudocode for computing a longitudinal redundancy check (LRC) provides a straightforward algorithmic implementation for ensuring during block transmission. According to the ISO 1155 standard, the LRC is calculated as the modulo-2 sum (equivalent to bitwise XOR) of all bytes in the , resulting in an 8-bit value appended to the . This method assumes 8-bit byte operations and can be easily adapted to programming languages such as C or for processing byte arrays. The following illustrates the ISO 1155 computation process:
initialize lrc = 0
for each byte b in the block:
    lrc = lrc XOR b
append lrc to the block
An alternative iterative form uses arithmetic modulo 256 followed by a adjustment, commonly employed in protocols like for ASCII mode. This variant computes the sum of bytes, masks to 8 bits, and then applies the to ensure the total sum including the LRC is zero modulo 256. for this alternative:
initialize lrc = 0
for each byte b in the block:
    lrc = (lrc + b) AND 0xFF
lrc = ((lrc XOR 0xFF) + 1) AND 0xFF
append lrc to the block
To verify the received block, recompute the LRC on the data bytes excluding the received LRC byte, then check if the XOR of the recomputed LRC and the received LRC equals zero; if so, the block is intact. This verification applies to the XOR-based method and assumes no errors in . Pseudocode for verification (XOR-based):
recomputed_lrc = 0
for each byte b in the received block excluding the final LRC byte:
    recomputed_lrc = recomputed_lrc XOR b
if (recomputed_lrc XOR received_lrc) == 0:
    block is valid
else:
    error detected
For the arithmetic variant, instead checks if the sum of all bytes including the received LRC equals zero 256.

Use in Protocols

The Longitudinal Redundancy Check (LRC) finds application in several communication protocols, particularly those requiring simple, low-overhead detection in constrained environments. In the protocol's ASCII mode, LRC serves as the error-checking mechanism, where it is computed as the of the sum of all bytes in the message frame (excluding start and end delimiters), appended as a two-character value. This approach enables reliable transmission over serial lines in industrial systems, such as programmable logic controllers and supervisory control and data acquisition () setups. In metering systems, IEC 62056-21 employs LRC for verifying the integrity of blocks exchanged between a hand-held unit and devices via interfaces. The LRC is calculated by XORing all characters in the block (per ISO/IEC 1155:1978), excluding start and end characters, and appended as a single byte to detect errors in modes A, B, or C. This method supports local readout in utility meters for , gas, and , ensuring compatibility in , low-power devices. For communications, ISO/IEC 7816-3 specifies LRC as the default error detection code (optional, unless is used) in the epilogue field of T=1 protocol blocks, computed as the byte-wise XOR of all bytes from the node address (NAD) through the information field (INF), such that the XOR including the LRC equals 00. It is particularly used in contact-based cards for secure data exchange in applications like and systems, where computational efficiency is paramount. The ACCESS.bus protocol, designed for connecting PC peripherals such as keyboards and pointing devices, integrates an XOR-based LRC (termed checksum) in message formats, where the final byte is the XOR of all preceding bytes to yield zero upon verification. This facilitates error-free data transfer in low-speed, multi-drop bus topologies for legacy consumer electronics. LRC remains prevalent in legacy and low-overhead systems, including embedded devices and serial communications, owing to its computational simplicity and the speed of its typical 8-bit XOR variant, which requires minimal processing resources compared to more robust methods. Although it has been largely phased out in high-speed networks in favor of cyclic redundancy checks (CRC) for superior burst-error detection, LRC persists in ISO standards like IEC 62056-21 and ISO/IEC 7816 to maintain backward compatibility and efficiency in resource-limited scenarios.

Evaluation

Comparison to Other Methods

The Longitudinal Redundancy Check (LRC) serves as a specialized form of block , typically employing XOR or modular addition across bytes in a fixed-length block to compute a byte. This approach makes LRC simpler and computationally faster than general checksum methods, such as the Fletcher or Adler algorithms, which use running sums over arbitrary-length and can better handle variable packet sizes in protocols like . Both detect single-bit errors and some double-bit errors with a (HD) of 2, but general checksums offer improved mixing of bits to reduce undetected error probabilities in longer or variable streams, achieving HD up to 3 for short lengths before degrading. In contrast to Cyclic Redundancy Checks (CRC), LRC relies on straightforward linear operations like byte-wise XOR, whereas CRC performs polynomial division in GF(2), enabling detection of longer burst errors up to the degree of the polynomial plus one (e.g., CRC-16 detects bursts up to 17 bits). LRC exhibits an HD of 2 and detects bursts up to 8 bits for an 8-bit check, making it less reliable for high-noise environments compared to CRC's higher HD (e.g., 4 for CRC-16) and lower undetected error rates. For example, at 10 KB message length and BER=10^{-6}, CRC-16 has an approximate undetected error probability (Pud) of ~10^{-6}, compared to LRC's undetected error fraction of ~3% for 32-bit chunks (a conditional probability given errors). Notably, LRC is mathematically equivalent to an 8-bit CRC using the primitive polynomial x^8 + 1, but standard CRC polynomials like x^{16} + x^{15} + x^2 + 1 provide superior burst error detection and data independence, favoring CRC in applications such as Ethernet frames or storage media where robustness outweighs minimal added complexity. LRC finds use in legacy block-oriented systems like magnetic tapes for quick parity validation, while general checksums suit lightweight network headers, and CRC dominates in demanding scenarios requiring high integrity, such as avionics or file transfers.
MethodMechanismError Detection CapabilitiesComputation ComplexityHardware Support
LRC (8-bit)Byte-wise XOR or sumHD=2; detects 1-bit errors, 8-bit bursts; ~3% undetected fraction for 32-bit chunksSimple linear ops; O(n) timeBasic gates; no tables needed
Checksum (e.g., Fletcher-32)Running modular additionHD=2-3; detects 1-2 bit errors; Pud ~10^{-11} at 10KB (BER=10^{-6})Addition with carry handling; O(n)Adders; software-efficient
CRC (e.g., 16-bit)Polynomial division (GF(2))HD=4; detects bursts up to 17 bits; Pud ~10^{-6} at 10KB (BER=10^{-6})Shift-XOR; table-acceleratedShift registers; LUTs common

Strengths and Limitations

One key strength of the Longitudinal Redundancy Check (LRC) is its low computational overhead, as it relies on simple bitwise XOR or addition operations across blocks, making it suitable for applications and resource-constrained systems. This simplicity also facilitates easy implementation using basic generators, which require minimal circuitry compared to more complex codes. Furthermore, LRC effectively detects single-bit errors and short-burst errors within the block size, as it identifies any odd number of errors in vertical slices of the data matrix. However, LRC has significant limitations as an error-detection method, primarily its inability to correct —it only signals their presence, necessitating retransmission in most cases, though extended forms may offer limited correction. It performs poorly against long burst exceeding the block size and is vulnerable to systematic , such as an even number of bit flips in each column, which leave the check sum unchanged and go undetected. For random bit , the undetected error probability is approximately $2^{-8} for an 8-bit LRC on messages longer than 8 bits, offering lower reliability than (CRC) methods, which achieve around $2^{-16} or better. Consequently, LRC has become outdated for high-speed networks since the , where more robust codes prevail. In applications, LRC remains best suited for low-bandwidth, systems such as bisynchronous protocols, but it lacks integration with (FEC) techniques, limiting its use in modern error-resilient environments.

References

  1. [1]
    longitudinal redundancy check (LRC) - ATIS Telecom Glossary
    A system of error control based on the formation of a block check following preset rules. Note 1: The block check formation rules are applied in the same ...Missing: standard | Show results with:standard
  2. [2]
    LRC (Longitudinal Redundancy Check) - Gartner Glossary
    A data communications error-trapping technique in which a character is accumulated at both the sending and receiving stations during the transmission.
  3. [3]
    [PDF] Selection of Cyclic Redundancy Code and Checksum Algorithms to ...
    A longitudinal redundancy check (LRC), also known as an XOR checksum, involves XORing all the chunks of a dataword together to create a check sequence. It is ...
  4. [4]
    G.707 : Network node interface for the synchronous digital hierarchy (SDH)
    **Summary of BIP-8 and Longitudinal Redundancy Check in ITU-T G.707:**
  5. [5]
    Longitudinal redundancy check (LRC) - exida
    Longitudinal redundancy check (LRC). Error detection scheme that consists of a byte where each bit is calculated on the basis of the parity of all the bits ...
  6. [6]
    [PDF] Chapter 55 Error Detection
    The extra redundant bits carry information for error detection for the data unit. If the received data stream pass the checking function, the redundant bits ...Missing: telecommunication | Show results with:telecommunication
  7. [7]
    [PDF] INTERNATIONAL STANDARD @ 1155
    Oct 1, 1973 · It consists of accompanying the data block or text by one checking character (in addition to character parity) and it is often referred to as ...
  8. [8]
    [PDF] ISO 1155:1978 - iTeh Standards
    ISO 1155:1978 defines a method for detecting errors in information messages using longitudinal parity by adding a block check character.
  9. [9]
    RFC 935 - Reliable link layer protocols - IETF Datatracker
    Most synchronous uses require a cyclic redundancy check sequence be attached to each frame. This is a 16-bit sequence which can be easily generated and checked ...
  10. [10]
    [PDF] Specification and Implementation Guide for MODBUS over serial line
    Dec 20, 2006 · The LRC field is one byte, containing an 8–bit binary value. The LRC value is calculated by the device that emits, which appends the. LRC to the ...
  11. [11]
    [PDF] Error Detection
    Apr 29, 2013 · Example: Longitudinal Redundancy Check (LRC). ◇ LRC is a byte-by-byte parity computation. • XOR all the bytes of the data word together ...Missing: formula | Show results with:formula
  12. [12]
    [PDF] Selection of Cyclic Redundancy Code and Checksum Algorithms to ...
    The undetected fraction is the number of undetected errors out of all possible errors that involve HD bits, which varies depending upon the error detection code ...
  13. [13]
    Optimal rectangular code for high density magnetic tapes
    The optimal rectangular code (ORC), presented here, is designed to correct ... error-correction mechanism. The code can be generalized to multiple-channel ...
  14. [14]
  15. [15]
    [PDF] iTeh Standards (https://standards.iteh.ai) Document Preview
    International Standard IEC 62056-21 has been prepared by IEC Technical Committee 13: ... This part of IEC 62056 describes hardware and protocol specifications for ...
  16. [16]
    [PDF] ISO/IEC 7816-3
    Nov 1, 2006 · The epilogue field conveys the error detection code of the block, either a longitudinal redundancy code (LRC), or a cyclic redundancy code (CRC) ...
  17. [17]
    [PDF] ACCESS.busTM - ReAl
    ACCESS.bus Base Protocol Specification V3.0. 2-1. 2. ACCESS.bus Base Protocol ... This function call is used to report bus errors that where detected by the ...
  18. [18]
  19. [19]
    [PDF] Tutorial: Checksum and CRC Data Integrity Techniques for Aviation
    May 9, 2012 · Example: Longitudinal Redundancy Check (LRC). • LRC is a byte-by-byte ... – One's complement addition is the same as modulo 255 addition.
  20. [20]
    Longitudinal Redundancy Check in Computer Networks
    Jan 10, 2023 · One major disadvantage is that it can only detect errors, not correct them. This means that if an error is detected, the data must be ...
  21. [21]
    Longitudinal Redundancy Check (LRC)/2-D Parity Check
    Jul 15, 2025 · Longitudinal Redundancy Check (LRC) is also known as 2-D parity check. In this method, data which the user want to send is organised into tables of rows and ...
  22. [22]
    Are LRC (Longitudinal Redundancy Check) or CRC (Cyclic ...
    Jul 9, 2019 · In the old days of tape drives, LRC was used for error detection. They were also used (at certain point in time) for ensuring data integrity.