Message transmission method and device, electronic equipment, related medium and program product
By introducing virtual port numbers into data packets, the congestion problem in bandwidth convergence networks is solved, efficient path replacement is achieved, and packet transmission efficiency is improved. It is suitable for data center networks, Redis data services, and cloud disk storage scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-12-23
- Publication Date
- 2026-06-23
AI Technical Summary
In communication networks with convergent bandwidth, existing congestion control schemes result in low message transmission efficiency, throughput significantly lower than ideal values, and cannot effectively solve network congestion problems.
By introducing a virtual port number into the data packet, the original port number is placed in the second field when the data packet is generated. The receiving end restores the original port number for transport layer protocol processing, thereby achieving path replacement to resolve congestion without affecting transport layer protocol processing.
It improves message transmission efficiency, avoids reduced throughput and increased latency due to congestion, and meets the application requirements of high reliability and low latency.
Smart Images

Figure CN122268796A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computers, and in particular to a message transmission method, apparatus, electronic device, related media, and program product. Background Technology
[0002] Modern communication networks, such as IPv4 networks, are often designed with convergent bandwidth to reduce costs and minimize average traffic intensity. This means the total uplink bandwidth is less than the total downlink bandwidth, with a ratio often reaching 1:3 or even 1:6. In such networks, multiple data streams frequently traversing the same physical link can cause network congestion.
[0003] To address this, related technologies offer congestion control schemes. These schemes detect network congestion levels and adjust the sending rate of the transmitting end accordingly to maintain stable network operation. However, when network congestion occurs, the congestion control scheme has to tolerate the congestion, resulting in low packet transmission efficiency and throughput significantly lower than ideal. Summary of the Invention
[0004] This disclosure provides a message transmission method, apparatus, electronic device, related medium, and program product that can solve congestion problems by switching routes, and the switching process does not affect the transport layer protocol processing, thereby effectively improving message transmission efficiency.
[0005] According to one aspect of this disclosure, a message transmission method is provided, applied to a sending device; the message transmission method includes: Generate a data packet; wherein, the first field in the data packet has a first original port number; Based on the congestion window value corresponding to the current routing period of the transmitting device, it is determined that the first original path from the transmitting device to the receiving device is congested. Select the first virtual port number corresponding to the current routing period from the first candidate port number set, update the first field with the first virtual port number, and place the first original port number in the second field of the data packet; the first virtual port number is used to perform routing calculations to obtain a first alternative path from the sending device to the receiving device. The data packet is sent so that after the receiving device receives the data packet, it can extract the first original port number from the second field and update the first field with the first original port number for transport layer protocol processing.
[0006] Optionally, selecting the first virtual port number corresponding to the current routing period from the first candidate port number set includes: Based on multiple candidate port numbers in the first candidate port number set, a routing operation is performed to obtain multiple candidate replacement paths from the sending device to the receiving device; Determine the path overlap between the first original path and the plurality of candidate replacement paths; The candidate port number corresponding to the candidate replacement path with the minimum path overlap is determined as the first virtual port number corresponding to the current routing cycle.
[0007] Optionally, selecting the first virtual port number corresponding to the current routing period from the first candidate port number set includes: Identify overlapping paths among multiple congested paths from the transmitting device to the receiving device; Based on multiple candidate port numbers in the first candidate port number set, a routing operation is performed to obtain multiple candidate replacement paths from the sending device to the receiving device; The candidate port number corresponding to the candidate replacement path that excludes the overlapping path is determined as the first virtual port number corresponding to the current routing cycle.
[0008] According to one aspect of this disclosure, a message transmission method is provided, applied to a receiving device; the message transmission method includes: A data packet is received from a sending device; wherein the data packet has a first field and a second field, the first field having a first virtual port number and the second field having a first original port number; the first virtual port number is selected by the sending device from a first set of candidate port numbers when the first original path from the sending device to the receiving device is congested based on the congestion window value corresponding to the current routing period of the sending device; the first virtual port number is used to perform routing calculations to obtain a first alternative path from the sending device to the receiving device; The first original port number is extracted from the second field, and the first field is updated with the first original port number for transport layer protocol processing.
[0009] According to one aspect of this disclosure, a message transmission apparatus is provided, applied to a transmitting device; the message transmission apparatus includes: A data packet generation module is used to generate data packets; wherein, the first field in the data packet has a first original port number; The first congestion determination module is used to determine, based on the congestion window value corresponding to the current routing period of the transmitting device, that the first original path from the transmitting device to the receiving device is congested. The data packet encapsulation module is used to select a first virtual port number corresponding to the current routing period from the first candidate port number set, update the first field with the first virtual port number, and place the first original port number in the second field of the data packet; the first virtual port number is used to perform routing calculations to obtain a first alternative path from the sending device to the receiving device. The data packet sending module is used to send the data packet so that after the receiving device receives the data packet, it can extract the first original port number from the second field and update the first field with the first original port number for transport layer protocol processing.
[0010] Optionally, the message transmission device further includes an acknowledgment message receiving module, used to receive an acknowledgment message for the data message from the receiving device; wherein the acknowledgment message has a third field and a fourth field, the third field having a second virtual port number selected by the receiving device from a second candidate port number set, and the fourth field having a second original port number, the second virtual port number being used to perform routing calculations to obtain a second alternative path from the receiving device to the sending device; The message transmission device further includes an acknowledgment message decapsulation module, which is used to extract the second original port number from the fourth field and update the third field with the second original port number for transport layer protocol processing.
[0011] Optionally, the data packet further includes a fifth field, which has a first checksum of the first original port number; the data packet encapsulation module is further configured to update the fifth field with a second checksum of the first virtual port number, so that after the receiving device receives the data packet, it uses the second checksum of the fifth field to verify the first virtual port number in the first field, and when the verification of the first virtual port number in the first field is successful, it extracts the first original port number from the second field and updates the first field with the first original port number.
[0012] Optionally, the data packet encapsulation module is further configured to place the first check value in the sixth field of the data packet, so that after the receiving device updates the first field with the first original port number, it can extract the first check value from the sixth field, update the fifth field with the first check value, verify the first original port number in the first field with the first check value in the fifth field, and perform transport layer protocol processing when the verification of the first original port number in the first field is successful.
[0013] Optionally, the first original port number includes a first original source port number and a first original destination port number, and the first field includes a seventh field having the first original source port number and an eighth field having the first original destination port number; the data packet encapsulation module is further configured to: Select the first virtual source port number corresponding to the current routing period from the first candidate source port number set, and update the seventh field with the first virtual source port number; Select the first virtual destination port number corresponding to the current routing period from the first candidate destination port number set, and update the eighth field with the first virtual destination port number; wherein, the candidate destination port number in the first candidate destination port number set is used to trigger the receiving device to update the seventh field and the eighth field.
[0014] Optionally, the first original port number includes at least one of a first original source port number and a first original destination port number, and the first field includes at least one of a seventh field having the first original source port number and an eighth field having the first original destination port number. The data packet encapsulation module is further used for: Perform at least one of the following processes: Select the first virtual source port number corresponding to the current routing period from the first candidate source port number set, and update the seventh field with the first virtual source port number; Select the port number of the first virtual destination corresponding to the current routing cycle from the first candidate destination port number set, and update the eighth field with the first virtual destination port number.
[0015] Optionally, the data packet encapsulation module is further configured to: A routing operation is performed based on multiple candidate port numbers in the first candidate port number set to obtain the correspondence between the multiple candidate port numbers and multiple physical ports of the transmitting device; Determine the port load level of the multiple physical ports; The physical port with the lowest port load is identified as the target physical port, and the candidate port number corresponding to the target physical port is identified as the filtered port number. Select the first virtual port number corresponding to the current routing cycle from the filtered port numbers.
[0016] Optionally, the data packet encapsulation module is further configured to: Based on multiple candidate port numbers in the first candidate port number set, a routing operation is performed to obtain multiple candidate replacement paths from the sending device to the receiving device; Determine the path overlap between the first original path and the plurality of candidate replacement paths; The candidate port number corresponding to the candidate replacement path with the minimum path overlap is determined as the first virtual port number corresponding to the current routing cycle.
[0017] Optionally, the data packet encapsulation module is further configured to: Identify overlapping paths among multiple congested paths from the transmitting device to the receiving device; Based on multiple candidate port numbers in the first candidate port number set, a routing operation is performed to obtain multiple candidate replacement paths from the sending device to the receiving device; The candidate port number corresponding to the candidate replacement path that excludes the overlapping path is determined as the first virtual port number corresponding to the current routing cycle.
[0018] Optionally, the first congestion determination module is further configured to: The congestion window value corresponding to the current routing cycle and the congestion window value corresponding to the historical routing cycles are fused to obtain a fused congestion window value. When the fusion congestion window value is less than the congestion window value threshold, it is determined that the first original path from the transmitting device to the receiving device is congested.
[0019] Optionally, the data packet encapsulation module is further configured to: When the path switching condition is met, the first virtual port number corresponding to the current routing period is selected from the first candidate port number set. The path switching conditions include at least one of the following: the sending window value corresponding to the current routing cycle of the sending device is zero and the duration reaches a first duration threshold; the interval between the last selection of the first candidate port number set reaches a second duration threshold.
[0020] Optionally, the data packet encapsulation module is further configured to: Perform any of the following processes: The second field of the data packet is updated with the first original port number so that the receiving device updates the second field with the original value of the second field after extracting the first original port number from the second field. A second field is created based on the first original port number, and the second field is added to the data packet so that the receiving device deletes the second field from the data packet after extracting the first original port number from the second field.
[0021] According to one aspect of this disclosure, a message transmission apparatus is provided for use in a receiving device; the message transmission apparatus includes: A data packet receiving module is used to receive data packets from a sending device; wherein, the data packet has a first field and a second field, the first field having a first virtual port number, and the second field having a first original port number; the first virtual port number is selected by the sending device from a first candidate port number set when the sending device determines that the first original path from the sending device to the receiving device is congested based on the congestion window value corresponding to the current routing period of the sending device; the first virtual port number is used to perform routing calculations to obtain a first alternative path from the sending device to the receiving device; The data packet decapsulation module is used to extract the first original port number from the second field and update the first field with the first original port number for transport layer protocol processing.
[0022] Optionally, the message transmission device further includes an acknowledgment message generation module for generating an acknowledgment message for the data message; wherein the third field in the acknowledgment message has a second original port number; The message transmission device further includes a second congestion determination module, used to determine, based on the congestion window value corresponding to the current routing period of the receiving device, that the second original path from the receiving device to the transmitting device is congested; The message transmission device further includes an acknowledgment message encapsulation module, which is used to select a second virtual port number corresponding to the current routing period from the second candidate port number set, update the third field with the second virtual port number, and place the second original port number in the fourth field of the acknowledgment message. The second virtual port number is used to perform routing calculations to obtain a second alternative path from the receiving device to the sending device. The message transmission device further includes an acknowledgment message sending module, which is used to send the acknowledgment message so that after the sending device receives the acknowledgment message, it can extract the second original port number from the fourth field and update the third field with the second original port number for transport layer protocol processing.
[0023] Optionally, the data packet further includes a fifth field, which has a second checksum of the first virtual port number; the data packet decapsulation module is further configured to: The first virtual port number in the first field is verified using the second verification value of the fifth field; When the verification of the first virtual port number in the first field is successful, the first original port number is extracted from the second field and the first field is updated with the first original port number.
[0024] Optionally, the data packet decapsulation module is further configured to: Update the fifth field with the first checksum of the first original port number; The first original port number in the first field is verified using the first verification value in the fifth field. When the verification of the first original port number in the first field is successful, transport layer protocol processing is performed.
[0025] Optionally, the data packet decapsulation module is further configured to: Perform any of the following processes: Extract the first checksum from the sixth field of the data packet; The first checksum is calculated based on the first original port number contained in the first field.
[0026] According to one aspect of this disclosure, an electronic device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the message transmission method as described above.
[0027] According to one aspect of this disclosure, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the message transmission method as described above. According to one aspect of this disclosure, a computer program product is provided, the computer program product including a computer program that is read and executed by a processor of an electronic device, causing the electronic device to perform the message transmission method as described above.
[0028] In related technologies, due to limitations of transport layer protocols, the five-tuple (including source port number, destination port number, etc.) in the messages transmitted between the sending and receiving devices is usually fixed. Forwarding devices in the message transmission network typically select routes based on the five-tuple in the message. This results in the sending device only being able to send messages to the receiving device along a fixed communication path. Therefore, even if this communication path becomes congested, it must endure the congestion. In this embodiment, the field recording the port number in the data packet is set to be replaceable during the routing process and recoverable during the receiving process, thus not affecting the transport layer protocol processing. Specifically, after determining that the first original path from the sending device to the receiving device is congested, a first virtual port number is selected from the first candidate port number set to attempt a new path, and the field recording the port number, i.e., the first field, is updated with the first virtual port number. The first virtual port number is used to select a new path, but the first original port number is needed in the subsequent transport layer protocol processing. Therefore, in this embodiment of the present disclosure, the first original port number is placed in the second field so that after the receiving device receives the data packet, it can recover the first original port number according to the second field, thereby achieving the effect of trying the selection of a new path to solve the congestion problem without affecting the transport layer protocol processing, thus improving the packet transmission efficiency.
[0029] Other features and advantages of this disclosure will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the disclosure. The objectives and other advantages of this disclosure may be realized and obtained by means of the structures particularly pointed out in the description, claims and drawings. Attached Figure Description
[0030] The accompanying drawings are provided to further understand the technical solutions of this disclosure and constitute a part of the specification. They are used together with the embodiments of this disclosure to explain the technical solutions of this disclosure and do not constitute a limitation on the technical solutions of this disclosure. Figure 1A This is a first architecture diagram of a system for applying the message transmission method provided in this embodiment of the disclosure; Figure 1B This is a second architecture diagram of the system for which the message transmission method provided in this embodiment is applied; Figure 1C This is a third-architecture diagram of the system in which the message transmission method provided in this embodiment is applied; Figure 2 This is a schematic diagram illustrating the application of the message transmission method provided in this embodiment to a data center network scenario; Figure 3 This is a schematic diagram illustrating the application of the message transmission method provided in this embodiment of the disclosure to a Redis data service scenario; Figure 4This is a schematic diagram illustrating the application of the message transmission method provided in this embodiment to a cloud disk storage scenario; Figure 5 This is a general flowchart of the message transmission method provided in the embodiments of this disclosure; Figure 6 This is a schematic diagram of the TCP / IP protocol stack model provided in the embodiments of this disclosure; Figure 7 This is a schematic diagram of the exponential growth algorithm provided in an embodiment of this disclosure; Figure 8 This is another schematic diagram of the exponential growth algorithm provided in this embodiment of the disclosure; Figure 9 This is a schematic diagram of the congestion avoidance algorithm provided in an embodiment of this disclosure; Figure 10 This is a schematic diagram of the timeout retransmission algorithm provided in the embodiments of this disclosure; Figure 11 This is a schematic diagram of a retransmission algorithm based on duplicate acknowledgments provided in an embodiment of this disclosure; Figure 12 yes Figure 5 A schematic diagram of step 530, which involves virtual tunnel encapsulation. Figure 13 This is a schematic diagram of path switching provided in an embodiment of this disclosure; Figure 14 This is a schematic diagram of routing operations provided in an embodiment of this disclosure; Figure 15 yes Figure 5 A schematic diagram of virtual tunnel decapsulation in step 550; Figure 16 It is about Figure 5 A detailed flowchart of step 520; Figure 17 It is about Figure 5 A detailed flowchart of steps 530 and 550; Figure 18 yes Figure 17 A schematic diagram of virtual tunnel encapsulation performed in steps 1710 to 1730. Figure 19 yes Figure 17 A schematic diagram of virtual tunnel decapsulation in step 1740; Figure 20 It is about Figure 5 Another specific flowchart for steps 530 and 550; Figure 21 yes Figure 20 A schematic diagram of step 2010, which involves virtual tunnel encapsulation. Figure 22 yes Figure 20A schematic diagram of virtual tunnel decapsulation in step 2020; Figure 23 It is about Figure 5 Another specific flowchart for steps 530 and 550; Figure 24 yes Figure 23 A schematic diagram of step 2310, which involves virtual tunnel encapsulation. Figure 25 yes Figure 23 A schematic diagram of step 2320, which involves virtual tunnel decapsulation. Figure 26 It is about Figure 5 Another specific flowchart for steps 530 and 550; Figure 27 It is about Figure 5 A detailed flowchart of step 530; Figure 28 It is about Figure 5 Another specific flowchart for step 530; Figure 29 It is about Figure 5 Another specific flowchart for step 530; Figure 30 It is about Figure 5 Another specific flowchart for step 530; Figure 31 It is about Figure 5 Another specific flowchart for steps 530 and 550; Figure 32 yes Figure 31 A schematic diagram of step 3110, which involves virtual tunnel encapsulation. Figure 33 yes Figure 31 A schematic diagram of step 3120, which involves virtual tunnel decapsulation. Figure 34 It is about Figure 5 Another specific flowchart for steps 530 and 550; Figure 35 yes Figure 34 A schematic diagram of virtual tunnel encapsulation in step 3410; Figure 36 yes Figure 34 A schematic diagram of step 3420, which involves virtual tunnel decapsulation. Figure 37 Based on Figure 5 A schematic diagram illustrating the virtual tunnel encapsulation-decapsulation process for implementing acknowledgment messages; Figure 38 yes Figure 37 A schematic diagram of step 3730, which involves virtual tunnel encapsulation. Figure 39 yes Figure 37 A schematic diagram of virtual tunnel decapsulation in step 3750; Figure 40 Based on Figure 5 A flowchart illustrating the process of verifying data packets; Figure 41 yes Figure 40 A schematic diagram of step 4010, which involves virtual tunnel encapsulation. Figure 42 yes Figure 40 A schematic diagram of step 4030, which involves virtual tunnel decapsulation. Figure 43 Based on Figure 40 A flowchart illustrating the implementation of two-layer verification of data packets; Figure 44 yes Figure 43 A schematic diagram of step 4310, which involves virtual tunnel encapsulation. Figure 45 yes Figure 43 A schematic diagram of step 4330 in the middle section for virtual tunnel decapsulation; Figure 46 Based on Figure 40 Another flowchart illustrating the implementation of two-layer verification of data packets; Figure 47 yes Figure 46 A schematic diagram of step 4620, which involves virtual tunnel decapsulation. Figure 48 This is a schematic diagram of an IPv4 network using the TCP protocol provided in an embodiment of this disclosure; Figure 49 This is another schematic diagram of an IPv4 network using the TCP protocol provided in this embodiment of the disclosure; Figure 50 This is a schematic diagram of a custom module in a server provided in an embodiment of this disclosure; Figure 51 This is a schematic diagram of the connection components and custom sublayers in the server provided in the embodiments of this disclosure; Figure 52 This is a schematic diagram of the TCP connection for message transmission provided in the embodiments of this disclosure; Figure 53 This is a schematic diagram of the TCP packet header provided in an embodiment of this disclosure; Figure 54 This is a schematic diagram of virtual tunnel encapsulation according to path control logic provided in an embodiment of this disclosure; Figure 55 This is a schematic diagram of virtual tunnel decapsulation according to path control logic provided in an embodiment of this disclosure; Figure 56 This is a schematic diagram of virtual tunnel encapsulation based on custom fields provided in an embodiment of this disclosure; Figure 57 This is a schematic diagram of virtual tunnel decapsulation based on custom fields provided in an embodiment of this disclosure; Figure 58 This is a schematic diagram comparing the experimental results of the embodiments of this disclosure with related technologies; Figure 59 This is a module block diagram of a message transmission device applied to a sending device provided in an embodiment of this disclosure; Figure 60 This is a block diagram of a message transmission device applied to a receiving device provided in an embodiment of this disclosure; Figure 61 This is a terminal structure diagram of the message transmission method provided in the embodiments of this disclosure; Figure 62 This is a server structure diagram of the message transmission method provided in the embodiments of this disclosure. Detailed Implementation To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this disclosure.
[0031] Before providing a further detailed description of the embodiments of this disclosure, the terms and concepts used in these embodiments are explained, and they are subject to the following interpretations: 1) Message transmission network: This generally refers to a network architecture that includes sending devices, receiving devices, and multiple forwarding devices. For example, a message transmission network can be a data center network. A data center network is an infrastructure used to provide network, storage, and computing resources to support enterprises or data center tenants in performing a wide range of workloads. The core components of a data center network include multiple servers and multiple switches, where servers are used as sending or receiving devices, and switches are used as forwarding devices.
[0032] 2) Congestion Control: By detecting congestion along the communication path and dynamically adjusting the sending rate of the transmitting end (sending device), excessive data injection into the communication path can prevent overload of forwarding devices. In the congestion control algorithm, a congestion window (cwnd) is maintained for each communication connection. The congestion window determines the maximum amount of data the transmitting end can send within a round-trip time (RTT). The size (value) of the congestion window is dynamically adjusted based on the current congestion level of the communication path. If the communication path becomes more congested, the congestion window value decreases; if the communication path becomes more uncongested, the congestion window value increases.
[0033] 3) Equal Cost Multi Path (ECMP): This is a technique that selects multiple equivalent communication paths in a message transmission network and distributes traffic across these paths to achieve load balancing and network redundancy.
[0034] 4) Communication connection: refers to the communication connection between the sending device and the receiving device.
[0035] 5) Communication path: refers to the combination of a series of forwarding devices and links that the transmitting device and the receiving device must pass through to transmit messages.
[0036] 6) Transport Layer Protocols: These are communication protocols located at the transport layer in a computer network architecture. Their main function is to provide end-to-end communication services between processes (or applications, services) on different devices. Transport layer protocols have port addressing capabilities, meaning they use port numbers to identify different processes. The port number is a crucial concept in the transport layer; it can be seen as a identifier used by a device to distinguish different processes. For example, when accessing a webpage through a browser on a computer, the browser process uses a specific port number to communicate with the corresponding web process on the server. This allows data to be accurately transmitted between specific processes on different devices.
[0037] In message transmission networks, equal-cost multipath routing hash algorithms are widely used for routing, which selects one communication path from multiple equivalent communication paths for message transmission. However, in practical message transmission networks, to reduce costs and minimize average traffic intensity, they are often designed with bandwidth convergence, meaning the total uplink bandwidth is less than the total downlink bandwidth, often in a ratio of 1:3 or even 1:6. In such networks, some degree of hash polarization inevitably occurs, where multiple data streams transmit through the same communication path, leading to congestion on that path.
[0038] In related technologies, the 5-tuple (including source port number, destination port number, etc.) in the messages transmitted between the sending and receiving devices is usually fixed. This is mainly because the 5-tuple is used for connection identification in the transport layer protocol. Changing some information in the 5-tuple will affect the connection identification of the transport layer protocol, leading to communication interruption. Simultaneously, forwarding devices in the message transmission network typically select routes based on the 5-tuple in the message, which means that the sending device can only send messages to the receiving device along a fixed communication path. When congestion occurs on the communication path from the sending device to the receiving device, related technologies can only use congestion control schemes to control the sending rate of the sending device, resulting in low message transmission efficiency and throughput significantly lower than ideal values.
[0039] Congestion control solutions provided by related technologies have to tolerate congestion, which in turn affects message transmission efficiency. Modern message transmission networks are very sensitive to message throughput and latency. A decrease in throughput directly reduces the input output per second (IOPS) of the application layer, while the increased latency caused by congestion can significantly increase service latency. Both throughput degradation and latency degradation may violate service commitment terms.
[0040] In response to this, embodiments of this disclosure provide a message transmission method, apparatus, electronic device, related medium, and program product that can solve congestion problems by switching routes, and the switching process does not affect the transport layer protocol processing, thereby effectively improving message transmission efficiency.
[0041] System architecture and scenario description of the embodiments disclosed herein Figure 1A This is a first system architecture diagram of the message transmission method provided in this embodiment of the disclosure, which includes a terminal 130, a forwarding device 120, a server 110, etc.
[0042] Terminal 130 can take various forms, including desktop computers, laptops, personal digital assistants (PDAs), mobile phones, in-vehicle terminals, and dedicated terminals. Furthermore, it can be a single device or a collection of multiple devices. For example, multiple desktop computers connected via a local area network, sharing a single monitor, can work collaboratively to form a single terminal 130. Terminal 130 can communicate with relay device 120 via wired or wireless means to exchange data.
[0043] Server 110 refers to a computer system capable of providing certain services to terminal 130. Compared to ordinary terminal 130, server 110 has higher requirements in terms of stability, security, and performance. Server 110 can be a single high-performance computer in a network platform, a cluster of multiple high-performance computers, a portion of a single high-performance computer (e.g., a virtual machine), or a combination of portions of multiple high-performance computers (e.g., virtual machines). Server 110 can also communicate with forwarding device 120 via wired or wireless means to exchange data.
[0044] Forwarding device 120 is used to realize message transmission between different network nodes (network nodes refer to terminal 130 or server 110) in the message transmission network. Forwarding device 120 typically has multiple physical ports, through which multiple network nodes can be connected. Forwarding device 120 can be a switch or router, or other device capable of receiving and forwarding messages. Messages sent from terminal 130 to server 110 must reach the corresponding server 110 through forwarding device 120; messages sent from server 110 to terminal 130 must also reach the corresponding terminal 130 through forwarding device 120. Figure 1A In this configuration, terminal 130 can be used as a sending device and server 110 can be used as a receiving device; or, server 110 can be used as a sending device and terminal 130 can be used as a receiving device, without any limitation.
[0045] Figure 1B This is a second system architecture diagram for the message transmission method provided in this embodiment of the disclosure. It includes a forwarding device 120 and a server 110, etc., wherein some servers 110 are used as sending devices and other servers 110 are used as receiving devices.
[0046] Figure 1C This is a third system architecture diagram for the message transmission method provided in this embodiment of the disclosure. It includes a terminal 130 and a server 110, wherein some terminals 130 are used as sending devices and other terminals 130 are used as receiving devices.
[0047] The embodiments disclosed herein can be applied in various scenarios, such as Figure 2 The data center network scenario shown is as follows: Figure 3 The Redis data service scenario shown, and such as Figure 4 The cloud disk storage scenario shown.
[0048] (a) Data center network scenario.
[0049] Data center networks typically use a Clos / Fat-tree architecture (Layer 3 or Layer 2 switches), such as Figure 2As shown, a data center network has three layers of switches: access layer (Leaf), aggregation layer (Spine), and core layer (Core). The data center network also includes a host layer, where servers act as sending or receiving devices, and the Layer 3 switches act as forwarding devices. An access layer switch and all its downstream servers are collectively called a rack; for example, access layer switches L0 and L1 and their downstream servers H0 and H1 together form rack 0. An access layer switch, all its upstream aggregation layer switches, and all its downstream servers are collectively called a network module (Pod); for example, access layer switches L0, L1, L2, and L3, along with their upstream aggregation layer switches S0, S1, S2, and S3 and their downstream servers H0, H1, H2, and H3, together form network module 0. It is worth noting that in a data center network, to increase communication bandwidth and connection reliability between servers, servers can connect to different access layer switches via multiple links, for example... Figure 2 In this configuration, server H0 is connected to access layer switch L0 through one physical port and to access layer switch L1 through another physical port. The physical port of the server is the network interface card (NIC) port.
[0050] by Figure 2 In this example, servers H0 and H4 are connected, and the original path from server H0 to server H4 is H0-L0-S0-C0-S4-L4-H4. Server H0 acts as the sending device, and server H4 acts as the receiving device. The "-" symbol in the original path indicates a physical link; for example, "H0-L0" means that server H0 and access layer switch L0 are connected via a physical link. When the original path from server H0 to server H4 is H0-L0-S0-C0-S4-L4-H4, the data packets sent by server H0 will sequentially pass through access layer switch L0, aggregation layer switch S0, core layer switch C0, aggregation layer switch S4, and access layer switch L4 before finally reaching server H4.
[0051] In the solutions provided by related technologies, server H0, as the sending device, detects the congestion status of the original path H0-L0-S0-C0-S4-L4-H4 through a congestion control algorithm and adjusts the sending rate of server H0 according to the congestion status, without switching routes. This causes the communication connection between server H0 and H4 to suffer from low throughput due to congestion, even if there are other communication paths that are idle in the data center network.
[0052] By using the message transmission method provided in this embodiment, server H0 does not directly send the data packet after generating it. Instead, it first determines whether the original path H0-L0-S0-C0-S4-L4-H4 is congested based on the congestion window value corresponding to the current routing period of server H0. If it is determined that the original path H0-L0-S0-C0-S4-L4-H4 is congested, the first virtual port number corresponding to the current routing period of server H0 is selected from the first candidate port number set, and the first field of the data packet is updated with the first virtual port number. The original first port number in the first field of the data packet is placed in the second field of the data packet. In this way, virtual tunnel encapsulation of the data packet is realized. That is, the value of the first field of the data packet changes from the first original port number to the first virtual port number. The first virtual port number is used to perform routing calculations to obtain the replacement path from server H0 to server H4. Here, the replacement path is H0-L1-S1-C2-S5-L5-H4 as an example. Then, server H0 sends a data packet, which travels along the replacement path H0-L1-S1-C2-S5-L5-H4 to server H4. Upon receiving the data packet, server H4 extracts the first original port number from the second field of the data packet and updates the first field of the data packet with this first original port number. This achieves virtual tunnel decapsulation of the data packet, restoring the original data packet generated by server H0. Thus, the virtual tunnel encapsulation-decapsulation process is transparent to the transport layer protocol and does not disrupt the connection identification between server H0 and server H4.
[0053] In this embodiment of the disclosure, the field recording the port number in the data packet is set so that it can be replaced during the routing process and can be restored during the reception process. This achieves the effect of trying new path selection to solve the congestion problem without affecting the transport layer protocol processing, thereby improving the packet transmission efficiency and making it well applicable to data center networks with bandwidth convergence.
[0054] (ii) Redis data service scenario.
[0055] like Figure 3The diagram illustrates a terminal 340, an overlay network 330, a proxy server 320, and a base network 310 (message transmission network). The base network 310 is an underlay network, meaning it's a network established directly at the physical layer; for example, it could be a data center network. The overlay network 330 is an overlay network, created using virtualization technology. The proxy server 320 facilitates communication between the base network 310 and the overlay network 330. The overlay network 330, proxy server 320, and base network 310 work together to provide Redis data services to the terminal 340. The overlay network 330 can be considered the front end of the Redis database, offering advantages in flexibility, security, and virtualization technology, thus meeting the external access and connection requirements of the Redis data service. The base network 310 can be considered the back end of the Redis database, focusing on high performance and stability to ensure the Redis data service can efficiently process data and provide services externally.
[0056] If the solutions provided by related technologies are applied in the basic network 310, problems such as terminal 340 request timeout and data loss will occur, which will seriously affect the availability and performance of Redis data services. For application scenarios that require high reliability and low latency (such as real-time data analysis and online transaction processing), the decline in service quality may lead to serious business losses. In addition, the basic network 310 and the overlay network 330 cannot exert their full performance, which can easily lead to a waste of computing resources.
[0057] If the message transmission method provided in this embodiment is applied to the basic network 310, the congestion problem faced by the basic network 310 can be solved quickly and effectively, giving full play to the performance of the basic network 310 itself, without limiting the performance of the overlay network 330; it can achieve efficient data processing, ensure high availability and timely feedback of Redis data services, and avoid serious business losses.
[0058] (III) Cloud disk storage scenario.
[0059] like Figure 4The diagram illustrates a terminal 420 and a basic network 410 (message transmission network). The basic network 410 is an underground network, meaning it's a network established directly at the physical layer; for example, it could be a data center network. The basic network 410 provides cloud disk storage services to the terminal 420. These cloud disk storage services support data creation, deletion, modification, and retrieval. For instance, in response to a data storage request initiated by the terminal 420, the basic network 410 stores the data carried in the data storage request. Alternatively, in response to a data read request initiated by the terminal 420, the basic network 410 retrieves the required data from its stored data and sends the retrieved data to the terminal 420.
[0060] If the solution provided by the relevant technology is applied in the basic network 410, the requests initiated by the terminal 420 may not be processed in a timely manner or may even fail to be processed, which will seriously affect the service quality and availability of cloud disk storage services.
[0061] If the message transmission method provided in this embodiment is applied in the basic network 410, the basic network 410 can quickly respond to the request initiated by the terminal 420, achieve more effective data balancing, and improve the service quality and availability of cloud disk storage services; at the same time, it also helps to improve the flexibility and scalability of cloud disk storage services, and provides strong support for functions such as online expansion and contraction.
[0062] It is worth noting that the examples above only illustrate some application scenarios of this disclosure. The business scenarios to which this disclosure can be applied may include, but are not limited to, the specific embodiments described above.
[0063] General Description of Embodiments in this Disclosure According to one embodiment of this disclosure, a message transmission method is provided. This method is applied to a message transmission network, which generally refers to a network architecture including a sending device, a receiving device, and multiple forwarding devices. For example, a message transmission network can be as follows: Figure 2 The data center network shown is as follows: A sending device is an electronic device used to send data packets to a receiving device and receive acknowledgment packets from the receiving device; a sending device can be a terminal or a server. A receiving device is an electronic device used to receive data packets from a sending device and send acknowledgment packets back to the sending device; a receiving device can be a terminal or a server. A forwarding device is an electronic device capable of receiving and forwarding packets; for example, a forwarding device can be a switch or a router.
[0064] Below, we will combine Figure 5 This invention describes the message transmission method provided in the embodiments of this disclosure. For ease of explanation, Figure 5The forwarding device is omitted, but in reality, the sending device and the receiving device need to use the forwarding device to transmit messages.
[0065] like Figure 5 As shown, a message transmission method according to an embodiment of this disclosure includes: Step 510: The sending device generates a data packet; wherein the first field in the data packet has the first original port number; Step 520: The transmitting device determines that the first original path from the transmitting device to the receiving device is congested based on the congestion window value corresponding to the current routing cycle of the transmitting device; Step 530: The sending device selects the first virtual port number corresponding to the current routing period from the first candidate port number set, updates the first field with the first virtual port number, and places the first original port number in the second field of the data packet; the first virtual port number is used to perform routing calculations to obtain the first alternative path from the sending device to the receiving device; Step 540: The sending device sends a data packet; Step 550: The receiving device extracts the first original port number from the second field and updates the first field with the first original port number for transport layer protocol processing.
[0066] Steps 510-550 are described in detail below.
[0067] In step 510, the sending device generates a data packet; wherein the first field in the data packet has a first original port number.
[0068] Once the sending device has established a communication connection with the receiving device, the sending device generates a data packet. The payload field of the data packet contains the service data that needs to be transmitted. The service data refers to the data that the sending device expects the receiving device to process. For example, it can be data that the sending device expects the receiving device to store, or data that the sending device expects the receiving device to calculate. There are no restrictions on this.
[0069] This disclosure does not limit the transport layer protocol used to establish the communication connection. For example, it can be a connection-oriented transport layer protocol, such as Transmission Control Protocol (TCP), Stream Control Transmission Protocol (SCTP), or Wireless Transaction Protocol (WTP). To facilitate understanding of the role of the transport layer, this disclosure provides, for example... Figure 6The diagram illustrates the TCP / IP protocol stack model, a fundamental communication architecture of the Internet. It divides network communication functions into different layers, each responsible for a specific task. Data transmission across the network is achieved through cooperation between these layers. Of course, other models can be used besides the TCP / IP stack, such as the Open Systems Interconnection (OSI) model. This explanation uses the TCP / IP stack as an example. Figure 6 As shown, the TCP / IP protocol stack model includes the application layer, transport layer, network layer, and network interface layer. The application layer is the top layer, interacts directly with processes, and defines how processes send data over the network. The transport layer defines port numbers to identify processes in a device and provides end-to-end data transmission services. The network layer defines Internet Protocol (IP) addresses to identify the network location of a device for routing and forwarding. The network interface layer defines data frames and transmits them in the physical network. In one embodiment, the network interface layer can be further subdivided into the data link layer and the physical layer.
[0070] Next, with Figure 6 Using the TCP / IP protocol stack model shown as an example, the data transmission process between the sending device and the receiving device is explained. For the transmitting device 610, the application layer transmits the service data to be transmitted to the transport layer; the transport layer encapsulates the service data into transport layer messages, which include a transport layer header (such as a TCP header) and a payload. The transport layer header adds information such as the port number, and the payload field is used to store the service data. Then, the transport layer message is transmitted to the network layer; the network layer encapsulates the transport layer message into a network layer message, which includes a network layer header (IP header), a transport layer header, and a payload. The network layer header adds information such as the IP address. Then, the network layer message is transmitted to the network interface layer; the network interface layer encapsulates the network layer message into a data frame (i.e., a data packet), which includes an Ethernet header (Eth header), a network layer header, a transport layer header, and a payload. The Ethernet header adds information such as the Media Access Control (MAC) address. Then, the network interface layer sends the data frame to the receiving device 620 via a physical link (such as a network cable). For the receiving device 620, after receiving the data frame, the service data can be obtained by unpacking the data frame in reverse order.
[0071] Based on the above examples, it can be seen that data packets have a port number field. Taking the TCP / IP protocol stack model as an example, the port number field is located in the transport layer header. For ease of distinction, the port number field in the data packet is named the first field, and the port number contained in the port number field of the data packet is named the first original port number. It is worth noting that the first original port number is the port number agreed upon when the sending device and the receiving device establish a communication connection, used to identify the communication connection between the sending device and the receiving device.
[0072] In step 520, the transmitting device determines that the first original path from the transmitting device to the receiving device is congested based on the congestion window value corresponding to the current routing period of the transmitting device.
[0073] Here, the process by which a sending device selects a communication path for a data packet is called a routing cycle (i.e., different routing cycles are for different data packets). The sending device can calculate the current congestion window value (real-time congestion window value) using a congestion control algorithm, which serves as the congestion window value corresponding to the current routing cycle. This disclosure does not limit the congestion control algorithm used; four congestion control algorithms will be illustrated below.
[0074] (a) Exponential growth algorithm.
[0075] After the sending and receiving devices establish a communication connection, the exponential growth algorithm can be used. The strategy of the exponential growth algorithm is to increment the congestion window size by 1 each time the sending device receives an acknowledgment message. Therefore, during this stage, the congestion window size will grow exponentially, thereby quickly detecting network conditions.
[0076] like Figure 7 and Figure 8 As shown, when the sending and receiving devices first establish a communication connection, the congestion window value is initialized. For example, the congestion window value is initialized to 1, indicating that the sending device can send one maximum segment size (MSS) of data at a time, i.e., one data packet. Then, the sending device sends one data packet and receives one corresponding acknowledgment packet, and the congestion window value changes from 1 to 2, indicating that the sending device can send two MSS of data at a time. Then, the sending device sends two data packets and receives two corresponding acknowledgment packets, and the congestion window value changes from 2 to 4, indicating that the sending device can send four MSS of data at a time. Finally, the sending device sends four data packets and receives four corresponding acknowledgment packets, and the congestion window value changes from 4 to 8, indicating that the sending device can send eight MSS of data at a time.
[0077] The exponential growth algorithm also includes an exponential growth threshold. When the congestion window size is less than the exponential growth threshold, the exponential growth algorithm is used; when the congestion window size is greater than or equal to the exponential growth threshold, the congestion avoidance algorithm is used. Here, we take an exponential growth threshold of 8 as an example.
[0078] (ii) Congestion avoidance algorithm.
[0079] When the congestion window size is greater than or equal to the exponential growth threshold, a congestion avoidance algorithm is used. For example... Figure 9 As shown, the congestion avoidance algorithm's strategy is to increase the congestion window size whenever the sending device receives an acknowledgment message, but the increase becomes 1 / congestion window size. Therefore, during the congestion avoidance phase, the congestion window size still increases, but the rate of increase changes from exponential to linear. This linear growth method can more stably increase the sending device's congestion window size, avoiding network congestion caused by the congestion window size increasing too quickly, and achieving a balance between utilizing network bandwidth and preventing congestion.
[0080] (iii) Congestion Occurrence Algorithm.
[0081] Congestion-causing algorithms are divided into timeout retransmission algorithms and retransmission algorithms based on duplicate acknowledgments.
[0082] 1) Timeout retransmission algorithm.
[0083] If, after the sending device transmits a data packet, no acknowledgment packet is received within the retransmission timeout (RTO), the timeout retransmission algorithm is used. For example... Figure 10 As shown, the strategy of the timeout retransmission algorithm is to reduce the exponentially growing threshold, initialize the congestion window size, and use an exponential growth algorithm. For example, the exponentially growing threshold can be updated to 1 / 2 or 1 / 3 of the congestion window size. Figure 10 For example, updating the exponential growth threshold from 8 to 6 (12 / 2). The timeout retransmission algorithm can quickly reduce the pressure on the network from the sending device, giving the network enough time to recover.
[0084] 2) Retransmission algorithm based on duplicate acknowledgments.
[0085] When the sending device receives duplicate acknowledgment messages, and the number of duplicate acknowledgment messages reaches a threshold, a retransmission algorithm based on duplicate acknowledgments is used. For example... Figure 11 As shown, the strategy of the retransmission algorithm based on duplicate acknowledgments is to reduce the congestion window size, update the exponential growth threshold based on the congestion window size, and use a recovery algorithm based on duplicate acknowledgments. Reducing the congestion window size can mean reducing it to 1 / 2, 1 / 3, etc. Figure 11For example, the congestion window value was updated from 12 to 6, and the exponential growth threshold was updated from 8 to 6.
[0086] (iv) Recovery algorithm based on duplicate confirmation.
[0087] like Figure 11 As shown, the strategy of the recovery algorithm based on duplicate acknowledgments is to increase the congestion window value according to the number threshold. For example, if the number threshold is 3, then the congestion window value is increased by 3 (meaning 3 MSS are added). Figure 11 Taking the congestion window value being updated from 6 to 9 as an example: the sending device retransmits lost data packets; when the sending device receives a duplicate acknowledgment packet, it increments the congestion window value by 1; when the sending device receives a new acknowledgment packet (i.e., a non-duplicate acknowledgment packet), it updates the congestion window value according to the initial value of the exponentially increasing threshold, and re-enters the congestion avoidance phase. Through the retransmission algorithm based on duplicate acknowledgments and the recovery algorithm, the congestion window value does not experience a precipitous drop like in the timeout retransmission algorithm, but rather remains at a relatively high value and continues to grow linearly. This moderate adjustment allows for maintaining a high transmission rate even when the network experiences a certain degree of congestion, while avoiding excessive network load and enabling a faster recovery to the congestion avoidance phase, continuing to effectively utilize network bandwidth.
[0088] Based on the above examples of congestion control algorithms, it can be seen that the congestion window value reflects the congestion status of the communication path; that is, the smaller the congestion window value, the more congested the communication path; and the larger the congestion window value, the less congested the communication path. Therefore, based on the congestion window value corresponding to the current routing period of the transmitting device, it can be determined whether the first original path from the transmitting device to the receiving device is congested. For example, when the congestion window value corresponding to the current routing period of the transmitting device is less than the congestion window value threshold, it is determined that the first original path from the transmitting device to the receiving device is congested; when the congestion window value corresponding to the current routing period of the transmitting device is greater than or equal to the congestion window value threshold, it is determined that the first original path from the transmitting device to the receiving device is not congested. The congestion window value threshold can be set according to the throughput requirements of the communication connection; for example, the higher the throughput requirements of the communication connection, the larger the congestion window value threshold can be set.
[0089] The first original path refers to the communication path used by the sending device in the previous routing cycle of the current routing cycle. If the previous routing cycle did not use virtual tunnel encapsulation, the first original path is obtained by routing calculation based on the first original port number; if the previous routing cycle used virtual tunnel encapsulation, the first original path is obtained by routing calculation based on the virtual port number corresponding to the previous routing cycle. It is worth noting that virtual tunnel encapsulation refers to the port number encapsulation method in step 530. Next, we will combine... Figure 2Two scenarios will be used to illustrate this.
[0090] (a) Scenarios in which virtual tunnel encapsulation was not used in the previous routing cycle.
[0091] For example, if virtual tunnel encapsulation is not used in routing period 1, the sending device will directly send out the generated data packet 1 for data packet 1 generated in routing period 1. At this time, the port number field of data packet 1 has the first original port number. The first original port number is used to perform routing calculations to obtain the first original path from the sending device to the receiving device. For example, the first original path is H0-L0-S0-C0-S4-L4-H4.
[0092] In routing period 2 following routing period 1, the transmitting device obtains the congestion window value corresponding to routing period 2 through the congestion control algorithm, and determines whether the first original path H0-L0-S0-C0-S4-L4-H4 from the transmitting device to the receiving device is congested based on the congestion window value corresponding to routing period 2.
[0093] (ii) Scenarios where virtual tunnel encapsulation was used in the previous routing cycle.
[0094] For example, if virtual tunnel encapsulation is used in routing period 1, the sending device processes data packet 1 generated in routing period 1 according to steps 520 to 540. At this time, the port number field of data packet 1 has the virtual port number corresponding to routing period 1. The virtual port number corresponding to routing period 1 is used to perform routing calculations to obtain the first original path from the sending device to the receiving device. For example, the first original path is H0-L0-S0-C1-S4-L4-H4.
[0095] In routing period 2 following routing period 1, the transmitting device obtains the congestion window value corresponding to routing period 2 through the congestion control algorithm, and determines whether the first original path H0-L0-S0-C1-S4-L4-H4 from the transmitting device to the receiving device is congested based on the congestion window value corresponding to routing period 2.
[0096] In step 530, the sending device selects the first virtual port number corresponding to the current routing period from the first candidate port number set, updates the first field with the first virtual port number, and places the first original port number in the second field of the data packet; the first virtual port number is used to perform routing calculations to obtain the first alternative path from the sending device to the receiving device.
[0097] When it is determined that the first original path from the sending device to the receiving device is not congested, it proves that the first original path is still available, and therefore the data packet can continue to be transmitted along the first original path. Specifically, this can be divided into two cases: when it is determined that the first original path from the sending device to the receiving device is not congested and virtual tunnel encapsulation was not used in the previous routing cycle, the sending device keeps the first field in the data packet unchanged, that is, it does not update the first field. In this way, when the sending device sends subsequent data packets, it will perform routing calculations based on the first original port number, so that the data packet reaches the receiving device along the first original path. The above method only uses virtual tunnel encapsulation when necessary, which can save the additional overhead of virtual tunnel encapsulation and decapsulation; when it is determined that the first original path from the sending device to the receiving device is not congested, Furthermore, when virtual tunnel encapsulation was used in the previous routing cycle, the virtual port number corresponding to the previous routing cycle was used as the first virtual port number corresponding to the current routing cycle. The first field was updated with the first virtual port number, and the first original port number was placed in the second field of the data packet. In this way, when the sending device sends a data packet, it will perform routing calculations based on the virtual port number corresponding to the previous routing cycle, so that the data packet reaches the receiving device along the first original path. The above method continuously uses virtual tunnel encapsulation, which can avoid various problems that may occur during the process of switching from never using virtual tunnel encapsulation to using virtual tunnel encapsulation, and ensure the consistency of packet processing.
[0098] When it is determined that the first original path from the sending device to the receiving device is congested, it proves that the first original path is unavailable. To resolve the congestion problem, such as... Figure 12 As shown, the sending device selects (e.g., randomly selects or uses other selection methods) the first virtual port number corresponding to the current routing period from the first candidate port number set, updates the first field with the first virtual port number, and places the first original port number in the second field of the data packet. The first virtual port number is used to perform routing calculations to obtain the first alternative path from the sending device to the receiving device. The above process is equivalent to encapsulating the data packet with a virtual tunnel according to the first virtual port number. The data packet encapsulated with the virtual tunnel will be transmitted in the virtual tunnel (i.e. the first alternative path) corresponding to the first virtual port number. Figure 13 The path switching process is illustrated. The first original path from the transmitting device to the receiving device is H0-L0-S0-C0-S4-L4-H4. After virtual tunnel encapsulation based on the first virtual port number, the first alternative path from the transmitting device to the receiving device is H0-L1-S1-C2-S5-L5-H4.
[0099] In one embodiment of this disclosure, the first candidate port number set includes one or more candidate port numbers other than the first original port number. For example, a range of port numbers for the transmitting device (including all available port numbers) can be determined, and all or some of the port numbers in the port number range other than the first original port number can be included in the first candidate port number set. In this way, invalid switching caused by the selected first virtual port number being the same as the first original port number can be avoided.
[0100] In one embodiment of this disclosure, step 530 can be performed at the transport layer, i.e., during the process of the sending device generating a data packet.
[0101] In one embodiment of this disclosure, the second field is a field that does not participate in routing calculations and does not affect connection identification. Taking the TCP protocol as an example, the second field can be the Option field in the TCP header.
[0102] In one embodiment of this disclosure, routing calculations can be performed solely based on port numbers, or they can be performed in conjunction with other elements. For example, routing calculations can be performed on 5-tuples (source IP address, destination IP address, transport layer protocol type, source port number, destination port number), 4-tuples (source IP address, destination IP address, source port number, destination port number), or 7-tuples (source IP address, destination IP address, transport layer protocol type, source port number, destination port number, service type, interface index). There is no limitation on this.
[0103] Next, taking routing calculation based on a 5-tuple and employing a routing hash algorithm as an example, the routing calculation process will be explained. This disclosure provides, for instance, the following... Figure 14 The diagram shown illustrates the routing operation, which will be explained step-by-step: 1) Based on the destination IP address in the data packet, the sending device determines multiple equivalent communication paths in the packet transmission network that can reach the destination IP address. Based on the physical ports (referring to the physical ports in the sending device) that these communication paths need to pass through, a candidate physical port list is constructed, such as [8, 9, 10, 11], where 8 represents the sequence number (identifier) of the physical port. 2) The sending device performs a hash calculation on the five-tuple in the data packet to obtain the hash value; 3) The sending device performs a modulo operation between the hash value and the length of the candidate physical port list to obtain the target index number of the candidate physical port list. Then, it determines the physical port corresponding to the target index number in the candidate physical port list as the physical port for sending data packets.
[0104] For example, if the hash value obtained by hashing the quintuple in the data packet is 13, and the length of the candidate physical port list [8, 9, 10, 11] is 4, then the target index number obtained by performing the modulo operation is 1. Thus, the second-ranked physical port 9 in the candidate physical port list [8, 9, 10, 11] is determined to be used to send the data packet. The index number of the candidate physical port list is calculated starting from 0.
[0105] In the example above, each physical port in the candidate physical port list is connected to a forwarding device. Therefore, when the sending device determines the physical port used to send the data packet, it is equivalent to determining which forwarding device the data packet will hop to for the first hop in the packet transmission network.
[0106] It's worth noting that routing algorithms also apply to both forwarding and receiving devices in packet transmission networks. Furthermore, port numbers and physical ports differ in meaning. Port numbers are a transport layer concept used to distinguish different processes within a device; while physical ports are interfaces within a device used to connect to physical media (such as network cables or fiber optic cables), enabling the device to connect to external physical links.
[0107] Figure 14 The diagram also illustrates a hash seed, which is a random number or string used to initialize a hash function (used to perform hash calculations). In embodiments of this disclosure, different hash seeds can be configured for different electronic devices in the message transmission network, and / or different hash functions can be configured for different electronic devices in the message transmission network, thereby introducing differentiation and minimizing hash polarization.
[0108] In step 540, the transmitting device sends a data packet.
[0109] After encapsulating the data packet with a virtual tunnel according to the first virtual port number, the sending device sends the data packet. In this way, the data packet will reach the receiving device along the first alternative path. Taking the first alternative path as H0-L1-S1-C2-S5-L5-H4 as an example, the data packet sent by server H0 will pass through access layer switch L1, aggregation layer switch S1, core layer switch C2, aggregation layer switch S5, and access layer switch L5 in sequence, and finally reach server H4.
[0110] In step 550, the receiving device extracts the first raw port number from the second field and updates the first field with the first raw port number for transport layer protocol processing.
[0111] After receiving the data packet, the receiving device, such as Figure 15As shown, the first original port number is extracted from the second field and updated with the first original port number. This achieves virtual tunnel decapsulation of the data packet, enabling transport layer protocol processing based on the data packet. Since the first field in the data packet contains the first original port number, the receiving device can identify that the data packet is generated based on the communication connection between the sending and receiving devices during transport layer protocol processing, without disrupting the identification of the communication connection. The transport layer protocol processing is determined by the communication model (such as the TCP / IP protocol stack model) used by the packet transmission network, and may include processes such as congestion control, unpacking the data packet, and passing it to the application layer.
[0112] It is worth noting that before step 550, the receiving device has already performed network interface layer protocol processing and network layer protocol processing on the data packet.
[0113] In steps 510 to 550 above, the field recording the port number in the data packet is set so that it can be replaced during routing and restored during reception, thus not affecting the transport layer protocol processing. Specifically, after determining that the first original path from the sending device to the receiving device is congested, a first virtual port number is selected from the first candidate port number set to try a new path, and the field recording the port number, i.e., the first field, is updated with the first virtual port number. The first virtual port number is used to select a new path, but the first original port number is needed in subsequent transport layer protocol processing. Therefore, in this embodiment, the first original port number is placed in the second field so that after the receiving device receives the data packet, it can restore the first original port number according to the second field, thereby achieving the effect of trying a new path to solve the congestion problem without affecting the transport layer protocol processing, thus improving the packet transmission efficiency.
[0114] The above is a general description of steps 510 to 550. Below, we will focus on a more detailed description of steps 520 and 530.
[0115] Detailed description of step 520 In step 520, the transmitting device determines that the first original path from the transmitting device to the receiving device is congested based on the congestion window value corresponding to the current routing period of the transmitting device.
[0116] For example, when the congestion window value corresponding to the current routing period of the transmitting device is less than the congestion window value threshold, it is determined that the first original path from the transmitting device to the receiving device is congested; when the congestion window value corresponding to the current routing period of the transmitting device is greater than or equal to the congestion window value threshold, it is determined that the first original path from the transmitting device to the receiving device is not congested.
[0117] In one embodiment of this disclosure, reference is made to Figure 16 , Figure 5 Step 520 shown includes: Step 1610: The transmitting device performs a fusion process on the congestion window value corresponding to the current routing period and the congestion window value corresponding to the historical routing periods to obtain a fused congestion window value. Step 1620: When the fusion congestion window value is less than the congestion window value threshold, the transmitting device determines that the first original path from the transmitting device to the receiving device is congested.
[0118] Steps 1610 to 1620 are described in detail below.
[0119] In step 1610, the transmitting device performs a fusion process on the congestion window value corresponding to the current routing period and the congestion window value corresponding to the historical routing periods to obtain a fused congestion window value.
[0120] Considering that the transmitting device continuously uses congestion control algorithms to determine the congestion window value, meaning the congestion window value is constantly changing, the congestion window value corresponding to the current routing period may contain fluctuation noise and may not accurately reflect the current congestion status of the first original path. Therefore, the transmitting device fuses the congestion window value corresponding to the current routing period and the congestion window values corresponding to historical routing periods to obtain a fused congestion window value. Here, the historical routing period refers to the N routing periods preceding the current routing period, and the value of N can be set according to the actual application scenario. The fusion processing method is not limited; for example, it can be averaging, taking the minimum value, etc. The prerequisite for fusion processing is that the congestion window value corresponding to the current routing period and the congestion window values corresponding to historical routing periods both correspond to the same communication path.
[0121] In one embodiment of this disclosure, the transmitting device performs a fusion process on the congestion window value corresponding to the current routing period and the congestion window value corresponding to the historical routing period to obtain a fused congestion window value. This includes: the transmitting device performs a moving average process on the congestion window value corresponding to the current routing period and the congestion window value corresponding to the historical routing period to obtain a fused congestion window value.
[0122] Here, the fusion process can be a moving average. The formula is as follows: Moving average value corresponding to the current routing cycle = (1-c) The moving average value of the previous routing period + c The congestion window value corresponding to the current routing period, where 1-c>c, and the moving average value corresponding to the current routing period is the fused congestion window value.
[0123] For example, the congestion window value for route selection period 1 is 20, for route selection period 2 it is 18, for route selection period 3 it is 20, and for route selection period 4 it is 10, with c=0.1. Therefore, the moving average value for route selection period 2 can be calculated as 0.9. 20+0.1 18 = 19.8 (rounded down to 20), the moving average value corresponding to a routing period of 3 is 0.9. 20+0.1 20=20, the moving average value corresponding to a routing period of 4 is 0.9. 20+0.1 10 = 19. This reduces the fluctuation noise caused by the congestion window value corresponding to route selection period 4. Since there is no previous route selection period for route selection period 1, the congestion window value corresponding to route selection period 1 is directly used as the moving average value corresponding to route selection period 1.
[0124] Since the congestion window values corresponding to historical routing cycles are usually numerous and highly reliable, referencing the congestion window values corresponding to historical routing cycles more in the above-mentioned moving average processing (i.e., setting 1-c>c) can effectively filter out the fluctuation noise that may be caused by the congestion window values corresponding to the current routing cycle, which helps to improve the accuracy of congestion detection.
[0125] In step 1620, when the fusion congestion window value is less than the congestion window value threshold, the transmitting device determines that the first original path from the transmitting device to the receiving device is congested.
[0126] When the fused congestion window value is less than the congestion window value threshold, the transmitting device determines that the first original path from the transmitting device to the receiving device is congested; when the fused congestion window value is greater than or equal to the congestion window value threshold, the transmitting device determines that the first original path from the transmitting device to the receiving device is not congested. The congestion window value threshold can be set according to the throughput requirements of the communication connection.
[0127] In steps 1610 to 1620 above, considering that the transmitting device continuously uses the congestion control algorithm to determine the congestion window value, that is, the congestion window value is constantly changing dynamically, the congestion window value corresponding to the current routing cycle of the transmitting device may have fluctuation noise, which may not accurately reflect the current congestion situation of the first original path. Therefore, the congestion window value corresponding to the historical routing cycle is combined to calculate the fused congestion window value, so that the fused congestion window value can more accurately reflect the current congestion situation of the first original path, thereby helping to improve the accuracy of congestion judgment and the necessity of route switching after judging congestion, and avoiding unnecessary resource overhead.
[0128] Detailed description of step 530 In step 530, the sending device selects the first virtual port number corresponding to the current routing period from the first candidate port number set, updates the first field with the first virtual port number, and places the first original port number in the second field of the data packet; the first virtual port number is used to perform routing calculations to obtain the first alternative path from the sending device to the receiving device.
[0129] Here, the sending device selects the first virtual port number corresponding to the current routing period from the first candidate port number set, and performs virtual tunnel encapsulation on the data packet according to the first virtual port number. In this way, the communication path from the sending device to the receiving device can be updated from the first original path to the first alternative path, that is, the routing is achieved through virtual tunnel encapsulation.
[0130] In one embodiment of this disclosure, reference is made to Figure 17 , Figure 5 Step 530 shown includes: Step 1710: The transmitting device selects the first virtual source port number corresponding to the current routing period from the first candidate source port number set, and updates the seventh field with the first virtual source port number; Step 1720: The transmitting device selects the first virtual destination port number corresponding to the current routing period from the first candidate destination port number set, and updates the eighth field with the first virtual destination port number; Step 1730: The sending device places the first original source port number and the first original destination port number in the second field of the data packet; Reference Figure 17 , Figure 5 Step 550 shown can be updated to step 1740: Step 1740: When the receiving device identifies that the first virtual destination port number in the eighth field belongs to the first candidate destination port number set, it extracts the first original source port number and the first original destination port number from the second field, updates the seventh field with the first original source port number, and updates the eighth field with the first original destination port number to perform transport layer protocol processing.
[0131] Steps 1710 to 1740 are described in detail below.
[0132] In step 1710, the transmitting device selects the first virtual source port number corresponding to the current routing period from the first candidate source port number set, and updates the seventh field with the first virtual source port number.
[0133] Here, the first original port number includes the first original source port number and the first original destination port number. For the data packet generated by the sending device, the first field in the data packet can be subdivided into the seventh field (i.e., the source port number field) and the eighth field (i.e., the destination port number field). The seventh field has the first original source port number, and the eighth field has the first original destination port number.
[0134] Based on this, the transmitting device can select the first virtual source port number corresponding to the current routing period from the first candidate source port number set, and update the seventh field with the first virtual source port number, such as... Figure 18 As shown. The first candidate source port number set includes multiple candidate source port numbers in addition to the first original source port number.
[0135] In step 1720, the transmitting device selects the first virtual destination port number corresponding to the current routing period from the first candidate destination port number set, and updates the eighth field with the first virtual destination port number.
[0136] The first candidate destination port number set includes one or more candidate destination port numbers other than the first original destination port number. Unlike the first candidate source port number set, these candidate destination port numbers are used to trigger the receiving device to update the seventh and eighth fields, i.e., to trigger the receiving device to perform virtual tunnel decapsulation. The first candidate destination port number set can be preset. Based on this, the transmitting device selects the first virtual destination port number corresponding to the current routing period from the first candidate destination port number set and updates the eighth field with the first virtual destination port number, such as... Figure 18 As shown, the data packet has been encapsulated in a virtual tunnel based on the first virtual destination port number in the eighth field.
[0137] In step 1730, the sending device places the first original source port number and the first original destination port number in the second field of the data packet.
[0138] The sending device places the first original source port number and the first original destination port number in the second field of the data packet for subsequent recovery. In one embodiment of this disclosure, the second field includes a ninth field and a tenth field; the sending device places the first original source port number in the ninth field and the first original destination port number in the tenth field, thereby making it easier to distinguish.
[0139] The virtual tunnel encapsulation of the data packet is completed through steps 1710 to 1730. During the transmission of the data packet, the first virtual source port number and the first virtual destination port number are used for routing calculation to obtain the first alternative path from the sending device to the receiving device.
[0140] In step 1740, when the receiving device identifies that the first virtual destination port number in the eighth field belongs to the first candidate destination port number set, it extracts the first original source port number and the first original destination port number from the second field, updates the seventh field with the first original source port number, and updates the eighth field with the first original destination port number to perform transport layer protocol processing.
[0141] After receiving a data packet, the receiving device recognizes that the data packet has been encapsulated in a virtual tunnel because the first virtual destination port number in the eighth field belongs to the first candidate destination port number set. Therefore, the receiving device performs the following processing: extracts the first original source port number and the first original destination port number from the second field (e.g., extracts the first original source port number from the ninth field and the first original destination port number from the tenth field), updates the seventh field with the first original source port number, and updates the eighth field with the first original destination port number for transport layer protocol processing, such as... Figure 19 As shown. In another scenario, the receiving device discovers that the port number in the eighth field of the data packet does not belong to the first candidate destination port number set. Therefore, the receiving device recognizes that the data packet has not been encapsulated in a virtual tunnel and directly processes the data packet using the transport layer protocol.
[0142] It is worth noting that the reason why the eighth field is used to identify whether a data packet has undergone virtual tunnel encapsulation in this embodiment is that the eighth field is the destination port number field. In the current communication model, the receiving device usually extracts the destination port number from the destination port number field of the data packet and hands the data packet over to the process corresponding to the destination port number for processing. Therefore, by assigning different meanings to different destination port numbers, the receiving device can perform different operations, namely, perform virtual tunnel decapsulation or not perform virtual tunnel decapsulation. In addition, when the sending device and the receiving device establish a communication connection, the agreed first original destination port number should avoid the first candidate destination port number set, thereby preventing the receiving device from mistakenly believing that a data packet that has not undergone virtual tunnel encapsulation has undergone virtual tunnel encapsulation.
[0143] Of course, in other embodiments, the seventh field can also be used to identify whether the data packet has been encapsulated through a virtual tunnel.
[0144] The above method triggers the receiving device to perform virtual tunnel decapsulation by selecting candidate destination port numbers from the first set of candidate destination port numbers. This ensures the accuracy and necessity of virtual tunnel decapsulation and is suitable for scenarios where some data packets in a packet transmission network use virtual tunnel encapsulation, while others do not. Two application scenarios are illustrated below.
[0145] (a) Gray-scale deployment scenario.
[0146] For example, if this embodiment of the present disclosure is deployed in a message transmission network using a gray-scale deployment method, the message transmission network will simultaneously contain data packets encapsulated using virtual tunnels and data packets not encapsulated using virtual tunnels. The port number in the eighth field of the data packet encapsulated using virtual tunnels belongs to the first candidate destination port number set, while the port number in the eighth field of the data packet not encapsulated using virtual tunnels does not belong to the first candidate destination port number set. Based on this, after receiving a data packet, the receiving device in the message transmission network can determine whether the data packet has undergone virtual tunnel encapsulation based on the eighth field of the data packet, and then determine whether to perform virtual tunnel decapsulation on the data packet. Through the above-described gray-scale deployment scenario, various uncontrollable problems caused by a large number of data packets encapsulated using virtual tunnels in the message transmission network can be avoided, effectively reducing risks and facilitating the rapid advancement of the deployment process.
[0147] (ii) Differentiate configuration scenarios.
[0148] For example, in a message transmission network, multiple communication connections are established. Some of these connections (taking communication connection 1 as an example) do not allow routing. Therefore, the sending device involved in communication connection 1 does not perform virtual tunnel encapsulation on the data packets. The receiving device involved in communication connection 1, upon receiving the data packets, recognizes that the data packets are not encapsulated using virtual tunnels and thus directly processes the data packets using the transport layer protocol. However, some communication connections (taking communication connection 2 as an example) do not strictly require message transmission along a fixed communication path, i.e., routing is allowed. Therefore, the sending device involved in communication connection 2 performs virtual tunnel encapsulation on the data packets before sending them. The receiving device involved in communication connection 2, upon receiving the data packets, recognizes that the data packets have been encapsulated using virtual tunnels and thus decapsulates the data packets using virtual tunnels before processing them using the transport layer protocol. As described above, this embodiment of the present disclosure can achieve differentiated configuration, thereby meeting the communication needs of different communication connections.
[0149] In steps 1710 to 1740 above, the seventh and eighth fields in the data packet are used for path control. The eighth field is also used to identify whether the data packet has been encapsulated through a virtual tunnel. In this way, after receiving the data packet, the receiving device can determine whether the data packet has been encapsulated through a virtual tunnel based on the eighth field in the data packet, and then determine whether to perform virtual tunnel decapsulation on the data packet. This can ensure the necessity and accuracy of virtual tunnel decapsulation, and is suitable for scenarios in the packet transmission network where some data packets are encapsulated through virtual tunnels, while other data packets are not.
[0150] In one embodiment of this disclosure, reference is made to Figure 20 , Figure 5Step 530 shown can be updated to step 2010: Step 2010: The sending device selects the first virtual source port number corresponding to the current routing period from the first candidate source port number set, updates the seventh field with the first virtual source port number, and places the first original source port number in the second field of the data packet; Reference Figure 20 , Figure 5 Step 550 shown can be updated to step 2020: Step 2020: The receiving device extracts the first original source port number from the second field and updates the seventh field with the first original source port number for transport layer protocol processing.
[0151] Steps 2010 to 2020 are described in detail below.
[0152] In step 2010, the sending device selects the first virtual source port number corresponding to the current routing period from the first candidate source port number set, updates the seventh field with the first virtual source port number, and places the first original source port number in the second field of the data packet.
[0153] Here, all data packets in the default message transmission network need to undergo virtual tunnel encapsulation. In this case, the sending device selects the first virtual source port number corresponding to the current routing period from the first candidate source port number set, updates the seventh field with the first virtual source port number, and places the first original source port number in the second field of the data packet, thereby completing the virtual tunnel encapsulation of the data packet. Figure 21 As shown.
[0154] It is worth noting that the eighth field (destination port number field) in the data packet can retain its original first destination port number during the virtual tunnel encapsulation process. During data packet transmission, the first virtual source port number and the first original destination port number are used for routing calculations to obtain the first alternative path from the sending device to the receiving device.
[0155] In step 2020, the receiving device extracts the first original source port number from the second field and updates the seventh field with the first original source port number for transport layer protocol processing.
[0156] After receiving a data packet, the receiving device performs virtual tunnel decapsulation by default. This involves extracting the first original source port number from the second field and updating the seventh field with that number for transport layer protocol processing. Figure 22 As shown.
[0157] In steps 2010 to 2020 above, the seventh field in the data packet is used for path control. After receiving the data packet, the receiving device performs virtual tunnel decapsulation based on the seventh field in the data packet. This is applicable to scenarios where all data packets in the packet transmission network use virtual tunnel encapsulation.
[0158] In one embodiment of this disclosure, reference is made to Figure 23 , Figure 5 Step 530 shown can be updated to step 2310: Step 2310: The sending device selects the first virtual destination port number corresponding to the current routing period from the first candidate destination port number set, updates the eighth field with the first virtual destination port number, and places the first original destination port number in the second field of the data packet; Reference Figure 23 , Figure 5 Step 550 shown can be updated to step 2320: Step 2320: The receiving device extracts the first original destination port number from the second field and updates the eighth field with the first original destination port number for transport layer protocol processing.
[0159] Steps 2310 to 2320 are described in detail below.
[0160] In step 2310, the sending device selects the first virtual destination port number corresponding to the current routing period from the first candidate destination port number set, updates the eighth field with the first virtual destination port number, and places the first original destination port number in the second field of the data packet.
[0161] Here, all data packets in the default message transmission network need to undergo virtual tunnel encapsulation. In this case, the sending device selects the first virtual destination port number corresponding to the current routing period from the first candidate destination port number set, updates the eighth field with the first virtual destination port number, and places the first original destination port number in the second field of the data packet, thereby completing the virtual tunnel encapsulation of the data packet. Figure 24 As shown.
[0162] It is worth noting that the seventh field (source port number field) in the data packet can retain its original first source port number during the virtual tunnel encapsulation process. During data packet transmission, the first virtual destination port number and the first original source port number are used for routing calculations to obtain the first alternative path from the sending device to the receiving device.
[0163] It is worth noting that, unlike the first candidate destination port number set in step 1720, the candidate destination port numbers in the first candidate destination port number set involved in step 2310 are not used to trigger the receiving device to perform virtual tunnel decapsulation. The receiving device will perform virtual tunnel decapsulation by default.
[0164] In step 2320, the receiving device extracts the first original destination port number from the second field and updates the eighth field with the first original destination port number for transport layer protocol processing.
[0165] After receiving a data packet, the receiving device performs virtual tunnel decapsulation by default. This involves extracting the first original destination port number from the second field and updating the eighth field with that number for transport layer protocol processing. Figure 25 As shown.
[0166] In steps 2310 to 2320 above, the eighth field in the data packet is used for path control. After receiving the data packet, the receiving device performs virtual tunnel decapsulation based on the eighth field in the data packet. This is applicable to scenarios where all data packets in the packet transmission network use virtual tunnel encapsulation.
[0167] In one embodiment of this disclosure, reference is made to Figure 26 , Figure 5 Step 530 shown includes: Step 2610: The transmitting device selects the first virtual source port number corresponding to the current routing period from the first candidate source port number set, and updates the seventh field with the first virtual source port number; Step 2620: The transmitting device selects the first virtual destination port number corresponding to the current routing period from the first candidate destination port number set, and updates the eighth field with the first virtual destination port number; Step 2630: The sending device places the first original source port number and the first original destination port number in the second field of the data packet; Reference Figure 26 , Figure 5 Step 550 shown can be updated to step 2640: Step 2640: The receiving device extracts the first original source port number and the first original destination port number from the second field, updates the seventh field with the first original source port number, and updates the eighth field with the first original destination port number for transport layer protocol processing.
[0168] Steps 2610 to 2640 are described in detail below.
[0169] In step 2610, the transmitting device selects the first virtual source port number corresponding to the current routing period from the first candidate source port number set, and updates the seventh field with the first virtual source port number.
[0170] Here, all data packets in the default message transmission network need to be encapsulated in a virtual tunnel. In this case, the sending device selects the first virtual source port number corresponding to the current routing period from the first candidate source port number set and updates the seventh field with the first virtual source port number.
[0171] In step 2620, the transmitting device selects the first virtual destination port number corresponding to the current routing period from the first candidate destination port number set, and updates the eighth field with the first virtual destination port number.
[0172] Unlike the first candidate destination port number set in step 1720, the candidate destination port numbers in the first candidate destination port number set involved in step 2620 are not used to trigger the receiving device to perform virtual tunnel decapsulation. The receiving device will perform virtual tunnel decapsulation by default.
[0173] In step 2630, the sending device places the first original source port number and the first original destination port number in the second field of the data packet.
[0174] The sending device places the first original source port number and the first original destination port number in the second field of the data packet to complete the virtual tunnel encapsulation of the data packet. During the transmission of the data packet, the first virtual source port number and the first virtual destination port number are used to perform routing calculations to obtain the first alternative path from the sending device to the receiving device.
[0175] In step 2640, the receiving device extracts the first original source port number and the first original destination port number from the second field, updates the seventh field with the first original source port number, and updates the eighth field with the first original destination port number for transport layer protocol processing.
[0176] After receiving a data packet, the receiving device performs virtual tunnel decapsulation on the data packet by default. That is, it extracts the first original source port number and the first original destination port number from the second field, updates the seventh field with the first original source port number, and updates the eighth field with the first original destination port number for transport layer protocol processing.
[0177] In steps 2610 to 2640 above, the seventh and eighth fields in the data packet are used for path control. After receiving the data packet, the receiving device performs virtual tunnel decapsulation based on the seventh and eighth fields in the data packet. This is applicable to scenarios where all data packets in the packet transmission network use virtual tunnel encapsulation.
[0178] In one embodiment of this disclosure, reference is made to Figure 27 , Figure 5 Step 530 shown includes: Step 2710: The transmitting device performs routing calculations based on multiple candidate port numbers in the first candidate port number set to obtain the correspondence between the multiple candidate port numbers and multiple physical ports of the transmitting device. Step 2720: The transmitting device determines the port load level of multiple physical ports; Step 2730: The transmitting device determines the physical port with the lowest port load as the target physical port, and determines the candidate port number corresponding to the target physical port as the filtered port number; Step 2740: The transmitting device selects the first virtual port number corresponding to the current routing cycle from the filtered port numbers; Step 2750: The sending device updates the first field with the first virtual port number and places the first original port number in the second field of the data packet.
[0179] Steps 2710 to 2750 are described in detail below.
[0180] In step 2710, the transmitting device performs routing calculations on multiple candidate port numbers in the first candidate port number set to determine the correspondence between the multiple candidate port numbers and multiple physical ports of the transmitting device.
[0181] When the first candidate port number set includes multiple candidate port numbers, the transmitting device may randomly select one candidate port number as the first virtual port number. However, the first alternative path obtained in this way may not be more idle than the first original path. Therefore, embodiments of this disclosure provide other selection strategies for the first candidate port number set.
[0182] First, the transmitting device performs routing calculations based on multiple candidate port numbers in the first candidate port number set to determine the correspondence between the multiple candidate port numbers and the multiple physical ports of the transmitting device. Here, performing routing calculations based on candidate port numbers can refer to relying solely on candidate port numbers for routing calculations, or it can refer to combining routing calculations with other elements, such as performing routing calculations on a quintuple containing candidate port numbers.
[0183] Combination Figure 2For example, server H0 and server H4 have established a communication connection. Server H0 acts as the sending device, and server H4 acts as the receiving device. Physical port 1 of server H0 is connected to access layer switch L0, and physical port 2 of server H0 is connected to access layer switch L1. The first candidate port number set includes two candidate port numbers, namely port number 1 and port number 5. In this case, after performing routing calculation based on port number 1, it is found that if port number 1 is used as the first virtual port number, the data packet will be sent from physical port 1 of the sending device. Therefore, it is determined that port number 1 corresponds to physical port 1 of the sending device. After performing routing calculation based on port number 5, it is found that if port number 5 is used as the first virtual port number, the data packet will be sent from physical port 2 of the sending device. Therefore, it is determined that port number 5 corresponds to physical port 2 of the sending device.
[0184] In step 2720, the transmitting device determines the port load level of multiple physical ports.
[0185] Here, the transmitting device determines the port load of multiple physical ports. The port load can refer to the bandwidth utilization of a physical port. For example, for a physical port with a maximum throughput of 1Gbps, if its throughput at a certain moment is 800Mbps, the port load at that moment is calculated to be 80%. The transmitting device can detect the port load of multiple physical ports using tools built into the operating system, such as the command-line tool netstat; it can also use other tools, such as Simple Network Management Protocol (SNMP).
[0186] In step 2730, the transmitting device determines the physical port with the lowest port load as the target physical port, and determines the candidate port number corresponding to the target physical port as the filtered port number.
[0187] The lower the port load of a physical port, the more idle the physical port is. Therefore, after determining the port load of multiple physical ports, the transmitting device determines the physical port with the lowest port load as the target physical port, and determines the candidate port number corresponding to the target physical port as the filtered port number.
[0188] For ease of explanation, examples are provided as shown in Table 1: Table 1. Correspondence between Physical Port, Candidate Port Number, and Port Load Level
[0189] Based on the example shown in Table 1, among the physical ports 1 to 4 of the transmitting device, physical port 3 has the lowest port load. Therefore, physical port 3 is determined as the target physical port, and the port numbers 9 to 12 corresponding to physical port 3 are all determined as the filtered port numbers.
[0190] In step 2740, the transmitting device selects the first virtual port number corresponding to the current routing cycle from the filtered port numbers.
[0191] If there is only one filtered port number, the transmitting device will directly determine the filtered port number as the first virtual port number corresponding to the current routing period; if there are multiple filtered port numbers, the transmitting device will select (e.g., randomly select) the first virtual port number corresponding to the current routing period from the filtered port numbers.
[0192] Based on the example shown in Table 1, the filtered port numbers include port numbers 9 to 12, from which one can be randomly selected, for example, port number 9 can be selected as the first virtual port number.
[0193] In step 2750, the sending device updates the first field with the first virtual port number and places the first original port number in the second field of the data packet.
[0194] After selecting the first virtual port number, the sending device updates the first field with the first virtual port number and places the first original port number in the second field of the data packet, thereby achieving virtual tunnel encapsulation. After virtual tunnel encapsulation, the data packet will be sent through the target physical port of the sending device. That is, the first hop in the first replacement path will start from the target physical port of the sending device. Since the target physical port is the least busy physical port among the multiple physical ports of the sending device, it can increase the probability that the first replacement path is less busy than the first original path, thus minimizing invalid routing.
[0195] In steps 2710 to 2750 above, the port load of the physical port of the sending device is used as the basis for selecting the first virtual port number. Specifically, the physical port with the lowest port load is determined as the target physical port, the candidate port number corresponding to the target physical port is determined as the filtered port number, and the first virtual port number corresponding to the current routing cycle is selected from the filtered port number. In this way, it is ensured that the data packet will be sent through the target physical port of the sending device after being encapsulated by the virtual tunnel. Since the target physical port is the least idle physical port among the multiple physical ports of the sending device, it can increase the probability that the first replacement path is less idle than the first original path, and try to avoid the situation that the routing needs to be changed again after the routing is changed, which can effectively save computing resources.
[0196] In one embodiment of this disclosure, reference is made to Figure 28 , Figure 5 Step 530 shown includes: Step 2810: The transmitting device performs routing calculations based on multiple candidate port numbers in the first candidate port number set to obtain multiple candidate replacement paths from the transmitting device to the receiving device; Step 2820: The transmitting device determines the path overlap between the first original path and multiple candidate replacement paths; Step 2830: The transmitting device determines the candidate port number corresponding to the candidate replacement path with the minimum path overlap as the first virtual port number corresponding to the current routing cycle. Step 2840: The sending device updates the first field with the first virtual port number and places the first original port number in the second field of the data packet.
[0197] Steps 2810 to 2840 are described in detail below.
[0198] In step 2810, the transmitting device performs routing calculations based on multiple candidate port numbers in the first candidate port number set to obtain multiple candidate replacement paths from the transmitting device to the receiving device.
[0199] Here, the sending device performs routing calculations based on multiple candidate port numbers in the first candidate port number set to obtain multiple candidate replacement paths from the sending device to the receiving device, where each candidate replacement path corresponds to a candidate port number. It is worth noting that step 2810 requires the sending device to know the distribution of multiple forwarding devices in the message transmission network (e.g., which forwarding devices the sending device is connected to, and which forwarding devices are included in different layers of the message transmission network) and the physical port information. Only then can the sending device obtain the complete communication path from the sending device to the receiving device through routing calculations.
[0200] In step 2820, the transmitting device determines the path overlap between the first original path and the plurality of candidate replacement paths.
[0201] For example, routing operations are usually implemented based on the equal-cost multipath algorithm. For the first original path and a candidate replacement path, the total number of hops of the two communication paths is usually the same. Therefore, the number of overlapping paths in the two communication paths can be divided by the total number of hops to obtain the path overlap between the two communication paths. Here, overlapping path refers to the communication path between any two devices that communicate directly (i.e., without forwarding through other devices), rather than the complete communication path from the sending device to the receiving device.
[0202] For ease of explanation, combined with Figure 2 Examples are provided as shown in Table 2: Table 2 Path Overlap Table
[0203] Taking port number 1 in Table 2 as an example, the candidate replacement path obtained through routing calculation is H0-L0-S0-C1-S4-L4-H4. The overlapping paths between it and the first original path H0-L0-S0-C0-S4-L4-H4 include 4 hops: H0-L0, L0-S0, S4-L4, and L4-H4. The total number of hops is 6, so the path overlap is 4 / 6 = 67%. The calculation process for the overlap of the other paths shown can be deduced by analogy.
[0204] In step 2830, the transmitting device determines the candidate port number corresponding to the candidate replacement path with the minimum path overlap as the first virtual port number corresponding to the current routing cycle.
[0205] Taking Table 2 as an example, among the four candidate replacement paths, the candidate replacement path with the minimum path overlap is determined to be H0-L1-S1-C2-S5-L5-H4, and the port number 4 corresponding to this candidate replacement path is determined as the first virtual port number corresponding to the current routing cycle.
[0206] If there are multiple candidate port numbers corresponding to the candidate replacement path with the minimum path overlap, then one of them can be randomly selected as the first virtual port number corresponding to the current routing cycle.
[0207] In step 2840, the sending device updates the first field with the first virtual port number and places the first original port number in the second field of the data packet.
[0208] After the data packet is encapsulated in a virtual tunnel according to the first virtual port number selected in step 2830, the data packet will arrive at the receiving device along the first alternative path. Here, the first alternative path refers to the candidate alternative path with the minimum path overlap with the first original path. In this way, the root causes of congestion of the first original path can be avoided as much as possible, and the probability that the first alternative path is more idle than the first original path can be increased.
[0209] In steps 2810 to 2840 above, considering that the first original path is already congested, the sending device selects the first virtual port number with the principle of avoiding the first original path as much as possible. Specifically, the sending device performs routing calculations based on multiple candidate port numbers in the first candidate port number set to obtain multiple candidate replacement paths from the sending device to the receiving device. Then, the candidate port number corresponding to the candidate replacement path that is most different from the first original path is determined as the first virtual port number, and the data packet is encapsulated with a virtual tunnel based on the first virtual port number. This minimizes the overlap between the first replacement path and the first original path, increases the probability that the first replacement path is less congested than the first original path, and avoids the situation where a route change is required again after a route change, which can effectively save computing resources.
[0210] In one embodiment of this disclosure, reference is made to Figure 29 , Figure 5 Step 530 shown includes: Step 2910: The transmitting device determines the overlapping paths of multiple congested paths from the transmitting device to the receiving device; Step 2920: The transmitting device performs routing calculations based on multiple candidate port numbers in the first candidate port number set to obtain multiple candidate replacement paths from the transmitting device to the receiving device; Step 2930: The transmitting device will exclude the candidate port number corresponding to the candidate replacement path of the overlapping path and determine it as the first virtual port number corresponding to the current routing cycle. Step 2940: The sending device updates the first field with the first virtual port number and places the first original port number in the second field of the data packet.
[0211] Steps 2910 to 2940 are described in detail below.
[0212] In step 2910, the transmitting device determines the overlapping paths of multiple congested paths from the transmitting device to the receiving device.
[0213] A congested path refers to a communication path where a sending device has previously used to transmit data packets to a receiving device and where congestion has occurred; for example, the initial path can be considered a congested path. When there are multiple congested paths, the sending device identifies overlapping paths among them. These overlapping paths are highly likely to be the root cause of the congestion. Taking N congested paths as an example, the overlapping path needs to appear at least M times among the N congested paths, where M is an integer greater than 1 and not exceeding N, and the value can be set according to the actual situation. In the case of M=N, combined with... Figure 2 For example, if the congested paths include the following four paths: H0-L0-S0-C0-S4-L4-H4, H0-L0-S0-C1-S4-L4-H4, H0-L0-S1-C2-S5-L4-H4, and H0-L0-S1-C2-S5-L5-H4, then the overlapping path can be identified as H0-L0. It is highly likely that the congestion on these paths is caused by the overload of the physical port connecting server H0 to access layer switch L0.
[0214] In step 2920, the transmitting device performs routing calculations based on multiple candidate port numbers in the first candidate port number set to obtain multiple candidate replacement paths from the transmitting device to the receiving device.
[0215] Step 2920 can be referred to the relevant description of step 2810.
[0216] In step 2930, the transmitting device will exclude the candidate port number corresponding to the candidate replacement path of the overlapping path and determine it as the first virtual port number corresponding to the current routing cycle.
[0217] For ease of explanation, examples are provided as shown in Table 3: Table 3 Candidate Replacement Paths
[0218] As shown in Table 3, the candidate replacement paths corresponding to port numbers 1 to 3 all include the overlapping path H0-L0, meaning that the overlapping path H0-L0 has not been excluded. However, the candidate replacement path corresponding to port number 4 is H0-L1-S1-C2-S5-L5-H4, which excludes the overlapping path H0-L0. Therefore, port number 4 is determined as the first virtual port number corresponding to the current routing cycle. It is worth noting that excluding overlapping paths means not including overlapping paths.
[0219] If there are multiple candidate port numbers corresponding to the candidate replacement path that excludes overlapping paths, then one of them can be randomly selected as the first virtual port number corresponding to the current routing cycle.
[0220] In step 2940, the sending device updates the first field with the first virtual port number and places the first original port number in the second field of the data packet.
[0221] After the data packet is encapsulated in a virtual tunnel according to the first virtual port number selected in step 2930, the data packet will arrive at the receiving device along the first alternative path. The first alternative path here has excluded overlapping paths, so it can avoid the root causes that may cause congestion and increase the probability that the first alternative path is less busy than the first original path.
[0222] In steps 2910 to 2940 above, when multiple congested paths exist historically, overlapping paths among these paths are identified. These overlapping paths are highly likely to be the root cause of congestion. Therefore, the sending device performs routing calculations based on multiple candidate port numbers in the first candidate port number set to obtain multiple candidate alternative paths from the sending device to the receiving device. The candidate port number corresponding to the candidate alternative path that excludes overlapping paths is determined as the first virtual port number corresponding to the current routing period. The data packet is then encapsulated with a virtual tunnel based on the first virtual port number. This ensures that the first alternative path excludes overlapping paths, avoids potential congestion sources, increases the probability that the first alternative path is less congested than the first original path, and minimizes the need for rerouting after a previous route change, effectively saving computational resources.
[0223] In one embodiment of this disclosure, reference is made to Figure 30 , Figure 5 Step 530 shown can be updated to step 3010: In step 3010, when the path switching condition is met, the sending device selects the first virtual port number corresponding to the current routing period from the first candidate port number set, updates the first field with the first virtual port number, and places the first original port number in the second field of the data packet; wherein, the path switching condition includes at least one of the following: the sending window value corresponding to the current routing period of the sending device is zero and the duration reaches a first duration threshold; the interval between the last selection of the first candidate port number set reaches a second duration threshold.
[0224] Here, corresponding path switching conditions can be set for the virtual tunnel encapsulation operation. When the path switching conditions are met, the sending device performs virtual tunnel encapsulation on the data packet, that is, selects the first virtual port number corresponding to the current routing period from the first candidate port number set, updates the first field with the first virtual port number, and places the first original port number in the second field of the data packet, thereby switching the first original path to the first alternative path; when the path switching conditions are not met, the sending device does not perform virtual tunnel encapsulation on the data packet, but directly sends the data packet.
[0225] Path switching conditions include at least one of the following: 1) The sending window value corresponding to the current routing cycle of the transmitting device is zero, and the duration reaches the first duration threshold. Path switching may cause out-of-order packets to appear on the receiving device. To reduce the occurrence of out-of-order packets, path switching can be performed after the communication connection between the transmitting and receiving devices has been idle for a period of time. That is, the sending window value corresponding to the current routing cycle of the transmitting device is zero, and the duration reaches the first duration threshold. Here, the sending window value refers to the amount of data that the transmitting device is allowed to send without receiving an acknowledgment message from the receiving device. A sending window value of zero means that the transmitting device is temporarily not sending data, that is, the communication connection is in an idle state. The first duration threshold can be set according to the actual situation, for example, 1ms.
[0226] 2) The interval since the last selection of the first candidate port number set reaches the second time threshold. After path switching, the congestion control algorithm needs time to converge (i.e., the congestion window value adjusts from the beginning to a stable state). Therefore, path switching can only be performed when the interval since the last path switching (i.e., the interval since the last selection of the first candidate port number set) reaches the second time threshold. The second time threshold can be set as the convergence time of the congestion control algorithm, for example, 10ms. It is understandable that if the interval since the last path switching does not reach the second time threshold, the congestion control algorithm may not have converged, and the congestion window value corresponding to the current routing cycle of the transmitting device may not be accurate. This could cause the original, uncongested path to be mistakenly considered congested, leading to unnecessary waste of computational resources and making it difficult to guarantee that the first replacement path is less congested than the original path. By establishing the above path switching conditions, the necessity of path switching can be increased, thus truly resolving the congestion problem caused by the original path.
[0227] In step 3010 above, two path switching conditions are set. The first condition is that the data packet is encapsulated in a virtual tunnel only when the sending window value corresponding to the current routing cycle of the sending device is zero and the duration reaches the first duration threshold. This can reduce the occurrence of out-of-order packets on the receiving device side and improve the orderliness and accuracy of packet transmission. The second condition is that the data packet is encapsulated in a virtual tunnel only when the interval between the last selection of the first candidate port number set reaches the second duration threshold. This can ensure that the congestion of the first original path is real, increase the necessity of path switching, and avoid unnecessary waste of resources.
[0228] In one embodiment of this disclosure, reference is made to Figure 31 , Figure 5 Step 530 shown can be updated to step 3110: Step 3110: The sending device selects the first virtual port number corresponding to the current routing period from the first candidate port number set, updates the first field with the first virtual port number, and updates the second field of the data packet with the first original port number; Reference Figure 31 , Figure 5 Step 550 shown can be updated to step 3120: Step 3120: The receiving device extracts the first original port number from the second field, updates the first field with the first original port number, and updates the second field with the original value of the second field for transport layer protocol processing.
[0229] Steps 3110 to 3120 are described in detail below.
[0230] In step 3110, the sending device selects the first virtual port number corresponding to the current routing period from the first candidate port number set, updates the first field with the first virtual port number, and updates the second field of the data packet with the first original port number.
[0231] The second field can be a field defined by the traditional message format, that is, a field that the data packet has when it is generated. For ease of distinction, the value of the second field when the data packet is generated is called the original value. In this case, the sending device updates the second field of the data packet with the first original port number, such as... Figure 32 As shown.
[0232] In step 3120, the receiving device extracts the first original port number from the second field, updates the first field with the first original port number, and updates the second field with the original value of the second field for transport layer protocol processing.
[0233] During the virtual tunnel decapsulation process of data packets, the receiving device, in addition to updating the first field with the first original port number, also updates the second field with the original value of the second field to initialize the second field, such as... Figure 33 As shown. Of course, the implementation of step 3120 is based on the premise that the receiving device knows the original value of the second field, for example, the original value of the second field is a conventional default value; if the receiving device does not know the original value of the second field, the second field can be cleared.
[0234] In steps 3110 to 3120 above, when the second field is a field specified by the traditional message format, the sending device updates the second field with the first original port number, and the receiving device updates the second field with the original value of the second field, thereby realizing the restoration of the second field. This ensures that the data packet obtained by the receiving device after decapsulation through the virtual tunnel is consistent with the data packet generated by the sending device, achieving the effect of not affecting the transport layer protocol processing.
[0235] In one embodiment of this disclosure, reference is made to Figure 34 , Figure 5 Step 530 shown can be updated to step 3410: Step 3410: The sending device selects the first virtual port number corresponding to the current routing period from the first candidate port number set, updates the first field with the first virtual port number, creates a second field based on the first original port number, and adds the second field to the data packet; Reference Figure 34 , Figure 5 Step 550 shown can be updated to step 3420: Step 3420: The receiving device extracts the first original port number from the second field, updates the first field with the first original port number, and deletes the second field in the data packet for transport layer protocol processing.
[0236] Steps 3410 to 3420 are described in detail below.
[0237] In step 3410, the sending device selects the first virtual port number corresponding to the current routing period from the first candidate port number set, updates the first field with the first virtual port number, creates a second field based on the first original port number, and adds the second field to the data packet.
[0238] Here, the second field is not a field specified in the traditional message format; that is, the data packet does not have a second field when it is generated. During the virtual tunnel encapsulation process of the data packet, the sending device creates the second field based on the first original port number and adds it to the data packet, such as... Figure 35 As shown.
[0239] In step 3420, the receiving device extracts the first original port number from the second field, updates the first field with the first original port number, and deletes the second field in the data packet for transport layer protocol processing.
[0240] During the virtual tunnel decapsulation process of the data packet, the receiving device, in addition to updating the first field with the first original port number, also deletes the second field from the data packet, such as... Figure 36 As shown.
[0241] In steps 3410 to 3420 above, during the virtual tunnel encapsulation process, the sending device creates a second field based on the first original port number and adds the second field to the data packet; during the virtual tunnel decapsulation process, the receiving device deletes the second field from the data packet, thereby ensuring that the data packet obtained by the receiving device after decapsulation through the virtual tunnel is consistent with the data packet generated by the sending device, achieving the effect of not affecting the transport layer protocol processing.
[0242] Virtual tunnel encapsulation-decapsulation scheme for acknowledgment messages In one embodiment of this disclosure, reference is made to Figure 37 , Figure 5 Following step 550 shown, the following is also included: Step 3710: The receiving device generates an acknowledgment message for the data packet; wherein, the third field in the acknowledgment message contains the second original port number; Step 3720: The receiving device determines that the second original path from the receiving device to the transmitting device is congested based on the congestion window value corresponding to the current routing cycle of the receiving device; Step 3730: The receiving device selects the second virtual port number corresponding to the current routing period from the second candidate port number set, updates the third field with the second virtual port number, and places the second original port number in the fourth field of the acknowledgment message. The second virtual port number is used to perform routing calculations to obtain the second alternative path from the receiving device to the sending device. Step 3740: The receiving device sends an acknowledgment message; Step 3750: The sending device extracts the second original port number from the fourth field and updates the third field with the second original port number for transport layer protocol processing.
[0243] Steps 3710 to 3750 are described in detail below.
[0244] In step 3710, the receiving device generates an acknowledgment message for the data packet; wherein the third field in the acknowledgment message has a second original port number.
[0245] After the receiving device performs virtual tunnel decapsulation on the data packet, it can generate an acknowledgment message (ACK message) for the data packet. The third field (i.e., the port number field) in the acknowledgment message has a second original port number.
[0246] In step 3720, the receiving device determines that the second original path from the receiving device to the transmitting device is congested based on the congestion window value corresponding to the current routing period of the receiving device.
[0247] For the receiving device receiving data packets, the congestion control algorithm also determines the congestion window value corresponding to the current routing cycle of the receiving device. Based on the congestion window value corresponding to the current routing cycle of the receiving device, it can be determined whether the second original path from the receiving device to the sending device is congested. It is worth noting that the sending device and the receiving device are relative concepts. The receiving device can also be regarded as a sending device when sending data, so the congestion control algorithm can be applied.
[0248] The second original path refers to the communication path used by the receiving device in the previous routing cycle of the current routing cycle. If the previous routing cycle did not use virtual tunnel encapsulation, the second original path is obtained by routing calculation based on the second original port number; if the previous routing cycle used virtual tunnel encapsulation, the second original path is obtained by routing calculation based on the virtual port number corresponding to the previous routing cycle. For ease of explanation, the following explanation assumes that the receiving device uses virtual tunnel encapsulation by default.
[0249] In step 3730, the receiving device selects the second virtual port number corresponding to the current routing period from the second candidate port number set, updates the third field with the second virtual port number, and places the second original port number in the fourth field of the acknowledgment message. The second virtual port number is used to perform routing calculations to obtain the second alternative path from the receiving device to the sending device.
[0250] When it is determined that the second original path from the receiving device to the sending device is not congested, it proves that the second original path is still available. Therefore, the acknowledgment message can continue to be transmitted along the second original path. For example, the receiving device uses the virtual port number corresponding to the previous routing cycle as the second virtual port number corresponding to the current routing cycle, updates the third field with the second virtual port number, and places the second original port number in the fourth field of the acknowledgment message. In this way, when the receiving device sends the acknowledgment message, it will perform routing calculations based on the virtual port number corresponding to the previous routing cycle, so that the acknowledgment message reaches the sending device along the second original path.
[0251] When congestion is detected on the second original path from the receiving device to the transmitting device, it proves that the second original path is unavailable. To resolve the congestion problem, such as... Figure 38 As shown, the receiving device selects (e.g., randomly selects or uses other selection methods) the second virtual port number corresponding to the current routing period from the second candidate port number set, updates the third field with the second virtual port number, and places the second original port number in the fourth field of the acknowledgment message. The second virtual port number is used for routing calculations to obtain the second alternative path from the receiving device to the sending device. The above process is equivalent to encapsulating the acknowledgment message with a virtual tunnel based on the second virtual port number. The acknowledgment message encapsulated with the virtual tunnel will be transmitted in the virtual tunnel (i.e., the second alternative path) corresponding to the second virtual port number. The second candidate port number set includes one or more candidate port numbers other than the second original port number.
[0252] In one embodiment of this disclosure, step 3730 can be performed at the transport layer, i.e., during the process of the receiving device generating an acknowledgment message.
[0253] In step 3740, the receiving device sends an acknowledgment message.
[0254] After the receiving device performs virtual tunnel encapsulation on the acknowledgment message according to the second virtual port number, it sends the acknowledgment message. In this way, the acknowledgment message will reach the sending device along the second alternative path.
[0255] In step 3750, the transmitting device extracts the second original port number from the fourth field and updates the third field with the second original port number for transport layer protocol processing.
[0256] After receiving the acknowledgment message, the sending device, as follows Figure 39As shown, the second original port number is extracted from the fourth field and the third field is updated with the second original port number. This achieves virtual tunnel decapsulation of the acknowledgment message so that it can be processed by the transport layer protocol according to the acknowledgment message, such as calculating the congestion window value corresponding to the next routing cycle of the sending device through the congestion control algorithm.
[0257] It is worth noting that the process of generating and sending acknowledgment messages is similar to that of generating and sending data messages. Therefore, the above embodiments regarding data messages can also be applied to acknowledgment messages. For example, the receiving device can determine whether congestion has occurred on the second original path from the receiving device to the sending device by calculating the fused congestion window value; for another example, the third field may include at least one of the source port number field and the destination port number field; for yet another example, the fourth field may be a field specified in the traditional message format, or it may be a field created by the receiving device and added to the acknowledgment message.
[0258] In steps 3710 to 3750 above, the field recording the port number in the acknowledgment message is set so that it can be replaced during the routing process and restored during the reception process, thus not affecting the transport layer protocol processing. Specifically, after determining that the second original path from the receiving device to the sending device is congested, a second virtual port number is selected from the second candidate port number set to try a new path, and the field recording the port number, i.e., the third field, is updated with the second virtual port number. The second virtual port number is used to select a new path, but the second original port number is needed in the subsequent transport layer protocol processing. Therefore, in this embodiment of the disclosure, the second original port number is placed in the fourth field so that after the sending device receives the acknowledgment message, it can restore the second original port number according to the fourth field, thereby achieving the effect of trying a new path to solve the congestion problem without affecting the transport layer protocol processing, thus improving the message transmission efficiency.
[0259] Data packet verification scheme In one embodiment of this disclosure, reference is made to Figure 40 , Figure 5 Following step 530, the following is also included: Step 4010: The sending device updates the fifth field with the second checksum of the first virtual port number; Reference Figure 40 , Figure 5 Before step 550 shown, the following is also included: Step 4020: The receiving device uses the second check value in the fifth field to verify the first virtual port number in the first field; Reference Figure 40 , Figure 5 Step 550 shown can be updated to step 4030: Step 4030: When the verification of the first virtual port number in the first field is successful, the receiving device extracts the first original port number from the second field and updates the first field with the first original port number for transport layer protocol processing.
[0260] Steps 4010 to 4030 are described in detail below.
[0261] In step 4010, the transmitting device updates the fifth field with the second checksum of the first virtual port number.
[0262] Here, the data packet also has a fifth field, which is used to verify the first field (the verification object may not be limited to the first field). The fifth field has a first checksum of the first original port number. The first checksum of the first original port number can be calculated based solely on the first original port number, or it can be calculated by combining the first original port number with other elements. This depends on which fields the verification object of the fifth field includes. For example, the checksum in the TCP protocol needs to be calculated based on the TCP header and other parts (such as the payload).
[0263] After the transmitting device updates the first field with the first virtual port number, since the value of the first field has changed, a second checksum of the first virtual port number is calculated, and the fifth field is updated with the second checksum of the first virtual port number, such as... Figure 41 As shown. It is worth noting that the calculation methods for various verification values (such as the first verification value and the second verification value) involved in the embodiments of this disclosure are the same; the update of the fifth field by the sending device is also part of the virtual tunnel encapsulation.
[0264] In step 4020, the receiving device uses the second check value of the fifth field to verify the first virtual port number of the first field.
[0265] After receiving a data packet encapsulated through a virtual tunnel, the receiving device first verifies the first virtual port number in the first field using the second checksum in the fifth field. For example, the receiving device recalculates the checksum based on the first virtual port number in the first field and determines whether the recalculated checksum is the same as the second checksum in the fifth field. If they are the same, the verification of the first virtual port number in the first field is successful; if they are different, the verification of the first virtual port number in the first field fails. Of course, the verification object here may not only be the first field; for example, in the TCP protocol, the TCP header and other parts (such as the payload) are verified as a whole.
[0266] In step 4030, when the verification of the first virtual port number in the first field is successful, the receiving device extracts the first original port number from the second field and updates the first field with the first original port number for transport layer protocol processing.
[0267] When the verification of the first virtual port number in the first field fails, it indicates that the data packet may have been lost or tampered with. Therefore, the receiving device can choose not to continue processing the data packet, for example, it can discard the data packet directly. When the verification of the first virtual port number in the first field succeeds, it indicates that the data packet is complete and accurate. Therefore, the receiving device performs virtual tunnel decapsulation on the data packet, that is, extracts the first original port number from the second field and updates the first field with the first original port number for transport layer protocol processing. As for the fifth field, it can be considered that the verification work of the fifth field has been completed and is no longer needed. Therefore, the second checksum of the fifth field can remain unchanged, such as... Figure 42 As shown, the fifth field can also be cleared.
[0268] In steps 4010 to 4030 above, during the virtual tunnel encapsulation of the data packet, the sending device updates the fifth field with the second check value of the first virtual port number; after receiving the data packet, the receiving device first checks the first virtual port number in the first field with the second check value in the fifth field, and only performs virtual tunnel decapsulation on the data packet when the first virtual port number in the first field is successfully checked. This can effectively verify the integrity and accuracy of the data packet received by the receiving device, while ensuring the necessity of virtual tunnel decapsulation and avoiding unnecessary waste of resources.
[0269] In one embodiment of this disclosure, the data packet verification scheme is applicable not only to the receiving device but also to the forwarding device between the sending and receiving devices. This enables the data packet to be discarded in a timely manner when the verification fails, thereby improving the effectiveness of packet transmission and avoiding waste of resources.
[0270] In one embodiment of this disclosure, the verification scheme for the confirmation message can refer to the verification scheme for the data message, and will not be described in detail here.
[0271] In one embodiment of this disclosure, after updating the first field with the first original port number, the message transmission method further includes: updating the fifth field with the first check value of the first original port number; verifying the first original port number of the first field with the first check value of the fifth field; and performing transport layer protocol processing, including: performing transport layer protocol processing when the verification of the first original port number of the first field is successful.
[0272] Here, the receiving device can also verify the data packets decapsulated through the virtual tunnel. For example, after extracting the first original port number from the second field and updating the first field with the first original port number, the receiving device, considering that the value of the first field has been updated from the first virtual port number to the first original port number, updates the fifth field with the first checksum of the first original port number and verifies the first original port number in the first field with the first checksum of the fifth field. When the verification of the first original port number in the first field fails, it proves that the data packet may have lost or been tampered with. Therefore, the receiving device can choose not to continue processing the data packet, for example, it can directly discard the data packet. When the verification of the first original port number in the first field succeeds, it proves that the data packet is complete and accurate. Therefore, the receiving device performs transport layer protocol processing on the data packet. In this way, in addition to verifying the data packets encapsulated through the virtual tunnel, the receiving device also verifies the data packets decapsulated through the virtual tunnel. Through this two-layer verification mechanism, the success rate and security of the receiving device's transport layer protocol processing can be improved.
[0273] In one embodiment of this disclosure, reference is made to Figure 43 , Figure 40 Following step 530, the following is also included: Step 4310: The sending device places the first checksum in the sixth field of the data packet; Reference Figure 43 , Figure 40 Step 4030 shown includes: Step 4320: When the verification of the first virtual port number in the first field is successful, the receiving device extracts the first original port number from the second field and updates the first field with the first original port number; Step 4330: The receiving device extracts the first check value from the sixth field and updates the fifth field with the first check value; Step 4340: The receiving device uses the first check value in the fifth field to verify the first original port number in the first field; Step 4350: When the verification of the first original port number in the first field is successful, the receiving device performs transport layer protocol processing.
[0274] Steps 4310 to 4350 are described in detail below.
[0275] In step 4310, the sending device places the first check value in the sixth field of the data packet.
[0276] While updating the fifth field with the second checksum using the first virtual port number, the sending device places the original first checksum of the fifth field into the sixth field of the data packet, such as... Figure 44As shown. It is worth noting that the process of placing the first checksum in the sixth field of the data packet can be considered as part of the virtual tunnel encapsulation.
[0277] In one embodiment of this disclosure, the sixth field and the second field can be the same field or different fields. When the sixth field and the second field are different fields, the processing method for the second field described in the above embodiments (refer to step 3120 or step 3420) also applies to the sixth field.
[0278] In step 4320, when the verification of the first virtual port number in the first field is successful, the receiving device extracts the first original port number from the second field and updates the first field with the first original port number.
[0279] In step 4330, the receiving device extracts the first check value from the sixth field and updates the fifth field with the first check value.
[0280] During the virtual tunnel decapsulation process of the receiving device on the data packet, in addition to extracting the first original port number from the second field and updating the first field with the first original port number, the device also extracts the first checksum from the sixth field and updates the fifth field with the first checksum. Figure 45 As shown.
[0281] In step 4340, the receiving device verifies the first original port number in the first field using the first check value in the fifth field.
[0282] In step 4350, when the verification of the first original port number in the first field is successful, the receiving device performs transport layer protocol processing.
[0283] In steps 4310 to 4350 above, the sending device places the first check value in the sixth field of the data packet. In this way, after the receiving device updates the first field with the first original port number, it can extract the first check value from the sixth field and update the fifth field with the first check value. Thus, by transmitting the first check value through the sixth field, effective verification of the data packet decapsulated through the virtual tunnel can be achieved, ensuring that the data packet decapsulated through the virtual tunnel is accurate and error-free, thereby improving the success rate and security of the receiving device in processing the transport layer protocol.
[0284] In one embodiment of this disclosure, reference is made to Figure 46 , Figure 40 Step 4030 shown includes: Step 4610: When the verification of the first virtual port number in the first field is successful, the receiving device extracts the first original port number from the second field and updates the first field with the first original port number; Step 4620: The receiving device calculates a first check value based on the first original port number in the first field, and updates the fifth field with the first check value; Step 4630: The receiving device uses the first check value in the fifth field to verify the first original port number in the first field; Step 4640: When the verification of the first original port number in the first field is successful, the receiving device performs transport layer protocol processing.
[0285] Steps 4610 to 4640 are described in detail below.
[0286] In step 4610, when the verification of the first virtual port number in the first field is successful, the receiving device extracts the first original port number from the second field and updates the first field with the first original port number.
[0287] In step 4620, the receiving device calculates a first check value based on the first original port number of the first field, and updates the fifth field with the first check value.
[0288] During the virtual tunnel decapsulation process of the receiving device on the data packet, in addition to extracting the first original port number from the second field and updating the first field with the first original port number, a first checksum is calculated based on the first original port number in the first field, and the fifth field is updated with the first checksum. Figure 47 As shown.
[0289] In step 4630, the receiving device verifies the first original port number in the first field using the first check value in the fifth field.
[0290] Here, the receiving device uses the first check value of the fifth field to verify the first original port number of the first field. Since the first check value of the fifth field is calculated based on the first original port number in step 4620, a successful verification result is usually obtained in step 4630.
[0291] In step 4640, when the verification of the first original port number in the first field is successful, the receiving device performs transport layer protocol processing.
[0292] In steps 4610 to 4640 above, the receiving device calculates the first check value based on the first original port number in the first field, and updates the fifth field with the first check value. In this way, it is ensured that the data packet decapsulated through the virtual tunnel is consistent with the data packet initially generated by the sending device, which can improve the success rate of the receiving device in processing the transport layer protocol.
[0293] Example of the specific usage process of the message transmission method in this disclosure embodiment The following explanation uses an IPv4 network with TCP as the transport layer protocol as an example.
[0294] As an example, embodiments of this disclosure provide, for example, Figure 48 The diagram illustrates an IPv4 network. Solid lines between different devices represent physical links, the width of which indicates the degree of congestion. Dashed lines with arrows together form the communication path. Figure 48 In the IPv4 network, server H0 and server H3 establish a TCP connection (communication connection), and the communication path used by the TCP connection to transmit packets is H0-L0-S0-L2-H3. In the native TCP scheme, regardless of whether the communication path is congested (e.g., Figure 48 Even if the physical link L0-S0 is highly congested or a network failure causes a timeout retransmission, the route will not be switched. This is mainly because the information used for routing calculation is a 5-tuple, and the information used for TCP connection identification is also a 5-tuple. If a certain piece of information in the 5-tuple is changed to switch routes, it will affect TCP connection identification and cause TCP connection interruption.
[0295] To reduce costs and due to low average traffic intensity, IPv4 networks are often designed with convergent bandwidth, which means they are more prone to congestion. However, in actual business operations, the average traffic on IPv4 networks is usually quite low; most of the time, only a small number of physical links are congested, while others are relatively idle. This means that routing during congestion can yield significant benefits. Therefore, in this embodiment, when congestion is detected on the communication path of a TCP connection, the TCP connection is switched to a less congested communication path, thereby effectively resolving the congestion problem, better utilizing IPv4 network resources, and effectively improving packet transmission efficiency. Figure 49 As shown, in this embodiment of the disclosure, congestion was detected in the communication path H0-L0-S0-L2-H3 of the TCP connection. Therefore, the communication path of the TCP connection was switched from H0-L0-S0-L2-H3 to H0-L1-S1-L3-H3.
[0296] Reference Figure 50 as well as Figure 51This disclosure embodiment can be implemented as a custom module (similar to a kernel module in a Linux system) in the server's data transmission stack. This custom module includes a connection component and a custom sublayer. The connection component resides within the TCP layer and its functionality is extended by modifying the source code of standard TCP (native TCP). This extension primarily involves attribute and logical extensions. Attribute extension refers to adding path-related state attributes (path attributes), including virtual source and destination port numbers, to implement lightweight virtual tunnel encapsulation, i.e., controlling the path's direction. Logical extension refers to adding throughput detection (congestion detection), path control, and path switching logic. The custom sublayer resides between the TCP and IP layers and is responsible for modifying packets in the receiving direction, thus achieving transparency to standard TCP processing. It is worth noting that this disclosure embodiment does not perform reliable transmission of upper-layer traffic; instead, it performs lightweight virtual tunnel encapsulation and data flow throughput detection on packets, thereby improving data flow throughput and service availability.
[0297] Reference Figure 52 , Figure 52 This is a schematic diagram of a TCP connection for message transmission provided in an embodiment of this disclosure, which will be combined with... Figure 52 Provide a detailed description.
[0298] Step 1) When a TCP connection sends data, it first determines whether to allow transmission based on a congestion control algorithm, such as... Figure 52 As shown in ①.
[0299] Step 2) If the congestion control algorithm allows transmission, then the standard TCP transmission process (including sliding window processing, sequence number allocation, etc.) begins. Figure 52 As shown in ②.
[0300] Step 3) After the standard TCP sending process is completed, the path control logic of this embodiment of the disclosure will be entered, such as... Figure 52 As shown in ③.
[0301] Step 4) In the path control logic, the packet header is modified to control the communication path of the packet. This embodiment inserts a custom sublayer between the transport layer and the IP layer. After the packet header is modified by the path control logic, it is delivered to the custom sublayer, which then passes the packet to the IP layer, such as... Figure 52 As shown in ④.
[0302] Step 5) After receiving the packet from the IP layer, in this embodiment of the disclosure, a custom sublayer first performs reception processing, that is, modifies the packet header to restore the packet to its format before path control, making the reception processing of the custom sublayer transparent to TCP, such as... Figure 52 As shown in ⑤.
[0303] Step 6) After the custom sublayer's receive processing is complete, the packet has been restored to its format before path control. At this point, the packet is delivered to the standard TCP receive processing flow, such as... Figure 52 As shown in ⑥.
[0304] Step 7) In the standard TCP receive processing flow, the congestion control status (such as the congestion window value) is updated, and the packet is delivered to the upper layer (i.e., the business application) for processing, such as... Figure 52 As shown in ⑦.
[0305] Step 8) The throughput detection logic of this embodiment continuously detects the congestion window value of the TCP connection, such as... Figure 52 As shown in ⑧.
[0306] Step 9) If the throughput detection logic detects that the congestion window value is less than the congestion window value threshold, it will notify the path switching logic to switch the communication path, such as... Figure 52 As shown in ⑨.
[0307] Step 10) The path switching logic will change the virtual source port number in the path attributes and take effect in the path control logic, such as... Figure 52 As shown in ⑩.
[0308] Below, on Figure 52 The details of the workflow will be explained.
[0309] 1) Throughput detection logic.
[0310] This disclosure embodiment detects the congestion window value of TCP connections, enabling accurate determination of whether congestion has occurred in the communication path and avoiding missed or false alarms. For example, a moving average can be used to assess the degree of congestion; the formula for calculating the moving average is as follows:
[0311] in, This represents the moving average coefficient, which is a number greater than 0 and less than 1. The specific value can be configured according to the actual situation, such as 0.1. This represents the current congestion window value (i.e., the congestion window value corresponding to the current routing cycle); the right side of the equation... This represents the historical moving average (i.e., the moving average corresponding to the previous routing cycle); the left side of the equation... This represents the current moving average (i.e., the moving average corresponding to the current routing cycle).
[0312] Based on this, in this embodiment of the disclosure, the server updates the congestion control algorithm each time it receives an acknowledgment message. Then update using the above formula .
[0313] when When it is determined that the communication path is congested and a route switch is required, then... , Indicates the congestion window threshold; This represents the configurable threshold coefficient, which is a number greater than 0 and not exceeding 1, for example, it can be configured to be 0.4; This represents the maximum congestion window value, which could be, for example, the Bandwidth-Delay Product (BDP).
[0314] This embodiment of the disclosure does not require detection of congestion signals (such as packet loss count, explicit congestion notification, or packet delay), nor does it require consideration of the specific congestion control algorithm used. It only needs to detect the congestion window value, as the congestion window value directly controls the throughput of TCP connections. However, the congestion window value is constantly changing dynamically. Therefore, a time-based moving average is performed in the above process to filter out small fluctuations and noise, ensuring that the obtained value is consistent with the actual value. The accuracy and effectiveness.
[0315] 2) Path control logic.
[0316] To achieve path control, this embodiment of the disclosure requires modification of the source port number field and the destination port number field in the packet header. When the transport layer protocol uses TCP, the packet header is the TCP header, and its format is as follows: Figure 53 As shown below, the implementation details of the path control logic will be explained in detail.
[0317] ① Initialize path attributes.
[0318] The path attributes mainly include the virtual source port number and the virtual destination port number, used to modify the TCP packet header. In this embodiment, a fixed destination port number (e.g., 4790) is used as the virtual destination port number. Destination port number 4790 is used to trigger the custom sublayer's receiving and processing flow; that is, the custom sublayer will only receive and process packets with destination port number 4790. If some TCP traffic in the network does not need to be received and processed by the custom sublayer, then destination port number 4790 needs to be avoided when creating a TCP connection and allocating the destination port number, thereby preventing this TCP traffic from being incorrectly received and processed by the custom sublayer. In one embodiment of this disclosure, if all TCP traffic in the network needs to be received and processed by the custom sublayer, the virtual destination port number can be configured arbitrarily without using a fixed destination port number. In this case, the custom sublayer will receive and process all packets.
[0319] The virtual source port number can be configured to a random source port number, or it can use the same source port number as the TCP connection. It's worth noting that the virtual source port number may be changed to a new source port number due to path switching.
[0320] ② Sending process (referring to sending process in the path control logic).
[0321] like Figure 54 As shown, when sending a message, the path control logic puts the original source port number, the original destination port number, and the first checksum (corresponding to the checksum value mentioned above) from the TCP header into the Option field. Then, it updates the source port number field with the virtual source port number from the path attribute, updates the destination port number field with the virtual destination port number from the path attribute, and calculates the second checksum. The purpose of updating the source port number field and the destination port number field with the virtual source port number from the path attribute is to control the communication path of the message. The purpose of putting the original source port number, the original destination port number, and the first checksum from the TCP header into the Option field is to ensure that they can be recovered during reception processing, thus making the processing of this embodiment transparent to TCP.
[0322] Additionally, saving the first checksum to the Options field avoids recalculating the checksum during receive processing. It's worth noting that when updating the source port number field with the virtual source port number in the path attribute, and when updating the destination port number field with the virtual destination port number in the path attribute, a second checksum needs to be calculated. This is because the checksum is calculated based on the TCP header and TCP data. Since the content and length of the TCP header have been updated, the second checksum needs to be recalculated to prevent subsequent packet checksum failures from causing packets to be discarded.
[0323] ③ Reception processing (here referring to reception processing in path control logic, i.e., reception processing of custom sub-layers).
[0324] After the packet leaves the IP layer, it is distributed according to the destination port number. If the destination port number field in the packet has a value of 4790, the packet is distributed to a custom sublayer for reception and processing. Figure 55 As shown, in the custom sublayer's receiving process, the source port number field is updated with the original source port number in the Option field, the destination port number field is updated with the original destination port number in the Option field, the checksum field is updated with the first checksum in the Option field, and then the Option field is cleared to zero. In this way, the originally generated packet can be recovered, making the receiving process transparent to the standard TCP.
[0325] In the aforementioned path control logic's sending and receiving processes, virtual tunnel encapsulation and decapsulation are implemented through the Options field in the TCP header. In one embodiment of this disclosure, virtual tunnel encapsulation and decapsulation can also be implemented through custom fields in a custom header, such as... Figure 56 and Figure 57 As shown, in Figure 57 The custom packet header needs to be deleted during the virtual tunnel decapsulation process.
[0326] In the above-described path control logic sending process, the first checksum needs to be saved to the Options field. In one embodiment of this disclosure, the first checksum may not be saved to the Options field. Instead, in the path control logic receiving process, the first checksum is recalculated when updating the source port number field with the original source port number in the Option field and when updating the destination port number field with the original destination port number in the Option field.
[0327] 3) Path switching logic.
[0328] When the throughput detection logic detects congestion on the communication path, it triggers path switching logic. This logic reconfigures a virtual source port number randomly in the path attributes. Subsequent packets will then use this new virtual source port number to modify the TCP header, thus achieving path switching. Two points need clarification here: ① Switching timing: Switching from the original path to the new path may cause out-of-order packets to appear on the receiving device of the TCP connection. In order to reduce out-of-order packets, the path switching can be set to be performed only after the TCP connection has been idle for a period of time (such as 1ms). TCP connection idle means that the sending window value is zero (empty).
[0329] ② Switching Interval: After switching paths once, a certain interval (e.g., 10ms) is required before the next path switch can proceed. This is because after switching paths, the TCP connection's traffic undergoes congestion control again on the new path, and the convergence of the congestion control algorithm (i.e., from initial adjustment to stability) requires a certain amount of time.
[0330] The embodiments disclosed herein have at least the following technical effects: 1) Significantly reduces the impact of network congestion on TCP service traffic in IPv4 networks, increases TCP connection throughput, and thus improves service IOPS. Embodiments of this disclosure allow congested TCP connections to switch to less congested or even completely uncongested communication paths within 100ms (possibly less), increasing TCP connection throughput by more than 50%. For example, see... Figure 58If the communication path becomes congested, the native TCP solution can only tolerate the congestion, and the throughput will drop to 30Gbps and last for a long time. However, the embodiments disclosed in this disclosure can switch to an idle communication path 100ms after the congestion, and restore the throughput to 100Gbps.
[0331] 2) The embodiments disclosed herein can significantly reduce network congestion points and distribute network traffic more evenly across all communication paths, thereby increasing the overall network throughput by more than 20%.
[0332] 3) It can achieve adaptive routing of TCP service traffic in congested scenarios in IPv4 networks without upgrading the network (e.g., no need to upgrade to IPv6) or changing the switch configuration (e.g., no need to configure the switch to support overlay networks), which is low-cost and highly applicable.
[0333] Description of apparatus and devices according to embodiments of this disclosure It is understood that although the steps in the above flowcharts are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in this embodiment, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the above flowcharts may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.
[0334] It should be noted that in all specific embodiments of this disclosure, when processing of messages is required, permission or consent from the relevant parties is obtained first, and the processing of messages complies with the relevant laws, regulations, and standards of the relevant countries and regions. Furthermore, when this disclosure requires message processing, separate permission or consent from the relevant parties is obtained through pop-up windows or redirection to a confirmation page, and the message is processed only after obtaining the separate permission or consent from the relevant parties.
[0335] Reference Figure 59 , Figure 59 This is a schematic diagram of the structure of a message transmission device 5900 provided in an embodiment of the present disclosure. The message transmission device 5900 includes: The data packet generation module 5910 is used to generate data packets; wherein, the first field in the data packet has a first original port number; The first congestion determination module 5920 is used to determine that the first original path from the transmitting device to the receiving device is congested based on the congestion window value corresponding to the current routing period of the transmitting device. The data packet encapsulation module 5930 is used to select the first virtual port number corresponding to the current routing period from the first candidate port number set, update the first field with the first virtual port number, and place the first original port number in the second field of the data packet; the first virtual port number is used to perform routing calculations to obtain the first alternative path from the sending device to the receiving device. The data packet sending module 5940 is used to send data packets so that after the receiving device receives the data packet, it can extract the first original port number from the second field and update the first field with the first original port number for transport layer protocol processing.
[0336] In one embodiment, the message transmission apparatus 5900 further includes an acknowledgment message receiving module (not shown) for receiving an acknowledgment message for the data message from the receiving device; wherein the acknowledgment message has a third field and a fourth field, the third field having a second virtual port number selected by the receiving device from a second candidate port number set, and the fourth field having a second original port number, the second virtual port number being used to perform routing calculations to obtain a second alternative path from the receiving device to the sending device; The message transmission apparatus 5900 also includes an acknowledgment message decapsulation module (not shown) for extracting the second original port number from the fourth field and updating the third field with the second original port number for transport layer protocol processing.
[0337] In one embodiment, the data packet further includes a fifth field, which has a first checksum of the first original port number. The data packet encapsulation module 5930 is further configured to update the fifth field with a second checksum of the first virtual port number, so that after the receiving device receives the data packet, it can use the second checksum of the fifth field to verify the first virtual port number in the first field, and when the verification of the first virtual port number in the first field is successful, it can extract the first original port number from the second field and update the first field with the first original port number.
[0338] In one embodiment, the data packet encapsulation module 5930 is further configured to place a first check value in the sixth field of the data packet, so that after the receiving device updates the first field with the first original port number, it can extract the first check value from the sixth field, update the fifth field with the first check value, verify the first original port number in the first field with the first check value in the fifth field, and perform transport layer protocol processing when the verification of the first original port number in the first field is successful.
[0339] In one embodiment, the first original port number includes a first original source port number and a first original destination port number, and the first field includes a seventh field having the first original source port number and an eighth field having the first original destination port number; the data packet encapsulation module 5930 is further configured to: Select the first virtual source port number corresponding to the current routing cycle from the first candidate source port number set, and update the seventh field with the first virtual source port number; Select the first virtual destination port number corresponding to the current routing period from the first candidate destination port number set, and update the eighth field with the first virtual destination port number; wherein, the candidate destination port number in the first candidate destination port number set is used to trigger the receiving device to update the seventh and eighth fields.
[0340] In one embodiment, the first original port number includes at least one of a first original source port number and a first original destination port number, and the first field includes at least one of a seventh field having the first original source port number and an eighth field having the first original destination port number. The data packet encapsulation module 5930 is also used for: Perform at least one of the following processes: Select the first virtual source port number corresponding to the current routing cycle from the first candidate source port number set, and update the seventh field with the first virtual source port number; Select the port number of the first virtual destination corresponding to the current routing cycle from the first candidate destination port number set, and update the eighth field with the port number of the first virtual destination.
[0341] In one embodiment, the data packet encapsulation module 5930 is further configured to: Routing calculations are performed based on multiple candidate port numbers in the first candidate port number set to obtain the correspondence between multiple candidate port numbers and multiple physical ports of the sending device; Determine the port load level of multiple physical ports; The physical port with the lowest port load is identified as the target physical port, and the candidate port number corresponding to the target physical port is identified as the filtered port number. Select the first virtual port number corresponding to the current routing cycle from the filtered port numbers.
[0342] In one embodiment, the data packet encapsulation module 5930 is further configured to: Based on multiple candidate port numbers in the first candidate port number set, a routing calculation is performed to obtain multiple candidate replacement paths from the sending device to the receiving device; Determine the path overlap between the first original path and multiple candidate replacement paths; The candidate port number corresponding to the candidate replacement path with the minimum path overlap is determined as the first virtual port number corresponding to the current routing cycle.
[0343] In one embodiment, the data packet encapsulation module 5930 is further configured to: Identify overlapping paths among multiple congested paths from the transmitting device to the receiving device; Based on multiple candidate port numbers in the first candidate port number set, a routing calculation is performed to obtain multiple candidate replacement paths from the sending device to the receiving device; The candidate port number corresponding to the candidate replacement path that excludes overlapping paths is determined as the first virtual port number corresponding to the current routing cycle.
[0344] In one embodiment, the first congestion determination module 5920 is further configured to: The congestion window value corresponding to the current routing cycle and the congestion window values corresponding to historical routing cycles are merged to obtain the merged congestion window value. When the fusion congestion window value is less than the congestion window value threshold, it is determined that the first original path from the transmitting device to the receiving device is congested.
[0345] In one embodiment, the data packet encapsulation module 5930 is further configured to: When the path switching conditions are met, select the first virtual port number corresponding to the current routing cycle from the first candidate port number set; The path switching conditions include at least one of the following: the sending window value corresponding to the current routing cycle of the sending device is zero and the duration reaches a first duration threshold; the interval between the last selection of the first candidate port number set reaches a second duration threshold.
[0346] In one embodiment, the data packet encapsulation module 5930 is further configured to: Perform any of the following processes: The second field of the data packet is updated with the first original port number so that the receiving device can update the second field with the original value of the second field after extracting the first original port number from the second field. A second field is created based on the first original port number and added to the data packet so that the receiving device can delete the second field from the data packet after extracting the first original port number from the second field.
[0347] Reference Figure 60 , Figure 60 This is a schematic diagram of the structure of a message transmission device 6000 provided in an embodiment of the present disclosure. The message transmission device 6000 includes: The data packet receiving module 6010 is used to receive data packets from the sending device. The data packet has a first field and a second field. The first field has a first virtual port number, and the second field has a first original port number. The first virtual port number is selected by the sending device from a first set of candidate port numbers when the first original path from the sending device to the receiving device is congested, based on the congestion window value corresponding to the current routing cycle of the sending device. The first virtual port number is used to perform routing calculations to obtain a first alternative path from the sending device to the receiving device. The data packet decapsulation module 6020 is used to extract the first original port number from the second field and update the first field with the first original port number for transport layer protocol processing.
[0348] In one embodiment, the message transmission apparatus 6000 further includes an acknowledgment message generation module (not shown) for generating an acknowledgment message for the data message; wherein the third field in the acknowledgment message has a second original port number; The message transmission device 6000 also includes a second congestion determination module (not shown), used to determine that the second original path from the receiving device to the transmitting device is congested based on the congestion window value corresponding to the current routing period of the receiving device; The message transmission device 6000 also includes an acknowledgment message encapsulation module (not shown), which is used to select the second virtual port number corresponding to the current routing period from the second candidate port number set, update the third field with the second virtual port number, and place the second original port number in the fourth field of the acknowledgment message. The second virtual port number is used to perform routing calculations to obtain the second alternative path from the receiving device to the sending device. The message transmission device 6000 also includes an acknowledgment message sending module (not shown) for sending an acknowledgment message so that after receiving the acknowledgment message, the sending device can extract the second original port number from the fourth field and update the third field with the second original port number for transport layer protocol processing.
[0349] In one embodiment, the data packet further includes a fifth field, which has a second checksum of the first virtual port number; the data packet decapsulation module 6020 is also used for: Use the second check value in the fifth field to verify the first virtual port number in the first field; When the first virtual port number in the first field is successfully verified, the first original port number is extracted from the second field and the first field is updated with the first original port number.
[0350] In one embodiment, the data packet decapsulation module 6020 is further configured to: Update the fifth field with the first checksum of the first original port number; Use the first check value in the fifth field to verify the first original port number in the first field; When the first original port number in the first field is successfully verified, transport layer protocol processing is performed.
[0351] In one embodiment, the data packet decapsulation module 6020 is further configured to: Perform any of the following processes: Extract the first checksum from the sixth field of the data packet; Calculate the first checksum based on the first original port number in the first field.
[0352] Reference Figure 61 , Figure 61 To implement the structural block diagram of a portion of the terminal 130 of the message transmission method according to this embodiment of the present disclosure, the terminal includes: a radio frequency (RF) circuit 6110, a memory 6115, an input unit 6130, a display unit 6140, a sensor 6150, an audio circuit 6160, a wireless fidelity (WiFi) module 6170, a processor 6180, and a power supply 6190, etc. Those skilled in the art will understand that... Figure 61 The terminal structure shown does not constitute a limitation on mobile phones or computers and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0353] The RF circuit 6110 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and processes it with the processor 6180; in addition, it transmits uplink data to the base station.
[0354] The memory 6115 can be used to store software programs and modules. The processor 6180 executes various terminal functions and data processing by running the software programs and modules stored in the memory 6115.
[0355] The input unit 6130 can be used to receive input numeric or character information, and to generate key signal inputs related to the terminal's settings and function control. Specifically, the input unit 6130 may include a touch panel 6131 and other input devices 6132.
[0356] The display unit 6140 can be used to display input or provided information, as well as various menus of the terminal. The display unit 6140 may include a display panel 6141.
[0357] Audio circuit 6160, speaker 6161, and microphone 6162 provide an audio interface.
[0358] In this embodiment, the processor 6180 included in the terminal can execute the message transmission method of the previous embodiment. The terminals disclosed in this embodiment include, but are not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, and aircraft. The embodiments of this invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.
[0359] Reference Figure 62 , Figure 62 This is a partial structural block diagram of a server 110 implementing the message transmission method of this disclosure embodiment. The server 110 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 6222 (e.g., one or more processors) and a memory 6232, and one or more storage media 6230 (e.g., one or more mass storage devices) storing application programs 6242 or data 6244. The memory 6232 and storage media 6230 can be temporary or persistent storage. The program stored in the storage media 6230 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server 6200. Furthermore, the CPU 6222 may be configured to communicate with the storage media 6230 and execute the series of instruction operations in the storage media 6230 on the server 6200.
[0360] Server 6200 may also include one or more power supplies 6226, one or more wired or wireless network interfaces 6250, one or more input / output interfaces 6258, and / or one or more operating systems 6241, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0361] The processor in server 6200 can be used to execute the message transmission method of the present disclosure embodiments.
[0362] This disclosure also provides a computer-readable storage medium for storing a computer program for executing the message transmission methods of the foregoing embodiments.
[0363] This disclosure also provides a computer program product, which includes a computer program. The processor of an electronic device reads and executes the computer program, causing the electronic device to perform the message transmission method described above.
[0364] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this disclosure described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “including,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0365] It should be understood that in this disclosure, "at least one item" means one or more, and "more than one" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0366] It should be understood that in the description of the embodiments of this disclosure, "multiple" means two or more, "greater than", "less than", "exceeding" etc. are understood to exclude the number itself, and "above", "below", "within" etc. are understood to include the number itself.
[0367] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0368] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0369] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0370] If the integrated unit is implemented as a software functional unit 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 this disclosure, in essence, 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. This computer software product is stored in a storage medium and includes several instructions (computer programs) to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing computer programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0371] It should also be understood that the various implementation methods provided in this disclosure can be combined arbitrarily to achieve different technical effects. In this disclosure, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0372] The above is a detailed description of the embodiments of this disclosure. However, this disclosure is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this disclosure. All such equivalent modifications or substitutions are included within the scope defined by the claims of this disclosure.
Claims
1. A message transmission method, characterized in that, Applied to a sending device; the message transmission method includes: Generate a data packet; wherein, the first field in the data packet has a first original port number; Based on the congestion window value corresponding to the current routing period of the transmitting device, it is determined that the first original path from the transmitting device to the receiving device is congested. Select the first virtual port number corresponding to the current routing period from the first candidate port number set, update the first field with the first virtual port number, and place the first original port number in the second field of the data packet; the first virtual port number is used to perform routing calculations to obtain a first alternative path from the sending device to the receiving device. The data packet is sent so that after the receiving device receives the data packet, it can extract the first original port number from the second field and update the first field with the first original port number for transport layer protocol processing.
2. The message transmission method according to claim 1, characterized in that, After sending the data packet, the packet transmission method further includes: The receiving device receives an acknowledgment message for the data packet; wherein the acknowledgment message has a third field and a fourth field, the third field has a second virtual port number selected by the receiving device from a second candidate port number set, and the fourth field has a second original port number, the second virtual port number being used to perform routing calculations to obtain a second alternative path from the receiving device to the sending device; The second original port number is extracted from the fourth field, and the third field is updated with the second original port number for transport layer protocol processing.
3. The message transmission method according to claim 1, characterized in that, The data packet also has a fifth field, which has a first check value for the first original port number; After updating the first field with the first virtual port number, the message transmission method further includes: The fifth field is updated with the second checksum of the first virtual port number, so that after the receiving device receives the data packet, it uses the second checksum of the fifth field to verify the first virtual port number in the first field, and when the verification of the first virtual port number in the first field is successful, it extracts the first original port number from the second field and updates the first field with the first original port number.
4. The message transmission method according to claim 3, characterized in that, After updating the first field with the first virtual port number, the message transmission method further includes: The first check value is placed in the sixth field of the data packet so that after the receiving device updates the first field with the first original port number, it can extract the first check value from the sixth field, update the fifth field with the first check value, verify the first original port number in the first field with the first check value in the fifth field, and perform transport layer protocol processing when the verification of the first original port number in the first field is successful.
5. The message transmission method according to claim 1, characterized in that, The first original port number includes a first original source port number and a first original destination port number, and the first field includes a seventh field having the first original source port number and an eighth field having the first original destination port number. The step of selecting the first virtual port number corresponding to the current routing period from the first candidate port number set and updating the first field with the first virtual port number includes: Select the first virtual source port number corresponding to the current routing period from the first candidate source port number set, and update the seventh field with the first virtual source port number; Select the first virtual destination port number corresponding to the current routing period from the first candidate destination port number set, and update the eighth field with the first virtual destination port number; wherein, the candidate destination port number in the first candidate destination port number set is used to trigger the receiving device to update the seventh field and the eighth field.
6. The message transmission method according to claim 1, characterized in that, The first original port number includes at least one of a first original source port number and a first original destination port number, and the first field includes at least one of a seventh field having the first original source port number and an eighth field having the first original destination port number. The step of selecting the first virtual port number corresponding to the current routing period from the first candidate port number set and updating the first field with the first virtual port number includes: Perform at least one of the following processes: Select the first virtual source port number corresponding to the current routing period from the first candidate source port number set, and update the seventh field with the first virtual source port number; Select the port number of the first virtual destination corresponding to the current routing cycle from the first candidate destination port number set, and update the eighth field with the first virtual destination port number.
7. The message transmission method according to claim 1, characterized in that, The step of selecting the first virtual port number corresponding to the current routing period from the first candidate port number set includes: A routing operation is performed based on multiple candidate port numbers in the first candidate port number set to obtain the correspondence between the multiple candidate port numbers and multiple physical ports of the transmitting device; Determine the port load level of the multiple physical ports; The physical port with the lowest port load is identified as the target physical port, and the candidate port number corresponding to the target physical port is identified as the filtered port number. Select the first virtual port number corresponding to the current routing cycle from the filtered port numbers.
8. The message transmission method according to claim 1, characterized in that, The step of determining that the first original path from the transmitting device to the receiving device is congested based on the congestion window value corresponding to the current routing period of the transmitting device includes: The congestion window value corresponding to the current routing cycle and the congestion window value corresponding to the historical routing cycles are fused to obtain a fused congestion window value. When the fusion congestion window value is less than the congestion window value threshold, it is determined that the first original path from the transmitting device to the receiving device is congested.
9. The message transmission method according to claim 1, characterized in that, The step of selecting the first virtual port number corresponding to the current routing period from the first candidate port number set includes: When the path switching condition is met, the first virtual port number corresponding to the current routing period is selected from the first candidate port number set. The path switching conditions include at least one of the following: the sending window value corresponding to the current routing cycle of the sending device is zero and the duration reaches a first duration threshold; the interval between the last selection of the first candidate port number set reaches a second duration threshold.
10. The message transmission method according to claim 1, characterized in that, The step of placing the first original port number in the second field of the data packet includes: Perform any of the following processes: The second field of the data packet is updated with the first original port number so that the receiving device updates the second field with the original value of the second field after extracting the first original port number from the second field. A second field is created based on the first original port number, and the second field is added to the data packet so that the receiving device deletes the second field from the data packet after extracting the first original port number from the second field.
11. A message transmission method, characterized in that, Applied to receiving devices; the message transmission method includes: A data packet is received from a sending device; wherein the data packet has a first field and a second field, the first field having a first virtual port number and the second field having a first original port number; the first virtual port number is selected by the sending device from a first set of candidate port numbers when the first original path from the sending device to the receiving device is congested based on the congestion window value corresponding to the current routing period of the sending device; the first virtual port number is used to perform routing calculations to obtain a first alternative path from the sending device to the receiving device; The first original port number is extracted from the second field, and the first field is updated with the first original port number for transport layer protocol processing.
12. The message transmission method according to claim 11, characterized in that, After extracting the first original port number from the second field and updating the first field with the first original port number for transport layer protocol processing, the message transmission method further includes: Generate an acknowledgment message for the data packet; wherein the third field in the acknowledgment message has a second original port number; Based on the congestion window value corresponding to the current routing period of the receiving device, it is determined that the second original path from the receiving device to the transmitting device is congested. Select the second virtual port number corresponding to the current routing period from the second candidate port number set, update the third field with the second virtual port number, place the second original port number in the fourth field of the acknowledgment message, and use the second virtual port number to perform routing calculations to obtain the second alternative path from the receiving device to the sending device; The acknowledgment message is sent so that after receiving the acknowledgment message, the sending device can extract the second original port number from the fourth field and update the third field with the second original port number for transport layer protocol processing.
13. The message transmission method according to claim 11, characterized in that, The data packet also has a fifth field, which has a second check value for the first virtual port number; After receiving a data packet from the sending device, the packet transmission method further includes: The first virtual port number in the first field is verified using the second verification value of the fifth field; The step of extracting the first original port number from the second field and updating the first field with the first original port number includes: When the verification of the first virtual port number in the first field is successful, the first original port number is extracted from the second field and the first field is updated with the first original port number.
14. The message transmission method according to claim 13, characterized in that, After updating the first field with the first original port number, the message transmission method further includes: Update the fifth field with the first checksum of the first original port number; The first original port number in the first field is verified using the first verification value in the fifth field. The process of performing transport layer protocol processing includes: When the verification of the first original port number in the first field is successful, transport layer protocol processing is performed.
15. The message transmission method according to claim 14, characterized in that, Before updating the fifth field with the first checksum of the first original port number, the message transmission method further includes: Perform any of the following processes: Extract the first checksum from the sixth field of the data packet; The first checksum is calculated based on the first original port number contained in the first field.
16. A message transmission device, characterized in that, Applied to a sending device; the message transmission device includes: A data packet generation module is used to generate data packets; wherein, the first field in the data packet has a first original port number; The first congestion determination module is used to determine, based on the congestion window value corresponding to the current routing period of the transmitting device, that the first original path from the transmitting device to the receiving device is congested. The data packet encapsulation module is used to select a first virtual port number corresponding to the current routing period from the first candidate port number set, update the first field with the first virtual port number, and place the first original port number in the second field of the data packet; the first virtual port number is used to perform routing calculations to obtain a first alternative path from the sending device to the receiving device. The data packet sending module is used to send the data packet so that after the receiving device receives the data packet, it can extract the first original port number from the second field and update the first field with the first original port number for transport layer protocol processing.
17. A message transmission device, characterized in that, Applied to receiving devices; the message transmission device includes: A data packet receiving module is used to receive data packets from a sending device; wherein, the data packet has a first field and a second field, the first field having a first virtual port number, and the second field having a first original port number; the first virtual port number is selected by the sending device from a first candidate port number set when the sending device determines that the first original path from the sending device to the receiving device is congested based on the congestion window value corresponding to the current routing period of the sending device; the first virtual port number is used to perform routing calculations to obtain a first alternative path from the sending device to the receiving device; The data packet decapsulation module is used to extract the first original port number from the second field and update the first field with the first original port number for transport layer protocol processing.
18. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the message transmission method according to any one of claims 1 to 15.
19. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the message transmission method according to any one of claims 1 to 15.
20. A computer program product, the computer program product comprising a computer program, characterized in that, The computer program is read and executed by the processor of the electronic device, causing the electronic device to perform the message transmission method according to any one of claims 1 to 15.