CN101588221B - Method and device for realizing self-adapting selection of checkum algorithm - Google Patents
Method and device for realizing self-adapting selection of checkum algorithm Download PDFInfo
- Publication number
- CN101588221B CN101588221B CN2009100873897A CN200910087389A CN101588221B CN 101588221 B CN101588221 B CN 101588221B CN 2009100873897 A CN2009100873897 A CN 2009100873897A CN 200910087389 A CN200910087389 A CN 200910087389A CN 101588221 B CN101588221 B CN 101588221B
- Authority
- CN
- China
- Prior art keywords
- checksum
- message
- end point
- opposite end
- received
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000012790 confirmation Methods 0.000 claims description 105
- 230000008878 coupling Effects 0.000 claims description 83
- 238000010168 coupling process Methods 0.000 claims description 83
- 238000005859 coupling reaction Methods 0.000 claims description 83
- 230000004044 response Effects 0.000 claims description 53
- 238000004364 calculation method Methods 0.000 claims description 50
- 230000008569 process Effects 0.000 claims description 23
- 238000012545 processing Methods 0.000 claims description 11
- 230000003044 adaptive effect Effects 0.000 claims description 9
- 230000008859 change Effects 0.000 claims description 9
- 230000001960 triggered effect Effects 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000000977 initiatory effect Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 2
- 235000014510 cooky Nutrition 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000011664 signaling Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Landscapes
- Detection And Prevention Of Errors In Transmission (AREA)
Abstract
The invention discloses a method for realizing the self-adapting selection of checksum algorithm, comprising: the terminal point selects the first checksum algorithm to calculate the received checksumof the message from the counterpart terminal point, when the calculated checksum is determined to be unequal to the checksum carried by the received message, the second checksum algorithm is selected to attempt to be coupled with the counterpart terminal point. The invention also discloses a device for realizing the self-adapting selection of checksum algorithm, the method and device are used to realize that the SCTF terminal point adopting the new checksum algorithm CRC-32 is coupled with the SCTP terminal point adopting the Adler-32 or CRC-32 checksum algorithm, further realize that the newapparatus is compatible with the old apparatus in the network.
Description
Technical Field
The present invention relates to Stream Control Transmission Protocol (SCTP) in a communication system, and in particular, to a method and apparatus for implementing adaptive selection of a checksum algorithm in SCTP.
Background
SCTP is a component of the signaling transport protocol (SIGTRAN) protocol suite, belonging to the transport layer protocol, and is mainly used to reliably transport signaling messages of the Public Switched Telephone Network (PSTN) over an IP network. SCTP is a connection-oriented protocol that provides a method for establishing associations between a set of IP addresses between two SCTP endpoints over which the SCTP endpoints can send SCTP packets. Here, the SCTP endpoint is a receiver or sender of SCTP packet logic; the association is a corresponding relationship between two SCTP endpoints, each SCTP endpoint can correspond to one set of IP addresses, and correspondingly, the association is a corresponding relationship between two sets of IP addresses. Here, the establishment of the coupling is implemented using a "four-way handshake" mechanism, as shown in fig. 1. In order to ensure the validity of the SCTP packets, each SCTP packet header includes a necessary authentication tag field and a checksum field, where the checksum is set by a sender of the SCTP packet, and a receiver discards an SCTP packet including an invalid checksum. At present, the checksum algorithm of the traditional version is Adler-32, and in order to further improve the reliability of the checksum algorithm, a new version of the checksum algorithm is proposed, which is as follows: CRC-32.
In the prior art, an SCTP endpoint that uses a new version of the checksum algorithm CRC-32 can only establish a coupling with an SCTP endpoint that uses the checksum algorithm CRC-32, but cannot establish a coupling with an SCTP endpoint that uses the checksum algorithm Adler-32, that is: the method is incompatible with the SCTP endpoint adopting the old version checksum algorithm, and further cannot be compatible with the equipment in the existing network, thereby influencing the wide use of the new version checksum algorithm.
Disclosure of Invention
In view of the above, the main objective of the present invention is to provide a method and an apparatus for implementing checksum algorithm adaptive selection, so that associations can be established between SCTP endpoints using different checksum algorithms.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the invention provides a method for realizing self-adaptive selection of a checksum algorithm, which comprises the following steps:
the terminal selects the first checksum algorithm to calculate the checksum of the received message from the opposite terminal, and selects the second checksum algorithm to try to establish coupling with the opposite terminal again when the calculated checksum is determined to be unequal to the checksum carried in the received message.
Before the calculating the checksum of the message from the opposite end point, the method further includes: judging whether a message from an opposite end point is received or not, and selecting a first checksum algorithm to calculate the checksum of the message from the opposite end point when the message from the opposite end point is received; when a message from the opposite end point is not received, a second checksum algorithm is selected and an attempt is made to reestablish a coupling with the opposite end point.
When the local terminal actively establishes coupling with the opposite terminal, the method specifically comprises the following steps:
sending a starting message to an opposite end point;
judging whether a starting confirmation message from the opposite end point is received or not, if the starting confirmation message from the opposite end point is not received, selecting a second checksum algorithm and restarting to establish coupling with the opposite end point; if the starting confirmation message from the opposite end point is received, a first checksum algorithm is selected to calculate the checksum of the starting confirmation message, and if the calculated checksum is equal to the checksum carried in the received starting confirmation message, a state response message is sent to the opposite end point; if the calculated checksum is not equal to the checksum carried in the received start confirmation message, selecting a second checksum algorithm and restarting to establish coupling with the opposite end point;
after sending the state response message to the opposite end point, judging whether the state confirmation message from the opposite end point is received or not, if the state confirmation message from the opposite end point is not received, selecting a second checksum algorithm and restarting to establish coupling with the opposite end point; if the state confirmation message from the opposite end point is received, a first checksum algorithm is selected to calculate the checksum of the state confirmation message, and if the calculated checksum is equal to the checksum carried in the received state confirmation message, the current coupling establishing process is ended; and if the calculated checksum and the checksum carried in the received state confirmation message are not equal, selecting a second checksum algorithm and restarting to establish coupling with the opposite end point.
When the local endpoint is passively coupled with the opposite endpoint, the method specifically comprises the following steps:
calculating the received starting message by using a first checksum algorithm, and if the calculated checksum is equal to the checksum carried in the received starting message, sending a starting confirmation message to the opposite end point; if the calculated checksum is not equal to the checksum carried in the received starting message, selecting a second checksum algorithm and restarting to establish coupling with the opposite end point;
after sending a starting confirmation message to the opposite end point, judging whether a state response message from the opposite end point is received or not, if the state response message from the opposite end point is not received, selecting a second checksum algorithm and restarting to establish coupling with the opposite end point; if the state response message from the opposite end point is received, the first checksum algorithm is selected to calculate the received state response message, if the calculated checksum is equal to the checksum carried in the received state response message, the state confirmation message is sent to the opposite end point, and the current coupling establishing process is ended; and if the calculated checksum is not equal to the checksum carried in the received status response message, selecting a second checksum algorithm and restarting to establish coupling with the opposite end point.
In the above scheme, the first checksum algorithm is a CRC-32 checksum algorithm; the second checksum algorithm is an Adler-32 checksum algorithm; or the first checksum algorithm is an Adler-32 checksum algorithm; the second checksum algorithm is a CRC-32 checksum algorithm.
The invention also provides a device for realizing self-adaptive selection of the checksum algorithm, which comprises the following components:
the receiving and sending module is used for receiving the message from the opposite end point and transmitting the message to the storage module for storage;
the storage module is used for storing the message from the opposite end point;
and the calculation comparison module is used for selecting a first checksum algorithm to calculate the checksum of the received message from the opposite end point, selecting a second checksum algorithm when the calculated checksum is determined to be unequal to the checksum carried in the received message, and triggering the transceiver module to establish coupling with the opposite end point again.
And when the calculation comparison module determines that the calculated checksum is equal to the checksum carried in the received message, the calculation comparison module is further used for continuously selecting the first checksum algorithm to calculate the checksum of the subsequent message from the opposite end point and triggering the transceiver module to continuously establish coupling with the opposite end point.
Further, the apparatus further comprises:
the judgment processing module is used for triggering the calculation and comparison module to carry out checksum calculation when determining that the message from the opposite end point is received, and informing the calculation and comparison module to change a checksum algorithm when determining that the message from the opposite end point is not received;
correspondingly, the calculation and comparison module is further configured to change the selected checksum algorithm when the judgment processing module determines that the message from the opposite end point is not received, and trigger the transceiver module to establish a coupling with the opposite end point again.
In the above scheme, when the device is used for the endpoint to actively establish the coupling,
the receiving and sending module receives the message from the opposite end point and transmits the message to the storage module for storage, and the specific steps are as follows:
sending a starting message or a state response message to the opposite end point, receiving a starting confirmation message or a state confirmation message from the opposite end point, and transmitting the starting confirmation message or the state confirmation message to a storage module for storage;
the calculation comparison module calculates the checksum of the received message from the opposite end point by using a first checksum algorithm, selects a second checksum algorithm when the calculated checksum is determined to be unequal to the checksum carried in the received message, and triggers the transceiver module to establish coupling with the opposite end point again, specifically:
selecting a first checksum algorithm to calculate the checksum of the starting confirmation message or the state confirmation message, comparing the calculation result with the checksum carried in the starting confirmation message or the state confirmation message, continuing to select the first checksum algorithm to calculate the checksum of the subsequent message from the opposite end point when the checksum carried in the starting confirmation message is determined to be equal to the checksum carried in the starting confirmation message, triggering the transceiver module to send a state response message to the opposite end point, and ending the coupling establishment process when the checksum carried in the state confirmation message is determined to be equal to the checksum; and when the checksum carried in the message from the opposite end point is determined to be unequal, a second checksum algorithm is selected for calculation, and the transceiver module is triggered to send the starting message to the opposite end point.
In the above scheme, when the device is used for the endpoint to passively establish the coupling,
the receiving and sending module receives the message from the opposite end point and transmits the message to the storage module for storage, and the specific steps are as follows:
receiving a starting message or a state response message sent by an opposite end point, sending a starting confirmation message or a state confirmation message to the opposite end point, and transmitting the starting message or the state response message to a storage module for storage;
the calculation comparison module calculates the checksum of the received message from the opposite end point by using a first checksum algorithm, selects a second checksum algorithm when the calculated checksum is determined to be unequal to the checksum carried in the received message, and triggers the transceiver module to establish coupling with the opposite end point again, specifically:
selecting a first checksum algorithm to calculate the checksum of the starting message or the state response message, comparing the calculation result with the checksum carried in the starting message or the state response message, continuing to select the first checksum algorithm to calculate the checksum of the subsequent message from the opposite end point when the calculation result is equal to the checksum carried in the starting message or the state response message, and triggering the transceiver module to send a starting confirmation message or a state confirmation message to the opposite end point; and when the checksum carried in the starting message or the status response message is determined to be unequal, calculating the checksum of the subsequent message from the opposite end point by using a second checksum algorithm, and triggering the transceiver module to establish coupling with the opposite end point.
The invention provides a method and a device for realizing self-adaptive selection of a checksum algorithm. The invention can realize that the SCTP endpoint adopting the new version checksum algorithm CRC-32 and the SCTP endpoint adopting the Adler-32 or the CRC-32 checksum algorithm can be coupled, thereby realizing the compatibility of new and old equipment in the network.
Drawings
FIG. 1 is a schematic diagram of a "four-way handshake" mechanism for coupling establishment;
FIG. 2 is a schematic flow chart of an implementation of the method for actively establishing a coupling at an endpoint according to the present invention;
FIG. 3 is a schematic flow chart of a method for passively establishing a coupling according to the present invention;
fig. 4 is a schematic structural diagram of an apparatus for implementing adaptive selection of checksum algorithm in the present invention.
Detailed Description
The basic idea of the invention is: the terminal selects the first checksum algorithm to calculate the checksum of the received message from the opposite terminal, and selects the second checksum algorithm to try to establish coupling with the opposite terminal again when the calculated checksum is determined to be unequal to the checksum carried in the received message.
The checksum algorithm may be of various kinds for different communication systems, and the implementation of the present invention will be described in detail below by taking the first checksum algorithm and the second checksum algorithm as the CRC-32 checksum algorithm and the Adler-32 checksum algorithm, respectively, as examples.
In the invention, the terminal point and the opposite terminal point both refer to any SCTP terminal point, wherein the opposite terminal point supports one of CRC-32 checksum algorithm and Adler-32 checksum algorithm.
The method and apparatus for adaptive selection of checksum algorithm are described below for two different situations, namely active coupling establishment and passive coupling establishment of the endpoint.
Fig. 2 is a schematic diagram of an implementation process of the method for actively establishing a coupling at an endpoint of the present invention, as shown in fig. 2, the process includes the following steps:
step 201: sending an initiation (INIT) message to the opposite end point;
the method specifically comprises the following steps: the end point selects CRC-32 checksum algorithm to calculate the checksum of the starting message to be sent, fills the calculated checksum into the checksum field in the starting message, and sends the whole starting message to the opposite end point.
In the invention, the end point firstly selects CRC-32 checksum algorithm to try to establish coupling with the opposite end point by default in the process of establishing coupling actively and passively, and also can select Adler-32 checksum algorithm to try to establish coupling with the opposite end point.
Step 202: judging whether a start confirmation (INIT ACK) message from the opposite end point is received, if the start confirmation message from the opposite end point is received, executing step 203; if no start-up confirm message is received from the opposite endpoint, step 207 is performed.
In the present invention, the message that is not received from the opposite end point is: the message from the opposite end point is not received within the set time; the set time is calculated by taking the unit of second, such as: 1 second, or 2 seconds, or 0.1 second, etc.; if no message from the opposite end point is received, the method comprises the following steps: the other end point does not reply the message, and the check sum of the message sent by the end point calculated by the other end point is not equal to the check sum carried in the message sent by the end point, so that the establishment process of the coupling fails, and another check sum algorithm is selected to establish the coupling again.
Step 203: calculating the checksum of the start confirmation message by using a CRC-32 checksum algorithm, and executing step 204 if the calculated checksum is equal to the checksum carried in the received start confirmation message; if the calculated checksum and the checksum carried in the received startup verification message are not equal, step 207 is performed.
Step 204: sending a status answer (COOKIE ECHO) message to the opposite end point;
the method specifically comprises the following steps: the end point selects CRC-32 checksum algorithm to calculate the checksum of the status response message to be sent, fills the calculated checksum into the checksum field in the status response message, and sends the whole status response message to the other end point.
Step 205: judging whether a status confirmation (cookie) message from the opposite end point is received, if the status confirmation message from the opposite end point is received, executing step 206; if no status confirmation message is received from the opposite end point, go to step 207;
here, the reason why the message from the opposite end point is not received may be: in the process of transmitting the message of the end point to the opposite end point, because the network damage causes the error of the message data of the end point, the check sum of the message sent by the end point calculated by the opposite end point is unequal to the check sum carried in the message sent by the end point, and the establishing process of the coupling fails, and another check sum algorithm is selected to establish the coupling again.
Step 206: calculating the checksum of the state confirmation message by using a CRC-32 checksum algorithm, and executing step 208 if the calculated checksum is equal to the checksum carried in the received state confirmation message; if the calculated checksum and the checksum carried in the received status confirmation message are not equal, execute step 207;
here, the calculated checksum and the checksum carried in the received status confirmation message are not equal, for the reason that: in the process of transmitting the message of the opposite end point to the local end point, because the network damage causes the error of the message data of the opposite end point, the two checksums are unequal, the establishment process of the coupling fails, and another checksum algorithm is selected to reestablish the coupling.
Step 207: selecting an Adler-32 checksum algorithm and executing the same operation as the steps 201 to 206, if the starting confirmation message or the state confirmation message returned by the opposite end point is not received, or the calculated checksum and the checksum carried in the received starting confirmation message or the state confirmation message are not equal, executing the step 201, selecting the CRC-32 checksum algorithm again to try to establish coupling with the opposite end point, and if four handshakes are completed by selecting the Adler-32 checksum algorithm, executing the step 208.
Step 208: the coupling establishment procedure is ended.
Fig. 3 is a schematic diagram of an implementation process of the method for passively establishing coupling at an endpoint according to the present invention, and as shown in fig. 3, the process includes the following steps:
step 301: calculating the checksum of the received starting message by using a CRC-32 checksum algorithm, and executing the step 302 if the calculated checksum is equal to the checksum carried in the received starting message; if the calculated checksum is not equal to the checksum carried in the received initiation message, step 306 is performed.
Step 302: sending a starting confirmation message to the opposite end point;
the method specifically comprises the following steps: the end point selects CRC-32 checksum algorithm to calculate the checksum of the start confirmation message to be sent, fills the calculated checksum into the checksum field in the start confirmation message, and sends the whole start confirmation message to the other end point.
Step 303: judging whether a status response message from the opposite end point is received, if the status response message from the opposite end point is received, executing step 304; if the status reply message from the opposite end point is not received, step 306 is executed;
here, the reason why the message from the opposite end point is not received may be: in the process of transmitting the message of the end point to the opposite end point, because the network damage causes the error of the message data of the end point, the check sum of the message sent by the end point calculated by the opposite end point is unequal to the check sum carried in the message sent by the end point, and the establishing process of the coupling fails, and another check sum algorithm is selected to establish the coupling again.
Step 304: calculating the checksum of the received status response message by using a CRC-32 checksum algorithm, and if the calculated checksum is equal to the checksum carried in the received status response message, executing step 305; if the calculated checksum is not equal to the checksum carried in the received status reply message, execute step 306;
here, the calculated checksum and the checksum carried in the received status confirmation message are not equal, for the reason that: in the process of transmitting the message of the opposite end point to the local end point, because the network damage causes the error of the message data of the opposite end point, the two checksums are unequal, the establishment process of the coupling fails, and another checksum algorithm is selected to reestablish the coupling.
Step 305: sending a state confirmation message to the opposite end point, and finishing the current coupling establishing process;
the method specifically comprises the following steps: the end point selects a CRC-32 checksum algorithm to calculate the checksum of the state confirmation message to be sent, fills the calculated checksum into a checksum field in the state confirmation message, and sends the whole state confirmation message to the opposite end point;
here, it is considered that after the state confirmation message is transmitted to the opposite end point, if the opposite end point can receive it, the coupling establishment procedure is ended.
Step 306: selecting an Adler-32 checksum algorithm and executing the same operation as the steps 301 to 305, if a status response message returned by the opposite end point is not received or the calculated checksum is not equal to the checksum carried in the received start message or status response message, executing the step 301, selecting the CRC-32 checksum algorithm again to try to establish coupling with the opposite end point, and if four handshakes are completed by selecting the Adler-32 checksum algorithm, ending the coupling establishment process.
In order to implement the above method, the present invention further provides an apparatus for implementing adaptive selection of checksum algorithm, as shown in fig. 4, the apparatus includes: the device comprises a receiving and sending module, a storage module and a calculation and comparison module; wherein,
the receiving and sending module is used for sending a message to an opposite end point, receiving the message from the opposite end point and transmitting the message to the storage module for storage;
the storage module is used for storing the message from the opposite end point;
the calculation and comparison module is used for calculating the checksum of the message from the opposite end point by using a first checksum algorithm, comparing the calculation result with the checksum carried in the message from the opposite end point, continuing to calculate the checksum of the subsequent message from the opposite end point by using the first checksum algorithm when the two checksums are equal, triggering the transceiver module to continue to establish coupling with the opposite end point, and selecting a second checksum algorithm when the two checksums are not equal and triggering the transceiver module to re-establish coupling with the opposite end point; and the message for calculating the checksum in the calculation and comparison module comes from the storage module.
The device further comprises a judging and processing module, a calculating and comparing module and a judging and processing module, wherein the judging and processing module is used for judging whether a message from an opposite end point is received or not, triggering the calculating and comparing module to carry out checksum calculation when the message is determined to be received, and informing the calculating and comparing module to change a checksum algorithm when the message is determined not to be received;
correspondingly, the calculation and comparison module is also used for calculating the checksum of the message from the opposite end point by using the current checksum algorithm when the judgment and processing module determines that the message from the opposite end point is received; and when the judgment processing module determines that the message from the opposite end point is not received, the selected checksum algorithm is changed, and the transceiver module is triggered to establish coupling with the opposite end point again.
When the device is used for the endpoint to actively establish the coupling,
the receiving and sending module sends a message to an opposite end point, receives the message from the opposite end point and transmits the message to the storage module for storage, and the receiving and sending module specifically comprises:
sending a starting message or a state response message to the opposite end point, receiving a starting confirmation message or a state confirmation message from the opposite end point, and transmitting the starting confirmation message or the state confirmation message to a storage module for storage;
the storage module stores messages from the opposite end point, specifically:
storing a start-up confirmation message or a state confirmation message from the opposite end point;
the judgment processing module judges whether a message from an opposite end point is received or not, triggers the calculation comparison module to carry out checksum calculation when the message is determined to be received, and informs the calculation comparison module to change a checksum algorithm when the message is determined not to be received, specifically:
judging whether a starting confirmation message or a state confirmation message from an opposite end point is received or not, triggering a calculation comparison module to carry out checksum calculation when the starting confirmation message or the state confirmation message is received, and informing the calculation comparison module to change a checksum algorithm when the calculation comparison module is not received;
the calculation and comparison module selects a first checksum algorithm to calculate the checksum of the message from the opposite end point, compares the calculation result with the checksum carried in the message from the opposite end point, determines that the two checksums are equal, continues to select the first checksum algorithm to calculate the checksum of the subsequent message from the opposite end point, triggers the transceiver module to continue to establish coupling with the opposite end point, selects a second checksum algorithm when determining that the two checksums are not equal, and triggers the transceiver module to re-establish coupling with the opposite end point, specifically:
selecting a first checksum algorithm to calculate the checksum of the starting confirmation message or the state confirmation message, comparing the calculation result with the checksum carried in the starting confirmation message or the state confirmation message, continuing to select the first checksum algorithm to calculate the checksum of the subsequent message from the opposite end point when the checksum is determined to be equal to the checksum carried in the starting confirmation message, triggering the transceiver module to send a state response message to the opposite end point, and ending the coupling establishment process when the checksum is determined to be equal to the checksum carried in the state confirmation message; and when the checksum carried in the message from the opposite end point is determined to be unequal, a second checksum algorithm is selected to calculate the checksum of the subsequent message from the opposite end point, and the transceiver module is triggered to send the starting message to the opposite end point.
When the device is used for the endpoint to passively establish a coupling,
the receiving and sending module sends a message to an opposite end point, receives the message from the opposite end point and transmits the message to the storage module for storage, and the receiving and sending module specifically comprises:
receiving a starting message or a state response message sent by an opposite end point, sending a starting confirmation message or a state confirmation message to the opposite end point, and transmitting the starting message or the state response message to a storage module for storage;
the storage module stores messages from the opposite end point, specifically:
storing a start message or a status response message from an opposite end point;
the judgment processing module judges whether a message from an opposite end point is received or not, triggers the calculation comparison module to carry out checksum calculation when the message is determined to be received, and informs the calculation comparison module to change a checksum algorithm when the message is determined not to be received, specifically:
judging whether a state response message from an opposite end point is received or not, triggering a calculation comparison module to carry out checksum calculation when the state response message is received, and informing the calculation comparison module to change a checksum algorithm when the state response message is not received;
the calculation and comparison module selects a first checksum algorithm to calculate the checksum of the message from the opposite end point, compares the calculation result with the checksum carried in the message from the opposite end point, determines that the two checksums are equal, continues to select the first checksum algorithm to calculate the checksum of the subsequent message from the opposite end point, triggers the transceiver module to continue to establish coupling with the opposite end point, selects a second checksum algorithm when determining that the two checksums are not equal, and triggers the transceiver module to re-establish coupling with the opposite end point, specifically:
selecting a first checksum algorithm to calculate the checksum of the starting message or the state response message, comparing the calculation result with the checksum carried in the starting message or the state response message, continuing to select the first checksum algorithm to calculate the checksum of the subsequent message from the opposite end point when the calculation result is equal to the checksum carried in the starting message or the state response message, and triggering the transceiver module to send a starting confirmation message or a state confirmation message to the opposite end point; and when the checksum carried in the starting message or the status response message is determined to be unequal, calculating the checksum of the subsequent message from the opposite end point by using a second checksum algorithm, and triggering the transceiver module to establish coupling with the opposite end point.
The above description is only exemplary of the present invention and should not be taken as limiting the scope of the present invention, and any modifications, equivalents, improvements, etc. that are within the spirit and principle of the present invention should be included in the present invention.
Claims (6)
1. A method for adaptive selection of a checksum algorithm, the method comprising:
the endpoint selects a first checksum algorithm to calculate the checksum of the received message from the endpoint of the opposite side, and selects a second checksum algorithm to try to establish coupling with the endpoint of the opposite side again when the calculated checksum is determined to be unequal to the checksum carried in the received message;
when the local terminal actively establishes coupling with the opposite terminal, the method specifically comprises the following steps:
sending a starting message to an opposite end point;
judging whether a starting confirmation message from the opposite end point is received or not, if the starting confirmation message from the opposite end point is not received, selecting a second checksum algorithm and restarting to establish coupling with the opposite end point; if the starting confirmation message from the opposite end point is received, a first checksum algorithm is selected to calculate the checksum of the starting confirmation message, and if the calculated checksum is equal to the checksum carried in the received starting confirmation message, a state response message is sent to the opposite end point; if the calculated checksum is not equal to the checksum carried in the received start confirmation message, selecting a second checksum algorithm and restarting to establish coupling with the opposite end point;
after sending the state response message to the opposite end point, judging whether the state confirmation message from the opposite end point is received or not, if the state confirmation message from the opposite end point is not received, selecting a second checksum algorithm and restarting to establish coupling with the opposite end point; if the state confirmation message from the opposite end point is received, a first checksum algorithm is selected to calculate the checksum of the state confirmation message, and if the calculated checksum is equal to the checksum carried in the received state confirmation message, the current coupling establishing process is ended; if the calculated checksum and the checksum carried in the received state confirmation message are not equal, selecting a second checksum algorithm and restarting to establish coupling with the opposite end point;
when the local endpoint is passively coupled with the opposite endpoint, the method specifically comprises the following steps:
calculating the received starting message by using a first checksum algorithm, and if the calculated checksum is equal to the checksum carried in the received starting message, sending a starting confirmation message to the opposite end point; if the calculated checksum is not equal to the checksum carried in the received starting message, selecting a second checksum algorithm and restarting to establish coupling with the opposite end point;
after sending a starting confirmation message to the opposite end point, judging whether a state response message from the opposite end point is received or not, if the state response message from the opposite end point is not received, selecting a second checksum algorithm and restarting to establish coupling with the opposite end point; if the state response message from the opposite end point is received, the first checksum algorithm is selected to calculate the received state response message, if the calculated checksum is equal to the checksum carried in the received state response message, the state confirmation message is sent to the opposite end point, and the current coupling establishing process is ended; and if the calculated checksum is not equal to the checksum carried in the received status response message, selecting a second checksum algorithm and restarting to establish coupling with the opposite end point.
2. The method of claim 1, wherein before calculating the checksum of the message from the opposite endpoint, further comprising: judging whether a message from an opposite end point is received or not, and selecting a first checksum algorithm to calculate the checksum of the message from the opposite end point when the message from the opposite end point is received; when a message from the opposite end point is not received, a second checksum algorithm is selected and an attempt is made to reestablish a coupling with the opposite end point.
3. The method for implementing checksum algorithm adaptive selection according to claim 1 or 2, wherein the first checksum algorithm is a CRC-32 checksum algorithm; the second checksum algorithm is an Adler-32 checksum algorithm; or the first checksum algorithm is an Adler-32 checksum algorithm; the second checksum algorithm is a CRC-32 checksum algorithm.
4. An apparatus for adaptive selection of a checksum algorithm, the apparatus comprising:
the receiving and sending module is used for receiving the message from the opposite end point and transmitting the message to the storage module for storage;
the storage module is used for storing the message from the opposite end point;
the calculation comparison module is used for selecting a first checksum algorithm to calculate the checksum of the received message from the opposite end point, selecting a second checksum algorithm when the calculated checksum is determined to be unequal to the checksum carried in the received message, and triggering the transceiver module to establish coupling with the opposite end point again;
when the device is used for the endpoint to actively establish the coupling,
the receiving and sending module receives the message from the opposite end point and transmits the message to the storage module for storage, and the specific steps are as follows:
sending a starting message or a state response message to the opposite end point, receiving a starting confirmation message or a state confirmation message from the opposite end point, and transmitting the starting confirmation message or the state confirmation message to a storage module for storage;
the calculation comparison module calculates the checksum of the received message from the opposite end point by using a first checksum algorithm, selects a second checksum algorithm when the calculated checksum is determined to be unequal to the checksum carried in the received message, and triggers the transceiver module to establish coupling with the opposite end point again, specifically:
selecting a first checksum algorithm to calculate the checksum of the starting confirmation message or the state confirmation message, comparing the calculation result with the checksum carried in the starting confirmation message or the state confirmation message, continuing to select the first checksum algorithm to calculate the checksum of the subsequent message from the opposite end point when the checksum carried in the starting confirmation message is determined to be equal to the checksum carried in the starting confirmation message, triggering the transceiver module to send a state response message to the opposite end point, and ending the coupling establishment process when the checksum carried in the state confirmation message is determined to be equal to the checksum; when the checksum carried in the message from the opposite end point is determined to be unequal, a second checksum algorithm is selected for calculation, and the transceiver module is triggered to send a starting message to the opposite end point;
when the device is used for the endpoint to passively establish a coupling,
the receiving and sending module receives the message from the opposite end point and transmits the message to the storage module for storage, and the specific steps are as follows:
receiving a starting message or a state response message sent by an opposite end point, sending a starting confirmation message or a state confirmation message to the opposite end point, and transmitting the starting message or the state response message to a storage module for storage;
the calculation comparison module calculates the checksum of the received message from the opposite end point by using a first checksum algorithm, selects a second checksum algorithm when the calculated checksum is determined to be unequal to the checksum carried in the received message, and triggers the transceiver module to establish coupling with the opposite end point again, specifically:
selecting a first checksum algorithm to calculate the checksum of the starting message or the state response message, comparing the calculation result with the checksum carried in the starting message or the state response message, continuing to select the first checksum algorithm to calculate the checksum of the subsequent message from the opposite end point when the calculation result is equal to the checksum carried in the starting message or the state response message, and triggering the transceiver module to send a starting confirmation message or a state confirmation message to the opposite end point; and when the checksum carried in the starting message or the status response message is determined to be unequal, calculating the checksum of the subsequent message from the opposite end point by using a second checksum algorithm, and triggering the transceiver module to establish coupling with the opposite end point.
5. The apparatus of claim 4, wherein the computation comparison module, when determining that the computed checksum is equal to a checksum carried in the received message, is further configured to continue to use the first checksum algorithm to compute a checksum of a subsequent message from the peer end point, and trigger the transceiver module to continue to establish a coupling with the peer end point.
6. The apparatus for implementing adaptive selection of checksum algorithm according to claim 4 or 5, further comprising:
the judgment processing module is used for triggering the calculation and comparison module to carry out checksum calculation when determining that the message from the opposite end point is received, and informing the calculation and comparison module to change a checksum algorithm when determining that the message from the opposite end point is not received;
correspondingly, the calculation and comparison module is further configured to change the selected checksum algorithm when the judgment processing module determines that the message from the opposite end point is not received, and trigger the transceiver module to establish a coupling with the opposite end point again.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009100873897A CN101588221B (en) | 2009-06-19 | 2009-06-19 | Method and device for realizing self-adapting selection of checkum algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009100873897A CN101588221B (en) | 2009-06-19 | 2009-06-19 | Method and device for realizing self-adapting selection of checkum algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101588221A CN101588221A (en) | 2009-11-25 |
CN101588221B true CN101588221B (en) | 2012-07-04 |
Family
ID=41372303
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2009100873897A Expired - Fee Related CN101588221B (en) | 2009-06-19 | 2009-06-19 | Method and device for realizing self-adapting selection of checkum algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101588221B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2745637B1 (en) * | 2011-10-07 | 2017-09-20 | Philips Lighting Holding B.V. | Methods and apparatus for improved dmx512 communication having checksum |
CN113872732B (en) * | 2021-09-27 | 2024-05-07 | 中国电子科技集团公司第五十四研究所 | Satellite channel reliable data transmission method based on self-adaptive checksum algorithm |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101123485A (en) * | 2007-09-20 | 2008-02-13 | 杭州华三通信技术有限公司 | iSCSI packet processing method and device, error recovery method and device |
CN101252476A (en) * | 2008-03-18 | 2008-08-27 | 华为技术有限公司 | Apparatus and method for malfunction detection |
-
2009
- 2009-06-19 CN CN2009100873897A patent/CN101588221B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101123485A (en) * | 2007-09-20 | 2008-02-13 | 杭州华三通信技术有限公司 | iSCSI packet processing method and device, error recovery method and device |
CN101252476A (en) * | 2008-03-18 | 2008-08-27 | 华为技术有限公司 | Apparatus and method for malfunction detection |
Also Published As
Publication number | Publication date |
---|---|
CN101588221A (en) | 2009-11-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106210924B (en) | Video network transmission control method and system | |
KR101430032B1 (en) | Method for improving a tcp data transmission process in case the physical transmission medium is disconnected | |
US9571409B2 (en) | Maximum transmission unit negotiation method and data terminal | |
CN111224999A (en) | Transmission protocol switching method, device, equipment and storage medium | |
CN104717259B (en) | The multi-path data Transmission system and method for distributed transfer server network assistance | |
WO2009127112A1 (en) | Method for state migrating of stream control transmission protocol | |
WO2007139161A1 (en) | Mobile terminal and communication method | |
KR100804082B1 (en) | Method and apparatus for avoiding duplicate negotiations during communication establishment | |
WO2018076580A1 (en) | Two-sided acceleration transmission method and system for wireless network | |
WO2014194806A1 (en) | Link processing method and mobile terminal in multiplexing control protocol | |
CN101588221B (en) | Method and device for realizing self-adapting selection of checkum algorithm | |
WO2014194493A1 (en) | Method, device and system for reducing confirmation packets at transmission control layer | |
CN114070494A (en) | Data transmission method, device, equipment and storage medium | |
IL199993A (en) | Submit report handling in smsip | |
CN102487341B (en) | Talk detection method, device and session initial protocol server | |
KR20170126808A (en) | User equipment and communication method of the same | |
US20140177575A1 (en) | Method for establishing an application session, device and corresponding notification | |
JP2004537241A (en) | How to support multiple checksum algorithms in a network node | |
US7703129B2 (en) | Authentication system and method thereof for dial-up networking connection via terminal | |
JP3741421B2 (en) | Data communication method and communication terminal device | |
JP4724761B2 (en) | Communication control device and program | |
WO2008085278B1 (en) | Method for providing reliable communucation session establishment in a communication infrastructure | |
CN117579233B (en) | Message retransmission method and device | |
JP2008167078A (en) | Mobile telephone terminal, and out-of-zone deciding method | |
CN110115018B (en) | Call holding method and mobile terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20180703 Address after: California, USA Patentee after: Global innovation polymerization LLC Address before: 518057 Nanshan District high tech Industrial Park, Shenzhen, Guangdong, Ministry of justice, Zhongxing Road, South China road. Patentee before: ZTE Corp. |
|
TR01 | Transfer of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120704 |
|
CF01 | Termination of patent right due to non-payment of annual fee |