Communication methods and related apparatuses

CN123021142APending Publication Date: 2026-10-30HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510573504.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2026-10-30

AI Technical Summary

Benefits of technology

[0126]其中,第五方面至第十方面中任一种可能的实现方式所带来的技术效果可参见上述第一方面至第四方面中不同可能的实现方式所带来的技术效果,此处不再赘述。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123021142A_ABST
    Figure CN123021142A_ABST
Patent Text Reader

Abstract

The application discloses a communication method and related device, which are applied to the technical field of communication. In the communication method, a terminal can access a second network by sending a session establishment request to a first network, and does not need to independently perform authentication registration for the second network. In addition, the terminal can obtain a first key identifier from a session establishment response from the second network, and determine a NAS message protection key of the terminal in the second network based on a key corresponding to the first key identifier, so that the terminal not only establishes a session corresponding to the second network, but also protects a NAS message of the second network by using the NAS message protection key of the terminal in the second network, and network security establishment for the second network is realized. It can be seen that the method realizes flexible, quick and efficient network security establishment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a communication method and related apparatus. Background Technology

[0002] Fifth-generation mobile communication technology (5G) provides mechanisms for protecting the confidentiality and integrity of signaling and user data. Under this mechanism, the process of a terminal accessing the network requires a primary authentication process with the network side to obtain the key used for security protection.

[0003] As subnet services continue to evolve, the future mobile communication network is evolving from a large, unified network to distributed, autonomous subnets tailored to diverse scenarios. For example, the relationship between the large network (such as a network providing access or basic services to public users) and subnets (such as networks providing access or specific services to specific users) is similar to that between a company headquarters and its districts, or a company headquarters and its county-level branches—distributed and autonomous. Another example is scenarios like live-streaming parks, stadiums, or theme parks, where terminals from multiple operators can connect simultaneously to both the large network and subnets. Therefore, establishing network security for future distributed, autonomous subnets remains a challenge. Summary of the Invention

[0004] This application provides a communication method and related apparatus for establishing network security for distributed autonomous subnets.

[0005] Firstly, this application provides a communication method. This method can be applied to a terminal, or to components within the terminal (e.g., a processor, chip, chip system, circuit, or functional module), and can also be applied to logical nodes, logical modules, or software capable of implementing all or part of the terminal's functions; there is no limitation in this regard. The following description uses a terminal as the executing entity as an example; the same applies when components within the terminal or logical nodes, logical modules, or software capable of implementing all or part of the terminal's functions are used as the executing entity. The method includes:

[0006] The terminal sends a session establishment request to the first network that has been registered and authenticated. The session establishment request is used by the terminal to request the establishment of a session corresponding to the service associated with the second network.

[0007] The terminal receives a session establishment response from the second network, which includes a first key identifier.

[0008] The terminal determines the non-access stratum (NAS) message protection key in the second network based on the security anchor key of the terminal in the first network corresponding to the first key identifier; or, the terminal determines the NAS message protection key in the second network based on the NAS message protection key of the terminal in the first network corresponding to the first key identifier.

[0009] As can be seen, in this method, the terminal can access the second network by sending a session establishment request to the first network without needing to perform separate authentication and registration for the second network. Furthermore, by obtaining the first key identifier from the session establishment response from the second network and determining the terminal's NAS message protection key on the second network based on the key corresponding to the first key identifier, the terminal not only establishes a session on the second network but also uses its NAS message protection key on the second network to protect NAS messages, thus achieving secure establishment of the second network. Therefore, this method achieves flexible, fast, and efficient network security establishment.

[0010] Optionally, assuming the NAS security endpoint is located at a signaling routing function network element, and each network has a corresponding signaling routing function network element, the session establishment request can be sent by the terminal to the first signaling routing function network element of the first network. Correspondingly, the session establishment response can come from the second signaling routing function network element of the second network.

[0011] In this context, a secure endpoint is an entity or device on the network side that encrypts messages sent to the terminal and decrypts messages received from the terminal. Similarly, a NAS secure endpoint is an entity or device on the network side that encrypts NAS messages sent to the terminal and decrypts NAS messages received from the terminal. For example, in this embodiment, a signaling routing function network element is used as the NAS secure endpoint, whereby the signaling routing function network element encrypts NAS messages sent to the terminal and decrypts NAS messages received from the terminal.

[0012] In one optional implementation, the session establishment request further includes at least one of the following: a session identifier for which the terminal requests to establish a session; the terminal's location information; or, service information corresponding to the session requested by the terminal. Optionally, the service information includes at least one of the following: service identifier information, application identifier information, data network information, or slice information corresponding to the session.

[0013] In this method, the session identifier helps inform the first network that a new session needs to be established. The terminal's location information helps the first network perform service discovery. The service information helps the first network determine whether it can provide the service corresponding to the service information. If it cannot provide the service corresponding to the service information, it can obtain the identifier information of the second network that can provide the corresponding service through service discovery.

[0014] In one optional implementation, the session establishment response further includes identification information of the second network. In another optional implementation, the session establishment response further includes a temporary identifier assigned to the terminal by the second network, the identification information of the second network being determined from the temporary identifier. Optionally, the identification information of the second network includes at least one of the following: the identifier of the second signaling routing function network element of the second network, the Internet Protocol (IP) address of the second signaling routing function network element of the second network, or the network identifier of the second network.

[0015] In this method, the terminal can obtain the NAS message protection key that needs to be deduced in the second network based on the identification information of the second network.

[0016] In another alternative implementation, the session establishment response may also include at least one of the following:

[0017] The second key identifier is the key identifier corresponding to the NAS message protection key of the terminal in the second network.

[0018] Instruction information, used to instruct the terminal to obtain the NAS message protection key on the second network; or,

[0019] The terminal uses a NAS message protection algorithm in the second network.

[0020] In this method, the second key identifier can implicitly instruct the terminal to deduce the NAS message protection key of the second network, the indication information can explicitly instruct the terminal to deduce the NAS message protection key of the second network, and the NAS message protection algorithm can instruct the terminal to use the corresponding protection algorithm to protect the NAS messages of the second network according to the NAS message protection key of the second network.

[0021] In one optional implementation, before the terminal determines the NAS message protection key of the second network, the method further includes: the terminal can determine the NAS message protection key of the terminal in the second network based on at least one of the identification information of the second network, the second key identification, or the indication information (or, in other words, determine the NAS message protection key of the terminal in the second network that needs to be deduced).

[0022] For example, if the terminal determines it has accessed the second network based on the second network's identification information, then it needs to obtain the NAS message protection key for the terminal on the second network. As another example, if the terminal determines it needs to obtain a new NAS message protection key because the second key identifier differs from an existing key identifier. Yet another example is when the terminal determines it needs to obtain a new NAS message protection key based on explicit instructions in the indication information.

[0023] In this application embodiment, the method by which the terminal determines or deduces the NAS message protection key in the second network may include, but is not limited to, the following two optional implementation methods:

[0024] In one optional implementation, the terminal determines its NAS message protection key in the second network based on at least one of the identification information or a count value of the second network, and the terminal's security anchor key in the first network corresponding to the first key identifier. The count value is the number of NAS message protection keys determined based on the terminal's security anchor key in the first network.

[0025] This method provides a security architecture based on the derivation of the terminal's security anchor key in the first network and the NAS message protection key in the second network. Based on the security anchor key derivation, isolation between different NAS message protection keys can be achieved to a certain extent, and network-side security context requests can be directly forwarded to security function network elements.

[0026] In another optional implementation, the terminal determines its NAS message protection key in the second network based on at least one of the identification information or count value of the second network, and the NAS message protection key of the terminal in the first network corresponding to the first key identifier. The count value is the number of NAS message protection keys determined based on the terminal's NAS message protection key in the first network.

[0027] This method provides a security architecture for deriving NAS message protection keys from the terminal in the first network and then in the second network. Based on the NAS message protection key derivation from the first network, the network side can directly derive the key through the first signaling routing function element of the first network, without needing to forward the security context request to the security function element. This makes obtaining the security context more direct and convenient.

[0028] In an optional implementation, the method further includes: the terminal receiving a message authentication code (MAC) value; determining an integrity protection key using the terminal's NAS message protection key in the second network; the terminal using the integrity protection key to verify the MAC value of the session establishment response message; if the verification passes, the terminal using the NAS message protection key to protect the NAS messages in the second network; and enabling encryption and integrity protection of NAS messages between the second network and the terminal after the MAC value verification passes. Optionally, the MAC value and the session establishment response message can be carried in the same message.

[0029] In an optional implementation, the method further includes: the terminal using its NAS message protection key in the second network to determine a user plane data protection key for use in protecting user plane data.

[0030] Secondly, this application provides a communication method that can be applied to relevant network functions in a first network, such as a first signaling routing function, session management function, or user plane function. This method can also be applied to entities, devices, or network elements related to the relevant network functions in the first network. Furthermore, this method can be applied to components (e.g., processors, chips, chip systems, circuits, or functional modules) of relevant network function entities, devices, or network elements in the first network, and can also be applied to logical nodes, logical modules, or software capable of implementing all or part of the network element functions; there are no limitations on this. This aspect is illustrated using the first signaling routing function network element as an example of the executing entity. The method includes:

[0031] The first signaling routing function network element receives a first session establishment request from the terminal. The first session establishment request includes service information, and the service information corresponds to a service associated with the second network.

[0032] The first signaling routing function network element sends a service discovery request based on the first session establishment request. The service discovery request includes service information and terminal identification information, or includes service information, terminal identification information and location information.

[0033] The first signaling routing function network element receives the service discovery response, which includes the identification information of the second network.

[0034] The first signaling routing function network element sends a second session establishment request to the second network based on the identification information of the second network. The second session establishment request includes the identification information of the terminal, or includes the identification information and location information of the terminal.

[0035] As can be seen, in this method, after receiving the first session establishment request, the first network can obtain the identification information of the second network through service discovery. The second network is the network providing the service corresponding to the service information. Therefore, the first signaling routing function network element can send a second session establishment request to the second network based on the identification information of the second network to establish the session corresponding to the service.

[0036] Optionally, if the terminal's location information is not included in the first session establishment request, the first network may request the terminal's location information from the location management function network element or the mobility management function network element.

[0037] Optionally, after receiving the first session establishment request, the first network can determine whether it can provide the corresponding service based on the service information therein; if it determines that it cannot provide the corresponding service, it can obtain the identification information of the second network through service discovery, and send the second session establishment request to the second network.

[0038] As can be seen, in this method, when the first network detects that it cannot provide services for the requested service, it performs service discovery, discovers the second network, and forwards the corresponding service request to the second network.

[0039] In an optional implementation, the method further includes: a first signaling routing function network element sending information related to the security context of the terminal in the second network to the second network based on the identification information of the second network, wherein the information related to the NAS security context of the terminal in the second network includes the NAS message protection key of the terminal in the second network.

[0040] Optionally, the second session establishment request and the NAS security context-related information can be sent to the second network together, such as in a single message, or they can be sent to the second network separately in different messages. Optionally, the first signaling routing function network element obtains the NAS security context-related information of the terminal in the second network before sending the second session establishment request, or after receiving the service discovery response.

[0041] The optional implementation methods for the first signaling routing function network element to obtain information related to the NAS security context of the terminal in the second network include, but are not limited to, the following two:

[0042] In one optional implementation, a first signaling routing function network element requests information related to the NAS security context of a terminal in the second network from other network elements, such as a security function network element. The method includes: the first signaling routing function network element sending a security context request, the security context request being used to request information related to the NAS security context of the terminal in the second network, the security context request including the terminal's identification information and the second network's identification information; and the first signaling routing function network element receiving a security context response, the security context response including the terminal's information related to the NAS security context of the second network.

[0043] In one possible implementation, the security context request is sent by the sending terminal of the first signaling routing function network element before the NAS security context related information of the second network. Alternatively, the security context request is sent after the first signaling routing function network element sends the second session establishment request and before the sending terminal sends the NAS security context related information of the second network. Or, the security context request is sent before the first signaling routing function network element sends the second session establishment request.

[0044] Optionally, the security context response received by the first signaling routing function network element further includes a first key identifier, wherein the first key identifier is an identifier corresponding to the NAS message protection key of the terminal in the first network. This first key identifier is used by the terminal to determine the NAS message protection key in the first network in order to deduce the NAS message protection key in the second network.

[0045] In another optional implementation, the first network determines (e.g., by deduction) the NAS security context-related information of the terminal in the second network. The method further includes: a first signaling routing function network element receiving a security context request, the security context request being used to request the NAS security context-related information of the terminal in the second network; the first signaling routing function network element determining the NAS security context-related information of the terminal in the second network based on the NAS security context information of the terminal in the first network; and the first signaling routing function network element sending a security context response, the security context response including the NAS security context-related information of the terminal in the second network, the NAS security context-related information of the terminal in the second network including the NAS message protection key of the terminal in the second network. Here, the first network is the network where the terminal has been authenticated and registered.

[0046] Optionally, the security context request may be received from the second signaling routing function network element of the second network after the second session establishment request has been sent.

[0047] Optionally, the method further includes: the first signaling routing function network element obtaining the NAS security context information of the terminal in the first network based on the terminal's identification information. The security context request includes the terminal's identification information.

[0048] Optionally, the security context response sent by the first signaling routing function network element may also include a first key identifier. The definition and function of the first key identifier are as described above and will not be detailed here.

[0049] As can be seen, this method eliminates the need for terminals to undergo independent authentication and registration processes on the second network to obtain information related to the terminal's NAS security context on the second network. Instead, the information is deduced from the first network. This facilitates flexible, rapid, and efficient network security establishment.

[0050] The following describes specific optional implementation methods for the first signaling routing function network element to determine NAS security context-related information of the second network based on the NAS security context information of the first network:

[0051] In one optional implementation, the first signaling routing function network element determines or deduces the NAS message protection key of the terminal in the second network based on the identification information of the second network and the NAS message protection key of the terminal in the first network. Specifically, the NAS security context information of the terminal in the first network includes the NAS message protection key of the terminal in the first network, and the information related to the NAS security context of the terminal in the second network includes the NAS message protection key of the terminal in the second network.

[0052] In another optional implementation, the NAS security context information of the terminal in the first network also includes a count value, which is the number of NAS message protection keys determined by the terminal based on the NAS security context information of the terminal in the first network. The first signaling routing function network element determines the NAS message protection key of the terminal in the second network based on the count value and the NAS message protection key of the terminal in the first network.

[0053] The information related to the NAS security context of the terminal in the second network sent by the first signaling routing function network element includes not only the NAS message protection key of the terminal in the second network, but also the first key identifier. The meaning and function of the first key identifier are as described above and will not be elaborated here.

[0054] In this embodiment of the application, the information related to the security context of the terminal in the second network also includes at least one of the following:

[0055] The terminal's security capability information, which indicates the security protection algorithms supported by the terminal; or...

[0056] The second key identifier is the identifier corresponding to the NAS message protection key of the terminal in the second network.

[0057] Specifically, the terminal's security capability information enables the second network to combine locally supported security algorithms to select a subsequent NAS message protection algorithm. Furthermore, based on the NAS message protection key and the selected NAS message protection algorithm, it derives a confidentiality protection key and an integrity protection key to protect the NAS messages sent to the terminal. The terminal's security context-related information in the second network includes a second key identifier, which facilitates forwarding information from the second network to the terminal, allowing the terminal to be aware of the need to derive a new key (i.e., the terminal's NAS message protection key in the second network).

[0058] In one alternative implementation, before the first network determines (e.g., deduces) the information related to the NAS security context of the terminal in the second network, it may also request the authentication method corresponding to the terminal in the second network from the unified data management network element or policy control function network element.

[0059] For example, before the first signaling routing function network element determines the information related to the NAS security context of the terminal in the second network based on the NAS security context information of the first network, the method further includes: the first signaling routing function network element (e.g., sending an authentication method request to a unified data management network element), the authentication method request including the terminal's identification information and the identification information of the second network; the first signaling routing function network element receiving (e.g., from the unified data management network element) an authentication method response, the authentication method response including first indication information, the first indication information being used to indicate that the terminal does not need to be authenticated in the second network.

[0060] Optionally, in the authentication method response, the first indication information is used to indicate the authentication method of the second network. For example, authentication can be performed independently for the second network, Extensible Authentication Protocol (EAP) authentication, or slice authentication. In this case, the first signaling routing function network element can trigger the terminal to execute the corresponding authentication method.

[0061] The security context request received by the first signaling routing function network element also includes the identification information of the second network and the identification information of the terminal. The identification information of the second network and the identification information of the terminal carried in the authentication method request can be obtained based on the security context request.

[0062] Other alternative implementation methods or descriptions of terms in this aspect, such as the identification information of the second network, can be found in the relevant content described in the first aspect, and will not be detailed here.

[0063] Thirdly, this application provides a communication method that can be applied to relevant network functions in a first network, such as security functions. This method can also be applied to network elements of relevant network functions in the first network, such as security function network elements. This method can also be applied to relevant network function entities, relevant network function devices, or components (e.g., processors, chips, chip systems, circuits, or functional modules) in the first network, and can also be applied to logical nodes, logical modules, or software that can implement all or part of the functions of entities, devices, or network elements; there are no limitations on this. This aspect is illustrated using a security function network element as the executing entity as an example. The method includes:

[0064] The security function network element receives a security context request, which is used to request information related to the NAS security context of the terminal in the second network. The security context request includes the terminal's identification information.

[0065] The security function network element obtains the terminal's security anchor key in the first network from the stored security context information of the terminal based on the terminal's identification information; the security function network element determines the NAS message protection key of the terminal in the second network based on the terminal's security anchor key in the first network.

[0066] The security function network element sends a security context response, which includes information related to the NAS security context of the terminal in the second network. The information related to the NAS security context of the second network includes the NAS message protection key of the terminal in the second network.

[0067] The first network is the network where the terminal has registered and authenticated, and the second network is the network where the terminal requests to establish the service association corresponding to the session.

[0068] In this method, the security function network element can determine the NAS message protection key of the terminal in the second network based on the security anchor key of the terminal in the first network, thereby improving the network security establishment efficiency of the second network, saving signaling, and optimizing the network security establishment process.

[0069] Optionally, the security context request can be sent from the first signaling routing function network element of the first network to the security function network element, or from the second signaling routing function network element of the second network to the security function network element. Correspondingly, the security context response can be sent from the security function network element to either the first or second signaling routing function network element.

[0070] Optionally, the security context request may also include identification information of the second network.

[0071] Optionally, the security context response may also include a first key identifier, wherein the first key identifier is the identifier corresponding to the security anchor key of the terminal in the first network. This method sends the first key identifier to the terminal, enabling the terminal to determine the corresponding security anchor key based on the first key identifier, thereby deriving the NAS message protection key for the terminal in the second network.

[0072] In the security context response, the terminal may include at least one of the following information related to the NAS security context in the second network: the terminal's security capability information, which indicates the security protection algorithms supported by the terminal; or, a second key identifier, which is the identifier corresponding to the NAS message protection key of the terminal in the second network.

[0073] In this method, the terminal's security capability information is included in the NAS security context information of the second network. This allows the second network to select the appropriate NAS message protection algorithm based on the security algorithms supported by the terminal and the locally supported algorithms. Furthermore, it allows the second network to deduce the confidentiality protection key and integrity protection key based on the NAS message protection key, thus protecting the NAS messages sent to the terminal. Additionally, the second network can send the terminal's security capability information to the terminal, enabling the terminal to verify the correctness of the security capability information received from the network side. The terminal's second key identifier is also included in the NAS security context information of the second network, which is facilitated by the second network forwarding it to the terminal, allowing the terminal to learn that a new key needs to be deduced (i.e., the terminal's NAS message protection key in the second network).

[0074] In one optional implementation, the security function network element determines the NAS message protection key of the terminal in the second network based on the security anchor key of the terminal in the first network. This includes: the security function network element determining the NAS message protection key of the terminal in the second network based on a count value and the security anchor key of the terminal in the first network, wherein the count value is the number of NAS message protection keys determined based on the security anchor key of the terminal in the first network.

[0075] Optionally, the method further includes: the security function network element obtaining the count value from the stored security context information of the terminal based on the terminal's identification information.

[0076] In another optional implementation, the security function network element determines the NAS message protection key for the terminal in the second network based on the terminal's security anchor key in the first network. This includes: the security function network element determining the NAS message protection key for the terminal in the second network based on the identification information of the second network and the terminal's security anchor key in the first network, with a count value representing the number of NAS message protection keys determined based on the terminal's security anchor key in the first network. The identification information of the second network can be obtained from a security context request.

[0077] In one optional implementation, before the security function network element determines the NAS message protection key of the terminal in the second network based on the security anchor key of the terminal in the first network, it may also request the authentication method corresponding to the terminal in the second network from the unified data management network element or the policy control function network element.

[0078] For example, the method further includes: a security function network element sending an authentication method request, the authentication method request including the terminal's identification information and the identification information of the second network; and the security function network element receiving an authentication method response, the authentication method response including first indication information, the first indication information being used to indicate that the terminal does not need to be authenticated in the second network.

[0079] For example, in the authentication method response, the first indication information is used to indicate the authentication method of the terminal in the second network. In this case, the security function network element triggers the terminal to perform authentication, EAP authentication or slice authentication for the second network.

[0080] The identification information of the second network is obtained from the security context request.

[0081] Optionally, the authentication request can be sent from the security function network element to the unified data management function network element or the policy control function network element.

[0082] Optionally, if the security function network element is aware of the authentication method corresponding to the terminal in the second network or if authentication is not required, it may not need to send an authentication method request.

[0083] Other alternative implementation methods or descriptions of terms in this aspect, such as the identification information of the second network, can be found in the relevant content described in the first aspect, and will not be detailed here.

[0084] Fourthly, this application provides a communication method that can be applied to relevant network functions in a second network, such as a second signaling routing function, session management function, or user plane function. This method can also be applied to entities, devices, or components (e.g., processors, chips, chip systems, circuits, or functional modules) of relevant network functions in the second network, and can also be applied to logical nodes, logical modules, or software that can implement all or part of the functions of entities, devices, or network elements; there is no limitation in this regard. This aspect is illustrated using a second signaling routing function network element as the executing entity. The method includes:

[0085] The second signaling routing function network element receives a session establishment request from the first network. The session establishment request is used by the terminal to request the establishment of a session corresponding to the service associated with the second network. The session establishment request includes the terminal's identification information. The first network is the network that the terminal has registered and authenticated.

[0086] The second signaling routing function network element determines the information related to the NAS security context of the terminal in the second network. The information related to the NAS security context of the terminal in the second network includes the NAS message protection key of the terminal in the second network.

[0087] The second signaling routing function network element sends a session establishment response to the terminal. The session establishment response includes a first key identifier, which corresponds to the terminal's security anchor key in the first network or the terminal's NAS message protection key in the first network. This is used by the terminal to determine the NAS message protection key in the second network.

[0088] In this method, after the second network determines the information related to the NAS security context of the terminal in the second network, it can send a first key identifier to the terminal. This allows the terminal to deduce the NAS message protection key of the second network based on the security anchor key or NAS message protection key corresponding to the first key identifier. This eliminates the need for the terminal to perform independent authentication and registration for the second network to obtain the NAS message protection key of the second network, thereby saving signaling overhead and optimizing the network security establishment process.

[0089] In one possible implementation, the session establishment request is sent by the terminal to the first signaling routing function network element of the first network through the access network device, and then forwarded by the first signaling routing function network element to the second signaling routing function network element.

[0090] In another possible implementation, the session establishment request is sent by the terminal to the first signaling routing function network element of the first network through the access network device, and then forwarded by the first signaling routing function network element to the second signaling routing function network element through a similar network open function entity or network exposed function entity.

[0091] The second signaling routing function network element can execute the step of sending a session establishment response to the terminal after the session management function network element has established a session.

[0092] In one optional implementation, the session establishment request further includes at least one of the following: a session identifier for which the terminal requests to establish a session; the terminal's location information; or, service information corresponding to the session requested by the terminal. Optionally, the service information includes at least one of the following: service identifier information, application identifier information, data network information, or slice information corresponding to the session.

[0093] In this method, the session identifier helps the second network to know the identifier of a new session that needs to be established. The terminal's location information helps the second network request the establishment of a session from the corresponding session management function network element. Service information is used to identify the service corresponding to the session.

[0094] In one optional implementation, the session establishment response includes identification information of the second network; or, the session establishment response includes a temporary identifier assigned to the terminal by the second network, and the identification information of the second network is determined from the temporary identifier. Optionally, the identification information of the second network includes at least one of the following: the identifier or IP address of the second signaling routing function network element, or the network identifier of the second network.

[0095] The beneficial effects of this implementation method can be found in the relevant content described in the first aspect, and will not be elaborated here.

[0096] Optionally, the session establishment response may also include at least one of the following:

[0097] The second key identifier is the key identifier corresponding to the NAS message protection key of the terminal in the second network.

[0098] Instruction information, used to instruct the terminal to obtain the NAS message protection key on the second network; or,

[0099] The terminal uses a NAS message protection algorithm in the second network.

[0100] The beneficial effects of this implementation method can be found in the relevant content described in the first aspect, and will not be elaborated here.

[0101] In this embodiment, after receiving a session establishment request from the first network, the second network discovers that the request is for establishing a session corresponding to the second network. It can then query whether it has saved information related to the terminal's NAS security context for that second network. If the terminal's NAS security context information is not saved, the second network can use, but is not limited to, the following two optional implementation methods to determine the terminal's NAS security context information:

[0102] In one optional implementation, the second signaling routing function network element requests information related to the NAS security context of the terminal in the second network from the first signaling routing function network element or the security function network element of the first network. The method includes: the second signaling routing function network element sending a security context request, the security context request being used to request information related to the NAS security context of the terminal in the second network, the security context request including the terminal's identification information and the second network's identification information; the second signaling routing function network element receiving a security context response, the security context response including the terminal's information related to the NAS security context of the terminal in the second network; the information related to the NAS security context of the terminal in the second network including the terminal's NAS message protection key in the second network.

[0103] The relevant content and beneficial effects of this implementation method can be found in the relevant content described in the second or third aspect, and will not be detailed here.

[0104] Optionally, the security context response may also include a first key identifier, wherein the first key identifier is an identifier corresponding to the NAS message protection key of the terminal in the first network, or an identifier corresponding to the security anchor key of the terminal in the first network.

[0105] This method facilitates forwarding the first key identifier to the terminal, enabling the terminal to determine the corresponding NAS message protection key or security anchor key of the first network, and thus deduce the NAS message protection key of the second network.

[0106] In another optional implementation, the second signaling routing function network element may receive information from the first signaling routing function network element regarding the NAS security context of the terminal in the second network. This information includes the terminal's NAS message protection key in the second network. Optionally, the NAS security context-related information may also be carried in a security context response or a session establishment request and sent by the first signaling routing function network element to the second signaling routing function network element.

[0107] In one optional implementation, the terminal's security context-related information in the second network further includes at least one of the following:

[0108] The terminal's security capability information, which indicates the security protection algorithms supported by the terminal; or...

[0109] The second key identifier is the identifier corresponding to the NAS message protection key of the terminal in the second network.

[0110] For details regarding the implementation method and its beneficial effects, please refer to the relevant content described in the second or third aspect, which will not be elaborated here.

[0111] Other optional implementation methods or descriptions of terms in this aspect, such as the identification information and service information of the second network, can be found in the relevant content described in the first to third aspects, and will not be detailed here.

[0112] Fifthly, this application also provides a communication device. This communication device includes modules, units, or means that implement the methods described above. These modules, units, or means can be implemented in hardware, software, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the functions described above.

[0113] In one possible design, the communication device may include a processing unit and a communication unit. The processing unit is configured to support the communication device in performing the corresponding functions described in the above-described method. The communication unit supports communication between the communication device and other communication devices. The communication device may also include a storage unit coupled to the processing unit and the communication unit, which stores necessary program instructions and data for the communication device. Additionally, the processing unit may be used to control the communication unit to transmit and receive data / signaling.

[0114] The communication device may execute any one of the first to fourth aspects or any possible implementation of any one of them, which will not be described in detail here.

[0115] As an example, the communication unit can be a transceiver or a communication interface, the storage unit can be a memory, and the processing unit can be a processor. The processor is coupled to the memory, which stores programs or instructions. The processor can be used to cause the communication device to perform the methods described in any one of the first to fourth aspects or possible embodiments of any one of them when the program or instructions are executed by the processor. The transceiver or communication interface can be used to send and receive signals and / or data.

[0116] In another embodiment, the communication device is a chip or chip system. The processing unit may also be a processing circuit or logic circuit; the transceiver unit may be an input / output interface, interface circuit, output circuit, input circuit, pin, or related circuit on the chip or chip system.

[0117] In implementation, the processor can be used for, but is not limited to, baseband-related processing, and the transceiver or communication interface can be used for, but is not limited to, radio frequency transceiver. These devices can be disposed on separate chips, or at least partially or entirely on the same chip. For example, the processor can be further divided into analog baseband processors and digital baseband processors. The analog baseband processor can be integrated with the transceiver (or communication interface) on the same chip, while the digital baseband processor can be disposed on a separate chip. With the continuous development of integrated circuit technology, more and more devices can be integrated on the same chip. For example, a digital baseband processor can be integrated with multiple application processors (e.g., but not limited to graphics processors, multimedia processors, etc.) on the same chip. Such a chip can be called a system-on-a-chip (SoC). Whether the various devices are disposed independently on different chips or integrated on one or more chips often depends on the needs of the product design. This application does not limit the implementation form of the above-mentioned devices.

[0118] Sixthly, this application also provides a communication device, comprising: a processor configured to execute the method described in any one of the first to fourth aspects or any possible embodiments thereof. In executing these methods, the processes of sending and receiving the signals described in the methods can be understood as the process of the processor outputting the signals and the process of the processor inputting the signals. When outputting the signals, the processor outputs the signals to a transceiver for transmission by the transceiver (or communication interface). After being output by the processor, the signals may require further processing before reaching the transceiver (or communication interface). Similarly, when the processor receives the input signals, the transceiver (or communication interface) receives the signals and inputs them to the processor. Furthermore, after the transceiver (or communication interface) receives the signals, the signals may require further processing before being input to the processor.

[0119] Unless otherwise specified, or unless it contradicts its actual function or internal logic in the relevant description, the transmission and reception operations involved by the processor can be more generally understood as processor output and reception, input and other operations, rather than transmission and reception operations directly performed by radio frequency circuits and antennas.

[0120] In one possible implementation, the communication device further includes a memory for storing necessary program instructions and data.

[0121] In implementation, the processor can be a dedicated processor for executing these methods, or it can be a processor that executes computer instructions stored in memory to execute these methods, such as a general-purpose processor. The memory can be a non-transitory memory, such as read-only memory (ROM), which can be integrated with the processor on the same chip or disposed on different chips. This application does not limit the type of memory or the arrangement of the memory and processor.

[0122] In a seventh aspect, this application also provides a communication system, which includes a terminal device that performs the first aspect or any possible implementation of the first aspect, a network device that performs the second aspect or any possible implementation of the second aspect, a network device that performs the third aspect or any possible implementation of the third aspect, and a network device that performs the fourth aspect or any possible implementation of the fourth aspect.

[0123] Eighthly, this application provides a computer-readable storage medium storing a computer program that, when run, causes the method described in any one of the first to fourth aspects or any possible implementation thereof to be executed.

[0124] Ninthly, this application also provides a computer program product including instructions, the computer program product comprising: computer program code, which, when executed, causes the method described in any one of the first to fourth aspects or any possible implementation thereof to be performed.

[0125] In a tenth aspect, this application provides a chip system including a processor and an interface. The interface is used to acquire programs or instructions, and the processor is used to invoke the programs or instructions to implement the functions involved in any one of the first to fourth aspects or possible implementations of any one of them. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for the terminal. This chip system may be composed of chips or may include chips and other discrete devices.

[0126] The technical effects of any of the possible implementations in aspects five through ten can be found in the technical effects of the different possible implementations in aspects one through four above, and will not be repeated here.

[0127] Understandably, provided that the solutions do not contradict each other, the solutions in the above aspects can be combined. Attached Figure Description

[0128] Figure 1 This is a schematic diagram of the architecture of a 5G communication system;

[0129] Figure 2 This is a schematic diagram illustrating the encryption and decryption process for confidentiality protection.

[0130] Figure 3 This is a schematic diagram of an encryption and decryption process for integrity protection;

[0131] Figures 4 to 5 This is a schematic diagram of the future distributed subnet architecture provided in an embodiment of this application;

[0132] Figure 6 This is a schematic diagram of a communication method provided in an embodiment of this application;

[0133] Figures 7 to 8 A schematic diagram of the security architecture provided in this application embodiment;

[0134] Figures 9 to 12 This is a schematic diagram of a communication method provided in an embodiment of this application;

[0135] Figures 13 to 14 This is a schematic diagram of the communication device provided in the embodiments of this application. Detailed Implementation

[0136] The terms "first" and "second," etc., used in the specification, claims, and drawings of this application are used only to distinguish different objects and not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0137] The term "embodiment" as used herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0138] In this application, "at least one (item)" refers to one or more, "more than one" refers to two or more, "at least two (items)" refers to two or three or more, and "and / or" is used to describe the relationship between related objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. "Or" indicates that there can be two relationships, such as only A exists and only B exists; when A and B are not mutually exclusive, it can also mean that there are three relationships, such as only A exists, only B exists, and both A and B exist simultaneously. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items. For example, at least one (item) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c".

[0139] In this application, "send" and "receive" indicate the direction of signal transmission. For example, "send information to XX" can be understood as the destination of the information being XX, which can include direct transmission via the air interface or indirect transmission via the air interface from other units or modules. "Receive information from YY" can be understood as the source of the information being YY, which can include direct reception from YY via the air interface or indirect reception from YY via the air interface from other units or modules. "Send" can also be understood as the "output" of a chip interface, and "receive" can also be understood as the "input" of a chip interface. In other words, sending and receiving can occur between devices, such as between network devices and terminal devices, or within a device, such as between components, modules, chips, software modules, or hardware modules within the device via buses, traces, or interfaces.

[0140] The following describes the communication system involved in the embodiments of this application.

[0141] The method provided in this application can be applied to various communication systems, such as Internet of Things (IoT) systems, narrowband Internet of Things (NB-IoT) systems, long term evolution (LTE) systems, 5th-generation (5G) communication systems, new radio (NR) systems, and new communication systems emerging in future communication development. IoT networks may include, but are not limited to, vehicle-to-everything (V2X) networks. Communication methods in V2X systems can be collectively referred to as vehicle-to-everything (V2X), where X can represent anything. For example, V2X may include: vehicle-to-vehicle (V2V) communication, vehicle-to-infrastructure (V2I) communication, vehicle-to-pedestrian (V2P) communication, or vehicle-to-network (V2N) communication, etc. The embodiments of this application can also be applied to device-to-device (D2D) technology, machine-to-machine (M2M) technology, or V2X technology communication. The method provided in the embodiments of this application can also be applied to non-terrestrial networks (NTN) communication (also known as non-terrestrial network communication).

[0142] Figure 1 This is a schematic diagram of the architecture of a fifth-generation (5G) communication system. 5G is a new generation of broadband mobile communication technology characterized by high speed, low latency, and massive connectivity. 5G communication infrastructure is the network infrastructure for realizing the interconnection of humans, machines, and things. A non-roaming 5G network architecture based on service-oriented interfaces is shown below. Figure 1 As shown, network functions are based on modular decomposition. Decoupled network functions (NFs) can be independently expanded, evolved, and deployed on demand. All NFs in the control plane use service-oriented interfaces, allowing the same service to be called by multiple NFs, reducing the coupling between interface definitions and ultimately enabling on-demand customization of the entire network function, flexibly supporting different business scenarios and requirements. Service-oriented NFs have service-oriented interfaces between them, and the messages exchanged are service-oriented messages. The following is a brief introduction to the name and function of each module:

[0143] User equipment (UE) is a device with wireless transceiver capabilities that can be deployed on land, including indoors or outdoors, handheld, wearable, or vehicle-mounted; on water (such as on ships); and in the air (such as on airplanes, balloons, and satellites). The UE stores a long-term key K and related functions. In the case of two-way authentication, the UE uses K and related functions to verify the authenticity of the network.

[0144] A UE (User Equipment) can also be called a terminal, which can be a mobile phone, tablet, computer with wireless transceiver capabilities, virtual reality (VR) terminal device, augmented reality (AR) terminal device, wireless terminal in industrial control, vehicle-mounted terminal device, wireless terminal in self-driving, wireless terminal in remote medical care, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, wireless terminal in smart home, wearable terminal device, etc. A UE can also be referred to as a terminal, terminal device, access terminal device, vehicle-mounted terminal, industrial control terminal, UE unit, UE station, mobile station, mobile station, remote station, remote terminal device, mobile device, UE agent, or UE device, etc. A UE can be fixed or mobile.

[0145] An access network (AN) is used to implement access-related functions. It can provide network access to authorized users in a specific area and determine transmission tunnels of different qualities to transmit user data based on user level, service requirements, etc. The access network forwards control signals and user data between terminal devices and the core network. The access network may include access network equipment. For example, in this application, information exchanged between the tag device and network elements of the core network can be forwarded through the access network equipment.

[0146] Access network equipment can be devices that provide access for terminals, and can include radio access network (RAN) equipment and AN equipment. AN equipment is mainly responsible for functions such as radio resource management, quality of service (QoS) management, data compression, and encryption on the air interface side. RAN equipment can include various types of base stations, such as macro base stations, micro base stations (also known as small cells), relay stations, access points, and balloon stations. In systems employing different wireless access technologies, the names of devices with base station functions may vary. For example, in LTE and 5G systems, network devices may be called: RAN or next-generation Node base station (gNB), evolved Node B (eNB or eNodeB), base station controller (BSC), base transceiver station (BTS), home network equipment (e.g., home-evolved Node B or home Node B, HNB), baseband unit (BBU), access point (AP) in wireless fidelity (WIFI) systems, wireless relay node, wireless backhaul node, transmission and reception point (TRP), transmission point (TP), etc.; or one or a group of antenna panels (including multiple antenna panels) of network equipment in 5G systems; or, they may be network nodes constituting a gNB or transmission point, such as BBU, or distributed unit (distributed unit). Unit (DU), or roadside unit (RSU) in V2X or intelligent driving scenarios.

[0147] In some deployments, a gNB or transport point may include a centralized unit (CU) and a DU, etc. A gNB or transport point may also include a radio unit (RU). The CU implements some of the functions of the gNB or transport point, and the DU implements some of the functions of the gNB or transport point. For example, the CU implements the functions of radio resource control (RRC) and the packet data convergence protocol (PDCP) layer, while the DU implements the functions of radio link control (RLC), media access control (MAC), and physical (PHY) layers. Since information from the RRC layer ultimately becomes physical layer information, or is transformed from physical layer information, in this architecture, higher-layer signaling, such as RRC layer signaling or PDCP layer signaling, can also be considered to be sent by the DU, or by the DU+RU. It is understood that network devices can be CU nodes, DU nodes, or devices including both CU and DU nodes. Optionally, network devices can also be auxiliary communication equipment, such as satellites.

[0148] The core network is responsible for maintaining the subscription data of the mobile network and providing UEs with functions such as session management, mobility management, policy management, and security authentication. The core network may include the following network elements:

[0149] The access and mobility management function (AMF) network element is mainly responsible for mobility management in mobile networks, such as user location updates, user network registration, and user handover.

[0150] The Authentication Server Function (AUSF) network element is used to perform security authentication for terminal devices.

[0151] SEAF network elements, which can be part of AMF, are mainly responsible for initiating authentication requests to AUSF network elements and completing the authentication of terminal devices on the network side during the authentication process.

[0152] The unified data management (UDM) network element is mainly used to store user data, such as subscription data and authentication / authorization data.

[0153] The Session Management Function (SMF) network element is primarily responsible for session management in mobile networks, such as session establishment, modification, and release. Specific functions include assigning Internet Protocol (IP) addresses to users and selecting User Plane Function (UPF) network elements that provide packet forwarding capabilities.

[0154] The UPF network element is mainly responsible for forwarding and receiving user plane data. It can receive user plane data from the data network and transmit it to the UE through the access network device; it can also receive user plane data from the UE through the access network device and forward it to the data network.

[0155] The policy control function (PCF) network element primarily supports providing a unified policy framework to control network behavior, providing policy rules to the control layer network functions, and is also responsible for acquiring user subscription information related to policy decisions. The PCF network element can provide policies to the AMF and SMF network elements, such as Quality of Service (QoS) policies and slice selection policies.

[0156] Application function (AF) network elements mainly support interaction with the 3GPP core network to provide services, such as influencing data routing decisions, policy control functions, or providing some third-party services to the network side.

[0157] The network slice selection function (NSSF) network element is used to select network slices for the UE.

[0158] Network exposure function (NEF) network elements are mainly used to support the exposure of capabilities and events.

[0159] Network function repository (NRF) network elements primarily provide service registration, discovery, and authorization, and maintain information on available network function (NF) instances. This enables on-demand configuration of network functions and services, as well as interconnection between NFs. Service registration means that an NF network element must register with the NRF network element before it can provide services. Service discovery means that when an NF network element needs services from other NF network elements, it must first perform service discovery through the NRF network element to find the desired NF network element providing the service. For example, if NF network element 1 needs services from NF network element 2, it must first perform service discovery through the NRF network element to find NF network element 2.

[0160] The data network (DN) is used to provide services to users. It can be a private network, such as a local area network (LAN); an external network independent of the operator, such as the Internet; or a proprietary network jointly deployed by the operator, such as a network providing the IP multimedia subsystem (IMS). The UE can access the DN through an established protocol data unit (PDU) session.

[0161] The location management function (LMF) network element is mainly used to provide the location information of the terminal.

[0162] The network slice specific authentication and authorization function (NSSAAF) network element is mainly responsible for specific authentication and authorization of network slices.

[0163] in addition, Figure 1 In the 5G communication system architecture shown, the UE and AMF network elements can interact through the N1 interface. The interaction between other network function network elements is similar. For example, the AN and AMF network elements can interact through the N2 interface, and the N3 interface supports selective activation / deactivation of user plane connections. The SMF network element and UPF network element can interact through the N4 interface, and the UPF network element and DN can interact through the N6 interface, etc.

[0164] It should be noted that the above only lists the 5G communication systems to which the communication methods provided in the embodiments of this application are applicable. The communication methods provided in the embodiments of this application can also be applied to future communication systems. The network architecture and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of communication network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0165] 5G networks provide mechanisms for the confidentiality and integrity protection of signaling and user data. During network access, this mechanism derives the key used for subsequent security protection through the main authentication process between the UE and the network side; and negotiates the encryption and integrity protection algorithms used to protect signaling or air interface RRC signaling and user plane data through algorithm negotiation. Once the key and algorithm are available, the key and 3GPP-defined input parameters can be input into the encryption or integrity protection algorithm to obtain the corresponding secure output. The following sections briefly explain key derivation, algorithm negotiation, and data protection.

[0166] The key derivation architecture in a 5G system is divided into a network side and a user interface (UE) side. The Universal Subscriber Identity Module (USIM) card and the UDM (or ARPF) network element store the terminal's long-term key K. When the terminal registers with the network, it undergoes identity authentication, also known as primary authentication. After the primary authentication process, the corresponding authentication key KAUSF and security anchor key KSEAF can be derived from the cipher key (CK) and integrity key (IK) used in the primary authentication process. KAMF is derived from KSEAF, and KAMF is used to generate the control plane NAS key and subsequently, KgNB and NH, used to generate the RRC key and user plane key.

[0167] 5G networks support multiple encryption algorithms. When a terminal makes a registration request, it carries its own security capability information, such as the security algorithms it supports. The network side (AMF or RAN; AMF terminates NAS message encryption, and RAN terminates RRC signaling and user plane data encryption over the air interface) locally configures its supported security algorithm list and priorities. Based on the terminal's security capabilities and the network side's configured security algorithm priority list, the security algorithm to be negotiated between the terminal and the network side can be determined. After the network side determines the security protection algorithm to use, it sends the selected algorithm to the terminal during the security activation process. Therefore, the algorithm negotiation in 5G mobile communication networks is based on the security capabilities reported by the terminal and the network side's own capabilities, selecting a cryptographic algorithm that is supported by both sides and has the higher priority.

[0168] After deriving the corresponding key using the key derivation method described above, it can be used to protect the corresponding NAS, RRC, and user plane (UP) data. Specifically, this is divided into confidentiality and integrity protection. Confidentiality protection refers to encrypting the data and outputting ciphertext. If an attacker obtains the ciphertext, they cannot deduce the corresponding plaintext information. The encryption process of the NEA encryption algorithm for 5G communication networks defined by 3GPP is as follows: Figure 2 The diagram on the left shows that the input parameters include: key, count, bearer, direction, and length, and the output keystream is KEYSTREAM.

[0169] The definitions of the above parameters vary depending on the scenario, and this application does not impose any restrictions. For example, the specific definitions of each parameter when encrypting and protecting NAS messages in a 5G network are as follows: (1) BEARER: 5 bits, using the NAS connection identifier; (2) COUNT: 32 bits, uplink and downlink NAS COUNT values; (3) DIRECTION: 1 bit, 0 and 1, representing uplink and downlink; (4) LENGTH: the length of the plaintext (the length of the keystream required); (5) KEY: 128 bits, specific to the UE (per UE), from K AMF This is deduced. The BEARER input is the NAS connection identifier. The initial value of the NAS COUNT should be zero (0), and this count is incremented by one after each NAS message undergoes the aforementioned encryption and integrity protection processing.

[0170] Then, as Figure 2As shown, by XORing the output keystream block (KEYSTREAM BLOCK) with the plaintext (PLAINTEXTBLOCK), the corresponding ciphertext (CIPHERTEXT) can be output. Figure 2 The diagram on the right shows that the decryption process is similar to the encryption process described above. It involves inputting the keys KEY, COUNT, BEARER, DIRECTION, and LENGTH into the encryption algorithm NEA, outputting the key stream KEYSTREAM, and then XORing CIPHERTEXT with the key stream KEYSTREAM to output the corresponding plaintext PLAINTEXT.

[0171] Integrity protection of 5G communication networks as defined by 3GPP, such as Figure 3 The diagram on the left shows how the key KEY, COUNT, MESSAGE, DIRECTION, and BEARER are input into the Integrity Protection Algorithm (NIA), which outputs the corresponding message authentication code (MAC) value MAC-I or NAS-MAC. Integrity verification is as follows... Figure 3 The diagram on the right shows how the NIA (National Integrity Assurance Algorithm) uses the keys KEY, COUNT, MESSAGE, DIRECTION, and BEARER to calculate the MAC value and compares it with the received MAC value to determine if the calculated MAC value is equal. Figure 2 , Figure 3 As shown, the input parameters for confidentiality and integrity protection include: KEY, COUNT, DIRECTION, BEARER, and the corresponding message to be protected.

[0172] In the 5G network provision mechanism, 5G private networks include standalone non-public networks (SNPN) and public network integrated non-public networks (PNI-NPN). In these two security establishment methods, the private network is independent of the main network. Users access and register independently on the private network and perform authentication and security establishment.

[0173] For example, in SNPN, users complete the access and registration process independently. During registration, they select an authentication method and rely on an external authentication, authorization, and accounting (AAA) server for EAP authentication. After authentication, the user returns the authentication result and the generated key MSK to the NSSAAF network element. The NSSAAF network element then instructs the NSSAAF network element to provide the authentication result and key MSK. The AUSF network element then derives K from the key MSK. AUSF And relying on K AUSF Deducing the secure anchor key K for user and network side communication SEAF This leads to the derivation of the NAS message protection key. The process of the terminal independently authenticating for SNPN requires interaction with multiple network elements, making the process complex and involving a large amount of signaling.

[0174] For example, the security between PNI-NPN and the main network is independent. After a user successfully completes primary authentication on the main network, authentication on the PNI-NPN requires another primary authentication (also known as secondary authentication or slice-specific authentication) to establish PNI-NPN security. Terminals also have independent access and registration processes for PNI-NPN, requiring interaction with multiple network elements, resulting in a complex process and numerous signaling steps.

[0175] It is evident that current methods for establishing security on private networks involve independent authentication and security procedures compared to the main network, resulting in complex processes and numerous signaling steps. Therefore, how to achieve flexible, rapid, and efficient security establishment remains an issue that requires further research.

[0176] This application provides a communication method in which the main network can trigger the secure establishment of a subnet based on a service initiated by a terminal. After obtaining the NAS message protection key of the terminal, the subnet can implicitly or explicitly instruct the terminal to deduce its NAS message protection key within the subnet. This method establishes subnet security through the main network, optimizes the subnet authentication process, and enables more efficient, convenient, and flexible secure subnet establishment.

[0177] As subnet services continue to evolve, the demand for distributed subnets in future mobile communication networks has emerged, evolving from a comprehensive main network to customized distributed autonomous subnets for diverse scenarios. In distributed subnet scenarios for future mobile communication networks, for example, in distributed 2B private networks, control plane functions are flexibly deployed between headquarters and branches, enabling distributed autonomy. The relationship between some subnets and the main network may resemble that between headquarters and districts, or some subnets may simply be temporary networks providing specific services to users, without high-level security requirements or strict security isolation. Another example is distributed 2C subnets: scenarios such as influencer live-streaming parks, stadiums, and theme parks require multi-operator user access, connecting both the main network and subnets, necessitating local closed-loop policies. For scenarios like amusement parks and stadiums, there is no strong need for isolation between subnets and the main network; therefore, establishing subnet security through the main network can optimize the subnet authentication process.

[0178] This application provides a schematic diagram of a distributed subnet scenario, as shown below. Figure 4 As shown, the main network is a central network for sensing, IoT, positioning, authentication, contract signing, mobile management (MM), session management (SM), UP, and artificial intelligence (AI). Each subnet corresponds to a different private network scenario, such as industrial scenarios with high deterministic and positioning requirements, amusement park scenarios with extended reality (XR) immersive communication, and regional customized scenarios for sensing, IoT, positioning, MM, AI, or computing. Control plane functions are deployed in the central network and among the various subnets, enabling distributed autonomy.

[0179] This application provides a schematic diagram of a distributed subnet scenario, as shown below. Figure 5 As shown, a user may connect to both the main network and the subnet simultaneously through a wireless access network device. The user performs main network registration and obtains the subnet signaling routing policy. The wireless access network device determines the target network based on the routing information indicated by the user (such as N2 routing selection), performs signaling splitting between the main network and the subnet, avoids signaling detours, and reduces latency.

[0180] Figure 4 and Figure 5The distributed subnets and main network shown also involve security function network elements (or security functions, security function devices / entities) and service discovery function network elements. Among them, the security function network elements (or security functions, security function devices / entities) are dedicated network elements mainly used to perform functions such as user authentication method selection and user authentication, key deduction, and security context establishment. The signaling routing function (or signaling routing function network element / device / entity or signaling routing function node) is the entry and exit point for NAS signaling, connected to the base station, used to send signaling from the base station to the corresponding network element and to send NAS messages from the core network to the corresponding base station. The service discovery function network element is mainly used for dynamic topology routing management of large and small networks (such as the main network and subnets), capability discovery under the distributed anchor architecture, and interconnection with the subnet; it supports service discovery functions. In the embodiments of this application, the service discovery function network element can also be replaced with a network element discovery function network element or an NRF network element that supports service discovery functions.

[0181] This application applies to the architecture of future mobile communication network evolution. It does not limit the names of network elements, nor is the architecture limited to subnet scenarios; it may be applicable to scenarios involving multiple networks, and no restrictions are placed here. The functions of the 5G network elements involved in this application can be found in [reference needed]. Figure 1 The relevant content will not be elaborated here.

[0182] The embodiments of this application are described below with reference to the accompanying drawings.

[0183] Figure 6 This is a flowchart illustrating a communication method provided in an embodiment of this application. Figure 6 The communication method shown establishes a second network securely through a first network. Optionally, the first network is... Figure 4 The central network shown or Figure 5 The large network shown, the second network is Figure 4 or Figure 5 The subnets shown include, but are not limited to, the following: the first network includes devices, entities, or network elements such as a first signaling routing function, a first service discovery function, a mobility management function, a location management function, a security function, and a unified data management function; the second network includes devices, entities, or network elements such as a second signaling routing function, a second session management function, and a second service discovery function. The following description uses corresponding functional entities as examples. This communication method includes, but is not limited to, the following steps:

[0184] 001. The terminal sends a first session establishment request to the first network that has been registered and authenticated. The first session establishment request is used by the terminal to request the establishment of a session corresponding to the service associated with the second network.

[0185] in, Figure 6The following example illustrates the process: the session establishment request is sent by the terminal to the first signaling routing function entity in the first network through the access network device. Accordingly, the first signaling routing function entity receives the session establishment request.

[0186] In addition to the terminal's identification information, the session establishment request also includes at least one of the following: a session identifier for which the terminal requests to establish a session; the terminal's location information; or, service information corresponding to the session requested by the terminal. The service information includes at least one of the following: service identifier information, application identifier information, data network information, or slice information corresponding to the session.

[0187] 002. The first signaling routing function entity sends a service discovery request to the first service discovery function entity according to the first session establishment request, and the first service discovery function entity receives the service discovery request accordingly.

[0188] The service discovery request includes service information and terminal identification information obtained from the first session establishment request. Optionally, the service discovery request may also include the terminal's location information obtained from the first session establishment request.

[0189] If the terminal's location information is not included in the first session establishment request, the first service discovery function entity may obtain it from the location management function entity or mobility management function entity of the first network based on the terminal's identification information.

[0190] 003. The first service discovery entity selects a second network based on the service information and the terminal's location information in the service discovery request. The second network is a network capable of providing the service corresponding to the service information.

[0191] 004. The first service discovery function entity sends a service discovery response to the first signaling routing function entity, which includes the identification information of the second network.

[0192] The identification information of the second network includes at least one of the following: the identifier of the second signaling routing function entity of the second network, the IP address of the second signaling routing function entity of the second network, or the network identifier of the second network.

[0193] Accordingly, the second signaling routing function entity receives the service discovery response.

[0194] 005. The first signaling routing function entity sends a second session establishment request to the second network based on the identification information of the second network. The second session establishment request includes the identification information of the terminal.

[0195] Optionally, the second session establishment request may also include the session identifier and the terminal's location information obtained from the first session establishment request.

[0196] Figure 6 The following example illustrates the process of sending a second session establishment request from the first signaling routing function entity to the second signaling routing function entity.

[0197] In this embodiment of the application, the second signaling routing function entity of the second network requests information related to the NAS security context of the terminal in the second network, including but not limited to the following schemes one to three:

[0198] Option 1: The second signaling routing function entity requests information about the terminal's NAS security context in the second network from the security function entity, as described in steps 006a to 009a:

[0199] 006a. The second signaling routing function entity determines, based on the second session establishment request, that the terminal's NAS security context related information in the second network has not been saved, and executes step 007a; determines that the terminal's NAS security context related information in the second network has been saved, and executes step 010.

[0200] 007a. The second signaling routing function entity sends a security context request to the security function entity. This security context request requests information related to the NAS security context of the terminal in the second network, including the terminal's identification information. Accordingly, the security function entity receives the security context request.

[0201] Optionally, the security context request may also include identification information of the second network.

[0202] 008a. The security function entity obtains the terminal's security anchor key in the first network from the stored terminal's security context information based on the terminal's identification information in the security context request, and determines the terminal's NAS message protection key in the second network based on the terminal's security anchor key in the first network.

[0203] In one optional implementation, before obtaining the terminal's security anchor key from the stored security context information of the terminal in the security context request based on the terminal's identification information in the security context request, the security function entity also sends an authentication method request to the unified data management function entity. The authentication method request includes the terminal's identification information and the identification information of the second network. The security function entity receives the authentication method response, which includes first indication information, which is used to indicate that the terminal does not need to be authenticated in the second network.

[0204] Optionally, if the authentication method response includes first indication information to indicate the authentication method corresponding to the terminal in the second network, the security function entity may additionally trigger the terminal to perform independent authentication for the second network using the indicated authentication method.

[0205] As can be seen, this implementation takes into account the different security levels required between different subnets. For subnets with high security levels, such as those in industrial scenarios, it is still necessary to ensure that data does not leave the park. This can be achieved by requesting and responding to authentication methods, which can trigger the terminal to independently authenticate for access to the second network. For subnets that do not have a strong need for isolation between the subnet and the main network, the communication method provided in this application can be used to establish subnet security through the main network.

[0206] Optionally, the security function entity determines the NAS message protection key for the terminal in the second network based on the terminal's security anchor key in the first network. This includes: the security function entity determining the NAS message protection key for the terminal in the second network based on a count value and the terminal's security anchor key in the first network. The count value is the number of NAS message protection keys determined based on the terminal's security anchor key in the first network. The count value is obtained by the security function entity from the stored security context information of the terminal based on the terminal's identification information.

[0207] 009a. The security function entity sends a security context response to the second signaling routing function entity. The security context response includes information related to the NAS security context of the terminal in the second network. The information related to the NAS security context of the second network includes the NAS message protection key of the terminal in the second network. Accordingly, the second signaling routing function entity receives the security context response.

[0208] Optionally, the security context response may also include a first key identifier, wherein the first key identifier is the identifier corresponding to the security anchor key of the terminal in the first network.

[0209] The terminal's information related to the NAS security context in the second network also includes at least one of the following: the terminal's security capability information, which indicates the security protection algorithms supported by the terminal; or, a second key identifier, which is an identifier corresponding to the terminal's NAS message protection key in the second network.

[0210] Specifically, the second signaling routing function entity may request information about the terminal's NAS security context in the second network from the security function entity. Alternatively, the second signaling routing function entity may request information about the terminal's NAS security context in the second network from the security function entity in the first network via other function entities in the first network, such as the network capability open function entity. The security function entity may send a security context response to the second signaling routing function entity via other function entities in the first network, such as the network capability open function entity.

[0211] Option 2: The first signaling routing function entity requests information about the terminal's NAS security context in the second network from the security function entity, as described in steps 006b to 009b:

[0212] 006b. The first signaling routing function entity sends a security context request to the security function entity. This security context request requests information related to the NAS security context of the terminal in the second network, including the terminal's identification information. Accordingly, the security function entity receives the security context request.

[0213] The security context request also includes the identification information of the second network.

[0214] 007b. The security function entity obtains the terminal's security anchor key in the first network from the stored terminal's security context information based on the terminal's identification information in the security context request, and determines the terminal's NAS message protection key in the second network based on the terminal's security anchor key in the first network.

[0215] The optional implementation methods for this step can refer to the relevant content described in step 008a of Scheme 1, which will not be detailed here.

[0216] 008b. The security function entity sends a security context response to the first signaling routing function entity. The security context response includes information related to the NAS security context of the terminal in the second network. The information related to the NAS security context of the second network includes the NAS message protection key of the terminal in the second network. Accordingly, the first signaling routing function entity receives the security context response.

[0217] The optional implementation of the security context response and the terminal's NAS security context related information in the second network can refer to the relevant content described in step 009a of Scheme 1, and will not be described in detail here.

[0218] 009b. The first signaling routing function entity sends information about the NAS security context of the terminal in the second network to the second signaling routing function entity. Correspondingly, the second signaling routing function entity receives the NAS security context information of the terminal in the second network.

[0219] In addition, the first signaling routing function entity also sends a first key identifier to the second signaling routing function entity, wherein the first key identifier is the identifier corresponding to the security anchor key of the terminal in the first network.

[0220] Optionally, the second session establishment request in step 005 may be sent in a single message along with information related to the NAS security context of the terminal in the second network. Correspondingly, the first signaling routing function entity may execute step 006b after step 004.

[0221] In one possible implementation of this scheme two, before the first signaling routing function entity executes step 006b, the method further includes: the second signaling routing function entity sending a request to the first signaling routing function entity for information related to the NAS security context of the terminal in the second network. That is, the second signaling routing function entity requests information related to the NAS security context of the terminal in the second network from the first signaling routing function entity in the first network; after the security function entity sends a security context response to the first signaling routing function entity, the first signaling routing function entity forwards the information related to the NAS security context of the terminal in the second network from the security context response to the second signaling routing function entity.

[0222] In another possible implementation of this scheme 2, before step 006b, the second signaling routing function entity does not initiate a security context request to the first network, but instead receives information related to the NAS security context of the second network actively sent by the first signaling routing function entity in step 009b.

[0223] Option 3: The second signaling routing function entity requests information about the terminal's NAS security context in the second network from the first signaling routing function entity, as shown in steps 006c to 009c:

[0224] 006c. The second signaling routing function entity determines, based on the second session establishment request, that the terminal's NAS security context related information in the second network has not been saved, and executes step 007c; determines that the terminal's NAS security context related information in the second network has been saved, and executes step 010.

[0225] 007c. The second signaling routing function entity sends a security context request to the first signaling routing function entity. This security context request requests information related to the NAS security context of the terminal in the second network, including the terminal's identification information. Correspondingly, the second signaling routing function entity receives the security context request.

[0226] Optionally, the security context request may also include identification information of the second network.

[0227] 008c. The first signaling routing function entity determines the NAS security context related information of the terminal in the second network based on the NAS security context information of the terminal in the first network.

[0228] The NAS security context information of the terminal in the first network includes the NAS message protection key of the terminal in the first network. The NAS security context information of the terminal in the second network includes the NAS message protection key of the terminal in the second network.

[0229] Optionally, before step 008c, the first signaling routing function entity also obtains the NAS security context information of the terminal in the first network based on the terminal's identification information in the security context request.

[0230] In one optional implementation, step 008c includes: a first signaling routing function entity determining the NAS message protection key of the terminal in the second network based on the identification information of the second network and the NAS message protection key of the terminal in the first network.

[0231] In another optional implementation, the NAS security context information of the terminal in the first network further includes a count value, which is the number of NAS message protection keys determined by the terminal based on the NAS security context information of the terminal in the first network. Step 008c includes: the first signaling routing function entity determining the NAS message protection key of the terminal in the second network based on the count value and the NAS message protection key of the terminal in the first network.

[0232] It should be noted that the count value (which can be referred to as the first count value) included in the security context information of the terminal in the security function network element of Scheme 1 and 2 is different from the count value (which can be referred to as the second count value) included in the NAS security context information of the terminal in the first network in the first signaling routing function entity of Scheme 3. The first count value is the number of NAS message protection keys determined by the terminal based on the security anchor key of the terminal in the first network, and the second count value is the number of NAS message protection keys determined by the terminal based on the NAS message protection key of the terminal in the first network.

[0233] In one optional implementation, the security context request further includes identification information of the second network and identification information of the terminal. Before determining the information related to the NAS security context of the terminal in the second network based on the NAS security context information of the terminal in the first network, the first signaling routing function entity also sends an authentication method request to the unified data management function entity. The authentication method request includes the identification information of the terminal and the identification information of the second network. The first signaling routing function entity receives the authentication method response, which includes first indication information. The first indication information is used to indicate that the terminal does not need to be authenticated in the second network.

[0234] Optionally, if the authentication method response includes first indication information to indicate the authentication method corresponding to the terminal in the second network, the first signaling routing function entity may additionally trigger the terminal to perform independent authentication for the second network using the indicated authentication method.

[0235] As can be seen, this implementation takes into account the different security levels required between different subnets. For subnets with high security levels, such as those in industrial scenarios, it is still necessary to ensure that data does not leave the park. This can be achieved by requesting and responding to authentication methods, which can trigger the terminal to independently authenticate for access to the second network. For subnets that do not have a strong need for isolation between the subnet and the main network, the communication method provided in this application can be used to establish subnet security through the main network.

[0236] 009c. The first signaling routing function entity sends a security context response to the second signaling routing function entity. The security context response includes information related to the NAS security context of the terminal in the second network. The information related to the NAS security context of the terminal in the second network includes the NAS message protection key of the terminal in the second network. Accordingly, the second signaling routing function entity receives the security context response.

[0237] The security context response also includes a first key identifier, which is the identifier corresponding to the NAS message protection key of the terminal in the first network.

[0238] The information related to the security context of the terminal in the second network also includes the relevant content described in step 009a of Scheme 1, which will not be detailed here.

[0239] Optionally, after the second signaling routing function entity receives the security context response through steps 009a of scheme one and step 009c of scheme three, or after the second signaling routing function entity receives the information related to the NAS security context of the terminal in the second network through step 009b of scheme two, it further performs the following steps to perform service discovery and establish a session for the terminal:

[0240] The second signaling routing function entity sends a service discovery request to the second service discovery function network element of the second network; the second service discovery function network element returns a service discovery response, wherein the service discovery response includes the identification information of the second session management function entity of the second network; the second signaling routing function entity sends a session establishment request to the second session management function entity according to the identification information of the second session management function entity, the session establishment request including a session identifier, the terminal's identification information, and the terminal's location information (optional); the second session management function entity establishes user plane resources for the session of the terminal according to the session establishment request, and returns a session establishment response. Then, step 010 is executed.

[0241] In addition, the second signaling routing function entity also assigns a temporary identifier to the terminal; selects a subsequent NAS message protection algorithm based on the terminal's security capability information and locally supported security algorithms; and derives a confidentiality protection key and an integrity protection key based on the terminal's NAS message protection key in the second network. The confidentiality protection key and the integrity protection key are used to protect the NAS messages sent to the terminal by the second signaling routing function entity.

[0242] 010. The second signaling routing function entity sends a session establishment response to the terminal. This session establishment response includes a first key identifier, which corresponds to the terminal's security anchor key in the first network and is used by the terminal to determine the NAS message protection key in the second network. Accordingly, the terminal receives this session establishment response.

[0243] The session establishment response may also include the identification information of the second network, or a temporary identifier assigned to the terminal by the second network. If the session establishment response includes a temporary identifier assigned to the terminal by the second network, the terminal can determine the identification information of the second network from this temporary identifier.

[0244] Optionally, the session establishment response may also include at least one of the following: a second key identifier, which is a key identifier corresponding to the NAS message protection key of the terminal in the second network; indication information, which instructs the terminal to obtain the NAS message protection key in the second network; or, the NAS message protection algorithm of the terminal in the second network.

[0245] The terminal can determine the NAS message protection key of the terminal in the second network based on at least one of the identification information of the second network, the second key identification, or the indication information, and then execute step 011.

[0246] 011. The terminal determines the NAS message protection key in the second network based on the key corresponding to the first key identifier.

[0247] In one optional implementation, for Scheme 1 and Scheme 2, step 011 includes: the terminal determines the NAS message protection key of the terminal in the second network based on the security anchor key of the terminal in the first network corresponding to the first key identifier.

[0248] Optionally, the terminal determines its NAS message protection key in the second network based on at least one of the identification information or count value of the second network, and the terminal's security anchor key in the first network corresponding to the first key identifier. The count value is the number of NAS message protection keys determined based on the terminal's security anchor key in the first network.

[0249] In another optional implementation, for scheme three, step 011 includes: the terminal determines the NAS message protection key of the terminal in the second network based on the NAS message protection key of the terminal in the first network corresponding to the first key identifier.

[0250] In an optional implementation, the method further includes: the terminal receiving a message authentication code (MAC) value in step 010; determining an integrity protection key using the terminal's NAS message protection key in the second network; the terminal using the integrity protection key to verify the MAC value of the session establishment response message; if the verification passes, the NAS message protection key is used to protect the NAS messages in the second network; if the MAC value verification passes, encryption and integrity protection of NAS messages between the second network and the terminal are enabled. Optionally, the MAC value and the session establishment response message can be carried in the same message.

[0251] As can be seen, in this method, the terminal can access the second network by sending a session establishment request to the first network without needing to perform separate authentication and registration for the second network. Furthermore, by obtaining the first key identifier from the session establishment response from the second network and determining the terminal's NAS message protection key on the second network based on the key corresponding to the first key identifier, the terminal not only establishes a session on the second network but also uses its NAS message protection key on the second network to protect NAS messages, thus achieving secure establishment of the second network. Therefore, this method achieves flexible, fast, and efficient network security establishment.

[0252] Furthermore, this method supports authentication methods for terminals in different subnets. For example, it supports authentication methods where the subnet needs to be isolated from the main network and complete independent authentication and security establishment. It also supports subnets with lower security requirements, where the communication method described in this application can be used, with the main network deducing information related to the NAS security context of the terminal in the subnet. This makes subnet security establishment more efficient, convenient, flexible, and compatible with subnet security requirements, preventing data leakage in high-security subnets.

[0253] In the embodiments of this application, Figure 6 In the communication method described, the first network is the main network, and the second network can be multiple subnets, such as subnet 1 and subnet 2. Scheme 1 and Scheme 2 can be adopted. Figure 7 The security architecture shown derives the NAS message protection key (e.g., KNAS1) for the terminal in the main network, the NAS message protection key (e.g., KNAS2) for subnet 1, and the NAS message protection key (e.g., KNAS3) for subnet 2 from the terminal's main network security anchor key (e.g., KAUSF). Figure 7As shown, the big data network can further deduce the confidentiality protection key K based on the big data network's KNAS1. NAS1int and integrity protection key K NAS1enc Subnet 1 derives the confidentiality protection key K based on KNAS2 of subnet 1. NAS2int and integrity protection key K NAS2enc Subnet 2 derives the confidentiality protection key K based on KNAS3 of subnet 2. NAS3int and integrity protection key K NAS3enc .

[0254] Option 3 can be adopted Figure 8 The security architecture shown derives the NAS message protection key for the terminal on the subnet from the NAS message protection key on the main network. For example... Figure 8 As shown, the security function network element deduces the NAS message protection key KNAS1 of the terminal in the main network based on the terminal's security anchor key in the main network. The main network then deduces the NAS message protection key KNAS2 of subnet 1 based on the terminal's KNAS1 in the main network, and deduces the NAS message protection key KNAS3 of subnet 2 based on the terminal's KNAS1 in the main network. Figure 8 The confidentiality protection key and integrity protection key shown are... Figure 7 The deduction method is similar and will not be described in detail here.

[0255] Figure 9 This is a flowchart illustrating another communication method provided in this application embodiment. The communication method takes a first network as the main network and a second network as subnet 1. The signaling routing function entity of the main network is denoted as signaling routing function network element 1, the signaling routing function entity of subnet 1 is denoted as signaling routing function network element 2, the service discovery function entity of the main network is denoted as service discovery function network element 1, the unified data management entity is denoted as unified data management network element, the service discovery function entity of subnet 1 is denoted as service discovery function network element 2, and the session management function entity of subnet 1 is denoted as session management function network element 2.

[0256] Safety function entities can adopt Figure 7 The security architecture shown determines the NAS message protection key for the terminal in subnet 1 based on the security anchor key of the main network. The following description uses a security function network element as an example. Additionally, Figure 9 In the communication method shown, the terminal can first register and authenticate with the main network, and then, based on the service initiated by the terminal, perform network security establishment for the subnet. For example... Figure 9 As shown, the communication method may include, but is not limited to, the following steps:

[0257] 101. The terminal sends a registration request to the signaling routing function network element 1 of the main network, and the corresponding signaling function network element 1 receives the registration request.

[0258] The registration request is used to request registration within the larger network. This registration request includes the terminal's identification information, which is a privacy-protected identity identifier, such as a subscription concealed identifier (SUCI). The terminal can also send its security capability information (denoted as UE securitycapability) to the signaling routing function network element 1. This security capability information indicates the security protection algorithms supported by the terminal.

[0259] Optionally, step 101 includes: 101-1. The terminal sends an access network message (AN message) to the access network device, the access network message including the registration request; 101-2. After receiving the access network message, the access network device sends an N2 message (N2 message) to the signaling routing function network element 1 of the main network, the N2 message including the registration request, the registration request in the N2 message including the terminal's identification information and security capability information. In addition, the N2 message also includes some N2 parameters.

[0260] 102. Signaling routing function network element 1 performs service discovery with service discovery function network element 1 of the main network to obtain relevant information of mobility management (MM) function network element.

[0261] Among them, MM network elements can discover corresponding UDM network element and security function network element instances.

[0262] Specifically, step 102 may include: 102-1. The signaling routing function network element 1 sends a service discovery request to the service discovery function network element 1 of the main network, and the service discovery function network element 1 receives the service discovery request; 102-2. The service discovery function network element 1 returns relevant information of the mobility management function network element to the signaling routing function network element 1.

[0263] Among them, MM network elements can discover corresponding UDM network element and security function network element instances.

[0264] 103. An authentication process is conducted between the terminal and the main network. The terminal and security function network elements derive the security anchor key of the main network, negotiate the security protection algorithm, and establish network security.

[0265] In step 103, the terminal's security capability information also needs to be sent to the security function network element. Optionally, this security capability information can be directly sent to the security function network element by the signaling routing function network element 1; or, as... Figure 9 As shown, the security capability information can be sent from the signaling routing function network element 1 to the UDM network element, and then from the UDM network element to the security function network element.

[0266] 104. The security function network element maintains a count value for NAS key derivation for each terminal, saves the terminal's security capability information, and derives the terminal's NAS message protection key (KNAS1) for the large network based on the terminal's security anchor key in the large network.

[0267] In one optional implementation, the security function network element derives the NAS message protection key of the terminal in the main network based on the terminal's security anchor key in the main network, including: the security function network element obtaining a count value NASKey COUNT, wherein the count value NASKey COUNT is the number of NAS message protection keys determined based on the terminal's security anchor key in the main network; and the security function network element determining the terminal's NAS message protection key in the main network based on the count value NASKey COUNT and the terminal's security anchor key in the main network.

[0268] In another optional implementation, the security function network element derives the NAS message protection key of the terminal in the main network based on the terminal's security anchor key in the main network. This includes: the security function network element determining the NAS message protection key of the terminal in the main network based on a count value, the terminal's security anchor key in the main network, and at least one of "the terminal's identifier and the identifier of the terminal's home network".

[0269] The counter value NASKey COUNT is initialized when the security anchor key is derived, and its initial value is 0. Then, each time the security anchor key is used to derive the NAS message protection key, the counter value NASKeyCOUNT is incremented by one.

[0270] For example, the determination or deduction process in step 104 can be represented as:

[0271] KNAS1 = KDF(KAUTH, NASKey COUNT); or,

[0272] KNAS1 = KDF(KAUTH, NASKey COUNT, HPLMN ID); or,

[0273] KNAS1=KDF(KAUTH, UE ID, NASKey COUNT, HPLMN ID).

[0274] Wherein, KNAS1 is the NAS message protection key of the terminal in the main network; KDF() is the key derivation function; KAUTH is the security anchor key of the terminal in the main network; UE ID is the identifier of the terminal; NASKey COUNT is the number of NAS message protection keys derived based on the security anchor key of the terminal in the main network; and home public landmobile network identifier (HPLMN ID) is the identification information of the terminal's home network.

[0275] After completing the above key deduction, the security function network element increments the NASKey COUNT value maintained for the terminal by one, i.e., NASKey COUNT = NASKey COUNT + 1.

[0276] Optionally, signaling routing function 1 assigns a temporary identifier (denoted as UE Temp ID 1) to the terminal within the main network. This temporary identifier may be determined based on the network identifier of signaling routing function network element 1, the identifier of signaling routing function network element 1, or a random number assigned to the terminal by signaling routing function network element 1 that is different from other terminals. Alternatively, the temporary identifier may also be determined based on the identifier of signaling routing function network element 1 and a random number assigned to the terminal by signaling routing function network element 1 that is different from other terminals.

[0277] For example, if the network identifier of signaling routing function element 1 is PLMN ID1, the identifier of signaling routing function element 1 is NF ID1, and the random number assigned to the terminal by signaling routing function element 1, which is different from other terminals, is Rand1, then the temporary identifier of the terminal can be: UE Temp ID 1 = PLMN ID1 + NF ID1 + Rand1, or UE Temp ID 1 = NFID1 + Rand1. Here, "+" indicates concatenation; for example, NF ID1 and Rand1 are concatenated to obtain UE Temp ID 1.

[0278] 105. The terminal establishes a session with the network using Protocol Data Unit Session Identifier 1 (marked as PDU session ID 1) and uses KNAS1 to protect NAS messages.

[0279] For example, at a certain moment, if a terminal wants to initiate a session (marked as PDU session ID 2) corresponding to a specific service in a subnet (such as subnet 1), it performs the following steps, including but not limited to:

[0280] 106. The terminal sends a session establishment request to the main network, and the corresponding signaling routing function network element 1 of the main network receives the session establishment request.

[0281] The session establishment request is used by the terminal to request the establishment of a session. The session establishment request (PDU session request) includes the session identifier (such as PDU session ID2) of the terminal request to establish a session, the terminal's location information (optional), and the service information corresponding to the terminal request to establish a session.

[0282] The service information may include at least one of the following: service identification information, application identification information, data network information, or slice information corresponding to the session.

[0283] In an optional implementation, if the session establishment request does not carry the terminal's location information, the signaling routing function network element 1 may request the terminal's location information from the LMF network element or the MM network element 1, such as... Figure 9 As shown: 107-1. Signaling routing function network element 1 sends a terminal location request to LMF network element or MM network element 1, which may carry the terminal's identification information; 107-2. Signaling routing function network element 1 receives a terminal location response from LMF network element or MM network element 1, which carries the terminal's location information.

[0284] 108. Signaling routing function network element 1 sends a service discovery request to the service discovery function network element 1 of the main network, and correspondingly, the service discovery function network element 1 receives the service discovery request.

[0285] The service discovery request includes service information and terminal identification information (such as SUPI). Alternatively, the service discovery request includes service information, terminal identification information, and location information (denoted as UE location).

[0286] Optionally, before executing step 108, the signaling routing function network element 1 may also perform security verification and decryption on the session establishment request. Additionally, if the signaling routing function network element 1 determines, based on the service information carried in the session establishment request, that the main network cannot provide the service corresponding to that service information, it will execute step 108. Optionally, the service discovery request may directly carry the decrypted session establishment request.

[0287] In one possible implementation, the signaling routing function network element 1 stores information about the services or services that its corresponding main network can provide. Based on the service information in the session establishment request, the signaling routing function network element 1 determines that the main network cannot provide the service corresponding to that service information. This can include: the signaling routing function network element 1 matching or comparing the information about the services or services that the main network can provide with the service information in the session establishment request; if the service information is not found in the information about the services or services that the main network can provide, then it is determined that the main network cannot provide the service corresponding to that service information.

[0288] In addition, if the signaling routing function network element 1 contains the service information in the information of the services or services that the large network can provide, it can determine that the large network can provide the service corresponding to the service information.

[0289] 109. Service discovery function: Network element 1 performs subnet discovery based on the received service discovery request and selects subnet 1 that can provide the corresponding service or session establishment service.

[0290] In one possible implementation, signaling routing function network element 1 determines that the main network cannot provide the service corresponding to the service information. Therefore, the service discovery request can carry implicit or explicit indications to inform service discovery function network element 1 that the main network cannot provide the service corresponding to the service information, or to inform service discovery function network element 1 that subnet discovery is required. For example, by carrying the subnet discovery service name in the service discovery request, it implicitly indicates that service discovery function network element 1 cannot provide the service corresponding to the service information.

[0291] In another possible implementation, after receiving a service discovery request, service discovery function network element 1 determines whether the main network can provide the service corresponding to the service information. For example, service discovery function network element 1 stores information about the services or services that its corresponding main network can provide. By matching or comparing this information with the service information in the service discovery request, if the service information is not found in its own information, it is determined that the main network cannot provide the service corresponding to the service information.

[0292] In addition, if the service discovery function network element 1 has the service information in its corresponding information, it can determine that the main network can provide the service corresponding to the service information.

[0293] In one possible implementation, the service discovery function network element 1 stores the correspondence between various service information, location information, and subnet identification information. Thus, the service discovery function network element 1 performs subnet discovery by: querying the corresponding subnet identification information from the stored correspondence based on the service information and terminal identification information in the service discovery request, or based on the service information, terminal identification information, and location information in the service discovery request.

[0294] Specifically, the service discovery function network element 1 determines, based on parameters in the received service discovery request, such as service information, terminal identification information, and location information, that the main network cannot provide the service corresponding to the service information (or cannot provide the corresponding session establishment service). Optionally, if the service discovery request does not carry the terminal's location information, the service discovery function network element may request the terminal's location information from the LMF network element or the MM function network element.

[0295] 110. Service discovery function network element 1 returns a service discovery response to signaling routing function network element 1.

[0296] The service discovery response includes identification information for subnet 1, such as, but not limited to, at least one of the following: the identifier of signaling routing function network element 2 of subnet 1, the IP address of signaling routing function network element 2 of subnet 1, and the network identifier of subnet 1.

[0297] In one possible implementation, service discovery function network element 1 determines the identifier of signaling routing function network element 2 of subnet 1 based on the correspondence between the subnet identifier stored locally and the identifier of the signaling routing function network element providing services to the subnet, as well as the identifier information of subnet 1 returned in the service discovery response in step 109. In another possible implementation, service discovery function network element 1 determines the IP address of signaling routing function network element 2 of subnet 1 based on the correspondence between the subnet identifier stored locally and the IP address of the signaling routing function network element providing services to the subnet, as well as the identifier information of subnet 1 returned in the service discovery response in step 109.

[0298] 111. The signaling routing function network element 1 sends a session establishment request to subnet 1 based on the identification information of subnet 1 in the service discovery response; correspondingly, subnet 1 receives the session establishment request.

[0299] In one possible implementation, the identification information of subnet 1 in the service discovery response is the identifier of signaling routing function element 2 of subnet 1. Then, signaling routing function element 1 can determine the address of signaling routing function element 2 corresponding to its identifier based on its stored mapping between identifiers and addresses of various signaling routing function elements. Furthermore, sending a session establishment request from signaling routing function element 1 to subnet 1 includes: signaling routing function element 1 sending a session establishment request to signaling routing function element 2 based on its address. Correspondingly, signaling routing function element 2 receives the session establishment request.

[0300] In another possible implementation, the identification information for subnet 1 in the service discovery response is the network identifier of subnet 1. Then, signaling routing function element 1 can determine the address of signaling routing function element 2 corresponding to the network identifier of subnet 1 based on its stored mapping between network identifiers and addresses for each subnet. Subsequently, signaling routing function element 1 sends a session establishment request to signaling routing function element 2 based on the address of signaling routing function element 2.

[0301] In another possible implementation, the identification information of subnet 1 in the service discovery response is the identifier of signaling routing function network element 2 of subnet 1. Then, signaling routing function network element 1 sends a session establishment request to signaling routing function network element 2 based on the address of signaling routing function network element 2.

[0302] like Figure 9 Taking the example of a session establishment request being sent from signaling routing function network element 1 to signaling routing function network element 2 of subnet 1. Optionally, in step 111, information between the main network and subnet 1 can be forwarded through network capability open function network elements, or it can be sent through the established Internet Protocol Security (IPsec) channel, that is, assuming that security has been established between signaling routing function network element 1 and signaling routing function network element 2.

[0303] The session establishment request may include the terminal's identification information, or it may include both the terminal's identification information and location information. Optionally, if the terminal's location information is not included in the session establishment request, the signaling routing function network element 2 may request the terminal's location information from the LMF network element or the MM function network element. The session establishment request may also include a session identifier (abbreviated as ID2).

[0304] Optionally, the session establishment request in step 111 can be the same as the session establishment request in step 106. In step 111, the signaling routing function network element 1 can forward the session establishment request to subnet 1.

[0305] For example, the session establishment request can be represented as PDU session request(ID2, SUPI, UE location).

[0306] 112. The signaling routing function network element 2 determines, based on the session establishment request, that the terminal has not saved information related to the NAS security context of the NAS in subnet 1.

[0307] For example, the signaling routing function network element 2 queries whether the terminal's NAS security context related information in the session establishment request has been stored based on the terminal's identification information; if the terminal's NAS security context related information in the subnet 1 has not been stored, step 113 is executed; if the terminal's NAS security context related information in the subnet 1 has been stored, step 116 is executed.

[0308] 113. Signaling routing function network element 2 sends a security context request to the security function network element, and the corresponding security function network element receives the security context request.

[0309] The security context request is used to request information related to the NAS security context of the terminal in subnet 1. The security context request includes the terminal's identification information. Optionally, the security context request may also include the identification information of subnet 1 or the session identifier of the session.

[0310] 114. The security function network element determines the security context information of the terminal based on the terminal's identification information in the security context request, and determines whether there is information related to the NAS security context of subnet 1; if it is determined that there is information related to the NAS security context of subnet 1, step 116 is executed; if it is determined that there is no information related to the NAS security context of subnet 1, step 115 is executed.

[0311] In one scenario, the security context request carries the identification information of subnet 1; in another scenario, the security context request does not carry the identification information of subnet 1, and the security function network element determines the identification information of subnet 1 corresponding to the sender of the security context request (i.e., signaling routing function 2).

[0312] In one possible implementation, step 114 includes: the security function network element stores the identification information of each terminal and the corresponding security context information; the security function network element queries the security context information of the terminal corresponding to the identification information of the terminal in the security context request; the security function network element queries whether the security context information of the terminal includes NAS security context related information corresponding to the identification information of subnet 1; if the security context information of the terminal includes NAS security context related information corresponding to the identification information of subnet 1, step 116 is executed; if the security context information of the terminal does not include NAS security context related information corresponding to the identification information of subnet 1, step 115 is executed.

[0313] 115. The security function network element obtains the terminal's security anchor key in the main network from the terminal's security context information; based on the security anchor key, the security function network element determines the terminal's NAS message protection key in subnet 1.

[0314] In addition to obtaining the security anchor key from the terminal's security context information, the security function network element also obtains a count value (NASKey COUNT) from the terminal's security context information. The count value (NASKey COUNT) is the number of NAS message protection keys (NASKeys) determined based on the terminal's security anchor key in the main network.

[0315] In one optional implementation, the security function network element determines the NAS message protection key KNAS2 of the terminal in subnet 1 based on the security anchor key, including: the security function network element determines the NAS message protection key KNAS2 of the terminal in subnet 1 based on the count value and the terminal's security anchor key in the main network.

[0316] Among them, the security function network element obtains the identification information of subnet 1 from the security context request, or determines the identification information of subnet 1 according to the sender of the security context request (i.e., signaling routing function 2).

[0317] In another optional implementation, the security function network element determines the NAS message protection key KNAS2 of the terminal in subnet 1 based on the security anchor key, including: the security function network element determines the NAS message protection key KNAS2 of the terminal in subnet 1 based on the identification information and count value of subnet 1 and the security anchor key of the terminal in the main network.

[0318] For example, the process of determining or deducing the NAS message protection key KNAS2 for the terminal in subnet 1 can be represented as:

[0319] KNAS2 = KDF(KAUTH, NASKey COUNT); or,

[0320] KNAS2 = KDF(KAUTH, identification information for subnet 1, NASKey COUNT); or,

[0321] KNAS2 = KDF(KAUTH, UE ID, NASKey COUNT, identification information of subnet 1).

[0322] Wherein, KNAS2 is the NAS message protection key of the terminal in subnet 1; KDF() is the key derivation function; KAUTH represents the security anchor key of the terminal in the main network; UE ID is the identifier of the terminal; the identification information of subnet 1 can be the identifier of subnet 1, the identifier of signaling routing function network element 2, or IP address, or session identifier ID2; NASKey COUNT is the number of NAS message protection keys (NASKey) derived based on the security anchor key of the terminal in the main network.

[0323] After completing the above key deduction, the security function network element increments the NASKey COUNT value maintained for the terminal by one, i.e., NASKey COUNT = NASKey COUNT + 1.

[0324] 116. The security function network element sends a security context response to the signaling routing function network element 2 of subnet 1. The security context response includes information related to the NAS security context of the terminal in subnet 1. The information related to the NAS security context of subnet 1 includes the NAS message protection key KNAS2 of the terminal in subnet 1. Correspondingly, the signaling routing function network element 2 of subnet 1 receives the security context response.

[0325] Among them, the information related to the NAS security context of the terminal in subnet 1 includes not only KNAS2, but also the terminal's identification information (such as SUPI).

[0326] Optionally, the security context response may also include a first key identifier (denoted as ngKSI1), which is the identifier corresponding to the terminal's security anchor key in the main network. Optionally, in addition to KNAS2, the NAS security context-related information of the terminal in subnet 1 may also include at least one of the following: the terminal's security capability information (denoted as UEsecurity capability), which indicates the security protection algorithms supported by the terminal; or, a second key identifier (denoted as ngKSI-KNAS2), which is the identifier corresponding to the NAS message protection key KNAS2 of the terminal in subnet 1.

[0327] 117. The signaling routing function network element 2 performs service discovery with the service discovery function network element 2 of subnet 1, and interacts with the corresponding session management function network element 2 to establish a PDU session for the terminal.

[0328] For example, step 117 may include the following steps: 117a. Signaling routing function network element 2 sends a service discovery request to service discovery function network element 2 of subnet 1; 117b. Service discovery function network element 2 returns a service discovery response, wherein the service discovery response includes the identification information of session management function network element 2; 117c. Signaling routing function network element 2 sends a session establishment request (PDU session request) to session management function network element 2 according to the identification information of session management function network element 2, wherein the session establishment request includes the session identifier corresponding to subnet 1, the terminal identification information, and the terminal location information (optional); 117d. Session management function network element 2 returns a session establishment response (PDU session response).

[0329] 118. Signaling routing function network element 2 assigns a temporary identifier to the terminal in subnet 1; selects the subsequent NAS message protection algorithm (denoted as selected NAS algorithms) based on the terminal's security capability information and locally supported security algorithms; and derives the confidentiality protection key and integrity protection key based on the terminal's NAS message protection key in subnet 1.

[0330] In this embodiment of the application, the execution order of steps 117 and 118 is not limited. For example, step 118 can be executed first, followed by step 117.

[0331] Optionally, the signaling routing function network element 2 assigns a temporary identifier (denoted as UE TempID 2) to the terminal in subnet 1. The temporary identifier may be determined based on the network identifier of the signaling routing function network element 2, the identifier of the signaling routing function network element 2, and a random number assigned to the terminal by the signaling routing function network element 2 that is different from other terminals; or, the temporary identifier may also be determined based on the identifier of the signaling routing function network element 2 and a random number assigned to the terminal by the signaling routing function network element 2 that is different from other terminals.

[0332] For example, if the identifier of the network where the signaling routing function network element 2 is located is PLMN ID2, the identifier of the signaling routing function network element 2 is NF ID2, and the random number assigned to the terminal by the signaling routing function network element 2, which is different from other terminals, is Rand2, then the temporary identifier of the terminal can be: UE Temp ID 2 = PLMN ID2 + NF ID2 + Rand2, or UE Temp ID 2 = NF ID2 + Rand2.

[0333] Here, "+" indicates that the identifier of the signaling routing function network element 2 is concatenated with the temporary identifier of the terminal.

[0334] In step 118, the signaling routing function network element 2 selects the subsequent NAS message protection algorithm based on the terminal's security capability information and the locally supported security algorithms. Possible implementation methods can refer to, but are not limited to, the relevant content on the security algorithms used in the terminal and network side communication negotiation in the 5G network mentioned above, which will not be detailed here.

[0335] In step 118, the signaling routing function network element 2 derives the confidentiality protection key and the integrity protection key based on the NAS message protection key of the terminal in subnet 1. Possible implementation methods can refer to, but are not limited to, the relevant content on confidentiality protection and integrity protection in 5G networks mentioned above, as well as the aforementioned... Figure 7 , Figure 8 The details regarding the derivation of confidentiality protection keys and integrity protection keys will not be elaborated here.

[0336] Among them, the confidentiality protection key and the integrity protection key derived from the NAS message protection key of the terminal in subnet 1 are used to protect the NAS messages sent to the terminal by the signaling routing function network element 2.

[0337] 119. The signaling routing function network element 2 sends a session establishment response to the terminal, which includes the first key identifier ngKSI; correspondingly, the terminal receives the session establishment response.

[0338] Specifically, the first key identifier sent by signaling routing function network element 2 to the terminal is the key identifier corresponding to the terminal's security anchor key in the main network. This first key identifier can be obtained from the security context response from the security function network element. Specifically, this first key identifier is stored in the terminal's security context information. The first key identifier is used by the terminal in step 120 to determine the corresponding main network security anchor key, and thus determine the terminal's NAS message protection key in subnet 1.

[0339] In one possible implementation, the session establishment response may further include at least one of the following: identification information of subnet 1, temporary identifier assigned to the terminal by subnet 1, second key identifier, indication information, or NAS message protection algorithm of the terminal in subnet 1.

[0340] The identification information of subnet 1 is carried by signaling routing function network element 2 from the session establishment request from signaling routing function network element 1, or it is obtained by itself. The identification information of subnet 1 is used by the terminal to know that it needs to deduce and deduce the NAS message protection key in subnet 1.

[0341] The temporary identifier assigned to the terminal by subnet 1 is assigned by the signaling routing function network element 2. It is used by the terminal to determine the identification information of subnet 1, thereby enabling the terminal to know the NAS message protection key that needs to be deduced and deduced in subnet 1.

[0342] The second key identifier is the key identifier corresponding to the NAS message protection key of the terminal in subnet 1. It is obtained by the signaling routing function network element 2 from the NAS security context related information received in subnet 1, and is used by the terminal to know that it needs to deduce the NAS message protection key in subnet 1.

[0343] The indication information is sent to the terminal by the signaling routing function network element 2, and is used to explicitly instruct the terminal to deduce the NAS message protection key in subnet 1. For example, the indication information is a 1-bit indication. When the indication bit is 1, the terminal can determine that a new NAS message protection key needs to be deduced. When the indication bit is 0, the terminal can determine that a new NAS message protection key does not need to be deduced.

[0344] The NAS message protection algorithm for the terminal in subnet 1 is selected by the signaling routing function network element 2 based on the terminal's security capability information and locally supported security algorithms. The terminal protects subsequent NAS messages between the terminal and subnet 1 according to the NAS message protection key in subnet 1 determined in step 120 and the NAS message protection algorithm.

[0345] Optionally, in step 119, the signaling routing function network element 2 also uses the integrity protection key corresponding to the NAS message protection key of the terminal in subnet 1 to calculate the MAC value (denoted as MAC-I) of the session establishment response message, and sends it to the terminal together with the session establishment response.

[0346] Optionally, the session establishment response may also include a PDU session establishment acceptance indication to inform the terminal that the network side accepts the session establishment request corresponding to the service of subnet 1 sent by the terminal.

[0347] Example 1: The session establishment response includes the session identifier (PDU session ID2), PDU session establishment acceptance indication (PDU Session Session Establishment Accept), temporary identifier, first key identifier (ngKSI), subsequent NAS message protection algorithms (selected NAS algorithms), and the MAC value of the session establishment response (MAC-I).

[0348] Example 2, compared to the session establishment response in Example 1, includes a second key identifier (ngKSI-KNAS2). The second key identifier implicitly instructs the terminal to perform step 120 to deduce the NAS message protection key in subnet 1.

[0349] 120. The terminal establishes a response based on the received session and determines the NAS message protection key for the terminal in subnet 1.

[0350] Optionally, before the terminal executes step 120, the following possible implementations may also be performed:

[0351] In one possible implementation, the terminal determines that it has accessed subnet 1 based on the identification information of subnet 1 in the session establishment response, and then determines that it needs to deduce the NAS message protection key KNAS2 of the terminal in subnet 1.

[0352] In another possible implementation, the terminal determines the identification information of subnet 1 or the identification information of the routing function network element 1 of subnet 1 from the temporary identifier assigned to the terminal by subnet 1 in the session establishment response. Based on the identification information of subnet 1 or the identification information of the routing function network element 1 of subnet 1, it determines that it has accessed subnet 1, and then determines that it needs to deduce the NAS message protection key KNAS2 of the terminal in subnet 1.

[0353] In another possible implementation, the terminal determines the NAS message protection key KNAS2 of the terminal in subnet 1 based on the second key identifier in the session establishment response.

[0354] In another possible implementation, the terminal obtains the indication information in the session establishment response, which is used to instruct the terminal to deduce the NAS message protection key in subnet 1, thereby knowing that it needs to deduce the NAS message protection key KNAS2 in subnet 1.

[0355] Optionally, the terminal also obtains the security context information corresponding to the first key identifier in the session establishment response; from the security context information, it obtains the terminal's security anchor key in the main network corresponding to the first key identifier, as well as the count value NASKey COUNT. The count value NASKey COUNT is the number of NAS message protection keys determined based on the terminal's security anchor key in the main network.

[0356] In step 120, the terminal determines the NAS message protection key KNAS2 of the terminal in subnet 1 based on the received session establishment response. This includes: the terminal determining the NAS message protection key KNAS2 of the terminal in subnet 1 based on at least one of the identification information or the count value NASKey COUNT of subnet 1, and the security anchor key of the terminal in the main network corresponding to the first key identifier.

[0357] This method, based on the derivation of the security anchor key, can achieve a certain degree of isolation between protection keys for different NAS messages, and the security context request on the network side can be directly forwarded to the security function network element.

[0358] Specifically, the terminal determines the NAS message protection key KNAS2 of the terminal in subnet 1 based on at least one of the identification information or count value of subnet 1 and the security anchor key of the terminal in the main network corresponding to the first key identifier. The example of the security function network element determining the NAS message protection key KNAS2 of the terminal in subnet 1 in step 115 can be referred to, and will not be described in detail here.

[0359] The NASKey COUNT value is maintained by the terminal and represents the number of NAS message protection keys (NASKeys) determined by the terminal based on the security anchor key of the main network. After completing the key derivation, the terminal increments the NASKey COUNT value it maintains by one, i.e., NASKey COUNT = NASKey COUNT + 1.

[0360] Optionally, in step 119, the terminal also receives the MAC value MAC-I of the session establishment response from the signaling routing function network element 2; step 120 further includes: the terminal uses KNAS2 to deduce the integrity protection key; and uses the integrity protection key to verify the MAC-I of the session establishment response. If the verification passes, subsequent NAS messages are protected using KNAS2.

[0361] Alternatively, the terminal can use the temporary identifier (UE Temp ID 2) assigned to it by subnet 1 to route with signaling routing function network element 2. For example, the terminal obtains the identifier of signaling routing function network element 2 from the temporary identifier; the terminal sends a message carrying the identifier of signaling routing function network element 2 to the access network device based on the identifier of signaling routing function network element 2 in the message; and then the access network device determines the corresponding IP address for routing based on the identifier of signaling routing function network element 2 in the message.

[0362] 121. Based on the information related to the established NAS security context, the terminal and subnet 1 protect the NAS interaction messages between the terminal and the subnet.

[0363] The NAS security context information includes the aforementioned NAS message protection key KNAS2, integrity protection key, confidentiality protection key, and negotiated security protection algorithm. This allows the terminal to enable protection for NAS interaction messages between subnet 1 and the terminal. Furthermore, the terminal can use its NAS message protection key in subnet 1 to determine the user plane data protection key for user plane data protection.

[0364] As can be seen, in this method, the terminal can access subnet 1 by sending a session establishment request to the main network. Furthermore, the terminal can obtain a first key identifier from the session establishment response from subnet 1, and determine its NAS message protection key in subnet 1 based on the key corresponding to the first key identifier. This allows the terminal not only to establish a session corresponding to subnet 1, but also to protect NAS messages in subnet 1 using its NAS message protection key, thus achieving network security establishment for subnet 1. Therefore, this method eliminates the need for independent authentication and registration for subnet 1, achieving flexible, fast, and efficient network security establishment.

[0365] This application embodiment uses the example of a terminal establishing security for subnet 1 within a large network. This application embodiment can also be applied to scenarios where the security function network elements of the large network establish network security for other subnets, which will not be described in detail here.

[0366] The embodiments of this application can achieve the following effects:

[0367] (1) As described in steps 104, 114, and 115, the security function network element is used to deduce the NAS message protection key for different subnets, and saves the corresponding NASKey COUNT value and UE security capability for subsequent NAS message protection key deduction for other subnets. Additionally, this method allows the terminal to send its security capability information only once (e.g., during the large network registration phase), and this security capability information can be stored in the security function network element for use in sending to subnets or for subnets to obtain from the security function network element for security capability negotiation.

[0368] (2) As described in steps 108 to 111, when the large network identifies that it cannot provide services for the services requested by the terminal, it can perform service discovery based on the terminal's location information and the requested services, discover subnets, and forward the corresponding service requests to the corresponding subnets.

[0369] (3) As described in steps 106 to 121, the main network triggers the establishment of subnet security based on the service initiated by the terminal. As described in steps 112 to 116, after receiving the corresponding service request, the subnet determines that it has not saved the NAS security context related information of the corresponding terminal, and then the subnet requests the NAS security context related information of the terminal in the subnet from the main network.

[0370] (4) As described in steps 119 to 120, after the subnet obtains the information related to the NAS security context of the terminal in the subnet, the subnet sends implicit or explicit indication information to the terminal, instructing the terminal to deduce a new key and send the MAC value MAC-I calculated using the deduced integrity protection key for verification.

[0371] Figure 10 This is a flowchart illustrating another communication method provided in an embodiment of this application. Figure 10 The communication method described above and Figure 12 The difference in the communication method is that, Figure 10 In the aforementioned communication method, the signaling routing function network element 1 of the main network requests information related to the NAS security context of the terminal in subnet 1 from the security function network element, and then sends it to subnet 1.

[0372] in, Figure 10 In the communication method described, steps 201 to 211 are... Figure 9 Steps 101 to 111 in the communication method described herein correspond to each other and will not be detailed here. In addition to sending a session establishment request to subnet 1 based on the identification information of subnet 1 in the service discovery response, signaling routing function network element 1 also executes step 212:

[0373] 212. Signaling routing function network element 1 sends a security context request to the security function network element, and the corresponding security function network element receives the security context request.

[0374] The security context request is used to request information related to the NAS security context of the terminal in subnet 1. The security context request includes the terminal's identification information and the identification information of subnet 1.

[0375] The optional implementations of the security context request in step 212 and related content can be found in [link to relevant documentation]. Figure 9 The details of step 113 in the method will not be elaborated here.

[0376] 213. The security function network element determines the security context information of the terminal based on the terminal's identification information in the security context request, and determines whether there is information related to the NAS security context of subnet 1; if it is determined that there is information related to the NAS security context of subnet 1, step 215 is executed; if it is determined that there is no information related to the NAS security context of subnet 1, step 214 is executed.

[0377] 214. The security function network element obtains the terminal's security anchor key in the main network from the terminal's security context information; based on the terminal's security anchor key in the main network, the security function network element determines the NAS message protection key of the terminal in subnet 1.

[0378] Steps 213 and 214 are related to Figure 9 Steps 114 and 115 in the method correspond to each other, so the relevant content of steps 213 and 214 can be referred to the relevant descriptions of steps 114 and 115, and will not be detailed here.

[0379] 215. The security function network element sends a security context response to the signaling routing function network element 1, and the corresponding signaling routing function network element 1 receives the security context response.

[0380] The security context response includes information related to the NAS security context of the terminal in subnet 1, which includes the NAS message protection key KNAS2 of the terminal in subnet 1.

[0381] This step 215 and Figure 9 The method corresponds to step 116, so the relevant content of step 215 can be referred to the relevant description of step 116, and will not be detailed here.

[0382] 216. Signaling routing function network element 1 sends information related to the NAS security context of the terminal in subnet 1 to subnet 1 (such as signaling routing function network element 2).

[0383] Optionally, steps 212 to 215 can be performed before step 211 and after step 210, so that the information related to the NAS security context of the terminal in subnet 1 in step 216 and the session establishment request in step 211 can be sent together to the signaling routing function network element 2.

[0384] Among them, the NAS security context related information of subnet 1 includes the NAS message protection key KNAS2 of the terminal in subnet 1; correspondingly, the signaling routing function network element 2 of subnet 1 receives the security context response.

[0385] Optionally, the information related to the NAS security context of the terminal in subnet 1 includes not only KNAS2, but also the terminal's identification information (such as SUPI).

[0386] Optionally, in addition to sending the information related to the NAS security context of the terminal in subnet 1 to the signaling routing function network element 2, the signaling routing function network element 1 also sends the first key identifier (denoted as ngKSI). The first key identifier is the identifier corresponding to the security anchor key of the terminal in the main network.

[0387] Optionally, the information related to the NAS security context of the terminal in subnet 1 includes, in addition to KNAS2, at least one of the following: the terminal's security capability information (denoted as UE security capability), which is used to indicate the security protection algorithm supported by the terminal; or, a second key identifier (denoted as ngKSI-KNAS2), which is the identifier corresponding to the NAS message protection key KNAS2 of the terminal in subnet 1.

[0388] In step 216, the terminal's NAS security context information in subnet 1, as well as the information that can also be sent to subnet 1, can be found in [reference needed]. Figure 9 The details of the security context response in step 116 of the method will not be elaborated here.

[0389] like Figure 10 As shown, the communication method further includes steps 217 to 221, and steps 217 to 221 are related to... Figure 9 Steps 117 to 121 in the communication method described herein are respectively, and will not be described in detail here to avoid redundancy.

[0390] Figure 10In one possible implementation, before signaling routing function network element 1 executes step 212, the method further includes: signaling routing function network element 2 sending a request to signaling routing function network element 1 for information related to the NAS security context of the terminal in subnet 1. That is, signaling routing function network element 2 requests information related to the NAS security context of the terminal in subnet 1 from the security function network element of the main network via the main network's signaling routing function network element 1; after the security function entity sends a security context response to signaling routing function network element 1, signaling routing function network element 1 forwards the information related to the NAS security context of subnet 1 from the security context response to signaling routing function network element 2.

[0391] visible, Figure 10 In the aforementioned communication method, the signaling routing function network element 1 can request NAS security context related information for subnet 1, thereby further simplifying the terminal's security establishment for subnet 1 and saving signaling.

[0392] This application also provides a flowchart illustrating a communication method, which employs... Figure 8 The security architecture shown determines the NAS message protection key of the terminal in the second network (taking subnet 1 as an example) based on the NAS message protection key of the terminal in the first network (taking the main network as an example). In this communication method, the terminal can first register and authenticate in the main network, and then the signaling routing function network element 1, instead of the security function network element, deduces the NAS security context information of the terminal in subnet 1.

[0393] like Figure 11 In the communication method shown, steps 301 to 312 are... Figure 9 Steps 101 to 112 in the communication method described herein correspond to each other and will not be detailed here. In addition to sending a session establishment request to subnet 1 based on the identification information of subnet 1 in the service discovery response, the signaling routing function network element 1 also performs the following steps in step 311:

[0394] 313. Signaling routing function network element 2 sends a security context request to signaling routing function network element 1, and correspondingly, signaling routing function network element 1 receives the security context request.

[0395] The security context request is used to request information related to the NAS security context of the terminal in subnet 1. The security context request includes the terminal's identification information and the identification information of subnet 1.

[0396] The relevant content regarding the security context request in step 313 can be found here. Figure 9 The details of step 113 in the method will not be elaborated here.

[0397] 314. The signaling routing function network element 1 determines the NAS security context related information of the terminal in subnet 1 based on the NAS security context information of the terminal in the main network.

[0398] In one possible implementation, before step 314, the method further includes: the signaling routing function network element 1 stores the identification information of each terminal and the corresponding terminal's NAS security context related information in the main network; the signaling routing function network element 1 queries the corresponding terminal's NAS security context related information in the main network based on the terminal's identification information in the security context request; then, the signaling routing function network element 1 queries whether the terminal's NAS security context related information in the main network includes the NAS security context related information corresponding to the identification information of subnet 1; if the terminal's NAS security context related information in the main network includes the NAS security context related information corresponding to the identification information of subnet 1, step 315 is executed; if the terminal's NAS security context related information in the main network does not include the NAS security context related information corresponding to the identification information of subnet 1, step 314 is executed.

[0399] In one optional implementation, the NAS security context information of the terminal in the main network includes the NAS message protection key of the terminal in the main network. The signaling routing function network element 1 obtains the NAS message protection key of the terminal in subnet 1 from the information related to the NAS security context of the terminal in subnet 1. The signaling routing function network element 1 also obtains the identification information of subnet 1 from the security context request, the service discovery response, or the sender of the security context request (i.e., the signaling routing function network element 2).

[0400] Step 314 includes: the signaling routing function network element 1 determines or deduces the NAS message protection key of the terminal in subnet 1 based on the identification information of subnet 1 and the NAS message protection key of the terminal in the main network.

[0401] For example, the process of determining or deducing the NAS message protection key KNAS2 of the terminal in subnet 1 based on the identification information of subnet 1 and the NAS message protection key of the terminal in the main network can be expressed as follows:

[0402] KNAS2 = KDF(KNAS1, identification information of subnet 1).

[0403] For example, the process by which signaling routing function network element 1 determines the NAS message protection key KNAS2 of the terminal in subnet 1 based on the identification information of subnet 1, the counter value NASKey COUNT, and the NAS message protection key of the terminal in the main network can be expressed as follows:

[0404] KNAS2 = KDF(KNAS1, identification information of subnet 1, NASKey COUNT).

[0405] Wherein, KNAS2 is the NAS message protection key for the terminal in subnet 1; KNAS1 is the NAS message protection key for the terminal in the main network; KDF() is the key derivation function; the identification information of subnet 1 can be the identifier of subnet 1, the identifier of signaling routing function network element 2, or the IP address, or the session identifier ID2.

[0406] Among them, the signaling routing function network element 1 also obtains the NASKey COUNT count value from the NAS security context related information of the terminal in the main network. The NASKey COUNT count value is the number of NAS message protection keys (NASKeys) determined based on the NAS message protection keys of the terminal in the main network.

[0407] After completing the above key deduction, the signaling routing function network element 1 increments the NASKey COUNT value maintained for the terminal by one, that is, NASKey COUNT = NASKey COUNT + 1.

[0408] In another optional implementation, the signaling routing function network element 1 obtains the count value NASKey COUNT and the terminal's NAS message protection key in the main network from the NAS security context related information of the terminal in subnet 1.

[0409] Step 314 includes: the signaling routing function network element 1 determines the NAS message protection key of the terminal in subnet 1 based on the counter value NASKey COUNT and the NAS message protection key of the terminal in the main network.

[0410] For example, the process of determining or deducing the NAS message protection key KNAS2 of the terminal in subnet 1 based on the counter value NASKey COUNT and the NAS message protection key KNAS1 of the terminal in the main network can be expressed as follows:

[0411] KNAS2=KDF(KNAS1,NASKey COUNT).

[0412] Among them, after completing the above key deduction, the signaling routing function network element 1 increments the value of the NAS key deduction count NASKey COUNT maintained for the terminal by one, that is, NASKey COUNT = NASKey COUNT + 1.

[0413] 315. Signaling routing function network element 1 sends a security context response to signaling routing function network element 2, and correspondingly, signaling routing function network element 2 receives the security context response.

[0414] The security context response includes information related to the NAS security context of the terminal in subnet 1, which includes the NAS message protection key of the terminal in subnet 1.

[0415] Additionally, the relevant content regarding security context response in step 315 can be found here. Figure 9 The details of step 116 in the method will not be elaborated here. It should be noted that the first key identifier carried in the security context response in step 315 is obtained from the NAS security context information of the terminal in the main network, and is the key identifier corresponding to the NAS message protection key of the terminal in the main network.

[0416] like Figure 11 As shown, the communication method also includes steps 316 to 320. Details of steps 316 to 320 can be found in [reference needed]. Figure 9 Steps 117 to 121 in the communication method described herein will not be detailed here to avoid redundancy.

[0417] visible, Figure 11 In the aforementioned communication method, after the main network identifies the subnet service requirements, the signaling routing function network element 1 deduces the NAS security context related information of the terminal in subnet 1 for the terminal, and pushes it to subnet 1 through the signaling routing function network element 1, thereby further simplifying the terminal's security establishment for subnet 1 and saving signaling.

[0418] This application also provides a communication method. This method establishes network security in subnet 1 using the communication method provided in the above embodiments. Terminals communicate within subnet 1 and initiate sessions corresponding to specific services in another subnet 2. Subnet 1 can forward service discovery requests to the main network. After obtaining the identification information of subnet 2, the main network can forward session establishment requests to subnet 2. Subnet 2 can use the communication method provided in the above embodiments to request information related to the NAS security context of the terminal in subnet 2 from the signaling routing function network element 1 or the security function network element, thereby achieving more efficient, convenient, and flexible security establishment of subnet 2.

[0419] Figure 12 The communication method described above is adopted in subnet 2. Figure 9 The communication method described above is illustrated using network security establishment as an example. In this communication method, the signaling routing function entity of subnet 1 is denoted as signaling routing function network element 2, the service discovery function entity of subnet 1 is denoted as service discovery function network element 2, the service discovery function entity of the main network is denoted as service discovery function network element 1, the session management function entity of subnet 2 is denoted as session management function network element 3, and the signaling routing function entity of subnet 2 is denoted as signaling routing function network element 3. This will be illustrated using an example. Figure 12As shown, the communication method may include, but is not limited to, the following steps:

[0420] 401. The terminal sends a session establishment request to the signaling routing function network element 2 of subnet 1, and the corresponding signaling function network element 2 receives the session establishment request.

[0421] This session establishment request is used by the terminal to request the establishment of a session. The session establishment request includes the session identifier (such as PDU session ID3) of the terminal requesting to establish a session, the terminal's location information (optional), and the service information corresponding to the terminal requesting to establish a session.

[0422] Optionally, the session establishment request can be carried in the SM container in the N2 message, such as denoted as N2message(SM container(PDU session request(PDU session ID3, service information, [UElocation])).

[0423] In one optional implementation, if the terminal's location information is not carried in the session establishment request, the signaling routing function network element 2 may request the terminal's location information from the LMF network element or the MM network element 2, which will not be described in detail here.

[0424] If the signaling routing function network element 2 determines that it cannot provide the service corresponding to the service information in the session establishment request received in step 401, it executes step 402.

[0425] In one possible implementation, the signaling routing function network element 2 stores information about the services or services that its corresponding subnet 1 can provide. Based on the service information in the session establishment request, the signaling routing function network element 2 determines that subnet 1 cannot provide the service corresponding to that service information. This can include: the signaling routing function network element 2 matching or comparing the information about the services or services that subnet 1 can provide with the service information in the session establishment request; if the service information is not found in the information about the services or services that subnet 1 can provide, then the signaling routing function network element 2 determines that subnet 1 cannot provide the service corresponding to that service information.

[0426] In addition, if the signaling routing function network element 2 contains the service information in the information of the services or services that subnet 1 can provide, it is determined that subnet 1 can provide the service corresponding to the service information.

[0427] 402. Signaling routing function network element 2 sends a service discovery request to service discovery function network element 2 of subnet 1, and correspondingly, service discovery function network element 2 receives the service discovery request.

[0428] The service discovery request includes service information and terminal identification information. Alternatively, the service discovery request includes service information, terminal identification information, and location information.

[0429] Optionally, the signaling routing function network element 2 also performs security verification and decryption on session establishment requests.

[0430] Optionally, the service discovery request can directly carry the decrypted session establishment request, such as servicediscovery(PDU session request(PDU session ID3, service information, [UE location]).

[0431] 403. Service discovery function network element 2 forwards the service discovery request to the service discovery network element 1 of the main network based on the service information in the received service discovery request.

[0432] In one possible implementation, the signaling routing function network element 2 determines that subnet 1 cannot provide the service corresponding to the service information. Therefore, the service discovery request can carry implicit or explicit indications to inform the service discovery function network element 2 that subnet 1 cannot provide the service corresponding to the service information, or to inform the service discovery function network element 2 that subnet discovery is required.

[0433] In another possible implementation, after receiving a service discovery request, service discovery function network element 2 determines whether subnet 1 can provide the service corresponding to the service information. For example, service discovery function network element 2 stores information about the services or services that its corresponding subnet 1 can provide. By matching or comparing this information with the service information in the service discovery request, if the service information is not found in its own information, it is determined that subnet 1 cannot provide the service corresponding to the service information.

[0434] In addition, if the service discovery function network element 2 has the service information in its corresponding information, it determines that subnet 1 can provide the service corresponding to the service information.

[0435] 404. Service Discovery Function: If network element 1 determines, based on the parameters in the received service discovery request, that neither the main network nor subnet 1 can provide the corresponding service, it performs subnet discovery and selects subnet 2 that can provide the corresponding service or session establishment service.

[0436] In step 404, the service discovery function network element 1 determines whether it can provide the corresponding service and how to perform subnet discovery. (See also...) Figure 9 The relevant content described in step 109 of the embodiment will not be detailed here.

[0437] 405. Service discovery function network element 1 returns a service discovery response to service discovery function network element 2.

[0438] The service discovery response includes identification information for subnet 2, such as, but not limited to, at least one of the following: the identifier of the signaling routing function network element 3 of subnet 2, the IP address of the signaling routing function network element 3 of subnet 2, and the network identifier of subnet 2.

[0439] 406. Service discovery function network element 2 sends the identification information of subnet 2 to signaling routing function network element 2.

[0440] 407. Based on the service discovery response, signaling routing function network element 2 forwards the session establishment request to signaling routing function network element 3 of subnet 3.

[0441] The session establishment request includes the terminal's identification information. Optionally, the session establishment request may also include at least one of the following: the session identifier (such as PDU sessionID3) for which the terminal requests to establish a session, the terminal's location information, or the service information corresponding to the session requested by the terminal.

[0442] like Figure 12 Taking the example of a session establishment request being sent from signaling routing function element 2 to signaling routing function element 3 of subnet 2. Optionally, information between the main network and subnet 1 (such as service discovery requests and service discovery responses), and information between subnet 1 and subnet 2 (such as session establishment requests) can be forwarded through NEF elements or sent through the established IPsec channel, assuming that security has been established between signaling routing function element 1, signaling routing function element 2, and signaling routing function element 3.

[0443] For example, the session establishment request can be represented as PDU session request(ID3, SUPI, UE location).

[0444] 408. The signaling routing function network element 3 determines, based on the terminal identification information (such as SUPI) in the session establishment request, that the terminal's NAS security context information in subnet 2 has not been saved.

[0445] For example, the signaling routing function network element 3 queries whether the terminal's NAS security context related information in the session establishment request has been stored based on the terminal's identification information; if the terminal's NAS security context related information in the subnet 2 has not been stored, step 409 is executed; if the terminal's NAS security context related information in the subnet 2 has been stored, step 413 is executed.

[0446] 409. Signaling routing function network element 3 sends a security context request to the security function network element of the main network, and the corresponding security function network element receives the security context request.

[0447] The security context request includes the terminal's identification information and the identification information of subnet 2. Optionally, the security context request may also include the terminal's location information.

[0448] Specifically, the security context request sent by signaling routing function network element 3 to the security function network element of the main network may also be sent by signaling routing function network element 3 through other functional entities or network elements of the first network, such as the network capability opening function network element sending the security context request to the security function network element of the first network; the security function network element sending the security context response to signaling routing function network element 3 may also be sent by the security function network element through other functional entities or network elements of the first network, such as the network capability opening function network element.

[0449] 410. The security function network element determines the security context information of the terminal based on the terminal's identification information in the security context request, and determines whether there is information related to the NAS security context of the corresponding subnet 2; if it is determined that there is information related to the NAS security context of the corresponding subnet 2, step 412 is executed; if it is determined that there is no information related to the NAS security context of the corresponding subnet 2, step 410 is executed.

[0450] In step 410, the security function network element determines the relevant content of the terminal's security context information, which can be found in the following reference: Figure 9 The relevant content described in step 114 of the embodiments will not be detailed here.

[0451] 411. The security function network element obtains the terminal's security anchor key in the main network from the terminal's security context information; based on the security anchor key, the security function network element determines the terminal's NAS message protection key KNAS3 in subnet 2.

[0452] Among them, the optional implementation of the security function network element determining the NAS message protection key KNAS3 of the terminal in subnet 2 based on the security anchor key can be referred to the relevant content of the security function network element determining the NAS message protection key KNAS2 of the terminal in subnet 1 in the foregoing embodiment, which will not be described in detail here.

[0453] 412. The security function network element sends a security context response to the signaling routing function network element 3 of subnet 2. The security context response includes information related to the NAS security context of the terminal in subnet 2, including the NAS message protection key KNAS3 of the terminal in subnet 2. Correspondingly, the signaling routing function network element 3 of subnet 2 receives the security context response.

[0454] Optionally, the security context response sent by the security function network element to the signaling routing function network element 3, in addition to carrying the NAS message protection key KNAS3 of the terminal in subnet 2, also carries a first key identifier, which is the identifier corresponding to the security anchor key of the terminal in the main network. Optionally, the NAS security context related information of the terminal in subnet 2 also carries the terminal's security capability information, which is used to indicate the security protection algorithms supported by the terminal.

[0455] 413. The signaling routing function network element 3 interacts with the session management function network element 3 of subnet 2 to establish a PDU session for the terminal.

[0456] Among them, the signaling routing function network element 3 and the service discovery function network element 3 of subnet 2 perform service discovery related operations, obtain the identification information of the session management function network element 3, and establish a PDU session for the terminal.

[0457] 414. Signaling routing function network element 3 assigns a temporary identifier to the terminal; and selects the subsequent NAS message protection algorithm based on the terminal's security capability information and locally supported security algorithms in the security context response; and derives the confidentiality protection key and integrity protection key based on KNAS3.

[0458] In step 414, the signaling routing function network element 3 assigns temporary identifiers to the terminal, selects the NAS message protection algorithm, and derives the confidentiality protection key and integrity protection key. (See also...) Figure 9 The relevant content described in step 118 of the embodiments will not be detailed here.

[0459] 415. The signaling routing function network element 3 sends a session establishment response to the terminal, which includes the first key identifier ngKSI; correspondingly, the terminal receives the session establishment response.

[0460] Optionally, the session establishment response may also include identification information of subnet 3, or a temporary identifier assigned to the terminal by subnet 2.

[0461] Optionally, the session establishment response may also include at least one of the following: a second key identifier, which is the key identifier corresponding to the NAS message protection key of the terminal in subnet 2; indication information, which is used to instruct the terminal to obtain the NAS message protection key in subnet 2; or, the NAS message protection algorithm of the terminal in subnet 3.

[0462] 416. The terminal establishes a response based on the received session and determines the NAS message protection key KNAS3 for the terminal in subnet 2.

[0463] Optionally, before step 415, the terminal further determines, based on at least one of the identification information of subnet 2, the second key identifier, or the indication information, that it needs to obtain the NAS message protection key for subnet 2. For example, the terminal further determines that it has accessed subnet 2 and needs to deduce the NAS message protection key for subnet 2 based on the identification information of subnet 2 in the session establishment response or the temporary identifier assigned to the terminal by subnet 2.

[0464] In step 416, the terminal determines that the optional implementation of the NAS message protection key KNAS3 in subnet 2 can be found in the relevant content of the foregoing embodiments, such as... Figure 9 The details of step 120 in the method will not be elaborated here.

[0465] Optionally, in step 415, the terminal also receives the MAC value MAC-I of the session establishment response from the signaling routing function network element 2; the method further includes: the terminal using KNAS3 to deduce the integrity protection key; using the integrity protection key to verify the MAC-I in the session establishment response, and if the verification passes, subsequent NAS messages are protected using KNAS3. Additionally, the terminal can also use this temporary identifier to route with the signaling routing function network element 3.

[0466] 417. The terminal and subnet 2 protect subsequent communication processes based on the information related to the established NAS security context.

[0467] For example, the terminal enables encryption and integrity protection for NAS messages between subnet 2 and the terminal; in addition, the terminal uses its NAS message protection key in subnet 2 to determine the user plane data protection key for the protection of user plane data.

[0468] As can be seen, in this method, subnet 1 identifies that it cannot provide services and forwards the relevant requests to the service discovery function network element 1 of the main network to perform service discovery and find the corresponding subnet 2. In addition, subnet 2 can request NAS security context related information from the main network and pass it to subnet 2 (instead of inferring subnet 2 from subnet 1), thereby realizing security isolation between different subnets and improving the efficiency of subnets establishing security contexts.

[0469] The optional implementation methods in steps 408 to 416, such as the implementation methods for security context request, security context response, and security function network element deduction KNAS3, can be found in [reference needed]. Figure 9 The relevant content will not be elaborated here.

[0470] Optional, Figure 12 The communication method described above can also be used Figure 10The signaling routing function network element 1 of the main network requests information related to the NAS security context of the terminal in subnet 2 from the security function network element and sends it to subnet 2. This will not be described in detail here.

[0471] Optional, Figure 12 The communication method described above can also be used Figure 7 The security architecture shown involves the signaling routing function network element 3 requesting information related to the NAS security context of the terminal in subnet 2 from the security function network element and sending it to subnet 2. This will not be described in detail here.

[0472] Optional, Figure 12 The communication method described adopts Figure 8 The security architecture shown, and the adoption of Figure 11 The signaling routing function network element 1 of the large network deduces the information related to the NAS security context of the terminal in subnet 2 and sends it to subnet 2. This will not be described in detail here.

[0473] visible, Figure 12 The communication method described, as in steps 401-405, involves subnet 1 identifying that it cannot provide services and forwarding the relevant requests to the service discovery function network element 1 of the main network for service discovery, thereby finding the corresponding subnet 2. In addition, subnet 2 can request NAS security context-related information from the main network and pass it to subnet 2 (instead of deducing subnet 2 from subnet 1), thereby achieving security isolation between different subnets and improving the efficiency of subnets establishing security contexts.

[0474] This application also provides a communication method that supports authentication methods for terminals in different subnets. For example, it supports authentication methods where the subnet needs to be isolated from the main network to complete independent authentication and security establishment. It also supports subnets with lower security requirements, where the methods described in the above communication methods of this application can be used, and the main network can deduce information related to the NAS security context of the terminal in the subnet.

[0475] For example, with Figure 9Taking the communication method as an example, in step 114, if the security function network element determines that there is no NAS security context related information for the corresponding subnet 1, it can send an authentication method request to the UDM network element. The authentication method request includes the terminal's identification information and the identification information of subnet 1. The identification information of subnet 1 and the terminal carried in the authentication method request can be obtained based on the security context request. The security function network element receives an authentication method response from the UDM network element. The authentication method response includes first indication information, which indicates that the terminal does not need to be authenticated in subnet 1. Then, the security function network element can execute step 115 to determine the NAS message protection key for the terminal in subnet 1 using the terminal's security anchor key in the main network, without requiring the terminal to perform independent authentication for subnet 1. Alternatively, the security function network element receives an authentication method response from the UDM network element. The authentication method response includes first indication information, which indicates that if the terminal is using the authentication method in subnet 1, the security function network element triggers the terminal to perform authentication, EAP authentication, or slice authentication for subnet 1.

[0476] As can be seen, subnet 1 may require secondary authentication. Therefore, before determining in step 114 that there is no NAS security context related information for subnet 1 and before executing step 115 to request the security context, the security function will request the corresponding authentication method of the terminal in the corresponding subnet 1 from the UDM network element.

[0477] Optionally, the first indication information is used to indicate that the terminal does not need authentication in subnet 1. The security function network element returns information related to the NAS security context of the terminal in subnet 1 to subnet 1. Then, subnet 1 can know that it does not need to trigger secondary authentication, EAP authentication, or slice authentication for the terminal, and execute... Figure 9 The relevant content of steps 117 to 121.

[0478] Similarly, with Figure 10 Taking the aforementioned communication method as an example, in step 213, if the security function network element determines that there is no information related to the NAS security context of subnet 1, it can send an authentication method request to the UDM network element. The security function network element receives an authentication method response from the UDM network element. The authentication method response includes first indication information, which indicates that the terminal does not need to be authenticated in subnet 1. Then, the security function network element can execute step 214 to determine the NAS message protection key of the terminal in subnet 1 through the security anchor key of the terminal in the main network, without requiring the terminal to perform independent authentication for subnet 1. Alternatively, the security function network element receives an authentication method response from the UDM network element. The authentication method response includes first indication information, which indicates that if the terminal is in the authentication mode of subnet 1, the security function network element triggers the terminal to perform authentication, EAP authentication, or slice authentication for subnet 1.

[0479] Optionally, the first indication information is used to indicate that the terminal does not need authentication in subnet 1. The security function network element returns information related to the NAS security context of the terminal in subnet 1 to subnet 1 through the signaling routing function network element 1 of the main network. Then, subnet 1 can know that there is no need to trigger secondary authentication, EAP authentication, or slice authentication for the terminal, and execute... Figure 10 The relevant content of steps 217 to 221.

[0480] by Figure 11 Taking the communication method described above as an example, before step 313, if the signaling routing function network element 2 determines that there is no information related to the NAS security context of the corresponding subnet 1, it can send an authentication method request to the UDM network element. The signaling routing function network element 2 receives an authentication method response from the UDM network element. The authentication method response includes first indication information, which indicates that the terminal does not need to be authenticated in subnet 1. Then, the signaling routing function network element 2 can execute step 313, determining the NAS message protection key of the terminal in subnet 1 through the NAS message protection key of the terminal in the main network, without requiring the terminal to perform independent authentication for subnet 1. Alternatively, the signaling routing function network element 2 receives an authentication method response from the UDM network element. The authentication method response includes first indication information, which indicates that if the terminal is in the authentication mode of subnet 1, the signaling routing function network element 2 triggers the terminal to perform authentication, EAP authentication, or slice authentication for subnet 1.

[0481] Similarly, the authentication method request to confirm the terminal's corresponding authentication method in the subnet described in this application embodiment can be applied to the other communication methods mentioned above, and will not be described in detail here.

[0482] This application also provides a flowchart illustrating a communication method, which employs... Figure 8 The security architecture shown determines the NAS message protection key of the terminal in subnet 1 based on the NAS message protection key of the terminal in the main network. Optionally, in this communication method, the terminal can first register and authenticate in the main network, and then the signaling routing function network element 1 or the signaling routing function network element 2 can request information related to the NAS security context of the terminal in subnet 1 from the security function network element.

[0483] One possible implementation, such as Figure 10 As shown, the signaling routing function network element 1 requests information related to the NAS security context of the terminal in subnet 1 from the security function network element. The difference is that in this embodiment, it is necessary to... Figure 10 In the method, step 214 is replaced by: the security function network element derives the NAS message protection key (such as KNAS2) of the terminal in subnet 1 based on the NAS message protection key (such as KNAS1) of the terminal in the main network.

[0484] Another possible implementation, such as Figure 9 As shown, the signaling routing function network element 2 requests information related to the NAS security context of the terminal in subnet 1 from the security function network element. The difference is that in this embodiment, it is necessary to... Figure 9 In the method, step 115 is replaced by: the security function network element derives the NAS message protection key (such as KNAS2) of the terminal in subnet 1 based on the NAS message protection key (such as KNAS1) of the terminal in the main network.

[0485] For example, the signaling routing function network element 1 / security function network element determines the NAS message protection key KNAS2 of the terminal in subnet 1 based on KNAS1, which can be expressed as:

[0486] KNAS2 = KDF(KNAS1, identification information of subnet 1, NASKey COUNT).

[0487] NASKey COUNT = NASKey COUNT + 1, where the identification information of subnet 1 can be the identifier of subnet 1, the identifier of signaling routing function network element 2, or the IP address, or session identifier ID2; NASKey COUNT is the NASKey COUNT maintained by the security function network element for this terminal, that is, the number of NAS message protection keys (NASKey) derived by the terminal based on KNAS1 of the main network.

[0488] It is evident that this communication method uses the NAS message protection key of the main network to deduce the NAS message protection key for the subnet, without necessarily using the security anchor key for deduction.

[0489] Furthermore, unless otherwise specified or logically conflicting, the terminology and / or descriptions of different embodiments are consistent and can be referenced by each other. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.

[0490] It is understood that some optional features in the various embodiments of this application may not depend on other features in certain scenarios, or may be combined with other features in certain scenarios, without limitation.

[0491] It is understood that the solutions in the embodiments of this application can be used in combination, and the explanations or descriptions of various terms, similar operations or steps appearing in the embodiments can be referenced or explained to each other in the various embodiments, and this application does not limit them.

[0492] To achieve the functions of the methods provided in the embodiments of this application, the network element / device may include hardware structures and / or software modules, implementing the above functions in the form of hardware structures, software modules, or a combination of hardware structures and software modules. Whether a particular function is executed in the form of hardware structures, software modules, or a combination of hardware structures and software modules depends on the specific application and design constraints of the technical solution.

[0493] like Figure 13 As shown, this application provides a communication device. This communication device can be a terminal device, a device in a first network (such as the large network described above), or a device in a second network (such as subnet 1, subnet 2, etc. described above). It can also be a component (e.g., an integrated circuit, chip, processor, chip system, module, unit, etc.) of a terminal device, a device in the first network, or a device in the second network. The communication device can also be other communication units used to implement the methods in the method embodiments of this application. The communication device may include a processing unit 1301. Optionally, the communication device may further include a communication unit 1302. The processing unit 1301 controls the communication unit 1302 to perform data / signaling transmission and reception. The communication unit 1302 may also be referred to as a transceiver unit. Optionally, the communication unit 1302 may include a sending unit and a receiving unit. The sending unit can be used to send data / signaling, and the receiving unit can be used to receive data / signaling. Optionally, the communication device may also include a storage unit 1303, which can be used to store information and / or data and / or instructions, etc. The storage unit 1303 can interact with the processing unit 1301 or the communication unit 1302.

[0494] In one possible design, regarding the case where the communication device is used to implement the functions of the terminal in the above method embodiments:

[0495] Communication unit 1302 is used to send a session establishment request to a first network that has been registered and authenticated. The session establishment request is used by the terminal to request the establishment of a session corresponding to the service associated with the second network.

[0496] The communication unit 1302 is used to receive a session establishment response from the second network, the session establishment response including a first key identifier;

[0497] The processing unit 1301 is configured to determine the non-access stratum (NAS) message protection key of the terminal in the second network based on the security anchor key of the terminal in the first network corresponding to the first key identifier; or, the terminal determines the NAS message protection key of the terminal in the second network based on the NAS message protection key of the terminal in the first network corresponding to the first key identifier.

[0498] In one possible design, regarding the communication device used to implement the function of the first signaling routing function network element (such as signaling routing function network element 1) in the first network of the above method embodiments:

[0499] Communication unit 1302 is used to receive a first session establishment request from a terminal. The first session establishment request includes service information, and the service corresponding to the service information is a service associated with the second network.

[0500] The communication unit 1302 is used to send a service discovery request based on the first session establishment request. The service discovery request includes service information and terminal identification information, or includes service information, terminal identification information and location information.

[0501] The communication unit 1302 is used to receive a service discovery response, which includes the identification information of the second network;

[0502] The communication unit 1302 is used to send a second session establishment request to the second network based on the identification information of the second network. The second session establishment request includes the identification information of the terminal, or includes the identification information and location information of the terminal.

[0503] In one possible design, regarding the case where the communication device is used to implement the functions of the security function network element in the first network of the above method embodiments:

[0504] The communication unit 1302 is used to receive a security context request. The security context request is used to request information related to the NAS security context of the terminal in the second network. The security context request includes the terminal's identification information.

[0505] The processing unit 1301 is used to obtain the terminal's security anchor key in the first network from the stored security context information of the terminal based on the terminal's identification information; and to determine the NAS message protection key of the terminal in the second network based on the terminal's security anchor key in the first network.

[0506] The communication unit 1302 is used to send a security context response, which includes information related to the NAS security context of the terminal in the second network. The information related to the NAS security context of the second network includes the NAS message protection key of the terminal in the second network.

[0507] The first network is the network where the terminal has registered and authenticated, and the second network is the network where the terminal requests to establish the service association corresponding to the session.

[0508] In one possible design, regarding the communication device used to implement the function of the second signaling routing function network element (such as signaling routing function network element 2) in the second network of the above method embodiments:

[0509] The communication unit 1302 is used to receive a session establishment request from the first network. The session establishment request is used by the terminal to request the establishment of a session corresponding to the service associated with the second network. The session establishment request includes the terminal's identification information. The first network is a network that the terminal has registered and authenticated with.

[0510] Processing unit 1301 is used to determine information related to the NAS security context of the terminal in the second network, including the NAS message protection key of the terminal in the second network.

[0511] The communication unit 1302 is used to send a session establishment response to the terminal. The session establishment response includes a first key identifier, which corresponds to the terminal's security anchor key in the first network or the terminal's NAS message protection key in the first network. The first key identifier is used by the terminal to determine the NAS message protection key in the second network.

[0512] The embodiments of this application and the method embodiments shown above are based on the same concept and have the same technical effects. For the specific principles, please refer to the description of the embodiments shown above, which will not be repeated here.

[0513] This application also provides a communication device, such as... Figure 14 As shown. The communication device can be a terminal device, a device in the first network, or a device in the second network. It can also be a chip, chip system, or processor, etc., within the terminal device, the device in the first network, or the device in the second network, capable of implementing the above methods. This device can be used to implement the methods described in the above method embodiments; for details, please refer to the descriptions in the above method embodiments.

[0514] The communication device may include one or more processors 1401. The processor 1401 can be used to implement some or all of the functions of the terminal-side device or network-side device through logic circuits or by running computer programs. The processor 1401 may be a general-purpose processor or a special-purpose processor, such as a baseband processor, digital signal processor, application-specific integrated circuit, field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or CPU. The baseband processor can be used to process communication protocols and communication data, while the central processing unit (CPU) can be used to control the communication device, execute software programs, and process data from the software programs. The communication device may be, for example, a base station, a baseband chip, a terminal, a terminal chip, a distributed unit (DU), or a central unit (CU).

[0515] Optionally, the communication device may include one or more memories 1402, which may store instructions 1404 that can be executed on the processor 1401, causing the communication device to perform the methods described in the above method embodiments. Optionally, the memory 1402 may also store data. The processor 1401 and the memory 1402 may be configured separately or integrated together.

[0516] The memory 1402 may include, but is not limited to, non-volatile memory such as hard disk drive (HDD) or solid-state drive (SSD), random access memory (RAM), erasable programmable read-only memory (EPROM), ROM or compact disc read-only memory (CD-ROM), etc.

[0517] Optionally, the communication device may further include a transceiver 1405 and an antenna 1406. The transceiver 1405, which may be referred to as a transceiver unit, transceiver, or transceiver circuit, is used to implement transceiver functions. The transceiver 1405 may include a receiver and a transmitter. The receiver, which may be referred to as a receiver or receiving circuit, is used to implement a receiving function; the transmitter, which may be referred to as a transmitter or transmitting circuit, is used to implement a transmitting function. For example, the transceiver 1405 can perform... Figure 13 The processor 1401 can execute the relevant operations of the communication unit 1302. Figure 13 The relevant operations of the processing unit 1301 will not be described in detail here.

[0518] In another possible design, the processor 1401 may include a transceiver for implementing receive and transmit functions. For example, the transceiver may be a transceiver circuit, an interface, or an interface circuit. The transceiver circuit, interface, or interface circuit for implementing receive and transmit functions may be separate or integrated. The aforementioned transceiver circuit, interface, or interface circuit may be used for reading and writing code / data, or for transmitting or relaying signals.

[0519] In another possible design, the processor 1401 may optionally store instructions 1403, which, when executed on the processor 1401, cause the communication device to perform the methods described in the above method embodiments. Instructions 1403 may be embedded in the processor 1401; in this case, the processor 1401 may be implemented in hardware.

[0520] In another possible design, the communication device may include a circuit that can perform the functions of sending, receiving, or communicating in the aforementioned method embodiments. The processor and transceiver described in this application embodiment can be implemented on integrated circuits (ICs), analog ICs, radio frequency integrated circuits (RFICs), mixed-signal ICs, application-specific integrated circuits (ASICs), printed circuit boards (PCBs), electronic devices, etc. The processor and transceiver can also be manufactured using various IC process technologies, such as complementary metal-oxide semiconductors (CMOS), n-metal-oxide-semiconductor (NMOS), positive-channel metal-oxide semiconductors (PMOS), bipolar junction transistors (BJTs), bipolar CMOS (BiCMOS), silicon-germanium (SiGe), or gallium arsenide (GaAs), etc.

[0521] Those skilled in the art will also understand that the various illustrative logical blocks and steps listed in the embodiments of this application can be implemented by electronic hardware, computer software, or a combination of both. Whether such functionality is implemented through hardware or software depends on the specific application and the overall system design requirements. Those skilled in the art can use various methods to implement the described functionality for a specific application, but such implementation should not be construed as exceeding the scope of protection of the embodiments of this application.

[0522] The embodiments of this application and the above-described method embodiments are based on the same concept and have the same technical effects. For the specific principles, please refer to the description in the above-described method embodiments, which will not be repeated here.

[0523] This application also provides a computer-readable storage medium for storing computer software instructions that, when executed by a communication device, implement the functions of any of the above method embodiments.

[0524] This application also provides a computer program product for storing computer software instructions, which, when executed by a communication device, implement the functions of any of the above method embodiments.

[0525] This application also provides a computer program that, when run on a computer, implements the functions of any of the above method embodiments.

[0526] This application also provides a chip including a processor. The processor is used to execute code or instructions to implement the functions of any of the above method embodiments. Optionally, the chip further includes an interface, and the processor is coupled to the interface, which is used to receive or output signals.

[0527] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs (DVDs)), or semiconductor media (e.g., SSDs), etc.

[0528] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for establishing network security, characterized in that, The method includes: Send a session establishment request to the first network that has been registered and authenticated. The session establishment request is used by the terminal to request the establishment of a session corresponding to the service associated with the second network. Receive a session establishment response from the second network, the session establishment response including a first key identifier; Based on the security anchor key of the terminal in the first network corresponding to the first key identifier or the non-access stratum (NAS) message protection key of the terminal in the first network, the NAS message protection key of the terminal in the second network is determined.

2. The method according to claim 1, characterized in that, The step of determining the NAS message protection key of the terminal in the second network based on the security anchor key of the terminal in the first network corresponding to the first key identifier or the NAS message protection key of the terminal in the first network includes: Based on at least one of the identification information or count value of the second network, and the security anchor key of the terminal in the first network corresponding to the first key identifier, the NAS message protection key of the terminal in the second network is determined; or... Based on at least one of the identification information or count value of the second network, and the NAS message protection key of the terminal in the first network corresponding to the first key identifier, the NAS message protection key of the terminal in the second network is determined. The count value is the number of NAS message protection keys determined based on the terminal's security anchor key in the first network or the terminal's NAS message protection key in the first network.

3. The method according to claim 1 or 2, characterized in that, The method further includes: The NAS message protection key of the terminal in the second network is determined based on at least one of the identification information of the second network, the second key identifier, or the indication information.

4. A method for establishing network security, characterized in that, include: Receive the first session establishment request from the terminal; The first session establishment request includes service information, and the service information corresponds to a service associated with the second network; Based on the first session establishment request, a service discovery request is sent. The service discovery request includes the service information and the terminal's identification information, or includes the service information, the terminal's identification information, and location information. Receive a service discovery response, the service discovery response including the identification information of the second network; Based on the identification information of the second network, a second session establishment request is sent to the second network. The second session establishment request includes the identification information of the terminal, or includes the identification information and location information of the terminal.

5. The method according to claim 4, characterized in that, The method further includes: Based on the identification information of the second network, information related to the security context of the terminal in the second network is sent to the second network. The information related to the NAS security context of the terminal in the second network includes the NAS message protection key of the terminal in the second network.

6. The method according to claim 5, characterized in that, The method further includes: Send a security context request, the security context request being used to request information related to the NAS security context of the terminal in the second network, the security context request including the identification information of the terminal and the identification information of the second network; Receive a security context response, the security context response including information related to the NAS security context of the terminal in the second network.

7. The method according to claim 4, characterized in that, The method further includes: Receive a security context request, the security context request being used to request information related to the NAS security context of the terminal in the second network; Based on the NAS security context information of the terminal in the first network, information related to the NAS security context of the terminal in the second network is determined; the first network is the network in which the terminal has been authenticated and registered. Send a security context response, the security context response including information related to the NAS security context of the terminal in the second network, the information related to the NAS security context of the terminal in the second network including the NAS message protection key of the terminal in the second network.

8. The method according to claim 7, characterized in that, The security context request includes the terminal's identification information, and the method further includes: Based on the terminal's identification information, the NAS security context information of the terminal in the first network is obtained.

9. The method according to claim 7 or 8, characterized in that, The step of determining the NAS security context-related information of the terminal in the second network based on the NAS security context information of the terminal in the first network includes: Based on the identification information of the second network and the NAS message protection key of the terminal in the first network, the NAS message protection key of the terminal in the second network is determined, wherein the NAS security context information of the terminal in the first network includes the NAS message protection key of the terminal in the first network, and the information related to the NAS security context of the terminal in the second network includes the NAS message protection key of the terminal in the second network; or, Based on the count value and the NAS message protection key of the terminal in the first network, the NAS message protection key of the terminal in the second network is determined. The NAS security context information of the terminal in the first network includes the count value and the NAS message protection key of the terminal in the first network, and the security context information of the terminal in the second network includes the NAS message protection key of the terminal in the second network. The count value is the number of NAS message protection keys determined based on the NAS security context information of the terminal in the first network.

10. The method according to any one of claims 7 to 9, characterized in that, The security context request also includes the identification information of the second network and the identification information of the terminal, and the method further includes: Send an authentication method request, the authentication method request including the identification information of the terminal and the identification information of the second network; The terminal receives an authentication method response, which includes first indication information, indicating that the terminal does not require authentication in the second network.

11. A method for establishing network security, characterized in that, include: A security context request is received, which is used to request information related to the NAS security context of the terminal in the second network, and the security context request includes the identification information of the terminal. Based on the terminal's identification information, obtain the terminal's security anchor key in the first network from the stored security context information of the terminal; Based on the security anchor key of the terminal in the first network, the NAS message protection key of the terminal in the second network is determined; Send a security context response, the security context response including information related to the NAS security context of the terminal in the second network, the NAS security context related information of the second network including the NAS message protection key of the terminal in the second network.

12. The method according to claim 11, characterized in that, The step of determining the NAS message protection key of the terminal in the second network based on the security anchor key of the terminal includes: Based on the count value and the terminal's security anchor key in the first network, the NAS message protection key of the terminal in the second network is determined, wherein the count value is the number of NAS message protection keys determined based on the terminal's security anchor key in the first network.

13. The method according to claim 11 or 12, characterized in that, The method further includes: Based on the terminal's identification information, the count value is obtained from the stored security context information of the terminal.

14. The method according to any one of claims 11 to 13, characterized in that, The security context response also includes a first key identifier, wherein the first key identifier is the identifier corresponding to the security anchor key of the terminal in the first network.

15. The method according to any one of claims 11 to 14, characterized in that, The terminal also includes at least one of the following in the NAS security context related information of the second network: The security capability information of the terminal, which indicates the security protection algorithms supported by the terminal; or... The second key identifier is the identifier corresponding to the NAS message protection key of the terminal in the second network.

16. The method according to any one of claims 11 to 15, characterized in that, The security context request also includes the identification information of the second network, and the method further includes: Send an authentication method request, the authentication method request including the identification information of the terminal and the identification information of the second network; The terminal receives an authentication method response, which includes first indication information, indicating that the terminal does not require authentication in the second network.

17. A method for establishing network security, characterized in that, include: The terminal receives a session establishment request from a first network. The session establishment request is used by the terminal to request the establishment of a session corresponding to a service associated with a second network. The session establishment request includes the terminal's identification information. The first network is a network in which the terminal has been registered and authenticated. Determine information related to the NAS security context of the terminal in the second network, including the NAS message protection key of the terminal in the second network; A session establishment response is sent to the terminal, the session establishment response including a first key identifier, the first key identifier corresponding to the terminal's security anchor key in the first network or the terminal's non-access stratum NAS message protection key in the first network, used by the terminal to determine the NAS message protection key in the second network.

18. The method according to claim 2, 3, or 17, characterized in that, The session establishment response includes the identification information of the second network; or, the session establishment response includes a temporary identifier assigned to the terminal by the second network, wherein the identification information of the second network is determined from the temporary identifier.

19. The method according to claim 2, 3, or 18, characterized in that, The identification information of the second network includes at least one of the following: The identifier of the second signaling routing function network element or the Internet Protocol IP address, or the network identifier of the second network.

20. The method according to any one of claims 1 to 3, or any one of claims 17 to 19, characterized in that, The session establishment response also includes at least one of the following: The second key identifier is the key identifier corresponding to the NAS message protection key of the terminal in the second network; Instruction information, the instruction information being used to instruct the terminal to obtain the NAS message protection key in the second network; or, The terminal uses the NAS message protection algorithm in the second network.

21. The method according to any one of claims 1 to 7, or any one of claims 17 to 20, characterized in that, The session establishment request also includes at least one of the following: The terminal requests a session identifier to establish a session; The location information of the terminal; or... The terminal requests the business information corresponding to establish a session.

22. The method according to claim 21, characterized in that, The business information includes at least one of the following: The session corresponds to the service identification information, application identification information, data network information, or slice information.

23. The method according to any one of claims 17 to 22, characterized in that, The process of determining the information related to the NAS security context of the terminal in the second network includes: Send a security context request, the security context request being used to request information related to the NAS security context of the terminal in the second network, the security context request including the identification information of the terminal and the identification information of the second network; The terminal receives a security context response, which includes information related to the NAS security context of the terminal in the second network; the information related to the NAS security context of the terminal in the second network includes the NAS message protection key of the terminal in the second network.

24. The method according to claim 23, characterized in that, The security context response also includes a first key identifier, wherein the first key identifier is an identifier corresponding to the NAS message protection key of the terminal in the first network, or an identifier corresponding to the security anchor key of the terminal in the first network.

25. The method according to any one of claims 17 to 22, characterized in that, The process of determining the information related to the NAS security context of the terminal in the second network includes: The terminal receives information related to the NAS security context of the second network, which includes the NAS message protection key of the terminal in the second network.

26. The method according to any one of claims 17 to 25, characterized in that, The information related to the security context of the terminal in the second network also includes at least one of the following: The security capability information of the terminal, which indicates the security protection algorithms supported by the terminal; or... The second key identifier is the identifier corresponding to the NAS message protection key of the terminal in the second network.

27. A communication device, characterized in that, Includes a module for performing the method as described in any one of claims 1 to 26.

28. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program, which, when executed, performs the method as described in any one of claims 1 to 26.

29. A computer program product, characterized in that, When the computer program product is executed, the method as described in any one of claims 1 to 26 is performed.