Converging and shunting method and system based on programmable switch and universal server
Through the method based on programmable switches and universal servers, the problem of poor flexibility in traditional aggregation and splitter hardware design is solved, efficient processing and flexible management of data packets are achieved, and the adaptability and efficiency of the system are improved.
Patent Information
- Application Number
- CN202411059314.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-03
- Publication Date
- 2024-10-18
AI Technical Summary
The dedicated hardware design of traditional aggregation splitters results in poor flexibility and scalability, making it difficult to adapt to different application scenarios and protocols, resulting in insufficient data packet processing efficiency and flexibility.
Using a method based on programmable switches and universal servers, by obtaining and processing data packets, using the forwarding function of the switch for preliminary processing and format conversion, and conducting in-depth analysis and processing through the universal server, packets that meet specific needs are generated, using Programmable switches perform final processing and distribution.
It achieves efficient processing and flexible management of data messages, improves the efficiency and reliability of data transmission, enhances the flexibility and adaptability of the system, and reduces hardware update and maintenance costs.
Smart Images

Figure CN118802808A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and system for converging and distributing traffic based on a programmable switch and a general server. Background Art
[0002] In modern network systems, the convergence and splitter is an important network device responsible for processing and forwarding a large number of data packets. However, the current convergence and splitter usually uses a dedicated frame chassis and hardware board to implement the function. This traditional design has a series of drawbacks that cannot be ignored. First, the dedicated hardware design of the traditional convergence and splitter is limited in flexibility and scalability. Once the system needs to be updated or upgraded, the entire hardware board usually needs to be replaced, resulting in huge costs and waste of resources. Secondly, the dedicated hardware design is more difficult to adapt to different application scenarios and protocols. The hardware boards of traditional convergence and splitter are often optimized for specific uses and protocols. Such a design leads to poor versatility and adaptability of the system.
[0003] Therefore, how to achieve efficient processing and flexible management of data messages has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The present application provides a method, system, electronic device and storage medium for converging and diverting traffic based on a programmable switch and a general server, which can realize efficient processing and flexible management of data messages.
[0005] In a first aspect, the present application provides a method for convergence and diversion based on a programmable switch and a general server, which is applied to a first-layer switch, and the method includes: obtaining a first message; generating a second message based on the first message; sending the second message to the second-layer switch, so that the second-layer switch generates a third message based on the second message, and sends the third message to the general server, so as to receive a fourth message generated from the general server based on the third message, and send the fourth message to the first programmable switch; receiving the fourth message; generating a fifth message based on the fourth message; and sending the fifth message to the corresponding output port.
[0006] By adopting the above technical solution, by obtaining the first message and generating the second message based on the first message, the preliminary processing and format conversion of the data are realized. The generated second message is sent to the second layer switch, so that the second layer switch generates the third message based on the second message, and sends the third message to the general server. In this way, the forwarding function of the switch can be used to realize the efficient transmission and preliminary processing of the data, thereby improving the efficiency and reliability of data transmission. Next, the general server receives and generates the fourth message based on the third message, and sends the fourth message to the first programmable switch. The technical effect and advantage of this is that through the processing of the general server, the data can be further deeply analyzed and processed to generate a fourth message that meets specific requirements, thereby enhancing the flexibility and accuracy of data processing. After receiving the fourth message, the first programmable switch generates a fifth message based on the fourth message, and sends the fifth message to the corresponding output port. Through this solution, the flexibility of the programmable switch can be fully utilized to finally process and distribute the data, ensuring that the data can be accurately and efficiently transmitted to the final destination, thereby realizing efficient processing and flexible management of data messages.
[0007] Optionally, generating the second message based on the first message specifically includes: determining first private message header information according to a preset rule, the first private message header information including a first fixed byte field, a first predefined field and a first custom field; constructing a first private message header based on the first message, the first fixed byte field, the first predefined field and the first custom field; adding the first private message header to the header of the first message to generate the second message.
[0008] By adopting the above technical solution, the first private message header information is determined according to a preset rule, and the first private message header information includes a first fixed byte field, a first predefined field, and a first custom field, thereby realizing the structuring and standardization of the message header information. Based on the first message, the first fixed byte field, the first predefined field, and the first custom field, the first private message header is constructed, so that different types of information can be managed in a unified manner, thereby improving the parsing efficiency and flexibility of the message. The first private message header is added to the header of the first message to generate a second message, thereby ensuring that the message carries the necessary header information during the transmission process, facilitating subsequent processing and transmission, and improving the reliability and security of data transmission.
[0009] Optionally, generating the fifth message based on the fourth message specifically includes: deleting a private message header from the fourth message to obtain the fifth message.
[0010] By adopting the above technical solution, by deleting the private message header, unnecessary header information can be removed, the size of the message can be reduced, the transmission efficiency can be improved, and the bandwidth occupation can be reduced. After removing the private message header, the fifth message is more concise, which is convenient for subsequent system processing and analysis, and improves the system's response speed and data processing capability.
[0011] In a second aspect, the present application provides a method for convergence and diversion based on a programmable switch and a general server, which is applied to a second-layer switch, and the method includes: receiving a second message, the second message is generated by the first-layer switch based on the first message; based on the second message, generating a third message; sending the third message to the general server so that the general server generates a fourth message based on the third message; receiving the fourth message; sending the fourth message to the first programmable switch so that the first programmable switch generates a fifth message based on the fourth message, and sending the fifth message to the corresponding output port.
[0012] Optionally, generating a third message based on the second message specifically includes: determining second private message header information according to a preset rule, the second private message header information including a second fixed byte field, a second predefined field and a second custom field; constructing a second private message header based on the second message, the second fixed byte field, the second predefined field and the second custom field; adding the second private message header to the header of the second message to generate the third message.
[0013] In a third aspect, the present application provides a method for convergence and diversion based on a programmable switch and a general server, which is applied to a general server, and the method includes: receiving a third message, the third message is generated by the second layer switch based on the second message, and the second message is generated by the first layer switch based on the first message; based on the third message, a fourth message is generated; the fourth message is sent to the second layer switch, so that the second layer switch sends the fourth message to the first programmable switch, and then the first programmable switch generates a fifth message based on the fourth message, and sends the fifth message to the corresponding output port.
[0014] Optionally, generating a fourth message based on the third message specifically includes: parsing the second private message header information from the third message, the second private message header information including a second fixed byte field, a second predefined field and a second custom field; determining the third private message header information according to a preset rule, the third private message header information including a third fixed byte field, a third predefined field and a third custom field; modifying the second fixed byte field, the second predefined field and the second custom field based on the third fixed byte field, the third predefined field and the third custom field to obtain a third private message header, or constructing a third private message header based on the third message, the third fixed byte field, the third predefined field and the third custom field; adding the third private message header to the header of the third message to generate the fourth message.
[0015] In a fourth aspect of the present application, a convergence and distribution system based on a programmable switch and a general server is provided, which is applied to a first layer switch, and the system includes: a first message receiving module, a first message parsing module and a first message sending module; the first message receiving module is used to obtain a first message; the first message parsing module is used to generate a second message based on the first message; the first message sending module is used to send the second message to the second layer switch, so that the second layer switch generates a third message based on the second message, and sends the third message to the general server, so that the fourth message generated by the general server based on the third message is received, and the fourth message is sent to the first programmable switch; the first message receiving module is also used to receive the fourth message; the first message parsing module is also used to generate a fifth message based on the fourth message; the first message sending module is also used to send the fifth message to the corresponding output port.
[0016] In a fifth aspect of the present application, a convergence and distribution system based on a programmable switch and a general server is provided, which is applied to a second-layer switch, and the system includes: a second message receiving module, a second message parsing module and a second message sending module; the second message receiving module is used to receive a second message, and the second message is generated by the first-layer switch based on the first message; the second message parsing module is used to generate a third message based on the second message; the second message sending module is used to send the third message to the general server, so that the general server generates a fourth message based on the third message; the second message receiving module is also used to receive the fourth message; the second message sending module is also used to send the fourth message to the first programmable switch, so that the first programmable switch generates a fifth message based on the fourth message, and sends the fifth message to the corresponding output port.
[0017] In a sixth aspect of the present application, a convergence and distribution system based on a programmable switch and a general server is provided, which is applied to a general server, and the system includes: a third message receiving module, a third message parsing module and a third message sending module; the third message receiving module is used to receive a third message, the third message is generated by the second layer switch based on the second message, and the second message is generated by the first layer switch based on the first message; the third message parsing module is used to generate a fourth message based on the third message; the third message sending module is used to send the fourth message to the second layer switch, so that the second layer switch sends the fourth message to the first programmable switch, and then the first programmable switch generates a fifth message based on the fourth message, and sends the fifth message to the corresponding output port.
[0018] In the seventh aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any method as described in the first aspect of the present application.
[0019] In an eighth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program that can be loaded by a processor and execute a method as described in any one of the first aspects of the present application.
[0020] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: By obtaining the first message and generating the second message based on the first message, the preliminary processing and format conversion of the data are realized. The generated second message is sent to the second layer switch, so that the second layer switch generates the third message based on the second message, and sends the third message to the general server. In this way, the forwarding function of the switch can be used to realize the efficient transmission and preliminary processing of the data, thereby improving the efficiency and reliability of data transmission. Next, the general server receives and generates the fourth message based on the third message, and sends the fourth message to the first programmable switch. The technical effect and advantage of this is that through the processing of the general server, the data can be further deeply analyzed and processed to generate a fourth message that meets specific requirements, thereby enhancing the flexibility and accuracy of data processing. After receiving the fourth message, the first programmable switch generates a fifth message based on the fourth message, and sends the fifth message to the corresponding output port. Through this scheme, the flexibility of the programmable switch can be fully utilized to finally process and distribute the data, ensuring that the data can be accurately and efficiently transmitted to the final destination, thereby realizing efficient processing and flexible management of data messages. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is one of the flow diagrams of a method for converging and distributing traffic based on a programmable switch and a general server provided in an embodiment of the present application; Figure 2 This is a schematic diagram of a message structure provided in an embodiment of the present application; Figure 3 This is a second flow chart of a method for converging and distributing traffic based on a programmable switch and a general server provided in an embodiment of the present application; Figure 4 This is a flow chart of a method for converging and distributing traffic based on a programmable switch and a general server provided in an embodiment of the present application; Figure 5 This is a schematic diagram of a process flow of message processing by a general server provided in an embodiment of the present application; Figure 6 This is a network topology diagram of a two-layer CLOS scalable architecture of a programmable switch provided in an embodiment of the present application; Figure 7 This is a network topology diagram of a three-layer CLOS scalable architecture of a programmable switch provided in an embodiment of the present application; Figure 8 This is one of the structural schematic diagrams of a convergence and distribution system based on a programmable switch and a general server provided in an embodiment of the present application; Fig. 9 This is the second structural diagram of a convergence and distribution system based on a programmable switch and a general server provided in an embodiment of the present application; Fig.10 This is the third structural diagram of a convergence and distribution system based on a programmable switch and a general server provided in an embodiment of the present application.
[0022] Explanation of the accompanying drawings: 11. first message receiving module; 12. first message parsing module; 13. first message sending module; 21. second message receiving module; 22. second message parsing module; 23. second message sending module; 31. third message receiving module; 32. third message parsing module; 33. third message sending module. DETAILED DESCRIPTION
[0023] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0024] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.
[0025] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0026] The present application provides a method for convergence and distribution based on a programmable switch and a general server. The method is applied to a first-layer switch. In the present application, the first-layer switch is a programmable switch, and the first-layer switch adopts a scalable architecture of CLOS.
[0027] Reference Figure 1 , which shows one of the flow diagrams of a method for converging and distributing traffic based on a programmable switch and a general server provided in an embodiment of the present application. The method includes steps S11-S16, which are as follows: Step S11: Obtain a first message.
[0028] Specifically, in the convergence and diversion method based on programmable switches and general servers, step S11 is to obtain a first message. The main purpose of this step is to receive a data packet from the network, laying the foundation for subsequent message processing and diversion. The specific operation process of obtaining the first message is as follows: First, the first layer switch receives messages from the external network through its network interface. After the message enters the switch, it is initially parsed to identify and verify the integrity and validity of the message. This parsing process includes parsing the standard protocol header (such as Ethernet header, IP header, transport layer header, etc.) to ensure that the message complies with the predetermined communication protocol standard.
[0029] During the parsing process, the field extraction module of the switch extracts key fields in the message, such as MAC address, VLAN tag, IP address, and port number, etc. The extraction of these fields helps to add private message header information in subsequent steps, as well as classify and process messages.
[0030] By parsing and extracting key fields, the switch can initially understand the properties and traffic characteristics of the message. At this point, the message is identified as the first message, and it contains the information that was initially parsed and extracted. In this way, the first-layer switch can prepare for the subsequent steps of message processing and forwarding.
[0031] The effect of step S11 is to ensure that the first-layer switch can correctly receive and parse the data packets in the network, and provide the necessary information basis for the subsequent packet processing steps. By acquiring and preliminarily parsing the first packet, the system can effectively distinguish and identify different types of traffic, providing support for efficient convergence and diversion functions. At the same time, by extracting key field information, the system can accurately process the packet according to preset rules and parameters in the subsequent steps, thereby achieving flexible traffic management and optimization.
[0032] Step S12: Generate a second message based on the first message.
[0033] Specifically, the purpose of step S12 is to generate a second message based on the first message. The core of this step is to add private message header information to the message for subsequent exchange and processing. By adding private message header information, the system can carry more control and identification information, improving the flexibility and efficiency of message processing.
[0034] In a possible implementation, step S12 specifically includes the following steps: The first private message header information is determined according to a preset rule, where the first private message header information includes a first fixed byte field, a first predefined field, and a first custom field.
[0035] A first private message header is constructed based on the first message, the first fixed byte field, the first predefined field, and the first user-defined field.
[0036] The first private message header is added to the header of the first message to generate a second message.
[0037] Specifically, the private message header information mentioned in the above embodiment plays a very important role in series connection and information transmission in the entire system. Figure 2 For detailed description, refer to Figure 2 , Figure 2 It is a schematic diagram of a message structure provided by an embodiment of the present application. In this embodiment, the private message header is located in front of the Ethernet header of the original message, with a total of 34 bytes, including fixed byte fields, predefined fields and custom fields. The fixed byte field contains three parts, a total of 11 bytes, which are used to ensure that the message can be correctly received and identified by the network card and the programmable switch. The predefined field includes the Length field, the Checksum field, the Source Address field and the Destination Address field, a total of 12 bytes, wherein the SourceAddress field and the Destination Address field are the same as the Source Address field and the Destination Address field of the IP header of the original message (IPv6 can extract part of the field in the original message), so that the network card of the general server can calculate the correct RSS value when receiving the message carrying the private message header, and send the message to the correct CPU core for processing, so as to ensure load balancing and the same source and same destination. The custom field is shown as Attr. Field in the figure, with a total of 11 bytes, which can be flexibly allocated according to business needs, including but not limited to the message input port, the operator to which the message belongs, the uplink and downlink to which the message belongs, the message type, etc.
[0038] In the aforementioned two-layer CLOS architecture, different private message header formats can be used in the process from the input port to the general server and the process from the general server to the output port, that is, different custom fields can be assigned, so as to achieve more efficient message pre-processing and post-processing. The private message header in the above format has the following advantages: the format conforms to the existing standard protocol and can be processed by most switches and servers; the custom field range is large and sufficient information can be transmitted between different devices; it is located at the front of the message, and the overhead of adding, querying, verifying, and deleting the private message header is relatively small.
[0039] After determining the first private message header information, the system needs to integrate the information into a unified message header structure. First, the system starts to assemble the message header according to the predefined private message header format.
[0040] Specifically, the system first creates a basic framework for a private message header. In this framework, the fixed byte fields are first filled. These fields ensure that the message can be correctly identified and processed when it enters various network devices. Next, the system fills in the predefined fields, which include the first fixed byte field and the first predefined field determined in the previous step. This information will guide the forwarding path, processing strategy, and priority arrangement of the message in the network.
[0041] After completing the construction of the first private message header, the system needs to splice it with the first message. First, the system will check the header structure and length of the first message to ensure that the private message header is added without destroying the original message structure. At this time, the first message contains the original data received from the network, and the private message header contains control information such as path identification, traffic type identification, priority information and reserved fields.
[0042] Next, the system places the constructed first private message header at the head of the first message. This operation requires precise positioning and data splicing technology to ensure that the information in the message header can be correctly added to the first message. Specifically, the system first allocates enough space in the memory to store the first private message header and the data of the first message. Then, the system copies the data of the first private message header to the starting position of the new space in sequence, and then copies the rest of the first message to the new space to form a complete message structure, namely the second message.
[0043] Step S13: Send the second message to the second layer switch so that the second layer switch generates a third message based on the second message, and sends the third message to the general server, so as to receive a fourth message generated from the general server based on the third message, and send the fourth message to the first programmable switch.
[0044] Specifically, the purpose of step S13 is to send the second message to the second layer switch, so that the second layer switch generates a third message based on the second message, and sends the third message to the general server, and then receives the fourth message generated from the general server based on the third message, and sends the fourth message to the first programmable switch. The core of this step is to achieve efficient forwarding and processing of messages through the collaborative work of the two-layer programmable switch and the general server. The specific operation process is as follows: After the second message is generated, the first-layer switch needs to send the message to the second-layer switch. The sending process first needs to select a suitable forwarding port, which is based on information such as the path identifier and traffic type identifier in the message header. The forwarding logic of the first-layer switch will use this information to determine which port of the second-layer programmable switch to forward the message to through the internal field matching module and message encapsulation module.
[0045] When the second message reaches the second layer switch, the second layer switch will parse the message again. During the parsing process, the control information in the private message header will be read, including the path identifier, traffic type identifier, and priority information. Based on this information, the second layer switch will perform corresponding processing and decision-making. Specifically, the second layer switch may add or modify the private message header information according to the preset rules to generate the third message.
[0046] After the third message is generated, the second layer switch forwards it to the general server. The general server receives the third message through the network card and enters the message processing flow. The general server performs in-depth analysis and processing based on the control information in the private message header. During the processing, the general server may match and filter the message and generate the fourth message based on the preset rules and policies. The fourth message usually carries the updated control information so that it can be processed accordingly when it returns to the switch.
[0047] After the general server generates the fourth message, it sends it back to the second-layer switch through the network card. After receiving the fourth message, the second-layer switch will parse and process it again. At this time, the second-layer switch will decide which port of the first-layer switch to forward the message to based on the control information in the message. In this way, the message can be effectively transmitted and processed between the two-layer programmable switches.
[0048] After receiving the fourth message, the first-layer switch will perform final processing on it. According to the control information in the private message header, the first-layer switch will delete the private message header, restore the data format of the original message, and generate the fifth message. Finally, the first-layer switch forwards the fifth message to the corresponding output port to achieve the final transmission of the message.
[0049] Through step S13, the system realizes efficient transmission and processing of messages between the double-layer programmable switch and the general server. Private message header information plays a key role in this process, ensuring the path selection, traffic management and priority processing of messages in the network. In this way, the system can flexibly respond to complex network environments and changing business needs, and realize efficient aggregation and diversion functions.
[0050] Step S14: Receive the fourth message.
[0051] Specifically, the purpose of step S14 is to receive the fourth message. The core of this step is to ensure that the first layer switch can correctly receive and process the fourth message returned from the second layer switch, thereby laying the foundation for subsequent message processing and forwarding. The specific operation process is as follows: When the second layer switch sends the fourth message back to the first layer switch, the message receiving module of the first layer switch needs to monitor its input port at all times to receive the message in time. After receiving the fourth message, the message receiving module first performs a preliminary integrity check on the message to ensure that the message is not damaged or lost during transmission.
[0052] After the verification is passed, the first layer switch will parse the fourth message. During the parsing process, the system needs to read the private message header information in the message header, which includes the previously added path identifier, traffic type identifier, priority information and reserved fields. By parsing these fields, the system can understand the transmission path, traffic category and priority of the message, thereby providing guidance for subsequent processing steps.
[0053] After parsing the fourth message, the system needs to determine how to further process the message based on the information in the private message header. For example, if the message has a higher priority, the system may allocate more processing resources to it to ensure that it can be processed as quickly as possible. If the path identifier of the message indicates that the message requires specific processing operations, the system will also adjust its processing flow accordingly.
[0054] Step S15: Generate a fifth message based on the fourth message.
[0055] Specifically, the purpose of step S15 is to generate a fifth message based on the fourth message. The core of this step is to remove the private message header information from the fourth message by processing it, and restore it to the original message format so as to be finally transmitted and output in the network.
[0056] In a possible implementation, step S15 specifically includes the following steps: The private message header is deleted from the fourth message to obtain a fifth message.
[0057] Specifically, after receiving the fourth message, the first layer switch first parses the fourth message in detail. The focus of the analysis is to read and confirm the information in the private message header, which includes the path identifier, traffic type identifier, priority information and reserved field. These control information plays an important role in the processing and forwarding of the message, but must be removed before the message is finally transmitted.
[0058] Next, the system processes it through the private header message parsing module. The private header message parsing module is responsible for accurately locating the location of the private message header and performing the deletion operation. Specifically, the module will strip the private message header part of the fourth message from the message, leaving only the original message part. This process needs to ensure the accuracy of the deletion operation to avoid affecting other parts of the message.
[0059] After the private message header is successfully removed, the system generates a fifth message. The fifth message no longer contains the private message header information, and its format is similar to the first message initially received, but the data content may contain some processed and optimized information. At this point, the message is restored to the standard format to ensure its compatibility and identifiability in the network.
[0060] Step S16: Send the fifth message to the corresponding output port.
[0061] After the fifth message is generated, the first layer switch needs to determine the output port of the message according to the preset routing and forwarding rules. At this point, the message has been processed and optimized many times, including various operations performed by the system to ensure its correct transmission.
[0062] First, the field matching module of the switch will use the key information in the fifth message, such as the destination IP address, port number, etc., to find matching routing and forwarding rules. These rules are pre-configured by the system's control plane and are set based on network topology and business requirements. By matching these rules, the system can determine the optimal output path to ensure that the message can reach its destination efficiently.
[0063] Next, the switch's message encapsulation module will perform the final encapsulation processing on the fifth message. During the encapsulation process, the module will ensure that the message header information and data content are consistent and meet the requirements of the network transmission protocol. In this way, the message can be correctly identified and processed by subsequent network devices during the transmission process.
[0064] After the encapsulation is completed, the system sends the fifth message to the determined output port. The port management module of the switch is responsible for sending the message from the corresponding physical port or logical port. During the sending process, the module will monitor the port status to ensure that the message can be transmitted smoothly and will not fail due to port failure or congestion.
[0065] By sending the fifth message to the corresponding output port, the system realizes the final transmission of the message and completes the entire message processing flow. This process ensures that the message can reach the destination device or terminal efficiently and accurately to meet business needs.
[0066] The effect of sending the fifth message to the output port is to achieve the final transmission of the message, ensuring the normal operation of the entire system. Through this step, the system can complete the entire process from receiving, processing to final sending, ensuring the efficient transmission and correct processing of the message in the network. This not only improves the transmission efficiency of the network, but also enhances the stability and reliability of the system.
[0067] In summary, in this embodiment, a cluster of programmable switches and general-purpose servers forms a convergence and diversion cluster, which can achieve the same functions as a traditional convergence and diversion device, and logically the convergence and diversion cluster can be regarded as a separate convergence and diversion device. The input traffic of the convergence and diversion cluster is input from the first-layer switch, and the output traffic is also output from the first-layer switch. The first-layer switch and the second-layer switch are interconnected using a two-layer CLOS architecture, that is, each switch in the first layer has a path to each switch in the second layer, and there is no path between switches in the layer. The second-layer switch is interconnected with the general-purpose server, and each network card of the general-purpose server can be connected to the same second-layer switch or to different second-layer switches.
[0068] After the first message enters the first layer switch, the message parsing module first performs preset standard protocol parsing on the message, usually L2-L4 layer protocol parsing, to verify the correctness of the message. The field extraction module then extracts the fields of the L2-L4 layer, generally the extraction of standard protocol header fields such as MAC, VLAN, IP, tunnel protocol, and transport layer protocol. The data plane of a programmable switch usually contains multiple Match-Action table items, which are often defined in P4 language or NPL language. The field matching module uses the Match-Action table items of these data planes to implement specific processing flows, such as QoS control, ACL filtering, flow table maintenance, etc. In this embodiment, it also includes specific functions such as same-source and same-destination judgment, and message header offset calculation. Each Match-Action table item contains one or more actions, such as output, discard, mirroring, multicast, etc. According to the processing results of the field matching module, the private header message parsing module converts part of the information in the above results into custom fields in the private header information and adds them to the private header information. Common information such as message input port, message operator, message uplink and downlink, message type, etc., the first-layer switch does not need to add all the private header information, only the relevant fields need to be added. Finally, the message encapsulation module is responsible for encapsulating the original message and the private header information into a second message, and calculating the hash value of the message according to the preset hash algorithm, and forwarding the message to the port output of the first-layer switch.
[0069] After the second message enters the second layer switch, the processing flow of the second layer switch can be the same as that of the first layer switch, or it can be different. For example, the private header information can be used to identify whether field matching is required in the second layer switch. If not, the message can skip the processing of the field extraction module and the field matching module. For example, the second layer switch and the first layer switch perform field extraction and field matching of different protocols, and perform different identifications in the private header information. The second layer switch encapsulates the second message into a third message.
[0070] The third message is forwarded by the second layer switch to the network card of the corresponding general server, and the corresponding message processing is performed according to the data plane process of the general server and the value of the preset parameter of the control plane.
[0071] In another possible implementation, the present application also provides a method for convergence and diversion based on a programmable switch and a general server, which is applied to a second-layer switch. The second-layer switch is also a programmable switch. The second-layer switch also adopts the scalable architecture of CLOS, that is, there is a link connection between the second-layer switch and the first-layer switch; the second-layer switch and the first-layer switch can have the same number of ports or different numbers of ports.
[0072] Reference Figure 3 , which shows a second flow diagram of a method for converging and distributing traffic based on a programmable switch and a general server provided in an embodiment of the present application. The method includes steps S21-S25, which are as follows: Step S21: receiving a second message, where the second message is generated by the first layer switch based on the first message.
[0073] Step S22: Generate a third message based on the second message.
[0074] Step S23: Send the third message to the general server, so that the general server generates a fourth message based on the third message.
[0075] Step S24: Receive the fourth message.
[0076] Step S25: Send the fourth message to the first programmable switch, so that the first programmable switch generates a fifth message based on the fourth message, and sends the fifth message to a corresponding output port.
[0077] Specifically, the purpose of step S21 is to receive the second message, which is generated by the first layer switch based on the first message. The key to this step is to ensure that the second layer switch can correctly receive and prepare to process the second message from the first layer switch, laying the foundation for subsequent message processing and generating the third message. The specific operation process is as follows: After the first layer switch generates the second message, it will send the message to the second layer switch through a preset path. At this time, the second layer switch needs to monitor its input port at all times to receive the message from the first layer switch in time.
[0078] When the message receiving module of the second layer switch detects the second message, it will first perform an integrity check on the message to ensure that the message is not damaged or lost during transmission. After receiving and verifying the integrity of the second message, the second message will be analyzed in detail. During the analysis process, the system will read the private message header information in the header of the second message.
[0079] Specifically, after generating the third message, the second layer switch needs to send the message to the general server. First, the system will determine the transmission path and destination of the message based on the private message header information (including the second fixed byte field, the second predefined field, etc.) in the third message. By parsing this information, the switch can determine the optimal transmission path and select the appropriate port to send the message to the corresponding general server.
[0080] The selection of the message transmission path depends on the field matching module and routing forwarding rules inside the switch. These rules are configured by the system's control plane to ensure that the message can reach the destination efficiently. The system will select the appropriate server for processing based on the preset load balancing strategy and network topology to avoid overloading a single server.
[0081] After determining the transmission path, the message encapsulation module will perform the final encapsulation processing on the third message to ensure that it meets the requirements of the network transmission protocol and can be correctly identified and parsed by the general server. During the encapsulation process, the system will retain the control information in the private message header to ensure that the general server can obtain the complete context of the message.
[0082] Subsequently, the second layer switch sends the third message to the network card of the general server through the predetermined network interface. After the network card of the general server receives the message, it will immediately process it through the message receiving module. The message receiving module is responsible for verifying the integrity of the message and distributing it to the corresponding processing thread to enter the deep analysis and processing process.
[0083] When the general server completes the deep analysis and processing of the third message, it will generate the fourth message and send it back to the second layer switch through the network card. At this time, the second layer switch needs to monitor its input port at all times to receive the message from the general server in time.
[0084] After receiving the fourth message, the second layer switch first performs an integrity check through the message receiving module to ensure that the message is not damaged or lost during transmission. After the check is passed, the fourth message is analyzed in detail. During the analysis process, it is necessary to read the private message header information in the message header, including the third fixed byte field, the third predefined field, and the third custom field. By parsing these fields, the system can understand the current status of the message and the operations that need to be performed.
[0085] Specifically, after the second-layer switch successfully receives and parses the fourth message, the system needs to send the message back to the first-layer switch. First, the system will determine the transmission path and destination of the message based on the private message header information in the fourth message (including the third fixed byte field, the third predefined field, etc.). By parsing this information, the second-layer switch can determine the optimal transmission path and select the appropriate port to send the message back to the first-layer switch.
[0086] The selection of the message transmission path depends on the field matching module and routing forwarding rules inside the switch. These rules are configured by the system's control plane to ensure that the message can be efficiently returned to the first-layer switch and avoid path congestion or conflict. The system will select the best path based on the preset load balancing strategy and network topology and send the fourth message back to the first-layer switch.
[0087] After determining the transmission path, the message encapsulation module will encapsulate the fourth message to ensure that it meets the requirements of the network transmission protocol and can be correctly identified and parsed by the first-layer switch. During the encapsulation process, the system will retain the control information in the private message header to ensure that the first-layer switch can obtain the complete context of the message. Subsequently, the second-layer switch sends the fourth message to the network card of the first-layer switch through the predetermined network interface.
[0088] In a possible implementation, step S22 specifically includes the following steps: The second private message header information is determined according to a preset rule, where the second private message header information includes a second fixed byte field, a second predefined field, and a second custom field.
[0089] A second private message header is constructed based on the second message, the second fixed byte field, the second predefined field, and the second user-defined field.
[0090] The second private message header is added to the header of the second message to generate a third message.
[0091] Specifically, the purpose of step S22 is to generate a third message based on the second message. By adding or modifying the private message header information based on the second message, it is ensured that the message carries necessary control information during transmission so that the general server can further process it.
[0092] The specific implementation of the sub-steps included in step S22 is similar to the specific implementation of the sub-steps included in step S12, so no further details will be given here.
[0093] In another possible implementation, the present application also provides a method for convergence and diversion based on programmable switches and general servers, which is applied to general servers. The general server can be a server with any instruction set CPU, such as x86, arm instruction set server; the general server can also be a server in any form, such as blade, multi-node server; the general server can also be an orthogonal architecture, ATCA architecture containing a hardware board of a network card chip and a CPU.
[0094] Reference Figure 4 , which shows a flow diagram of a method for converging and distributing traffic based on a programmable switch and a general server provided in an embodiment of the present application. The method includes steps S31-S33, which are as follows: Step S31: receiving a third message, where the third message is generated by the second layer switch based on the second message, and the second message is generated by the first layer switch based on the first message.
[0095] Step S32: Generate a fourth message based on the third message.
[0096] Step S33: Send the fourth message to the second layer switch, so that the second layer switch sends the fourth message to the first programmable switch, and then the first programmable switch generates a fifth message based on the fourth message, and sends the fifth message to the corresponding output port.
[0097] Specifically, refer to Figure 5 , Figure 5A schematic diagram of the process flow of message processing by a general server provided in an embodiment of the present application is shown. The third message is first received from one or more network card queues by the message receiving module of the general server. Subsequently, the private message header information is parsed, and the subsequent process is selected according to the parsed private message header information, such as the control message (the message generated inside the convergence and diversion cluster, used for interactive control information), and then the subsequent control message processing process is performed, such as the data plane message (the message input from the outside to the convergence and diversion cluster, that is, the message to be processed), and then the subsequent data plane message processing process is performed. For data plane messages, continue to perform L2-L4 standard protocol parsing and field extraction, and query flow table items based on fields such as tunnels and five-tuples to determine whether the current flow table is hit. If not, match the parsed message header field in the header matching module. The header matching module also usually contains multiple matching table items. According to the matching results, a new row of table items is added to the flow table, and the necessary attributes, actions, etc. are recorded in the table items. The attributes include but are not limited to the flow start time, flow end time, each layer of the flow protocol information, table item hit status, priority, etc. The actions include but are not limited to output, discard, sampling, first N packets, etc.; if it is hit, determine whether to perform deep parsing based on the private header information and flow table information. If deep parsing is required, the message returns to the message parsing module for L4-L7 standard protocol parsing or some private protocol parsing. After parsing, the message enters the load matching module for matching. The matching includes but is not limited to string matching, mask matching, fuzzy matching, regular matching, DPI rule matching, application identification, attack traffic identification and other general matching or specific field matching, and the flow table information is further updated according to the matching results. After all matches are completed, the next execution action is obtained according to the latest status in the flow table. If the message needs to be output, the message is updated with the latest private header information in the private header message parsing module, and then encapsulated as the fourth message from the message sending module and the corresponding network card is selected for output. The receiving network card and the sending network card of the message are generally the same network card. The processing flow of the above-mentioned general server is one of the processing flows of the embodiment, which is implemented by pure software, but does not limit the present invention. For example, in a general server equipped with a hardware accelerator such as an intelligent network card, part of the processing flow can also be unloaded to the hardware accelerator through software, which will be another processing flow.
[0098] The fourth message is sent from the general server to the second-layer programmable switch, and is forwarded to the first-layer programmable switch where the output port is located after a processing flow similar to that of the above-mentioned programmable switch. It should be noted that the first-layer programmable switch needs to delete the private header information of the fourth message in the private header message parsing module, because the private header information is in the format inside the aggregation and distribution cluster rather than the standard format. Therefore, the private header information needs to be stripped before being output from the output port to restore the message to the original message.
[0099] The above is the processing flow of the data plane of the programmable switch and the general server, and the processing flow of the control plane is executed by the centralized controller.
[0100] In a possible implementation, step S32 specifically includes the following steps: The second private message header information is parsed from the third message, where the second private message header information includes a second fixed byte field, a second predefined field, and a second custom field.
[0101] The third private message header information is determined according to a preset rule, where the third private message header information includes a third fixed byte field, a third predefined field, and a third custom field.
[0102] The second fixed byte field, the second predefined field and the second custom field are modified based on the third fixed byte field, the third predefined field and the third custom field to obtain a third private message header, or, based on the third message, the third fixed byte field, the third predefined field and the third custom field, a third private message header is constructed.
[0103] The third private message header is added to the header of the third message to generate a fourth message.
[0104] Specifically, after the general server receives and parses the third message, the system needs to further process it to generate the fourth message. First, read and parse the private message header information in the third message. This information includes the second fixed byte field, the second predefined field, and the second custom field. These fields provide key information such as the transmission path, traffic type, and priority of the message.
[0105] Next, the system determines the third private message header information that needs to be added or modified based on the preset rules and the current network status. The system first determines the new path identifier, traffic type identifier, priority information, and reserved field based on the content of the third message and the existing private message header information. The system may modify the existing control information to adapt to the current network conditions and business needs. For example, the system may adjust the priority information of the message based on the current network load and the importance of the message, or update the path identifier and traffic type identifier based on the destination and traffic type of the message.
[0106] After determining the new control information, the system will construct the third private message header information, which will be added to the header of the third message to generate the fourth message. The specific operation steps include creating a new private message header structure, filling in the necessary field information, including the third fixed byte field, the third predefined field and the third custom field, and then adding the new private message header to the header of the third message to generate a complete fourth message.
[0107] The process of generating the fourth message must ensure the integrity and consistency of the message. The system needs to ensure that the newly added private message header information is seamlessly combined with the original message data to avoid affecting other parts of the message. In this way, the system ensures that the fourth message retains the original data and carries the latest control information.
[0108] In all the above embodiments, the implementation methods of the embodiments can refer to Figure 6 , Figure 6 This is a network topology diagram of a two-layer CLOS scalable architecture of a programmable switch provided in an embodiment of the present application. The above embodiments have the following characteristics: the input and output ports of the traffic are all located in the first-layer programmable switch, and any switch in the first layer can contain input traffic and output traffic at the same time; the first-layer programmable switch and the second-layer programmable switch are full-mesh bidirectionally connected, that is, the first-layer switch and each switch in the second layer have a bidirectional path, which can be one cable or multiple cables; all general-purpose servers are connected to the second-layer programmable switch, which can be connected to only one or multiple servers, and there is no connection between general-purpose servers.
[0109] This two-layer CLOS scalable architecture has the following advantages: all messages pass through the first-layer programmable switch and the second-layer programmable switch to reach the general server, and then are output by the general server through the second-layer programmable switch and the first-layer programmable switch. The message processing path is the same no matter which device it passes through at each layer; programmable switches and general servers can be expanded on demand at each layer. If there are many input and output links, the first-layer programmable switch can be expanded horizontally without affecting the existing links. If the performance of the general server is slightly lower and more units are required, the general server can be expanded separately without affecting the number of programmable switches; it is easy to achieve global homogeneity. If a The upstream and downstream streams are input from two first-layer programmable switches respectively, and can be converged to the same second-layer programmable switch through a full-mesh link, and then processed by the same general server, without the problem of one-way flow; it is easy to unload some pre-processing and post-processing. Since the two-layer programmable switches are located before and after the general server respectively, some pre-processing and post-processing can be easily implemented in the programmable switch, thereby obtaining better performance and reducing the pressure on the general server; avoiding single point failure. If the programmable switch or the general server fails, the traffic can be distributed to other similar devices for processing in real time without causing traffic loss.
[0110] It should be noted that, in addition to all the above embodiments, the present application can also be implemented by the following methods. Figure 7 , Figure 7This is a network topology diagram of a three-layer CLOS scalable architecture of a programmable switch provided in an embodiment of the present application. This embodiment includes a three-layer programmable switch, the first-layer programmable switch is responsible for traffic input, the third-layer programmable switch is responsible for traffic output, and the first, second, and third-layer programmable switches are connected in a full-mesh manner. Figure 6 Compared with the embodiment shown in the figure, this embodiment has the following disadvantages: low link utilization, only one-way traffic is carried on the links between programmable switches; a large number of programmable switches are required, and when the traffic is small, at least three programmable switches are required instead of two; different programmable switches have different roles and different processing flows, which increases the system complexity and control plane difficulty. Figure 7 The embodiment shown in the figure is folded in half along the second layer of programmable switches, Figure 6 The network topology of the embodiment shown is such that the two-layer CLOS scalable architecture is a preferred architecture.
[0111] Compared with traditional aggregation and splitter, the above-mentioned two-layer CLOS scalable architecture composed of programmable switches has powerful cluster scalability, can easily cope with ultra-large-scale traffic access, and avoid the access limit of frame-type devices; and can be broken down into parts and deployed in different computer rooms and cabinets to make full use of tight space; further, it can reduce investment and construction costs. When the traffic is small, only one second-layer programmable switch can be used, and then it can be gradually expanded to a two-layer programmable switch as the traffic increases.
[0112] Reference Figure 8 , which shows one of the structural schematic diagrams of a convergence and distribution system based on a programmable switch and a general server provided in an embodiment of the present application, the system includes: a first message receiving module 11, a first message parsing module 12 and a first message sending module 13; A first message receiving module 11, used to obtain a first message; A first message parsing module 12, configured to generate a second message based on the first message; A first message sending module 13 is used to send the second message to the second layer switch, so that the second layer switch generates a third message based on the second message, and sends the third message to the general server, so as to receive a fourth message generated from the general server based on the third message, and send the fourth message to the first programmable switch; The first message receiving module 11 is further used to receive a fourth message; The first message parsing module 12 is further used to generate a fifth message based on the fourth message; The first message sending module 13 is further configured to send the fifth message to a corresponding output port.
[0113] Reference Fig. 9, which shows a second structural diagram of a convergence and distribution system based on a programmable switch and a general server provided in an embodiment of the present application, the system includes: a second message receiving module 21, a second message parsing module 22 and a second message sending module 23; A second message receiving module 21, used for receiving a second message, where the second message is generated by the first layer switch based on the first message; A second message parsing module 22, configured to generate a third message based on the second message; A second message sending module 23, used for sending the third message to the general server, so that the general server generates a fourth message based on the third message; The second message receiving module 21 is further used to receive a fourth message; The second message sending module 23 is further configured to send the fourth message to the first programmable switch, so that the first programmable switch generates a fifth message based on the fourth message, and sends the fifth message to a corresponding output port.
[0114] Reference Fig.10 , which shows a third structural diagram of a convergence and distribution system based on a programmable switch and a general server provided in an embodiment of the present application, the system includes: a third message receiving module 31, a third message parsing module 32 and a third message sending module 33; A third message receiving module 31, used to receive a third message, where the third message is generated by the second layer switch based on the second message, and the second message is generated by the first layer switch based on the first message; A third message parsing module 32, configured to generate a fourth message based on the third message; The third message sending module 33 is used to send the fourth message to the second layer switch, so that the second layer switch sends the fourth message to the first programmable switch, and then the first programmable switch generates a fifth message based on the fourth message and sends the fifth message to the corresponding output port.
[0115] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0116] The present application also discloses an electronic device, which may include: at least one processor, at least one network interface, a user interface, a memory, and at least one communication bus.
[0117] The communication bus is used to realize the connection and communication between these components.
[0118] The user interface may include a display screen (Display) and a camera (Camera), and the optional user interface may also include a standard wired interface and a wireless interface.
[0119] The network interface may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0120] Among them, the processor may include one or more processing cores. The processor uses various interfaces and lines to connect various parts of the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory. Optionally, the processor can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor, but may be implemented separately through a chip.
[0121] Among them, the memory may include a random access memory (Random Access Memory, RAM) or a read-only memory (Read-Only Memory). Optionally, the memory includes a non-transitory computer-readable storage medium. The memory can be used to store instructions, programs, codes, code sets or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory may also be optionally at least one storage device located away from the aforementioned processor. The memory as a computer-readable storage medium may include an operating system, a network communication module, a user interface module and an application.
[0122] In an electronic device, a user interface is mainly used to provide an input interface for a user and obtain data input by the user; and a processor can be used to call an application stored in a memory, and when executed by one or more processors, the electronic device executes one or more methods such as those in the above embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited to the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0123] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0124] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0125] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0126] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0127] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0128] The above are only exemplary embodiments of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other embodiments of the present disclosure.
[0129] This application is intended to cover any variation, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art not described in the present disclosure. The description and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A method for converging and distributing traffic based on a programmable switch and a general server, characterized in that: Applied to a first layer switch, the method comprises: Obtaining a first message; Based on the first message, generate a second message; Sending the second message to the second layer switch so that the second layer switch generates a third message based on the second message, and sending the third message to the general server, so that the general server receives a fourth message generated based on the third message, and sends the fourth message to the first programmable switch; receiving the fourth message; Based on the fourth message, generate a fifth message; The fifth message is sent to the corresponding output port.
2. The method according to claim 1, characterized in that The generating a second message based on the first message specifically includes: Determine first private message header information according to a preset rule, where the first private message header information includes a first fixed byte field, a first predefined field, and a first custom field; Constructing a first private message header based on the first message, the first fixed byte field, the first predefined field, and the first custom field; Add the first private message header to the header of the first message to generate the second message.
3. The method according to claim 1, characterized in that The generating a fifth message based on the fourth message specifically includes: The private message header is deleted from the fourth message to obtain the fifth message.
4. A method for converging and distributing traffic based on a programmable switch and a general server, characterized in that: Applied to a layer 2 switch, the method comprises: receiving a second message, where the second message is generated by the first layer switch based on the first message; Based on the second message, generate a third message; Sending the third message to a general server so that the general server generates a fourth message based on the third message; receiving the fourth message; The fourth message is sent to the first programmable switch, so that the first programmable switch generates a fifth message based on the fourth message, and sends the fifth message to a corresponding output port.
5. The method according to claim 4, characterized in that The generating a third message based on the second message specifically includes: Determine second private message header information according to a preset rule, where the second private message header information includes a second fixed byte field, a second predefined field, and a second custom field; Constructing a second private message header based on the second message, the second fixed byte field, the second predefined field, and the second custom field; The second private message header is added to the header of the second message to generate the third message.
6. A method for converging and distributing traffic based on a programmable switch and a general server, characterized in that: Applied to a general server, the method comprises: receiving a third message, wherein the third message is generated by the second layer switch based on the second message, and the second message is generated by the first layer switch based on the first message; Based on the third message, generate a fourth message; The fourth message is sent to the second layer switch, so that the second layer switch sends the fourth message to the first programmable switch, and then the first programmable switch generates a fifth message based on the fourth message and sends the fifth message to the corresponding output port.
7. The method according to claim 6, characterized in that The generating a fourth message based on the third message specifically includes: Parsing the third message to obtain second private message header information, where the second private message header information includes a second fixed byte field, a second predefined field, and a second custom field; Determine third private message header information according to a preset rule, wherein the third private message header information includes a third fixed byte field, a third predefined field, and a third custom field; Modifying the second fixed byte field, the second predefined field and the second custom field based on the third fixed byte field, the third predefined field and the third custom field to obtain a third private message header, or constructing a third private message header based on the third message, the third fixed byte field, the third predefined field and the third custom field; The third private message header is added to the header of the third message to generate the fourth message.
8. A convergence and distribution system based on a programmable switch and a general server, characterized in that: Applied to a first layer switch, the system comprises: a first message receiving module, a first message parsing module and a first message sending module; The first message receiving module is used to obtain a first message; The first message parsing module is used to generate a second message based on the first message; The first message sending module is used to send the second message to the second layer switch, so that the second layer switch generates a third message based on the second message, and sends the third message to the general server, so as to receive a fourth message generated by the general server based on the third message, and send the fourth message to the first programmable switch; The first message receiving module is further used to receive the fourth message; The first message parsing module is further used to generate a fifth message based on the fourth message; The first message sending module is further used to send the fifth message to a corresponding output port.
9. A convergence and distribution system based on a programmable switch and a general server, characterized in that: Applied to a second layer switch, the system comprises: a second message receiving module, a second message parsing module and a second message sending module; The second message receiving module is used to receive a second message, where the second message is generated by the first layer switch based on the first message; The second message parsing module is used to generate a third message based on the second message; The second message sending module is used to send the third message to the general server, so that the general server generates a fourth message based on the third message; The second message receiving module is further used to receive the fourth message; The second message sending module is further configured to send the fourth message to the first programmable switch, so that the first programmable switch generates a fifth message based on the fourth message, and sends the fifth message to a corresponding output port.
10. A convergence and distribution system based on a programmable switch and a general server, characterized in that: Applied to a general server, the system comprises: a third message receiving module, a third message parsing module and a third message sending module; The third message receiving module is used to receive a third message, where the third message is generated by the second layer switch based on the second message, and the second message is generated by the first layer switch based on the first message; The third message parsing module is used to generate a fourth message based on the third message; The third message sending module is used to send the fourth message to the second layer switch, so that the second layer switch sends the fourth message to the first programmable switch, and then the first programmable switch generates a fifth message based on the fourth message and sends the fifth message to the corresponding output port.
Citation Information
Patent Citations
Gathering and shunting method and device based on programmable switching chip, storage medium and electronic equipment
CN111277517A
Method and system for implementing a multi-chassis link aggregation group in a network
US20120314715A1
Network traffic load balancing
US20140307553A1
