Jump to content

Longitudinal redundancy check

From Wikipedia, the free encyclopedia

In telecommunication, alongitudinal redundancy check(LRC), orhorizontal redundancy check,is a form ofredundancy checkthat is applied independently to each of a parallel group of bit streams. The data must be divided intotransmission blocks,to which the additional check data is added.

The term usually applies to a singleparity bitper bit stream, calculated independently of all the other bit streams (BIP-8).[1][2]

This "extra" LRC word at the end of a block of data is very similar tochecksumandcyclic redundancy check(CRC).

Optimal rectangular code[edit]

While simple longitudinalparitycan onlydetecterrors, it can be combined with additional error-control coding, such as atransverse redundancy check(TRC), tocorrecterrors. The transverse redundancy check is stored on a dedicated "parity track".

Whenever any single-bit error occurs in a transmission block of data, such two-dimensional parity checking, or "two-coordinate parity checking",[3] enables the receiver to use the TRC to detect which byte the error occurred in, and the LRC to detect exactly which track the error occurred in, to discover exactly which bit is in error, and then correct that bit by flipping it.[4][5][6]

Pseudocode[edit]

International standardISO 1155[7]states that a longitudinal redundancy check for a sequence of bytes may be computed insoftwareby the following algorithm:

lrc:= 0
for eachbytebin the bufferdo
lrc:= (lrc+b)and0xFF
lrc:= (((lrcXOR 0xFF) + 1)and0xFF)

which can be expressed as "the 8-bit two's-complement value of the sum of all bytes modulo 28"(x AND 0xFFis equivalent tox MOD 28).

Other forms[edit]

Many protocols use an XOR-based longitudinal redundancy check byte (often calledblock check characteror BCC), including the serial line interface protocol (SLIP, not to be confused with the later and well-knownSerial LineInternetProtocol),[8] theIEC 62056-21 standard for electrical-meter reading, smart cards as defined inISO/IEC 7816,and theACCESS.busprotocol.

An 8-bit LRC such as this is equivalent to acyclic redundancy checkusing the polynomialx8 + 1, but the independence of the bit streams is less clear when looked at in that way.

References[edit]

  1. ^ RFC935:"Reliable link layer protocols".
  2. ^ "Errors, Error Detection, and Error Control: Data Communications and ComputerNetworks: A Business User's Approach".
  3. ^"Chapter1".Archived fromthe originalon 2013-06-13.Retrieved2012-08-20.
  4. ^ Gary H. Kemmetmueller. "RAM error correction using two dimensional parity checking".
  5. ^ Oosterbaan. "Longitudinal parity".
  6. ^ "Errors, Error Detection, and Error Control".
  7. ^ISO 1155:1978Information processing -- Use of longitudinal parity to detect errors in information messages.
  8. ^ RFC914. "A Thinwire Protocol for connecting personal computers to the INTERNET". Appendix D: "Serial Line Interface Protocol (SLIP)".