CN110062033B - Message forwarding method and device and related product - Google Patents

Message forwarding method and device and related product Download PDF

Info

Publication number
CN110062033B
CN110062033B CN201910257585.8A CN201910257585A CN110062033B CN 110062033 B CN110062033 B CN 110062033B CN 201910257585 A CN201910257585 A CN 201910257585A CN 110062033 B CN110062033 B CN 110062033B
Authority
CN
China
Prior art keywords
network card
forwarding
configuration table
message
identifier
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
Application number
CN201910257585.8A
Other languages
Chinese (zh)
Other versions
CN110062033A (en
Inventor
刘健男
党丽娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Neusoft Corp
Original Assignee
Neusoft Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Neusoft Corp filed Critical Neusoft Corp
Priority to CN201910257585.8A priority Critical patent/CN110062033B/en
Publication of CN110062033A publication Critical patent/CN110062033A/en
Application granted granted Critical
Publication of CN110062033B publication Critical patent/CN110062033B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/083Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability for increasing network speed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Abstract

The embodiment of the application discloses a message forwarding method, a message forwarding device and a related product.A configuration processor clusters network cards according to performance parameters, adds an identifier of a low-load network card into a load configuration table when a network card clustering result comprises the low-load network card and a high-load network card, and forwards and processes a message of the low-load network card by a single configuration processor; and adding the identifier of the high-load network card into an optimized configuration table, and writing the optimized configuration table into each forwarding processor. Meanwhile, the working mode of each forwarding processor is changed into an optimization mode, and the forwarding processor forwards the message of the high-load network card, so that the corresponding relation between the network card and the forwarding processor is dynamically adjusted, and the effective allocation of resources is realized. In addition, in the optimization mode, the optimization configuration table is written into each forwarding processor, so that each forwarding processor can read the corresponding optimization configuration table when forwarding the message, locking is not required among the forwarding processors, and the concurrent processing performance is improved.

Description

Message forwarding method and device and related product
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for forwarding a packet, and a related product.
Background
The robustness and high performance of firewall devices are important indicators for security vendors. With the continuous Development of the technology, a software firewall, such as a firewall based on a DPDK (Data Plane Development Kit), can already realize large-flow message forwarding. The forwarding system of the software firewall mainly realizes that the message is received from the network card and forwarded out in a user mode.
For general firewall devices, a full connection relationship between a network card and forwarding processors is generally configured, that is, when a firewall is initialized, a fixed number of forwarding processors are started, and each forwarding processor receives messages from all network cards and forwards the messages. However, this processing method may cause resource waste of the forwarding processor or a part of the network card messages cannot be processed in time.
Disclosure of Invention
In view of this, embodiments of the present application provide a message forwarding method, a device and a related product, so as to solve the technical problem in the prior art that resources of a forwarding processor are wasted or a part of messages of a network card cannot be processed in time.
In order to solve the above problem, the technical solution provided by the embodiment of the present application is as follows:
a message forwarding method, the method comprising:
the configuration processor acquires performance parameters generated by processing each network card by the forwarding processor, and clusters the network cards according to the performance parameters to obtain a clustering result of the network cards;
determining a message forwarding mode according to the category number of the clustering results;
if the message forwarding mode is determined to be the optimization mode, adding the identifier of the network card with the clustering result of low load into a load configuration table, and adding the identifier of the network card with the clustering result of high load into the optimization configuration table;
obtaining messages from a network card queue of a network card corresponding to each identifier in the load configuration table and forwarding the messages;
changing the working mode of each forwarding processor into an optimized mode and writing the optimized configuration table into each forwarding processor, so that each forwarding processor acquires a message from a network card queue of a network card corresponding to each identifier in the optimized configuration table and forwards the message.
In one possible implementation, the method further includes:
and if the message forwarding mode is determined to be the general mode, the working mode of each forwarding processor is not changed, so that each forwarding processor obtains the message from the network card queue of the network card corresponding to each identifier in a general configuration table and forwards the message, wherein the general configuration table comprises the identifiers of all the current network cards.
In a possible implementation manner, the determining a packet forwarding mode according to the category number of the clustering result includes:
when the category number of the clustering result is two categories, determining a message forwarding mode as an optimization mode;
and when the category number of the clustering result is one category, determining a message forwarding mode as a general mode.
In a possible implementation manner, before obtaining a message from a network card queue of a network card corresponding to each identifier in the load configuration table and forwarding the message, the method further includes:
configuring a network card queue rule for the network card corresponding to each identifier in the load configuration table, so that the network card corresponding to each identifier in the load configuration table uses a single target network card queue to send a message;
the network card queue of the network card corresponding to each identifier in the load configuration table is used for acquiring messages and forwarding the messages:
and acquiring messages from the target network card queue of the network card corresponding to each identifier in the load configuration table and forwarding the messages.
In a possible implementation manner, after changing the operation mode of each forwarding processor to the optimized mode and writing the optimized configuration table into each forwarding processor, the method further includes:
monitoring the processing performance of the forwarding processors, and changing the working mode of each forwarding processor into a general mode when the processing performance of the forwarding processor meets a preset condition so that the forwarding processor obtains messages from a network card queue of a network card corresponding to each identifier in a general configuration table and forwards the messages, wherein the general configuration table comprises identifiers of all current network cards.
In a possible implementation manner, when the processing performance of the forwarding processors satisfies a preset condition, before changing the operation mode of each forwarding processor to the general mode, the method further includes:
and canceling the configuration of a network card queue rule for the network card corresponding to each identifier in the load configuration table, so that the network card corresponding to each identifier in the load configuration table uses a plurality of network card queues to send messages.
In a possible implementation manner, after changing the operation mode of each forwarding processor to the optimized mode and writing the optimized configuration table into each forwarding processor, the method further includes:
acquiring message flow of a network card corresponding to each identifier in the load configuration table, and determining the network card with the message flow exceeding a first threshold value in the network card corresponding to each identifier in the load configuration table as a first target network card;
removing the identifier of the first target network card from the load configuration table, and adding the identifier of the first target network card to the optimized configuration table;
and rewriting the optimized configuration table into each forwarding processor.
In one possible implementation, the method further includes:
and canceling the configuration of a network card queue rule for the first target network card so that the first target network card uses a plurality of network card queues to send messages.
In a possible implementation manner, after changing the operation mode of each forwarding processor to the optimized mode and writing the optimized configuration table into each forwarding processor, the method further includes:
acquiring the message flow of the network card corresponding to each identifier in the optimized configuration table, and determining the network card with the message flow smaller than a second threshold value in the network card corresponding to each identifier in the optimized configuration table as a second target network card;
removing the identifier of the second target network card from the optimized configuration table, and adding the identifier of the second target network card to the load configuration table;
and rewriting the optimized configuration table into each forwarding processor.
In one possible implementation, the method further includes:
and configuring a network card queue rule for the second target network card so that the second target network card uses a single target network card queue to send messages.
In a possible implementation manner, the optimized configuration table is written into each forwarding processor, and a whole table replacement manner is adopted.
A message forwarding apparatus, the apparatus comprising:
the first acquisition unit is used for acquiring performance parameters generated by processing each network card by the forwarding processor, clustering the network cards according to the performance parameters and acquiring the clustering result of the network cards;
a determining unit, configured to determine a packet forwarding mode according to the category number of the clustering results;
an adding unit, configured to add, if it is determined that the packet forwarding mode is the optimized mode, the identifier of the network card with the low load as the clustering result to a load configuration table, and add the identifier of the network card with the high load as the clustering result to the optimized configuration table;
a second obtaining unit, configured to obtain a message from a network card queue of a network card corresponding to each identifier in the load configuration table, and forward the message;
and the first changing unit is used for changing the working mode of each forwarding processor into an optimized mode and writing the optimized configuration table into each forwarding processor, so that each forwarding processor obtains a message from a network card queue of a network card corresponding to each identifier in the optimized configuration table and forwards the message.
In a possible implementation manner, the first changing unit is further configured to, if it is determined that the message forwarding mode is a general mode, not change the working mode of each forwarding processor, so that each forwarding processor obtains a message from a network card queue of a network card corresponding to each identifier in a general configuration table and forwards the message, where the general configuration table includes identifiers of all current network cards.
In a possible implementation manner, the determining unit is specifically configured to determine, when the number of categories of the clustering result is two, a packet forwarding mode as an optimized mode; and when the category number of the clustering result is one category, determining a message forwarding mode as a general mode.
In one possible implementation, the apparatus further includes:
the first configuration unit is used for configuring a network card queue rule for the network card corresponding to each identifier in the load configuration table before executing the second acquisition unit, so that the network card corresponding to each identifier in the load configuration table uses a single target network card queue to send a message;
the second obtaining unit is specifically configured to obtain a message from a target network card queue of the network card corresponding to each identifier in the load configuration table, and forward the message.
In one possible implementation, the apparatus further includes:
a monitoring unit for monitoring the processing performance of the forwarding processor after executing the first changing unit;
and the second changing unit is used for changing the working mode of each forwarding processor into a general mode when the processing performance of the forwarding processor meets a preset condition, so that the forwarding processor obtains a message from a network card queue of a network card corresponding to each identifier in a general configuration table and forwards the message, wherein the general configuration table comprises identifiers of all current network cards.
In one possible implementation, the apparatus further includes:
and the first canceling unit is used for canceling the configuration of the network card queue rule for the network card corresponding to each identifier in the load configuration table before executing the second changing unit, so that the network card corresponding to each identifier in the load configuration table uses a plurality of network card queues to send messages.
In one possible implementation, the apparatus further includes:
a third obtaining unit, configured to obtain, after executing the first changing unit, a message traffic of the network card corresponding to each identifier in the load configuration table, and determine, as a first target network card, a network card whose message traffic exceeds a first threshold in the network card corresponding to each identifier in the load configuration table;
a first removing unit, configured to remove the identifier of the first target network card from the load configuration table, and add the identifier of the first target network card to the optimized configuration table;
a first writing unit, configured to rewrite the optimized configuration table into each forwarding processor.
In one possible implementation, the apparatus further includes:
and the second canceling unit is used for canceling the configuration of a network card queue rule for the first target network card so as to enable the first target network card to use a plurality of network card queues for message sending.
In one possible implementation, the apparatus further includes:
a fourth obtaining unit, configured to obtain, after executing the first changing unit, a message flow of the network card corresponding to each identifier in the optimized configuration table, and determine, as a second target network card, the network card whose message flow is smaller than a second threshold value in the network card corresponding to each identifier in the optimized configuration table;
a second removing unit, configured to remove the identifier of the second target network card from the optimized configuration table, and add the identifier of the second target network card to the load configuration table;
and a second writing unit, configured to rewrite the optimized configuration table into each forwarding processor.
In one possible implementation, the apparatus further includes:
and the second configuration unit is used for configuring a network card queue rule for the second target network card so that the second target network card uses a single target network card queue to send messages.
In a possible implementation manner, the optimized configuration table is written into each forwarding processor, and a whole table replacement manner is adopted.
In one possible implementation, the apparatus includes:
a configuration processor and a forwarding processor;
the configuration processor is the message forwarding device;
and the forwarding processor is used for acquiring messages from the network card queue of the network card corresponding to each identifier in the optimization configuration table and forwarding the messages.
A computer-readable storage medium, having stored therein instructions, which, when run on a terminal device, cause the terminal device to execute the above-mentioned message forwarding method.
A computer program product, which, when running on a terminal device, causes the terminal device to execute the above-mentioned message forwarding method.
Therefore, the embodiment of the application has the following beneficial effects:
in the embodiment of the application, the configuration processor acquires the performance parameters generated by the forwarding processor processing each network card, and clusters the network cards according to the performance parameters to obtain the clustering results of all the network cards. And then, determining a message forwarding mode according to the category number of the clustering result. And when the message forwarding mode is determined to be the optimization mode, adding the identifier of the network card with the low load clustering result into the load configuration table, and adding the identifier of the network card with the high load clustering result into the optimization configuration table. The working mode of each forwarding processor is changed into an optimization mode, and the optimization configuration is written into each forwarding processor. When the message is forwarded, the configuration processors acquire the message from the network card queue of each network card with the identifier corresponding to the load configuration table and forward the message, and each forwarding processor acquires the message from the network card queue of each network card with the identifier corresponding to the optimized configuration table and forwards the message.
That is, with the method provided in the embodiment of the present application, the configuration processor may cluster the network cards according to the performance parameters, add the identifier of the low-load network card to the load configuration table when the network card clustering result includes the low-load network card and the high-load network card, and forward the message for processing the low-load network card by the single configuration processor; and adding the identifier of the high-load network card into the optimized configuration table, and writing the optimized configuration table into each forwarding processor. Meanwhile, the working mode of each forwarding processor is changed into an optimization mode, and each forwarding processor forwards the message of the high-load network card, so that the corresponding relation between the network card and the forwarding processor is dynamically adjusted, the effective allocation of resources is realized, and the message forwarding performance is improved. In addition, in the optimization mode, the optimization configuration table is written into each forwarding processor, so that each forwarding processor can read the corresponding optimization configuration table when forwarding the message, locking is not required among the forwarding processors, that is, the forwarding processors have no problem of resource competition in common in the whole forwarding process, and the concurrent processing performance is improved.
Drawings
Fig. 1 is a schematic diagram illustrating firewall packet forwarding according to an embodiment of the present application;
fig. 2 is a flowchart of a message forwarding method according to an embodiment of the present application;
fig. 3 is a structural diagram of a message forwarding apparatus according to an embodiment of the present application;
fig. 4 is a structural diagram of a message forwarding device according to an embodiment of the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, embodiments accompanying the drawings are described in detail below.
In order to facilitate understanding of the technical solutions provided in the present application, the following description will first be made on the background of the present application.
The inventor finds that, in the research of the traditional firewall message forwarding method, after the configuration processor determines the number of the forwarding processors and the number of the network cards, the configuration forwarding processors establish a full connection relationship with the network cards, so that each forwarding processor receives and forwards messages from all the network cards. In the conventional message forwarding method, the full-connection mapping relationship is invariable and does not change according to the different performance of the network card. That is, the network cards of different types are all subjected to the unified processing, which may cause the waste or shortage of the resources of the forwarding processor and affect the message forwarding performance. For example, each forwarding processor processes multiple gigabit network cards and ten-gigabit network cards simultaneously, if message forwarding is performed according to the full connection relationship configured in the conventional manner, multiple forwarding processors can process one gigabit network card simultaneously, and actually, one forwarding processor can completely and independently process multiple gigabit network cards. When the message flow of the gigabit network card is very large, whether the gigabit network card has the flow or not, each forwarding processor needs to allocate resources to the gigabit network card, which causes resource waste and affects the message processing performance of the gigabit network card.
Based on this, an embodiment of the present application provides a message forwarding method, and in a specific implementation, a configuration processor may obtain performance parameters generated by processing each network card by a forwarding processor, and perform clustering on the network cards according to the performance parameters, so as to obtain clustering results of all the network cards. And determining a message forwarding mode according to the clustering result. If the network cards belong to different categories, it is indicated that a high-load network card and a low-load network card exist in the network cards, and in order to improve the message forwarding performance of the high-load network card, different processing is performed on the high-load network card and the low-load network card. At the moment, the configuration processor determines that the message forwarding mode is the optimized mode, adds the identifier of the network card with low load into the load configuration table, and obtains the message from the network card queue of the network card corresponding to each identifier in the load configuration table and forwards the message. And simultaneously, adding the identifier of the network card with high load into the optimized configuration table, and writing the optimized configuration table into each forwarding processor, so that each forwarding processor can acquire the message from the network card queue of each network card with the identifier corresponding to the network card in the table through the optimized configuration table corresponding to the forwarding processor and forward the message.
Therefore, the method provided by the embodiment of the application can dynamically adjust the mapping relationship between the network card and the forwarding processor according to the type of the network card, and perform different processing on different types of network cards, thereby improving the overall forwarding performance. In addition, the configuration processor writes the optimized configuration table into each forwarding processor, so that the forwarding processors can forward the message according to the optimized configuration table stored in the forwarding processors, and locking is not required to be performed to prevent the multiple forwarding processors from reading the optimized configuration table at the same time to cause concurrency conflict, so that the forwarding processors do not have the problem of resource competition sharing in the whole forwarding process, and the concurrency processing performance is improved.
To facilitate understanding of the technical solutions provided by the present application, the following will describe the operating principles of the configuration processor and the forwarding processor in the present application, and refer to fig. 1, which is a schematic diagram of forwarding a firewall packet provided in an embodiment of the present application, where the firewall may include two types of processors, namely, the configuration processor and the forwarding processor. The configuration processor can collect performance parameters of each network card and the forwarding processor so as to determine a message forwarding mode according to the obtained performance parameters. And the forwarding processor is used for receiving the message from the network card and forwarding the message. In practical applications, the firewall may include a plurality of forwarding processors, so that the message is forwarded by using the plurality of forwarding processors.
The message forwarding mode may include a general mode and an optimized mode. In the general mode, each forwarding processor receives and forwards messages of all network cards according to the full connection relation configured by the configuration processor, that is, each forwarding processor obtains and forwards messages of the network card corresponding to each identifier through the corresponding general configuration table. In the optimization mode, the forwarding processor receives and forwards the message of the network card corresponding to each identifier in the respective optimization configuration table, and the configuration processor receives and forwards the message of the network card corresponding to each identifier in the load configuration table. In the optimization mode, the forwarding processor can process the messages of the high-load network card completely without processing the messages of the low-load network card, and the message forwarding performance of the high-load network card is improved.
According to the above description, in both the general mode and the optimized mode, the forwarding processor only needs to forward the message, and does not need to process other work, so that the workload of the forwarding processor is reduced, and the message forwarding efficiency is improved. The configuration processor can not only process configuration work, but also process message forwarding of a low-load network card.
In the general mode, the type of each network card is general; in the optimization mode, the types of the network cards can be divided into a high-load network card and a low-load network card. The high-load network card has large flow, and the throughput of the network card of the type is over 80% of the linear speed under the normal condition. The low-load network card has very small flow, and the configuration processor can independently process a plurality of low-load network cards.
Based on the above description, a message forwarding method provided in the embodiment of the present application will be described below with reference to the accompanying drawings.
Referring to fig. 2, which is a flowchart of a message forwarding method provided in the embodiment of the present application, as shown in fig. 2, the method may include:
s201: the configuration processor obtains performance parameters generated by the forwarding processor processing each network card, and clusters the network cards according to the performance parameters to obtain the clustering result of the network cards.
In this embodiment, to implement different processing for different types of network cards, the configuration processor first obtains performance parameters generated by the forwarding processor processing each network card from the forwarding processor, so as to cluster the network cards according to the performance parameters, to obtain a clustering result of the network cards, that is, to determine the type of the current network card. The performance parameters generated by the forwarding processor processing each network card may include throughput generated when the forwarding processor processes the network card, the number of new sessions, and the like, and the performance parameters may reflect the current traffic of the network card.
In specific implementation, after acquiring the performance parameters generated by the forwarding processor processing each network card, the configuration processor may cluster all the network cards by using a clustering algorithm, and aggregate the network cards belonging to the same type or similar types, thereby obtaining a clustering result.
S202: and determining a message forwarding mode according to the category number of the clustering results.
In this embodiment, after the network cards are clustered according to the performance parameters of the network cards to obtain clustering results, the message forwarding mode may be determined according to the number of categories of the clustering results.
As can be seen from the above description, the message forwarding mode may include a general mode and an optimization mode, and in the general mode, the types of all the network cards are similar and are all general. In the optimized mode, the network cards can be divided into high-load network cards and low-load network cards. That is, in the general mode, the clustering result of the network card is of one type; in the optimization mode, the network card has two types of clustering results, so the configuration processor can determine the message forwarding mode according to the type number of the clustering results.
In the concrete implementation, when the category number of the clustering result is two categories, the message forwarding mode is determined as the optimization mode; and when the category number of the clustering result is one category, determining the message forwarding mode as a general mode. For example, 6 network cards coexist, namely, network card 1, network card 2, network card 3, network card 4, network card 5, and network card 6. The network card 1, the network card 2, the network card 4 and the network card 6 belong to the same class, and the network card 3 and the network card 5 belong to the same class, the message forwarding mode is the optimized mode. If the 6 network cards belong to the same class, the message forwarding mode is a general mode. In addition, when the number of the types of the clustering results is two, the clustering results can be further divided into a low-load network card and a high-load network card. The operation of each forwarding processor in the general mode will be described in the following embodiments.
S203: and if the message forwarding mode is determined to be the optimization mode, adding the identifier of the network card with the clustering result of low load into the load configuration table, and adding the identifier of the network card with the clustering result of high load into the optimization configuration table.
In this embodiment, when it is determined that the message forwarding mode is the optimized mode, the configuration processor adds the identifier of the network card with the low load as the clustering result to the load configuration table, and adds the identifier of the network card with the high load as the clustering result to the optimized configuration table, so as to implement different processing for different types of network cards in the optimized mode. For example, the network card 1, the network card 2, the network card 4, and the network card 6 belong to a low-load network card, the identifier 1 of the network card 1, the identifier 2 of the network card 2, the identifier 4 of the network card 4, and the identifier 6 of the network card 6 are added to the load configuration table, the network card 3 and the network card 5 belong to a high-load network card, and the identifier 3 of the network card 3 and the identifier 5 of the network card 5 are added to the optimal configuration table.
S204: and obtaining messages from the network card queue of the network card corresponding to each identifier in the load configuration table and forwarding the messages.
In this embodiment, after the configuration processor adds the identifier of the low-load network card to the load configuration table, a message may be obtained from the network card queue of the network card corresponding to each identifier in the load configuration table, and the message may be forwarded. That is, in the optimization mode, the configuration processor also performs message forwarding work to process the message of the low-load network card. Because the flow of the low-load network card is very small, the configuration processor can simultaneously process the message forwarding of a plurality of low-load network cards. For example, the configuration processor obtains and forwards the messages of the network card 1, the network card 2, the network card 4 and the network card 6 through the load configuration table.
S205: and changing the working mode of each forwarding processor into an optimization mode and writing the optimization configuration table into each forwarding processor so that each forwarding processor acquires the message from the network card queue of the network card corresponding to each identifier in the optimization configuration table and forwards the message.
In this embodiment, when the configuration processor determines that the message forwarding mode is the optimized mode, each forwarding processor may be triggered to change the operating mode to the optimized mode, and the optimized configuration table is written into each forwarding processor, so that each forwarding processor stores the optimized configuration table, and each forwarding processor acquires a message from the network card queue of each network card identified by the corresponding identifier in the corresponding optimized configuration table to perform message forwarding. The problem of competition of a plurality of forwarding processors is avoided by configuring an exclusive optimized configuration table for each forwarding processor, so that each forwarding processor is not required to be locked when processing the message, and the forwarding performance of the whole firewall is increased linearly with the increase of the forwarding processors.
It can be understood that, in practical applications, each network card sends a message to the configuration processor or the forwarding processor through its own network card queue, and therefore, when the configuration processor or the forwarding processor forwards a message, the configuration processor or the forwarding processor needs to obtain the message through the network card queue of the network card and forward the message.
It should be noted that the optimal configuration table written by the configuration processor into each forwarding processor is the same, that is, a plurality of forwarding processors are configured to process the messages of the same high-load network card. For example, if there are 3 forwarding processors, the forwarding processor 1 obtains and forwards the message of the network card 3 through its corresponding optimized configuration table, and obtains and forwards the message of the network card 5 at the same time; the forwarding processor 2 obtains and forwards the message of the network card 3 through the corresponding optimized configuration table, and obtains and forwards the message of the network card 5 at the same time; the forwarding processor 3 obtains and forwards the message of the network card 3 through the corresponding optimized configuration table, and obtains and forwards the message of the network card 5 at the same time.
It should be noted that, in this embodiment, the execution sequence of S204 and S205 is not limited by the above description, and in practical application, the configuration processor may first execute S205 to trigger the change of the working mode of each forwarding processor and write the optimized configuration table into each forwarding processor, and then execute S204 to obtain the message of the network card corresponding to each identifier from the load configuration table and forward the message.
It can be known from the above embodiments that the configuration processor can cluster the network cards according to the performance parameters, and when the network card clustering result includes a low-load network card and a high-load network card, add the identifier of the low-load network card to the load configuration table, and forward the message for processing the low-load network card by the single configuration processor; and adding the identifier of the high-load network card into the optimized configuration table, and writing the optimized configuration table into each forwarding processor. Meanwhile, the working mode of each forwarding processor is changed into an optimization mode, and each forwarding processor forwards the message of the high-load network card, so that the corresponding relation between the network card and the forwarding processor is dynamically adjusted, the effective allocation of resources is realized, and the message forwarding performance is improved. In addition, in the optimization mode, the optimization configuration table is written into each forwarding processor, so that each forwarding processor can read the corresponding optimization configuration table when forwarding the message, locking is not required among the forwarding processors, the forwarding processors have no problem of resource competition sharing in the whole forwarding process, and the concurrent processing performance is improved.
Based on the foregoing embodiment, it can be seen that the packet forwarding mode includes a general mode and an optimization mode, and the foregoing embodiment introduces a working process when the configuration processor determines that the packet forwarding mode is the optimization mode according to the number of categories of the clustering result. The operation of the configuration processor and the forwarding processor when the message forwarding mode is the general mode will be described below. And when the configuration processor determines that the message forwarding mode is the general mode according to the category number of the clustering result, the working mode of each forwarding processor is not changed, so that each forwarding processor acquires the message from the network card queue of the network card corresponding to each identifier in the general configuration table and forwards the message, wherein the general configuration table comprises the identifiers of all the current network cards.
That is, the default operating mode of each forwarding processor is a general mode, and when the configuration processor determines that the message forwarding mode is the general mode, the configuration processor does not need to trigger each forwarding processor to change the operating mode, and still forwards the message according to the default operating mode, that is, each forwarding processor processes the messages of all network cards. In this embodiment, in the general mode, each forwarding processor stores a general configuration table, and each forwarding processor can obtain a message through a network card queue of a network card corresponding to each identifier in the general configuration table corresponding to each forwarding processor and forward the message, so that the forwarding processors do not need to be locked during operation, and thus, each forwarding processor does not have a problem of resource contention sharing during the whole forwarding process, and the concurrency processing performance is improved.
In specific implementation, the embodiment of the present application provides an implementation manner for determining a message forwarding mode according to the category number of the clustering result, and specifically may be that, when the category number of the clustering result is two, the message forwarding mode is determined as an optimization mode; and when the category number of the clustering result is one category, determining the message forwarding mode as a general mode. For example, when the aggregation result of the network card is general, the configuration processor determines that the message forwarding mode is a general mode; and when the clustering result of the network card comprises a high-load network card and a low-load network card, the configuration processor determines that the message forwarding mode is the optimization mode.
It is understood that, in practical applications, each network card may correspond to a plurality of network card queues, so that in the general mode, the message of each network card may be forwarded by a plurality of forwarding processors. When the message forwarding mode is the optimized mode, the messages of the low-load network card are only received and forwarded by the configuration processor, and in order to avoid the low-load network card from sending messages through a plurality of network card queues, the network card queues of the low-load network card are required to be configured with network card queue rules. When the method is concretely implemented, network card queue rules are configured for the network cards corresponding to the identifiers in the load configuration table, so that the network cards corresponding to the identifiers in the load configuration table use a single target network card queue to send messages; and acquiring messages from the target network card queue of the network card corresponding to each identifier in the load configuration table and forwarding the messages.
In specific implementation, the configuration processor traverses the network cards corresponding to the identifiers of the load configuration table, and configures a network card queue rule for each network card, so that all messages of each network card are sent by using a single target network card queue. When the configuration processor forwards the message of the network card corresponding to each identifier of the load configuration table, the message is obtained from the target network card queue used by the network card to forward the message. For example, the network card 1 includes 4 network card queues, and the network card queue 1 is configured as a target network card queue; the network card 2 comprises 3 network card queues, and the network card queue 1 is configured as a target network card queue; the network card 4 comprises 3 network card queues, and the network card queue 2 is configured as a target network card queue; the network card 6 comprises 4 network card queues, and the network card queue 3 is configured as a target network card queue. The configuration processor respectively obtains messages from the network card queue 1 of the network card 1, the network card queue 1 of the network card 2, the network card queue 2 of the network card 4 and the network card queue 3 of the network card 6 and forwards the messages.
In a possible implementation manner of the embodiment of the present application, since the traffic of the network card changes in real time and the processing performance of the forwarding processor changes accordingly, in order to dynamically adjust the working mode of the forwarding processor, the configuration processor may monitor the processing performance of the forwarding processor, so as to change the working mode of the forwarding processor according to the processing performance of the forwarding processor. Specifically, in the optimization mode, the configuration processor monitors the processing performance of the forwarding processor, and when the processing performance of the forwarding processor meets a preset condition, the working mode of each forwarding processor is changed to a general mode, so that the forwarding processor obtains a message from a network card queue of a network card corresponding to each identifier in a general configuration table and forwards the message, wherein the general configuration table includes identifiers of all current network cards.
In this embodiment, the configuration processor monitors the processing performance of each forwarding processor, and when the processing performance of all forwarding processors meets the preset condition, the working mode of all forwarding processors is changed to the general mode, so that each forwarding processor obtains and forwards the messages of all network cards through the corresponding general configuration table. In specific implementation, the configuration processor may monitor the utilization rate of each forwarding processor, and if the utilization rate of each forwarding processor is lower than a preset threshold and the continuous duration of the utilization rate lower than the preset threshold exceeds a preset duration, trigger the operating mode of each forwarding processor to be changed from the optimization mode to the general mode.
It can be understood that, in the optimization mode, the configuration processor sets a network card queue rule for each identifier in the load configuration table corresponding to the network card, so that the configuration processor obtains a message through a target network card queue of the network card and forwards the message. When the configuration processor triggers each forwarding processor to change from the optimization mode to the general mode, the network card queue rule needs to be canceled, so that the network card can send the message to the multiple forwarding processors through the multiple network card queues. Specifically, the network card corresponding to each identifier in the load configuration table is not configured with the network card queue rule, so that the network card corresponding to each identifier in the load configuration table uses a plurality of network card queues to send messages.
Similarly, in practical application, the traffic of the network card is also changed in real time, that is, the type of the network card is changed, in order to ensure that the network card with high load can be forwarded by the forwarding processor, the configuration processor needs to monitor whether the network card corresponding to each identifier in the load configuration table has a condition of very large message traffic, so as to move the network card identifier with large message traffic in the load configuration table to the optimized configuration table, which can be specifically realized by the following steps:
1) and acquiring the message flow of the network card corresponding to each identifier in the load configuration table, and determining the network card with the message flow exceeding a first threshold value in the network card corresponding to each identifier in the load configuration table as a first target network card.
In this embodiment, in the optimization mode, the configuration processor may traverse the message traffic of each network card corresponding to each identifier in the load configuration table, and determine the network card whose message traffic exceeds the first threshold as the first target network card, that is, determine the network card whose message traffic exceeds the first threshold as the high-load network card. The first threshold may be set according to an actual application, and this embodiment is not limited.
2) And removing the identifier of the first target network card from the load configuration table, and adding the identifier of the first target network card into the optimized configuration table.
In this embodiment, after the configuration processor determines the first target network card from the load configuration table, it indicates that the traffic of the first target network card is large, and the configuration processor cannot process the message of the first target network card, the identifier of the first target network card is removed from the load configuration table, and the identifier of the first target network card is added to the optimized configuration table, so that the forwarding processor can process the message of the first target network card.
3) And rewriting the optimized configuration table into each forwarding processor.
In this embodiment, after the configuration processor adds the identifier of the first target network card to the optimal configuration table, the optimal configuration table including the identifier of the first target network card is rewritten into each forwarding processor.
In practical application, when the configuration processor adds the identifier of the first target network card to the optimal configuration table, the configuration processor reconstructs an optimal configuration table instead of adding the identifier of the first target network card to the optimal configuration table corresponding to each forwarding processor, the optimal configuration table includes the identifier of the first target network card, and then the optimal configuration table is rewritten into each forwarding processor. In specific implementation, the optimized configuration table in each forwarding processor can be updated by adopting a whole table replacement mode, so that the multi-core forwarding performance is improved.
It should be noted that, after the identifier of the first target network card is transferred from the load configuration table to the optimized configuration table, in order to implement that the multiple forwarding processors can process the message of the first target network card at the same time, the network card queue rule set by the identifier of the first target network card in the load configuration identifier needs to be cancelled. Namely, the network card queue rule is not configured for the first target network card, so that the first target network card uses a plurality of network card queues to send messages.
For example, the configuration processor removes the identifier 1 of the high-load network card 1 in the load configuration table, copies the original optimization configuration table, and adds the identifier of the network card 1 to the copied optimization configuration table. And simultaneously, the rule configured by the network card 1 and used for sending the messages by using the network card queue 1 is cancelled, so that the network card 1 can send the messages through a plurality of network card queues so as to be received and forwarded by a plurality of forwarding processors. And finally, replacing the optimized configuration table comprising the identifier 1 with the optimized configuration table stored in the forwarding processor, so that the forwarding processor can acquire the message according to the replaced optimized configuration table and forward the message.
Therefore, in the optimization mode, the configuration processor can dynamically adjust the mapping relationship between the network card and the forwarding processor according to the message flow of the network card corresponding to each identifier in the load configuration table, so that when the network card flow corresponding to each identifier in the load configuration table is large, the forwarding processor can be used for forwarding messages, and the message forwarding performance is improved.
Similarly, in order to avoid that the message traffic of the network card corresponding to each identifier in the optimized configuration table becomes smaller and continues to occupy the resources of the forwarding processor, the configuration processor may also monitor the message traffic of the network card corresponding to each identifier in the optimized configuration table, so that the network card identifier with smaller message traffic may be removed from the optimized configuration table. The method can be realized by the following steps:
1) and acquiring the message flow of the network card corresponding to each identifier in the optimized configuration table, and determining the network card with the message flow smaller than a second threshold value in the network card corresponding to each identifier in the optimized configuration table as a second target network card.
In this embodiment, in the optimization mode, the configuration processor may traverse the message traffic of each network card corresponding to each identifier in the optimization configuration table, and determine the network card with the message traffic smaller than the second threshold as the first target network card, that is, determine the network card with the message traffic smaller than the second threshold as the low-load network card. The second threshold may be set according to an actual application, and this embodiment is not limited herein.
2) And removing the identifier of the second target network card from the optimization configuration table, and adding the identifier of the second target network card to the load configuration table.
In this embodiment, after the configuration processor determines the second target network card from the optimized configuration table, it indicates that the flow of the second target network card is small, and the forwarding processor is not required to forward the message, the expression of the second target network card is removed from the optimized configuration table, and the identifier of the second target network card is added to the load configuration table, so that the configuration processor processes the message of the second target network card.
3) And rewriting the optimized configuration table into each forwarding processor.
In this embodiment, after the configuration processor removes the identifier of the second target network card from the optimized configuration table, the optimized configuration table that does not include the identifier of the second target network card is rewritten into each forwarding processor.
In a specific implementation, each forwarding processor corresponds to the optimized configuration table, and when the second target network card identifier needs to be removed from the optimized configuration table, a removal operation needs to be performed on each forwarding processor, so that the workload of the configuration processor is increased. In order to improve the working performance of the configuration processor, when the configuration processor needs to use the identifier of the second target network card from the optimal configuration table, the optimal configuration table of each forwarding processor can be updated in a whole-table replacement mode. Specifically, the configuration processor may copy an original optimized configuration table from a certain forwarding processor, remove the identifier of the second target network card from the optimized-configuration table, and replace the original optimized configuration table of each forwarding processor with the optimized configuration table from which the identifier of the second target network card has been removed, thereby reducing the workload of the configuration processor and improving the forwarding processing performance.
It should be noted that, after the identifier of the second target network card is added to the load configuration table, a network card queue rule needs to be configured for the second target network card, so that the second target network card uses a single target network card queue to perform message sending.
For example, when the configuration processor determines that the network card 3 corresponding to the identifier 3 in the optimized configuration table is a low-load network card, the original optimized configuration table is copied, the identifier 3 in the optimized configuration table is removed, and the identifier 3 is added to the load configuration table. Meanwhile, a network card queue rule is configured for the network card 3, so that the configuration processor can receive the message sent by the network card 3 through a single target network card queue. Finally, the original optimized configuration table in the forwarding processor is replaced by the optimized configuration table with the identification 3 removed.
Therefore, in the optimization mode, the configuration processor can dynamically adjust the mapping relationship between the network card and the forwarding processor according to the message flow of the network card corresponding to each identifier in the optimization configuration table, so that when the network card flow corresponding to each identifier in the optimization configuration table is small, the configuration processor can be used for forwarding messages, the forwarding processor is prevented from being occupied, and the message forwarding performance is improved.
Based on the above method embodiment, the present application provides a message forwarding apparatus, which will be described below with reference to the accompanying drawings.
Referring to fig. 3, which is a structural diagram of a message forwarding apparatus provided in the embodiment of the present application, as shown in fig. 3, the apparatus may include:
a first obtaining unit 301, configured to obtain performance parameters generated by processing each network card by a forwarding processor, and perform clustering on the network cards according to the performance parameters to obtain a clustering result of the network cards;
a determining unit 302, configured to determine a packet forwarding mode according to the category number of the clustering result;
an adding unit 303, configured to add, if it is determined that the packet forwarding mode is the optimized mode, the identifier of the network card with the low load as the clustering result into a load configuration table, and add the identifier of the network card with the high load as the clustering result into the optimized configuration table;
a second obtaining unit 304, configured to obtain a message from a network card queue of a network card corresponding to each identifier in the load configuration table, and forward the message;
a first changing unit 305, configured to change the working mode of each forwarding processor to an optimized mode, and write the optimized configuration table into each forwarding processor, so that each forwarding processor obtains a message from a network card queue of a network card corresponding to each identifier in the optimized configuration table and forwards the message.
In a possible implementation manner, the first changing unit is further configured to, if it is determined that the message forwarding mode is a general mode, not change the working mode of each forwarding processor, so that each forwarding processor obtains a message from a network card queue of a network card corresponding to each identifier in a general configuration table and forwards the message, where the general configuration table includes identifiers of all current network cards.
In a possible implementation manner, the determining unit is specifically configured to determine, when the number of categories of the clustering result is two, a packet forwarding mode as an optimized mode; and when the category number of the clustering result is one category, determining a message forwarding mode as a general mode.
In one possible implementation, the apparatus further includes:
the first configuration unit is used for configuring a network card queue rule for the network card corresponding to each identifier in the load configuration table before executing the second acquisition unit, so that the network card corresponding to each identifier in the load configuration table uses a single target network card queue to send a message;
the second obtaining unit is specifically configured to obtain a message from a target network card queue of the network card corresponding to each identifier in the load configuration table, and forward the message.
In one possible implementation, the apparatus further includes:
a monitoring unit for monitoring the processing performance of the forwarding processor after executing the first changing unit;
and the second changing unit is used for changing the working mode of each forwarding processor into a general mode when the processing performance of the forwarding processor meets a preset condition, so that the forwarding processor obtains a message from a network card queue of a network card corresponding to each identifier in a general configuration table and forwards the message, wherein the general configuration table comprises identifiers of all current network cards.
In one possible implementation, the apparatus further includes:
and the first canceling unit is used for canceling the configuration of the network card queue rule for the network card corresponding to each identifier in the load configuration table before executing the second changing unit, so that the network card corresponding to each identifier in the load configuration table uses a plurality of network card queues to send messages.
In one possible implementation, the apparatus further includes:
a third obtaining unit, configured to obtain, after executing the first changing unit, a message traffic of the network card corresponding to each identifier in the load configuration table, and determine, as a first target network card, a network card whose message traffic exceeds a first threshold in the network card corresponding to each identifier in the load configuration table;
a first removing unit, configured to remove the identifier of the first target network card from the load configuration table, and add the identifier of the first target network card to the optimized configuration table;
a first writing unit, configured to rewrite the optimized configuration table into each forwarding processor.
In one possible implementation, the apparatus further includes:
and the second canceling unit is used for canceling the configuration of a network card queue rule for the first target network card so as to enable the first target network card to use a plurality of network card queues for message sending.
In one possible implementation, the apparatus further includes:
a fourth obtaining unit, configured to obtain, after executing the first changing unit, a message flow of the network card corresponding to each identifier in the optimized configuration table, and determine, as a second target network card, the network card whose message flow is smaller than a second threshold value in the network card corresponding to each identifier in the optimized configuration table;
a second removing unit, configured to remove the identifier of the second target network card from the optimized configuration table, and add the identifier of the second target network card to the load configuration table;
and a second writing unit, configured to rewrite the optimized configuration table into each forwarding processor.
In one possible implementation, the apparatus further includes:
and the second configuration unit is used for configuring a network card queue rule for the second target network card so that the second target network card uses a single target network card queue to send messages.
In a possible implementation manner, the optimized configuration table is written into each forwarding processor, and a whole table replacement manner is adopted.
It should be noted that, implementation of each unit in this embodiment may refer to the above method embodiment, and this embodiment is not described herein again.
Based on the foregoing apparatus, the present application further provides a message forwarding device, see fig. 4, which is a structure diagram of a message forwarding device provided in this application embodiment, where the message forwarding device may include:
a configuration processor 401 and a forwarding processor 402;
the configuration processor may be the apparatus described in the above apparatus embodiments;
the forwarding processor 402 is configured to obtain a message from a network card queue of a network card corresponding to each identifier in the optimized configuration table and forward the message.
It should be noted that, for specific implementation of each processor in this embodiment, reference may be made to the apparatus embodiment and the method embodiment described above, and details of this embodiment are not described herein again.
In addition, an embodiment of the present application further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a terminal device, the terminal device is caused to execute the packet forwarding method.
The embodiment of the present application provides a computer program product, which is characterized in that when the computer program product runs on a terminal device, the terminal device is enabled to execute the message forwarding method.
According to the embodiment, the configuration processor can cluster the network cards according to the performance parameters, when the network card clustering result comprises the low-load network card and the high-load network card, the identifier of the low-load network card is added into the load configuration table, and the single configuration processor forwards and processes the message of the low-load network card; and adding the identifier of the high-load network card into the optimized configuration table, and writing the optimized configuration table into each forwarding processor. Meanwhile, the working mode of each forwarding processor is changed into an optimization mode, and each forwarding processor forwards the message of the high-load network card, so that the corresponding relation between the network card and the forwarding processor is dynamically adjusted, the effective allocation of resources is realized, and the message forwarding performance is improved. In addition, in the optimization mode, the optimization configuration table is written into each forwarding processor, so that each forwarding processor can read the corresponding optimization configuration table when forwarding the message, locking is not required among the forwarding processors, that is, the forwarding processors have no problem of resource competition in common in the whole forwarding process, and the concurrent processing performance is improved.
It should be noted that, in the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the system or the device disclosed by the embodiment, the description is simple because the system or the device corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (14)

1. A message forwarding method is characterized in that the method comprises the following steps:
the configuration processor acquires performance parameters generated by processing each network card by the forwarding processor, and clusters the network cards according to the performance parameters to obtain a clustering result of the network cards;
determining a message forwarding mode according to the category number of the clustering results;
if the message forwarding mode is determined to be the optimization mode, adding the identifier of the network card with the clustering result of low load into a load configuration table, and adding the identifier of the network card with the clustering result of high load into the optimization configuration table;
obtaining messages from a network card queue of a network card corresponding to each identifier in the load configuration table and forwarding the messages;
changing the working mode of each forwarding processor into an optimized mode and writing the optimized configuration table into each forwarding processor, so that each forwarding processor acquires a message from a network card queue of a network card corresponding to each identifier in the optimized configuration table and forwards the message.
2. The method of claim 1, further comprising:
and if the message forwarding mode is determined to be the general mode, the working mode of each forwarding processor is not changed, so that each forwarding processor obtains the message from the network card queue of the network card corresponding to each identifier in a general configuration table and forwards the message, wherein the general configuration table comprises the identifiers of all the current network cards.
3. The method according to claim 1 or 2, wherein the determining a packet forwarding mode according to the number of categories of the clustering result comprises:
when the category number of the clustering result is two categories, determining a message forwarding mode as an optimization mode;
and when the category number of the clustering result is one category, determining a message forwarding mode as a general mode.
4. The method according to claim 1, wherein before obtaining the message from the network card queue of each network card corresponding to the identifier in the load configuration table and forwarding the message, the method further comprises:
configuring a network card queue rule for the network card corresponding to each identifier in the load configuration table, so that the network card corresponding to each identifier in the load configuration table uses a single target network card queue to send a message;
the network card queue of the network card corresponding to each identifier in the load configuration table is used for acquiring messages and forwarding the messages:
and acquiring messages from the target network card queue of the network card corresponding to each identifier in the load configuration table and forwarding the messages.
5. The method of claim 1, wherein after changing the operating mode of each forwarding processor to an optimized mode and writing the optimized configuration table to each forwarding processor, the method further comprises:
monitoring the processing performance of the forwarding processors, and changing the working mode of each forwarding processor into a general mode when the processing performance of the forwarding processor meets a preset condition so that the forwarding processor obtains messages from a network card queue of a network card corresponding to each identifier in a general configuration table and forwards the messages, wherein the general configuration table comprises identifiers of all current network cards.
6. The method according to claim 5, wherein when the processing performance of the forwarding processors satisfies a preset condition, before changing the operation mode of each of the forwarding processors to the general mode, the method further comprises:
and canceling the configuration of a network card queue rule for the network card corresponding to each identifier in the load configuration table, so that the network card corresponding to each identifier in the load configuration table uses a plurality of network card queues to send messages.
7. The method of claim 1, wherein after changing the operating mode of each forwarding processor to an optimized mode and writing the optimized configuration table to each forwarding processor, the method further comprises:
acquiring message flow of a network card corresponding to each identifier in the load configuration table, and determining the network card with the message flow exceeding a first threshold value in the network card corresponding to each identifier in the load configuration table as a first target network card;
removing the identifier of the first target network card from the load configuration table, and adding the identifier of the first target network card to the optimized configuration table;
and rewriting the optimized configuration table into each forwarding processor.
8. The method of claim 7, further comprising:
and canceling the configuration of a network card queue rule for the first target network card so that the first target network card uses a plurality of network card queues to send messages.
9. The method of claim 1, wherein after changing the operating mode of each forwarding processor to an optimized mode and writing the optimized configuration table to each forwarding processor, the method further comprises:
acquiring the message flow of the network card corresponding to each identifier in the optimized configuration table, and determining the network card with the message flow smaller than a second threshold value in the network card corresponding to each identifier in the optimized configuration table as a second target network card;
removing the identifier of the second target network card from the optimized configuration table, and adding the identifier of the second target network card to the load configuration table;
and rewriting the optimized configuration table into each forwarding processor.
10. The method of claim 9, further comprising:
and configuring a network card queue rule for the second target network card so that the second target network card uses a single target network card queue to send messages.
11. The method of claim 1, 7 or 9, wherein writing the optimal configuration table to each of the forwarding processors uses a whole-table replacement.
12. A message forwarding apparatus, the apparatus comprising:
the first acquisition unit is used for acquiring performance parameters generated by processing each network card by the forwarding processor, clustering the network cards according to the performance parameters and acquiring the clustering result of the network cards;
a determining unit, configured to determine a packet forwarding mode according to the category number of the clustering results;
an adding unit, configured to add, if it is determined that the packet forwarding mode is the optimized mode, the identifier of the network card with the low load as the clustering result to a load configuration table, and add the identifier of the network card with the high load as the clustering result to the optimized configuration table;
a second obtaining unit, configured to obtain a message from a network card queue of a network card corresponding to each identifier in the load configuration table, and forward the message;
and the first changing unit is used for changing the working mode of each forwarding processor into an optimized mode and writing the optimized configuration table into each forwarding processor, so that each forwarding processor obtains a message from a network card queue of a network card corresponding to each identifier in the optimized configuration table and forwards the message.
13. A message forwarding device, the device comprising:
a configuration processor and a forwarding processor;
the configuration processor is the message forwarding apparatus according to claim 12;
and the forwarding processor is used for acquiring messages from the network card queue of the network card corresponding to each identifier in the optimization configuration table and forwarding the messages.
14. A computer-readable storage medium having stored therein instructions that, when run on a terminal device, cause the terminal device to perform the message forwarding method of any one of claims 1-11.
CN201910257585.8A 2019-04-01 2019-04-01 Message forwarding method and device and related product Active CN110062033B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910257585.8A CN110062033B (en) 2019-04-01 2019-04-01 Message forwarding method and device and related product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910257585.8A CN110062033B (en) 2019-04-01 2019-04-01 Message forwarding method and device and related product

Publications (2)

Publication Number Publication Date
CN110062033A CN110062033A (en) 2019-07-26
CN110062033B true CN110062033B (en) 2022-02-18

Family

ID=67318074

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910257585.8A Active CN110062033B (en) 2019-04-01 2019-04-01 Message forwarding method and device and related product

Country Status (1)

Country Link
CN (1) CN110062033B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7631100B2 (en) * 2003-10-07 2009-12-08 Microsoft Corporation Supporting point-to-point intracluster communications between replicated cluster nodes
CN103596290A (en) * 2013-10-24 2014-02-19 西南交通大学 Wireless multi-network integration method
CN105357203A (en) * 2015-11-13 2016-02-24 汉柏科技有限公司 Message processing method for firewall equipment, processor and firewall equipment
CN109361609A (en) * 2018-12-14 2019-02-19 东软集团股份有限公司 Message forwarding method, device, equipment and the storage medium of firewall box

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7631100B2 (en) * 2003-10-07 2009-12-08 Microsoft Corporation Supporting point-to-point intracluster communications between replicated cluster nodes
CN103596290A (en) * 2013-10-24 2014-02-19 西南交通大学 Wireless multi-network integration method
CN105357203A (en) * 2015-11-13 2016-02-24 汉柏科技有限公司 Message processing method for firewall equipment, processor and firewall equipment
CN109361609A (en) * 2018-12-14 2019-02-19 东软集团股份有限公司 Message forwarding method, device, equipment and the storage medium of firewall box

Also Published As

Publication number Publication date
CN110062033A (en) 2019-07-26

Similar Documents

Publication Publication Date Title
US20160077872A1 (en) Data processing apparatus and data processing method
WO2019223596A1 (en) Method, device, and apparatus for event processing, and storage medium
CN109802951B (en) Message forwarding method, device and storage device
EP2618257A2 (en) Scalable sockets
CN108021449B (en) Coroutine implementation method, terminal equipment and storage medium
US20240152395A1 (en) Resource scheduling method and apparatus, and computing node
US11438271B2 (en) Method, electronic device and computer program product of load balancing
US9614728B2 (en) Identifying network communication patterns
CN108512782A (en) Accesses control list is grouped method of adjustment, the network equipment and system
US10237148B2 (en) Providing a data set for tracking and diagnosing datacenter issues
CN112231102A (en) Method, device, equipment and product for improving performance of storage system
CN100462956C (en) Method and system for loading programme on computer system
US20140115601A1 (en) Data processing method and data processing system
CN109889406B (en) Method, apparatus, device and storage medium for managing network connection
Xu et al. Building a high-performance key–value cache as an energy-efficient appliance
CN110062033B (en) Message forwarding method and device and related product
CN111400241B (en) Data reconstruction method and device
CN111049750B (en) Message forwarding method, system and equipment
CN109165135B (en) Data management method, computer readable storage medium and terminal equipment
CN111008146A (en) Method and system for testing safety of cloud host
CN108521351B (en) Session flow statistical method, processor core, storage medium and electronic device
CN110737530A (en) method for improving packet receiving capability of HANDLE identifier parsing system
CN111447145B (en) Flow table management method, device, system and storage medium of multi-core system
CN110119301A (en) A kind of virtual machine migration method and system
CN110046040B (en) Distributed task processing method and system and storage medium

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
GR01 Patent grant
GR01 Patent grant