Message forwarding methods, devices, electronic equipment and storage media
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2026-08-14
AI Technical Summary
[0005]本申请实施例提供一种报文转发方法、装置、电子设备及存储介质,以解决对用户操作系统或应用的侵入较大,或者兼容性不高的技术问题
[0043]综上所述,在本申请实施例中,负载均衡设备在接收到客户端发送的原始报文的情况下,确定访问后端服务器的原始报文的目的物理地址和目的网络地址;将目的物理地址替换为寻址转发地址,并将目的网络地址替换为后端服务器的网络地址,寻址转发地址是根据后端服务器的物理标识得到的,寻址转发地址用于透传客户端的网络地址;封装替换后的原始报文得到第一报文,并将第一报文发送给后端服务器所在的宿主机;接收宿主机根据寻址转发地址返回的第二报文;对第二报文进行封装,并将封装后的第二报文返回给客户端。通过上述技术方案,一方面,由于通过寻址转发地址转发报文至后端服务器所在的宿主机,使得后端服务器所在的宿主机对寻址转发地址进行识别,能够实现同源同宿;另一方面,不需要用户操作系统和应用做改造,负载均衡设备就能够支持直接透传客户端IP地址,能够减少对用户操作系统或应用的侵入,提高兼容性,为用户提供更好的使用体验。
Smart Images

Figure CN119814654B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a message forwarding method, apparatus, electronic device, and storage medium. Background Technology
[0002] In cloud networks, software-defined networking (SDN) software controls network functions more flexibly. To improve user experience, cloud load balancing typically requires the transparent transmission of client Internet Protocol (IP) addresses without network restrictions.
[0003] Common implementation methods include cloud load balancing inserting TCP option addresses (TOAs) into the user's Transmission Control Protocol (TCP) packets and modifying the user's operating system or application. However, this method is highly intrusive to the user's operating system or application.
[0004] Common implementation methods also include using reserved fields in the Virtual Extensible Local Area Network (VXLAN) protocol to identify that packets are sent from the cloud load balancer. However, this method requires customization of the standard VXLAN protocol and may have potential compatibility issues with other devices that process VXLAN packets. Summary of the Invention
[0005] This application provides a message forwarding method, apparatus, electronic device, and storage medium to solve the technical problem of significant intrusion into user operating systems or applications, or low compatibility.
[0006] In a first aspect, embodiments of this application provide a message forwarding method, the method being applied to a load balancing device, the method comprising:
[0007] Upon receiving the original message sent by the client, determine the destination physical address and destination network address of the original message, which is used to access the backend server;
[0008] The destination physical address is replaced with the addressing forwarding address, and the destination network address is replaced with the network address of the backend server. The addressing forwarding address is obtained based on the physical identifier of the backend server and is used to transparently transmit the network address of the client.
[0009] The original message after encapsulation and replacement is used to obtain the first message, and the first message is sent to the host machine where the backend server is located;
[0010] Receive the second message returned by the host machine according to the address forwarding address;
[0011] The second message is encapsulated, and the encapsulated second message is returned to the client.
[0012] Optionally, the physical identifier of the backend server includes a MAC identifier, and replacing the destination physical address with the addressing forwarding address includes:
[0013] The addressing and forwarding address is determined based on the mapping relationship between the MAC identifier and the addressing and forwarding address, wherein the MAC identifier is a user-visible MAC address;
[0014] Replace the destination physical address with the addressing and forwarding address.
[0015] Optionally, the step of encapsulating the second message and returning the encapsulated second message to the client includes:
[0016] The client's address information is determined based on the stored session information;
[0017] Match the second message with a five-tuple session and encapsulate it at Layer 2;
[0018] The encapsulated second message is returned to the client.
[0019] Optionally, the method further includes:
[0020] Based on the MAC identifiers of multiple virtual switches, addressing and forwarding addresses are assigned to the multiple virtual switches, thereby obtaining the mapping relationship between the MAC identifiers and the addressing and forwarding addresses;
[0021] The mapping relationship is sent to the host machine where the multiple virtual switches are located.
[0022] Secondly, embodiments of this application provide a message forwarding method, the method being applied to the host machine where the backend server resides, the method comprising:
[0023] Upon receiving the first message sent by the load balancer, obtain the addressing and forwarding address in the first message;
[0024] Based on the mapping relationship between the physical address and the addressing and forwarding address, the addressing and forwarding address in the first message is replaced with the physical address;
[0025] The first message is sent to the backend server corresponding to the physical address, and the second message returned by the backend server is received.
[0026] The second message is sent to the load balancing device according to the addressing and forwarding address.
[0027] Optionally, sending the second message to the load balancing device according to the addressing forwarding address includes:
[0028] The second message is processed through the connection tracking module of the virtual switch to extract the addressing and forwarding address and the underlying network address of the load balancer.
[0029] The second message is encapsulated and sent to the load balancer according to the addressing forwarding address and the underlying network address.
[0030] Thirdly, embodiments of this application provide a message forwarding device, which is applied to a load balancing device, and the device includes:
[0031] The first determining module is used to determine the destination physical address and destination network address of the original message sent by the client upon receiving the original message sent by the client, wherein the original message is used to access the backend server.
[0032] The first replacement module is used to replace the destination physical address with an addressing forwarding address and replace the destination network address with the network address of the backend server. The addressing forwarding address is obtained based on the physical identifier of the backend server and is used to transparently transmit the network address of the client.
[0033] The first sending module is used to encapsulate the replaced original message to obtain the first message, and send the first message to the host machine where the backend server is located;
[0034] The receiving module is used to receive the second message returned by the host machine according to the address forwarding address;
[0035] The first processing module is used to encapsulate the second message and return the encapsulated second message to the client.
[0036] Fourthly, embodiments of this application provide a message forwarding device applied to a host machine where a backend server resides, the device comprising:
[0037] The acquisition module is used to acquire the addressing and forwarding address in the first message when the first message sent by the load balancing device is received.
[0038] The second replacement module is used to replace the addressing and forwarding address in the first message with the physical address according to the mapping relationship between the physical address and the addressing and forwarding address;
[0039] The second processing module is used to send the first message to the backend server corresponding to the physical address, and to receive the second message returned by the backend server.
[0040] The second sending module is used to send the second message to the load balancing device according to the addressing forwarding address.
[0041] Fifthly, embodiments of this application provide an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the above-described message forwarding method when executing the program.
[0042] Sixthly, embodiments of this application provide a readable storage medium that, when the instructions in the readable storage medium are executed by the processor of an electronic device, enables the electronic device to perform the aforementioned message forwarding method.
[0043] In summary, in this embodiment, upon receiving the original packet sent by the client, the load balancing device determines the destination physical address and destination network address of the original packet accessing the backend server; it replaces the destination physical address with an addressing forwarding address and the destination network address with the network address of the backend server. The addressing forwarding address is obtained based on the physical identifier of the backend server and is used to transparently transmit the client's network address; it encapsulates the replaced original packet to obtain a first packet and sends the first packet to the host machine where the backend server resides; it receives a second packet returned by the host machine based on the addressing forwarding address; it encapsulates the second packet and returns the encapsulated second packet to the client. Through this technical solution, on the one hand, because the packet is forwarded to the host machine where the backend server resides via the addressing forwarding address, the host machine where the backend server resides can identify the addressing forwarding address, achieving same-origin and same-destination communication; on the other hand, without requiring modifications to the user's operating system and applications, the load balancing device can directly support transparent transmission of the client's IP address, reducing intrusion into the user's operating system or applications, improving compatibility, and providing a better user experience. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is an overall system architecture diagram of a message forwarding method provided in an embodiment of this application;
[0046] Figure 2 This is a flowchart illustrating the steps of a message forwarding method provided in an embodiment of this application;
[0047] Figure 3 This is a flowchart illustrating the specific steps of a message forwarding method provided in an embodiment of this application;
[0048] Figure 4 This is a flowchart of another message forwarding method provided in an embodiment of this application;
[0049] Figure 5 This is a schematic diagram of a message path provided in an embodiment of this application;
[0050] Figure 6 This is a structural diagram of a message forwarding device provided in an embodiment of this application;
[0051] Figure 7 This is a structural diagram of another message forwarding device provided in the embodiments of this application;
[0052] Figure 8 This is a structural diagram of an electronic device provided in an embodiment of this application;
[0053] Figure 9 This is a structural diagram of another electronic device provided in an embodiment of this application. Detailed Implementation
[0054] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0055] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0056] A Layer 4 load balancer is a network device typically placed at the user traffic ingress point to distribute access traffic across multiple service nodes, thereby achieving high availability and horizontal scaling of services. During traffic distribution, the Layer 4 load balancer performs address translation, changing the destination address from the Virtual IP Address (VIP) address on the Layer 4 load balancer to the IP address of the service node (Real Server). The source IP address is usually handled in two ways: one is to convert it to a specific IP address, and the other is to directly pass through the client's IP address. Directly passing through the client's IP address provides a better user experience, as user applications can directly obtain the client's real IP address, but this often requires specific network topology.
[0057] In traditional data center networks, backend Real Servers are typically required to point their default routes to a load balancer. The load balancer also functions as a gateway, handling all traffic from Real Servers. Even when Real Servers communicate directly with nodes in other subnets, the load balancer is still required to forward traffic, resulting in significant network limitations.
[0058] In cloud networks, since they are controlled by SDN software, network functions can be implemented more flexibly. To improve user experience, cloud load balancing usually needs to achieve transparent transmission of client IP addresses without network restrictions.
[0059] In some implementations, cloud load balancers insert TOA (Transmission Control Protocol) packets into the user's TCP packets and modify the user's operating system or application. By loading the TOA kernel module to parse the TOA, the user's business application can obtain the client's IP address. However, this method is highly intrusive to the user's operating system or application and is inconvenient to use.
[0060] In another implementation, cloud load balancers use reserved fields in the VXLAN protocol to identify that a packet originates from the cloud load balancer. The cloud virtual switch identifies and triggers the recording of the Underlay IP address that is sent back to the source, thereby sending the packet back to the load balancer. However, this method requires customization of the standard VXLAN protocol and may have potential compatibility issues with other devices that process VXLAN packets.
[0061] To address the aforementioned technical problems, embodiments of this application provide a message forwarding method, apparatus, electronic device, and storage medium. First, an application scenario related to an embodiment of this application will be described.
[0062] Figure 1This is an overall system architecture diagram of a message forwarding method provided in an embodiment of this application. See also... Figure 1 The message forwarding system includes a cloud network controller, a cloud load balancer controller, multiple cloud virtual switches located on host machines, and multiple cloud load balancer forwarding devices.
[0063] In this embodiment of the application, the cloud network controller is used to monitor and manage the configuration of network devices, and to determine how to configure virtual machines in the cloud according to the user's network needs.
[0064] In this embodiment, the cloud load balancer controller configures the cloud load balancing forwarding device based on load balancing service configuration information and information about work units on multiple clouds. Load balancing is the entry point for business traffic. However, load balancing on different clouds is often fragmented; that is, the load balancing service provided by cloud provider A cannot access work units (e.g., containers, virtual machines) deployed by cloud provider B. Therefore, if a business builds its application on different clouds, each cloud will provide a load balancing traffic entry point, and each load balancer can only distribute user requests to the work units on its own cloud. For multiple load balancing traffic entry points on different clouds, the business needs to use Domain Name System (DNS) for scheduling.
[0065] For example, the cloud load balancer controller is responsible for obtaining the addressing forwarding MAC address and the identification MAC address of the Real Server from the cloud network controller, as well as the mapping relationship between the two MAC addresses, and then sending the configuration to the cloud load balancer forwarding device.
[0066] In this embodiment, a host machine refers to a physical computer or server running virtualization software (such as VMware, VirtualBox, Docker, etc.). In a virtualization environment, the host machine is responsible for providing hardware resources (such as CPU, memory, disk, network, etc.) to the guest machine. The guest machine is a simulated computer running on the host machine; it has its own operating system and applications, but all operations are performed on the resources provided by the host machine. In the context of Docker, the host machine typically refers to a physical machine or virtual machine running the Docker daemon. Docker containers run on the host machine and are managed and scheduled by the Docker daemon. The Docker daemon on the host machine interacts with clients (such as command-line interfaces or Docker Compose), receives requests from clients, and creates, starts, stops, and manages Docker containers on the host machine. In short, a host machine is a computer that provides hardware resources and runs virtualization software or the Docker daemon in a virtualization or Docker environment.
[0067] For example, the cloud network controller is responsible for assigning an addressing forwarding MAC address to each Real Server virtual machine and sending the mapping relationship between the addressing forwarding MAC and the Real Server virtual machine identifier MAC to the virtual switch on the host machine where the Real Server virtual machine is located.
[0068] In this embodiment, a virtual switch (vSwitch) is a network switching device used in a virtualization environment. It simulates the function of a physical switch, enabling communication between virtual machines (VMs) and between VMs and the physical network. The vSwitch is a key component of the virtualization infrastructure, existing on the host system as a core component of the virtual network.
[0069] For example, a cloud virtual switch should include a connection tracking subsystem, which receives the mapping relationship between the addressing forwarding MAC and the Real Server virtual machine identifier MAC issued by the cloud network controller, and triggers the same-origin, same-destination mechanism when it receives a packet containing the addressing forwarding MAC. The connection tracking subsystem records the Underlay IP address of the cloud load balancer forwarding device and the corresponding addressing forwarding MAC address. When it receives a packet sent by the virtual machine, it matches the connection tracking subsystem, extracts the addressing forwarding MAC address and the Underlay IP address of the cloud load balancer forwarding device, and uses these addresses to encapsulate VXLAN packets for transmission.
[0070] In this embodiment of the application, the cloud load balancer forwarding device is deployed in the cloud network to improve the efficiency of cloud management.
[0071] For example, the cloud load balancer forwarding device is responsible for receiving configuration information such as the addressing forwarding MAC and identification MAC of the Real Server from the cloud load balancer controller. When sending a message to the Real Server, it uses the addressing forwarding MAC address for overlay layer 2 encapsulation. When receiving VXLAN messages sent by the cloud virtual switch, it matches the five-tuple session and sends the message back to the client.
[0072] Optionally, the load balancing forwarding method includes one or more combinations of the source Media Access Control Address (MAC) address, destination MAC address, source IP address, and destination IP address.
[0073] The message forwarding method provided in the embodiments of this application will be described in detail below.
[0074] Figure 2 This is a flowchart illustrating the steps of a message forwarding method provided in an embodiment of this application. See also... Figure 2 This message forwarding method is applied to Figure 1 In the cloud load balancing forwarding device shown, the packet forwarding method may include:
[0075] Step 101: Upon receiving the original message sent by the client, determine the destination physical address and destination network address of the original message.
[0076] In this embodiment of the application, the original message is used to access the backend server.
[0077] In one possible implementation, the destination physical address is the destination MAC address, and the destination network address is the destination IP address; the original packet may include the source MAC address, destination MAC address, source IP address, destination IP address, VLAN identifier, etc.
[0078] Step 102: Replace the destination physical address with the addressing forwarding address, and replace the destination network address with the network address of the backend server.
[0079] In this embodiment of the application, the addressing and forwarding address is obtained based on the physical identifier of the backend server, and the addressing and forwarding address is used to transparently transmit the network address of the client.
[0080] In one possible implementation, the backend server is a Real Server, and the addressing forwarding address is the addressing forwarding MAC address.
[0081] In this embodiment of the application, the physical identifier of the backend server can also be referred to as the "Identifier MAC".
[0082] It should be noted that each backend server or business node (Real Server) has a MAC address that is visible to the user. In step 102, the identification MAC address and the addressing forwarding MAC address are separated. The MAC address visible to the user is called the identification MAC address. Based on this identification MAC address, each backend Real Server is assigned another MAC address, which is the addressing forwarding MAC address.
[0083] Step 103: Encapsulate the replaced original message to obtain the first message, and send the first message to the host machine where the backend server is located.
[0084] In this embodiment of the application, the first message may be in VXLAN format.
[0085] In one possible implementation, step 103 may include: using the addressing forwarding address to perform overlay layer 2 encapsulation to obtain the first packet, and sending the first packet to the Real Server virtual machine through tunneling technology.
[0086] In this embodiment of the application, the host machine can be a cloud server or a physical server. The host machine provides hardware resources and infrastructure for RealServer and allows the creation and management of virtual machines on it.
[0087] Step 104: Receive the second message returned by the host machine based on the address forwarding address.
[0088] In this embodiment of the application, by identifying the addressing forwarding MAC on the cloud virtual switch, the connection tracking subsystem is triggered to record the source IP address of the Underlay layer, thereby achieving same source and same destination.
[0089] In some embodiments, when the host receives a first message sent by the load balancing device, it obtains the addressing forwarding address in the first message; replaces the addressing forwarding address in the first message with the physical address according to the mapping relationship between the physical address and the addressing forwarding address; sends the first message to the backend server corresponding to the physical address, and receives the second message returned by the backend server; and sends the second message to the load balancing device according to the addressing forwarding address.
[0090] Step 105: Encapsulate the second message and return the encapsulated second message to the client.
[0091] In one possible implementation, encapsulating the second message in step 105 may include: parsing the second message, finding the pre-saved session information, and encapsulating the message and sending it to the client based on the client information corresponding to the session information.
[0092] For example, before step 105, the above message forwarding method may further include: reading the second message and recording the tunnel endpoint network address, tunnel endpoint network identifier, destination network address, source network address, network protocol type, destination port, source port, and source MAC address of the second message in the session record table.
[0093] In summary, in this embodiment, on the one hand, since the packets are forwarded to the host machine where the backend server is located by addressing the forwarding address, the host machine where the backend server is located can identify the addressing the forwarding address, thus achieving same origin and same destination; on the other hand, without requiring modifications to the user's operating system and applications, the load balancing device can support direct transparent transmission of the client's IP address, which can reduce the intrusion into the user's operating system or applications, improve compatibility, and provide users with a better user experience.
[0094] Figure 3 This is a flowchart illustrating the specific steps of a message forwarding method provided in an embodiment of this application. See also... Figure 3 This message forwarding method is applied to Figure 1 In the cloud load balancing forwarding device shown, the packet forwarding method may include:
[0095] Step 201: Upon receiving the original message sent by the client, determine the destination physical address and destination network address of the original message.
[0096] The method for this step has been explained in step 101 above, and will not be repeated here.
[0097] Step 202: Determine the addressing and forwarding address based on the mapping relationship between the MAC identifier and the addressing and forwarding address.
[0098] The MAC identifier is the MAC address that is visible to the user.
[0099] In some embodiments, the above message forwarding method further includes:
[0100] Sub-step A1: Assign addressing and forwarding addresses to multiple virtual switches based on their MAC identifiers, thereby obtaining the mapping relationship between MAC identifiers and addressing and forwarding addresses;
[0101] Sub-step A2: Send the mapping relationship to the host machines where multiple virtual switches are located.
[0102] Step 203: Replace the destination physical address with the addressing forwarding address.
[0103] The method for this step has been explained in step 102 above, and will not be repeated here.
[0104] Step 204: Replace the destination network address with the network address of the backend server.
[0105] The method for this step has been explained in step 102 above, and will not be repeated here.
[0106] Step 205: Encapsulate the replaced original message to obtain the first message, and send the first message to the host machine where the backend server is located.
[0107] In the embodiments of this application,
[0108] The method for this step has been explained in step 103 above, and will not be repeated here.
[0109] Step 206: Receive the second message returned by the host machine based on the address forwarding address.
[0110] In the embodiments of this application,
[0111] The method for this step has been explained in step 104 above, and will not be repeated here.
[0112] Step 207: Encapsulate the second message and return the encapsulated second message to the client.
[0113] The method for this step has been explained in step 105 above, and will not be repeated here.
[0114] In some embodiments, step 207 includes:
[0115] Sub-step 2071: Determine the client's address information based on the stored session information;
[0116] Sub-step 2072: Match the second message with the five-tuple session and perform layer 2 encapsulation;
[0117] Sub-step 2073: Return the encapsulated second message to the client.
[0118] In summary, in this embodiment of the application, in the cloud network, regardless of whether the cloud load balancer, the client, and the RealServer are located in the same subnet, and regardless of whether the traffic is north-south or east-west, the user's operating system and application do not need to be modified. The cloud load balancer can support the direct transmission of the client's IP address, providing users with a better user experience.
[0119] Figure 4 This is a flowchart of another message forwarding method provided in an embodiment of this application. See also... Figure 4 This message forwarding method is applied to Figure 1 In the host machines where the multiple cloud virtual switches shown reside, the packet forwarding method may include:
[0120] Step 301: Upon receiving the first message sent by the load balancing device, obtain the addressing and forwarding address in the first message.
[0121] In this embodiment of the application, the addressing and forwarding address is assigned by the load balancing device to different backend servers.
[0122] Step 302: Based on the mapping relationship between physical address and addressing forwarding address, replace the addressing forwarding address in the first message with the physical address.
[0123] In some embodiments, the above message forwarding method further includes:
[0124] The mapping relationship between the physical address sent by the load balancer and the address forwarding address.
[0125] Step 303: Send the first message to the backend server corresponding to the physical address, and receive the second message returned by the backend server.
[0126] Step 304: Send the second message to the load balancer according to the address forwarding address.
[0127] In some embodiments, step 304 may include:
[0128] Sub-step 3041: Pass the second message through the connection tracking module of the virtual switch to extract the addressing forwarding address and the underlying network address of the load balancer;
[0129] Sub-step 3042: Encapsulate the second message and send it to the load balancer according to the addressing forwarding address and the underlying network address.
[0130] In this embodiment, the connection tracking module is used to track or maintain network connections and their status.
[0131] Through the above technical solution, during the bidirectional communication process, the corresponding message is identified by addressing and forwarding the MAC address. The connection tracking module of the virtual switch needs to record the connection information and message return path, that is, the same source and same destination at the session level.
[0132] In summary, in this embodiment, the identification MAC and the addressing forwarding MAC are separated. Users can only see the identification MAC, while the addressing forwarding MAC is used for packet forwarding encapsulation. In addition to the identification MAC, an addressing forwarding MAC is assigned to the Real Server to achieve transparent transmission of cloud load balancing client IP addresses. By identifying the addressing forwarding MAC on the cloud virtual switch, the connection tracking subsystem is triggered to record the Underlay layer source IP address, thereby achieving same-source, same-destination connectivity.
[0133] Figure 5 This is a schematic diagram of a message path provided in an embodiment of this application. See also... Figure 5 As shown, after receiving a client message, the load balancer encapsulates a VXLAN message and sends it to the host machine where the backend Real Server resides. After receiving the VXLAN message, the host machine where the backend Real Server resides sends the message to the virtual machine of the backend Real Server. The reply message from the virtual machine of the backend Real Server is sent to the message load balancer after passing through the connection tracking module of the virtual switch. After receiving the message, the load balancer encapsulates the message and sends it to the client.
[0134] Using the above technical solution, the user is completely unaware of the changes, and there is no modification to the VXLAN message format, thus the implementation cost is relatively low.
[0135] Figure 6This is a schematic diagram of a packet forwarding device provided in an embodiment of this application, used in a load balancing device. The packet forwarding device 600 may include:
[0136] The first determining module 601 is used to determine the destination physical address and destination network address of the original message when it receives the original message sent by the client. The original message is used to access the backend server.
[0137] The first replacement module 602 is used to replace the destination physical address with the addressing forwarding address and the destination network address with the network address of the backend server. The addressing forwarding address is obtained based on the physical identifier of the backend server and is used to pass through the network address of the client.
[0138] The first sending module 603 is used to encapsulate the replaced original message to obtain the first message, and send the first message to the host machine where the backend server is located;
[0139] Receiver module 604 is used to receive the second message returned by the host machine according to the address forwarding address;
[0140] The first processing module 605 is used to encapsulate the second message and return the encapsulated second message to the client.
[0141] Optionally, the first replacement module 602 includes:
[0142] The first determination submodule is used to determine the addressing and forwarding address based on the mapping relationship between the MAC identifier and the addressing and forwarding address. The MAC identifier is a user-visible MAC address.
[0143] The Replace submodule is used to replace the destination physical address with the addressing forwarding address.
[0144] Optionally, the first processing module 605 includes:
[0145] The second determination submodule is used to determine the client's address information based on the stored session information;
[0146] The processing submodule is used to match the second message with the five-tuple session and perform layer 2 encapsulation;
[0147] The first sending submodule is used to return the encapsulated second message to the client.
[0148] Optionally, the message forwarding device 600 further includes:
[0149] The address allocation module is used to allocate addressing and forwarding addresses to multiple virtual switches based on their MAC identifiers, thereby obtaining the mapping relationship between MAC identifiers and addressing and forwarding addresses.
[0150] The mapping relationship sending module is used to send mapping relationships to the host machines where multiple virtual switches reside.
[0151] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0152] Figure 7 This is a schematic diagram of a packet forwarding device provided in an embodiment of this application, applied to the host machine where the backend server is located. The packet forwarding device 700 may include:
[0153] The acquisition module 701 is used to acquire the addressing and forwarding address in the first message when it receives the first message sent by the load balancing device.
[0154] The second replacement module 702 is used to replace the addressing forwarding address in the first message with the physical address according to the mapping relationship between the physical address and the addressing forwarding address;
[0155] The second processing module 703 is used to send the first message to the backend server corresponding to the physical address and receive the second message returned by the backend server.
[0156] The second sending module 704 is used to send the second message to the load balancing device according to the address forwarding address.
[0157] Optionally, the second transmitting module 704 includes:
[0158] The address extraction submodule is used to extract the addressing and forwarding address and the underlying network address of the load balancer from the connection tracking module of the virtual switch after the second packet passes through the virtual switch.
[0159] The second sending submodule is used to encapsulate the second message and send it to the load balancing device according to the addressing forwarding address and the underlying network address.
[0160] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0161] See Figure 7 The electronic device 400 may include one or more of the following components: processing component 402, memory 404, power supply component 406, multimedia component 408, audio component 410, input / output (I / O) interface 412, sensor component 414, and communication component 416.
[0162] Processing component 402 typically controls the overall operation of electronic device 400, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 402 may include one or more processors 420 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 402 may include one or more modules to facilitate interaction between processing component 402 and other components. For example, processing component 402 may include a multimedia module to facilitate interaction between multimedia component 408 and processing component 402.
[0163] Memory 404 is used to store various types of data to support the operation of electronic device 400. Examples of such data include instructions for any application or method operating on electronic device 400, contact data, phonebook data, messages, pictures, multimedia, etc. Memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0164] Power supply component 406 provides power to various components of electronic device 400. Power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 400.
[0165] Multimedia component 408 includes an interface that provides an output interface between electronic device 400 and a user. In some embodiments, the interface may include a liquid crystal display (LCD) and a touch panel (TP). If the interface includes a touch panel, the interface may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 408 includes a front-facing camera and / or a rear-facing camera. When electronic device 400 is in an operating mode, such as a shooting mode or a multimedia mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0166] Audio component 410 is used to output and / or input audio signals. For example, audio component 410 includes a microphone (MIC) used to receive external audio signals when electronic device 400 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 404 or transmitted via communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
[0167] Input / output (I / O) interface 412 provides an interface between processing component 402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0168] Sensor assembly 414 includes one or more sensors for providing state assessments of various aspects of electronic device 400. For example, sensor assembly 414 may detect the on / off state of electronic device 400, the relative positioning of components such as the display and keypad of electronic device 400, changes in position of electronic device 400 or a component of electronic device 400, the presence or absence of user contact with electronic device 400, orientation or acceleration / deceleration of electronic device 400, and temperature changes of electronic device 400. Sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 414 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0169] Communication component 416 facilitates wired or wireless communication between electronic device 400 and other devices. Electronic device 400 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 5G), or combinations thereof. In one exemplary embodiment, communication component 416 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 416 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0170] In an exemplary embodiment, the electronic device 400 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to implement a vehicle-road cooperative scenario demonstration method provided in this application embodiment.
[0171] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, which can be executed by a processor 420 of an electronic device 400 to perform the above-described method. For example, the non-transitory storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0172] Figure 8 This is a block diagram of an electronic device 500 according to another embodiment of the present invention. For example, the electronic device 500 may be provided as a server. See also Figure 8 The electronic device 500 includes a processing component 522, which further includes one or more processors, and memory resources represented by a memory 532 for storing instructions, such as applications, that can be executed by the processing component 522. The applications stored in the memory 532 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 522 is configured to execute instructions to perform a demonstration method for a vehicle-to-everything (V2X) scenario provided in this application embodiment.
[0173] Electronic device 500 may also include a power supply component 526 configured to perform power management of electronic device 500, a wired or wireless network interface 550 configured to connect electronic device 500 to a network, and an input / output (I / O) interface 558. Electronic device 500 may operate on an operating system stored in memory 532, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0174] In embodiments of this application, memory 632 can be used to store software programs and various data. Memory 632 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, applications or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, memory 632 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 632 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0175] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly handles operations related to the operating system, user interface, and applications, while the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into the processor.
[0176] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described super-resolution reconstruction method for images and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0177] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0178] This application also provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the super-resolution reconstruction method embodiment of the image described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0179] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0180] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A message forwarding method, the method comprising: Upon receiving a raw message sent by a client, the load balancing device determines the destination physical address and destination network address of the raw message, which is used to access the backend server. The load balancing device replaces the destination physical address with the addressing forwarding address and replaces the destination network address with the network address of the backend server. The addressing forwarding address is obtained based on the physical identifier of the backend server and is used to transparently transmit the network address of the client. The load balancing device encapsulates and replaces the original message to obtain the first message, and sends the first message to the host machine where the backend server is located; Upon receiving the first message from the load balancer, the host machine obtains the addressing and forwarding address from the first message. The host machine replaces the addressing and forwarding address in the first packet with the physical address based on the mapping relationship between the physical address and the addressing and forwarding address; The host machine sends the first message to the backend server corresponding to the physical address and receives the second message returned by the backend server; The host machine sends the second packet to the load balancing device according to the addressing and forwarding address; The load balancing device receives the second message returned by the host machine according to the address forwarding address; The load balancing device encapsulates the second message and returns the encapsulated second message to the client.
2. The method according to claim 1, characterized in that, The physical identifier of the backend server includes a MAC identifier, and the load balancing device replaces the destination physical address with an addressing forwarding address, including: The addressing and forwarding address is determined based on the mapping relationship between the MAC identifier and the addressing and forwarding address, wherein the MAC identifier is a user-visible MAC address; Replace the destination physical address with the addressing and forwarding address.
3. The method according to claim 1, characterized in that, The load balancing device encapsulates the second packet and returns the encapsulated second packet to the client, including: The client's address information is determined based on the stored session information; Match the second message with a five-tuple session and encapsulate it at Layer 2; The encapsulated second message is returned to the client.
4. The method according to claim 1, characterized in that, The method further includes: The load balancing device assigns addressing and forwarding addresses to the multiple virtual switches based on their MAC identifiers, thereby obtaining a mapping relationship between the MAC identifiers and the addressing and forwarding addresses. The load balancing device sends the mapping relationship to the host machine where the multiple virtual switches are located.
5. The method according to claim 1, characterized in that, The host machine sends the second packet to the load balancing device according to the addressing forwarding address, including: The second message is processed through the connection tracking module of the virtual switch to extract the addressing and forwarding address and the underlying network address of the load balancer. The second message is encapsulated and sent to the load balancer according to the addressing forwarding address and the underlying network address.
6. A message forwarding system, comprising a device for a load balancing device and a device for a host machine where a backend server resides, characterized in that, The device applied to the load balancing equipment includes: The first determining module is used to determine the destination physical address and destination network address of the original message sent by the client upon receiving the original message sent by the client, wherein the original message is used to access the backend server. The first replacement module is used to replace the destination physical address with an addressing forwarding address and replace the destination network address with the network address of the backend server. The addressing forwarding address is obtained based on the physical identifier of the backend server and is used to transparently transmit the network address of the client. The first sending module is used to encapsulate the replaced original message to obtain the first message, and send the first message to the host machine where the backend server is located; The receiving module is used to receive the second message returned by the host machine according to the address forwarding address; The first processing module is used to encapsulate the second message and return the encapsulated second message to the client; The device applied to the host machine where the backend server resides includes: The acquisition module is used to acquire the addressing and forwarding address in the first message when the first message sent by the load balancing device is received. The second replacement module is used to replace the addressing and forwarding address in the first message with the physical address according to the mapping relationship between the physical address and the addressing and forwarding address; The second processing module is used to send the first message to the backend server corresponding to the physical address, and to receive the second message returned by the backend server. The second sending module is used to send the second message to the load balancing device according to the addressing forwarding address.
7. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method as described in any one of claims 1 to 5.
8. A readable storage medium, characterized in that, When the instructions in the readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Data transmission method and system
CN102946351A
Load balancing method and load balancing system in cloud computing environment
CN104780115A
Traffic forwarding method and device, and storage medium
CN118714087A