Transmission method of ethernet frame, electronic device and storage medium

By introducing a type identification field into the preamble of the Ethernet frame, the problem of insufficient data type identification in existing technologies is solved, enabling more efficient data isolation and personalized processing, improving network processing performance and simplifying device architecture.

CN116567096BActive Publication Date: 2026-07-14ALIBABA (CHINA) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIBABA (CHINA) CO LTD
Filing Date
2023-05-09
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

In existing technologies, the data receiving end needs to parse MAC frames to identify the data type, which leads to high complexity in data stream processing, complex network device architecture design, and insufficient upfront data type identification, thus affecting network processing performance.

Method used

By introducing a type identification field into the preamble of the Ethernet frame, the receiving end can determine the target type of the MAC frame upon receiving the preamble, without waiting for the MAC frame to be fully received. The generated preamble also performs clock alignment and indicates the start of MAC frame transmission.

Benefits of technology

By identifying data types in advance, the architecture design of network devices is simplified, the complexity of data stream processing is reduced, and network processing performance and data isolation effectiveness are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116567096B_ABST
    Figure CN116567096B_ABST
Patent Text Reader

Abstract

The one or more embodiments of the specification provide a transmission method of an Ethernet frame, an electronic device and a storage medium. The method can include: generating an Ethernet frame containing a preamble and a media access control (MAC) frame, a value of a type identification field in the preamble being used to represent a target type of target data contained in the MAC frame; and sending the Ethernet frame to a receiving end to perform shunt processing on the MAC frame according to the value of the type identification field by the receiving end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to one or more embodiments in the field of communication technology, and more particularly to a method for transmitting Ethernet frames, an electronic device, and a storage medium. Background Technology

[0002] The rapid development of computer networks has placed higher demands on the network performance of data receiving and processing devices. To address this, data receivers in computer networks can identify data types and perform targeted processing. By identifying data types, the receiver can effectively isolate different data streams, enabling personalized processing of each stream and improving network processing performance. Furthermore, it can reduce the complexity of the data stream processing pipeline and simplify the architecture design of network devices. Clearly, from the perspective of data type identification, the earlier the data stream identification is implemented, the more significant these benefits are.

[0003] Currently, data receivers typically employ port-based or payload-based identification schemes, which require parsing the received data packets (such as MAC frames) to achieve identification. Summary of the Invention

[0004] In view of this, one or more embodiments of this specification provide a method for transmitting Ethernet frames, an electronic device, and a storage medium.

[0005] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:

[0006] According to a first aspect of one or more embodiments of this specification, a method for transmitting Ethernet frames is provided, comprising:

[0007] Generate an Ethernet frame containing a preamble and a Media Access Control (MAC) frame, wherein the value of the type identification field in the preamble is used to characterize the target type of the target data contained in the MAC frame;

[0008] The Ethernet frame is sent to the receiving end so that the receiving end can perform splitting processing on the MAC frame according to the value of the type identification field.

[0009] According to a second aspect of one or more embodiments of this specification, a method for transmitting Ethernet frames is provided, comprising:

[0010] The received Ethernet frame contains a preamble, and the Ethernet frame also contains a Media Access Control (MAC) frame encapsulating target data. The value of the type identification field in the preamble is used to characterize the target type of the target data.

[0011] The MAC frame is split into streams based on the value of the type identification field.

[0012] According to a third aspect of one or more embodiments of this specification, an electronic device is provided, comprising:

[0013] processor;

[0014] Memory used to store processor-executable instructions;

[0015] The processor implements the method as described in any one of the first or second aspects by executing the executable instructions.

[0016] According to a fourth aspect of one or more embodiments of this specification, a computer-readable storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement the steps of the method as described in any one of the first or second aspects.

[0017] According to a fifth aspect of one or more embodiments of this specification, a computer program product is provided, comprising a computer program and / or instructions that, when executed by a processor, implement the method as described in any one of the first or second aspects.

[0018] Through the aforementioned embodiments, for a MAC frame containing target data to be transmitted, the transmitting end generates an Ethernet frame containing a preamble and the MAC frame. The value of the type identification field in the preamble can be used to characterize the target type of the target data. When the receiving end receives the preamble contained in the Ethernet frame, it can perform splitting processing on the MAC frame contained in the Ethernet frame according to the value of the type identification field in the preamble.

[0019] As can be seen, this specification proposes a novel preamble structure, defining a preamble with customizable type identification field values. This allows the sender of the target data to set the value of the type identification field according to the target data's target type when generating the preamble. Consequently, the receiver of the target data can quickly determine the target data's target type using this value, without waiting for the entire MAC frame to be received and parsed to determine the target type. Clearly, compared to related technologies that require parsing the MAC frame to determine the target data's target type, this solution allows the receiver to quickly and accurately determine the target data's target type in subsequently received MAC frames using the preamble. This further advances the data type identification process (far ahead of related technologies), not only facilitating more effective data isolation and personalized processing, thus improving network processing performance, but also further reducing the complexity of the data stream processing pipeline and simplifying network device architecture design. In other words, this specification makes the benefits of both aspects more pronounced by advancing the data type identification process. Attached Figure Description

[0020] Figure 1 This is a data flow diagram of an information transmission process in related technologies.

[0021] Figure 2 This is a schematic diagram of the structure of the Ethernet frame used in related technologies.

[0022] Figure 3 This is a flowchart of an exemplary embodiment of an Ethernet frame transmission method.

[0023] Figure 4 This is a schematic diagram of the structure of an Ethernet frame provided in an exemplary embodiment.

[0024] Figure 5 This is a flowchart of another method for transmitting Ethernet frames provided in an exemplary embodiment.

[0025] Figure 6 This is a schematic diagram of a receiving end's processing flow for an Ethernet frame, provided in an exemplary embodiment.

[0026] Figure 7 This is a schematic diagram of the structure of a device provided in an exemplary embodiment.

[0027] Figure 8 This is a flowchart of an Ethernet frame transmission apparatus provided in an exemplary embodiment.

[0028] Figure 9 This is a flowchart of another Ethernet frame transmission device provided in an exemplary embodiment. Detailed Implementation

[0029] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0030] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.

[0031] The rapid development of computer networks has placed higher demands on the network performance of data receiving and processing devices. To address this, data receivers in computer networks can identify data types and perform targeted processing. By identifying data types, the receiver can effectively isolate different data streams, enabling personalized processing of each stream and improving network processing performance. Furthermore, it can reduce the complexity of the data stream processing pipeline and simplify the architecture design of network devices. Clearly, from the perspective of data type identification, the earlier the data stream identification is implemented, the more significant these benefits are.

[0032] The OSI (Open System Interconnection Reference Model) is a standard framework for network interconnection proposed by the International Organization for Standardization (ISO). As an infrastructure-level communication standard, the OSI model is widely used in the field of communication technology.

[0033] The OSI model defines a seven-layer network interconnection model, from lowest to highest: Physical Layer, Data Link Layer, Network Layer, Transport Layer, Session Layer, Presentation Layer, and Application Layer. For application layer data to be transmitted, each layer at the sending end encapsulates it into corresponding data blocks in descending order of complexity, and finally transmits it bit-by-bit at the Physical Layer to the receiving end. Specifically, upon receiving the MAC (Media Access Control Address) frame encapsulated by the Data Link Layer, the Physical Layer adds a fixed-length (8 bytes) preamble with a specified value to the front of the MAC frame according to a preset protocol, and then transmits the frame sequentially after the preamble.

[0034] like Figure 1 As shown, for information messages (masks) that need to be transmitted to the receiving end, they are usually split into multiple data segments (of course, if the message data volume is small enough, splitting is not necessary), such as Part 1, Part 2, ... Part s, etc., and each data segment is used as a target data packet. In addition to containing that data segment, any data packet corresponding to any data segment usually also includes a preamble before it. The structure of Ethernet frames in related technologies is as follows... Figure 2As shown, in addition to the MAC frame containing the target data, the Ethernet frame also contains an 8-byte preamble. This preamble includes a 7-byte preamble (a 2-bit 0 / 1 cycle) and a 1-byte SFD (Start of Frame Delimiter, valued at 10101011). The preamble and the MAC frame are concatenated to form the Ethernet frame. The preamble is sometimes also referred to as the preamble, in which case it and the SFD together constitute a generalized preamble. Specifically, the preamble ensures clock alignment between the sender and receiver during Ethernet frame transmission, and the SFD indicates the start of MAC frame transmission to the receiver; data transmitted after the SFD is the MAC frame. Therefore, the preamble serves two functions: clock alignment and indicating the start of MAC frame transmission.

[0035] In current data transmission processes, data receivers typically employ port-based or payload-based identification schemes. These schemes require parsing received data packets (such as MAC frames) to achieve identification. For example, the receiver will detect the data packets received... Figure 2 After the Ethernet frame is completed, the port number recorded in it is obtained by parsing the MAC frame, and then the data type of the data contained therein is determined based on the port number; or the payload in the MAC frame is directly parsed to determine the data type of the payload (which is essentially data). It is clear that this scheme requires parsing the MAC frame to determine the data type.

[0036] In response, this specification improves upon the preamble (i.e., the aforementioned generalized preamble) in related technologies by proposing a novel preamble that includes a type identification field. The sending end sets the value of the type identification field according to the target type of the target data, so that the receiving end can directly determine the target type of the target data in subsequent MAC frames based on the value, without having to parse the MAC frames, thereby further advancing the type identification process for the target data.

[0037] In the embodiments of this specification, both the sending and receiving ends of the target data conform to the aforementioned seven-layer model, wherein each layer in the sending end is used to encapsulate the target data in descending order. Specifically, the data link layer provides its encapsulated MAC frame (containing the target data) to the physical layer. The physical layer can generate a corresponding preamble for this MAC frame—the preamble and the MAC frame constitute an Ethernet frame, which can then be sent to the receiving end, i.e., the preamble and MAC frame are sent sequentially in the order of preamble followed by MAC frame. Correspondingly, upon receiving the preamble, the receiving end can perform stream splitting processing on the corresponding MAC frame based on the value of the type identification field.

[0038] Furthermore, either the sending end or the receiving end described in this specification can be any form of electronic device that conforms to the aforementioned seven-layer model. For example, the device can be a server-side device in a centralized network architecture, such as a physical server containing an independent host, or a virtual server or cloud server hosted by a host cluster. Alternatively, the device can also be a client-side device in a centralized network architecture, such as a mobile phone, tablet, laptop, PDA (Personal Digital Assistants), wearable devices (such as smart glasses, smartwatches, etc.), VR (Virtual Reality) devices, AR (Augmented Reality) devices, etc., and one or more embodiments in this specification do not limit this. For example, either device can also be an electronic device in a distributed network architecture, such as a node device deployed with blockchain nodes in a blockchain scenario, or a blockchain client connected to a node device, etc., which will not be elaborated further. Additionally, the sending end and the receiving end described in this specification can communicate via a network, which can include at least one type of wired or wireless network.

[0039] As mentioned earlier, preambles in related technologies have two functions: "clock alignment" and "indicating the start of MAC frame transmission." In contrast, the novel preamble described in this specification, in addition to these two functions, also possesses a completely new function: "indicating the type of data in the MAC frame," achieved through the appropriate setting of the type identification field. In fact, it is precisely because of this new function that the receiver can quickly determine the target data type without parsing the MAC frame, thus achieving pre-processing data type identification.

[0040] To achieve the above three functions, this specification defines a novel preamble structure, as shown in Table 1 below:

[0041] Table 1

[0042]

[0043]

[0044] As shown in Table 1, the three fields in this new preamble—"clock alignment field," "type identification field," and "start identifier field"—correspond to the functions of "clock alignment," "indicating the type of data in the MAC frame," and "indicating the start of MAC frame transmission," respectively. The bit width of each field indicates its length, representing the total number of bits contained in that field. The following detailed description, in conjunction with the accompanying drawings, of this new preamble (hereinafter referred to as the preamble) and the process of transmitting Ethernet frames based on it, will be provided in detail.

[0045] Please see Figure 3 , Figure 3 This is a flowchart illustrating an exemplary embodiment of an Ethernet frame transmission method. (As shown...) Figure 3 As shown, this method is applied to the sending end of the target data; specifically, it can be considered as the scheme being applied to the physical layer of the sending end. It may include steps 302-304 as described below.

[0046] Step 302: Generate an Ethernet frame containing a preamble and the MAC frame. The value of the type identification field in the preamble is used to characterize the target type of the target data contained in the MAC frame.

[0047] For MAC frames encapsulated at the data link layer, the sending end can generate a corresponding preamble at the physical layer, that is, determine the value of each field (i.e., each bit in the field) in the preamble. As mentioned earlier, the value of the type identification field contained in the preamble can be used to indicate the type of data in the MAC frame. Therefore, the sending end can determine the type of the target data in the MAC frame (i.e., the target type) before generating the preamble, so as to determine the value of the type identification field according to the type.

[0048] In one embodiment, since the MAC frame is typically generated by the application layer (i.e., the top layer of the aforementioned OSI model), the application layer usually knows the target type. Therefore, the application layer can add a type identifier to the target data so that the physical layer can determine the target type of the target data based on the type identifier. The type identifier can be maintained by the sending end for the physical layer to query, or it can be provided to the physical layer by the application layer. Alternatively, since the MAC frame contains target data, the sending end can also obtain the data characteristics of the target data by parsing the MAC frame and determine the target type of the target data based on these data characteristics. The target type determined in the above manner can then be used by the sending end to determine the value of the type identification field.

[0049] In one embodiment, the transmitting end can generate the preamble according to a preset preamble format. This preset preamble format is jointly adhered to by both the transmitting and receiving ends, so that the receiving end can smoothly parse the values ​​and meanings of each field in the received preamble according to this format. Furthermore, by presetting the preamble format, it helps the transmitting end to quickly generate the preamble and the receiving end to quickly parse the preamble, thereby improving the transmission efficiency of Ethernet frames to a certain extent. The preamble format can be used to define (e.g., record) the number of bits (i.e., the aforementioned bit width) of each field in the preamble, and can also define the values ​​of at least some bits in at least some fields. For example, the number of bits and the values ​​of each bit in the clock alignment field, the number of bits in the type identification field, and the number of bits and the values ​​of each bit in the start identifier field can be defined.

[0050] Before generating the preamble, the sending end can pre-set the preamble format in various ways. For example, the sending end and the receiving end can each obtain the same format configuration parameters and configure their own preamble format according to these parameters; in other words, the sending end can configure its own preamble format according to the obtained format configuration parameters, and the format configuration parameters are also used by the receiving end to configure its own preamble format. The aforementioned format configuration parameters can be agreed upon by the operators of the sending end and the receiving end through methods different from the communication between the sending end and the receiving end (such as offline methods, interaction using other devices used by each end, etc.). This specification does not limit the agreed-upon method or the parameter content, and can be reasonably selected according to actual needs. In fact, the "same format configuration parameters" should be understood as the sending end and the receiving end obtaining the same preamble format after configuration, while this specification does not limit the number of parameters or the parameter format obtained by each end. For example, the format configuration parameters of the sending end can be in XML (Extensible Markup Language) format, while the format configuration parameters of the receiving end can be in JSON (JavaScript Object Notation) format.

[0051] For example, considering that the configuration process for the sending and receiving ends may be complex, and the preamble format may need to be updated, to reduce the workload of the configuration process and ensure that the preamble formats of the sending and receiving ends are as identical as possible, the sending and receiving ends can jointly negotiate the preamble format. That is, the sending end can determine the preamble format with the receiving end through a negotiation process, and the preamble format negotiated in this way is respectively followed by the sending end and the receiving end. The negotiation process can occur during or after the establishment of the physical layer connection between the sending end and the receiving end. Furthermore, if the sending end and the receiving end already maintain (pre-configured or negotiated) the preamble format locally, they can also update the preamble format through the aforementioned negotiation process, which will not be elaborated further.

[0052] The preamble format determined in the aforementioned manner can be used to define the number of bits and their values ​​in the clock alignment field, the number of bits in the type identification field, and the number of bits and their values ​​in the start identifier field. For example, the bit width of these three fields and the values ​​of their respective bits can be determined using the following rules:

[0053] Clock alignment field:

[0054] (1) The sum of the bit width of the clock alignment field, the bit width of the type identification field, and the bit width of the start identifier field (i.e., the bit width of the preamble described in this scheme) is equal to an integer multiple of the bit width of a byte, that is, an integer multiple of 8 bits.

[0055] (2) While satisfying (1), the bit width of the clock alignment field can be as short as possible in order to shorten the preamble length and save transmission bandwidth.

[0056] (3) Once the bit width of the clock alignment field is determined, its content can be set to all 0s or all 1s, or it can be set to "1010……10" to be as compatible as possible with the preamble in related technologies.

[0057] Type identification field:

[0058] Considering that the value of the type identification field is used to represent the data type, the total number of data types corresponding to the number of bits in the type identification field can be no less than the total number of data types that need to be sent between the sending end and the receiving end. As shown in Table 1 above, when the number of bits in the type identification field is n (i.e., the type identification field consists of n consecutive bits), the total number of data types corresponding to the number of bits in the type identification field is 2. n If the total number of data types that need to be sent between the sending end and the receiving end is N, then n should satisfy 2. n ≥N, that is, n≥log2(N).

[0059] Start identifier field:

[0060] The start identifier field is only used to indicate to the receiving end that MAC frame transmission has started. Its bit width can be set as short as possible, such as 2 bits, and the value can be "00" or "11", etc. Of course, it can also be set to 1 bit or 4 bits, etc., which will not be elaborated further.

[0061] As mentioned earlier, the preamble includes a type identification field. Generating the preamble according to a preset preamble format includes determining the value of the type identification field according to that format. In one embodiment, the number of bits in the type identification field defined in the preset preamble format can be determined, and the value of each bit in the type identification field can be determined according to the target type; wherein, the total number of data types corresponding to the number of bits in the type identification field is not less than the total number of data types that need to be sent between the sending end and the receiving end. Taking the aforementioned negotiation process as an example, the sending end and the receiving end can determine the total number of data types that they need to send in subsequent data transmission during the negotiation process. Considering the directionality of data transmission and reception, when the sending end and the receiving end need to send data to each other (i.e., the sending end needs to send data to the receiving end and the receiving end also needs to send data to the sending end), the total number of the first type of data that the sending end needs to send to the receiving end and the total number of the second type of data that the receiving end needs to send to the sending end can be determined, and then the larger of the total number of the first type and the total number of the second type is determined as the total number of data types that they need to send in subsequent data transmission.

[0062] For example, let's assume that n = 2 as defined in Table 1 of the preset preamble format. In this case, the total number of data types corresponding to the number of bits in the type identification field is 2. n =4; Further assuming that the total number of data types that need to be sent between the sending end and the receiving end is N=3, then the mapping relationship between the value of the type identification field and the data type can be seen in Table 2 below:

[0063] Table 2

[0064] Values ​​of the type identification field Data types 00 Type 1 01 Type 2 11 Type 3 10 reserve

[0065] Based on the mapping relationship shown in Table 2 and the target data type determined in the aforementioned embodiments, the sending end can determine the value of the type identification field when generating the preamble. For example, if the target type is type 2, the value of the type identification field can be determined to be "01", which will not be elaborated further. It can be seen that the length of the type identification field corresponds to the total number of data types that need to be transmitted between the sending end and the receiving end, and can meet the transmission requirements of that total number of types. Obviously, the number of bits n in the type identification field described in this specification is not a fixed value, thus the novel preamble described in this specification can be applied to more application scenarios.

[0066] As mentioned above, the preamble may include a clock alignment field. Generating the preamble according to a preset preamble format may include determining the value of the clock alignment field according to that format. In one embodiment, the transmitting end may determine the number of bits in the clock alignment field of the preamble as defined in the preset preamble format; or, if the number of bits in the clock alignment field is not defined in the aforementioned preset preamble format, the transmitting end may also determine the number of bits in the clock alignment field of the preamble based on the clock parameters of the transmitting end and the receiving end.

[0067] For example, after determining that the bit width of the type identification field is 2, and considering that the bit width of the start identifier field is also 2, the bit width of the clock alignment field can be set to 4.

[0068] Furthermore, the values ​​of each bit in the clock alignment field can be filled according to the basic bit values ​​of the clock alignment field defined in the preset preamble format. It can be seen that when the preset preamble format defines the number of bits in the clock alignment field, the corresponding value can be determined according to that number of bits; while when the preset preamble format does not define the number of bits in the clock alignment field, the transmitting end can temporarily determine that number of bits based on its own and the receiving end's clock parameters. Furthermore, the preamble format can define the values ​​of each bit in the clock alignment field. If the number of bits in the clock alignment field is defined, the value of each bit can be directly recorded in this format. If the number of bits in the clock alignment field is not recorded, the value of the clock alignment field can be defined as being filled in units of 2-bit basic values. For example, if the preamble format can record a 2-bit basic value of "10", then if the number of bits in the clock alignment field is determined to be 4 bits, the value of the clock alignment field can be "1010" (filled with 2 basic values); and if the number of bits in the clock alignment field is determined to be 6 bits, the value of the clock alignment field can be "101010" (filled with 3 basic values), and so on. It is evident that, similar to the aforementioned type identification field, the length of the clock alignment field is not a fixed value and can also be determined according to the actual situation of the transmitting and receiving ends, so that it can fully meet the actual situation of clock delay and network latency of the transmitting and receiving ends while occupying as few bits as possible.

[0069] As mentioned earlier, the preamble may include a start identifier field. Generating the preamble according to a preset preamble format may include determining the value of the start identifier field according to that format. In one embodiment, the transmitting end may determine the number of bits in the start identifier field and the value of each bit in the preamble defined in the preset preamble format. It can be seen that the preset preamble format can define the number of bits in the start identifier field and the value of each bit; for example, the value of the start identifier field can be directly recorded as "11".

[0070] For example, assuming the target type of the MAC frame recorded in the current MAC frame is type 1 as shown in Table 2, the preamble generated in the aforementioned manner can be seen in Table 3 below:

[0071] Table 3

[0072]

[0073] The clock alignment field is 4 bits long and has a value of "1010"; the type identification field is 2 bits long and has a value of "00", which is used to indicate that the target type of the MAC frame is the aforementioned type 1; the start identifier field is 2 bits long and has a value of "11".

[0074] Step 304: Send the Ethernet frame to the receiving end so that the receiving end can perform traffic splitting on the MAC frame according to the value of the type identification field.

[0075] After generating the preamble (i.e., the values ​​of each field) in the aforementioned manner, the preamble and the MAC frame logically constitute an Ethernet frame. In practice, no "concatenation" or "encapsulation" operations are performed on the two. For example, a MAC frame generated in the aforementioned manner is as follows: Figure 4 As shown, the preamble is 1 byte in length. In other words, only 1 byte of preamble is needed to achieve the three functions of "clock alignment", "indicating the type of data in the MAC frame" and "indicating the start of MAC frame transmission". Compared with the 8-byte fixed-length preamble required in related technologies, the length of the preamble is significantly shortened, effectively saving the communication bandwidth between the sender and receiver.

[0076] Based on this, the sending end sends the Ethernet frame to the receiving end, that is, it sends the two frames in the order of the preamble followed by the MAC frame. Correspondingly, the receiving end also receives the two frames in the same order. For the receiving end, it can parse the received preamble according to the aforementioned preamble format, determine the value of the type identification field, and perform stream splitting processing on the MAC frame based on the value. The value of the type identification field is used to characterize the target type of the MAC frame, so the receiving end can determine the target type based on the value, and then provide the first MAC frame that has been received or will be received after the current moment (this MAC frame is the MAC frame corresponding to the aforementioned preamble) to the processing module corresponding to the target type for processing.

[0077] Through the aforementioned embodiments, for a MAC frame containing target data to be transmitted, the transmitting end generates an Ethernet frame containing a preamble and the MAC frame. The value of the type identification field in the preamble can be used to characterize the target type of the target data. When the receiving end receives the preamble contained in the Ethernet frame, it can perform splitting processing on the MAC frame contained in the Ethernet frame according to the value of the type identification field in the preamble.

[0078] As can be seen, this specification proposes a novel preamble structure, defining a preamble with customizable type identification field values. This allows the sender of the target data to set the value of the type identification field according to the target data's target type when generating the preamble. Consequently, the receiver of the target data can quickly determine the target data's target type using this value, without waiting for the entire MAC frame to be received and parsed to determine the target type. Clearly, compared to related technologies that require parsing the MAC frame to determine the target data's target type, this solution allows the receiver to quickly and accurately determine the target data's target type in subsequently received MAC frames using the preamble. This further advances the data type identification process (far ahead of related technologies), not only facilitating more effective data isolation and personalized processing, thus improving network processing performance, but also further reducing the complexity of the data stream processing pipeline and simplifying network device architecture design. In other words, this specification makes the benefits of both aspects more pronounced by advancing the data type identification process.

[0079] Please see Figure 5 , Figure 5 This is a flowchart illustrating an exemplary embodiment of an Ethernet frame transmission method. (As shown...) Figure 5 As shown, this method is applied to the receiving end of the target data; specifically, it can be considered as the scheme being applied to the physical layer of the receiving end. It may include steps 502-504 as described below.

[0080] Step 502: Receive the preamble contained in the Ethernet frame. The Ethernet frame also contains a Media Access Control (MAC) frame encapsulating target data. The value of the type identification field in the preamble is used to characterize the target type of the target data.

[0081] Step 504: Perform stream splitting on the MAC frame according to the value of the type identification field.

[0082] In one embodiment, the receiving end can parse the preamble after receiving the complete Ethernet frame and then split the MAC frame according to the value of the parsed type identification field. Alternatively, considering that the preamble and MAC frame in the Ethernet frame are transmitted to the receiving end in sequence, the receiving end can also parse the preamble immediately upon receiving it from the sending end to determine the value of the type identification field and split the subsequently received MAC frame accordingly. Obviously, because the target type identification process is brought forward, the receiving end does not need to wait for the MAC frame to finish receiving before it can start splitting, that is, it can split the MAC frame while receiving it, which significantly improves the processing efficiency of the Ethernet frame. Of course, whether the preamble is parsed after receiving the complete Ethernet frame or immediately upon receiving it, it does not affect the subsequent splitting process of the MAC frame. The receiving end can parse the received preamble according to the aforementioned preamble format it adheres to, which will not be elaborated further.

[0083] In one embodiment, the receiving end can determine the target type based on the value of the type identification field, and offload the first MAC frame received after the preamble to the target processing module corresponding to the target type. The receiving end can maintain a first mapping relationship between the value of the type identification field and the data type (as shown in Table 2 above), so that after parsing the received preamble to obtain the value of the type identification field, the corresponding target type can be queried from the first mapping relationship. Furthermore, the receiving end can also maintain a second mapping relationship between the data type and the processing module, so that when the target type is determined, the corresponding target processing module can be queried from the second mapping relationship.

[0084] The process of the receiving end receiving Ethernet frames and splitting MAC frames can be found in [reference needed]. Figure 6 This includes steps 602-608 below.

[0085] Step 602: The physical port of the receiving end receives the Ethernet frame sent by the sending end.

[0086] Step 604: The physical layer of the receiving end parses the preamble in the Ethernet frame to determine the value of the type identification field.

[0087] Step 606: The receiving end determines the target type of the target data in the MAC frame based on the value of the type identification field.

[0088] Step 608: The receiving end distributes the MAC frame to the corresponding processing module for processing according to the target type.

[0089] The receiving end can be associated with a processing module, such as a locally deployed processing module or a processing module deployed in another device. It is understood that, given that the MAC frame contains the data to be transmitted (such as the aforementioned target data), offloading any type of MAC frame to the corresponding processing module can be considered as offloading the corresponding data (i.e., the data contained in the MAC frame) to that processing module. Any type can correspond to one or more processing modules: if any type corresponds to one processing module, MAC frames containing that type of data can be offloaded to that processing module; if any type corresponds to multiple processing modules, MAC frames containing that type of data can be offloaded to each of these processing modules (i.e., each processing module receives and processes the same MAC frame separately).

[0090] For example, if the total number of data types to be sent between the sending end and the receiving end is N, then the number of processing modules associated with the receiving end can be no less than N. For instance, if data of a certain data type is only routed to one processing module, and the number of bits in the type identification field is n (2^N), then... n If ≥N), then the receiving end can associate with a maximum of 2 n Each processing module, such as Figure 6 As shown. Alternatively, where MAC frames containing a certain type of data can be distributed to multiple processing modules, the receiving end can also associate more than 2... n The processing modules are not described in detail here.

[0091] As can be seen, this specification proposes a novel preamble structure, defining a preamble with customizable type identification field values. This allows the sender of the target data to set the value of the type identification field according to the target data's target type when generating the preamble. Consequently, the receiver of the target data can quickly determine the target data's target type using this value, without waiting for the entire MAC frame to be received and parsed to determine the target type. Clearly, compared to related technologies that require parsing the MAC frame to determine the target data's target type, this solution allows the receiver to quickly and accurately determine the target data's target type in subsequently received MAC frames using the preamble. This further advances the data type identification process (far ahead of related technologies), not only facilitating more effective data isolation and personalized processing, thus improving network processing performance, but also further reducing the complexity of the data stream processing pipeline and simplifying network device architecture design. In other words, this specification makes the benefits of both aspects more pronounced by advancing the data type identification process.

[0092] Figure 7 This is a schematic structural diagram of a device provided in an exemplary embodiment. Please refer to... Figure 7 At the hardware level, the device includes a processor 702, an internal bus 704, a network interface 706, memory 708, and non-volatile memory 710, and may also include other hardware required for its functions. One or more embodiments of this specification can be implemented in software, for example, the processor 702 reads the corresponding computer program from the non-volatile memory 710 into memory 708 and then runs it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices. Figure 7 The device shown can be used to implement the Ethernet frame transmission apparatus corresponding to the foregoing embodiments.

[0093] Please refer to Figure 8 In one software implementation, the Ethernet frame transmission device may include:

[0094] The Ethernet frame generation unit 801 is used to generate an Ethernet frame containing a preamble and a Media Access Control (MAC) frame, wherein the value of the type identification field in the preamble is used to characterize the target type of the target data contained in the MAC frame.

[0095] The Ethernet frame sending unit 802 is used to send the Ethernet frame to the receiving end so that the receiving end can perform traffic splitting on the MAC frame according to the value of the type identification field.

[0096] Optional, also includes:

[0097] The target type determination unit 803 is used to determine the target type based on the data characteristics of the target data obtained by parsing the MAC frame; or, to determine the target type based on the type identifier added to the target data by the application layer that generated the target data.

[0098] The target type is used to determine the value of the type identification domain.

[0099] Optionally, the Ethernet frame generation unit 801 is specifically used for:

[0100] The preamble is generated according to a preset preamble format, which is jointly observed by the sending end and the receiving end.

[0101] Optional, also includes:

[0102] The format configuration unit 804 is used to configure its own preamble format according to the acquired format configuration parameters, wherein the format configuration parameters are also used by the receiving end to configure its own preamble format; or,

[0103] The format negotiation unit 805 is used to determine the preamble format with the receiving end through a negotiation process. The negotiated preamble format is respectively followed by the sending end and the receiving end.

[0104] Optionally, the Ethernet frame generation unit 801 is specifically used for:

[0105] The number of bits in the type identifier field defined in the preset preamble format is determined, and the value of each bit in the type identifier field is determined according to the target type; wherein, the total number of data types corresponding to the number of bits in the type identifier field is not less than the total number of data types that need to be sent between the sending end and the receiving end.

[0106] Optionally, the Ethernet frame generation unit 801 is specifically used for:

[0107] The number of bits in the clock alignment field of the preamble defined in the preset preamble format is determined, or the number of bits in the clock alignment field of the preamble is determined according to the clock parameters of the transmitting end and the receiving end.

[0108] The values ​​of each bit in the clock alignment field are filled according to the basic bit values ​​defined in the preset preamble format.

[0109] Optionally, the Ethernet frame generation unit 801 is specifically used for:

[0110] Determine the number of bits in the start identifier field and the value of each bit in the preamble as defined in the preset preamble format.

[0111] Please refer to Figure 9 In one software implementation, the Ethernet frame transmission device may include:

[0112] The preamble receiving unit 901 is used to receive a preamble contained in an Ethernet frame, wherein the Ethernet frame also contains a Media Access Control (MAC) frame encapsulating target data, and the value of the type identification field in the preamble is used to characterize the target type of the target data.

[0113] The MAC frame splitting unit 902 is used to split the MAC frame according to the value of the type identification field.

[0114] Optionally, the MAC frame splitting unit 902 is specifically used for:

[0115] The target type is determined based on the value of the type identification field, and the first MAC frame received after the preamble is diverted to the target processing module corresponding to the target type.

[0116] This specification also proposes an electronic device, comprising:

[0117] processor;

[0118] Memory used to store processor-executable instructions;

[0119] The processor executes the executable instructions to implement the method as described in any of the preceding descriptions.

[0120] This specification also provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method as described in any of the preceding claims.

[0121] This specification also provides a computer program product, including a computer program and / or instructions that, when executed by a processor, implement the method as described in any of the preceding claims.

[0122] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.

[0123] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0124] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0125] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0126] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0127] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0128] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this specification. The singular forms “a,” “described,” and “the” used in one or more embodiments of this specification and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0129] It should be understood that although the terms first, second, third, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of one or more embodiments of this specification, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "in response to a determination," or "when," or "in the event of a determination."

[0130] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit the scope of one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the protection scope of one or more embodiments of this specification.

Claims

1. A method for transmitting Ethernet frames, characterized in that, Applied to the sending end of Ethernet frames, including: Generate an Ethernet frame containing a preamble and a Media Access Control (MAC) frame. The preamble includes a clock alignment field, a type identification field, and a start identifier field. The sum of the bit widths of the clock alignment field, the type identification field, and the start identifier field is equal to an integer multiple of the bit width of a byte. The bit widths of the clock alignment field and the start identifier field are each as short as possible to maximize the bit width of the type identification field. The value of the type identification field is used to characterize the target type of the target data contained in the MAC frame. The Ethernet frame is sent to the receiving end so that the receiving end can perform traffic splitting on the MAC frame based on the value of the type identification field without parsing the MAC frame. This includes: determining the target type based on the value of the type identification field, and splitting the first MAC frame received after the preamble to the target processing module corresponding to the target type for processing.

2. The method according to claim 1, characterized in that, Also includes: The target type is determined based on the data characteristics of the target data obtained by parsing the MAC frame; or, the target type is determined based on the type identifier added to the target data by the application layer that generated the target data. The target type is used to determine the value of the type identification domain.

3. The method according to claim 1, characterized in that, Generating the preamble includes: The preamble is generated according to a preset preamble format, which is jointly observed by the sending end and the receiving end.

4. The method according to claim 3, characterized in that, Also includes: The receiver configures its own preamble format according to the obtained format configuration parameters, and the format configuration parameters are also used by the receiver to configure its own preamble format. or, The preamble format is determined through a negotiation process with the receiving end, and the negotiated preamble format is respectively followed by the sending end and the receiving end.

5. The method according to claim 3, characterized in that, The step of generating the preamble according to the preset preamble format includes: The number of bits in the type identification field defined in the preset preamble format is determined, and the value of each bit in the type identification field is determined according to the target type; wherein, the total number of data types corresponding to the number of bits in the type identification field is not less than the total number of data types that need to be sent between the sending end and the receiving end.

6. The method according to claim 3, characterized in that, The step of generating the preamble according to the preset preamble format includes: The number of bits in the clock alignment field of the preamble defined in the preset preamble format is determined, or the number of bits in the clock alignment field of the preamble is determined according to the clock parameters of the transmitting end and the receiving end. The values ​​of each bit in the clock alignment field are filled according to the basic bit values ​​defined in the preset preamble format.

7. The method according to claim 3, characterized in that, The step of generating the preamble according to the preset preamble format includes: Determine the number of bits in the start identifier field and the value of each bit in the preamble as defined in the preset preamble format.

8. A method for transmitting Ethernet frames, characterized in that, Applications to the receiver of Ethernet frames include: The received Ethernet frame contains a preamble, and the Ethernet frame also contains a Media Access Control (MAC) frame encapsulating target data. The preamble includes a clock alignment field, a type identification field, and a start identifier field. The sum of the bit widths of the clock alignment field, the type identification field, and the start identifier field is equal to an integer multiple of the bit width of a byte. The bit widths of the clock alignment field and the start identifier field are each as short as possible to maximize the bit width of the type identification field. The value of the type identification field is used to characterize the target type of the target data. Without parsing the MAC frame, the MAC frame is split according to the value of the type identification field, including: determining the target type according to the value of the type identification field, and splitting the first MAC frame received after the preamble to the target processing module corresponding to the target type for processing.

9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor implements the method as described in any one of claims 1-8 by executing the executable instructions.

10. A computer-readable storage medium storing computer instructions thereon, characterized in that, When executed by the processor, this instruction implements the steps of the method as described in any one of claims 1-8.

11. A computer program product, comprising a computer program and / or instructions, characterized in that, When the computer program and / or instructions are executed by the processor, they implement the method as described in any one of claims 1-8.