Connection establishment method and apparatus, device, system, medium, and program product
By obtaining multiple IP addresses, sending connection requests and data packets in the 0-RTT scenario of concurrent multi-IP connection, and determining that the connection is successful after receiving the response message, the problem of low connection success rate is solved and the accuracy and security of data packet processing are achieved.
Patent Information
- Application Number
- PCT/CN2025/083451
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-25
- Filing Date
- 2025-03-19
- Publication Date
- 2025-10-02
AI Technical Summary
In the 0-RTT scenario where multiple Internet protocols are concurrently established, the existing technology has a low success rate in establishing connections due to equipment failures and other reasons, and there is also the problem of duplicate processing of connection requests and data packets.
By obtaining multiple IP addresses, sending connection requests and data packets respectively, and confirming the connection is successful after receiving the response message, the connection of other IPs is closed; an identification deduplication mechanism is used to avoid repeated processing; and the data packet is encrypted with a recovery key to improve security.
Improves the connection success rate in 0-RTT scenarios with multiple IPs concurrently establishing connections, ensures the accuracy and security of data packet processing, and avoids failures caused by premature connection closure due to failure to receive a response message.
Smart Images

Figure CN2025083451_02102025_PF_FP_ABST
Abstract
Description
Method, device, equipment, system, medium and program product for establishing connection
[0001] This application claims priority to Chinese patent application No. 202410349627.1 filed on March 25, 2024, entitled “Method, device, equipment, system, medium and program product for establishing a connection”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of communication technology, and in particular to methods, devices, equipment, systems, media, and program products for establishing a connection. Background Art
[0003] Quick UDP internet connections (QUIC) based on the User Datagram Protocol (UDP) is a secure transport protocol that runs on top of UDP and is highly integrated with Transport Layer Security (TLS) 1.3. The Hypertext Transfer Protocol 3 (HTTP / 3) based on QUIC can send application data with zero round trip time (RTT). 0-RTT means that the application data is included in the first message sent by the client to the device, meaning that before sending the application data, the number of communication rounds between the client and the device is zero.
[0004] For example, after a client successfully completes the TLS handshake with a device for the first time, both the client and the device locally store a pre-shared encryption key, called a resumption key. If the client reconnects to the device, it sends the application data encrypted with the resumption key directly to the device when it sends a connection request, without having to perform another TLS handshake before sending the application data. This allows the connection to be established and the application data to be sent simultaneously.
[0005] In this 0-RTT scenario, the connection establishment method can be a concurrent establishment of multiple Internet Protocols (IPs). Concurrent establishment of multiple IPs means using multiple IPs to initiate the establishment of a connection at the same time to improve the success rate of connection establishment. In related technologies, in a 0-RTT scenario with concurrent establishment of multiple IPs, the client will attempt to establish a connection with device 1 based on IP1 and send 0-RTT application data, and to establish a connection with device 2 based on IP2 and send 0-RTT application data. Since the establishment of a connection based on IP1 in the 0-RTT scenario will be directly assumed to be successful after initiation, the establishment of a connection based on IP2 will be directly closed. However, in reality, there are cases where the establishment of a connection based on IP1 fails due to reasons such as a failure of device 1. Summary of the Invention
[0006] The present application provides a method, apparatus, device, system, medium and program product for establishing a connection, which are used to improve the connection establishment success rate in a 0-RTT scenario where multiple IPs are concurrently established.
[0007] In a first aspect, a method for establishing a connection is provided, the method comprising: obtaining multiple IPs corresponding to a service domain name to be accessed; sending a connection request and a first data packet to at least one device corresponding to the multiple IPs based on the multiple IPs, the first data packet being a data packet in application data required to be transmitted to access the service domain name; upon receiving a response message returned by any one of the at least one device based on any one of the multiple IPs, determining that the connection established based on any one of the IPs is successful, the response message including a connection response to the connection request and a confirmation packet for the first data packet; sending a close message to the devices corresponding to the remaining IPs based on the remaining IPs except for any one of the multiple IPs, the close message being used to close the connection established based on the remaining IPs.
[0008] In this method, for 0-RTT scenarios with multiple IPs concurrently establishing connections, the connection to any device based on any IP is determined to be successful only after a response message from any device has been received, and connections based on the remaining IPs are then closed. This approach eliminates the problem of connection failures caused by prematurely closing connections based on other IPs without receiving a response message from any device after initiating a connection based on any IP. This improves the connection success rate.
[0009] In one possible implementation, a connection request carries a first identifier, and a first data packet carries a second identifier. The first identifier is used by the device to deduplicate received connection requests with the same first identifier, and the second identifier is used by the device to deduplicate received first data packets with the same request identifier. By separately carrying the first identifier and the second identifier, it is possible to avoid repeated processing of repeatedly sent connection requests and first data packets, thereby improving the accuracy of processing the connection requests and first data packets.
[0010] In one possible implementation, the connection establishment request and the first data packet are encapsulated and transmitted in a message. The message also includes a third identifier, which is used by the device to deduplicate received messages with the same third identifier. By packaging the messages with the third identifier, duplicate processing of repeatedly sent messages can be avoided, thereby improving the accuracy of message processing.
[0011] In one possible implementation, the first data packet is encrypted using a recovery key, which is a shared key determined during the first handshake with the device corresponding to the service domain name. Encryption improves the security of the transmission of the first data packet, and because the recovery key is the shared key determined during the first handshake with the device corresponding to the service domain name, the accuracy of the encryption and decryption process of the first data packet is guaranteed.
[0012] In one possible implementation, after determining that a connection based on any IP address is successfully established, a second data packet is sent to the device corresponding to the any IP address based on the any IP address, where the second data packet is a data packet subsequent to the first data packet. After the connection is successfully established, subsequent data transmission can be performed via the successfully established connection.
[0013] In a second aspect, a method for establishing a connection is provided, the method comprising: receiving a connection request and a first data packet sent by a client based on any IP, the first data packet being a data packet in application data required to be transmitted to access a service domain name; in a case where the connection request and the first data packet are processed for the first time, returning a response message to the client based on any IP to determine that the connection established based on any IP is successful, the response message including a connection response for the connection request and a confirmation packet for the first data packet; or, in a case where the connection request and the first data packet are not processed for the first time, receiving a close message sent by the client based on any IP to close the connection established based on any IP.
[0014] In this method, for 0-RTT scenarios with concurrent multi-IP connections, a received connection request and first data packet are processed only if it is determined that they are being processed for the first time. This prevents repeated processing of repeatedly sent connection requests and first data packets, improving the accuracy of processing them.
[0015] In one possible implementation, the connection request carries a first identifier, and the first data packet carries a second identifier, the first identifier is used by the device to deduplicate received connection requests with the same first identifier, and the second identifier is used by the device to deduplicate received first data packets with the same request identifier; after receiving the connection request and the first data packet sent by the client based on any IP, it also includes: if the connection database does not include the first identifier and the second identifier, it is determined that the connection request and the first data packet are processed for the first time, and the connection database records the identifier of the connection request processed for the first time and the identifier of the first data packet processed for the first time; if the connection database includes at least one of the first identifier or the second identifier, it is determined that the connection request and the first data packet are not processed for the first time.
[0016] In one possible implementation, after returning a response message to the client based on any IP address, the method further includes: adding a first identifier and a second identifier to a connection database. The connection database records the first identifier of the connection request and the second identifier of the first data packet processed for the first time, and whether the connection database contains the first identifier and the second identifier can accurately determine whether the received connection request and the first data packet are processed for the first time.
[0017] In one possible implementation, the connection request and the first data packet are encapsulated in a message for transmission, and the message also encapsulates a third identifier, and the third identifier is used by the device to deduplicate received messages with the same third identifier; after receiving the connection request and the first data packet sent by the client based on any IP, it also includes: if the connection database does not include the third identifier, it is determined that the connection request and the first data packet are processed for the first time, and the connection database records the identifier of the message processed for the first time; if the connection database includes the third identifier, it is determined that the connection request and the first data packet are not processed for the first time.
[0018] In one possible implementation, after returning a response message to the client based on any IP address, the method further includes: adding a third identifier to a connection database. The connection database records the third identifier of the message processed for the first time, and whether the third identifier is included in the connection database can accurately determine whether the received message is processed for the first time.
[0019] In one possible implementation, the first data packet is encrypted using a recovery key, which is a shared key determined during the first handshake with the client. Before returning a response message to the client based on any IP, the first data packet is also decrypted based on the recovery key.
[0020] According to a third aspect, a device for establishing a connection is provided. The device includes a transceiver module and a processing module.
[0021] A transceiver module is used to perform the operations related to receiving and / or sending performed in the first aspect or any possible implementation of the first aspect; a processing module is used to perform other operations other than the operations related to receiving and / or sending in the first aspect or any possible implementation of the first aspect.
[0022] Alternatively, the transceiver module is used to perform the reception and / or sending related operations performed in the second aspect or any possible implementation of the second aspect; the processing module is used to perform other operations other than the reception and / or sending related operations in the second aspect or any possible implementation of the second aspect.
[0023] In a possible implementation, the transceiver module includes a receiving module and / or a sending module. The receiving module is used to perform reception-related operations, and the sending module is used to perform sending-related operations.
[0024] In the case where the transceiver module is used to perform the operations related to receiving and / or sending performed in the first aspect or any possible implementation of the first aspect; the processing module is used to perform other operations other than the operations related to receiving and / or sending in the first aspect or any possible implementation of the first aspect. The processing module is used to obtain multiple IPs corresponding to the service domain name to be accessed; the transceiver module is used to send a connection request and a first data packet to at least one device corresponding to the multiple IPs based on the multiple IPs, the first data packet being a data packet in the application data required to be transmitted to access the service domain name; the processing module is used to determine that the connection established based on any IP is successful when receiving a response message returned by any device among the at least one device based on any IP among the multiple IPs, the response message including a connection response to the connection request and a confirmation packet for the first data packet; the transceiver module is used to send a close message to the devices corresponding to the remaining IPs based on the remaining IPs except any IP among the multiple IPs, the close message being used to close the connection established based on the remaining IPs.
[0025] In one possible implementation, the connection request carries a first identifier, and the first data packet carries a second identifier. The first identifier is used by the device to deduplicate received connection requests with the same first identifier, and the second identifier is used by the device to deduplicate received first data packets with the same request identifier.
[0026] In a possible implementation, the connection establishment request and the first data packet are encapsulated in a message for transmission. The message further encapsulates a third identifier, and the third identifier is used by the device to deduplicate received messages with the same third identifier.
[0027] In a possible implementation, the first data packet is encrypted using a recovery key, where the recovery key is a shared key determined during the first handshake with the device corresponding to the service domain name.
[0028] In a possible implementation, the transceiver module is further configured to send a second data packet to a device corresponding to any IP based on any IP, where the second data packet is a data packet subsequent to the first data packet.
[0029] In the case where the transceiver module is used to perform the operations related to receiving and / or sending performed in the second aspect or any possible implementation of the second aspect; the processing module is used to perform other operations other than the operations related to receiving and / or sending in the second aspect or any possible implementation of the second aspect. The transceiver module is used to receive a connection request and a first data packet sent by a client based on any IP, where the first data packet is a data packet in the application data required to be transmitted to access the service domain name; when the connection request and the first data packet are processed for the first time, a response message is returned to the client based on any IP to determine that the connection established based on any IP is successful, and the response message includes a connection response for the connection request and a confirmation packet for the first data packet; or, when the connection request and the first data packet are not processed for the first time, a close message is received from the client based on any IP to close the connection established based on any IP.
[0030] In one possible embodiment, the connection request carries a first identifier, and the first data packet carries a second identifier, the first identifier is used by the device to deduplicate received connection requests with the same first identifier, and the second identifier is used by the device to deduplicate received first data packets with the same request identifier; the processing module is used to determine that the connection request and the first data packet are processed for the first time if the connection database does not include the first identifier and the second identifier, and the connection database records the identifier of the connection request processed for the first time and the identifier of the first data packet processed for the first time; if the connection database includes at least one of the first identifier or the second identifier, determine that the connection request and the first data packet are not processed for the first time.
[0031] In a possible implementation, the processing module is further configured to add the first identifier and the second identifier to the connection database.
[0032] In one possible implementation, the connection request and the first data packet are encapsulated in a message for transmission, and the message also encapsulates a third identifier, and the third identifier is used by the device to deduplicate received messages with the same third identifier; the processing module is used to determine that the connection request and the first data packet are processed for the first time if the connection database does not include the third identifier, and the connection database records the identifier of the message processed for the first time; if the connection database includes the third identifier, determine that the connection request and the first data packet are not processed for the first time.
[0033] In a possible implementation, the processing module is further configured to add a third identifier to the connection database.
[0034] In a possible implementation, the first data packet is encrypted using a recovery key, where the recovery key is a shared key determined during the first handshake with the client; the processing module is further configured to decrypt the first data packet based on the recovery key.
[0035] In a fourth aspect, a network device is provided, comprising: a processor, the processor being coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor, so that the network device implements the method for establishing a connection as described in any one of the first or second aspects above.
[0036] Optionally, there are one or more processors and one or more memories.
[0037] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0038] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated on the same chip as the processor or be set on different chips. This application does not limit the type of memory and the setting method of the memory and the processor.
[0039] In a fifth aspect, a communication device is provided, comprising: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other via an internal connection path; the memory is configured to store instructions; and the processor is configured to execute the instructions stored in the memory to control the transceiver to receive signals and to control the transceiver to transmit signals. When the processor executes the instructions stored in the memory, the communication device executes the method of the first aspect or any possible implementation of the first aspect, or executes the method of the second aspect or any possible implementation of the second aspect.
[0040] In a sixth aspect, a system for establishing a connection is provided, the system for establishing a connection comprising a client and at least one device;
[0041] The client is used to execute the method in the first aspect or any possible implementation of the first aspect, and any device in the at least one device is used to execute the method in the second aspect or any possible implementation of the second aspect.
[0042] In the seventh aspect, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, and the instruction is loaded and executed by a processor to enable the computer to implement the method in the above-mentioned first aspect or any possible implementation of the first aspect, or to implement the method in the above-mentioned second aspect or any possible implementation of the second aspect.
[0043] In an eighth aspect, a computer program (product) is provided, which includes: computer program code, which, when executed by a computer, enables the computer to execute the methods in the above aspects.
[0044] In a ninth aspect, a chip is provided, comprising a processor for calling and executing instructions stored in a memory from the memory, so that a communication device equipped with the chip executes the methods in the above aspects.
[0045] In the tenth aspect, another chip is provided, comprising: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the methods in the above aspects.
[0046] It should be understood that the beneficial effects achieved by the technical solutions of aspects 2 to 10 of the present application and their corresponding possible implementations can be referenced to the technical effects of the first aspect and its corresponding possible implementations, and will not be repeated here. In addition, the device for establishing a connection mentioned in the third aspect may be the chip mentioned in aspect 9 or aspect 10, or the device for establishing a connection may also be the device mentioned in aspect 4. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] FIG1 is a schematic diagram of a 0-RTT connection establishment process provided in the related art;
[0048] FIG2 is a schematic diagram of another 0-RTT connection establishment process provided in the related art;
[0049] FIG3 is a schematic diagram of an implementation environment of a method for establishing a connection provided in an embodiment of the present application;
[0050] FIG4 is a flowchart of a method for establishing a connection provided in an embodiment of the present application;
[0051] FIG5 is a flowchart of another method for establishing a connection provided in an embodiment of the present application;
[0052] FIG6 is a schematic diagram of a process of establishing a connection provided by an embodiment of the present application;
[0053] FIG7 is a schematic diagram of another process of establishing a connection provided in an embodiment of the present application;
[0054] FIG8 is a schematic structural diagram of a device for establishing a connection provided in an embodiment of the present application;
[0055] FIG9 is a schematic diagram of the structure of a network device provided in an embodiment of the present application;
[0056] FIG10 is a schematic diagram of the structure of another network device provided in an embodiment of the present application;
[0057] FIG11 is a schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0059] In the communication technology based on fast QUIC, since QUIC and TLS1.3 are highly integrated, QUIC can use the session information that has previously gone through the TLS full handshake through TLS session resumption to perform TLS encrypted transmission of application data. Combined with the connection establishment mechanism of QUIC, the synchronous sending of QUIC connection and application data can be achieved. In other words, the first request of HTTP / 3 based on QUIC can achieve true 0-RTT sending of application data. For an introduction to QUIC, please refer to the description in Request for Comments (RFC) 9000, and for an introduction to TLS1.3, please refer to the description in RFC8446. The embodiments of this application will not be repeated here.
[0060] In the embodiments of this application, 0-RTT refers to establishing a fast TLS 1.3 encrypted connection through session resumption, allowing data packets to be sent and received at the start of the first RTT. 1-RTT refers to establishing a complete TLS 1.3 encrypted connection through a full handshake, allowing data packets to be sent and received at the start of the second RTT. The differences between the 1-RTT and 0-RTT request processes are illustrated using an example of a client establishing a connection to a device and sending data.
[0061] In a 1-RTT request, the client first sends a connection request to the device, and the device sends a connection response to the client. After receiving the connection response, the client sends data to the device, and the device then sends a data confirmation response to the client. In a 0-RTT request, the client directly sends a connection request and application data to the device, and the device also directly sends a connection response and data confirmation response to the client. The client is the program that provides local services to the client and is the party that actively initiates the connection. Optionally, the client can be a program running on a smartphone, personal computer, TV set-top box, or any other device that supports the network IP protocol.
[0062] In a multi-IP concurrent connection scenario, a client can use multiple IP addresses to initiate connections simultaneously, increasing the success rate of connection establishment. For example, in a multi-IP concurrent connection scenario using the happy eyeballs algorithm, a client simultaneously attempts to establish both an Internet Protocol version 4 (IPv4) connection and an Internet Protocol version 6 (IPv6) connection. If the IPv4 connection is established successfully first, the client immediately uses the IPv4 connection. If the IPv6 connection is established successfully within a certain period of time (typically a few hundred milliseconds), the client switches to the IPv6 connection, achieving a smooth transition from IPv4 to IPv6. The happy eyeballs algorithm is used in dual-stack network environments. For a description of the happy eyeballs algorithm, refer to RFC6555 or RFC8305.
[0063] For example, let's take the case where the client uses IP1 and IP2 to establish connections concurrently. Referring to the schematic diagram of the 0-RTT connection process in the related technology shown in Figure 1 or Figure 2, at the 0th RTT, the client sends initial (initial) and 0-RTT data (data) to device 1 corresponding to IP1 and device 2 corresponding to IP2 at the same time, and notifies the upper application layer that the connection is successfully established; if the connection based on IP1 is sent successfully first, then the connection based on IP2 will be directly closed, that is, IP2 will not get a chance to establish a connection. Among them, initial refers to the message used for connection establishment in the QUIC protocol, and it is also the first message sent by the client for the QUIC connection; data refers to the application data packet sent and received between the client and the device in the QUIC protocol, that is, data is not a control message.
[0064] When the communication network and device 1 are both normal, as shown in Figure 1, after device 1 receives the initial and 0-RTT data packets, it returns the handshake corresponding to the initial and the acknowledgment (ack) packet corresponding to the 0-RTT data to the client. The client then uses device 1 corresponding to IP1 for subsequent data transmission and reception. For example, the client sends 1-RTT data to device 1 corresponding to IP1. Among them, handshake refers to the message in the QUIC protocol that transmits information such as certificates or connection parameters between the client and the device; ack packet refers to the control message in the QUIC protocol that the client or device replies to the other party, which is used to respond to the data that the other party has received.
[0065] However, as shown in Figure 2, if IP1 fails—for example, if device 1 fails, or if the network connecting the client to device 1 fails—device 1 will not receive the initial and 0-RTT data. Consequently, the connection based on IP1 is closed, meaning the connection based on IP1 fails. Because the connection based on IP2 has already been closed, the client's overall connection fails. This means that the connection success rate in a 0-RTT scenario with multiple concurrent IP connections is low.
[0066] An embodiment of the present application provides a method for establishing a connection, which can improve the connection establishment success rate in a 0-RTT scenario where multiple IPs are established concurrently. Refer to Figure 3, which is a schematic diagram of the implementation environment of a method for establishing a connection provided by an embodiment of the present application. The implementation environment includes a client and a device, and the client is connected to multiple devices through wired or wireless means based on different IPs. In Figure 3, IP1, IP2 and IP3 are used to simplify the network path between the client and any device. Optionally, different IPs may correspond to the same device. For example, IP1 and IP4 both correspond to device 1. Among them, the client refers to the initiator of the connection request, and the device is the party that responds to the client's connection request. Optionally, the implementation environment also includes a database, which is connected to multiple devices through wired or wireless means. The database is used to store connection request records for each device.
[0067] The device mentioned in the embodiments of the present application refers to a device that interacts with the client for data and provides computing services. Optionally, the device can be a network device or server such as a switch or a router, or a component of a network device or a server, such as a single board or a line card on a network device or a server, or a functional module on a network device or a server, or a chip for implementing the method of the present application, which is not specifically limited in the embodiments of the present application. When the device is a chip, the transceiver module for implementing the method can be, for example, an interface circuit of the chip, and the processing module can be a processing circuit with processing functions in the chip. The connection method between devices includes, but is not limited to, direct connection via an Ethernet cable or an optical cable.
[0068] Taking the client executing this method as an example, see Figure 4, which is a flowchart of a method for establishing a connection provided in an embodiment of the present application. This method can be applied in the implementation environment shown in Figure 3. For example, the client is the client shown in Figure 3. As shown in Figure 4, the method for establishing a connection includes the following steps 401-404.
[0069] Step 401: Acquire multiple IP addresses corresponding to the service domain name to be accessed.
[0070] In the embodiments of the present application, a domain name is a name of a computer or computer group on the Internet, consisting of a string of names separated by dots, and is used to locate and identify devices during data transmission. Compared to IP addresses, domain names can display information such as the name and nature of the address organization and are easier to remember. Mapping domain names and IP addresses to each other allows users to access the Internet more conveniently without having to remember the numeric string of IP addresses that can be directly read by machines. For example, the domain name system (DNS) includes the correspondence between domain names and IP addresses and is used to convert between domain names and IP addresses. DNS is also called a domain name server.
[0071] In one possible implementation, multiple IP addresses corresponding to the service domain name to be accessed are obtained through DNS resolution. One IP address corresponds to one device. For example, as shown in FIG3 , IP1 corresponds to device 1, and IP2 corresponds to device 2. Alternatively, different IP addresses may correspond to the same device. For example, IP1 and IP4 correspond to device 1, and IP2 corresponds to device 2. The present embodiment does not limit the number and type of the multiple IP addresses. For example, the multiple IP addresses may be any number of two or more IP addresses, and the types of the multiple IP addresses may be either IPv4 or IPv6, or both.
[0072] Step 402: Send a connection request and a first data packet to at least one device corresponding to the multiple IPs based on the multiple IPs. The first data packet is a data packet in the application data required to be transmitted for accessing the service domain name.
[0073] In an embodiment of the present application, after obtaining multiple IPs corresponding to the service domain name to be accessed, a connection request and a first data packet are sent to each device corresponding to each IP, that is, the number of times the client sends the connection request and the first data packet is equal to the number of multiple IPs. For example, the multiple IPs include IP1 and IP2, IP1 corresponds to device 1, and IP2 corresponds to device 2. Then, based on IP1, a connection request and a first data packet are sent to device 1, and based on IP2, a connection request and a first data packet are sent to device 2. For another example, if the multiple IPs include IP1 and IP2, IP1 corresponds to device 1, and IP2 also corresponds to device 1, then, based on IP1, a connection request and a first data packet are sent to device 1, and based on IP2, a connection request and a first data packet are sent to device 1 again.
[0074] The connection request is used by a client to establish a connection with a device corresponding to any IP address based on any IP address. This connection is used to transmit the application data required to access the service domain name. The application data required to access the service domain name includes multiple data packets arranged in sequence, with the first data packet being the first of the multiple data packets. Because the first data packet is the first data packet sent by the client, it can also be called a 0-RTT data packet. Optionally, the connection request and the first data packet can be sent separately and simultaneously, or they can be encapsulated and sent in a single message.
[0075] In the case where the connection request and the first data packet can be sent separately and simultaneously, the connection request carries a first identifier, and the first data packet carries a second identifier. The first identifier is used by the device to deduplicate received connection requests with the same first identifier, and the second identifier is used by the device to deduplicate received first data packets with the same request identifier. Thus, by separately carrying the first identifier and the second identifier, repeated processing of repeatedly sent connection requests and first data packets can be avoided, thereby improving the accuracy of processing the connection requests and first data packets.
[0076] When the connection establishment request and the first data packet are encapsulated and sent in a single message, a third identifier is also encapsulated in the message. This third identifier is used by the device to deduplicate received messages with the same third identifier. Thus, by encapsulating the third identifier in the message, duplicate processing of repeatedly sent messages can be avoided, thereby improving the accuracy of message processing.
[0077] The embodiment of the present application does not limit the setting of the first identifier and the second identifier. The first identifier can be used to distinguish different connection request interfaces, and the second identifier can be used to distinguish different first data packets. Similarly, the embodiment of the present application does not limit the setting of the third identifier. The third identifier can be used to distinguish different messages. For example, the first identifier, the second identifier, or the third identifier can be a string of characters or numbers, and the string of characters or numbers will not or will have a very low probability of being repeated in the short term. Short-term can refer to a time period that is less than or equal to a time period threshold, and the time period threshold can be flexibly adjusted according to the application scenario. For example, if the time period threshold is 1 minute, short-term can refer to 1 minute.
[0078] In one possible implementation, the first data packet is encrypted using a recovery key, which is a shared key determined during the first handshake with the device corresponding to the service domain. This means that the client has previously accessed the service domain and obtained the shared key determined during the first handshake with the device corresponding to the service domain. This improves the security of the transmission of the first data packet through encryption, and because the recovery key is the shared key determined during the first handshake with the device corresponding to the service domain, the accuracy of the encryption and decryption process of the first data packet is guaranteed.
[0079] Step 403, upon receiving a response message returned by any device among at least one device based on any IP among multiple IPs, it is determined that the connection established based on any IP is successful, and the response message includes a connection response to the connection request and a confirmation packet for the first data packet.
[0080] Among them, the connection request can be initial, then the connection response to the connection request can be a handshake, the first data packet can be a 0-RTT data packet, and the confirmation packet for the first data packet can be ack. In one possible implementation, after determining that the connection based on any IP is successfully established, a second data packet is also sent to the device corresponding to any IP based on any IP. The second data packet is the data packet after the first data packet, that is, the subsequent application data required to be transmitted to access the service domain name. For example, the first data packet is a 0-RTT data packet, and the second data packet is a 1-RTT data packet. That is to say, after the connection is successfully established, subsequent data transmission can be carried out through the successfully established connection.
[0081] Step 404: Based on the remaining IPs except any one IP in the multiple IPs, a close message is sent to the devices corresponding to the remaining IPs respectively. The close message is used to close the connection established based on the remaining IPs.
[0082] After confirming that a connection has been successfully established between any IP address and any device, other concurrent connection establishment tasks can be closed. For example, if multiple IP addresses include IP1, IP2, and IP3, and a response message is received from IP1, the remaining IP addresses are IP2 and IP3. IP2 then sends a close message to the device corresponding to IP2 to close the connection established with IP2; IP3 then sends a close message to the device corresponding to IP3 to close the connection established with IP3.
[0083] In the method shown in Figure 4, for 0-RTT scenarios with concurrent multi-IP connections, the successful connection with any device based on any IP is determined only after a response message from any device has been received, and only then are all other connection tasks closed. This is rather than initiating a connection based on any IP and then, if no response message from any device has been received, assuming the connection is successful and closing connections based on other IPs. This solves the problem of connection failures caused by prematurely closing connections based on other IPs without receiving a response message from any device, thereby improving the connection success rate.
[0084] Taking any one of at least one device as an example, refer to Figure 5, which is a flowchart of a method for establishing a connection provided in an embodiment of the present application. This method can be applied in the implementation environment shown in Figure 3. For example, any one of the devices is any one of device 1, device 2, and device 3 shown in Figure 3. As shown in Figure 5, the method for establishing a connection includes the following steps 501 and 502.
[0085] Step 501: receiving a connection establishment request and a first data packet sent by a client based on any IP address, where the first data packet is a data packet in application data required to be transmitted for accessing a service domain name.
[0086] The connection request is used to establish a connection between any device and the client based on any IP address. This connection is used to transmit application data required to access the service domain name. In this embodiment of the present application, for multiple sets of connection requests and first data packets sent concurrently by the client, at least one device will only process one set of connection requests and first data packets at a time. After the processing of the first set of connection requests and first data packets is completed, the next set of connection requests and first data packets will be processed.
[0087] Optionally, for any service domain name, if any device starts processing a connection request for that service domain name, the processing thread for that service domain name will be locked so that any concurrent connection requests other than the one being processed for that service domain name will not be processed. If any device completes processing the connection request for that service domain name, the processing thread for that service domain name will be unlocked so that any concurrent connection requests other than the one being processed for that service domain name will be processed.
[0088] Taking any IP as IP1 as an example, when any device corresponds to IP1 and IP2, any device will receive the connection request and the first data packet sent by the client once based on IP1, and will receive the connection request and the first data packet sent by the client again based on IP2. If any device first receives the connection request and the first data packet sent by the client based on IP1, then any device will start processing the connection request and the first data packet received based on IP1, and lock the processing thread for any service domain name. So that when any device receives the connection request and the first data packet sent by the client again based on IP2, because the processing thread of any service domain name is locked, the processing of the connection request and the first data packet received again based on IP2 will be suspended.
[0089] In one possible implementation, the first data packet is encrypted using a recovery key, which is a shared key determined during the first handshake with the client. Therefore, before any device processes the first data packet, that is, before returning a response message to the client based on any IP address, the first data packet is first decrypted using the recovery key.
[0090] Step 502: When the connection request and the first data packet are processed for the first time, a response message is returned to the client based on any IP to determine that the connection established based on any IP is successful. The response message includes a connection response for the connection request and a confirmation packet for the first data packet. Alternatively, when the connection request and the first data packet are not processed for the first time, a close message sent by the client is received based on any IP to close the connection established based on any IP.
[0091] In an embodiment of the present application, the processing method for the received connection request and the first data packet is to first determine whether the received connection request and the first data packet are processed for the first time. If it is the first time, a response message is returned to the client based on any IP. If it is not the first time, a response message is not returned to the client based on any IP. In the case where a response message is not returned to the client based on any IP, a close message sent by the client based on any IP will be received, and the connection established based on any IP will be closed according to the close message, for example, the connection request and the first data packet received based on any IP will be discarded.
[0092] The present embodiment of the present application does not limit the method for determining whether a received connection request and first data packet are processed for the first time. For example, at least one device is connected to a connection database, which is used to record the identifiers of connection requests and first data packets that have been processed for the first time. Then, by checking whether the connection database includes the identifiers carried in the received connection request and first data packet, it is determined whether the received connection request and first data packet are processed for the first time.
[0093] When the connection request carries a first identifier and the first data packet carries a second identifier, the connection database records the identifier of the connection request processed for the first time and the identifier of the first data packet processed for the first time. The method for determining whether the received connection request and first data packet are processed for the first time is as follows: if the connection database does not include the first identifier and the second identifier, it is determined that the connection request and the first data packet are processed for the first time; if the connection database includes at least one of the first identifier or the second identifier, it is determined that the connection request and the first data packet are not processed for the first time.
[0094] In this case, after a response message is returned to the client based on any IP address, the first identifier and the second identifier are added to the connection database. The connection database records the first identifier of the connection request and the second identifier of the first data packet processed for the first time. Then, by determining whether the connection database contains the first identifier and the second identifier, it is possible to accurately determine whether the received connection request and first data packet are processed for the first time.
[0095] When a connection request and a first data packet are encapsulated and transmitted in a message that also includes a third identifier, the connection database records the identifier of the message being processed for the first time. A method for determining whether the received connection request and first data packet are processed for the first time is to determine, if the connection database does not include the third identifier, that the connection request and first data packet are processed for the first time; and if the connection database does include the third identifier, that the connection request and first data packet are not processed for the first time.
[0096] In this case, after returning a response message to the client based on any IP address, the method further includes: adding a third identifier to a connection database. The connection database records the third identifier of the message processed for the first time, and whether the third identifier is included in the connection database can accurately determine whether the received message is processed for the first time.
[0097] In the method shown in Figure 5, for a 0-RTT scenario with concurrent multi-IP connections, a received connection request and first data packet are processed only if it is determined that they are being processed for the first time. This prevents repeated processing of repeatedly sent connection requests and first data packets, improving the accuracy of their processing.
[0098] The method for establishing a connection provided in an embodiment of the present application is illustrated by taking multiple IPs including IP1 and IP2, where IP1 corresponds to device 1 and IP2 corresponds to device 2. Referring to FIG6 , if the network functions between the client and devices 1 and 2 are normal, the connection establishment process includes but is not limited to the following steps 61 to 66.
[0099] In step 61, the client obtains the two IP addresses corresponding to the current device domain name through DNS resolution, denoted as IP1 and IP2. The client sends initial and 0-RTT data to device 1 via IP1, and simultaneously sends the same initial and 0-RTT data to device 2 via IP2. The initial or 0-RTT data sent via IP1 and the initial or 0-RTT data sent via IP2 carry the same unique request identifier.
[0100] In step 62, after receiving the initial and 0-RTT data from the client, device 1 queries the database based on the unique request identifier carried in the initial or 0-RTT data to determine whether the current request has been processed. Since there is no record of the unique request identifier in the database, step 63 is executed.
[0101] In step 63, device 1 determines that this is the first time to process the request and processes it as a normal response, that is, returns a handshake and ack packet to the client and records the current unique request identifier in the database.
[0102] In step 64, after receiving the initial and 0-RTT data from the client, device 2 queries the database based on the unique request identifier carried in the initial or 0-RTT data. Since the database already has a record for the unique request identifier, step 65 is executed.
[0103] In step 65, device 2 determines that the current request has been processed and ignores the initial and 0-RTT data, that is, does not return the handshake and ack packets to the client.
[0104] In step 66, the client receives the handshake and ack packets returned by device 1, confirming that the IP1 connection was successfully established. The client then sends a close message to device 2 to close the IP2 connection. This concludes the concurrent establishment of multiple IP connections in the 0-RTT scenario, with successful connection establishment and data transmission and reception via IP1.
[0105] In the scenario shown in Figure 6 where the devices corresponding to multiple IPs can all receive the client's request normally, the client adds a unique request identifier in the initial or 0-RTT data for request deduplication, so that the device can deduplicate based on the unique request identifier, preventing the same request from being processed multiple times, thereby avoiding other problems caused by repeated request processing.
[0106] If the network between the client and either device 1 or device 2 is abnormal, or if either device 1 or device 2 is unable to process or respond to the client's request, this embodiment of the application uses the device 1 abnormality as an example. The connection establishment process for the device 2 abnormality is similar to the connection establishment process for the device 1 abnormality and will not be repeated here. Referring to Figure 7, in the scenario where device 1 is abnormal and device 2 is normal, the connection establishment process includes but is not limited to the following steps 71-74.
[0107] In step 71, the client obtains the two IP addresses corresponding to the current device domain name through DNS resolution, again represented by IP1 and IP2. The client sends initial and 0-RTT data to device 1 via IP1, and simultaneously sends the same initial and 0-RTT data to device 2 via IP2. The initial or 0-RTT data sent via IP1 and the initial or 0-RTT data sent via IP2 carry the same unique request identifier.
[0108] In step 72, after receiving the initial and 0-RTT data from the client, device 2 queries the database based on the unique request identifier carried in the initial or 0-RTT data to determine whether the current request has been processed. Since there is no record of the unique request identifier in the database, step 73 is executed.
[0109] Wherein, due to an abnormality in the network or device 1, device 1 does not receive the client's request or is unable to process the client's request.
[0110] In step 73, device 2 determines that this is the first time to process the request and processes it as a normal response, that is, returns a handshake and ack packet to the client and records the current unique request identifier in the database.
[0111] Step 74: The client receives the handshake and ack packets from device 2, confirming the successful IP2 connection. The client then sends a close message to device 1 to close the IP1 connection. This concludes the concurrent multi-IP connection in the 0-RTT scenario, with a successful IP2 connection and data transmission.
[0112] Therefore, the client does not terminate concurrent tasks upon notification of a successful underlying 0-RTT connection. Instead, it stops concurrent IP connection establishment only when it actually receives a response message from the device, rather than assuming a connection is successful and closing other concurrent IP connections when a 0-RTT message is successfully sent. This ensures successful 0-RTT connections. This prevents the possibility of network or device anomalies causing request failures during concurrent multi-IP connection establishment, leading to the closure of other IP connections and the failure of otherwise successful requests. This improves the connection success rate.
[0113] The above describes the method for establishing a connection according to an embodiment of the present application. Corresponding to the above method, an embodiment of the present application also provides a device for establishing a connection. Figure 8 is a structural diagram of a device for establishing a connection provided by an embodiment of the present application. Based on the following multiple modules shown in Figure 8, the device for establishing a connection shown in Figure 8 can perform all or part of the operations performed in Figures 4-7. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown therein, and the embodiment of the present application does not limit this. As shown in Figure 8, the device includes a transceiver module 801 and a processing module 802.
[0114] The transceiver module 801 is used to perform the reception and / or transmission related operations performed in the method shown in Figure 4, and the processing module 802 is used to perform other operations other than the reception and / or transmission related operations in the method shown in Figure 4; or, the transceiver module 801 is used to perform other operations other than the reception and / or transmission related operations in the method shown in Figure 5, and the processing module 802 is used to perform other operations other than the reception and / or transmission related operations performed in the method shown in Figure 5.
[0115] In a possible implementation, the transceiver module 801 includes a receiving module and / or a sending module. The receiving module is used to perform reception-related operations, and the sending module is used to perform sending-related operations.
[0116] In the case where the transceiver module 801 is used to perform the reception and / or transmission related operations performed in the method shown in Figure 4, and the processing module 802 is used to perform other operations other than the reception and / or transmission related operations performed in the method shown in Figure 4.
[0117] The processing module 802 is used to obtain multiple IPs corresponding to the service domain name to be accessed; the transceiver module 801 is used to send a connection request and a first data packet to at least one device corresponding to the multiple IPs based on the multiple IPs, where the first data packet is a data packet in the application data required to be transmitted to access the service domain name; the processing module 802 is used to determine that the connection established based on any IP is successful when a response message is received from any device among the at least one device based on any IP among the multiple IPs, where the response message includes a connection response to the connection request and a confirmation packet for the first data packet; the transceiver module 801 is used to send a close message to the devices corresponding to the remaining IPs based on the remaining IPs except any IP, where the close message is used to close the connection established based on the remaining IPs.
[0118] In one possible implementation, the connection request carries a first identifier, and the first data packet carries a second identifier. The first identifier is used by the device to deduplicate received connection requests with the same first identifier, and the second identifier is used by the device to deduplicate received first data packets with the same request identifier.
[0119] In a possible implementation, the connection establishment request and the first data packet are encapsulated in a message for transmission. The message further encapsulates a third identifier, and the third identifier is used by the device to deduplicate received messages with the same third identifier.
[0120] In a possible implementation, the first data packet is encrypted using a recovery key, where the recovery key is a shared key determined during the first handshake with the device corresponding to the service domain name.
[0121] In a possible implementation, the transceiver module 801 is further configured to send a second data packet to a device corresponding to any IP based on any IP, where the second data packet is a data packet subsequent to the first data packet.
[0122] In the case where the transceiver module 801 is used to perform other operations besides the reception and / or transmission related operations performed in the method shown in Figure 5, and the processing module 802 is used to perform other operations besides the reception and / or transmission related operations performed in the method shown in Figure 5.
[0123] The transceiver module 801 is used to receive a connection request and a first data packet sent by a client based on any IP, where the first data packet is a data packet in the application data required to be transmitted to access the service domain name; when the connection request and the first data packet are processed for the first time, a response message is returned to the client based on any IP to determine that the connection established based on any IP is successful, and the response message includes a connection response for the connection request and a confirmation packet for the first data packet; or, when the connection request and the first data packet are not processed for the first time, a close message sent by the client is received based on any IP to close the connection established based on any IP.
[0124] In one possible implementation, the connection request carries a first identifier, and the first data packet carries a second identifier, the first identifier is used by the device to deduplicate received connection requests with the same first identifier, and the second identifier is used by the device to deduplicate received first data packets with the same request identifier; the processing module 802 is used to determine that the connection request and the first data packet are processed for the first time if the connection database does not include the first identifier and the second identifier, and the connection database records the identifier of the connection request processed for the first time and the identifier of the first data packet processed for the first time; if the connection database includes at least one of the first identifier or the second identifier, determine that the connection request and the first data packet are not processed for the first time.
[0125] In a possible implementation, the processing module 802 is further configured to add the first identifier and the second identifier to the connection database.
[0126] In one possible implementation, the connection request and the first data packet are encapsulated in a message for transmission, and the message also encapsulates a third identifier, which is used by the device to deduplicate received messages with the same third identifier; the processing module 802 is used to determine that the connection request and the first data packet are processed for the first time if the connection database does not include the third identifier, and the connection database records the identifier of the message processed for the first time; if the connection database includes the third identifier, it is determined that the connection request and the first data packet are not processed for the first time.
[0127] In a possible implementation, the processing module 802 is further configured to add a third identifier to the connection database.
[0128] In a possible implementation, the first data packet is encrypted using a recovery key, where the recovery key is a shared key determined during the first handshake with the client. The processing module 802 is further configured to decrypt the first data packet based on the recovery key.
[0129] It should be understood that the device provided in FIG8 is merely an example of the division of the functional modules described above when implementing its functions. In actual applications, the functions described above can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0130] Referring to Figure 9 , a schematic diagram illustrating the structure of a network device 2000 according to an exemplary embodiment of the present application is shown. The network device 2000 shown in Figure 9 is configured to perform the operations involved in the connection establishment method shown in Figures 4 or 5 . The network device 2000 is, for example, a switch or router, and can be implemented using a general bus architecture.
[0131] As shown in FIG. 9 , the network device 2000 includes at least one processor 2001 , a memory 2003 , and at least one communication interface 2004 .
[0132] The processor 2001 is, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solution of the present application. For example, the processor 2001 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute the various logic blocks, modules, and circuits described in conjunction with the disclosure of the embodiments of the present invention. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0133] Optionally, network device 2000 also includes a bus. The bus is used to transmit information between the various components of network device 2000. The bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, for example. Buses can be categorized as address buses, data buses, control buses, and the like. For ease of illustration, FIG9 shows only one line, but this does not imply that there is only one bus or only one type of bus.
[0134] The memory 2003 is, for example, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, or a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2003 is, for example, independent and connected to the processor 2001 via a bus. The memory 2003 can also be integrated with the processor 2001.
[0135] The communication interface 2004 uses any transceiver-like device for communicating with other devices or communication networks. The communication network can be Ethernet, a radio access network (RAN), or a wireless local area network (WLAN). The communication interface 2004 can include a wired communication interface or a wireless communication interface. Specifically, the communication interface 2004 can be an Ethernet interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a wireless local area network (WLAN) interface, a cellular network communication interface, or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In the embodiment of the present application, the communication interface 2004 can be used for the network device 2000 to communicate with other devices.
[0136] In a specific implementation, as an embodiment, the processor 2001 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG9 . Each of these processors may be a single-core CPU processor or a multi-core CPU processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0137] In a specific implementation, as an embodiment, the network device 2000 may include multiple processors, such as the processor 2001 and the processor 2005 shown in FIG9 . Each of these processors may be a single-core CPU or a multi-core CPU. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0138] In a specific implementation, as an embodiment, the network device 2000 may further include an output device and an input device. The output device communicates with the processor 2001 and can display information in a variety of ways. For example, the output device can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device communicates with the processor 2001 and can receive user input in a variety of ways. For example, the input device can be a mouse, a keyboard, a touch screen device, or a sensor device.
[0139] In some embodiments, the memory 2003 is used to store program code 2010 for executing the solution of the present application, and the processor 2001 can execute the program code 2010 stored in the memory 2003. That is, the network device 2000 can implement the method for establishing a connection provided by the method embodiment through the processor 2001 and the program code 2010 in the memory 2003. The program code 2010 may include one or more software modules. Optionally, the processor 2001 itself may also store program code or instructions for executing the solution of the present application.
[0140] In a specific embodiment, the network device 2000 of the embodiment of the present application may correspond to the client in the above-mentioned method embodiments. The processor 2001 in the network device 2000 reads the instructions in the memory 2003, so that the network device 2000 shown in Figure 9 can execute all or part of the operations performed by the client in the above-mentioned method embodiments.
[0141] For another example, the network device 2000 in an embodiment of the present application may correspond to any device in the above-mentioned method embodiments. The processor 2001 in the network device 2000 reads the instructions in the memory 2003, so that the network device 2000 shown in Figure 9 can execute all or part of the operations performed by any device in the above-mentioned method embodiments.
[0142] The network device 2000 may also correspond to the apparatus for establishing a connection shown in FIG8 , and each functional module in the apparatus for establishing a connection may be implemented using software of the network device 2000. In other words, the functional modules included in the apparatus for establishing a connection are generated by the processor 2001 of the network device 2000 after reading the program code 2010 stored in the memory 2003.
[0143] Among them, each step of the method for establishing a connection shown in Figure 4 or 5 is completed by the hardware integrated logic circuit or software instructions in the processor of the network device 2000. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
[0144] Referring to Figure 10, Figure 10 shows a schematic diagram of the structure of a network device 2100 provided in another exemplary embodiment of the present application. The network device 2100 shown in Figure 10 is used to perform all or part of the operations involved in the method for establishing a connection shown in Figures 4 or 5. The network device 2100 is, for example, a switch, a router, etc., and the network device 2100 can be implemented using a general bus architecture.
[0145] As shown in FIG. 10 , the network device 2100 includes a main control board 2110 and an interface board 2130 .
[0146] The main control board (MCB), also known as the main processing unit (MPU) or route processor card, is used to control and manage various components in network device 2100, including routing calculations, device management, device maintenance, and protocol processing. MCB 2110 includes a central processing unit (CPU) 2111 and memory 2112.
[0147] Interface board 2130 is also known as a line processing unit (LPU), line card, or service board. It provides various service interfaces and implements data packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces and POS (Packet over SONET / SDH) interfaces. Ethernet interfaces, for example, are Flexible Ethernet Clients (FlexE Clients) interfaces. Interface board 2130 includes a central processing unit (CPU) 2131, a network processor (NPU) 2132, a forwarding table memory 2134, and a physical interface card (PIC) 2133.
[0148] The central processing unit 2131 on the interface board 2130 is used to control and manage the interface board 2130 and communicate with the central processing unit 2111 on the main control board 2110 .
[0149] The network processor 2132 is used to implement message forwarding processing. The network processor 2132 can be in the form of a forwarding chip. The forwarding chip can be a network processor (NP). In some embodiments, the forwarding chip can be implemented using an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA). Specifically, the network processor 2132 is used to forward received messages based on the forwarding table stored in the forwarding entry memory 2134. If the destination address of the message is the address of the network device 2100, the message is sent to the CPU (such as the central processing unit 2131) for processing. If the destination address of the message is not the address of the network device 2100, the next hop and outgoing interface corresponding to the destination address are searched in the forwarding table based on the destination address, and the message is forwarded to the outgoing interface corresponding to the destination address. The processing of uplink messages may include processing the message inbound interface and forwarding table lookup; the processing of downlink messages may include forwarding table lookup, etc. In some embodiments, the central processing unit may also perform the functions of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, thereby eliminating the need for a forwarding chip in the interface board.
[0150] Physical interface card 2133 implements physical layer interconnection. Raw traffic enters interface board 2130 through this card, and processed packets are sent out from this physical interface card 2133. Physical interface card 2133, also known as a daughter card, can be installed on interface board 2130. It converts optical and electrical signals into packets, performs a validity check on these packets, and then forwards them to network processor 2132 for processing. In some embodiments, central processing unit 2131 can also perform the functions of network processor 2132, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for network processor 2132 in physical interface card 2133.
[0151] Optionally, the network device 2100 includes multiple interface boards. For example, the network device 2100 further includes an interface board 2140. The interface board 2140 includes a central processing unit 2141, a network processor 2142, a forwarding table entry memory 2144, and a physical interface card 2143. The functions and implementation of each component in the interface board 2140 are the same as or similar to those of the interface board 2130 and are not described in detail here.
[0152] Optionally, network device 2100 further includes a switching fabric board 2120. Switching fabric board 2120 may also be referred to as a switch fabric unit (SFU). If network device 2100 includes multiple interface boards, switching fabric board 2120 is used to exchange data between the interface boards. For example, interface board 2130 and interface board 2140 can communicate via switching fabric board 2120.
[0153] The main control board 2110 is coupled to the interface board. For example, the main control board 2110, the interface board 2130, the interface board 2140, and the switching network board 2120 are connected to the system backplane via a system bus to achieve intercommunication. In one possible implementation, an inter-process communication (IPC) channel is established between the main control board 2110 and the interface boards 2130 and 2140, and communication is performed between the main control board 2110 and the interface boards 2130 and 2140 via the IPC channel.
[0154] Logically, network device 2100 includes a control plane and a forwarding plane. The control plane includes a main control board 2110 and a central processing unit (CPU) 2111. The forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 2134, physical interface cards 2133, and a network processor 2132. The control plane performs routing functions, generates forwarding tables, processes signaling and protocol messages, and configures and maintains the network device's status. The control plane sends the generated forwarding tables to the forwarding plane. On the forwarding plane, the network processor 2132 forwards messages received by the physical interface card 2133 based on the forwarding tables sent by the control plane. The forwarding tables sent by the control plane can be stored in the forwarding table entry memory 2134. In some embodiments, the control plane and forwarding plane can be completely separate and not located on the same network device.
[0155] It's worth noting that there may be one or more main control boards (SPUs), which can include both active and standby SPUs. There may also be one or more interface boards. The higher the network device's data processing capabilities, the more interface boards it provides. Interface boards can also have one or more physical interface cards. There may be no SPUs, one or more SPUs, and multiple SPUs can provide load balancing and redundancy. In a centralized forwarding architecture, network devices may not require SPUs; the interface boards handle service data processing for the entire system. In a distributed forwarding architecture, network devices may have at least one SPU, which enables data exchange between multiple interface boards, providing high-capacity data exchange and processing capabilities. Therefore, network devices with distributed architectures have greater data access and processing capabilities than those with centralized architectures. Alternatively, a network device can consist of a single card, without a switching fabric board (SFB), integrating the functions of the interface board and the main control board. In this case, the central processing unit (CPU) on the interface board and the CPU on the main control board can be combined into a single CPU on this card, performing the combined functions of the two. This type of network device has lower data exchange and processing capabilities (for example, low-end network devices such as switches or routers). The specific architecture used depends on the specific network deployment scenario and is not specified here.
[0156] In a specific embodiment, the network device 2100 corresponds to the apparatus for establishing a connection shown in FIG8 . In some embodiments, the transceiver module 801 in the apparatus for establishing a connection shown in FIG8 corresponds to the physical interface card 2133 in the network device 2100 , and the processing module 802 corresponds to the central processing unit 2111 or the network processor 2132 in the network device 2100 .
[0157] Figure 11 is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 1100 may have relatively large differences due to different configurations or performances, and may include one or more processors 1101 and one or more memories 1102, wherein the one or more memories 1102 store at least one computer program, and the at least one computer program is loaded and executed by the one or more processors 1101 to enable the server to implement the method for establishing a connection provided in the above-mentioned various method embodiments. Of course, the server 1100 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server 1100 may also include other components for implementing device functions, which will not be described in detail here.
[0158] An embodiment of the present application further provides a system for establishing a connection, comprising: a client and at least one device. For example, the client is network device 2000 shown in FIG. 9 or network device 2100 shown in FIG. 10 , and the at least one device is network device 2000 shown in FIG. 9 , network device 2100 shown in FIG. 10 , or the server shown in FIG. 11 . The method for establishing a connection performed by the client and the at least one device can be found in the description of the embodiments shown in FIG. 4-7 above, and will not be further described here.
[0159] An embodiment of the present application further provides a communication device, comprising: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other via an internal connection path. The memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals. When the processor executes the instructions stored in the memory, the processor executes a method required to be executed by a client or any device.
[0160] It should be understood that the processor described above may be a CPU, or other general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports the Advanced Reduced Instruction Set Machine (ARM) architecture.
[0161] Furthermore, in an optional embodiment, the memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. The memory may also include a non-volatile random access memory. For example, the memory may also store device type information.
[0162] The memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM), which is used as an external cache memory. By way of example and not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0163] An embodiment of the present application further provides a computer-readable storage medium, in which at least one instruction is stored. The instruction is loaded and executed by a processor to enable a computer to implement any of the above methods for establishing a connection.
[0164] The embodiments of the present application further provide a computer program (product), which, when executed by a computer, can enable a processor or computer to execute the corresponding steps and / or processes in the above method embodiments.
[0165] An embodiment of the present application also provides a chip, including a processor, for calling and executing instructions stored in a memory from a memory, so that a communication device equipped with the chip executes any of the above methods for establishing a connection.
[0166] An embodiment of the present application also provides another chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected through an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute any of the above methods for establishing a connection.
[0167] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive).
[0168] Those skilled in the art will appreciate that the various method steps and modules described in conjunction with the embodiments disclosed herein can be implemented in software, hardware, firmware, or any combination thereof. In order to clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0169] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0170] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. As an example, the method of the embodiment of the present application can be described in the context of a machine executable instruction, and the machine executable instruction is such as included in the program module executed in the device on the real or virtual processor of the target. Generally speaking, a program module includes a routine, a program, a library, an object, a class, a component, a data structure, etc., which performs a specific task or realizes a specific abstract data structure. In various embodiments, the function of the program module can be merged or split between the described program modules. The machine executable instruction for the program module can be executed in a local or distributed device. In a distributed device, the program module can be located in both a local and a remote storage medium.
[0171] The computer program code for realizing the method for the embodiment of the application can be written in one or more programming languages.These computer program codes can be provided to the processor of general-purpose computer, special-purpose computer or other programmable data processing device, so that program code, when being executed by computer or other programmable data processing device, causes the function / operation specified in flow chart and / or block diagram to be implemented.Program code can be executed completely on computer, partly on computer, as independent software package, partly on computer and partly on remote computer or completely on remote computer or server.
[0172] In the context of the embodiments of the present application, computer program code or related data may be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, and the like.
[0173] Examples of signals may include electrical, optical, radio, acoustic or other forms of propagated signals, such as carrier waves, infrared signals, etc.
[0174] A machine-readable medium may be any tangible medium that contains or stores a program for or in connection with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination thereof. More detailed examples of machine-readable storage media include an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0175] Those skilled in the art will clearly understand that, for the sake of convenience and brevity of description, the specific working processes of the above-described systems, devices, and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0176] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, or can be electrical, mechanical or other forms of connection.
[0177] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0178] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.
[0179] If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0180] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items that have substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there any limitation on quantity or execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the various examples, a first image may be referred to as a second image, and similarly, a second image may be referred to as a first image. The first image and the second image may both be images, and in some cases, may be separate and different images.
[0181] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0182] In this application, the term "at least one" means one or more, and the term "plurality" means two or more. For example, "plurality of second messages" means two or more second messages. The terms "system" and "network" are often used interchangeably herein.
[0183] It should be understood that the terminology used in the description of the various examples herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0184] It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the listed items. The term "and / or" describes an association between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this application generally indicates that the associated objects are in an "or" relationship.
[0185] It will also be understood that the term “comprise” (also known as “includes,” “including,” “comprises,” and / or “comprising”) when used in this specification specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0186] It should also be understood that the terms “if” and “if” may be interpreted to mean “when” or “upon” or “in response to determining” or “in response to detecting.” Similarly, the phrases “if it is determined that ” or “if [stated condition or event] is detected” may be interpreted to mean “upon determining ” or “in response to determining ” or “upon detecting [stated condition or event]” or “in response to detecting [stated condition or event],” depending on the context.
[0187] It should be understood that determining B based on A does not mean determining B based solely on A. B can also be determined based on A and / or other information.
[0188] It should also be understood that references throughout this specification to "one embodiment," "an embodiment," or "one possible implementation" mean that specific features, structures, or characteristics associated with that embodiment or implementation are included in at least one embodiment of the present application. Therefore, the appearance of "in one embodiment," "in an embodiment," or "one possible implementation" throughout this specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0189] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application should be included in the scope of protection of the present application.
Claims
1. A method for establishing a connection, characterized in that: The method comprises: Obtain multiple Internet Protocol IP addresses corresponding to the service domain name to be accessed; Sending a connection establishment request and a first data packet to at least one device corresponding to the multiple IPs based on the multiple IPs, where the first data packet is a data packet in the application data required to be transmitted to access the service domain name; Upon receiving a response message returned by any one of the at least one device based on any one of the multiple IPs, determining that the connection established based on the any one IP is successful, the response message including a connection establishment response to the connection establishment request and a confirmation packet for the first data packet; Based on the remaining IPs among the multiple IPs except the any one IP, a close message is sent to the devices corresponding to the remaining IPs respectively, where the close message is used to close the connection established based on the remaining IPs.
2. The method according to claim 1, characterized in that The connection request carries a first identifier, and the first data packet carries a second identifier. The first identifier is used by the device to deduplicate received connection requests with the same first identifier, and the second identifier is used by the device to deduplicate received first data packets with the same request identifier.
3. The method according to claim 1, characterized in that The connection establishment request and the first data packet are encapsulated in a message for transmission. The message further encapsulates a third identifier, and the third identifier is used by the device to deduplicate received messages with the same third identifier.
4. The method according to any one of claims 1 to 3, characterized in that: The first data packet is encrypted using a recovery key, where the recovery key is a shared key determined when performing a first handshake with a device corresponding to the service domain name.
5. The method according to any one of claims 1 to 4, characterized in that: After determining that the connection established based on any one of the IPs is successful, the method further includes: Based on the any one IP, a second data packet is sent to a device corresponding to the any one IP, where the second data packet is a data packet subsequent to the first data packet.
6. A method for establishing a connection, characterized in that: The method comprises: Receiving, based on any IP address, a connection establishment request and a first data packet sent by a client, where the first data packet is a data packet in application data required to be transmitted for accessing a service domain name; If the connection establishment request and the first data packet are processed for the first time, a response message is returned to the client based on the any one IP address, determining that the connection established based on the any one IP address is successful, the response message including a connection establishment response to the connection establishment request and an acknowledgment packet for the first data packet; or In a case where the connection establishment request and the first data packet are not processed for the first time, a close message sent by the client is received based on the any IP to close the connection established based on the any IP.
7. The method according to claim 6, characterized in that The connection establishment request carries a first identifier, and the first data packet carries a second identifier, the first identifier is used by the device to deduplicate received connection establishment requests with the same first identifier, and the second identifier is used by the device to deduplicate received first data packets with the same request identifier; After receiving the connection establishment request and the first data packet sent by the client based on any IP, the method further includes: If the connection database does not include the first identifier and does not include the second identifier, it is determined that the connection request and the first data packet are processed for the first time, and the connection database records the identifier of the connection request processed for the first time and the identifier of the first data packet processed for the first time; If the connection establishment database includes at least one of the first identifier or the second identifier, it is determined that the connection establishment request and the first data packet are not processed for the first time.
8. The method according to claim 7, characterized in that After returning a response message to the client based on any one of the IP addresses, the method further includes: The first identifier and the second identifier are added to the connection database.
9. The method according to claim 6, characterized in that The connection establishment request and the first data packet are encapsulated in a message for transmission, and the message is further encapsulated with a third identifier, and the third identifier is used by the device to deduplicate received messages with the same third identifier; After receiving the connection establishment request and the first data packet sent by the client based on any IP, the method further includes: If the connection establishment database does not include the third identifier, it is determined that the connection establishment request and the first data packet are processed for the first time, and the connection establishment database records the identifier of the message processed for the first time; If the connection establishment database includes the third identifier, it is determined that the connection establishment request and the first data packet are not processed for the first time.
10. The method according to claim 9, characterized in that After returning a response message to the client based on any one of the IP addresses, the method further includes: The third identifier is added to the connection database.
11. The method according to any one of claims 6 to 10, characterized in that: The first data packet is encrypted using a recovery key, where the recovery key is a shared key determined during the first handshake with the client; Before returning a response message to the client based on any one of the IP addresses, the method further includes: The first data packet is decrypted based on the recovered key.
12. A device for establishing a connection, characterized in that: The device comprises: A transceiver module for performing operations related to receiving and / or sending in the method according to any one of claims 1 to 5, and a processing module for performing operations other than the operations related to receiving and / or sending in the method according to any one of claims 1 to 5; or A transceiver module is used to perform operations related to receiving and / or sending in the method described in any one of claims 6-11, and a processing module is used to perform other operations besides the operations related to receiving and / or sending in the method described in any one of claims 6-11.
13. A network device, characterized in that: The network device includes: a processor, the processor is coupled to a memory, the memory stores at least one program instruction or code, and the at least one program instruction or code is loaded and executed by the processor to enable the network device to implement the method for establishing a connection described in any one of claims 1-11.
14. A system for establishing a connection, characterized in that The system for establishing a connection includes a client and at least one device; The client is used to execute the method for establishing a connection according to any one of claims 1 to 5, and any one of the at least one devices is used to execute the method for establishing a connection according to any one of claims 6 to 11.
15. A computer-readable storage medium, characterized in that The computer storage medium stores at least one instruction, which is loaded and executed by the processor to enable the computer to implement the method for establishing a connection described in any one of claims 1 to 5, or to enable the computer to implement the method for establishing a connection described in any one of claims 6 to 11.
16. A computer program product, characterized in that The computer program product includes: computer program code, which is loaded and executed by a computer to enable the computer to implement the method for establishing a connection described in any one of claims 1 to 5, or to enable the computer to implement the method for establishing a connection described in any one of claims 6 to 11.
Citation Information
Patent Citations
Connection establishment method based on QUIC protocol
CN116405576A
Method, device, equipment and system for establishing connection, medium and program product
CN118400410A
QUIC transport protocol-based communication method and system
US20230247007A1
Message processing method and system, and device and storage medium
WO2023040782A1