CN114679239A - CRC (Cyclic redundancy check) segmented calculation method and device in high-speed network - Google Patents

CRC (Cyclic redundancy check) segmented calculation method and device in high-speed network Download PDF

Info

Publication number
CN114679239A
CN114679239A CN202210365156.4A CN202210365156A CN114679239A CN 114679239 A CN114679239 A CN 114679239A CN 202210365156 A CN202210365156 A CN 202210365156A CN 114679239 A CN114679239 A CN 114679239A
Authority
CN
China
Prior art keywords
crc
data
data block
value
calculation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210365156.4A
Other languages
Chinese (zh)
Other versions
CN114679239B (en
Inventor
齐一健
杨凯
朱云姗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Nori Integrated Circuit Design Co ltd
Original Assignee
Beijing Nori Integrated Circuit Design Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Nori Integrated Circuit Design Co ltd filed Critical Beijing Nori Integrated Circuit Design Co ltd
Priority to CN202210365156.4A priority Critical patent/CN114679239B/en
Publication of CN114679239A publication Critical patent/CN114679239A/en
Application granted granted Critical
Publication of CN114679239B publication Critical patent/CN114679239B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)
  • Error Detection And Correction (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention relates to a CRC (cyclic redundancy check) segmented calculation method and device in a high-speed network, wherein the method comprises the following steps: partitioning a data packet of a CRC value to be calculated in a network to obtain M data blocks to be calculated, which are arranged according to a data sequence; calculating the CRC value of each data block to be calculated; the CRC final value of the previous data block is used as the CRC initial value of the current data block; and the final value of the last data block is used as the CRC value of the data packet; when CRC calculation of the current data block is carried out, N CRC calculation units are adopted to carry out parallel calculation by combining the CRC initial value of the current data block so as to obtain the CRC final value of the current data block. The invention can quickly calculate the CRC value of the large-scale data packet in real time so as to meet the bandwidth requirement of a high-speed network.

Description

CRC (Cyclic redundancy check) segmented calculation method and device in high-speed network
Technical Field
The invention belongs to the technical field of communication, and particularly relates to a CRC (cyclic redundancy check) segmented calculation method and device in a high-speed network.
Background
In the transmission process of the communication system, the transmission channel is subjected to a lot of external interference, so that errors, namely bit errors, exist in the data received by the data receiving end. In order to reduce the error rate and ensure the correctness of data transmission, error check is carried out on the data. Crc (cyclic Redundancy check), which is a cyclic error correction check code, is a commonly used check and error correction code in the field of data communication. In a communication system, for example, the fcs (frame Check sequence) field of an ethernet packet uses CRC to Check the transmitted packet for errors.
CRC is calculated by performing polynomial calculation on data and attaching the obtained result to the original data, and the data receiving side detects whether there is an error in the transmitted data by a similar algorithm. When error detection is performed using CRC, the lengths of the information field and the check field may be arbitrarily given.
The CRC calculation can only process data of a certain length in one clock cycle, and thus, for large-scale data with a large bit width, a CRC value needs to be obtained through multi-step calculation, a result cannot be given in real time, and the calculation efficiency is low.
The error checking of the ethernet packet mentioned above uses the CRC-32 check algorithm in the protocol to obtain the FCS field. In a communication network with a lower speed, for example, in a 10Gbps ethernet network, only the CRC value calculation needs to be performed on data with a bit width of 128 bits, and the existing CRC calculation method can give a CRC result faster. However, in a high-speed network, such as 400Gbps ethernet, CRC value calculation needs to be performed on data with a bit width of 1024 bits, and a result is given in real time. The existing CRC value calculation method has low efficiency and cannot meet the requirement of calculating the CRC value of the current data in real time in a high-speed network. .
Disclosure of Invention
In view of the above analysis, the present invention aims to disclose a CRC segmentation calculation method and apparatus in a high-speed network, which solves the CRC real-time calculation problem of large-scale data.
The invention discloses a CRC (cyclic redundancy check) segmented calculation method in a high-speed network, which comprises the following steps:
partitioning a data packet of a CRC value to be calculated in a network to obtain M data blocks to be calculated, which are arranged according to a data sequence;
calculating the CRC value of each data block to be calculated; using the CRC final value of the previous data block as the CRC initial value of the current data block; and the final value of the last data block is used as the CRC value of the data packet;
when CRC calculation of the current data block is carried out, N CRC calculation units are adopted to carry out parallel calculation by combining the CRC initial value of the current data block so as to obtain the CRC final value of the current data block.
Further, when the data packet of the CRC value to be calculated in the network is partitioned to obtain M data blocks to be calculated arranged according to the data sequence, the data packet is partitioned according to the data length Y of the sum of the bit widths of the N CRC calculation units.
Further, the calculation process of the CRC value of each data block to be calculated comprises the following steps:
judging whether the length X of the current data block is equal to the length Y of the data; if yes, directly turning to the next step; if not, performing zero padding operation to obtain data with the data length Y, and turning to the next step;
carrying out data segmentation and numbering; dividing the data block to be calculated into N data segments according to the equal length L, and numbering each data segment into data segments D according to the bit order of the data segmentsi(ii) a 1, …, N; n is Y/L; l is the bit width of the CRC calculation unit;
segment D of data1After the XOR operation is carried out on the CRC initial value of the middle data and the current data block, the middle data and the CRC initial value of the current data block are assigned to the data segment D again1Performing the following steps;
performing parallel CRC calculation on the N data sections by adopting N CRC calculation units to obtain N CRC results;
and carrying out exclusive OR operation on the N obtained CRC results, and combining to obtain the CRC final value of the current data block.
Further, the calculation process of the CRC value of each data block to be calculated comprises the following steps:
judging whether the length X of the current data block can divide the bit width L of the CRC calculation unit; if yes, taking the current data block as a first data block and turning to the next step; if not, splitting the current data into two data blocks according to the integral multiple of the bit width L, wherein the first data block is the data of which the length is the integral multiple of the bit width L after splitting, and the second data block is the remainder part after splitting;
judging whether the length of the transferred first data block is equal to the data length Y or not; if yes, directly turning to the next step; if not, performing zero padding operation to obtain data with the data length Y, and turning to the next step;
carrying out data segmentation and numbering; dividing the data block to be calculated into N data segments according to the equal length L, and numbering each data segment into data segments D according to the bit high-low sequence of the data segmentsi(ii) a 1, …, N; n is Y/L; l is the bit width of the CRC calculation unit;
segment D of data1After the XOR operation is carried out on the CRC initial value of the middle data and the current data block, the middle data and the CRC initial value of the current data block are assigned to the data segment D again1Performing the following steps;
performing parallel CRC calculation on the N sections of data by adopting N CRC calculation units to obtain N CRC results;
performing exclusive-or operation on the obtained N CRC results, and combining to obtain a CRC final value of the first data block;
judging whether a second data block with an uncomputed CRC result exists in the calculation of the current data block; if not, taking the CRC final value of the first data block as the CRC final value of the current data block, and then entering the CRC value calculation of the next data block; if yes, the next step is carried out;
padding zero in the high order of the second data block to make the length of the second data block the same as the CRC final value of the first data block, and carrying out XOR on the second data block after padding zero and the CRC final value of the first data block;
and performing CRC calculation on the XOR result by adopting 1 remainder part CRC calculation unit to obtain a CRC result which is used as a CRC final value of the current data block, and then performing CRC value calculation on the next data block.
Further, the zero padding operation is a high-order zero padding operation.
Further, each of the N CRC calculation units is not completely identical and exists with the data segment DiProcessing information related to the serial number and used for receiving and processing corresponding data segment data; remainder partial CRC calculation unit and data segment D1The corresponding CRC calculation units are consistent.
The invention also discloses a CRC subsection calculating device in the high-speed network, which comprises:
the first blocking unit is used for blocking a data packet of a CRC value to be calculated in a network to obtain M data blocks to be calculated, wherein the M data blocks are arranged according to a data sequence;
the CRC segmentation calculation unit is used for calculating the CRC value of each data block to be calculated; the CRC final value of the previous data block is used as the CRC initial value of the current data block; and the final value of the last data block is used as the CRC value of the data packet;
when CRC calculation of the current data block is carried out, N CRC calculation units are adopted to carry out parallel calculation by combining the CRC initial value of the current data block so as to obtain the CRC final value of the current data block.
Further, the CRC segmentation calculation unit includes:
the data shifting zero padding unit is used for judging whether the length X of the current data block is equal to the length Y of the data; if yes, the data block to be calculated is directly transmitted to the second block partitioning unit; if not, performing zero padding operation to obtain data with the data length Y, and transmitting the data to the second partitioning unit;
the second block dividing unit is used for carrying out data segmentation and numbering, dividing the data block to be calculated into N data segments according to the equal length L, and numbering each data segment into a data segment D according to the bit height sequence of the data segmenti(ii) a 1, …, N; n is Y/L; l is the bit width of the CRC calculation unit;
a CRC initial value XOR unit for dividing the data segment D1After the XOR operation is carried out on the CRC initial value of the middle data and the current data block, the middle data and the CRC initial value of the current data block are assigned to the data segment D again1Performing the following steps;
the N CRC calculation units are used for respectively carrying out parallel CRC calculation on the N data sections to obtain N CRC results;
and the CRC value merging unit is used for carrying out XOR operation on the obtained N CRC results and merging to obtain a CRC final value of the current data block.
Further, the CRC segmentation calculation unit includes:
the data splitting unit is used for judging whether the length X of the current data block can divide the bit width L of the CRC calculation unit completely; if yes, taking the current data block as a first data block and turning to the next step; if not, splitting the current data into two data blocks according to the integral multiple of the bit width L, wherein the first data block is the data with the length of the integral multiple of the bit width L after splitting, and the second data block is the remainder part after splitting;
the data shifting zero-filling unit is used for judging whether the length of the first data block is equal to the length Y of the data; if yes, directly transmitting the data block to be calculated to the second block partitioning unit; if not, performing zero padding operation to obtain data with the data length Y, and transmitting the data to the second partitioning unit;
the second block dividing unit is used for carrying out data segmentation and numbering, dividing the data block to be calculated into N data segments according to the equal length L, and numbering each data segment into a data segment D according to the bit height sequence of the data segmenti(ii) a 1, …, N; n is Y/L; l is the bit width of the CRC calculation unit;
a CRC initial value XOR unit for dividing the data segment D1After the XOR operation is carried out on the CRC initial value of the middle data and the current data block, the middle data and the CRC initial value of the current data block are assigned to the data segment D again1Performing the following steps;
the N CRC calculation units are used for respectively carrying out parallel CRC calculation on the N data sections to obtain N CRC results;
a CRC value merging unit, configured to perform an exclusive-or operation on the obtained N CRC results, and merge to obtain a CRC final value of the first data block;
the first CRC final value unit is used for judging whether a second data block with an uncomputed CRC result exists in the calculation of the current data block or not; if not, taking the CRC final value of the first data block as the CRC final value of the current data block; if yes, inputting the CRC final value of the first data block into an exclusive-OR unit;
an exclusive or unit, configured to zero-fill the second data block at a high bit, so that the length of the second data block is the same as the CRC end value of the first data block, and perform exclusive or on the zero-filled second data block and the CRC end value of the first data block;
and the second CRC final value unit is used for performing CRC calculation on the XOR node by adopting 1 remainder part CRC calculation unit to obtain a CRC result which is the CRC final value of the current data block.
Further, the zero padding operation is a high-order zero padding operation.
The invention can realize at least one of the following beneficial effects:
compared with the traditional CRC value calculation method, the CRC segmentation calculation method and the CRC segmentation calculation device in the high-speed network can quickly calculate the CRC value of a large data block, and meet the data transmission requirement on the high-speed network.
According to the invention, through N different CRC calculation units, the positions of the calculated data segments in the whole data block to be calculated are correspondingly processed in each CRC calculation unit, and in the subsequent CRC value combination, the positions of the data segments corresponding to the CRC values do not need to be concerned, so that the implementation steps are simpler.
According to the invention, the exclusive OR operation of the CRC value and the next calculated data segment is carried out after the data shifting and blocking unit, so that the combinational logic steps required in the process that the CRC final value of the previous data segment is calculated to the final value and the next data segment is subjected to the CRC exclusive OR are reduced, and the problem of time sequence tension caused by larger circuit delay due to the multiple exclusive OR operations is further avoided.
The invention can support the calculation of the CRC value of the data block with any length within the range from 1bit to the maximum calculable length, and solves various calculation conditions when the length of the data block to be calculated is different. Meanwhile, the maximum calculable length can be selected according to actual requirements, and is flexible and changeable.
Drawings
The drawings, in which like reference numerals refer to like parts throughout, are for the purpose of illustrating particular embodiments only and are not to be considered limiting of the invention.
FIG. 1 is a flow chart of a CRC segmentation calculation method in a high speed network according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating the calculation of CRC values for each block to be calculated according to the embodiment of the present invention;
FIG. 3 is a flowchart illustrating the CRC value calculation of each block to be calculated according to the embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating the connection of the CRC segmentation calculation apparatus in the high-speed network according to the embodiment of the present invention;
FIG. 5 is a schematic diagram of the connection of the CRC segmentation calculation apparatus in the high-speed network according to the embodiment of the present invention.
Detailed Description
The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form a part hereof, and which together with the embodiments of the invention serve to explain the principles of the invention.
One embodiment of the present invention discloses a CRC segmentation calculation method in a high-speed network, as shown in fig. 1, including:
s101, partitioning a data packet of a CRC value to be calculated in a network to obtain M data blocks to be calculated, which are arranged according to a data sequence; and the data packet subjected to the blocking is the effective payload data of the data packet.
Step S102, calculating the CRC value of each data block to be calculated; the CRC final value of the previous data block is used as the CRC initial value of the current data block; and the final value of the last data block is used as the CRC value of the data packet;
when CRC calculation of the current data block is carried out, N CRC calculation units are adopted to carry out parallel calculation by combining the CRC initial value of the current data block so as to obtain the CRC final value of the current data block.
Specifically, when a data packet of a CRC value to be calculated in a network is partitioned to obtain M data blocks to be calculated arranged according to a data sequence, the data packet is partitioned according to a data length Y of a sum of bit widths of N CRC calculation units.
For example, in a 400Gbps ethernet, a data packet with a length of 1500bytes (8 bits for 1 byte) needs to be subjected to CRC calculation to obtain an FCS field, and if the maximum bit width of data subjected to parallel CRC calculation every time is 1024 bits, the data packet is divided into M ═ 9 data blocks, where 8 data blocks are 1024 bits and 1 data block is 736 bit. In step S2, CRC calculation is performed for each of 9 data items.
Specifically, the process of calculating the CRC value of each data block to be calculated in step S2, as shown in fig. 2, includes:
step S201, judging whether the length X of the current data block is equal to the length Y of the data; if yes, directly turning to the next step; if not, performing zero padding operation to obtain data with the data length Y, and turning to the next step;
the method can support CRC value calculation of data with any length, for example, in a 400Gbps Ethernet, a data packet with the length of 1500bytes (1byte is 8bit) needs to be subjected to CRC calculation to obtain an FCS domain, 8 data blocks of 1024 bits and 1 data block of 736 bits are obtained in 9 data blocks through data packet blocking, the lengths of the data blocks are different, and the data with any length are supplemented into the data blocks with the same length through the step, so that subsequent unified processing is facilitated. Therefore, the processing of the data block with any length is realized.
Preferably, the zero padding operation is a high-order zero padding operation. I.e. shifting payload data to the lower bits of the data block; and (5) complementing 0 at the high bit of the data block to be calculated.
Step S202, carrying out data segmentation and numbering; dividing the data block to be calculated into N data segments according to the equal length L, and numbering each data segment into data segments D according to the bit high-low sequence of the data segmentsi(ii) a 1, …, N; n is Y/L; l is the bit width of the CRC calculation unit;
in this step, the length of each data segment is the same as the bit width of the CRC calculation unit by segmentation, and the position of each data segment is more definite by numbering, which is convenient for the subsequent call and processing of the data segment by the CRC calculation unit.
Step S203, data segment D1After the XOR operation is carried out on the CRC initial value of the middle data and the current data block, the middle data and the CRC initial value of the current data block are assigned to the data segment D again1Performing the following steps;
the CRC initial value of the current data block is the CRC final value of the previous data block; through the processing of the step, the combinational logic step required in the process that the CRC end value of the previous data segment is calculated to the end value and the next data is subjected to CRC exclusive OR is realized, and meanwhile, the problem of time sequence tension caused by large circuit delay caused by multiple exclusive OR operations due to large length of the data block when the data block is performed before the shifting and partitioning of data segmentation is avoided.
Because the CRC initial value of the current data block is the CRC final value of the previous data block; when the first data block is processed, the CRC initial value needs to be set in advance, and in this embodiment, the value of the CRC initial value of the first data block is all 0, all F, or other preset values.
Step S204, adopting N CRC calculation units to perform parallel CRC calculation on N sections of data segments to obtain N CRC results;
preferably, each of the N CRC calculation units is not completely identical and exists with the data segment DiAnd the processing information related to the number is used for receiving and processing the corresponding data segment data.
That is, the CRC calculation unit 1 processes the data segment D1The middle data; CRC calculation unit 2 processes data segment D2The middle data; by analogy, the CRC calculation unit N processes the data segment DNThe middle data; each CRC calculation unit has processing information associated with the corresponding data segment number.
And S205, carrying out XOR operation on the N obtained CRC results, and combining to obtain the CRC final value of the current data block.
The CRC end value of the current data block is used as the CRC initial value of the next data block, and the xor operation of the next data block is performed in step S203.
In this embodiment, through N different CRC calculation units, corresponding processing is performed on the calculated data segment at the position of the whole data block to be calculated in each CRC calculation unit, and in subsequent CRC value combining, the position of the data segment corresponding to the CRC value does not need to be concerned, so that the implementation steps are simpler.
The embodiment also provides another process for calculating the CRC value of each data block to be calculated in step S2, as shown in fig. 3, including:
step S301, judging whether the length X of the current data block can divide the bit width L of the CRC calculation unit completely; if yes, taking the current data block as a first data block and transferring to the next step; if not, splitting the current data into two data blocks according to the integral multiple of the bit width L, wherein the first data block is the data of which the length is the integral multiple of the bit width L after splitting, and the second data block is the remainder part after splitting;
step S302, judging whether the length of the transferred first data block is equal to the length Y of the data; if yes, directly turning to the next step; if not, performing zero padding operation to obtain data with the data length Y, and turning to the next step;
preferably, the zero padding operation is a high-order zero padding operation. I.e. shifting the payload data to the lower bits of the data block; and (4) complementing 0 at the high bit of the data block to be calculated.
Step S303, carrying out data segmentation and numbering; dividing the data block to be calculated into N data segments according to the equal length L, and numbering each data segment into data segments D according to the bit high-low sequence of the data segmentsi(ii) a 1, …, N; n is Y/L; l is the bit width of the CRC calculation unit;
in this step, the length of each data segment is the same as the bit width of the CRC calculation unit through segmentation, and the position of each data segment is made more definite through numbering, which facilitates the call and processing of the subsequent CRC calculation unit on the data segment.
Step S304, data segment D1After the XOR operation is carried out on the CRC initial value of the middle data and the current data block, the middle data and the CRC initial value of the current data block are assigned to the data segment D again1The preparation method comprises the following steps of (1) performing;
the CRC initial value of the current data block is the CRC final value of the previous data block; through the processing of the step, the combinational logic step required in the process that the CRC end value of the previous data segment is calculated to the end value and the next data is subjected to CRC exclusive OR is realized, and meanwhile, the problem of time sequence tension caused by large circuit delay caused by multiple exclusive OR operations due to large length of the data block when the data block is performed before the shifting and partitioning of data segmentation is avoided.
Because the CRC initial value of the current data block is the CRC final value of the previous data block; when the first data block is processed, the CRC initial value needs to be set in advance, and in this embodiment, the value of the CRC initial value of the first data block is all 0, all F, or other preset values.
Step S305, performing parallel CRC calculation on N sections of data segments by adopting N CRC calculation units to obtain N CRC results;
preferably, each of the N CRC calculation units is not completely identical and exists with the data segment DiWhere the numbers are relatedAnd the management information is used for receiving and processing the corresponding data segment data.
That is, the CRC calculation unit 1 processes the data segment D1The middle data; CRC calculation unit 2 processes data segment D2The middle data; by analogy, the CRC calculation unit N processes the data segment DNThe middle data; each CRC calculation unit has processing information associated with the corresponding data segment number.
And step S306, carrying out exclusive OR operation on the obtained N CRC results, and combining to obtain a CRC final value of the first data block.
Step S307, judging whether a second data block with an uncomputed CRC result exists in the calculation of the current data block; if not, taking the CRC final value of the first data block as the CRC final value of the current data block, and then entering the CRC value calculation of the next data block; if yes, the next step is carried out;
step S308, zero padding is carried out on the high order of the second data block, the length of the second data block is the same as the length of the CRC final value of the first data block, and the zero padded second data block and the CRC final value of the first data block are subjected to exclusive OR;
and step S309, performing CRC calculation on the XOR result by adopting 1 remainder partial CRC calculation unit to obtain a CRC result as a CRC final value of the current data block.
The CRC end value of the current data block is used as the CRC initial value of the next data block, and the xor operation of the next data block is performed in step S303.
Specifically, each of the N CRC calculation units is not completely identical and exists with the data segment DiProcessing information related to the serial number and used for receiving and processing corresponding data segment data; remainder partial CRC calculation unit and data segment D1The corresponding CRC calculation units are consistent.
In this embodiment, through N different CRC calculation units, corresponding processing is performed on the calculated data segment at the position of the whole data block to be calculated in each CRC calculation unit, and in subsequent CRC value combining, the position of the data segment corresponding to the CRC value does not need to be concerned, so that the implementation steps are simpler.
For example, in the calculation of CRC values of ethernet packets, an ethernet with a bandwidth of 400Gbps needs to perform CRC calculation on data with a maximum bit width of 1024 bits in real time, and then 32 CRC value calculation units are needed to calculate CRC values of 32 data segments at the maximum when CRC-32 is used. Meanwhile, under the above conditions, the CRC calculation system can support the calculation of the CRC value with any length in the bit width range of 1bit to 1024 bits, and give the result in real time.
In summary, compared with the existing CRC value calculation method, the embodiments of the present invention can quickly calculate the CRC value of a large data block, and meet the data transmission requirement on a high-speed network. Through N different CRC calculation units, the positions of the calculated data segments in the whole data block to be calculated are correspondingly processed in each CRC calculation unit, and in the subsequent CRC value combination, the positions of the data segments corresponding to the CRC values do not need to be concerned, so that the implementation steps are simpler. The exclusive OR operation of the CRC value and the next calculated data segment is carried out after the data shifting and partitioning unit, so that the combinational logic step required in the process that the CRC final value of the previous data segment is calculated to the final value and the next data segment is subjected to the CRC exclusive OR is reduced, and the problem of time sequence tension caused by larger circuit delay due to multiple exclusive OR operations is further avoided. The CRC value calculation of the data block with any length within the range from 1bit to the maximum calculable length can be supported, and various calculation conditions of different lengths of the data block to be calculated are solved. Meanwhile, the maximum calculable length can be selected according to actual requirements, and is flexible and changeable.
A specific embodiment of the present invention further discloses a CRC segmentation calculation apparatus in a high-speed network, as shown in fig. 4, including:
the first blocking unit is used for blocking a data packet of a CRC value to be calculated in a network to obtain M data blocks to be calculated, wherein the M data blocks are arranged according to a data sequence;
the CRC segmentation calculation unit is used for calculating the CRC value of each data block to be calculated; the CRC final value of the previous data block is used as the CRC initial value of the current data block; and the final value of the last data block is used as the CRC value of the data packet;
when CRC calculation of the current data block is carried out, N CRC calculation units are adopted to carry out parallel calculation by combining the CRC initial value of the current data block so as to obtain the CRC final value of the current data block.
Specifically, the CRC segmentation calculation unit includes:
the data shifting zero padding unit is used for judging whether the length X of the current data block is equal to the length Y of the data; if yes, directly transmitting the data block to be calculated to the second block partitioning unit; if not, performing zero padding operation to obtain data with the data length Y, and transmitting the data to the second partitioning unit;
preferably, the zero padding operation of the data shift zero padding unit is a high-order zero padding operation.
The second block dividing unit is used for carrying out data segmentation and numbering, dividing the data block to be calculated into N data segments according to the equal length L, and numbering each data segment into a data segment D according to the bit height sequence of the data segmenti(ii) a 1, …, N; n is Y/L; l is the bit width of the CRC calculation unit;
a CRC initial value XOR unit for dividing the data segment D1After the XOR operation is carried out on the CRC initial value of the middle data and the current data block, the middle data and the CRC initial value of the current data block are assigned to the data segment D again1Performing the following steps;
the N CRC calculation units are used for respectively carrying out parallel CRC calculation on the N data sections to obtain N CRC results;
preferably, each of the N CRC calculation units is not identical and exists with the data segment DiAnd the processing information related to the number is used for receiving and processing the corresponding data segment data.
And the CRC value merging unit is used for carrying out XOR operation on the obtained N CRC results and merging to obtain a CRC final value of the current data block.
A specific embodiment of the present invention further discloses a CRC segmentation calculation apparatus in a high-speed network, as shown in fig. 5, the CRC segmentation calculation unit includes:
the data splitting unit is used for judging whether the length X of the current data block can divide the bit width L of the CRC calculation unit completely; if yes, taking the current data block as a first data block and transferring to the next step; if not, splitting the current data into two data blocks according to the integral multiple of the bit width L, wherein the first data block is the data with the length of the integral multiple of the bit width L after splitting, and the second data block is the remainder part after splitting;
the data shifting zero-filling unit is used for judging whether the length of the first data block is equal to the length Y of the data; if yes, directly transmitting the data block to be calculated to the second block partitioning unit; if not, performing zero padding operation to obtain data with the data length Y, and transmitting the data to the second block partitioning unit;
preferably, the zero padding operation of the data shift zero padding unit is a high-order zero padding operation.
The second block dividing unit is used for carrying out data segmentation and numbering, dividing the data block to be calculated into N data segments according to the equal length L, and numbering each data segment into a data segment D according to the bit height sequence of the data segmenti(ii) a 1, …, N; n is Y/L; l is the bit width of the CRC calculation unit;
a CRC initial value XOR unit for dividing the data segment D1After the XOR operation is carried out on the CRC initial value of the middle data and the current data block, the middle data and the CRC initial value of the current data block are assigned to the data segment D again1Performing the following steps;
the N CRC calculation units are used for respectively carrying out parallel CRC calculation on the N data sections to obtain N CRC results;
a CRC value merging unit, configured to perform an exclusive-or operation on the obtained N CRC results, and merge to obtain a CRC final value of the first data block;
the first CRC final value unit is used for judging whether a second data block with an uncomputed CRC result exists in the calculation of the current data block; if not, taking the CRC final value of the first data block as the CRC final value of the current data block; if yes, the CRC final value of the first data block is input to the XOR unit;
an exclusive or unit, configured to zero-fill the second data block at a high bit, so that the length of the second data block is the same as the CRC end value of the first data block, and perform exclusive or on the zero-filled second data block and the CRC end value of the first data block;
and the second CRC final value unit is used for performing CRC calculation on the XOR node by adopting 1 remainder part CRC calculation unit to obtain a CRC result which is the CRC final value of the current data block.
The specific technical details and technical effects in this embodiment are the same as those in the previous embodiment, and reference may be made to the previous embodiment, which is not repeated herein.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention.

Claims (10)

1. A CRC segmentation calculation method in a high-speed network is characterized by comprising the following steps:
partitioning a data packet of a CRC value to be calculated in a network to obtain M data blocks to be calculated, which are arranged according to a data sequence;
calculating the CRC value of each data block to be calculated; using the CRC final value of the previous data block as the CRC initial value of the current data block; and the final value of the last data block is used as the CRC value of the data packet;
when CRC calculation of the current data block is carried out, N CRC calculation units are adopted to carry out parallel calculation to obtain the CRC final value of the current data block by combining the CRC initial values of the current data block.
2. The CRC segmentation calculation method in the high-speed network according to claim 1, wherein when the data packets of the CRC value to be calculated in the network are segmented to obtain M data blocks to be calculated arranged according to the data sequence, the data packets are segmented according to the data length Y of the sum of the bit widths of the N CRC calculation units.
3. The method for CRC segmentation computation in high speed networks according to claim 2, wherein the computation of the CRC value of each data block to be computed comprises:
judging whether the length X of the current data block is equal to the length Y of the data; if yes, directly turning to the next step; if not, performing zero padding operation to obtain data with the data length Y, and turning to the next step;
carrying out data segmentation and numbering; dividing the data block to be calculated into N data segments according to the equal length L, and numbering each data segment into data segments D according to the bit high-low sequence of the data segmentsi(ii) a 1, …, N; n is Y/L; l is the bit width of the CRC calculation unit;
segment D of data1After the XOR operation is carried out on the CRC initial value of the middle data and the current data block, the middle data and the CRC initial value of the current data block are assigned to the data segment D again1Performing the following steps;
performing parallel CRC calculation on the N data sections by adopting N CRC calculation units to obtain N CRC results;
and carrying out exclusive OR operation on the N obtained CRC results, and combining to obtain the CRC final value of the current data block.
4. The CRC segmentation computation method in high speed network as claimed in claim 2, wherein the computation process of CRC value of each data block to be computed comprises:
judging whether the length X of the current data block can divide the bit width L of the CRC calculation unit; if yes, taking the current data block as a first data block and turning to the next step; if not, splitting the current data into two data blocks according to the integral multiple of the bit width L, wherein the first data block is the data with the length of the integral multiple of the bit width L after splitting, and the second data block is the remainder part after splitting;
judging whether the length of the transferred first data block is equal to the data length Y or not; if yes, directly turning to the next step; if not, performing zero padding operation to obtain data with the data length Y, and turning to the next step;
carrying out data segmentation and numbering; dividing the data block to be calculated into N data segments according to the equal length L, and numbering each data segment into data segments D according to the bit high-low sequence of the data segmentsi(ii) a 1, …, N; n is Y/L; l is the bit width of the CRC calculation unit;
segment D of data1After the XOR operation is carried out on the CRC initial value of the middle data and the current data block, the middle data and the CRC initial value of the current data block are assigned to the data segment D again1Performing the following steps;
performing parallel CRC calculation on the N sections of data by adopting N CRC calculation units to obtain N CRC results;
performing exclusive or operation on the obtained N CRC results, and combining to obtain a CRC final value of the first data block;
judging whether a second data block with an uncomputed CRC result exists in the calculation of the current data block; if not, taking the CRC final value of the first data block as the CRC final value of the current data block, and then entering the CRC value calculation of the next data block; if yes, the next step is carried out;
padding zero in the high order of the second data block to make the length of the second data block the same as the CRC final value of the first data block, and carrying out XOR on the second data block after padding zero and the CRC final value of the first data block;
and performing CRC calculation on the XOR result by adopting 1 remainder part CRC calculation unit to obtain a CRC result which is used as a CRC final value of the current data block, and then performing CRC value calculation on the next data block.
5. The CRC segmentation computation method in high speed networks according to claim 3 or 4, characterized in that the zero padding operation is a high order zero padding operation.
6. The CRC segmentation calculation method in a high speed network according to claim 5,
of the N CRC calculation units, each of which is not completely identical, exists with the data segment DiProcessing information related to the serial number and used for receiving and processing corresponding data segment data; remainder partial CRC calculation unit and data segment D1The corresponding CRC calculation units are consistent.
7. An apparatus for CRC segmentation computation in a high speed network, comprising:
the first blocking unit is used for blocking a data packet of a CRC value to be calculated in a network to obtain M data blocks to be calculated, wherein the M data blocks are arranged according to a data sequence;
the CRC segmentation calculation unit is used for calculating the CRC value of each data block to be calculated; the CRC final value of the previous data block is used as the CRC initial value of the current data block; and the final value of the last data block is used as the CRC value of the data packet;
when CRC calculation of the current data block is carried out, N CRC calculation units are adopted to carry out parallel calculation by combining the CRC initial value of the current data block so as to obtain the CRC final value of the current data block.
8. The apparatus for calculating CRC segments in a high speed network according to claim 7, wherein said CRC segment calculating unit comprises:
the data shifting zero padding unit is used for judging whether the length X of the current data block is equal to the length Y of the data; if yes, directly transmitting the data block to be calculated to the second block partitioning unit; if not, performing zero padding operation to obtain data with the data length Y, and transmitting the data to the second partitioning unit;
the second block dividing unit is used for carrying out data segmentation and numbering, dividing the data block to be calculated into N data segments according to the equal length L, and numbering each data segment into a data segment D according to the bit height sequence of the data segmenti(ii) a 1, …, N; n is Y/L; l is the bit width of the CRC calculation unit;
a CRC initial value XOR unit for dividing the data segment D1After the XOR operation is carried out on the CRC initial value of the middle data and the current data block, the middle data and the CRC initial value of the current data block are assigned to the data segment D again1Performing the following steps;
the N CRC calculation units are used for respectively carrying out parallel CRC calculation on the N data sections to obtain N CRC results;
and the CRC value merging unit is used for carrying out XOR operation on the obtained N CRC results and merging to obtain a CRC final value of the current data block.
9. The apparatus for calculating CRC segments in a high speed network according to claim 7, wherein said CRC segment calculating unit comprises:
the data splitting unit is used for judging whether the length X of the current data block can divide the bit width L of the CRC calculation unit completely; if yes, taking the current data block as a first data block and turning to the next step; if not, splitting the current data into two data blocks according to the integral multiple of the bit width L, wherein the first data block is the data with the length of the integral multiple of the bit width L after splitting, and the second data block is the remainder part after splitting;
the data shifting zero-filling unit is used for judging whether the length of the first data block is equal to the length Y of the data; if yes, directly transmitting the data block to be calculated to the second block partitioning unit; if not, performing zero padding operation to obtain data with the data length Y, and transmitting the data to the second partitioning unit;
the second block dividing unit is used for carrying out data segmentation and numbering, dividing the data block to be calculated into N data segments according to the equal length L, and numbering each data segment into a data segment D according to the bit height sequence of the data segmenti(ii) a 1, …, N; n is Y/L; l is the bit width of the CRC calculation unit;
a CRC initial value XOR unit for dividing the data segment D1After the XOR operation is carried out on the CRC initial value of the middle data and the current data block, the value is assigned to the data segment D again1Performing the following steps;
the N CRC calculation units are used for respectively carrying out parallel CRC calculation on the N data sections to obtain N CRC results;
a CRC value merging unit, configured to perform an exclusive-or operation on the obtained N CRC results, and merge to obtain a CRC final value of the first data block;
the first CRC final value unit is used for judging whether a second data block with an uncomputed CRC result exists in the calculation of the current data block or not; if not, taking the CRC final value of the first data block as the CRC final value of the current data block; if yes, inputting the CRC final value of the first data block into an exclusive-OR unit;
an exclusive or unit, configured to zero-fill the second data block at a high bit, so that the length of the second data block is the same as the CRC end value of the first data block, and perform exclusive or on the zero-filled second data block and the CRC end value of the first data block;
and the second CRC final value unit is used for performing CRC calculation on the XOR node by adopting 1 remainder part CRC calculation unit to obtain a CRC result which is the CRC final value of the current data block.
10. The apparatus for calculating CRC segmentation in high speed networks according to claim 8 or 9, wherein the zero padding operation is an upper zero padding operation.
CN202210365156.4A 2022-04-02 2022-04-02 CRC segmentation calculation method and device in high-speed network Active CN114679239B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210365156.4A CN114679239B (en) 2022-04-02 2022-04-02 CRC segmentation calculation method and device in high-speed network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210365156.4A CN114679239B (en) 2022-04-02 2022-04-02 CRC segmentation calculation method and device in high-speed network

Publications (2)

Publication Number Publication Date
CN114679239A true CN114679239A (en) 2022-06-28
CN114679239B CN114679239B (en) 2024-04-23

Family

ID=82078602

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210365156.4A Active CN114679239B (en) 2022-04-02 2022-04-02 CRC segmentation calculation method and device in high-speed network

Country Status (1)

Country Link
CN (1) CN114679239B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117220833A (en) * 2023-11-09 2023-12-12 新华三网络信息安全软件有限公司 CRC (cyclic redundancy check) calculation circuit, chip, message processing method and network security equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1431594A (en) * 2003-01-27 2003-07-23 西安电子科技大学 Method for parallel computing code of CRC in multiple channels and multiple bits
CN105119694A (en) * 2015-09-11 2015-12-02 烽火通信科技股份有限公司 Method and system for calculating CRC value in high speed network
CN112803954A (en) * 2020-12-31 2021-05-14 中山大学 Improved BP List decoding algorithm based on CRC (cyclic redundancy check) segmentation processing
CN113110954A (en) * 2021-04-23 2021-07-13 合肥恒烁半导体有限公司 CRC (Cyclic redundancy check) code parallel computing method and device and application thereof
WO2021195800A1 (en) * 2020-03-28 2021-10-07 Qualcomm Incorporated Code block segmentation for downlink control information

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1431594A (en) * 2003-01-27 2003-07-23 西安电子科技大学 Method for parallel computing code of CRC in multiple channels and multiple bits
CN105119694A (en) * 2015-09-11 2015-12-02 烽火通信科技股份有限公司 Method and system for calculating CRC value in high speed network
WO2021195800A1 (en) * 2020-03-28 2021-10-07 Qualcomm Incorporated Code block segmentation for downlink control information
CN112803954A (en) * 2020-12-31 2021-05-14 中山大学 Improved BP List decoding algorithm based on CRC (cyclic redundancy check) segmentation processing
CN113110954A (en) * 2021-04-23 2021-07-13 合肥恒烁半导体有限公司 CRC (Cyclic redundancy check) code parallel computing method and device and application thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117220833A (en) * 2023-11-09 2023-12-12 新华三网络信息安全软件有限公司 CRC (cyclic redundancy check) calculation circuit, chip, message processing method and network security equipment
CN117220833B (en) * 2023-11-09 2024-01-26 新华三网络信息安全软件有限公司 CRC (cyclic redundancy check) calculation circuit, chip, message processing method and network security equipment

Also Published As

Publication number Publication date
CN114679239B (en) 2024-04-23

Similar Documents

Publication Publication Date Title
CN107154836B (en) Parallel Cyclic Redundancy Check (CRC) method based on Field Programmable Gate Array (FPGA)
US8271859B2 (en) Segmented CRC design in high speed networks
US8037399B2 (en) Techniques for segmented CRC design in high speed networks
EP0950300B1 (en) Secondary channel using code violations
US8225187B1 (en) Method and apparatus for implementing a cyclic redundancy check circuit
EP0313707B1 (en) Data integrity securing means
US10211852B2 (en) CRC calculation method, and apparatus
EP0470451A2 (en) Implementation of the high-level data link control cyclic redundancy check (HDLC CRC) calculation
WO2018187049A1 (en) Digital signature systems and methods for network path trace
US8271850B2 (en) Fast low-density parity-check code encoder
WO2018090860A1 (en) Cyclic redundancy check calculation for multiple blocks of a message
JPH0856165A (en) Method and equipment for calculation of error inspection code and correction code
CN114785634B (en) Implementation method for CRC (cyclic redundancy check) of data transmitted by CAN (controller area network) communication system in HIL (high-performance liquid chromatography) test process
CN111193635A (en) Method, system, and computer readable medium for measuring delivery latency
JPH07240739A (en) Method and equipment for generating and inspecting frame inspection sequence for message
CN114679239A (en) CRC (Cyclic redundancy check) segmented calculation method and device in high-speed network
US6732318B2 (en) Variable width parallel cyclical redundancy check
CN108270508B (en) Cyclic redundancy check CRC implementation method, device and network equipment
JP3419520B2 (en) Data communication method and device
US7546512B2 (en) Techniques to perform error detection
CN104618057B (en) A kind of Packet Transport Network not damaged protection reverse method and system
CN101848055A (en) Method and device for correcting data
US7047479B1 (en) Parallel CRC formulation
US5923681A (en) Parallel synchronous header correction machine for ATM
EP3694125B1 (en) Bit block processing method, and node

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant