CN114553757A - Protocol message processing method, device and equipment based on programmable switch - Google Patents

Protocol message processing method, device and equipment based on programmable switch Download PDF

Info

Publication number
CN114553757A
CN114553757A CN202210111588.2A CN202210111588A CN114553757A CN 114553757 A CN114553757 A CN 114553757A CN 202210111588 A CN202210111588 A CN 202210111588A CN 114553757 A CN114553757 A CN 114553757A
Authority
CN
China
Prior art keywords
message
protocol
queue
information
abstract
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210111588.2A
Other languages
Chinese (zh)
Inventor
田冰川
翟恩南
周禹
刘洪强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210111588.2A priority Critical patent/CN114553757A/en
Publication of CN114553757A publication Critical patent/CN114553757A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a protocol message processing method, a device and equipment based on a programmable switch. Acquiring a protocol message transmitted by tested equipment, wherein the tested equipment is equipment for carrying out data transmission with a programmable switch; determining abstract information in a preset protocol message abstract queue according to a protocol message; generating an abstract message based on the abstract information and the template message; acquiring configuration information in the network protocol data stream corresponding to the protocol message according to the summary information; and adjusting the abstract message according to the configuration information to obtain a feedback result of the protocol message, and sending the feedback result of the protocol message to the tested equipment. According to the data processing method based on the programmable switch, the generation and the processing of the network protocol data stream can be supported, and the test requirement on the protocol processing function of the network test equipment is realized.

Description

Protocol message processing method, device and equipment based on programmable switch
Technical Field
The present application relates to a processing method, apparatus, device and storage medium. The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for processing a protocol packet based on a programmable switch.
Background
The functional test of a network test device such as a switch device depends on Protocol data such as Transmission Control Protocol (TCP), hypertext Transfer Protocol (HTTP), and the like.
Generally, in order to test the protocol processing function of a switch device, the switch device needs to generate protocol traffic according to protocol data and transmit the protocol traffic to other network devices, and then, when receiving a data packet transmitted by other network devices, the switch generates a reply data packet in a manner that meets the protocol specification. Because the traditional switch is difficult to support the generation and processing of the protocol flow, the test requirement of the protocol processing function of the switch cannot be met.
Disclosure of Invention
The embodiment of the application provides a protocol message processing method, a device, equipment and a storage medium based on a programmable switch, which can support the generation and processing of network protocol data streams and realize the test requirement on the protocol processing function of network test equipment.
According to a first aspect of the embodiments of the present application, a method for processing a protocol packet based on a programmable switch is provided, which includes:
acquiring a protocol message transmitted by a tested device, wherein the tested device is a device for data transmission with a programmable switch;
determining abstract information in a preset protocol message abstract queue according to the protocol message;
generating an abstract message based on the abstract information and the template message; acquiring configuration information in a network protocol data stream corresponding to the protocol message according to the summary information;
and adjusting the abstract message according to the configuration information to obtain a feedback result of the protocol message, and sending the feedback result of the protocol message to the tested equipment.
According to a second aspect of the embodiments of the present application, there is provided a data processing method based on a programmable switch, including:
acquiring a protocol message;
determining abstract information in a preset protocol message abstract queue according to a protocol message;
generating an abstract message based on the abstract information and the template message; acquiring configuration information in the network protocol data stream corresponding to the protocol message according to the summary information;
and adjusting the abstract message according to the configuration information to obtain a feedback result of the protocol message.
According to a third aspect of the embodiments of the present application, there is provided a protocol packet processing apparatus based on a programmable switch, including:
the device comprises an acquisition module, a processing module and a control module, wherein the acquisition module is used for acquiring a protocol message transmitted by a tested device, and the tested device is a device for data transmission with a programmable switch;
the determining module is used for determining summary information in a preset protocol message summary queue according to the protocol message;
the generating module is used for generating abstract messages based on the abstract information and the template messages; acquiring configuration information in a network protocol data stream corresponding to the protocol message according to the summary information;
and the adjusting module is used for adjusting the abstract message according to the configuration information to obtain a feedback result of the protocol message and sending the feedback result of the protocol message to the tested equipment.
According to a fourth aspect of the embodiments of the present application, there is provided a programmable switch-based data processing apparatus, comprising:
the acquisition module is used for acquiring the protocol message;
the determining module is used for determining summary information in a preset protocol message summary queue according to the protocol message;
the generating module is used for generating the abstract message based on the abstract information and the template message; acquiring configuration information in the data stream corresponding to the protocol message according to the summary information;
and the adjusting module is used for adjusting the abstract message according to the configuration information to obtain a feedback result of the protocol message.
According to a fifth aspect of embodiments of the present application, there is provided a computer apparatus, comprising: a memory and a processor;
a memory for storing a computer program;
a processor for executing the computer program stored in the memory, the computer program when executed causing the processor to perform the steps of the programmable switch-based protocol message processing method as shown in the first aspect or the steps of the programmable switch-based data processing method as shown in the second aspect.
According to a sixth aspect of embodiments of the present application, there is provided a computer-readable storage medium storing a program or instructions thereon, which, when executed by a computer device, causes the computer device to perform the steps of the programmable switch-based protocol message processing method as shown in the first aspect or the steps of the programmable switch-based data processing method as shown in the second aspect.
According to a seventh aspect of embodiments of the present application, there is provided a computer program product comprising a computer program which, when executed by a computer apparatus, causes the computer apparatus to perform the steps of the programmable switch-based protocol message processing method as shown in the first aspect or the steps of the programmable switch-based data processing method as shown in the second aspect.
According to the protocol message processing method, device, equipment and storage medium based on the programmable switch in the embodiment of the application, the abstract information in the preset protocol message abstract queue is determined by obtaining the protocol message transmitted by the tested equipment for data transmission with the programmable switch, the abstract message is generated based on the abstract information and the template message issued by the control plane corresponding to the programmable switch, the configuration information in the network protocol data stream corresponding to the protocol message is obtained according to the abstract information, and then the abstract message is adjusted according to the configuration information to obtain the feedback result of the protocol message. Therefore, the generation and processing of the high-throughput network protocol data stream can be supported, and the large-scale test requirement on the protocol processing function of the network test equipment is realized.
Drawings
The present application may be better understood from the following description of specific embodiments of the application taken in conjunction with the accompanying drawings, in which like or similar reference numerals identify like or similar features.
FIG. 1 is one of the schematic diagrams illustrating a data processing architecture according to one embodiment;
FIG. 2 is a second diagram illustrating a data processing architecture according to one embodiment;
FIG. 3 is a third diagram illustrating a data processing architecture according to one embodiment;
FIG. 4 is a fourth diagram illustrating a data processing architecture according to one embodiment;
FIG. 5 is a fifth diagram illustrating a data processing architecture according to one embodiment;
FIG. 6 is a flow diagram illustrating a data processing method according to one embodiment;
FIG. 7 is a block diagram illustrating a programmable switch based data processing apparatus according to one embodiment;
FIG. 8 is a block diagram illustrating a programmable switch based data processing apparatus according to one embodiment;
fig. 9 is a diagram showing a hardware configuration of a computer apparatus according to an embodiment.
Detailed Description
Features and exemplary embodiments of various aspects of the present application will be described in detail below, and in order to make objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail below with reference to the accompanying drawings and the embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. It will be apparent to one skilled in the art that the present application may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present application by illustrating examples thereof.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
In the related art, an existing network test device such as a switch may generate and process a stateful or stateless data flow through hardware and software, where the generation and processing of a stateless message may be implemented on hardware; the generation and processing of the state message can be realized on software. However, for hardware testing, due to its limitations, it is difficult to generate and process high-throughput stateful data streams in some scenarios; for software testing, it is difficult to generate and process high-throughput data streams, and target stress testing cannot be provided to the protocol processing apparatus. Therefore, the above prior art cannot meet the test requirements of the protocol processing function of the network test equipment.
Based on this, the embodiment of the present application provides a protocol packet processing method based on a programmable switch, which implements the capability of software to generate and process traffic in the hardware of the programmable switch according to the packet types that the programmable switch can support, overcomes the closed hardware testing capability of a network performance testing device, and the programmable switch supports the generation and processing of line-speed status packets, so as to achieve the processing performance of high concurrency and high throughput, and implement the large-scale test requirement on the protocol processing function.
Based on this, the data processing method provided by the embodiment of the present application will be described in detail below with reference to the data processing architecture provided by the embodiment of the present application shown in fig. 1.
In one or more possible embodiments, as shown in fig. 1, the data processing architecture proposed in the embodiments of the present application includes a data processing network 10, where the data processing network 10 includes at least one device under test 101, a processing module 102, and a programmable switch 103.
The data processing network 10 will be described in detail below.
In the embodiment of the present application, the at least one device under test 101 may include device 1, device 2, … …, and device N, where N is an integer greater than 1.
The processing module 102 includes a data plane module 1021(control lane) and a control plane module 1022(control lane). Data plane module 1021 is responsible for handling and forwarding various types of packets on different ports of a switch (e.g., programmable switch 103 in the embodiments of the subject application). The control plane module 1022 is used to control and manage the operation of various network protocols, and provides various network information and forwarding query items required before data plane data processing and forwarding. It should be noted that, the data plane module 1021 corresponds to each of the at least one device under test 101 mentioned above, and the network protocol may include at least one of the following: stateful protocols, stateless protocols.
The programmable switch 103 includes a programmable switch chip (programmable switching ASIC) which is a switch chip in which each packet processing table of the data plane module 1021 can be flexibly programmed and modified. It should be noted that the programmable switch 103 performs data transmission with each of the at least one device under test 101 mentioned above. For example, in the test of the protocol processing function for the stateful protocol or the stateless protocol, the programmable switch 103 may be configured to receive the data packet a sent by the device 1, and then, by using the data processing method provided in the embodiment of the present application, generate the feedback result of replying to the data packet a in a manner that meets the protocol specification, thereby forming the bidirectional stateful traffic to meet the test requirement of the protocol processing function.
In one or more possible embodiments, as shown in fig. 2, the programmable switch 103 may include an obtaining message module 1031, a protocol message queue module 1032, and a protocol message processing module 1033, and the protocol message processing method based on the programmable switch provided in this embodiment may be implemented based on the obtaining message module 1031, the protocol message queue module 1032, and the protocol message processing module 1033, which is specifically shown as follows.
In some examples, the get message module 1031 may be configured to receive data packets sent by at least one device under test 101, where the data packets include protocol message a. The message obtaining module 1031 is further configured to transmit the protocol message a to the protocol message queue module 1032. In addition, the message obtaining module 1031 is further configured to forward the template message to the protocol message queue module 1032, where the template message is issued by the control plane module 1022 and serves as a template of a feedback result of the protocol message, and the module message includes an indication field used for indicating the programmable switch to perform internal circulation and rewriting on the module message.
The protocol message queue module 1032 is configured to determine, according to the protocol message a, summary information in the protocol message queue module 1032, and receive the template message transmitted by the message obtaining module 1031 when the message obtaining module 1031 obtains the template message issued by the control plane module 1022. Based on this, the protocol packet queue module 1032 may also be configured to generate a summary packet according to the summary information and the template packet, and transmit the summary packet to the protocol packet processing module 1033. In some examples, the protocol message queue module 1032 stores a protocol message digest queue for storing digest information as referred to above.
The protocol packet processing module 1033 is configured to receive the digest packet, and obtain configuration information in the network protocol data stream corresponding to the protocol packet a according to the digest information in the digest packet. Based on this, the protocol packet processing module 1033 is further configured to adjust the digest packet according to the configuration information, so as to obtain a feedback result of the protocol packet. In some examples of the method of the present invention,
the protocol packet processing module 1033 stores an abstract handler table, which is used to store configuration information in a network protocol data stream corresponding to the protocol packet a. Further, the protocol packet processing module 1033 is configured to Match the configuration information according to a digest processing program table, where the digest processing program table is a Match-Action table in the programmable switch 103, that is, a matching field and a corresponding execution Action, and the table describes an Action (Action) that a certain state is matched to a certain packet field to execute a certain Action and obtain a new state, so as to search an Action sequence to be executed on the digest packet from the Match-Action table according to a flow state of the digest packet, select an Action to be executed, and finally execute the selected Action, for example, actions such as adding a load, modifying a packet field, and transferring a state.
In another or multiple possible embodiments, before acquiring the protocol packet in the embodiment of the present application, the programmable switch 103 may further provide different processing modes according to the type of the packet. Therefore, based on the message obtaining module 1031 in fig. 2, the message obtaining module 1031 will be described in detail with reference to fig. 3.
As shown in fig. 3, the message obtaining module 1031 may specifically include a message classification module 10311 and a message forwarding module 10312.
The message classification module 10311 is configured to, when the programmable switch 103 receives the message X at the input port, identify a header (or a field carried in the message X) in the message X, and determine a classification result of the message X, where the classification result includes a message type of the message X. Here, the packet type of the packet X may be a normal packet, a protocol packet, or a template packet. Further, the normal message comes from at least one of the above-mentioned devices, and the normal message includes an indication field a, where the indication field a is used to indicate that the programmable switch 103 forwards the normal message normally. The protocol message comes from other network devices, and the protocol message includes an indication field B for instructing the programmable switch 103 to process and feed back the protocol message. The template message is issued by the control plane module 1022, and serves as a template of a feedback result of the protocol message, where the module message includes an indication field C for indicating the programmable switch to perform internal circulation and rewriting on the module message.
The message forwarding module 10312 is configured to receive the message X transmitted by the message classification module 10311, where the message X carries a classification result of the message X. The message forwarding module 10312 is further configured to determine forwarding policy information of the message X based on the classification result of the message X. When the classification result of the packet X indicates that the packet X is a protocol packet or a template packet, the forwarding policy information is to send the protocol packet or the template packet to the protocol packet queue module 1032. And when the classification result of the message X indicates that the message X is a common message, forwarding the strategy information to the related at least one device through the output port of the programmable switch 103 according to the routing table. When the classification result of the message X represents that the message X is a result message, the forwarding policy information is multicast forwarding information carried according to the result message, at least one first copy of the result message is forwarded to the output port of the programmable switch 103, and at least one first copy is sent to the at least one device involved through the output port of the programmable switch 103, and a second copy of the result message is restored to obtain a template message.
In one or more possible embodiments, when the received protocol packet is a packet in any state in a protocol data stream, the data processing method provided in this embodiment may process the protocol data stream. Based on the structure shown in fig. 2 or fig. 3, the programmable switch 103 further includes a status register 104 and a restoring module 105, as shown in fig. 4.
The status register 104 is used to store summary information in a preset protocol message summary queue of the protocol message queue module 1032. And, in the case of acquiring a new state written by the protocol packet output by the protocol packet processing module 1033, store information representing a state of the protocol packet, so as to update the digest information in the preset protocol packet digest queue.
The restoring module 105 is configured to restore a result packet inconsistent with the protocol packet structure to a template packet. When the result message obtained by the message obtaining module 1031 is inconsistent with the protocol message structure, the message obtaining module 1031 sends the result message to the restoring module 105, the restoring module 105 restores the result message to a template message, and sends the template message to the protocol message queue module 1032. The restoring module 105 is further configured to delete a load carried by a result packet inconsistent with the protocol packet structure, so as to avoid cyclically adding the load.
Therefore, the programmable switch 103 in this embodiment of the present application may implement the above-mentioned data processing method and the capability of processing the network protocol data stream, on the other hand, the programmable switch 103 in this embodiment of the present application may provide the programming function and the forwarding function, for example, in the case that the network function is implemented in the programmable switch 103, the programmable switch 103 may exceed the throughput capability that can be achieved by other gateway devices through software. Therefore, the protocol flow generation and processing function is realized on the programmable switch 103, and the protocol is processed by using the hardware where the programmable switch 103 is located, so that the large-scale test requirement on the protocol processing function of the network test equipment can be met.
The data processing method provided by the embodiment of the present application is explained in detail based on the data processing architecture shown in fig. 2 and fig. 3.
The programmable switch 103 receives data packets sent by at least one device under test 101, the data packets including message a. The message classification module 10311 in the programmable switch 103 classifies the messages, and forwards the classified messages through the protocol forwarding module 102, and the protocol message queue module 1032 receives the protocol messages forwarded by the protocol forwarding module 102, and determines summary information in a protocol message summary queue preset in the protocol message queue module 1032. And, the programmable switch 103 obtains the module message issued by the control plane module 1022, and the protocol message queue module 1032 generates the digest message B based on the digest information and the template message. Protocol packet queue module 1032 transmits digest packet B to protocol packet processing module 1033. Protocol message processing module 1033 obtains digest message B. Next, the protocol packet processing module 1033 obtains, according to the digest information, configuration information in the network protocol data stream corresponding to the protocol packet, where the configuration information may be information of a key field and a stream state of a matching digest packet in the digest processing program table, and then adjusts the digest packet according to the configuration information to obtain a feedback result of the protocol packet, where the feedback result of the protocol packet includes a result packet.
Thus, the generation and processing of stateful and stateless messages may be accomplished by the programmable switch 103. The protocol traffic generation and processing function is realized on the programmable switch 103, and the programmable switch 103 is used for processing the protocol by using hardware, so that the data processing method provided by the embodiment of the application can be realized, and for hardware testing, high-throughput stateful data streams can be generated and processed; for software testing, high-throughput data streams may be generated and processed, and target stress tests may be provided to the protocol processing device. The protocol message processing module 1033 adjusts the abstract message according to the configuration information, so that a user-defined message structure can be realized, and the user-defined protocol message can be tested. The protocol message is circularly written into a new state for many times through the protocol message processing module 1033, so that the generation and processing of high-throughput network protocol data streams can be realized, and the large-scale test requirement on the protocol processing function of the network test equipment can be realized.
In addition, the programmable switch 103 in the embodiment of the present application may provide different functions according to different types of messages processed. Illustratively, as shown in fig. 4, when the protocol packet digest queue is a single queue, the protocol packet digest queue number Qi is fixed to 0, and only one register is needed for each of the queue head pointer, the queue tail pointer, and the queue length for maintaining the queue data structure. If the process of the protocol message processing module 1033 on the digest message does not involve the history message, the digest processing program table and the protocol message queue do not need to store the flow state, and at this time, the programmable switch 103 is equivalent to a deterministic automaton having only two states, which are only transferred from the starting state to the ending state.
In another example, as shown in the structure of fig. 5, when the load carried by the result packet does not need to be modified and the structure of the result packet is consistent with that of the protocol packet, the protocol packet queue module 1032 and the circular template packet in the structure shown in fig. 3 may be omitted.
It should be noted that the programmable switch 103 in the embodiment of the present application may be applied to any scenario of testing a protocol processing function, for example, may be applied to a data center, where the data center needs to detect protocol processing performance of multiple devices, and therefore, a long-time and high-throughput protocol traffic needs to be generated and processed, so as to detect parameters such as stability, power consumption, and latency of multiple devices or a device group under high voltage, and thus determine whether a bottleneck exists in a data center service.
In addition, the programmable switch 103 in this embodiment of the present Application may also be applied to at least one cloud platform of a public cloud, a private cloud, a proprietary cloud, and a hybrid cloud, or may also be applied to entity devices, such as SNA network tester devices, or may be applied to some software applications (applications) that need to perform a protocol processing function test, so as to achieve high concurrency and high throughput processing performance for a network protocol data stream, and meet a large-scale test requirement for a protocol processing function.
In addition, programmable switch 103 may also perform the above-described manner in the form of a computer program product or in the form of a computer-readable storage medium, for example, when in the form of a computer program product, programmable switch 103 is a system Network architecture Network tester equipment (SNA).
According to the above architecture and application scenarios, the data processing method based on the programmable switch provided in the embodiment of the present application is described in detail below with reference to fig. 6.
Figure 6 is a flow diagram illustrating a programmable switch-based data processing method according to one embodiment.
As shown in fig. 6, the data processing method may be applied to a data processing device based on a programmable switch, and the data processing method based on the programmable switch may specifically include:
step 610, acquiring a protocol message; step 620, according to the protocol message, determining summary information in a preset protocol message summary queue; step 630, generating a summary message based on the summary information and the template message; acquiring configuration information in the network protocol data stream corresponding to the protocol message according to the summary information; and step 640, adjusting the abstract message according to the configuration information to obtain a feedback result of the protocol message.
The above steps are described in detail below, specifically as follows.
Before step 610 is involved, the data processing method based on a programmable switch in the embodiment of the present application may further include:
receiving at least one message;
classifying each message according to the header and the field of each message in at least one message to obtain the message type of each message;
and marking the message type of each message in the metadata of each message.
Based on this, step 610 may specifically include:
identifying metadata of each message to obtain the message type of each message;
and determining the message as a protocol message under the condition that the message type of each message meets the preset protocol message type.
Referring to step 620, according to the protocol packet obtained in step 610, digest information in a preset protocol packet digest queue is determined, where the digest information may include key fields extracted from the protocol packet and a current flow state.
Based on this, step 620 in this embodiment may specifically include step 6201 to step 6203.
And 6201, extracting the protocol field of the preset position in the protocol message according to the protocol message.
And 6202, writing the protocol field into a preset protocol message abstract queue to obtain abstract information.
Here, the preset position may be a position set by a user according to a requirement and a protocol processing flow with a state, and the preset protocol message digest queue may be a multi-queue data structure implemented in a programmable switch.
Illustratively, according to metadata of a protocol message, extracting a protocol field at a preset position in the protocol message, writing the protocol field as a summary of the protocol message into a preset protocol message summary queue, and searching a current flow state according to characteristics of the protocol message and enqueuing the current flow state into the protocol message summary queue together to obtain summary information, wherein the current flow state can be a state of establishing connection, closing connection, responding and the like.
Therefore, when the protocol message in the data stream is processed, the current stream state of the protocol message is represented in the preset protocol message abstract queue, the protocol field of the preset position in the protocol message is extracted, and the protocol field is written into the preset protocol message abstract queue to obtain abstract information, so that the protocol message in different states in the data stream can be accurately processed at a later stage.
The steps 6201 to 6203 are described in detail below.
In one or more possible examples, this step 6202 may specifically include:
step 62021, according to the protocol field, acquiring the enqueue serial number of the protocol message in the preset protocol message abstract queue, the enqueue serial number corresponding to the first queue;
step 62022, adding the enqueue sequence number and the queue length of the first queue in the register;
step 62023, according to the enqueue sequence number, obtaining a queue tail pointer of the first queue, and adding the queue tail pointer to a register, wherein the queue tail pointer is used for indicating a relative offset of the first queue;
step 62024, acquiring a first offset of the queue tail pointer relative to the register according to the enqueue serial number, the queue capacity of the first queue and the queue tail pointer;
step 62025, according to the first offset, writing the protocol field into the register to obtain the summary information.
Illustratively, when the protocol field is written into a preset protocol message digest queue to obtain digest information, a group of queue head pointers, a group of queue tail pointers and a group of queue lengths are set to maintain the data structure of each queue, and the capacity of a single queue may be 2 n.
Based on the method, according to the protocol field, an enqueue sequence number Qi is obtained from a preset protocol message abstract queue, the enqueue sequence number Qi corresponds to a first queue, and the enqueue sequence number Qi and the queue length are added to a register, wherein the protocol field can be a designated header or field of the protocol message. Using the queue number Qi as a subscript, a queue tail pointer Ti of the first queue is obtained, which indicates the relative offset of the first queue. And shifting the queue number Qi to the left by N bits, performing bitwise OR on the queue number Qi and a queue tail pointer Ti to obtain an offset Ti 'of the queue tail pointer Ti relative to a register, and writing a specified field of the protocol message into the register offset according to the offset Ti' to obtain summary information.
Therefore, in order to solve the problem that a queue data structure does not exist in the P4 language, the data processing method based on the programmable switch provided in the embodiment of the present application may implement data processing by a register set in the programmable switch when the preset protocol packet digest queue is a multi-queue, where when the preset protocol packet digest queue of the multi-queue is enqueued, an enqueue number of a protocol packet in the preset protocol packet digest queue, a first queue corresponding to the enqueue number, and a queue tail pointer for indicating a relative offset of the first queue are obtained, and then the enqueue number, a queue length of the first queue, and a queue tail pointer are added to the register. And according to the enqueue sequence number, the queue capacity of the first queue and the queue tail pointer, acquiring a first offset of the queue tail pointer relative to the register, and writing the protocol field into the register according to the first offset to obtain the summary information. Therefore, under the condition that the protocol message digest queue is preset to be a multi-queue, the register of the queue structure in the programmable switch can be effectively maintained.
It should be noted that P4 is a switch chip programming language, and P4 allows a user to write a P4 program and then generate a binary code (binary code) into the chip of the P4 switch through a compiler.
In one or more possible examples, the preset protocol packet digest queue may include a flow state queue corresponding to the protocol packet, and based on this, the step 62021 may specifically include:
determining whether a preset protocol message abstract queue comprises a flow state queue corresponding to a protocol message or not according to the protocol field; and under the condition that the preset protocol message abstract queue comprises a flow state queue corresponding to the protocol message, determining the queue serial number of the flow state queue as an enqueue serial number.
Illustratively, the preset protocol packet digest queue may include a flow state queue corresponding to the protocol packet, where the queue number of the flow state queue is determined as an enqueue number Qi in the case that the preset protocol packet digest queue is a multi-queue, and the queue number Qi is fixed to 0 in the case that the preset protocol packet digest queue is a single-queue.
Therefore, when the preset protocol message abstract queues of the multiple queues are enqueued, the queue number of the flow state queue is determined as the enqueue number under the condition that the preset protocol message abstract queue comprises the flow state queue corresponding to the protocol message according to the protocol field, so that the register of the queue structure in the programmable switch can be further effectively maintained.
Based on this, before step 630, the data processing method based on a programmable switch in the embodiment of the present application may further include:
according to the template message, acquiring a dequeue serial number of the template message, wherein the dequeue serial number is a serial number of a second queue, and the dequeue serial number corresponds to the enqueue serial number; adjusting the queue length stored in the register according to the queue length of the second queue; acquiring a queue head pointer of the second queue according to the dequeue sequence number, wherein the queue head pointer is used for indicating the relative offset of the second queue and adding the queue head pointer in a register; acquiring a second offset of the queue head pointer relative to the register according to the dequeue sequence number, the queue capacity of the second queue and the queue head pointer; and acquiring the abstract message according to the second offset.
Illustratively, according to the template message, a dequeue sequence number Qi of the template message is configured from the control platform, where the dequeue sequence number Qi is a sequence number of the second queue, and according to the queue length of the second queue, the queue length stored in the register is adjusted, and if the queue length is nonzero, the queue length is self-decremented. When the queue length is not zero, a queue head pointer Hi of the second queue is obtained by using the queue sequence number Qi as a subscript, the queue head pointer Hi indicates the relative offset of the target queue, and the queue head pointer Hi is added into the register. And shifting the queue sequence number Qi to the left by N bits, and bitwise OR-ing the queue head pointer Hi to obtain the offset Hi 'of the queue head pointer Hi relative to the register, and writing the data of the register which is offset according to Hi' into a specified message field to obtain the abstract message.
Therefore, the dequeue sequence number of the second queue corresponding to the enqueue sequence number in the template message is obtained, and the queue length stored in the register is adjusted according to the queue length of the second queue. And acquiring a queue head pointer of the second queue for indicating the relative offset of the second queue according to the dequeue sequence number, and adding the queue head pointer in a register. And then, acquiring a second offset of the queue head pointer relative to the register according to the dequeue sequence number, the queue capacity of the second queue and the queue head pointer, and acquiring the abstract message according to the second offset. Therefore, the digest enqueue serial number and the digest dequeue serial number of the protocol message can be corresponding to each other, and the accuracy of the digest message is ensured.
And 630, when the template message is received, writing the abstract information of the protocol message related to the step 620 into a field corresponding to the template message to generate an abstract message, and acquiring the configuration information in the network protocol data stream corresponding to the protocol message from the abstract processing program table according to the abstract information in the abstract message.
Illustratively, a template message issued by a control plane is acquired, summary information is written into a corresponding field of the template message according to the summary information dequeued from a preset protocol message summary queue and the stream state, a summary message is generated, and key fields of the summary message and information of the stream state are matched according to a summary processing program table, wherein the summary processing program table can be a matching operation (Match-Action) table in a programmable switch.
Based on this, the embodiments of the present application provide the following two ways of generating a summary message, which are specifically shown as follows.
In one or more possible examples, step 630 may specifically include:
acquiring a template message, wherein the template message carries a preset indication field; acquiring a first position according to a preset indication field, wherein the first position is the position of a first target field in the template message, which is indicated by the preset indication field and used for writing the abstract information; and writing the abstract information into the first target field according to the first position to generate an abstract message.
Illustratively, a template message sent by the control plane is obtained, the module message may carry a preset indication field, the preset indication field is used for indicating internal circulation and rewriting of the module message, a position where the abstract information is written in the template message is obtained from the preset indication field, and according to the position, the abstract information is written in a field corresponding to the position in the template message to generate the abstract message.
Therefore, when the template message in the data stream is processed, the position of the preset indication field indicating abstract information written in the first target field in the template message is obtained according to the preset indication field carried by the template message, and the abstract information is written in the first target field according to the first position to generate the abstract message.
In another possible example or examples, step 630 may specifically include:
determining a second position in the template message according to the field attribute of the abstract information, wherein the second position is a position of a second target field in the template message written with the abstract information, and the field attribute can be the length, the format, the mandatory field and the like of the field;
and writing the abstract information into a second target field according to the second position to obtain an abstract message.
Illustratively, the position of the abstract information written in the second target field in the template message is determined according to the attributes of the field length, the format, the mandatory field and the like of the abstract information, and the abstract information is written in the second target field according to the position to obtain the abstract message, so that the protocol message can be conveniently processed subsequently, and the space is saved.
Then, the embodiments of the present application provide the following two ways to obtain configuration information, which are specifically shown as follows.
In one or more possible examples, the step 630 may specifically include:
in a preset abstract processing program table, acquiring configuration information in a data stream corresponding to a protocol message according to abstract information; the configuration information includes first processing state information and execution information of a preset operation corresponding to the first processing state information, and the first state information is used for representing state information of the protocol packet in the data stream.
It should be noted that the preset digest processing program table may be a Match-Action table in the programmable switch, and each Match-Action table in the data plane may be re-customized by data plane programming, so that the Match-Action table may support various protocols and algorithms. The first state information may be information of a flow state of the digest packet.
Illustratively, according to the summary information, state information is searched from a data packet or metadata of a data stream corresponding to the protocol packet, then a Match-Action table is executed according to the state information to perform searching, execution information of a preset operation corresponding to the state information is obtained, and subsequently, the executed preset operation can be selected and the selected preset operation is executed.
Therefore, in the preset abstract processing program table, the state information of the protocol message in the data stream corresponding to the protocol message and the execution information of the preset operation corresponding to the state information are obtained according to the abstract information, and the abstract message is convenient to adjust subsequently.
In another possible example or examples, the digest information carries a target sequence number, and the target sequence number includes at least one of: under the circumstances of the enqueue sequence number and the dequeue sequence number, the step 630 may specifically include:
and acquiring configuration information in the data stream corresponding to the protocol message according to the target sequence number in a preset abstract processing program table.
Illustratively, at least one target sequence number of an enqueue sequence number or an dequeue sequence number is obtained from the summary information, and a preset summary processing program table is executed according to the target sequence number for searching to obtain configuration information corresponding to the target sequence number in the data stream corresponding to the protocol message.
Therefore, when the abstract message is adjusted, the configuration information in the data stream corresponding to the protocol message is acquired according to at least one target sequence number of the enqueue sequence number or the dequeue sequence number carried by the abstract information in the preset abstract processing program table, so that the configuration information corresponding to the target sequence number is acquired, and the accuracy of processing the protocol message is improved.
Step 640 is involved, the digest message is rewritten according to the configuration information to obtain a feedback result of the protocol message, and the feedback result of the protocol message may include a result message.
Illustratively, a state number in a flow state in the summary message is acquired, an action sequence which needs to be executed on the summary message is searched from a Match-action table according to the state number, an action to be executed is selected, and finally the selected action is executed. The actions performed may be, for example, adding load, modifying message fields, state transitions, etc. And after the selected action is executed on the abstract message, obtaining a new state number and writing the new state number into a state register corresponding to the data stream. In addition, after the selected action is executed on the abstract message, a feedback result of the protocol message is generated, and the feedback result can comprise a result message.
Therefore, the abstract information in the preset protocol message abstract queue is determined based on the acquired protocol message, the abstract message is generated based on the abstract information and the template message, the configuration information in the network protocol data stream corresponding to the protocol message is acquired according to the abstract information, and then the abstract message is adjusted according to the configuration information to obtain the feedback result of the protocol message. Therefore, the generation and processing of the high-throughput network protocol data stream can be realized, the large-scale test requirement on the protocol processing function of the network test equipment is realized, the abstract message is adjusted according to the configuration information, the self-defined message structure can be realized, and the self-defined protocol message is tested.
In one or more possible examples, step 640 may specifically include:
executing preset operation on the abstract message according to the execution information to obtain first execution result information; acquiring second processing state information of the protocol message according to the first execution result information; acquiring a first result message corresponding to the second processing state information in a preset abstract processing program table; and determining that the first result message is a feedback result of the protocol message.
The second processing state information may be information of a new state generated after performing a preset operation.
Illustratively, after obtaining the execution information of the preset operation corresponding to the state information by searching from the Match-Action table, the preset operation is performed on the digest message according to the execution information to obtain first execution result information, and a first result message corresponding to the first execution result information is generated in the preset digest processing program table, where the first result message may include second processing state information of the protocol message, where the second processing state information may be state information generated after the preset operation is performed. At this time, the first result message is determined to be the feedback result of the protocol message.
Therefore, when the abstract message is processed, the preset operation is executed on the abstract message according to the execution information to obtain first execution result information, second processing state information of the protocol message is obtained according to the first execution result information, then, a first result message corresponding to the second processing state information is obtained in a preset abstract processing program table, and the first result message is determined to be a feedback result of the protocol message. Therefore, new processing state information of the protocol message and a feedback result of the protocol message can be obtained after the preset operation is executed, and the protocol message can be conveniently processed in a subsequent cycle.
In addition, after step 640, the data processing method based on the programmable switch according to the embodiment of the present application may further update the digest information in the preset protocol packet digest queue according to the above-mentioned second processing state information, so as to obtain the processing state of the protocol packet in the network protocol data stream more accurately next time, and based on this, the data processing method based on the programmable switch further includes:
and storing the second processing state information in a register so as to update the summary information in the preset protocol message summary queue.
Illustratively, after the preset operation is performed on the digest message, the generated information of the new state is written into the register, thereby facilitating the update of the digest information in the preset protocol message digest queue.
In addition, an embodiment of the present application provides a template packet generation method, that is, in a case that a feedback result includes multicast forwarding information, the data processing method based on a programmable switch according to the embodiment of the present application may further include:
and sending a first copy of the feedback result to the network equipment according to the multicast forwarding information, and performing message reduction on a second copy of the feedback result to obtain a template message.
Illustratively, when the feedback result includes multicast forwarding information, at least one first copy of the feedback result is sent to at least one network device according to the multicast forwarding information carried by the feedback result, and a second copy of the feedback result is subjected to message restoration to obtain a template message.
Therefore, under the condition that the feedback result comprises the multicast forwarding information, the first copy of the feedback result is sent to the network equipment according to the multicast forwarding information, and the second copy of the feedback result is subjected to message restoration to obtain the template message. Therefore, the abstract messages can be rewritten for multiple times through circularly processing the protocol messages, the high throughput function of the data is achieved, and the large-scale test requirement on the protocol processing function is met.
In summary, the summary information in the preset protocol message summary queue is determined based on the obtained protocol message, the summary message is generated based on the summary information and the template message, the configuration information in the network protocol data stream corresponding to the protocol message is obtained according to the summary information, and then the summary message is adjusted according to the configuration information, so as to obtain the feedback result of the protocol message. Therefore, the generation and processing of the high-throughput network protocol data stream can be supported, and the large-scale test requirement on the protocol processing function of the network test equipment is realized.
Based on the same inventive concept, the present application provides a programmable switch-based data processing apparatus corresponding to the above-mentioned programmable switch-based data processing method. The details are described with reference to fig. 7.
Figure 7 is a block diagram illustrating a programmable switch based data processing apparatus according to one embodiment.
As shown in fig. 7, the programmable switch-based data processing apparatus 700 may specifically include:
an obtaining module 701, configured to obtain a protocol packet;
a determining module 702, configured to determine, according to a protocol packet, summary information in a preset protocol packet summary queue;
a generating module 703, configured to generate a summary message based on the summary information and the template message; acquiring configuration information in the network protocol data stream corresponding to the protocol message according to the summary information;
and an adjusting module 704, configured to adjust the abstract message according to the configuration information, so as to obtain a feedback result of the protocol message.
Based on this, the following describes the programmable switch-based data processing apparatus 700 provided in the embodiment of the present application in detail:
in one or more possible embodiments, the programmable switch-based data processing apparatus 700 can further include an extraction module and a write module;
the extraction module is used for extracting a protocol field at a preset position in the protocol message according to the protocol message;
and the writing module is used for writing the protocol field into a preset protocol message abstract queue to obtain abstract information.
In one or more possible embodiments, the programmable switch-based data processing apparatus 700 can further include an add-on module;
the obtaining module 701 is further configured to obtain, according to the protocol field, an enqueue number of the protocol packet in a preset protocol packet digest queue, where the enqueue number corresponds to the first queue;
the adding module is used for adding the enqueue serial number and the queue length of the first queue in the register;
the obtaining module 701 is further configured to obtain a queue tail pointer of the first queue according to the enqueue serial number, and add the queue tail pointer to the register, where the queue tail pointer is used to indicate a relative offset of the first queue;
the obtaining module 701 is further configured to obtain a first offset of the queue tail pointer with respect to the register according to the enqueue number, the queue capacity of the first queue, and the queue tail pointer;
the writing module is further configured to write the protocol field into the register according to the first offset to obtain the summary information.
In one or more possible embodiments, the determining module 702 is further configured to determine, according to the protocol field, whether a flow state queue corresponding to the protocol packet is included in the preset protocol packet digest queue;
the determining module 702 is further configured to determine a queue number of the flow state queue as an enqueue number when the preset protocol packet digest queue includes the flow state queue corresponding to the protocol packet.
In one or more possible embodiments, the obtaining module 701 is further configured to obtain a template message, where the message template carries a preset indication field;
the obtaining module 701 is further configured to obtain a first position according to the preset indication field, where the first position is a position where the preset indication field indicates that the summary information is written in a first target field in the template message;
the writing module is further used for writing the summary information into the first target field according to the first position to generate a summary message.
In one or more possible embodiments, the determining module 702 is further configured to determine, according to the field attribute of the summary information, a second location in the template message, where the second location is a location where the summary information is written into a second target field in the template message;
and the writing module is also used for writing the abstract information into a second target field according to the second position to obtain the abstract message.
In one or more possible embodiments, the obtaining module 701 is further configured to, before generating the summary message based on the summary information and the template message, obtain a dequeue sequence number of the template message according to the template message, where the dequeue sequence number is a sequence number of the second queue, and the dequeue sequence number corresponds to the enqueue sequence number;
the adjusting module 704 is further configured to adjust the queue length stored in the register according to the queue length of the second queue;
the obtaining module 701 is further configured to obtain a queue head pointer of the second queue according to the dequeue sequence number, where the queue head pointer is used to indicate a relative offset of the second queue, and add the queue head pointer to the register;
the obtaining module 701 is further configured to obtain a second offset of the queue head pointer with respect to the register according to the dequeue sequence number, the queue capacity of the second queue, and the queue head pointer;
the obtaining module 701 is further configured to obtain the target digest according to the second offset.
In one or more possible embodiments, the obtaining module 701 is further configured to obtain, in a preset digest processing program table, configuration information in a data stream corresponding to the protocol packet according to the digest information; wherein the content of the first and second substances,
the configuration information includes first processing state information and execution information of a preset operation corresponding to the first processing state information, and the first state information is used for representing state information of the protocol packet in the data stream.
In one or more possible embodiments, the digest information carries a target sequence number, and the target sequence number includes at least one of the following: an enqueue serial number and an dequeue serial number; the programmable switch-based data processing apparatus 700 can also include an execution module;
the obtaining module 701 is further configured to obtain, in a preset digest processing program table, configuration information in the data stream corresponding to the protocol packet according to the target sequence number.
In one or more possible embodiments, the execution module is configured to execute a preset operation on the summary message according to the execution information to obtain first execution result information;
the obtaining module 701 is further configured to obtain second processing state information of the protocol packet according to the first execution result information;
the obtaining module 701 is further configured to obtain, in a preset digest processing program table, a first result message corresponding to the second processing state information;
the determining module 702 is further configured to determine that the first result packet is a feedback result of the protocol packet.
In one or more possible embodiments, the programmable switch-based data processing apparatus 700 can further include a storage module;
and the storage module is used for storing the second processing state information in a register so as to update the summary information in the preset protocol message summary queue.
In one or more possible embodiments, the feedback result includes multicast forwarding information, and the programmable switch-based data processing apparatus 700 may further include a sending module;
and the sending module is used for sending the first copy of the feedback result to the network equipment according to the multicast forwarding information and carrying out message restoration on the second copy of the feedback result to obtain the template message.
Therefore, under the condition that the protocol message digest queue is preset to be a multi-queue, a register of a queue structure in the programmable switch can be effectively maintained, and when the digest message is processed, new processing state information of the protocol message and a feedback result of the protocol message are obtained after the preset operation is executed, so that the protocol message can be conveniently processed in a subsequent cycle, a high throughput function of data is achieved, and the large-scale test requirement on the protocol processing function is met.
Based on the same inventive concept, the present application provides a programmable switch-based data processing apparatus corresponding to the above-mentioned programmable switch-based data processing method. The details are described with reference to fig. 7.
Figure 8 is a block diagram illustrating a programmable switch based protocol message processing apparatus according to one embodiment.
As shown in fig. 8, the protocol packet processing apparatus 800 based on a programmable switch may specifically include:
an obtaining module 801, configured to obtain a protocol packet transmitted by a device under test, where the device under test is a device that performs data transmission with a programmable switch;
a determining module 802, configured to determine, according to the protocol packet, digest information in a preset protocol packet digest queue;
a generating module 803, configured to generate a summary message based on the summary information and the template message; acquiring configuration information in a network protocol data stream corresponding to the protocol message according to the summary information;
an adjusting module 804, configured to adjust the abstract message according to the configuration information, obtain a feedback result of the protocol message, and send the feedback result of the protocol message to the device under test.
Therefore, the abstract information in the preset protocol message abstract queue is determined by acquiring the protocol message transmitted by the tested equipment for data transmission with the programmable switch, the abstract message is generated based on the abstract information and the template message issued by the control plane corresponding to the programmable switch, the configuration information in the network protocol data stream corresponding to the protocol message is acquired according to the abstract information, and then the abstract message is adjusted according to the configuration information to obtain the feedback result of the protocol message. Therefore, the generation and processing of the high-throughput network protocol data stream can be supported, and the large-scale test requirement on the protocol processing function of the network test equipment is realized.
Fig. 9 is a diagram showing a hardware configuration of a computer apparatus according to an embodiment.
As shown in fig. 9, computer device 900 includes an input device 901, an input interface 902, a processor 903, a memory 904, an output interface 905, and an output device 906.
The input interface 902, the processor 903, the memory 904, and the output interface 905 are connected to each other via a bus 910, and the input device 901 and the output device 906 are connected to the bus 910 via the input interface 902 and the output interface 905, respectively, and further connected to other components of the computer device 900. Specifically, the input device 901 receives input information from the outside and transmits the input information to the processor 903 through the input interface 902; the processor 903 processes the input information based on computer-executable instructions stored in the memory 904 to generate output information, stores the output information in the memory 904 temporarily or permanently, and then transmits the output information to the output device 906 via the output interface 905; the output device 906 outputs the output information to the outside of the computer device 900 for use by the user.
In one embodiment, the computer device 900 shown in fig. 9 may be implemented as a data processing device that may include: a memory configured to store a program; a processor configured to execute the program stored in the memory to perform the data processing method described in the above embodiments.
In one embodiment, the memory may also be used to store protocol messages and template messages and the results of the calculations for each step in the data processing described in conjunction with fig. 1-6 above. As an example, the calculation result includes at least: the method comprises the steps of setting an enqueue serial number of a protocol message in a preset protocol message digest queue, the queue length of a first queue, a queue tail pointer of the first queue indicating the relative offset of the first queue and a first offset of the queue tail pointer relative to a register.
According to an embodiment of the present application, the process described above with reference to the flowchart may be implemented as a computer-readable storage medium. For example, embodiments of the present application include a computer-readable storage medium comprising a program or instructions stored thereon, which, if executed by a computer device, cause the computer device to perform the steps of the above-described method.
According to an embodiment of the application, the process described above with reference to the flow chart may be implemented as a computer software program. For example, embodiments of the present application include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network, and/or installed from a removable storage medium.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions which, when run on a computer, cause the computer to perform the methods described in the various embodiments above. The procedures or functions according to the embodiments of the present application are all or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), among others.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications or substitutions do not depart from the scope of the embodiments of the present application.

Claims (18)

1. A protocol message processing method based on a programmable switch comprises the following steps:
acquiring a protocol message transmitted by a tested device, wherein the tested device is a device for data transmission with a programmable switch;
determining abstract information in a preset protocol message abstract queue according to the protocol message;
generating an abstract message based on the abstract information and the template message; acquiring configuration information in a network protocol data stream corresponding to the protocol message according to the summary information;
and adjusting the abstract message according to the configuration information to obtain a feedback result of the protocol message, and sending the feedback result of the protocol message to the tested equipment.
2. A programmable switch-based data processing method, comprising:
acquiring a protocol message;
determining abstract information in a preset protocol message abstract queue according to the protocol message;
generating an abstract message based on the abstract information and the template message; acquiring configuration information in a network protocol data stream corresponding to the protocol message according to the summary information;
and adjusting the abstract message according to the configuration information to obtain a feedback result of the protocol message.
3. The method of claim 2, wherein the determining digest information in a predetermined protocol packet digest queue according to the protocol packet comprises:
extracting a protocol field of a preset position in the protocol message according to the protocol message;
and writing the protocol field into the preset protocol message abstract queue to obtain the abstract information.
4. The method according to claim 3, wherein the writing the protocol field into the predetermined protocol packet digest queue to obtain the digest information comprises:
according to the protocol field, acquiring an enqueue serial number of the protocol message in a preset protocol message abstract queue, wherein the enqueue serial number corresponds to a first queue;
adding the enqueue sequence number and the queue length of the first queue in a register;
acquiring a queue tail pointer of the first queue according to the enqueuing sequence number, and adding the queue tail pointer into the register, wherein the queue tail pointer is used for indicating the relative offset of the first queue;
acquiring a first offset of the queue tail pointer relative to the register according to the enqueue serial number, the queue capacity of the first queue and the queue tail pointer;
and writing the protocol field into the register according to the first offset to obtain the summary information.
5. The method according to claim 4, wherein the obtaining, according to the protocol field, an enqueue sequence number of the protocol packet in a preset protocol packet digest queue comprises:
determining whether a flow state queue corresponding to the protocol message is included in the preset protocol message abstract queue or not according to the protocol field;
and under the condition that the preset protocol message abstract queue comprises a flow state queue corresponding to the protocol message, determining the queue number of the flow state queue as the enqueue number.
6. The method of claim 2, wherein generating a summary message based on the summary information and a template message comprises:
obtaining a template message, wherein the message template carries a preset indication field;
acquiring a first position according to the preset indication field, wherein the first position is a position where the preset indication field indicates that the summary information is written into a first target field in the template message;
and writing the abstract information into the first target field according to the first position to generate an abstract message.
7. The method of claim 2, wherein generating a summary message based on the summary information and a template message comprises:
determining a second position in the template message according to the field attribute of the summary information, wherein the second position is a position where the summary information is written into a second target field in the template message;
and writing the abstract information into the second target field according to the second position to obtain an abstract message.
8. The method of claim 2, wherein prior to generating a summary message based on the summary information and a template message, the method further comprises:
according to the template message, acquiring a dequeue serial number of the template message, wherein the dequeue serial number is a serial number of a second queue, and the dequeue serial number corresponds to the enqueue serial number;
adjusting the queue length stored in a register according to the queue length of the second queue;
acquiring a queue head pointer of the second queue according to the dequeue sequence number, wherein the queue head pointer is used for indicating the relative offset of the second queue and adding the queue head pointer into the register;
acquiring a second offset of the queue head pointer relative to the register according to the dequeue sequence number, the queue capacity of the second queue and the queue head pointer;
and acquiring the abstract message according to the second offset.
9. The method of claim 2, wherein the obtaining configuration information in a data stream corresponding to the protocol packet according to the summary information comprises:
in a preset abstract processing program table, acquiring configuration information in a data stream corresponding to the protocol message according to the abstract information; wherein, the first and the second end of the pipe are connected with each other,
the configuration information includes first processing state information and execution information of a preset operation corresponding to the first processing state information, where the first state information is used to represent state information of the protocol packet in the data stream.
10. The method of claim 9, wherein the summary information carries a target sequence number, the target sequence number comprising at least one of: an enqueue serial number and an dequeue serial number;
in the preset summary processing program table, obtaining configuration information in a data stream corresponding to the protocol packet according to the summary information, including:
and acquiring configuration information in a data stream corresponding to the protocol message in the preset abstract processing program table according to the target sequence number.
11. The method of claim 9, wherein the adjusting the digest packet according to the configuration information to obtain the feedback result of the protocol packet comprises:
executing the preset operation on the abstract message according to the execution information to obtain first execution result information;
acquiring second processing state information of the protocol message according to the first execution result information; acquiring a first result message corresponding to the second processing state information in a preset abstract processing program table;
and determining that the first result message is a feedback result of the protocol message.
12. The method of claim 11, wherein the method further comprises:
and storing the second processing state information in a register so as to update the summary information in the preset protocol message summary queue.
13. The method of claim 2, wherein the feedback result comprises multicast forwarding information; the method further comprises the following steps:
and sending the first copy of the feedback result to network equipment according to the multicast forwarding information, and performing message reduction on the second copy of the feedback result to obtain a template message.
14. A protocol message processing arrangement based on a programmable switch, comprising:
the device comprises an acquisition module, a processing module and a control module, wherein the acquisition module is used for acquiring a protocol message transmitted by a tested device, and the tested device is a device for data transmission with a programmable switch;
the determining module is used for determining summary information in a preset protocol message summary queue according to the protocol message;
the generating module is used for generating abstract messages based on the abstract information and the template messages; acquiring configuration information in a network protocol data stream corresponding to the protocol message according to the summary information;
and the adjusting module is used for adjusting the abstract message according to the configuration information to obtain a feedback result of the protocol message and sending the feedback result of the protocol message to the tested equipment.
15. A programmable switch-based data processing apparatus comprising:
the acquisition module is used for acquiring the protocol message;
the determining module is used for determining summary information in a preset protocol message summary queue according to the protocol message;
the generating module is used for generating abstract messages based on the abstract information and the template messages; acquiring configuration information in a data stream corresponding to the protocol message according to the summary information;
and the adjusting module is used for adjusting the abstract message according to the configuration information to obtain a feedback result of the protocol message.
16. A computer device, comprising: a memory and a processor, wherein the processor is capable of,
the memory for storing a computer program;
the processor configured to execute the computer program stored in the memory, the computer program when executed causing the processor to perform the steps of the programmable switch-based protocol message processing method of claim 1 or the steps of the programmable switch-based data processing method of any one of claims 1 to 13.
17. A computer readable storage medium having stored thereon a program or instructions which, if executed by a computer device, cause the computer device to perform the steps of the programmable switch-based protocol message processing method of claim 1 or to perform the steps of the programmable switch-based data processing method of any of claims 1 to 13.
18. A computer program product comprising a computer program which, if executed by a computer device, causes the computer device to perform the steps of the programmable switch-based protocol message processing method of claim 1 or the steps of the programmable switch-based data processing method of any one of claims 1 to 13.
CN202210111588.2A 2022-01-29 2022-01-29 Protocol message processing method, device and equipment based on programmable switch Pending CN114553757A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210111588.2A CN114553757A (en) 2022-01-29 2022-01-29 Protocol message processing method, device and equipment based on programmable switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210111588.2A CN114553757A (en) 2022-01-29 2022-01-29 Protocol message processing method, device and equipment based on programmable switch

Publications (1)

Publication Number Publication Date
CN114553757A true CN114553757A (en) 2022-05-27

Family

ID=81674305

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210111588.2A Pending CN114553757A (en) 2022-01-29 2022-01-29 Protocol message processing method, device and equipment based on programmable switch

Country Status (1)

Country Link
CN (1) CN114553757A (en)

Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1303086A2 (en) * 2001-10-09 2003-04-16 Alcatel A hierarchical protocol classification engine
WO2013059991A1 (en) * 2011-10-25 2013-05-02 华为技术有限公司 Data message processing method and system, message forwarding device
US20140236527A1 (en) * 2013-02-21 2014-08-21 Advantest Corporation Cloud based infrastructure for supporting protocol reconfigurations in protocol independent device testing systems
WO2014202030A1 (en) * 2013-06-21 2014-12-24 北京邮电大学 Network controller, switch and method for increasing openflow network capability
US20150370675A1 (en) * 2014-06-21 2015-12-24 Ixia Methods, systems, and computer readable media for utilizing abstracted user-defined data to conduct network protocol testing
CN105227407A (en) * 2015-10-16 2016-01-06 邦讯技术股份有限公司 A kind of protocol debugging method, Apparatus and system
WO2018113425A1 (en) * 2016-12-19 2018-06-28 华为技术有限公司 Method, apparatus and system for detecting time delay
CN109039814A (en) * 2018-07-26 2018-12-18 北京明朝万达科技股份有限公司 A kind of protocol testing method and device
CN109787833A (en) * 2019-01-23 2019-05-21 清华大学 Network exception event cognitive method and system
CN111683066A (en) * 2020-05-27 2020-09-18 平安养老保险股份有限公司 Heterogeneous system integration method and device, computer equipment and storage medium
US20210092122A1 (en) * 2019-09-23 2021-03-25 Vmware, Inc. Centralized capability system for programmable switches
CN112714047A (en) * 2021-03-29 2021-04-27 北京网测科技有限公司 Industrial control protocol flow based test method, device, equipment and storage medium
CN112822722A (en) * 2020-12-30 2021-05-18 联想未来通信科技(重庆)有限公司 Data message transmission method and device
CN113037691A (en) * 2019-12-24 2021-06-25 中国移动通信集团浙江有限公司 Message processing method, device and system
CN113055196A (en) * 2019-12-28 2021-06-29 华为技术有限公司 Message processing method, network device and computer readable storage medium
CN113162816A (en) * 2020-12-29 2021-07-23 深圳市吉祥腾达科技有限公司 Testing method and testing system for OSPFv3 protocol of switch
CN113691486A (en) * 2020-05-19 2021-11-23 中移(成都)信息通信科技有限公司 Message modification method, device, equipment and storage medium
CN113938405A (en) * 2020-07-10 2022-01-14 北京华为数字技术有限公司 Data processing method and device
WO2022017249A1 (en) * 2020-07-21 2022-01-27 阿里巴巴集团控股有限公司 Programmable switch, traffic statistics method, defense method, and packet processing method

Patent Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1303086A2 (en) * 2001-10-09 2003-04-16 Alcatel A hierarchical protocol classification engine
WO2013059991A1 (en) * 2011-10-25 2013-05-02 华为技术有限公司 Data message processing method and system, message forwarding device
US20140236527A1 (en) * 2013-02-21 2014-08-21 Advantest Corporation Cloud based infrastructure for supporting protocol reconfigurations in protocol independent device testing systems
WO2014202030A1 (en) * 2013-06-21 2014-12-24 北京邮电大学 Network controller, switch and method for increasing openflow network capability
US20150370675A1 (en) * 2014-06-21 2015-12-24 Ixia Methods, systems, and computer readable media for utilizing abstracted user-defined data to conduct network protocol testing
CN105227407A (en) * 2015-10-16 2016-01-06 邦讯技术股份有限公司 A kind of protocol debugging method, Apparatus and system
WO2018113425A1 (en) * 2016-12-19 2018-06-28 华为技术有限公司 Method, apparatus and system for detecting time delay
CN109039814A (en) * 2018-07-26 2018-12-18 北京明朝万达科技股份有限公司 A kind of protocol testing method and device
CN109787833A (en) * 2019-01-23 2019-05-21 清华大学 Network exception event cognitive method and system
US20210092122A1 (en) * 2019-09-23 2021-03-25 Vmware, Inc. Centralized capability system for programmable switches
CN113037691A (en) * 2019-12-24 2021-06-25 中国移动通信集团浙江有限公司 Message processing method, device and system
CN113055196A (en) * 2019-12-28 2021-06-29 华为技术有限公司 Message processing method, network device and computer readable storage medium
CN113691486A (en) * 2020-05-19 2021-11-23 中移(成都)信息通信科技有限公司 Message modification method, device, equipment and storage medium
CN111683066A (en) * 2020-05-27 2020-09-18 平安养老保险股份有限公司 Heterogeneous system integration method and device, computer equipment and storage medium
CN113938405A (en) * 2020-07-10 2022-01-14 北京华为数字技术有限公司 Data processing method and device
WO2022017249A1 (en) * 2020-07-21 2022-01-27 阿里巴巴集团控股有限公司 Programmable switch, traffic statistics method, defense method, and packet processing method
CN113162816A (en) * 2020-12-29 2021-07-23 深圳市吉祥腾达科技有限公司 Testing method and testing system for OSPFv3 protocol of switch
CN112822722A (en) * 2020-12-30 2021-05-18 联想未来通信科技(重庆)有限公司 Data message transmission method and device
CN112714047A (en) * 2021-03-29 2021-04-27 北京网测科技有限公司 Industrial control protocol flow based test method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US8681819B2 (en) Programmable multifield parser packet
CN112866111B (en) Method and device for managing flow table
US20140181140A1 (en) Terminal device based on content name, and method for routing based on content name
US7664112B2 (en) Packet processing apparatus and method
CN105939297B (en) A kind of TCP message recombination method and device
US8432908B2 (en) Efficient packet replication
US20230042747A1 (en) Message Processing Method and Device, Storage Medium, and Electronic Device
US11122136B2 (en) Quantum payload service for facilitating communications between a quantum computing system and classical computing systems
US9268813B2 (en) Terminal device based on content name, and method for routing based on content name
JP6189898B2 (en) RMAAPI support with active messages
EP2747336A1 (en) Content processing method, device and system
CN107896141B (en) FC-AE-ASM network data redundancy method
JP2006235831A (en) Condition management device, method, and program
US9137331B2 (en) Adaptive replication
CN114553757A (en) Protocol message processing method, device and equipment based on programmable switch
CN111225063A (en) Data exchange system and method for static distributed computing architecture
JP6654733B2 (en) Data processing device, network system, packet order control circuit, and data processing method
CN116346649A (en) Virtual service packet grabbing method and device of load balancing equipment
US11714692B2 (en) Classical management of qubit requests
CN114338529B (en) Five-tuple rule matching method and device
KR20120102722A (en) An apparatus, an assembly and a method of operating a plurality of analyzing means reading and ordering data packets
CN113626295B (en) Method and system for processing pressure measurement data and computer readable storage medium
CN115277504A (en) Network traffic monitoring method, device and system
EP1260065A1 (en) Method and apparatus for determining priority of network packets
CN108737293B (en) Method and device for processing request

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination