A method, apparatus and electronic device for transmitting information
By receiving AH response packets in the SDP network through the gateway and sending notification messages to the IH cluster, the problem of low efficiency in connecting multiple IHs with AH is solved, and more efficient identity authentication and communication connections are achieved.
Patent Information
- Application Number
- CN202311135318.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-05
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2043-09-05
AI Technical Summary
In software-defined perimeter (SDP) networks, the process of multiple session initiating hosts (IHs) authenticating and establishing communication connections with session accepting hosts (AHs) is inefficient and results in a poor user experience.
The gateway receives the response packet from the Session Acceptor Host (AH), sends a notification message to the Session Initiating Host Cluster, instructs the AH to open the access port, and receives the handshake packet carrying the Single Packet Authorization SPA data packet information, thereby reducing the number of data packets received and improving the efficiency of identity authentication and communication connection.
It reduces packet reception waiting time, improves the efficiency of authentication and communication between multiple session initiating hosts and session receiving hosts, and enhances user experience.
Smart Images

Figure CN117155668B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of network technology and security technology, and in particular to a method, apparatus and electronic device for transmitting information. Background Technology
[0002] With the development of network and security technologies, the Cloud Security Alliance (CSA) has proposed a network security model based on the zero-trust concept—Software Defined Perimeter (SDP).
[0003] In SDP, a "verify before connecting" mechanism is typically used, leveraging Single Packet Authorization (SPA) technology to achieve service hiding. This service can be provided by the Accepting Host (AH) or by resources protected by the AH. Service hiding means that the service (i.e., the service provided by the AH or the resource protected by the AH) does not directly expose its domain name, Internet Protocol address (IP address), or port. Therefore, after service hiding, attackers cannot directly see the target (i.e., the AH or the resource protected by the AH) in network space, and the service (i.e., the service provided by the AH or the resource protected by the AH) can avoid being attacked.
[0004] Under the "authenticate before connect" mechanism, the initiating host (IH) must authenticate with the access host (AH) before establishing a communication connection. First, the IH constructs an SPA packet. Then, the IH sends this SPA packet to the AH through a gateway. The gateway converts the source IP address and source port in the SPA packet into its own public IP address and a random port. This gateway can be a router, and the SPA packet is a single authentication packet carrying a one-time password and other information. Once the AH verifies the received SPA packet, it opens the service access port on the public IP address, allowing the IH to access that port.
[0005] Because AH has set a default dynamic access control policy (which means closing all ports and rejecting all communication connections), even if AH confirms that the SPA data packet sent by the first IH has been successfully verified, AH will not reply to the first IH with any message. Therefore, the first IH cannot know that AH has opened the port for establishing encrypted communication. So, the first IH can only wait for a preset time before sending a handshake packet to AH through the gateway. This handshake packet indicates a request to establish a communication connection. After AH verifies the received handshake packet, it sends a reply packet to the first IH. This reply packet indicates confirmation that a communication connection can be established. After receiving the reply packet, the first IH can confirm that AH has agreed to its request to establish a communication connection and has opened the service access port for it, that is, opened the port for establishing encrypted communication. Thus, the first IH can confirm that the authentication between it and AH has been successful and that a communication connection can be established with AH. Furthermore, the first IH can establish a communication connection with AH through the service access port opened by AH based on multiple data packets for establishing a communication connection. When the second IH or the Nth IH authenticates with the AH and establishes a communication connection, the above steps are repeated. Here, N is an integer greater than 2.
[0006] In scenarios where multiple IHs need to authenticate with an AH and establish a communication connection, it is impossible to determine whether the AH has opened its service access port. Therefore, each IH must first send an SPA data packet, wait for a preset time, and then send a handshake packet to the AH through the gateway to request the establishment of a communication connection. Only after receiving a reply packet from the AH in response to the handshake packet can it be confirmed that the IH has authenticated the user and that a communication connection can be established. This results in low efficiency and a poor user experience when multiple IHs authenticate with the AH and establish a communication connection. Summary of the Invention
[0007] This application provides a method, apparatus, and electronic device for transmitting information, to solve the problem of low efficiency in authentication and communication connection establishment between multiple IHs and AHs. The specific implementation scheme is as follows:
[0008] In a first aspect, this application provides a method for sending information, applied to a gateway, the method comprising:
[0009] Based on the received first reply packet, a notification message is sent to the session initiating host IH cluster; wherein, the first reply packet is sent by the session receiving host AH, and the notification message indicates that AH is the public Internet Protocol IP address of the gateway and its open access port;
[0010] Receive a first combined packet; wherein the first combined packet is sent by the target IH based on the notification message, the target IH is any IH in the IH cluster, and the first combined packet is a handshake packet carrying single-packet authorization SPA data packet information;
[0011] Based on the first combined packet, a second combined packet is determined and sent to the AH; wherein, the first source port in the first combined packet corresponds to the second source port in the second combined packet.
[0012] Through the above-described embodiments, based on the received first reply packet, a notification message is sent to the IH cluster, enabling all IHs in the IH cluster to know the open access port of the AH, rather than only IHs requesting to establish a communication connection with the AH knowing the open access port of the AH. This improves the ability of IHs to know the open status of the AH's access port. Then, after sending the notification message to the IH cluster, it is not necessary to receive two data packets (i.e., the SPA data packet and the handshake packet). Instead, a handshake packet carrying the SPA data packet information (i.e., the first combined packet) can be received in one go. This allows the IH to send information for authentication and request to establish a communication connection, thereby reducing the number of data packet receptions and the waiting time between receiving the SPA data packet and the handshake packet. Consequently, the efficiency of authentication and communication connection between the target IH and the AH in the IH cluster is improved.
[0013] In one possible implementation, before sending a notification message to the session-initiating host IH cluster based on the received first reply packet, the method further includes:
[0014] Receive subscription request; wherein the subscription request is sent by the target IH, and the subscription request contains at least a first source IP address, the first source IP address being the IP address of the target IH;
[0015] If the first source IP address is within the preset IP address range, then an agreement message is sent to the target IH, and the target IH is added to the IH cluster.
[0016] In one possible implementation, after sending the second combined packet to the AH, the method further includes:
[0017] The system receives a second reply packet and reads the message information and destination information in the second reply packet; wherein the second reply packet is sent by the AH based on the second combined packet, and the destination information includes a first destination IP address and a first destination port, and the first destination IP address is the public IP address;
[0018] In response to the target IH corresponding to the destination information being the target IH in the record information, a feedback message is sent to the IH cluster; wherein, the feedback message indicates that the AH extends the original valid time length of the access port opening based on a preset time length.
[0019] Secondly, this application provides a method for sending information, applied to a session initiating host (IH), the method comprising:
[0020] The receiving gateway receives a notification message returned by the first reply packet sent by the session accept host AH; wherein, the notification message indicates that AH is the public Internet Protocol IP address of the gateway and an open access port;
[0021] Based on the notification message, a first combined packet is encapsulated and sent to the gateway, so that the gateway determines a second combined packet based on the first combined packet and sends the second combined packet to the AH; wherein, the first combined packet is a handshake packet carrying single-packet authorization SPA data packet information, and the first source port in the first combined packet corresponds to the second source port in the second combined packet.
[0022] Through the above-described embodiments, based on the notification message returned by the gateway after receiving the first reply packet sent by the AH, the open status of the AH's access port can be promptly ascertained. Based on this notification message, the SPA data packet sending strategy can be adjusted in a timely manner to employ a more efficient SPA data packet sending strategy, thereby improving the efficiency of authentication and communication connection establishment between the IH and AH. Furthermore, after learning that the AH's access port is open, the IH can directly attempt to authenticate with the AH and establish a communication connection based on the handshake packet (i.e., the first combined packet) carrying SPA data packet information, in order to access the resources protected by the AH. This embodiment avoids the waiting time after sending SPA data packets, thereby reducing the time spent on authentication and communication connection establishment with the AH, thus improving the efficiency of authentication and communication connection establishment between the IH and AH.
[0023] In one possible implementation, prior to the notification message returned by the receiving gateway based on the first reply packet sent by the session accepting host AH, the following steps are also included:
[0024] Send a subscription request to the gateway; wherein the subscription request contains at least a first source IP address, the first source IP address being the IP address of the IH;
[0025] A consent message is received, and based on the consent message, a communication connection is established with the gateway; wherein the consent message is sent by the gateway based on the first source IP address.
[0026] Thirdly, this application provides a method for sending information, applied to a session receiving host (AH), the method comprising:
[0027] A first reply packet is sent to the gateway so that the gateway sends a notification message to the session initiating host IH cluster, and upon receiving the first combined packet, a second combined packet is determined; wherein, the notification message indicates that the AH is the public Internet Protocol IP address of the gateway, the first combined packet is a handshake packet carrying single-packet authorization SPA data packet information, and the first source port in the first combined packet corresponds to the second source port in the second combined packet;
[0028] Receive the second combined packet; wherein the second combined packet is sent by the gateway.
[0029] In the above-described embodiment, a first reply packet is sent to the gateway, enabling both the gateway and the IHs in the IH cluster to know that the AH has opened its access port. This allows the IHs in the IH cluster to directly send a handshake packet (i.e., a first combined packet) carrying SPA data packet information to authenticate with the AH and request to establish a communication connection. Then, the AH can directly receive a second combined packet sent by the gateway based on the first combined packet to authenticate the IH and determine whether the IH can establish a communication connection. Through this embodiment, only the second combined packet needs to be received once for authenticating the IH and determining whether the IH can establish a communication connection, eliminating the need to receive two data packets (i.e., the SPA data packet and the handshake packet). This reduces the number of data packet receptions and improves the efficiency of IH authentication and connection establishment within the IH cluster.
[0030] In one possible implementation, after receiving the second combined package, the method further includes:
[0031] Based on a preset time length, the original effective time length of the access control policy is extended; wherein, the access control policy instructs that the access port be opened for the public IP address of the gateway; and,
[0032] A second response packet is encapsulated and sent to the gateway, so that the gateway sends a feedback message to the IH cluster based on the second response packet; wherein the feedback message indicates that the AH extends the original valid time length of the access port opening based on the preset time length.
[0033] Fourthly, this application also provides an information transmission device applied to a gateway, the device comprising:
[0034] The first sending module is used to send a notification message to the session initiating host IH cluster based on the received first reply packet; wherein the first reply packet is sent by the session receiving host AH, and the notification message indicates that AH is the public Internet Protocol IP address of the gateway and its open access port;
[0035] A first receiving module is configured to receive a first combined packet; wherein the first combined packet is sent by a target IH based on the notification message, the target IH is any IH in the IH cluster, and the first combined packet is a handshake packet carrying single-packet authorization SPA data packet information.
[0036] A first processing module is configured to determine a second combined packet based on the first combined packet and send the second combined packet to the AH; wherein the first source port in the first combined packet corresponds to the second source port in the second combined packet.
[0037] In one possible implementation, the first sending module is specifically used to receive a subscription request; wherein the subscription request is sent by the target IH, and the subscription request contains at least a first source IP address, the first source IP address being the IP address of the target IH; if the first source IP address is within a preset IP address range, an agreement message is sent to the target IH, and the target IH is added to the IH cluster.
[0038] In one possible implementation, the first processing module is specifically configured to receive a second reply packet and read the message information and destination information in the second reply packet; wherein the second reply packet is sent by the AH based on the second combined packet, and the destination information includes a first destination IP address and a first destination port, wherein the first destination IP address is the public IP address; in response to the IH corresponding to the destination information being the target IH in the record information, a feedback message is sent to the IH cluster; wherein the feedback message indicates that the AH extends the original valid time length of the access port opening based on a preset time length.
[0039] Fifthly, this application also provides an information sending apparatus, applied to any IH in a session initiating host (IH), the apparatus comprising:
[0040] The second receiving module is used to receive a first reply packet sent by the gateway based on the session receiving host AH, and a notification message returned therefrom; wherein, the notification message indicates that AH is the public Internet Protocol IP address open access port of the gateway;
[0041] The second processing module is used to encapsulate a first combined packet based on the notification message and send the first combined packet to the gateway, so that the gateway determines a second combined packet based on the first combined packet and sends the second combined packet to the AH; wherein, the first combined packet is a handshake packet carrying single-packet authorization SPA data packet information, and the first source port in the first combined packet corresponds to the second source port in the second combined packet.
[0042] In one possible implementation, the second receiving module is specifically configured to send a subscription request to the gateway; wherein the subscription request includes at least a first source IP address, the first source IP address being the IP address of the IH; receive an agreement message, and based on the agreement message, determine to establish a communication connection with the gateway; wherein the agreement message is sent by the gateway based on the first source IP address.
[0043] Sixthly, this application also provides an information sending apparatus applied to a session receiving host AH, the apparatus comprising:
[0044] The second sending module is used to send a first reply packet to the gateway so that the gateway sends a notification message to the session initiating host IH cluster, and determines a second combination packet upon receiving the first combination packet; wherein, the notification message indicates that the AH is the public Internet Protocol IP address open access port of the gateway, the first combination packet is a handshake packet carrying single-packet authorization SPA data packet information, and the first source port in the first combination packet corresponds to the second source port in the second combination packet;
[0045] The third processing module is used to receive the second combined packet; wherein the second combined packet is sent by the gateway.
[0046] In one possible implementation, the third processing module is specifically configured to extend the original effective time length of the access control policy based on a preset time length; wherein the access control policy indicates that the access port is opened for the public IP address of the gateway; and to encapsulate a second reply packet and send the second reply packet to the gateway, so that the gateway sends a feedback message to the IH cluster based on the second reply packet; wherein the feedback message indicates that the AH extends the original effective time length of the access port being open based on the preset time length.
[0047] In a seventh aspect, this application provides an electronic device, comprising:
[0048] Memory, used to store computer programs;
[0049] When a processor executes a computer program stored in the memory, it implements the above-described method steps for sending information.
[0050] Eighthly, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described method steps for sending information. Attached Figure Description
[0051] Figure 1 A flowchart of an information transmission method provided in this application embodiment Figure 1 ;
[0052] Figure 2 A flowchart of an information transmission method provided in this application embodiment Figure 2 ;
[0053] Figure 3 A flowchart of an information transmission method provided in this application embodiment Figure 3 ;
[0054] Figure 4 A schematic diagram illustrating the processing steps of the information transmission method provided in this application embodiment;
[0055] Figure 5 A schematic diagram of an information transmitting device provided in an embodiment of this application. Figure 1 ;
[0056] Figure 6 A schematic diagram of an information transmitting device provided in an embodiment of this application. Figure 2 ;
[0057] Figure 7 A schematic diagram of an information transmitting device provided in an embodiment of this application. Figure 3 ;
[0058] Figure 8 A schematic diagram of an electronic device provided in this application. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The specific operational methods in the method embodiments can also be applied to the device embodiments or system embodiments. It should be noted that in the description of this application, "multiple" is understood as "at least two". "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. A connected to B can represent: A and B directly connected, and A and B connected through C. Furthermore, in the description of this application, terms such as "first" and "second" are used only for distinguishing the purpose of description and should not be construed as indicating or implying relative importance or order.
[0060] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0061] In SDP, when multiple IHs authenticate with an AH and establish a communication connection, each IH must first send an SPA message to the AH, and then send a handshake packet to the AH after a preset time to attempt to establish a communication connection. This results in low efficiency when multiple IHs authenticate with an AH and establish a communication connection.
[0062] Therefore, this application proposes a method for sending information, which is applied in a Network Address Port Translation (NAPT) environment.
[0063] The above information transmission method can be applied to a gateway. After receiving the first reply packet sent by the AH, a notification message is sent to the IH cluster so that all IHs in the IH cluster are aware that the AH has opened its access port. Then, when receiving data packets sent by the target IH in the IH cluster, the handshake packet carrying SPA data packet information (i.e., the first combined packet) can be received directly. Based on this first combined packet, the target IH can then authenticate with the AH and establish a communication connection. Compared to receiving two data packets from the target IH before determining whether the authentication between the target IH and the AH was successful and whether a communication connection can be established, receiving only one data packet from the target IH is sufficient to determine the authentication success and the establishment of a communication connection. This reduces the number of data packets received from the target IH and avoids the waiting between receiving the SPA data packet and the handshake packet, thereby improving the efficiency of the target IH authenticating with the AH and establishing a communication connection.
[0064] Reference Figure 1 The diagram shows a flowchart of an information transmission method provided in an embodiment of this application. Figure 1 This method is specifically applied to gateways. The method includes:
[0065] S11, based on the received first reply packet, send a notification message to the IH cluster.
[0066] The first reply packet is sent by AH, and the notification message indicates that AH has opened the access port for the gateway's public IP address.
[0067] Before sending a notification message to the IH cluster, first identify the IH cluster.
[0068] In one possible implementation, when determining the IH cluster, the decision to add the target IH to the IH cluster is made based on the subscription request sent by the target IH, thereby achieving the purpose of determining the IH cluster.
[0069] First, a subscription request is received. This subscription request is sent by the target IP address and contains at least a first source IP address. This first source IP address is the IP address of the target IP address.
[0070] In this embodiment of the application, various information transmission methods can be used to receive subscription requests. For example, subscription requests can be received via multicast protocols or Message Queuing Telemetry Transport (MQTT) protocols.
[0071] Then, it is determined whether the first source IP address is within the preset IP address range. This preset IP address range is, for example, 192.168.1.1-192.168.1.100.
[0072] If the first source IP address is not within the preset IP address range, the target IH will be refused entry into the IH cluster, and a gateway rejection message will be sent to the target IH. This gateway rejection message indicates that a communication connection with the target IH is refused.
[0073] If the first source IP address is within the preset IP address range, the target IP address is added to the IP address cluster, and an agreement message is sent to the target IP address. This agreement message indicates that a communication connection with the target IP address is permitted.
[0074] In this embodiment of the application, when sending a message to the target IH, the system can also determine whether to refuse to establish a communication connection with the target IH or to agree to establish a communication connection with the target IH based on the subscription identifier in the sent information. For example, if the subscription identifier is a first preset value, it indicates that the system refuses to establish a communication connection with the target IH; if the subscription identifier is a second preset value, it indicates that the system agrees to establish a communication connection with the target IH.
[0075] Using the above method, based on the subscription request received from the target IPH, and according to the judgment result of whether the first source IP address (i.e., the IP address of the target IPH) is within the preset IP address range, it is determined whether to agree to establish a communication connection with the target IPH. After agreeing to establish a communication connection with the target IPH, the target IPH is added to the IH cluster. By using the above method of adding the target IPH to the IH cluster, other eligible IPHs can also be added to the IH cluster, thereby defining the IH cluster. This allows subsequent messages to be sent directly to the IH cluster, ensuring that every IPH in the IH cluster is aware of the message.
[0076] Furthermore, after identifying the IH cluster and before receiving the first reply packet, it is necessary to first receive the first SPA data packet sent by the first IH in the IH cluster, as well as the first handshake packet sent by the first IH. This first IH is the first IH in the IH cluster to authenticate with the AH and attempt to establish a communication connection when it is unaware that the AH has an open access port.
[0077] Specifically, when receiving the first SPA data packet sent by the first IH, a fourth source port is randomly generated for the third source port of the first IH, and the second source IP address in the first SPA data packet is modified to the third source IP address to obtain the second SPA data packet. Here, the third source port is the port of the first IH; the fourth source port is the port of the gateway; the second source IP address is the IP address of the first IH; and the third source IP address is the public IP address of the gateway.
[0078] The first SPA packet mentioned above contains at least a second source IP address, a third source port, a second destination IP address, and a second destination port; the second SPA packet contains at least a fourth source port, a third source IP address, a second destination IP address, and a second destination port. The second destination IP address is the IP address of the AH, such as 200.1.1.1; the second destination port is the port on which the AH receives SPA packets, such as 1234. This second destination IP address and second destination port can be obtained from the configuration information of the first IH, or they can be provided by the fourth-party device.
[0079] In this embodiment of the application, when a fourth source port is randomly generated for the third source port and the second source IP address is modified to the third source IP address, the gateway's network address port conversion function can be used to randomly generate a fourth source port for the third source port and modify the second source IP address to the third source IP address. For example, if the second source IP address and the third source port are "192.168.1.10:5555", then the third source IP address and the fourth source port can be "100.1.1.1:2222".
[0080] Next, the message information contained in the first and second SPA packets, as well as the correspondence between the third source port, the second source IP address, and the fourth source port, are recorded in the log information. The message information contained in each of the first and second SPA packets includes at least the source IP address, source port, destination IP address, destination port, and packet type. This packet type can be an SPA packet.
[0081] The correspondence between the third source port, the second source IP address, and the fourth source port can be seen as follows: the second source IP address and the third source port corresponding to the fourth source port "2222" are "192.168.1.10:5555". Simultaneously, the message information in the record records that the IH corresponding to this second source IP address and the third source port "192.168.1.10:5555" is the first IH. Therefore, based on the correspondence between the third source port, the second source IP address, and the fourth source port in the record information, the IH corresponding to the fourth source port can be determined.
[0082] Then, based on the second destination IP address and second destination port in the second SPA data packet, the second SPA data packet is sent to the port of AH that receives SPA data packets.
[0083] It should be noted that, in this embodiment, the second SPA data packet can be sent to the AH first, and then the message information contained in the first and second SPA data packets, as well as the correspondence between the third source port, the second source IP address, and the fourth source port, can be recorded in the record information simultaneously with sending the second SPA data packet to the AH.
[0084] Furthermore, after a first preset time, the first handshake packet sent by the first IH is received. When the first IH sends the first handshake packet using Datagram Transport Layer Security (DTLS), this first handshake packet can be a Client Hello handshake packet. This first handshake packet indicates that the first IH requests to establish a communication connection. This first handshake packet also contains at least a second source IP address, a fifth source port, a second destination IP address, and a third destination port. The fifth source port is the port of the first IH, and the third destination port is the port used by the AH to receive the handshake packet.
[0085] It should be noted that in this embodiment, the third source port is the port where the first IH sends the first SPA data packet, and the fifth source port is the port where the first IH sends the first handshake packet. Therefore, the fifth source port is different from the third source port. Similarly, the third destination port is the port where the AH receives the handshake packet, and the second destination port is the port where the AH receives the SPA data packet. Therefore, the third destination port is also different from the second destination port. For example, the second destination port might be 1234, and the third destination port might be 5678.
[0086] Upon receiving the first handshake packet from the first IH, the processing steps are consistent with those of the first SPA packet, where a sixth source port is randomly generated for the fifth source port. This sixth source port is the gateway's port and is different from the fourth source port. The second source IP address is then modified to the third source IP address to obtain the second handshake packet. The message information contained in both the first and second handshake packets, as well as the correspondence between the fifth source port, the second source IP address, and the sixth source port, are then recorded in the log information; and this second handshake packet is sent to the AH.
[0087] The second handshake packet mentioned above must contain at least a sixth source port, a third source IP address, a second destination IP address, and a third destination port. The message information contained in both the first and second handshake packets must include at least a source IP address, a source port, a destination IP address, a destination port, and a packet type. This packet type can be a Client hello handshake packet.
[0088] Furthermore, after sending the second handshake packet to AH, the system receives the first reply packet sent by AH based on the second handshake packet. The correctness of this first reply packet is then verified. This first reply packet contains at least the first destination IP address, the fourth destination port, the fourth source IP address, and the seventh source port. The first destination IP address is the public IP address of the gateway, the fourth destination port is the gateway's port, the fourth source IP address is AH's IP address, and the seventh source port is AH's port.
[0089] In one possible implementation, when verifying the correctness of the first reply packet, the message information and destination information within the first reply packet are first read. This destination information includes the first destination IP address and the fourth destination port.
[0090] Then, if the IH corresponding to the target information is determined to be the first IH in the record information, then the first response packet is determined to be the correct response packet.
[0091] Using the above method, based on the destination information in the message information of the reply packet, the IH corresponding to the reply packet can be determined. Then, based on the comparison result between the IH corresponding to the reply packet and the IH in the record information, the correctness of the reply packet can be determined, thus confirming that the AH corresponding to the reply packet has an open access port. This access port is consistent with the third destination port.
[0092] In one possible implementation, when determining that the IH corresponding to the target information is the first IH in the record information, the IH corresponding to the target information is first determined, then the first IH is determined in the record information, and then it is determined that the IH corresponding to the target information and the first IH are the same IH.
[0093] First, based on the first destination IP address and the fourth destination port in the destination information, check in the record information whether there is a corresponding relationship for the fourth destination port.
[0094] If there is no corresponding relationship for the fourth destination port in the record information, it is directly determined that the IH corresponding to the destination information is not the same as the first IH, and the first reply packet is determined to be an incorrect reply packet.
[0095] If a mapping exists for a fourth destination port in the log information, the source IP address and source port corresponding to that fourth destination port can be determined from the log information. Then, based on the IH (Internet Information Center) corresponding to the source IP address and source port in the log information, the IH (Internet Information Center) corresponding to the fourth destination port can be determined.
[0096] In this embodiment of the application, the source IP address and source port corresponding to the fourth destination port in the recorded information are the second source IP address and the fifth source port, respectively.
[0097] Next, in the recorded information, we identify a first message containing an SPA packet type and a second message containing a handshake packet type. The source IP address in the first message is consistent with the source IP address in the second message, and both source IP addresses are the second source IP address. Therefore, the IH corresponding to the source IP address in either the first or second message is determined to be the first IH.
[0098] If the source IP address and source port corresponding to the fourth destination port are inconsistent with the source IP address and source port of the first IH, then it is determined that the IH corresponding to the fourth destination port is not the same IH as the first IH.
[0099] If the source IP address and source port corresponding to the fourth destination port are the same as the source IP address and source port of the first IH, then it is determined that the IH corresponding to the fourth destination port and the first IH are the same IH.
[0100] In another possible implementation, when verifying the correctness of the first reply packet, firstly, by parsing the first reply packet, based on the fourth source IP address and the seventh source port in the first reply packet, it is determined that the first reply packet was sent by AH. Then, by parsing the first reply packet, the first destination IP address and the fourth destination port in the first reply packet are determined. For example, the first destination IP address is 100.1.1.1, and the fourth destination port is 3333. Simultaneously, by parsing the first reply packet, the data packet type of the first reply packet can be determined. For example, the data packet type could be Server Hello or Hello VerityRequest, which indicates an acknowledgment reply to IH requesting the establishment of a communication connection.
[0101] Then, check the log information to see if a fourth destination port exists.
[0102] If the fourth destination port is not found in the log information, it is determined that the IH cluster has no IH request to establish a communication connection with AH.
[0103] If a fourth destination port exists in the log information, the source IP address and source port corresponding to that fourth destination port are determined from the mapping relationship of that fourth destination port. For example, if the fourth destination port is 3333, and the log information records that the source IP address and source port corresponding to port 3333 are 192.168.1.2:1677, and the IH corresponding to this source IP address and source port is the first IH, then the IH corresponding to the fourth destination port is determined to be the first IH. Therefore, it is determined that the first reply packet is a reply to the first IH.
[0104] Next, in the record information, check whether there is message information contained in the first SPA packet and the first handshake packet sent by the first IH.
[0105] If not, then the first response packet is determined to be an incorrect response packet.
[0106] If so, then the first reply packet is confirmed to be the correct reply packet, confirming that AH has opened the access port.
[0107] After confirming that the first reply packet is correct, a notification message is sent to the IH cluster so that the IHs in the IH cluster can determine the open access port of the AH. Furthermore, the first reply packet can be forwarded to the first IH to confirm that the AH has agreed to the request to establish a communication connection. The first IH can then establish a communication connection with the AH through the connection establishment data packet and access the resources protected by the AH. Simultaneously, based on the first reply packet, the first IH also confirms that its authentication has been successful.
[0108] It should be noted that when forwarding the first reply packet to the first IH, the first reply packet must first undergo NAPT translation before being sent to the first IH. Here, NAPT translation restores the fourth destination port in the first reply packet back to the port of the first IH, i.e., the fifth source port, and restores the first destination IP address in the first reply packet back to the IP address of the first IH, i.e., the second source IP address.
[0109] In this embodiment of the application, when sending a notification message to the IH cluster, the notification message can be sent to each IH in the IH cluster. Alternatively, the notification message can be sent to the IH cluster, and then each IH in the IH cluster can download the notification message from the various messages in the IH cluster itself.
[0110] Furthermore, in this embodiment, when sending a notification message to the IH cluster, if the subscription request was received using a multicast protocol, the notification message can be sent to the IH cluster via the multicast IP address. This multicast IP address is a pre-configured IP address of the gateway, such as 224.1.1.1.
[0111] If the subscription request is received via the MQTT protocol, a notification message is sent to the IH cluster using a published topic. This published topic indicates the notification message.
[0112] S12, Receive the first combined packet.
[0113] The first combined packet is sent by the target IH based on a notification message. The target IH is any IH in the IH cluster. The first combined packet is a handshake packet carrying SPA data packet information. The first combined packet contains at least a first source IP address, a first source port, a third destination port, and a second destination IP address. The first source port is the port of the target IH. The third destination port is the access port opened by the AH.
[0114] In step S11, a notification message is sent to the IH cluster so that the target IH in the IH cluster knows that the AH has opened the access port and then receives the first combined packet sent by the target IH.
[0115] S13, based on the first combined packet, determine the second combined packet, and send the second combined packet to AH.
[0116] In this configuration, the first source port in the first packet corresponds to the second source port in the second packet. This second source port is the gateway's port. The aforementioned second packet contains at least the second source port, the third source IP address, the third destination port, and the second destination IP address.
[0117] After receiving the first combined packet, a second combined packet is determined based on the first combined packet, and the second combined packet is sent to AH.
[0118] In this embodiment of the application, the implementation steps of determining the second combination packet based on the first combination packet and sending the second combination packet to AH are the same as the implementation steps after receiving the first SPA data packet and the first handshake packet in step S11, and will not be repeated here.
[0119] It should be noted that the message information contained in the first and second combined packets recorded in the log information includes at least SPA packets and handshake packets. Furthermore, if the target IH is not the same as the first IH, the second source port in the second combined packet will not be the same as the fourth or sixth source port. In this embodiment, the source ports of the IH (i.e., the first, third, and fifth source ports) correspond one-to-one with the source ports of the gateway (i.e., the second, fourth, and sixth source ports). Based on the source ports corresponding to the IH, services can be identified. Therefore, when the source ports of the IH correspond one-to-one with the source ports of the gateway, the service or application communicating with the AH can be determined.
[0120] In one possible implementation, after sending the second combined packet to the AH, a second reply packet is received, and the message information and destination information within the second reply packet are read. The second reply packet is sent by the AH based on the second combined packet, and the destination information includes a first destination IP address and a first destination port, where the first destination port is the gateway's port. Specifically, the second reply packet includes at least the first destination IP address, the first destination port, a fourth source IP address, and a seventh source port. Next, in response to the IH corresponding to the destination information being the target IH in the record information, a feedback message is sent to the IH cluster. This feedback message instructs the AH to extend the original valid time length of the access port opening based on a preset time length.
[0121] Similarly, when the IH cluster sends a feedback message, it can also forward a second reply packet to the target IH. When forwarding the second reply packet to the target IH, it is also necessary to first perform NAPT translation on the second reply packet before sending the translated second reply packet to the target IH. Here, NAPT translation restores the first destination port in the second reply packet back to the target IH's port, i.e., the first source port, and restores the first destination IP address in the second reply packet back to the target IH's IP address, i.e., the first source IP address.
[0122] In this embodiment of the application, the implementation steps after sending the second combined packet to AH are in the same principle as the implementation steps after sending the second handshake packet to AH in step S11, and will not be described again here.
[0123] In summary, the information transmission method proposed in this application, when applied to a gateway, determines the open access port of the AH based on the comparison result of the first reply packet from the AH and the recorded information. Subsequently, it sends a notification message to the IH cluster so that the IHs in the IH cluster are aware that the AH has an open access port. Then, based on the first combined packet received from the target IH, it determines the second combined packet and sends the second combined packet to the AH, enabling the AH to authenticate the target IH and determine whether the target IH can establish a communication connection. Through this method, when the AH opens its access port, all IHs in the IH cluster are aware that the AH has opened its access port. This avoids the situation where multiple IHs first send SPA data packets to the AH for authentication, wait a certain time, and then send handshake packets to attempt to establish a communication connection. This reduces the time spent on authentication and connection establishment between multiple IHs and the AH, improves efficiency, and enhances the user experience.
[0124] Furthermore, by subscribing to multiple IHs in the IH cluster, messages can be sent directly to the IH cluster so that all IHs in the IH cluster can receive the message. This enables efficient and secure group notifications within the intranet and allows for differentiated management of different IHs.
[0125] Based on the same inventive concept, this application provides a method for sending information. This method is applied to any IH in an IH cluster. Please refer to... Figure 2 The implementation steps of this method include:
[0126] S21, Receive the first reply packet sent by the gateway based on AH, and the returned notification message.
[0127] The notification message indicates that AH is the public IP address of the gateway, which is an open access port. This gateway can be a Network Address Translation (NAT) gateway, or a router, firewall, or other device with NAT functionality. In other words, the gateway can be a device with NAT capabilities.
[0128] In this embodiment of the application, a communication connection is established with the gateway before receiving the notification message.
[0129] In one possible implementation, when establishing a communication connection with the gateway, a subscription request is first sent to the gateway. This subscription request contains at least a first source IP address, which is the IP address of IH.
[0130] If a gateway rejection message is received from the gateway, it indicates that the communication connection with the gateway has failed to be established. At this point, you can try to establish a communication connection with the gateway again, or try to establish a communication connection with another gateway.
[0131] If a consent message is received from the gateway, it is confirmed that the communication connection with the gateway has been successfully established, and that the IH has joined the IH cluster. Therefore, the development status of the target AH's access port can be determined based on messages sent from the gateway to the IH cluster.
[0132] In one possible implementation, when a notification message is received, it can be downloaded from various messages in the IH cluster.
[0133] S22, based on the notification message, encapsulate the first combination packet and send the first combination packet to the gateway, so that the gateway determines the second combination packet based on the first combination packet and sends the second combination packet to AH.
[0134] The first combined packet is a handshake packet carrying SPA data packet information. The first source port in the first combined packet corresponds to the second source port in the second combined packet. The first source port is the IH port, and the second source port is the gateway port.
[0135] After receiving the notification message in step S21 and confirming that the AH access port is open, a first combined packet is encapsulated, that is, the SPA data packet information is encapsulated into the handshake packet to obtain the first combined packet. The SPA data packet information includes, but is not limited to, timestamps, random numbers, client identity documents (clientID), and hash-based message authentication codes (HMAC). The handshake packet information includes, but is not limited to, timestamps, handshake packet type, and random numbers. The handshake packet type can be Client Hello.
[0136] When encapsulating the first combined packet, SPA packet information can be padded to the end of the handshake packet information.
[0137] Then, the first combined packet is sent to the gateway. The gateway then transmits the information from this first combined packet to the AH.
[0138] In one possible implementation, a countdown timer is started before the first packet is encapsulated. The countdown timer is equal to the original valid duration of the AH open access port. Therefore, the first packet can be encapsulated at any time during the countdown timer's startup.
[0139] In this embodiment, the countdown time can be obtained from the IH's configuration information. Simultaneously, the AH's configuration information also presets the original valid time length. This ensures that the countdown time matches the original valid time length of the AH's open access port.
[0140] In one possible implementation, after sending a first combo packet to the gateway, enabling the gateway to determine a second combo packet based on the first combo packet, and sending the second combo packet to the AH, a second reply packet is received, as well as a feedback message is received.
[0141] In this process, the second response packet is sent by AH to the gateway based on the second combined packet. The gateway, after verifying the accuracy of the second response packet, then sends it to the IH cluster. Based on this second response packet, IH can confirm that AH has agreed to the request to establish a communication connection. IH can then establish a communication connection with AH based on the connection establishment packet and access the resources protected by AH. Simultaneously, the second response packet also confirms that identity authentication has been successfully completed.
[0142] The aforementioned feedback message is sent by the gateway to the IH cluster based on the second reply packet. This feedback message indicates that AH extends the original effective time of the access port opening based on a preset time length. This allows the determination of the effective time length of AH's access control policy, and thus the adjustment of the countdown timer based on this effective time length.
[0143] In one possible implementation, if no notification message is received in step S21, the countdown start device is in an inactive state. At this time, a first SPA data packet is encapsulated and sent to the gateway. Then, after a first preset time, a second handshake packet is encapsulated and sent to the gateway. After sending the second handshake packet, if a notification message is received, it can be confirmed that the AH has opened its access port. Next, the countdown time of the countdown device is adjusted, and the countdown device is started. After the countdown device is started, within the countdown time range, a communication connection can be established with the AH through the gateway, and the resources protected by the AH can be accessed through the gateway.
[0144] In the application embodiment, the state of the countdown device can be used to adjust whether to send the first combined packet or to send the first SPA data packet and the first handshake packet sequentially.
[0145] In summary, the information transmission method proposed in this application, when applied to any IH in an IH cluster, can determine the open access port of the AH based on the notification message sent by the gateway to the IH cluster. Subsequently, the SPA data packet information and the handshake packet can be encapsulated into a first combined packet, which is then directly sent to the gateway. The gateway then forwards the information from the first combined packet to the AH, enabling the AH to authenticate the IH and confirm whether a communication connection can be established. Through this method, the open status of the AH's access port is promptly obtained based on the notification message sent by the gateway to the IH cluster. After confirming that the AH's access port is open, only one first combined packet needs to be sent from the gateway to the AH to attempt authentication and establish a communication connection. This improves the efficiency of authentication and connection establishment without compromising SDP security.
[0146] Based on the same inventive concept, this application provides a method for sending information, which is applied to AH. Please refer to [link / reference]. Figure 3 The implementation steps of this method include:
[0147] S31, send a first reply packet to the gateway so that the gateway sends a notification message to the IH cluster, and determine the second combination packet upon receiving the first combination packet.
[0148] The notification message indicates that AH is the public IP address of the gateway, and the first packet is a handshake packet carrying SPA data packet information. The first source port in the first packet corresponds to the second source port in the second packet. The first source port is the port of the target IH, which is any IH in the IH cluster, and the second source port is the port of the gateway.
[0149] In this embodiment, before sending the first reply packet to the gateway, a second SPA data packet is received. When the first IH corresponding to the second SPA data packet is a valid IH, a new access control policy is added. Subsequently, a second handshake packet is received, and it is determined that the second handshake packet conforms to the newly added access control policy.
[0150] The newly added access control policy specifies that access ports should be opened for the gateway's public IP address, meaning that data packets originating from the first destination IP address are allowed to access the target port. This first destination IP address is the gateway's public IP address. Furthermore, the aforementioned access control policy is a dynamic access control policy. Based on this access control policy, it can be ensured that only resources protected by IH (Internet Access Control) that conform to this access control policy and are legally valid can access them.
[0151] In one possible implementation, when it is determined that the first IH corresponding to the second SPA data packet is a valid IH, firstly, the HMAC is calculated according to a preset key and a preset algorithm; and then the HMAC carried in the SPA data packet is read. Then, it is determined whether the calculated HMAC matches the HMAC carried in the SPA data packet.
[0152] If the calculated HMAC does not match the HMAC carried in the SPA packet, then the first IH is determined to be an invalid IH.
[0153] If the calculated HMAC matches the HMAC carried in the SPA packet, the first IH is determined to be a valid IH, and a new access control policy is added.
[0154] In this embodiment, when determining the preset key and preset algorithm, the preset key and preset algorithm can be determined based on the legality information of the SPA data packet contained in the AH configuration information, which includes the preset key and preset algorithm. Alternatively, the preset key and preset algorithm can be determined based on the preset key identifier and preset algorithm identifier carried in the SPA data packet. For example, if the preset key identifier is 1, it indicates that the preset key is the first data in the AH configuration information; if the preset algorithm identifier is 2, it indicates that the preset algorithm is the second algorithm in the algorithm list in the AH configuration information.
[0155] In one possible implementation, after receiving the second handshake packet, upon determining that the second handshake packet conforms to the newly added access control policy, firstly, the third source IP address in the second handshake packet is read. Then, it is determined whether this third source IP address matches the first destination IP address in the newly added access control policy.
[0156] If the third source IP address does not match the first destination IP address, the second handshake packet is discarded.
[0157] If the third source IP address is the same as the first destination IP address, then the second handshake packet is determined to conform to the newly added access control policy.
[0158] After determining that the second handshake packet conforms to the newly added access control policy, the data packet type of the second handshake packet is read. If the data packet type indicates a request to establish a communication connection, a first reply packet is sent to the gateway, causing the gateway to send a notification message to the IH cluster. Upon receiving the first combined packet, the gateway determines the second combined packet. This first reply packet indicates that a communication connection can be established. Therefore, based on this first reply packet, the gateway can confirm that the AH can establish a communication connection, and also confirms that the SPA data packet has passed authentication and that the access port is open to the public IP address.
[0159] S32, Receive the second combined packet.
[0160] The second packet is sent by the gateway.
[0161] After receiving the second packet, determine whether the third source IP address in the second packet matches the first destination IP address in the newly added access control policy.
[0162] If the third source IP address does not match the first destination IP address, the second packet is discarded.
[0163] If the third source IP address is the same as the first destination IP address, then the SPA packet information is read from the second combined packet.
[0164] Furthermore, after reading the SPA data packet information, the target IH is determined to be a legitimate IH based on the SPA data packet information. In this embodiment, the implementation step of determining the target IH as a legitimate IH based on the SPA data packet information is consistent with the principle of the implementation step of determining the first IH as a legitimate IH based on the second SPA data packet in step S31, and will not be repeated here.
[0165] In one possible implementation, after determining that the target IH is a legitimate IH, that is, after receiving the second combined packet, the original effective time length of the access control policy is extended based on a preset time length.
[0166] After the access control policy expires, the system will continue to authenticate the IH's identity and determine whether the IH can establish a communication connection by first receiving the SPA data packet and then the handshake packet.
[0167] Furthermore, after determining that the IH corresponding to the second combined packet is a legitimate IH—that is, after receiving the second combined packet—the data packet type of the handshake packet within it is read, and the data packet type indicates a request to establish a communication connection. A second reply packet is then encapsulated and sent to the gateway, enabling the gateway to send a feedback message to the IH cluster based on the second reply packet. This feedback message indicates that the AH extends the original valid time for opening the access port based on a preset time length.
[0168] When encapsulating the second reply packet, a fourth source IP address and a seventh source port, as well as a first destination IP address and a first destination port, are added. The fourth source IP address and the seventh source port can be used to determine AH. Simultaneously, the first destination IP address and the first destination port can be used to determine the target IH.
[0169] In the embodiments of this application, during the processes of steps S11-S13, S21-S22, and S31-S32, when IH and AH in the IH cluster perform identity authentication and establish a communication connection, they can perform identity authentication and establish a communication connection based on the DTLS protocol, or they can perform identity authentication and establish a communication connection based on the Mutual Transport Layer Security (MTLS) protocol.
[0170] When using the MTLS protocol, the handshake packet type can be either Synchronize Sequence Numbers (SYN) or Acknowledge Character (ACK).
[0171] In summary, the information transmission method proposed in this application allows AH to send a first reply packet to the gateway, enabling the gateway to send a notification message to the IH cluster. Upon receiving the first combined packet, AH determines the second combined packet, ensuring that both the gateway and the IH in the IH cluster are aware that AH has opened the access port. This allows the IH in the IH cluster to attempt authentication with AH and establish a communication connection by sending only one combined packet, reducing the time spent on authentication and connection establishment, and thus improving the efficiency of authentication and connection establishment.
[0172] Furthermore, based on the comparison result between the received second combined packet and the newly added access control policy, when the third source IP address in the second combined packet matches the first destination IP address in the newly added access control policy, the SPA packet information can be directly read from the second combined packet; then, based on the SPA packet information, the target IH corresponding to the second combined packet is determined to be a legitimate IH, and based on the handshake packet in the second combined packet, a second reply packet is sent to the gateway.
[0173] In this application embodiment, based on the comparison result between the received data packet and the newly added access control policy, it is determined whether to verify the legitimacy of the target IH corresponding to the SPA data packet by reading SPA data packet information from the data packet, or by directly receiving the SPA data packet. When the received data packet is a combined packet, that is, when the third source IP address in the data packet is consistent with the first destination IP address in the newly added access control policy, a second reply packet can be directly sent to the gateway based on the data packet. This allows the gateway and the IH in the IH cluster to confirm that the AH continues to open the access port. Furthermore, based on a preset time length, the original effective time length of the access port opening is extended, allowing the IH in the IH cluster to adjust the SPA data packet sending strategy and optimize the efficiency of identity authentication and establishing communication connections.
[0174] The technical solution of this application will be further explained below with reference to a specific application process.
[0175] like Figure 4 The diagram illustrates the processing flow of the information transmission method. First, the first IH sends a subscription request to the NAT gateway to establish a communication connection. Then, the NAT gateway receives the subscription request. If the IP address of the first IH is within a preset IP address range, the NAT gateway adds the first IH to the IH cluster and sends an agreement message to the first IH. Next, the first IH receives the agreement message and, based on it, determines whether to establish a communication connection with the NAT gateway. Similarly, subsequent IHs intending to establish a communication connection with the AH all join the IH cluster in the same manner.
[0176] After joining the IH cluster, the first IH sends a first SPA packet to the NAT gateway so that the NAT gateway can obtain a second SPA packet based on the first SPA packet. This first SPA packet contains a second source IP address, a third source port, a second destination IP address and port, and an HMAC address. The second source IP address is the IP address of the first IH, the third source port is the port of the first IH, the second destination IP address is the IP address of the AH, and the second destination port is the port on which the AH receives the SPA packet.
[0177] The NAT gateway receives the first SPA packet sent by the first IH. Then, the NAT gateway randomly generates a fourth source port for the third source port in the first SPA packet and modifies the second source IP address to the third source IP address, resulting in a second SPA packet. This fourth source port is the NAT gateway's port, and the third source IP address is the NAT gateway's public IP address. Next, the NAT gateway sends the second SPA packet to the AH so that the AH can verify the legitimacy of the first IH corresponding to the second SPA packet. Simultaneously, the NAT gateway records the message information contained in both the first and second SPA packets, as well as the one-to-one correspondence between the third source port in the first SPA packet and the fourth source port in the second SPA packet, through its recording module.
[0178] After receiving the second SPA data packet, the Access Control (AH) first verifies the validity of the first Internet Gateway (IH) corresponding to the second SPA data packet. If the first IH is valid, the AH creates an access control policy. This access control policy instructs that access ports be opened for the public IP address of the NAT gateway.
[0179] Furthermore, after a preset time, the first IH sends a first handshake packet to the NAT gateway. This first handshake packet indicates that the first IH requests to establish a communication connection. The first handshake packet contains a second source IP address, a fifth source port, a second destination IP address, and a third destination port. The fifth source port is the port of the first IH, and the third destination port is the port on which the AH receives the handshake packet.
[0180] The NAT gateway receives the first handshake packet. Then, consistent with the processing of received SPA packets, it randomly generates a sixth source port for the fifth source port and modifies the second source IP address to the third source IP address, resulting in the second handshake packet. This sixth source port is the NAT gateway's port. The NAT gateway sends this second handshake packet to the AH so that the AH can determine whether a communication connection can be established based on this second handshake packet. Simultaneously, the NAT gateway records the message information contained in both the first and second handshake packets, as well as the one-to-one correspondence between the fifth source port in the first handshake packet and the sixth source port in the second handshake packet, through its recording module.
[0181] AH receives the second handshake packet. If the third source IP address in the second handshake packet matches the IP address allowed to access the target port in the newly added access control policy, then AH sends a first reply packet to the first IH corresponding to the second handshake packet. The first reply packet indicates that a communication connection can be established; the target port matches the third destination port.
[0182] The NAT gateway receives the first reply packet. Then, the NAT gateway sends the first reply packet to the parsing module.
[0183] In the resolution module of the NAT gateway, parsing the first reply packet allows for the determination of whether it was sent by the Access Hack (AH). This prevents the attacker's first reply packet from being mistakenly identified as originating from the AH, thereby improving the security of communication authentication. After confirming that the first reply packet was sent by the AH, the first destination IP address and the fourth destination port within the packet are identified. The first destination IP address is the public IP address of the NAT gateway, and the fourth destination port is the NAT gateway's port. Then, the first destination IP address, the fourth destination port, and the type of the first reply packet are sent to the judgment and notification module, enabling the module to confirm whether the AH has opened the access port.
[0184] In the judgment and notification module of the NAT gateway, it queries whether the data stored in the record module contains the first and second packet information. The first packet information is the packet information contained in the SPA data packet sent from the IH corresponding to the first destination IP address and the fourth destination port to the AH; the second packet information is the packet information contained in the handshake packet sent from the IH corresponding to the first destination IP address and the fourth destination port to the AH. If the data stored in the record module contains the first and second packet information, it confirms that the AH has opened the access port. The first reply packet is then converted to NAPT and sent to the first IH; that is, the NAPT-converted first reply packet is sent to the first IH. Simultaneously, a notification message is sent to the IH cluster to enable the IHs in the IH cluster to confirm that the AH has opened the access port. This notification message indicates that the AH has opened the access port to public IP addresses.
[0185] In the IH cluster, the first IH receives the first reply packet and notification message after NAPT conversion via the receiving module, confirming that the AH has opened the access port. Then, it notifies the timing module to start a countdown timer. The countdown time in this timer is the original valid duration of the AH's open access port. Within the countdown range, a communication connection can be established with the AH through the NAT gateway, and resources protected by the AH can be accessed based on resource access request packets.
[0186] If the target IH in the IH cluster immediately receives the notification message through the receiving module, it confirms that the AH has opened the access port. It also notifies the timing module in the target IH to set the countdown.
[0187] In the timing module of the target IH, a countdown timer is started. The countdown time is the original valid duration of the open access port of the AH. The policy module is then notified to adjust the SPA packet sending policy.
[0188] If the receiving module in the target IH does not immediately receive the notification message from the IH cluster, it first determines the first time when the notification message was sent to the IH cluster and sends that first time to the timing module.
[0189] In the timing module within the target IH, the first time is received, and the second time to start the countdown device is determined. Then, the absolute value of the difference between the first and second times is calculated. It is then determined whether this absolute value is not greater than the original valid time length of the AH's open access port. If the absolute value is not greater than the original valid time length, the countdown time of the countdown device is set to the difference between the original valid time length and the absolute value. The policy module is then notified to adjust the SPA data packet sending strategy.
[0190] In the policy module of the target IH, if it is determined that the countdown device has been started, then the SPA packet sending policy is determined to be sending a handshake packet carrying SPA packet information. The sending policy is then sent to the construction module.
[0191] In the construction module of the target IH, based on this sending strategy, a handshake packet carrying SPA data packet information is encapsulated to obtain a first combined packet. This first combined packet is sent to the NAT gateway so that the NAT gateway can obtain a second combined packet based on the first combined packet.
[0192] The NAT gateway receives the first combined packet. Then, the NAT gateway randomly generates a second source port for the first source port in the first combined packet, and modifies the first source IP address in the first combined packet to a third source IP address, thus obtaining the second combined packet. This first source IP address is the IP address of the target IH.
[0193] Simultaneously, the NAT gateway records the packet information contained in the first packet and the correspondence between the first source port in the first packet and the second source port in the second packet through its recording module. Then, it sends the second packet to the AH so that the AH can confirm whether the target IH is allowed to access the target port.
[0194] AH receives the second combined packet. Then, AH determines through the judgment module that the access control policy for the third source IP address is in effect, and notifies the extraction module to extract the SPA packet information from the combined packet.
[0195] In the extraction module of the Access Gateway (AH), SPA data packet information is extracted from the second combined packet, and based on this SPA data packet information, it is determined that the target IH corresponding to the second combined packet is a legitimate IH. After determining that the target IH corresponding to the second combined packet is a legitimate IH, the original effective time length of the access control policy is extended based on a preset time length, i.e., the original effective time length for opening the access port is extended. Simultaneously, based on the handshake packet in the second combined packet, a second reply packet is sent to the gateway. This second reply packet indicates that a communication connection can be established with the target IH.
[0196] The NAT gateway receives the second reply packet. Then, based on the same processing operation as the first reply packet, it determines that the target IH authentication was successful and the AH has opened the access port. The second reply packet is then converted using NAPT and sent to the target IH; that is, the NAPT-converted second reply packet is sent to the target IH. Simultaneously, a feedback message is sent to the IH cluster to inform the IHs in the cluster that the AH has opened the access port and that the AH has extended the original valid time period for opening the access port based on a preset time length. This feedback message indicates that the AH has extended the original valid time period for opening the access port based on a preset time length.
[0197] In the above manner, after receiving the first reply packet, the NAT gateway processes the first reply packet based on the recording module, parsing module, notification and judgment module to determine the open access port of AH; then, by sending a notification message to the IH cluster, all IHs in the IH cluster can know the open access port of AH.
[0198] After the IH in the IH cluster learns that the AH has opened the access port through the notification message received by the receiving module, it sends the information in the first encapsulated packet to the AH through the NAT gateway based on the timing module, policy module, and construction module in order to attempt to authenticate with the AH and establish a communication connection.
[0199] Compared to existing technologies, where even if multiple IHs under a NAT gateway have established communication connections with an AH, the remaining IHs under the NAT gateway still need to send SPA data packets and handshake packets to the AH sequentially, the information sending method provided in this application embodiment allows multiple target IHs that have joined an IH cluster under a NAT gateway to attempt to authenticate with the AH and establish a communication connection simply by sending a handshake packet (i.e., a combined packet) containing SPA data packet information to the AH once through the NAT gateway. This improves the efficiency of authentication and communication connection establishment between multiple IHs and the AH, enhancing the user experience.
[0200] Based on the same inventive concept, this application also provides an information transmitting device, such as... Figure 5 The diagram shown is a structural schematic of an information transmitting device provided in this application. Figure 1 This device is used in a gateway, and this device is related to the aforementioned Figure 1 This corresponds to a method for sending information. The device includes:
[0201] The first sending module 501 is used to send a notification message to the IH cluster based on the received first reply packet; wherein the first reply packet is sent by AH, and the notification message indicates that AH is the public IP address of the gateway with an open access port;
[0202] The first receiving module 502 is used to receive the first combined packet; wherein the first combined packet is sent by the target IH based on the notification message, the target IH is any IH in the IH cluster, and the first combined packet is a handshake packet carrying SPA data packet information;
[0203] The first processing module 503 is used to determine the second combination packet based on the first combination packet and send the second combination packet to AH; wherein the first source port in the first combination packet corresponds to the second source port in the second combination packet.
[0204] In one possible implementation, the first sending module 501 is specifically used to receive a subscription request; wherein the subscription request is sent by the target IH, and the subscription request contains at least a first source IP address, which is the IP address of the target IH; if the first source IP address is within a preset IP address range, an agreement message is sent to the target IH, and the target IH is added to the IH cluster.
[0205] In one possible implementation, the first processing module 503 is specifically configured to receive the second reply packet and read the message information and destination information in the message information in the second reply packet; wherein, the second reply packet is sent by AH based on the second combined packet, and the destination information includes the first destination IP address and the first destination port; in response to the IH corresponding to the destination information being the target IH in the record information, a feedback message is sent to the IH cluster; wherein, the feedback message indicates that AH extends the original effective time length of the access port opening based on a preset time length.
[0206] Based on the same inventive concept, this application also provides an information transmitting device, such as... Figure 6 The diagram shown is a structural schematic of an information transmitting device provided in this application. Figure 2 This device is applied to any IH in the IH cluster, and this device is related to the aforementioned Figure 2 This corresponds to a method for sending information. The device includes:
[0207] The second receiving module 601 is used to receive the first reply packet sent by the gateway based on AH, and the returned notification message; wherein, the notification message indicates that AH is the public IP address of the gateway and the open access port;
[0208] The second processing module 602 is used to encapsulate a first combined packet based on a notification message and send the first combined packet to the gateway, so that the gateway determines a second combined packet based on the first combined packet and sends the second combined packet to the AH; wherein, the first combined packet is a handshake packet carrying SPA data packet information, and the first source port in the first combined packet corresponds to the second source port in the second combined packet.
[0209] In one possible implementation, the second receiving module 601 is specifically used to send a subscription request to the gateway; wherein the subscription request includes at least a first source IP address, the first source IP address being the IP address of IH; receive an agreement message, and based on the agreement message, determine to establish a communication connection with the gateway; wherein the agreement message is sent by the gateway based on the first source IP address.
[0210] Based on the same inventive concept, this application also provides an information transmitting device, such as... Figure 7 The diagram shown is a structural schematic of an information transmitting device provided in this application. Figure 3This device is applied to AH, and this device is similar to the aforementioned Figure 3 This corresponds to a method for sending information. The device includes:
[0211] The second sending module 701 is used to send a first reply packet to the gateway so that the gateway sends a notification message to the IH cluster, and determines the second combination packet when it receives the first combination packet; wherein, the notification message indicates that AH is the public IP address of the gateway and the access port is open, the first combination packet is a handshake packet carrying SPA data packet information, and the first source port in the first combination packet corresponds to the second source port in the second combination packet;
[0212] The third processing module 702 is used to receive the second combined packet; wherein the second combined packet is sent by the gateway.
[0213] In one possible implementation, the third processing module 702 is specifically used to extend the original effective time length of the access control policy based on a preset time length; wherein the access control policy indicates that the access port is opened for the public IP address of the gateway; and to encapsulate a second reply packet and send the second reply packet to the gateway, so that the gateway sends a feedback message to the IH cluster based on the second reply packet; wherein the feedback message indicates that the AH extends the original effective time length of the access port opening based on the preset time length.
[0214] Based on the same inventive concept, this application also provides an electronic device that can realize the function of the aforementioned information transmitting device. (Refer to...) Figure 8 The aforementioned electronic devices include:
[0215] At least one processor 801 and a memory 802 connected to at least one processor 801. In this embodiment, the specific connection medium between the processor 801 and the memory 802 is not limited. Figure 8 The example shown is the connection between processor 801 and memory 802 via bus 800. Bus 800 is... Figure 8 The connections between other components are indicated by thick lines and are for illustrative purposes only, not as limiting information. The 800 bus can be divided into address bus, data bus, control bus, etc., for ease of representation. Figure 8 The term is represented by a single thick line, but this does not imply that there is only one bus or one type of bus. Alternatively, the processor 801 can also be called a controller; there is no restriction on the name.
[0216] In this embodiment, the memory 802 stores instructions executable by at least one processor 801. By executing the instructions stored in the memory 802, the at least one processor 801 can perform the information transmission method described above. The processor 801 can implement... Figure 5-7 The functions of each module in the device shown.
[0217] The processor 801 is the control center of the device. It can connect to various parts of the control device through various interfaces and lines. By running or executing instructions stored in memory 802 and calling data stored in memory 802, the processor can perform various functions and process data, thereby monitoring the device as a whole.
[0218] In one possible design, processor 801 may include one or more processing units. Processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 801. In some embodiments, processor 801 and memory 802 may be implemented on the same chip; in some embodiments, they may also be implemented on separate chips.
[0219] The processor 801 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the information transmission method disclosed in the embodiments of this application can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.
[0220] Memory 802, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 802 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. Memory 802 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 802 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0221] By designing and programming the processor 801, the code corresponding to the information transmission method described in the foregoing embodiments can be embedded into the chip, enabling the chip to execute the code during operation. Figure 1-3 The steps of the information transmission method in the illustrated embodiment are described. How to design and program the processor 801 is a technique well-known to those skilled in the art and will not be elaborated upon here.
[0222] Based on the same inventive concept, embodiments of this application also provide a storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the information transmission method described above.
[0223] In some possible implementations, various aspects of the information transmission method provided in this application may also be implemented in the form of a program product, which includes program code that, when the program product is run on a device, causes the control device to perform the steps in the information transmission method according to the various exemplary embodiments of this application described above.
[0224] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0225] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0226] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0227] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0228] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for sending information, applied to a gateway, characterized in that, The method includes: The system receives a first single-packet authorization SPA data packet sent by the first IH in the session initiating host IH cluster, and sends a second SPA data packet obtained based on the first SPA data packet to the session accepting host AH. It also receives a first handshake packet sent by the first IH and sends a second handshake packet obtained based on the first handshake packet to the AH. The first IH is the first IH in the IH cluster to attempt to establish a communication connection with the AH when it is unaware that the AH has an open access port. The system receives a first reply packet sent by the AH based on the second handshake packet, and verifies the correctness of the first reply packet based on the comparison result between the message information and the record information in the first reply packet. After determining that the first reply packet is a correct reply packet, the system sends a notification message to the IH cluster. The notification message indicates that the AH has opened an access port for the public Internet Protocol (IP) address of the gateway. Receive a first combined packet; wherein the first combined packet is sent by the target IH based on the notification message, the target IH is any IH in the IH cluster, and the first combined packet is a handshake packet carrying SPA data packet information; Based on the first combined packet, a second combined packet is determined and sent to the AH; wherein, the first source port in the first combined packet corresponds to the second source port in the second combined packet; the first source port is the port of the target IH; the second source port is the port of the gateway; the second combined packet contains at least the IP address of the AH and the access ports open by the AH.
2. The method as described in claim 1, characterized in that, Before sending the notification message to the IH cluster, the method further includes: Receive subscription request; wherein the subscription request is sent by the target IH, and the subscription request contains at least a first source IP address, the first source IP address being the IP address of the target IH; If the first source IP address is within the preset IP address range, then an agreement message is sent to the target IH, and the target IH is added to the IH cluster.
3. The method as described in claim 1, characterized in that, After sending the second combined packet to the AH, the method further includes: The system receives a second reply packet and reads the message information and destination information from the message information in the second reply packet. The second reply packet is sent by the AH based on the second combined packet. The destination information includes a first destination IP address and a first destination port. The first destination IP address is the public IP address. In response to the target IH corresponding to the destination information being the target IH in the record information, a feedback message is sent to the IH cluster; wherein, the feedback message indicates that the AH extends the original valid time length of the access port opening based on a preset time length.
4. A method for sending information, applied to any IH in a session initiating host IH cluster, characterized in that, The method includes: The receiving gateway receives a notification message returned by a first reply packet sent by a host AH based on a session; wherein the notification message indicates that the AH is the public Internet Protocol (IP) address of the gateway with an open access port; the notification message is sent by the gateway after receiving the first reply packet sent by the AH based on a second handshake packet, verifying the correctness of the first reply packet based on the comparison result of the message information and record information in the first reply packet, and determining that the first reply packet is a correct reply packet; the second handshake packet is sent by the gateway to the AH based on the first handshake packet sent by the first IH in the IH cluster; the first IH is the first IH in the IH cluster to attempt to establish a communication connection with the AH when it is not known that the AH has an open access port; before receiving the first reply packet, the gateway also received a first single-packet authorization SPA data packet sent by the first IH, and sent a second SPA data packet obtained based on the first SPA data packet to the AH. Based on the notification message, a first combined packet is encapsulated and sent to the gateway, so that the gateway determines a second combined packet based on the first combined packet and sends the second combined packet to the AH; wherein, the first combined packet is a handshake packet carrying SPA data packet information, the first source port in the first combined packet corresponds to the second source port in the second combined packet; the first source port is the port of any IH; the second source port is the port of the gateway; the second combined packet contains at least the IP address of the AH and the access port opened by the AH.
5. The method as described in claim 4, characterized in that, Before the notification message returned by the receiving gateway based on the first reply packet sent by the session-receiving host AH, the following is also included: Send a subscription request to the gateway; wherein the subscription request contains at least a first source IP address, the first source IP address being the IP address of the IH; A consent message is received, and based on the consent message, a communication connection is established with the gateway; wherein the consent message is sent by the gateway based on the first source IP address.
6. A method for sending information, applied to a session receiving host AH, characterized in that, The method includes: The gateway receives a second SPA data packet based on a first single-packet authorization SPA data packet, and the gateway also receives a second handshake packet based on a first handshake packet; wherein the first SPA data packet and the first handshake packet are sent to the gateway by the first IH in the session initiating host IH cluster; the first IH is the first IH in the IH cluster to attempt to establish a communication connection with the AH when it is not aware that the AH has an open access port; Based on the second handshake packet, a first reply packet is sent to the gateway. The gateway verifies the correctness of the first reply packet based on the comparison between the message information and record information in the first reply packet. After confirming that the first reply packet is correct, it sends a notification message to the IH cluster. Upon receiving a first combined packet sent by the target IH based on the notification message, it determines a second combined packet. The notification message indicates that the AH is the public Internet Protocol (IP) address of the gateway, the target IH is any IH in the IH cluster, the first combined packet is a handshake packet carrying SPA data packet information, and the first source port in the first combined packet corresponds to the second source port in the second combined packet. The first source port is the port of the target IH, and the second source port is the port of the gateway. Receive the second combined packet; wherein the second combined packet is sent by the gateway; the second combined packet contains at least the IP address of the AH and the open access port of the AH.
7. The method as described in claim 6, characterized in that, After receiving the second combined packet, the method further includes: Based on a preset time length, the original effective time length of the access control policy is extended; wherein, the access control policy instructs that the access port be opened for the public IP address of the gateway; and, A second response packet is encapsulated and sent to the gateway, so that the gateway sends a feedback message to the IH cluster based on the second response packet; wherein the feedback message indicates that the AH extends the original valid time length of the access port opening based on the preset time length.
8. An information transmitting device, applied to a gateway, characterized in that, The device includes: The first sending module is configured to receive a first single-packet authorization SPA data packet sent by the first IH in the session initiating host IH cluster, and send a second SPA data packet obtained based on the first SPA data packet to the session receiving host AH; receive a first handshake packet sent by the first IH, and send a second handshake packet obtained based on the first handshake packet to the AH; receive a first reply packet sent by the AH based on the second handshake packet, and verify the correctness of the first reply packet based on the comparison result of the message information and record information in the first reply packet; after determining that the first reply packet is a correct reply packet, send a notification message to the IH cluster; wherein, the notification message indicates that the AH is the public Internet Protocol (IP) address of the gateway with an open access port; the first IH is the first IH in the IH cluster to attempt to establish a communication connection by authenticating to the AH when the open access port of the AH is not known. A first receiving module is configured to receive a first combined packet; wherein the first combined packet is sent by a target IH based on the notification message, the target IH is any IH in the IH cluster, and the first combined packet is a handshake packet carrying SPA data packet information. A first processing module is configured to determine a second combined packet based on the first combined packet and send the second combined packet to the AH; wherein, the first source port in the first combined packet corresponds to the second source port in the second combined packet; the first source port is the port of the target IH; the second source port is the port of the gateway; and the second combined packet contains at least the IP address of the AH and the access ports opened by the AH.
9. An information sending device, applied to any IH in a session initiating host IH cluster, characterized in that, The device includes: The second receiving module is used to receive a notification message returned by the gateway after receiving a first reply packet sent by the session-receiving host AH. The notification message indicates that the AH is the public Internet Protocol (IP) address of the gateway with an open access port. The notification message is sent by the gateway after receiving the first reply packet sent by the AH based on a second handshake packet, verifying the correctness of the first reply packet based on the comparison result between the message information and record information in the first reply packet, and confirming that the first reply packet is correct. The second handshake packet is sent by the gateway to the AH based on the first handshake packet sent by the first IH in the IH cluster. The first IH is the first IH in the IH cluster to attempt to establish a communication connection with the AH when it is unaware that the AH has an open access port. Before receiving the first reply packet, the gateway also received a first single-packet authorization (SPA) data packet sent by the first IH and sent a second SPA data packet obtained based on the first SPA data packet to the AH. The second processing module is configured to encapsulate a first combined packet based on the notification message and send the first combined packet to the gateway, so that the gateway determines a second combined packet based on the first combined packet and sends the second combined packet to the AH; wherein, the first combined packet is a handshake packet carrying SPA data packet information, the first source port in the first combined packet corresponds to the second source port in the second combined packet; the first source port is the port of any IH; the second source port is the port of the gateway; the second combined packet contains at least the IP address of the AH and the access port opened by the AH.
10. An information transmitting device, applied to a session receiving host AH, characterized in that, The device includes: The second sending module is configured to receive a second SPA data packet sent by the gateway based on a first single-packet authorization SPA data packet, and a second handshake packet sent by the gateway based on a first handshake packet; based on the second handshake packet, send a first reply packet to the gateway, so that the gateway verifies the correctness of the first reply packet based on the comparison result of the message information and record information in the first reply packet. After determining that the first reply packet is a correct reply packet, the gateway sends a notification message to the session initiating host IH cluster, and upon receiving a first combined packet sent by the target IH based on the notification message, determines the second combined packet; wherein, the notification message indicates that the AH is the The gateway's public Internet Protocol (IP) address has an open access port. The target IH is any IH in the IH cluster. The first combined packet is a handshake packet carrying SPA data packet information. The first source port in the first combined packet corresponds to the second source port in the second combined packet. The first source port is the port of the target IH. The second source port is the port of the gateway. The first SPA data packet and the first handshake packet are sent from the first IH in the IH cluster to the gateway. The first IH is the first IH in the IH cluster to attempt to establish a communication connection with the AH when it is unaware that the AH has an open access port. The third processing module is used to receive the second combined packet; wherein the second combined packet is sent by the gateway; the second combined packet contains at least the IP address of the AH and the open access port of the AH.
11. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a computer program stored in the memory, implements the method of any one of claims 1-7.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.
Citation Information
Patent Citations
Single packet authorization method and system
CN111770090A
Service mode switching method and system under SDP architecture
CN113810347A
