CN104618253B - A kind of transmitting message treating method and apparatus of dynamic change - Google Patents
A kind of transmitting message treating method and apparatus of dynamic change Download PDFInfo
- Publication number
- CN104618253B CN104618253B CN201510032868.4A CN201510032868A CN104618253B CN 104618253 B CN104618253 B CN 104618253B CN 201510032868 A CN201510032868 A CN 201510032868A CN 104618253 B CN104618253 B CN 104618253B
- Authority
- CN
- China
- Prior art keywords
- message
- packet
- processor
- source
- order preservation
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000012545 processing Methods 0.000 claims abstract description 87
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 69
- 238000009826 distribution Methods 0.000 claims abstract description 50
- 230000006855 networking Effects 0.000 claims abstract description 15
- 238000004321 preservation Methods 0.000 claims description 93
- 230000005540 biological transmission Effects 0.000 claims description 18
- 230000008569 process Effects 0.000 claims description 18
- 238000003672 processing method Methods 0.000 claims description 5
- 238000007635 classification algorithm Methods 0.000 abstract description 11
- 238000010586 diagram Methods 0.000 description 10
- 238000004590 computer program Methods 0.000 description 7
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 238000012423 maintenance Methods 0.000 description 4
- 238000003860 storage Methods 0.000 description 3
- 230000007547 defect Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a kind of transmitting message treating method and apparatus of dynamic change, to solve the problems, such as that the feature stream mode classification that existing packet order preserving uses can not be changed dynamically.This method is, outstanding message is received first, then judge whether the type of the message is the message for needing order-preserving, when finally determining that the message is the message for needing order-preserving, obtain the traffic stream identifier of the message, three kinds of feature flow algorithms based on system intialization, a kind of optimal feature flow algorithm is selected to generate the distribution of traffic flows mode of the message according to network congestion degree in network congestion, the processing of message is carried out based on the distribution of traffic flows mode, in this way, pass through prefabricated various features packet classification algorithm, feature packet classification algorithm can be dynamically changed according to different networkings and equipment form, cost is small, operability is strong.
Description
Technical Field
The present invention relates to the field of communications, and in particular, to a method and an apparatus for processing a dynamically changed transmission packet.
Background
With the popularization of computer networks, the demand of users for network bandwidth is continuously increased, and the processing capacity of network equipment is also higher and higher. As a core Processing Unit of a network device, the performance of a CPU (Central Processing Unit) becomes an important criterion for determining the Processing capability of a network device. Since the advent of multi-core processors, a new step in the processing power of network devices has been created. The processor with a multi-core architecture can process messages in parallel, improves processing capacity, but generates a phenomenon of message disorder in parallel processing, which causes problems such as TCP (transmission control Protocol) message or UDP (User data Protocol) message disorder during message forwarding, and the like, and the requirement of message order preservation is generated accordingly. For example, a dual-core CPU sequentially receives 2 messages according to the sequence of messages 1 and 2 and respectively distributes the messages to a core C1 and a core C2 for processing, because the message content, the CPU processing policy and the load condition of each core are different, the situation that the message 2 is processed first and the message 1 is processed later may occur, and at this time, if the CPU directly sends out the processed messages, the disorder phenomenon that the order of the sent messages is 2 and 1 occurs.
In the prior art, two methods are adopted for message order-preserving design, the first order-preserving method is to carry out preprocessing numbering on messages before the messages enter network transmission equipment for processing, and the messages are sent out according to the numbers after the processing is finished. The second order-preserving method is to classify the message according to the characteristics of the message flow, classify the message into different threads, and preserve the whole message by ensuring the sequential processing of the individual feature flow, but the disadvantage of preserving the order by adopting the method is that the extraction mode of the feature flow directly affects the access processing capability of the device, and the data flow type on the network is not invariable, which is characterized in that the data flow type is invariable according to the operator networking and the user service type, the current feature flow classification algorithm can not be dynamically changed, the application range is single, and the method is not suitable for flexible networking.
Disclosure of Invention
The invention aims to provide a dynamically-changed transmission message processing method and a dynamically-changed transmission message processing device, which are used for solving the problem that the characteristic flow classification mode adopted by the existing message order preservation cannot be dynamically changed.
The purpose of the invention is realized by the following technical scheme:
a dynamically changed transmission message processing method comprises the following steps:
receiving a message to be processed;
judging whether the type of the message is a message needing order preservation;
when the message is determined to be a message needing order preservation, acquiring a service flow identifier of the message, randomly selecting a service flow distribution mode of generating the message by using a characteristic flow algorithm based on three characteristic flow algorithms preset by a system, and processing the message based on the service flow distribution mode.
Therefore, by prefabricating various characteristic flow classification algorithms, the characteristic flow classification algorithms can be dynamically changed according to different networking and equipment forms, the defect of the conventional message service flow order-preserving mode is reduced to the maximum extent, the cost is low, the operability is high, the message processing performance is further improved, and in addition, in a certain specific occasion, the networking topology can be simplified, the network complexity is reduced, and the equipment maintenance cost is reduced at the same time by selecting the dynamic algorithm instead of re-networking.
Optionally, the determining whether the type of the packet is a packet requiring order preservation includes:
acquiring attribute information of the message, and if the message is determined to be a TCP or UDP type message, judging the message to be a message needing order preservation; and if the message is determined to be of other types, judging that the message is a message without order preservation.
Optionally, after determining that the packet is a packet that does not need to be order-preserved, the method further includes:
and selecting a corresponding processor for the messages without the order preservation according to a round-robin scheduling mode, and sending the messages without the order preservation to the corresponding processor for processing the messages without the order preservation.
Optionally, sending the packet without order preservation to a corresponding processor to process the packet without order preservation specifically includes:
if the performance index of the corresponding processor reaches a preset threshold value, discarding the messages which are sent to the processor and do not need to be preserved;
and if the performance index of the corresponding processor does not reach the preset threshold value, sending the message without order preservation to the corresponding processor for processing the message without order preservation.
Optionally, the service flow identifier of the packet is a source IP address, a source destination IP address, a three-layer protocol number, a source port number, and a source destination port number of the packet.
Optionally, when determining that the packet is a packet requiring order preservation, acquiring a service flow identifier of the packet, randomly selecting a service flow distribution mode in which a feature flow algorithm generates the packet based on three feature flow algorithms preset by a system, and processing the packet based on the service flow distribution mode specifically includes:
when the message is determined to be a message needing order preservation, acquiring a source IP address and a three-layer protocol number of the message, performing hash operation by using a hash algorithm to generate a 4-bit main key identifier, and sending the message to a processor corresponding to the main key identifier to process the message; or,
when the message is determined to be a message needing order preservation, acquiring a source IP address, a three-layer protocol number and a source port number of the message, performing hash operation by using a hash algorithm to generate a 4-bit main key identifier, and sending the message to a processor corresponding to the main key identifier to process the message; or,
when the message is determined to be a message needing order preservation, a source destination IP address, a three-layer protocol number and a source destination port number of the message are obtained, a hash algorithm is utilized to carry out hash operation to generate a 4-bit main key identifier, and the message is sent to a processor corresponding to the main key identifier to be processed.
Optionally, sending the packet to a processor corresponding to the primary key identifier for processing the packet, specifically including:
if the performance index of the processor corresponding to the primary key identifier reaches a preset threshold value, discarding the message sent to the processor corresponding to the primary key identifier;
and if the performance index of the processor corresponding to the primary key identifier does not reach a preset threshold value, sending the message to the processor corresponding to the primary key identifier for processing the message.
A dynamically changing transmission message processing apparatus, comprising:
a receiving unit, configured to receive a message to be processed;
the judging unit is used for judging whether the type of the message is a message needing order preservation;
the distribution unit is used for acquiring the service flow identification of the message when the message is determined to be the message needing order preservation, randomly selecting a service flow distribution mode of generating the message by using a characteristic flow algorithm based on three characteristic flow algorithms preset by a system, and processing the message based on the service flow distribution mode.
Therefore, by prefabricating various characteristic flow classification algorithms, the characteristic flow classification algorithms can be dynamically changed according to different networking and equipment forms, the defect of the conventional message service flow order-preserving mode is reduced to the maximum extent, the cost is low, the operability is high, the message processing performance is further improved, and in addition, in a certain specific occasion, the networking topology can be simplified, the network complexity is reduced, and the equipment maintenance cost is reduced at the same time by selecting the dynamic algorithm instead of re-networking.
Optionally, when determining whether the type of the packet is a packet requiring order preservation, the determining unit is configured to:
acquiring attribute information of the message, and if the message is determined to be a TCP or UDP type message, judging the message to be a message needing order preservation; and if the message is determined to be of other types, judging that the message is a message without order preservation.
Optionally, after determining that the packet is a packet that does not need to be order-preserved, the distribution unit is further configured to:
and selecting a corresponding processor for the messages without the order preservation according to a round-robin scheduling mode, and sending the messages without the order preservation to the corresponding processor for processing the messages without the order preservation.
Optionally, when the packet without order preservation is sent to a corresponding processor to be processed, the distribution unit is specifically configured to:
if the performance index of the corresponding processor reaches a preset threshold value, discarding the messages which are sent to the processor and do not need to be preserved;
and if the performance index of the corresponding processor does not reach the preset threshold value, sending the message without order preservation to the corresponding processor for processing the message without order preservation.
Optionally, the service flow identifier of the packet obtained by the distribution unit is a source IP address, a source destination IP address, a three-layer protocol number, a source port number, and a source destination port number of the packet.
Optionally, when determining that the packet is a packet requiring order preservation, acquiring a service flow identifier of the packet, randomly selecting a service flow distribution mode in which a feature flow algorithm generates the packet based on three feature flow algorithms preset by a system, and when processing the packet based on the service flow distribution mode, the distribution unit is specifically configured to:
when the message is determined to be a message needing order preservation, acquiring a source IP address and a three-layer protocol number of the message, performing hash operation by using a hash algorithm to generate a 4-bit main key identifier, and sending the message to a processor corresponding to the main key identifier to process the message; or,
when the message is determined to be a message needing order preservation, acquiring a source IP address, a three-layer protocol number and a source port number of the message, performing hash operation by using a hash algorithm to generate a 4-bit main key identifier, and sending the message to a processor corresponding to the main key identifier to process the message; or,
when the message is determined to be a message needing order preservation, a source destination IP address, a three-layer protocol number and a source destination port number of the message are obtained, a hash algorithm is utilized to carry out hash operation to generate a 4-bit main key identifier, and the message is sent to a processor corresponding to the main key identifier to be processed.
Optionally, when the packet is sent to the processor corresponding to the primary key identifier for processing the packet, the distribution unit is specifically configured to:
if the performance index of the processor corresponding to the primary key identifier reaches a preset threshold value, discarding the message sent to the processor corresponding to the primary key identifier;
and if the performance index of the processor corresponding to the primary key identifier does not reach a preset threshold value, sending the message to the processor corresponding to the primary key identifier for processing the message.
Drawings
FIG. 1 is a schematic diagram illustrating processing of an order-preserving packet in the form of a multi-core processor according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a dynamically changed transmission message processing method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a dynamically changed transmission message processing apparatus 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 by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention describes a processing mode of an order-preserving message in a multi-core processor form, and the order-preserving processing of the message is carried out by adopting a characteristic flow classification algorithm, and the specific processing flow can be seen in fig. 1.
When a multi-core processor is used, a general processing mode is that the processor 1 to the processor N are all stream processing cores or threads, different feature streams of a TCP or UDP message traffic stream are extracted and distributed to the processing cores which are not communicated according to different algorithms for processing, because hardware processing capability difference and feature stream path difference exist between the processing cores, and processing is executed according to the current sequence inside the processing cores, which requires that as long as no order-preserving requirement exists between the feature streams, as long as the feature streams are processed inside one processing core, the order-preserving property of the TCP or UDP data stream cannot be lost after the processing of fig. 1, so that the purpose of preserving the order of the TCP or UDP message traffic stream can be achieved.
Referring to fig. 2, a method for processing a dynamically changed transmission packet according to an embodiment of the present invention includes the following specific processes.
Step 200: and receiving a message to be processed.
Step 201: and judging whether the type of the message is the message needing order preservation.
Specifically, after receiving a message to be processed, obtaining attribute information of the message, and if the message is determined to be a TCP or UDP type message, determining that the message is a message requiring order preservation; and if the message is determined to be of other types, judging that the message is a message without order preservation.
Further, after determining that the received message is a message without order preservation, selecting a corresponding processor for the message without order preservation according to a Round-Robin Scheduling mode, and sending the message without order preservation to the corresponding processor for processing the message, wherein a Round-Robin Scheduling algorithm is to schedule requests to different processors in turn in a Round-Robin manner.
For example, periodically receiving messages to be processed, assuming that the system is provided with 16 feature stream processors, which are numbered 1-16, when receiving a message that does not need to be preserved for the first time, sending the message to the processor numbered 1 for processing the message, when receiving a message that does not need to be preserved for the second time, sending the message to the processor numbered 2 for processing the message, and so on, until the processor numbered 16 also executes the processing of the message that does not need to be preserved, when receiving the message that does not need to be preserved again, reselecting the processor numbered 1 for processing the message, and so on.
Specifically, the method comprises the following steps. The message that does not need to be preserved is sent to a corresponding processor to be processed, which is specifically divided into two situations:
the first case is: and if the performance index of the corresponding processor reaches a preset threshold value, discarding the message which is sent to the processor and does not need to be preserved.
Therefore, when the processing capacity of a single processor or thread reaches a bottleneck, the current message sent to the processor or thread is discarded to ensure that the message is not back-pressed to influence the message processing distributed to other processors or threads, and the message processing performance can be improved.
The second case is: and if the performance index of the corresponding processor does not reach the preset threshold value, sending the message without the order preservation to the corresponding processor to process the message without the order preservation.
Step 202: when the message is determined to be a message needing order preservation, acquiring the service flow identification of the message, randomly selecting a service flow distribution mode of generating the message by using a characteristic flow algorithm based on three characteristic flow algorithms preset by a system, and processing the message based on the service flow distribution mode.
Specifically, the service flow identifier of the packet is a source IP address, a source destination IP address, a three-layer protocol number, a source port number, and a source destination port number of the packet.
In the implementation of the invention, according to the characteristics of TCP or UDP message service flows and the independence between the message service flows of different ports, the source IP address, the source and destination IP address connection information, the source port information and the destination port information of the TCP or UDP message are extracted, different multiple characteristic flow filtering distributors are generated by combination, and through the adaptation with the drive, different characteristic flow distribution modes can be dynamically selected at the equipment maintenance side according to different networking environments and dynamically take effect without the equipment initialization reconfiguration.
At present, in implementation, three feature stream classification algorithms are prefabricated in a system:
algorithm 1: and extracting the source IP address and the three-layer protocol number of the TCP or UDP message, and carrying out hash operation to generate a 4-bit distribution index value for distributing the service message.
And 2, algorithm: and extracting a source IP address, a source Port number (Port) and a three-layer protocol number of the TCP or UDP message, carrying out hash operation to generate a 4-bits distribution index value, and distributing the service message.
Algorithm 3: and extracting a source and destination IP address, a source and destination Port and a three-layer protocol number of the TCP or UDP message, carrying out hash operation to generate a 4-bit distribution index value, and distributing the service message.
Specifically, when the message is determined to be a message requiring order preservation, a service flow identifier of the message is obtained, a service flow distribution mode in which a feature flow algorithm generates the message is randomly selected based on three feature flow algorithms preset by a system, and the message is processed based on the service flow distribution mode, which specifically includes the following three modes:
the first mode is as follows: when the message is determined to be a message needing order preservation, the source IP address and the three-layer protocol number of the message are obtained, a hash algorithm is utilized to carry out hash operation to generate a 4-bit main key identifier, and the message is sent to a processor corresponding to the main key identifier to be processed.
The characteristic flow algorithm in the mode is suitable for a scene that a certain special website is limited by networking and a user downloads or limits transmission flow, the load of transmission caused by overlarge single user flow is prevented, the transmission efficiency of the message is further improved, and the system performance is improved.
The second way is: when the message is determined to be a message needing order preservation, acquiring a source IP address, a three-layer protocol number and a source port number of the message, performing hash operation by using a hash algorithm to generate a 4-bit main key identifier, and sending the message to a processor corresponding to the main key identifier to process the message; or alternatively.
The characteristic flow algorithm in the mode is suitable for a scene of limiting the number of the links downloaded by the user in networking, and the algorithm can limit certain current for the fixed TCP ports 20 and 21, so that the phenomenon that the download link of a single user is too large is prevented.
The third mode is as follows: when the message is determined to be a message needing order preservation, a source destination IP address, a three-layer protocol number and a source destination port number of the message are obtained, a hash algorithm is utilized to carry out hash operation to generate a 4-bit main key identifier, and the message is sent to a processor corresponding to the main key identifier to be processed.
The feature flow algorithm in this manner is suitable for networks that maximize the use of transmission performance without restriction.
Thus, through three characteristic flow algorithms preset by the system, when the network is congested, an optimal characteristic flow algorithm is selected according to the network congestion degree to generate the service flow distribution mode of the message, for example, the network congestion degree is judged through the message discarding frequency count in the device, and the service distribution mode with the minimum discarding degree is selected.
For example, when a message to be processed that needs to be order-preserved is received, a suitable feature flow algorithm can be selected based on the three service flow distribution manners and according to differences in networking environments, a 4-bit primary key identifier (i.e., a distribution index value) is generated through hash operation, preferably, one primary key identifier corresponds to one processor but is not fixed, one primary key identifier can also correspond to multiple processors according to the system setting, assuming that 16 processors are provided in the system and respectively numbered 1-16, each generated different primary key identifier corresponds to a different processor, and the corresponding relationship is shown in table 1.
TABLE 1
It should be noted that the correspondence between the primary key identifier and the processor in table 1 is only a simple example, and the specific correspondence may be actually analyzed and determined according to the operation conditions of each processor of the actual system.
Specifically, sending the message to the processor corresponding to the primary key identifier for processing the message includes the following two situations:
the first case is: and if the performance index of the processor corresponding to the primary key identifier reaches a preset threshold value, discarding the message sent to the processor corresponding to the primary key identifier.
Therefore, when the processing capacity of a single processor or thread reaches a bottleneck, the current message sent to the processor or thread is discarded to ensure that the message is not back-pressed to influence the message processing distributed to other processors or threads, and the message processing performance can be improved.
The second case is: and if the performance index of the processor corresponding to the primary key identifier does not reach the preset threshold value, sending the message to the processor corresponding to the primary key identifier for processing the message.
Based on the above technical solution, referring to fig. 3, in an embodiment of the present invention, a dynamically changed transmission packet processing apparatus is provided, including: a receiving unit 30, a judging unit 31, a distributing unit 32, wherein:
the receiving unit 30 is configured to receive a message to be processed.
The determining unit 31 is configured to determine whether the type of the packet is a packet that needs to be order-preserved.
The distribution unit 32 is configured to, when determining that the packet is a packet that needs to be order-preserved, obtain a service flow identifier of the packet, randomly select a service flow distribution mode in which a feature flow algorithm generates the packet based on three feature flow algorithms preset by the system, and process the packet based on the service flow distribution mode.
Preferably, when determining whether the type of the packet is a packet requiring order preservation, the determining unit 31 is configured to:
acquiring attribute information of the message, and if the message is determined to be a TCP or UDP type message, judging the message to be a message needing order preservation; and if the message is determined to be of other types, judging that the message is a message without order preservation.
Preferably, after determining that the packet is a packet that does not need to be order-preserved, the distributing unit 32 is further configured to:
and selecting a corresponding processor for the message without the order preservation according to a round-robin scheduling mode, and sending the message without the order preservation to the corresponding processor for processing the message without the order preservation.
Preferably, when sending the message without order preserving to the corresponding processor for processing the message without order preserving, the distributing unit 32 is specifically configured to:
if the performance index of the corresponding processor reaches a preset threshold value, discarding the message which is sent to the processor and does not need to be preserved;
and if the performance index of the corresponding processor does not reach the preset threshold value, sending the message without the order preservation to the corresponding processor to process the message without the order preservation.
Preferably, the service flow identifier of the packet obtained by the distribution unit 32 is a source IP address, a source destination IP address, a three-layer protocol number, a source port number, and a source destination port number of the packet.
Preferably, when determining that the packet is a packet requiring order preservation, the service flow identifier of the packet is obtained, based on three feature flow algorithms preset by the system, a service flow distribution manner in which a feature flow algorithm generates the packet is randomly selected, and when processing the packet based on the service flow distribution manner, the distribution unit 32 is specifically configured to:
when the message is determined to be a message needing order preservation, acquiring a source IP address and a three-layer protocol number of the message, performing hash operation by using a hash algorithm to generate a 4-bit main key identifier, and sending the message to a processor corresponding to the main key identifier to process the message; or,
when the message is determined to be a message needing order preservation, acquiring a source IP address, a three-layer protocol number and a source port number of the message, performing hash operation by using a hash algorithm to generate a 4-bit main key identifier, and sending the message to a processor corresponding to the main key identifier to process the message; or,
when the message is determined to be a message needing order preservation, a source destination IP address, a three-layer protocol number and a source destination port number of the message are obtained, a hash algorithm is utilized to carry out hash operation to generate a 4-bit main key identifier, and the message is sent to a processor corresponding to the main key identifier to be processed.
Preferably, when sending the message to the processor corresponding to the primary key identifier for processing the message, the distributing unit 32 is specifically configured to:
if the performance index of the processor corresponding to the primary key identifier reaches a preset threshold value, discarding the message sent to the processor corresponding to the primary key identifier;
and if the performance index of the processor corresponding to the primary key identifier does not reach the preset threshold value, sending the message to the processor corresponding to the primary key identifier for processing the message.
To sum up, in the implementation of the present invention, a message to be processed is received, whether the type of the message is a message requiring order preservation is determined, when the message is determined to be a message requiring order preservation, a service flow identifier of the message is obtained, based on three feature flow algorithms preset by the system, when the network is congested, an optimal feature flow algorithm is selected according to the network congestion degree, a service flow distribution manner of the message is generated, and the message is processed based on the service flow distribution manner, so that by prefabricating a plurality of feature flow classification algorithms, the feature flow classification algorithm can be dynamically changed according to different networking and device configurations, the disadvantages of the existing message service flow order preservation manner are minimized, the cost is low, the operability is high, the message processing performance is further improved, in addition, in a certain specific occasion, the dynamic algorithm selection is not re-networking, the networking topology can be simplified, the network complexity is reduced, and the equipment maintenance cost is reduced.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.
Claims (14)
1. A dynamically changing transmission message processing method is characterized by comprising the following steps:
receiving a message to be processed;
judging whether the type of the message is a message needing order preservation;
when the message is determined to be a message needing order preservation, acquiring a service flow identifier of the message, selecting a service flow distribution mode of generating the message by using a characteristic flow algorithm according to different networking environments and equipment forms based on three characteristic flow algorithms preset by a system, and processing the message based on the service flow distribution mode;
the feature flow algorithm comprises an algorithm 1: extracting a source IP address and a three-layer protocol number of the message to perform Hash operation; and 2, algorithm: extracting a source IP address, a source port number and a three-layer protocol number of the message to perform hash operation; algorithm 3: and extracting the source and destination IP address, the source and destination Port and the three-layer protocol number of the message to perform Hash operation.
2. The method of claim 1, wherein determining whether the type of the packet is a packet requiring order preservation comprises:
acquiring attribute information of the message, and if the message is determined to be a TCP or UDP type message, judging the message to be a message needing order preservation; and if the message is determined to be of other types, judging that the message is a message without order preservation.
3. The method of claim 2, wherein after determining that the packet is a packet that does not require order preservation, further comprising:
and selecting a corresponding processor for the messages without the order preservation according to a round-robin scheduling mode, and sending the messages without the order preservation to the corresponding processor for processing the messages without the order preservation.
4. The method according to claim 3, wherein sending the packet without order preservation to a corresponding processor for processing the packet without order preservation specifically comprises:
if the performance index of the corresponding processor reaches a preset threshold value, discarding the messages which are sent to the processor and do not need to be preserved;
and if the performance index of the corresponding processor does not reach the preset threshold value, sending the message without order preservation to the corresponding processor for processing the message without order preservation.
5. The method of claim 1, wherein the traffic flow identification of the packet is a source IP address, a source destination IP address, a three-layer protocol number, a source port number, a source destination port number of the packet.
6. The method according to any one of claims 1 to 5, wherein when determining that the packet is a packet that needs to be order-preserved, acquiring a service flow identifier of the packet, randomly selecting a service flow distribution manner in which a feature flow algorithm generates the packet based on three feature flow algorithms preset by a system, and processing the packet based on the service flow distribution manner specifically includes:
when the message is determined to be a message needing order preservation, acquiring a source IP address and a three-layer protocol number of the message, performing hash operation by using a hash algorithm to generate a 4-bit main key identifier, and sending the message to a processor corresponding to the main key identifier to process the message; or,
when the message is determined to be a message needing order preservation, acquiring a source IP address, a three-layer protocol number and a source port number of the message, performing hash operation by using a hash algorithm to generate a 4-bit main key identifier, and sending the message to a processor corresponding to the main key identifier to process the message; or,
when the message is determined to be a message needing order preservation, a source destination IP address, a three-layer protocol number and a source destination port number of the message are obtained, a hash algorithm is utilized to carry out hash operation to generate a 4-bit main key identifier, and the message is sent to a processor corresponding to the main key identifier to be processed.
7. The method according to claim 6, wherein sending the message to a processor corresponding to the primary key identifier for processing the message specifically includes:
if the performance index of the processor corresponding to the primary key identifier reaches a preset threshold value, discarding the message sent to the processor corresponding to the primary key identifier;
and if the performance index of the processor corresponding to the primary key identifier does not reach a preset threshold value, sending the message to the processor corresponding to the primary key identifier for processing the message.
8. A dynamically changing transmission message processing apparatus, comprising:
a receiving unit, configured to receive a message to be processed;
the judging unit is used for judging whether the type of the message is a message needing order preservation;
the distribution unit is used for acquiring a service flow identifier of the message when the message is determined to be the message needing order preservation, selecting a service flow distribution mode of generating the message by using a characteristic flow algorithm according to different networking environments and equipment forms based on three characteristic flow algorithms preset by a system, and processing the message based on the service flow distribution mode;
the feature flow algorithm comprises an algorithm 1: extracting a source IP address and a three-layer protocol number of the message to perform Hash operation; and 2, algorithm: extracting a source IP address, a source port number and a three-layer protocol number of the message to perform hash operation; algorithm 3: and extracting the source and destination IP address, the source and destination Port and the three-layer protocol number of the message to perform Hash operation.
9. The apparatus according to claim 8, wherein when determining whether the type of the packet is a packet requiring order preservation, the determining unit is configured to:
acquiring attribute information of the message, and if the message is determined to be a TCP or UDP type message, judging the message to be a message needing order preservation; and if the message is determined to be of other types, judging that the message is a message without order preservation.
10. The apparatus of claim 9, wherein after determining that the packet is a packet that does not require order preservation, the distribution unit is further configured to:
and selecting a corresponding processor for the messages without the order preservation according to a round-robin scheduling mode, and sending the messages without the order preservation to the corresponding processor for processing the messages without the order preservation.
11. The apparatus according to claim 10, wherein when sending the packet without order preservation to a corresponding processor for processing the packet without order preservation, the distribution unit is specifically configured to:
if the performance index of the corresponding processor reaches a preset threshold value, discarding the messages which are sent to the processor and do not need to be preserved;
and if the performance index of the corresponding processor does not reach the preset threshold value, sending the message without order preservation to the corresponding processor for processing the message without order preservation.
12. The apparatus of claim 8, wherein the traffic flow identifier of the packet obtained by the distributing unit is a source IP address, a source destination IP address, a three-layer protocol number, a source port number, and a source destination port number of the packet.
13. The apparatus according to any one of claims 8 to 12, wherein when determining that the packet is a packet that needs to be order-preserved, a service flow identifier of the packet is obtained, based on three characteristic flow algorithms preset by a system, a service flow distribution manner in which one characteristic flow algorithm generates the packet is randomly selected, and when processing the packet based on the service flow distribution manner, the distribution unit is specifically configured to:
when the message is determined to be a message needing order preservation, acquiring a source IP address and a three-layer protocol number of the message, performing hash operation by using a hash algorithm to generate a 4-bit main key identifier, and sending the message to a processor corresponding to the main key identifier to process the message; or,
when the message is determined to be a message needing order preservation, acquiring a source IP address, a three-layer protocol number and a source port number of the message, performing hash operation by using a hash algorithm to generate a 4-bit main key identifier, and sending the message to a processor corresponding to the main key identifier to process the message; or,
when the message is determined to be a message needing order preservation, a source destination IP address, a three-layer protocol number and a source destination port number of the message are obtained, a hash algorithm is utilized to carry out hash operation to generate a 4-bit main key identifier, and the message is sent to a processor corresponding to the main key identifier to be processed.
14. The apparatus according to claim 13, wherein when sending the packet to the processor corresponding to the primary key identifier for processing the packet, the distribution unit is specifically configured to:
if the performance index of the processor corresponding to the primary key identifier reaches a preset threshold value, discarding the message sent to the processor corresponding to the primary key identifier;
and if the performance index of the processor corresponding to the primary key identifier does not reach a preset threshold value, sending the message to the processor corresponding to the primary key identifier for processing the message.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510032868.4A CN104618253B (en) | 2015-01-22 | 2015-01-22 | A kind of transmitting message treating method and apparatus of dynamic change |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510032868.4A CN104618253B (en) | 2015-01-22 | 2015-01-22 | A kind of transmitting message treating method and apparatus of dynamic change |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104618253A CN104618253A (en) | 2015-05-13 |
CN104618253B true CN104618253B (en) | 2018-08-07 |
Family
ID=53152539
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510032868.4A Active CN104618253B (en) | 2015-01-22 | 2015-01-22 | A kind of transmitting message treating method and apparatus of dynamic change |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104618253B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108718259B (en) * | 2018-05-30 | 2020-07-03 | 新华三信息安全技术有限公司 | Message processing method and multi-core processor |
CN111262792B (en) * | 2020-01-17 | 2022-04-01 | 新华三信息安全技术有限公司 | Message forwarding method, device, network equipment and storage medium |
CN114731334B (en) * | 2020-02-14 | 2023-10-20 | 华为技术有限公司 | Message order preserving method and device |
CN111628941A (en) * | 2020-05-27 | 2020-09-04 | 广东浪潮大数据研究有限公司 | Network traffic classification processing method, device, equipment and medium |
CN112965824B (en) * | 2021-03-31 | 2024-04-09 | 北京金山云网络技术有限公司 | Message forwarding method and device, storage medium and electronic equipment |
CN114553774B (en) * | 2021-12-24 | 2023-06-16 | 锐捷网络股份有限公司 | Message forwarding method, device, equipment and medium |
CN115580584A (en) * | 2022-09-27 | 2023-01-06 | 新华三信息安全技术有限公司 | Message processing method and device |
CN118413563A (en) * | 2023-01-29 | 2024-07-30 | 华为技术有限公司 | Message transmission method, device and system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102664815A (en) * | 2012-05-21 | 2012-09-12 | 华为技术有限公司 | Load sharing method, device and system for message traffic |
CN103384221A (en) * | 2013-06-26 | 2013-11-06 | 汉柏科技有限公司 | Method for optimizing service precedence message fast forwarding |
CN103457868A (en) * | 2013-08-15 | 2013-12-18 | 北京华为数字技术有限公司 | Load sharing method and device |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4919608B2 (en) * | 2005-03-02 | 2012-04-18 | 株式会社日立製作所 | Packet transfer device |
US7668107B2 (en) * | 2006-03-22 | 2010-02-23 | Marvell Israel (M.I.S.L.) Ltd. | Hardware implementation of network testing and performance monitoring in a network device |
CN101072176A (en) * | 2007-04-02 | 2007-11-14 | 华为技术有限公司 | Report processing method and system |
CN102055657B (en) * | 2009-11-02 | 2013-03-13 | 杭州华三通信技术有限公司 | Load distributing method of fiber channel (FC) data message and FC exchanger system |
EP2395710B1 (en) * | 2010-06-08 | 2013-11-06 | Alcatel Lucent | Device and method for data load balancing |
CN101986627B (en) * | 2010-11-25 | 2012-09-05 | 北京星网锐捷网络技术有限公司 | Method, device and equipment for balancing loads |
CN103731307B (en) * | 2013-12-30 | 2017-01-04 | 浙江大学 | A kind of for multiple services standardized data face dynamic reconfiguration method |
-
2015
- 2015-01-22 CN CN201510032868.4A patent/CN104618253B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102664815A (en) * | 2012-05-21 | 2012-09-12 | 华为技术有限公司 | Load sharing method, device and system for message traffic |
CN103384221A (en) * | 2013-06-26 | 2013-11-06 | 汉柏科技有限公司 | Method for optimizing service precedence message fast forwarding |
CN103457868A (en) * | 2013-08-15 | 2013-12-18 | 北京华为数字技术有限公司 | Load sharing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN104618253A (en) | 2015-05-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104618253B (en) | A kind of transmitting message treating method and apparatus of dynamic change | |
CN107438994B (en) | Method, apparatus, and computer storage medium for server load balancing | |
CN103986715B (en) | A kind of method and device of control of network flow quantity | |
US9674080B2 (en) | Proxy for port to service instance mapping | |
US8908522B2 (en) | Transmission rate control | |
US10389627B2 (en) | State-dependent data forwarding | |
WO2016206742A1 (en) | Method and system for managing data traffic in a computing network | |
US20150063349A1 (en) | Programmable switching engine with storage, analytic and processing capabilities | |
US10243857B1 (en) | Method and apparatus for multipath group updates | |
CN110798400B (en) | Message forwarding method and device | |
CN106534394B (en) | Apparatus, system, and method for managing ports | |
US10178017B2 (en) | Method and control node for handling data packets | |
US20140122743A1 (en) | Shared interface among multiple compute units | |
KR101841026B1 (en) | Service function chaining network system for path optimization | |
US20170048145A1 (en) | Switching device and control method of switching device | |
CN107846341B (en) | Method, related device and system for scheduling message | |
CN114079638A (en) | Data transmission method, device and storage medium of multi-protocol hybrid network | |
CN107566293B (en) | Method and device for limiting message speed | |
CN112995036A (en) | Network traffic scheduling method and device | |
US10397127B2 (en) | Prioritized de-queueing | |
CN106034086B (en) | Method and device for realizing load sharing | |
EP2996291B1 (en) | Packet processing method, device, and system | |
CN117459462A (en) | Network load balancing method and device | |
US20170244638A1 (en) | Control apparatus, control method and control system | |
CN105812274B (en) | Service data processing method and related equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |