Message fragmentation method and device based on TOFINO switch

By using the mirror function to copy and process packets on the Tofino chip, the defects of the Tofino chip in processing sharded packets are solved, and the performance and reliability of network communication are improved.

CN119814712APending Publication Date: 2025-04-11CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411776797.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The Tofino chip has defects in processing sharded packets, resulting in increased network load and latency, reducing network performance and reliability.

Method used

The mirror function is used to copy the original message, generate the copied message as the first slice of the shard, and the original message as the second slice, and forward the processed shard through the Tofino chip.

Benefits of technology

By utilizing the mirror and advance mechanism of the Tofino chip, the sharded packets are directly processed, which solves the shortcomings of the gateway equipment in processing sharded packets and improves the performance and reliability of network communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814712A_ABST
    Figure CN119814712A_ABST
Patent Text Reader

Abstract

The invention provides a message fragmentation method and device based on a TOFINO switch. The method comprises the following steps: acquiring an original message; the original message is copied through adoption of a mirror function, a copied message is generated, the copied message is used as a first slice of a slice, and the original message is used as a second slice; respectively processing the original message and the copied message to obtain a processed fragment; according to the embodiment of the invention, the method can directly process the fragmented message through the mirror and advance mechanism of the Tofino chip, thereby solving the defects of the current gateway equipment in the aspect of processing the fragmented message, and improving the performance and reliability of network communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a message fragmentation method and device based on a Tofino switch. Background Art

[0002] In the field of network communication, the gateway is an important device that can connect different networks and realize the forwarding and processing of data packets. The fragmentation function is one of the basic functions of the gateway, which can divide a large data packet into multiple smaller data packets for transmission. However, if the Tofino chip is used as the forwarding chip of the gateway, there is a lack of a dedicated fragmentation module to process fragmented messages. The Tofino chip is a fully programmable switch chip with high performance and certain flexibility, but it has certain defects in processing fragmented messages. Although the existing function combination can be used to complete the function of message fragmentation, this will increase the network load and delay, thereby reducing the performance and reliability of the network. Therefore, it is necessary to seek a fragmentation processing method to solve the defects of the current gateway device in processing fragmented messages and improve the performance and reliability of network communications. Summary of the invention

[0003] The present application shows a message fragmentation method and device based on a Tofino switch.

[0004] In a first aspect, the present application shows a message fragmentation method based on a Tofino switch, the method comprising:

[0005] Get the original message;

[0006] The original message is copied using a mirror function to generate a copied message, wherein the copied message is used as the first fragment and the original message is used as the second fragment;

[0007] The original message and the copied message are processed respectively to obtain processed fragments;

[0008] The processed fragments are forwarded by the Tofino chip.

[0009] Optionally, the processing of the copied message includes: configuring a maximum message length of a Mirror session, wherein the maximum message length is used to truncate the tail of the mirror-copied message;

[0010] The copied message is processed according to the preset MF flag and the first truncation length to obtain a first fragment message.

[0011] Optionally, the processing the original message includes:

[0012] The original message is fragmented according to the offset and the second interception length to obtain second fragmented messages.

[0013] Optionally, the method further comprises:

[0014] The size, protocol type, destination address and source address of the original message are judged and analyzed to determine whether the original message needs to be fragmented.

[0015] Optionally, the method further comprises:

[0016] The first fragment message and the second fragment message are verified and judged to judge the integrity of the message.

[0017] In a second aspect, the present application shows a message fragmentation device based on a Tofino switch, the device comprising:

[0018] An acquisition module is used to obtain the original message;

[0019] A replication module, used to replicate the original message using a mirror function to generate a replicated message, wherein the replicated message is used as the first fragment of the fragmentation, and the original message is used as the second fragment;

[0020] A processing module, used for processing the original message and the copied message respectively to obtain processed fragments;

[0021] The sending module is used to forward the processed fragments through the Tofino chip.

[0022] Optionally, the processing module is used to:

[0023] Configure the maximum message length of the mirror session. The maximum message length is used to truncate the tail of the mirrored message.

[0024] The copied message is processed according to the preset MF flag and the first truncation length to obtain a first fragment message.

[0025] Optionally, the processing module is used to:

[0026] The original message is fragmented according to the offset and the second interception length to obtain second fragmented messages.

[0027] Optionally, the processing module is used to:

[0028] The size, protocol type, destination address and source address of the original message are judged and analyzed to determine whether the original message needs to be fragmented.

[0029] Optionally, the processing module is used to:

[0030] The first fragment message and the second fragment message are verified and judged to judge the integrity of the message.

[0031] In a third aspect, the present application shows an electronic device, which includes: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the method described in any of the above aspects.

[0032] In a fourth aspect, the present application illustrates a non-temporary computer-readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute a method as described in any of the above aspects.

[0033] In a fifth aspect, the present application illustrates a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in any of the above aspects.

[0034] The technical solution provided by the present application may include the following beneficial effects: the message fragmentation method and device based on the Tofino switch provided in the embodiment of the present application include: obtaining the original message; using the mirror function to copy the original message to generate a copied message, wherein the copied message is used as the first fragment of the fragment, and the original message is used as the second fragment; processing the original message and the copied message respectively to obtain processed fragments; forwarding the processed fragments through the Tofino chip. The embodiment of the present application can utilize the mirror and advance mechanisms of the Tofino chip to directly process the fragmented messages to solve the defects of the current gateway device in processing fragmented messages, and improve the performance and reliability of network communications. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is a flow chart of the steps of a message fragmentation method based on a Tofino switch of the present application.

[0036] Figure 2 It is a schematic diagram of message fragmentation of the present application.

[0037] Figure 3 It is a schematic diagram of message fragmentation of the present application.

[0038] Figure 4 This is a structural block diagram of a message fragmentation device based on a Tofino switch of the present application.

[0039] Figure 5 It is a block diagram of an electronic device of the present application.

[0040] Figure 6 It is a block diagram of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0042] Glossary:

[0043] Mirror refers to the mirroring technology, which can be used to copy the data of the original website to ensure data redundancy and reliability.

[0044] Mirror session usually refers to the process of communicating between two or more devices in a mirror mode in network communication. In this mode, all messages sent to the primary device are copied and sent to the backup device, ensuring that the backup device can receive the same data as the primary device. This mode is often used in high availability and failover scenarios to ensure that when the primary device fails, the backup device can quickly take over to ensure service continuity.

[0045] In an IP datagram, MF stands for More Fragment, which means there are more fragments.

[0046] In the field of network communication, the gateway is an important device that can connect different networks and realize the forwarding and processing of data packets. The fragmentation function is one of the basic functions of the gateway, which can divide a large data packet into multiple smaller data packets for transmission. However, if the Tofino chip is used as the forwarding chip of the gateway, there is a lack of a dedicated fragmentation module to process fragmented messages. The Tofino chip is a fully programmable switch chip with high performance and certain flexibility, but it has certain defects in processing fragmented messages. Although the existing function combination can be used to complete the function of message fragmentation, this will increase the network load and delay, thereby reducing the performance and reliability of the network. Therefore, it is necessary to seek a fragmentation processing method to solve the defects of the current gateway device in processing fragmented messages and improve the performance and reliability of network communications.

[0047] When x86 is used as a gateway, message fragmentation is a common requirement. However, when Tofino is used as a gateway, the chip itself does not have the fragmentation capability, resulting in a lack of functionality when replacing the x86 gateway. This application proposes a solution to supplement Tofino's fragmentation capability so that it does not become a missing function item and expands the scope of use of Tofino.

[0048] The present application provides a message fragmentation method and device based on a Tofino switch. The present application scheme is described in detail below in conjunction with the accompanying drawings.

[0049] Reference Figure 1 , shows a flow chart of the steps of a message fragmentation method based on a Tofino switch of the present application, which can be applied to an electronic device, wherein the method can specifically include the following steps:

[0050] S101, obtaining the original message;

[0051] Message fragmentation identification: This module uses the high-performance processing capabilities of the Tofino switch to quickly identify messages that need to be fragmented. It can judge and analyze key information such as the size, protocol type, destination address, and source address of the message to determine whether the message needs to be fragmented.

[0052] Tofino is a programmable chip developed by Barefoot Networks, mainly used in network equipment. The Tofino chip has extremely high processing power and can achieve line rate processing of up to 6.5Tbps, which makes it perform well in network equipment. The core feature of the Tofino chip is its programmability. The application scenarios of the Tofino chip are very wide, especially in data centers and cloud computing environments. Due to its high performance and flexibility, Tofino chips are widely used in devices such as Ethernet switches and routers to help improve the overall performance and efficiency of the network. In short, the Tofino chip plays an important role in network equipment with its high performance and programmability, especially in data centers and cloud computing environments, and its application prospects are very broad. Tofino can be used to separate the security system network from the process system network, and realize the physical isolation of critical systems from non-critical systems.

[0053] The Tofino switch of the present application is a programmable switching chip based on the P4 programming language, developed by Barefoot Networks. The main feature of the Tofino switch is its flexible P4 programmability, which enables network builders to perform better switching and routing in the network, including efficient load balancing.

[0054] S102, using the mirror function to copy the original message to generate a copied message, wherein the copied message is used as the first fragment, and the original message is used as the second fragment;

[0055] Message replication: Use the Tofino switch's Pre module to replicate the original message multiple times so that each message can be processed differently. The replicated messages can be processed differently at the same time, and different fragmentation processing methods will not affect each other, thereby improving processing efficiency and accuracy.

[0056] S103, processing the original message and the copied message respectively to obtain processed fragments;

[0057] Message fragmentation: It performs different fragmentation processing on the copied message, such as calculating according to parameters such as message size and MTU, and adding information such as fragment header and fragment sequence number. It can also perform checksum and other operations on the fragmented data to ensure the integrity and correctness of the data.

[0058] S104. Forward the processed fragments through the Tofino chip.

[0059] The message fragmentation method based on the Tofino switch provided in the embodiment of the present application includes: obtaining the original message; using the mirror function to copy the original message to generate a copied message, wherein the copied message is used as the first fragment of the fragmentation, and the original message is used as the second fragment; processing the original message and the copied message respectively to obtain processed fragments; forwarding the processed fragments through the Tofino chip. The embodiment of the present application can use the mirror and advance mechanisms of the Tofino chip to directly process the fragmented message to solve the defects of the current gateway device in processing the fragmented message, and improve the performance and reliability of network communication.

[0060] Another embodiment of the present application further supplements the message fragmentation method based on the Tofino switch provided in the above embodiment.

[0061] In one implementation, the copied message may be processed in the following manner: configure the maximum message length of Mirrorsession, the maximum message length being used to truncate the tail of the mirror-copied message; and process the copied message according to a preset MF flag and a first truncation length to obtain a first fragment message.

[0062] It should be noted that

[0063] 1. Configure the maximum message length of the Mirror session to implement "tail truncation" of the mirrored message;

[0064] 2.IP.flags sets the MF flag;

[0065] 3. IP.total_length is set to 420;

[0066] At this point, the first piece of the message has taken shape. By truncating the tail, it becomes a shorter message. In the subsequent pipeline, the checksum will be calculated uniformly and the relevant outer header will be encapsulated.

[0067] In some specific embodiments, the original message may be processed in the following manner: the original message is fragmented according to the offset and the second truncation length to obtain second fragmented messages.

[0068] Specifically, the second shard is processed as follows:

[0069] 1. P0-parser uses advance() to remove the header of the message;

[0070] 2. Set IP.offset;

[0071] 3. IP.total_length minus 400;

[0072] At this point, the second message fragment is also basically modified, and the payload header of the message is shortened to become a shorter message. Similarly, in the subsequent pipeline, the checksum will be uniformly calculated and the relevant outer header will be encapsulated. In some embodiments of the present application, the method further includes: judging and analyzing the size, protocol type, destination address and source address key information of the original message to determine whether the original message needs to be fragmented.

[0073] In some embodiments of the present application, the method further includes: verifying and judging the first fragment message and the second fragment message to judge the integrity of the message.

[0074] The present invention provides a message fragmentation method based on a Tofino switch, aiming to improve the efficiency and performance of network communication. The method utilizes the message duplication capability of a Tofino chip to duplicate multiple copies of an original message, and then performs different fragmentation processing on each copy of the message, and finally forwards all fragmented messages through the Tofino chip. The method utilizes the pipeline architecture, pre and other designs of the Tofino chip to achieve efficient message fragmentation and forwarding, thereby improving the throughput and performance of the network. The advantages of the present invention are that the method can effectively solve the message fragmentation problem in network communication, improve the reliability and stability of the network, and has great application prospects and commercial value.

[0075] The purpose of this application is to solve the defects in processing fragmented messages when using Tofino as a gateway device. Currently, most forwarding gateways use x86 architecture, but they have certain limitations in performance and reliability. In order to improve the performance and reliability of network communications, some network service providers have begun to use the fully programmable switch chip Tofino to replace some software forwarding gateways.

[0076] At the same time, in actual applications, new network elements are deployed in the original network nodes in an updated manner. In software forwarding gateways, sharding is a common function, and the entire network will not make large-scale modifications to the sharding function due to the use of Tofino chips, so there is no need for sharding in the intermediate nodes of the network, so sharding is an essential function.

[0077] However, the Tofino chip lacks a dedicated fragmentation module to process fragmented messages, which makes it impossible to use the Tofino chip to replace x86 software forwarding in some scenarios. Therefore, the purpose of the invention is to propose a fragmentation processing method based on Tofino, which can directly process fragmented messages through the existing Tofino mirror and advance mechanisms, thereby making up for this functional defect.

[0078] Specifically, the goal of the embodiment of the present application is to develop a new fragmentation processing method that can directly process fragmented messages by utilizing the mirror and advance mechanisms of the Tofino chip. The embodiment of the present application will study and optimize the algorithm and process of this method so that it can adapt to different network environments and load conditions, and improve the efficiency and accuracy of processing fragmented messages. Through this new fragmentation processing method, the embodiment of the present application aims to solve the limitation that the Tofino chip cannot process fragmented messages, improve the performance and reliability of network communications, and contribute to the development of network communication technology.

[0079] The function set of the Tofino chip is composed of programmable modules and fixed modules. The functions of the programmable modules include parsing, matching and modifying data packets; the fixed modules are relatively independent functions, including counters, meters, mirror, multicast and other functions.

[0080] The Mirror function is a fixed module. Its function is to copy the original message into two copies. It is mainly used in scenarios where mirroring is required. Modifying or offsetting any one of the messages will not have any impact on the other message. At the same time, the Mirror function also supports the configuration of the MaxLength of the message, because in most cases the mirror message only cares about the message header, so the length of the message can be set, and the long message can be cut into short messages from the tail.

[0081] The Advance function is a common step in message processing and is a programmable module. Its function is to offset the message header pointer and is used to reduce or increase message header information between multiple layers of message headers.

[0082] like Figure 2 and Figure 3 As shown, the large packet fragmentation function is realized by utilizing the combination of the mirror+advance function in the P4 chip. First, the mirror function is used to copy the message into two pieces. The copied message is used for the first piece of the fragmentation, and the original message is used for the second piece.

[0083] In some preferred embodiments, the first slice of the shard is processed as follows:

[0084] 1. Configure the maximum message length of the Mirror session to implement "tail truncation" of the mirrored message;

[0085] 2.IP.flags sets the MF flag;

[0086] 3. IP.total_length is set to 420;

[0087] At this point, the first piece of the message has taken shape. By truncating the tail, it becomes a shorter message. In the subsequent pipeline, the checksum will be calculated uniformly and the relevant outer header will be encapsulated.

[0088] How to handle the second shard:

[0089] 1. P0-parser uses advance() to remove the header of the message;

[0090] 2. Set IP.offset;

[0091] 3. IP.total_length minus 400;

[0092] At this point, the second message has been basically modified. By truncating the header of the message payload, it becomes a shorter message. Similarly, in the subsequent pipeline, the checksum will be calculated uniformly and the relevant outer header will be encapsulated.

[0093] It is understandable that the combination of Tofino's existing functions was cleverly used to complete the ability it originally did not have, splitting a long message into two shorter messages.

[0094] The embodiment of the present application utilizes the programmability of the Tofino switch: the Tofino switch is a programmable switch that can implement customized network functions by writing a P4 program. The message fragmentation processing method of the present invention fully utilizes the programmability of the Tofino switch, implements the message fragmentation processing function by writing a P4 program, and solves some problems of the traditional fragmentation processing method.

[0095] High-performance message fragmentation processing is achieved: the message fragmentation processing method of the present invention is implemented based on the Tofino switch and has the advantage of high performance.

[0096] In contrast, traditional sharding methods require running software programs on the host, which is constrained by the performance and resource limitations of the host and cannot meet high performance requirements.

[0097] Solve the defects of the traditional fragmentation processing method: the traditional fragmentation processing method needs to run a software program on the host, which is easy to cause large delays and affect the reliability and stability of the network. The message fragmentation processing method of the present invention can be implemented on the switch, avoiding these problems and improving the reliability and stability of the network.

[0098] The message fragmentation processing method of the embodiment of the present application is implemented based on the Tofino switch and has the advantage of high performance. In contrast, the traditional fragmentation processing method requires running a software program on the host, which is subject to the performance and resource limitations of the host and cannot meet the requirements of high performance. Low latency, the message fragmentation processing method of the present application can be processed on the switch, so the requirements of low latency can be achieved. The traditional fragmentation processing method needs to be processed on the host, and needs to go through steps such as network transmission, which is prone to large delays.

[0099] The message fragmentation method and device based on the Tofino switch provided in the embodiment of the present application include: obtaining the original message; using the mirror function to copy the original message to generate a copied message, wherein the copied message is used as the first fragment of the fragmentation, and the original message is used as the second fragment; processing the original message and the copied message respectively to obtain processed fragments; forwarding the processed fragments through the Tofino chip. The embodiment of the present application can use the mirror and advance mechanism of the Tofino chip to directly process the fragmented message to solve the defects of the current gateway device in processing the fragmented message, and improve the performance and reliability of network communication.

[0100] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any combination without conflict, and this application is not limited thereto.

[0101] Another embodiment of the present application provides a message fragmentation device based on a Tofino switch, which is used to execute the message fragmentation method based on a Tofino switch provided in the above embodiment.

[0102] After describing the method embodiment provided in the present application, the message fragmentation device based on the Tofino switch provided in the present application is described.

[0103] like Figure 4 , which is a schematic diagram of the structure of a message fragmentation device based on a Tofino switch provided in an embodiment of the present application. The message fragmentation device based on a Tofino switch includes an acquisition module 401, a replication module 402, a processing module 403 and a sending module 404, wherein:

[0104] The acquisition module 401 is used to acquire the original message;

[0105] The copy module 402 is used to copy the original message using the mirror function to generate a copied message, wherein the copied message is used as the first fragment and the original message is used as the second fragment;

[0106] The processing module 403 is used to process the original message and the copied message respectively to obtain processed fragments;

[0107] The sending module 404 is used to forward the processed fragments through the Tofino chip.

[0108] Regarding the device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0109] The message fragmentation device based on the Tofino switch provided in the embodiment of the present application includes: obtaining the original message; using the mirror function to copy the original message to generate a copied message, wherein the copied message is used as the first fragment of the fragmentation, and the original message is used as the second fragment; processing the original message and the copied message respectively to obtain processed fragments; forwarding the processed fragments through the Tofino chip. The embodiment of the present application can use the mirror and advance mechanism of the Tofino chip to directly process the fragmented message to solve the defects of the current gateway device in processing the fragmented message, and improve the performance and reliability of network communication.

[0110] Another embodiment of the present application further supplements the message fragmentation device based on the Tofino switch provided in the above embodiment.

[0111] Among them, first, module 403 is used to configure the maximum message length of the Mirror session, and the maximum message length is used to truncate the tail of the mirror-copied message; according to the pre-set MF flag and the first truncation length, the copied message is processed to obtain a first fragmented message. Secondly, the processing module 403 is used to fragment the original message according to the offset and the second truncation length to obtain a second fragmented message. Thirdly, the processing module 403 is used to judge and analyze the size, protocol type, destination address and source address key information of the original message to determine whether it is necessary to fragment the original message; finally, the processing module 403 is used to verify and judge the first fragmented message and the second fragmented message to judge the integrity of the message.

[0112] The message fragmentation method and device based on the Tofino switch provided in the embodiment of the present application include: obtaining the original message; using the mirror function to copy the original message to generate a copied message, wherein the copied message is used as the first fragment of the fragmentation, and the original message is used as the second fragment; processing the original message and the copied message respectively to obtain processed fragments; forwarding the processed fragments through the Tofino chip. The embodiment of the present application can use the mirror and advance mechanism of the Tofino chip to directly process the fragmented message to solve the defects of the current gateway device in processing the fragmented message, and improve the performance and reliability of network communication.

[0113] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0114] Optionally, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0115] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0116] Figure 5800 is a block diagram of an electronic device 800 shown in the present application. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0117] Reference Figure 5 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0118] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0119] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, images, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0120] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.

[0121] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0122] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0123] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0124] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0125] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast operation information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0126] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0127] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0128] Figure 6 19 is a block diagram of a computer-readable storage medium 1900 shown in the present application. For example, the computer-readable storage medium 1900 may be provided as a server.

[0129] Reference Figure 6 , the computer-readable storage medium 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as an application, that can be executed by the processing component 1922. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0130] The computer readable storage medium 1900 may also include a power supply component 1926 configured to perform power management of the computer readable storage medium 1900, a wired or wireless network interface 1950 configured to connect the computer readable storage medium 1900 to a network, and an input / output (I / O) interface 1958. The computer readable storage medium 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0131] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0132] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0133] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0134] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application 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 this application.

[0135] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0136] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0137] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0138] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0139] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.

[0140] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A message fragmentation method based on Tofino switch, characterized in that: The method comprises: Get the original message; The mirror can be used to copy the original message to generate a copied message, wherein the copied message is used as the first fragment and the original message is used as the second fragment; Processing the original message and the copied message respectively to obtain processed fragments; The processed fragments are forwarded by the Tofino chip.

2. The message fragmentation method based on Tofino switch according to claim 1 is characterized in that: The processing of the copied message includes: Configure the maximum message length of the mirror session. The maximum message length is used to truncate the tail of the mirrored message. The copied message is processed according to the preset MF flag and the first truncation length to obtain a first fragment message.

3. The message fragmentation method based on Tofino switch according to claim 2 is characterized in that: The processing of the original message includes: The original message is fragmented according to the offset and the second interception length to obtain second fragmented messages.

4. The message fragmentation method based on Tofino switch according to claim 1 is characterized in that: The method further comprises: The size, protocol type, destination address and source address of the original message are judged and analyzed to determine whether the original message needs to be fragmented.

5. The message fragmentation method based on Tofino switch according to claim 3 is characterized in that: The method further comprises: The first fragment message and the second fragment message are verified and judged to judge the integrity of the message.

6. A message fragmentation device based on Tofino switch, characterized in that: The device comprises: An acquisition module is used to obtain the original message; A copy module, used to copy the original message by using a mirror function to generate a copied message, wherein the copied message is used as the first fragment and the original message is used as the second fragment; A processing module, used for processing the original message and the copied message respectively to obtain processed fragments; The sending module is used to forward the processed fragments through the Tofino chip.

7. The message fragmentation device based on Tofino switch according to claim 6, characterized in that: The processing module is used for: Configure the maximum message length of the mirror session. The maximum message length is used to truncate the tail of the mirrored message. The copied message is processed according to the preset MF flag and the first truncation length to obtain a first fragment message.

8. The message fragmentation device based on Tofino switch according to claim 6, characterized in that: The processing module is used for: The original message is fragmented according to the offset and the second interception length to obtain second fragmented messages.

9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the method according to any one of claims 1 to 5 when executed by the processor.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.