Ethernet data sending and receiving processing method and device and switch chip architecture
By simplifying the preamble, MAC field, and IPSA/IPDA field of Ethernet packets, efficient data transmission in small packet scenarios is achieved, solving the problem of heavy protocol header overhead in traditional Ethernet and improving network transmission efficiency.
Patent Information
- Application Number
- CN202511425627.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2025-12-12
AI Technical Summary
The heavy overhead of the protocol header in traditional Ethernet leads to low forwarding efficiency of the payload, which affects network transmission efficiency, especially in small packet scenarios.
By identifying the payload or overall size of the data packet, either the first mode or the second mode is selected for data packet transmission and reception. In the first mode, the preamble, MAC field, and cyclic redundancy check (CRC) code at the end of the frame are simplified, and the IPSA and IPDA fields are simplified at the network layer; in the second mode, the traditional Ethernet message format is used.
In small packet scenarios, the payload ratio and forwarding efficiency are increased, improving network transmission efficiency, while also ensuring compatibility in large packet scenarios. The payload forwarding efficiency is increased from 50% and 20% of traditional Ethernet to 65% and 70%, respectively.
Smart Images

Figure CN121125886A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to computer network communication technology, and in particular to an Ethernet data transmission and reception processing method and apparatus, as well as a switch chip architecture. Background Technology
[0002] Ethernet is currently the most widely used local area network (LAN) technology. For 50 years since its inception, Ethernet has never been replaced; instead, it has survived and evolved, finding widespread application in almost all digital device environments, greatly facilitating people's lives and promoting social progress.
[0003] The IEEE 802.3 standard, developed by the IEEE, defines the technical standard for Ethernet, including physical layer wiring, electronic signals, and media access layer protocols. Traditional Ethernet can generally be broken down into five main layers at the network protocol level: physical layer, data link layer, network layer, transport layer, and application layer. However, in traditional Ethernet, the heavy overhead of the protocol header leads to low payload forwarding efficiency, affecting network transmission efficiency. Summary of the Invention
[0004] The technical problem to be solved by the embodiments of the present invention is how to improve the data transmission efficiency of Ethernet.
[0005] To address the aforementioned issues, the technical solution provided by this invention is as follows: Based on the payload or overall size of the data packet, a preamble is set to a preset value to distinguish data packets transmitted in either the first or second mode. In the first mode, the preamble field in the simplified physical layer encapsulation format is set to the preset value, and the MAC field and cyclic redundancy check (CRC) code in the link layer encapsulation format are removed. In the second mode, the traditional Ethernet message format is adopted.
[0006] Optionally, in the above Ethernet data transmission method, the step of forwarding data packets based on the payload or overall size of the data packets includes: when the payload of the data packets is less than or equal to 32 bytes, or the overall length of the data packets is less than or equal to 64 bytes, the first mode is used to forward the data packets; otherwise, the second mode is used to forward the data packets.
[0007] Optionally, in the above Ethernet data transmission method, the first mode further includes: a 16-bit preset Source ID and Dest ID for the IPSA field and IPDA field in the simplified network layer encapsulation format; wherein the Source ID and Dest ID are preset identifiers of the source device and the destination device, respectively.
[0008] To address the aforementioned technical problems, this embodiment also discloses an Ethernet data receiving and processing method, comprising: receiving a data packet sent by the Ethernet data sending method described above; identifying whether the preamble field in the data packet is a preset value to determine whether the data packet is a data packet forwarded in a first mode or a data packet forwarded in a second mode; decapsulating and parsing the data packet forwarded in the first mode according to the decapsulation rules corresponding to the first mode; or decapsulating the data packet forwarded in the second mode according to the decapsulation rules corresponding to the second mode and according to traditional Ethernet decapsulation rules.
[0009] Optionally, in the aforementioned Ethernet data transmission device, the decapsulation rule corresponding to the first mode includes: skipping the MAC layer 2 header processing flow and forwarding the chip pipeline.
[0010] To address the aforementioned technical problems, this embodiment also discloses an Ethernet data transmission device, comprising: a first identification module for identifying the payload or overall size of a data packet; a first processing module for selecting, based on the identification result of the identification module, to set a preamble to a preset value as a distinguishing identifier for transmitting data packets in a first mode or a second mode; in the first mode, simplifying the preamble field in the physical layer encapsulation format to the preset value, and deleting the MAC field and cyclic redundancy check (CRC) code in the link layer encapsulation format; in the second mode, employing the traditional Ethernet message format.
[0011] Optionally, in the aforementioned Ethernet data transmission device, the first processing module forwards data packets using the first mode when the data packet payload is less than or equal to 32 bytes, or when the overall length of the data packet is less than or equal to 64 bytes; otherwise, it forwards data packets using the second mode.
[0012] Optionally, in the aforementioned Ethernet data transmission device, the first processing module is further configured to simplify the IPSA field and IPDA field in the network layer encapsulation format to 16-bit preset Source ID and Dest ID; wherein the Source ID and Dest ID are preset identifiers of the source device and the destination device, respectively.
[0013] To address the aforementioned technical problems, this embodiment also discloses an Ethernet data receiving and processing device, comprising: a receiving module for receiving data packets sent by the Ethernet data sending device described above; a second identification module for identifying whether the preamble field in the data packet is a preset value, to determine whether the data packet is a data packet forwarded in a first mode or a data packet forwarded in a second mode; and a second processing module for decapsulating and parsing the data packets forwarded in the first mode according to the decapsulation rules corresponding to the first mode; or decapsulating the data packets forwarded in the second mode according to the traditional Ethernet decapsulation rules corresponding to the decapsulation rules of the second mode.
[0014] To address the aforementioned technical problems, this embodiment also discloses a switch chip architecture, wherein a first-mode processing engine is provided in the chip physical layer and the link layer architecture, respectively, for executing the Ethernet data transmission method or the Ethernet data reception processing method as described above; and a second-mode processing engine is provided for handling large data packet scenarios; in the chip pipeline, a first-mode IPE and a first-mode EPE are provided for executing the Ethernet data transmission method or the Ethernet data reception processing method as described above; and a second-mode IPE and a second-mode EPE are provided for handling large data packet scenarios.
[0015] Compared with the prior art, the technical solution of the present invention has the following advantages:
[0016] This invention simplifies the field information in the corresponding network protocol layer within small data packets and uses the simplified fields (such as preambles) as identification fields for small packet scenarios. This optimizes and reduces Ethernet header overhead, thereby improving Ethernet's load share and forwarding efficiency in small packet scenarios. It solves the problem of low forwarding efficiency caused by heavy protocol header overhead in traditional Ethernet. Simultaneously, in large packet scenarios, this solution also supports conventional processing of traditional Ethernet data packets, thus balancing improved forwarding efficiency and compatibility. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the existing IPv4 packet format;
[0019] Figure 2This is a schematic diagram of the existing IPv6 packet format;
[0020] Figure 3 This is a schematic diagram of the message format of a data packet generated by an Ethernet data transmission method according to an embodiment of the present invention;
[0021] Figure 4 This is a schematic diagram of the switch chip architecture;
[0022] Figure 5 yes Figure 4 The diagram shows the processing logic of the switch chip architecture. Detailed Implementation
[0023] The IEEE 802.3 standard, developed by the IEEE, defines the technical standard for Ethernet, including physical layer wiring, electronic signals, and media access layer protocols. Traditional Ethernet can generally be broken down into five main layers at the network protocol level: physical layer, data link layer, network layer, transport layer, and application layer. However, in traditional Ethernet, the heavy overhead of the protocol header leads to low payload forwarding efficiency, affecting network transmission efficiency.
[0024] like Figure 1 and 2 As shown, Ethernet packet overhead is broken down into: 8B preamble and 12B interframe gap at the physical layer; 14B Layer 2 MAC header and 4B checksum at the link layer; and 20B IPv4 header and 40B IPv6 header overhead at the network layer. In small packet scenarios, each packet carries very little payload, but the packet density is very high. The problem in this scenario is that traditional Ethernet has low payload efficiency for small packet forwarding. For example, a 64B IPv4 packet can only carry 30B of payload, resulting in a forwarding efficiency of less than 50%, with most of the overhead concentrated in the Ethernet header. When network bandwidth is limited, excessive overhead in the Ethernet header will significantly impact the transmission efficiency of the effective payload information.
[0025] To address the aforementioned technical problems, this embodiment discloses an Ethernet data transmission method, applicable to Ethernet environments with high real-time data transmission requirements, such as data center networks and industrial networks, effectively improving network transmission efficiency. Specifically, the Ethernet data transmission method may include:
[0026] Step S101: Identify the payload or overall size of the data packet;
[0027] In practice, identifying the payload or overall size of a data packet can be done by checking if the payload is less than or equal to 32 bytes, or if the overall packet length is less than or equal to 64 bytes. Generally, the total packet length is the sum of the payload and the header length. Therefore, the conditions of a payload less than or equal to 32 bytes and an overall packet length less than or equal to 64 bytes are relatively equivalent.
[0028] By determining whether the data packet payload is less than or equal to 32 bytes or the overall size of the data packet is less than or equal to 64 bytes, it can be determined whether the current situation belongs to a small packet communication scenario. Small packet scenarios have many applications in network communication. Whether a service belongs to a small packet service scenario can be distinguished based on the fixed scenario at the service level, such as VoIP services and M2M (Machine Type Communication) services, whose typical characteristic is continuous small packet communication.
[0029] In specific implementations, the small packet scenario can also involve identifying the payload in the data packet to be sent, or whether the overall length of the data packet is less than a preset value. Specifically, when the effective payload in the data packet is less than or equal to 32 bytes, or the overall length of the data packet is less than or equal to 64 bytes, it is determined to be a small packet forwarding. In this case, the implementation steps described later in this embodiment can be applied to improve network transmission efficiency. Typically, for data packets with an effective payload greater than 32 bytes, or an overall packet length greater than 64 bytes, it is determined to be a large packet forwarding, and the conventional data packet processing method is used. For data packets with effective payloads between these two values, those skilled in the art can flexibly configure whether to apply this embodiment according to the needs of the actual application scenario.
[0030] Step S102: Select to set the preamble to a preset value as a distinguishing identifier for sending data packets in the first mode or the second mode;
[0031] When step S101 determines it to be a small packet service scenario, and identifies that the payload in the data packet to be sent is less than a preset value, or the total packet length is less than a preset value, efficient Ethernet can be achieved by simplifying the data packet using the first mode. Simultaneously, the preamble is set to a preset value as a distinguishing identifier between sending data packets in the first mode and the second mode.
[0032] In practical implementation, this scheme simplifies the preamble to 2 bytes at the physical layer, thereby reducing 6 bytes of overhead. The preamble is a field used for clock synchronization between the sender and receiver of data packets. It typically consists of 8 bytes, composed of a cycle of 1s and 0s. One byte is the Start of Frame Delimiter (SFD), with the content 10101011. When 11 appears, it indicates that subsequent content will no longer be a synchronization signal. When the receiver receives the 10101010 preamble, it will adjust its own byte clock according to the protocol. In this scheme, the preamble is simplified from 8 bytes to 2 bytes; specifically, it can reserve one byte for the preamble field and the Start of Frame Delimiter. The reserved preamble field can be a preset value to identify the currently forwarded or received data packet as a small packet that has undergone simplified settings. Through the above data packet processing method, 6 bytes of overhead can be reduced at the physical layer. Furthermore, by setting the preamble to a specific preset value, it can serve as an effective identifier to distinguish between high-efficiency Ethernet and traditional Ethernet in subsequent processing.
[0033] In practical implementation, this scheme reduces header overhead at the link layer by omitting the Layer 2 Media Access Control (MAC) header and the Link Layer Frame Check Sequence (FCS). A MAC frame typically consists of a header, data portion, and trailer. The MAC header usually includes three fields: the first two are a 6-byte destination address field and a source address field, representing the MAC physical addresses of the network adapters at the receiving and sending ends of the frame, respectively; the third field is a 2-byte type field, indicating the type of the upper-layer protocol. By omitting the MAC header, at least 14 bytes of overhead can be reduced. Additionally, the MAC frame trailer includes a 4-byte FCS for checking for errors. In this embodiment, the FCS at the trailer can also be omitted, resulting in a total reduction of 18 bytes of overhead at the data link layer through the aforementioned packet processing method.
[0034] In practical implementation, this scheme simplifies the IP source address (IPSA) and IP destination address (IPDA) at the network layer. Specifically, for IPv4, the original 32-bit IPA address can be reduced to a preset 16-bit Source ID, and the original 32-bit IPDA address can also be reduced to a preset 16-bit Destination ID. This reduces the IP header from 20 bytes to 12 bytes, a total reduction of 8 bytes. Similarly, for IPv6, by replacing the original IPA and IPDA with preset Source IDs and Destination IDs, this embodiment reduces the original 128-bit IPA address in IPv6 packets to 16 bits, and the original 128-bit IPDA address to 16 bits, thus reducing the IP header from 40 bytes to 12 bytes, a total reduction of 28 bytes.
[0035] The Source ID and Dest ID mentioned above are the preset identifiers for the source device and the destination device, respectively. These specific identifiers are unique identifiers for the relevant devices. In this embodiment, both the Source ID and Dest ID are set to 16 bits, allowing 216 such devices to be set up in a specific network, which can meet general needs.
[0036] In practical implementation, if a data packet is determined to be non-small packet through step S101, then the data packet can be forwarded through the second mode. In the second mode, the traditional Ethernet forwarding message format is used, which is the same as the existing data packet encapsulation method, and will not be elaborated further here.
[0037] In summary, this embodiment addresses the small packet scenario where IPv4 and IPv6 format data packets are processed consistently at the physical and link layers. At the network layer, IPSA and IPDA are also simplified into 16-bit Source ID and Dest ID, reducing header overhead by 32 bytes and 52 bytes respectively, ultimately resulting in the following structure: Figure 3 The diagram shows the Ethernet data frame format. Based on a typical 64-byte IPv4 packet, the payload forwarding efficiency can be increased from 40% to 65%. Taking the minimum IPv6 packet length of 78 bytes (excluding IPG and preamble) as an example, the payload forwarding efficiency can be increased from 20% to 70%, significantly improving the transmission efficiency of the payload.
[0038] Step S103: Send data packets.
[0039] After completing the operations of steps S101 to S102 above, the data packet is sent.
[0040] This invention also discloses an Ethernet data receiving and processing method corresponding to the above-described Ethernet data sending method, specifically including the following steps:
[0041] Step S201: Receive data packets;
[0042] In specific implementations, the data packet can be a regular Ethernet data packet, or it can be a data packet generated for small packet scenarios in the Ethernet data transmission method of the aforementioned embodiments. The Ethernet data receiving and processing method of this embodiment can also be compatible with processing data packets in both modes.
[0043] Step S202: Identify the preamble field in the data packet as a preset value;
[0044] In practical implementation, the preamble of small data packets is simplified and can be set to a specific reserved value for identification. Therefore, when the preamble is read as this reserved value, it can be determined whether the data packet is forwarded in the first mode or the second mode, and decapsulated according to the corresponding rules. By identifying the preamble as a specific identifier, it is possible to distinguish and identify high-efficiency Ethernet and traditional Ethernet, thereby achieving interoperability and conversion capabilities.
[0045] Step S203: Decapsulate and parse the data packet according to the preset rules corresponding to the first or second mode.
[0046] In practical implementation, for data packets sent in the first mode, at the data link layer, because the MAC field and the cyclic redundancy check (CRC) code at the end of the frame are simplified, the MAC layer 2 header processing is skipped during decapsulation, and the forwarding chip pipeline proceeds directly. At the network layer, since the IPSA and IPDA are replaced by the Source ID and Dest ID, the forwarding is also performed by reading the Source ID and Dest ID.
[0047] As for the data packets sent in the second mode, since they are still encapsulated according to the traditional Ethernet message format, they can be parsed according to the usual decapsulation rules.
[0048] This invention also discloses an Ethernet data transmission apparatus corresponding to the above-described Ethernet data transmission method, specifically comprising: a first identification module for identifying the payload or overall size of a data packet; a first processing module for selecting, based on the identification result of the identification module, to set the preamble to a preset value as a distinguishing identifier for transmitting data packets in a first mode or a second mode; in the first mode, simplifying the preamble field in the physical layer encapsulation format to the preset value, and deleting the MAC field and cyclic redundancy check (CRC) code in the link layer encapsulation format; in the second mode, employing the traditional Ethernet message format.
[0049] In specific implementation, the first processing module determines that when the effective payload of the data packet is less than or equal to 32B, or the overall length of the data packet is less than or equal to 64B, it is a small packet forwarding and forwards the data packet using the first mode; for data packets with an effective payload greater than 32B, or an overall length greater than 64B, it is determined to be a large packet forwarding and forwards the data packet using the second mode.
[0050] In a specific implementation, the first identification module is further used to identify whether the data packet to be sent is an IPv4 data packet or an IPv6 data packet; the first processing module is further used to, when the data packet to be sent is an IPv4 data packet, simplify the IPSA field and IPDA field in the network layer encapsulation format to a 16-bit preset Source ID and Dest ID according to preset rules; wherein the Source ID and Dest ID are preset identifiers of the source device and the destination device, respectively.
[0051] Since the embodiments of the present invention and the first embodiment are based on the same inventive concept, the specific solutions of this embodiment can be referred to the corresponding content of the first embodiment, and will not be repeated here.
[0052] This invention also discloses an Ethernet data receiving and processing apparatus corresponding to the above-described Ethernet data receiving and processing method, specifically comprising: a receiving module for receiving data packets sent by the Ethernet data sending device; a second identification module for identifying whether the preamble field in the data packet is a preset value, to determine whether the data packet is a data packet forwarded in a first mode or a data packet forwarded in a second mode; and a second processing module for decapsulating and parsing the data packets forwarded in the first mode according to the decapsulation rules corresponding to the first mode; or decapsulating the data packets forwarded in the second mode according to the decapsulation rules corresponding to the second mode, and according to traditional Ethernet decapsulation rules.
[0053] Since the embodiments of the present invention and the second embodiment are based on the same inventive concept, the specific solutions of this embodiment can be referred to the corresponding content of the first embodiment, and will not be repeated here.
[0054] This invention also discloses a switch chip architecture, such as... Figure 4 and Figure 5 As shown, in the chip physical layer and link layer architecture, a first mode processing engine is set to execute the Ethernet data transmission method as described above, or the Ethernet data reception processing method as described in the previous embodiment; and a second mode processing engine is set to handle large data packet scenarios.
[0055] The chip pipeline is configured with a combination of two chip forwarding pipelines: a "first-mode inbound processing engine (IPE) + a first-mode outbound processing engine (EPE)" and a "second-mode IPE + a second-mode EPE". The first-mode IPE and first-mode EPE are used to execute the Ethernet data transmission method or the Ethernet data reception processing method described in the aforementioned embodiments; the second-mode IPE and second-mode EPE are used to handle typical large data packet scenarios.
[0056] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include ROM, RAM, disk, or optical disk, etc.
[0057] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of the invention; therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.
Claims
1. A method for transmitting Ethernet data, characterized in that, include: Depending on the payload or overall size of the data packet, the preamble is set to a preset value to serve as a distinguishing identifier for sending data packets in the first or second mode. In the first mode, the preamble field in the simplified physical layer encapsulation format is set to the preset value, and the MAC field and frame tail cyclic redundancy check code in the link layer encapsulation format are deleted. In the second mode, the traditional Ethernet message format is used.
2. The Ethernet data transmission method as described in claim 1, characterized in that, The statement based on the data packet's payload or overall data packet size includes: When the payload of a data packet is less than or equal to 32 bytes, or the overall length of the data packet is less than or equal to 64 bytes, the first mode is used to forward the data packet; otherwise, the second mode is used to forward the data packet.
3. The Ethernet data transmission method as described in claim 1, characterized in that, The first mode also includes: The IPSA and IPDA fields in the simplified network layer encapsulation format are 16-bit preset Source ID and Dest ID; wherein the Source ID and Dest ID are the preset identifiers of the source device and the destination device, respectively.
4. A method for receiving and processing Ethernet data, characterized in that, include: Receive data packets sent by the Ethernet data transmission method as described in any one of claims 1 to 3; Identify whether the preamble field in the data packet is a preset value to determine whether the data packet is a data packet forwarded in the first mode or a data packet forwarded in the second mode; According to the decapsulation rules corresponding to the first mode, the data packets forwarded in the first mode are decapsulated and parsed; or according to the decapsulation rules corresponding to the second mode, the data packets forwarded in the second mode are decapsulated according to the traditional Ethernet decapsulation rules.
5. The Ethernet data receiving and processing method as described in claim 4, characterized in that, Its features are, The decapsulation rules corresponding to the first mode include: skipping the MAC layer 2 header processing flow and forwarding the chip pipeline.
6. An Ethernet data transmission device, comprising: The first identification module is used to identify the payload or the overall size of the data packet. The first processing module is used to select, based on the recognition result of the recognition module, to set the preamble to a preset value as a distinguishing identifier for sending data packets in the first mode or the second mode. In the first mode, the preamble field in the simplified physical layer encapsulation format is set to the preset value, and the MAC field and frame tail cyclic redundancy check code in the link layer encapsulation format are deleted. In the second mode, the traditional Ethernet message format is used.
7. The Ethernet data transmission apparatus as described in claim 6, characterized in that, The first processing module forwards data packets using the first mode when the effective payload of the data packet is less than or equal to 32 bytes, or when the overall length of the data packet is less than or equal to 64 bytes; otherwise, it forwards data packets using the second mode.
8. The Ethernet data transmission apparatus as described in claim 6, characterized in that, The first processing module is further configured to, in the first mode, simplify the IPSA field and IPDA field in the network layer encapsulation format to a 16-bit preset Source ID and Dest ID; wherein the Source ID and Dest ID are respectively the preset identifier of the source device and the preset identifier of the destination device.
9. An Ethernet data receiving and processing device, characterized in that, include: A receiving module is configured to receive data packets sent by the Ethernet data transmitting device as described in any one of claims 6 to 8; The second identification module is used to identify whether the preamble field in the data packet is a preset value, so as to determine whether the data packet is a data packet forwarded in the first mode or a data packet forwarded in the second mode. The second processing module is used to decapsulate and parse the data packets forwarded in the first mode according to the decapsulation rules corresponding to the first mode; or to decapsulate the data packets forwarded in the second mode according to the traditional Ethernet decapsulation rules corresponding to the second mode.
10. A switch chip architecture, characterized in that, In the chip physical layer and link layer architecture, a first mode processing engine is set respectively to execute the Ethernet data transmission method as described in any one of claims 1 to 3, or the Ethernet data reception processing method as described in any one of claims 4 to 5. In addition, a second-mode processing engine is set up to handle large data packet scenarios; In the chip pipeline, a first mode IPE and a first mode EPE are set to perform the Ethernet data transmission method as described in any one of claims 1 to 3, or the Ethernet data reception processing method as described in any one of claims 4 to 5; and a second mode IPE and a second mode EPE are set to handle large data packet scenarios.
