CN116016713A - Message transmission method, device, network equipment and readable storage medium - Google Patents

Message transmission method, device, network equipment and readable storage medium Download PDF

Info

Publication number
CN116016713A
CN116016713A CN202211603026.6A CN202211603026A CN116016713A CN 116016713 A CN116016713 A CN 116016713A CN 202211603026 A CN202211603026 A CN 202211603026A CN 116016713 A CN116016713 A CN 116016713A
Authority
CN
China
Prior art keywords
message
field
cpu
processing unit
fixed information
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
CN202211603026.6A
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.)
Suzhou Centec Communications Co Ltd
Original Assignee
Suzhou Centec Communications 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 Suzhou Centec Communications Co Ltd filed Critical Suzhou Centec Communications Co Ltd
Priority to CN202211603026.6A priority Critical patent/CN116016713A/en
Publication of CN116016713A publication Critical patent/CN116016713A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application provides a message transmission method, a message transmission device, network equipment and a readable storage medium, and relates to the technical field of communication. The method is applied to a processing unit in the network equipment for processing the data forwarding message, the network equipment also comprises a central processing unit CPU which is in communication connection with the processing unit, and the method comprises the following steps: obtaining a first protocol message which needs to be sent to a CPU by a processing unit; deleting a field in a first fixed information head of the first protocol message according to a target preset uploading field corresponding to the first protocol message to obtain a first message to be processed, wherein the first fixed information head comprises preset fields in the fixed information head required by the processing unit; and sending the first message to be processed to the CPU. Therefore, the fields in the fixed information header in the protocol message to be sent to the CPU by the processing unit are deleted, so that the occupation of the fixed information header to the CPU bandwidth is reduced, and the transmission performance is improved.

Description

Message transmission method, device, network equipment and readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and apparatus for transmitting a message, a network device, and a readable storage medium.
Background
Network devices such as switches and routers in the existing network generally have special switching chips or processing units such as NPs (Network Processor, network processors) for processing data forwarding messages. The protocol messages related to network state maintenance, link establishment and the like need to be uploaded to a CPU (Central Processing Unit ) for processing. The protocol message currently sent to the CPU additionally carries some message forwarding information (i.e. a fixed information header), where the fixed information header contains additional information required for internal processing of a series of processing units, such as from which port, to which port to send. Meanwhile, some special-scenario applications, such as OAM, PTP, etc., all required fields are also contained in the fixed header. So in complex processing units this additional information is typically long, generally over 40bytes, as much as even up to 64bytes are required. Therefore, the overhead of the fixed information header of the protocol message currently sent to the CPU is relatively large, and the bandwidth of the CPU is occupied.
Disclosure of Invention
The embodiment of the application provides a message transmission method, a message transmission device, network equipment and a readable storage medium, which are used for reducing the occupation of a fixed information head to the CPU bandwidth and improving the transmission performance by deleting the field in the fixed information head in a protocol message to be sent to the CPU by a processing unit.
Embodiments of the present application may be implemented as follows:
in a first aspect, an embodiment of the present application provides a method for transmitting a packet, which is applied to a processing unit in a network device for processing a data forwarding packet, where the network device further includes a central processing unit CPU communicatively connected to the processing unit CPU, and the method includes:
obtaining a first protocol message which needs to be sent to the CPU by the processing unit;
deleting a field in a first fixed information header of the first protocol message according to a target preset uploading field corresponding to the first protocol message to obtain a first message to be processed, wherein the first fixed information header comprises preset fields in the fixed information header required by the processing unit;
and sending the first message to be processed to the CPU.
In a second aspect, an embodiment of the present application provides a packet transmission device, which is applied to a processing unit in a network device for processing a data forwarding packet, where the network device further includes a central processing unit CPU communicatively connected to the processing unit CPU, and the device includes:
the message obtaining module is used for obtaining a first protocol message which needs to be sent to the CPU by the processing unit;
the processing module is used for deleting the field in the first fixed information head of the first protocol message according to the target preset uploading field corresponding to the first protocol message to obtain a first message to be processed, wherein the first fixed information head comprises preset fields in the fixed information head required by the processing unit;
the processing module is further configured to send the first message to be processed to the CPU.
In a third aspect, an embodiment of the present application provides a network device, including a processor and a memory, where the memory stores machine executable instructions that can be executed by the processor, where the processor may execute the machine executable instructions to implement a packet transmission method according to the foregoing embodiment.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a computer program that, when executed by a processor, implements a method for transmitting a message according to the foregoing embodiments.
The message transmission method, the device, the network equipment and the readable storage medium provided by the embodiment of the application firstly obtain a first protocol message which needs to be sent to a CPU by a processing unit, then prune a field in a first fixed information head of the first protocol message according to a target preset sending field corresponding to the first protocol message to obtain a first message to be processed, wherein the first fixed information head comprises a preset field included in the fixed information head required by the processing unit; and finally, the first message to be processed is sent to the CPU. Therefore, the fields in the fixed information header in the protocol message to be sent to the CPU by the processing unit are deleted, so that the occupation of the fixed information header to the CPU bandwidth is reduced, and the transmission performance is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered limiting the scope, and that other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a block schematic diagram of a network device according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a message transmission method according to an embodiment of the present application;
FIG. 3 is a flow chart illustrating the sub-steps included in step S120 in FIG. 2;
FIG. 4 is a second flow chart of a message transmission method according to the embodiment of the present application;
FIG. 5 is a flow chart illustrating the sub-steps included in step S150 in FIG. 4;
fig. 6 is a schematic diagram of a message transmission process according to an embodiment of the present application;
FIG. 7 is a second diagram illustrating a message transmission process according to an embodiment of the present disclosure;
fig. 8 is a block diagram of a message transmission device according to an embodiment of the present application.
Icon: 100-a network device; 110-memory; a 120-processor; 130-a communication unit; 200-message transmission device; 210-a message obtaining module; 220-a processing module.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, are intended to be within the scope of the present application.
It is noted that relational terms such as "first" and "second", and the like, are 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a block schematic diagram of a network device 100 according to an embodiment of the present application. The network device 100 may be, but is not limited to, a router, a switch, etc. The network device 100 may include a processing unit, a CPU (Central Processing Unit ) and a communication unit 130. The processing unit is used for processing the data forwarding message, and the processing unit may be, but is not limited to, a switch chip, an NP (Network Processor, a network processor), and the like. The processing unit may include a memory 110 and a processor 120. The CPU is used for processing protocol messages such as network state maintenance, link establishment and the like. The processing unit, the CPU, and the communication unit 130 are electrically connected directly or indirectly to each other, so as to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines.
Wherein the memory 110 is used for storing programs or data. The Memory 110 may be, but is not limited to, random access Memory (Random Access Memory, RAM), read Only Memory (ROM), programmable Read Only Memory (Programmable Read-Only Memory, PROM), erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
The processor 120 is used to read/write data or programs stored in the memory 110 and perform corresponding functions. For example, the memory 110 stores a message transmission device 200, and the message transmission device 200 includes at least one software functional module that may be stored in the memory 110 in the form of software or firmware (firmware). The processor 120 executes various functional applications and data processing by running software programs and modules stored in the memory 110, such as the message transmission device 200 in the embodiment of the present application, that is, implements the message transmission method in the embodiment of the present application.
The communication unit 130 is configured to establish a communication connection between the network device 100 and other communication terminals through a network, and is configured to transmit and receive data through the network.
It should be understood that the architecture shown in fig. 1 is merely a schematic diagram of the architecture of the network device 100, and that the network device 100 may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
Referring to fig. 2, fig. 2 is a flow chart of a message transmission method according to an embodiment of the present application. The method is applied to a processing unit in the network equipment, the processing unit is used for processing the data forwarding message, and the network equipment further comprises a CPU (central processing unit) in communication connection with the processing unit. The following describes the specific flow of the message transmission method in detail. In this embodiment, the method may include steps S110 to S130.
Step S110, obtaining a first protocol packet that the processing unit needs to upload to the CPU.
Step S120, deleting a field in a first fixed information header of the first protocol packet according to a target preset send field corresponding to the first protocol packet, to obtain a first packet to be processed.
Step S130, sending the first message to be processed to the CPU.
In this embodiment, when the processing unit needs to send the protocol packet to the CPU, the protocol packet may be obtained first as the first protocol packet. The first protocol message is generated by the processing unit based on the first original protocol message (i.e. the message body of the first protocol message) and additional information required by internal processing of the processing unit, that is, a first fixed information header in the first protocol message includes a preset field included in a fixed information header required by the processing unit.
Under the condition that the first protocol message is obtained, a target preset uploading field which needs to be carried when the first protocol message is uploaded to the CPU can be determined. Then, based on the target preset uploading field, deleting the field in the first fixed information head, so as to reduce the field in the first fixed information head, and taking the processed first protocol message as a first message to be processed. It can be understood that the target preset upload field is a field of interest when the CPU processes the protocol message. And finally, uploading the first message to be processed to the CPU.
Therefore, the fields in the fixed information header in the protocol message to be sent to the CPU by the processing unit are deleted, so that the occupation of the fixed information header to the CPU bandwidth is reduced, and the transmission performance is improved.
Optionally, in this embodiment, the processing unit may store a first rule, where the first rule is used to determine a field included in a fixed information header of a protocol packet sent to the CPU, and the first packet to be processed may be obtained in a manner shown in fig. 3. Referring to fig. 3, fig. 3 is a flow chart illustrating the sub-steps included in step S120 in fig. 2. In this embodiment, step S120 may include sub-steps S121 to S123.
Substep S121, determining, according to the first rule, a target preset upload field to be included in the first fixed information header.
Alternatively, the specific storage mode of the first rule may be determined in conjunction with actual requirements, for example, using a cputanstopcpu register to store the first rule. And determining a target preset uploading field which needs to be reserved in the first fixed information head by utilizing the first rule.
As a possible implementation manner, the first rule includes a correspondence between different types of protocol packets and a preset uploading field, that is, a field of interest of the CPU that needs to be carried when the different types of protocol packets upload the CPU is preset. In this case, the type analysis may be performed on the first protocol packet to obtain a first type of the first protocol packet; and then, according to the corresponding relation between the protocol messages of different types and the preset uploading fields included in the first rule and the first type, obtaining the preset uploading fields corresponding to the first type, and taking the preset uploading fields corresponding to the first type as the target preset uploading fields. Therefore, the field to be uploaded can be determined according to the type of the first protocol message, and the flexibility is better.
As another possible implementation manner, the first rule may only include a preset upload field, that is, any type of protocol packet needs to include the preset upload field in the first rule when uploading to the CPU. In this case, the preset upload field in the first rule may be directly determined as the target preset upload field. In this way, it is facilitated to quickly set the first rule.
And step S122, determining a field to be deleted according to the preset field required by the processing unit and the target preset uploading field.
And step S122, performing field deletion processing on the first protocol message according to the field to be deleted to obtain the first message to be processed.
And under the condition that the target preset uploading field is determined, comparing the preset field included in the processing requirement in the processing unit with the target preset uploading field, so as to determine the field to be deleted. Namely, the target preset uploading field in the preset fields included in the processing unit internal processing requirement is a field needing to be reserved, and the rest fields are fields to be deleted. Then, the field to be deleted in the first fixed information header of the first protocol message can be deleted, so as to obtain the first message to be processed. And then, the first message to be processed can be sent to the CPU.
The inventor of the application also finds that when the current CPU issues a protocol message to the processing unit, all preset fields included in the fixed information header required by the processing unit are carried in the message. Therefore, the fixed information head in the protocol message issued by the CPU is relatively long, and the bandwidth of the CPU is occupied.
In order to reduce occupation of CPU bandwidth, CPU can also confirm the field carried when issuing the protocol message according to the configuration, if not carry all fields required by the processing unit. Referring to fig. 4, fig. 4 is a second flowchart of a message transmission method according to an embodiment of the present disclosure. In this embodiment, the method may further include steps S140 to S160.
Step S140, receiving a second protocol packet issued by the CPU.
In this embodiment, the CPU generates the second protocol packet based on the second original protocol packet (i.e., the packet body of the second protocol packet) and a target preset issuing field corresponding to the second original protocol packet. The target preset issuing field corresponding to the second original protocol message may be determined by the CPU based on preset configuration. The number of the target preset issuing fields is smaller than the number of the preset fields included in the fixed information header required by the processing unit in the current prior art. It can be understood that the target preset issuing field is a field that must be carried when the CPU issues the message, for example, a field related to the forwarding of the message is used to indicate which physical port is finally forwarded from, how the message is edited inside the switch chip, and the like, which can be specifically set in combination with actual requirements.
Step S150, performing field filling processing on the second fixed information header of the second protocol packet according to the preset field included in the fixed information header required by the processing unit, to obtain a second packet to be processed.
Step S160, processing, by the processing unit, the second message to be processed.
And under the condition that the second protocol message is obtained, determining a target preset issuing field included in the second protocol message through analysis. And then, performing field filling processing according to preset fields included in the fixed information header required by the processing unit and the target preset issuing field, thereby obtaining a second message to be processed. The second message to be processed includes the number of fields of the preset fields included in the fixed header required by the processing unit. And then, the processing unit can process the second message to be processed according to the processing mode of the data forwarding message. Therefore, occupation of CPU bandwidth by the issued protocol message can be reduced, and meanwhile, the processing unit can be ensured to obtain the message meeting the requirement for processing.
Optionally, in this embodiment, the processing unit may store a second rule, where the second rule is used to determine a field included in a fixed information header of a protocol packet sent by the CPU, and the second packet to be processed may be obtained in a manner shown in fig. 5. Referring to fig. 5, fig. 5 is a flowchart illustrating the sub-steps included in step S150 in fig. 4. In this embodiment, step S150 may include sub-steps S151 to S153.
And sub-step S151, determining a target preset issuing field included in the second fixed information header according to the second rule.
Optionally, the specific storage manner of the second rule may be determined in conjunction with actual requirements, for example, using a cputransfromthe register to store the second rule. Thus, the second protocol message does not need to be subjected to field analysis of a fixed information header, but a target preset issuing field included in the second protocol message is determined based on the second rule.
As a possible implementation manner, the second rule includes a correspondence between different types of protocol packets and a preset issuing field, that is, a field that is preset and configured to be carried by the different types of protocol packets when issued by the CPU. In this case, the type analysis may be performed on the second protocol packet to obtain a second type of the second protocol packet; and then, according to the corresponding relation between the protocol messages of different types and the preset issuing fields included in the second rule and the second type, obtaining the preset issuing fields corresponding to the second type, and taking the preset issuing fields corresponding to the second type as the target preset issuing fields. Thus, the field carried in the issuing process can be determined according to the type of the second protocol message.
Correspondingly, the second rule may also be stored in the CPU, and the target preset issuing field corresponding to the second original protocol packet may be determined according to the corresponding relationship between the different types of protocol packets and the preset issuing field and the second original protocol packet, and then the second protocol packet is generated based on the second original protocol packet and the target preset issuing field.
As another possible implementation manner, the second rule may only include a preset issuing field, that is, any type of protocol packet needs to include the preset issuing field in the second rule when issued. In this case, the preset issuing field in the second rule may be directly determined as the target preset issuing field. In this way, it is facilitated to quickly set the second rule.
Correspondingly, the second rule may also be stored in the CPU, and the second protocol packet may be generated according to a preset issuing field included in the second rule and the second original protocol packet.
And sub-step S152, determining a field to be filled according to the preset field required by the processing unit and the target preset issuing field.
And sub-step S153, performing field filling processing on the second fixed information head according to the field to be filled to obtain the second message to be processed.
Under the condition that the target preset issuing field is determined, the preset field included in the processing requirement inside the processing unit can be compared with the target preset issuing field, so that the field to be filled is determined. That is, the processing unit internally processes the fields which are not included in the target preset issuing field in the preset fields included in the requirements, and the fields are fields which need to be filled. And then, carrying out message analysis on the second protocol message and/or obtaining corresponding information from other aspects, determining the specific content of the field to be filled, and then carrying out field filling processing on a second fixed information head so as to obtain the second message to be processed. And then, the processing unit can process the second message to be processed according to the conventional flow.
Optionally, in this embodiment, the protocol packet that is optionally sent to the CPU or the protocol packet that is sent by the CPU includes a packet source port and a packet destination port. Optionally, the fixed header of the protocol packet sent to the CPU may further include a reason for sending the packet to the CPU, and the fixed header of the protocol packet sent by the CPU may further include a field for indicating whether to skip the logic inside the processing unit. The reason for the message to be sent to the CPU is convenient for the CPU to directly determine the processing mode of the message based on the reason, and the reason analysis is not needed.
Optionally, fields required to be carried when the message is sent to the CPU and fields required when the message is sent by the CPU can be set according to actual requirements. For example, whether to upload the CPU may be configured for the following fields: svlan_id, cvlan_id_valid. The following fields may also be configured to determine whether to upload to or download by the CPU: the message color field color_valid, the message priority field priority_valid, the message cos field src_cos_valid, the message ttl field ttl_valid, the message field field_valid, the message isolation_id_valid, the cvlan operation field ctag_op_valid, the svlan operation field stag_op_valid, the message timestamp field ingres_ts_valid and the like.
Generally, the information header is fixed at present, and fields for transmitting messages between forwarding modules in the processing unit are directly used, so that the overhead of the fixed information header is relatively high, and the transmission bandwidth of the CPU is wasted. In the embodiment of the Application, the interactive transmission information among all modules in the ASIC (Application-specific integrated circuit) is filtered, and only the CPU transmission concern field is extracted, so that the transmission performance is improved.
The following describes the message transmission method with reference to fig. 6 and 7.
Assuming that a protocol message sent by the switch chip to the CPU is 64Bytes, the actual bandwidth effective utilization is 64/(40+64) =61.5% and additionally carries the PacketInfo of 40Bytes (i.e. fixed header).
As shown in fig. 6, a cputans module is added in the switch chip, and the fields needed to be carried in the fixed information header when the CPU is sent are determined according to the type of the message. If the common message only carries a CPU source port, a destination port and the like; other OAM messages, such as OAM message type, reporting time, etc., need to be additionally carried with OAM related information. Based on the determined field to be carried, the field which is not concerned by the CPU in the PacketInfo is removed, only the concerned field is reserved, the fixed information head after deletion is 20Bytes, and the utilization rate is improved to 64/(20+64) =76.2%. Therefore, the bandwidth and the transmission performance of the upper CPU can be greatly improved by the mode.
After the processing is completed, a message including a fixed header after the processing may be uploaded to the CPU. The message can be sent to the CPU through DMA (Direct Memory Access ), or can be sent to the CPU through CPU MAC, which can be specifically determined in combination with actual requirements.
When the CPU issues a message, as shown in fig. 7, the CPU only needs to carry the necessary message forwarding information. For example, the fixed information header of the message issued by the CPU only includes a field for indicating which physical port is going out from, a field for indicating how the message is edited inside the switch chip, and the like. Whereby only basic additional 20bytes information is needed. Through the CPUTrans module of the chip, the 20Bytes information in the issued message is converted into 40 Btes information needed by the exchange chip, namely, the information is filled. Thus, the bandwidth utilization is also increased to 64/(20+64) =76.2%.
The CPUTransToCPU register and the cputransfromtpu register may be configured in advance to indicate a field carried in a message sent by the switch chip and a field carried in an uplink message. Alternatively, the user configures specific fields in advance according to the own requirements, and the specific fields need to be carried when the CPU issues the message.
Therefore, by adding the CPUTrans module in the exchange chip, the PacketInfo carried by the CPU for receiving and transmitting is compressed PacketInfo, and the size of the PacketInfo carried during interaction with the CPU is reduced, so that the performance of receiving and transmitting messages can be remarkably improved in the scenes of high-speed message receiving and transmitting such as CPU soft forwarding.
In order to perform the corresponding steps in the foregoing embodiments and the various possible manners, an implementation manner of the packet transmission apparatus 200 is given below, and alternatively, the packet transmission apparatus 200 may employ the device structure of the network device 100 shown in fig. 1. Further, referring to fig. 8, fig. 8 is a block diagram of a message transmission apparatus 200 according to an embodiment of the present application. It should be noted that, the basic principle and the technical effects of the message transmission apparatus 200 provided in this embodiment are the same as those of the foregoing embodiments, and for brevity, reference may be made to the corresponding contents of the foregoing embodiments. The message transmission device 200 is applied to a processing unit in a network device for processing a data forwarding message, the network device further includes a CPU communicatively connected to the processing unit, and the message transmission device 200 includes: message acquisition module 210 and processing module 220.
The message obtaining module 210 is configured to obtain a first protocol message that the processing unit needs to send to the CPU.
The processing module 220 is configured to prune a field in a first fixed header of the first protocol packet according to a target preset send field corresponding to the first protocol packet, to obtain a first packet to be processed. The first fixed information head includes a preset field included in the fixed information head required by the processing unit.
The processing module 220 is further configured to send the first message to be processed to the CPU.
Optionally, in this embodiment, the message obtaining module 210 is further configured to receive a second protocol message sent by the CPU, where the second protocol message is generated by the CPU based on a second original protocol message and a target preset sending field corresponding to the second original protocol message, and the number of fields of the target preset sending field is less than the number of fields of preset fields included in a fixed information header required by the processing unit. The processing module 220 is further configured to: performing field filling processing on a second fixed information head of the second protocol message according to preset fields included in the fixed information head required by the processing unit to obtain a second message to be processed; and processing the second message to be processed through the processing unit.
Alternatively, the above modules may be stored in the memory 110 shown in fig. 1 in the form of software or Firmware (Firmware) and executed by the processor 120 in fig. 1. Meanwhile, data, codes of programs, and the like, which are required to execute the above-described modules, may be stored in the memory 110.
The embodiment of the application also provides a readable storage medium, on which a computer program is stored, the computer program implementing the message transmission method when being executed by a processor.
In summary, the embodiments of the present application provide a method, an apparatus, a network device, and a readable storage medium for transmitting a message, where first a first protocol message that a processing unit needs to upload to a CPU is obtained, then a field in a first fixed information header of the first protocol message is pruned according to a target preset upload field corresponding to the first protocol message, so as to obtain a first message to be processed, where the first fixed information header includes a preset field included in the fixed information header required by the processing unit; and finally, the first message to be processed is sent to the CPU. Therefore, the fields in the fixed information header in the protocol message to be sent to the CPU by the processing unit are deleted, so that the occupation of the fixed information header to the CPU bandwidth is reduced, and the transmission performance is improved.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely an alternative embodiment of the present application and is not intended to limit the present application, and various modifications and variations may be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (10)

1. The message transmission method is characterized by being applied to a processing unit in network equipment for processing a data forwarding message, wherein the network equipment also comprises a Central Processing Unit (CPU) in communication connection with the processing unit, and the method comprises the following steps:
obtaining a first protocol message which needs to be sent to the CPU by the processing unit;
deleting a field in a first fixed information header of the first protocol message according to a target preset uploading field corresponding to the first protocol message to obtain a first message to be processed, wherein the first fixed information header comprises preset fields in the fixed information header required by the processing unit;
and sending the first message to be processed to the CPU.
2. The method according to claim 1, wherein the processing unit stores a first rule, the first rule is used for determining a field included in a fixed header of a protocol packet sent to the CPU, the deleting the field in the first fixed header of the first protocol packet according to a target preset send-up field corresponding to the first protocol packet, and the obtaining a first packet to be processed includes:
determining a target preset uploading field to be included in the first fixed information head according to the first rule;
determining a field to be deleted according to the preset field required by the processing unit and the target preset uploading field;
and performing field deletion processing on the first protocol message according to the field to be deleted to obtain the first message to be processed.
3. The method of claim 2, wherein the first rule includes a correspondence between different types of protocol messages and preset upload fields, and the determining, according to the first rule, a target preset upload field to be included in the first fixed information header includes:
obtaining a first type of the first protocol message;
and determining the target preset uploading field according to the corresponding relation between the protocol messages of different types and the preset uploading field and the first type.
4. The method according to claim 2, wherein the first rule includes a preset upload field, and the determining, according to the first rule, a target preset upload field to be included in the first fixed information header includes:
and determining a preset uploading field included in the first rule as the target preset uploading field.
5. The method according to any one of claims 1-4, further comprising:
receiving a second protocol message issued by the CPU, wherein the second protocol message is generated by the CPU based on a second original protocol message and a target preset issuing field corresponding to the second original protocol message, and the number of fields of the target preset issuing field is less than that of preset fields included in a fixed information header required by the processing unit;
performing field filling processing on a second fixed information head of the second protocol message according to preset fields included in the fixed information head required by the processing unit to obtain a second message to be processed;
and processing the second message to be processed through the processing unit.
6. The method according to claim 5, wherein the processing unit stores a second rule, the second rule is used for determining a field included in a fixed information header of a protocol packet issued by the CPU, and performing field filling processing on a second fixed information header of the second protocol packet according to a preset field included in the fixed information header required by the processing unit to obtain a second packet to be processed, and the method includes:
determining a target preset issuing field included in the second fixed information head according to the second rule;
determining a field to be filled according to the preset field required by the processing unit and the target preset issuing field;
and performing field filling processing on the second fixed information head according to the field to be filled to obtain the second message to be processed.
7. The method according to claim 5, wherein the fixed header of the protocol message sent to the CPU and/or the protocol message sent by the CPU includes a message source port and a message destination port, the fixed header of the protocol message sent to the CPU further includes a reason for sending the message to the CPU, and the fixed header of the protocol message sent by the CPU further includes a field for indicating whether to skip the internal logic of the processing unit.
8. A message transmission device, which is applied to a processing unit in a network device for processing a data forwarding message, wherein the network device further comprises a central processing unit CPU communicatively connected with the processing unit CPU, and the device comprises:
the message obtaining module is used for obtaining a first protocol message which needs to be sent to the CPU by the processing unit;
the processing module is used for deleting the field in the first fixed information head of the first protocol message according to the target preset uploading field corresponding to the first protocol message to obtain a first message to be processed 5, wherein the first fixed information head comprises preset fields in the fixed information head required by the processing unit;
the processing module is further configured to send the first message to be processed to the CPU.
9. A network device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executable instructions of machine 0 to implement the message transmission method of any of claims 1-7.
10. A readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the message transmission method according to any of claims 1-7.
CN202211603026.6A 2022-12-13 2022-12-13 Message transmission method, device, network equipment and readable storage medium Pending CN116016713A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211603026.6A CN116016713A (en) 2022-12-13 2022-12-13 Message transmission method, device, network equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211603026.6A CN116016713A (en) 2022-12-13 2022-12-13 Message transmission method, device, network equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN116016713A true CN116016713A (en) 2023-04-25

Family

ID=86018357

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211603026.6A Pending CN116016713A (en) 2022-12-13 2022-12-13 Message transmission method, device, network equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116016713A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932458A (en) * 2012-11-02 2013-02-13 上海电机学院 Point-to-point protocol (PPP) hardware acceleration system and achieving method thereof
CN107547417A (en) * 2016-06-29 2018-01-05 中兴通讯股份有限公司 A kind of message processing method, device and base station
CN110381071A (en) * 2019-07-24 2019-10-25 新华三技术有限公司合肥分公司 A kind of message transmitting method, device and send method, apparatus
CN111835642A (en) * 2019-04-19 2020-10-27 华为技术有限公司 Service processing method and network equipment
CN111970276A (en) * 2020-08-17 2020-11-20 苏州盛科科技有限公司 Method and device for issuing message by CPU port of network chip
CN113691486A (en) * 2020-05-19 2021-11-23 中移(成都)信息通信科技有限公司 Message modification method, device, equipment and storage medium
CN114006953A (en) * 2020-07-28 2022-02-01 华为技术有限公司 Method and device for processing message

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932458A (en) * 2012-11-02 2013-02-13 上海电机学院 Point-to-point protocol (PPP) hardware acceleration system and achieving method thereof
CN107547417A (en) * 2016-06-29 2018-01-05 中兴通讯股份有限公司 A kind of message processing method, device and base station
CN111835642A (en) * 2019-04-19 2020-10-27 华为技术有限公司 Service processing method and network equipment
CN110381071A (en) * 2019-07-24 2019-10-25 新华三技术有限公司合肥分公司 A kind of message transmitting method, device and send method, apparatus
CN113691486A (en) * 2020-05-19 2021-11-23 中移(成都)信息通信科技有限公司 Message modification method, device, equipment and storage medium
CN114006953A (en) * 2020-07-28 2022-02-01 华为技术有限公司 Method and device for processing message
CN111970276A (en) * 2020-08-17 2020-11-20 苏州盛科科技有限公司 Method and device for issuing message by CPU port of network chip

Similar Documents

Publication Publication Date Title
KR102317523B1 (en) Packet control method and network device
CN109981208B (en) Method and device for transmitting service flow based on flexible Ethernet Flexe
CN113411313B (en) Data transmission method, device and system
CN109842868B (en) Frame aggregation and network setting frame sending method and equipment
CN111200830A (en) Data transmission method and device and electronic equipment
CN112039796B (en) Data packet transmission method and device, storage medium and electronic equipment
CN111031078B (en) Communication method and device
CN110808948B (en) Remote procedure calling method, device and system
CN113542051B (en) Monitoring flow load balancing method based on software defined network
US11736375B2 (en) Scalable in-band telemetry metadata extraction
JP6968990B2 (en) Methods and equipment for determining quality of service, as well as programs
CN107204924B (en) Link discovery method and device
CN109408424A (en) A kind of SpaceFibre bus data acquisition method based on PCIe interface
CN107579920B (en) Data stream transmission method and device, storage medium and processor
CN110417687B (en) Message sending and receiving method and device
CN111885549A (en) Information acquisition method and device, storage medium and electronic device
CN112995809B (en) Control method and device of FC switch, FC switch and storage medium
CN111385131A (en) Configuration method, device, equipment and system of network equipment
CN111385156B (en) sFlow flow sampling method, device and system
CN107786441B (en) Communication method, OpenFlow switch and communication system
CN116016713A (en) Message transmission method, device, network equipment and readable storage medium
CN110769460B (en) BSR transmission method, device, related equipment and storage medium
JP5328622B2 (en) Switching hub, frame relay method, and network relay device
CN109995603B (en) Method and device for measuring packet loss under Tag model and electronic equipment
CN114024598B (en) Forwarding interface test method and device

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