Message processing system, method, machine-readable storage medium, and program product
By using programmable forwarding devices and programmable network cards in the network, some gateway functions are offloaded to these devices for processing, solving the problems of insufficient processor traffic processing performance and storage resource limitations, and achieving efficient reporting Improved performance of text stream processing and gateway clusters.
Patent Information
- Application Number
- CN202010526837.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-02-20
- Filing Date
- 2020-06-11
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2040-06-11
AI Technical Summary
When processing packets in the network, the processor's traffic processing performance is weak, which affects the performance of the gateway cluster. The storage resources of the dedicated forwarding equipment are small, making it difficult to adapt to the development of network bandwidth.
Adopting a three-layer gateway flow table entry offload scheme of programmable forwarding devices, programmable network cards and processors, some gateway message flows running on the processor are offloaded to the programmable forwarding devices and programmable network cards for processing, and by statistically stating traffic rankings Stagely unload large traffic to excellent equipment, realizing centralized control and uninstallation of flow tables.
It improves the processing efficiency of message flow, improves the performance of gateway clusters, adapts to network bandwidth development, and optimizes the storage resource utilization and traffic scheduling capabilities of the equipment.
Smart Images

Figure CN113285892B_ABST
Abstract
Description
[0001] Related Applications Citations
[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 20, 2020, with application number 202010104496.2 and invention name “A message flow processing method and device”, the entire contents of which are incorporated into this application by reference. Technical Field
[0003] The present disclosure generally relates to the field of network technology, and more particularly to a message processing system, method, machine-readable storage medium, and program product. Background Art
[0004] A packet is a data packet exchanged or transmitted in a network, which usually includes a header part and a data part. A packet flow refers to a continuous packet passing through a network node within a period of time. For example, each packet may include a five-tuple of information, where the five-tuple includes a source Internet Protocol (IP) address, a destination IP address, a source port, a destination port, and a transport layer protocol. The five-tuple can be used as an identifier to distinguish different sessions.
[0005] A gateway is a network gateway that allows networks with different architectures or protocols to communicate with each other. It provides network compatibility functions, such as protocol conversion, routing, data exchange, etc., to achieve communication between different networks. For example, in a cloud computing platform, in order to provide tenants with different cloud network services, cloud service providers will provide different types of virtual gateway server clusters in the cloud computing infrastructure to provide different virtual network services, such as network address translation (NAT) gateways, stateful firewalls, load balancers, dedicated line gateways, and so on. Summary of the invention
[0006] According to some embodiments of the present disclosure, a message processing system, method, machine-readable storage medium, and program product are provided.
[0007] In a first aspect of the present disclosure, a message processing system is provided. The system includes: a programmable forwarding device and a computing device, the computing device includes a programmable network card, a processor and a memory, and the processor executes instructions in the memory to run a gateway. The programmable forwarding device is configured to receive a message, determine whether there is a flow table entry matching the message in a flow table accessible to the programmable forwarding device, and if not, send the message to the programmable network card. The programmable network card is configured to receive a message, determine whether there is a flow table entry matching the message in a flow table accessible to the programmable network card, and if not, send the message to the processor. The processor is configured to run the gateway to receive the message and process the message according to the flow table entry in the flow table accessible to the gateway. According to the message processing system of the first aspect of the present disclosure, at least a portion of the message flow at the gateway running on the processor can be offloaded to the programmable forwarding device and the programmable network card for processing, thereby improving the processing efficiency of the message flow.
[0008] In some embodiments, the flow table accessible to the programmable network card includes flow table items unloaded from the flow table accessible to the gateway, and the flow table accessible to the programmable forwarding device includes flow table items unloaded from the flow table accessible to the programmable network card. In this way, the programmable forwarding device and the programmable network card can directly process the message using the unloaded flow table items, thereby improving the message processing efficiency.
[0009] In some embodiments, the processor is configured to: collect statistics on the message flows processed by the gateway within a unit time period; and determine the traffic ranking of the sessions involved in the message flows based on the statistics. By collecting statistics on the traffic ranking of each session, the most suitable traffic can be selected for offloading to the programmable forwarding device and the programmable network card.
[0010] In some embodiments, the message processing system also includes a controller, and the processor is further configured to send first session information of a first number of sessions in the traffic ranking to the controller; the controller is configured to receive the first session information and send a first group of flow tables related to the first session information to the programmable network card. The programmable network card is also configured to: count the second message flow processed by the programmable network card within a unit time period; determine the second traffic ranking of the session involved in the second message flow based on the statistics; and send the second session information of the second number of sessions in the second traffic ranking to the controller. The controller is also configured to receive the second session information and send a second group of flow table entries related to the second session information to the programmable forwarding device. Through this staged unloading method, large traffic can be unloaded to the programmable forwarding device with the best traffic processing performance, and medium traffic can be unloaded to the programmable network card with better traffic processing performance, thereby further improving the processing efficiency of the message flow. In addition, by deploying a controller, centralized control of flow table unloading can be achieved.
[0011] In some embodiments, the message processing system further includes a controller, and the controller is configured to: receive session information related to multiple sessions in the traffic ranking from the processor; determine a first group of sessions and a second group of sessions according to the session information, wherein the traffic of the sessions in the first group of sessions is greater than the traffic of the sessions in the second group of sessions; send flow table entries related to the first group of sessions to the programmable forwarding device; and send flow table entries related to the second group of sessions to the programmable network card. Through this joint unloading method, large traffic can be unloaded to the programmable forwarding device and programmable network card with better traffic processing performance, thereby further improving the processing efficiency of the message flow.
[0012] In some embodiments, the processor is configured to: send flow table items related to multiple sessions in the traffic ranking to the programmable network card; or send flow table items related to a first group of sessions in the multiple sessions to the programmable switch, and send flow table items related to a second group of sessions in the multiple sessions to the programmable network card, and the traffic of the sessions in the first group of sessions is greater than the traffic of the sessions in the second group of sessions. In this way, large traffic can be offloaded to programmable forwarding devices and programmable network cards with better traffic processing performance, thereby further improving the processing efficiency of message flows.
[0013] In some embodiments, the message processing system further includes a controller, and the programmable forwarding device or programmable network card is further configured to: identify a session interruption message including an interruption flag, and send the session interruption message to the controller or processor; and the controller or processor is configured to: send an instruction for deleting a flow entry to the programmable forwarding device or the programmable network card when determining that the session is terminated according to the session interruption message. By clearing the gateway flow entry related to the terminated session, the storage space in the programmable forwarding device and / or the smart network card can be released, which helps to add new gateway flow entries, thereby improving the processing efficiency of the message flow.
[0014] In some embodiments, the message processing system further includes a controller, and the controller or processor is configured to do at least one of the following: when no session heartbeat message is received from the programmable forwarding device for a period exceeding a threshold time period, send an instruction to the programmable forwarding device for deleting the flow entry; and when no session heartbeat message is received from the programmable network card for a period exceeding a threshold time period, send an instruction to the programmable network card for deleting the flow entry. By clearing the gateway flow entry related to the session that may have ended, the storage space in the programmable forwarding device and / or the smart network card can be released, which helps to add new gateway flow entries, thereby improving the processing efficiency of the message flow.
[0015] In some embodiments, the message processing system further includes a controller, and the programmable forwarding device is further configured to send the message to the controller when there is no flow table entry matching the message in the flow table accessible to the programmable forwarding device, and determine that the message is to be forwarded to the computing device according to the forwarding table entry received from the controller. The controller is further configured to send the forwarding table entry to the programmable forwarding device. Since the controller has a stronger traffic scheduling capability, it can forward the message to the most suitable computing device.
[0016] In some embodiments, the programmable forwarding device is arranged in a cabinet and connected to multiple computing devices in the cabinet, and the controller is deployed on one of the multiple computing devices. By deploying the controller in the computing device, the scheduling capability of the controller can be guaranteed, thereby facilitating traffic scheduling in the system.
[0017] In some embodiments, the controller is deployed on the operating system of the programmable forwarding device and controls the programmable switching chip in the programmable forwarding device through an interface. In this way, the processor of the programmable forwarding device can be used to implement the functions of the controller, which improves the flexibility of controller deployment and simplifies the network architecture.
[0018] In some embodiments, the controller generates a consistent hash flow table for consistent hash scheduling; and the controller sends the consistent hash flow table to the programmable forwarding device. In this way, the programmable forwarding device can implement complex scheduling functions.
[0019] In some embodiments, the programmable forwarding device is a programmable switch having a programmable parser, a programmable match-action table, and a programmable inverse parser, the computing device is a server, and the programmable network card is an intelligent network card having communication protocol processing capabilities. Therefore, according to the gateway flow table entry unloading solution of the embodiment of the present disclosure, a part of the message flow at the gateway running on the processor can be unloaded to the programmable switch and the intelligent network card for processing, thereby improving the processing efficiency of the message flow.
[0020] In a second aspect of the present disclosure, a message processing system is provided. The system includes a programmable forwarding device and a computing device, the computing device includes a programmable network card, a processor and a memory, and the processor executes instructions in the memory to run a gateway. The programmable forwarding device is configured to receive a first message and process the first message according to a flow table entry that matches the first message in a flow table accessible to the programmable forwarding device. The programmable network card is configured to receive a second message and process the second message according to a flow table entry that matches the second message in a flow table accessible to the programmable network card. The processor is configured to run the gateway, receive a third message, and process the third message according to a flow table entry that matches the third message in a flow table accessible to the gateway. The flow table accessible to the programmable network card includes flow table entries unloaded from the flow table accessible to the gateway, and the flow table accessible to the programmable forwarding device includes flow table entries unloaded from the flow table accessible to the gateway. The flow table accessible to the programmable forwarding device may include flow table items directly unloaded from the flow table accessible to the gateway, or may include flow table items indirectly unloaded from the flow table accessible to the gateway, for example, the programmable network card may first unload the flow table items from the gateway, and the programmable forwarding device then unloads the flow table items from the programmable network card. According to the second aspect of the present disclosure, the message processing system can unload at least a portion of the message flow at the gateway running on the processor to the programmable forwarding device and the programmable network card for processing, thereby improving the processing efficiency of the message flow.
[0021] In some embodiments, the processor is configured to: collect statistics on the message flows processed by the gateway within a unit time period; and determine the traffic ranking of the sessions involved in the message flows based on the statistics. By collecting statistics on the traffic ranking of each session, the most suitable traffic can be selected for offloading to the programmable forwarding device and the programmable network card.
[0022] In some embodiments, the message processing system further includes a controller, and the processor is further configured to send first session information of a first number of sessions in the traffic ranking to the controller; the controller is configured to receive the first session information and send a first group of flow table items related to the first session information to the programmable network card. The programmable network card is also configured to: perform statistics on the second message flow processed by the programmable network card within a unit time period; determine the second traffic ranking of the session involved in the second message flow based on the statistics; and send the second session information of the second number of sessions in the second traffic ranking to the controller. The controller is also configured to receive the second session information and send a second group of flow table items related to the second session information to the programmable forwarding device. Through this staged unloading method, large traffic can be unloaded to the programmable forwarding device with the best traffic processing performance, and medium traffic can be unloaded to the programmable network card with better traffic processing performance, thereby further improving the processing efficiency of the message flow. In addition, by deploying a controller, centralized control of flow table unloading can be achieved.
[0023] In some embodiments, the message processing system further includes a controller, and the controller is configured to: receive session information related to multiple sessions in the traffic ranking from the processor; determine a first group of sessions and a second group of sessions according to the session information, wherein the traffic of the sessions in the first group of sessions is greater than the traffic of the sessions in the second group of sessions; send flow table entries related to the first group of sessions to the programmable forwarding device; and send flow table entries related to the second group of sessions to the programmable network card. Through this joint unloading method, large traffic can be unloaded to the programmable forwarding device and programmable network card with better traffic processing performance, thereby further improving the processing efficiency of the message flow.
[0024] In some embodiments, the processor is further configured to: send flow table items related to multiple sessions in the traffic ranking to the programmable network card; or send flow table items related to a first group of sessions in the multiple sessions to the programmable switch, and send flow table items related to a second group of sessions in the multiple sessions to the programmable network card, and the traffic of the sessions in the first group of sessions is greater than the traffic of the sessions in the second group of sessions. In this way, large traffic can be offloaded to programmable forwarding devices and programmable network cards with better traffic processing performance, thereby further improving the processing efficiency of message flows.
[0025] In the fourth aspect of the present disclosure, a message processing method is provided. The method includes: a programmable forwarding device receives a message, determines whether there is a flow table entry matching the message in a flow table accessible to the programmable forwarding device, and if not, sends the message to a programmable network card in a computing device; a programmable network card receives a message, determines whether there is a flow table entry matching the message in a flow table accessible to the programmable network card, and if not, sends the message to a processor in the computing device; and a gateway running on the processor receives the message and processes the message according to the flow table entry in the flow table accessible to the gateway. According to the message processing method of the third aspect of the present disclosure, at least a portion of the message flow at the gateway running on the processor can be offloaded to the programmable forwarding device and the programmable network card for processing, thereby improving the processing efficiency of the message flow.
[0026] In a fourth aspect of the present disclosure, one or more machine-readable storage media are provided, on which a first instruction set for execution by a programmable forwarding device, a second instruction set for execution by a programmable network card, and a third instruction set for execution by a processor are stored, wherein the first instruction set, the second instruction set, and the third instruction set, when executed, cause a system including a programmable forwarding device, a programmable network card, and a processor to execute a method provided according to the aforementioned third aspect or its possible variations. In some embodiments, the machine-readable storage medium may be non-transitory. The machine-readable storage medium includes, but is not limited to, volatile memory (e.g., random access memory), non-volatile memory (e.g., flash memory, hard disk drive (HDD), solid state drive (SSD), etc.).
[0027] In a fifth aspect of the present disclosure, a program product is provided, which includes a first instruction set for execution by a programmable forwarding device, a second instruction set for execution by a programmable network card, and a third instruction set for execution by a processor, wherein the first instruction set, the second instruction set, and the third instruction set, when executed, enable a system including a programmable forwarding device, a programmable network card, and a processor to perform a method provided according to the aforementioned third aspect or its possible variations. In some embodiments, the program product may include multiple software installation packages, and when the method provided by the aforementioned third aspect or its possible variations needs to be used, the software installation packages may be downloaded and executed on the programmable forwarding device, the programmable network card, and the processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The features, advantages and other aspects of the various implementations of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Several implementations of the present disclosure are shown here in an exemplary and non-limiting manner. In the accompanying drawings:
[0029] Figure 1 An example network architecture of a data center according to an embodiment of the present disclosure is shown;
[0030] Figure 2A An example architecture diagram of a message processing system according to an embodiment of the present disclosure is shown;
[0031] Figure 2B A schematic diagram showing the deployment of a gateway flow table according to an embodiment of the present disclosure is shown;
[0032] Figure 3 A flowchart of a message processing method according to an embodiment of the present disclosure is shown;
[0033] Figure 4 A schematic diagram showing an example structure of a smart network card according to an embodiment of the present disclosure;
[0034] Figure 5A-5B A schematic diagram showing an example structure of a programmable switch and a programmable switching chip thereof according to an embodiment of the present disclosure;
[0035] Figures 6A-6D A schematic diagram of gateway flow entry unloading according to an embodiment of the present disclosure is shown;
[0036] Figures 7A-7C A schematic diagram showing gateway flow entry clearing according to an embodiment of the present disclosure is shown;
[0037] Figures 8A-8B A schematic diagram showing the deployment of a controller in a message processing system according to an embodiment of the present disclosure;
[0038] Fig. 9 A schematic diagram for implementing consistent hashing according to an embodiment of the present disclosure is shown; and
[0039] Fig.10 A schematic diagram showing flow stratification processing at different flow rates according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0040] The preferred implementation of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although example embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0041] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based at least in part on". The terms "embodiment" and "some embodiments" both mean "at least some embodiments". Other explicit and implicit definitions may also be included below.
[0042] Typically, a gateway running on a processor in a computing device (such as a server) can be used to process packets. The processor has flexible programmability and a large amount of storage resources. However, the processor is relatively weak in terms of traffic processing performance, such as low throughput and long processing latency, which affects the performance of the gateway and becomes a bottleneck for the performance of the gateway cluster. Although the emergence of some tools (such as the Data Plane Development Kit (DPDK)) has improved the traffic processing performance (such as throughput) of the processor to a certain extent, compared with dedicated forwarding devices (such as switches), the processor still lags far behind in terms of traffic processing performance.
[0043] In order to improve the traffic processing performance of the gateway, a possible improvement is to offload part of the gateway's functions to a programmable network card (such as a smart network card). Since the smart network card is a dedicated traffic processing hardware device, it has higher traffic processing performance than the gateway implemented by the processor through software. However, the traffic processing performance of the smart network card is not high enough and it is difficult to adapt to the development of network bandwidth. To this end, the embodiments of the present disclosure propose a three-layer gateway flow table unloading scheme of a programmable forwarding device, a programmable network card, and a processor, which can offload at least a part of the message flow at the gateway running on the processor to the programmable forwarding device and the programmable network card for processing, thereby improving the processing efficiency of the message flow and improving the performance of the gateway cluster.
[0044] The inventors have found that dedicated forwarding devices (such as switches, etc.) have characteristics such as high throughput and low latency, and have multi-point coordination capabilities, but their storage resources are relatively small. The programmable network card has certain communication protocol processing performance and flexible programmability, and has relatively large storage resources, but can only perform single-point unloading and lacks multi-point coordination capabilities. Although the processor has poor traffic processing performance, it has flexible programmability and a large amount of storage resources. Therefore, the embodiments of the present disclosure propose a message processing architecture that reasonably utilizes the characteristics and strengths of different devices, which can realize layered unloading and processing of message flows, thereby more efficiently realizing the gateway function. The following will refer to the attached Figure 1-10 Some example embodiments of the present disclosure are described.
[0045] Figure 1 FIG. 1 shows an example network architecture of a data center 100 according to an embodiment of the present disclosure. Figure 1 As shown, the data center 100 may use a two-layer flat network architecture (e.g., a Spine-Leaf network architecture), which includes switches 110-1 and 110-2 (individually or collectively referred to as switches 110) as Spine switches, and access switches 120-1, 120-2, 120-3, and 120-4 (individually or collectively referred to as access switches 120) as Leaf switches. Figure 1 In the network architecture, there is a three-layer network above the Leaf switch, and an independent two-layer broadcast domain below the Leaf switch. The number of downlink ports on the Spine switch can determine the number of Leaf switches, and the number of uplink ports on the Leaf switch can determine the number of Spine switches. The Spine-Leaf network has the advantages of high reliability, high performance, and scalability. Each access switch 120 can be used to connect one or more computing devices (such as servers). Figure 1As shown, access switch 120-1 accesses server cluster 130-1, access switch 120-2 accesses server cluster 130-2, access switch 120-3 accesses server cluster 130-3, and access switch 120-4 accesses server cluster 130-4.
[0046] In some embodiments, the server cluster 130-1 can be a server cabinet, and one or more access switches 120 can be deployed on a server cabinet, and each server in the server cabinet can be directly connected to the access switch of the cabinet to realize the interconnection between the server and the access switch in the cabinet. Optionally, the access switch 120 can be the top of the server cabinet, and thus can also be called a top-of-rack switch (ToR). Alternatively, the access switch 120 can also be located in the middle or bottom of the server cabinet. The architecture of the ToR switch simplifies the connection from the server in the server cabinet to the access switch, reducing the complexity of the network architecture. It should be understood that although the server cabinet is used as an example of the server cluster 130-1, the server cluster 130-1 can also be provided in other forms. In addition, the access switch can also be other switches other than the ToR switch.
[0047] exist Figure 1 In the example network architecture, the communication between any two access switches 120 can be achieved through a spine switch 110, so the network latency between the access switches 120 can be controlled. In addition, the access switches 120 and the switches 110 are fully cross-connected, so the failure of a single switch in any layer will not affect the entire network architecture, so the reliability of this network architecture is high. It should be understood that although Figure 1 What is shown is a two-layer network architecture of a Spine-Leaf network structure, however, the embodiments of the present disclosure can also be used for a traditional three-layer network architecture or other tree-shaped network architectures. For example, in a three-layer network architecture, the access switch 120 is located at the access layer, the switch 110 is located at the aggregation layer as an aggregation switch, and the switch 110 is also connected to the core switch (not shown) of the core layer. In a three-layer network architecture, the path that the communication between the two access switches 120 needs to go through is: access switch-aggregation switch-core switch-aggregation switch-access switch, and a longer path may result in a larger delay. In some embodiments, the data center 100 can be constructed in units of POD (Point Of Delivery), including a network server POD and a data server POD that carry a gateway function, and corresponding PODs can be added as the scale increases. For example, an architecture form of a core layer and multiple PODs can be adopted, wherein each POD can include one or more top-of-rack switches.
[0048] Figure 2A FIG. 2 shows an example architecture diagram of a message processing system 200 according to an embodiment of the present disclosure. Figure 2A In the example of FIG. 2 , the message processing system 200 includes three servers, but the message processing system of the embodiment of the present disclosure may include more or fewer servers. Figure 2A As shown, the message processing system 200 includes a programmable switch 210, servers 221, 231 and 241, and a controller 250, wherein the servers 221, 231 and 241 can be physically connected to the switch 210 via a network cable. Optionally, the servers 221, 231 and 241 and the switch 210 can be located in the same server cabinet, and they can be directly connected via a network cable. Alternatively, the servers 221, 231 and 241 and the switch 210 can also be located in different server cabinets or in different locations, and they can be indirectly connected via one or more other network devices (such as switches, etc.). The programmable switch 210 can be Figure 1 Alternatively, the programmable switch 210 may also be a higher-layer switch, such as Figure 1 In this case, the programmable switch 210 can be connected to each server through one or more network components (such as other switches). Unlike ordinary switches, the functions of the programmable switch 210 are user-defined through programming languages. Figure 5A-5B A schematic diagram of an example structure of a programmable switch 210 is described. The programmable switch 210 runs the operating system of the switch, but the difference from the operating system of a computer is that the operating system of the programmable switch is specially designed and developed for message processing. For example, the programmable switch 210 runs special network applications to serve network functions, such as network routing protocols such as Open Shortest Path First (OSPF) and Border Gateway Protocol (BGP), which can be used to implement network routing, monitoring, security and other functions. The programmable switch 210 includes a programmable switching chip, which is specially optimized and customized to process various high-speed and low-latency network data packets in the network. Therefore, the message processing capability of the programmable switch is better than the message processing capability of the processor. In some embodiments, the programmable switch 210 and the servers 221, 231 and 241 can be located in the same server cabinet, and the controller 250 can be a software module implemented on a device in the server cabinet, which is used to manage traffic scheduling in the message processing system 200. In some embodiments, the message processing system 200 can be implemented as part of a cloud data center to provide different network services to tenants, and corresponding gateways can be deployed.
[0049] refer to Figure 2A, each server includes an intelligent network card and a processor (e.g., a central processing unit (CPU)), and the processor can run a gateway, for example, using an X86 architecture and DPDK technology to implement gateway functions, wherein DPDK is a data plane development tool set that can provide library functions and driver support for message processing under the processor architecture. DPDK is different from the operating system in that it is designed for generality, but focuses on high-performance processing of messages in network applications. For example, server 221 includes an intelligent network card 222 and a processor 223, server 231 includes an intelligent network card 232 and a processor 233, and server 241 includes an intelligent network card 242 and a processor 243. In an embodiment of the present disclosure, the processors 223, 233, and 243 in servers 221, 231, and 241 are programmed to implement gateway functions such as NAT gateways, Internet gateways (IGW), external network gateways (EGW), dedicated line gateways, and the like through software. In order to improve the stability of the gateway, a gateway backup can be provided, thereby forming a gateway master-slave pair. Alternatively, the servers 221, 231, 241 in the message processing system 200 may also be other computing devices other than servers, such as computers. In the embodiment of the present disclosure, the network card in the server is a programmable smart network card. In addition to helping the server to send and receive messages, the smart network card can also unload traffic processing work from the server's processor, thereby improving the resource utilization of the server. Figure 4 A schematic diagram of an example structure of a SmartNIC 232 is described.
[0050] In some embodiments, in order to improve the utilization of computing and storage resources in the server, the data center can begin to adopt virtualization technology, so a large number of virtual machines appear in the network. For example, multiple virtual machines (VMs) can be virtualized on a physical server through virtualization technology. In addition, the server cluster can also provide cloud services. Users can apply for an isolated and private virtual network environment in the cloud environment, and can freely configure sub-services such as IP address segments, subnets, and security groups in the virtual private cloud.
[0051] The message processing system 200 can be presented as a whole to the outside, and a virtual IP (VIP) address is provided to the outside. The internal structure of the message processing system 200 can be opaque to the outside, and the message processing system 200 can adapt to various gateways or virtual gateways in the cloud environment. External devices can access the message processing system 200 through the VIP address. After the message enters the message processing system 200, it is first received by the programmable switch 210. The distribution of the message in the message processing system 200 is determined by the programmable switch 210 and the controller 250. The controller 250 can be implemented by a processor in a server to implement traffic scheduling. For example, the controller 250 can decide which server the message received by the message processing system 200 should be sent to based on the internal scheduling algorithm. In some embodiments, the controller 250 can provide an application program interface (API) to the outside to facilitate the administrator to select a suitable scheduling algorithm and algorithm parameters. The administrator can implement, for example, traffic scheduling with custom weights, a diversion strategy based on a virtual network interface or a virtual machine, a diversion strategy for node up and down, and so on through the API. In addition, the controller 250 can also send the flow table entries of the gateway running on the processor to the programmable switch and / or the smart network card, so that the programmable switch or the smart network card can directly process the message according to the gateway flow table entry without forwarding it to the processor for processing. For example, an example of a flow table entry may include a matching domain (used to identify the message corresponding to the flow table entry), a priority (defining the priority order of the flow table entry), a timer (saving relevant statistical information), a processing instruction (the action to be performed after matching the flow table entry), etc. In addition, although Figure 2A Only a single programmable switch 210 is shown in FIG. 1 , but the programmable switch 210 may be a logical switch that actually includes one or more physical switches. Figure 2A The smart network cards 222, 232, and 242 shown in the figure may also include one or more physical smart network cards respectively.
[0052] Figure 2B FIG. 1 is a schematic diagram showing the deployment of a gateway flow table according to an embodiment of the present disclosure. Figure 2BAs shown, a gateway flow table 291 is stored in the memory 234 in the server 231, which includes gateway flow table entries generated according to various algorithms or strategies. The processor 233 executes the instructions in the memory 234 to run the gateway 235, and the gateway 235 can process (for example, modify, package, discard, etc.) the received message according to the gateway flow table entry in the gateway flow table 291, thereby realizing the gateway function. In the embodiment of the present disclosure, the programmable switch 210 and the smart network card 232 have programmable message processing capabilities, and thus can assist the gateway 235 in realizing a part of the network function. The gateway flow table 293 can be stored in the memory in the programmable switch 210, and the gateway flow table 292 can be stored in the memory in the smart network card 232. The gateway flow tables 293 and 292 may be initially empty, and gateway flow table entries may be dynamically added and / or deleted. For example, a portion of the gateway flow table entries in the gateway flow table 291 may be unloaded to the gateway flow table 293 in the programmable switch 210, and another portion of the gateway flow table entries in the gateway flow table 291 may be unloaded to the gateway flow table 292 in the smart NIC 232. The flow table in the present application includes at least one flow entry.
[0053] like Figure 2B As shown, the gateway 235 running on the processor 233 can process the received message according to the corresponding gateway flow table entry in the gateway flow table 291 in the memory 234. In addition to being able to access the gateway flow table 292 in its own memory, the smart network card 232 can also access the gateway flow table in the memory 234 through a direct memory access (DMA) channel (not shown). Therefore, in an embodiment of the present disclosure, the local gateway flow table of the programmable switch 210 refers to the gateway flow table 293 stored in the memory inside the programmable switch 210, and the local gateway flow table of the processor 233 refers to the gateway flow table 291 stored in the memory 234 in the server 231. The local gateway flow table of the smart network card 232 can refer to the gateway flow table 292 stored in the memory inside the smart network card 232, and can also refer to the gateway flow table in the memory 234 that can be accessed through the DMA channel.
[0054] Figure 3 A flowchart of a message processing method 300 according to an embodiment of the present disclosure is shown. Figure 2A-2B The method 300 is described using the message processing system 200 described above. However, the message processing method 300 is not limited to the method Figure 2A-2B In block 302, a programmable forwarding device receives a message, such as a message from outside or inside a data center. The programmable forwarding device is, for example, a programmable switch, a programmable router, etc. For example, when a message enters Figure 2AAfter the described message processing system 200 , the message is first received by the programmable switch 210 .
[0055] In box 304, the programmable forwarding device determines whether there is a local flow table entry that matches the message in its local flow table. For example, the programmable switch 210 determines whether to directly process the message or send the message to a computing device (such as server 231) by determining whether the local gateway flow table 293 has a gateway flow table entry that matches the message and is unloaded from the gateway. The gateway is run by a processor in each computing device. According to an embodiment of the present disclosure, the gateway flow table entry of the gateway 235 can be unloaded to the programmable switch 210 by the controller 250 or the processor 233. If the judgment in box 304 is yes, then in box 306, the programmable forwarding device directly processes the message according to the local gateway flow table entry. For example, if the programmable switch 210 has a local gateway flow table entry that matches the message, the programmable switch 210 can directly process the message (e.g., match, modify, discard, etc.) without forwarding the message to the server for message processing. If the judgment in box 304 is no, then in box 308, the programmable forwarding device sends a message to the computing device, such as a server, a computer, etc. For example, when there is no matching local gateway flow table entry, the programmable switch 210 forwards the message to a server for processing. In some embodiments, the programmable switch 210 can forward the message to a gateway running on a processor of a server for processing according to a preset scheduling algorithm (such as equal cost multi-path routing (ECMP)). Alternatively, the programmable switch 210 can also send the message to the controller 250, and the controller 250 decides which server gateway the message is sent to according to an internal scheduling algorithm, and sends the relevant forwarding table entries to the programmable switch 210. After receiving the forwarding table entry from the controller 250, the programmable switch 210 forwards the message to the corresponding server (for example, server 231).
[0056] In box 310, the programmable network card (e.g., smart network card) in the computing device determines whether there is a local flow table entry that matches the message in its local flow table. For example, after the server 231 receives the message from the programmable switch 210, its smart network card 232 first receives the message and determines whether its local gateway flow table 292 or the gateway flow table in the memory 234 has a matching gateway flow table entry, and then determines whether to directly process the message or send the message to the processor 233 in the server 231. If the judgment in box 310 is yes, then in box 312, the programmable network card processes the message according to the local gateway flow table entry. For example, if the smart network card 232 includes a gateway flow table entry that matches the message, the smart network card 232 can directly process the message (e.g., match, modify, discard, etc.) without forwarding the message to the processor 233 for message processing. If the judgment in box 310 is no, then in box 314, the programmable network card sends the message to the processor in the computing device. For example, the smart NIC 232 sends the message to the processor 233. In block 316, the gateway 235 running on the processor 233 processes the message according to the relevant gateway flow table entry in the gateway flow table 291.
[0057] Therefore, according to the message processing method 300 of the embodiment of the present disclosure, after the message processing system 200 receives the message, if the gateway flow table entry matched by the message has been sent to the programmable switch 210, the programmable switch 210 directly processes the message without forwarding it to the server for message processing. Since the programmable switch 210 has good traffic processing performance, the efficiency of message processing can be significantly improved. If the gateway flow table entry matched by the message has not been sent to the programmable switch 210 but has been sent to the smart network card (such as the smart network card 232), the smart network card 232 directly processes the message without forwarding it to the corresponding processor 233 for processing. Since the smart network card has good traffic processing performance, the efficiency of message processing can also be improved. In addition, the programmable switch 210 usually has multiple interfaces and can access multiple distributed nodes. By considering the traffic characteristics of different nodes, multi-point collaboration can be achieved. Therefore, the message processing method 300 of the embodiment of the present disclosure can unload at least part of the message flow at the gateway where the processor runs to the programmable forwarding device layer and the programmable network card for processing, thereby improving the processing efficiency of the message flow.
[0058] Figure 4 FIG. 2 is a schematic diagram showing an example structure of a smart network card 232 according to an embodiment of the present disclosure. Figure 4As shown, the smart network card 232 may include a network interface 410 (Ethernet interface, such as an RJ-45 interface) connected to the network side, a programmable hardware 415, a host interface 420 (such as a PCIe interface) connected to the processor on the host side, and a memory 430. The smart network card 232 can be connected to the programmable switch 210 through the network interface 410 for receiving and sending traffic. The gateway flow table 292 stored in the memory 430 may include one or more gateway flow table items unloaded from the gateway running the processor. After receiving an external message, the ordinary network card only determines whether the message is sent to its own device or to other devices. If it is sent to its own device, it notifies the processor to process it. If it is not sent to its own device, it is forwarded or discarded. In addition, the ordinary network card also directly forwards the message sent by the processor after receiving it. Since the smart network card 232 includes programmable hardware 415, in addition to being able to send and receive messages, it can also unload some message processing work and tasks from the gateway 235 running on the processor 233, such as modifying messages. For example, the smart network card 232 can help the processor to implement some storage management, security processing, network processing and other tasks through programming, which not only improves the processing efficiency but also reduces the burden on the processor.
[0059] Smart NIC 232 can be implemented in a variety of ways, including but not limited to Smart NIC based on Field Programmable Gate Array (FPGA), Smart NIC based on multi-core network processor (NP), Smart NIC based on general processor core, and Smart NIC based on Application Specific Integrated Circuit (ASIC), etc. Smart NIC can improve network bandwidth and throughput by performing network processing functions in faster hardware instead of slower software. It should be understood that Figure 4 Only an example structure of a smart network card with programmable functions is shown, and any other programmable network card currently available or to be developed in the future may be used in combination with the embodiments of the present disclosure.
[0060] Figure 5A FIG. 2 is a schematic diagram showing an example structure of a programmable switch 210 according to an embodiment of the present disclosure. Different from the fixed network processing functions in a traditional switch, the programmable switch 210 according to an embodiment of the present disclosure can customize various network processing functions through programming. Figure 5A As shown, the programmable switch 210 includes a memory 501, a processor 502, a programmable switching chip 503 and other components, such as a power supply, etc. The memory 501 stores a gateway flow table 293, which may include gateway flow table entries unloaded from the gateway 235. In some embodiments, the controller 250 may be deployed on the operating system of the programmable switch 210 and run by the processor 502. The controller 250 may control the programmable switching chip 503 through a PCIe interface.
[0061] Figure 5B The example structure of the programmable switching chip 503 in the programmable switch 210 is further shown. Figure 5B As shown, the programmable switching chip 503 can adopt a programmable protocol-independent switch architecture (PISA), which mainly includes an inlet pipeline 510, a shared memory 520, and an outlet pipeline 530, wherein the inlet pipeline 510 and the outlet pipeline 530 have the same structure, and each pipeline starts with a programmable parser, followed by a programmable match-action table, and then a programmable inverse parser. In the inlet pipeline 510, the message may be forwarded, copied, discarded, or trigger flow control, while the outlet pipeline 530 can further modify the message and send it to the corresponding outlet port. By using the programmable switching chip 503, new network protocols or new network functions can be flexibly added to the programmable switch 210, for example, a portion of the gateway function implemented by the processor can be added.
[0062] Continue to refer Figure 5B , the inlet pipeline 510 includes a programmable parser 511, a programmable match-action table 512, and a programmable inverse parser 513. The user can customize the function of the parser 511 through programming to parse the message into a customized data structure. The programmable match-action table 512 includes multiple match-action units (MAUs), and the structures of the matches and actions can be defined through programming. Whenever a message is received, a match table lookup operation is performed and the corresponding action is executed according to the rules defined in the flow table entry. The programmable inverse parser 513 is used to reassemble the processed header and the original message into a new message, and the programmable inverse parser 513 can also be defined through programming. The shared memory 520 is a high-speed storage pool for buffering, which is used to cache messages. The device realizes the exchange of messages from the inlet to the outlet through the read and write operations on the shared memory 520. The outlet pipeline 530 includes a programmable parser 531, a programmable match-action table 532, and a programmable inverse parser 533, which can also customize the functions of each component through programming.
[0063] The programmable switching chip 503 can be implemented in a variety of ways, including but not limited to FPGA, ASIC, NP and their combination. It should be understood that Figure 5A-5B Only one example structure of a programmable switch with programmable functions is shown, and any other existing or future developed programmable switch may be used in combination with the embodiments of the present disclosure.
[0064] In some embodiments, the traffic can be divided into a large flow with a larger flow rate (i.e., a session with a larger flow rate), a medium flow with a medium flow rate (i.e., a session with a medium flow rate), and a small flow with a smaller flow rate (i.e., a session with a smaller flow rate) according to the flow rate, wherein the flow rate can refer to the amount of data flowing per second. The traffic processed by the gateway running on the server may involve multiple sessions, and each session can be identified by the quintuple of each message in the traffic, wherein the quintuple includes the source IP address, the destination IP address, the source port, the destination port, and the transport layer protocol. If the quintuples of different messages are the same, it means that these messages belong to the same session. Therefore, the large flow, medium flow, and small flow passing through the unit time can be counted, and then the large flow can be unloaded to the programmable switch for processing, the medium flow can be unloaded to the smart network card for processing, and the small flow can still be processed by the processor. In this way, the processing efficiency of the message flow in the system can be improved. Usually, the traffic in the network or data center presents a long-tail distribution, and a small number of sessions occupy most of the transmission volume. Large flows have a small number but a large throughput, and are more suitable for processing by programmable switches with fewer flow table resources but stronger message processing performance. Small flows have a large number but a small throughput, and are more suitable for processing by processors with sufficient resources. Alternatively, a four-tuple or a triple may be used to identify each session, where a four-tuple may include a source IP address, a destination IP address, a source port, and a destination port, and a triple may include a source IP address, a source port, and a transport layer protocol, or may include a source IP address, a destination IP address, and a transport layer protocol, and so on.
[0065] Figures 6A-6D A schematic diagram of gateway flow entry unloading according to an embodiment of the present disclosure is shown. It should be understood that the gateway flow entry unloading process in the embodiment of the present disclosure can be implemented by the controller 250 or a controller implemented on the processor 233 . Fig. 6A The normal message processing method is shown, for example, in the initial stage, when the gateway flow table entry has not yet been unloaded to the programmable switch 210 or the smart network card 232. At 611, the programmable switch 210 receives the message 601, and since there is no matching gateway flow table entry in its local gateway flow table 293, it is forwarded to the server 231 according to the normal forwarding rule. The smart network card 232 in the server 231 first receives the message 601, and there is no relevant gateway flow table entry in the local gateway flow table 292 of the smart network card 232, so it is forwarded to the processor 233 in the server 231. The gateway 235 executed on the processor 233 processes the message 601 according to the matching flow table entry in the gateway flow table 291, such as modification, packaging, and discarding.
[0066] In some embodiments, the programmable switch 210 can forward the message 601 to the server 231 for processing according to a pre-set simple scheduling method (e.g., equal-cost multi-path routing (ECMP)). ECMP is a routing technology that implements the transmission of data packets on different paths. First, the shortest path between two nodes in the network is calculated. If there are multiple equal-cost shortest paths, load balancing is performed. Since the implementation of ECMP is relatively simple, it can be directly implemented in the programmable switch 210. Alternatively, the programmable switch 210 can also send the message 601 to the controller 250, and the controller 250 decides which server the message 601 is sent to according to the internal scheduling algorithm, and sends the relevant forwarding table entries to the programmable switch 210. Since the controller 250 has a stronger scheduling capability, it can instruct the programmable switch 210 to forward the message 601 to the most suitable server. According to an embodiment of the present disclosure, two types of flow tables can be stored in the programmable switch 210, one is a forwarding flow table (not shown) for performing switch functions, for example, the programmable switch 210 forwards the message to a server gateway according to the forwarding table entries in the forwarding flow table, and the other is an unloaded gateway flow table 293, for example, the programmable switch 210 processes the message according to the gateway flow table entries in the gateway flow table 293, such as matching, modifying, discarding, etc.
[0067] Figure 6B-6C A schematic diagram of offloading gateway flow entries in stages is shown. Figure 6B The first stage of unloading the gateway flow table entry to the smart network card 232 is shown, and the processor 233 in the server 231 counts the traffic processed by the gateway 235 in the unit time window (e.g., 1 second, etc.), for example, determining the traffic ranking of multiple sessions involved in the traffic according to the five-tuple of the message. Optionally, at 621, the processor 233 sends the session information (e.g., header information, etc.) of the top m sessions with higher rankings to the controller 250. Then, at 622, the controller 250 sends the gateway flow table entries corresponding to the top m sessions to the smart network card 232.
[0068] Alternatively, at 623, the processor 233 may directly send the gateway flow table entries corresponding to the first m sessions to the smart network card 232 without unloading the gateway flow table entries through the controller 250. In this case, the function of the controller 250 is implemented by the processor 233. Next, at 624, the programmable switch 210 receives the message 602, which may belong to the same session as the message 601. After the programmable switch 210 forwards the message 602 to the smart network card 232, since the gateway flow table entries related to the message have been unloaded to the smart network card 232, the smart network card 232 can directly process the message 602 without forwarding it to the processor 233 for processing, thereby improving the message processing efficiency. In some embodiments, when the controller 250 finds that there is remaining storage space in the gateway flow table 292 in the smart network card 232, the session information of the corresponding first m sessions can be obtained. In addition, the value of m can be determined based on the remaining storage space of the gateway flow table 292 in the smart network card 232.
[0069] Figure 6C The second stage of unloading the gateway flow table entry to the programmable switch 210 is shown. The smart network card 232 of the server 231 counts the traffic processed in the unit time window, for example, determining the traffic ranking of multiple sessions involved in the traffic according to the five-tuple in the message. Optionally, at 631, the smart network card 232 sends the session information of the top n sessions with higher rankings to the controller 250. Then, at 632, the controller 250 sends the gateway flow table entries corresponding to the top n sessions to the programmable switch 210.
[0070] Alternatively, at 633, the smart network card 232 may directly send the gateway flow table entries corresponding to the first n sessions to the programmable switch 210 without unloading the gateway flow table entries through the controller 250. Next, at 634, when the programmable switch 210 receives the message 603 belonging to the same session as the message 601, since the gateway flow table entry related to the message 603 has been unloaded to the gateway flow table 293 in the programmable switch 210, the programmable switch 210 directly processes the message 603 without forwarding it to the server 231 for processing, thereby further improving the message processing efficiency. In some embodiments, when the controller 250 finds that there is remaining storage space in the gateway flow table 293 in the programmable switch 210, the session information of the corresponding first n sessions can be obtained. In addition, the value of n can be determined based on the remaining storage space in the programmable switch 210 and the allocation ratio of gateways on different servers. For example, assuming that the programmable switch 210 is connected to 10 servers, each server gateway can unload one tenth of the total space of the gateway flow table 293 in the programmable switch 210. Since the traffic processing performance of the programmable switch 210 is greater than that of the smart network card 232, and the traffic processing performance of the smart network card 232 is greater than that of the processor 233, therefore, by unloading the gateway flow table entries to the programmable switch 210 and the smart network card 232, the efficiency of message processing can be improved, the throughput can be increased, and the latency can be reduced.
[0071] Fig.6D A schematic diagram of a joint unloading gateway flow entry is shown. The processor 233 in the server 231 counts the traffic passing through the gateway 235 in a unit time window, for example, determining the traffic ranking of multiple sessions involved in the traffic according to the five-tuple of the message. Optionally, at 641, the processor 233 sends the session information of the top p+q sessions with higher rankings to the controller 250. Then, at 642, the controller 250 sends the gateway flow entries corresponding to the top p sessions to the programmable switch 210, and at 643, the controller 250 sends the gateway flow entries corresponding to the remaining q sessions to the smart network card 232.
[0072] Alternatively, the processor 233 may directly send the gateway flow table entries corresponding to the first p sessions to the programmable switch 210 at 644, and the processor 233 may directly send the gateway flow table entries corresponding to the remaining q sessions to the smart network card 232 at 645, without unloading the gateway flow table entries through the controller 250. At 646, when the programmable switch 210 receives the message 604 belonging to the same session as the message 601, since the gateway flow table entry corresponding to the message has been unloaded to the gateway flow table 293 in the programmable switch 210, the programmable switch 210 directly processes the message 604 without forwarding it to the server 231 for processing.
[0073] In some embodiments, when the controller 250 finds that there is remaining gateway flow table space in the programmable switch 210 and the smart network card 232, it can initiate the acquisition of session information of the first p+q sessions. In addition, the value of p can be determined based on the remaining storage space of the gateway flow table 293 in the programmable switch 210 and the allocation ratio of gateways on different servers, and the value of q can be determined based on the remaining storage space of the gateway flow table 292 in the smart network card 232. In this way, different data streams are unloaded to devices at different levels for processing according to the characteristics of network traffic, further improving the efficiency of message processing. In some embodiments, the flow table items related to the session information of the first p+q sessions before unloading are replaced, and unloading can be performed in proportion. For example, the flow table items of the sessions with the top thirty percent of the flow rate counted at the gateway 235 on the processor 233 are unloaded to the programmable switch 210, and the flow table items of the sessions with the middle forty percent of the flow rate counted at the gateway 235 on the processor 233 are unloaded to the smart network card 232, while the messages of the sessions with the bottom thirty percent of the flow rate are still processed by the processor 233. In addition, Figure 6B-6D It can be an unloading strategy for gateway flow table entries in the initial stage. In the subsequent process, new gateway flow table entries can be dynamically unloaded to the programmable switch 210 and / or the smart network card 232 according to the size of the space released by clearing the flow table in the programmable switch 210 and / or the smart network card 232.
[0074] Figures 7A-7C Schematic diagrams of three exemplary gateway flow entry clearing according to embodiments of the present disclosure are shown. It should be understood that the flow entry clearing in the embodiments of the present disclosure may be implemented by the controller 250 or a controller implemented on the processor 233. Fig. 7A , which shows a method for clearing flow table entries for session interruption. At 711, the programmable switch 210 identifies a session interruption message 701 (e.g., a TCP session interruption flag message) including an interruption flag (e.g., FIN, RST, etc.). Optionally, at 712, the programmable switch 210 sends the interruption message 701 to the controller 250. The controller 250 determines whether the session is ended according to the interruption flag, and if it is determined that the session is ended, sends an instruction to the programmable switch 210 at 713 to delete the gateway flow table entries related to the session.
[0075] Alternatively, at 714, the programmable switch 210 may also send the interrupt message 701 to the processor 233. The processor 233 determines whether the session is ended according to the interrupt flag, and if it is determined that the session is ended, sends an instruction to the programmable switch 210 at 715 to delete the gateway flow table entries related to the session. After receiving the deletion instruction, the programmable switch 210 may delete the gateway flow table entries related to the session, for example, deleting the relevant gateway flow table entries in the gateway flow table 293. Alternatively or additionally, when the smart network card 232 identifies the session interrupt message, it may also delete the relevant gateway flow table entries in the gateway flow table 292 in a similar manner. By clearing the gateway flow table entries related to the ended session, the flow table storage space in the programmable switch and / or the smart network card can be released, which helps to add new gateway flow table entries, thereby further improving the message processing performance.
[0076] Figure 7B A method of clearing flow table entries when they time out is shown. At 721, the programmable switch 210 may optionally periodically (e.g., every 5 seconds) send a session heartbeat message to the controller 250 during the message reception, as shown in 722. The controller 250 includes a timer 720, which may time each session according to the received session heartbeat message. If a session heartbeat message of a session is not received for more than a unit time period, it indicates that the session may have ended or terminated. Therefore, at 723, the controller 250 may send an instruction to the programmable switch 210 to delete the gateway flow table entry related to the session.
[0077] Alternatively, during the reception of the message, the programmable switch 210 may also periodically (for example, every 5 seconds) send a session heartbeat message to the processor 233 at 724. The processor 233 includes a timer 729, which can time each session according to the received session heartbeat message. If the session heartbeat message of a session is not received for more than a unit time period, it means that the session may have ended or terminated. Therefore, at 725, the processor 233 may send an instruction to the programmable switch 210 to delete the gateway flow table entry related to the session. After receiving the deletion instruction, the programmable switch 210 may delete the gateway flow table entry related to the session, for example, delete the relevant gateway flow table entry in the gateway flow table 293. Alternatively or additionally, the controller 250 or the processor 233 may also delete the session-related gateway flow table entry in the gateway flow table 292 in the smart network card 232 in a similar manner when the session heartbeat message of the smart network card 232 is not received for more than a unit time period.
[0078] Figure 7C Another way to clear flow table entries when they time out is shown. Figure 7CAs shown, a timer 730 is provided in the programmable switch 210, and the gateway flow table 293 in the programmable switch 210 stores the timestamp information associated with the gateway flow table item, which can be used to record the time when the gateway flow table item was last used. After the timer 730 determines that a certain gateway flow table item in the gateway flow table 293 has not been used for more than a threshold time period according to the timestamp information, it can indicate to delete the gateway flow table item. Optionally, at 732, the programmable switch 210 can send an indication that the gateway flow table item has been deleted to the controller 250. Alternatively, at 733, the programmable switch 210 can also send an indication that the gateway flow table item has been deleted to the processor 233. In addition, a similar timer 740 can also be provided in the smart network card 232, which can clear the timed-out gateway flow table item in the gateway flow table 292. In this way, the controller or processor can obtain the current gateway flow table item on the programmable switch and / or the smart network card in real time, and it is helpful to unload new gateway flow table items to the programmable switch and / or the smart network card. By clearing out timed-out and unused gateway flow table entries, flow table storage space in the programmable switch and / or smart network card can be released, thereby facilitating the addition of new gateway flow table entries, thereby further improving message processing performance.
[0079] Figures 8A-8B FIG. 1 is a schematic diagram showing the deployment of a controller in a message processing system according to an embodiment of the present disclosure. Fig. 8A , which shows the architecture 800 of the message processing system in which the controller is deployed in the server, and the controller 250 can be deployed in a server 251, wherein the server 251 can be located in the same server cabinet as the servers 221, 231, and 241, for example. The controller 250 can control the unloading and clearing of the gateway flow table entries of the programmable switch 210, the smart network card 222, 232, 242, and the processor 223, 233, and 243. Since the server 251 has a high programmable performance, the deployed controller 250 can have a flexible traffic scheduling capability, thereby assisting the programmable switch 210 to improve the scheduling capability of the entire message processing system.
[0080] refer to Figure 8B , which shows the architecture 850 of the message processing system in which the controller is deployed in the programmable switch. The controller 250 can also be deployed in the operating system of the programmable switch 210 and run by the processor 502 therein. The controller 250 controls the programmable switching chip 503 in the programmable switch 210 through the PCIe interface, and unloads the flow table entries of the business data of the programmable switch 210 to the smart network card and the processor. In addition to the programmable switching chip, the programmable switch 210 also includes a programmable processor (e.g. Figure 5AThe processor 502 shown in FIG. 2 is a processor 502 in the programmable switch 210, and thus the controller 250 can be implemented by the processor 502 in the programmable switch 210, thereby improving the flexibility of controller deployment and simplifying the network structure. Therefore, the controller 250 can improve the flexible traffic scheduling capability of the gateway cluster.
[0081] Fig. 9 A schematic diagram for implementing consistent hashing according to an embodiment of the present disclosure is shown. Since the message processing system 200 of the present disclosure deploys a controller 250, it can implement some complex scheduling algorithms, such as consistent hashing scheduling, etc. For example, in a cloud environment, virtual gateway nodes can be divided into stateless gateways and stateful gateways, wherein the stateless gateway performs simple operations and forwarding on the message according to the flow table, while the stateful gateway needs to perform connection tracking and session maintenance, such as Linux virtual server (LVS), Nginx server, NAT gateway, stateful firewall, etc. In a cloud environment, the stateful gateway is responsible for the stateful business processing flow. These stateful gateways will record the state of the traffic, so a data flow must be processed by a fixed gateway before it ends. Due to the dynamic change scenarios such as online or offline of the gateway cluster, the traffic will be hashed to different gateways, resulting in interruption of the traffic session and affecting the business. Therefore, the consistent hashing algorithm can be used to solve this problem to ensure that when the backend gateway changes, the traffic can also be hashed to the same gateway.
[0082] Considering that the consistent hashing algorithm is relatively complex, it is usually impossible to implement it on ordinary physical switches (ordinary switches do not have sufficient computing performance). Fig. 9 As shown, according to an embodiment of the present disclosure, the controller 250 implements a complex consistent hashing algorithm, for example, the control plane implements the consistent hashing algorithm 902, and sends the relevant consistent hashing flow table 901 to the programmable switch 210 for storage, so that the data plane saves the consistent hashing flow table 901. The programmable switch 210 calculates the corresponding hash according to the header of the message, and then forwards the message to a fixed gateway by querying the consistent hashing flow table 901, thereby implementing consistent hashing scheduling, as shown in 905. Through the collaboration of the control plane and the data plane, and utilizing the programmable capability of the programmable switch 210, the controller 250 can be used to implement complex traffic scheduling functions in the programmable switch 210. In addition to consistent hashing, the message processing system 200 of the embodiment of the present disclosure can also implement other complex scheduling functions such as load balancing.
[0083] Fig.10 FIG. 2 shows a schematic diagram of flow stratification processing at different flow rates according to an embodiment of the present disclosure. Fig.10As shown, the traffic processed in a unit time period in the server 231 can be counted, and the large and small flows can be identified, for example, the large flow 1010 with a large flow rate (such as video flow, etc.), the medium flow 1020 with a medium flow rate (social network browsing, etc.), and the small flow 1030 with a low flow rate (such as text chat, etc.) can be identified. For the large flow 1010, the controller 250 unloads the gateway flow table entry related to the large flow 1010 to the programmable switch 210, so that the programmable switch 210 can directly process the message of the large flow 1010 without forwarding it to the server 231 for processing. For the medium flow 1020, the controller 250 unloads the gateway flow table entry related to the medium flow 1020 to the smart network card 232, so that the smart network card 232 can directly process the message of the medium flow 1020 without forwarding it to the processor 233 for processing. In addition, the remaining small flows 1030 can still be processed by the gateway 235 running on the processor 233. Since the traffic of the small flows 1030 is small, the impact on the throughput and delay is relatively small.
[0084] In an example of the present disclosure, the large flow 1010, for example, occupies 89% of the total flow, the medium flow 1020, for example, occupies 10% of the total flow, and the small flow 1030, for example, only occupies 1% of the total flow. According to an embodiment of the present disclosure, the programmable switch 210 with the best traffic processing performance can process large flows with large traffic, and the smart network card 232 with better traffic processing can process medium flows with medium traffic. In this way, the throughput of the message processing system can be improved and the latency can be reduced, while the traffic processing burden of the processor can be reduced. Therefore, the message processing system of the present disclosure adopts an adaptive traffic processing architecture, including the software implementation of the processor and the hardware implementation of the programmable switch and the smart network card, which can realize automatic guidance and hierarchical processing of traffic.
[0085] The embodiments of the present disclosure propose to offload part of the gateway functions at the processor of the gateway server to the programmable switch and the smart network card for implementation. The embodiments of the present disclosure offload large flows to the programmable switch for processing. Since the programmable switch has a high throughput and a short processing delay, it can significantly improve the performance of the gateway cluster and reduce the processing pressure of the gateway cluster. At the same time, the embodiments of the present disclosure also offload medium flows to the smart network card. Since the traffic processing performance of the smart network card is better than that of the processor, it can further improve the performance of the gateway cluster. In addition, according to some embodiments of the present disclosure, a distributed node collaboration method is adopted. Since the load of the gateway cluster is significantly reduced, it can ensure load balancing between gateway clusters and achieve session connection maintenance. In addition, the custom traffic scheduling strategy of the embodiments of the present disclosure can also achieve gateway upgrades, isolation of malicious traffic, etc.
[0086] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the systems, methods, machine-readable storage media, and program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by machine-readable instructions.
[0087] These machine-readable instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable information presentation device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable information presentation device, a device is generated to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram. These machine-readable instructions can also be stored in a machine-readable storage medium, and these instructions cause the computer, programmable information presentation device, and / or other equipment to operate in a specific manner, so that the computer-readable medium storing the instructions includes an article of manufacture, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0088] Machine-readable instructions may be loaded onto a computer, other programmable information presentation apparatus, or other device so that a series of operational steps are performed on the computer, other programmable information presentation apparatus, or other device to produce a machine-implemented process, thereby causing the instructions executed on the computer, other programmable information presentation apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0089] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.
[0090] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the various implementations disclosed herein.
Claims
1. A message processing system, characterized in that: The invention comprises a programmable forwarding device and a computing device, wherein the computing device comprises a programmable network card, a processor and a memory, and the processor executes instructions in the memory to operate a gateway. The programmable forwarding device is configured to receive a message, determine whether there is a flow table entry matching the message in a flow table accessible to the programmable forwarding device, and if not, send the message to the programmable network card; The programmable network card is configured to receive the message, determine whether there is a flow table entry matching the message in a flow table accessible to the programmable network card, and if not, send the message to the processor; as well as The processor is configured to operate the gateway to receive the message and process the message according to a flow table entry in a flow table accessible to the gateway; The processor is configured to: Collecting statistics on the message flows processed by the gateway within a unit time period; Determining a flow ranking of sessions involved in the message flow according to the statistics; as well as The message processing system further includes a first controller, and the processor is further configured to send first session information of a first number of sessions in the traffic ranking to the first controller; The first controller is configured to receive the first session information and send a first set of flow table entries related to the first session information to the programmable network card; The programmable network card is further configured to: Collecting statistics on the second message flow processed by the programmable network card within the unit time period; Determine a second traffic ranking of the session involved in the second message flow according to the statistics; as well as Sending second session information of a second number of sessions in the second traffic ranking to the first controller; The first controller is further configured to receive the second session information and send a second set of flow table entries related to the second session information to the programmable forwarding device; or: The message processing system further includes a second controller, The processor is further configured to send first session information of a first number of sessions in the traffic ranking to the second controller; The second controller is configured to receive the first session information and send a first group of flow table entries related to the first session information to the programmable network card; The programmable network card is further configured to: Collecting statistics on the second message flow processed by the programmable network card within the unit time period; Determine a second traffic ranking of the session involved in the second message flow according to the statistics; as well as Sending second session information of a second number of sessions in the second traffic ranking to the second controller; The second controller is further configured to receive the second session information and send a second set of flow table entries related to the second session information to the programmable forwarding device; or: The processor is configured to: Sending flow table entries related to a plurality of sessions in the traffic ranking to the programmable network card; or Flow table entries related to a first group of sessions among the multiple sessions are sent to the programmable forwarding device, and flow table entries related to a second group of sessions among the multiple sessions are sent to the programmable network card, wherein the traffic of the sessions in the first group of sessions is greater than the traffic of the sessions in the second group of sessions.
2. The system according to claim 1, characterized in that The flow table accessible to the programmable network card includes flow table entries unloaded from the flow table accessible to the gateway, and the flow table accessible to the programmable forwarding device includes flow table entries unloaded from the flow table accessible to the programmable network card.
3. The system according to claim 1, characterized in that The message processing system further includes a controller, The programmable forwarding device or the programmable network card is further configured to: identify a session interruption message including an interruption flag, and send the session interruption message to the controller or the processor; and The controller or the processor is configured to: when it is determined according to the session interruption message that the session is ended, send an instruction for deleting a flow table entry to the programmable forwarding device or to the programmable network card.
4. The system according to claim 1, characterized in that The message processing system further includes a controller, and the controller or the processor is configured to do at least one of the following: When no session heartbeat message is received from the programmable forwarding device for a period exceeding a threshold time period, sending an instruction for deleting a flow table entry to the programmable forwarding device; as well as When no session heartbeat message is received from the programmable network card for a period exceeding the threshold time period, an instruction for deleting the flow table entry is sent to the programmable network card.
5. The system according to claim 1, characterized in that The message processing system further includes a controller, The programmable forwarding device is further configured to, if there is no flow table entry matching the message in a flow table accessible to the programmable forwarding device, send the message to the controller, and determine that the message is to be forwarded to the computing device based on the forwarding entry received from the controller; and The controller is further configured to send the forwarding table entry to the programmable forwarding device.
6. The system according to any one of claims 1 to 5, characterized in that: The programmable forwarding device is a programmable switch having a programmable parser, a programmable match-action table, and a programmable inverse parser, the computing device is a server, and the programmable network card is an intelligent network card having communication protocol processing capability.
7. A message processing system, characterized in that: The invention comprises a programmable forwarding device and a computing device, wherein the computing device comprises a programmable network card, a processor and a memory, and the processor executes instructions in the memory to operate a gateway. The programmable forwarding device is configured to receive a first message and process the first message according to a flow table entry matching the first message in a flow table accessible to the programmable forwarding device; The programmable network card is configured to receive a second message, and process the second message according to a flow table entry matching the second message in a flow table accessible to the programmable network card; The processor is configured to run the gateway, receive a third message, and process the third message according to a flow table entry matching the third message in a flow table accessible to the gateway, and The flow table accessible to the programmable network card includes flow table entries unloaded from the flow table accessible to the gateway, and the flow table accessible to the programmable forwarding device includes flow table entries unloaded from the flow table accessible to the gateway; The processor is configured to: Collecting statistics on the message flows processed by the gateway within a unit time period; Determining a flow ranking of sessions involved in the message flow according to the statistics; as well as: The message processing system further includes a first controller, and the processor is further configured to send first session information of a first number of sessions in the traffic ranking to the first controller; The first controller is configured to receive the first session information and send a first set of flow table entries related to the first session information to the programmable network card; The programmable network card is further configured to: Collecting statistics on the second message flow processed by the programmable network card within the unit time period; Determine a second traffic ranking of the session involved in the second message flow according to the statistics; as well as Sending second session information of a second number of sessions in the second traffic ranking to the first controller; and the first controller is further configured to receive the second session information and send a second set of flow table entries related to the second session information to the programmable forwarding device; or: The message processing system further includes a second controller, and the second controller is configured to: receiving, from the processor, session information associated with a plurality of sessions in the traffic ranking; Determine a first group of sessions and a second group of sessions according to the session information, wherein the traffic of the sessions in the first group of sessions is greater than the traffic of the sessions in the second group of sessions; Sending a flow table entry related to the first group of sessions to the programmable forwarding device; as well as Sending a flow table entry related to the second group of sessions to the programmable network card; or: The processor is further configured to: Sending flow table entries related to a plurality of sessions in the traffic ranking to the programmable network card; or Flow table entries related to a first group of sessions among the multiple sessions are sent to the programmable forwarding device, and flow table entries related to a second group of sessions among the multiple sessions are sent to the programmable network card, wherein the traffic of the sessions in the first group of sessions is greater than the traffic of the sessions in the second group of sessions.
