Non-access stratum message processing method and communication device
By generating information containing the NAS COUNT value and the local NAS COUNT value in the communication device, the problem of insufficient security of the NAS message processing mechanism is solved, the security of NAS message transmission is improved, and out-of-order messages are prevented from being misjudged as replay messages. Enhanced communication system reliability.
Patent Information
- Application Number
- CN202310224991.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2024-08-30
AI Technical Summary
The security of the NAS message processing mechanism in the prior art is poor, resulting in insufficient security of NAS message transmission. Especially when NAS messages arrive out of order, it is easy to misjudge them as replay messages and discard legitimate messages.
By generating information including the NAS COUNT value and the local NAS COUNT value when receiving the NAS message in the first device, it avoids directly updating the local NAS COUNT value, thereby identifying and preventing replay attacks and ensuring the integrity verification and security of the NAS message. .
It improves the security of NAS message transmission and prevents misjudgment of messages arriving out of order as replay messages, thereby avoiding discarding legitimate messages and enhancing the reliability of the communication system.
Smart Images

Figure CN118574124A
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to a method for processing non-access stratum (NAS) messages and a communication device. Background Art
[0002] At present, the technical standard (TS) 24.501 of the 3rd Generation Partnership Project (3GPP) stipulates that when the receiver determines that the received NAS message is not a replayed NAS message, the receiver should make the estimated NAS COUNT value different from the local NAS COUNT value stored by the receiver in order to determine the estimated NAS COUNT value for integrity verification of the NAS message. Further, after the integrity verification of the NAS message passes, the receiver should update the local NAS COUNT value to the estimated NAS COUNT value.
[0003] However, in some scenarios, the security of the above NAS message processing mechanism is poor. Therefore, how to optimize the NAS message processing mechanism to improve the security of NAS message transmission is an urgent problem to be solved. Summary of the invention
[0004] The non-access layer message processing method and communication device provided in the embodiments of the present application can optimize the NAS message processing mechanism to improve the security of NAS message transmission.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, a method for processing a NAS message is provided. The method may be executed by a first device, or by a component of the first device, such as a processor, a chip, or a chip system of the first device, or may be implemented by a logic module or software that can implement all or part of the functions of the first device. The following is an example of the method being executed by the first device. The method includes:
[0007] The first device receives a first NAS message from the second device, and determines a first non-access layer count NAS COUNT value corresponding to the first NAS message; when the integrity verification of the first NAS message passes, the first device generates first information according to the first NAS COUNT value and a local NAS COUNT value stored by the first device, and the first information includes the first NAS COUNT value and / or the local NAS COUNT value; the first device receives a second NAS message from the second device, and determines a second NAS COUNT value corresponding to the second NAS message; the first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value.
[0008] Because in the embodiment of the present application, the first device generates the first information according to the first NAS COUNT value and the local NAS COUNT value when the integrity verification of the first NAS message passes, and the first information includes the first NAS COUNT value and / or the local NAS COUNT value, that is, the first device does not directly update the local NAS COUNT value according to the first NAS COUNT value, thereby avoiding the situation that the first device cannot identify part of the replayed NAS message when verifying the integrity of the second NAS message due to the local NAS COUNT value being updated to a smaller NAS COUNT value. Further, when the first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value, it can determine whether the second NAS message is a replayed NAS message, thereby avoiding replay attacks, thereby improving the security of NAS message transmission. Therefore, the NAS message processing method provided in the embodiment of the present application can optimize the NAS message processing mechanism to improve the security of NAS message transmission.
[0009] In combination with the foregoing first aspect, in a possible implementation manner, the first device generates first information according to the first NAS COUNT value and a local NAS COUNT value stored by the first device, where the first information includes the first NAS COUNT value and / or the local NAS COUNT value, including:
[0010] When the first NAS COUNT value is greater than the local NAS COUNT value, the first device updates the local NAS COUNT value, and the first information includes the updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value;
[0011] Alternatively, when the first NAS COUNT value is less than or equal to the local NAS COUNT value, the first device determines not to update the local NAS COUNT value, and the first information includes the local NAS COUNT value.
[0012] That is to say, the first device will update the local NAS COUNT value to the first NAS COUNT value only when the integrity verification of the first NAS message passes and the first NAS COUNT value is greater than the local NAS COUNT value, thereby preventing the local NAS COUNT value from being updated to a smaller NAS COUNT value, thereby avoiding replay attacks.
[0013] In combination with the first aspect above, in a possible implementation, when the first NAS COUNT value is greater than the local NAS COUNT value, and the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, the first information further includes one or more NAS COUNT values between the first NAS COUNT value and the local NAS COUNT value. It can be understood that, since the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, the first NAS COUNT value may refer to a NAS COUNT message that does not arrive in order, or a NAS COUNT value that arrives out of order, and further, the one or more NAS COUNT values between the first NAS COUNT value and the local NAS COUNT value may refer to a NAS COUNT value that should be accepted but is not received.
[0014] That is to say, the first information may also include a NAS COUNT value that should be accepted but has not been received, so that when the first device verifies the integrity of the second NAS message based on the first information and the second NAS COUNT value, it can be determined whether the second NAS message belongs to a NAS message that should be received but has not been received, thereby avoiding determining the second NAS message as a replayed NAS message and discarding the NAS message.
[0015] In combination with the foregoing first aspect, in a possible implementation manner, the first device verifies the integrity of the second NAS message according to the first information and the second NASCOUNT value, including:
[0016] In a case where the second NAS COUNT value is greater than the updated local NAS COUNT value, or in a case where the second NAS COUNT value is less than the updated local NAS COUNT value and the second NAS COUNT value belongs to one or more NAS COUNT values, the first device determines to verify the integrity of the second NAS message according to the second NAS COUNT value;
[0017] Alternatively, when the second NAS COUNT value is less than or equal to the updated local NAS COUNT value and the second NAS COUNT value does not belong to one or more NAS COUNT values, the first device determines not to verify the integrity of the second NAS message.
[0018] That is to say, when verifying the integrity of the second NAS message, the first device can determine whether the second NAS message is a replayed NAS message based on the second NAS COUNT value and the first information, and does not verify the integrity of the second NAS message if it is determined that the second NAS message is a replayed NAS message, thereby avoiding replay attacks and improving the security of NAS message transmission.
[0019] In combination with the first aspect, in a possible implementation manner, when the first NAS COUNT value is greater than the local NAS COUNT value, the first device updates the local NAS COUNT value, and the first information includes the updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value, including:
[0020] When the difference between the first NAS COUNT value and the local NAS COUNT value is 1, the updated local NAS COUNT value is the first NAS COUNT value.
[0021] That is to say, the updated local NAS COUNT value included in the first information is the NAS COUNT value that arrives in order relative to the local NAS COUNT value (that is, the NAS COUNT value corresponding to the local NAS COUNT value plus 1), and then when the first device verifies the integrity of the second NAS message according to the second NAS COUNT value and the first information, it can be determined that the local NAS COUNT value that is less than or equal to the updated one is a replayed NAS message.
[0022] In combination with the foregoing first aspect, in a possible implementation manner, the first device verifies the integrity of the second NAS message according to the first information and the second NASCOUNT value, including:
[0023] In a case where the second NAS COUNT value is greater than the updated local NAS COUNT value, the first device determines to verify the integrity of the second NAS message according to the second NAS COUNT value;
[0024] Alternatively, when the second NAS COUNT value is less than or equal to the updated local NAS COUNT value, the first device determines not to verify the integrity of the second NAS message.
[0025] That is to say, when verifying the integrity of the second NAS message, the first device can determine whether the second NAS message is a replayed NAS message based on the size relationship between the second NAS COUNT value and the updated local NAS COUNT value in the first information, thereby avoiding replay attacks and improving the security of NAS message transmission.
[0026] In combination with the foregoing first aspect, in a possible implementation manner, the first device generates first information according to the first NAS COUNT value and a local NAS COUNT value stored by the first device, where the first information includes the first NAS COUNT value and / or the local NAS COUNT value, including:
[0027] When the first NAS COUNT value is greater than the local NAS COUNT value and the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, the first device determines not to update the local NAS COUNT value, and the first information includes the local NAS COUNT value and the first NAS COUNT value.
[0028] That is, when the first NAS COUNT value is greater than the local NAS COUNT value, and the first NAS COUNT value is not a NAS COUNT value that arrives in order (i.e., the first NAS COUNT value is not a NAS COUNT value corresponding to the local NAS COUNT value plus 1), the first device may not update the local NAS COUNT value, but record the local NAS COUNT value and the first NAS COUNT value that arrives out of order, so that the first device can determine one or more NAS COUNT values (i.e., NAS COUNT values that should be accepted but not received) between the first NAS COUNT value and the local NAS COUNT value according to the first information, so that when the first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value, it can determine whether the second NAS message is a NAS message that should be received but not received, thereby avoiding determining the second NAS message as a replayed NAS message and discarding the NAS message.
[0029] In combination with the foregoing first aspect, in a possible implementation manner, the first device verifies the integrity of the second NAS message according to the first information and the second NASCOUNT value, including:
[0030] When the second NAS COUNT value is greater than the local NAS COUNT value and the second NAS COUNT value is not equal to the first NAS COUNT value, the first device determines to verify the integrity of the second NAS message according to the second NAS COUNT value;
[0031] Alternatively, when the second NAS COUNT value is less than or equal to the local NAS COUNT value, or the second NAS COUNT value is equal to the first NAS COUNT value, the first device determines not to verify the integrity of the second NAS message.
[0032] That is to say, when verifying the integrity of the second NAS message, the first device can determine whether the second NAS message is a replayed NAS message based on the second NAS COUNT value and the first information, and does not verify the integrity of the second NAS message if it is determined that the second NAS message is a replayed NAS message, thereby avoiding replay attacks and improving the security of NAS message transmission.
[0033] In combination with the first aspect above, in a possible implementation manner, the method provided by the first aspect further includes:
[0034] When the first device determines that the integrity verification of the second NAS message passes, the first device updates the first information.
[0035] That is to say, when the integrity verification of the second NAS message passes, by updating the first information, the first device can use the updated first information to perform integrity verification on the next received NAS message, thereby improving the security of NAS message transmission.
[0036] In combination with the first aspect, in a possible implementation manner, the first information includes an updated local NAS COUNT value and one or more NAS COUNT values between the first NAS COUNT value and the local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value; and the first device updates the first information, including:
[0037] When the second NAS COUNT value is greater than the first NAS COUNT value, the first device updates the updated local NAS COUNT value to the second NAS COUNT value;
[0038] Alternatively, in a case where the second NAS COUNT value belongs to one or more NAS COUNT values, the first device deletes the second NAS COUNT value from the one or more NAS COUNT values.
[0039] That is, when the second NAS COUNT value is greater than the local NAS COUNT value (i.e., the updated local NAS COUNT value in the first information), the first device updates the updated local NAS COUNT value to the second NAS COUNT value, thereby making the updated value of the local NAS COUNT value the maximum value among the NAS COUNT values that have passed the integrity verification. Further, when the second NAS COUNT value belongs to one or more NAS COUNT values, the second NAS COUNT value is deleted from the one or more NAS COUNT values, thereby avoiding replay attacks caused by receiving the same NAS COUNT value when verifying the next NAS message, thereby achieving replay protection.
[0040] In combination with the first aspect, in a possible implementation manner, when the second NAS COUNT value is greater than the first NAS COUNT value, and the difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, the first device updates the first information, further including:
[0041] The first device records one or more NAS COUNT values between the second NAS COUNT value and the first NAS COUNT value in the first information.
[0042] That is, updating the first information may also include updating the NAS COUNT value that should be accepted but not received, which may be used to determine whether the next arriving NAS message is a NAS message that should be received but not received, thereby avoiding determining the next arriving NAS message as a replayed NAS message and discarding the NAS message.
[0043] In combination with the first aspect, in a possible implementation manner, the first NAS COUNT value is greater than the local NAS COUNT value, the difference between the first NAS COUNT value and the local NAS COUNT value is 1, the first information includes an updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value; the first device updates the first information, including:
[0044] When the second NAS COUNT value is greater than the first NAS COUNT value and the difference between the second NAS COUNT value and the first NAS COUNT value is 1, the first device updates the updated local NAS COUNT value to the second NAS COUNT value;
[0045] Alternatively, when the second NAS COUNT value is greater than the first NAS COUNT value and the difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, the first device determines not to update the updated local NAS COUNT value and records the second NAS COUNT value in the first information.
[0046] That is, in a case where the updated local NAS COUNT value included in the first information is a NAS COUNT value that arrives in sequence relative to the local NAS COUNT value, if the second NAS COUNT value is a NAS COUNT value that arrives in sequence relative to the updated local NAS COUNT value, the first device updates the updated local NAS COUNT value to the second NAS COUNT value; if the second NAS COUNT value is greater than the first NAS COUNT value and is not a NAS COUNT value that arrives in sequence relative to the local NAS COUNT value, the first device does not update the updated local NAS COUNT value, so that the updated value of the local NAS COUNT value can be the maximum value of the NAS COUNT values that arrive in sequence and pass the integrity verification, and then when verifying the integrity of the next arriving NAS message, the NAS COUNT message with a NAS COUNT value less than the local NAS COUNT value can be determined as a replayed NAS message. Further, when the second NAS COUNT value is greater than the first NAS COUNT value and is not a NAS COUNT value that arrives in sequence relative to the local NAS COUNT value, the first device records the second NAS COUNT value in the first information, and then when verifying the integrity of the next arriving NAS message, the NAS message whose NAS COUNT value is equal to the second NAS COUNT value can be determined as a replayed NAS message.
[0047] In combination with the first aspect, in a possible implementation manner, the first NAS COUNT value is greater than the local NAS COUNT value, the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, and the first information includes the local NAS COUNT value and the first NAS COUNT value; the first device updates the first information, including:
[0048] When the second NAS COUNT value is greater than the local NAS COUNT value, and the difference between the second NAS COUNT value and the local NAS COUNT value is 1, and the difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, the first device updates the local NAS COUNT value to the second NAS COUNT value;
[0049] Alternatively, when the second NAS COUNT value is greater than the local NAS COUNT value, and the difference between the second NAS COUNT value and the local NAS COUNT value is 1, and the difference between the second NAS COUNT value and the first NAS COUNT value is 1, the first device updates the local NAS COUNT value to the first NAS COUNT value;
[0050] Alternatively, when the second NAS COUNT value is greater than the local NAS COUNT value and the difference between the second NAS COUNT value and the local NAS COUNT value is greater than 1, the first device determines not to update the local NAS COUNT value and records the second NAS COUNT value in the first information.
[0051] That is, in the case where the first information includes the local NAS COUNT value and the first NAS COUNT value, the first device updates the local NAS COUNT value in a manner such that the updated value is the maximum value among the NAS COUNT values that have passed the integrity verification and arrived in order, and then when verifying the integrity of the next NAS message to arrive, the NAS COUNT message whose NAS COUNT value is less than the local NAS COUNT value can be determined as a replayed NAS message. Further, in the case where the second NAS COUNT value arrives out of order, the first device records the second NAS COUNT value (i.e., records the NAS COUNT value that arrives out of order) in the first information, and then when verifying the integrity of the next NAS message to arrive, the NAS COUNT message whose NAS COUNT value is equal to the NAS COUNT value that arrives out of order can be determined as a replayed NAS message.
[0052] In combination with the above first aspect, in a possible implementation manner, the first device is a terminal device, and the second device is an access and / or mobile network element;
[0053] Alternatively, the first device is an access and / or mobile network element, and the second device is a terminal device.
[0054] In a second aspect, a method for processing a NAS message is provided, which can be executed by a first device, or by a component of the first device, such as a processor, a chip, or a chip system of the first device, or by a logic module or software that can implement all or part of the functions of the first device. The following is an example of the method being executed by the first device. The method includes:
[0055] The first device receives a first NAS message from the second device, and determines a first non-access layer count NAS COUNT value corresponding to the first NAS message; when the integrity verification of the first NAS message passes, the first device generates first information according to the first NAS COUNT value and a local NAS COUNT value stored in the first device, and the first information includes the first NAS COUNT value and / or the local NAS COUNT value; the first device receives a second NAS message from the second device, and determines a second NAS COUNT value corresponding to the second NAS message; the first device determines whether to accept the second NAS message according to the first information and the second NAS COUNT value.
[0056] Because in the embodiment of the present application, the first device generates the first information according to the first NAS COUNT value and the local NAS COUNT value when the integrity verification of the first NAS message passes, and the first information includes the first NAS COUNT value and / or the local NAS COUNT value, that is, the first device does not directly update the local NAS COUNT value according to the first NAS COUNT value, thereby avoiding the situation that the first device cannot identify part of the replayed NAS message when verifying the integrity of the second NAS message due to the local NAS COUNT value being updated to a smaller NAS COUNT value. Further, when the first device determines whether to accept the second NAS message according to the first information and the second NAS COUNT value, it can determine whether the second NAS message is a replayed NAS message, thereby avoiding replay attacks, thereby improving the security of NAS message transmission. Therefore, the NAS message processing method provided in the embodiment of the present application can optimize the NAS message processing mechanism to improve the security of NAS message transmission.
[0057] In combination with the foregoing second aspect, in a possible implementation manner, the first device determines whether to accept the second NAS message, including:
[0058] When the second NAS message is not a replay NAS message and the integrity verification of the second NAS message passes, the first device determines to accept the second NAS message;
[0059] Alternatively, in the case where the second NAS message is a replay NAS message, the first device determines not to accept the second NAS message.
[0060] It can be understood that when the first device determines not to accept the second NAS message, the first device discards the second NAS message.
[0061] It should be understood that whether the first device accepts the second NAS message according to the first information and the second NAS COUNT value can be replaced by "the first device determines whether the second NAS message is accepted according to the first information and the second NAS COUNT value".
[0062] In combination with the second aspect, in a possible implementation manner, the first device generates first information according to the first NAS COUNT value and a local NAS COUNT value stored by the first device, where the first information includes the first NAS COUNT value and / or the local NAS COUNT value, including:
[0063] When the first NAS COUNT value is greater than the local NAS COUNT value, the first device updates the local NAS COUNT value, and the first information includes the updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value;
[0064] Alternatively, when the first NAS COUNT value is less than or equal to the local NAS COUNT value, the first device determines not to update the local NAS COUNT value, and the first information includes the local NAS COUNT value.
[0065] In combination with the above-mentioned second aspect, in a possible implementation manner, when the first NAS COUNT value is greater than the local NAS COUNT value, and the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, the first information also includes one or more NAS COUNT values between the first NAS COUNT value and the local NAS COUNT value.
[0066] In combination with the second aspect, in a possible implementation manner, the first device determines whether to accept the second NAS message according to the first information and the second NASCOUNT value, including:
[0067] When the second NAS COUNT value is greater than the updated local NAS COUNT value, and it is determined according to the second NAS COUNT value that the integrity verification of the second NAS message passes, or when the second NAS COUNT value is less than the updated local NAS COUNT value, and the second NAS COUNT value belongs to one or more NAS COUNT values, and it is determined according to the second NAS COUNT value that the integrity verification of the second NAS message passes, the first device determines to accept the second NAS message;
[0068] Alternatively, when the second NAS COUNT value is less than or equal to the updated local NAS COUNT value, and the second NAS COUNT value does not belong to one or more NAS COUNT values, the first device determines not to accept the second NAS message.
[0069] In combination with the second aspect, in a possible implementation manner, when the first NAS COUNT value is greater than the local NAS COUNT value, the first device updates the local NAS COUNT value, and the first information includes the updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value, including:
[0070] When the difference between the first NAS COUNT value and the local NAS COUNT value is 1, the updated local NAS COUNT value is the first NAS COUNT value.
[0071] In combination with the second aspect, in a possible implementation manner, the first device determines whether to accept the second NAS message according to the first information and the second NASCOUNT value, including:
[0072] When the second NAS COUNT value is greater than the updated local NAS COUNT value and it is determined according to the second NAS COUNT value that the integrity verification of the second NAS message passes, the first device determines to accept the second NAS message;
[0073] Alternatively, when the second NAS COUNT value is less than or equal to the updated local NAS COUNT value, the first device determines not to accept the second NAS message.
[0074] In combination with the second aspect, in a possible implementation manner, the first device generates first information according to the first NAS COUNT value and a local NAS COUNT value stored by the first device, where the first information includes the first NAS COUNT value and / or the local NAS COUNT value, including:
[0075] When the first NAS COUNT value is greater than the local NAS COUNT value and the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, the first device determines not to update the local NAS COUNT value, and the first information includes the local NAS COUNT value and the first NAS COUNT value.
[0076] In combination with the second aspect, in a possible implementation manner, the first device determines whether to receive the second NAS message according to the first information and the second NASCOUNT value, including:
[0077] When the second NAS COUNT value is greater than the local NAS COUNT value, the second NAS COUNT value is not equal to the first NAS COUNT value, and it is determined according to the second NAS COUNT value that the integrity verification of the second NAS message passes, the first device determines to accept the second NAS message;
[0078] Alternatively, when the second NAS COUNT value is less than or equal to the local NAS COUNT value, or the second NAS COUNT value is equal to the first NAS COUNT value, the first device determines not to accept the second NAS message.
[0079] In combination with the above second aspect, in a possible implementation manner, the method provided by the second aspect further includes:
[0080] When the first device determines to accept the second NAS message, the first device updates the first information.
[0081] In combination with the second aspect, in a possible implementation manner, the first information includes an updated local NAS COUNT value and one or more NAS COUNT values between the first NAS COUNT value and the local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value; and the first device updates the first information, including:
[0082] When the second NAS COUNT value is greater than the first NAS COUNT value, the first device updates the updated local NAS COUNT value to the second NAS COUNT value;
[0083] Alternatively, in a case where the second NAS COUNT value belongs to one or more NAS COUNT values, the first device deletes the second NAS COUNT value from the one or more NAS COUNT values.
[0084] In combination with the second aspect, in a possible implementation manner, when the second NAS COUNT value is greater than the first NAS COUNT value, and the difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, the first device updates the first information, further including:
[0085] The first device records one or more NAS COUNT values between the second NAS COUNT value and the first NAS COUNT value in the first information.
[0086] In combination with the second aspect, in a possible implementation manner, the first NAS COUNT value is greater than the local NAS COUNT value, the difference between the first NAS COUNT value and the local NAS COUNT value is 1, the first information includes an updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value; the first device updates the first information, including:
[0087] When the second NAS COUNT value is greater than the first NAS COUNT value and the difference between the second NAS COUNT value and the first NAS COUNT value is 1, the first device updates the updated local NAS COUNT value to the second NAS COUNT value;
[0088] Alternatively, when the second NAS COUNT value is greater than the first NAS COUNT value and the difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, the first device determines not to update the updated local NAS COUNT value and records the second NAS COUNT value in the first information.
[0089] In combination with the second aspect, in a possible implementation manner, the first NAS COUNT value is greater than the local NAS COUNT value, the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, and the first information includes the local NAS COUNT value and the first NAS COUNT value; the first device updates the first information, including:
[0090] When the second NAS COUNT value is greater than the local NAS COUNT value, and the difference between the second NAS COUNT value and the local NAS COUNT value is 1, and the difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, the first device updates the local NAS COUNT value to the second NAS COUNT value;
[0091] Alternatively, when the second NAS COUNT value is greater than the local NAS COUNT value, and the difference between the second NAS COUNT value and the local NAS COUNT value is 1, and the difference between the second NAS COUNT value and the first NAS COUNT value is 1, the first device updates the local NAS COUNT value to the first NAS COUNT value;
[0092] Alternatively, when the second NAS COUNT value is greater than the local NAS COUNT value and the difference between the second NAS COUNT value and the local NAS COUNT value is greater than 1, the first device determines not to update the local NAS COUNT value and records the second NAS COUNT value in the first information.
[0093] In combination with the above second aspect, in a possible implementation manner, the first device is a terminal device, and the second device is an access and / or mobile network element;
[0094] Alternatively, the first device is an access and / or mobile network element, and the second device is a terminal device.
[0095] Among them, the technical effects of any implementation method in the second aspect can refer to the above-mentioned first aspect and will not be repeated here.
[0096] In a third aspect, a method for processing a NAS message is provided, which can be executed by a first device, or by a component of the first device, such as a processor, a chip, or a chip system of the first device, or by a logic module or software that can implement all or part of the functions of the first device. The following is an example of the method being executed by the first device. The method includes:
[0097] The first device receives a first NAS message from the second device, and determines a first NAS COUNT value corresponding to the first NAS message; when the first device determines that the integrity verification of the first NAS message passes according to the first NAS COUNT value, and the first NAS COUNT value is greater than the local NAS COUNT value stored in the first device, the first device updates the local NAS COUNT value to the first NAS COUNT value.
[0098] Since, in the embodiment of the present application, the first device updates the local NAS COUNT value when the integrity verification of the first NAS message passes and the first NAS COUNT value is greater than the local NAS COUNT value, it can be avoided that the first device cannot identify the partially replayed NAS message when receiving the next arriving NAS message due to the local NAS COUNT value being updated to a smaller NAS COUNT value. Therefore, the NAS message processing method provided in the embodiment of the present application can optimize the NAS message processing mechanism to improve the security of NAS message transmission.
[0099] In combination with the third aspect, in a possible implementation manner, the method provided by the third aspect further includes:
[0100] When the first device determines that the first NAS message integrity verification passes according to the first NAS COUNT value, the first device generates first information according to the first NAS COUNT value and the local NAS COUNT value stored by the first device, and the first information includes a first NAS overflow count NAS OVERFLOW value, and the first NAS OVERFLOW value is equal to the NAS OVERFLOW value in the local NAS COUNT value or the NAS OVERFLOW value in the updated local NAS COUNT value.
[0101] In combination with the third aspect, in a possible implementation manner, the first device generates first information according to the first NAS COUNT value and the local NAS COUNT value stored by the first device, where the first information includes a first NAS overflow count NASOVERFLOW value, where the first NAS OVERFLOW value is equal to the NAS OVERFLOW value in the local NAS COUNT value or the NAS OVERFLOW value in the updated local NAS COUNT value, including:
[0102] In the case where the first NAS COUNT value is less than the local NAS COUNT value, the first NAS OVERFLOW value is equal to the NAS OVERFLOW value in the local NAS COUNT value;
[0103] Alternatively, when the first NAS COUNT value is greater than the local NAS COUNT value, the first NAS OVERFLOW value is equal to the NAS OVERFLOW value in the updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value.
[0104] It should be understood that the first NAS OVERFLOW value may be an independent variable; or, the first NAS OVERFLOW value may be the 16 most significant bits in the field corresponding to the local NAS COUNT, which is not specifically limited in the embodiment of the present application.
[0105] In combination with the third aspect, in a possible implementation manner, the method provided by the third aspect further includes:
[0106] When the first device determines that the first NAS message integrity verification passes according to the first NAS COUNT value, the first device generates first information according to the first NAS COUNT value and a local NAS COUNT value stored by the first device, where the first information includes the local NAS COUNT value and / or the first NAS COUNT value.
[0107] In combination with the third aspect, in a possible implementation manner, the first information includes a local NAS COUNT value and / or a first NAS COUNT value, including:
[0108] When the first NAS COUNT value is greater than the local NAS COUNT value, the first device updates the local NAS COUNT value, and the first information includes the updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value;
[0109] Alternatively, when the first NAS COUNT value is less than or equal to the local NAS COUNT value, the first device determines not to update the local NAS COUNT value, and the first information includes the local NAS COUNT value.
[0110] In combination with the above-mentioned third aspect, in a possible implementation manner, when the first NAS COUNT value is greater than the local NAS COUNT value, and the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, the first information also includes one or more NAS COUNT values between the first NAS COUNT value and the local NAS COUNT value.
[0111] In combination with the third aspect, in a possible implementation manner, when the first NAS COUNT value is greater than the local NAS COUNT value, the first device updates the local NAS COUNT value, and the first information includes the updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value, including:
[0112] When the difference between the first NAS COUNT value and the local NAS COUNT value is 1, the updated local NAS COUNT value is the first NAS COUNT value.
[0113] In combination with the third aspect, in a possible implementation manner, the first device generates first information according to the first NAS COUNT value and a local NAS COUNT value stored in the first device, where the first information includes the first NAS COUNT value and / or the local NAS COUNT value, including:
[0114] When the first NAS COUNT value is greater than the local NAS COUNT value and the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, the first device determines not to update the local NAS COUNT value, and the first information includes the local NAS COUNT value and the first NAS COUNT value.
[0115] In combination with the third aspect, in a possible implementation manner, the method provided by the third aspect further includes:
[0116] The first device receives a second NAS message from the second device and determines a second NAS COUNT value corresponding to the second NAS message; the first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value; or, the first device determines whether to receive the second NAS message according to the first information and the second NAS COUNT value.
[0117] In combination with the third aspect, in a possible implementation manner, the first device is a terminal device, and the second device is an access and / or mobile network element;
[0118] Alternatively, the first device is an access and / or mobile network element, and the second device is a terminal device.
[0119] Among them, the technical effects of any implementation method in the third aspect can refer to the above-mentioned first aspect and will not be repeated here.
[0120] In a fourth aspect, a communication device is provided for implementing the above-mentioned various methods. The communication device may be the first device in any of the above aspects or any of its implementations, or a device including the above-mentioned first device, or a device included in the above-mentioned first device, such as a chip. The communication device includes a module, unit, or means corresponding to the above-mentioned method, which may be implemented by hardware, software, or by executing the corresponding software implementation by hardware. The hardware or software includes one or more modules or units corresponding to the above-mentioned functions.
[0121] In some possible designs, the communication device may include a processing module and a transceiver module. The transceiver module, which may also be referred to as a transceiver unit, is used to implement the sending and / or receiving functions in any of the above aspects and any possible implementations thereof. The transceiver module may be composed of a transceiver circuit, a transceiver, a transceiver or a communication interface. The processing module may be used to implement the processing functions in any of the above aspects and any possible implementations thereof.
[0122] In some possible designs, the transceiver module includes a sending module and a receiving module, which are respectively used to implement the sending and receiving functions in any of the above aspects and any possible implementation methods thereof.
[0123] In a fifth aspect, a communication device is provided, comprising: a processor and a memory; the memory is used to store computer instructions, and when the processor executes the instructions, the communication device executes the method described in any one of the above aspects. The communication device can be the first device in any one of the above aspects or any implementation thereof, or a device including the first device, or a device included in the first device, such as a chip.
[0124] In a sixth aspect, a communication device is provided, comprising: a processor and a communication interface; the communication interface is used to communicate with a module outside the communication device; the processor is used to execute a computer program or instruction so that the communication device executes the method described in any one of the above aspects. The communication device can be the first device in any one of the above aspects or any implementation thereof, or a device including the first device, or a device included in the first device, such as a chip.
[0125] In a seventh aspect, a communication device is provided, comprising: at least one processor; the processor is used to execute a computer program or instruction stored in a memory, so that the communication device performs the method described in any of the above aspects. The memory may be coupled to the processor, or may be independent of the processor. The communication device may be the first device in any of the above aspects or any of its implementations, or a device including the first device, or a device included in the first device, such as a chip.
[0126] In an eighth aspect, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer-readable storage medium is run on a communication device, the communication device can execute the method described in any one of the above aspects or any one of its implementation methods.
[0127] In a ninth aspect, a computer program product comprising instructions is provided, which, when executed on a communication device, enables the communication device to execute the method described in any one of the above aspects or any one of its implementations.
[0128] In a tenth aspect, a communication device (for example, the communication device may be a chip or a chip system) is provided, wherein the communication device includes a processor for implementing the functions involved in any of the above aspects or any of its implementation methods.
[0129] In some possible designs, the communication device includes a memory for storing necessary program instructions and data.
[0130] In some possible designs, when the device is a chip system, it can be composed of a chip or include a chip and other discrete devices.
[0131] It can be understood that when the communication device provided in any one of the fourth to tenth aspects is a chip, the above-mentioned sending action / function can be understood as output, and the above-mentioned receiving action / function can be understood as input.
[0132] Among them, the technical effects brought about by any design method in the fourth to tenth aspects can refer to the technical effects brought about by different design methods in the above-mentioned first aspect, and will not be repeated here.
[0133] In an eleventh aspect, a communication system is provided, which includes the first device described in the above aspect and the second device described in the above aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0134] Figure 1 This is a schematic diagram of the architecture of a 5G system provided in an embodiment of the present application;
[0135] Figure 2 This is a schematic diagram of the integrity protection process of a NAS message provided in an embodiment of the present application;
[0136] Figure 3 It is a flowchart of a NAS message processing method provided in an embodiment of the present application;
[0137] Figure 4 This is a schematic diagram of out-of-order arrival of NAS messages provided in an embodiment of the present application;
[0138] Figure 5 It is a schematic diagram of the architecture of a communication system provided by an embodiment of the present application;
[0139] Figure 6 is a schematic diagram of the structure of a communication device provided in an embodiment of the present application;
[0140] Figure 7 This is a flow diagram of a method for processing a NAS message provided in an embodiment of the present application. Figure 1 ;
[0141] Figure 8 This is a schematic diagram of the relationship between the storage time and the NAS message retransmission waiting time provided in an embodiment of the present application;
[0142] Fig. 9 This is a flow diagram of a method for processing a NAS message provided in an embodiment of the present application. Figure 2 ;
[0143] Fig.10 This is a flow diagram of a method for processing a NAS message provided in an embodiment of the present application. Figure 3 ;
[0144] Fig.11This is a flow diagram of a method for processing a NAS message provided in an embodiment of the present application. Figure 4 ;
[0145] Fig.12 This is a flow diagram of a method for processing a NAS message provided in an embodiment of the present application. Figure 5 ;
[0146] Fig.13 It is a structural schematic diagram of a first device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0147] To facilitate understanding of the technical solutions provided by the embodiments of the present application, a brief introduction to the related technologies of the present application is first given. The brief introduction is as follows:
[0148] First, fifth generation (5G) mobile communication system:
[0149] Figure 1 is a schematic diagram of the architecture of a 5G system provided in an embodiment of the present application, such as Figure 1 As shown, the 5G system includes: an access network (AN) and a core network (CN), and may also include: terminal equipment.
[0150] The terminal device may be a device with transceiver functions, or a chip or chip system that can be set in the terminal device. The terminal device may also be called user equipment (UE), access terminal, subscriber unit, user station, mobile station (MS), mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device. The terminal device in the embodiments of the present application can be a mobile phone, a cellular phone, a smart phone, a tablet computer, a wireless data card, a personal digital assistant (PDA), a wireless modem, a handheld device (handset), a laptop computer, a machine type communication (MTC) terminal, a computer with wireless transceiver function, a virtual reality (VR) terminal, an augmented reality (AR) terminal, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a vehicle-mounted terminal, a road side unit (RSU) with terminal function, etc. The terminal device in the embodiment of the present application may also be a vehicle-mounted module, a vehicle-mounted module, a vehicle-mounted component, a vehicle-mounted chip or a vehicle-mounted unit built into the vehicle as one or more components or units.
[0151] The above AN is used to implement access-related functions, can provide network access functions for authorized users in a specific area, and can determine transmission links of different qualities to transmit user data according to the user's level, business requirements, etc. AN forwards control data and user data between terminal equipment and CN. AN can include: access network equipment, also known as radio access network equipment (RAN) equipment.
[0152] RAN equipment can be equipment that provides access to terminal equipment. For example, RAN equipment can include: 5G, such as the next generation node B (gNodeB, gNB) in the new radio (NR) system, or, one or a group of antenna panels (including multiple antenna panels) of a base station in 5G, or, it can also be a network node constituting a gNB, a transmission point (transmission and reception point, TRP or transmission point, TP) or a transmission measurement function (transmission measurement function, TMF), such as a baseband unit (building base band unit, BBU), or, a centralized unit (centralized unit, CU) or a distributed unit (distributed unit, DU), an RSU with base station function, or a wired access gateway, or a core network element of 5G. Alternatively, RAN equipment can also include an access point (access point, AP) in a wireless fidelity (wireless fidelity, Wi-Fi) system, a wireless relay node, a wireless backhaul node, various forms of macro base stations, micro base stations (also known as small stations), relay stations, access points, wearable devices, vehicle-mounted devices, etc. Alternatively, the RAN device may also include a next-generation mobile communication system, such as an access network device of a sixth-generation (6G) mobile communication system, such as a 6G base station, or in the next-generation mobile communication system, the first device may also have other naming methods, which are all covered within the protection scope of the embodiments of the present application, and the present application does not impose any limitations on this.
[0153] CN is mainly responsible for maintaining the subscription data of the mobile network and providing functions such as session management, mobility management, policy management and security authentication for terminal devices. CN mainly includes the following network elements: user plane function (UPF) network element, authentication server function (AUSF) network element, access and mobility management function (AMF) network element, session management function (SMF) network element, network slice selection function (NSSF) network element, network exposure function (NEF) network element, network function repository function (NF repository function, NRF) network element, policy control function (PCF) network element, unified data management (UDM) network element, and application function (AF) network element.
[0154] Among them, Figure 1 As shown, the terminal device accesses the 5G network through the RAN device, and the terminal device communicates with the AMF network element through the N1 interface (N1 for short); the RAN device communicates with the AMF network element through the N2 interface (N2 for short); the RAN device communicates with the UPF network element through the N3 interface (N3 for short); the SMF network element communicates with the UPF network element through the N4 interface (N4 for short); different UPF network elements communicate through the N9 interface (N9 for short); the UPF network element accesses the data network (DN) through the N6 interface (N6 for short).
[0155] Figure 1The control plane functions shown in the figure, such as AUSF network element, AMF network element, SMF network element, NSSF network element, NEF network element, NRF network element, PCF network element, UDM network element, and AF network element, interact with each other using service-oriented interfaces. For example, the service-oriented interface provided by the AUSF network element to the outside is Nausf; the service-oriented interface provided by the AMF network element to the outside is Namf; the service-oriented interface provided by the SMF network element to the outside is Nsmf; the service-oriented interface provided by the NSSF network element to the outside is Nnssf; the service-oriented interface provided by the NEF network element to the outside is Nnef; the service-oriented interface provided by the NRF network element to the outside is Nnrf; the service-oriented interface provided by the PCF network element to the outside is Npcf; the service-oriented interface provided by the UDM network element to the outside is Nudm; and the service-oriented interface provided by the AF network element to the outside is Naf. For the relevant function description and interface description, please refer to the 5G system architecture diagram in the technical standard (TS) 23.501, which will not be repeated here.
[0156] Among them, the AMF network element is mainly responsible for mobility management and access management. Among them, the AMF network element can receive NAS messages (including mobility management (MM) signaling and session management (SM) signaling) from terminal devices and related signaling from RAN devices (for example, N2 signaling at the base station granularity interacting with AMF) through the N1 interface to complete the user registration process and forwarding of SM signaling and mobility management.
[0157] The AUSF network element can be used to support authentication for 3GPP access and non-3GPP access (such as wireless local area network (WLAN) access, or satellite access, etc.). Among them, the AUSF network element can be used for authentication services and key generation to achieve two-way authentication of terminal devices. For example, during the primary authentication and key negotiation process between the AMF network element and the terminal device, the AUSF network element can complete the authentication of the terminal device.
[0158] SMF network elements are mainly used for session management in mobile networks, such as user plane network element selection, user plane network element redirection, Internet protocol (IP) address allocation, bearer establishment, modification and release, and quality of service (QoS) control.
[0159] UPF network elements are used for packet routing and forwarding, QoS processing of user plane data, etc. UDM network elements are used to process user identification, access authentication, registration, or mobility management, etc.
[0160] NEF network elements mainly provide services that enable 3GPP networks to securely provide network service capabilities to third-party service provider application function network elements.
[0161] NSSF network element, used to select network slices for terminal devices, etc.
[0162] The PCF network element includes user contract data management functions, policy control functions, billing policy control functions, QoS control, etc. It is a unified policy framework used to guide network behavior and provide policy rule information for control plane function network elements (such as AMF network elements, etc.).
[0163] The AF network element is mainly used to provide application layer information to the 3GPP network. Exemplarily, the AF network element may include a services capability server (SCS) or an application server (AS).
[0164] It should be understood that Figure 1 Some examples of network elements or entities in a 5G network are given only as examples. The 5G network may also include some network data analytics functions (NWDAF) and the like. Figure 1 The network elements or entities not shown are not specifically limited in the embodiments of the present application.
[0165] Second, NAS:
[0166] NAS constitutes the highest layer of the control plane between the terminal device and the AMF network element for 3GPP access and non-3GPP access. When NAS signaling is established, the communicating parties can activate the security features of NAS by establishing a NAS security context. After activating the security features of NAS, the terminal device and the AMF network element should not receive non-encrypted plaintext NAS messages (or plain NAS messages).
[0167] The following takes the 5G system (5G system, 5GS) NAS message as an example to introduce the NAS message format and NAS security features.
[0168] 2.1、5GS NAS message format
[0169] In TS 24.501, each 5GS NAS message is a standard layer 3 (layer 3, L3) message defined in TS 24.007. Among them, 5GS NAS can include the above-mentioned common NAS messages and security-protected NAS messages. Specifically, common NAS messages mainly include the following items:
[0170] A1, extended protocol discriminator;
[0171] B1, security header type associated with a half spare octet or PDU session identity;
[0172] C1, procedure transaction identity;
[0173] D1. message type;
[0174] E1. Other information elements, as required.
[0175] For example, the format of a common NAS message is shown in Table 1. An octet includes eight bytes arranged from a low-significant bit to a high-significant bit. In Table 1, "1" may represent a low-significant bit, and "8" may represent a high-significant bit.
[0176] It should be understood that octet 1 represents the identifier of the octet corresponding to the extended protocol discriminator in the NAS message. Similarly, octet 2 represents the identifier of the octet corresponding to the security header type associated with the semi-spare octet or PDU session identifier.
[0177] For detailed descriptions of the security header type associated with the above-mentioned extended protocol identifier, semi-spare octet or protocol data unit PDU session identifier, process transaction identifier, message type, and other required information elements, please refer to TS 24.501 and will not be repeated here.
[0178]
[0179] Table 1
[0180] The NAS messages that are protected include the following:
[0181] A2, extended protocol identifier;
[0182] B2, security header type associated with a half spare octet;
[0183] C2, message authentication code (MAC);
[0184] D2, sequence number (SQN);
[0185] E2. The above-mentioned ordinary NAS message.
[0186] The MAC includes the integrity verification information of the NAS message. If there is a valid NAS security context and the integrity protection function is enabled, the protected NAS message should include the MAC. The MAC can be a MAC-I or a NAS MAC.
[0187] The SQN is a value consisting of the eight least significant bits of the NAS COUNT value corresponding to the security-protected NAS message. The SQN may also be referred to as a NAS SQN.
[0188] It should be understood that MAC and SQN are explained in conjunction with NAS integrity protection in the following "NAS Security Features" and will not be repeated here.
[0189] Illustratively, Table 2 shows the format of a protected NAS message.
[0190]
[0191] Table 2
[0192] It should be understood that the NAS message referred to below refers to a security-protected NAS message. When the NAS message is not emphasized as a common NAS message, the meanings to be expressed by the NAS message and the security-protected NAS message are consistent.
[0193] 2.2 Security Features of NAS
[0194] The security features of NAS mainly involve the integrity protection and encryption protection of NAS messages. Before the security features of NAS can be activated, a NAS security context needs to be established between the AMF network element and the terminal device. TS 33.501, NAS security context can include: key K AMFand the associated key set identifier, the security capabilities of the terminal device, the identifier of the selected integrity protection algorithm, the identifier of the selected encryption algorithm, K NASenc , K NASint , and a pair of NAS COUNT values, etc. K NASint is the key used for integrity protection, K NASenc It is a key used for encryption protection. A pair of NAS COUNT values includes an uplink NAS COUNT value and a downlink NAS COUNT value.
[0195] It can be understood that the uplink NAS COUNT value corresponds to the uplink NAS message, that is, the NAS message sent by the terminal device to the AMF network element. The downlink NAS COUNT value corresponds to the downlink NAS message, that is, the NAS message sent by the AMF network element to the terminal device. In other words, the sender of the NAS message can be the AMF network element or the terminal device. The receiver of the NAS message can be the terminal device or the AMF network element.
[0196] Typically, the above NAS security context is established as a result of the primary authentication and key negotiation process between the AMF network element and the terminal device. Among them, the NAS security context can also establish a new NAS security context during the switch from the original AMF network element to the target AMF network element. Alternatively, the NAS security context can also be a NAS security context mapped to an already established evolved packet system (EPS) security context, which is not specifically limited in the embodiments of the present application.
[0197] For detailed instructions on establishing a NAS security context, please refer to TS 24.501, which will not be repeated here.
[0198] It should be understood that for integrity protection, when activating integrity protection, replay protection should also be activated unless the empty integrity protection algorithm is selected. For encryption, it is usually configured by the operator. For example, the operator can choose to perform encryption operation or no encryption operation. Specifically, for no encryption operation, it means that the operator can always select the empty encryption algorithm (5G-EA0) by configuring the AMF network element, thereby achieving no encryption operation.
[0199] That is, for the current NAS connection, integrity protection may be activated, or integrity protection and encryption protection may be activated at the same time.
[0200] In a possible implementation, when only integrity protection is activated for the current NAS connection, integrity protection is implemented by calculating MAC for the unencrypted NAS message and the NAS SQN.
[0201] Combine the following Figure 2Describe the integrity protection process and NAS COUNT value.
[0202] 2.2.1. Integrity protection process
[0203] Figure 2 FIG. 1 is a schematic diagram of a NAS message integrity protection process provided by an embodiment of the present application. Figure 2 As shown in (a) and (b) in FIG. 1 , the input parameters of the integrity protection algorithm include a key, a count (COUNT) value, a bearer identifier (BEARER), a message, and a direction, which are introduced below.
[0204] Key: This key can also be called an integrity protection key. The integrity protection key can be a 128-bit key for integrity protection, such as the above K NASint .
[0205] Count (COUNT) value: The COUNT value is represented by 32 bits and can be obtained by formula (1) and formula (2). Formula (1) and formula (2) are as follows.
[0206] COUNT := 0x00 || NAS COUNT Formula (1)
[0207] NAS COUNT := NAS OVERFLOW || NAS SQN formula (2)
[0208] In formula (1), the COUNT value is a 32-bit count value formed by supplementing the NAS COUNT value with 8 bits of 0. The NAS COUNT value may be an uplink NAS COUNT value or a downlink NAS COUNT value.
[0209] In formula (2), the NAS COUNT value is represented by 24 bits. The NAS COUNT value consists of the 16-bit most significant bit NAS overflow count (NAS OVERFLOW) and the 8-bit NAS SQN. When the NAS SQN increases to the maximum value, that is, when it rolls over from 11111111 to 00000000, the NAS OVERFLOW increases by 1.
[0210] Bearer Identifier (BEARER): The bearer identifier can be a 5-bit NAS connection identifier.
[0211] Message: can refer to the NAS message itself.
[0212] Direction: can refer to uplink and downlink directions, where the uplink direction is bit value 1 and the downlink direction is bit value 0.
[0213] like Figure 2 As shown in (a) in the figure, the sender of the NAS message uses the above input parameters and the integrity protection algorithm to calculate a 32-bit integrity authentication code (such as MAC-I or NAS MAC), and attaches the 32-bit integrity authentication code to the NAS message (such as the MAC in Table 2 above).
[0214] like Figure 2 As shown in (b), after receiving the NAS message, the NAS message receiver can use the estimated NAS COUNT value estimated by the NAS message to obtain the COUNT value, and combine it with other input parameters to calculate the expected integrity authentication code (such as XMAC-I / XNAS-MAC) through the integrity protection algorithm. Further, the NAS message receiver compares the expected integrity authentication code with the integrity authentication code carried in the NAS message to determine whether they are consistent. If they are consistent, it is considered that the received NAS message is consistent with the sent NAS message, that is, it has not been tampered with by a third party. If they are inconsistent, the NAS message receiver discards the NAS message.
[0215] 2.2.2 NAS COUNT value
[0216] The NAS OVERFLOW value in the NAS COUNT value is independently maintained by the AMF network element and the terminal device, and the NAS SQN is transmitted between the terminal device and the AMF network element as part of the NAS message (such as the SQN in Table 2 above). Among them, the NAS COUNT value stored by the sender of the NAS message is the value used in the next NAS message, and the local NAS COUNT value stored by the receiver of the NAS message is the maximum value of one or more NAS COUNT values corresponding to the NAS message that has passed the integrity verification. Specifically, for the downlink NAS COUNT value:
[0217] The local downlink NAS COUNT value stored in the AMF network element (sender of the downlink NAS message) is the value used in the next NAS message. The local downlink NAS COUNT value stored or read locally from the terminal device (receiver of the downlink NAS message) is the maximum value of one or more NAS COUNT values corresponding to the NAS message that has passed the integrity verification.
[0218] For the upstream NAS COUNT value:
[0219] The uplink NAS COUNT value stored or read from the terminal device (uplink NAS message sender) is the value used in the next NAS message, and the local uplink NAS COUNT value stored in the AMF network element (uplink NAS message receiver) is the maximum value of one or more NAS COUNT values corresponding to the NAS message that has passed integrity verification.
[0220] That is to say, for the NAS message receiver, it can determine the NASSQN in the NAS COUNT value through the NAS message, and also needs to obtain the complete NAS COUNT value by estimating the NAS OVERFLOW value.
[0221] It should be understood that, for the estimation method of the NAS COUNT value, a general method is to use the NAS OVERFLOW value of the local NAS COUNT value and the NAS SQN of the received NAS message to generate an estimated NAS COUNT value. Of course, other NAS COUNT value estimation methods can also be used, and the embodiments of the present application do not specifically limit this.
[0222] The following describes the maintenance process of the NAS COUNT value and the processing mechanism of NAS messages.
[0223] Third, the maintenance process of NAS COUNT value:
[0224] TS 24.501 specifies that after each new or retransmitted security-protected NAS message is sent, the NAS message sender shall increase the NAS COUNT value by 1. It should be understood that if the lower layer indicates that the radio resource control (RRC) connection has failed, the initial NAS message is excluded. In other words, if the lower layer indicates that the RRC connection has failed, the NAS message sender does not increase the NAS COUNT value by 1 after the initial NAS message is sent.
[0225] It should also be understood that if a new NAS security context is established or mapped, the NAS COUNT value is reset to zero. The specific situation of resetting the NAS COUNT value to zero can be found in TS 24.501, which will not be described in detail here.
[0226] Exemplarily, the following downlink NAS message is used as an example to illustrate the process of AMF network element and terminal equipment independently maintaining NAS COUNT value.
[0227] For the AMF network element: Use the currently stored downlink NAS COUNT value to perform integrity protection on the NAS message to be sent to obtain a downlink NAS message. After sending the downlink NAS message to the terminal device, the downlink NAS COUNT value is increased by 1.
[0228] For terminal devices: receive a downlink NAS message from an AMF network element; the terminal device determines the estimated downlink NAS COUNT value corresponding to the downlink NAS message based on the downlink NAS message, and uses the estimated downlink NAS COUNT value to verify the integrity of the downlink NAS message. If the integrity verification passes, the local downlink NAS COUNT value is updated based on the estimated downlink NAS COUNT value, and the updated local downlink NAS COUNT value is the estimated NAS COUNT value. If the integrity verification fails, the downlink NAS message is discarded, and the local downlink NAS COUNT value is not updated.
[0229] That is to say, the NAS message sender sends NAS messages in the order of NAS COUNT values from small to large.
[0230] It should be understood that the maintenance process of the uplink NAS COUNT value is similar to the maintenance process of the downlink NAS COUNT value described above, and will not be repeated here.
[0231] Fourth, the processing mechanism of NAS messages:
[0232] As described in the "Security Features of NAS" section above, when integrity protection is activated, replay protection should also be activated unless the null integrity protection algorithm is selected. TS 24.501 stipulates that the replay protection mechanism specifies that the same NAS message cannot be accepted repeatedly, that is, for a given NAS security context, the NAS COUNT value that passes the NAS message integrity verification should only be accepted once.
[0233] Below Figure 3 The processing method of the NAS message shown is used as an example to illustrate the implementation method of replay protection.
[0234] Figure 3 FIG. 1 is a flow chart of a method for processing a NAS message provided in an embodiment of the present application. The method for processing a NAS message is described with the NAS message receiver as the execution subject. Figure 3 As shown, the method for processing the NAS message includes the following steps S301 to S306.
[0235] S301. A NAS message receiver receives a NAS message from a NAS message sender.
[0236] The NAS message receiver may be a terminal device, and the NAS message sender may be an AMF network element; or, the NAS message receiver may be an AMF network element, and the NAS message sender may be a terminal device.
[0237] It should be understood that the information interaction between the AMF network element and the terminal device involved in the embodiments of the present application means that: the terminal device sends information to the (R)AN, and the (R)AN sends the information to the AMF network element; or, the AMF network element sends information to the (R)AN, and the (R)AN sends the information to the terminal device. Since the (R)AN plays a role of transparent transmission, for the sake of simplicity in the embodiments of the present application and / or the accompanying drawings, it can be directly described as the terminal device sending information to the AMF network element, or the AMF network element sending information to the terminal device.
[0238] S302: The NAS message receiver determines an estimated NAS COUNT value corresponding to the NAS message according to the NAS message.
[0239] Among them, the method for determining the estimated NAS COUNT value corresponding to the NAS message can refer to the estimation method described in the aforementioned “NAS COUNT value”, which will not be repeated here.
[0240] S303. The NAS message receiver determines whether the estimated NAS COUNT value is less than or equal to the local NAS COUNT value stored by the NAS message receiver. If so, execute step S306; if not, execute step S304.
[0241] S304. The NAS message receiver determines whether the NAS message passes the integrity verification. If so, execute step S305; if not, execute step S306.
[0242] The NAS message receiver performs integrity verification on the NAS message according to the estimated NAS COUNT value. The specific implementation of the integrity verification can refer to the relevant description in the aforementioned “Integrity Protection Process” and will not be repeated here.
[0243] It can be understood that the estimated NAS COUNT value in step S304 is greater than the local NAS COUNT value.
[0244] It should be understood that the reason why the NAS message fails the integrity verification may be that the NAS message is tampered with, or the estimated NAS COUNT value is inaccurate. Among them, the estimated NAS COUNT value may be inaccurate when the NAS OVERFLOW is flipped, which is specifically related to the estimation method of the NAS COUNT value.
[0245] S305: Update the local NAS COUNT value of the NAS message receiver to the estimated NAS COUNT value.
[0246] S306: discard the NAS message.
[0247] That is to say, the NAS message receiver can compare the estimated NAS COUNT value corresponding to the received NAS message with the local NAS COUNT value, and use the comparison result as the basis for judging whether the NAS message is a replayed NAS message. That is, if the estimated NAS COUNT value is less than or equal to the local NAS COUNT value, the NAS message is considered to be a replayed NAS message and then discarded.
[0248] As described in the aforementioned "NAS COUNT value maintenance process", NAS messages are sent in the order of NAS COUNT values from small to large. However, in actual applications, NAS messages are passed through layers, and it is very likely that the NAS message sent first will be sent first and arrive later, that is, the NAS message is an out-of-order NAS message, and the NAS COUNT value corresponding to the out-of-order NAS message is the NAS COUNT value of the out-of-order NAS message. In this way, the NAS message received after the out-of-order NAS message may be determined as a replayed NAS message and discarded, resulting in missed NAS messages. Specifically, the NAS COUNT value corresponding to the NAS message received first by the NAS message recipient is greater than the NAS COUNT value corresponding to the NAS message received later. Combined with Figure 3 In the NAS message processing method shown in the figure, the NAS message receiver will update the local NAS COUNT value to the NAS COUNT value corresponding to the first received NAS message, which will make the local NAS COUNT value greater than the NAS COUNT value corresponding to the later received NAS message, so that the later received NAS message is considered to be a replayed NAS message and discarded.
[0249] For example, Figure 4 The NAS message out-of-order arrival is used as an example to illustrate that the NAS message receiver discards the NAS message that it has not received. Figure 4As shown, the AMF network element sends the downlink NAS message N1, the downlink NAS message N2, and the downlink NAS message N3 to the terminal device in the order of arrival of the NAS COUNT value from small, and the terminal device receives the downlink NAS message N1, the downlink NAS message N3, and the downlink NAS message N2 in sequence, that is, the downlink NAS message N3 is received before the downlink NAS message N2. Among them, for the AMF network element, when it sends the downlink NAS message N1, the downlink NAS COUNT value used for integrity protection of the downlink NAS message N1 is X+1, and the AMF network element sends the downlink NAS messages in the order of the downlink NAS COUNT value from small to large, and then the downlink NAS COUNT value used for integrity protection of the downlink NAS message N2 is X+2, and the downlink NAS COUNT value used for integrity protection of the downlink NAS message N3 is X+3. The situation of the terminal device receiving the downlink NAS message N1, the downlink NAS message N3, and the downlink NAS message N2 is as follows:
[0250] 1) For downlink NAS message N1:
[0251] When receiving the downlink NAS message N1, the local downlink NAS COUNT value stored in the terminal device is X. The terminal device can execute the above step S302 to obtain an estimated downlink NAS COUNT value (i.e., X+1), which is greater than the local downlink NAS COUNT value stored in the terminal device, and then the above steps S304 to S306 can be executed to update the local downlink NAS COUNT value to X+1.
[0252] 2) For downlink NAS message N3:
[0253] When receiving the downlink NAS message N3, the local downlink NAS COUNT value stored in the terminal device is X+1. The terminal device can execute the above step S302 to obtain the estimated downlink NAS COUNT value (i.e., X+3), which is greater than the local downlink NAS COUNT value stored in the terminal device, and then the above steps S304 to S306 can be executed to update the local downlink NAS COUNT value to X+3.
[0254] 3) For downlink NAS message N2:
[0255] When receiving the downlink NAS message N2, the local downlink NAS COUNT value of the terminal device is X + 3. The terminal device can execute the above step S302 to obtain the estimated downlink NAS COUNT value (i.e., X + 2), and the estimated downlink NAS COUNT value is less than the local downlink NAS COUNT value of the terminal device, and then the downlink NAS message N2 is considered to be a replay NAS message, and the above step S307 is executed to discard the downlink NAS message N2.
[0256] That is to say, Figure 3 The NAS message processing mechanism shown does not support out-of-order reception of NAS messages. If NAS messages arrive out of order, the existing local NAS COUNT value update mechanism will cause the local NAS COUNT value to be updated out of order, which will cause the NAS messages that have not been received to be discarded.
[0257] The following describes the NAS message processing flow when receiving a NAS message in TS 24.501. The processing flow enables the NAS message receiver to accept a NAS message whose estimated NAS COUNT value is less than the local NAS COUNT value.
[0258] In TS 24.501, when a NAS message receiver receives a NAS message, it can first determine whether the received NAS message is a replayed NAS message. If the NAS message receiver determines that the received NAS message is a replayed NAS message, the NAS message receiver can discard the NAS message; otherwise, in order to determine the estimated NAS COUNT value used for integrity verification of the NAS message, the NAS message receiver should make the SQN of the estimated NAS COUNT value equal to the SQN carried in the received NAS message, and:
[0259] If the NAS message receiver can guarantee that the received NAS message has not been previously accepted, the NAS OVERFLOW value selected in the estimated NAS COUNT value should make the estimated NAS COUNT value less than the local NAS COUNT value; otherwise, the NAS OVERFLOW value selected in the estimated NAS COUNT value should make the estimated NAS COUNT value greater than the local NAS COUNT value.
[0260] That is to say, when the NAS message receiver determines that the received NAS message is not a replayed NAS message, the estimated NAS COUNT value corresponding to the NAS message for integrity verification should be different from the local NAS COUNT value, that is, the NAS message will not be discarded if the estimated NAS COUNT value is less than the local NAS COUNT value.
[0261] However, when the estimated NAS COUNT value is smaller than the local NAS COUNT value, and the integrity verification of the received NAS message is determined to be passed based on the estimated NAS COUNT value, the NAS message receiver will update the local NAS COUNT value to the estimated NAS COUNT value, that is, the local NAS COUNT value is updated to a smaller NAS COUNT value, and then when receiving the NAS message based on the smaller local NAS COUNT value, the partially replayed NAS message cannot be identified.
[0262] For example, the local NAS COUNT value is X+4, the NAS message corresponding to the local NAS COUNT value X+4 is NAS message N4, the currently received NAS message N5 is not a replayed NAS message, and the estimated NAS COUNT value corresponding to NAS message N5 is X+3, which is used to illustrate that the NAS message receiver cannot identify a portion of the replayed NAS message. It can be understood that when the NAS message receiver determines that the integrity verification of NAS message N5 has passed according to the estimated NAS COUNT value X+3, the NAS message receiver will update the local NAS COUNT value to X+3, and then when the NAS message receiver receives NAS message N4 again, the NAS message receiver can determine the estimated NAS COUNT value to be greater than the local NAS COUNT value according to the above TS 24.501 process, that is, the NAS message receiver can determine the estimated NAS COUNT value corresponding to NAS message N4 to be X+4 (X+4 is greater than the local NAS COUNT value X+3), and the estimated NAS COUNT value X+4 can make NAS message N4 pass the integrity verification. In other words, the NAS message receiver cannot identify the NAS message N4 as a replayed NAS message, and thus the NAS receiver may be subject to a replay attack, resulting in poor security of NAS message transmission.
[0263] Based on this, an embodiment of the present application provides a method for processing NAS messages, which can optimize the processing mechanism of NAS messages to improve the security of NAS message transmission.
[0264] The technical solution in the embodiment of the present application will be described below in conjunction with the accompanying drawings in the embodiment of the present application. In order to facilitate understanding of the embodiment of the present application, the following points are explained before introducing the embodiment of the present application.
[0265] 1. "Pre-definition" or "pre-configuration" can be implemented by pre-saving corresponding codes, tables, linked lists or other methods that can be used to indicate relevant information in a device (for example, including a first device and a second device). The embodiments of the present application do not limit the specific implementation method. Among them, "save" and "store" have the same meaning and can be expressed interchangeably. "Storage" may refer to storage in one or more memories. The one or more memories may be separately set or integrated in an encoder or decoder, a processor, or a communication device. The one or more memories may also be partially separately set and partially integrated in a decoder, a processor, or a communication device. The type of memory may be any form of storage medium, which is not limited by the embodiments of the present application.
[0266] 2. The “protocol” involved in the embodiments of the present application may refer to a standard protocol in the field of communications, for example, it may include the long term evolution (LTE) protocol, the NR protocol, and related protocols used in future communication systems, which is not limited in the embodiments of the present application.
[0267] 3. In the embodiments of the present application, descriptions such as “when…”, “in the case of…”, “if” and “if” all mean that under certain objective circumstances, the device (such as the first device or the first device and the second device) will make corresponding processing. It does not limit the time, nor does it require the device (such as the first device or the first device and the second device) to have a judgment action when implementing it, nor does it mean that there are other limitations.
[0268] 4. In the embodiments of the present application, "information", "signal", "message", "channel" and "signaling" can sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings they intend to express are matched. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings they intend to express are matched.
[0269] 5. In the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship. For example, A / B can represent A or B; "and / or" in the embodiments of the present application is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. These three situations, where A and B can be singular or plural. In addition, in the description of the embodiments of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or its similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solution of the embodiments of the present application, in the embodiments of the present application, the words "first" and "second" are used to distinguish the same or similar items with basically the same functions and effects. Those skilled in the art will appreciate that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference. At the same time, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.
[0270] The technical solutions of the embodiments of the present application can be applied to various communication systems, such as wireless fidelity (WiFi) systems, vehicle to everything (V2X) communication systems, device-to-device (D2D) communication systems, Internet of Vehicles communication systems, fourth generation (4G) mobile communication systems, such as long term evolution (LTE) systems, worldwide interoperability for microwave access (WiMAX) communication systems, 5G communication systems, and future communication systems. Among them, the 5G communication system includes a non-standalone (NSA) 5G mobile communication system and a standalone (SA) 5G mobile communication system.
[0271] The present application will present various aspects, embodiments or features around a system that may include multiple devices, components, modules, etc. It should be understood and appreciated that each system may include additional devices, components, modules, etc., and / or may not include all of the devices, components, modules, etc. discussed in conjunction with the figures. In addition, combinations of these schemes may also be used.
[0272] The network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0273] like Figure 5 As shown, a communication system provided by an embodiment of the present application includes a first device and a second device. The first device may be a NAS message receiver, and the second device may be a NAS message sender. The first device may be a terminal device, or an access and / or mobile network element. The access and / or mobile network element may be Figure 1 The AMF network element shown, or the mobility management entity (MME) in LTE, or other network elements with the above-mentioned AMF network element functions in future communication systems. The second device can be a terminal device, or an AMF network element, or an MME, or other network elements with the above-mentioned AMF network element functions in future communication systems.
[0274] It can be understood that the access and / or mobile network element is merely an exemplary name for the convenience of expression, and it can also be replaced by any possible name, such as "access management unit", "mobile management network element", or "access and mobile network element", etc., without specific limitation.
[0275] For example, Figure 1 As shown, for an uplink NAS message, the first device may be an AMF network element, and the second device may be a terminal device. For a downlink NAS message, the first device may be a terminal device, and the second device may be an AMF network element.
[0276] In a possible implementation, a first device receives a first NAS message from a second device, and determines a first non-access layer count NAS COUNT value corresponding to the first NAS message; when the integrity verification of the first NAS message passes, the first device generates first information according to the first NAS COUNT value and a local NAS COUNT value stored by the first device, and the first information includes the first NAS COUNT value and / or the local NAS COUNT value; the first device receives a second NAS message from the second device, and determines a second NAS COUNT value corresponding to the second NAS message; the first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value.
[0277] The specific implementation of the above solution will be described in detail in the following embodiments and will not be repeated here.
[0278] Because in the embodiment of the present application, the first device generates the first information according to the first NAS COUNT value and the local NAS COUNT value when the integrity verification of the first NAS message passes, and the first information includes the first NAS COUNT value and / or the local NAS COUNT value, that is, the first device does not directly update the local NAS COUNT value according to the first NAS COUNT value, thereby avoiding the situation that the first device cannot identify part of the replayed NAS message when verifying the integrity of the second NAS message due to the local NAS COUNT value being updated to a smaller NAS COUNT value. Further, when the first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value, it can determine whether the second NAS message is a replayed NAS message, thereby avoiding replay attacks, thereby improving the security of NAS message transmission. Therefore, the NAS message processing method provided in the embodiment of the present application can optimize the NAS message processing mechanism to improve the security of NAS message transmission.
[0279] It should be understood that the first device and the second device in the embodiment of the present application can also be referred to as a communication device, which can be a general device or a dedicated device, and the embodiment of the present application does not specifically limit this.
[0280] In a possible implementation, the related functions of the first device or the second device in the embodiment of the present application can be implemented by one device, or by multiple devices together, or by one or more functional modules in one device, and the embodiment of the present application does not specifically limit this. It is understandable that the above functions can be network elements in hardware devices, or software functions running on dedicated hardware, or a combination of hardware and software, or virtualization functions instantiated on a platform (e.g., a cloud platform).
[0281] For example, the related functions of the first device or the second device in the embodiment of the present application can be Figure 6 The communication device 600 is implemented.
[0282] Figure 6 Schematic diagram of the structure of a communication device 600 provided in an embodiment of the present application. The communication device 600 includes one or more processors 601, a communication line 602, and at least one communication interface ( Figure 6 The description is merely illustrative of the example of including a communication interface 604 and a processor 601). In a possible implementation, a memory 603 may also be included.
[0283] The processor 601 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.
[0284] The communication line 602 may include a path for connecting different components.
[0285] The communication interface 604 may be a transceiver module for communicating with other devices or communication networks, such as Ethernet, RAN, WLAN, etc. For example, the transceiver module may be a device such as a transceiver or a transceiver. In a possible implementation, the communication interface 604 may also be a transceiver circuit located in the processor 601 to implement signal input and signal output of the processor.
[0286] The memory 603 may be a device with a storage function. For example, it may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor via a communication line 602. The memory may also be integrated with the processor.
[0287] The memory 603 is used to store computer-executable instructions for executing the solution of the present application, and the execution is controlled by the processor 601. The processor 601 is used to execute the computer-executable instructions stored in the memory 603, thereby implementing the NAS message processing method provided in the embodiment of the present application.
[0288] Alternatively, in an embodiment of the present application, the processor 601 may also perform functions related to the processing of the NAS message processing method provided in the following embodiments of the present application, and the communication interface 604 is responsible for communicating with other devices or communication networks, which is not specifically limited in the embodiment of the present application.
[0289] The computer-executable instructions in the embodiments of the present application may also be referred to as application program codes, which is not specifically limited in the embodiments of the present application.
[0290] In a specific implementation, as an embodiment, the processor 601 may include one or more CPUs, such as Figure 6 CPU0 and CPU1 in.
[0291] In a specific implementation, as an embodiment, the communication device 600 may include multiple processors, such as Figure 6 601 and processor 607 in FIG. Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0292] In a possible implementation, the communication apparatus 600 may further include an output device 605 and an input device 606. The output device 605 communicates with the processor 601 and may display information in a variety of ways.
[0293] The communication device 600 can be a general device or a dedicated device. For example, the communication device 600 can be a desktop computer, a portable computer, a network server, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, an embedded device or a computer with Figure 6 The embodiment of the present application does not limit the type of the communication device 600.
[0294] The following will be combined Figure 7 to Figure 11 The interaction process between each network element / device in the above communication system is specifically introduced through a method embodiment. The NAS message processing method provided in the embodiment of the present application can be applied to the above communication system and specifically applied to various scenarios, which are specifically introduced below.
[0295] Example 1:
[0296] In Example 1, the NAS message receiver may generate two records about NAS COUNT values: a first record and a second record. The first record may include one or more NAS COUNT values that should be accepted but not received. The second record includes a local NAS COUNT value.
[0297] It can be understood that, for uplink NAS COUNT values, the types of NAS COUNT values that should be accepted but not received and local NAS COUNT values are both uplink NAS COUNT values. For downlink NAS COUNT values, the types of NAS COUNT values that should be accepted but not received and local NAS COUNT values are both downlink NAS COUNT values.
[0298] The following takes the NAS COUNT value in the next row as an example, and further describes the local NAS COUNT value included in the first record and the NAS COUNT value included in the first record that should be accepted but not received, in combination with Table 3 and Table 4.
[0299] For local NAS COUNT value:
[0300] The terminal device may update the local NAS COUNT value, wherein the local NAS COUNT value that should be accepted but not received is incremented, that is, the updated local NAS COUNT value is greater than the local NAS COUNT value before the update.
[0301] Exemplarily, the following NAS message receiver (i.e., terminal device) successfully receives Figure 4 The downlink NAS messages N1 to N3 shown in FIG. are used as examples for explanation. Figure 4 As shown, the local NAS COUNT value stored in the terminal device is X. After the downlink NAS message N1 passes the integrity verification, the local NAS COUNT value is updated to X+1; after the downlink NAS message N3 passes the integrity verification, the local NAS COUNT value is updated to X+3; after the downlink NAS message N2 passes the integrity verification, because the downlink NAS COUNT value X+2 is used when the downlink NAS message N2 passes the integrity verification, which is less than X+3, the maximum downlink NAS COUNT value corresponding to the NAS message that currently passes the integrity verification is X+3, and thus the local NAS COUNT value is not updated and remains X+3. For details, please refer to the update record of the local NAS COUNT value in Table 3.
[0302] When to receive NAS messages Second record Before receiving downlink NAS message N1 The local NAS COUNT value is X After receiving downlink NAS message N1 The local NAS COUNT value is X+1 After receiving downlink NAS message N3 The local NAS COUNT value is X+3 After receiving downlink NAS message N2 The local NAS COUNT value is X+3
[0303] Table 3
[0304] It should be understood that the downlink NAS message N3 in the above Table 3 is a NAS message that arrives out of order, and thus the NAS COUNT value X+3 corresponding to the downlink NAS message N3 is a NAS COUNT value that arrives out of order.
[0305] For NAS COUNT values that should be accepted but were not received:
[0306] The NAS COUNT value that should be accepted but not received may refer to one or more NAS COUNT values between the local NAS COUNT value and the NAS COUNT value that arrives out of order. It can be understood that the NAS COUNT value that arrives out of order may refer to: the NAS COUNT value corresponding to the NAS message that has passed the integrity verification, and the NAS COUNT value is greater than the local NAS COUNT value, and the difference between the NAS COUNT value and the local NAS COUNT value is greater than 1.
[0307] It should be understood that, in Example 1, the NAS COUNT value that should be accepted but not received may refer to: when the difference between the updated local NAS COUNT value and the local NAS COUNT value before the update is greater than 1, one or more NAS COUNT values between the updated local NAS COUNT value and the local NAS COUNT value before the update.
[0308] Exemplarily, the local NAS COUNT value of the NAS message receiver is X, and the previous NAS messages all arrive in order (that is, there is no NAS COUNT value in the first record), and the next NAS message received is NAS message N4. Before receiving NAS message N4, the local NAS COUNT value in the second record of the NAS message reception is X, and there is no NAS COUNT value in the first record. After NAS message N4 passes the integrity verification, the local NAS COUNT value in the second record is updated from X to the NAS COUNT value X+8 used by NAS message N4 to pass the integrity verification, and then the NAS COUNT value that should be received but not received is the NAS COUNT value between the local NAS COUNT value X before the update and the local NAS COUNT value X+8 after the update: X+1, X+2, X+3, X+4, X+5, X+6, and X+7. Further, the NAS message receiver stores the above NAS COUNT values X+1 to X+7 in the first record. For details, please refer to the first record and the second record in Table 4.
[0309]
[0310]
[0311] Table 4
[0312] Exemplarily, in combination with the above-mentioned first record and the second record, taking the first device as a terminal device, the second device as an AMF network element, and the NAS message as a downlink NAS message as an example, Figure 7 The method for processing a NAS message provided in an embodiment of the present application is exemplarily described.
[0313] See also Figure 7 The process of the NAS message processing method provided in the embodiment of the present application is as follows:
[0314] S701. The AMF network element sends a downlink NAS message to the terminal device. Correspondingly, the terminal device receives a downlink NAS message from the AMF network element.
[0315] S702. The terminal device determines an estimated downlink NASSOUNT value corresponding to the downlink NAS message according to the downlink NAS message.
[0316] Among them, the method for determining the estimated downlink NAS COUNT value corresponding to the downlink NAS message according to the downlink NAS message can refer to the estimation method described in the aforementioned “NAS COUNT value”, which will not be repeated here.
[0317] S703. The terminal device determines whether the estimated downlink NAS COUNT value is less than or equal to the local NAS COUNT value. If so, the terminal device executes step S704; if not, the terminal device executes step S707.
[0318] S704: The terminal device determines whether the estimated downlink NAS COUNT value is the NAS COUNT value in the first record, and if so, the terminal device executes step S705. If not, the terminal device determines that the downlink NAS message is a replay NAS message.
[0319] It can be understood that if the estimated downlink NAS COUNT value is less than or equal to the local NAS COUNT value and is not in the first record, it can be considered that the estimated downlink NAS COUNT value is the downlink NAS COUNT value previously received by the terminal device, and then the terminal device determines that the downlink NAS message is a replay NAS message.
[0320] That is to say, the terminal device records the NAS COUNT value that should be accepted but has not been received, and then when the estimated NAS COUNT value based on the received downlink NAS message is less than or equal to the first NAS COUNT value, it can further determine whether the downlink NAS message is a replay NAS message, thereby avoiding directly discarding the downlink NAS message, and thus supporting out-of-order reception and replay protection of NAS messages.
[0321] S705. The terminal device determines whether the downlink NAS message passes the integrity verification. If so, the terminal device executes step S706; if not, the terminal device may determine that the downlink NAS message fails the integrity verification.
[0322] Among them, the specific implementation of the terminal device performing integrity verification on the downlink NAS message according to the estimated downlink NAS COUNT value can be found in the relevant description in the aforementioned "Integrity Protection Process", which will not be repeated here.
[0323] It can be understood that if the downlink NAS message fails the integrity verification, it can be considered that the NAS message is at risk of being tampered with, and the terminal device can discard the downlink NAS message, or the terminal device can perform other processing on the downlink NAS message. The embodiments of the present application do not specifically limit this.
[0324] In a possible implementation, in step S703, if the terminal device determines that the NAS COUNT value is less than or equal to the local NAS COUNT value, the terminal device may also first determine whether the downlink NAS message passes the integrity verification (i.e., execute step S705), and if the integrity verification of the downlink NAS message passes, determine whether the estimated downlink NAS COUNT value is the NAS COUNT value in the first record (i.e., execute step S704). It can be understood that if it is determined that the estimated downlink NAS COUNT value is the NAS COUNT value in the first record, step S706 is executed; if it is determined that the estimated downlink NAS COUNT value is not the NAS COUNT value in the first record, it is determined that the downlink NAS message is a replay NAS message.
[0325] S706. The terminal device deletes the NAS COUNT value that is the same as the estimated downlink NAS COUNT value in the first record.
[0326] In a possible implementation, when the terminal device determines that the estimated downlink NAS COUNT value is the NAS COUNT value in the first record, the terminal device may execute steps S705-1 and S706-1.
[0327] S705-1. The terminal device deletes the NAS COUNT value that is the same as the estimated downlink NAS COUNT value in the first record.
[0328] That is, when the estimated downlink NAS COUNT value corresponding to the downlink NAS message is the NAS COUNT value in the first record, the terminal device can determine that the downlink NAS message is a NAS message that should be accepted but not received, and then delete the NAS COUNT value that is the same as the estimated downlink NAS COUNT value in the first record. In this way, when a message that should be accepted but not received is intercepted and cannot pass the integrity verification, and the terminal device repeatedly receives the NAS message, the terminal device can determine that the NAS message is a replayed NAS message when it receives the NAS message for the second time, and then discard the NAS message, so that it is not necessary to determine whether the estimated downlink NAS COUNT value is the NAS COUNT value in the first record each time the NAS message is received (i.e., step S704).
[0329] S706-1. The terminal device determines whether the downlink NAS message passes the integrity verification. If so, the terminal device determines that the downlink NAS message passes the integrity verification; if not, the terminal device determines that the downlink NAS message fails the integrity verification.
[0330] Based on the above steps S701 to S706, or steps S701 to S706-1, the terminal device can determine the NAS COUNT value that should be accepted but has not been received through the first record, and then when the estimated NAS COUNT value corresponding to the received downlink NAS message is less than or equal to the local NAS COUNT value, the terminal device can further determine whether the downlink NAS message is a NAS message that should be accepted but has not been received, thereby avoiding directly discarding the downlink NAS message, and then supporting out-of-order reception and replay protection of NAS messages, thereby improving the security of NAS message transmission.
[0331] S707. The terminal device determines whether the downlink NAS message passes the integrity verification. If so, the terminal device executes step S708; if not, the terminal device determines that the downlink NAS message fails the integrity verification.
[0332] It can be understood that when the estimated downlink NAS COUNT value is greater than the local NAS COUNT value, the terminal device can determine that the downlink NAS message is not a retransmitted NAS message, and then the terminal device can execute step S707 to perform integrity verification.
[0333] S708. The terminal device updates the local NAS COUNT value in the second record to the estimated downlink NAS COUNT value.
[0334] That is, when the estimated downlink NAS COUNT value is greater than the local NAS COUNT value, and the estimated downlink NAS COUNT value enables the NAS message to pass integrity verification, the terminal device will update the local NAS COUNT value.
[0335] It can be understood that since the estimated downlink NAS COUNT value is greater than the local NAS COUNT value before the update, the updated local NAS COUNT value is greater than the local NAS COUNT value before the update, so the local NAS COUNT value is updated incrementally.
[0336] That is to say, the local NAS COUNT value will not be updated to a smaller NAS COUNT value, thereby avoiding the situation where the partial replayed NAS message described in the aforementioned “NAS message processing mechanism” cannot be identified, thereby improving the security of NAS message transmission.
[0337] S709. When the difference between the updated local NAS COUNT value (i.e., the estimated downlink NAS COUNT value) and the local NAS COUNT value before the update is greater than 1, the terminal device stores the NAS COUNT value between the updated local NAS COUNT value and the local NAS COUNT value before the update in the first record.
[0338] It should be understood that in Example 1, if the difference between the updated local NAS COUNT value and the local NAS COUNT value before the update is 1, that is, there is no other NAS COUNT value between the updated local NAS COUNT value and the local NAS COUNT value before the update, and thus the first record does not need to be updated.
[0339] It should also be understood that if the difference between the updated local NAS COUNT value and the local NAS COUNT value before the update is 1, it can be considered that the downlink NAS message is a downlink NAS message that arrives in sequence relative to the local NAS COUNT value, that is, the estimated downlink NAS COUNT value corresponding to the downlink NAS message is equal to the next NAS COUNT value expected to be received by the local NAS COUNT value.
[0340] That is, when the terminal device determines that the received downlink NAS message is a downlink NAS message that arrives in order relative to the local NAS COUNT value, the terminal device does not update the first record. When the terminal device determines that the received downlink NAS message is a NAS message that arrives out of order, the terminal device updates the first record.
[0341] It should be understood that step S708 may be executed before step S709; or, step S708 may be executed after step S709; or, step S708 and step S709 may be executed simultaneously, and this embodiment of the present application does not specifically limit this.
[0342] In a possible implementation, after step S706, step S706-1, or step S709, Figure 7 The method for processing the NAS message shown further includes step S710.
[0343] S710. The terminal device maintains a first record.
[0344] In a possible implementation, the first record includes a plurality of windows. One window is used to store a NAS COUNT value that should be accepted but not received. In the case where the terminal device stores multiple NAS COUNT values that should be accepted but not received in the first record multiple times, the multiple NAS COUNT values that should be accepted but not received can be stored in multiple windows in chronological order, or the multiple NAS COUNT values that should be accepted but not received can be stored in multiple windows in the order of NAS COUNT values from small to large, and the embodiments of the present application do not specifically limit this.
[0345] It can be understood that when multiple NAS COUNT values are simultaneously stored in the window within the first record, they can be stored in the order of the size of the NAS COUNT values.
[0346] It should be understood that the number of windows in the first record may be fixed; or, the number of windows in the first record may be non-fixed, and the implementation of this application does not make any specific limitation on this.
[0347] It should also be understood that a "window" may refer to a logical entity that logically describes the storage relationship and storage capacity between the NAS COUNT values in the first record, that is, logically multiple windows are different, and physically multiple windows may be the same storage entity. Of course, a "window" may also refer to a storage entity (such as a storage unit) that physically stores the NAS COUNT value in the first record, and the embodiments of the present application do not specifically limit this.
[0348] Exemplarily, the first record includes N windows, where N is an integer greater than 0. Each window in the N windows may refer to a logical window; or each window in the N windows may refer to a physical storage entity.
[0349] In a possible implementation, when the number of NAS COUNT values in the first record exceeds a preset number, the terminal device deletes one or more NAS COUNT values in the first record. The one or more NAS COUNT values deleted by the terminal device in the first record may be: one or more NAS COUNT values that should be accepted but not received that are first stored in the first record, the NAS COUNT value that should be accepted but not received that first enters the window in the first record, or the smallest NAS COUNT value that should be accepted but not received in the first record, etc., which is not specifically limited in the embodiment of the present application.
[0350] In a possible implementation, the preset number may be 1, 2, 3, or more, which is not specifically limited in the embodiment of the present application.
[0351] That is, the number of NAS COUNT values stored in the first record is fixed. When the number of NAS COUNT values stored in the first record exceeds the upper limit, the terminal device can delete one or more NAS COUNT values in the first record so that a new NAS COUNT value can be stored in the first record.
[0352] In another possible implementation, the NAS COUNT value in the first record is set with a preset retention time. Wherein, when the preset retention time corresponding to the NAS COUNT value in the first record expires, the terminal device deletes the NAS COUNT value whose preset retention time has expired in the first record. The preset retention time can be set to 50s, 1min, 2min, or other time values, which is not specifically limited in the embodiment of the present application.
[0353] In another possible implementation, a preset storage time is set for the window in the first record. When the preset storage time corresponding to the window in the first record times out, the terminal device deletes the NAS COUNT value stored in the window whose preset storage time has timed out in the first record, or the terminal device deletes the window whose preset storage time has timed out and the NAS COUNT value stored therein in the first record, which is not specifically limited in the embodiments of the present application.
[0354] That is, when the preset storage time corresponding to the NAS COUNT value in the first record expires, the terminal device may delete the NAS COUNT value in the first record so that a new NAS COUINT value may be stored in the first record.
[0355] It can be understood that "storage" and "writing" have the same meaning. In other words, "storage" and "writing" can be used interchangeably, and are explained uniformly here and will not be repeated below.
[0356] The following is an illustrative description of the change process of the NAS COUNT values stored in the first record and the second record after the terminal device receives the downlink NAS message in combination with Table 5 and Table 6.
[0357] Exemplarily, the local NAS COUNT value of the terminal device is X, the previous NAS messages all arrive in order (that is, there is no NAS COUNT value in the first record at this time), and the first record includes 5 windows as an example to illustrate step S708. Among them, the 5 windows are represented in the order of storing the NAS COUNT values from the first to the last: window #1, window #2, window #3, window #4, and window #5.
[0358] The estimated downlink NAS COUNT value corresponding to the new NAS message N5 received by the terminal device is X+5, and then the terminal device executes steps S707 to S709. The changes in the NAS COUNT values in the first record and the second record in the terminal device are shown in Table 5.
[0359]
[0360] Table 5
[0361] Referring to Table 5, the local NAS COUNT value in the second record is updated from X to X+5, and the resulting NAS COUNT values that should be accepted but not received are: X+1 to X+4. Window #1 in the first record writes the NAS COUNT value X+1 that should be accepted but not received, window #2 writes the NAS COUNT value X+2 that should be accepted but not received, window #3 writes the NAS COUNT value X+3 that should be accepted but not received, window #4 writes the NAS COUNT value X+4 that should be accepted but not received, and no NAS COUNT value is written in window #5.
[0362] Exemplarily, after receiving NAS message N5, the terminal device receives NAS message N6, and the estimated NAS COUNT value corresponding to NAS message N6 is X+8. Then, the terminal device executes steps S707 to S710, and changes in NAS COUNT values in the first record and the second record in the terminal device are shown in Table 6.
[0363]
[0364] Table 6
[0365] Referring to Table 6, the local NAS COUNT value in the second record is updated from X+5 to X+8, and the new NAS COUNT values that should be accepted but not received after receiving NAS message N6 are X+6 and X+7, respectively, so that the NAS COUNT values that should be accepted but not received are the following 6 values: X+1 to X+4, X+6 to X+7. Since the number of NAS COUNT values that should be accepted but not received currently exceeds the number of windows, the terminal device executes step S710, deletes the NAS COUNT value X+1 that should be accepted but not received in window #1, and writes X+2, X+3, X+4, X+6, and X+7 in windows #1 to #5 in sequence.
[0366] It should be understood that, as described above with respect to "window", "window" is a logical concept, and further, after the terminal device deletes the NAS COUNT value X+1 that should be accepted but not received in window #1, it does not mean that the NAS COUNT value X+2 that should be accepted but not received must be written into window #1. For example, the terminal device may delete window #1 and add a new window #6. The newly added window #6 is used to write the NAS COUNT value X+7 that should be accepted but not received, and window # is used to write the NAS COUNT value X+6 that should be accepted but not received.
[0367] Exemplarily, the terminal device receives NAS message N7 after receiving NAS message N6. The estimated NAS COUNT value corresponding to NAS message N7 is X+6. Then the terminal device executes steps S704 to S706. Changes in NAS COUNT values in the first record and the second record in the terminal device are shown in Table 7.
[0368]
[0369] Table 7
[0370] Referring to Table 7, since the estimated NAS COUNT value X+6 corresponding to the NAS message N7 is less than the local NAS COUNT value X+8, the local NAS COUNT value is not updated, and the NAS COUNT value X+6 that should be accepted but not received in window #4 is deleted, and X+7 in window #5 is written into window #4.
[0371] Exemplarily, taking the first record and the second record in Table 7 as an example, when the storage time of the NAS COUNT value X+2 that should be accepted but not received in window #1 expires, the terminal device deletes the NAS COUNT value X+2 in window #1, and writes X+3, X+4, and X+7 in windows #1 to #3 in sequence.
[0372] In a possible implementation, the NAS COUNT value that the terminal device wants to delete in the first record is a lost NAS COUNT value. The NAS COUNT value that the terminal device wants to delete in the first record may be a NAS COUNT value in the first record that satisfies the following conditions:
[0373] The preset storage time corresponding to the NAS COUNT value that should be accepted but not received has timed out; and / or the NAS COUNT value to be deleted when the number of NAS COUNT values that should be accepted but not received in the first record exceeds a preset number.
[0374] The NAS COUNT values to be deleted when the number of NAS COUNT values that should be accepted but not received in the first record exceeds a preset number can refer to the relevant description of the above step S710, which will not be repeated here.
[0375] It should be understood that, as described in the aforementioned “NAS COUNT value maintenance process”, the NAS message sender sends NAS messages in the order of NAS COUNT values from small to large, and thus there is a corresponding relationship between the NAS COUNT value and the NAS message, so that the NAS message corresponding to the lost NAS COUNT value is the lost NAS message.
[0376] It can be understood that according to the above-mentioned relevant instructions on steps S701 to S710, the terminal device can determine the following information based on the first record: whether the received NAS message is a NAS message that arrives in order relative to the local NAS COUNT value, whether there is a NAS message that should be accepted but has not been received, whether it is a replayed NAS message, whether it is a lost NAS message, and whether it is a NAS message that has not passed the integrity verification. Then, the terminal device can send the relevant information of the above NAS messages to the AMF network element, so that the AMF network element can obtain the reception status of the NAS message and perform corresponding NAS message retransmission, sending of the next NAS message, or updating of the NAS security context and other operations.
[0377] In one possible implementation, Figure 7 The method for processing the NAS message shown further includes: step S711 and step S712.
[0378] S711. The terminal device sends processing result information to the AMF network element. Correspondingly, the AMF network element receives the processing result information from the terminal device.
[0379] The processing result information is information obtained by the terminal device processing the downlink NAS message according to the first record. The processing result information may include one or more of the following: response information indicating that the downlink NAS message has been received, information indicating a NAS COUNT value that should be accepted but not received, information indicating a lost NAS COUNT value in the first record, information indicating that the downlink NAS message is a replay NAS message, and information indicating that the downlink NAS message has not passed integrity verification.
[0380] The following describes the specific information contained in the processing result information in different situations.
[0381] Case 1: The downlink NAS message passes integrity verification, and the estimated downlink NAS COUNT value is equal to the NAS COUNT value that arrives in sequence relative to the local NAS COUNT value.
[0382] The NAS COUNT values that arrive in sequence relative to the local NAS COUNT value may refer to the relevant description of the downlink NAS messages that arrive in sequence relative to the local NAS COUNT value in the aforementioned step S709, which will not be repeated here.
[0383] In a possible implementation manner, in the case below, the processing result information may include: response information for indicating that the downlink NAS message has been received.
[0384] That is to say, if the downlink NAS message received by the terminal device is a downlink NAS message that arrives in order relative to the local NAS COUNT value, the processing result information sent by the terminal device to the AMF network element includes the response information corresponding to the normal reception of the NAS message.
[0385] Case 2: The downlink NAS message passes integrity verification, and the estimated downlink NAS COUNT value is greater than the NAS COUNT value that arrives in sequence relative to the local NAS COUNT value.
[0386] In a possible implementation manner, the processing result information includes response information used to indicate that the downlink NAS message has been received, and / or information used to indicate a NAS COUNT value that should be accepted but has not been received.
[0387] The information used to indicate the NAS COUNT value that should be accepted but not received may include information used to indicate one or more NAS COUNT values included in the first record that should be accepted but not received.
[0388] It can be understood that in Example 1, the estimated NAS COUNT value being greater than the NAS COUNT value arriving in sequence may mean that: the difference between the estimated downlink NAS COUNT value and the local NAS COUNT value before updating is greater than 1.
[0389] In a possible implementation, when the estimated NAS COUNT value corresponding to the received NAS message satisfies situation 2, the processing result information includes response information, and / or a NAS COUNT value that should be received but has not been received. The NAS COUNT value that should be received but has not been received may be a NAS COUNT value in the first record.
[0390] That is to say, the AMF network element can determine the NAS messages that arrive at the terminal device out of order by using the NASCOUNT value in the processing result information that should be received but has not been received.
[0391] In another possible implementation, when the estimated NAS COUNT value corresponding to the received NAS message satisfies condition 2 and the storage time of one or more NAS COUNT values in the first record exceeds an upper limit, the processing result information further includes NAS message loss information. The NAS message loss information includes one or more NAS COUNT values in the first record whose storage time exceeds an upper limit. The storage time is less than the retransmission waiting time of the NAS message.
[0392] It can be understood that, as described above with respect to the “preset retention time”, when the retention time of the NAS COUNT value in the first record exceeds the upper limit, the terminal device determines that the NAS message corresponding to the deleted NAS COUNT value is a lost NAS message.
[0393] That is to say, the AMF network element can determine that the NAS message is lost before the retransmission waiting time ends by processing the NAS message loss information in the result information, and thus there is no need to wait for the retransmission waiting time to end before retransmitting.
[0394] For example, Figure 8 Figure 1 is a diagram showing the relationship between the storage time and the NAS message retransmission waiting time. Figure 8 As shown, the downlink NAS message N8 is a lost NAS message. Among them, after the AMF network element sends the downlink NAS message N8, it will start the timer and continue to send the subsequent downlink NAS message N9 and downlink NAS message N10. If the AMF network element does not receive the response information of the downlink NAS message N8 within the retransmission waiting time, the AMF network element will initiate retransmission of the downlink NAS message N8 after the retransmission waiting time ends. In the embodiment of the present application, the terminal device can determine that the NAS COUNT value corresponding to the downlink NAS message N8 is the NAS COUNT value that should be received but has not been received by receiving the downlink NAS message N9, and start the timer. When the storage time of the NAS COUNT value corresponding to the downlink NAS message N8 reaches the upper limit, and the estimated NAS COUNT value corresponding to the downlink NAS message N10 meets condition 2, the terminal device sends the processing result information to the AMF network element, and the processing result information includes the information that the downlink NAS message N8 is lost. In this way, the AMF network element can initiate the retransmission processing of the downlink NAS message N8 before the retransmission waiting time ends.
[0395] Case 3: The downlink NAS message fails integrity verification.
[0396] It can be understood that, as described in the aforementioned steps S705 and S707, the terminal device can determine whether the received downlink NAS message passes the integrity verification. Wherein, the downlink NAS message fails to pass the integrity verification may be that the NAS message is tampered with, or the estimated NAS COUNT value estimated by the terminal device based on the downlink NAS message is wrong (for example, flipped).
[0397] In a possible implementation manner, the processing result information includes NAS message integrity verification failure information.
[0398] That is to say, the AMF network element can determine the downlink NAS message that failed the integrity verification based on the NAS message integrity verification failure information in the processing result information, and then the AMF network element can retransmit the NAS message that failed the integrity verification based on the NAS message integrity verification failure information and local policy, or trigger the NAS security context update process.
[0399] S712. The AMF network element performs the first operation according to the processing result information.
[0400] The first operation includes: sending a NAS message, retransmitting a NAS message, or updating a NAS security context.
[0401] It can be understood that for the processing result information corresponding to the above condition 1, the AMF network element can continue to send NAS messages according to the current NAS process.
[0402] For the processing result information corresponding to the above situation 2, if the processing result information includes response information and / or the NAS COUNT value that should be received but has not been received, the AMF network element can perform the NAS message retransmission operation according to the current NAS message. If the processing result information includes NAS message loss information, the AMF network element can perform the NAS message retransmission operation according to the local policy.
[0403] For the processing result information corresponding to the above condition 3, the AMF network element can perform a NAS message retransmission operation or a NAS security context update operation according to the local policy.
[0404] Example 2:
[0405] The difference between Example 2 and Example 1 is that the local NAS COUNT value in the second record is a NAS COUNT value that arrives in sequence relative to the local NAS COUNT value in Example 1. The NAS COUNT value that arrives in sequence relative to the local NAS COUNT value in Example 1 is a NAS COUNT value corresponding to the local NAS COUNT value in Example 1 plus 1. For details, please refer to the relevant description of step S709 in Example 1, which will not be repeated here.
[0406] Exemplarily, taking the example shown in Table 3 in the aforementioned “Example 1” as an example, the update status of the local NAS COUNT value in the first NAS COUNT record corresponding to the second record in Example 2 is shown in Table 8.
[0407]
[0408] Table 8
[0409] It should be understood that in Example 2, the NAS COUNT value stored in the first record can also be expressed as a NAS COUNT value corresponding to the NAS COUNT value between the updated local NAS COUNT value and the local NAS COUNT value before the update minus 1. Exemplarily, taking the example shown in Table 4 in the aforementioned "Example 1" as an example, the first NAS COUNT record and the first record in Example 2 are shown in Table 9.
[0410]
[0411] Table 9
[0412] Specifically, taking the first device as a terminal device, the second device as an AMF network element, and the NAS message as a downlink NAS message as an example, Fig. 9 The method for processing a NAS message provided in an embodiment of the present application is exemplarily described.
[0413] See also Fig. 9 The process of the NAS message processing method provided in the embodiment of the present application is as follows:
[0414] S901~S902, steps S901~S902 are the same Figure 7 In the embodiment shown, steps S701 to S702 are described in detail. Figure 7 The embodiments shown will not be described in detail here.
[0415] S903. The terminal device determines whether the estimated downlink NAS COUNT value is less than the local NAS COUNT value. If so, the terminal device executes step S904; if not, the terminal device executes step S907.
[0416] S904~S907, steps S904~S907 are the same Figure 7 For the steps S704 to S707 in the embodiment shown in FIG. Figure 7 The embodiments shown will not be described in detail here.
[0417] S908. The terminal device updates the local NAS COUNT value in the second record to the sum of the estimated downlink NAS COUNT value and 1.
[0418] S909: When the difference between the updated local NAS COUNT value and the local NAS COUNT value before the update is greater than 1, store in the first record a NAS COUNT value corresponding to the NAS COUNT value between the updated local NAS COUNT value and the local NAS COUNT value before the update minus 1.
[0419] It can be understood that in Example 2, if the difference between the updated local NAS COUNT value and the local NAS COUNT value before the update is 1, it can be considered that the downlink NAS message that currently passes the integrity verification is a downlink NAS message that arrives in order, and thus there is no need to update the first record.
[0420] In a possible implementation, the first record includes a plurality of windows, wherein one window is used to store a NAS COUNT value that should be received but has not been received. The NAS COUNT value that should be received but has not been received can be stored in the window in chronological order.
[0421] It should be understood that the number of windows in the first record can refer to the relevant description of step 709 in the above example 1, which will not be repeated here.
[0422] After step S906 or step S909, Fig. 9 The method for processing the NAS message shown also includes:
[0423] Step S910, step S910 is the same as Figure 7 For the step S710 in the embodiment shown, the relevant description can be found in Figure 7 The embodiments shown will not be described in detail here.
[0424] In one possible implementation, Fig. 9 The method for processing the NAS message shown also includes:
[0425] Steps S911 to S912, steps S911 to S912 are the same as Figure 7 For the steps S711 to S712 in the embodiment shown in FIG. Figure 7 The embodiments shown will not be described in detail here.
[0426] Example 3:
[0427] The difference between Example 3 and Example 1 is that the receiver of the NAS message records the NAS COUNT value that arrives out of order in the aforementioned Example 1, and the local NAS COUNT value in Example 3 is the maximum value of the NAS COUNT values that arrive in order and pass the integrity verification.
[0428] It should be understood that, in order to facilitate description of the difference between Example 3 and Example 1, the out-of-order NAS COUNT value in Example 3 may be stored in the fourth record, and the local NAS COUNT value in Example 3 may be stored in the fourth record.
[0429] It can be understood that for the NAS COUNT value that arrives out of order, reference can be made to the relevant description in the aforementioned example 1, which will not be repeated here.
[0430] The following describes the local NAS COUNT value and the out-of-order NAS COUNT value in Example 3.
[0431] Exemplarily, the example shown in Table 3 of the above example is used for explanation. The initial local NAS COUNT value in the terminal device is X. After the downlink NAS message N1 passes the integrity verification, the sequence of NAS COUNT values that pass the integrity verification in the terminal device is [X, X+1], and the maximum value of the sequence is X+1, and the local NAS COUNT value is updated to X+1; after the downlink NAS message N3 passes the integrity verification, the sequence of NAS COUNT values that pass the integrity verification in the terminal device is [X, X+1], and X+3 is a NAS COUNT value that arrives out of order, and the maximum value of the sequence is X+1, and the local NAS COUNT value is not updated; after the downlink NAS message N2 passes the integrity verification, the sequence of NAS COUNT values that pass the integrity verification in the terminal device is [X, X+1, X+2, X+3], and the maximum value of the sequence is X+3, and the local NAS COUNT value is updated to X+3. For details, please refer to the update record of the local NAS COUNT value in Table 10.
[0432] When to receive NAS messages Fourth Record Before receiving downlink NAS message N1 The local NAS COUNT value is X After receiving downlink NAS message N1 The local NAS COUNT value is X+1 After receiving downlink NAS message N3 The local NAS COUNT value is X+1 After receiving downlink NAS message N2 The local NAS COUNT value is X+3
[0433] Table 10
[0434] Exemplarily, the example shown in Table 4 in the above example 1 is used for explanation. The initial local NAS COUNT value of the NAS message receiver is X, and the previous NAS messages all arrive in order, so there is no NAS COUNT value in the third record. The NAS COUNT value used by the new NAS message N4 through integrity verification is X+8. The NAS message N4 is a NAS message that arrives out of order. The multiple NAS COUNT values that pass the integrity verification in the terminal device include [0,…,X,X+8]. The sequence of NAS COUNT values that arrive in order is [0,…,X]. The NAS COUNT value that arrives out of order is X+8, so the local NAS COUNT value is not updated, and the fourth record stores X+8. For details, please refer to the fourth record and the fourth record in Table 11.
[0435] When to receive NAS messages Fourth Record The third record NAS message N4 and before The local NAS COUNT value is X none After receiving NAS message N4 The local NAS COUNT value is X X+8
[0436] Table 11
[0437] Specifically, taking the first device as a terminal device, the second device as an AMF network element, and the NAS message as a downlink NAS message as an example, Fig.10 The NAS message processing method provided in the embodiment of the present application is exemplarily described.
[0438] See also Fig.10 The process of the NAS message processing method provided in the embodiment of the present application is as follows:
[0439] S1001~S1002, steps S1001~S1002 are the same Figure 7 For the steps S701 to S702 in the embodiment shown in FIG. Figure 7 The embodiments shown will not be described in detail here.
[0440] S1003. The terminal device determines whether the estimated downlink NAS COUNT value is less than or equal to the local NAS COUNT value. If not, the terminal device executes step S1004; if so, the terminal device determines that the downlink NAS message is a replay NAS message.
[0441] It can be understood that since the local NAS COUNT value in Example 3 is the maximum value among the NAS COUNT values that arrive in sequence, the local NAS COUNT value and the NAS COUNT value that is less than the local NAS COUNT value are all NAS COUNT values that the terminal device has already accepted. In other words, the downlink NAS messages whose estimated downlink NAS COUNT value is less than or equal to the local NAS COUNT value are all replayed NAS messages.
[0442] S1004. The terminal device determines whether the estimated downlink NAS COUNT value is equal to the sum of the local NAS COUNT value and 1. If so, the terminal device executes step S1005; if not, the terminal device executes step S1009.
[0443] It can be understood that if the estimated downlink NAS COUNT value is equal to the NAS COUNT value corresponding to the sum of the local NAS COUNT value and 1, it can be considered that the downlink NAS message is a NAS message that arrives in sequence relative to the local NAS COUNT value.
[0444] S1005. The terminal device determines whether the downlink NAS message passes the integrity verification. If so, the terminal device executes step S1006; if not, the terminal device determines that the downlink NAS message fails the integrity verification.
[0445] Among them, the terminal device performs integrity verification on the downlink NAS message according to the estimated downlink NAS COUNT value. The specific implementation of the integrity verification can be found in the relevant description in the aforementioned "Integrity Protection Process", which will not be repeated here.
[0446] It can be understood that if the downlink NAS message fails the integrity verification, it can be considered that the NAS message is at risk of being tampered with, or the estimated NAS COUNT value is wrong.
[0447] S1006. The terminal device updates the local NAS COUNT value by adding 1 to the estimated downlink NAS COUNT value.
[0448] It can be understood that since the estimated downlink NAS COUNT value in step S1005 arrives in order relative to the local NAS COUNT value, the maximum value of the NAS COUNT value sequence arranged continuously in order of size in the terminal device also increases by 1, so the local NAS COUNT value needs to be updated.
[0449] S1007. The terminal device determines whether the value corresponding to the updated local NAS COUNT value plus 1 is located in the third record. If so, the terminal device executes step S1008. If not, the terminal device determines that the current local NAS COUNT value is the local NAS COUNT value updated in step S1006, and proceeds to step S1012.
[0450] That is, if the terminal device determines that the value corresponding to the updated local NAS COUNT value plus 1 is not in the third record, the terminal device may consider that the updated local NAS COUNT value is the maximum value in the NAS COUNT value sequence arranged consecutively in order of size.
[0451] It should be understood that if the terminal device determines that the value corresponding to the updated local NAS COUNT value plus 1 is in the third record, then the NAS COUNT value corresponding to the updated local NAS COUNT value plus 1 is no longer out of order, but a NAS COUNT value that arrives in order, and then the NAS COUNT value needs to be deleted in the third record. The following is an example of receiving a downlink NAS message N2 in Table 10 for explanation.
[0452] Specifically, when receiving the downlink NAS message N3, the sequence of NAS COUNT values in the terminal device that enables the NAS message to pass the integrity verification is [X, X+1], the local NAS COUNT value is X+1, and X+3 is the NAS COUNT value that arrives out of order (located in the third record). When receiving the downlink NAS message N2, the estimated downlink NAS COUNT value corresponding to the downlink NAS message N2 is X+2, and then at step S1006, the updated local NAS COUNT value is X+2. However, the NAS COUNT value corresponding to the updated local NAS COUNT value plus 1 is X+3, and X+3 is located in the third record. In fact, the sequence of NAS COUNT values in the terminal device that enables the NAS message to pass the integrity verification is [X, X+1, X+2, X+3], that is, X+3 is no longer a NAS COUNT value that arrives out of order, but the maximum value in the sequence of NAS COUNT values that arrive in order.
[0453] S1008. The terminal device deletes the value corresponding to the updated local NAS COUNT value plus 1 in the third record, and proceeds to step S1006.
[0454] It can be understood that the above X+3 in the third record, ie, the value corresponding to the updated local NASCOUNT value plus 1, can be deleted through step S1008.
[0455] It can also be understood that after deleting the value corresponding to the updated local NAS COUNT value plus 1 in the third record and entering step S1006 again, it can be further determined whether there are any NAS COUNT values in the third record that arrive in sequence relative to the estimated downlink NAS COUNT value, and then the potential NAS COUNT values that arrive in sequence in the third record can be deleted.
[0456] Exemplarily, taking the local NAS COUNT value as 4, the out-of-order NAS COUNT values stored in the third record include: [6, 7, 9], and the estimated downlink NAS COUNT value corresponding to the received downlink NAS message N11 is 5, and the downlink NAS message passes the integrity verification, the terminal device executes step S1006, and the updated local NAS COUNT value is 5; the terminal device executes step S1007, and the NAS COUNT value corresponding to the updated local NAS COUNT value 5 plus 1 is 6, and the NAS COUNT value 6 is located in the third record, and then the terminal device executes step S1008, deletes the NAS COUNT value 6 in the third record, and then enters step S1006; the terminal device executes step S1006 again, and updates the updated local NAS COUNT value 5 again, and the updated local NAS COUNT value is 6 at this time; the terminal device executes step S1007 again, and the NAS COUNT value corresponding to the updated local NAS COUNT value 6 plus 1 is 7, and the NAS COUNT value 6 is located in the third record. The COUNT value 7 is in the third record, and then the terminal device executes step S1008 again, deletes the NAS COUNT value 7 in the third record, and then enters step S1006 again; the terminal device executes step S1006, and updates the updated local NAS COUNT value 6 again. At this time, the updated local NAS COUNT value is 7; the terminal device executes step S1007 again, and the NAS COUNT value corresponding to the updated local NAS COUNT value 7 plus 1 is 8. The NAS COUNT value 8 is not in the third record, and then the terminal device determines that the current local NAS COUNT value is 7.
[0457] S1009. The terminal device determines whether the estimated downlink NAS COUNT value is within the third record. If so, the terminal device determines that the downlink NAS message is a replay NAS message; if not, the terminal device executes step S1010.
[0458] That is to say, the terminal device sets the local NAS COUNT value and adds a third record to store the NAS COUNT value that arrives out of order. Then, when the estimated NAS COUNT value corresponding to the received downlink NAS message is less than or equal to the local NAS COUNT value, the terminal device can further determine whether the downlink NAS message is a replay NAS message based on the local NAS COUNT value and the third record, thereby avoiding directly discarding the downlink NAS message, and thus supporting out-of-order arrival and replay protection of NAS messages.
[0459] S1010. The terminal device determines whether the downlink NAS message passes the integrity verification. If so, the terminal device executes step S1011; if not, the terminal device determines that the downlink NAS message fails the integrity verification.
[0460] S1011. The terminal device stores the estimated downlink NAS COUNT value in the third record.
[0461] In a possible implementation, the third record includes multiple windows, wherein one window is used to store a NAS COUNT value that arrives out of order. There may be multiple NAS COUNT values that arrive out of order, and multiple NAS COUNT values that arrive out of order may be stored in multiple windows in the order of the size of the NAS COUNT values.
[0462] It can be understood that the NAS COUNT values that arrive out of order can be stored in multiple windows in descending order; or, the NAS COUNT values that arrive out of order can be stored in multiple windows in ascending order, and the embodiments of the present application do not specifically limit this.
[0463] It should be understood that the number of windows in the third record may be fixed; or, the number of windows in the third record may be non-fixed, and the implementation of this application does not make any specific limitation on this.
[0464] In a possible implementation, the third record includes M windows, where M is an integer greater than 1. The NAS COUNT values that arrive out of order are stored in the M windows in the order of the NAS COUNT values. The NAS COUNT values in the third record may be stored at intervals or not at intervals, which is not specifically limited in this embodiment.
[0465] It should also be understood that the implementation principle of the window in the third record is similar to that of the window in the first record. For details, please refer to the description of the window in the above example 1, which will not be repeated here.
[0466] Exemplarily, taking M=6, the local NAS COUNT value is 2, and the NAS COUNT values that arrive out of order are 4, 5, 6, and 8, the above-mentioned "interval storage" is explained in conjunction with Table 12. As shown in Table 12, the third record includes 6 windows: window #1 to window #6. Among them, the above-mentioned NAS COUNT values 4, 5, 6, and 8 that arrive out of order are stored in intervals in window #5 to window #3 and window #1 in the order of the size of the NAS COUNT values. The windows left empty at the intervals are used to represent NAS COUNT values that should be accepted but have not been received. For example, window #2 represents a NAS COUNT value of 7, and window #6 is used to represent a NAS COUNT value of 3.
[0467] Further, the NAS COUNT value 3 that should be accepted but not received represented by window #6 is the NAS COUNT value that is expected to arrive in order relative to the local NAS COUNT value 2. That is, through the third record in Table 12, it can be determined that the local NAS COUNT value is the previous NAS COUNT value of the NAS COUNT value represented by window #6 that has not been received.
[0468]
[0469] Table 12
[0470] S1012. The terminal device maintains the third record.
[0471] In a possible implementation, when all the M windows in the third record have been occupied and the terminal device stores the NAS COUNT value in the third record, the terminal device maintains the third record, including the following steps:
[0472] S1012-1~S1012-3, steps S1012-1~S1012-3 are the same as the above steps S1006~S1008, and related descriptions can refer to the related instructions of the above steps S1006~S1008, which will not be repeated here.
[0473] It can be understood that when all the M windows in the third record have been occupied and the terminal device stores the next NAS COUNT value in the third record, the terminal device determines that the next NAS COUNT value of the local NAS COUNT value has been accepted, and then executes the above steps S1012-1 to S1012-3 to update the local NAS COUNT value and the third record.
[0474] In a possible implementation, when the NAS message receiver determines that the next NAS COUNT value of the local NAS COUNT value has been accepted, the NAS message receiver determines that the NAS message corresponding to the accepted NAS COUNT value is a lost NAS message.
[0475] It should be understood that the lost NAS message can be regarded as invalid, and its corresponding NAS COUNT is also invalid. If the terminal device receives the NAS message again, it regards the NAS message as an invalid message.
[0476] Exemplarily, taking the example corresponding to Table 10 above as an example, it is assumed that the terminal device determines that the downlink NAS message N2 is a lost NAS message during the process of receiving the downlink NAS message N3, and then the device determines that the NAS COUNT value X+2 corresponding to the downlink NAS message N2 has been received. After the terminal device successfully verifies the integrity of the downlink NAS message N3, the NAS COUNT value sequence in the terminal device that enables the NAS message to pass the integrity verification is [X, X+1, X+2, X+3], and the maximum value of the sequence is X+3, and then the local NAS COUNT value is updated from X+1 to X+3.
[0477]
[0478] Table 13
[0479] Exemplarily, the example shown in Table 12 above is used to receive NAS message N12 (the corresponding NAS COUNT value is 9), and the process of the terminal device maintaining the third record is exemplarily described in combination with Table 13. When the terminal device receives NAS message N12, the terminal device executes the above steps S1001 to S1004, S1009 to S1011, and then determines that the terminal device stores the estimated NAS COUNT value 9 corresponding to the NAS message N12 in the third record. At this time, the local NAS COUNT value in the terminal device and the third record are shown in Table 12. The specific process of maintaining the third record is as follows:
[0480] The terminal device executes step S1012-1, and the local NAS COUNT value is updated to 3; the terminal device executes steps S1012-2 and S1012-3, and deletes the NAS COUNT value 4 in the third record; the terminal device executes step S1012-1 again, and the local NAS COUNT value is updated to 4. Repeating the above steps, the local NAS COUNT value can be updated to 6, and the NAS COUNT values 5 and 6 can be deleted in the third record, so that the local NAS COUNT value in the terminal device is updated from 2 to 6, and the NAS COUNT value stored in the third record is updated from [4,5,6,8] to [8,9].
[0481] In another possible implementation, a storage time is set for the window in the third record, wherein after the storage time of the window reaches an upper limit, the terminal device marks the NAS COUNT value stored in the window as received.
[0482] That is, after the NAS COUNT value in the third record reaches the upper limit of the storage time, the terminal device can determine that the NAS message corresponding to the NAS COUNT value is a lost NAS message.
[0483] It can be understood that after the terminal device marks the NAS COUNT value stored in the window as received, the above steps S1012-1 to S1012-3 can be executed to update the local NAS COUNT value and the third record.
[0484] If the number of NAS COUNT values that should be received but have not been received currently exceeds M, the terminal device performs the third record update process.
[0485] It should be understood that according to the relevant instructions of the aforementioned steps S1001 to S1012, the terminal device can determine whether the received NAS message is an in-order NAS message, whether it is an out-of-order NAS message, whether it is a replayed NAS message, whether it is a lost NAS message, and whether it is a NAS message that fails integrity verification based on the local NAS COUNT value and the third record. Then, the terminal device can send the relevant information of the above NAS messages to the AMF network element, so that the AMF network element can obtain the reception status of the NAS message and perform corresponding retransmission, sending of NAS messages, or updating of NAS security context and other operations.
[0486] In one possible implementation, Fig.10 The method for processing the NAS message shown further includes:
[0487] S1013~S1014, steps S1013~S1014 are the same Figure 7 For the steps S711 to S712 in the embodiment shown in FIG. Figure 7 The embodiments shown will not be described in detail here.
[0488] Example 4:
[0489] The difference between Example 4 and Example 3 is that the local NAS COUNT value stored in the fourth record is the NAS COUNT value corresponding to the local NAS COUNT value in Example 3 plus 1.
[0490] Exemplarily, taking the example shown in Table 10 in the aforementioned “Example 3” as an example, the update status of the local NAS COUNT value in the corresponding fourth record in Example 4 is shown in Table 14.
[0491] When to receive NAS messages Fourth Record Before receiving downlink NAS message N1 The fourth NAS COUNT value is X+1 After receiving downlink NAS message N1 The fourth NAS COUNT value is X+2 After receiving downlink NAS message N3 The fourth NAS COUNT value is X+2 After receiving downlink NAS message N2 The fourth NAS COUNT value is X+4
[0492] Table 14
[0493] It should be understood that in Example 4, the out-of-order NAS COUNT value stored in the third record is the same as that in Example 3. For details, please refer to the relevant description in Example 3, which will not be repeated here.
[0494] Specifically, taking the first device as a terminal device, the second device as an AMF network element, and the NAS message as a downlink NAS message as an example, Fig.11 The NAS message processing method provided in the embodiment of the present application is exemplarily described.
[0495] See also Fig.11 The process of the NAS message processing method provided in the embodiment of the present application is as follows:
[0496] S1101~S1102, steps S1101~S1102 are the same Figure 7 In the embodiment shown, steps S701 to S702 are described in detail. Figure 7 The embodiments shown will not be described in detail here.
[0497] S1103. The terminal device determines whether the estimated downlink NAS COUNT value is less than the local NAS COUNT value. If not, the terminal device executes step S1104; if so, the terminal device determines that the downlink NAS message is a replay NAS message.
[0498] S1104. The terminal device determines whether the estimated downlink NAS COUNT value is equal to the local NAS COUNT value. If so, the terminal device executes step S1105; if not, the terminal device executes step S1109.
[0499] S1105. The terminal device determines whether the downlink NAS message passes the integrity verification. If so, the terminal device executes step S1106; if not, the terminal device determines that the downlink NAS message fails the integrity verification.
[0500] Among them, the terminal device performs integrity verification on the downlink NAS message according to the estimated downlink NAS COUNT value. The specific implementation of the integrity verification can be found in the relevant description in the aforementioned "Integrity Protection Process", which will not be repeated here.
[0501] It can be understood that if the downlink NAS message fails the integrity verification, it can be considered that the NAS message is at risk of being tampered with, or the estimated NAS COUNT value is wrong.
[0502] S1106. The terminal device updates the local NAS COUNT value by adding 1 to the estimated downlink NAS COUNT value.
[0503] It can be understood that, since the estimated downlink NAS COUNT value in step S1105 is equal to the local NAS COUNT value, the local NAS COUNT value needs to be updated so as to be used for receiving a NAS message next time.
[0504] S1107. The terminal device determines whether the updated local NAS COUNT value is located in the third record. If so, the terminal device executes step S1108. If not, the terminal device determines that the current local NAS COUNT value is the local NAS COUNT value updated in step S1006, and proceeds to step S1112.
[0505] It should be understood that the relevant description of step S1107 can be found in step S1007 in Example 3, and will not be repeated here.
[0506] S1108. The terminal device deletes the updated local NAS COUNT value in the third record and proceeds to step S1106.
[0507] It should be understood that the relevant description of step S1108 can be found in step S1008 in Example 3, and will not be repeated here.
[0508] S1109~S1112, steps S1109~S1112 are the same Fig.10 In the embodiment shown, steps S1009 to S1012 are described in detail in Fig.10 The embodiments shown will not be described in detail here.
[0509] In one possible implementation, Fig.11 The NA message processing method shown further includes:
[0510] S1113~S1114, steps S1113~S1114 are the same Figure 7 For the steps S711 to S712 in the embodiment shown in FIG. Figure 7 The embodiments shown will not be described in detail here.
[0511] Combination of the above Figure 7 to Figure 11 The following describes in detail the process of the NAS message processing method provided in the embodiment of the present application under various examples. Fig.12 This section describes the overall process of NAS message processing.
[0512] Fig.12 A flowchart of a method for processing NAS messages provided in an embodiment of the present application Figure 5 The method mainly involves the interaction between the first device and the second device. The first device may be the above-mentioned terminal device, and the second device may be the above-mentioned AMF network element; or the first device may be the above-mentioned AMF network element, and the second device may be the above-mentioned terminal device.
[0513] like Fig.12 As shown, the process of this method is as follows:
[0514] S1201: A second device sends a first NAS message to a first device. Correspondingly, the first device receives the first NAS message from the second device.
[0515] S1202. The first device determines a first NAS COUNT value corresponding to the first NAS message.
[0516] The specific implementation of step S1202 may refer to the related description of the aforementioned “NAS message processing mechanism” and will not be repeated here.
[0517] It should be understood that in the embodiment of the present application, the first NAS COUNT value and the local NAS COUNT value stored in the first device may be the same as or different from each other, and the embodiment of the present application does not specifically limit this.
[0518] S1203: When the integrity verification of the first NAS message passes, the first device generates first information according to the first NAS COUNT value and the local NAS COUNT value, wherein the first information includes the first NAS COUNT value and / or the local NAS COUNT value.
[0519] The implementation of step S1203 is described in detail in the following content.
[0520] S1204: The second device sends a second NAS message to the first device. Correspondingly, the first device receives the second NAS message from the second device.
[0521] S1205. The first device determines a second NAS COUNT value corresponding to the second NAS message.
[0522] The specific implementation of step S1205 can refer to the related description of the aforementioned “NAS message processing mechanism”, which will not be repeated here.
[0523] S1206. The first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value.
[0524] The following are three examples, namely, Example A, Example B and Example C, which respectively illustrate the specific implementation of steps S1203 and S1206.
[0525] For example A:
[0526] In a possible implementation, the first information may include the first record and / or the second record in the above example one.
[0527] In a possible implementation, the first device generates first information according to the first NAS COUNT value and a local NAS COUNT value stored in the first device, where the first information includes the first NAS COUNT value and / or the local NAS COUNT value (step S1203), including:
[0528] When the first NAS COUNT value is greater than the local NAS COUNT value, the first device updates the local NAS COUNT value, and the first information includes the updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value;
[0529] Alternatively, when the first NAS COUNT value is less than or equal to the local NAS COUNT value, the first device determines not to update the local NAS COUNT value, and the first information includes the local NAS COUNT value.
[0530] That is to say, the first device will update the local NAS COUNT value to the first NAS COUNT value only when the integrity verification of the first NAS message passes and the first NAS COUNT value is greater than the local NAS COUNT value, thereby preventing the local NAS COUNT value from being updated to a smaller NAS COUNT value, thereby avoiding replay attacks.
[0531] In a possible implementation, when the first NAS COUNT value is greater than the local NAS COUNT value and the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, the first information further includes one or more NAS COUNT values between the first NAS COUNT value and the local NAS COUNT value.
[0532] It can be understood that, since the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, the first NAS COUNT value may refer to a NAS COUNT message that does not arrive in order, or a NAS COUNT value that arrives out of order, and further, one or more NAS COUNT values between the first NAS COUNT value and the local NAS COUNT value may refer to NAS COUNT values that should be accepted but are not received.
[0533] That is to say, the first information may also include a NAS COUNT value that should be accepted but has not been received, so that when the first device verifies the integrity of the second NAS message based on the first information and the second NAS COUNT value, it can be determined whether the second NAS message belongs to a NAS message that should be received but has not been received, thereby avoiding determining the second NAS message as a replayed NAS message and discarding the NAS message.
[0534] In a possible implementation manner, the first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value (step S1206), including:
[0535] In a case where the second NAS COUNT value is greater than the updated local NAS COUNT value, or in a case where the second NAS COUNT value is less than the updated local NAS COUNT value and the second NAS COUNT value belongs to one or more NAS COUNT values, the first device determines to verify the integrity of the second NAS message according to the second NAS COUNT value;
[0536] Alternatively, when the second NAS COUNT value is less than or equal to the updated local NAS COUNT value and the second NAS COUNT value does not belong to one or more NAS COUNT values, the first device determines not to verify the integrity of the second NAS message.
[0537] It should be understood that when the second NAS COUNT value is greater than the updated local NAS COUNT value, or when the second NAS COUNT value is less than the updated local NAS COUNT value and the second NAS COUNT value belongs to one or more NAS COUNT values, the first device can determine that the second NAS message is not a replay NAS message.
[0538] It should also be understood that when the second NAS COUNT value is less than or equal to the updated local NAS COUNT value and the second NAS COUNT value does not belong to one or more NAS COUNT values, the first device may determine that the second NAS message is a replay NAS message.
[0539] That is to say, when verifying the integrity of the second NAS message, the first device can determine whether the second NAS message is a replayed NAS message based on the second NAS COUNT value and the first information, and does not verify the integrity of the second NAS message if it is determined that the second NAS message is a replayed NAS message, thereby avoiding replay attacks and improving the security of NAS message transmission.
[0540] It can be understood that the first device can determine whether the second NAS message is a replay NAS message based on the first information and the second NAS COUNT value after verifying the integrity of the second NAS message based on the second NAS COUNT value; or, the first device can simultaneously verify the integrity of the second NAS message and determine whether the second NAS message is a replay NAS message, which is not specifically limited in this embodiment of the present application.
[0541] It can be understood that the specific implementation of steps S1203 and S1206 in the above example A can refer to the relevant instructions in example 1, and will not be repeated here.
[0542] For example B:
[0543] In a possible implementation, the first information may include the third record and / or the fourth record in the above example three.
[0544] In a possible implementation, when the first NAS COUNT value is greater than the local NAS COUNT value, the first device updates the local NAS COUNT value, and the first information includes the updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value, including:
[0545] When the difference between the first NAS COUNT value and the local NAS COUNT value is 1, the updated local NAS COUNT value is the first NAS COUNT value.
[0546] That is to say, the updated local NAS COUNT value included in the first information is the NAS COUNT value that arrives in order relative to the local NAS COUNT value (that is, the NAS COUNT value corresponding to the local NAS COUNT value plus 1), and then when the first device verifies the integrity of the second NAS message according to the second NAS COUNT value and the first information, it can be determined that the local NAS COUNT value that is less than or equal to the updated one is a replayed NAS message.
[0547] In a possible implementation manner, the first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value (step S1206), including:
[0548] In a case where the second NAS COUNT value is greater than the updated local NAS COUNT value, the first device determines to verify the integrity of the second NAS message according to the second NAS COUNT value;
[0549] Alternatively, when the second NAS COUNT value is less than or equal to the updated local NAS COUNT value, the first device determines not to verify the integrity of the second NAS message.
[0550] It should be understood that, in the case where the second NAS COUNT value is greater than the updated local NAS COUNT value, the first device may determine that the second NAS message is not a replay NAS message.
[0551] It should also be understood that, in the event that the second NAS COUNT value is less than or equal to the updated local NAS COUNT value, the first device may determine that the second NAS message is a replay NAS message.
[0552] That is to say, when verifying the integrity of the second NAS message, the first device can determine whether the second NAS message is a replayed NAS message based on the size relationship between the second NAS COUNT value and the updated local NAS COUNT value in the first information, thereby avoiding replay attacks and improving the security of NAS message transmission.
[0553] It can be understood that the first device can determine whether the second NAS message is a replay NAS message based on the first information and the second NAS COUNT value after verifying the integrity of the second NAS message based on the second NAS COUNT value; or, the first device can simultaneously verify the integrity of the second NAS message and determine whether the second NAS message is a replay NAS message, which is not specifically limited in this embodiment of the present application.
[0554] It can be understood that the specific implementation of steps S1203 and S1206 in the above example B can refer to the relevant instructions in example three, and will not be repeated here.
[0555] For example C:
[0556] In a possible implementation, the first information may include the third record and / or the fourth record in the above example three.
[0557] In a possible implementation, the first device generates first information according to the first NAS COUNT value and a local NAS COUNT value stored in the first device, where the first information includes the first NAS COUNT value and / or the local NAS COUNT value (step S1203), including:
[0558] When the first NAS COUNT value is greater than the local NAS COUNT value and the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, the first device determines not to update the local NAS COUNT value, and the first information includes the local NAS COUNT value and the first NAS COUNT value.
[0559] That is, when the first NAS COUNT value is greater than the local NAS COUNT value, and the first NAS COUNT value is not a NAS COUNT value that arrives in order (i.e., the first NAS COUNT value is not a NAS COUNT value corresponding to the local NAS COUNT value plus 1), the first device may not update the local NAS COUNT value, but record the local NAS COUNT value and the first NAS COUNT value that arrives out of order, so that the first device can determine one or more NAS COUNT values (i.e., NAS COUNT values that should be accepted but not received) between the first NAS COUNT value and the local NAS COUNT value according to the first information, so that when the first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value, it can determine whether the second NAS message is a NAS message that should be received but not received, thereby avoiding determining the second NAS message as a replayed NAS message and discarding the NAS message.
[0560] In a possible implementation manner, the first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value (step S1206), including:
[0561] When the second NAS COUNT value is greater than the local NAS COUNT value and the second NAS COUNT value is not equal to the first NAS COUNT value, the first device determines to verify the integrity of the second NAS message according to the second NAS COUNT value;
[0562] Alternatively, when the second NAS COUNT value is less than or equal to the local NAS COUNT value, or the second NAS COUNT value is equal to the first NAS COUNT value, the first device determines not to verify the integrity of the second NAS message.
[0563] It should be understood that when the second NAS COUNT value is greater than the local NAS COUNT value and the second NAS COUNT value is not equal to the first NAS COUNT value, the first device may determine that the second NAS message is not a replay NAS message.
[0564] It should also be understood that if the second NAS COUNT value is less than or equal to the local NAS COUNT value, or the second NAS COUNT value is equal to the first NAS COUNT value, the first device may determine that the second NAS message is a replay NAS message.
[0565] That is to say, when verifying the integrity of the second NAS message, the first device can determine whether the second NAS message is a replayed NAS message based on the second NAS COUNT value and the first information, and does not verify the integrity of the second NAS message if it is determined that the second NAS message is a replayed NAS message, thereby avoiding replay attacks and improving the security of NAS message transmission.
[0566] It can be understood that the first device can determine whether the second NAS message is a replay NAS message based on the first information and the second NAS COUNT value after verifying the integrity of the second NAS message based on the second NAS COUNT value; or, the first device can simultaneously verify the integrity of the second NAS message and determine whether the second NAS message is a replay NAS message, which is not specifically limited in this embodiment of the present application.
[0567] It can be understood that the specific implementation of steps S1203 and S1206 in the above example C can refer to the relevant instructions in example three, and will not be repeated here.
[0568] In one possible implementation, Fig.12 The method for processing the NAS message shown further includes:
[0569] When the first device determines that the integrity verification of the second NAS message passes, the first device updates the first information.
[0570] That is to say, when the integrity verification of the second NAS message passes, by updating the first information, the first device can use the updated first information to perform integrity verification on the next received NAS message, thereby improving the security of NAS message transmission.
[0571] The following describes the specific implementation of updating the first information by the first device based on the above examples A, B and C.
[0572] For example A:
[0573] In a possible implementation manner, the first information includes an updated local NAS COUNT value and one or more NAS COUNT values between the first NAS COUNT value and the local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value; and the first device updates the first information, including:
[0574] When the second NAS COUNT value is greater than the first NAS COUNT value, the first device updates the updated local NAS COUNT value to the second NAS COUNT value;
[0575] Alternatively, in a case where the second NAS COUNT value belongs to one or more NAS COUNT values, the first device deletes the second NAS COUNT value from the one or more NAS COUNT values.
[0576] That is, when the second NAS COUNT value is greater than the local NAS COUNT value (i.e., the updated local NAS COUNT value in the first information), the first device updates the updated local NAS COUNT value to the second NAS COUNT value, thereby making the updated value of the local NAS COUNT value the maximum value among the NAS COUNT values that have passed the integrity verification. Further, when the second NAS COUNT value belongs to one or more NAS COUNT values, the second NAS COUNT value is deleted from the one or more NAS COUNT values, thereby avoiding replay attacks caused by receiving the same NAS COUNT value when verifying the next NAS message, thereby achieving replay protection.
[0577] In a possible implementation manner, when the second NAS COUNT value is greater than the first NAS COUNT value, and the difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, the first device updates the first information, further comprising:
[0578] The first device records one or more NAS COUNT values between the second NAS COUNT value and the first NAS COUNT value in the first information.
[0579] That is, updating the first information may also include updating the NAS COUNT value that should be accepted but not received, which may be used to determine whether the next arriving NAS message is a NAS message that should be received but not received, thereby avoiding determining the next arriving NAS message as a replayed NAS message and discarding the NAS message.
[0580] It can be understood that the specific implementation of the first device updating the first information in the above example A can refer to the relevant instructions for updating / maintaining the first record and the second record in example 1, and will not be repeated here.
[0581] For example B:
[0582] In a possible implementation manner, the first NAS COUNT value is greater than the local NAS COUNT value, a difference between the first NAS COUNT value and the local NAS COUNT value is 1, the first information includes an updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value; and the first device updates the first information, including:
[0583] When the second NAS COUNT value is greater than the first NAS COUNT value and the difference between the second NAS COUNT value and the first NAS COUNT value is 1, the first device updates the updated local NAS COUNT value to the second NAS COUNT value;
[0584] Alternatively, when the second NAS COUNT value is greater than the first NAS COUNT value and the difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, the first device determines not to update the updated local NAS COUNT value and records the second NAS COUNT value in the first information.
[0585] That is, in a case where the updated local NAS COUNT value included in the first information is a NAS COUNT value that arrives in sequence relative to the local NAS COUNT value, if the second NAS COUNT value is a NAS COUNT value that arrives in sequence relative to the updated local NAS COUNT value, the first device updates the updated local NAS COUNT value to the second NAS COUNT value; if the second NAS COUNT value is greater than the first NAS COUNT value and is not a NAS COUNT value that arrives in sequence relative to the local NAS COUNT value, the first device does not update the updated local NAS COUNT value, so that the updated value of the local NAS COUNT value can be the maximum value of the NAS COUNT values that arrive in sequence and pass the integrity verification, and then when verifying the integrity of the next arriving NAS message, the NAS COUNT message with a NAS COUNT value less than the local NAS COUNT value can be determined as a replayed NAS message. Further, when the second NAS COUNT value is greater than the first NAS COUNT value and is not a NAS COUNT value that arrives in sequence relative to the local NAS COUNT value, the first device records the second NAS COUNT value in the first information, and then when verifying the integrity of the next arriving NAS message, the NAS message whose NAS COUNT value is equal to the second NAS COUNT value can be determined as a replayed NAS message.
[0586] It can be understood that the specific implementation of the first device updating the first information in the above example B can refer to the relevant instructions for updating / maintaining the third record and the fourth record in example three, which will not be repeated here.
[0587] For example C:
[0588] In a possible implementation manner, the first NAS COUNT value is greater than the local NAS COUNT value, a difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, and the first information includes the local NAS COUNT value and the first NAS COUNT value; and the first device updates the first information, including:
[0589] When the second NAS COUNT value is greater than the local NAS COUNT value, and the difference between the second NAS COUNT value and the local NAS COUNT value is 1, and the difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, the first device updates the local NAS COUNT value to the second NAS COUNT value;
[0590] Alternatively, when the second NAS COUNT value is greater than the local NAS COUNT value, and the difference between the second NAS COUNT value and the local NAS COUNT value is 1, and the difference between the second NAS COUNT value and the first NAS COUNT value is 1, the first device updates the local NAS COUNT value to the first NAS COUNT value;
[0591] Alternatively, when the second NAS COUNT value is greater than the local NAS COUNT value and the difference between the second NAS COUNT value and the local NAS COUNT value is greater than 1, the first device determines not to update the local NAS COUNT value and records the second NAS COUNT value in the first information.
[0592] That is, in the case where the first information includes the local NAS COUNT value and the first NAS COUNT value, the first device updates the local NAS COUNT value in a manner such that the updated value is the maximum value among the NAS COUNT values that have passed the integrity verification and arrived in order, and then when verifying the integrity of the next NAS message to arrive, the NAS COUNT message whose NAS COUNT value is less than the local NAS COUNT value can be determined as a replayed NAS message. Further, in the case where the second NAS COUNT value arrives out of order, the first device records the second NAS COUNT value (i.e., records the NAS COUNT value that arrives out of order) in the first information, and then when verifying the integrity of the next NAS message to arrive, the NAS COUNT message whose NAS COUNT value is equal to the NAS COUNT value that arrives out of order can be determined as a replayed NAS message.
[0593] It can be understood that the specific implementation of the first device updating the first information in the above example C can refer to the relevant instructions for updating / maintaining the third record and the fourth record in example three, which will not be repeated here.
[0594] Because in the embodiment of the present application, the first device generates the first information according to the first NAS COUNT value and the local NAS COUNT value when the integrity verification of the first NAS message passes, and the first information includes the first NAS COUNT value and / or the local NAS COUNT value, that is, the first device does not directly update the local NAS COUNT value according to the first NAS COUNT value, thereby avoiding the situation that the first device cannot identify part of the replayed NAS message when verifying the integrity of the second NAS message due to the local NAS COUNT value being updated to a smaller NAS COUNT value. Further, when the first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value, it can determine whether the second NAS message is a replayed NAS message, thereby avoiding replay attacks, thereby improving the security of NAS message transmission. Therefore, the NAS message processing method provided in the embodiment of the present application can optimize the NAS message processing mechanism to improve the security of NAS message transmission.
[0595] The actions of the first device in steps S1201 to S1206 can be performed by Figure 6 The processor 601 in the communication device 600 shown calls the application code stored in the memory 603 to instruct the communication device 600 to execute 6, and the embodiment of the present application does not impose any limitation on this.
[0596] The above mainly introduces the scheme provided by the embodiment of the present application from the perspective of interaction between various network elements. Accordingly, the embodiment of the present application also provides a communication device, which is used to implement the above various methods. The communication device can be the first device in the above method embodiment, or a device including the above first device, or a component that can be used for the first device. In order to implement the above functions, the communication device includes a hardware structure and / or software module corresponding to each function. It should be easy for those skilled in the art to realize that, in combination with the units and algorithm steps of each example described in the embodiment disclosed in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0597] The embodiment of the present application can divide the functional modules of the communication device according to the above method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be understood that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0598] For example, taking the communication device as the first device in the above method embodiment, Fig.13 A schematic diagram of the structure of a first device 130 is shown. The first device 130 includes a transceiver module 1301 and a processing module 1302. The transceiver module 1301, which may also be called a transceiver unit, is used to implement a transceiver function, and may be, for example, a transceiver circuit, a transceiver, a transceiver or a communication interface.
[0599] In one possible implementation:
[0600] The transceiver module 1301 is used to receive a first NAS message from a second device; the processing module 1302 is used to determine a first NAS COUNT value corresponding to the first NAS message, and if the integrity verification of the first NAS message passes, generate first information according to the first NAS COUNT value and the stored local NAS COUNT value, where the first information includes the first NAS COUNT value and / or the local NAS COUNT value; the transceiver module 1301 is also used to receive a second NAS message from the second device; the processing module 1302 is also used to determine the first NAS COUNT value corresponding to the first NAS message, and verify the integrity of the second NAS message according to the first information and the second NAS COUNT value.
[0601] In some embodiments, the processing module 1302 is further configured to:
[0602] When the first NAS COUNT value is greater than the local NAS COUNT value, the local NAS COUNT value is updated, and the first information includes the updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value;
[0603] Alternatively, when the first NAS COUNT value is less than or equal to the local NAS COUNT value, it is determined not to update the local NAS COUNT value, and the first information includes the local NAS COUNT value.
[0604] In some embodiments, when the first NAS COUNT value is greater than the local NAS COUNT value and the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, the first information further includes one or more NAS COUNT values between the first NAS COUNT value and the local NAS COUNT value.
[0605] In some embodiments, the processing module 1302 is further configured to:
[0606] In a case where the second NAS COUNT value is greater than the updated local NAS COUNT value, or in a case where the second NAS COUNT value is less than the updated local NAS COUNT value and the second NAS COUNT value belongs to one or more NAS COUNT values, determining to verify the integrity of the second NAS message according to the second NAS COUNT value;
[0607] Alternatively, when the second NAS COUNT value is less than or equal to the updated local NAS COUNT value and the second NAS COUNT value does not belong to one or more NAS COUNT values, it is determined not to verify the integrity of the second NAS message.
[0608] In some embodiments, when the difference between the first NAS COUNT value and the local NAS COUNT value is 1, the updated local NAS COUNT value is the first NAS COUNT value.
[0609] In some embodiments, the processing module 1302 is further configured to:
[0610] When the second NAS COUNT value is greater than the updated local NAS COUNT value, determine to verify the integrity of the second NAS message according to the second NAS COUNT value;
[0611] Alternatively, when the second NAS COUNT value is less than or equal to the updated local NAS COUNT value, it is determined not to verify the integrity of the second NAS message.
[0612] In some embodiments, the processing module 1302 is further configured to:
[0613] When the first NAS COUNT value is greater than the local NAS COUNT value and the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, it is determined not to update the local NAS COUNT value. The first information includes the local NAS COUNT value and the first NAS COUNT value.
[0614] In some embodiments, the processing module 1302 is further configured to:
[0615] When the second NAS COUNT value is greater than the local NAS COUNT value and the second NAS COUNT value is not equal to the first NAS COUNT value, determine to verify the integrity of the second NAS message according to the second NAS COUNT value;
[0616] Alternatively, when the second NAS COUNT value is less than or equal to the local NAS COUNT value, or the second NAS COUNT value is equal to the first NAS COUNT value, it is determined not to verify the integrity of the second NAS message.
[0617] In some embodiments, the processing module 1302 is further configured to: update the first information when it is determined that the integrity verification of the second NAS message passes.
[0618] In some embodiments, the first information includes an updated local NAS COUNT value and one or more NAS COUNT values between the first NAS COUNT value and the local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value; the processing module 1302 is further configured to:
[0619] When the second NAS COUNT value is greater than the first NAS COUNT value, updating the updated local NAS COUNT value to the second NAS COUNT value;
[0620] Alternatively, in a case where the second NAS COUNT value belongs to one or more NAS COUNT values, the second NAS COUNT value is deleted from the one or more NAS COUNT values.
[0621] In some embodiments, the processing module 1302 is further used to: when the second NAS COUNT value is greater than the first NAS COUNT value and the difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, record one or more NAS COUNT values between the second NAS COUNT value and the first NAS COUNT value in the first information.
[0622] In some embodiments, the first NAS COUNT value is greater than the local NAS COUNT value, the difference between the first NAS COUNT value and the local NAS COUNT value is 1, the first information includes the updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value; the processing module 1302 is further used to:
[0623] When the second NAS COUNT value is greater than the first NAS COUNT value and the difference between the second NAS COUNT value and the first NAS COUNT value is 1, updating the updated local NAS COUNT value to the second NAS COUNT value;
[0624] Alternatively, when the second NAS COUNT value is greater than the first NAS COUNT value and the difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, it is determined not to update the updated local NAS COUNT value, and the second NAS COUNT value is recorded in the first information.
[0625] In some embodiments, the first NAS COUNT value is greater than the local NAS COUNT value, the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, and the first information includes the local NAS COUNT value and the first NAS COUNT value; the processing module 1302 is further used to:
[0626] If the second NAS COUNT value is greater than the local NAS COUNT value, and the difference between the second NAS COUNT value and the local NAS COUNT value is 1, and the difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, update the local NAS COUNT value to the second NAS COUNT value;
[0627] Alternatively, when the second NAS COUNT value is greater than the local NAS COUNT value, and the difference between the second NAS COUNT value and the local NAS COUNT value is 1, and the difference between the second NAS COUNT value and the first NAS COUNT value is 1, the local NAS COUNT value is updated to the first NAS COUNT value;
[0628] Alternatively, when the second NAS COUNT value is greater than the local NAS COUNT value and the difference between the second NAS COUNT value and the local NAS COUNT value is greater than 1, it is determined not to update the local NAS COUNT value, and the second NAS COUNT value is recorded in the first information.
[0629] In some embodiments, the first device is a terminal device, and the second device is an access and / or mobile network element; or, the first device is an access and / or mobile network element, and the second device is a terminal device.
[0630] In another possible implementation:
[0631] The transceiver module 1301 is configured to receive a first NAS message from a second device; the processing module 1302 is configured to determine a first NAS COUNT value corresponding to the first NAS message, and generate first information according to the first NAS COUNT value and a stored local NAS COUNT value when the integrity verification of the first NAS message passes, where the first information includes the first NAS COUNT value and / or the local NAS COUNT value; the transceiver module 1301 is further configured to receive a second NAS message from the second device; the processing module 1302 is further configured to determine the first NAS COUNT value corresponding to the first NAS message, and determine whether to accept the second NAS message according to the first information and the second NAS COUNT value.
[0632] In yet another possible implementation:
[0633] The transceiver module 1301 is used to receive a first NAS message from a second device; the processing module 1302 is used to determine a first NAS COUNT value corresponding to the first NAS message, and when the integrity verification of the first NAS message passes and the first NAS COUNT value is greater than the stored local NAS COUNT value, the local NAS COUNT value is updated to the first NAS COUNT value.
[0634] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0635] In the embodiment of the present application, the first device 130 is presented in the form of dividing various functional modules in an integrated manner. The "module" here may refer to a specific ASIC, a circuit, a processor and a memory that executes one or more software or firmware programs, an integrated logic circuit, and / or other devices that can provide the above functions. In a simple embodiment, a person skilled in the art can imagine that the first device 130 can be used Figure 6 The form of the communication device 600 is shown.
[0636] for example, Figure 6 The processor 601 in the communication device 600 shown can call the computer-executable instructions stored in the memory 603, so that the communication device 600 executes the NAS message processing method in the above method embodiment.
[0637] Specifically, Fig.13 The functions / implementation processes of the transceiver module 1301 and the processing module 1302 can be Figure 6 The processor 601 in the communication device 600 shown calls the computer execution instructions stored in the memory 603 to implement. Or, Fig.13 The function / implementation process of the processing module 1302 in Figure 6 The processor 601 in the communication device 600 shown calls the computer execution instructions stored in the memory 603 to implement, Fig.13 The function / implementation process of the transceiver module 1301 can be Figure 6 The communication interface 604 in the communication device 600 shown in FIG. 6 is implemented.
[0638] Since the first device 130 provided in the embodiment of the present application can execute the above-mentioned NAS message processing method, the technical effects that can be obtained can refer to the above-mentioned method embodiment and will not be repeated here.
[0639] It should be understood that one or more of the above modules or units can be implemented by software, hardware or a combination of the two. When any of the above modules or units are implemented in software, the software exists in the form of computer program instructions and is stored in a memory, and the processor can be used to execute the program instructions and implement the above method flow. The processor can be built into an SoC (system on chip) or an ASIC, or it can be an independent semiconductor chip. In addition to the core used to execute software instructions for calculation or processing in the processor, it can also further include necessary hardware accelerators, such as field programmable gate arrays (FPGA), PLDs (programmable logic devices), or logic circuits that implement dedicated logic operations.
[0640] When the above modules or units are implemented in hardware, the hardware can be any one or any combination of a CPU, a microprocessor, a digital signal processing (DSP) chip, a microcontroller unit (MCU), an artificial intelligence processor, an ASIC, a SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator or a non-integrated discrete device, which can run the necessary software or not rely on the software to execute the above method flow.
[0641] Optionally, an embodiment of the present application further provides a communication device (for example, the communication device may be a chip or a chip system), which includes a processor for implementing the method in any of the above method embodiments. In one possible design, the communication device also includes a memory. The memory is used to store necessary program instructions and data, and the processor can call the program code stored in the memory to instruct the communication device to execute the method in any of the above method embodiments. Of course, the memory may not be in the communication device. When the communication device is a chip system, it may be composed of chips, or it may include chips and other discrete devices, which is not specifically limited in the embodiments of the present application.
[0642] Optionally, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program or instruction, and when the computer-readable storage medium is run on a communication device, the communication device can execute the method described in any of the above method embodiments or any of its implementation methods.
[0643] Optionally, an embodiment of the present application further provides a communication system, which includes the first device described in the above method embodiment and the second device described in the above method embodiment.
[0644] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with a medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0645] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0646] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for processing a non-access layer NAS message, characterized in that: The method comprises: The first device receives a first NAS message from the second device, and determines a first non-access layer count NAS COUNT value corresponding to the first NAS message; In a case where the integrity verification of the first NAS message passes, the first device generates first information according to the first NAS COUNT value and a local NAS COUNT value stored by the first device, where the first information includes the first NAS COUNT value and / or the local NAS COUNT value; The first device receives a second NAS message from the second device, and determines a second NAS COUNT value corresponding to the second NAS message; The first device verifies integrity of the second NAS message according to the first information and the second NAS COUNT value.
2. The method according to claim 1, characterized in that The first device generates first information according to the first NAS COUNT value and a local NAS COUNT value stored by the first device, where the first information includes the first NAS COUNT value and / or the local NAS COUNT value, including: When the first NAS COUNT value is greater than the local NAS COUNT value, the first device updates the local NAS COUNT value, and the first information includes an updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value; Alternatively, when the first NAS COUNT value is less than or equal to the local NAS COUNT value, the first device determines not to update the local NAS COUNT value, and the first information includes the local NAS COUNT value.
3. The method according to claim 2, characterized in that In the case that the first NAS COUNT value is greater than the local NAS COUNT value, and the difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, the first information further includes one or more NAS COUNT values between the first NAS COUNT value and the local NAS COUNT value.
4. The method according to claim 3, characterized in that The first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value, including: In a case where the second NAS COUNT value is greater than the updated local NAS COUNT value, or in a case where the second NAS COUNT value is less than the updated local NAS COUNT value and the second NAS COUNT value belongs to the one or more NAS COUNT values, the first device determines to verify the integrity of the second NAS message according to the second NAS COUNT value; Alternatively, when the second NAS COUNT value is less than or equal to the updated local NAS COUNT value and the second NAS COUNT value does not belong to the one or more NAS COUNT values, the first device determines not to verify the integrity of the second NAS message.
5. The method according to claim 2, characterized in that: In a case where the first NAS COUNT value is greater than the local NAS COUNT value, the first device updates the local NAS COUNT value, and the first information includes an updated local NAS COUNT value, where the updated local NAS COUNT value is the first NAS COUNT value, including: When the difference between the first NAS COUNT value and the local NAS COUNT value is 1, the updated local NAS COUNT value is the first NAS COUNT value.
6. The method according to claim 5, characterized in that The first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value, including: In a case where the second NAS COUNT value is greater than the updated local NAS COUNT value, the first device determines to verify the integrity of the second NAS message according to the second NAS COUNT value; Alternatively, when the second NAS COUNT value is less than or equal to the updated local NAS COUNT value, the first device determines not to verify the integrity of the second NAS message.
7. The method according to claim 1, characterized in that The first device generates first information according to the first NAS COUNT value and a local NAS COUNT value stored by the first device, where the first information includes the first NAS COUNT value and / or the local NAS COUNT value, including: When the first NAS COUNT value is greater than the local NAS COUNT value and a difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, the first device determines not to update the local NAS COUNT value, and the first information includes the local NAS COUNT value and the first NAS COUNT value.
8. The method according to claim 7, characterized in that The first device verifies the integrity of the second NAS message according to the first information and the second NAS COUNT value, including: When the second NAS COUNT value is greater than the local NAS COUNT value and the second NAS COUNT value is not equal to the first NAS COUNT value, the first device determines to verify the integrity of the second NAS message according to the second NAS COUNT value; Alternatively, when the second NAS COUNT value is less than or equal to the local NAS COUNT value, or the second NAS COUNT value is equal to the first NAS COUNT value, the first device determines not to verify the integrity of the second NAS message.
9. The method according to any one of claims 1 to 8, characterized in that The method further comprises: When the first device determines that the integrity verification of the second NAS message passes, the first device updates the first information.
10. The method according to claim 9, characterized in that The first information includes an updated local NAS COUNT value and one or more NAS COUNT values between the first NAS COUNT value and the local NAS COUNT value, wherein the updated local NAS COUNT value is the first NAS COUNT value; The first device updates the first information, including: In a case where the second NAS COUNT value is greater than the first NAS COUNT value, the first device updates the updated local NAS COUNT value to the second NAS COUNT value; Alternatively, in a case where the second NAS COUNT value belongs to the one or more NAS COUNT values, the first device deletes the second NAS COUNT value from the one or more NAS COUNT values.
11. The method according to claim 10, characterized in that When the second NAS COUNT value is greater than the first NAS COUNT value, and a difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, the first device updates the first information, further comprising: The first device records one or more NAS COUNT values between the second NAS COUNT value and the first NAS COUNT value in the first information.
12. The method according to claim 9, characterized in that The first NAS COUNT value is greater than the local NAS COUNT value, a difference between the first NAS COUNT value and the local NAS COUNT value is 1, and the first information includes an updated local NAS COUNT value, and the updated local NAS COUNT value is the first NAS COUNT value; The first device updates the first information, including: When the second NAS COUNT value is greater than the first NAS COUNT value and the difference between the second NAS COUNT value and the first NAS COUNT value is 1, the first device updates the updated local NAS COUNT value to the second NAS COUNT value; Alternatively, when the second NAS COUNT value is greater than the first NAS COUNT value, and the difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, the first device determines not to update the updated local NAS COUNT value, and records the second NAS COUNT value in the first information.
13. The method according to claim 9, characterized in that The first NAS COUNT value is greater than the local NAS COUNT value, a difference between the first NAS COUNT value and the local NAS COUNT value is greater than 1, and the first information includes the local NAS COUNT value and the first NAS COUNT value; The first device updates the first information, including: In a case where the second NAS COUNT value is greater than the local NAS COUNT value, a difference between the second NAS COUNT value and the local NAS COUNT value is 1, and a difference between the second NAS COUNT value and the first NAS COUNT value is greater than 1, the first device updates the local NAS COUNT value to the second NAS COUNT value; Alternatively, when the second NAS COUNT value is greater than the local NAS COUNT value, and the difference between the second NAS COUNT value and the local NAS COUNT value is 1, and the difference between the second NAS COUNT value and the first NAS COUNT value is 1, the first device updates the local NAS COUNT value to the first NAS COUNT value; Alternatively, when the second NAS COUNT value is greater than the local NAS COUNT value, and the difference between the second NAS COUNT value and the local NAS COUNT value is greater than 1, the first device determines not to update the local NAS COUNT value, and records the second NAS COUNT value in the first information.
14. The method according to any one of claims 1 to 13, characterized in that The first device is a terminal device, and the second device is an access and / or mobile network element; Alternatively, the first device is an access and / or mobile network element, and the second device is a terminal device.
15. A communication device, characterized in that: The communication device is used to execute the NAS message processing method according to any one of claims 1 to 14.
16. A communication device, characterized in that: include: A processor, the processor being coupled to a memory; the processor being configured to execute a computer program stored in the memory, so that the communication device executes the method for processing a NAS message according to any one of claims 1 to 14.
17. A communication device, characterized in that: include: A processor and an interface circuit; wherein the interface circuit is used to receive code instructions and transmit them to the processor; The processor is configured to execute the code instructions so that the communication device executes the NAS message processing method according to any one of claims 1 to 14.
18. A communication device, characterized in that: The communication device includes a processor and a transceiver, the transceiver is used for information exchange between the communication device and other communication devices, and the processor executes program instructions so that the communication device executes the NAS message processing method according to any one of claims 1 to 14.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a computer program or an instruction. When the computer program or the instruction is executed on a computer, the computer is enabled to execute the method for processing a NAS message according to any one of claims 1 to 14.
20. A chip system, characterized in that: include: At least one processor and an interface, wherein the at least one processor is coupled to a memory through the interface, and when the at least one processor executes a computer program or instruction in the memory, the method according to any one of claims 1 to 14 is executed.
Citation Information
Cited By
Communication method and device, communication equipment, chip and storage medium
CN119521207A
