WO2020142880A1 - 一种数据传输方法及装置 - Google Patents

一种数据传输方法及装置 Download PDF

Info

Publication number
WO2020142880A1
WO2020142880A1 PCT/CN2019/070698 CN2019070698W WO2020142880A1 WO 2020142880 A1 WO2020142880 A1 WO 2020142880A1 CN 2019070698 W CN2019070698 W CN 2019070698W WO 2020142880 A1 WO2020142880 A1 WO 2020142880A1
Authority
WO
WIPO (PCT)
Prior art keywords
mac address
crc code
destination mac
payload
ethernet frame
Prior art date
Application number
PCT/CN2019/070698
Other languages
English (en)
French (fr)
Inventor
芬诺曼
王童童
陈李昊
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to JP2021539432A priority Critical patent/JP7247351B2/ja
Priority to PCT/CN2019/070698 priority patent/WO2020142880A1/zh
Priority to EP19908885.7A priority patent/EP3893457B1/en
Priority to CN201980087861.9A priority patent/CN113287285A/zh
Publication of WO2020142880A1 publication Critical patent/WO2020142880A1/zh
Priority to US17/367,017 priority patent/US11799776B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0078Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location
    • H04L1/0083Formatting with frames or packets; Protocol or part of protocol for error control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • H04L12/4645Details on frame tagging
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/66Layer 2 routing, e.g. in Ethernet based MAN's
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/322Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions
    • H04L69/324Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions in the data link layer [OSI layer 2], e.g. HDLC

Definitions

  • the embodiments of the present application relate to computer network technology, and in particular, to a data transmission method and device.
  • Ethernet (Ethernet) is used to transmit Ethernet frames.
  • the Ethernet frame includes a frame header, a payload, and a frame check sequence (Frame Check Sequence, FCS).
  • FCS Frame Check Sequence
  • the network device After receiving the Ethernet frame, the network device verifies whether the frame header and payload have errors according to FCS. If the network device determines that there is no error in the frame header and payload, the network device forwards the Ethernet frame. If the network device forwards the Ethernet frame according to the FCS before checking whether the frame header and the payload have an error, the network device may have forwarded the errored Ethernet frame.
  • Embodiments of the present application provide a data transmission method and device, which are helpful to prevent network equipment from forwarding an erroneous Ethernet frame.
  • an embodiment of the present application provides a data transmission method.
  • the method can be applied to a network device, or the method can be applied to a communication device that can support the network device to implement the method.
  • the communication device includes a chip system and a method. Including: After receiving the Ethernet frame, the network device checks the destination Media Access Control (MAC) address according to the first cyclic redundancy check (CRC) code to determine whether the destination MAC address occurs Error; if the network device determines that the destination MAC address is not in error, the network device forwards the Ethernet frame based on the destination MAC address.
  • the Ethernet frame includes the destination media access control MAC address, the first cyclic redundancy check CRC code and the payload.
  • the parameters of the first CRC code include the destination MAC address, and the parameters of the first CRC code do not include the payload.
  • the network device can determine that a part of the received Ethernet frame is correct according to the first CRC code, and forward it through the direct forwarding method Ethernet frame, to avoid forwarding the Ethernet frame with error.
  • the Ethernet frame further includes a first Ethernet type.
  • the first Ethernet type is used to indicate that the first CRC code is a CRC code, and the parameters of the first CRC code do not include the first Ethernet type;
  • the network device checks the destination MAC address according to the first CRC code, including: the network device determines that the first CRC code is the CRC code according to the first Ethernet type; the network device responds to the first CRC code is the CRC code, Verify the destination MAC address according to the first CRC code.
  • the network device can determine whether to forward the Ethernet frame in a through-forwarding manner based on the verification result. For example, when the destination MAC address has no transmission error, the network device may forward the Ethernet frame by using a straight forwarding method. When the destination MAC address is sent incorrectly, the network device can discard the Ethernet frame.
  • the content checked by the network device according to the first CRC code may also be different.
  • the possible implementations are introduced below.
  • the Ethernet frame further includes a virtual local area network (Virtual Local Area Network, VLAN) tag
  • the parameter of the first CRC code further includes a VLAN tag
  • the network device verifies the destination MAC address according to the first CRC code to determine whether the destination MAC address has an error, including: the network device verifies the destination MAC address and the VLAN tag according to the first CRC code to determine the destination MAC address And VLAN tag error; if the network device determines that the destination MAC address has not occurred, the network device forwards the Ethernet frame based on the destination MAC address, including: if the network device determines that the destination MAC address and VLAN tag have not occurred, Then, the network device forwards the Ethernet frame according to the destination MAC address.
  • VLAN Virtual Local Area Network
  • the Ethernet frame further includes a second Ethernet type, the parameters of the first CRC code also include the second Ethernet type, and the payload includes the protocol Message, the second Ethernet type is used to indicate the protocol type of the protocol message in the payload;
  • the network device checks the destination MAC address according to the first CRC code to determine whether the destination MAC address has an error, including: the network device Check the destination MAC address and the second Ethernet type according to the first CRC code to determine whether an error has occurred in the destination MAC address and the second Ethernet type; if the network device determines that the destination MAC address has no error, the network device determines the destination MAC address
  • the forwarding of the Ethernet frame by the address includes: if the network device determines that the destination MAC address and the second Ethernet type have no errors, the network device forwards the Ethernet frame according to the destination MAC address.
  • the Ethernet frame further includes a source MAC address, and the parameters of the first CRC code further include the source MAC address;
  • a CRC code checks the destination MAC address to determine whether the destination MAC address has an error, including: the network device checks the destination MAC address and the source MAC address according to the first CRC code to determine whether the destination MAC address and the source MAC address occur Error; if the network device determines that the destination MAC address has no error, the network device forwards the Ethernet frame based on the destination MAC address, including: if the network device determines that the destination MAC address and source MAC address have not occurred, the network device The destination MAC address forwards the Ethernet frame.
  • the network device checks the destination MAC address, source MAC address, and VLAN tag according to the first CRC code to determine whether the destination MAC address, source MAC address, and VLAN tag are in error; if the network device determines the destination MAC address, source MAC If there is no error in the address and VLAN tag, the network device forwards the Ethernet frame according to the destination MAC address.
  • the network device checks the destination MAC address, source MAC address, VLAN tag, and second Ethernet type according to the first CRC code to determine whether the destination MAC address, source MAC address, VLAN tag, and second Ethernet type have errors; If the network device determines that the destination MAC address, the source MAC address, the VLAN tag, and the second ether type have no errors, the network device forwards the Ethernet frame according to the destination MAC address.
  • the Ethernet frame further includes a second CRC code
  • the parameters of the second CRC code include the destination MAC address, the source MAC address, and the first ether type , The first CRC code, the VLAN tag, the second ether type, and the payload.
  • the method further includes: the network device according to the second CRC code to the destination MAC address and source MAC address, first ether type, first CRC code, VLAN tag, second ether type and payload are checked to determine the destination MAC address, source MAC address, first ether type, first CRC code, VLAN tag, The second ether type and whether there is an error in the payload.
  • an embodiment of the present application provides a data transmission method.
  • the method can be applied to a network device, or the method can be applied to a communication device that can support the network device to implement the method.
  • the communication device includes a chip system.
  • the method includes: the network device generates an Ethernet frame and sends the Ethernet frame.
  • the Ethernet frame includes the destination MAC address, the first CRC code, and the payload.
  • the parameters of the first CRC code include the destination MAC address, and the parameters of the first CRC code do not include the payload.
  • the receiving device by adding the first CRC code to the Ethernet frame, the receiving device can determine that a part of the received Ethernet frame is correct according to the first CRC code, and forward it through the direct forwarding method Ethernet frame. It avoids that the receiving device will forward the wrong Ethernet frame.
  • the Ethernet frame further includes a first Ethernet type.
  • the first Ethernet type is used to indicate that the first CRC code is a CRC code, and the parameters of the first CRC code do not include the first Ether type.
  • the Ethernet frame further includes a VLAN tag
  • the parameter of the first CRC code further includes the VLAN tag
  • the Ethernet frame further includes a second Ethernet type
  • the parameters of the first CRC code also include the second Ethernet type
  • the payload includes the protocol packet
  • the second ether type is used to indicate the protocol type of the protocol message in the payload.
  • the Ethernet frame further includes the source MAC address.
  • the Ethernet frame further includes a second CRC code
  • the parameters of the second CRC code include the destination MAC address, the source MAC address, and the first ether type , The first CRC code, the VLAN tag, the second ether type, and the payload.
  • the first ether type and the first CRC code may be located after the source MAC address.
  • the first ether type and the first CRC code may be located after the VLAN tag.
  • the number of bits in the first ether type is 16, and the number of bits in the first CRC code is 16.
  • the Ethernet frame may also include a version field and a reserved field.
  • the number of bits in the first ether type is 16, the number of bits in the version field is 1, the number of bits in the reserved field is 3, and the number of bits in the first CRC code is 12.
  • the number of bits in the first ether type is 16, the number of bits in the version field is 1, the number of bits in the reserved field is 15, and the number of bits in the first CRC code is 16.
  • an embodiment of the present application provides a data transmission method.
  • the method can be applied to a network device, or the method can be applied to a communication device that can support the network device to implement the method.
  • the communication device includes a chip system and a method. Including: after receiving the Ethernet frame, the network device checks the destination MAC address and only part of the payload according to the first CRC code, and determines whether the destination MAC address and only part of the payload have an error; if the network device determines the destination MAC Only part of the address and payload have no errors, and the network device forwards the Ethernet frame according to the destination MAC address.
  • the Ethernet frame includes the destination MAC address, the first CRC code and the payload, and the parameters of the first CRC code include only a part of the destination MAC address and the payload.
  • the network device can determine that a part of the received Ethernet frame is correct according to the first CRC code, and forward it through the direct forwarding method Ethernet frame, to avoid forwarding the Ethernet frame with error.
  • the Ethernet frame further includes a first Ethernet type.
  • the first Ethernet type is used to indicate that the first CRC code is a CRC code, and the parameters of the first CRC code do not include the first Ethernet type;
  • the network device checks the destination MAC address according to the first CRC code, including: the network device determines that the first CRC code is the CRC code according to the first Ethernet type; the network device responds to the first CRC code is the CRC code, according to the first A CRC code checks the destination MAC address.
  • the network device can determine whether to forward the Ethernet frame in a through-forwarding manner based on the verification result. For example, when the destination MAC address has no transmission error, the network device may forward the Ethernet frame by using a straight forwarding method. When the destination MAC address is sent incorrectly, the network device can discard the Ethernet frame.
  • the content checked by the network device according to the first CRC code may also be different.
  • the possible implementations are introduced below.
  • the Ethernet frame further includes a VLAN tag
  • the parameter of the first CRC code further includes the VLAN tag
  • the network device uses the first CRC
  • the code verifies only part of the destination MAC address and payload to determine whether there is an error in only part of the destination MAC address and payload, including: the network device checks the destination MAC address, only part of the payload and VLAN according to the first CRC code
  • the tag is checked to determine whether the destination MAC address, only part of the payload, and the VLAN tag have an error; if the network device determines that the destination MAC address and only part of the payload have not occurred, then the network device matches the ether based on the destination MAC address
  • the forwarding of the network frame includes: if the network device determines that the destination MAC address, only a part of the payload, and the VLAN tag have no errors, the network device forwards the Ethernet frame according to the destination MAC address.
  • the Ethernet frame further includes a second Ethernet type, the parameters of the first CRC code also include the second Ethernet type, and the payload includes the protocol Packet, the protocol packet includes the protocol header and the packet payload, the first CRC code includes only a portion of the payload that is at least a portion of the protocol header, and the second ether type is used to indicate the protocol packet in the payload Protocol type;
  • the network device verifies only a part of the destination MAC address and payload according to the first CRC code to determine whether an error occurs in only part of the destination MAC address and payload, including: The destination MAC address, only a part of the payload and the second ether type are checked to determine whether the destination MAC address, only a part of the payload and the second ether type have an error; if the network device determines the destination MAC address and the payload If only a part of the error does not occur, the network device forwards the Ethernet frame according to the destination MAC address
  • the Ethernet frame further includes a source MAC address, and the parameters of the first CRC code further include the source MAC address; the network device A CRC code checks only part of the destination MAC address and payload to determine whether there is an error in only part of the destination MAC address and payload, including: the network device checks only part of the destination MAC address and payload according to the first CRC code Check with the source MAC address to determine whether the destination MAC address, only a part of the payload and the source MAC address have an error; if the network device determines that the destination MAC address and only a part of the payload have no error, the network device determines the destination The forwarding of the Ethernet frame by the MAC address includes: if the network device determines that the destination MAC address, only a part of the payload, and the source MAC address have no errors, the network device forwards the Ethernet frame according to the destination MAC address.
  • the network device verifies only a part of the destination MAC address, source MAC address, VLAN tag and payload according to the first CRC code, and determines whether only a part of the destination MAC address, source MAC address, VLAN tag and payload occurs Error; if the network device determines that only a portion of the destination MAC address, source MAC address, VLAN tag, and payload has not occurred, the network device forwards the Ethernet frame based on the destination MAC address.
  • the network device verifies only the destination MAC address, source MAC address, VLAN tag, second Ethernet type, and payload according to the first CRC code, and determines the destination MAC address, source MAC address, VLAN tag, and second Whether there is an error in only part of the ether type and payload; if the network device determines that the destination MAC address, source MAC address, VLAN tag, second ether type, and only part of the payload have not occurred, the network device responds to the ether based on the destination MAC address Net frames are forwarded.
  • the Ethernet frame further includes a second CRC code
  • the parameters of the second CRC code include the destination MAC address, the source MAC address, and the first ether type , The first CRC code, the VLAN tag, the second ether type, and the payload.
  • the method further includes: the network device according to the second CRC code to the destination MAC address and source MAC address, first ether type, first CRC code, VLAN tag, second ether type and payload are checked to determine the destination MAC address, source MAC address, first ether type, first CRC code, VLAN tag, The second ether type and whether there is an error in the payload.
  • an embodiment of the present application provides a data transmission method.
  • the method can be applied to a network device, or the method can be applied to a communication device that can support the network device to implement the method.
  • the communication device includes a chip system and a method. Including: the network device generates an Ethernet frame and sends the Ethernet frame.
  • the Ethernet frame includes the destination MAC address, the first CRC code and the payload, and the parameters of the first CRC code include only a part of the destination MAC address and the payload.
  • the network device by adding the first CRC code to the Ethernet frame, the network device can determine that a part of the received Ethernet frame is correct according to the first CRC code, and forward it through the direct forwarding method Ethernet frame, to avoid forwarding the Ethernet frame with error.
  • the Ethernet frame further includes a first Ethernet type.
  • the first Ethernet type is used to indicate that the first CRC code is a CRC code, and the parameters of the first CRC code do not include the first Ether type.
  • the Ethernet frame further includes a virtual local area network VLAN tag
  • the parameters of the first CRC code further include a VLAN tag
  • the Ethernet frame further includes a second Ethernet type
  • the parameters of the first CRC code also include the second Ethernet type
  • the payload includes the protocol packet
  • the protocol packet includes the protocol header and the packet payload, only a part of the payload included in the parameters of the first CRC code is at least a part of the protocol header, and the second ether type is used to indicate the protocol type of the protocol packet in the payload .
  • the Ethernet frame further includes the source MAC address.
  • the Ethernet frame further includes a second CRC code
  • the parameters of the second CRC code include the destination MAC address, the source MAC address, and the first ether type , The first CRC code, the VLAN tag, the second ether type, and the payload.
  • the first ether type and the first CRC code may be located after the source MAC address.
  • the first ether type and the first CRC code may be located after the VLAN tag.
  • the number of bits in the first ether type is 16, and the number of bits in the first CRC code is 16.
  • the Ethernet frame may also include a version field and a reserved field.
  • the number of bits in the first ether type is 16, the number of bits in the version field is 1, the number of bits in the reserved field is 3, and the number of bits in the first CRC code is 12.
  • the number of bits in the first ether type is 16, the number of bits in the version field is 1, the number of bits in the reserved field is 15, and the number of bits in the first CRC code is 16.
  • an embodiment of the present application further provides a data transmission device, configured to implement the methods described in the first aspect to the fourth aspect.
  • the data transmission device is a network device or a communication device that supports the network device to implement the methods described in the first to fourth aspects.
  • the communication device includes a chip system.
  • the data transmission device includes: a processing unit, a sending unit, and a receiving unit.
  • the processing unit is used to generate an Ethernet frame; the processing unit is also used to check a part of the Ethernet frame according to the first CRC code.
  • the sending unit is used for sending Ethernet frames.
  • the receiving unit is used for receiving Ethernet frames.
  • the above functional module of the fifth aspect may be implemented by hardware, or may be implemented by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the transceiver is used to complete the functions of the receiving unit and the sending unit
  • the processor is used to complete the functions of the processing unit
  • the memory is used to store the program instructions of the processor to execute the method of the embodiments of the present application.
  • the processor, transceiver and memory are connected through the bus and complete the communication with each other. Specifically, reference may be made to the behavior of the network device in the method described in the first aspect to the method described in the fourth aspect.
  • an embodiment of the present application further provides a data transmission device, configured to implement the methods described in the first aspect to the fourth aspect.
  • the data transmission device is a network device or a communication device that supports the network device to implement the methods described in the first to fourth aspects.
  • the communication device includes a chip system.
  • the data transmission device includes a processor for implementing the functions of the methods described in the first aspect to the fourth aspect.
  • the data transmission device may further include a memory for storing program instructions and data.
  • the memory is coupled to the processor, and the processor can call and execute program instructions stored in the memory to implement the functions in the methods described in the first aspect to the fourth aspect.
  • the data transmission device may further include a communication interface, and the communication interface is used for the data transmission device to communicate with other devices. Exemplarily, if the data transmission device is a network device, the other device is a terminal device.
  • an embodiment of the present application also provides a computer-readable storage medium, including: computer software instructions; when the computer software instructions run in the data transmission device, the data transmission device performs the first to fourth aspects The method described in any aspect.
  • an embodiment of the present application further provides a computer program product containing instructions, which, when the computer program product runs in a data transmission device, causes the data transmission device to perform any of the above first to fourth aspects The method described.
  • an embodiment of the present application provides a chip system.
  • the chip system includes a processor, and may further include a memory, for implementing the function of the network device in the above method.
  • the chip system may be composed of chips, or may include chips and other discrete devices.
  • the name of the data transmission device does not limit the device itself. In actual implementation, these devices may appear under other names. As long as the functions of each device are similar to the embodiments of the present application, they fall within the scope of the claims of the present application and their equivalent technologies.
  • FIG. 1 is a simplified example diagram of a communication system provided by an embodiment of this application.
  • FIG. 2 is a flowchart of a data transmission method provided by an embodiment of the present application.
  • FIG. 3 is a structural example diagram of an Ethernet frame provided by an embodiment of the present application.
  • FIG. 4 is a structural example diagram of another Ethernet frame provided by an embodiment of the present application.
  • FIG. 5 is a structural example diagram of yet another Ethernet frame provided by an embodiment of the present application.
  • FIG. 6 is a structural example diagram of yet another Ethernet frame provided by an embodiment of the present application.
  • FIG. 7 is a structural example diagram of yet another Ethernet frame provided by an embodiment of the present application.
  • FIG. 9 is a diagram illustrating an example of the composition of a data transmission device according to an embodiment of the present application.
  • FIG. 10 is a diagram illustrating an example of the composition of a communication device provided by an embodiment of the present application.
  • the Ethernet type in this application is a 2-byte field in an Ethernet frame.
  • the first ether type is a 2-byte field.
  • the second ether type is a 2-byte field.
  • network equipment can be based on Open Systems Interconnection Communication Reference Model (OSI) or Transmission Control Protocol/Internet Protocol Protocol Family (Transmission Control Protocol/Internet Protocol/Protocol/Protocol Suite, TCP/IP Protocol Suite or TCP/IP Protocols) encapsulates user data into Ethernet frames and transmits the Ethernet frames to the receiving device.
  • OSI Open Systems Interconnection Communication Reference Model
  • TCP/IP Protocol Suite Transmission Control Protocol/Internet Protocol/Protocol/Protocol Suite, TCP/IP Protocol Suite or TCP/IP Protocols
  • the forwarding mode of the Ethernet frame can be divided into a cut-through forwarding (cut-through forwarding) mode and a store-and-forward mode.
  • the so-called store-and-forward method includes: after the device receives all the bits of the Ethernet frame, the Cyclic Redundancy Check (CRC) code included in the Frame Check Sequence (FCS) field in the Ethernet frame Check whether the header and payload in the received Ethernet frame are correct.
  • CRC Cyclic Redundancy Check
  • the outgoing port corresponding to the destination MAC address is searched in the forwarding table according to the destination MAC address in the Ethernet frame. Forward the Ethernet frame through the egress port.
  • CRC is a function to generate a fixed-length check code based on network data packets or computer file data. The CRC is used to detect whether errors occur in the transmitted data or stored data. CRC uses the principles of division and remainder for error detection.
  • the received Ethernet frame is correct means that the received Ethernet frame includes the correct header and payload. If the received Ethernet frame is correct, it can also mean that the received Ethernet frame includes no frame header and no payload error.
  • the received Ethernet frame error means that at least one of the frame header and the payload included in the received Ethernet frame has an error.
  • the received Ethernet frame error may also mean that at least one of the frame header and the payload included in the received Ethernet frame has an error. It can be understood that when the Ethernet frame is detected according to the FCS to determine that the Ethernet frame has an error, at least one of the frame header and the payload included in the Ethernet frame has an error. However, the device cannot determine exactly where the error occurred. For example, the device cannot determine whether the error is specifically an error in the frame header, an error in the payload, or an error in the frame header and the payload.
  • the so-called pass-through forwarding method includes: before receiving the complete Ethernet frame, the device forwards the information in the Ethernet frame to the corresponding egress port according to the relevant information in the Ethernet frame header. That is to say, before the device checks the frame header and payload of the Ethernet frame according to the FCS of the Ethernet frame, the device can forward the information in the Ethernet frame (such as the destination MAC address) via the outgoing port. Compared with the store-and-forward method, the pass-through forwarding method can reduce the length of time that Ethernet frames stay in the device.
  • An error may have occurred in the Ethernet frame received by the device.
  • the device can check the Ethernet frame according to the CRC code carried in the FCS field in the Ethernet frame to determine whether an error has occurred in the Ethernet frame.
  • the device starts forwarding the first bit of the Ethernet frame before receiving the last bit of the Ethernet frame. In other words, the device forwarded the Ethernet frame where the error occurred.
  • Forwarding the errored Ethernet frames causes the occupation of resources and affects the normal Ethernet frame forwarding.
  • TSN Time-Sensitive Networking
  • the embodiments of the present application provide a data transmission method, the basic principle of which is: after receiving an Ethernet frame, the network device checks the destination MAC address according to the first CRC code to determine whether the destination MAC address has an error ; If the network device determines that the destination MAC address is not in error, the network device forwards the Ethernet frame according to the destination MAC address; or, the network device verifies only a portion of the destination MAC address and payload according to the first CRC code to determine Whether the destination MAC address and only a portion of the payload have an error; if the network device determines that the destination MAC address and only a portion of the payload have not occurred, the network device forwards the Ethernet frame based on the destination MAC address.
  • the Ethernet frame includes the destination MAC address, the first CRC code and the payload, the parameters of the first CRC code include the destination MAC address, the parameters of the first CRC code do not include the payload or the parameters of the first CRC code also include the payload Only part of it.
  • the network device can determine that a part of the received Ethernet frame is correct according to the first CRC code, and forward it through the direct forwarding method Ethernet frame, to avoid forwarding the Ethernet frame with error.
  • FIG. 1 shows a simplified example diagram of a communication system to which embodiments of the present application can be applied.
  • the communication system may include: at least one terminal equipment (user equipment (UE) (terminal equipment 101 and terminal equipment 102 shown in FIG. 1) and at least one network equipment (shown in FIG. 1 Network equipment 103 and network equipment 104).
  • the terminal device may be a virtual machine, a host, or a server.
  • the network device can be a router or a bridge.
  • the terminal equipment and the network equipment can be connected by cables or optical fibers.
  • At least one terminal device and at least one network device may belong to the same virtual local area network (Virtual Local Area Network, VLAN), or may belong to different VLANs. Different VLANs can be connected through the gateway.
  • VLAN Virtual Local Area Network
  • FIG. 1 is only a schematic diagram, and the communication system may also include other network devices, such as a switch, which is not shown in FIG. 1.
  • the communication system shown in FIG. 1 may also include other networks, such as a core network.
  • the embodiments of the present application do not limit the number of sites, routers, gateways, and switches included in the communication system.
  • Network equipment and terminal equipment can be deployed on land, including indoor or outdoor, handheld or in-vehicle; they can also be deployed on the water; they can also be deployed on airplanes, balloons and satellites in the air.
  • the embodiments of the present application do not limit the application scenarios of the network device and the terminal device.
  • the sending device may be a station (the starting device for sending Ethernet frames), a router, a bridge, and so on.
  • the sending device may be the terminal device 101 in FIG. 1.
  • the receiving device may be a router, a bridge, etc.
  • the receiving device may be the network device 103 in FIG. 1.
  • FIG. 2 is a flowchart of a data transmission method provided by an embodiment of the present application.
  • the communication system shown in FIG. 1 can perform the method shown in FIG. 2.
  • the method shown in FIG. 2 may include: S201, S202, S203, S204, and S205.
  • the method shown in FIG. 2 may include: S201, S202, S203, S204, and S206.
  • the sending device generates an Ethernet frame.
  • the Ethernet frame includes a frame header, a payload, and a frame check sequence (Frame Check Sequence, FCS).
  • the frame header includes the destination MAC address, the source MAC address, and the first ether type.
  • the destination MAC address is adjacent to the source MAC address.
  • the destination MAC address is in front of the source MAC address.
  • the first ether type is adjacent to the payload.
  • the payload is adjacent to FCS.
  • the first ether type is in front of the payload.
  • the payload is in front of the FCS.
  • IEEE802.3 the number of bytes in the payload is 46 to 1500.
  • the frame header further includes a VLAN tag.
  • the destination MAC address is used to indicate the address of the receiving device that receives the Ethernet frame.
  • the source MAC address is used to indicate the address of the sending device that sends the Ethernet frame.
  • the VLAN tag indicates the VLAN identification.
  • the VLAN tag may be a customer tag (Customer tag, C-tag), a service tag (Service tag, S-tag), or a backbone tag (Backbone tag, B-tag).
  • Customer tag, C-tag Customer tag, C-tag
  • Service tag Service tag
  • S-tag service tag
  • B-tag backbone tag
  • the first ether type is used to indicate the protocol type of the protocol message in the payload.
  • Protocol messages are messages that follow a certain protocol.
  • the protocol message may be an IPv4 message, an address resolution protocol (Address Resolution Protocol, ARP) message, a point-to-point protocol (Point-to-Point Protocol over Ethernet, PPPoE) message, or an IPv6 message.
  • ARP Address Resolution Protocol
  • PPPoE Point-to-Point Protocol over Ethernet
  • IPv6 IPv6 message
  • the first ether type indicates that the protocol type of the protocol packet in the payload is PPPoE.
  • the first ether type indicates that the protocol type of the protocol packet in the payload is IPv6.
  • the first ether type indicates that the protocol type of the protocol packet in the payload is the Multiprotocol Label Switching (MPLS) protocol.
  • MPLS Multiprotocol Label Switching
  • the transmitted Ethernet frame is represented by the number of bits.
  • the task of the physical layer is to transparently transmit the bit stream, which means that the physical layer does not care what each bit represents, and only needs to transmit the bit stream.
  • the sending end sends 1 the receiving end should receive 1, if the receiving end receives 0, it means that the information received by the receiving end has an error.
  • Such errors may cause one or more frames transmitted on the link to be destroyed (bit errors occur, for example, 0 becomes 1 , Or 1 becomes 0), which causes the receiver to receive the error data.
  • bit errors occur, for example, 0 becomes 1 , Or 1 becomes 0
  • detection methods common ones include parity check, Internet check and cyclic redundancy check.
  • the Ethernet frame may include a first CRC code and a second CRC code.
  • the frame header includes the first CRC code.
  • the FCS carries the second CRC code.
  • the CRC code will be described below.
  • the CRC code below may be the first CRC code or the second CRC code.
  • the CRC algorithm it may be a CRC-32 algorithm (CRC-32 algorithm).
  • the parameters of the CRC code are the input data required to calculate the CRC code. It can be understood that the parameter of the CRC code is the dividend required to calculate the CRC code.
  • the parameters required to generate the first CRC code include a part of the Ethernet frame.
  • a part of the Ethernet frame may be the frame header of the Ethernet frame.
  • the frame header includes the destination MAC address, the source MAC address, and the first ether type.
  • the frame header includes the destination MAC address, the source MAC address, the VLAN tag, and the first ether type.
  • part of the Ethernet frame may also be part of the frame header.
  • the parameters required to generate the first CRC code may include the destination MAC address, but not the payload. Further, the parameters required to generate the first CRC code may further include at least one of the source MAC address, the VLAN tag, and the first ether type.
  • the receiving device checks whether an error occurs in a part of the Ethernet frame according to the first CRC code. For example, the receiving device checks whether the destination MAC address of the Ethernet frame has an error according to the first CRC code. Or, the receiving device verifies whether the destination MAC address and the source MAC address of the Ethernet frame have an error according to the first CRC code. Or, the receiving device verifies whether the destination MAC address, source MAC address, and VLAN tag of the Ethernet frame are in error according to the first CRC code. Or, the receiving device verifies whether the destination MAC address, source MAC address, VLAN tag, and first ether type of the Ethernet frame have errors according to the first CRC code.
  • the parameters required to generate the second CRC code may include the destination MAC address, the source MAC address, the first CRC code, the first ether type, and the payload.
  • the receiving device may check whether the destination MAC address, the source MAC address, the first CRC code, the first ether type, and the payload are incorrect according to the second CRC code.
  • the parameters required to generate the second CRC code may include the destination MAC address, the source MAC address, the VLAN tag, the first CRC code, the first ether type, and the payload.
  • the receiving device may check whether the destination MAC address, the source MAC address, the VLAN tag, the first CRC code, the first ether type, and the payload are incorrect according to the second CRC code.
  • the process of generating the CRC code may also include other parameters, and the specific process of generating the CRC code may refer to the prior art, and the embodiments of the present application will not repeat them here.
  • the receiving device may determine whether to forward the Ethernet frame in a through-forwarding manner according to the verification result.
  • the first CRC code may be used to indicate whether to forward the Ethernet frame in a through-forwarding manner. For example, if the receiving device checks a part of the Ethernet frame according to the first CRC code, it is determined that no error has occurred in the Ethernet frame. Furthermore, the receiving device can forward the Ethernet frame according to the pass-through forwarding method. If the receiving device verifies a part of the Ethernet frame according to the first CRC code, it is determined that the Ethernet frame has an error, so that the receiving device avoids forwarding the Ethernet frame by using a straight forwarding method. For example, the receiving device may discard the Ethernet frame or request the sending device to resend the Ethernet frame. For example, when there is no error in the destination MAC address, the receiving device can forward the Ethernet frame by using a straight forwarding method. When an error occurs in the destination MAC address, the receiving device can discard the Ethernet frame.
  • the Ethernet frame further includes a second Ethernet type, and the second Ethernet type is used to indicate that the first CRC code is a CRC code.
  • the parameters of the first CRC code do not include the second ether type.
  • the second ether type can be carried in the frame header. Specifically, it may be located after the source MAC address and before the first CRC code.
  • the second ether type may be adjacent to the source MAC address.
  • the second ether type may be adjacent to the first CRC code.
  • the receiving device may indicate whether to verify a part of the Ethernet frame through the second ether type. For example, after receiving the Ethernet frame, the receiving device may determine that the first CRC code is a CRC code according to the second Ethernet type. Furthermore, the receiving device may check a part of the Ethernet frame according to the first CRC code. When there is no error in the Ethernet frame, the receiving device may forward the Ethernet frame in a through-forwarding manner.
  • the field containing the second ether type and the first CRC code may be referred to as a pass-through frame label.
  • a pass-through frame label For the location of the pass-through frame label field in the Ethernet frame, refer to FIG. 3 to FIG. 7.
  • FIG. 3 is a structural example diagram of an Ethernet frame provided by an embodiment of the present application.
  • the Ethernet frame includes a destination MAC address field, a source MAC address field, a pass-through frame label field, a label field, a first Ethernet type field, a payload field, and an FCS field.
  • the destination MAC address field is used to carry the destination MAC address.
  • the source MAC address field is used to carry the source MAC address.
  • the pass-through forwarding frame label field is used to carry the second ether type and the first CRC code.
  • the tag field is used to carry VLAN tags.
  • the first ether type field is used to carry the first ether type.
  • the payload field is used to carry the payload.
  • the FCS field is used to carry the second CRC code.
  • the frame header of the Ethernet frame includes a destination MAC address field, a source MAC address field, a pass-through frame label field, a label field, and a first Ethernet type field. As shown in FIG. 3, the second ether type and the first CRC code may be located after the source MAC address.
  • the number of bits in the destination MAC address field may be 48 bits (6 bytes).
  • the number of bits in the source MAC address field may be 48 bits.
  • the number of bits in the tag field may be 32 bits (4 bytes).
  • the number of bits in the first ether type field may be 16 bits (2 bytes).
  • the number of bytes in the payload field may be 46-1500 bytes.
  • the number of bits in the FCS field may be 32 bits (4 bytes).
  • the number of bits in the pass-through frame label field may be 32 bits (4 bytes) or 48 bits (6 bytes).
  • the second ether type included in the pass-through frame label field and the number of bits in the first CRC code may have the following implementation manners.
  • the number of bits in the second ether type is 16, and the number of bits in the first CRC code is 16.
  • the Ethernet frame also includes a version field and a reserved field.
  • the version field and the reserved field may be located between the second ether type and the first CRC code.
  • the version field is used to fill in the version number.
  • the reserved field is used to extend the content of the label field of the pass-through forwarding frame.
  • the version number may be used to indicate the range of parameters required to generate the first CRC code.
  • the version number can also be used to indicate reserved fields. For example, when the version number is 1, it indicates the basic version, and when the version number is 2, it indicates the extended version. Understandably, the extended version means that the reserved field has other functions.
  • the version number can be represented by a bit, which can be 0 or 1.
  • Solution two as shown in FIG. 5, the number of bits in the second ether type is 16, the number of bits in the version field is 1, the number of bits in the reserved field is 3, and the number of bits in the first CRC code For 12.
  • Solution three as shown in FIG. 6, the number of bits in the second ether type is 16, the number of bits in the version field is 1, the number of bits in the reserved field is 15, and the number of bits in the first CRC code Is 16.
  • the second ether type and the first CRC code may be located after the VLAN tag.
  • the Ethernet frame reference may be made to the foregoing description of the Ethernet frame in the first achievable manner, and the embodiments of the present application will not repeat them here.
  • the sending device sends an Ethernet frame to the receiving device.
  • the sending device After generating the Ethernet frame, the sending device sends the Ethernet frame. It should be noted that before sending the Ethernet frame, the sending device can first determine whether the receiving device corresponding to the destination MAC address can recognize the pass-through frame label. If the receiving device corresponding to the destination MAC address can recognize the pass-through frame label, the pass-through The forwarding frame label is inserted into the frame header of the Ethernet frame; if the receiving device corresponding to the destination MAC address cannot recognize the pass-through forwarding frame label, there is no need to insert the pass-through forwarding frame label in the Ethernet frame, and only need to send the ether not including the pass-through forwarding frame label Net frame is enough. In practical applications, the device can use other protocols to determine whether the receiving device corresponding to the destination MAC address can recognize the pass-through frame label, such as Link Layer Discovery Protocol (Link Layer Discovery Protocol, LLDP).
  • Link Layer Discovery Protocol Link Layer Discovery Protocol
  • the receiving device receives the Ethernet frame sent by the sending device.
  • Ethernet frame For the explanation of the Ethernet frame, reference may be made to the detailed explanation of S201, and the embodiment of the present application will not repeat them here.
  • the receiving device may be a network switch.
  • the network switch may include multiple ports. Each port can be an Ethernet port.
  • the network switch may include a network processor and memory. The network processor and the memory are coupled.
  • the memory can store computer programs.
  • the network processor can process the received Ethernet frame by executing a computer program.
  • the memory can store the MAC forwarding table.
  • the MAC forwarding table may include multiple entries. Each entry contains the destination MAC address and port identification.
  • the network switch can receive the Ethernet frame sent by the sending device through an Ethernet port.
  • the receiving device may save the Ethernet frame in the memory of the receiving device.
  • the receiving device may serially receive Ethernet frames.
  • the receiving device first receives the most significant bit of the Ethernet frame, and finally receives the least significant bit of the Ethernet frame.
  • the upper 6 bytes of the Ethernet frame are the destination MAC address.
  • the lower 4 bytes of the Ethernet frame are FCS. Therefore, the receiving device first receives the destination MAC address and then receives the FCS.
  • the receiving device determines whether an error occurs in the Ethernet frame.
  • the Ethernet frame can reach the network switch in a bit stream.
  • the bit stream may contain a frame start delimiter (Start of frame delimiter, SFD) and an Ethernet frame. SFD and Ethernet frames are adjacent.
  • the network processor of the network switch can detect the bit stream to determine that the bit stream contains SFD.
  • the network processor may determine that the data after SFD is an Ethernet frame.
  • the network processor can obtain the field of the Ethernet frame from the bit stream according to the structure of the Ethernet frame. For example, the network processor may determine that the 6-byte data after the SFD is the destination MAC address of the Ethernet frame.
  • the network processor can determine that the data of 6 bytes after the destination MAC address is the source MAC address of the Ethernet frame.
  • the network processor may obtain the parameters of the first CRC code and the first CRC code from the Ethernet frame according to the structure of the Ethernet frame.
  • the instructions for implementing the CRC algorithm are stored in the memory.
  • the instruction contains a generator polynomial.
  • the network processor calculates the CRC code by executing instructions according to the parameters of the first CRC code (for example, the destination MAC address).
  • the network processor may determine whether the calculated CRC code is equal to the first CRC code obtained from the Ethernet frame through comparison, thereby determining whether an error has occurred in the Ethernet frame. If the calculated CRC code is equal to the first CRC code acquired from the Ethernet frame, it is determined that no error has occurred. If the calculated CRC code is not equal to the first CRC code acquired from the Ethernet frame, it is determined that an error has occurred.
  • the receiving device does not need to receive a complete Ethernet frame. For example, if the receiving device receives the parameters of the first CRC code and the first CRC code, the receiving device can determine whether an error has occurred in the Ethernet frame. For example, whether the destination MAC address has an error. The receiving device does not need to receive FCS. When the parameter of the first CRC code includes a part of the payload, the receiving device needs to receive a part of the payload, and does not need to receive the complete payload. When the parameter of the first CRC code does not include the payload, the receiving device does not need to receive the payload. Ethernet frames are transmitted serially in the network.
  • the receiving device receives an Ethernet frame is a continuous process, which needs to go through a period of time. Therefore, it takes a period of time for the receiving device to execute S203.
  • the receiving device performing S204 may include acquiring parameters and the first CRC code, calculating the CRC code, and comparing the first CRC code and the calculated CRC code. Therefore, it takes a period of time for the receiving device to execute S204.
  • the receiving device may not complete S203 (the complete Ethernet frame has not been received). However, when the receiving device completes S204, the receiving device may have completed S203 (received a complete Ethernet frame), or may not have completed S203.
  • S204 can be implemented in many different ways. For example, S204 may be implemented in one of S204a to S204e. The possible implementations are introduced below.
  • the receiving device checks the destination MAC address according to the first CRC code, and determines whether the destination MAC address has an error.
  • the parameters of the first CRC code include the destination MAC address. Determining whether the destination MAC address has an error may specifically include: using the destination MAC address as input data (or called dividend), using the generator polynomial corresponding to the CRC algorithm as the divisor, and calculating the remainder. If the calculated remainder is equal to the first CRC code, it is considered that there is no error in the parameters of the first CRC code (including the destination MAC address). If the calculated remainder is not equal to the first CRC code, it is considered that the parameters of the first CRC code (including the destination MAC address) are in error.
  • the receiving device checks the destination MAC address and the source MAC address according to the first CRC code, and determines whether an error occurs in the destination MAC address and the source MAC address.
  • the parameters of the first CRC code include multiple parameters.
  • the first CRC code may be one CRC code or multiple CRC codes. Multiple CRC codes correspond to multiple parameters.
  • the parameters of the first CRC code include multiple parameters. Specifically, the multiple parameters include the destination MAC address and the source MAC address.
  • the destination MAC address and the source MAC address are used as input data (or called dividend), the generator polynomial corresponding to the CRC algorithm is used as the divisor, and the remainder is calculated. If the calculated remainder is equal to the first CRC code, it is considered that the parameters of the first CRC code (including the destination MAC address and the source MAC address) have not occurred an error.
  • the parameters of the first CRC code are in error. It should be noted that, in the scenario where the parameters of the first CRC code are multiple, when it is determined that the parameters of the first CRC code are wrong, according to the CRC algorithm, only at least one of the multiple parameters can be determined to be wrong, but it cannot be Determine where the error occurred. For example, it cannot be determined that the error is specifically the source MAC address error, the destination MAC address or the source MAC address, and the destination MAC address error.
  • the receiving device checks multiple parameters in the Ethernet frame (such as the source MAC address and the destination MAC address involved in S204b) according to the first CRC code, the multiple parameters (such as the source MAC in S204b) are checked. Address and destination MAC address) as a whole to verify.
  • the specific implementation of S204b is described below by taking the first CRC code as multiple CRC codes as an example.
  • the first CRC code is CRC code 1 and CRC code 2.
  • the parameters of the first CRC code include multiple parameters. Specifically, the multiple parameters include the destination MAC address and the source MAC address. CRC code 1 corresponds to the destination MAC address, and CRC code 2 corresponds to the source MAC address.
  • the sending device obtains the CRC code 1 based on the CRC algorithm and the destination MAC address.
  • the sending device obtains the CRC code 2 based on the CRC algorithm and the source MAC address.
  • the receiving device takes the destination MAC address in the received Ethernet frame as input data (or called dividend), uses the generator polynomial corresponding to the CRC algorithm as the divisor, and calculates the remainder. If the calculated remainder is equal to the CRC code 1 in the received Ethernet frame, it is considered that there is no error in the destination MAC address in the received Ethernet frame. If the calculated remainder is not equal to CRC code 1, it is considered that the destination MAC address in the received Ethernet frame has an error.
  • the receiving device takes the source MAC address in the received Ethernet frame as input data (or called dividend), uses the generator polynomial corresponding to the CRC algorithm as the divisor, and calculates the remainder.
  • the scheme that the first CRC code is a plurality of CRC codes can not only determine that at least one of the parameters of the first CRC code has an error, but also determine that the error occurred specifically in where. For example, it can be determined that the error is specifically the source MAC address error, the destination MAC address or the source MAC address, and the destination MAC address error.
  • the receiving device checks the destination MAC address, the source MAC address and the VLAN tag according to the first CRC code, and determines whether the destination MAC address, the source MAC address and the VLAN tag have errors.
  • the receiving device determines that there is no error in the destination MAC address, source MAC address and VLAN tag, execute S205; if the receiving device determines that the destination MAC address, source MAC address and VLAN tag have errors, execute S206.
  • Mode four if the parameters of the first CRC code include the destination MAC address, the source MAC address, and the first ether type, execute S204d.
  • the receiving device checks the destination MAC address, the source MAC address, and the first ether type according to the first CRC code to determine whether an error has occurred in the destination MAC address, the source MAC address, and the first ether type.
  • the receiving device determines that the destination MAC address, source MAC address, and first ether type have no errors, execute S205; if the receiving device determines that the destination MAC address, source MAC address, and first ether type have errors, execute S206.
  • the receiving device checks the destination MAC address, the source MAC address, the VLAN tag, and the first ether type according to the first CRC code, and determines whether the destination MAC address, the source MAC address, the VLAN tag, and the first ether type have errors.
  • the receiving device determines that the destination MAC address, source MAC address, VLAN tag, and first ether type have no errors, execute S205; if the receiving device determines that the destination MAC address, source MAC address, VLAN tag, and first ether type have errors, execute S206 .
  • the receiving device forwards the Ethernet frame according to the destination MAC address.
  • the receiving device forwards the Ethernet frame through a direct forwarding method.
  • the network processor uses the destination MAC address in the Ethernet frame as a search key, and searches for an entry in the MAC forwarding table that matches the destination MAC address in the Ethernet frame. According to the identifier of the port in the matching entry, determine the outgoing port used to forward the Ethernet frame. The outgoing port used to forward the Ethernet frame is the port indicated by the identifier of the port in the matching entry.
  • the network processor sends the Ethernet frame via the port.
  • the receiving device discards the Ethernet frame or sends a retransmission request message to the sending device.
  • the receiving device determines that an error has occurred in the Ethernet frame according to S204. This error may be caused by the transmission of the Ethernet frame from the sending device to the receiving device. Since the receiving device determines that the Ethernet frame has an error according to S204, the receiving device does not need to use the destination MAC address in the Ethernet frame as a search key to search for an entry in the MAC forwarding table that matches the destination MAC address in the Ethernet frame. In other words, the receiving device can discard the Ethernet frame without looking up the MAC forwarding table. For example, the network processor may delete the Ethernet frames stored in the memory.
  • the retransmission request message is used to instruct the sending device to resend the Ethernet frame.
  • the method further includes: receiving the destination MAC address, source MAC address, VLAN tag, and second Ethernet type according to the second CRC code , The first CRC code, the first ether type and the payload are checked to determine whether the destination MAC address, source MAC address, VLAN tag, second ether type, first CRC code, first ether type and payload have errors .
  • the receiving device can forward the Ethernet frame through the direct forwarding mode when the receiving device can determine that a part of the received Ethernet frame is correct according to the first CRC code to avoid errors. Ethernet frames are forwarded.
  • FIG. 8 is a flowchart of another data transmission method provided by an embodiment of the present application.
  • the method may include S801-S805.
  • the method may include S801-S804 and S806.
  • the method shown in FIG. 8 is obtained by extending the method shown in FIG. 2.
  • the parameters of the first CRC code include not only the destination MAC address but also only a part of the payload.
  • the parameter of the first CRC code includes only a part of the payload means that the parameter of the first CRC code includes a part of the payload, but does not include all of the payload.
  • the sending device generates an Ethernet frame.
  • the parameters required to generate the first CRC code include not only a part of the Ethernet frame (eg, destination MAC address), but also only a part of the payload.
  • the payload includes the protocol packet, and the protocol packet includes the protocol header and the packet payload. Only a part of the payload may be at least a part of the protocol header.
  • the protocol message may be an IP message.
  • the protocol header may be an IP header.
  • the message payload can be an IP payload. Only a part of the payload may be the destination IP address in the IP header. Only a part of the payload may also be the destination IP address and source IP address in the IP header.
  • the payload may also include other fields of the IP packet header.
  • the other fields may be a version field, a service type (type of service) field or a protocol (protocol) field. This embodiment of the present application does not limit this.
  • the receiving device verifies whether the destination MAC address of the Ethernet frame and only a part of the payload have an error according to the first CRC code; or, the receiving device verifies the destination MAC address and the source MAC address of the Ethernet frame according to the first CRC code And only part of the payload has an error; or, the receiving device verifies whether the destination MAC address, source MAC address, VLAN tag, and only part of the payload of the Ethernet frame have an error based on the first CRC code; or, the receiving device has The first CRC code checks whether the destination MAC address, the source MAC address, the VLAN tag, the first ether type, and the payload of the Ethernet frame are in error.
  • the sending device sends an Ethernet frame to the receiving device.
  • the receiving device receives the Ethernet frame sent by the sending device.
  • the receiving device determines whether an error occurs in the Ethernet frame.
  • the parameter of the first CRC code further includes only a part of the payload.
  • the network processor may obtain the parameters of the first CRC code and the first CRC code from the Ethernet frame according to the structure of the Ethernet frame.
  • the network processor obtains only a part of the payload from the Ethernet frame, it can determine the structure of the payload according to the value of the first ether type in the Ethernet frame. Thus, only a part of the payload is obtained from the payload. For example, when it is determined that the value of the first ether type is 0x0800, the network processor may determine that the payload contains an IPv4 packet.
  • the network processor may obtain the parameters of the first CRC code from the payload according to the format of the IPv4 message.
  • only a part of the payload refers to the protocol field, source IP address field, and destination IP address field in the IPv4 header.
  • the network processor may determine that the number of bytes in the protocol field is 1, the number of bytes in the source IP address field is 4, and the number of bytes in the destination IP address field is 4 according to the format of the IPv4 message.
  • the protocol field is located in the 10th byte of the payload
  • the source IP address field is located in the 13th to 16th byte of the payload
  • the destination IP address field is located in the 17th to 20th byte of the payload.
  • the instructions for implementing the CRC algorithm are stored in the memory.
  • the instruction contains a generator polynomial.
  • the network processor calculates the CRC code by executing instructions based on the parameters of the first CRC code (e.g., destination MAC address, protocol field, source IP address field, and destination IP address field).
  • the network processor may determine whether the calculated CRC code is equal to the first CRC code acquired from the Ethernet frame through comparison, thereby determining whether an error has occurred in the Ethernet frame. If the calculated CRC code is equal to the first CRC code acquired from the Ethernet frame, it is determined that no error has occurred. If the calculated CRC code is not equal to the first CRC code acquired from the Ethernet frame, it is determined that an error has occurred.
  • S804 can be implemented in many different ways.
  • S804 may be implemented in one of S804a to S804e. The possible implementations are introduced below.
  • the receiving device verifies only a part of the destination MAC address and payload according to the first CRC code, and determines whether an error occurs in only the part of the destination MAC address and payload.
  • the parameters of the first CRC code involved in each scheme in S804a to S804e include multiple parameters.
  • the first CRC code may be one CRC code or multiple CRC codes. Multiple CRC codes correspond to multiple parameters.
  • the parameters of the first CRC code involved in S204b are different from the parameters of the first CRC code involved in S804a. For example, the parameters of the first CRC code involved in S204b do not involve the payload, and the parameters of the first CRC code involved in S804a involve the payload. However, the parameters of the first CRC code involved in S204b are multiple parameters.
  • the parameters of the first CRC code involved in S804a are also multiple parameters. Therefore, for the specific implementation manner of S804a, reference may be made to the description of S204b in the specification of this application, and details are not described here.
  • the receiving device checks the destination MAC address, the source MAC address, and only a part of the payload according to the first CRC code, and determines whether the destination MAC address, source MAC address, and only a part of the payload have an error.
  • the receiving device determines that there is no error in only part of the destination MAC address, source MAC address and payload, execute S805; if the receiving device determines that there is an error in only part of the destination MAC address, source MAC address and payload, execute S806.
  • the receiving device verifies only a part of the destination MAC address, source MAC address, VLAN tag, and payload according to the first CRC code, and determines whether only a part of the destination MAC address, source MAC address, VLAN tag, and payload has an error. .
  • the receiving device determines that there is no error in only part of the destination MAC address, source MAC address, VLAN tag and payload, execute S805; if the receiving device determines that there is an error in only part of the destination MAC address, source MAC address, VLAN tag and payload, Go to S806.
  • Mode four if the parameters of the first CRC code include the destination MAC address, the source MAC address, the first ether type, and only a part of the payload, S804d is executed.
  • the receiving device verifies only part of the destination MAC address, source MAC address, first ether type, and payload according to the first CRC code, and determines only the destination MAC address, source MAC address, first ether type, and payload. Whether part of the error occurred.
  • the receiving device determines that there is no error in only part of the destination MAC address, source MAC address, first ether type, and payload, execute S805; if the receiving device determines only the destination MAC address, source MAC address, first ether type, and payload If an error occurs in part, execute S806.
  • the receiving device checks the destination MAC address, source MAC address, VLAN tag, first ether type, and only a part of the payload according to the first CRC code, and determines the destination MAC address, source MAC address, VLAN tag, and first ether Whether an error occurred in only part of the type and payload.
  • the receiving device determines that only a part of the destination MAC address, source MAC address, VLAN tag, first ether type, and payload have no errors, execute S805; if the receiving device determines the destination MAC address, source MAC address, VLAN tag, first ether An error occurs in only part of the type and payload, and S806 is executed.
  • the receiving device forwards the Ethernet frame according to the destination MAC address.
  • the receiving device forwards the Ethernet frame through a direct forwarding method.
  • a direct forwarding method For specific implementation of S805, reference may be made to the description of S205 in the embodiment.
  • the receiving device discards the Ethernet frame or sends a retransmission request message to the sending device.
  • the retransmission request message is used to instruct the sending device to resend the Ethernet frame.
  • the method further includes: receiving the destination MAC address, source MAC address, VLAN tag, and second Ethernet type according to the second CRC code , The first CRC code, the first ether type and the payload are checked to determine whether the destination MAC address, source MAC address, VLAN tag, second ether type, first CRC code, first ether type and payload have errors .
  • the receiving device can forward the Ethernet frame through the direct forwarding mode when the receiving device can determine that a part of the received Ethernet frame is correct according to the first CRC code to avoid errors. Ethernet frames are forwarded.
  • each network element such as a sending device and a receiving device, includes a hardware structure and/or a software module corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driven hardware depends on the specific application of the technical solution and design constraints. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
  • the sending device and the receiving device may be divided into function modules according to the above method examples.
  • each function module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above integrated modules can be implemented in the form of hardware or software function modules. It should be noted that the division of the modules in the embodiments of the present application is schematic, and is only a division of logical functions. In actual implementation, there may be another division manner.
  • FIG. 9 shows a schematic diagram of a possible composition of a data transmission device.
  • the data transmission device can execute the method described in the above embodiment.
  • the data transmission device shown in FIG. 9 can perform the steps performed by the network device shown in FIG. 2 or 8.
  • the network device may be a sending device or a receiving device.
  • the data transmission device is a network device or a communication device that supports the network device to implement the method provided in the embodiment.
  • the communication device may be a chip system.
  • the data transmission device may include a receiving unit 901, a processing unit 902, and a sending unit 903.
  • the receiving unit 901 is used to support the data transmission device to execute the method described in the embodiments of the present application.
  • the receiving unit 901 is used to execute or to support the data transmission device to execute S203 in the data transmission method shown in FIG. 2.
  • the receiving unit 901 is used to execute or to support the data transmission device to execute S803 in the data transmission method shown in FIG. 8.
  • the processing unit 902 is configured to execute or support the data transmission device to execute S204 in the data transmission method shown in FIG. 2. For example, S204a to S204e are executed.
  • the processing unit 902 is configured to execute or support the data transmission device to execute S804 in the data transmission method shown in FIG. 8. For example, S804a to S804e are executed.
  • the sending unit 903 is used to execute or to support the data transmission device to execute S205 to S206 in the data transmission method shown in FIG. 2.
  • the sending unit 903 is used to execute or to support the data transmission device to execute S805 to S806 in the data transmission method shown in FIG. 8.
  • the processing unit 902 is used to support the data transmission device to execute the method described in the embodiments of the present application.
  • the processing unit 902 is used to execute or to support the data transmission device to execute S201 in the data transmission method shown in FIG. 2.
  • the processing unit 902 is configured to execute or support the data transmission device to execute S801 in the data transmission method shown in FIG. 8.
  • the sending unit 903 is configured to execute or support the data transmission device to execute S202 in the data transmission method shown in FIG. 2.
  • the sending unit 903 is used to execute or to support the data transmission device to execute S802 in the data transmission method shown in FIG. 8.
  • the data transmission device provided by the embodiment of the present application is used to execute the method of any of the above embodiments, and therefore can achieve the same effect as the method of the above embodiment.
  • a communication device 1000 provided by an embodiment of the present application is used to implement the functions of the network device in the foregoing embodiment.
  • the communication device 1000 may perform the method shown in FIG. 2 or FIG. 8.
  • the communication device 1000 may be a network device or a device in a network device.
  • the communication device 1000 may be a chip system.
  • the chip system may be composed of chips, or may include chips and other discrete devices.
  • the communication device 1000 includes at least one processor 1001 for implementing the method provided by the embodiment of the present application.
  • the processor 1001 may be used to check the destination MAC address according to the first CRC code, determine whether the destination MAC address has an error, and so on.
  • the processor 1001 may be used to check the destination MAC address according to the first CRC code, determine whether the destination MAC address has an error, and so on.
  • the communication device 1000 may further include at least one memory 1002 for storing program instructions and/or data.
  • the memory 1002 and the processor 1001 are coupled.
  • the coupling in the embodiments of the present application is an indirect coupling or communication connection between devices, units or modules, and may be in electrical, mechanical or other forms, and is used for information interaction between devices, units or modules.
  • the processor 1001 may cooperate with the memory 1002.
  • the processor 1001 may execute program instructions stored in the memory 1002. At least one of the at least one memory may be included in the processor.
  • the communication device 1000 may further include a communication interface 1003 for communicating with other devices through a transmission medium, so that the devices in the communication device 1000 can communicate with other devices.
  • a communication interface 1003 for communicating with other devices through a transmission medium, so that the devices in the communication device 1000 can communicate with other devices.
  • the communication device is a network device
  • the other device is a terminal device.
  • the processor 1001 uses the communication interface 1003 to send and receive data, and is used to implement the method performed by the network device described in the embodiments corresponding to FIG. 2 and FIG. 8.
  • the embodiment of the present application does not limit the specific connection medium between the communication interface 1003, the processor 1001, and the memory 1002.
  • the communication interface 1003, the processor 1001, and the memory 1002 are connected by a bus 1004.
  • the bus is shown by a thick line in FIG. 10, and the connection mode between other components is only for schematic illustration. , Not to limit.
  • the bus can be divided into an address bus, a data bus, and a control bus. For ease of representation, only a thick line is used in FIG. 10, but it does not mean that there is only one bus or one type of bus.
  • the structure shown in the communication device 1000 shown in FIG. 10 is a possible implementation manner of the data transmission device shown in FIG. 9.
  • the communication interface 1003 may be used to implement the receiving unit 901 and the sending unit 903.
  • the processor 1001 can implement the processing unit 902 by executing the program in the memory 1002.
  • the processor may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, which may be implemented or Perform the disclosed methods, steps, and logical block diagrams in the embodiments of the present application.
  • the general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied and executed by a hardware processor, or may be executed and completed by a combination of hardware and software modules in the processor.
  • the memory may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory).
  • a non-volatile memory such as a hard disk drive (HDD) or a solid-state drive (SSD), etc.
  • a volatile memory volatile memory
  • random access memory random-access memory, RAM
  • the memory is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
  • the memory in the embodiment of the present application may also be a circuit or any other device capable of realizing a storage function, which is used to store program instructions and/or data.
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the module or unit is only a division of logical functions.
  • there may be another division manner for example, multiple units or components may be The combination can either be integrated into another device, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical, or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed in multiple different places . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or software function unit.
  • the methods provided in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software When implemented using software, it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer program instructions When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part.
  • the computer may be a general-purpose computer, a dedicated computer, a computer network, a network device, a terminal, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be from a website site, computer, server or data center Transmission to another website, computer, server or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device including a server, a data center, and the like integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, digital video disc (DVD)), or a semiconductor medium (for example, SSD), or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

本申请公开了一种数据传输方法及装置,涉及计算机网络技术。用于避免网络设备转发发生错误的以太网帧的问题。具体方案为:网络设备接收以太网帧,并根据第一CRC码对目的MAC地址进行校验,确定目的MAC地址是否发生错误;如果网络设备确定目的MAC地址没有发生错误,则根据目的MAC地址对以太网帧进行转发。其中,以太网帧包括目的MAC地址、第一CRC码以及净荷,第一CRC码的参数包括目的MAC地址,第一CRC码的参数不包括净荷。本申请实施例用于转发以太网帧的过程中。

Description

一种数据传输方法及装置 技术领域
本申请实施例涉及计算机网络技术,尤其涉及一种数据传输方法及装置。
背景技术
以太网(Ethernet)用于传输以太网帧。以太网帧包括帧头、净荷以及帧校验序列(Frame Check Sequence,FCS)。网络设备接收到以太网帧后,根据FCS对帧头以及净荷是否发生错误进行校验。如果网络设备确定帧头以及净荷没有发生错误,则网络设备对以太网帧进行转发。如果网络设备根据FCS对帧头以及净荷是否发生错误进行校验之前,就对以太网帧进行转发,则网络设备可能转发了发生错误的以太网帧。
发明内容
本申请实施例提供一种数据传输方法及装置,有助于避免网络设备转发发生错误的以太网帧。
为达到上述目的,本申请实施例采用如下技术方案:
第一方面,本申请实施例提供了一种数据传输方法,该方法可应用于网络设备,或者该方法可应用于可以支持网络设备实现该方法的通信装置,例如该通信装置包括芯片系统,方法包括:网络设备接收到以太网帧后,根据第一循环冗余校验(Cyclic Redundancy Check,CRC)码对目的媒体访问控制(Media Access Control,MAC)地址进行校验,确定目的MAC地址是否发生错误;如果网络设备确定目的MAC地址没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发。其中,以太网帧包括目的媒体访问控制MAC地址、第一循环冗余校验CRC码以及净荷,第一CRC码的参数包括目的MAC地址,第一CRC码的参数不包括净荷。本申请实施例提供的数据传输方法,通过在以太网帧中增加第一CRC码,使得网络设备能够根据第一CRC码确定接收到的以太网帧的一部分正确的情况下,通过直通转发方式转发以太网帧,避免将发生错误的以太网帧进行转发。
结合第一方面,在第一种可能的实现方式中,以太网帧还包括第一以太类型,第一以太类型用于指示第一CRC码是CRC码,第一CRC码的参数不包括第一以太类型;所述网络设备根据第一CRC码对目的MAC地址进行校验,包括:网络设备根据第一以太类型确定第一CRC码是CRC码;网络设备响应于第一CRC码是CRC码,根据第一CRC码对目的MAC地址进行校验。网络设备可以根据校验结果确定是否采用直通转发方式转发以太网帧。例如,当目的MAC地址没有发送错误时,网络设备可以采用直通转发方式转发以太网帧。当目的MAC地址发送错误时,网络设备可以丢弃以太网帧。
根据生成第一CRC码需要的参数不同,网络设备根据第一CRC码校验的内容也可以不同。下面分别介绍可能的实现方式。
结合第一方面或第一种可能的实现方式,在第二种可能的实现方式中,以太网帧还包括虚拟局域网(Virtual Local Area Network,VLAN)标签,第一CRC码的参数还 包括VLAN标签;所述网络设备根据第一CRC码对目的MAC地址进行校验,确定目的MAC地址是否发生错误,包括:网络设备根据第一CRC码对目的MAC地址和VLAN标签进行校验,确定目的MAC地址和VLAN标签是否发生错误;所述如果网络设备确定目的MAC地址没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发,包括:如果网络设备确定目的MAC地址和VLAN标签没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发。
结合第一方面或第一种可能的实现方式,在第三种可能的实现方式中,以太网帧还包括第二以太类型,第一CRC码的参数还包括第二以太类型,净荷包括协议报文,第二以太类型用于指示净荷中的协议报文的协议类型;所述网络设备根据第一CRC码对目的MAC地址进行校验,确定目的MAC地址是否发生错误,包括:网络设备根据第一CRC码对目的MAC地址和第二以太类型进行校验,确定目的MAC地址和第二以太类型是否发生错误;所述如果网络设备确定目的MAC地址没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发,包括:如果网络设备确定目的MAC地址和第二以太类型没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发。
结合第一方面或第一种可能的实现方式,在第四种可能的实现方式中,以太网帧还包括源MAC地址,第一CRC码的参数还包括源MAC地址;所述网络设备根据第一CRC码对目的MAC地址进行校验,确定目的MAC地址是否发生错误,包括:网络设备根据第一CRC码对目的MAC地址和源MAC地址进行校验,确定目的MAC地址和源MAC地址是否发生错误;所述如果网络设备确定目的MAC地址没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发,包括:如果网络设备确定目的MAC地址和源MAC地址没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发。
可选的,上述第二种可能的实现方式至第四种可能的实现方式可以结合进行校验。
示例的,网络设备根据第一CRC码对目的MAC地址、源MAC地址和VLAN标签进行校验,确定目的MAC地址、源MAC地址和VLAN标签是否发生错误;如果网络设备确定目的MAC地址、源MAC地址和VLAN标签没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发。
示例的,网络设备根据第一CRC码对目的MAC地址、源MAC地址、VLAN标签和第二以太类型进行校验,确定目的MAC地址、源MAC地址、VLAN标签和第二以太类型是否发生错误;如果网络设备确定目的MAC地址、源MAC地址、VLAN标签和第二以太类型没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发。
结合第一方面或上述可能的实现方式,在第五种可能的实现方式中,以太网帧还包括第二CRC码,第二CRC码的参数包括目的MAC地址、源MAC地址、第一以太类型、第一CRC码、VLAN标签、第二以太类型以及净荷。
结合第五种可能的实现方式,在第六种可能的实现方式中,网络设备根据目的MAC地址对以太网帧进行转发之后,方法还包括:网络设备根据第二CRC码对目的MAC地址、源MAC地址、第一以太类型、第一CRC码、VLAN标签、第二以太类 型以及净荷进行校验,从而确定目的MAC地址、源MAC地址、第一以太类型、第一CRC码、VLAN标签、第二以太类型以及净荷是否发生错误。
第二方面,本申请实施例提供了一种数据传输方法,该方法可应用于网络设备,或者该方法可应用于可以支持网络设备实现该方法的通信装置,例如该通信装置包括芯片系统。方法包括:网络设备生成以太网帧,并发送以太网帧。其中,以太网帧包括目的MAC地址、第一CRC码以及净荷,第一CRC码的参数包括目的MAC地址,第一CRC码的参数不包括净荷。本申请实施例提供的数据传输方法,通过在以太网帧中增加第一CRC码,使得接收设备能够根据第一CRC码确定接收到的以太网帧的一部分正确的情况下,通过直通转发方式转发以太网帧。避免了接收设备将发生错误的以太网帧进行转发。
结合第二方面,在第一种可能的实现方式中,以太网帧还包括第一以太类型,第一以太类型用于指示第一CRC码是CRC码,第一CRC码的参数不包括第一以太类型。
结合第二方面或第一种可能的实现方式,在第二种可能的实现方式中,以太网帧还包括VLAN标签,第一CRC码的参数还包括VLAN标签。
结合第二方面或上述可能的实现方式,在第三种可能的实现方式中,以太网帧还包括第二以太类型,第一CRC码的参数还包括第二以太类型,净荷包括协议报文,第二以太类型用于指示净荷中的协议报文的协议类型。
结合第二方面或上述可能的实现方式,在第四种可能的实现方式中,以太网帧还包括源MAC地址。
结合第二方面或上述可能的实现方式,在第五种可能的实现方式中,以太网帧还包括第二CRC码,第二CRC码的参数包括目的MAC地址、源MAC地址、第一以太类型、第一CRC码、VLAN标签、第二以太类型以及净荷。
需要说明的是,在上述任意方面中,第一以太类型和第一CRC码可以位于源MAC地址之后。或者,第一以太类型和第一CRC码可以位于VLAN标签之后。其中,第一以太类型中的比特的数量为16,第一CRC码中的比特的数量为16。
另外,以太网帧还可以包括版本字段和保留字段。其中,第一以太类型中的比特的数量为16,版本字段中的比特的数量为1,保留字段中的比特的数量为3,第一CRC码中的比特的数量为12。或者,第一以太类型中的比特的数量为16,版本字段中的比特的数量为1,保留字段中的比特的数量为15,第一CRC码中的比特的数量为16。
第三方面,本申请实施例提供了一种数据传输方法,该方法可应用于网络设备,或者该方法可应用于可以支持网络设备实现该方法的通信装置,例如该通信装置包括芯片系统,方法包括:网络设备接收到以太网帧后,根据第一CRC码对目的MAC地址和净荷的仅仅一部分进行校验,确定目的MAC地址和净荷的仅仅一部分是否发生错误;如果网络设备确定目的MAC地址和净荷的仅仅一部分没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发。其中,以太网帧包括目的MAC地址、第一CRC码以及净荷,第一CRC码的参数包括目的MAC地址和净荷的仅仅一部分。本申请实施例提供的数据传输方法,通过在以太网帧中增加第一CRC码,使得网络设备能够根据第一CRC码确定接收到的以太网帧的一部分正确的情况下,通过直通转发方式转发以太网帧,避免将发生错误的以太网帧进行转发。
结合第三方面,在第一种可能的实现方式中,以太网帧还包括第一以太类型,第一以太类型用于指示第一CRC码是CRC码,第一CRC码的参数不包括第一以太类型;网络设备根据第一CRC码对目的MAC地址进行校验,包括:网络设备根据第一以太类型确定第一CRC码是CRC码;网络设备响应于第一CRC码是CRC码,根据第一CRC码对目的MAC地址进行校验。网络设备可以根据校验结果确定是否采用直通转发方式转发以太网帧。例如,当目的MAC地址没有发送错误时,网络设备可以采用直通转发方式转发以太网帧。当目的MAC地址发送错误时,网络设备可以丢弃以太网帧。
根据生成第一CRC码需要的参数不同,网络设备根据第一CRC码校验的内容也可以不同。下面分别介绍可能的实现方式。
结合第三方面或第一种可能的实现方式,在第二种可能的实现方式中,以太网帧还包括VLAN标签,第一CRC码的参数还包括VLAN标签;所述网络设备根据第一CRC码对目的MAC地址和净荷的仅仅一部分进行校验,确定目的MAC地址和净荷的仅仅一部分是否发生错误,包括:网络设备根据第一CRC码对目的MAC地址、净荷的仅仅一部分和VLAN标签进行校验,确定目的MAC地址、净荷的仅仅一部分和VLAN标签是否发生错误;所述如果网络设备确定目的MAC地址和净荷的仅仅一部分没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发,包括:如果网络设备确定目的MAC地址、净荷的仅仅一部分和VLAN标签没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发。
结合第三方面或第一种可能的实现方式,在第三种可能的实现方式中,以太网帧还包括第二以太类型,第一CRC码的参数还包括第二以太类型,净荷包括协议报文,协议报文包括协议头以及报文净荷,第一CRC码的参数包括的净荷的仅仅一部分为协议头的至少一部分,第二以太类型用于指示净荷中的协议报文的协议类型;所述网络设备根据第一CRC码对目的MAC地址和净荷的仅仅一部分进行校验,确定目的MAC地址和净荷的仅仅一部分是否发生错误,包括:网络设备根据第一CRC码对目的MAC地址、净荷的仅仅一部分和第二以太类型进行校验,确定目的MAC地址、净荷的仅仅一部分和第二以太类型是否发生错误;所述如果网络设备确定目的MAC地址和净荷的仅仅一部分没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发,包括:如果网络设备确定目的MAC地址、净荷的仅仅一部分和第二以太类型没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发。
结合第三方面或第一种可能的实现方式,在第四种可能的实现方式中,以太网帧还包括源MAC地址,第一CRC码的参数还包括源MAC地址;所述网络设备根据第一CRC码对目的MAC地址和净荷的仅仅一部分进行校验,确定目的MAC地址和净荷的仅仅一部分是否发生错误,包括:网络设备根据第一CRC码对目的MAC地址、净荷的仅仅一部分和源MAC地址进行校验,确定目的MAC地址、净荷的仅仅一部分和源MAC地址是否发生错误;所述如果网络设备确定目的MAC地址和净荷的仅仅一部分没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发,包括:如果网络设备确定目的MAC地址、净荷的仅仅一部分和源MAC地址没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发。
可选的,上述第二种可能的实现方式至第四种可能的实现方式可以结合进行校验。
示例的,网络设备根据第一CRC码对目的MAC地址、源MAC地址、VLAN标签和净荷的仅仅一部分进行校验,确定目的MAC地址、源MAC地址、VLAN标签和净荷的仅仅一部分是否发生错误;如果网络设备确定目的MAC地址、源MAC地址、VLAN标签和净荷的仅仅一部分没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发。
示例的,网络设备根据第一CRC码对目的MAC地址、源MAC地址、VLAN标签、第二以太类型和净荷的仅仅一部分进行校验,确定目的MAC地址、源MAC地址、VLAN标签、第二以太类型和净荷的仅仅一部分是否发生错误;如果网络设备确定目的MAC地址、源MAC地址、VLAN标签、第二以太类型和净荷的仅仅一部分没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发。
结合第三方面或上述可能的实现方式,在第五种可能的实现方式中,以太网帧还包括第二CRC码,第二CRC码的参数包括目的MAC地址、源MAC地址、第一以太类型、第一CRC码、VLAN标签、第二以太类型以及净荷。
结合第五种可能的实现方式,在第六种可能的实现方式中,网络设备根据目的MAC地址对以太网帧进行转发之后,方法还包括:网络设备根据第二CRC码对目的MAC地址、源MAC地址、第一以太类型、第一CRC码、VLAN标签、第二以太类型以及净荷进行校验,从而确定目的MAC地址、源MAC地址、第一以太类型、第一CRC码、VLAN标签、第二以太类型以及净荷是否发生错误。
第四方面,本申请实施例提供了一种数据传输方法,该方法可应用于网络设备,或者该方法可应用于可以支持网络设备实现该方法的通信装置,例如该通信装置包括芯片系统,方法包括:网络设备生成以太网帧,并发送以太网帧。其中以太网帧包括目的MAC地址、第一CRC码以及净荷,第一CRC码的参数包括目的MAC地址和净荷的仅仅一部分。本申请实施例提供的数据传输方法,通过在以太网帧中增加第一CRC码,使得网络设备能够根据第一CRC码确定接收到的以太网帧的一部分正确的情况下,通过直通转发方式转发以太网帧,避免将发生错误的以太网帧进行转发。
结合第四方面,在第一种可能的实现方式中,以太网帧还包括第一以太类型,第一以太类型用于指示第一CRC码是CRC码,第一CRC码的参数不包括第一以太类型。
结合第四方面或第一种可能的实现方式,在第二种可能的实现方式中,以太网帧还包括虚拟局域网VLAN标签,第一CRC码的参数还包括VLAN标签。
结合第四方面或上述可能的实现方式,在第三种可能的实现方式中,以太网帧还包括第二以太类型,第一CRC码的参数还包括第二以太类型,净荷包括协议报文,协议报文包括协议头以及报文净荷,第一CRC码的参数包括的净荷的仅仅一部分为协议头的至少一部分,第二以太类型用于指示净荷中的协议报文的协议类型。
结合第四方面或上述可能的实现方式,在第四种可能的实现方式中,以太网帧还包括源MAC地址。
结合第四方面或上述可能的实现方式,在第五种可能的实现方式中,以太网帧还包括第二CRC码,第二CRC码的参数包括目的MAC地址、源MAC地址、第一以太类型、第一CRC码、VLAN标签、第二以太类型以及净荷。
需要说明的是,在上述任意方面中,第一以太类型和第一CRC码可以位于源MAC地址之后。或者,第一以太类型和第一CRC码可以位于VLAN标签之后。其中,第一以太类型中的比特的数量为16,第一CRC码中的比特的数量为16。
另外,以太网帧还可以包括版本字段和保留字段。其中,第一以太类型中的比特的数量为16,版本字段中的比特的数量为1,保留字段中的比特的数量为3,第一CRC码中的比特的数量为12。或者,第一以太类型中的比特的数量为16,版本字段中的比特的数量为1,保留字段中的比特的数量为15,第一CRC码中的比特的数量为16。
第五方面,本申请实施例还提供了一种数据传输装置,用于实现上述第一方面至第四方面描述的方法。数据传输装置为网络设备或支持网络设备实现该第一方面至第四方面描述的方法的通信装置,例如该通信装置包括芯片系统。例如,该数据传输装置包括:处理单元、发送单元和接收单元。所述处理单元,用于生成以太网帧;处理单元,还用于根据第一CRC码校验以太网帧的一部分。所述发送单元,用于发送以太网帧。所述接收单元,用于接收以太网帧。
可选地,数据传输装置执行具体功能的方式可参考第一方面至第四方面的方法中相应的描述,这里不再赘述。
需要说明的是,上述第五方面的功能模块可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块。例如,收发器,用于完成接收单元和发送单元的功能,处理器,用于完成处理单元的功能,存储器,用于存储处理器执行本申请实施例的方法的程序指令。处理器、收发器和存储器通过总线连接并完成相互间的通信。具体的,可以参考第一方面所述的方法至第四方面所述的方法中的网络设备的行为。
第六方面,本申请实施例还提供了一种数据传输装置,用于实现上述第一方面至第四方面描述的方法。所述数据传输装置为网络设备或支持网络设备实现该第一方面至第四方面描述的方法的通信装置,例如该通信装置包括芯片系统。例如所述数据传输装置包括处理器,用于实现上述第一方面至第四方面描述的方法的功能。所述数据传输装置还可以包括存储器,用于存储程序指令和数据。所述存储器与所述处理器耦合,所述处理器可以调用并执行所述存储器中存储的程序指令,用于实现上述第一方面至第四方面描述的方法中的功能。所述数据传输装置还可以包括通信接口,所述通信接口用于该数据传输装置与其它设备进行通信。示例性地,若所述数据传输装置为网络设备,该其它设备为终端设备。
第七方面,本申请实施例还提供了一种计算机可读存储介质,包括:计算机软件指令;当计算机软件指令在数据传输装置中运行时,使得数据传输装置执行上述第一方面至第四方面中任一方面所述的方法。
第八方面,本申请实施例还提供了一种包含指令的计算机程序产品,当计算机程序产品在数据传输装置中运行时,使得数据传输装置执行上述第一方面至第四方面中任一方面所述的方法。
第九方面,本申请实施例提供了一种芯片系统,该芯片系统包括处理器,还可以包括存储器,用于实现上述方法中网络设备的功能。该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。
另外,上述方面的任意设计方式所带来的技术效果可参见第一方面至第四方面中不同设计方式所带来的技术效果,此处不再赘述。
本申请实施例中,数据传输装置的名字对设备本身不构成限定,在实际实现中,这些设备可以以其他名称出现。只要各个设备的功能和本申请实施例类似,属于本申请权利要求及其等同技术的范围之内。
附图说明
图1为本申请实施例提供的一种通信系统的简化示例图;
图2为本申请实施例提供的一种数据传输方法流程图;
图3为本申请实施例提供的一种以太网帧的结构示例图;
图4为本申请实施例提供的另一种以太网帧的结构示例图;
图5为本申请实施例提供的又一种以太网帧的结构示例图;
图6为本申请实施例提供的再一种以太网帧的结构示例图;
图7为本申请实施例提供的再一种以太网帧的结构示例图;
图8为本申请实施例提供的另一种数据传输方法流程图;
图9为本申请实施例提供的一种数据传输装置的组成示例图;
图10为本申请实施例提供的一种通信装置的组成示例图。
具体实施方式
本申请说明书和权利要求书中的术语“第一”、“第二”和“第三”等是用于区别不同对象,而不是用于限定特定顺序。
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
为了下述各实施例的描述清楚简洁,首先给出相关技术的简要介绍:
本申请中的以太类型是以太网帧中的2字节域。例如,第一以太类型是2字节域。第二以太类型是2字节域。
在以太网中,网络设备可以根据开放式系统互联通信参考模型(Open Systems Interconnection Reference Model,OSI)或者传输控制协议/互联协议协议族(Transmission Control Protocol/Internet Protocol Protocol Suite,TCP/IP Protocol Suite或TCP/IP Protocols)将用户数据封装为以太网帧,将以太网帧传输至接收端的设备。其中,以太网帧的转发方式可以分为直通转发(cut-through forwarding)方式和存储转发方式。所谓存储转发方式包括:设备接收到以太网帧的全部比特后,根据以太网帧中的帧校验序列(Frame Check Sequence,FCS)字段包括的循环冗余校验(Cyclic Redundancy Check,CRC)码校验接收到的以太网帧中的帧头和净荷是否正确。若接收到的以太网帧中的帧头和净荷正确,根据以太网帧中的目的MAC地址在转发表中查找与所述目的MAC地址对应的出端口。通过所述出端口转发所述以太网帧。其中,CRC是一种根据网络数据包或电脑文件数据产生固定长度的校验码的一种函数。CRC用来检测传输的数据或者保存的数据是否发生了错误。CRC是利用除法及余数的原理做错误检测的。接收到的以太网帧正确是指接收到的以太网帧包括的帧头和净荷均正 确。接收到的以太网帧正确也可指接收到的以太网帧包括的帧头和净荷均没有发生错误。接收到的以太网帧错误是指接收到的以太网帧包括的帧头和净荷中的至少一个发生错误。接到到的以太网帧错误也可指接收到的以太网帧包括的帧头和净荷中的至少一个发生错误。可以理解,根据FCS对以太网帧进行检测从而确定以太网帧发生错误时,以太网帧包括的帧头和净荷中的至少一个发生错误。但是,设备无法确定该错误具体发生在哪里。例如,设备无法确定错误具体为帧头发生错误,净荷发生错误,还是帧头以及净荷发生错误。所谓直通转发方式包括:设备接收到完整的以太网帧之前,根据以太网帧帧头(header)中的相关信息向对应的出端口转发所述以太网帧中的信息。也就是说,设备根据以太网帧的FCS对以太网帧的帧头和净荷进行校验之前,设备可以经由出端口转发以太网帧中的信息(例如目的MAC地址)。相对于存储转发方式,直通转发方式可以减少以太网帧在设备中停留的时长。
设备接收到的以太网帧可能发生了错误。设备可以根据以太网帧中的FCS字段携带的CRC码对以太网帧进行校验,从而确定以太网帧是否发生错误。在直通转发的情况下,设备在接收到以太网帧的最后一个比特之前,就已经开始转发以太网帧的第一个比特。也就是说,设备将发生错误的以太网帧进行了转发。对发生错误的以太网帧进行转发,造成对资源的占用,影响正常的以太网帧的转发。以上情况对网络造成不良的影响。例如,对时间敏感网络(Time-Sensitive Networking,TSN)网络造成影响。关于TSN,可以参考IEEE 802.1Qbv。
为了解决上述问题,本申请实施例提供一种数据传输方法,其基本原理是:网络设备接收到以太网帧之后,根据第一CRC码对目的MAC地址进行校验,确定目的MAC地址是否发生错误;如果网络设备确定目的MAC地址没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发;或者,网络设备根据第一CRC码对目的MAC地址和净荷的仅仅一部分进行校验,确定目的MAC地址和净荷的仅仅一部分是否发生错误;如果网络设备确定目的MAC地址和净荷的仅仅一部分没有发生错误,则网络设备根据目的MAC地址对以太网帧进行转发。其中,以太网帧包括目的MAC地址、第一CRC码以及净荷,第一CRC码的参数包括目的MAC地址,第一CRC码的参数不包括净荷或者第一CRC码的参数还包括净荷的仅仅一部分。本申请实施例提供的数据传输方法,通过在以太网帧中增加第一CRC码,使得网络设备能够根据第一CRC码确定接收到的以太网帧的一部分正确的情况下,通过直通转发方式转发以太网帧,避免将发生错误的以太网帧进行转发。
下面将结合附图对本申请实施例进行详细描述。
图1示出的是可以应用本申请实施例的通信系统的简化示例图。如图1所示,该通信系统可以包括:至少一个终端设备(user equipment,UE)(如图1中所示的终端设备101和终端设备102)和至少一个网络设备(如图1中所示的网络设备103和网络设备104)。其中,终端设备可以是虚拟机、主机或服务器。网络设备可以是路由器或网桥。终端设备与网络设备之间可以通过电缆或者光纤进行连接。至少一个终端设备和至少一个网络设备可以属于同一个虚拟局域网(Virtual Local Area Network,VLAN),也可以属于不同的VLAN。不同的VLAN可以通过网关连接。
需要说明的是,图1只是示意图,该通信系统中还可以包括其它网络设备,如还 可以包括交换机,在图1中未画出。另外,图1所示的通信系统还可以包括其他网络,例如核心网。本申请的实施例对该通信系统中包括的站点、路由器、网关、交换机的数量不做限定。
网络设备和终端设备可以部署在陆地上,包括室内或室外、手持或车载;也可以部署在水面上;还可以部署在空中的飞机、气球和卫星上。本申请的实施例对网络设备和终端设备的应用场景不做限定。
下面以发送设备与接收设备为例,对本申请实施例提供的数据传输方法进行详细说明。发送设备可以是站点(发送以太网帧的起点设备)、路由器、网桥等。例如,发送设备可以是图1中的终端设备101。接收设备可以是路由器、网桥等。例如,接收设备可以是图1中的网络设备103。图2为本申请实施例提供的一种数据传输方法流程图。图1所示的通信系统可以执行图2所示的方法。在一种可能的设计中,图2所示的方法可以包括:S201、S202、S203、S204以及S205。在一种可能的设计中,图2所示的方法可以包括:S201、S202、S203、S204以及S206。
S201、发送设备生成以太网帧。
以太网帧包括帧头、净荷(payload)以及帧校验序列(Frame check sequence,FCS)。帧头包括目的MAC地址、源MAC地址以及第一以太类型。目的MAC地址与源MAC地址相邻。目的MAC地址在源MAC地址的前面。第一以太类型和净荷相邻。净荷和FCS相邻。第一以太类型在净荷的前面。净荷在FCS的前面。关于以太网帧的结构,可以参考IEEE802.3。根据IEEE802.3的规定,净荷中的字节的数量为46至1500。在一种可能的实现方式中,帧头还包括VLAN标签(tag)。其中,目的MAC地址用于指示接收以太网帧的接收设备的地址。源MAC地址用于指示发送以太网帧的发送设备的地址。VLAN标签表示VLAN标识。例如,VLAN标签可以是客户标签(Customer tag,C-tag)、服务标签(Service tag,S-tag)或骨干标签(Backbone tag,B-tag)。关于VLAN标签,可以参考IEEE802.1Q的规定。
第一以太类型用于指示净荷中的协议报文的协议类型。协议报文是遵循某个协议的报文。协议报文可以是IPv4报文、地址解析协议(Address Resolution Protocol,ARP)报文、点对点协议(Point-to-Point Protocol over Ethernet,PPPoE)报文或者IPv6报文。例如,当第一以太类型的值为0x0800时,第一以太类型指示净荷中的协议报文的协议类型为IPv4。当第一以太类型的值为0x0806时,第一以太类型指示净荷中的协议报文的协议类型为ARP。当第一以太类型的值为0x8864时,第一以太类型指示净荷中的协议报文的协议类型为PPPoE。当第一以太类型的值为0x86DD时,第一以太类型指示净荷中的协议报文的协议类型为IPv6。当第一以太类型的值为0x8847时,第一以太类型指示净荷中的协议报文的协议类型为多协议标签交换(Multiprotocol Label Switching,MPLS)协议。
在物理层上,所传以太网帧用比特的数量来表示。物理层的任务就是透明地传输比特流,也就是说物理层并不关心每个比特代表的是什么意思,只需要传输比特流即可。当发送端发送1时,接收端应当接收到1,若接收端接收到0,表示接收端接收的信息发生错误。同理,当发送端发送0时,接收端应当接收到0,若接收端接收到1,表示接收端接收的信息发生错误。在数据传输过程中,无论传输系统的设计再怎么完 美,差错总会存在,这种差错可能会导致在链路上传输的一个或者多个帧被破坏(出现比特差错,例如,0变为1,或者1变为0),从而导致接收方接收到发生错误的数据。为了尽量提高接收方收到数据的正确率,在接收方接收数据之前需要对数据进行差错检测,当且仅当检测的结果指示数据正确时接收方才真正收下数据。检测的方式有多种,常见的有奇偶校验、因特网校验和循环冗余校验等。
以太网帧可以包括第一CRC码以及第二CRC码。具体的,帧头包括第一CRC码。FCS携带第二CRC码。下文将对CRC码进行说明。下文中的CRC码可以是第一CRC码,也可以是第二CRC码。计算输入数据(input data)的CRC码时,将输入数据作为被除数(dividend),将CRC算法对应的生成多项式(generator polynomial)作为除数(divisor),计算余数(remainder)。余数为CRC码。关于CRC算法,可以是CRC-32算法(CRC-32algorithm)。本申请中,CRC码的参数是计算该CRC码所需的输入数据。可以理解,CRC码的参数是计算该CRC码所需的被除数。
生成第一CRC码需要的参数包括以太网帧的一部分。以太网帧的一部分可以是以太网帧的帧头。在一种可能的设计中,帧头包括目的MAC地址、源MAC地址和第一以太类型。在另一种可能的设计中,帧头包括目的MAC地址、源MAC地址、VLAN标签和第一以太类型。在另一种可能的设计中,以太网帧的一部分也可以是帧头的一部分。生成第一CRC码需要的参数可以包括目的MAC地址,而不包括净荷。进一步地,生成第一CRC码需要的参数还可以包括源MAC地址、VLAN标签和第一以太类型中至少一个。接收设备根据第一CRC码校验以太网帧的一部分是否发生错误。例如,接收设备根据第一CRC码校验以太网帧的目的MAC地址是否发生错误。或者,接收设备根据第一CRC码校验以太网帧的目的MAC地址和源MAC地址是否发生错误。或者,接收设备根据第一CRC码校验以太网帧的目的MAC地址、源MAC地址和VLAN标签是否发生错误。或者,接收设备根据第一CRC码校验以太网帧的目的MAC地址、源MAC地址、VLAN标签和第一以太类型是否发生错误。
在一种可能的设计中,生成第二CRC码需要的参数可以包括目的MAC地址、源MAC地址、第一CRC码、第一以太类型和净荷。接收设备可以根据第二CRC码校验目的MAC地址、源MAC地址、第一CRC码、第一以太类型和净荷是否发生错误。在另一种可能的设计中,生成第二CRC码需要的参数可以包括目的MAC地址、源MAC地址、VLAN标签、第一CRC码、第一以太类型和净荷。接收设备可以根据第二CRC码校验目的MAC地址、源MAC地址、VLAN标签、第一CRC码、第一以太类型和净荷是否发生错误。
需要说明的是,在实际应用中,生成CRC码的过程还可以包括其他参数,且生成CRC码的具体过程均可以参考现有技术,本申请实施例在此不再赘述。
可理解的,接收设备可以根据校验结果确定是否采用直通转发方式转发以太网帧。具体地,可以通过第一CRC码指示是否采用直通转发方式转发以太网帧。例如,若接收设备根据第一CRC码校验以太网帧的一部分,确定以太网帧没有发生错误。进而,接收设备便可以根据直通转发方式转发以太网帧。若接收设备根据第一CRC码校验以太网帧的一部分,确定以太网帧发生错误,从而接收设备避免采用直通转发方式转发以太网帧。例如,接收设备可以丢弃以太网帧或请求发送设备重新发送以太网帧。例 如,当目的MAC地址没有发生错误时,接收设备可以采用直通转发方式转发以太网帧。当目的MAC地址发生错误时,接收设备可以丢弃以太网帧。
进一步的,以太网帧还包括第二以太类型,第二以太类型用于指示第一CRC码是CRC码。第一CRC码的参数不包括第二以太类型。第二以太类型可以被携带在帧头中。具体地,可以位于源MAC地址后面,位于第一CRC码前面。第二以太类型可以与源MAC地址相邻。第二以太类型可以与第一CRC码相邻。关于第二以太类型在以太网帧的位置,可以参考图3至图7。
在一种可能的设计中,接收设备可以通过第二以太类型指示是否对以太网帧的一部分进行校验。例如,接收设备接收到所述以太网帧之后,可以根据第二以太类型确定第一CRC码为CRC码。进而,接收设备可以根据第一CRC码对所述以太网帧的一部分进行校验。当所述以太网帧没有发生错误时,接收设备可以采用直通转发方式转发该以太网帧。
在本申请实施例中,可以将包含第二以太类型和第一CRC码的字段称为直通转发帧标签。关于直通转发帧标签字段在以太网帧中的位置,可以参考图3至图7。
在第一种可能的实现方式中,图3为本申请实施例提供的一种以太网帧的结构示例图。该以太网帧包括目的MAC地址字段、源MAC地址字段、直通转发帧标签字段、标签字段、第一以太类型字段、净荷字段和FCS字段。其中,目的MAC地址字段用于携带目的MAC地址。源MAC地址字段用于携带源MAC地址。直通转发帧标签字段用于携带第二以太类型和第一CRC码。标签字段用于携带VLAN标签。第一以太类型字段用于携带第一以太类型。净荷字段用于携带净荷。FCS字段用于携带第二CRC码。以太网帧的帧头包括目的MAC地址字段、源MAC地址字段、直通转发帧标签字段、标签字段和第一以太类型字段。如图3所示,第二以太类型和第一CRC码可以位于源MAC地址之后。
需要说明的是,目的MAC地址字段中的比特的数量可以为48个比特(6个字节)。源MAC地址字段中的比特的数量可以为48个比特。标签字段中的比特的数量可以为32个比特(4个字节)。第一以太类型字段中的比特的数量可以为16个比特(2个字节)。净荷字段中的字节的数量可以为46~1500个字节。FCS字段中的比特的数量可以为32个比特(4个字节)。直通转发帧标签字段中的比特的数量可以为32个比特(4个字节)或者48个比特(6个字节)。对于直通转发帧标签字段包括的第二以太类型和第一CRC码中的比特的数量可以有以下几种实现方式。
方案一,如图4所示,第二以太类型中的比特的数量为16,第一CRC码中的比特的数量为16。
可选的,以太网帧还包括版本字段和保留字段。版本字段和保留字段可以位于第二以太类型与第一CRC码之间。版本字段用于填写版本号。保留字段用于扩展直通转发帧标签字段的内容。版本号可以用于指示生成第一CRC码需要的参数的范围。可选的,版本号还可以用于指示保留字段。例如,版本号为1时,指示基础版本,版本号为2时,指示拓展版本。可理解的,拓展版本指保留字段具有指示其他作用。版本号可以用一个比特表示,该比特可以是0或1。
方案二,如图5所示,第二以太类型中的比特的数量为16,版本字段中的比特的 数量为1,保留字段中的比特的数量为3,第一CRC码中的比特的数量为12。
方案三,如图6所示,第二以太类型中的比特的数量为16,版本字段中的比特的数量为1,保留字段中的比特的数量为15,第一CRC码中的比特的数量为16。
在第二种可能的实现方式中,如图7所示,第二以太类型和第一CRC码可以位于VLAN标签之后。关于以太网帧的其他详细解释可以参考上述在第一种可实现方式中对以太网帧的阐述,本申请实施例在此不再赘述。
S202、发送设备向接收设备发送以太网帧。
发送设备在生成以太网帧之后,发送以太网帧。需要说明的是,发送设备在发送以太网帧之前,可以先确定对应目的MAC地址的接收设备是否能识别直通转发帧标签,若对应目的MAC地址的接收设备能识别直通转发帧标签,可以将直通转发帧标签插入以太网帧的帧头中;若对应目的MAC地址的接收设备不能识别直通转发帧标签,无需在以太网帧中插入直通转发帧标签,只需发送不包括直通转发帧标签的以太网帧即可。在实际应用中,设备可以采用其它协议确定对应目的MAC地址的接收设备是否能识别直通转发帧标签,例如链路层发现协议(Link Layer Discovery Protocol,LLDP)。
S203、接收设备接收发送设备发送的以太网帧。
关于以太网帧的解释可以参考S201的详细阐述,本申请实施例在此不再赘述。
具体地,接收设备可以是网络交换机。网络交换机可以包括多个端口。每个端口可以是以太网端口。网络交换机可以包括网络处理器以及存储器。网络处理器和存储器耦合。存储器可以存储计算机程序。网络处理器可以通过执行计算机程序对接收到的以太网帧进行处理。存储器可以保存MAC转发表。MAC转发表可以包括多个表项。每个表项包含目的MAC地址以及端口的标识。网络交换机可以通过一个以太网端口接收发送设备发送的以太网帧。另外,接收设备接收到以太网帧后,可以将以太网帧保存在接收设备的存储器中。S203具体实现时,接收设备可以串行地接收以太网帧。具体地,接收设备先接收到以太网帧的最高有效位,最后接收到以太网帧的最低有效位。在一种可能的实现方式中,以太网帧的高6字节为目的MAC地址。以太网帧的低4字节为FCS。因此,接收设备先接收到目的MAC地址,后接收到FCS。
S204、接收设备确定以太网帧是否发生错误。
具体地,以太网帧可以以比特流的方式到达网络交换机。比特流可以包含帧起始定界符(Start of frame delimiter,SFD)以及以太网帧。SFD和以太网帧相邻。网络交换机接收到比特流后,网络交换机的网络处理器可以对比特流进行检测,从而确定比特流中包含SFD。进而,网络处理器可以确定SFD之后的数据为以太网帧。网络处理器可以根据以太网帧的结构,从比特流中获取以太网帧的字段。例如,网络处理器可以确定SFD之后的6个字节的数据为以太网帧的目的MAC地址。网络处理器可以确定目的MAC地址之后的6个字节的数据为以太网帧的源MAC地址。网络处理器可以根据以太网帧的结构,从以太网帧中获取第一CRC码的参数,以及第一CRC码。存储器中保存了实现CRC算法的指令。例如,指令中包含了生成多项式。网络处理器根据第一CRC码的参数(例如目的MAC地址),通过执行指令,计算CRC码。网络处理器可以通过比较确定计算的CRC码是否与从以太网帧中获取的第一CRC码是否 相等,从而确定以太网帧是否发生错误。如果计算的CRC码与从以太网帧中获取的第一CRC码相等,则确定没有发生错误。如果计算的CRC码与从以太网帧中获取的第一CRC码不相等,则确定发生错误。
接收设备开始执行S204时,接收设备不需要接收到完整的以太网帧。例如,接收设备接收到第一CRC码的参数以及第一CRC码,接收设备即可确定以太网帧是否发生错误。例如,目的MAC地址是否发生错误。接收设备不需要接收FCS。当第一CRC码的参数包括净荷的一部分时,接收设备需要接收净荷的一部分,不需要接收完整的净荷。当第一CRC码的参数不包括净荷时,接收设备不需要接收净荷。以太网帧在网络中串行地传输。接收设备接收以太网帧是一个持续的过程,需要经历一个时长。因此,接收设备执行S203需要经历一个时长。另外,接收设备执行S204可能包括获取参数和第一CRC码,计算CRC码,以及比较第一CRC码和计算的CRC码。因此,接收设备执行S204需要经历一个时长。接收设备开始执行S204时,接收设备可能尚未执行完毕S203(尚未接收到完整的以太网帧)。但是,接收设备执行完S204时,接收设备可能已执行完毕S203(接收到完整的以太网帧),或者尚未执行完毕S203。
根据生成第一CRC码需要的参数不同,接收设备根据第一CRC码校验的内容也可以不同。因此,S204可以通过多个不同的方式实现。例如,S204可以通过S204a至S204e中的一种方式实现。下面分别介绍可能的实现方式。
方式一,若第一CRC码的参数包括目的MAC地址,执行S204a。
S204a、接收设备根据第一CRC码对目的MAC地址进行校验,确定目的MAC地址是否发生错误。
上述技术方案中,第一CRC码的参数包括目的MAC地址。确定目的MAC地址是否发生错误具体可以包括:将目的MAC地址作为输入数据(或者称为被除数),将CRC算法对应的生成多项式作为除数,计算余数。如果计算的余数等于第一CRC码,则认为第一CRC码的参数(包括目的MAC地址)没有发生错误。如果计算的余数不等于第一CRC码,则认为第一CRC码的参数(包括目的MAC地址)发生错误。
若接收设备确定目的MAC地址没有发生错误,执行S205;若接收设备确定目的MAC地址发生错误,执行S206。
方式二,若第一CRC码的参数包括目的MAC地址和源MAC地址,执行S204b。
S204b、接收设备根据第一CRC码对目的MAC地址和源MAC地址进行校验,确定目的MAC地址和源MAC地址是否发生错误。
在S204b至S204e的方案中,第一CRC码的参数包括多个参数。另外,第一CRC码可以是一个CRC码,也可以是多个CRC码。多个CRC码与多个参数一一对应。
下文以第一CRC码是一个CRC码为例,对S204b的具体实现方式进行描述。关于S204c至S204e的具体实现方式,可以参考S204b的具体实现方式。第一CRC码的参数包括多个参数。具体地,多个参数包括目的MAC地址和源MAC地址。S204b具体实现时,将目的MAC地址和源MAC地址作为输入数据(或者称为被除数),将CRC算法对应的生成多项式作为除数,计算余数。如果计算的余数等于第一CRC码,则认为第一CRC码的参数(包括目的MAC地址和源MAC地址)没有发生错误。如果计算的余数不等于第一CRC码,则认为第一CRC码的参数(包括目的MAC地址 和源MAC地址)发生错误。需要说明的是,在第一CRC码的参数为多个的场景中,当确定第一CRC码的参数发生错误时,根据CRC算法仅能确定多个参数中的至少一个参数发生错误,但无法确定错误具体发生在哪里。例如,无法确定错误具体为源MAC地址错误,目的MAC地址或者源MAC地址以及目的MAC地址错误。也就是说,接收设备根据第一CRC码对以太网帧中的多个参数(例如S204b涉及的源MAC地址以及目的MAC地址)进行校验时,是将多个参数(例如S204b涉及的源MAC地址以及目的MAC地址)作为一个整体进行校验的。
下文以第一CRC码是多个CRC码为例,对S204b的具体实现方式进行描述。关于S204c至S204e的具体实现方式,可以参考S204b的具体实现方式。第一CRC码是CRC码1和CRC码2。第一CRC码的参数包括多个参数。具体地,多个参数包括目的MAC地址和源MAC地址。CRC码1对应目的MAC地址,CRC码2对应源MAC地址。S201具体实现时,发送设备基于CRC算法以及目的MAC地址,得到CRC码1。发送设备基于所述CRC算法以及源MAC地址,得到CRC码2。S204b具体实现时,接收设备将接收到的以太网帧中的目的MAC地址作为输入数据(或者称为被除数),将CRC算法对应的生成多项式作为除数,计算余数。如果计算的余数等于接收到的以太网帧中的CRC码1,则认为接收到的以太网帧中的目的MAC地址没有发生错误。如果计算的余数不等于CRC码1,则认为接收到的以太网帧中的目的MAC地址发生错误。S204b具体实现时,接收设备将接收到的以太网帧中的源MAC地址作为输入数据(或者称为被除数),将CRC算法对应的生成多项式作为除数,计算余数。如果计算的余数等于接收到的以太网帧中的CRC码2,则认为接收到的以太网帧中的源MAC地址没有发生错误。如果计算的余数不等于CRC码2,则认为接收到的以太网帧中的源MAC地址发生错误。相对于第一CRC码是一个CRC码的场景,第一CRC码是多个CRC码的方案不仅可以确定第一CRC码的多个参数中的至少一个参数发生错误,而且可以确定错误具体发生在哪里。例如,可以确定错误具体为源MAC地址错误,目的MAC地址或者源MAC地址以及目的MAC地址错误。
若接收设备确定目的MAC地址和源MAC地址没有发生错误,执行S205;若接收设备确定目的MAC地址和源MAC地址发生错误,执行S206。
方式三,若第一CRC码的参数包括目的MAC地址、源MAC地址和VLAN标签,执行S204c。
S204c、接收设备根据第一CRC码对目的MAC地址、源MAC地址和VLAN标签进行校验,确定目的MAC地址、源MAC地址和VLAN标签是否发生错误。
若接收设备确定目的MAC地址、源MAC地址和VLAN标签没有发生错误,执行S205;若接收设备确定目的MAC地址、源MAC地址和VLAN标签发生错误,执行S206。
方式四,若第一CRC码的参数包括目的MAC地址、源MAC地址和第一以太类型,执行S204d。
S204d、接收设备根据第一CRC码对目的MAC地址、源MAC地址和第一以太类型进行校验,确定目的MAC地址、源MAC地址和第一以太类型是否发生错误。
若接收设备确定目的MAC地址、源MAC地址和第一以太类型没有发生错误,执 行S205;若接收设备确定目的MAC地址、源MAC地址和第一以太类型发生错误,执行S206。
方式五,若第一CRC码的参数包括目的MAC地址、源MAC地址、VLAN标签和第一以太类型,执行S204e。
S204e、接收设备根据第一CRC码对目的MAC地址、源MAC地址、VLAN标签和第一以太类型进行校验,确定目的MAC地址、源MAC地址、VLAN标签和第一以太类型是否发生错误。
若接收设备确定目的MAC地址、源MAC地址、VLAN标签和第一以太类型没有发生错误,执行S205;若接收设备确定目的MAC地址、源MAC地址、VLAN标签和第一以太类型发生错误,执行S206。
S205、接收设备根据目的MAC地址对以太网帧进行转发。
接收设备根据目的MAC地址采用直通转发方式对以太网帧进行转发。具体地,网络处理器以以太网帧中的目的MAC地址为查找关键字,在MAC转发表中查找与以太网帧中的目的MAC地址匹配的表项。根据匹配的表项中的端口的标识,确定用于转发以太网帧的出端口。用于转发以太网帧的出端口为匹配的表项中的端口的标识指示的端口。网络处理器经由端口发送所述以太网帧。
S206、接收设备丢弃以太网帧或向发送设备发送重传请求消息。
具体地,接收设备根据S204确定以太网帧发生错误。该错误可能是以太网帧从发送设备到接收设备的传输过程中产生的。由于接收设备根据S204确定以太网帧发生错误,接收设备没有必要以以太网帧中的目的MAC地址为查找关键字,在MAC转发表中查找与以太网帧中的目的MAC地址匹配的表项。也就是说,接收设备可以在不需要查找MAC转发表的情况下,丢弃以太网帧。例如,网络处理器可以将保存在存储器中的以太网帧删除。
所述重传请求消息用于指示发送设备重新发送以太网帧。
进一步的,接收设备根据第一CRC码对以太网帧的一部分进行校验并转发之后,方法还包括:接收设备根据第二CRC码对目的MAC地址、源MAC地址、VLAN标签、第二以太类型、第一CRC码、第一以太类型和净荷进行校验,从而确定目的MAC地址、源MAC地址、VLAN标签、第二以太类型、第一CRC码、第一以太类型和净荷是否发生错误。
从而,通过在以太网帧中增加第一CRC码,使得接收设备能够根据第一CRC码确定接收到的以太网帧的一部分正确的情况下,通过直通转发方式转发以太网帧,避免将发生错误的以太网帧进行转发。
图8为本申请实施例提供的另一种数据传输方法流程图。如图8所示,在一种可能的实现方式中,该方法可以包括S801-S805。在另一种可能的实现方式中,该方法可以包括S801-S804以及S806。图8所示的方法是对图2所示的方法进行扩展得到的。关于图8所示的方法具体实现方式,可以参考本申请对图2所示的方法的描述。与图2所示的方法不同,在图8所示的方法中,第一CRC码的参数不仅包括目的MAC地址,还包括净荷的仅仅一部分。第一CRC码的参数包括净荷的仅仅一部分是指,第一CRC码的参数包括净荷的一部分,但不包括净荷的全部。
S801、发送设备生成以太网帧。
与S201中阐述的以太网帧的不同,在S801中,生成第一CRC码需要的参数除了包括以太网帧的一部分(例如目的MAC地址),还包括净荷的仅仅一部分。净荷包括协议报文,协议报文包括协议头以及报文净荷。所述净荷的仅仅一部分可以是所述协议头的至少一部分。例如,协议报文可以是IP报文。协议头可以是IP头。报文净荷可以是IP净荷。所述净荷的仅仅一部分可以是IP头中的目的IP地址。所述净荷的仅仅一部分也可以是IP头中的目的IP地址和源IP地址。当然,所述净荷的仅仅一部分也可以包括IP报文头的其他字段。其他字段可以是版本字段、服务类型(type of service)字段或者协议(protocol)字段。本申请实施例对此不作限定。从而,接收设备根据第一CRC码校验以太网帧的目的MAC地址和净荷的仅仅一部分是否发生错误;或者,接收设备根据第一CRC码校验以太网帧的目的MAC地址、源MAC地址和净荷的仅仅一部分是否发生错误;或者,接收设备根据第一CRC码校验以太网帧的目的MAC地址、源MAC地址、VLAN标签和净荷的仅仅一部分是否发生错误;或者,接收设备根据第一CRC码校验以太网帧的目的MAC地址、源MAC地址、VLAN标签、第一以太类型和净荷的仅仅一部分是否发生错误。
另外,关于S801的具体实现方式,可以参考S201的详细阐述,本申请实施例在此不再赘述。
S802、发送设备向接收设备发送以太网帧。
关于S802的具体实现方式,可以参考S202的详细阐述,本申请实施例在此不再赘述。
S803、接收设备接收发送设备发送的以太网帧。
关于S803的具体实现方式,可以参考S203的详细阐述,本申请实施例在此不再赘述。
S804、接收设备确定以太网帧是否发生错误。
关于S804的具体实现方式,可以参考S204的详细阐述,本申请实施例在此不再赘述。
与图2所示的方法不同,图8所示的方法中,第一CRC码的参数还包括净荷的仅仅一部分。
S804具体实现时,网络处理器可以根据以太网帧的结构,从以太网帧中获取第一CRC码的参数,以及第一CRC码。网络处理器从以太网帧获取净荷的仅仅一部分时,可以根据以太网帧中的第一以太类型的值,确定净荷的结构。从而,从净荷中获取净荷的仅仅一部分。例如,当确定第一以太类型的值为0x0800时,网络处理器可以确定净荷中包含了IPv4报文。网络处理器可以根据IPv4报文的格式,从净荷中获取第一CRC码的参数。在一种可能的实现方式中,净荷的仅仅一部分是指IPv4头中的协议字段、源IP地址字段以及目的IP地址字段。网络处理器可以根据IPv4报文的格式,确定协议字段的字节的数量为1,源IP地址字段的字节的数量为4,目的IP地址字段的字节的数量为4。另外,协议字段位于净荷的第10个字节,源IP地址字段位于净荷的第13至16个字节,目的IP地址字段位于净荷的第17至20个字节。
存储器中保存了实现CRC算法的指令。例如,指令中包含了生成多项式。网络处 理器根据第一CRC码的参数(例如目的MAC地址、协议字段、源IP地址字段以及目的IP地址字段),通过执行指令,计算CRC码。
网络处理器可以通过比较确定计算的CRC码是否与从以太网帧中获取的第一CRC码是否相等,从而确定以太网帧是否发生错误。如果计算的CRC码与从以太网帧中获取的第一CRC码相等,则确定没有发生错误。如果计算的CRC码与从以太网帧中获取的第一CRC码不相等,则确定发生错误。
根据生成第一CRC码需要的参数不同,接收设备根据第一CRC码校验的内容也可以不同。因此,S804可以通过多个不同的方式实现。例如,S804可以通过S804a至S804e中的一种方式实现。下面分别介绍可能的实现方式。
方式一,若第一CRC码的参数包括目的MAC地址和净荷的仅仅一部分,执行S804a。
S804a、接收设备根据第一CRC码对目的MAC地址和净荷的仅仅一部分进行校验,确定目的MAC地址和净荷的仅仅一部分是否发生错误。
S804a至S804e中的每个方案涉及的第一CRC码的参数都包括多个参数。另外,第一CRC码可以是一个CRC码,也可以是多个CRC码。多个CRC码与多个参数一一对应。S204b涉及的第一CRC码的参数不同于S804a涉及的第一CRC码的参数。例如,S204b涉及的第一CRC码的参数不涉及净荷,S804a涉及的第一CRC码的参数涉及净荷。但是,S204b涉及的第一CRC码的参数是多个参数。S804a涉及的第一CRC码的参数也是多个参数。因此,关于S804a的具体实现方式,可以参考本申请说明书对S204b的描述,此处不再赘述。
若接收设备确定目的MAC地址和净荷的仅仅一部分没有发生错误,执行S805;若接收设备确定目的MAC地址和净荷的仅仅一部分发生错误,执行S806。
方式二,若第一CRC码的参数包括目的MAC地址、源MAC地址和净荷的仅仅一部分,执行S804b。
S804b、接收设备根据第一CRC码对目的MAC地址、源MAC地址和净荷的仅仅一部分进行校验,确定目的MAC地址、源MAC地址和净荷的仅仅一部分是否发生错误。
若接收设备确定目的MAC地址、源MAC地址和净荷的仅仅一部分没有发生错误,执行S805;若接收设备确定目的MAC地址、源MAC地址和净荷的仅仅一部分发生错误,执行S806。
方式三,若第一CRC码的参数包括目的MAC地址、源MAC地址、VLAN标签和净荷的仅仅一部分,执行S804c。
S804c、接收设备根据第一CRC码对目的MAC地址、源MAC地址、VLAN标签和净荷的仅仅一部分进行校验,确定目的MAC地址、源MAC地址、VLAN标签和净荷的仅仅一部分是否发生错误。
若接收设备确定目的MAC地址、源MAC地址、VLAN标签和净荷的仅仅一部分没有发生错误,执行S805;若接收设备确定目的MAC地址、源MAC地址、VLAN标签和净荷的仅仅一部分发生错误,执行S806。
方式四,若第一CRC码的参数包括目的MAC地址、源MAC地址、第一以太类 型和净荷的仅仅一部分,执行S804d。
S804d、接收设备根据第一CRC码对目的MAC地址、源MAC地址、第一以太类型和净荷的仅仅一部分进行校验,确定目的MAC地址、源MAC地址、第一以太类型和净荷的仅仅一部分是否发生错误。
若接收设备确定目的MAC地址、源MAC地址、第一以太类型和净荷的仅仅一部分没有发生错误,执行S805;若接收设备确定目的MAC地址、源MAC地址、第一以太类型和净荷的仅仅一部分发生错误,执行S806。
方式五,若第一CRC码的参数包括目的MAC地址、源MAC地址、VLAN标签、第一以太类型和净荷的仅仅一部分,执行S804e。
S804e、接收设备根据第一CRC码对目的MAC地址、源MAC地址、VLAN标签、第一以太类型和净荷的仅仅一部分进行校验,确定目的MAC地址、源MAC地址、VLAN标签、第一以太类型和净荷的仅仅一部分是否发生错误。
若接收设备确定目的MAC地址、源MAC地址、VLAN标签、第一以太类型和净荷的仅仅一部分没有发生错误,执行S805;若接收设备确定目的MAC地址、源MAC地址、VLAN标签、第一以太类型和净荷的仅仅一部分发生错误,执行S806。
S805、接收设备根据目的MAC地址对以太网帧进行转发。
接收设备根据目的MAC地址采用直通转发方式对以太网帧进行转发。S805具体实现时,可以参考实施例对S205的描述。
S806、接收设备丢弃以太网帧或向发送设备发送重传请求消息。
S806的具体实现方式,可以参考实施例对S206的描述。
所述重传请求消息用于指示发送设备重新发送以太网帧。
进一步的,接收设备根据第一CRC码对以太网帧的一部分进行校验并转发之后,方法还包括:接收设备根据第二CRC码对目的MAC地址、源MAC地址、VLAN标签、第二以太类型、第一CRC码、第一以太类型和净荷进行校验,从而确定目的MAC地址、源MAC地址、VLAN标签、第二以太类型、第一CRC码、第一以太类型和净荷是否发生错误。
从而,通过在以太网帧中增加第一CRC码,使得接收设备能够根据第一CRC码确定接收到的以太网帧的一部分正确的情况下,通过直通转发方式转发以太网帧,避免将发生错误的以太网帧进行转发。
上述本申请提供的实施例中,分别从发送设备、接收设备、以及发送设备和接收设备之间交互的角度对本申请实施例提供的方法进行了介绍。可以理解的是,各个网元,例如发送设备、接收设备为了实现上述本申请实施例提供的方法中的各功能,包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请实施例可以根据上述方法示例对发送设备、接收设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在 一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
图9示出了数据传输装置的一种可能的组成示意图。该数据传输装置能执行上述实施例所描述的方法。例如,图9所示的数据传输装置能够执行图2或者图8所示网络设备所执行的步骤。网络设备可以是发送设备也可以是接收设备。如图9所示,所述数据传输装置为网络设备或支持网络设备实现实施例中提供的方法的通信装置,例如该通信装置可以是芯片系统。该数据传输装置可以包括:接收单元901、处理单元902和发送单元903。
若网络设备作为接收设备时,其中,接收单元901,用于支持数据传输装置执行本申请实施例中描述的方法。例如,接收单元901,用于执行或用于支持数据传输装置执行图2所示的数据传输方法中的S203。接收单元901,用于执行或用于支持数据传输装置执行图8所示的数据传输方法中的S803。
处理单元902,用于执行或用于支持数据传输装置执行图2所示的数据传输方法中的S204。例如,执行S204a~S204e。处理单元902,用于执行或用于支持数据传输装置执行图8所示的数据传输方法中的S804。例如,执行S804a~S804e。
发送单元903,用于执行或用于支持数据传输装置执行图2所示的数据传输方法中的S205~S206。发送单元903,用于执行或用于支持数据传输装置执行图8所示的数据传输方法中的S805~S806。
若网络设备作为发送设备时,其中,处理单元902,用于支持数据传输装置执行本申请实施例中描述的方法。例如,处理单元902,用于执行或用于支持数据传输装置执行图2所示的数据传输方法中的S201。处理单元902,用于执行或用于支持数据传输装置执行图8所示的数据传输方法中的S801。发送单元903,用于执行或用于支持数据传输装置执行图2所示的数据传输方法中的S202。发送单元903,用于执行或用于支持数据传输装置执行图8所示的数据传输方法中的S802。
需要说明的是,图2或者图8对应的实施例涉及的各步骤的所有相关内容均可以援引到图9所示的相应的功能模块的功能描述,在此不再赘述。
本申请实施例提供的数据传输装置,用于执行上述任意实施例的方法,因此可以达到与上述实施例的方法相同的效果。
如图10所示为本申请实施例提供的通信装置1000,用于实现上述实施例中的网络设备的功能。例如,通信设备1000可以执行图2或者图8所示的方法。该通信装置1000可以是网络设备,也可以是网络设备中的装置。其中,该通信装置1000可以为芯片系统。本申请实施例中,芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。
通信装置1000包括至少一个处理器1001,用于实现本申请实施例提供的方法。示例性地,处理器1001可以用于根据第一CRC码对目的MAC地址进行校验,确定目的MAC地址是否发生错误等等,具体参见方法示例中的详细描述,此处不做赘述。
通信装置1000还可以包括至少一个存储器1002,用于存储程序指令和/或数据。存储器1002和处理器1001耦合。本申请实施例中的耦合是装置、单元或模块之间的 间接耦合或通信连接,可以是电性,机械或其它的形式,用于装置、单元或模块之间的信息交互。处理器1001可能和存储器1002协同操作。处理器1001可能执行存储器1002中存储的程序指令。所述至少一个存储器中的至少一个可以包括于处理器中。
通信装置1000还可以包括通信接口1003,用于通过传输介质和其它设备进行通信,从而通信装置1000中的装置可以和其它设备进行通信。示例性地,若通信装置为网络设备,该其它设备为终端设备。处理器1001利用通信接口1003收发数据,并用于实现图2和图8对应的实施例中所述的网络设备所执行的方法。
本申请实施例中不限定上述通信接口1003、处理器1001以及存储器1002之间的具体连接介质。本申请实施例在图10中以通信接口1003、处理器1001以及存储器1002之间通过总线1004连接,总线在图10中以粗线表示,其它部件之间的连接方式,仅是进行示意性说明,并不引以为限。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图10中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
图10所示的通信装置1000所示的结构是图9所示的数据传输装置的一种可能的实现方式。具体地,通信接口1003可以用于实现接收单元901以及发送单元903。处理器1001通过执行存储器1002中的程序可以实现处理单元902。
在本申请实施例中,处理器可以是通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
在本申请实施例中,存储器可以是非易失性存储器,比如硬盘驱动(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)等,还可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM)。存储器是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本申请实施例中的存储器还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显 示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
本申请实施例提供的方法中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、网络设备、终端或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机可以存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,数字视频光盘(digital video disc,DVD))、或者半导体介质(例如,SSD)等。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (43)

  1. 一种数据传输方法,其特征在于,包括:
    网络设备接收以太网帧,所述以太网帧包括目的媒体访问控制MAC地址、第一循环冗余校验CRC码以及净荷,所述第一CRC码的参数包括所述目的MAC地址,所述第一CRC码的参数不包括所述净荷;
    所述网络设备根据所述第一CRC码对所述目的MAC地址进行校验,确定所述目的MAC地址是否发生错误;
    如果所述网络设备确定所述目的MAC地址没有发生错误,则所述网络设备根据所述目的MAC地址对所述以太网帧进行转发。
  2. 根据权利要求1所述的方法,其特征在于,所述以太网帧还包括第一以太类型,所述第一以太类型用于指示所述第一CRC码是CRC码,所述第一CRC码的参数不包括所述第一以太类型;
    所述网络设备根据所述第一CRC码对所述目的MAC地址进行校验,包括:
    所述网络设备根据所述第一以太类型确定所述第一CRC码是CRC码;
    所述网络设备响应于所述第一CRC码是CRC码,根据所述第一CRC码对所述目的MAC地址进行校验。
  3. 根据权利要求1或2所述的方法,其特征在于,所述以太网帧还包括虚拟局域网VLAN标签,所述第一CRC码的参数还包括所述VLAN标签;
    所述网络设备根据所述第一CRC码对所述目的MAC地址进行校验,确定所述目的MAC地址是否发生错误,包括:
    所述网络设备根据所述第一CRC码对所述目的MAC地址和所述VLAN标签进行校验,确定所述目的MAC地址和所述VLAN标签是否发生错误;
    如果所述网络设备确定所述目的MAC地址没有发生错误,则所述网络设备根据所述目的MAC地址对所述以太网帧进行转发,包括:
    如果所述网络设备确定所述目的MAC地址和所述VLAN标签没有发生错误,则所述网络设备根据所述目的MAC地址对所述以太网帧进行转发。
  4. 根据权利要求1或2所述的方法,其特征在于,所述以太网帧还包括第二以太类型,所述第一CRC码的参数还包括所述第二以太类型,所述净荷包括协议报文,所述第二以太类型用于指示所述净荷中的所述协议报文的协议类型;
    所述网络设备根据所述第一CRC码对所述目的MAC地址进行校验,确定所述目的MAC地址是否发生错误,包括:
    所述网络设备根据所述第一CRC码对所述目的MAC地址和所述第二以太类型进行校验,确定所述目的MAC地址和所述第二以太类型是否发生错误;
    如果所述网络设备确定所述目的MAC地址没有发生错误,则所述网络设备根据所述目的MAC地址对所述以太网帧进行转发,包括:
    如果所述网络设备确定所述目的MAC地址和所述第二以太类型没有发生错误,则所述网络设备根据所述目的MAC地址对所述以太网帧进行转发。
  5. 根据权利要求1或2所述的方法,其特征在于,所述以太网帧还包括源MAC地址,所述第一CRC码的参数还包括所述源MAC地址;
    所述网络设备根据所述第一CRC码对所述目的MAC地址进行校验,确定所述目的MAC地址是否发生错误,包括:
    所述网络设备根据所述第一CRC码对所述目的MAC地址和所述源MAC地址进行校验,确定所述目的MAC地址和所述源MAC地址是否发生错误;
    如果所述网络设备确定所述目的MAC地址没有发生错误,则所述网络设备根据所述目的MAC地址对所述以太网帧进行转发,包括:
    如果所述网络设备确定所述目的MAC地址和所述源MAC地址没有发生错误,则所述网络设备根据所述目的MAC地址对所述以太网帧进行转发。
  6. 一种数据传输方法,其特征在于,包括:
    网络设备生成以太网帧,所述以太网帧包括目的媒体访问控制MAC地址、第一循环冗余校验CRC码以及净荷,所述第一CRC码的参数包括所述目的MAC地址,所述第一CRC码的参数不包括所述净荷;
    所述网络设备发送所述以太网帧。
  7. 根据权利要求6所述的方法,其特征在于,所述以太网帧还包括第一以太类型,所述第一以太类型用于指示所述第一CRC码是CRC码,所述第一CRC码的参数不包括所述第一以太类型。
  8. 根据权利要求6或7所述的方法,其特征在于,所述以太网帧还包括虚拟局域网VLAN标签,所述第一CRC码的参数还包括所述VLAN标签。
  9. 根据权利要求6至8中任一项所述的方法,其特征在于,所述以太网帧还包括第二以太类型,所述第一CRC码的参数还包括所述第二以太类型,所述净荷包括协议报文,所述第二以太类型用于指示所述净荷中的所述协议报文的协议类型。
  10. 根据权利要求6至9中任一项所述的方法,其特征在于,所述以太网帧还包括源MAC地址。
  11. 一种数据传输方法,其特征在于,包括:
    网络设备接收以太网帧,所述以太网帧包括目的媒体访问控制MAC地址、第一循环冗余校验CRC码以及净荷,所述第一CRC码的参数包括所述目的MAC地址和所述净荷的仅仅一部分;
    所述网络设备根据所述第一CRC码对所述目的MAC地址和所述净荷的仅仅一部分进行校验,确定所述目的MAC地址和所述净荷的仅仅一部分是否发生错误;
    如果所述网络设备确定所述目的MAC地址和所述净荷的仅仅一部分没有发生错误,则所述网络设备根据所述目的MAC地址对所述以太网帧进行转发。
  12. 根据权利要求11所述的方法,其特征在于,所述以太网帧还包括第一以太类型,所述第一以太类型用于指示所述第一CRC码是CRC码,所述第一CRC码的参数不包括所述第一以太类型;
    所述网络设备根据所述第一CRC码对所述目的MAC地址进行校验,包括:
    所述网络设备根据所述第一以太类型确定所述第一CRC码是CRC码;
    所述网络设备响应于所述第一CRC码是CRC码,根据所述第一CRC码对所述目的MAC地址进行校验。
  13. 根据权利要求11或12所述的方法,其特征在于,所述以太网帧还包括虚拟 局域网VLAN标签,所述第一CRC码的参数还包括所述VLAN标签;
    所述网络设备根据所述第一CRC码对所述目的MAC地址和所述净荷的仅仅一部分进行校验,确定所述目的MAC地址和所述净荷的仅仅一部分是否发生错误,包括:
    所述网络设备根据所述第一CRC码对所述目的MAC地址、所述净荷的仅仅一部分和所述VLAN标签进行校验,确定所述目的MAC地址、所述净荷的仅仅一部分和所述VLAN标签是否发生错误;
    如果所述网络设备确定所述目的MAC地址和所述净荷的仅仅一部分没有发生错误,则所述网络设备根据所述目的MAC地址对所述以太网帧进行转发,包括:
    如果所述网络设备确定所述目的MAC地址、所述净荷的仅仅一部分和所述VLAN标签没有发生错误,则所述网络设备根据所述目的MAC地址对所述以太网帧进行转发。
  14. 根据权利要求11至13中任一所述的方法,其特征在于,所述以太网帧还包括第二以太类型,所述第一CRC码的参数还包括所述第二以太类型,所述净荷包括协议报文,所述协议报文包括协议头以及报文净荷,所述第一CRC码的参数包括的所述净荷的仅仅一部分为所述协议头的至少一部分,所述第二以太类型用于指示所述净荷中的所述协议报文的协议类型;
    所述网络设备根据所述第一CRC码对所述目的MAC地址和所述净荷的仅仅一部分进行校验,确定所述目的MAC地址和所述净荷的仅仅一部分是否发生错误,包括:
    所述网络设备根据所述第一CRC码对所述目的MAC地址、所述净荷的仅仅一部分和所述第二以太类型进行校验,确定所述目的MAC地址、所述净荷的仅仅一部分和所述第二以太类型是否发生错误;
    如果所述网络设备确定所述目的MAC地址和所述净荷的仅仅一部分没有发生错误,则所述网络设备根据所述目的MAC地址对所述以太网帧进行转发,包括:
    如果所述网络设备确定所述目的MAC地址、所述净荷的仅仅一部分和所述第二以太类型没有发生错误,则所述网络设备根据所述目的MAC地址对所述以太网帧进行转发。
  15. 根据权利要求11或12所述的方法,其特征在于,所述以太网帧还包括源MAC地址,所述第一CRC码的参数还包括所述源MAC地址;
    所述网络设备根据所述第一CRC码对所述目的MAC地址和所述净荷的仅仅一部分进行校验,确定所述目的MAC地址和所述净荷的仅仅一部分是否发生错误,包括:
    所述网络设备根据所述第一CRC码对所述目的MAC地址、所述净荷的仅仅一部分和所述源MAC地址进行校验,确定所述目的MAC地址、所述净荷的仅仅一部分和所述源MAC地址是否发生错误;
    如果所述网络设备确定所述目的MAC地址和所述净荷的仅仅一部分没有发生错误,则所述网络设备根据所述目的MAC地址对所述以太网帧进行转发,包括:
    如果所述网络设备确定所述目的MAC地址、所述净荷的仅仅一部分和所述源MAC地址没有发生错误,则所述网络设备根据所述目的MAC地址对所述以太网帧进行转发。
  16. 一种数据传输方法,其特征在于,包括:
    网络设备生成以太网帧,所述以太网帧包括目的媒体访问控制MAC地址、第一循环冗余校验CRC码以及净荷,所述第一CRC码的参数包括所述目的MAC地址和所述净荷的仅仅一部分;
    所述网络设备发送所述以太网帧。
  17. 根据权利要求16所述的方法,其特征在于,所述以太网帧还包括第一以太类型,所述第一以太类型用于指示所述第一CRC码是CRC码,所述第一CRC码的参数不包括所述第一以太类型。
  18. 根据权利要求16或17所述的方法,其特征在于,所述以太网帧还包括虚拟局域网VLAN标签,所述第一CRC码的参数还包括所述VLAN标签。
  19. 根据权利要求16至18中任一项所述的方法,其特征在于,所述以太网帧还包括第二以太类型,所述第一CRC码的参数还包括所述第二以太类型,所述净荷包括协议报文,所述协议报文包括协议头以及报文净荷,所述第一CRC码的参数包括的所述净荷的仅仅一部分为所述协议头的至少一部分,所述第二以太类型用于指示所述净荷中的所述协议报文的协议类型。
  20. 根据权利要求16至19中任一项所述的方法,其特征在于,所述以太网帧还包括源MAC地址。
  21. 一种数据传输装置,其特征在于,包括:
    接收单元,用于接收以太网帧,所述以太网帧包括目的媒体访问控制MAC地址、第一循环冗余校验CRC码以及净荷,所述第一CRC码的参数包括所述目的MAC地址,所述第一CRC码的参数不包括所述净荷;
    处理单元,用于根据所述第一CRC码对所述目的MAC地址进行校验,确定所述目的MAC地址是否发生错误;
    如果所述处理单元确定所述目的MAC地址没有发生错误,发送单元,用于根据所述目的MAC地址对所述以太网帧进行转发。
  22. 根据权利要求21所述的装置,其特征在于,所述以太网帧还包括第一以太类型,所述第一以太类型用于指示所述第一CRC码是CRC码,所述第一CRC码的参数不包括所述第一以太类型;所述处理单元,用于:
    根据所述第一以太类型确定所述第一CRC码是CRC码;
    响应于所述第一CRC码是CRC码,根据所述第一CRC码对所述目的MAC地址进行校验。
  23. 根据权利要求21或22所述的装置,其特征在于,所述以太网帧还包括虚拟局域网VLAN标签,所述第一CRC码的参数还包括所述VLAN标签;
    所述处理单元,用于:
    根据所述第一CRC码对所述目的MAC地址和所述VLAN标签进行校验,确定所述目的MAC地址和所述VLAN标签是否发生错误;
    如果所述处理单元确定所述目的MAC地址和所述VLAN标签没有发生错误,所述发送单元,用于根据所述目的MAC地址对所述以太网帧进行转发。
  24. 根据权利要求21或22所述的装置,其特征在于,所述以太网帧还包括第二以太类型,所述第一CRC码的参数还包括所述第二以太类型,所述净荷包括协议报文, 所述第二以太类型用于指示所述净荷中的所述协议报文的协议类型;
    所述处理单元,用于:
    根据所述第一CRC码对所述目的MAC地址和所述第二以太类型进行校验,确定所述目的MAC地址和所述第二以太类型是否发生错误;
    如果所述处理单元确定所述目的MAC地址和所述第二以太类型没有发生错误,则所述发送单元,用于根据所述目的MAC地址对所述以太网帧进行转发。
  25. 根据权利要求21或22所述的装置,其特征在于,所述以太网帧还包括源MAC地址,所述第一CRC码的参数还包括所述源MAC地址;
    所述处理单元,用于:
    根据所述第一CRC码对所述目的MAC地址和所述源MAC地址进行校验,确定所述目的MAC地址和所述源MAC地址是否发生错误;
    如果所述处理单元确定所述目的MAC地址和所述源MAC地址没有发生错误,则所述发送单元,用于根据所述目的MAC地址对所述以太网帧进行转发。
  26. 一种数据传输装置,其特征在于,包括:
    处理单元,用于生成以太网帧,所述以太网帧包括目的媒体访问控制MAC地址、第一循环冗余校验CRC码以及净荷,所述第一CRC码的参数包括所述目的MAC地址,所述第一CRC码的参数不包括所述净荷;
    发送单元,用于发送所述以太网帧。
  27. 根据权利要求26所述的装置,其特征在于,所述以太网帧还包括第一以太类型,所述第一以太类型用于指示所述第一CRC码是CRC码,所述第一CRC码的参数不包括所述第一以太类型。
  28. 根据权利要求26或27所述的装置,其特征在于,所述以太网帧还包括虚拟局域网VLAN标签,所述第一CRC码的参数还包括所述VLAN标签。
  29. 根据权利要求26至28中任一项所述的装置,其特征在于,所述以太网帧还包括第二以太类型,所述第一CRC码的参数还包括所述第二以太类型,所述净荷包括协议报文,所述第二以太类型用于指示所述净荷中的所述协议报文的协议类型。
  30. 根据权利要求26至29中任一项所述的装置,其特征在于,所述以太网帧还包括源MAC地址。
  31. 一种数据传输装置,其特征在于,包括:
    接收单元,用于接收以太网帧,所述以太网帧包括目的媒体访问控制MAC地址、第一循环冗余校验CRC码以及净荷,所述第一CRC码的参数包括所述目的MAC地址和所述净荷的仅仅一部分;
    处理单元,用于根据所述第一CRC码对所述目的MAC地址和所述净荷的仅仅一部分进行校验,确定所述目的MAC地址和所述净荷的仅仅一部分是否发生错误;
    如果所述处理单元确定所述目的MAC地址和所述净荷的仅仅一部分没有发生错误,发送单元,用于根据所述目的MAC地址对所述以太网帧进行转发。
  32. 根据权利要求31所述的装置,其特征在于,所述以太网帧还包括第一以太类型,所述第一以太类型用于指示所述第一CRC码是CRC码,所述第一CRC码的参数不包括所述第一以太类型;所述处理单元,用于:
    根据所述第一以太类型确定所述第一CRC码是CRC码;
    响应于所述第一CRC码是CRC码,根据所述第一CRC码对所述目的MAC地址进行校验。
  33. 根据权利要求31或32所述的装置,其特征在于,所述以太网帧还包括虚拟局域网VLAN标签,所述第一CRC码的参数还包括所述VLAN标签;
    所述处理单元,用于:
    根据所述第一CRC码对所述目的MAC地址、所述净荷的仅仅一部分和所述VLAN标签进行校验,确定所述目的MAC地址、所述净荷的仅仅一部分和所述VLAN标签是否发生错误;
    如果所述处理单元确定所述目的MAC地址、所述净荷的仅仅一部分和所述VLAN标签没有发生错误,则所述发送单元,用于根据所述目的MAC地址对所述以太网帧进行转发。
  34. 根据权利要求31或32所述的装置,其特征在于,所述以太网帧还包括第二以太类型,所述第一CRC码的参数还包括所述第二以太类型,所述净荷包括协议报文,所述协议报文包括协议头以及报文净荷,所述第一CRC码的参数包括的所述净荷的仅仅一部分为所述协议头的至少一部分,所述第二以太类型用于指示所述净荷中的所述协议报文的协议类型;
    所述处理单元,用于:
    根据所述第一CRC码对所述目的MAC地址、所述净荷的仅仅一部分和所述第二以太类型进行校验,确定所述目的MAC地址、所述净荷的仅仅一部分和所述第二以太类型是否发生错误;
    如果所述处理单元确定所述目的MAC地址、所述净荷的仅仅一部分和所述第二以太类型没有发生错误,则所述发送单元,用于根据所述目的MAC地址对所述以太网帧进行转发。
  35. 根据权利要求31或32所述的装置,其特征在于,所述以太网帧还包括源MAC地址,所述第一CRC码的参数还包括所述源MAC地址;
    所述处理单元,用于:
    根据所述第一CRC码对所述目的MAC地址、所述净荷的仅仅一部分和所述源MAC地址进行校验,确定所述目的MAC地址、所述净荷的仅仅一部分和所述源MAC地址是否发生错误;
    如果所述处理单元确定所述目的MAC地址、所述净荷的仅仅一部分和所述源MAC地址没有发生错误,则所述发送单元,用于根据所述目的MAC地址对所述以太网帧进行转发。
  36. 一种数据传输装置,其特征在于,包括:
    处理单元,用于生成以太网帧,所述以太网帧包括目的媒体访问控制MAC地址、第一循环冗余校验CRC码以及净荷,所述第一CRC码的参数包括所述目的MAC地址和所述净荷的仅仅一部分;
    发送单元,用于发送所述以太网帧。
  37. 根据权利要求36所述的装置,其特征在于,所述以太网帧还包括第一以太类 型,所述第一以太类型用于指示所述第一CRC码是CRC码,所述第一CRC码的参数不包括所述第一以太类型。
  38. 根据权利要求36或37所述的装置,其特征在于,所述以太网帧还包括虚拟局域网VLAN标签,所述第一CRC码的参数还包括所述VLAN标签。
  39. 根据权利要求36至38中任一项所述的装置,其特征在于,所述以太网帧还包括第二以太类型,所述第一CRC码的参数还包括所述第二以太类型,所述净荷包括协议报文,所述协议报文包括协议头以及报文净荷,所述第一CRC码的参数包括的所述净荷的仅仅一部分为所述协议头的至少一部分,所述第二以太类型用于指示所述净荷中的所述协议报文的协议类型。
  40. 根据权利要求36至39中任一项所述的装置,其特征在于,所述以太网帧还包括源MAC地址。
  41. 一种通信装置,其特征在于,包括:至少一个处理器、存储器、总线和收发器,其中,所述存储器用于存储计算机程序,使得所述计算机程序被所述至少一个处理器执行时实现如权利要求1-5中任一项所述的数据传输方法、权利要求6-10中任一项所述的数据传输方法、权利要求11-15中任一项所述的数据传输方法或权利要求16-20中任一项所述的数据传输方法。
  42. 一种计算机可读存储介质,其特征在于,包括:计算机软件指令;
    当所述计算机软件指令在通信装置或内置在通信装置的芯片中运行时,使得所述通信装置执行如权利要求1-5中任一项所述的数据传输方法、权利要求6-10中任一项所述的数据传输方法、权利要求11-15中任一项所述的数据传输方法或权利要求16-20中任一项所述的数据传输方法。
  43. 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在通信装置或内置在通信装置的芯片中运行时,使得所述通信装置执行如权利要求1-5中任一项所述的数据传输方法、权利要求6-10中任一项所述的数据传输方法、权利要求11-15中任一项所述的数据传输方法或权利要求16-20中任一项所述的数据传输方法。
PCT/CN2019/070698 2019-01-07 2019-01-07 一种数据传输方法及装置 WO2020142880A1 (zh)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP2021539432A JP7247351B2 (ja) 2019-01-07 2019-01-07 データ送信方法及び機器
PCT/CN2019/070698 WO2020142880A1 (zh) 2019-01-07 2019-01-07 一种数据传输方法及装置
EP19908885.7A EP3893457B1 (en) 2019-01-07 2019-01-07 Data transmission method and device
CN201980087861.9A CN113287285A (zh) 2019-01-07 2019-01-07 一种数据传输方法及装置
US17/367,017 US11799776B2 (en) 2019-01-07 2021-07-02 Ethernet frame forwarding based on checking for an error in the ethernet frame

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/070698 WO2020142880A1 (zh) 2019-01-07 2019-01-07 一种数据传输方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/367,017 Continuation US11799776B2 (en) 2019-01-07 2021-07-02 Ethernet frame forwarding based on checking for an error in the ethernet frame

Publications (1)

Publication Number Publication Date
WO2020142880A1 true WO2020142880A1 (zh) 2020-07-16

Family

ID=71520580

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/070698 WO2020142880A1 (zh) 2019-01-07 2019-01-07 一种数据传输方法及装置

Country Status (5)

Country Link
US (1) US11799776B2 (zh)
EP (1) EP3893457B1 (zh)
JP (1) JP7247351B2 (zh)
CN (1) CN113287285A (zh)
WO (1) WO2020142880A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023116229A1 (zh) * 2021-12-22 2023-06-29 华为技术有限公司 生成、处理以太帧的方法、装置、设备、系统及存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115914010A (zh) * 2021-09-30 2023-04-04 中兴通讯股份有限公司 网络监测方法、装置及计算机存储介质
WO2024054283A1 (en) * 2022-09-08 2024-03-14 Microchip Technology Incorporated System and method for forwarding network traffic

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101325472A (zh) * 2008-07-24 2008-12-17 哈尔滨工业大学 一种以太网mac帧结构演示系统和方法
CN101471924A (zh) * 2007-12-27 2009-07-01 华为技术有限公司 一种数据包头指示方法及设备
WO2014081477A1 (en) * 2012-11-26 2014-05-30 Intel Corporation Methods and arrangements to decode communications
CN107370674A (zh) * 2016-05-13 2017-11-21 华为技术有限公司 一种数据传输的方法、设备和系统

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7577143B1 (en) * 2001-09-25 2009-08-18 Juniper Networks, Inc. Decoupling functionality related to providing a transparent local area network segment service
US20030188190A1 (en) * 2002-03-26 2003-10-02 Aaron Jeffrey A. System and method of intrusion detection employing broad-scope monitoring
US9866658B2 (en) * 2005-04-29 2018-01-09 Microsemi Storage Solutions, Inc. Method and apparatus for SAS open address frame processing in SAS expanders
CN101159656B (zh) 2007-11-12 2011-05-11 华为技术有限公司 一种报文采样的方法、系统及设备
US20090210770A1 (en) * 2008-02-14 2009-08-20 International Business Machines Corporation Method, system and computer program product for end to end error checking in ethernet
CN102238063B (zh) * 2010-04-26 2014-04-16 华为技术有限公司 一种报文处理方法及设备
US9014190B2 (en) * 2011-11-11 2015-04-21 Itron, Inc. Routing communications based on node availability
US9455905B2 (en) * 2013-02-22 2016-09-27 Broadcom Corporation Encapsulation for link layer preemption
WO2014138446A1 (en) * 2013-03-06 2014-09-12 Hospira,Inc. Medical device communication method
US10404625B2 (en) * 2013-10-29 2019-09-03 Intel Corporation Ethernet enhancements
DE102014224944A1 (de) * 2014-12-04 2016-06-09 Continental Automotive Gmbh Verfahren und Steuergerät zur Übertragung sicherheitsrelevanter Daten in einem Kraftfahrzeug mittels eines Ethernet-Standards
US10644976B2 (en) * 2015-05-18 2020-05-05 Denso Corporation Relay apparatus
JP6634718B2 (ja) * 2015-07-01 2020-01-22 富士通株式会社 仮想ネットワーク設定方法、仮想ネットワーク設定プログラム及び中継装置
US20180288706A1 (en) * 2017-03-29 2018-10-04 Intel Corporation Wireless communication device, system and method to provide an operational cyclic prefix length to decode a wake-up packet
US10397143B1 (en) * 2017-06-19 2019-08-27 Amazon Technologies, Inc. Preventing transmission of errors in a computing network
US10530396B2 (en) * 2017-11-20 2020-01-07 International Business Machines Corporation Dynamically adjustable cyclic redundancy code types
US11070471B1 (en) * 2018-07-30 2021-07-20 Paul Chang Switch fabric for networked virtual machines
US10917504B1 (en) * 2018-09-05 2021-02-09 Amazon Technologies, Inc. Identifying the source of CRC errors in a computing network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101471924A (zh) * 2007-12-27 2009-07-01 华为技术有限公司 一种数据包头指示方法及设备
CN101325472A (zh) * 2008-07-24 2008-12-17 哈尔滨工业大学 一种以太网mac帧结构演示系统和方法
WO2014081477A1 (en) * 2012-11-26 2014-05-30 Intel Corporation Methods and arrangements to decode communications
CN107370674A (zh) * 2016-05-13 2017-11-21 华为技术有限公司 一种数据传输的方法、设备和系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023116229A1 (zh) * 2021-12-22 2023-06-29 华为技术有限公司 生成、处理以太帧的方法、装置、设备、系统及存储介质

Also Published As

Publication number Publication date
US11799776B2 (en) 2023-10-24
CN113287285A (zh) 2021-08-20
JP7247351B2 (ja) 2023-03-28
EP3893457B1 (en) 2023-08-30
JP2022516355A (ja) 2022-02-25
US20210336881A1 (en) 2021-10-28
EP3893457A4 (en) 2021-12-01
EP3893457A1 (en) 2021-10-13

Similar Documents

Publication Publication Date Title
EP3461082B1 (en) Network congestion control method and device
US7899048B1 (en) Method and apparatus for remotely monitoring network traffic through a generic network
US11799776B2 (en) Ethernet frame forwarding based on checking for an error in the ethernet frame
JP6032278B2 (ja) Lan多重化装置
US11018892B2 (en) Broadband remote access server (BRAS) system-based packet encapsulation
KR100910818B1 (ko) 비-macsec 노드들을 통해 macsec 패킷들을터널링하기 위한 방법 및 시스템
US8351352B1 (en) Methods and apparatus for RBridge hop-by-hop compression and frame aggregation
WO2017193758A1 (zh) 一种数据传输的方法、设备和系统
US6414956B1 (en) VLAN tag transport within a switch
US20160226817A1 (en) Apparatus and method for creating block-type structure using sketch-based user interaction
US20220255772A1 (en) Packet sending method, apparatus, and system
WO2022042503A1 (zh) 一种报文传输方法、装置及系统
WO2021088813A1 (zh) 报文封装方法及装置、报文解封装方法及装置
KR101140453B1 (ko) Ip 인터워킹 vll을 통한 회로 에뮬레이션 방법 및 시스템
CN109120526B (zh) 点对点的传输报文的方法和网络设备
US11855888B2 (en) Packet verification method, device, and system
US8583822B2 (en) Method and system for minimum frame size support for a communication protocol encapsulated over Ethernet
WO2021254454A1 (zh) Bier oam检测的方法、设备以及系统
EP3896924A1 (en) Packet detection method and first network device
US10819631B2 (en) Network device supporting trill protocol and communication method thereof
EP4287567A1 (en) Data processing method, apparatus and chip
CN116366300A (zh) 数据传输方法、设备和数据传输系统
CN111835736A (zh) 一种报文传输方法及系统
EP1065860A1 (en) VLAN tag transport within a switch

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19908885

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021539432

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019908885

Country of ref document: EP

Effective date: 20210708