reference is now made to fig1 , which is a block diagram that schematically illustrates a data communication system 20 , in accordance with an embodiment of the present invention . a source node 22 conveys data blocks , typically packets , over a communications network 24 to a destination node 26 . source node 22 comprises a data source 28 , typically an application running on the source node , a crc calculator 30 , and a transmit circuit 32 . for each data block generated by data source 28 , crc calculator 30 calculates a crc based on a predetermined polynomial g ( x ), as is known in the crc art , and appends the crc to the data block . destination node 26 comprises a host computer system 34 and a network interface device ( nid ) 36 , which provides host 34 with an interface to network 24 . host 34 offloads a portion of protocol stack processing to nid 36 . although the nid is shown as a separate component of destination node 26 , the nid may be implemented as a component of host 34 , such as a network interface card ( nic ). nid 36 comprises a receive circuit 38 , which processes the input data blocks received from network 24 , and passes the blocks to a protocol parser 40 . parser 40 terminates at least one protocol of the protocol stack . to terminate the protocol , parser 40 typically extracts and reorders sub - blocks of data from the input block , and removes protocol - related data , such as headers , markers , and padding , resulting in an output block at a higher protocol level . parser 40 typically does not use the received crc to check the validity of the data of the input block . instead , a crc correction calculator 42 of nid 36 calculates an error correction term based on the relative positions of the sub - blocks in the input block and output block , as described hereinbelow with reference to fig2 and 3 . an aggregator 44 of nid 36 appends the error correction term and the original crc to the output block , and passes the output block to host 34 . nid 36 thus passes the original crc directly from the input block to the output block , without performing any computations on or with the original crc . nid 36 typically does not use the original crc to validate the integrity of the input block . such direct passing of the original crc generally reduces the likelihood of the original crc being corrupted because of hardware or software errors . alternatively , nid 36 uses the original crc to validate the integrity of the input block , and discards the input block if the crc check fails . nid 36 typically carries out these function in dedicated hardware , such as a custom or programmable logic chip . alternatively , the nid may perform some or all of these functions in software , which may be downloaded to the nid in electronic form over a network , for example , or it may alternatively be supplied on tangible media , such as cd - rom . upon receiving the output block , a crc check module 46 of host 34 determines whether to accept or reject the output block . crc check module 46 calculates the crc of the output block , as is known in the crc art . the crc check module combines the original error detection code of the input block with the error correction term , typically using an xor operation . the crc check module compares this combined value with the calculated crc of the output block . a match indicates that the output block is valid , while a non - match generally indicates that the output block should be discarded . typically , host 34 comprises a standard general - purpose processor with appropriate memory , communication interfaces and software for carrying out the crc computations described herein . this software may be downloaded to the host in electronic form over a network , for example , or it may alternatively be supplied on tangible media , such as cd - rom . reference is now made to fig2 , which is a block diagram that schematically illustrates the termination of an input protocol data unit ( pdu ) 60 , in accordance with an embodiment of the present invention . input pdu 60 comprises an input block 62 , labeled block s , and a crc s 64 , as calculated by crc calculator 30 of source node 22 . in order to process block s , protocol parser 40 divides block s into n + 1 sub - blocks 66 , labeled a 0 . . . a n , which may be of different sizes . sub - blocks 66 represent protocol - specified data fields , such as payload , headers , markers , and padding . to generate a higher protocol level output block 70 , labeled block d , parser 40 typically strips block s of a portion of the sub - blocks , and concatenates the remaining sub - blocks , not necessarily in their original order . the resulting block d comprises m + 1 sub - blocks b 0 . . . b m , wherein m is less than n . in the example shown in fig2 , parser 40 strips sub - blocks a 0 , a 4 , and a n from block s , and reverses the order of blocks a 2 and a 3 . aggregator 44 appends to block d original crc s 64 and an error correction term δcrc 72 ( calculated as described hereinbelow with reference to fig3 ), resulting in an output pdu 74 , which nid 36 passes to host 34 . fig3 is a flow chart schematically illustrating a method for calculating error correction term 72 , in accordance with an embodiment of the present invention . crc correction calculator 42 begins the method by zeroing a correction term accumulator variable t , at a zero t step 100 . calculator 42 also zeroes a loop counter i , at a zero i step 102 . alternatively , calculator 42 uses other techniques for loop control , as will be apparent to those skilled in the art . at an output block inclusion check step 104 , calculator 42 checks whether sub - block a i is included in output block d . if calculator 42 finds that sub - block a i is not included in output block d , at a remove factor step 106 the calculator determines a temporary variable e using a remove factor defined as : remove ⁢ ⁢ factor ⁡ ( a i , m ) = ⁢ ( crc ⁡ ( a i ) * x m ) ⁢ ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) = ⁢ ( crc ⁡ ( a i ) * ⁢ ( x m ⁢ mod ⁢ ⁢ g ⁡ ( x ) ) ) ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) ( 1 ) wherein a i is the sub - block being removed from block s , and m is the offset of the sub - block within the block , which offset is equal to the number of bits following the sub - block within the block . calculator 42 uses the same primitive polynomial for this calculation as crc calculator 30 used when calculating crc s 64 . on the other hand , if the calculator finds that current sub - block a i is included in output block d , at a shift factor step 108 the calculator determines e using a shift factor defined as : shift ⁢ ⁢ factor ⁡ ( a i , m , n ) = ⁢ ( crc ⁡ ( a i ) * ( x m + x n ) ) ⁢ ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) = ⁢ ( crc ⁢ ( a i ) * ⁢ ( x m + x n ) ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) ) ⁢ ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) = ⁢ ( crc ⁡ ( a i ) * ( x m ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) + ⁢ x n ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) ) ⁢ ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) ) ( 2 ) wherein a i is the sub - block whose location is different in input block s than in output block d , m is the offset of a i within block s , and n is the offset of a i within block d . calculator 42 uses the same primitive polynomial for this calculation as crc calculator 30 used when calculating crc s 64 . if m equals n , calculator 42 sets e equal to 0 . in either case , calculator 42 accumulates the determined value of e by setting t equal to t xor e , at an accumulation step 110 . it is to be noted that there typically is no need to store the value of sub - block a i once temporary variable e has been calculated for a i . at an increment i step 112 , the calculator increments i , and , if i is less than or equal to n ( the highest - numbered sub - block in input block s ), as determined at a loop check step 114 , calculator 42 returns to step 104 for processing the next sub - block . otherwise , the calculator concludes the method by setting error correction term δcrc 72 equal to t , at a set δcrc step 116 . a derivation of the remove and shift factors used at steps 106 and 108 is presented hereinbelow . numerous equations mathematically equivalent to these factors will be apparent to those skilled in the art , upon reading the present patent application , and these equivalent equations are within the scope of the present invention . for the purposes of the present derivation , each input block s is represented as a polynomial s ( x )= s 0 + s 1 x + s 2 x 2 + . . . , wherein the coefficients s 0 , s 1 , . . . , are the bits of the data block . when broken into sub - blocks a 0 , . . . , a n , s ( x ) becomes s ⁡ ( x ) = ∑ i = 0 s ⁢ ⁢ a i ⁡ ( x ) · x m i , wherein m i is the offset of each sub - block within block s , and the offset is equal to the number of bits following the sub - block within block s . crc s ( the crc of the complete input block s ) is given by : wherein g ( x ) is a primitive polynomial , and s ( x ) has been augmented by a number of 0 bits equal to the length of g ( x ) in bits , less 1 . taking the simple case in which s is broken into three consecutive sub - blocks a 0 , a 1 , and a 2 , and letting the notation crc ( a , m ) represent the crc of a data block a with m zeros appended thereto ( i . e ., block a binary shifted by m bits ), it can be seen that crc s may also be written as : crc s = ⁢ crc ⁡ ( a 0 , m 1 + m 2 ) ⁢ xor ⁢ crc ⁢ ( a 1 , m 2 ) ⁢ xor ⁢ ⁢ crc ⁡ ( a 2 , 0 ) = ⁢ ( a 0 ⁡ ( x ) * x ⁡ ( m 1 + m 2 ) ) ⁢ ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) ⁢ xor ⁢ ( a 1 ⁡ ( x ) * x m ⁢ 2 ) ⁢ ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) ⁢ xor ⁢ ⁢ a 2 ⁡ ( x ) ⁢ ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) ( 3 ) wherein m i is the length in bits of sub - block a i , and a i has been augmented by a number of 0 bits equal to the length of g ( x ), less 1 . in other words , the crc of a group of consecutive data blocks can be calculated by calculating the crc of each data block separately while substituting zeros for the other blocks . in these expressions , as well as in the description that follows , binary polynomial arithmetic is used , with no carries , as is known in the crc art . equation ( 3 ) shows that if a sub - block is added to a data block after the crc of the block has been calculated , the crc can be modified to cover the bits of the additional sub - block by ( a ) appending the appropriate number of zeros to the additional sub - block , ( b ) calculating the crc of the resulting binary - shifted sub - block , and ( c ) xoring the resulting sub - block crc with the original crc . similarly , because addition and subtraction are equivalent in binary arithmetic using xor operations , if a sub - block is removed from a block after the crc of the block has been calculated , the crc can be modified to exclude the bits of the removed sub - block using the same calculation as is used to add a sub - block . therefore , the correction term of equation ( 1 ) for modifying a crc of a block to remove a sub - block from the block is given by : remove ⁢ ⁢ factor ⁡ ( a i , m ) = ⁢ ( a i ⁡ ( x ) * x m ) ⁢ ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) = ⁢ ( crc ⁡ ( a i ) * x m ) ⁢ ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) = ⁢ ( crc ⁡ ( a i ) * ⁢ ( x m ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) ) ) ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) ( 4 ) wherein a i is the sub - block being removed from the block , and m is the offset of the sub - block within the block , which offset is equal to the number of bits following the sub - block within the block . to correct the crc of the complete block , the remove factor is xored with the crc . when calculator 42 uses equation ( 1 ) to calculate temporary variable e at step 106 , as described hereinabove , a i is the sub - block not included in input block s . equation ( 3 ) also shows that if the location of a sub - block within a block is changed after the crc of the block has been calculated , a compensating modification can be made to the crc by removing the sub - block from its first location and adding the sub - block at its new location . therefore , the correction term of equation ( 2 ) for modifying a crc of a block to shift a sub - block within the block is given by : shift ⁢ ⁢ factor ⁡ ( a i , m , n ) = ⁢ ( a i ⁡ ( x ) * x m ) ⁢ ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) ⁢ xor ⁢ ( a i ⁡ ( x ) * x n ) ⁢ ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) = ⁢ ( crc ⁡ ( a i ) * ( x m + x n ) ) ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) = ⁢ ( crc ⁢ ( a i ) * ⁢ ( x m + x n ) ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) ) ⁢ ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) = ⁢ ( crc ⁡ ( a i ) * ( x m ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) + ⁢ x n ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) ) ⁢ ⁢ mod ⁢ ⁢ ⁢ g ⁡ ( x ) ) ( 5 ) wherein a i is the sub - block being shifted within the block , m is the offset of the original location of the sub - block within the block , and n is the offset of the new location of the sub - block within the block . to correct the crc of the complete block , the shift factor is xored with the crc . reference is now made to fig4 , which is a block diagram that schematically illustrates a data communication system 200 , in accordance with an embodiment of the present invention . a source node 210 conveys data blocks , typically packets , over a communications network 212 to a destination node 214 . source node 210 comprises a host 216 , which generates the blocks of data , and offloads a portion of protocol stack processing to a nid 218 . typically , host 216 comprises a standard general - purpose processor with appropriate memory , communication interfaces and software for carrying out the crc computations described herein . this software may be downloaded to the host in electronic form over a network , for example , or it may alternatively be supplied on tangible media , such as cd - rom . although nid 218 is shown as a separate component of source node 210 , the nid may be implemented as a component of host 216 , such as a network interface card ( nic ). nid 218 comprises a protocol parser 220 , which terminates at least one protocol of the protocol stack . for each data block generated by host 216 , a crc calculator 222 of nid 218 calculates a crc for at least one protocol , as described hereinbelow . an aggregator 224 of nid 218 appends the crc to the data block , and a transmit circuit 226 of nid 218 sends the data block to network 212 . nid 218 typically carries out these function in dedicated hardware , such as a custom or programmable logic chip . alternatively , the nid may perform some or all of these functions in software , which may be downloaded to the nid in electronic form over a network , for example , or it may alternatively be supplied on tangible media , such as cd - rom . a receive circuit 228 of destination node 214 receives the data block from network 212 , and passes it to a crc check module 230 . the crc check module determines whether to accept or reject the block , by calculating the crc of the block , as is known in the crc art . for some applications , source node 210 sends data blocks to destination node 26 , described with reference to fig1 . reference is now made to fig5 , which is a flow chart schematically illustrating a method for calculating an error correction term δcrc for an output block v assembled for transmission , in accordance with an embodiment of the present invention . host 216 generates a data block r for transmission , and calculates a crc r for the block , using techniques known in the crc art . the host appends the crc r to block r , and passes block r to nid 218 . ( block r is referred herein to as input block r with respect to the nid .) protocol parser 220 of nid 218 assembles lower protocol level output data block v by dividing input block r into sub - blocks , and interspersing additional sub - blocks containing protocol - related data , such as headers , markers , and padding . the resulting output data block v has n + 1 sub - blocks a 0 , . . . , a n . to compute crc v for output block v , crc calculator 222 of nid 218 calculates an error correction term δcrc based on the positions of the sub - blocks in output block v relative to their respective positions in input block r , as described immediately hereinbelow . the nid applies δcrc to crc r , typically using an xor operation , in order to produce crc v . aggregator 224 of nid 218 appends crc v to the output block , and passes the output block to network 212 . crc calculator 222 begins the δcrc calculation method by zeroing a correction term accumulator variable t , at a zero t step 150 . calculator 222 also zeroes a loop counter i , at a zero i step 152 . alternatively , calculator 222 uses other techniques for loop control , as will be apparent to those skilled in the art . at an input block inclusion check step 154 , calculator 222 checks whether sub - block a i is included in input block r . if calculator 222 finds that the sub - block is not included in input block r , the calculator determines a temporary variable e using remove factor equation ( 1 ), as described hereinabove , at a remove factor step 156 , setting m to be the offset of sub - block a i within output block v . calculator 222 uses the same primitive polynomial for this calculation as host 34 used when calculating crc r . calculator 222 is able to use the remove factor equation to add a sub - block because , as described hereinabove , addition and subtraction are equivalent in binary xor arithmetic . on the other hand , if at step 154 the calculator finds that sub - block a i is included in input block r , calculator 222 determines e using shift factor equation ( 2 ), as described hereinabove , at a shift factor step 158 . in this case , m is the offset of sub - block a i within input block r , and n is the offset of a i within output block v . after calculating e , whether at step 156 or 158 , calculator 222 accumulates the determined value of e by setting t equal to t xor e , at an accumulation step 160 . at an increment i step 162 , the calculator increments i . if i is less than or equal to n ( the highest - numbered sub - block in output block v ), as determined at a loop check step 164 , calculator 222 returns to step 164 for processing the next sub - block . otherwise , the calculator concludes the method by setting error correction term δcrc equal to t , at a set δcrc step 166 . in an embodiment of the present invention , calculator 42 and / or 222 uses the following code for calculating x m mod g ( x ). the calculator typically uses this code for calculating x m mod g ( x ) and x m + n mod g ( x ) of equations ( 1 ) and ( 2 ), respectively . in this code , m l - 1 m l - 2 . . . m 1 m 0 is the l - bit representation of m . to execute the code , nid 36 or 218 provides a table containing the polynomials x ^ 2 j mod g ( x ) for j = 0 , 1 , . . . , k , wherein 2 k + 1 − 1 is the maximum expected packet length . polynomial multiplication may be implemented using techniques described with reference to fig5 of the above - mentioned u . s . patent application publication 2003 / 0066011 ( the &# 39 ; 011 application ). in order to implement these techniques in hardware , an equation generator is typically used , which describes ( a ) the future state of each memory element in fig5 of the &# 39 ; 011 application , given the present state of the rest of the elements , ( b ) the value of the coefficients of the polynomial p , and ( c ) the n current bits of the polynomial q . appendix a presents exemplary matlab code for such an equation generator . in an embodiment of the present invention , calculator 42 or 222 implements a table - based crc calculator , for example as described with reference to fig2 of the &# 39 ; 011 application . these techniques may be implemented in hardware in a rom table , via a combinatorial network defined by a set of equations which describe the future state of each storage element , given its current state and the n input bits . appendix b presents exemplary matlab code for such an equation generator . the equation generators of appendix a and b are implemented as production rule grammars . each of the character string variables s 0 , s 1 , . . . contains a string describing the content of the storage elements it represents , as a function of its previous state and the input sequence . the variables s 0 , s 1 , . . . are initialized to the strings s 0 ( t - 1 ), s 1 ( t - 1 ), . . . , respectively . the variable i represents the system input , and sequences the string values i 0 , i 1 , i 2 . . . once per each clock . the system state evolves using production rules . for example , the state of storage element s 0 may be determined by the production rule s 0 → s 15 ^ i , so that the string content of s 0 is replaced by the string which is a concatenation of the strings for s 15 with the string ^ ( xor ) and with the string contained in i representing the current input . the production system is implemented with the matlab function sprintf , which performs the string manipulation . the taps of the multiplier polynomial are represented by the constants p 0 , p 1 , . . . , which are built into the production rules . since it is generally not possible in matlab to have a two dimensional array of variable length strings , the main data structure ss [ ] is a vector that stores , in a concatenated form , all of the strings representing s 0 , s 1 , . . . the matrix b [:, :] is used to determine the boundaries of each string . the string sj occupies the substring of ss starting in b [ j , 1 ] and ending in b [ j , 2 ]. appendix c presents an exemplary implementation of several calculations performed by calculator 42 or 222 in matlab code , in accordance with an embodiment of the present invention . the matlab implementation includes the following files : block_crc — calculates the crc of a block of data crc_m — implements the procedure crc_remove crc_m_n — implements the procedure crc_shift mult_mod — implements polynomial multiplication exp_mod — implements x m mode g ( x ) other implementations of the crc arithmetic necessary for carrying out the methods described above will be apparent to those skilled in the art and are considered to be within the scope of the present invention . although the embodiments described hereinabove refer specifically to certain communication protocols , such as tcp / ip , and types of error detecting codes , such as crcs , the principles of the present invention may similarly be applied to data communications using other protocols , which may use error detecting codes of other types . the advantages of the present invention in the context of other protocols , coding algorithms and applications will be apparent to those skilled in the art . it will thus be appreciated that the embodiments described above are cited by way of example , and that the present invention is not limited to what has been particularly shown and described hereinabove . rather , the scope of the present invention includes both combinations and subcombinations of the various features described hereinabove , as well as variations and modifications thereof which would occur to persons skilled in the art upon reading the foregoing description and which are not disclosed in the prior art . b ( i , 2 ) = b ( i , 1 ) + length ( s ) − 1 ; % location of last g = [ 1 0 0 1 1 ]; % g ( x ) = x { circumflex over ( )} 4 + x + 1 d1 = [ 4 5 6 7 8 9 ]; % block of bytes % this function calculates the crc of block b and applies % this function calculates the crc of block b and applies % that contains the entries x { circumflex over ( )}( 2 { circumflex over ( )} i ) mod g ( x )