The invention generally relates to computers and computer networks and in particular to a cumulative error detecting code.
In computer networks or data networks, data cells are transmitted from a source to a destination over a fabric or network. The fabric or network may include a collection of switches that are interconnected via communication links. Regardless of the design of the network, there will usually be errors during transmission over the fabric or network, resulting in the change or corruption of one or more bits in a transmitted cell.
Error detection techniques are frequently used to detect some types of errors. For a given frame of bits or cell, additional bits that constitute an error detecting code are added to the cell or frame at the source before the cell is transmitted. The error detecting code is calculated as a function of the other transmitted bits. The destination device performs the same calculation on the received bits and compares the calculated code with the received error detecting code. A detected error occurs if and only if there is a mismatch.
One of the most common and one of the most powerful error detecting codes is the cyclic redundancy check (CRC), which can be described as follows. Given a k-bit block of bits, or message, the transmitter (or source) generates an n-bit sequence, known as a checksum (or frame check sequence) so that the resulting frame, consisting of k+n bits, is exactly divisible by some predetermined number. The resulting frame (or cell), including the k-bit message with the n-bit checksum appended thereto, is then transmitted to a destination. At the destination, the received resulting frame (k+n bits) is divided by the same predetermined number. If there is no remainder, then the receiver at the destination assumes there was no error.
While error detecting codes such as CRC can be used to detect some types of transmission errors, there may be several types of errors which are undetectable by a standard error detecting code or CRC. Therefore, there is a need for an improved error detection technique.
According to an embodiment of the present invention, a method of transmitting cells is provided. An error detecting code of a previous cell is stored. The next cell to be transmitted is received. The error detecting code of the previous cell is appended to the next cell, and a next error detecting code is calculated as a function of at least a portion of the next cell to be transmitted and the error detecting code of the previous cell appended thereto. The error detecting code of the previous cell appended to the next cell is replaced with the next error detecting code. The next cell including the next error detecting code appended thereto is then transmitted.
According to another embodiment of the present invention, a method of receiving a cell is provided. A previous error detecting code is stored. A next cell is received including a next error detecting code appended thereto. The next error detecting code is stored. The next error detecting code appended to the next cell is replaced with the previous error detecting code. A test error detecting code is calculated as a function of the next cell and the previous error detecting code appended thereto. The test error detecting code is compared with the next error detecting code to determine if there is an error in the received next cell.