Data fragmentation method based on DPU, electronic equipment and computer storage medium

By sharding the data packets based on the maximum capacity value and protocol version of the DPU network card, the problem of GSO technology occupying CPU resources is solved, more efficient data sharding and checksum operation is achieved, and network transmission performance is optimized .

CN119254709APending Publication Date: 2025-01-03YUSUR TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411369956.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

In the prior art, Generic Segmentation Offload (GSO) technology occupies a large amount of central processor (CPU) resources, resulting in weaker CPU processors being unable to handle other events during data sharding and calculation checksum, resulting in resource bottlenecks.

Method used

By obtaining the maximum data packet capacity value of the data packet on the DPU network card, and sharding is performed according to different protocol versions (IPv4 or IPv6) and Baotou information, CPU resources are released, and sharding technology is optimized.

Benefits of technology

It reduces CPU resource utilization, improves the efficiency and accuracy of data sharding, reduces processing delay, and directly processes ultra-long packets with hardware support, reducing CPU load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254709A_ABST
    Figure CN119254709A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a DPU-based data fragmentation method, electronic equipment and a storage medium, is applied to a DPU network card, and comprises the following steps: obtaining a maximum data message capacity value set by a data transmission unit through which a data message is to pass; if the data message uses the first protocol version and meets the fragmentation condition, determining a target data message capacity value according to the maximum data message capacity value and the internet protocol IP header length of the data message; fragmenting the data message based on the target data message capacity value to obtain the fragmented data message; if the data message uses a second protocol version and a protocol header analyzed by a packet header of the data message is a first preset protocol, determining a target data message capacity value according to the total length of an extension header analyzed by the packet header and the maximum data message capacity value, and fragmenting the data message based on the target data message capacity value, and obtaining the fragmented data message. According to the method and the device, the CPU resource utilization rate is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a DPU-based data slicing method, electronic device, and computer storage medium. Background Art

[0002] Internet Protocol (IP) fragmentation is a technology used to split large data packets into smaller fragments during network transmission. It is mainly to adapt to the differences in MTU (Maximum Transmission Unit) between different networks and ensure that data can be transmitted smoothly to the destination.

[0003] In the related technology, a network transmission technology (Generic Segmentation Offload, GSO) is used to fragment non-Transmission Control Protocol (TCP) messages according to MTU. This allows the data packets to be effectively received by the opposite protocol stack, and the opposite protocol stack will directly discard the overlong messages. However, because the GSO technology is a protocol stack process, it will occupy a large amount of central processing unit (CPU) resources. For some weaker CPU processors, it will be a catastrophic event. The CPU will be in the process of large packet segmentation or fragmentation and checksum calculation for a long time, and it will be unable to allocate resources for processing other events.

[0004] Therefore, how to reduce CPU resource utilization becomes an urgent problem to be solved. Summary of the invention

[0005] In view of this, an embodiment of the present application provides a DPU-based data sharding method, an electronic device, and a storage medium to at least partially solve the above-mentioned problems.

[0006] According to a first aspect of an embodiment of the present application, a DPU-based data slicing method is provided, which is applied to a DPU network card, including:

[0007] Obtain the maximum data message capacity value set by the data transmission unit through which the data message is to pass;

[0008] If the data message uses the first protocol version and meets the fragmentation condition, a target data message capacity value is determined according to the maximum data message capacity value and the IP header length of the data message; and the data message is fragmented based on the target data message capacity value to obtain fragmented data messages;

[0009] If the data message uses the second protocol version and the protocol header parsed from the packet header of the data message is the first preset protocol, the target data message capacity value is determined based on the total length of the extended header parsed from the packet header and the maximum data message capacity value, and the data message is fragmented based on the target data message capacity value to obtain fragmented data messages.

[0010] According to a second aspect of an embodiment of the present application, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method described in the first aspect.

[0011] According to a third aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect is implemented.

[0012] According to the scheme provided in the embodiment of the present application, the maximum data message capacity value set by the data transmission unit through which the data message is to pass is obtained through the DPU network card; if the data message uses the first protocol version and meets the fragmentation condition, the target data message capacity value is determined according to the maximum data message capacity value and the IP header length of the data message; and the data message is fragmented based on the target data message capacity value to obtain the fragmented data message; if the data message uses the second protocol version and the protocol header parsed from the packet header of the data message is the first preset protocol, the target data message capacity value is determined according to the total length of the extended header parsed from the packet header and the maximum data message capacity value, and the data message is fragmented based on the target data message capacity value to obtain the fragmented data message. In this process, by judging the protocol version used by the data message, it is also judged whether the data message has been fragmented or not allowed to be fragmented. If the above two situations do not occur, different fragmentation measures are performed according to different protocol versions, which releases CPU resources and optimizes fragmentation technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0014] Figure 1 A schematic diagram of a data slicing method based on DPU provided in an embodiment of the present application Figure 1 ;

[0015] Figure 2 A system block diagram of IP fragmentation unloading provided in an embodiment of the present application;

[0016] Figure 3 A schematic diagram of IP fragmentation offloading state jump provided in an embodiment of the present application;

[0017] Figure 4 The present invention is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0018] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.

[0019] like Figure 1 As shown, Figure 1 A schematic diagram of a data slicing method based on DPU provided in an embodiment of the present application Figure 1 . The DPU-based data fragmentation method provided in the embodiment of the present application can be applied to standard network cards, smart network cards, and DPU (Data Processing Unit) chips that support hardware to perform fragmentation operations. Among them, the hardware can be a processor. When the hardware supports IP fragmentation unloading, the software can directly send the overlong packet to the hardware for processing. Because the hardware's pipeline processing will greatly reduce the processing delay and release CPU resources, and because the hardware has its own filtering function, all data packets can be sent through the hardware. The packets that cannot be processed by the hardware are processed by the CPU, and the CPU that can be processed by the hardware directly passes the large packet to the hardware for processing.

[0020] The DPU-based data sharding methods include:

[0021] S101. Obtain a maximum data message capacity value set by a data transmission unit through which a data message is to pass.

[0022] In the embodiments of the present application, the maximum transmission unit MTU (Maximum Transmission Unit, MTU) refers to the maximum data packet size that the network can transmit, in bytes. The size of MTU determines the maximum number of bytes that the sender can send at one time. If the MTU exceeds the maximum value that the receiving end can bear, or exceeds the maximum value that a certain device on the transmission path can bear, it will cause the message to be fragmented or even discarded. The value of the data transmission unit, that is, the value of the MTU, can be set. The maximum data message capacity value set by the data transmission unit that the data message is to pass through is obtained to provide a reference for the subsequent judgment of the fragmentation of the data packet.

[0023] S102. If the data message uses the first protocol version and the data message meets the fragmentation conditions, the target data message capacity is determined according to the maximum data message capacity value and the Internet Protocol IP header length corresponding to the data message; and the data message is fragmented based on the target data message capacity value to obtain fragmented data messages.

[0024] In an embodiment of the present application, the protocol version used by the data message may be Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). The protocol version used by the data message is judged. When it is the first protocol version, i.e., the IPV4 international protocol version, it is further judged whether the data message meets the data fragmentation condition. If the data message is a fragmented message, a message that does not allow fragmentation, or a message length that is less than MTU, the data message does not meet the fragmentation condition, otherwise the data message meets the fragmentation condition. Because the payload content of the fragmented message is rounded to eight bytes when the data message is fragmented, the MTU value used for unloading, i.e., the target data message capacity value, is determined based on the currently set maximum data message capacity and IP header length.

[0025] Among them, if the data message uses the first protocol version, that is, the data message is an IPV4 message, the IP fragment offset flag, IP layer header information length, four-layer protocol type and total message length corresponding to the IPV4 message are parsed, and it is determined whether the data message meets the fragmentation conditions based on the parsing results.

[0026] In an embodiment of the present application, the transport layer protocol type corresponding to the data message is determined. If it is the first preset protocol, that is, the Transmission Control Protocol (TCP) / User Datagram Protocol (UDP), the number of fragments of the data message is determined according to the target data message capacity value to obtain the fragmented data message.

[0027] If the transport layer protocol type corresponding to the data message is not the first preset protocol, the data message is directly fragmented based on the target data message capacity value to obtain fragmented data messages.

[0028] In an embodiment of the present application, when IP fragmentation offloading is enabled, checksum offloading is enabled by default.

[0029] S103. If the data message uses the second protocol version and the protocol header parsed from the packet header of the data message is the first preset protocol, determine the target data message capacity value according to the total length of the extended headers parsed from the packet header and the maximum data message capacity, and fragment the data message based on the target data message capacity value to obtain fragmented data messages.

[0030] In an embodiment of the present application, the protocol version used by the data message is judged. When it is the second protocol version, that is, the IPV6 international protocol version, the protocol type carried by the packet header of the data message is parsed. When the carried protocol type is a protocol header, such as a four-layer protocol header is a first preset protocol, such as a TCP / UDP protocol, the total length of all extended headers whose protocol type is an extended header carried by the packet header is obtained, and the target data message capacity value is determined according to the total length of the extended headers and the maximum data message capacity. Finally, the number of fragments of the data message is determined according to the target data message capacity value to obtain the fragmented data message.

[0031] Among them, when parsing the protocol type carried in the packet header of the data message, if the protocol type is an extension header, continue parsing until the fourth-layer protocol header is parsed, obtain all the extension headers before parsing the fourth-layer protocol header, sum the obtained extension headers, and obtain the total length of the extension header. If a fragmentation extension header is parsed during the parsing of the protocol type carried by the packet header, it indicates that the data message has been fragmented before, and the message cannot be fragmented at this time, so no further parsing is performed.

[0032] In the embodiments of the present application, Figure 2 As shown, Figure 2 A system block diagram of IP fragment unloading provided in an embodiment of the present application. Figure 2In the invention, a checksum calculation module (packet_checksum), a descriptor generation module (packet_parser), a buffer pool storage module (packet_memory), and a data fragmentation module (packet_fragment) are included. After the data message is transmitted through the data stream interface, the checksum is calculated. At the same time, the descriptor generation module generates a corresponding descriptor, including support for hardware offload function, checksum offload, maximum data transmission unit, extended header length, and TCP / UDP result. When the MTU value for offload is determined based on the maximum transmission unit in the descriptor, the data message is stored in the buffer pool storage module. After the offload capability is confirmed and the TCP / UDP checksum is calculated, the data packet is read from the buffer pool and the data is fragmented in the data fragmentation module according to the offload capability to obtain the fragmented data. The checksum of the fragmented data is calculated again, which can be the IP layer checksum calculation, and the IP layer checksum and the TCP / UDP checksum are filled in the fragmented data message. Finally, the data message filled with the checksum is transmitted through the data stream interface.

[0033] It can be understood that in the embodiment of the present application, the data to be passed by the data message is obtained, and the maximum data message capacity value set by the input unit is obtained; if the data message uses the first protocol version and meets the fragmentation condition, the target data message capacity value is determined according to the maximum data message capacity value and the IP header length of the data message; and the data message is fragmented based on the target data message capacity value to obtain the fragmented data message; if the data message uses the second protocol version and the protocol header parsed from the packet header of the data message is the first preset protocol, the target data message capacity value is determined according to the total length of the extended header parsed from the packet header and the maximum data message capacity value, and the data message is fragmented based on the target data message capacity value to obtain the fragmented data message. In this process, on the one hand, in view of the problem that many CPU capabilities are weak, the protocol version used by the data message is replaced by the CPU to determine whether the data message has been fragmented or not allowed to be fragmented. If the above two situations do not occur, different fragmentation measures are performed according to different protocol versions, which releases CPU resources and optimizes fragmentation technology. On the other hand, if the user's CPU capability is very strong, the message processing delay can be reduced by disabling hardware functions.

[0034] In some embodiments of the present application, S102 can be implemented through S1021 to S103, which is explained by the following steps.

[0035] S1021. When the data message uses the first protocol version, obtain key fields of the data message during transmission.

[0036] In some embodiments of the present application, the key fields may be an IP fragment offset flag, an IP layer header information length, a four-layer protocol type, and a total message length. Among them, the IP fragment offset flag is used to identify the position of each fragment in the original data packet after the data packet is fragmented; the four-layer protocol type mainly includes the application layer, the transport layer, the network layer, and the network interface layer or the data link layer. These four layers work together to ensure the integrity and correctness of the data, so that various applications can communicate and exchange data through the network. The total message length refers to the total length of the message, including the sum of the lengths of the header and the payload. The IP layer header information length usually refers to the length of the IPv4 or IPv6 data packet header. The header structures of IPv4 and IPv6 are different, so their header lengths are also different.

[0037] S1022. When it is determined through the key fields that the data message meets the fragmentation condition, the target data message capacity value is determined according to the maximum data message capacity and the IP header length corresponding to the data message.

[0038] In some embodiments of the present application, it is determined whether the data message is a fragmented message, a message that does not allow fragmentation, or a message whose length is less than the MTU based on key fields of the data message, such as the IP fragment offset flag, the IP layer header information length, the four-layer protocol type, and the total length of the message. When it is determined by keywords that the data message meets the fragmentation condition, the target data message capacity value is further determined based on the maximum data message capacity and the IP header length corresponding to the data message.

[0039] S1023: When it is determined through the key field that the data message does not meet the fragmentation condition, the data message is not fragmented.

[0040] In some embodiments of the present application, when it is determined through key fields that a data message does not meet the fragmentation conditions, such as a fragmented message, a message that does not allow fragmentation, or a message whose length is less than the MTU, the data message is not fragmented. If the data message is a fragmented message or a message that does not allow fragmentation and the data message length is greater than the MTU, the packet is discarded and an ICMP error message is returned.

[0041] It is understandable that in some embodiments of the present application, when the data message uses the first protocol version, the key field of the data message during the transmission process is obtained; when the data message is judged to meet the fragmentation condition through the key field, the target data message capacity value is determined according to the maximum data message capacity and the IP header length corresponding to the data message. When the data message is judged to not meet the fragmentation condition through the key field, the data message is not fragmented. By judging whether the data message can be fragmented through the keyword corresponding to the data message, the accuracy of data fragmentation is improved.

[0042] In some embodiments of the present application, S10 is included before S102, which is specifically explained through the following steps.

[0043] S10. Parse the Ethernet type value corresponding to the data message to obtain the protocol version used by the data message.

[0044] In some embodiments of the present application, the data message transmitted by the bus is parsed, and the Ethernet type is first parsed, and the international protocol version used by the data message is determined by reading the Ethernet frame, extracting the type field, and checking the value of the type field. Wherein the protocol version used by the data message can be the IPV4 version and the IPV6 version, then it is determined whether the protocol version used by the data message is the IPV4 version or the IPV6 version.

[0045] It can be understood that in some embodiments of the present application, when fragmenting, the data packet is determined to be IPv4 or IPv6 based on the Ethernet type. Different protocol versions are suitable for different network environments and requirements, thereby improving the accuracy, efficiency and compatibility of network communications.

[0046] In some embodiments of the present application, S20 to S22 are also included before S104, which is specifically described through the following steps.

[0047] S20: If the data message uses the second protocol version, parse the protocol type carried in the packet header to obtain a parsing result.

[0048] In some embodiments of the present application, if the data message uses the second protocol version, i.e., the IPV6 protocol version, the protocol type carried in the packet header is parsed to determine whether the protocol type is an extended header or a preset protocol header, i.e., a layer 4 protocol header.

[0049] S21. If the parsing result indicates that the protocol type is an extension header, obtain the protocol type indicated by the next header field of the extension header.

[0050] S22: If the protocol type indicated by the next header field is an extension header, continue parsing the extension header until a preset protocol header is parsed out.

[0051] In some embodiments of the present application, when reading the fields of the IPV6 header, the "Next Header" field will display the next header type. If the "Next Header" field value corresponds to a certain extension header type, then the next header will be the extension header. When the parsing result indicates that the protocol type is an extension header, continue to read and parse the extension header, check the "Next Header" field in the extension header to determine the type of the next header, until the preset protocol header, i.e., the four-layer protocol header, is parsed.

[0052] It can be understood that in some embodiments of the present application, if the data message uses the second protocol version, the protocol type carried by the packet header corresponding to the data message is parsed to obtain the parsing result; if the parsing result indicates that the protocol type is an extension header, the protocol type indicated by the next header field of the extension header is obtained; if the protocol type indicated by the next header field is an extension header, the extension header is continued to be parsed until the preset protocol header is parsed. By parsing the protocol type of the data message packet header, it is determined whether it is an extension header or a preset protocol header to improve processing efficiency, ensure data integrity, support the implementation of network functions, and enhance network security. Through the above steps, the processing method for carrying option in the IPV4 header and carrying extension header in IPV6 is consistent with that for not carrying, and the IPV4 header option field and IPV6 extension header field can be correctly identified.

[0053] In some embodiments of the present application, S104 also includes S201 to S202, which are explained through the following steps.

[0054] S201. Parse the fragmented data messages to obtain the corresponding hop-by-hop extension headers or routing extension headers.

[0055] In some embodiments of the present application, the Hop-by-Hop Extensions are an important component of the IPv6 protocol, which allows additional processing of data packets at the IP layer without affecting the upper layer protocol. The Hop-by-Hop Extensions follow the IPv6 Basic Header and allow intermediate nodes to perform necessary processing on data packets without having to pass them to a higher network layer. The Routing Extension Header is an optional extension header defined in the IPv6 protocol, which uses the routing addresses arranged in order to identify the entire route, and the user can achieve the purpose of allowing packets to be transmitted along the same path by configuring the header.

[0056] In some embodiments of the present application, after a data message is fragmented, multiple fragmented data messages are obtained, and the fragmented data messages are further parsed to obtain a line-by-line extension header or a routing extension header corresponding to each fragmented data message.

[0057] S202: Add a fragment extension header corresponding to the fragmented data message after the hop-by-hop extension header or the routing extension header.

[0058] In some embodiments of the present application, a fragment extension header corresponding to each fragmented data packet is added after the hop-by-hop extension header or after the routing extension header. If these two extension headers do not exist, the fragment extension header is added after the IPV6 basic message header.

[0059] It can be understood that in some embodiments of the present application, the fragmented data message is parsed to obtain the corresponding hop-by-hop extension header or routing extension header; the fragment extension header corresponding to the fragmented data message is added after the hop-by-hop extension header or routing extension header. By adding the fragment extension header after the hop-by-hop extension header or routing extension header, it is clear whether the fragmented data message is a fragment message, and in the subsequent data message transmission process, the accuracy of whether the data message is a fragment message is improved, and the present application accepts any order of extension headers, and will add a fragment extension header after the non-fragmentable extension header according to the rules, and users are not restricted in use.

[0060] In some embodiments of the present application, if the data packet uses the first protocol version and meets the fragmentation conditions in S103, then after the target data packet capacity value is determined based on the maximum data packet capacity value and the Internet Protocol IP header length of the data packet, and if the data packet uses the second protocol version and the protocol header parsed from the data packet header is the first preset protocol in S104, it also includes S301 to S304, which is explained through the following steps.

[0061] S301. If the transport layer protocol of the data message is a first preset protocol, a first checksum is calculated to obtain a calculated first checksum.

[0062] In some embodiments of the present application, if the transport layer protocol of the data message is the first preset protocol, that is, the TCP / UDP protocol, the TCP / UDP checksum will be calculated, that is, the first checksum will be calculated to obtain the calculated first checksum. If the transport layer protocol of the data message is not the TCP / UDP protocol, the checksum will not be calculated, and data segmentation will be performed directly.

[0063] S302: Calculate a checksum based on a first preset protocol to obtain a calculated first checksum.

[0064] In some embodiments of the present application, if the data message uses the second protocol version and the protocol header (such as a four-layer protocol header) parsed from the packet header of the data message is the first preset protocol, that is, the TCP / UDP protocol, a checksum calculation is performed to obtain the calculated first checksum. If the parsed protocol header is not the first preset protocol, that is, it is not the TCP / UDP protocol, the data is directly fragmented.

[0065] It is understandable that in some embodiments of the present application, by determining whether the transport layer protocol of the data message is the first preset protocol or the protocol header parsed from the packet header of the data message is the first preset protocol, it is determined whether to perform the checksum calculation, thereby ensuring the integrity of the data transmission process. And the present application covers the checksum unloading of TCP messages and UDP messages of IPv4 and IPv6.

[0066] In some embodiments of the present application, the data packet is fragmented based on the target data packet capacity value in S102 to obtain fragmented data packets, and the data packet is fragmented based on the target data packet capacity value in S103 to obtain fragmented data packets. This can be achieved through S401 to S403, which is specifically explained through the following steps.

[0067] S401. Recalculate the network layer checksum for each fragmented data message to obtain a second checksum corresponding to each fragmented data message.

[0068] In some embodiments of the present application, the network layer checksum, i.e., the IP layer checksum, is a field in the IP data packet header, which is used to detect any damage or change to the IP data packet header during transmission. The network layer checksum is recalculated for each of the fragmented data packets to obtain a second checksum corresponding to each of the fragmented data packets, i.e., the IP layer checksum.

[0069] S402: Fill the second checksum and the first checksum into their corresponding first data messages respectively to obtain the filled first data messages.

[0070] S403: Fill the second checksums into the corresponding second data messages respectively to obtain the filled second data messages.

[0071] In some embodiments of the present application, after the data message is fragmented to obtain the fragmented data message, the first checksum, i.e., the TCP / UDP checksum, and the second checksum, i.e., the IP layer checksum, are filled into the first data message in the fragmented data message, i.e., the first data message, to obtain the filled first data message. The second checksum is respectively filled into the other data messages except the first data message to obtain the filled second data message.

[0072] Exemplarily, after the IPv4 data packet is fragmented, a first data packet, a second data packet, a third data packet, etc. are obtained. The TCP / UDP checksum and the IP layer checksum are filled into the first data packet, and the IP layer checksum is filled into the second data packet, the third data packet, etc., except the first data packet.

[0073] S304: Transmit the filled first data message and the filled second data message through a data transmission unit.

[0074] In some embodiments of the present application, if the message lengths of the filled first data message and the filled second data message are less than the set MTU, the filled first data message and the filled second data message are transmitted through the data transmission unit.

[0075] It can be understood that in some embodiments of the present application, the calculated first checksum and second checksum are filled in the first data message, and the second checksum is filled in other data messages, ensuring the integrity and accuracy of the fragmented data messages in the subsequent transmission process.

[0076] In some embodiments of the present application, S101 also includes S401, which will be specifically described through the following steps.

[0077] S401. When calculating a target data message capacity value, the data message is stored in a buffer pool.

[0078] In some embodiments of the present application, when calculating the MTU value, the data packet is stored in the buffer pool and waits. If it is a TCP / UDP protocol, the TCP / UDP checksum is calculated, and no checksum is calculated for other protocol packets. After confirming the offload capability and calculating the TCP / UDP checksum, the data packet is read from the buffer pool and IP fragmentation is performed according to the offload capability.

[0079] Combining the above steps, such as Figure 3 As shown, Figure 3 A schematic diagram of IP fragmentation offloading state jump provided in an embodiment of the present application. Figure 3The state includes the idle state (state_idle), which indicates that the system is in a static or waiting state. That is, the system is not performing any specific tasks or operations at this time, but is waiting for external events or triggers to change its state; the Ethernet Internet Protocol (IP) state (i.e., state_eth_ip), which indicates the state of processing Ethernet frames and extracting IP data packets, that is, the system is parsing the header of the Ethernet frame and preparing to process the IP data packets contained therein; judging whether to perform IP fragmentation by processing the Ethernet frame and extracting the IP data packets, when data fragmentation is not required, jumping to the ignore state, and when data fragmentation is required, jumping to the Internet Protocol (IP) option state (i.e., state_ip_option), which indicates that the system is parsing the IPv6 extension header or processing the IPv6 option state. That is, the system is processing the extension header or option field in the IPv6 data packet; the transport layer header state (i.e., state_tp_header), which indicates that the system is parsing the transport layer protocol header. That is, the system is processing the header information of TCP (Transmission Control Protocol), UDP (User Datagram Protocol) or other transport layer protocols; Payload state (i.e. state_payload), indicating that the system is processing the state of the payload. That is, the system has completed the parsing of the packet header and is ready to process the actual data in the packet; Ethernet Internet Protocol (IP) fragmentation state (i.e. state_frag_eth_ip), indicating that the system is processing the state of the fragmented IP data packet contained in the Ethernet frame, that is, the system is processing an Ethernet frame that contains one or more fragmented IP data packets; IP fragment processing option state (i.e. state_frag_ip_option), indicating that the system is processing fragmented IPv6 data packets and is parsing or processing the extension headers in these fragmented data packets. Fragment load state (i.e. state_frag_payload), used to describe a specific stage when processing fragmented data packets, indicating that the device is processing the payload part of the fragment.

[0080] It can be understood that in some embodiments of the present application, when calculating the target data packet capacity value, the data packets are stored in a cache pool, which enables the processor to process the data fragments subsequently, reduces waiting time, and improves system performance.

[0081] The present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method provided in any of the above embodiments when executing the program.

[0082] The present application also provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method provided in any of the above embodiments is implemented.

[0083] Reference Figure 4 , shows a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.

[0084] like Figure 4 As shown, the electronic device may include: a processor (processor) 1002 , a communication interface (Communications Interface) 1004 , a memory (memory) 1006 , and a communication bus 1008 .

[0085] in:

[0086] The processor 1002 , the communication interface 1004 , and the memory 1006 communicate with each other via a communication bus 1008 .

[0087] The communication interface 1004 is used to communicate with other electronic devices or servers.

[0088] The processor 1002 is used to execute the program 1010, and specifically can execute the relevant steps in the above method embodiment.

[0089] Specifically, the program 1010 may include program codes, which include computer operation instructions.

[0090] The processor 1002 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0091] The memory 1006 is used to store the program 1010. The memory 1006 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0092] The program 1010 may be specifically used to enable the processor 1002 to execute operations corresponding to the methods described in the above method embodiments.

[0093] The specific implementation of each step in program 1010 can refer to the corresponding description of the corresponding steps and units in the above method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above method embodiment, which will not be repeated here.

[0094] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.

[0095] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a special-purpose processor or programmable or special-purpose hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown here, the execution of the code converts the general-purpose computer into a special-purpose computer for executing the method shown here.

[0096] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.

[0097] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.

Claims

1. A data slicing method based on DPU, characterized in that: Applicable to DPU network cards, including: Obtain the maximum data message capacity value set by the data transmission unit through which the data message is to pass; If the data message uses the first protocol version and meets the fragmentation condition, a target data message capacity value is determined according to the maximum data message capacity value and the Internet Protocol IP header length of the data message; and the data message is fragmented based on the target data message capacity value to obtain fragmented data messages; If the data message uses the second protocol version and the protocol header parsed from the packet header of the data message is the first preset protocol, the target data message capacity value is determined based on the total length of the extended header parsed from the packet header and the maximum data message capacity value, and the data message is fragmented based on the target data message capacity value to obtain fragmented data messages.

2. The method according to claim 1, characterized in that If the data message uses the first protocol version and meets the fragmentation condition, determining the target data message capacity value according to the maximum data message capacity value and the Internet Protocol IP header length of the data message, including: When the data message uses the first protocol version, obtaining key fields of the data message during transmission; When it is determined through the key field that the data message meets the fragmentation condition, determining the target data message capacity value according to the maximum data message capacity and the IP header length corresponding to the data message; When it is determined through the key field that the data message does not meet the fragmentation condition, the data message is not fragmented.

3. The method according to claim 1, characterized in that If the data message uses the first protocol version and meets the fragmentation condition, before determining the target data message capacity value according to the maximum data message capacity value and the Internet Protocol IP header length of the data message, the method also includes: The Ethernet type value corresponding to the data message is parsed to obtain the protocol version used by the data message.

4. The method according to claim 1, characterized in that: If the data message uses the second protocol version and the protocol header parsed from the packet header of the data message is the first preset protocol, the method further includes: If the data message uses the second protocol version, parsing the protocol type carried in the packet header corresponding to the data message to obtain a parsing result; If the parsing result indicates that the protocol type is an extension header, obtaining the protocol type indicated by the next header field of the extension header; If the protocol type indicated by the next header field is an extension header, the extension header is continuously parsed until the preset protocol header is parsed out.

5. The method according to claim 1, characterized in that If the data message uses the second protocol version and the protocol header parsed from the packet header of the data message is the first preset protocol, a target data message capacity value is determined according to the total length of the extended header parsed from the packet header and the maximum data message capacity value, and the data message is fragmented based on the target data message capacity value. After obtaining the fragmented data message, the method further includes: Parsing the fragmented data packets to obtain corresponding hop-by-hop extension headers or routing extension headers; The fragment extension header corresponding to the fragmented data message is added after the hop-by-hop extension header or the routing extension header.

6. The method according to claim 1 or 2, characterized in that: If the data message uses the first protocol version and meets the fragmentation condition, after determining the target data message capacity value according to the maximum data message capacity value and the Internet Protocol IP header length of the data message, the method further includes: If the transport layer protocol of the data message is the first preset protocol, a first checksum is calculated to obtain a calculated first checksum; If the data message uses the second protocol version and the protocol header parsed from the packet header of the data message is the first preset protocol, the method further includes: A checksum is calculated based on the first preset protocol to obtain a calculated first checksum.

7. The method according to claim 1 or 6, characterized in that: After the data message is fragmented based on the target data message capacity value to obtain the fragmented data message, the method further includes: Recalculating the network layer checksum for each of the fragmented data messages to obtain a second checksum corresponding to each of the fragmented data messages; Filling the second checksum and the first checksum into the first data message to obtain the filled first data message; Filling the second checksums into the second data messages corresponding to the respective ones to obtain the filled second data messages; The filled first data message and the filled second data message are transmitted through the data transmission unit; wherein the first data message is the first data message in the fragmented data message; the second data message is the other data messages in the fragmented data message except the first data message.

8. The method according to any one of claims 1 to 7, characterized in that: After obtaining the maximum data message capacity value set by the data transmission unit through which the data message is to pass, the method further includes: When the target data packet capacity value is calculated, the data packet is stored in a buffer pool.

9. An electronic device, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method as described in any one of claims 1-8.

10. A computer storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Message generation verification method, device, system, equipment, cluster, medium and product

    CN119363858A