CN115580584A - Message processing method and device - Google Patents

Message processing method and device Download PDF

Info

Publication number
CN115580584A
CN115580584A CN202211181084.4A CN202211181084A CN115580584A CN 115580584 A CN115580584 A CN 115580584A CN 202211181084 A CN202211181084 A CN 202211181084A CN 115580584 A CN115580584 A CN 115580584A
Authority
CN
China
Prior art keywords
message
sending
forwarding
processor
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211181084.4A
Other languages
Chinese (zh)
Inventor
范路路
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Security Technologies Co Ltd
Original Assignee
New H3C Security Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Security Technologies Co Ltd filed Critical New H3C Security Technologies Co Ltd
Priority to CN202211181084.4A priority Critical patent/CN115580584A/en
Publication of CN115580584A publication Critical patent/CN115580584A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering

Landscapes

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

Abstract

The specification provides a message processing method and a message processing device, and relates to the technical field of communication. A message processing method comprises the following steps: caching the received message, and recording a cache address of the message and a forwarding mark set as a first value in a sending queue corresponding to a receiving and sending core in a processor; if the order is required to be preserved, a hash result obtained by carrying out hash operation according to the quintuple information is sent to a corresponding data core in the processor for processing; if the order is not required to be preserved, distributing the message according to the occupancy rate of each data core in the processor for processing; setting the forwarding mark of the processed message as a second value; and scanning the sending queues corresponding to the receiving and sending cores according to the recording sequence, stopping sending the message if the forwarding mark is set to a first value, and reading the message according to the cache address and sending the message if the forwarding mark is set to a second value. By the method, the reliability of processing and forwarding of the network equipment can be improved.

Description

Message processing method and device
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method and an apparatus for processing a packet.
Background
With the development and deepening of internet technology, people's demand for information security is gradually increasing, and network devices having functions of information analysis, information filtering, and the like are also gradually applied to the internet, such as firewall devices. In the current network environment, more and more service types need to be processed, the traffic mode is more and more complex, and some services need to process and send messages in sequence, that is, order preservation. For example, when network devices such as firewall devices perform DPI (Deep Packet Inspection) on a Packet, the Packet needs to be sent to the same processor core for processing according to the sequence of the Packet.
When load sharing is performed through hash transportation, if large-flow messages which need to be order-preserved appear, the messages may be distributed to a processor core with a high occupancy rate, so that congestion of the messages in the processor core is caused, even packet loss is caused, and the reliability of message processing and forwarding performed by network equipment is reduced.
Disclosure of Invention
In order to overcome the problems in the related art, the present specification provides a method and an apparatus for processing a message.
In combination with the first aspect of the embodiments of the present specification, the present application provides a message processing method, including:
caching the received message, and recording a caching address of the message and a forwarding mark set as a first value in a sending queue corresponding to a receiving and sending core in a processor, wherein the forwarding mark represents that the cached message cannot be forwarded when the forwarding mark is the first value, and the forwarding mark represents that the cached message can be forwarded when the forwarding mark is a second value;
if the message needs to be subjected to order preservation, the message is sent to a corresponding data core in a processor for processing according to a hash result obtained by carrying out hash operation on the quintuple information of the message, and a forwarding mark is set to be a second value after the message is processed;
if the message does not need to be subjected to order preservation, distributing the message according to the occupancy rate of each data core in the processor for processing, and setting the forwarding mark as a second value after processing;
and scanning the sending queues corresponding to the receiving and sending cores in the processor according to the recording sequence, stopping sending the message if the current forwarding mark is set to be a first value, and reading the message according to the cache address and sending the message if the current forwarding mark is set to be a second value.
Optionally, in the sending queue, the forwarding flag is located before the buffer address.
Optionally, caching the received packet, and recording a cache address of the packet and a forwarding flag set as a first value in a sending queue corresponding to a transceiving core in the processor, including:
if the table entry corresponding to the message is matched in the fast forwarding table, forwarding the message based on the matched table entry;
if the table entry corresponding to the message is not matched in the fast forwarding table, caching the message, and recording the caching address of the message and the forwarding mark set as the first value in a sending queue corresponding to a receiving and sending core in the processor.
In combination with the second aspect of the embodiments of the present specification, the present application provides a message processing apparatus, including:
the cache unit is used for caching the received message and recording a cache address of the message and a forwarding mark set as a first value in a sending queue corresponding to a receiving and sending core in the processor, wherein the forwarding mark indicates that the cached message cannot be forwarded when the forwarding mark is the first value, and the forwarding mark indicates that the cached message can be forwarded when the forwarding mark is a second value;
a distributing unit, configured to, if it is determined that the packet needs to be order-preserved, perform a hash operation according to quintuple information of the packet to obtain a hash result, and upload the packet to a corresponding data core in the processor for processing, and, if it is determined that the packet does not need to be order-preserved, distribute the packet according to an occupancy rate of each data core in the processor for processing
The marking unit is used for setting a forwarding mark corresponding to the message as a second value after the message is processed;
and the sending unit is used for scanning the sending queues corresponding to the receiving and sending cores in the processor according to the recording sequence, stopping sending the message if the current forwarding mark is set to be a first value, and reading the message and sending the message according to the cache address if the current forwarding mark is set to be a second value.
Optionally, in the sending queue, the forwarding flag is located before the buffer address.
Optionally, the caching unit is specifically configured to forward, by the sending unit, the packet based on the matched entry if the entry corresponding to the packet is matched in the fast forwarding table; if the table entry corresponding to the message is not matched in the fast forwarding table, the message is cached, and the cache address of the message and the forwarding mark set as the first value are recorded in a sending queue corresponding to a receiving and sending core in the processor.
In combination with the third aspect of the embodiments of the present specification, the present application provides a network device, including: a processor, a machine-readable storage medium, and a transceiver;
the processor comprises one or more transceiving cores and a data core, wherein each transceiving core is provided with a sending queue;
a machine-readable storage medium stores machine-executable instructions executable by a processor, the processor being caused by the machine-executable instructions to:
caching a message received through a transceiver, and recording a cache address of the message and a forwarding mark set as a first value in a sending queue corresponding to a transceiving core in a processor, wherein the forwarding mark indicates that the cached message cannot be forwarded when the forwarding mark is the first value, and the forwarding mark indicates that the cached message can be forwarded when the forwarding mark is a second value;
if the message needs to be subjected to order preservation, the message is sent to a corresponding data core in a processor for processing according to a hash result obtained by carrying out hash operation on the quintuple information of the message, and a forwarding mark is set as a second value after the message is processed;
if the message does not need to be subjected to order preservation, distributing the message for processing according to the occupancy rate of each data core in the processor, and setting the forwarding mark as a second value after processing;
and scanning the sending queues corresponding to the receiving and sending cores in the processor according to the recording sequence, stopping sending the message if the current forwarding mark is set to be a first value, and reading the message according to the cache address and sending the message through the transceiver if the current forwarding mark is set to be a second value.
Optionally, in the sending queue, the forwarding flag is located before the buffer address.
Optionally, caching the message received through the transceiver, and recording a cache address of the message and a forwarding flag set as a first value in a sending queue corresponding to a sending and receiving core in the processor, including:
if the table entry corresponding to the message is matched in the fast forwarding table, forwarding the message through the transceiver based on the matched table entry;
if the table entry corresponding to the message is not matched in the fast forwarding table, the message is cached, and the cache address of the message and the forwarding mark set as the first value are recorded in a sending queue corresponding to a receiving and sending core in the processor.
Optionally, the network device is a firewall device.
In connection with a fourth aspect of embodiments herein, there is provided a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: implementing the method steps of any of the above.
The technical scheme provided by the implementation mode of the specification can have the following beneficial effects:
in the embodiment of the present specification, cores of a processor are divided into a transceiving core for receiving and sending a packet and a data core for processing the packet, and the packet that needs to be processed in an order-preserving manner and the packet that does not need to be processed in an order-preserving manner are distinguished, so that a relatively idle data core processes the packet that does not need to be processed in an order-preserving manner, and the packet that needs to be processed in an order-preserving manner is sent to one data core for processing by hashing according to quintuple information, and the packet that is not processed is detected in a sending queue corresponding to the transceiving core and then is stopped from being sent, thereby ensuring order-preserving and balanced load sharing of the packet, and improving reliability of packet processing and forwarding by a network device.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the specification.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present specification and together with the description, serve to explain the principles of the specification.
Fig. 1 is a flow chart of a message processing method according to the present application;
fig. 2 is a schematic structural diagram of a network device to which the present application relates;
fig. 3 is a schematic structural diagram of a processor in a network device according to an embodiment of the present application, where a fast forwarding table is mounted in the processor;
fig. 4 is a schematic structural diagram of a processor in a network device according to an embodiment of the present invention, where a packet is distributed through a fast forwarding table;
fig. 5 is a schematic diagram illustrating a network device distributing a packet according to an embodiment of the present application;
fig. 6 is a schematic diagram of a correspondence between a message and a transmission queue in a network device according to an embodiment of the present application;
fig. 7 is a schematic configuration diagram of a message processing device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification.
The present application provides a message processing method, as shown in fig. 1, including:
s100, caching the received message, and recording the cache address of the message and a forwarding mark set as a first value in a sending queue corresponding to a receiving and sending core in the processor.
As shown in fig. 2, the network device includes a processor, a memory, a machine-readable storage medium, a transceiver, and a bus, and the processor, the memory, the machine-readable storage medium, and the transceiver are connected by the bus.
A plurality of processor cores are formed in the processor, and the processor cores are functionally divided into a transceiving core and a data core, where the transceiving core is configured to receive, perform table lookup according to a packet, and send the packet, and the data core is configured to process the received packet, and taking fig. 2 as an example, the processor is provided with one transceiving core and three data cores.
In the memory or the memory in the processor, a transmission queue may be formed, where the transmission queue is a segment of storage space, each transmission queue corresponds to one transceiver core, and the transmission queue is set to a first-in-first-out read-write mode. After the receiving and sending core receives the message through the transceiver, the message can be cached, the cache address caching the message is recorded in the sending queue, and reading and analyzing are carried out according to the message head of the message.
When the cache address is recorded, a forwarding flag is also required to be recorded, and the forwarding flag is used for identifying whether the packet needs to be processed by a data core. When the forwarding flag is a first value, it indicates that the cached packet cannot be forwarded, and when the forwarding flag is a second value, it indicates that the cached packet can be forwarded, and the following description will be given by taking the first value as 0 and the second value as 1 as an example. The forwarding tag may be set before a buffer address corresponding to a packet as needed, or after the buffer address, in order to determine whether the current packet can be sent quickly and without reading consumption, in the sending queue, the forwarding tag is located before the buffer address.
In order to accelerate the forwarding rate of the packet, optionally, step S100 is to cache the received packet, and record a cache address of the packet and a forwarding flag set as a first value in a sending queue corresponding to a transceiving core in the processor, where the forwarding flag includes:
S100A, if the table entry corresponding to the message is not matched in the fast forwarding table, caching the message, and recording the caching address of the message and the forwarding mark set as the first value in a sending queue corresponding to a receiving and sending core in the processor.
In the network device, for a data flow with the same five-tuple information, a fast forwarding table may be generated, and the fast forwarding table may record the five-tuple information of the data flow. When the first message of the data flow arrives, because the table entry corresponding to the message is not stored in the fast forwarding table, the receiving and sending core in the processor determines that the message needs to be analyzed and processed by the data core of the processor. At this time, the message is cached, the forwarding flag is recorded in the sending queue as the first value, and the cache address of the message is cached.
Because the forwarding flag of the packet is marked as the first value, it indicates that the packet needs to be processed and cannot be forwarded temporarily, and then the packet may be sent to a data core of the processor for processing. The processing process includes, but is not limited to, obtaining quintuple information therein, determining a forwarding mode, and generating an entry of a fast forwarding table containing the quintuple information. Whether or not the order-preserving process is required is described in the following description.
After the data check is used for processing the message, the message is forwarded through the receiving and sending check, and at the moment, a table entry corresponding to the message of the data flow is generated in the rapid forwarding table.
S100B, if the table entry corresponding to the message is matched in the fast forwarding table, forwarding the message based on the matched table entry.
If the data stream received by the transceiving core contains the generated quintuple information, it indicates that the message of the data stream has been processed by the data core, and subsequently, as shown in fig. 3, the message in the data stream can be directly forwarded by looking up the table by the processor to obtain information such as an interface. The message matched with the table entry in the fast forwarding table is directly forwarded without the cache, so that the forwarding efficiency of the processor to the data stream is accelerated.
S101, if the message needs to be subjected to order preservation, the message is sent to a corresponding data core in a processor for processing according to a hash result obtained by carrying out hash operation on the quintuple information of the message, and a forwarding mark is set to be a second value after the processing.
When the data check message is analyzed, whether the message needs to be subjected to order preserving processing can be determined according to information (such as a protocol type of the message) in a message header of the first message. For example, if the message is a TCP (Transmission Control Protocol) or UDP (User Datagram Protocol), it is determined that the message needs to be order-preserved, and if the message is an ARP (Address Resolution Protocol), it is determined that the message does not need to be order-preserved.
The receiving and sending cores of the processor determine that the message needs to be order-preserved, the receiving and sending cores can perform hash operation according to quintuple information of the message, and send the message to a corresponding data core for processing based on a hash result of the hash operation, as shown in fig. 4, the receiving and sending cores can send the message 1 to the data core 1 for processing according to the hash result.
After receiving the message 1, the data core 1 analyzes and processes the message 1, and sets a corresponding forwarding flag to 1 after processing, thereby marking that the message can be forwarded.
Because the messages needing to be subjected to order preservation are subjected to Hash operation of the processor, the messages with the same quintuple information can be ensured to be uploaded to the same data core for processing, and the processing sequence of the messages is ensured.
And S102, if the message does not need to be subjected to order preservation, distributing the message according to the occupancy rate of each data core in the processor for processing, and setting the forwarding mark as a second value after the processing.
During the operation process of the processor, the current occupancy rate of each processor core is detected and recorded. In the scenario shown in fig. 5, if the sending and receiving core determines that the packet 2 does not need to be processed in an order-preserving manner, a data core in a relatively idle state may be selected from the multiple data cores to process the packet based on the occupancy rate. For example, when the occupancy rate of the data core 1 is 25%, the occupancy rate of the data core 2 is 10%, and the occupancy rate of the data core 3 is 40%, when the transceiver core of the processor determines that the packet of the data stream does not need to be subjected to order preservation, the packet 2 may be distributed to the data core 2 according to the occupancy rate of each data core for processing.
After the data core 2 processes, the forwarding flag corresponding to the packet 2 in the sending queue may be set to 0, so as to indicate that the packet 2 has completed processing and can be forwarded.
S103, scanning the sending queues corresponding to the receiving and sending cores in the processor according to the recording sequence, stopping sending the message if the current forwarding mark is set to be a first value, and reading the message according to the cache address and sending the message if the current forwarding mark is set to be a second value.
During the working process of the transceiving core, continuously scanning the information recorded in the corresponding sending queue, as shown in fig. 6, three pairs of cache addresses and forwarding marks are recorded in the sending queue, where a message 10 and a message 11 corresponding to the cache address 1 and the cache address 2 are messages in a data stream that needs to be subjected to order preserving processing, and a message 20 corresponding to the cache address 3 is a message in a data stream that does not need to be subjected to order preserving processing. When the forwarding tag 1 is scanned, it is determined that the forwarding tag is 1, the packet 10 corresponding to the forwarding tag 1 can be forwarded, and the transceiving core reads the packet 10 from the cache according to the cache address 1 and forwards the packet through the transceiver. Then, the transceiving core scans the forwarding tag 2, determines that the forwarding tag is 0 and cannot be forwarded, and stops reading the subsequent forwarding tag and the cache address, waiting for the completion of processing the packet 11. After the message 11 is processed by the data core 1, the forwarding tag 2 corresponding to the message 11 is set to 1 from 0, and after the transceiving core scans that the forwarding tag 2 is set to 1, the transceiving core reads the message 11 from the cache according to the cache address 2 and forwards the message.
Thereafter, the core may continue scanning and send subsequent messages 20 with the forwarding flag 3 set to 1.
The method comprises the steps of dividing cores of a processor into a receiving and sending core for receiving and sending messages and a data core for processing the messages, distinguishing the messages needing order-preserving processing and the messages needing no order-preserving processing, enabling the relatively idle data cores to process the messages needing no order-preserving, carrying out Hash according to quintuple information, sending the messages needing order-preserving to one data core for processing, stopping sending the messages when unprocessed messages are detected in a sending queue corresponding to the receiving and sending cores, guaranteeing the order-preserving of the messages and balanced load sharing, and improving the reliability of message processing and forwarding of network equipment.
Correspondingly, the present application provides a message processing apparatus, as shown in fig. 7, including:
the cache unit is used for caching the received message and recording a cache address of the message and a forwarding mark set as a first value in a sending queue corresponding to a receiving and sending core in the processor, wherein the forwarding mark indicates that the cached message cannot be forwarded when the forwarding mark is the first value, and the forwarding mark indicates that the cached message can be forwarded when the forwarding mark is a second value;
a distributing unit, configured to, if it is determined that the packet needs to be order-preserved, perform hash operation according to quintuple information of the packet to obtain a hash result, send the packet to a corresponding data core in the processor for processing, and, if it is determined that the packet does not need to be order-preserved, distribute the packet according to an occupancy rate of each data core in the processor for processing
The marking unit is used for setting a forwarding mark corresponding to the message as a second value after the message is processed;
and the sending unit is used for scanning the sending queues corresponding to the receiving and sending cores in the processor according to the recording sequence, stopping sending the message if the current forwarding mark is set to be a first value, and reading the message and sending the message according to the cache address if the current forwarding mark is set to be a second value.
Optionally, in the sending queue, the forwarding flag is located before the buffer address.
Optionally, the cache unit is specifically configured to forward, if the table entry corresponding to the packet is matched in the fast forwarding table, the packet based on the matched table entry through the sending unit; if the table entry corresponding to the message is not matched in the fast forwarding table, caching the message, and recording the caching address of the message and the forwarding mark set as the first value in a sending queue corresponding to a receiving and sending core in the processor.
Correspondingly, the present application provides a network device, as shown in fig. 2, including: a processor, a machine-readable storage medium, and a transceiver;
the system comprises a processor and a control module, wherein the processor comprises one or more transceiving cores and a data core, and each transceiving core is provided with a sending queue;
a machine-readable storage medium stores machine-executable instructions executable by a processor, the processor being caused by the machine-executable instructions to:
caching a message received through a transceiver, and recording a cache address of the message and a forwarding mark set as a first value in a sending queue corresponding to a transceiving core in a processor, wherein the forwarding mark represents that the cached message cannot be forwarded when the forwarding mark is the first value, and the forwarding mark represents that the cached message can be forwarded when the forwarding mark is a second value;
if the message needs to be subjected to order preservation, the message is sent to a corresponding data core in a processor for processing according to a hash result obtained by carrying out hash operation on the quintuple information of the message, and a forwarding mark is set as a second value after the message is processed;
if the message does not need to be subjected to order preservation, distributing the message for processing according to the occupancy rate of each data core in the processor, and setting the forwarding mark as a second value after processing;
and scanning the sending queues corresponding to the sending and receiving cores in the processor according to the recording sequence, stopping sending the message if the current forwarding mark is set to be a first value, and reading the message according to the cache address and sending the message through the transceiver if the current forwarding mark is set to be a second value.
Optionally, in the sending queue, the forwarding flag is located before the buffer address.
Optionally, caching the message received by the transceiver, and recording a cache address of the message and a forwarding flag set as a first value in a sending queue corresponding to a sending and receiving core in the processor, including:
if the table entry corresponding to the message is matched in the fast forwarding table, forwarding the message through the transceiver based on the matched table entry;
if the table entry corresponding to the message is not matched in the fast forwarding table, the message is cached, and the cache address of the message and the forwarding mark set as the first value are recorded in a sending queue corresponding to a receiving and sending core in the processor.
Optionally, the network device is a firewall device.
Optionally, the network device further includes a memory, and the sending queue is formed in the memory.
Accordingly, the present application provides a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: implementing the method steps of any of the above.
The technical scheme provided by the implementation mode of the specification can have the following beneficial effects:
in the embodiment of the present specification, cores of a processor are divided into a transceiving core for receiving and sending a packet and a data core for processing the packet, and the packet that needs to be processed in an order-preserving manner and the packet that does not need to be processed in an order-preserving manner are distinguished, so that a relatively idle data core processes the packet that does not need to be processed in an order-preserving manner, and the packet that needs to be processed in an order-preserving manner is sent to one data core for processing by hashing according to quintuple information, and the packet that is not processed is detected in a sending queue corresponding to the transceiving core and then is stopped from being sent, thereby ensuring order-preserving and balanced load sharing of the packet, and improving reliability of packet processing and forwarding by a network device.
It will be understood that the present description is not limited to the precise arrangements that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
The above description is only for the purpose of illustrating the preferred embodiments of the present disclosure and is not to be construed as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (11)

1. A message processing method is characterized by comprising the following steps:
caching a received message, and recording a cache address of the message and a forwarding mark set as a first value in a sending queue corresponding to a receiving and sending core in a processor, wherein the forwarding mark represents that the cached message cannot be forwarded when the forwarding mark is the first value, and the forwarding mark represents that the cached message can be forwarded when the forwarding mark is a second value;
if the message needs to be subjected to order preservation, the message is sent to a corresponding data core in the processor for processing according to a hash result obtained by carrying out hash operation on five-tuple information of the message, and the forwarding mark is set to be a second value after the processing;
if the message does not need to be subjected to order preservation, distributing the message for processing according to the occupancy rate of each data core in the processor, and setting the forwarding mark as a second value after processing;
and scanning the sending queues corresponding to the receiving and sending cores in the processor according to the recording sequence, stopping sending the message if the current forwarding mark is set to a first value, and reading out the message according to the cache address and sending the message if the current forwarding mark is set to a second value.
2. The method of claim 1, wherein the forwarding tag precedes the buffer address in the transmit queue.
3. The method according to claim 1, wherein the caching the received packet and recording a cache address of the packet and a forwarding flag set to a first value in a transmission queue corresponding to a transceiving core in a processor, comprises:
if the table entry corresponding to the message is matched in the fast forwarding table, forwarding the message based on the matched table entry;
if the table entry corresponding to the message is not matched in the fast forwarding table, caching the message, and recording the caching address of the message and the forwarding mark set as the first value in a sending queue corresponding to a receiving and sending core in the processor.
4. A message processing apparatus, comprising:
the device comprises a caching unit, a sending unit and a receiving unit, wherein the caching unit is used for caching a received message and recording a caching address of the message and a forwarding mark set as a first value in a sending queue corresponding to a receiving and sending core in a processor, the forwarding mark represents that the cached message cannot be forwarded when the forwarding mark is the first value, and the forwarding mark represents that the cached message can be forwarded when the forwarding mark is a second value;
a distributing unit, configured to, if it is determined that the packet needs to be order-preserved, perform hash operation according to quintuple information of the packet to obtain a hash result, send the packet to a corresponding data core in the processor for processing, and if it is determined that the packet does not need to be order-preserved, distribute the packet according to an occupancy rate of each data core in the processor for processing
A marking unit, configured to set a forwarding mark corresponding to the packet to a second value after processing;
and the sending unit is used for scanning the sending queues corresponding to the receiving and sending cores in the processor according to the recording sequence, stopping sending the message if the current forwarding mark is set to be a first value, and reading out and sending the message according to the cache address if the current forwarding mark is set to be a second value.
5. The apparatus of claim 4, wherein the forwarding tag precedes the buffer address in the transmit queue.
6. The apparatus according to claim 4, wherein the caching unit is specifically configured to forward, by the sending unit, the packet based on the matched entry if the entry corresponding to the packet is matched in the fast forwarding table; if the table entry corresponding to the message is not matched in the fast forwarding table, caching the message, and recording the caching address of the message and the forwarding mark set as the first value in a sending queue corresponding to a receiving and sending core in the processor.
7. A network device, comprising: a processor, a machine-readable storage medium, and a transceiver;
the processor comprises one or more transceiving cores and a data core, wherein each transceiving core is provided with a sending queue;
the machine-readable storage medium stores machine-executable instructions executable by the processor to cause, by the processor, the processor to:
caching a message received through the transceiver, and recording a cache address of the message and a forwarding mark set as a first value in a sending queue corresponding to a receiving and sending core in a processor, wherein the forwarding mark indicates that the cached message cannot be forwarded when the forwarding mark is the first value, and the forwarding mark indicates that the cached message can be forwarded when the forwarding mark is a second value;
if the message needs to be subjected to order preservation, the message is sent to a corresponding data core in the processor for processing according to a hash result obtained by carrying out hash operation on five-tuple information of the message, and the forwarding mark is set to be a second value after the processing;
if the message does not need to be subjected to order preservation, distributing the message for processing according to the occupancy rate of each data core in the processor, and setting the forwarding mark as a second value after processing;
and scanning the sending queues corresponding to the receiving and sending cores in the processor according to the recording sequence, stopping sending the message if the current forwarding mark is set to a first value, and reading the message according to the cache address and sending the message through the transceiver if the current forwarding mark is set to a second value.
8. The network device of claim 7, wherein the forwarding tag precedes the buffer address in the transmit queue.
9. The network device according to claim 7, wherein the buffering the packet received by the transceiver, and recording a buffer address of the packet and a forwarding flag set to a first value in a sending queue corresponding to a sending/receiving core in a processor, comprises:
if the table entry corresponding to the message is matched in the rapid forwarding table, forwarding the message through the transceiver based on the matched table entry;
if the table entry corresponding to the message is not matched in the fast forwarding table, caching the message, and recording the caching address of the message and the forwarding mark set as the first value in a sending queue corresponding to a receiving and sending core in the processor.
10. The network device of any of claims 7-9, wherein the network device is a firewall device.
11. A machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to: -carrying out the method steps of any one of claims 1 to 3.
CN202211181084.4A 2022-09-27 2022-09-27 Message processing method and device Pending CN115580584A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211181084.4A CN115580584A (en) 2022-09-27 2022-09-27 Message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211181084.4A CN115580584A (en) 2022-09-27 2022-09-27 Message processing method and device

Publications (1)

Publication Number Publication Date
CN115580584A true CN115580584A (en) 2023-01-06

Family

ID=84582921

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211181084.4A Pending CN115580584A (en) 2022-09-27 2022-09-27 Message processing method and device

Country Status (1)

Country Link
CN (1) CN115580584A (en)

Similar Documents

Publication Publication Date Title
US7969976B2 (en) Gateway apparatus, packet forwarding method, and program
US8537815B2 (en) Accelerating data routing
JP4640128B2 (en) Response communication device and ARP response communication device
US8509264B2 (en) Radio communication apparatus
US20140226663A1 (en) Method, device, and system to prioritize encapsulating packets in a plurality of logical network connections
CN110213129B (en) Forwarding path time delay detection method, controller and forwarding equipment
US20110085549A1 (en) Data routing acceleration
US20170359268A1 (en) Methods and systems for receiving and transmitting packets based on priority levels
US20190116523A1 (en) Apparatus and method for data delivery in delay-tolerant network (dtn)
JP2009164948A (en) Communication system, server, terminal, packet transfer method, and program
CN109587082B (en) Message asynchronous forwarding system and method based on Linux operating system
CN114051013A (en) Communication data transmission method and device
US9832119B2 (en) Communication block apparatus and communication block method
CN115580584A (en) Message processing method and device
JP2009164947A (en) Server, method of transferring packet, and program
CN107332839B (en) Message transmission method and device
CN116095197B (en) Data transmission method and related device
KR100518813B1 (en) Packet forwarding system having receive data processor and a method processing thereof
CN113472677B (en) Virtualized environment load balancing flow processing method, system and computer medium
US20150169256A1 (en) Printing control server, printing control method, and printing system
CN116962297A (en) Message processing method and device
CN113542131B (en) Message forwarding method and device
CN113206791B (en) Message forwarding method and device
CN115442320B (en) Method, device and storage medium for realizing fragment reassembly of RDMA (remote direct memory Access) multi-queue messages
US20110299394A1 (en) Translating Between An Ethernet Protocol And A Converged Enhanced Ethernet Protocol

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