Disclosure of Invention
The invention aims to provide a method, a device, equipment and a storage medium for transmitting and receiving Ethernet data, which can synchronously transmit information of different attribute types by packaging two or more MRP equipment attribute information into one MRPDU, improve the data quantity or type carried by a data packet in single data transmission, reduce the number of data transmission under the same condition, reduce the flow consumption, improve the transmission efficiency and solve the problems of high transmission flow consumption and low transmission efficiency in the prior art.
In a first aspect, an embodiment of the present invention provides a method for transmitting ethernet data applied to a transmitting device, where the transmitting device and a receiving device are connected to each other by an ethernet network, and the method includes: determining equipment attribute information of at least two multiple registration protocols to be transmitted; encapsulating the equipment attribute information of the at least two multiple registration protocols into a Multiple Registration Protocol Data Unit (MRPDU); and sending a data packet to the receiving equipment, wherein the data packet comprises the MRPDU and an Ethernet frame structure type identifier, and the Ethernet frame structure type identifier is used for indicating that the MRPDU comprises equipment attribute information of the at least two multiple registration protocols.
The method applied to the Ethernet data transmission of the transmitting equipment provided by the embodiment of the invention has the beneficial effects that: the determined equipment attribute information of at least two multiple registration protocols is encapsulated into one MRPDU, and the Ethernet frame structure type identifier is identified on the transmitted data packet, so that the data packet can be identified as the MRPDU containing at least two multiple registration protocols, further the data packet containing the equipment attribute information of at least two multiple registration protocols can be encapsulated, transmitted and identified in the Ethernet, the data packet containing different MRP equipment attribute information can be synchronously transmitted, namely, the equipment attribute information defined by a plurality of different MRP upper layer protocols can be carried in one Ethernet frame, and network bandwidth can be saved.
In one possible implementation, the frame structure of the data packet includes, in addition to the data content field and the ethernet frame structure type, a destination address, an extended destination address, a redundancy field, and a check field. The beneficial effects are that: the data packet accords with the basic form of information transmission in the Ethernet by setting a destination address, an extended destination address, a redundant field and a check field in the data packet, so that the information transmission is realized.
In a second aspect, an embodiment of the present invention further provides a method for receiving ethernet data applied to a receiving device, where the receiving device and the transmitting device are connected to each other by an ethernet network, and the method includes: receiving a data packet from the sending equipment, wherein the data packet comprises an MRPDU and an Ethernet frame structure type identifier; and when the Ethernet frame structure type identifier indicates that the MRPDU comprises equipment attribute information of at least two multiple registration protocols, decapsulating the MRPDU according to the Ethernet frame structure type identifier to obtain the equipment attribute information of the at least two multiple registration protocols.
The Ethernet data receiving method applied to the receiving equipment provided by the embodiment of the invention has the beneficial effects that: and determining that the MRPDU comprises equipment attribute information of at least two multiple registration protocols through the Ethernet frame structure type identifier, and decapsulating the MRPDU to obtain MRP equipment attribute information contained in the data packet, so that the demultiplexing and reading of the data packet are convenient to realize.
In one possible implementation, the method further includes: and when the Ethernet frame structure type identifier indicates that the MRPDU only comprises equipment attribute information of one multi-registration protocol, acquiring the equipment attribute information from the MRPDU according to the Ethernet frame structure type identifier. The beneficial effects are that: this enables the packet to transmit not only information of multiple MRP attributes but also information of a single MRP attribute.
In one possible implementation, after obtaining the device attribute information of the at least two multiple registration protocols, the method further includes: and distributing the equipment attribute information of the at least two multiple registration protocols to corresponding multiple registration protocol applications. The beneficial effects are that: and distributing the obtained different MRP equipment attribute information to different MRP applications to realize reading of different kinds of information.
In one possible implementation, the frame structure of the data packet includes, in addition to the data content field and the ethernet frame structure type, a destination address, an extended destination address, a redundancy field, and a check field. The beneficial effects are that: the data packet accords with the basic form of information transmission in the Ethernet by setting a destination address, an extended destination address, a redundant field and a check field in the data packet, so that the information transmission is realized.
In a third aspect, an embodiment of the present invention further provides an ethernet data transmission apparatus, where the apparatus includes a determining unit configured to determine device attribute information of at least two multiple registration protocols to be transmitted;
An encapsulation unit, configured to encapsulate the device attribute information of the at least two multiple registration protocols into a multiple registration protocol data unit MRPDU;
And the sending unit is used for sending a data packet to the receiving equipment, wherein the data packet comprises the MRPDU and an Ethernet frame structure type identifier, and the Ethernet frame structure type identifier is used for indicating that the MRPDU comprises equipment attribute information of the at least two multiple registration protocols.
In one possible implementation, the frame structure of the data packet includes, in addition to the data content field and the ethernet frame structure type, a destination address, an extended destination address, a redundancy field, and a check field.
In a fourth aspect, an embodiment of the present invention further provides an ethernet data receiving apparatus, where the apparatus includes a receiving unit, configured to receive a data packet from a transmitting device, where the data packet includes an MRPDU and an ethernet frame structure type identifier;
And the decapsulation unit is used for decapsulating the MRPDU according to the Ethernet frame structure type identifier to obtain the equipment attribute information of at least two multiple registration protocols when the Ethernet frame structure type identifier indicates that the MRPDU comprises the equipment attribute information of at least two multiple registration protocols.
In a possible implementation manner, the decapsulating unit is further configured to, when the ethernet frame structure type identifier indicates that the MRPDU includes only device attribute information of one multiple registration protocol, obtain, according to the ethernet frame structure type identifier, the device attribute information from the MRPDU.
In one possible implementation, the method further includes: a distribution unit; the distribution unit is configured to distribute the device attribute information of the at least two multiple registration protocols to corresponding multiple registration protocol applications after obtaining the device attribute information of the at least two multiple registration protocols.
In one possible implementation, the frame structure of the data packet includes, in addition to the data content field and the ethernet frame structure type, a destination address, an extended destination address, a redundancy field, and a check field.
In a fifth aspect, an embodiment of the present invention provides a transmitting apparatus, including a processor and a memory. The memory is used for storing computer execution instructions; the computer-executable instructions, when executed by the processor, enable the transmitting device to implement the method of any one of the possible designs of the first aspect described above.
In a sixth aspect, an embodiment of the present invention provides a receiving apparatus, including a processor and a memory. The memory is used for storing computer execution instructions; the computer-executable instructions, when executed by the processor, enable the transmitting device to implement the method of any one of the possible designs of the second aspect described above.
In a seventh aspect, embodiments of the present invention further provide a computer-readable storage medium storing a computer program for causing a computer to perform the method of any one of the possible designs of the first aspect or the method of any one of the possible designs of the second aspect.
Advantageous effects concerning the above third to seventh aspects can be seen from the description in the above first or second aspect.
Detailed Description
The technical solutions in the embodiments of the present application are described below with reference to the accompanying drawings in the embodiments of the present application. In the description of embodiments of the application, the terminology used in the embodiments below is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include, for example, "one or more" such forms of expression, unless the context clearly indicates to the contrary. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" means one or more than two (including two). The term "and/or" is used to describe an association relationship of associated objects, meaning that there may be three relationships; for example, a and/or B may represent: a alone, a and B together, and B alone, wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise. The term "coupled" includes both direct and indirect connections, unless stated otherwise. The terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
In embodiments of the invention, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
Fig. 1 is a communication scenario of ethernet data transmission provided in an embodiment of the present invention, where a sending device 100 and a receiving device 200 are connected by an ethernet network, and the sending device 100 sends a data packet to the receiving device by the ethernet network, where the data packet includes a multiple registration protocol data unit MRPDU and an ethernet frame structure type identifier, and the ethernet frame structure type identifier is used to indicate that the MRPDU includes device attribute information of at least two multiple registration protocols. The transmitting device 100 and the receiving device 200 in this scenario include, but are not limited to, terminals, bridges, routers, switches, and the like.
Based on the communication scenario shown in fig. 1, fig. 2 is a schematic diagram of a method for sending and receiving ethernet data according to an embodiment of the present invention, where the sending method and the receiving method include:
s201, the transmitting device determines device attribute information of at least two multiple registration protocols to be transmitted.
S202, the sending equipment encapsulates the equipment attribute information of the at least two multiple registration protocols into a multiple registration protocol data unit MRPDU.
S203, the sending device sends a data packet to the receiving device, wherein the data packet comprises the MRPDU and an Ethernet frame structure type identifier, and the Ethernet frame structure type identifier is used for indicating that the MRPDU comprises device attribute information of the at least two multiple registration protocols.
S204, the receiving device 200 receives a data packet from the transmitting device, where the data packet includes an MRPDU and an ethernet frame structure type identifier.
S205, when the Ethernet frame structure type identifier indicates that the MRPDU includes device attribute information of at least two multiple registration protocols, the receiving device 200 decapsulates the MRPDU according to the Ethernet frame structure type identifier to obtain the device attribute information of the at least two multiple registration protocols.
In some embodiments, the present invention provides an ethernet frame type: uniMRP ethernet frame type by using this type of ethernet frame type, a plurality of different MRP upper layer protocol defined device attribute information can be carried in one ethernet frame. In some embodiments, the MRP upper layer protocol includes MMRP, MVRP, MSRP, MIRP. In addition, the invention also provides a Protocol multiplexing (MRP Protocol Mux) component for processing UniMRP Ethernet frames. The device may save network bandwidth by using UniMRP ethernet frame transmission methods of ethernet frame type.
Specifically, when it is determined that the attribute information of the MRP upper layer Protocol to be transmitted is at least two, the attribute information of the two or more MRP upper layer protocols is encapsulated into one MRPDU to be transmitted through a Protocol multiplexing (MRP Protocol Mux) component, so that the purpose of transmitting the attribute information of the two or more MRP upper layer protocols at a time is achieved. And the protocol multiplexing (MRP Protocol Demux) component is used for carrying out decapsulation according to the Ethernet frame structure type identifier to obtain the attribute information of two or more MRP upper layer protocols, so that the receiving and decapsulation of the equipment attribute information of at least two multiple registration protocols are completed, and the subsequent distribution is facilitated.
In use, the Ethernet frame structure type identifies an MRPDU that enables the MRPDU to be identified as one that contains attribute information for two or more MRP upper layer protocols.
In one possible implementation, the frame structure of the data packet includes, in addition to the data content field and the ethernet frame structure type, a destination address, an extended destination address, a redundancy field, and a check field. Illustratively, as shown in fig. 3, the transmission data contains other frame header overheads in addition to the data content field and the ethernet frame structure type, referred to as per-frame overheads (perFrameOverhead, FOH). The FOH includes a destination address, an extended destination address, a redundancy field, and a check field. For 802.3 Ethernet FOH is 42 bytes, consisting essentially of an 8 byte preamble, a 14 byte Ethernet header field, a4 byte 802.1Q priority and VLAN tag field, a4 byte CRC check field, and a 12 byte intra frame gap (Iter-FRAME GAPS, IFG).
In some embodiments, uniMRP ethernet frame type field occupies 2 bytes. In some embodiments, the value is 0xFFFF (IEEE reserved field).
In some embodiments, the UniMRP destination address (UniMRP Destination Address) field occupies 6 bytes, and the value is not limited, and one of the addresses may be reserved (MRP Application Reserved) using the MRP application. In some embodiments, uniMRP destination addresses are 01-80-C2-00-00-28.
The UniMRP Ethernet frame type of the application is that the MVRP Ethernet frame, the MSRP Ethernet frame type, the MMRP Ethernet frame type and the MIRP Ethernet frame type can be combined into the UniMRP Ethernet frame type data frame for transmission, thereby reducing the use of FOH.
Furthermore, it should be noted that in the prior art, different MRP upper layer protocols send information to maintain different queues, when a certain MRP upper layer protocol needs to send little information (such as only one information), an ethernet frame is also needed to transmit, and other MRP upper layer protocols need to send much information, and cannot multiplex the ethernet frame with little information to transmit. The Ethernet frame type provided by the scheme is as follows: uniMRP Ethernet frame types can be used for multiplexing Ethernet frames, so that the transmission efficiency of the equipment attribute information is improved.
In some embodiments, the ethernet data receiving method further comprises:
s206, when the Ethernet frame structure type identifier indicates that the MRPDU only comprises equipment attribute information of a multiple registration protocol, acquiring the equipment attribute information from the MRPDU according to the Ethernet frame structure type identifier. I.e. when the transmitted MRP device attribute information is only one, it may also be transmitted over UniMRP ethernet frame types.
In some embodiments, after obtaining the device attribute information of the at least two multiple registration protocols, the method further includes: and distributing the equipment attribute information of the at least two multiple registration protocols to corresponding multiple registration protocol applications. That is, when the obtained demultiplexed information is two or more kinds of MRP device attribute information, the demultiplexed information needs to be distributed to corresponding MRP applications for reading.
To more systematically describe the above transmission method, the following description is made with reference to the usage scenario diagrams shown in fig. 8 and 9.
Fig. 4 is a schematic diagram of a device attribute information transceiving process of MRP in the prior art, and fig. 5 is a schematic diagram of a device attribute information transceiving process using UniMRP ethernet frame type according to an embodiment of the present invention.
As shown in fig. 4, the transmitting apparatus and the receiving apparatus (Device) do not employ the attribute information transceiving process of the component, and the transmitting apparatus 100 in the switched network needs to transmit attribute information to the receiving apparatus 200. In some embodiments, the MVRP application needs to send MVRP information, and likewise, the MSRP application and the MMRP application need to send corresponding types of information. However, when transmitting MVRP information, the information of the home MVRP protocol is encapsulated in an MRPDU by an encoding (encoding) component, and is transmitted by using an ethernet frame, where the ethernet frame type of the ethernet frame is MVRP, and other types of information cannot be transmitted, and wait for transmission by using additional ethernet frames. When the receiving device 200 receives the ethernet frame, it recognizes that the ethernet frame is an ethernet frame of an MVRP protocol through the ethernet frame type for MVRP, and the decoding (decoding) component decapsulates the information in the MRPDU and distributes the information to the MVRP application for subsequent processing.
As shown in fig. 5, which is a use scenario in which a device uses a protocol demultiplexing component, a transmitting device 100 in a switched network needs to transmit attribute information to a receiving device 200. In some embodiments, the MVRP application needs to send MVRP information, and similarly, the MSRP application and the MMRP application need to send corresponding types of information, where information belonging to multiple protocols is encapsulated into one MRPDU through a protocol demultiplexing component, and sent by using one ethernet frame, where the ethernet frame type of the ethernet frame is UniMRP. When the receiving device 200 receives the ethernet frame, it recognizes that the ethernet frame is an ethernet frame of a composite MRP through the ethernet frame type UniMRP, and the protocol demultiplexing component decapsulates the information in the MRPDU and distributes the information to the corresponding MRP application for subsequent processing. In some embodiments, the protocol de-multiplexing component de-encapsulates the information in the MRPDU before distributing it to MVRP, MSRP, MMRP or MIRP applications.
To more systematically describe the above transmission method, the following description is made in connection with the ethernet frame multiplexing and demultiplexing diagrams shown in fig. 6 and 7.
Fig. 6 is a schematic flow chart of multiplexing ethernet frames by a protocol multiplexer component according to an embodiment of the present invention, and fig. 7 is a schematic flow chart of demultiplexing ethernet frames by a protocol demultiplexer component according to an embodiment of the present invention.
Taking MVRP, MSRP and MMRP application as transmitting devices as an example, as shown in fig. 6, attribute type marking is performed according to attribute information sent by MVRP, MSRP and MMRP application, then attribute is converted into information, the information is encapsulated into MRPDU, the value of the ethernet frame type field is marked as 0xFFFF, the destination address is marked as UniMRP destination address, and then the ethernet frame is sent out.
As shown in fig. 7, taking the ethernet frame sent in fig. 6 as an example, the receiving device monitors UniMRP destination addresses, determines whether the value of the ethernet frame type field is 0xFFFF, when the value of the ethernet frame type field is 0xFFFF, decapsulates the MRPDU into information, converts the information into an attribute, then determines the type of the attribute, and sends the attribute information of the MVRP, the MSRP and the MMRP to corresponding MVRP, MSRP and MMRP applications, respectively. And when the value of the Ethernet frame type field is not 0xFFFF, acquiring the equipment attribute information from the MRPDU according to the Ethernet frame structure type identification.
In practical use, in a topology network, a device node has 10 attributes that need to be propagated to the network, 11 routes to reach all R device nodes. The device nodes are transmission starting points of the attribute information, the transmission points are the number of LANs, and the R device nodes are transmission receiving points of the attribute information.
Before UniMRP ethernet frame structure types of the present application are not used, it is assumed that 2 pieces of attribute information can be attached to each piece of propagation data, that is, one ethernet frame can only contain 2 pieces of attribute data, the D device node needs to send 5 times, and the consumption of FOH in transmission is 42 bytes multiplied by 5 times multiplied by 11 transmission points=2310 bytes in total except the data itself.
After using UniMRP ethernet frame structure types of the present application, it is assumed that each propagated data can be accompanied by 5 pieces of attribute information, i.e. one ethernet frame can only contain 5 pieces of attribute data, the D device node needs to send 2 times, and the consumption of the network traffic in the transmission is 42 bytes multiplied by 2 times multiplied by 11 transmission points=924 bytes except the data itself.
In addition, according to the requirement of the MRP upper layer protocol, the state storage of the attribute information on the equipment has a life cycle, the default value of the timer of the MRP upper layer protocol is 1000 cS, namely, all the attribute information on the equipment is invalidated every 1000 cS, and the propagation process needs to be carried out again. Then about 8M of network traffic can be saved per minute after using this solution.
It should be noted that in practical use, the topology network may be more complex, for example: there are more device nodes. There may be a scenario where multiple device nodes initiate attribute propagation at the same time, so the benefits of using the ethernet information transmission method of the present application may be more obvious.
Fig. 8 is a schematic diagram of an ethernet data transmitting device according to an embodiment of the present invention, where the device includes:
a determining unit 801, configured to determine device attribute information of at least two multiple registration protocols to be transmitted;
An encapsulating unit 802, configured to encapsulate the device attribute information of the at least two multiple registration protocols into one MRPDU;
A sending unit 803, configured to send a data packet to the receiving device, where the data packet includes the MRPDU and an ethernet frame structure type identifier, and the ethernet frame structure type identifier is used to indicate that the MRPDU includes device attribute information of the at least two multiple registration protocols.
In some embodiments, the frame structure of the data packet includes, in addition to the data content field and the ethernet frame structure type, a destination address, an extended destination address, a redundancy field, and a check field.
Fig. 9 is a schematic diagram of an ethernet data receiving device according to an embodiment of the present invention, where the device includes:
a receiving unit 901, configured to receive a data packet from a transmitting device, where the data packet includes an MRPDU and an ethernet frame structure type identifier;
And a decapsulating unit 902, configured to decapsulate the MRPDU according to the ethernet frame structure type identifier when the ethernet frame structure type identifier indicates that the MRPDU includes device attribute information of at least two multiple registration protocols, so as to obtain the device attribute information of the at least two multiple registration protocols.
In some embodiments, the decapsulating unit 902 is further configured to, when the ethernet frame structure type identifier indicates that the MRPDU includes only device attribute information of one multiple registration protocol, obtain the device attribute information from the MRPDU according to the ethernet frame structure type identifier.
In some embodiments, further comprising: a distribution unit 903;
The distributing unit 903 is configured to distribute the device attribute information of the at least two multiple registration protocols to corresponding multiple registration protocol applications after obtaining the device attribute information of the at least two multiple registration protocols.
The embodiment of the invention provides a transmitting device, which comprises: a memory, a processor;
The memory is used for storing computer execution instructions; when the processor executes the computer-executable instructions, the transmitting device is caused to implement any one of the above-described ethernet data transmission methods applied to the transmitting device.
The embodiment of the invention provides receiving equipment, which comprises the following components: a memory, a processor;
the memory is used for storing computer execution instructions; the processor, when executing the computer-executable instructions, causes the transmitting device to implement any of the above-described ethernet data reception methods applied to the receiving device.
The present invention also provides a computer-readable medium storing a computer program for causing a computer to execute any one of the above ethernet data transmission methods applied to a transmitting device or any one of the above ethernet data reception methods applied to a receiving device.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above. The specific working processes of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which are not described herein.
The functional units in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic or optical disk, and the like.
The foregoing is merely a specific implementation of the embodiment of the present invention, but the protection scope of the embodiment of the present invention is not limited to this, and any changes or substitutions within the technical scope disclosed in the embodiment of the present invention should be covered in the protection scope of the embodiment of the present invention. Therefore, the protection scope of the embodiments of the present invention shall be subject to the protection scope of the claims.