CN115665055A - Message processing method and device - Google Patents
Message processing method and device Download PDFInfo
- Publication number
- CN115665055A CN115665055A CN202211202500.4A CN202211202500A CN115665055A CN 115665055 A CN115665055 A CN 115665055A CN 202211202500 A CN202211202500 A CN 202211202500A CN 115665055 A CN115665055 A CN 115665055A
- Authority
- CN
- China
- Prior art keywords
- mqc
- message
- data stream
- application
- table entry
- 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
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the invention provides a message processing method and a device, relates to the technical field of communication, and is applied to a switch, wherein the method comprises the following steps: receiving a data stream to be processed; extracting message characteristics of messages in a data stream to be processed; determining a target application for sending or receiving a data stream to be processed based on the message characteristics; generating a session table item as a target session table item; searching preset MQC configuration information containing the same application identification with a target session table item; generating and issuing a first MQC table item which comprises message characteristics in a target session table item and processing information in the searched preset MQC configuration information; and processing the data stream to be processed based on the issued MQC table entry. By applying the scheme provided by the embodiment of the invention, the switch can process messages of different applications by adopting different actions, different bandwidth guarantees and different priorities.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for processing a packet.
Background
With the development of the technology, various applications are developed endlessly, and different applications have different functions, and have different requirements on network transmission delay, bandwidth, packet loss rate and the like. In order to provide different network services for different applications, switches in a network need to process messages of different applications by using different actions, and therefore, a message processing method applied to the switches needs to be provided.
Disclosure of Invention
The embodiments of the present invention provide a method and an apparatus for processing a packet, so that a switch can process packets of different applications by using different actions, different bandwidth guarantees, and different priorities. The specific technical scheme is as follows:
in a first aspect, a method for processing a packet is provided, where the method is applied to a switch, and the method includes:
receiving a data stream to be processed;
extracting message characteristics of the message in the data stream to be processed;
determining a target application for sending or receiving the data stream to be processed based on the message characteristics;
generating a session table entry as a target session table entry, wherein the target session table entry records: the corresponding relation between the application identification of the target application and the message characteristics;
searching preset modular service quality command line interface MQC configuration information containing the same application identifier with the target session table entry, wherein the MQC configuration information records: the method comprises the following steps of corresponding relation between application identification of an application and processing information of the application, wherein the processing information comprises at least one of the following information: processing the identifier of the action of the message sent or received by the application, the message speed limit value for forwarding the message of the application, and the forwarding priority for forwarding the message of the application, wherein the action comprises: at least one of forwarding the message, discarding the message and copying the message;
generating and issuing a first MQC table item which comprises message characteristics in the target session table item and the processing information in the searched preset MQC configuration information;
and processing the data stream to be processed based on the issued MQC table entry.
In a second aspect, a message processing apparatus is provided, which is applied to a switch, and the apparatus includes:
the receiving module is used for receiving the data stream to be processed;
the extraction module is used for extracting message characteristics of the messages in the data stream to be processed;
the determining module is used for determining a target application for sending or receiving the data stream to be processed based on the message characteristics;
a first generating module, configured to generate a session entry as a target session entry, where: the corresponding relation between the application identification of the target application and the message characteristics;
a searching module, configured to search for preset modular quality of service command line interface MQC configuration information that contains the same application identifier as the target session table entry, where the MQC configuration information records: the method comprises the following steps of corresponding relation between application identification of an application and processing information of the application, wherein the processing information comprises at least one of the following information: processing the identifier of the action of the message sent or received by the application, the message speed limit value for forwarding the message of the application, and the forwarding priority for forwarding the message of the application, wherein the action comprises: at least one of forwarding the message, discarding the message and copying the message;
the second generation module is used for generating and issuing a first MQC table item which contains the message characteristics in the target session table item and the processing information in the searched preset MQC configuration information;
and the processing module is used for processing the data stream to be processed based on the issued MQC table entry.
In a third aspect, a computer-readable storage medium is provided, having stored thereon a computer program which, when being executed by a processor, carries out the method steps of any of the first aspects.
In a fourth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method steps of any of the first aspects.
The embodiment of the invention has the following beneficial effects:
the message processing method provided by the embodiment of the invention is applied to a switch, and comprises the following steps: receiving a data stream to be processed; extracting message characteristics of messages in the data stream to be processed; determining a target application for sending or receiving the data stream to be processed based on the message characteristics; generating a session table entry as a target session table entry, wherein the target session table entry records: the corresponding relation between the application identification of the target application and the message characteristics; searching preset modular service quality command line interface MQC configuration information containing the same application identifier as the target session table item, wherein the MQC configuration information records: the application identification of the application and the processing information of the application are corresponding, and the processing information comprises at least one of the following information: processing the identifier of the action of the message sent or received by the application, the message speed limit value for forwarding the message of the application, and the forwarding priority for forwarding the message of the application, wherein the action comprises the following steps: at least one of forwarding the message, discarding the message and copying the message; generating and issuing a first MQC table item which comprises message characteristics in the target session table item and the processing information in the searched preset MQC configuration information; and processing the data stream to be processed based on the issued MQC table entry.
By applying the scheme provided by the embodiment of the invention, after the switch receives the data stream to be processed, the message characteristics of the message in the data stream are extracted, application identification is carried out according to the message characteristics, the application identifier of the target application which sends or receives the data stream to be processed is obtained, and the target application is confirmed. And generating a session table item representing the corresponding relation between the message characteristics and the application identification as a target session table item. And searching MQC configuration information containing the same application identifier with the target session table entry to obtain the MQC configuration information containing the application identifier of the target application, acquiring processing information corresponding to the application identifier and used for processing the message, and establishing the MQC table entry according to the processing information and the message characteristics, so that the data stream with the same message characteristics in the data stream to be processed can be directly subjected to message processing according to the MQC table entry. Therefore, the message characteristics can be corresponded to the processing information for processing the to-be-processed data stream sent or received by the application through the application identifiers of different applications, so that the switch can process the messages in the to-be-processed data stream sent or received by different applications by adopting different actions, different bandwidth guarantees and different priorities. In addition, the processes of identifying the target application, issuing the MQC table entry and processing the data stream can be completed locally in the switch, and other devices and equipment are not needed in the process, so that resources can be saved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by referring to these drawings.
Fig. 1 is a schematic flow chart of a first message processing method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a second message processing method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a third message processing method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a fourth message processing method according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a fifth message processing method according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of a first packet forwarding process according to an embodiment of the present invention;
fig. 7 is a schematic flowchart of MQC configuration information update according to an embodiment of the present invention;
fig. 8 is a schematic flowchart of a second packet forwarding method according to an embodiment of the present invention;
fig. 9 is a schematic flowchart of a third packet forwarding process provided in the embodiment of the present invention;
fig. 10 is a schematic flowchart of a fourth packet forwarding process according to an embodiment of the present invention;
fig. 11 is a schematic flowchart of a fifth packet forwarding process according to an embodiment of the present invention;
fig. 12 is a schematic flowchart of sixth packet forwarding according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of a first message processing apparatus according to an embodiment of the present invention;
fig. 14 is a schematic structural diagram of a second message processing apparatus according to an embodiment of the present invention;
fig. 15 is a schematic structural diagram of a third packet processing apparatus according to an embodiment of the present invention;
fig. 16 is a schematic structural diagram of a switch according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived from the embodiments given herein by one of ordinary skill in the art, are within the scope of the invention.
In order to enable a switch to process messages of different applications by adopting different actions, different bandwidth guarantees and different priorities, embodiments of the present invention provide a message processing method and apparatus.
Fig. 1 is a schematic flowchart of a first message processing method provided in an embodiment of the present invention, and is applied to a switch, where the method includes the following steps S101 to S107.
Step S101, receiving a data stream to be processed.
Specifically, the switch, as a device in the network, receives a data stream from a sending end, and processes the received data stream. The data flow to be processed may be a data flow generated by different applications and required to be processed by the switch.
In an embodiment of the present invention, after receiving the data stream to be processed, the switch may process the data stream through an IPFIX (IP Flow Information Export) functional unit, establish a bidirectional Netstream (network stream) session, and classify packets in the data stream to be processed according to a quintuple of the data stream to be processed, that is, a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol. For example, it may be determined whether two data flows are classified as the same by determining whether the source IP address, the destination IP address, the source port, and the destination port are the same. The source port and the destination port may be L4 ports. In the scheme, messages belonging to the same classification can be processed in the same mode.
Step S102, extracting message characteristics of the message in the data stream to be processed.
Specifically, the received data stream to be processed includes packets, and the packet characteristics of the packets sent or received by different applications are different, so that the packets sent or received by different applications can be distinguished by extracting the packet characteristics.
In addition, the message characteristics may be composed of one or more of the quintuple, and may also be composed of other information contained in the message. For example, information for distinguishing whether the packet is a TCP (Transmission Control Protocol) packet or a UDP (User data packet Protocol) packet may be included in the port number of the L4 port.
In an embodiment of the present invention, the switch may locally extract the Packet features of the Packet through a Deep Packet Inspection (DPI) functional unit.
In another embodiment of the present invention, the step S102 may be implemented by the following step a.
Step A: and extracting the message characteristics of a preset number of messages in the data stream to be processed.
Specifically, in theory, the message features of the messages in the same data stream to be processed are all the same, so that only the message features of a part of the messages in the data stream to be processed can be extracted to represent the message features of each message in the data stream to be processed, and the message features of all the messages do not need to be extracted. In addition, the scheme provided by the embodiment of the invention only extracts the message characteristics of the messages with the preset number in the data stream to be processed, thereby being capable of obtaining the message characteristics more quickly, saving data processing resources and being suitable for the lower data processing capacity of the switch.
The preset number is a number of messages set manually according to an actual situation, for example, a value between ten and twenty of the preset number may be set, that is, message features of the first ten to twenty messages in the data stream to be processed are extracted.
Step S103, determining a target application for sending or receiving the data stream to be processed based on the message characteristics.
Because the packet characteristics of the packets included in the data streams sent or received by different applications are different, the switch may identify the target application based on the packet characteristics, specifically, the target application may be locally identified by the DPI functional unit according to the obtained packet characteristics.
The target application may be application software, such as social software, chat software, or the like, or may not be application software, such as an application running in a television for receiving video data.
Step S104, generating a conversation table item as a target conversation table item.
Wherein, the target session table entry records: and the corresponding relation between the application identifier of the target application and the message characteristics.
In the embodiment of the present invention, different Application identifiers are preset for different applications, and the Application identifiers may be represented in the form of APPID (Application Identity Document, application identifier number) or may be other preset numbers, such as a number, a character number, and the like.
In addition, the target session table entry is recorded in the session soft table, so that the switch can obtain the corresponding relationship between the message characteristics and the application identifier by searching the session table entry recorded in the session soft table.
Step S105, searching for preset MQC configuration information containing the same application identifier as the target session table entry.
Wherein, the MQC configuration information records: the application identification of the application and the processing information of the application are corresponding, and the processing information comprises at least one of the following information: the message speed limit value is used for processing the identification of the action of the message sent or received by the application, forwarding the message sent or received by the application, and forwarding the priority of the message sent or received by the application. The message limit value indicates the limit on the message forwarding speed under the condition of forwarding the message sent or received by the application, so that different bandwidth guarantee strategies are adopted for different messages. The forwarding priority indicates that the message of the application with the higher forwarding priority is forwarded preferentially when the message sent or received by the application is forwarded.
Because the data streams sent or received by different applications have different requirements on network transmission, the switch can process the data streams sent or received by different applications through different actions.
Table 1 is a table of correspondence between different application types and priorities and actions.
Table 1 shows the priorities and actions of the data flows for different application types. As can be seen from table 1, data streams belonging to different application types may take different actions to process the data streams of the application type.
Specifically, the MQC configuration information records a correspondence between application identifiers of different applications and processing information of an action for processing a packet sent or received by the application. By searching the MQC configuration information containing the application identifier of the target application recorded in the target session table entry, the processing information containing at least one of the identifier of the action of processing the message sent or received by the target application, the message speed limit value for forwarding the message sent or received by the application, and the forwarding priority for forwarding the message sent or received by the application can be obtained, and the switch can execute the corresponding processing action on the message sent or received by the target application according to the processing information.
Wherein the actions include: at least one of forwarding the message, discarding the message and copying the message. The action of forwarding the message indicates that the switch sends the data stream to be processed to the receiving end equipment, the action of discarding the message indicates that the switch stops sending the data stream to be processed to the receiving end equipment, and the action of copying the message indicates that the data stream to be processed is copied and uploaded to the server. For example, in case an application needs to be monitored, the switch may copy the pending data stream and upload it to the server.
Step S106, generating and issuing a first MQC table entry containing the message characteristics in the target session table entry and the processing information in the searched preset MQC configuration information.
Specifically, according to the application identifier of the target application, the MQC configuration information including the application identifier is obtained. The target session table entry and the MQC configuration information both include the same application identifier, the target session table entry further includes corresponding message characteristics, and the MQC configuration information further includes corresponding processing information. Therefore, the corresponding relation between the message characteristics and the processing information can be established through the application identifier, the corresponding relation is recorded through the first MQC table item, and then the first MQC table item is issued to the hardware MQC table.
And step S107, processing the data stream to be processed based on the issued MQC table entry.
Specifically, the corresponding relationship between the message characteristics and the processing information can be obtained through the MQC table entry. In the process of message processing, the data stream to be processed can search the corresponding MQC table entry through the message characteristics of the messages in the data stream to be processed, directly obtain the corresponding processing information, and process the messages in the data stream according to the processing information.
In an embodiment of the present invention, the execution of the steps S103 to S106 requires a certain time, and in this time, the first MQC entry is not yet issued, and the switch cannot process a packet based on the first MQC entry, so that the switch may treat the data stream to be processed as a normal data stream to perform normal processing, and process a packet in the data stream to be processed according to the processing information in the first MQC entry until the first MQC entry is generated and issued.
By applying the scheme provided by the embodiment of the invention, after the switch receives the data stream to be processed, the message characteristics of the message in the data stream are extracted, application identification is carried out according to the message characteristics, the application identifier of the target application which sends or receives the data stream to be processed is obtained, and the target application is confirmed. And generating a session table item representing the corresponding relation between the message characteristics and the application identification as a target session table item. And searching MQC configuration information containing the same application identifier with the target session table entry to obtain the MQC configuration information containing the application identifier of the target application, acquiring processing information corresponding to the application identifier and used for processing the message, and establishing the MQC table entry according to the processing information and the message characteristics, so that the data stream with the same message characteristics in the data stream to be processed can be directly subjected to message processing according to the MQC table entry. Therefore, the message characteristics can be corresponded to the processing information for processing the to-be-processed data stream sent or received by the application through the application identifiers of different applications, so that the switch can process the messages in the to-be-processed data stream sent or received by different applications by adopting different actions, different bandwidth guarantees and different priorities. In addition, the processes of identifying the target application, issuing the MQC table entry and processing the data stream can be completed locally in the switch, and other devices and equipment are not needed in the process, so that resources can be saved.
In the prior art, there are several different methods of handling a data stream received at a switch.
The first method is to install a security plug-in card on the switch, copy the data stream to the security plug-in card to realize application identification, and process the message in the data stream according to the identification result. The mode can only be used by a switch machine type supporting the safe plug-in card, so that the hardware cost is high and the mode cannot be used universally.
The second way is to adopt an independent server, copy the data stream to the server to realize application identification, and process the message in the data stream according to the identification result. This approach requires additional servers and a large number of data streams to be sent to the servers, thereby occupying bandwidth resources and reducing resource utilization.
Compared with the first mode, the embodiment of the invention does not need extra hardware cost, can save the hardware cost and can be applied to all switches.
Compared with the second mode, the embodiment of the invention does not need to upload the data stream to the server, so that additional equipment is not needed, additional bandwidth is not occupied, and the utilization rate of resources is improved.
The scheme provided by the embodiment of the invention is described by specific examples as follows: the switch receives the data flow to be processed sent by the application M and extracts the message characteristics of the message in the data flow to be processed. And determining the application identifier of the application M according to the message characteristics, establishing the corresponding relation between the application identifier of the application M and the message characteristics, and generating a session table item. Matching the preset MQC configuration information with the session table entry, searching the MQC configuration information containing the application identifier of the application M, obtaining the processing information in the MQC configuration information, establishing a corresponding relation with the message characteristics in the session table entry, and generating the MQC table entry. Therefore, the corresponding MQC entry is searched for by using the message characteristics of the message in the data stream to be processed sent by the application M to obtain the corresponding processing information, and the message in the data stream to be processed sent by the application M can be processed according to the processing information.
Fig. 2 is a schematic flow diagram of a second message processing method according to an embodiment of the present invention, and compared with the embodiment shown in fig. 1, the method further includes a step S108 after the step S104, and the method further includes a step S109 after the step S106.
And step S108, counting the aging information.
Wherein the aging information indicates: the situation of sending or receiving the message by the target application.
Specifically, after the session table entry is generated as the target session table entry, the aging information of the session table entry needs to be counted according to the message in the data stream to be processed received by the switch, so that the condition that the target application sends or receives the message can be obtained in time.
In an embodiment of the present invention, when the message sent or received by the target application is a TCP message, the aging information is: the sync sequence number of the TCP packet recently received by the switch includes: FIN (end) flag or RST (Reset) flag; and when the message sent or received by the target application is a UDP message, the aging information is the time interval of the interruption of receiving the UDP message by the switch.
Specifically, different parameters are used as aging information according to the type of the message in the data stream to be processed received by the switch.
Step S109, if the aging information indicates that the time length for the target application to stop sending or receiving the message reaches a preset time length, deleting the session entry and the first MQC entry.
Specifically, the condition that the target application sends or receives the message can be obtained according to the aging information. And under the condition that the aging information indicates that the target application stops sending or receiving the message, the switch is explained to not receive the message from the target application and not send the message to the target application. Therefore, the corresponding relationship between the application identifier of the target application and the message characteristics of the message sent or received by the target application and the processing information of the action of the switch for processing the data stream sent or received by the target application does not need to be preserved, and the session table entry and the first MQC table entry containing the application identifier can be deleted.
In an embodiment of the present invention, in a case of receiving a TCP packet, if the received TCP packet carries an FIN flag or an RST flag, it indicates that a TCP link between a receiving end and a sending end of the TCP packet is to be disconnected, that is, a target application is about to stop sending or receiving the packet, and it may be determined that a session table entry is aged. Under the condition of receiving the UDP message, after the time interval of the switch for receiving the UDP message and interrupting the UDP message reaches a certain threshold value, the target application is determined not to send or receive the UDP message any more, and the aging of the conversation table item is confirmed.
By applying the scheme provided by the embodiment of the invention, the switch obtains the condition that the target application sends or receives the message by counting the aging information for the session table entry, and under the condition that the switch does not receive the message from the target application and does not send the message to the target application any more, the hardware processing table entry can be released by deleting the session table entry and the first MQC table entry, specifically, only the hardware table entry which is issued on the chip, namely the first MQC table entry, is deleted, but the MQC configuration information configured by the user is reserved, and the resource waste is reduced.
Fig. 3 is a flowchart illustrating a third message processing method according to an embodiment of the present invention, where compared with the embodiment shown in fig. 1, the method further includes steps S110 to S112.
And step S110, acquiring newly added MQC configuration information.
Specifically, the user may write new MQC configuration information or update existing MQC configuration information in the switch based on a specific processing requirement, where the newly written MQC configuration information and the updated MQC configuration information are the newly added MQC configuration information.
And step S111, if a session table entry containing the same application identifier as the newly added MQC configuration information exists, generating the newly added MQC table entry based on the newly added MQC configuration information.
Wherein, the newly added MQC table entry comprises: message characteristics in the session table entry and processing information in the newly added MQC configuration information.
Specifically, it needs to be determined whether the application identifier included in the existing session entry has an application identifier included in the newly added MQC configuration information, and if the session entry exists, a newly added MQC entry may be generated, so that the switch can process the packet based on the newly added MQC entry.
In an embodiment of the present invention, the processing information included in the newly added MQC configuration information may not be used for processing the data stream transmitted or received by the application, so that it is necessary to first determine whether the newly added MQC configuration information is used for processing the data stream transmitted or received by the application. And if so, generating a newly added MQC table entry based on the newly added MQC configuration information. If not, the newly added MQC table entry can be generated and issued directly based on the newly added MQC configuration information without searching the session table entry.
And step S112, replacing the second MQC table entry with the newly-added MQC table entry.
Wherein, the second MQC table entry is: and the MQC table entries which are issued and have the same message characteristics as the newly added MQC table entries.
Specifically, there is an MQC entry including a message feature corresponding to the application identifier included in the newly added MQC configuration information, and the MQC entry is the second MQC entry. And the newly-added MQC table entry is an MQC table entry generated based on newly-added MQC configuration, wherein the newly-added MQC table entry contains updated processing information, and the newly-added MQC table entry is used for replacing a second MQC table entry, so that the data stream to be processed with corresponding message characteristics can be subjected to message processing according to the new MQC table entry. On the contrary, if the newly added MQC entry is directly issued, the newly added MQC entry may conflict with the second MQC entry, and the switch may continue to process the packet based on the original second MQC entry.
By applying the scheme provided by the embodiment of the invention, under the condition of increasing the MQC configuration, whether the corresponding MQC table entry exists or not is judged, so that the data stream to be processed can be subjected to message processing according to the new MQC table entry, and the processing mode of the switch for processing the data stream to be processed can be changed.
Fig. 4 is a schematic flow chart of a fourth message processing method according to an embodiment of the present invention, and compared with the embodiment shown in fig. 1, the method further includes steps S113 to S114.
And step S113, determining the deleted MQC configuration information.
Specifically, the preset MQC configuration information may be deleted, that is, the correspondence between the processing information indicating that the data stream transmitted or received by the target application corresponding to the application identifier included in the MQC configuration information is processed and the application identifier is deleted. If the corresponding MQC table entry exists, the corresponding relation between the message characteristics and the processing information contained in the MQC table entry is correspondingly deleted. Therefore, whether the corresponding MQC table entry exists needs to be judged.
And step S114, if the session table entry containing the same application identifier as the deleted MQC configuration information exists, deleting the third MQC table entry.
Wherein, the third MQC table entry includes: message characteristics in the session table entry and processing information in the deleted MQC configuration information.
Specifically, if the MQC configuration information is deleted, it indicates that the switch no longer needs to provide a special message processing service for the application corresponding to the application identifier included in the deleted MQC configuration information, and it needs to determine whether a session entry including the same application identifier as the deleted MQC configuration information exists. If the message exists, the third MQC table entry containing the same message characteristics with the session table entry also exists, so that the third MQC table entry needs to be deleted, and the switch can not adopt special actions to process the applied message after deletion. And if the third MQC table entry does not exist, the third MQC table entry does not exist.
In an embodiment of the present invention, the processing information included in the deleted MQC configuration information may not be used for processing the data stream transmitted or received by the application, so that it is required to first determine whether the deleted MQC configuration information is used for processing the data stream transmitted or received by the application. If yes, go to step S114. If not, the MQC table entry corresponding to the deleted MQC configuration can be directly deleted.
By applying the scheme provided by the embodiment of the invention, under the condition of deleting the MQC configuration information, whether the third MQC table entry exists is judged, the switch is prevented from continuously providing special message processing service for the application corresponding to the application identifier contained in the deleted MQC configuration information, and the switch is prevented from continuously adopting special actions to process the message of the application.
Fig. 5 is a flowchart illustrating a fifth message processing method according to an embodiment of the present invention, where, compared to the embodiment shown in fig. 1, the step S101 may be implemented by the following step S101A, the step S102 may be implemented by the following steps S102A to S102B, the step S103 may be implemented by the following step S103A, the step S104 may be implemented by the following step S104A, the step S105 may be implemented by the following step S105A, the step S106 may be implemented by the following step S106A, and the step S107 may be implemented by the following step S107A.
And step S101A, receiving a data stream to be processed through the drive of the switch.
And step S102A, copying the message in the data flow to be processed through the driver to obtain a copy message, and sending the copy message to the CPU of the switch.
Specifically, the driver sends a copy of the packet in the data stream to be processed to the CPU of the switch, so that the data stream to be processed can be processed normally through the switch, and the normal processing of the data stream to be processed is not affected by extracting the packet feature and confirming the target application.
And step S102B, extracting the message characteristics of the message in the data stream to be processed through the CPU.
Step S103A, determining, by the CPU, a target application that sends or receives the data stream to be processed based on the message characteristics, and issuing an application identifier of the target application and the message characteristics of the message in the data stream to be processed to the driver.
Step S104A, generating a session table item as a target session table item through the drive.
Step S105A, searching for preset MQC configuration information containing the same application identifier as the target session entry through the driver.
Step S106A, a first MQC table entry containing the message characteristics in the target session table entry and the processing information in the searched preset MQC configuration information is generated and issued through the driver.
And step S107A, processing the data stream to be processed based on the issued MQC table entry through the drive.
Compared with the embodiment shown in fig. 1, the embodiment of the present invention describes a specific implementation manner of implementing the foregoing embodiment in detail, and reference may be made to the content shown in fig. 1, which is not described again here.
By applying the scheme provided by the embodiment of the invention, the CPU and the driver in the switch work cooperatively to finish the process of message processing.
Fig. 6 is a schematic flowchart of a first packet forwarding process according to an embodiment of the present invention, when processing information recorded in the processing information included in the MQC entry indicates forwarding a packet.
In step S601, it is determined whether the DPI function unit is enabled.
Specifically, whether the DPI function is enabled or not may be manually configured by a user, and when the DPI function is enabled, the switch is capable of identifying the target application through the DPI function and continuing to perform subsequent steps.
Step S602, when the DPI function unit is enabled, N messages before the mirror image Netflow are sent to the DPI function unit.
Specifically, the message in the mirror Netflow (network flow) is a duplicate message.
In step S603, the DPI functional unit completes application recognition.
Step S604, the DPI functional unit issues APPID and message characteristics to a driver.
Step S605, the driver binds the APPID and the message characteristic and writes the APPID and the message characteristic into the conversation list item.
Step S606, determining whether there is MQC configuration information including a corresponding APPID.
And step S607, under the condition that the MQC configuration information containing the corresponding APPID is judged, the driver binds the message characteristics with the processing information to generate an MQC table entry.
Step S608, the driver issues the MQC entry.
And step S609, the driver forwards the message according to the processing information in the MQC table entry.
Specifically, the steps S601 to S609 are similar to the embodiments of the message forwarding method described above, and are not described again here.
Fig. 7 is a schematic flow diagram illustrating update of MQC configuration information according to an embodiment of the present invention, when processing information recorded in processing information included in an MQC entry indicates forwarding of a packet.
In step S701, the CPU issues MQC configuration information based on a single application or an application group.
Step S702, the drive traverses the session table entry, and finds the message characteristics corresponding to the APPID.
And step S703, based on the message characteristics, driving to forward the message according to the processing information.
Specifically, the steps S701 to S703 are similar to the embodiments of the message forwarding method described above, and are not described again here.
Fig. 8 is a schematic flow diagram of second packet forwarding according to an embodiment of the present invention, when processing information recorded in processing information included in the MQC entry indicates forwarding a packet.
And step B1, receiving the first packet and mirroring the first N messages by a driver to obtain a duplicate message.
Specifically, the first packet includes the first N packets of the data stream to be processed.
And step B2, the driver sends the obtained copy message to the CPU.
And step B3, the CPU extracts the message characteristics of the duplicate message.
And step B4, the CPU identifies the APPID through the DPI functional unit according to the message characteristics.
And step B5, the CPU binds and transmits the APPID and the message characteristics to the driver.
And step B6, the driver generates a session table item according to the message characteristics and the APPID.
And B7, driving and counting aging information.
And step B8, driving to normally forward the message when the aging phenomenon does not occur.
Specifically, the steps B1 to B8 are similar to the embodiments of the message forwarding method described above, and are not described herein again.
Fig. 9 is a schematic flow diagram of third packet forwarding provided in the embodiment of the present invention, when processing information recorded in the processing information included in the MQC entry indicates forwarding a packet.
And C1, driving to receive the subsequent packet.
Specifically, the subsequent packet includes the messages after the first N messages in the data stream to be processed.
And step C2, the driver continuously sends the copy message to the CPU.
And step C3, the CPU continuously extracts the message characteristics of the duplicate message.
And step C4, the CPU continuously identifies the APPID through the DPI functional unit according to the message characteristics.
And step C5, the CPU binds and transmits the APPID and the message characteristics to the driver.
And step C6, the driver generates a session table item according to the message characteristics and the APPID.
And C7, driving and updating the aging information.
And step C8, driving to normally forward the message when the aging phenomenon does not occur.
Specifically, the steps C1 to C8 are similar to the embodiments of the message forwarding method described above, and are not described herein again.
Fig. 10 is a schematic flow diagram of fourth packet forwarding according to an embodiment of the present invention, where processing information recorded in processing information included in the MQC entry indicates forwarding of a packet.
And D1, the CPU sends the MQC configuration information to the driver.
D2, driving and distinguishing MQC configuration information, and executing the step D3 if the MQC configuration information is matched with the application; and if the MQC configuration information is matched with the non-application, executing the step D5.
Specifically, the MQC configuration information is matched to the processing information included in the MQC configuration information that the application indicates is used to process the data stream that the application transmits or receives, and the MQC configuration information is matched to the processing information included in the non-application indicates is used to process the data stream that the non-application transmits or receives.
And D3, driving and searching the session table item containing the APPID.
And D4, under the condition that the session table entry is found, updating the MQC table entry according to the MQC configuration information.
And D5, directly updating the MQC table entry by driving.
And D6, driving to receive the message to be forwarded.
And D7, when the aging phenomenon does not occur, driving to forward the message according to the MQC table entry.
Specifically, the steps D1 to D7 are similar to the embodiments of the message forwarding method described above, and are not described again here.
Fig. 11 is a schematic flow diagram of fifth message forwarding according to an embodiment of the present invention, when processing information recorded in processing information included in the MQC entry indicates forwarding a message.
And E1, binding and issuing the APPID and the message characteristics to a driver by the CPU.
And E2, the driver generates a session table item according to the message characteristics and the APPID.
And E3, driving and searching MQC configuration information corresponding to the APPID.
And E4, the driver generates the MQC table entry according to the message characteristics and the processing information.
And E5, when the aging phenomenon does not occur, driving to forward the message according to the MQC table entry.
Specifically, the steps E1 to E5 are similar to the embodiments of the message forwarding method described above, and are not described again here.
Fig. 12 is a schematic flow chart of sixth message forwarding according to the embodiment of the present invention, when processing information recorded in the processing information included in the MQC entry indicates forwarding a message.
And F1, according to the aging information, aging of the session table entry occurs.
And step F2, the driver sends the aging information of the session table entry to the CPU.
And F3, driving to search MQC configuration information corresponding to the APPID.
And F4, the driver deletes the MQC table entry according to the message characteristics and the processing information.
And F5, driving to normally forward the message when the aging phenomenon does not occur.
Specifically, the steps F1 to F5 are similar to the embodiments of the message forwarding method described above, and are not described again here.
Based on the same inventive concept, corresponding to the above-mentioned message processing method, an embodiment of the present invention further provides a message processing apparatus, as shown in fig. 13, which is a schematic structural diagram of a first message processing apparatus provided in an embodiment of the present invention, and includes:
a receiving module 1301, configured to receive a data stream to be processed;
an extracting module 1302, configured to extract a message feature of a message in the data stream to be processed;
a determining module 1303, configured to determine, based on the message feature, a target application that sends or receives the data stream to be processed;
a first generating module 1304, configured to generate a session table entry as a target session table entry, where: the corresponding relation between the application identification of the target application and the message characteristics;
a searching module 1305, configured to search for preset modular quality of service command line interface MQC configuration information that contains the same application identifier as the target session table entry, where the MQC configuration information records: the method comprises the following steps of corresponding relation between application identification of an application and processing information of the application, wherein the processing information comprises at least one of the following information: processing the identifier of the action of the message sent or received by the application, the message speed limit value for forwarding the message of the application, and the forwarding priority for forwarding the message of the application, wherein the action comprises: at least one of forwarding the message, discarding the message and copying the message;
a second generating module 1306, configured to generate and issue a first MQC entry including the message feature in the target session entry and the processing information in the found preset MQC configuration information;
a processing module 1307, configured to process the data stream to be processed based on the issued MQC entry.
By applying the scheme provided by the embodiment of the invention, after the switch receives the data stream to be processed, the message characteristics of the message in the data stream are extracted, application identification is carried out according to the message characteristics, and the application identifier of the target application which sends or receives the data stream to be processed is obtained and the target application is confirmed. And generating a session table item representing the corresponding relation between the message characteristics and the application identification as a target session table item. And searching MQC configuration information containing the same application identifier with the target session table entry to obtain the MQC configuration information containing the application identifier of the target application, acquiring processing information corresponding to the application identifier and used for processing the message, and establishing the MQC table entry according to the processing information and the message characteristics, so that the data stream with the same message characteristics in the data stream to be processed can be directly subjected to message processing according to the MQC table entry. Therefore, the message characteristics can be corresponded to the processing information for processing the to-be-processed data stream sent or received by the application through the application identifiers of different applications, so that the switch can process the messages in the to-be-processed data stream sent or received by different applications by adopting different actions, different bandwidth guarantees and different priorities. In addition, the processes of identifying the target application, issuing the MQC table entry and processing the data stream can be completed locally in the switch, and other devices and equipment are not needed in the process, so that resources can be saved.
In an embodiment of the present invention, the first generating module 1304 is further configured to:
statistical aging information, wherein the aging information represents: the condition that the target application sends or receives a message;
the second generating module 1306 is further configured to:
and if the aging information indicates that the time length for the target application to stop sending or receiving the message reaches the preset time length, deleting the session table entry and the first MQC table entry.
By applying the scheme provided by the embodiment of the invention, the switch obtains the condition that the target application sends or receives the message by counting the aging information for the session table entry, and the hardware processing table entry can be released by deleting the session table entry and the first MQC table entry under the condition that the switch does not receive the message from the target application and does not send the message to the target application any more.
In an embodiment of the present invention, in a case that a packet sent or received by the target application is a TCP packet, the aging information is: the synchronization sequence number of the TCP message recently received by the switch comprises: ending the FIN flag or resetting the RST flag;
and/or
And under the condition that the message sent or received by the target application is a user data packet protocol (UDP) message, the aging information is the time interval of interruption of receiving the UDP message by the switch.
By applying the scheme provided by the embodiment of the invention, different parameters can be used as aging information according to the type of the message in the data stream to be processed received by the switch.
In an embodiment of the present invention, as shown in fig. 14, which is a schematic structural diagram of a second message processing apparatus provided in the embodiment of the present invention, compared with the foregoing embodiment shown in fig. 13, the apparatus further includes:
a first obtaining module 1308, configured to obtain newly added MQC configuration information;
a third generating module 1309, configured to generate a new MQC entry based on the new MQC configuration information if a session entry that includes the same application identifier as the new MQC configuration information exists, where the new MQC entry includes: message characteristics in the session table item and processing information in the newly added MQC configuration information;
a replacing module 1310, configured to replace the second MQC entry with the newly added MQC entry, where the second MQC entry is: and the MQC table entries which are issued and have the same message characteristics as the newly added MQC table entries.
By applying the scheme provided by the embodiment of the invention, under the condition of increasing the MQC configuration, whether the corresponding MQC table entry exists or not is judged, so that the data stream to be processed can be subjected to message processing according to the new MQC table entry, and the processing mode of the switch for processing the data stream to be processed can be changed.
In an embodiment of the present invention, as shown in fig. 15, which is a schematic structural diagram of a third message processing apparatus provided in the embodiment of the present invention, compared with the embodiment shown in fig. 13, the apparatus further includes:
a second obtaining module 1311, configured to determine deleted MQC configuration information;
a deleting module 1312, configured to delete a third MQC entry if a session entry containing the same application identifier as the deleted MQC configuration information exists, where the third MQC entry includes: message characteristics in the session table entry and processing information in the deleted MQC configuration information.
By applying the scheme provided by the embodiment of the invention, under the condition of deleting the MQC configuration information, whether the third MQC table entry exists is judged, the switch is prevented from continuously providing special message processing service for the application corresponding to the application identifier contained in the deleted MQC configuration information, and the switch is prevented from continuously adopting special actions to process the message of the application.
In an embodiment of the present invention, the receiving module 1301 is specifically configured to:
receiving a data stream to be processed through a drive of the switch;
the extracting module 1302 is specifically configured to:
copying a message in the data stream to be processed through the driver to obtain a copy message, and uploading the copy message to a CPU (central processing unit) of the switch;
extracting message characteristics of messages in the data stream to be processed through the CPU;
the determining module 1303 is specifically configured to:
determining, by the CPU, a target application that sends or receives the data stream to be processed based on the message characteristics, and issuing an application identifier of the target application and message characteristics of a message in the data stream to be processed to the driver;
the first generating module 1304 is specifically configured to:
generating a session table entry as a target session table entry through the driver;
the search module 1305 is specifically configured to:
searching preset MQC configuration information containing the same application identification with the target session table item through the driver;
the second generating module 1306 is specifically configured to:
generating and issuing a first MQC table item containing message characteristics in the target session table item and the searched processing information in the preset MQC configuration information through the driver;
the processing module 1307 is specifically configured to:
and processing the data stream to be processed based on the issued MQC table entry through the drive.
By applying the scheme provided by the embodiment of the invention, the CPU and the driver in the switch work cooperatively to finish the message processing process.
In an embodiment of the present invention, the extracting module 1302 is specifically configured to:
and extracting the message characteristics of a preset number of messages in the data stream to be processed.
The scheme provided by the embodiment of the invention only extracts the message characteristics of the messages with the preset number in the data stream to be processed, thereby being capable of obtaining the message characteristics more quickly, saving the data processing resources and being suitable for the lower data processing capacity of the switch.
Based on the same inventive concept, corresponding to the above-mentioned message processing method, an embodiment of the present invention further provides a switch, as shown in fig. 16, which is a schematic structural diagram of a switch provided in an embodiment of the present invention, and includes a processor 1601, a communication interface 1602, a memory 1603, and a communication bus 1604, where the processor 1601, the communication interface 1602, and the memory 1603 complete mutual communication through the communication bus 1604,
a memory 1603 for storing a computer program;
the processor 1601 is configured to execute the program stored in the memory 1603, and implements the following steps:
receiving a data stream to be processed;
extracting message characteristics of messages in the data stream to be processed;
determining a target application for sending or receiving the data stream to be processed based on the message characteristics;
generating a session table entry as a target session table entry, wherein the target session table entry records: the corresponding relation between the application identification of the target application and the message characteristics;
searching preset modular quality of service command line interface (MQC) configuration information which contains the same application identifier as the target session table entry, wherein the MQC configuration information records: the method comprises the following steps of corresponding relation between application identification of an application and processing information of the application, wherein the processing information comprises at least one of the following information: processing the identifier of the action of the message sent or received by the application, the message speed limit value for forwarding the message of the application, and the forwarding priority for forwarding the message of the application, wherein the action comprises: at least one of forwarding the message, discarding the message and copying the message;
generating and issuing a first MQC table item which comprises the message characteristics in the target session table item and the processing information in the searched preset MQC configuration information;
and processing the data stream to be processed based on the issued MQC table entry.
By applying the scheme provided by the embodiment of the invention, after the switch receives the data stream to be processed, the message characteristics of the message in the data stream are extracted, application identification is carried out according to the message characteristics, the application identifier of the target application which sends or receives the data stream to be processed is obtained, and the target application is confirmed. And generating a session table item representing the corresponding relation between the message characteristics and the application identification as a target session table item. And searching MQC configuration information containing the same application identifier with the target session table entry to obtain the MQC configuration information containing the application identifier of the target application, acquiring processing information corresponding to the application identifier and used for processing the message, and establishing the MQC table entry according to the processing information and the message characteristics, so that the data stream with the same message characteristics in the data stream to be processed can be directly subjected to message processing according to the MQC table entry. Therefore, the message characteristics can be corresponded to the processing information for processing the to-be-processed data stream sent or received by the application through the application identifiers of different applications, so that the switch can process the messages in the to-be-processed data stream sent or received by different applications by adopting different actions, different bandwidth guarantees and different priorities. In addition, the processes of identifying the target application, issuing the MQC table entry and processing the data stream can be completed locally in the switch, and other devices and equipment are not needed in the process, so that resources can be saved.
Based on the same inventive concept, corresponding to the above-mentioned message processing method, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above-mentioned message processing methods are implemented.
By applying the scheme provided by the embodiment of the invention, after the switch receives the data stream to be processed, the message characteristics of the message in the data stream are extracted, application identification is carried out according to the message characteristics, the application identifier of the target application which sends or receives the data stream to be processed is obtained, and the target application is confirmed. And generating a session table item representing the corresponding relation between the message characteristics and the application identification as a target session table item. And searching MQC configuration information containing the same application identifier with the target session table entry to obtain the MQC configuration information containing the application identifier of the target application, acquiring processing information corresponding to the application identifier and used for processing the message, and establishing the MQC table entry according to the processing information and the message characteristics, so that the data stream with the same message characteristics in the data stream to be processed can be directly subjected to message processing according to the MQC table entry. Therefore, the message characteristics can be corresponded to the processing information for processing the to-be-processed data stream sent or received by the application through the application identifiers of different applications, so that the switch can process the messages in the to-be-processed data stream sent or received by different applications by adopting different actions, different bandwidth guarantees and different priorities. In addition, the processes of identifying the target application, issuing the MQC table entry and processing the data stream can be completed locally in the switch, and other devices and equipment are not needed in the process, so that resources can be saved.
Based on the same inventive concept, corresponding to the above-mentioned message processing method, an embodiment of the present invention further provides a computer program product containing instructions, which, when running on a computer, causes the computer to execute the steps of any of the message processing methods in the above-mentioned embodiments.
By applying the scheme provided by the embodiment of the invention, after the switch receives the data stream to be processed, the message characteristics of the message in the data stream are extracted, application identification is carried out according to the message characteristics, the application identifier of the target application which sends or receives the data stream to be processed is obtained, and the target application is confirmed. And generating a session table item representing the corresponding relation between the message characteristics and the application identification as a target session table item. And searching MQC configuration information containing the same application identifier with the target session table entry to obtain the MQC configuration information containing the application identifier of the target application, acquiring processing information corresponding to the application identifier and used for processing the message, and establishing the MQC table entry according to the processing information and the message characteristics, so that the data stream with the same message characteristics in the data stream to be processed can be directly subjected to message processing according to the MQC table entry. Therefore, the message characteristics can be corresponded to the processing information for processing the to-be-processed data stream sent or received by the application through the application identifiers of different applications, so that the switch can process the messages in the to-be-processed data stream sent or received by different applications by adopting different actions, different bandwidth guarantees and different priorities. In addition, the processes of identifying the target application, issuing the MQC table entry and processing the data stream can be completed locally on the switch, and other devices and equipment are not needed in the process, so that resources can be saved.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (14)
1. A message processing method is applied to a switch, and the method comprises the following steps:
receiving a data stream to be processed;
extracting message characteristics of messages in the data stream to be processed;
determining a target application for sending or receiving the data stream to be processed based on the message characteristics;
generating a session table entry as a target session table entry, wherein the target session table entry records: the corresponding relation between the application identification of the target application and the message characteristics;
searching preset modular service quality command line interface MQC configuration information containing the same application identifier with the target session table entry, wherein the MQC configuration information records: the method comprises the following steps of corresponding relation between application identification of an application and processing information of the application, wherein the processing information comprises at least one of the following information: processing the identifier of the action of the message sent or received by the application, the message speed limit value for forwarding the message of the application, and the forwarding priority for forwarding the message of the application, wherein the action comprises: at least one of forwarding the message, discarding the message and copying the message;
generating and issuing a first MQC table item which comprises the message characteristics in the target session table item and the processing information in the searched preset MQC configuration information;
and processing the data stream to be processed based on the issued MQC table entry.
2. The method of claim 1, wherein after the generating the session entry as the target session entry, further comprising:
statistical aging information, wherein the aging information represents: the condition that the target application sends or receives a message;
after the generating and issuing the first MQC entry including the message feature in the target session entry and the processing information in the searched preset MQC configuration information, the method further includes:
and if the aging information indicates that the time length for the target application to stop sending or receiving the message reaches the preset time length, deleting the session table entry and the first MQC table entry.
3. The method according to claim 2, wherein in the case that the packets sent or received by the target application are TCP packets, the aging information is: the synchronous sequence number of the TCP message received by the switch recently comprises: ending the FIN flag or resetting the RST flag;
and/or
And under the condition that the message sent or received by the target application is a user data packet protocol (UDP) message, the aging information is the time interval of the switch for receiving the UDP message interrupt.
4. The method of claim 1, further comprising:
acquiring newly added MQC configuration information;
if a session table entry containing the same application identifier as the newly added MQC configuration information exists, generating a newly added MQC table entry based on the newly added MQC configuration information, wherein the newly added MQC table entry comprises: message characteristics in the session table item and processing information in the newly added MQC configuration information;
replacing a second MQC table entry with the newly added MQC table entry, wherein the second MQC table entry is as follows: and the MQC table entries which are issued and have the same message characteristics as the newly added MQC table entries.
5. The method of claim 1, further comprising:
determining deleted MQC configuration information;
if a session table entry containing the same application identifier as the deleted MQC configuration information exists, deleting a third MQC table entry, wherein the third MQC table entry comprises: message characteristics in the session table entry and processing information in the deleted MQC configuration information.
6. The method of claim 1, wherein receiving the pending data stream comprises:
receiving a data stream to be processed through a drive of the switch;
the extracting of the message characteristics of the message in the data stream to be processed includes:
copying a message in the data stream to be processed through the driver to obtain a copy message, and uploading the copy message to a CPU (central processing unit) of the switch;
extracting message characteristics of messages in the data stream to be processed through the CPU;
the determining, based on the message characteristics, a target application that sends or receives the data stream to be processed includes:
determining, by the CPU, a target application that sends or receives the data stream to be processed based on the message characteristics, and issuing an application identifier of the target application and message characteristics of a message in the data stream to be processed to the driver;
the generating of the session table entry as the target session table entry includes:
generating a session table entry as a target session table entry through the driver;
the searching for the preset modular quality of service command line interface (MQC) configuration information containing the same application identifier as the target session table entry comprises the following steps:
searching preset MQC configuration information containing the same application identification with the target session table item through the driver;
the generating and issuing of the first MQC entry including the message features in the target session entry and the processing information in the searched preset MQC configuration information includes:
generating and issuing a first MQC table item containing message characteristics in the target session table item and the searched processing information in the preset MQC configuration information through the driver;
the processing the data stream to be processed based on the issued MQC table entry comprises the following steps:
and processing the data stream to be processed based on the issued MQC table entry through the drive.
7. The method according to any one of claims 1 to 5, wherein the extracting packet features of packets in the data stream to be processed comprises:
and extracting the message characteristics of a preset number of messages in the data stream to be processed.
8. A message processing apparatus, applied to a switch, the apparatus comprising:
the receiving module is used for receiving the data stream to be processed;
the extraction module is used for extracting message characteristics of the messages in the data stream to be processed;
the determining module is used for determining a target application for sending or receiving the data stream to be processed based on the message characteristics;
a first generating module, configured to generate a session table entry as a target session table entry, where: the corresponding relation between the application identification of the target application and the message characteristics;
a searching module, configured to search for preset modular quality of service command line interface MQC configuration information that contains the same application identifier as the target session table entry, where the MQC configuration information records: the method comprises the following steps of corresponding relation between application identification of an application and processing information of the application, wherein the processing information comprises at least one of the following information: processing the identifier of the action of the message sent or received by the application, the message speed limit value for forwarding the message of the application, and the forwarding priority for forwarding the message of the application, wherein the action comprises: at least one of forwarding the message, discarding the message and copying the message;
the second generation module is used for generating and issuing a first MQC table item which contains the message characteristics in the target session table item and the processing information in the searched preset MQC configuration information;
and the processing module is used for processing the data stream to be processed based on the issued MQC table entry.
9. The apparatus of claim 8, wherein the first generating module is further configured to:
statistical aging information, wherein the aging information represents: the condition that the target application sends or receives a message;
the second generating module is further configured to:
and if the aging information indicates that the time length for the target application to stop sending or receiving the message reaches the preset time length, deleting the session table entry and the first MQC table entry.
10. The apparatus according to claim 9, wherein in a case that the packet sent or received by the target application is a transmission control protocol TCP packet, the aging information is: the synchronous sequence number of the TCP message received by the switch recently comprises: ending FIN mark or resetting RST mark;
and/or
And under the condition that the message sent or received by the target application is a user data packet protocol (UDP) message, the aging information is the time interval of the switch for receiving the UDP message interrupt.
11. The apparatus of claim 8, further comprising:
the first obtaining module is used for obtaining newly added MQC configuration information;
a third generating module, configured to generate a new MQC entry based on the new MQC configuration information if a session entry that contains the same application identifier as the new MQC configuration information exists, where the new MQC entry includes: message characteristics in the session table item and processing information in the newly added MQC configuration information;
a replacing module, configured to replace the second MQC entry with the newly added MQC entry, where the second MQC entry is: and the MQC table entries which are issued and have the same message characteristics as the newly added MQC table entries.
12. The apparatus of claim 8, further comprising:
the second acquisition module is used for determining the deleted MQC configuration information;
a deleting module, configured to delete a third MQC entry if a session entry containing the same application identifier as the deleted MQC configuration information exists, where the third MQC entry includes: message characteristics in the session table entry and processing information in the deleted MQC configuration information.
13. The apparatus of claim 8, wherein the receiving module is specifically configured to:
receiving a data stream to be processed through a drive of the switch;
the extraction module is specifically configured to:
copying a message in the data stream to be processed through the driver to obtain a copy message, and uploading the copy message to a CPU (central processing unit) of the switch;
extracting message characteristics of a message in the data stream to be processed through the CPU;
the determining module is specifically configured to:
determining, by the CPU, a target application that sends or receives the data stream to be processed based on the message characteristics, and issuing an application identifier of the target application and message characteristics of a message in the data stream to be processed to the driver;
the first generation module is specifically configured to:
generating a session table entry as a target session table entry through the driver;
the search module is specifically configured to:
searching preset MQC configuration information containing the same application identification with the target session table item through the driver;
the second generation module is specifically configured to:
generating and issuing a first MQC table item containing message characteristics in the target session table item and the searched processing information in the preset MQC configuration information through the driver;
the processing module is specifically configured to:
and processing the data stream to be processed based on the issued MQC table entry through the drive.
14. The apparatus according to any one of claims 8-12, wherein the extraction module is specifically configured to:
and extracting the message characteristics of a preset number of messages in the data stream to be processed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211202500.4A CN115665055A (en) | 2022-09-29 | 2022-09-29 | Message processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211202500.4A CN115665055A (en) | 2022-09-29 | 2022-09-29 | Message processing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115665055A true CN115665055A (en) | 2023-01-31 |
Family
ID=84985512
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211202500.4A Pending CN115665055A (en) | 2022-09-29 | 2022-09-29 | Message processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115665055A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116506365A (en) * | 2023-06-25 | 2023-07-28 | 杭州网鼎科技有限公司 | Multi-network outlet intelligent load balancing method, system and storage medium |
-
2022
- 2022-09-29 CN CN202211202500.4A patent/CN115665055A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116506365A (en) * | 2023-06-25 | 2023-07-28 | 杭州网鼎科技有限公司 | Multi-network outlet intelligent load balancing method, system and storage medium |
CN116506365B (en) * | 2023-06-25 | 2023-09-05 | 杭州网鼎科技有限公司 | Multi-network outlet intelligent load balancing method, system and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9871781B2 (en) | Systems and methods for path maximum transmission unit discovery | |
CN106972985B (en) | Method for accelerating data processing and forwarding of DPI (deep packet inspection) equipment and DPI equipment | |
US20020080789A1 (en) | Switch-based network processor | |
CN105684382A (en) | Packet control method, switch and controller | |
US20130294449A1 (en) | Efficient application recognition in network traffic | |
WO2022078104A1 (en) | Network traffic analysis method and apparatus, electronic device, and storage medium | |
CN112769597B (en) | Container network current limiting method and system for cloud-edge collaborative virtualization scene | |
CN115665055A (en) | Message processing method and device | |
CN115225734A (en) | Message processing method and network equipment | |
RU2602333C2 (en) | Network system, packet processing method and storage medium | |
CN112532714B (en) | Data processing method, processing device, server and storage medium | |
CN106330768A (en) | Application identification method based on cloud computing | |
CN110417707B (en) | Data transmission protection method, device, system and computer readable storage medium | |
CN105790985B (en) | Data switching method, first device, second device and system | |
CN102195887A (en) | Message processing method, device and network security equipment | |
CN116723162B (en) | Network first packet processing method, system, device, medium and heterogeneous equipment | |
CN115695522B (en) | Data packet drainage system based on OVS-DPDK and implementation method thereof | |
CN111262782B (en) | Message processing method, device and equipment | |
US11153214B2 (en) | In service flow capability update in guaranteed bandwidth multicast network | |
CN111224891A (en) | Traffic application identification system and method based on dynamic learning triples | |
CN116233317A (en) | Network traffic-oriented real-time VoLTE voice reduction and detection method and device | |
CN107483508B (en) | Message filtering method, device, equipment and storage medium | |
CN112350986B (en) | Shaping method and system for audio and video network transmission fragmentation | |
CN110071868B (en) | Link aggregation method, device and network equipment | |
CN111158776B (en) | Smooth restarting method of Web application protection system |
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 |