CN114679425B - Message processing method, network equipment and storage medium under 5G network - Google Patents

Message processing method, network equipment and storage medium under 5G network Download PDF

Info

Publication number
CN114679425B
CN114679425B CN202210300536.XA CN202210300536A CN114679425B CN 114679425 B CN114679425 B CN 114679425B CN 202210300536 A CN202210300536 A CN 202210300536A CN 114679425 B CN114679425 B CN 114679425B
Authority
CN
China
Prior art keywords
sub
data message
field
message
original data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210300536.XA
Other languages
Chinese (zh)
Other versions
CN114679425A (en
Inventor
李小军
吴闽华
孟庆晓
周智涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Genew Technologies Co Ltd
Original Assignee
Shenzhen Genew Technologies Co Ltd
Filing date
Publication date
Application filed by Shenzhen Genew Technologies Co Ltd filed Critical Shenzhen Genew Technologies Co Ltd
Priority to CN202210300536.XA priority Critical patent/CN114679425B/en
Publication of CN114679425A publication Critical patent/CN114679425A/en
Application granted granted Critical
Publication of CN114679425B publication Critical patent/CN114679425B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a message processing method, network equipment and storage medium under a 5G network, wherein the original data message is divided into a plurality of second fields under the condition that the length of the original data message exceeds a preset first threshold value, a second packet header is added in front of each second field to form a plurality of sub-data messages corresponding to the original data message, and each sub-data message is sent to a second processing unit; the second processing unit can restore the original data message according to the corresponding relation between the sub-data message represented by the second packet header and the original data message, so that the length of the data message received by the second processing unit can be reduced, the memory which is required to be pre-allocated by the second processing unit for receiving the data message is reduced, and the problem that in the prior art, the memory resource waste is caused by the fact that the buffer memory for pre-storing the received message is large in the 5G UPF can be solved.

Description

Message processing method, network equipment and storage medium under 5G network
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method for processing a packet in a 5G network, a network device, and a storage medium.
Background
At present, the most common of the 5G user plane functions (User Plane Function, UPF) is the network function, in the related art, after receiving a message from the network card, the CPU stores the message in a memory applied in advance, then applies a new memory to replace the memory just received, and uploads a memory buffer descriptor (BufferDescriptor, BD) storing data to the operating system kernel. The receiving process is asynchronous to the CPU, so that the receiving buffer address is firstly set on the network port hardware, and when the network port receives the message, the data is filled into the preset buffer memory in a direct memory operation (Direct Memory Access, DMA) mode. For 5G UPF, the network port bandwidth can reach 10Gbps, so that only one receiving BD cannot be set for buffering received data, otherwise packet loss is easily caused.
However, the number of received BDs of the portal of the 5G UPF is several thousands or even tens of thousands, and the buffer length of one BD is generally set to 1518 bytes. Therefore, in the related art, the buffer memory of the network port for pre-storing the received message is also large. Even if no message is input, the reserved buffer space can not be moved to other uses, so that the waste of memory resources is caused.
Disclosure of Invention
In view of this, the present invention provides a method for processing a message in a 5G network, a network device, and a storage medium, which are used for solving the problem in the prior art that a 5G UPF is larger for caching a pre-stored received message, which results in waste of memory resources. To achieve one or some or all of the above or other objects, the following is specific:
An embodiment of a first aspect of the present invention provides a method for processing a packet in a 5G network, which is applied to a first processing unit of a network device, where the network device includes the first processing unit and a second processing unit, and the second processing unit is connected to the first processing unit, and the method includes: acquiring an original data message, wherein the original data message comprises a first packet header field and a first data field; under the condition that the length of the original data message exceeds a preset first threshold value, a plurality of second fields are obtained according to the first threshold value, the first packet header field and the first data field; adding a second packet header in front of each second field to form a plurality of sub-data messages corresponding to the original data messages, wherein the second packet header is used for representing the corresponding relation between the sub-data messages and the original data messages; and sending each sub-data message to the second processing unit.
Preferably, when the length of the original data packet exceeds a preset first threshold, a plurality of second fields are obtained according to the first threshold, the first packet header field and the first data field, including: subtracting the length of the second packet header from the first threshold to obtain a second threshold under the condition that the length of the original data message exceeds the first threshold; splitting the original data message into a plurality of continuous second fields, wherein the first second field comprises the first packet header field and the first data field, the length of each second field does not exceed the second threshold value, and the length of each second field is less than the second threshold value and does not exceed one second field.
Preferably, the second header includes a first flag field and a second flag field; and adding a second packet header to the front of each second field to form a plurality of sub-data messages corresponding to the original data message, wherein the sub-data messages comprise: generating the first mark field according to the original data message, wherein the first mark fields of the sub data messages corresponding to the same original data message are the same; generating second mark fields corresponding to the sub-data messages one by one according to the generation sequence of the sub-data messages, wherein the second mark fields are used for the second processing unit to restore the original data messages according to the sub-data messages in sequence; and generating the second packet header corresponding to the second fields one by one according to the first mark fields and the second mark fields, and combining the second packet header with the corresponding second fields to obtain the sub-data message.
Preferably, the embodiment of the present invention further includes: and under the condition that the length of the original data message does not exceed the first threshold value, sending the original data message to the second processing unit.
An embodiment of a second aspect of the present invention provides a method for processing a packet in a 5G network, which is applied to a second processing unit of a network device, where the network device includes a first processing unit and the second processing unit, and the second processing unit is connected to the first processing unit, and the method includes: acquiring a received data message from the first processing unit, wherein the received data message carries a packet header to be detected for representing the type of the message; detecting the packet header to be detected, and taking the received data message as a sub-data message under the condition that the packet header to be detected is a second packet header, wherein the second packet header is used for representing the corresponding relation between the sub-data message and the original data message; and obtaining the original data message according to the sub data message.
Preferably, the embodiment of the present invention further includes: and under the condition that the received data message is a sub data message and the first memory space does not exist, applying the first memory space to the second processing unit according to a preset memory space value, wherein the first memory space is used for restoring the sub data message into an original data message.
Preferably, the second header includes a first flag field and a second flag field, where the first flag field corresponding to each sub-data packet of the same original data packet is the same, and the second flag field is used for the second processing unit to restore the original data packet according to each sub-data packet in sequence; the obtaining the original data message according to the sub data message includes: selecting the sub data messages corresponding to the same original data message according to the first mark field of each sub data message; sequencing the sub data messages corresponding to the same original data message according to the second mark field to obtain a sequencing result; and based on the sequencing result, obtaining the original data message according to each sub data message.
Preferably, the step of obtaining the original data packet according to each sub data packet based on the sorting result includes: taking the length of the message in the first memory space as the current message length; and taking the memory position pointed by the buffer descriptor corresponding to the sub data message plus the length of the second packet header as a starting point, taking the last bit of the sub data message as an end point, and copying the contents from the starting point to the end point in each sub data message to the memory position pointed by the current message length in the first memory space in sequence according to the sequencing result to obtain the original data message.
An embodiment of a third aspect of the present invention provides a network device, including: the system comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor implements a message processing method under a 5G network according to any one of the embodiments of the first aspect and the second aspect of the present invention when executing the computer program.
An embodiment of a fourth aspect of the present invention provides a computer readable storage medium storing computer executable instructions for performing a method for processing a message under a 5G network according to any one of the embodiments of the first aspect and the second aspect of the present invention.
The implementation of the embodiment of the invention has the following beneficial effects:
According to the message processing method, the network equipment and the storage medium under the 5G network, under the condition that the length of an original data message exceeds a preset first threshold value, a plurality of second fields are obtained according to the first threshold value, the first packet header field and the first data field; the original data message which is received by the second processing unit and has a longer length can be split into a plurality of second fields, a second packet head is added in front of each second field to form a plurality of sub-data messages corresponding to the original data message, and each sub-data message is sent to the second processing unit; the second processing unit can restore the original data message according to the corresponding relation between the sub-data message represented by the second packet header and the original data message, so that the length of the data message received by the second processing unit can be reduced, the memory which is required to be pre-allocated by the second processing unit for receiving the data message is reduced, and the problem that in the prior art, the memory resource waste is caused by the fact that the buffer memory for pre-storing the received message is large in the 5G UPF can be solved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Wherein:
fig. 1 is a schematic diagram of a UPF device according to an embodiment of the present invention;
FIG. 2 is a schematic illustration of an internal portal in accordance with an embodiment of the present invention;
Fig. 3 is a flowchart of a method for processing a message in a 5G network according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an original data packet according to an embodiment of the present invention;
Fig. 5 is a flowchart of a method for processing a message in a 5G network according to another embodiment of the present invention;
Fig. 6 is a flowchart of a method for processing a message in a 5G network according to another embodiment of the present invention;
FIG. 7 is a schematic diagram of a first sub-data packet obtained from the original data packet in FIG. 4;
FIG. 8 is a schematic diagram of a second sub-data packet obtained according to the original data packet in FIG. 4;
fig. 9 is a flowchart of a method for processing a message in a 5G network according to another embodiment of the present invention;
fig. 10 is a flowchart of a method for processing a message in a 5G network according to another embodiment of the present invention;
fig. 11 is a flowchart of a method for processing a message in a 5G network according to another embodiment of the present invention;
Fig. 12 is a schematic diagram of a network device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
It should be noted that although functional block division is performed in a device diagram and a logic sequence is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the block division in the device, or in the flowchart. The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The invention provides a message processing method, network equipment and storage medium under a 5G network, wherein the message processing method under the 5G network is applied to a first processing unit of the network equipment, the network equipment comprises the first processing unit and a second processing unit, and the second processing unit is connected with the first processing unit. Acquiring an original data message, wherein the original data message comprises a first packet header field and a first data field; under the condition that the length of the original data message exceeds a preset first threshold value, a plurality of second fields are obtained according to the first threshold value, the first packet header field and the first data field; adding a second packet header in front of each second field to form a plurality of sub-data messages corresponding to the original data messages, wherein the second packet header is used for representing the corresponding relation between the sub-data messages and the original data messages; and sending each sub-data message to the second processing unit. According to the embodiment of the invention, under the condition that the length of the original data message exceeds the preset first threshold, a plurality of second fields are obtained according to the first threshold, the first packet header field and the first data field; the original data message which is received by the second processing unit and has a longer length can be split into a plurality of second fields, a second packet head is added in front of each second field to form a plurality of sub-data messages corresponding to the original data message, and each sub-data message is sent to the second processing unit; the second processing unit can restore the original data message according to the corresponding relation between the sub-data message represented by the second packet header and the original data message, so that the length of the data message received by the second processing unit can be reduced, the memory which is required to be pre-allocated by the second processing unit for receiving the data message is reduced, and the problem that in the prior art, the memory resource waste is caused by the fact that the buffer memory for pre-storing the received message is large in the 5G UPF can be solved.
Embodiments of the present invention will be further described below with reference to the accompanying drawings.
As shown in fig. 1, fig. 1 is a schematic diagram of a UPF device 100 according to an embodiment of the present invention, in the example of fig. 1, the UPF device 100 includes a first processing unit 101 and a plurality of second processing units 102, where the second processing units 102 are respectively connected to the first processing unit 101, and the first processing unit 101 is provided with an external network port for communicating with the outside, and an internal network port for communicating with the second processing unit 102.
Specifically, after receiving a message from the network card, the CPU of the UPF device stores the message in a memory applied in advance, then applies a new memory to replace the memory just received, and uploads the memory buffer descriptor storing the data to the operating system kernel. The receiving process is asynchronous to the CPU, so that the receiving buffer address is firstly set on the network port hardware, and when the network port receives the message, the data is filled into the preset buffer through a direct memory operation mode. For 5G UPF, the network port bandwidth can reach 10Gbps, so that only one receiving BD cannot be set for buffering received data, otherwise packet loss is easily caused. However, the number of received BDs of the portal of the 5G UPF is several thousands or even tens of thousands, and the buffer length of one BD is generally set to 1518 bytes. Therefore, in the related art, the buffer memory of the network port for pre-storing the received message is also large. Even if no message is input, the reserved buffer space can not be moved to other uses, so that the waste of memory resources is caused. For 5G UPF other than X86, the memory may not have tens of GB, and may be 1G to 8GB. Memory is a valuable hardware resource of a computer system, almost all computing uses memory as a storage medium, and if the memory consumption is too high, new services may not be performed because the memory is not applied.
In a specific example, the UPF device includes a main control board MPU, a main control board, i.e., a first processing unit; the UPF device further includes two service boards, namely an SPU1 and an SPU2, respectively, and the service boards are also referred to as a second processing unit. The main control board is provided with 3 network ports, namely eth0, eth1 and eth2, wherein eth1 and eth2 are opposite-internal network ports, and eth1 and eth2 are in single-board butt joint with SPU1 and SPU2 respectively. On the single board of the MPU, the receiving buffer lengths of eth1 and eth2 are set to 512 bytes, and the receiving buffers of the network ports eth0 of the SPU1 and SPU2 are also set to 512 bytes, so that compared with the scheme of receiving the BD with the length preset to 1518 bytes in the related art, at least 20 Mbyte memory is saved.
Specifically, referring to fig. 2, fig. 2 is a schematic diagram of an internal network port provided by a specific example of the present invention, a network port of an external network on a UPF device is in butt joint with an external device, a message length is long or short, and a receiving BD length is preset to 1518 bytes. However, the internal network ports of the UPF are also in butt joint with the software and hardware system board of the manufacturer, so in the example of fig. 2, the buffer length of the received messages of the network ports can be set to 512 bytes, and then two thirds of the memory can be saved by one internal network port.
The UPF device and the application scenario described in the embodiments of the present invention are for more clearly describing the technical solution of the embodiments of the present invention, and do not constitute a limitation on the technical solution provided by the embodiments of the present invention, and those skilled in the art can know that, with the evolution of the communication technology and the appearance of the new application scenario, the technical solution provided by the embodiments of the present invention is applicable to similar technical problems.
It will be appreciated by those skilled in the art that the UPF device illustrated in FIG. 1 is not limiting of embodiments of the present invention and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
Based on the network device, various embodiments of a method for processing a message in a 5G network are provided.
As shown in fig. 3, fig. 3 is a flowchart of a method for processing a message under a 5G network according to an embodiment of the present invention, and in the example of fig. 3, the method for processing a message under a 5G network according to an embodiment of the present invention is applied to a first processing unit, which includes, but is not limited to, step S100, step S200, step S300, and step S400;
step S100, acquiring an original data message, wherein the original data message comprises a first packet header field and a first data field;
Step S200, obtaining a plurality of second fields according to the first threshold, the first packet header field and the first data field under the condition that the length of the original data message exceeds a preset first threshold;
Step S300, adding a second packet header in front of each second field to form a plurality of sub-data messages corresponding to the original data messages, wherein the second packet header is used for representing the corresponding relation between the sub-data messages and the original data messages;
step S400, each sub data message is sent to the second processing unit.
According to the scheme provided by the embodiment of the invention, under the condition that the length of the original data message exceeds a preset first threshold value, a plurality of second fields are obtained according to the first threshold value, the first packet header field and the first data field; the original data message which is received by the second processing unit and has a longer length can be split into a plurality of second fields, a second packet head is added in front of each second field to form a plurality of sub-data messages corresponding to the original data message, and each sub-data message is sent to the second processing unit; the second processing unit can restore the original data message according to the corresponding relation between the sub-data message represented by the second packet header and the original data message, so that the length of the data message received by the second processing unit can be reduced, the memory which is required to be pre-allocated by the second processing unit for receiving the data message is reduced, and the problem that in the prior art, the memory resource waste is caused by the fact that the buffer memory for pre-storing the received message is large in the 5G UPF can be solved.
Specifically, as shown in fig. 4, fig. 4 is a schematic structural diagram of an original DATA packet provided in an embodiment of the present invention, where in the example of fig. 4, the original DATA packet includes a mac_dst field, a mac_src field, a TYPE field, and a DATA field, where the mac_dst field, the mac_src field, and the TYPE field are first header fields, and the DATA field is a first DATA field.
Specifically, the mac_dst field and the mac_src field are used to represent the MAC address of the reception source and the MAC address of the transmission direction, respectively.
Specifically, the length of the mac_dst field and the mac_src field are both 6 bytes, and the length of the TYPE field is 2 bytes, that is, the total length of the first packet header field is 14 bytes.
As shown in fig. 5, the above method step S200 includes, but is not limited to, step S210 and step S220:
Step S210, subtracting the length of the second packet header from the first threshold to obtain a second threshold under the condition that the length of the original data message exceeds the first threshold;
Step S220, splitting the original data message into a plurality of continuous second fields, wherein the first second field comprises a first packet header field and a first data field, the length of each second field does not exceed a second threshold value, and the length of each second field is less than one second field of the second threshold value.
Specifically, the second fields are split from the original data message in sequence, so that the first second fields comprise the first packet header field and the first data field at the same time, and the original data message can be restored by sequentially combining the second fields in sequence.
In an embodiment, the second header includes a first flag field and a second flag field, where the first flag field of each sub-data packet corresponding to the same original data packet is the same, and the second flag field is used for the second processing unit to restore the original data packet according to each sub-data packet in sequence.
As shown in fig. 6, the above-mentioned method step S300 includes, but is not limited to, step S310, step S320, step S330, and step S340:
Step S310, generating a first mark field according to the original data message, wherein the first mark fields of all sub data messages corresponding to the same original data message are the same;
Step S320, generating second mark fields corresponding to the sub data messages one by one according to the generation sequence of the sub data messages, wherein the second mark fields are used for a second processing unit to restore original data messages according to the sub data messages in sequence;
step S330, a second packet header corresponding to the second fields one by one is generated according to the first mark field and the second mark field, and the second packet header is combined with the corresponding second fields to obtain the sub-data message.
As shown in fig. 7, fig. 7 is a schematic structural diagram of a first sub data packet obtained from the original data packet in fig. 4, and the sub data packet shown in fig. 7 is generated in the case that the first threshold is defined as 512 bytes in the original data packet in fig. 4, and in the example in fig. 7, a second header of the sub data packet includes a mac_dst field, a mac_src field, a type identification field, and a sequence identification field sequentially from front to back.
Specifically, the length of the type identifier field is 2 bytes, the content is 0x9999, and when the second processing unit detects that the thirteenth to fourteenth bytes of the packet header of the received packet are 0x9999, the packet header of the received packet can be confirmed to be a sub-data packet.
Specifically, the length of the sequence identifier field is 2 bytes, and since fig. 6 is a schematic structural diagram of the first sub-data packet obtained according to the original data packet in fig. 4, the sequence identifier field is 0x0000, and similarly, the sequence identifier field of the second sub-data packet obtained according to the original data packet in fig. 4 is 0x0001.
Specifically, the first tag field and the second tag field include a sequence identification field.
Specifically, since the first threshold is 512 bytes, in the example of fig. 6, the length of the second field is 496 bytes, that is, the second field includes 496 field contents of the original data packet from front to back in fig. 4.
As shown in fig. 8, fig. 8 is a schematic diagram of a structure of a second sub-data packet obtained according to the original data packet in fig. 4, where the second sub-data packet obtained according to the original data packet in fig. 4 is different from the first sub-data packet obtained according to the original data packet in fig. 4 only in sequence identification field, and the sequence identification field of the second sub-data packet is 0x0001, so that whether a plurality of sub-data packets correspond to the same original data packet can be obtained by verifying whether the mac_dst field, the mac_src field and the type identification field of the sub-data packet header are consistent, after the result of the verification, the sequence of each sub-data packet can be determined by the sequence identification field, and then the second fields of each sub-data packet can be combined in sequence to restore the original data packet.
In an embodiment, the method step further includes step S500: and under the condition that the length of the original data message does not exceed the first threshold value, sending the original data message to the second processing unit.
If the length of the original data message does not exceed the first threshold value, the original data message is not required to be split into a plurality of sub data messages, and the sub data messages are directly sent to the second processing unit.
As shown in fig. 9, fig. 9 is a flowchart of a method for processing a message under a 5G network according to another embodiment of the present invention, and in the example of fig. 9, the method for processing a message under a 5G network according to the embodiment of the present invention is applied to a second processing unit, which includes, but is not limited to, step S600, step S700, and step S800;
Step S600, a received data message from a first processing unit is obtained, wherein the received data message carries a packet header to be detected for representing the type of the message;
Step S700, detecting the packet header to be detected, and taking the received data message as a sub-data message when the packet header to be detected is a second packet header, wherein the second packet header is used for representing the corresponding relation between the sub-data message and the original data message;
Step S800, obtaining the original data message according to the sub data message.
In an embodiment, the second header includes a first flag field and a second flag field, where the first flag field of each sub-data packet corresponding to the same original data packet is the same, and the second flag field is used for the second processing unit to restore the original data packet according to each sub-data packet in sequence.
The second processing unit can restore the original data message according to the corresponding relation between the sub-data message represented by the second packet header and the original data message, so that the length of the data message received by the second processing unit can be reduced, the memory which is required to be pre-allocated by the second processing unit for receiving the data message is reduced, and the problem that in the prior art, the memory resource waste is caused by the fact that the buffer memory for pre-storing the received message is large in the 5G UPF can be solved.
Specifically, the above method step further includes step S500: and under the condition that the received data message is a sub data message and the first memory space does not exist, applying the first memory space to the second processing unit according to a preset memory space value, wherein the first memory space is used for restoring the sub data message into an original data message.
Specifically, the static variable pBuf is defined for applying 1600 bytes of memory, i.e., applying for 1600 bytes of first memory space, whose initial value is NULL. The memory is actually applied when the first 0x9999 type message is encountered.
Specifically, the first threshold is set to 512 bytes, and the length of the second header is 16 bytes.
As shown in fig. 10, the above-mentioned method step S800 includes, but is not limited to, step S810, step S820, and step S830:
Step S810, selecting the sub-data messages corresponding to the same original data message according to the first mark field of each sub-data message;
Step S820, sorting the sub-data messages corresponding to the same original data message according to the second mark field to obtain a sorting result;
step S830, based on the sorting result, the original data message is obtained according to each sub data message.
In an embodiment, whether the plurality of sub data messages correspond to the same original data message may be obtained by verifying whether the mac_dst field, the mac_src field and the type identifier field of the sub data message header are consistent, determining the sequence of each sub data message through the sequence identifier field after the result is confirmed, and then sequentially combining the second fields of each sub data message to restore the original data message.
As shown in fig. 11, the above-mentioned method step S830 includes, but is not limited to, step S831 and step S832:
step S831, the length of the message in the first memory space is used as the current message length;
in step S832, the memory location pointed by the buffer descriptor corresponding to the sub-data packet plus the length of the second header is used as a starting point, the last bit of the sub-data packet is used as an end point, and the contents from the starting point to the end point in each sub-data packet are copied to the memory location pointed by the current packet length in the first memory space in sequence according to the sorting result, so as to obtain the original data packet.
Example one:
in a specific example, the step of obtaining the original data packet by the second processing unit includes, but is not limited to:
step 1, defining a static variable pBuf for applying 1600 bytes of memory, using a packet, and setting the initial value as NULL. The memory is actually applied when the first 0x9999 type message is encountered. Defining a static variable ulLen for saving the actual length of the group packet, wherein the initial value is 0;
and step 2, taking the current message, and judging whether the type is 0x9999. If not, entering the next step, otherwise entering the step 4;
Step 3, judging ulLen whether 0 is obtained, if 0 is obtained, indicating that no packet is formed, directly uploading the BD-oriented message to the operating system kernel, and entering step 2;
Step 4, judging whether pBuf is empty, if yes, applying for the memory with 1600 bytes length, otherwise, directly entering the next step;
Step 5, copying the memory from the message 16 pointed by the BD to the memory pointed by pBuf + ulLen, wherein the copying length is the length of the message minus 16;
Step 6, grouping packet length ulLen = ulLen +current message length-16;
Step 7, entering step 2
Step 8, the memory with address pBuf and length ulLen is submitted to the kernel of the operating system, and step 2 is entered;
It should be noted that the steps in the specific example are established on the premise that the length of the first packet header field is 16 bytes, the first threshold value is 512 bytes, and the original data packet is smaller than 1600 bytes.
In addition, referring to fig. 12, the embodiment of the present invention further provides a network device 200, where the network device 200 is provided with a processor 201 and a memory 202, and the processor 201 and the memory 202 are connected through a bus. In particular, the processor 201 is configured to provide computing and control capabilities to support the operation of the overall network device 200. The Processor 201 may be a central processing unit (Central Processing Unit, CPU), and the Processor 201 may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL processors, DSPs), application SPECIFIC INTEGRATED Circuits (ASICs), field-Programmable gate arrays (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Specifically, the Memory 202 may be a Flash chip, a Read-Only Memory (ROM) disk, an optical disk, a U-disk, a removable hard disk, or the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 12 is merely a block diagram of a portion of the structure associated with an embodiment of the present invention and is not intended to limit the network device 200 to which an embodiment of the present invention is applied, and that a particular server may include more or fewer components than shown, or may combine certain components, or may have a different arrangement of components.
The processor is configured to run a computer program stored in the memory, and implement any one of the methods for processing a message under a 5G network provided by the embodiments of the present invention when the computer program is executed.
In an embodiment, the processor is configured to run a computer program stored in the memory.
It should be noted that, for convenience and brevity of description, the specific working process of the network device 200 described above may refer to the corresponding process in the foregoing embodiment of the message processing method under the 5G network, which is not described herein again.
In addition, an embodiment of the present invention further provides a computer readable storage medium, where one or more programs are stored, and the one or more programs are executable by one or more processors to implement steps of a message processing method under any 5G network as provided in the present specification.
The storage medium may be an internal storage unit of the electronic device of the foregoing embodiment, for example, a hard disk or a memory of the electronic device. The storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk provided on the electronic device, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD), or the like.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
While the preferred embodiment of the present invention has been described in detail, the present invention is not limited to the above embodiment, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and these equivalent modifications or substitutions are included in the scope of the present invention as defined in the appended claims.

Claims (8)

1. The method for processing the message under the 5G network is applied to a first processing unit of network equipment, the network equipment comprises the first processing unit and a second processing unit, and the second processing unit is connected with the first processing unit, and is characterized in that the method comprises the following steps:
Acquiring an original data message, wherein the original data message comprises a first packet header field and a first data field;
Subtracting the length of a second packet header from the first threshold to obtain a second threshold when the length of the original data packet exceeds the first threshold, wherein the second packet header comprises a first mark field and a second mark field, the first mark field comprises a first packet header field, the second mark field comprises a sequence identification field, and the first packet header field comprises a receiving source MAC address and a sending direction MAC address;
splitting the original data message into a plurality of continuous second fields;
Adding the second packet header before each second field to form a plurality of sub-data messages corresponding to the original data messages, wherein the second packet header is used for representing the corresponding relation between the sub-data messages and the original data messages, the first second field simultaneously comprises the first packet header field and the first data field, the length of each second field does not exceed the second threshold value, the length of each second field is less than the second threshold value, the second field does not exceed one, the first mark fields of each sub-data message corresponding to the same original data message are the same, and the second mark fields are used for a second processing unit to restore the original data message according to each sub-data message in sequence;
Transmitting each sub-data message to the second processing unit, so that the second processing unit verifies whether the first packet header fields in the second packet headers of the plurality of sub-data messages are consistent; and if the sub data messages are consistent, determining the sequence of a plurality of sub data messages based on the sequence identification field of each sub data message, and combining and restoring the second field of each sub data message according to the sequence to restore the original data message.
2. The method for processing a packet in a 5G network according to claim 1, wherein the second header includes a first flag field and a second flag field; and adding a second packet header to the front of each second field to form a plurality of sub-data messages corresponding to the original data message, wherein the sub-data messages comprise:
generating the first mark field according to the original data message, wherein the first mark fields of the sub data messages corresponding to the same original data message are the same;
Generating second mark fields corresponding to the sub-data messages one by one according to the generation sequence of the sub-data messages, wherein the second mark fields are used for the second processing unit to restore the original data messages according to the sub-data messages in sequence;
And generating the second packet header corresponding to the second fields one by one according to the first mark fields and the second mark fields, and combining the second packet header with the corresponding second fields to obtain the sub-data message.
3. The method for processing a message in a 5G network according to claim 1, further comprising: and under the condition that the length of the original data message does not exceed the first threshold value, sending the original data message to the second processing unit.
4. A method for processing a message in a 5G network, applied to a second processing unit of a network device, where the network device includes a first processing unit and the second processing unit, and the second processing unit is connected to the first processing unit, and the method includes:
Acquiring a received data message from the first processing unit, wherein the received data message carries a packet header to be detected for representing the type of the message;
Detecting the packet header to be detected, and taking the received data message as a sub-data message when the packet header to be detected is a second packet header, wherein the second packet header is used for representing the corresponding relation between the sub-data message and an original data message, the second packet header comprises a first mark field and a second mark field, the first mark fields of the sub-data messages corresponding to the same original data message are the same, the second mark field is used for enabling the second processing unit to restore the original data message according to the sub-data messages in sequence, the first mark field comprises a first packet header field, the second mark field comprises a sequence identification field, and the first packet header field comprises a MAC address of a receiving source and a MAC address of a sending direction;
Verifying whether first packet header fields in second packet headers of the plurality of sub-data messages are consistent; if the sub data messages are consistent, determining the sequence of a plurality of sub data messages based on the sequence identification field of each sub data message;
Sequencing the sub-data messages corresponding to the same original data message according to the sequence to obtain a sequencing result;
and based on the sequencing result, obtaining the original data message according to each sub data message.
5. The method for processing a message in a 5G network according to claim 4, further comprising:
And under the condition that the received data message is a sub data message and the first memory space does not exist, applying the first memory space to the second processing unit according to a preset memory space value, wherein the first memory space is used for restoring the sub data message into an original data message.
6. The method for processing a packet in a 5G network according to claim 5, wherein the obtaining the original data packet according to each of the sub data packets based on the sorting result includes:
Taking the length of the message in the first memory space as the current message length;
And taking the memory position pointed by the buffer descriptor corresponding to the sub data message plus the length of the second packet header as a starting point, taking the last bit of the sub data message as an end point, and copying the contents from the starting point to the end point in each sub data message to the memory position pointed by the current message length in the first memory space in sequence according to the sequencing result to obtain the original data message.
7. A network device, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements a method for processing messages under a 5G network according to any one of claims 1 to 6 when executing the computer program.
8. A computer-readable storage medium storing computer-executable instructions for performing a method of message processing under a 5G network according to any one of claims 1 to 6.
CN202210300536.XA 2022-03-24 Message processing method, network equipment and storage medium under 5G network Active CN114679425B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210300536.XA CN114679425B (en) 2022-03-24 Message processing method, network equipment and storage medium under 5G network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210300536.XA CN114679425B (en) 2022-03-24 Message processing method, network equipment and storage medium under 5G network

Publications (2)

Publication Number Publication Date
CN114679425A CN114679425A (en) 2022-06-28
CN114679425B true CN114679425B (en) 2024-05-31

Family

ID=

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101150562A (en) * 2007-10-29 2008-03-26 中兴通讯股份有限公司 A media stream data processing method for reducing CPU processing load
WO2012162949A1 (en) * 2011-08-17 2012-12-06 华为技术有限公司 Packet reassembly and resequence method, apparatus and system
CN103905300A (en) * 2012-12-25 2014-07-02 华为技术有限公司 Data message sending method, device and system
CN105264806A (en) * 2013-11-28 2016-01-20 华为技术有限公司 Transmission method and device for data packet
CN105339934A (en) * 2014-05-22 2016-02-17 华为技术有限公司 Packet processing method and apparatus
CN109257737A (en) * 2018-11-07 2019-01-22 北京天海达科技有限公司 A kind of Beidou long message sending device and method
CN110099027A (en) * 2018-01-29 2019-08-06 腾讯科技(深圳)有限公司 Transmission method and device, storage medium, the electronic device of service message
CN110474829A (en) * 2018-05-10 2019-11-19 华为技术有限公司 The method and apparatus of transmitting message
CN110581812A (en) * 2018-06-08 2019-12-17 北京京东尚科信息技术有限公司 Data message processing method and device
CN111083161A (en) * 2019-12-27 2020-04-28 中消云(北京)物联网科技研究院有限公司 Data transmission processing method and device and Internet of things equipment
CN111641622A (en) * 2020-05-21 2020-09-08 中国人民解放军国防科技大学 Converged network interface card, message coding method and message transmission method thereof
WO2021089052A1 (en) * 2019-11-08 2021-05-14 华为技术有限公司 Packet transmission method, proxy node, and storage medium
CN113141322A (en) * 2020-01-17 2021-07-20 北京配天技术有限公司 Data communication method, data communication device and computer storage medium
CN114124555A (en) * 2021-11-29 2022-03-01 杭州迪普科技股份有限公司 Message playback method and device, electronic equipment and computer readable medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101150562A (en) * 2007-10-29 2008-03-26 中兴通讯股份有限公司 A media stream data processing method for reducing CPU processing load
WO2012162949A1 (en) * 2011-08-17 2012-12-06 华为技术有限公司 Packet reassembly and resequence method, apparatus and system
CN103905300A (en) * 2012-12-25 2014-07-02 华为技术有限公司 Data message sending method, device and system
CN105264806A (en) * 2013-11-28 2016-01-20 华为技术有限公司 Transmission method and device for data packet
CN105339934A (en) * 2014-05-22 2016-02-17 华为技术有限公司 Packet processing method and apparatus
CN110099027A (en) * 2018-01-29 2019-08-06 腾讯科技(深圳)有限公司 Transmission method and device, storage medium, the electronic device of service message
CN110474829A (en) * 2018-05-10 2019-11-19 华为技术有限公司 The method and apparatus of transmitting message
CN110581812A (en) * 2018-06-08 2019-12-17 北京京东尚科信息技术有限公司 Data message processing method and device
CN109257737A (en) * 2018-11-07 2019-01-22 北京天海达科技有限公司 A kind of Beidou long message sending device and method
WO2021089052A1 (en) * 2019-11-08 2021-05-14 华为技术有限公司 Packet transmission method, proxy node, and storage medium
CN111083161A (en) * 2019-12-27 2020-04-28 中消云(北京)物联网科技研究院有限公司 Data transmission processing method and device and Internet of things equipment
CN113141322A (en) * 2020-01-17 2021-07-20 北京配天技术有限公司 Data communication method, data communication device and computer storage medium
CN111641622A (en) * 2020-05-21 2020-09-08 中国人民解放军国防科技大学 Converged network interface card, message coding method and message transmission method thereof
CN114124555A (en) * 2021-11-29 2022-03-01 杭州迪普科技股份有限公司 Message playback method and device, electronic equipment and computer readable medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
A Hajjar等."Network traffic application identification based on message size analysis".《Journal of Network and Computer》.2015,全文. *
W Dong等."Dynamic packet length control in wireless sensor networks".《IEEE》.2014,全文. *
张建宇 ; 韦韬 ; 邹维 ; .一种基于自适应缓存机制的报文分类算法.计算机研究与发展.2006,(第02期),全文. *
程伟,全天彤.IP报文分片机制与路径MTU发现技术.计算机应用研究.2000,(第08期),全文. *

Similar Documents

Publication Publication Date Title
US7650429B2 (en) Preventing aliasing of compressed keys across multiple hash tables
US10116746B2 (en) Data storage method and network interface card
CN106878199A (en) The collocation method and device of a kind of access information
CN114710224A (en) Frame synchronization method and device, computer readable medium and electronic device
CN111026324B (en) Updating method and device of forwarding table entry
CN110602234B (en) Block chain network node management method, device, equipment and storage medium
CN111541521B (en) Data packet length identification method and system
CN110659905A (en) Transaction verification method, device, terminal equipment and storage medium
CN113014510B (en) Data caching method and device in distributed test of inertial navigation system
CN109995548B (en) Device management method and system, data transmission method and system and terminal device
CN114679425B (en) Message processing method, network equipment and storage medium under 5G network
CN109889418B (en) Data transmission method and device based on CAN bus
CN111405007A (en) TCP session management method, device, storage medium and electronic equipment
CN112995069A (en) Instruction writing method and device and network equipment
CN111478864A (en) Data packet processing method and device, electronic equipment and storage medium
CN113973074B (en) Message processing method and device, electronic equipment and medium
EP4203492A1 (en) Service scheduling method, packet optical transport network device, and storage medium
CN114679425A (en) Message processing method, network equipment and storage medium in 5G network
CN111459819B (en) Software testing method and device, electronic equipment and computer readable medium
CN110896391B (en) Message processing method and device
US7581163B1 (en) Detection of corrupted memory pointers within a packet-processing device
CN108123990B (en) Data storage method, data storage system and data processing equipment
CN114579490A (en) Data transmission method and device, electronic equipment and storage medium
CN105391619A (en) Method for ensuring information display sequence and electronic equipment
CN108733598B (en) Data transmission method and data transmission device

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant