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

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

Info

Publication number
WO2015165255A1
WO2015165255A1 PCT/CN2014/091789 CN2014091789W WO2015165255A1 WO 2015165255 A1 WO2015165255 A1 WO 2015165255A1 CN 2014091789 W CN2014091789 W CN 2014091789W WO 2015165255 A1 WO2015165255 A1 WO 2015165255A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
receiving device
communication connection
mac layer
message
Prior art date
Application number
PCT/CN2014/091789
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 华为技术有限公司
Publication of WO2015165255A1 publication Critical patent/WO2015165255A1/zh

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/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals

Definitions

  • the present invention relates to the field of communications, and in particular, to a data transmission method and apparatus.
  • FC Fibre Channel
  • PCIE Peripheral Component Interconnect Express
  • the Ethernet data transmission Due to the congestion of the data and the weak error control, the Ethernet data transmission has a slow rate, a link error, a large number of packet loss, or even a network failure.
  • the prior art schedules data transmission through an Ethernet high-layer protocol, and solves the link congestion problem to some extent. For example, PFC (priority-based flow control), ETS (Enhanced Transmission Selection), QCN (Quantized Congestion Notification), etc. can effectively solve link congestion. problem.
  • PFC priority-based flow control
  • ETS Enhanced Transmission Selection
  • QCN Quality Congestion Notification
  • the mechanism for scheduling data transmission in the prior art is implemented in a high-level protocol, such as a TCP (Transmission Control Protocol) layer, when a bit error occurs in the MAC (Media Access Control) layer, a problem occurs.
  • TCP Transmission Control Protocol
  • MAC Media Access Control
  • Embodiments of the present invention provide a data transmission method and apparatus, which can solve the problem that data transmission efficiency is too low and the delay is too long when a bit error occurs in the MAC layer.
  • a data transmission method includes:
  • the sending device sends a data message to the receiving device through a media intervention control MAC layer communication connection established with the receiving device;
  • the transmitting device determines that the data message is not correctly transmitted, the transmitting device resends the data message to the receiving device by using the MAC layer communication connection.
  • the method before the transmitting device sends a data packet to the receiving device by using a media intervention control MAC layer communication connection established by the receiving device, the method further includes:
  • the transmitting device receives a MAC layer communication connection confirmation message sent by the receiving device, and establishes a communication connection with the transmitting device at the MAC layer according to the MAC layer communication connection confirmation message.
  • the sending apparatus determines that the data packet fails to be correctly transmitted, the sending apparatus communicates by using the MAC layer Reconnecting the data message to the receiving device includes:
  • the sending device determines that the response information of the data message is not received within a preset time, the sending device resends the data message to the receiving device by using the MAC layer communication connection.
  • the sending apparatus determines that the data packet fails to be correctly transmitted, the sending apparatus passes the MAC layer
  • the communication connection resending the data message to the receiving device, including:
  • the sending device receives the negative acknowledgement NAK information of the data packet by using the MAC layer communication connection
  • the sending device sends the data to the receiving by using the MAC layer communication connection according to the NAK information of the data packet.
  • the device resends the data packet, and the NAK information of the data packet is used to indicate that the receiving device does not correctly receive the data packet.
  • the data packet includes a sequence number of the data packet, and the method further includes:
  • the transmitting device receives, by using the MAC layer communication connection, a data retransmission message sent by the receiving device, where the data retransmission message includes NAK information and a sequence number of the NAK information;
  • the sending device determines that the NAK information of the data message is received through the MAC layer communication connection.
  • the sending device controls a MAC layer communication connection by using a media intervention established with the receiving device
  • the receiving device sends a data packet, where the sending device sends a data packet to the receiving device by using a predefined extended MAC frame structure;
  • the predefined extended MAC frame structure includes a source MAC address of the packet, a destination MAC address of the packet, an Ethernet data frame type of the packet, a sequence number of the packet, and a packet type.
  • the data packet includes a MAC address of the sending device, a MAC address of the receiving device, an Ethernet data frame type, a sequence number of the data packet, and a type of the data packet.
  • a data transmission method includes:
  • the receiving device controls the MAC layer communication connection, and receives the data message sent by the sending device;
  • the receiving device determines that the received data message has an error, transmitting, by the MAC layer communication connection, the negative acknowledgement NAK information of the data packet to the sending device, and the NAK information of the data packet And is used to indicate that the receiving device does not correctly receive the data message.
  • the method before the receiving, by the MAC layer, the receiving, by the MAC layer, the data packet sent by the sending device, the method further includes:
  • the receiving device transmits the MAC layer communication connection confirmation message to the transmitting device.
  • the data packet includes a sequence number of the data packet, and the method further includes:
  • the receiving device determines, according to the sequence number of the data packet carried in the data packet, whether the data packet has an error.
  • the MAC layer communication connection is performed. Sending the NAK information of the data packet to the sending device, including:
  • the receiving device determines that the received data packet has an error, the receiving device generates a data retransmission packet according to the data packet, where the data retransmission packet includes a NAK information and a a sequence number of the NAK information, the sequence number of the NAK information being consistent with the data message indicated by the sequence number of the data packet, the data retransmission message being used to indicate that the receiving device does not correctly receive the data Message
  • the receiving device sends the data retransmission message to the sending device by using the MAC layer communication connection.
  • the receiving device sends the data retransmission packet to the sending device by using the MAC layer communication connection, including:
  • the receiving device sends the data retransmission message to the receiving device by using a predefined extended MAC frame structure
  • the predefined extended MAC frame structure includes a source MAC address of the packet, a destination MAC address of the packet, an Ethernet data frame type of the packet, a sequence number of the packet, and a packet type.
  • the data retransmission message includes a MAC address of the receiving device, a MAC address of the sending device, an Ethernet data frame type, a sequence number of the data retransmission message, and NAK information.
  • the sending by the MAC layer communication connection, the data to the sending device After the message's negative response to the NAK message, it also includes:
  • a transmitting device includes:
  • a sending unit configured to send a data message to the receiving device by using a media intervention control MAC layer communication connection established by the receiving device;
  • the sending unit is further configured to: when determining that the receiving device does not normally receive the data packet, resend the data packet to the receiving device by using the MAC layer communication connection.
  • the sending unit is further configured to send a MAC layer communication connection request message to the receiving device according to a MAC address of the receiving device;
  • the transmitting device further includes a receiving unit and a connecting unit,
  • the receiving unit is configured to receive a MAC layer communication connection confirmation message sent by the receiving device;
  • the connecting unit is configured to establish a communication connection with the sending device at the MAC layer according to the MAC layer communication connection confirmation message received by the receiving unit.
  • the sending unit is further configured to: when determining that the response information of the data packet is not received within a preset time, Retransmitting the data message to the receiving device over the MAC layer communication connection.
  • the sending unit is further configured to: when the sending device receives the sending by the receiving device by using the MAC layer communication connection When the data message is negatively responsive to the NAK information, the data message is retransmitted to the receiving device by the MAC layer communication connection according to the NAK information of the data message, and the data message is NAK The information is used to indicate that the receiving device does not normally receive the data message.
  • the data packet includes a sequence number of the data packet
  • the receiving unit is further configured to receive, by using the MAC layer communication connection, a data retransmission message sent by the receiving device, where the data retransmission message includes a NAK information and a sequence number of the NAK information;
  • the receiving unit is further configured to: when the sequence number of the NAK information is consistent with the data packet indicated by the sequence number of the data packet, determine that the NAK of the data packet is received by using the MAC layer communication connection. information.
  • the sending unit is further configured to use a predefined extended MAC frame structure to The receiving device sends a data message
  • the predefined extended MAC frame structure includes a source MAC address of the packet, a destination MAC address of the packet, an Ethernet data frame type of the packet, a sequence number of the packet, and a packet type.
  • the data packet includes a MAC address of the sending device, a MAC address of the receiving device, an Ethernet data frame type, a sequence number of the data packet, and a type of the data packet.
  • a receiving apparatus includes:
  • a receiving unit configured to receive, by using a media intervention control MAC layer communication connection established by the sending device, the data message sent by the sending device;
  • a sending unit configured to send, by using the MAC layer communication connection, a negative acknowledgement NAK information of the data packet, and a NAK information of the data packet, when an error occurs in the received data packet And is used to indicate that the receiving device does not correctly receive the data message.
  • the receiving unit is further configured to receive a MAC layer communication connection request message sent by the sending device;
  • the receiving device further includes a control unit, configured to generate a MAC layer communication connection confirmation message
  • the sending unit is configured to connect the MAC layer communication generated by the control unit A confirmation message is sent to the transmitting device.
  • the data packet includes a sequence number of the data packet
  • the control unit is further configured to determine whether an error occurs in the data packet according to the sequence number of the data packet carried in the data packet.
  • control unit is further configured to: when the received data packet has an error, according to the data packet And generating a data retransmission message, where the data retransmission message includes a NAK information and a sequence number of the NAK information, where a sequence number of the NAK information is consistent with a data message indicated by a sequence number of the data packet, The data retransmission message is used to indicate that the receiving device does not correctly receive the data packet;
  • the sending unit is further configured to send, by using the MAC layer communication connection, the data retransmission message generated by the control unit to the sending apparatus.
  • the sending unit is further configured to send the data weight to the receiving device by using a predefined extended MAC frame structure Send a message;
  • the predefined extended MAC frame structure includes a source MAC address of the packet, a destination MAC address of the packet, an Ethernet data frame type of the packet, a sequence number of the packet, and a packet type.
  • the data retransmission message includes a MAC address of the receiving device, a MAC address of the sending device, an Ethernet data frame type, a sequence number of the data retransmission message, and NAK information.
  • the receiving unit is further configured to receive, by using the MAC layer communication connection, Sending the data message retransmitted by the device.
  • the sending device sends a data message to the receiving device through the media intervention control MAC layer communication connection established by the receiving device, and if the sending device determines that the data message is not correctly transmitted, The transmitting device retransmits the data packet to the receiving device through the MAC layer communication connection, thereby implementing a mechanism for ensuring reliable transmission of the Ethernet data at the MAC layer, and avoiding the prior art only through the high-level association.
  • the scheduling of the transmission of the Ethernet data can retransmit the data packet in time when the MAC layer fails to correctly transmit the data packet, such as the error, the packet loss, and the transmission timeout, thereby solving the MAC layer in the prior art.
  • the problem of data transmission efficiency that is too low and the delay is too long when an error occurs.
  • FIG. 1 is a schematic flowchart of a data transmission method according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of another data transmission method according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of still another data transmission method according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a transmitting apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a receiving apparatus according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of another sending apparatus according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of another receiving apparatus according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a data transmission system according to an embodiment of the present invention.
  • An embodiment of the present invention provides a data transmission method, which is applied to a transmitting apparatus. Referring to FIG. 1, the method includes the following steps:
  • the transmitting device sends a data packet to the receiving device by using a media intervention control MAC layer communication connection established by the receiving device.
  • the sending device is applied to an Ethernet, and the sending device is The device has established a media intervention control MAC layer communication connection with the receiving device, so the transmitting device can send a data message to the receiving device through a media intervention control MAC layer communication connection established with the receiving device, wherein the MAC layer is located at the OSI
  • the data link layer of the (Open System Interconnection) model is the lower layer protocol of the OSI model, and is mainly responsible for the control and connection of the physical layer physical media.
  • the sending device determines that the data message is not correctly transmitted, the sending device resends the data message to the receiving device by using the MAC layer communication connection.
  • the error may occur, the packet loss, the transmission timeout, and the like may be required by the transmitting device to resend the data packet.
  • the receiving device does not receive the data packet or the received data packet. An error occurred, or it took a long time to receive a data message.
  • the determining when determining that the data packet fails to be correctly transmitted, resending the data packet to the receiving device by using the MAC layer communication connection, thereby establishing a mechanism for data retransmission detection and guarantee at the MAC layer to ensure
  • the error occurs in the MAC layer, such as error, packet loss, and transmission timeout
  • the data packet is retransmitted in time, which effectively reduces the data transmission efficiency caused by the error in the MAC layer.
  • the problem of delay is too long.
  • the case that the data packet is not correctly transmitted may include:
  • the transmitting device After transmitting the data message, the transmitting device receives the NAK (Negative Acknowledgement) information sent by the receiving device, and then retransmits the data message to the transmitting device.
  • the negative acknowledgement NAK information indicates that the receiving device does not correctly receive the data packet, and the receiving device instructs the transmitting device to resend the data packet by sending the NAK information to the transmitting device.
  • the sending device does not receive the ACK (Acknowledgement) information sent by the receiving device or the NAK information sent by the receiving device in the preset time, wherein the ACK information of the data packet is used to indicate that the receiving device correctly receives the data.
  • the sending device starts timing when the data message is sent, and stops receiving the ACK information or the NAK information sent by the receiving device, and further optionally, if the NAK information is not received or received within the preset time.
  • the NAK information also stops timing, that is, the time period of the timer reaches the preset time to stop timing.
  • the response information that the sending device does not receive the data packet within the preset time may be caused by the network congestion or packet loss, and the receiving device does not receive the data packet. Or after a long time to receive the data message, the sending device will resend the data message to ensure the efficiency of data retransmission.
  • the transmitting device sends a data packet to the receiving device through the media intervention control MAC layer communication connection established by the receiving device, and if the sending device determines that the data packet fails to be correctly transmitted, The device retransmits the data packet to the receiving device through the MAC layer communication connection, thereby implementing a mechanism for ensuring reliable transmission of the Ethernet data at the MAC layer, and avoiding scheduling of Ethernet data transmission only by the upper layer protocol in the prior art.
  • the error occurs in the MAC layer, such as the error, the packet loss, and the transmission timeout
  • the data packet is retransmitted in time, which solves the problem that the data transmission efficiency of the MAC layer in the prior art is too low.
  • the problem is that the delay is too long.
  • An embodiment of the present invention provides another data transmission method, which is applied to a receiving device.
  • the method includes the following steps:
  • the receiving device controls the MAC layer communication connection by using the media established by the sending device, and receives the data packet sent by the sending device.
  • the receiving device receives the data packet sent by the sending device, or may cause the data packet received by the receiving device to be in error due to errors, congestion, packet loss, etc., and the data packet may be received after a long time. Text or unable to receive data messages.
  • the receiving device determines that the received data message has an error, transmitting a negative acknowledgement NAK information of the data message to the transmitting device through the MAC layer communication connection.
  • the NAK information of the data packet is used to indicate that the receiving device does not correctly receive the data packet.
  • the received data packet is determined:
  • the receiving device If the data message has no error, the receiving device generates corresponding ACK information, and sends the ACK information to the sending device through the MAC layer communication connection;
  • the receiving device If the data message is in error, the receiving device generates corresponding NAK information and will The NAK information is sent to the transmitting device through the MAC layer communication connection.
  • the transmitting device sends a data packet to the receiving device through the media intervention control MAC layer communication connection established by the receiving device, and if the receiving device determines that the received data packet has an error, the transmitting device passes The MAC layer communication connection sends a negative acknowledgement NAK information of the data message to the transmitting device, and the transmitting device retransmits the data packet to the receiving device through the MAC layer communication connection, thereby implementing a mechanism for ensuring reliable transmission of the Ethernet data at the MAC layer, thereby avoiding
  • the high-level protocol is used to schedule the transmission of the Ethernet data, and the data packet can be retransmitted in time when the error occurs in the MAC layer, such as error, packet loss, and transmission timeout.
  • the data transmission efficiency is too low and the delay is too long.
  • the data transmission method provided by the embodiment of the present invention receives the data message sent by the sending device by the receiving device controlling the MAC layer communication connection through the media intervention established by the transmitting device, and if the receiving device determines that the received data message has an error, The NAK information of the data packet is sent to the sending device by using the MAC layer communication connection, and the NAK information of the data packet is used to indicate that the receiving device does not correctly receive the data packet, which solves the problem that the MAC layer in the prior art has an error.
  • the data transmission efficiency is too low and the delay is too long.
  • an embodiment of the present invention provides a data transmission method, and the following steps are included as shown in FIG. 3:
  • the transmitting device sends a MAC layer communication connection request message to the receiving device according to the MAC address of the receiving device.
  • both the transmitting device and the receiving device belong to a network device in an Ethernet.
  • the sending device may establish a MAC layer communication connection with the receiving device by using a MAC layer communication connection entry, and the MAC layer communication connection entry records that a MAC layer communication connection can be established.
  • Information of the opposite end such as a MAC address, so that the transmitting device can acquire the MAC address of the receiving device, and send a MAC layer communication connection request message to the receiving device according to the MAC address of the receiving device to request establishment of the receiving device.
  • MAC layer communication connection such as a MAC address
  • the network device may include multiple network devices, and the sending device may be the first network device in the Ethernet.
  • Table 1 is the MAC address of the first network device.
  • the layer communication connection entry records the MAC layer communication connection relationship between the first network device and other network devices.
  • the first network device establishes a MAC layer communication connection with the network device at the other end of the MAC layer communication connection through a destination address (DA, Destination Address) and a source address (SA, Source Address) in each MAC layer communication connection.
  • the source address is the address of the network device that initiates the MAC layer communication connection request, that is, the address of the first network device
  • the target address is the address of the target network device, that is, the address of the network device that receives the communication connection request.
  • Communication connection number target address source address 0 First target network device First network device 1 Second target network device First network device 2 Third target network device First network device
  • an embodiment of the present invention may further provide a MAC layer frame structure, so that in all embodiments of the present invention, all MAC layer data messages can be sent and received between the sending device and the receiving device.
  • the frame structure for example, the transmitting device transmits the MAC layer communication connection request message to the receiving device using the frame structure, and the transmitting device, for example, transmits the data message to the receiving device using the frame structure.
  • the frame structure includes the following:
  • the destination MAC address for example, can occupy 6 bytes
  • the source MAC address for example, can occupy 6 bytes
  • the different values represent different message types, so that the type of the message can be quickly determined, for example, a message with an acknowledgment message, a message with a NAK message, a mentality message, and the like.
  • a definition is listed here as follows. In this manner, the ACK/NAK information is included in the type field of the message:
  • the type field of the message can also contain other definitions. Here is just a part of the description.
  • ACK Acknowledgement
  • NAK Negative Acknowledgement
  • the ACK information/NAK information sequence number field can occupy 2 bytes.
  • the ACK information sequence number may be the message sequence number of the currently received data message, and is used to indicate that the currently received data message has been correctly received.
  • the NAK information sequence number may be the message sequence number of the last correctly received data message, corresponding to the currently received data message, and used to indicate the currently received data message. An error occurred and needs to be resent.
  • the payload can carry all protocols, including TCP/IP, FCOE and other protocols that require a highly reliable connection, so that the method shown in the embodiment of the present invention can support various communication protocols.
  • the type of the message in the MAC layer communication connection request message sent by the sending device to the receiving device is 0101.
  • the receiving device sends a MAC layer communication connection confirmation message to the sending device.
  • the type of the MAC layer message of the MAC layer communication connection confirmation message transmitted by the receiving device to the transmitting device is 0110.
  • the transmitting device establishes a communication connection with the sending device at the MAC layer according to the MAC layer communication connection confirmation message.
  • the sending device initiates a synchronization message to the receiving device, and after receiving the synchronization message, the receiving device returns a synchronization confirmation message to the sending device and enters a synchronization state, and prepares to receive the data message sent by the sending device. After receiving the synchronization confirmation message of the receiving device, the sending device enters the synchronization state and starts to send data packets. Then, the transmitting device establishes a MAC layer communication connection with the receiving device.
  • the communication connection information can be monitored and managed through Table 2.
  • Table 2 is the MAC layer communication connection management entry, and the MAC layer communication connection between the plurality of network devices is recorded. status.
  • the MAC layer communication connection management entry may include a communication connection between multiple source network devices and multiple target network devices, and each communication connection may also include multiple pieces of information, where only three source network devices and two are used.
  • the switch state of the MAC layer communication connection between the target network devices is exemplified, which does not mean that the MAC layer communication connection management entry of the present invention must contain the information in Table 2 or only the information in Table 2.
  • the transmitting device sends a data packet to the receiving device by using a media intervention control MAC layer communication connection established by the receiving device.
  • the sending device stores the data message in the cache, so as to be resent when the receiving device does not correctly receive the data message. After the receiving device correctly receives the data message, the sending device can clear the message from the cache.
  • the receiving device determines, according to the sequence number of the data packet carried in the data packet, whether the data packet has an error.
  • the transmitting device can number the message during the data transmission process, and the number starts from 0. Each time one is sent, the serial number of the data message is incremented by 1.
  • the sequence number of the message can also be 0 starts counting.
  • the receiving device parses the data packet at the MAC layer to obtain the packet sequence number of the data packet.
  • the correct packet sequence number should be the sequence number of the last received data packet plus one. That is, it is continuous with the message sequence number of the last received data message, otherwise it represents an error in the received data message.
  • the receiving device may generate the ACK information, and send the ACK information to the sending device by using the MAC layer communication connection, where the ACK information includes a sequence number of the data packet, and is used to indicate that the sequence is carried. The data packet of the number has been received correctly.
  • the sending device deletes the cached data packet according to the received ACK information.
  • the receiving device discards the error data and generates corresponding NAK information.
  • the sequence number of the NAK information is the sequence number of the last packet that has been correctly received, and is used to instruct the sending device to resend the currently received error message.
  • the receiving device sends the NAK information to the sending device by using a data retransmission message, where the NAK information is used to indicate that the receiving device does not correctly receive the data packet.
  • determining whether the message is erroneous according to the message sequence number is only a specific implementation manner provided by this embodiment, and may also verify whether the data packet is in error by using other forms such as a check code, and how to determine whether the data packet is in error or not.
  • the invention is not limited.
  • the sending device resends the data packet to the receiving device by using a MAC layer communication connection.
  • the sending device starts timing when the data packet is sent, and stops receiving the ACK information or the NAK information sent by the receiving device, and further, if the confirmation message is not received within the preset time.
  • the non-confirmation information also stops timing, that is, the time length of the timing reaches the preset time.
  • the preset time can be set according to the specific circumstances.
  • the sending device resends the data message to the receiving device through the MAC layer communication connection, including two cases:
  • the transmitting device determines that neither the ACK information of the data packet nor the NAK information of the data packet is received within the preset time, the representative data packet is lost or the ACK/NAK information is lost or transmitted. In case of timeout or the like, the transmitting device retransmits the data message to the receiving device through the MAC layer communication connection.
  • the transmitting device if the transmitting device receives the negative acknowledgement NAK information of the data packet through the MAC layer communication connection within the preset time, the transmitting device resends the data to the receiving device through the MAC layer communication connection according to the NAK information of the data packet. Message.
  • the receiving device receives the data packet retransmitted by the sending device by using a MAC layer communication connection.
  • the receiving device determines whether the data packet is in error at the MAC layer, and sends corresponding ACK/NAK information to the receiving device through the MAC layer communication connection according to the judgment result, respectively, that the data packet has been correctly received, or the data packet is not correctly received.
  • the NAK information is used to instruct the transmitting device to resend the data message. In this way, the delay caused by the high-level protocol implementation judgment and retransmission is reduced.
  • the receiving device can transmit data to the transmitting device, and the transmitting device can receive the data transmitted by the receiving device.
  • the transmitting device and the receiving device can simultaneously transmit and receive data to each other.
  • the transmitting device can receive the receiving device while transmitting the data message Ta.
  • the data packet Ra is sent, and then the MAC layer determines whether the data packet Ra is in error, and sends ACK information or NAK information to the receiving device according to the judgment result.
  • the ACK information or the NAK information may be directly included in the frame structure of the data packet of the data packet Tb sent by the transmitting device to the receiving device.
  • the type of the packet of the MAC layer data packet may be 0001 or 0011, where 0001 Represents data with an ACK acknowledgment message, and 0011 represents data with a NAK unacknowledged message.
  • the transmitting device sends a data packet to the receiving device through the media intervention control MAC layer communication connection established by the receiving device, and if the sending device determines that the data packet fails to be correctly transmitted, The device retransmits the data packet to the receiving device through the MAC layer communication connection, thereby implementing a mechanism for ensuring reliable transmission of the Ethernet data at the MAC layer, and avoiding scheduling of Ethernet data transmission only by the upper layer protocol in the prior art.
  • the error occurs in the MAC layer, such as the error, the packet loss, and the transmission timeout
  • the data packet is retransmitted in time, which solves the problem that the data transmission efficiency of the MAC layer in the prior art is too low.
  • the problem is that the delay is too long.
  • An embodiment of the present invention provides a transmitting apparatus 401.
  • the transmitting apparatus 401 includes a transmitting unit 4011.
  • the sending unit 4011 is configured to send a data message to the receiving device by using a media intervention control MAC layer communication connection established by the receiving device.
  • the sending unit 4011 is further configured to: when determining that the receiving device does not normally receive the data packet, resend the data packet to the receiving device by using the MAC layer communication connection.
  • the sending unit 4011 is further configured to send a MAC layer communication connection request message to the receiving device according to the MAC address of the receiving device.
  • the sending device 401 further includes a receiving unit 4012 and a connecting unit 4013,
  • the receiving unit 4012 is configured to receive a MAC layer communication connection confirmation message sent by the receiving device.
  • the connecting unit 4013 is configured to establish a communication connection with the sending device at the MAC layer according to the MAC layer communication connection confirmation message received by the receiving unit 4012.
  • the sending unit 4011 is further configured to: when the sending device determines that the preset time is within a preset time When the response information of the data message is not received, the data message is retransmitted to the receiving device through the MAC layer communication connection.
  • the sending device 401 further includes a receiving unit 4012,
  • the receiving unit 4012 is configured to receive the negative acknowledgement NAK information of the data message sent by the receiving device by using the MAC layer communication connection.
  • the sending unit 4011 is further configured to: when the sending device receives the negative acknowledgement NAK information of the data packet sent by the receiving device by using the MAC layer communication connection, resending the data to the receiving device by using the MAC layer communication connection according to the NAK information of the data packet.
  • the NAK information of the data packet is used to indicate that the receiving device does not receive the data packet normally.
  • the data packet includes a sequence number of the data packet
  • the sending device 401 further includes a receiving unit 4012.
  • the receiving unit 4012 is further configured to receive, by using a MAC layer communication connection, a data retransmission message sent by the receiving device, where the data retransmission message includes a sequence number of the NAK information and the NAK information.
  • the receiving unit 4012 is further configured to determine, when the sequence number of the NAK information is consistent with the data packet indicated by the sequence number of the data packet, the NAK information that is received by the MAC layer communication connection.
  • the sending unit 4011 is further configured to send a data packet to the receiving device by using a predefined extended MAC frame structure.
  • the predefined extended MAC frame structure includes the source MAC address of the packet, the destination MAC address of the packet, the Ethernet data frame type of the packet, the sequence number of the packet, and the type of the packet.
  • the data message includes the MAC address of the sending device, the MAC address of the receiving device, the Ethernet data frame type, the serial number of the data packet, and the type of the data packet.
  • a transmitting apparatus provided by the embodiment of the present invention sends a data packet to a receiving apparatus by a media intervention control MAC layer communication connection established by the receiving apparatus. If the transmitting apparatus determines that the data packet is not correctly transmitted, the transmitting apparatus passes the MAC. The layer communication connection retransmits the data packet to the receiving device, thereby implementing a mechanism for ensuring reliable transmission of the Ethernet data at the MAC layer, and avoids scheduling the transmission of the Ethernet data only through the upper layer protocol in the prior art, and can be at the MAC layer. Errors, packet loss, and transmission timeouts are not correct. When the data packet is transmitted, the data packet is retransmitted in time, which solves the problem that the data transmission efficiency of the MAC layer in the prior art is too low and the delay is too long.
  • the receiving apparatus 501 includes a receiving unit 5011 and a transmitting unit 5012.
  • the receiving unit 5011 is configured to receive, by using a media intervention control MAC layer communication connection established by the sending device, the data packet sent by the sending device.
  • the sending unit 5012 is configured to: when the received data packet has an error, send a negative acknowledgement NAK information of the data packet to the sending device by using the MAC layer communication connection, where the NAK information of the data packet is used to indicate that the receiving device 501 does not receive the packet correctly. Data message.
  • the receiving unit 5011 is further configured to receive a MAC layer communication connection request message sent by the sending device.
  • the sending unit 5012 is configured to send a MAC layer communication connection confirmation message generated by the control unit 5013 to the sending apparatus.
  • the data packet includes a sequence number of the data packet
  • the control unit 5013 is further configured to determine whether the data packet has an error according to the sequence number of the data packet carried in the data packet.
  • control unit 5013 is further configured to: when the received data packet has an error, generate a data retransmission packet according to the data packet, where the data retransmission packet includes a NAK information and a sequence number of the NAK information, and the data The sequence number of the retransmission message is consistent with the sequence number of the data packet, and the data retransmission message is used to indicate that the receiving device 501 does not correctly receive the data message.
  • the sending unit 5012 is further configured to send, by using a MAC layer communication connection, a data retransmission message generated by the control unit 5013 to the transmitting device.
  • the sending unit 5012 is further configured to send a data retransmission message to the receiving device 501 by using a predefined extended MAC frame structure.
  • the predefined extended MAC frame structure includes the source MAC address of the packet, the destination MAC address of the packet, the Ethernet data frame type of the packet, the sequence number of the packet, and the packet.
  • the type of text includes the source MAC address of the packet, the destination MAC address of the packet, the Ethernet data frame type of the packet, the sequence number of the packet, and the packet. The type of text.
  • the data retransmission message includes the MAC address of the receiving device 501, the MAC address of the transmitting device, the Ethernet data frame type, the serial number of the data retransmission message, and the NAK information.
  • the receiving unit 5011 is further configured to receive, by using a MAC layer communication connection, a data message that is retransmitted by the sending device.
  • the receiving apparatus provides a receiving apparatus, and sends a data packet to the receiving apparatus by using a media intervention control MAC layer communication connection established by the sending apparatus, and if the receiving apparatus determines that the received data packet has an error, the MAC layer communication is performed.
  • a negative acknowledgement NAK message is sent to the transmitting device, and the transmitting device retransmits the data packet to the receiving device through the MAC layer communication connection, thereby implementing a mechanism for ensuring reliable transmission of the Ethernet data at the MAC layer, thereby avoiding the prior art.
  • Only the high-level protocol can be used to schedule the transmission of the Ethernet data, and the data packet can be retransmitted in time when the error occurs in the MAC layer, such as error, packet loss, and transmission timeout. In the technology, when the error occurs in the MAC layer, the data transmission efficiency is too low and the delay is too long.
  • An embodiment of the present invention provides another transmitting device 601.
  • the device may be embedded or itself a microprocessor computer, such as a general-purpose computer, a custom machine, a mobile terminal, or a tablet device, and an Ethernet device.
  • a terminal device such as a terminal, a storage device terminal, and the like
  • the transmitting device 601 includes: at least one processor 6011, a memory 6012, a bus 6013, a transmitter 6014, and a receiver 6015, the at least one processor 6011, the memory 6012, the transmitter 6014, and the receiving device
  • the units 6015 are connected by a bus 6013 and complete communication with each other.
  • the bus 6013 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component) bus, a PCIe bus, or an EISA (Extended Industry Standard Architecture) bus.
  • the bus 6013 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 6, but it does not mean that there is only one bus or one type of bus. among them:
  • the memory 6012 is for executing application code of the inventive scheme, and the application code for executing the inventive scheme is stored in a memory and controlled by the processor 6011 for execution.
  • the memory can be a read only memory ROM or other type of static storage device that can store static information and instructions, a random access memory RAM or other type of dynamic storage device that can store information and instructions, or can be electrically erasable or programmable.
  • These memories are connected to the processor via a bus.
  • the processor 6011 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more configured to implement the embodiments of the present invention. Integrated circuits.
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • a transmitting apparatus provided by the embodiment of the present invention sends a data packet to a receiving apparatus by a media intervention control MAC layer communication connection established by the receiving apparatus. If the transmitting apparatus determines that the data packet is not correctly transmitted, the transmitting apparatus passes the MAC. The layer communication connection retransmits the data packet to the receiving device, thereby implementing a mechanism for ensuring reliable transmission of the Ethernet data at the MAC layer, and avoids scheduling the transmission of the Ethernet data only through the upper layer protocol in the prior art, and can be at the MAC layer.
  • a data packet When a data packet is incorrectly transmitted, such as a bit error, a packet loss, or a transmission timeout, the data packet is retransmitted in time to solve the problem that the data transmission efficiency of the MAC layer in the prior art is too low and the delay is low. Too long a problem.
  • An embodiment of the present invention provides another receiving device 701.
  • the device may be embedded or itself a micro-processing computer, such as a general-purpose computer, a custom machine, a mobile phone terminal, or a tablet device.
  • the apparatus 701 includes: at least one processor 7011, a memory 7012, a bus 7013, a transmitter 7014, and a receiver 7015.
  • the at least one processor 7011, the memory 7012, the transmitter 7014, and the receiver 7015 are connected by a bus 7013 and complete each other. Communication.
  • the bus 7013 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component) bus, or an EISA (Extended Industry Standard Architecture) bus.
  • the bus 7013 can be divided into an address bus, a data bus, and a control Bus, etc. For ease of representation, only one thick line is shown in Figure 7, but it does not mean that there is only one bus or one type of bus. among them:
  • the memory 7012 is for executing application code of the inventive scheme, and the application code for executing the inventive scheme is stored in a memory and controlled by the processor 7011 for execution.
  • the memory can be a read only memory ROM or other type of static storage device that can store static information and instructions, a random access memory RAM or other type of dynamic storage device that can store information and instructions, or can be electrically erasable or programmable.
  • These memories are connected to the processor via a bus.
  • the processor 7011 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more configured to implement the embodiments of the present invention. Integrated circuits.
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • the processor 7011 is configured to invoke the program code in the memory 7012 to perform the operation of the control unit in the device embodiment corresponding to FIG. 5, and the device embodiment corresponding to FIG. 5 is specifically described, and details are not described herein again.
  • the receiving apparatus provides a receiving apparatus, and sends a data packet to the receiving apparatus by using a media intervention control MAC layer communication connection established by the sending apparatus, and if the receiving apparatus determines that the received data packet has an error, the MAC layer communication is performed.
  • a negative acknowledgement NAK message is sent to the transmitting device, and the transmitting device retransmits the data packet to the receiving device through the MAC layer communication connection, thereby implementing a mechanism for ensuring reliable transmission of the Ethernet data at the MAC layer, thereby avoiding the prior art.
  • Only the high-level protocol can be used to schedule the transmission of the Ethernet data, and the data packet can be retransmitted in time when the error occurs in the MAC layer, such as error, packet loss, and transmission timeout. In the technology, when the error occurs in the MAC layer, the data transmission efficiency is too low and the delay is too long.
  • Embodiments of the present invention provide a data transmission system 801, as shown in FIG. 8, which includes a transmitting device 8011 and a receiving device 8012.
  • the transmitting device 8011 is the transmitting device described in the embodiment corresponding to FIG. 4, and the receiving device 8012 is the receiving device described in the embodiment corresponding to FIG. 5;
  • the transmitting device 8011 is the transmitting device described in the embodiment corresponding to FIG. 6, and the receiving device 8012 is the receiving device described in the embodiment corresponding to FIG. 7;
  • the transmitting device sends a data packet to the receiving device through the media intervention control MAC layer communication connection established by the receiving device, and if the sending device determines that the data packet is not correctly transmitted, The device retransmits the data packet to the receiving device through the MAC layer communication connection, thereby implementing a mechanism for ensuring reliable transmission of the Ethernet data at the MAC layer, and avoiding scheduling of Ethernet data transmission only by the upper layer protocol in the prior art.
  • the error occurs in the MAC layer, such as the error, the packet loss, and the transmission timeout
  • the data packet is retransmitted in time, which solves the problem that the data transmission efficiency of the MAC layer in the prior art is too low.
  • the problem is that the delay is too long.
  • Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another.
  • a storage medium may be any available media that can be accessed by a computer.
  • the computer readable medium may include a RAM (Random Access Memory), a ROM (Read Only Memory), and an EEPROM (Electrically Erasable Programmable Read Only Memory).
  • CD-ROM Compact Disc Read Only Memory
  • CD-ROM Compact Disc Read Only Memory
  • Any connection may suitably be a computer readable medium.
  • coaxial cable, fiber optic cable, twisted pair, DSL (Digital Subscriber Line), or wireless technologies such as infrared, radio, and microwave
  • coaxial cable, fiber optic cable, twisted pair, DSL or Wireless technologies such as infrared, wireless, and microwaves are included in the fixing of the associated medium.
  • the disc and the disc include a CD (Compact Disc), a laser disc, a compact disc, a DVD disc (Digital Versatile Disc), a floppy disc, and a Blu-ray disc, wherein the disc is usually magnetically copied,
  • the disc uses a laser to optically replicate the data. Combinations of the above should also be included within the scope of the computer readable media.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

本发明提供一种数据传输方法及装置,涉及通信领域。能够解决以太网中媒体介入控制(MAC)层出现误码时,数据传输效率太低、时延太长的问题。该方法包括:发送装置通过与接收装置建立的MAC层通信连接向接收装置发送数据报文(101),如果发送装置确定数据报文未能正确传输时,则发送装置通过MAC层通信连接向接收装置重新发送数据报文(102),从而在MAC层实现了保证以太网数据可靠传输的机制。

Description

一种数据传输方法及装置
本申请要求于2014年4月29日提交中国专利局、申请号为201410178081.4、发明名称为“一种数据传输方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信领域,尤其涉及一种数据传输方法及装置。
背景技术
FC(Fibre Channel,光纤通道)数据、PCIE(Peripheral Component interconnect Express,快捷***部件互连标准)等数据都有独立传输物理通道,为了实现各种数据在同一个交换平面进行共享,现有技术中在以太网中对数据进行传输。
由于数据的拥塞、误码控制较弱,导致以太网数据传输存在速率较慢、链路误码、大量丢包甚至网络不通等问题。现有技术通过以太网高层协议对数据传输进行调度,一定程度上解决了链路拥塞问题。例如,PFC(priority-based Flow Control,基于优先级的流控)、ETS(Enhanced Transmission Selection,增强传输选择)、QCN(Quantized Congestion Notification,量子化拥塞通告)等技术,都可以有效解决链路拥塞问题。但是由于现有技术中调度数据传输的机制都在高层协议实现,如TCP(Transmission Control Protocol,传输控制协议)层,从而当MAC(Media Access Control,媒体介入控制)层出现误码时,会产生大量丢包,在TCP等高层进行重传不仅效率极低,而且时延太长,对带宽有较大影响。
发明内容
本发明的实施例提供一种数据传输方法及装置,能够解决当MAC层出现误码时数据传输效率太低、时延太长的问题。
为达到上述目的,本发明的实施例采用如下技术方案:
第一方面,一种数据传输方法,包括:
送装置通过与接收装置建立的媒体介入控制MAC层通信连接向所述接收装置发送数据报文;
如果所述发送装置确定所述数据报文未能正确传输时,则所述发送装置通过所述MAC层通信连接向所述接收装置重新发送所述数据报文。
结合第一方面,在第一种可能的实现方式中,所述发送装置通过与接收装置建立的媒体介入控制MAC层通信连接向所述接收装置发送数据报文之前,所述方法还包括:
所述发送装置根据所述接收装置的MAC地址,向所述接收装置发送MAC层通信连接请求消息;
所述发送装置接收所述接收装置发送的MAC层通信连接确认消息,并根据所述MAC层通信连接确认消息在所述MAC层与所述发送装置建立通信连接。
结合第一方面的第一种可能的实现方式,在第二种可能的方式中,如果所述发送装置确定所述数据报文未能正确传输时,则所述发送装置通过所述MAC层通信连接向所述接收装置重新发送所述数据报文包括:
如果所述发送装置确定在预设时间内未接收到所述数据报文的响应信息,则所述发送装置通过所述MAC层通信连接向所述接收装置重新发送所述数据报文。
结合第一方面的第一种可能的实现方式,在第三种可能的实现方式中,如果所述发送装置确定所述数据报文未能正确传输时,则所述发送装置通过所述MAC层通信连接向所述接收装置重新发送所述数据报文,包括:
如果所述发送装置通过所述MAC层通信连接接收到所述数据报文的否定应答NAK信息,则所述发送装置根据所述数据报文的NAK信息通过所述MAC层通信连接向所述接收装置重新发送所述数据报文,所述数据报文的NAK信息用于指示所述接收装置未正确接收到所述数据报文。
结合第一方面的第三种可能的实现方式,在第四种可能的实现方 式中,所述数据报文包括所述数据报文的序列号,所述方法还包括:
所述发送装置通过所述MAC层通信连接接收所述接收装置发送的数据重传报文,所述数据重传报文包括NAK信息以及所述NAK信息的序列号;
当所述NAK信息的序列号与所述数据报文的序列号指示的数据报文一致时,所述发送装置确定通过所述MAC层通信连接接收到所述数据报文的NAK信息。
结合第一方面至第一方面的第四种可能的实现方式中的任一种,在第五种可能的实现方式中,所述发送装置通过与接收装置建立的媒体介入控制MAC层通信连接向所述接收装置发送数据报文,包括:所述发送装置通过预定义的扩展MAC帧结构,向所述接收装置发送数据报文;
其中,所述预定义的扩展MAC帧结构包括报文的源MAC地址、报文的目的MAC地址、报文的以太网数据帧类型、报文的序列号、报文的类型;
则所述数据报文包括所述发送装置的MAC地址、所述接收装置的MAC地址、以太网数据帧类型、数据报文的序列号和所述数据报文的类型。
第二方面,一种数据传输方法,包括:
接收装置通过与发送装置建立的媒体介入控制MAC层通信连接,接收所述发送装置发送的数据报文;
如果所述接收装置确定接收到的所述数据报文出现错误,则通过所述MAC层通信连接向所述发送装置发送所述数据报文的否定应答NAK信息,所述数据报文的NAK信息用于指示所述接收装置没有正确接收所述数据报文。
结合第二方面,在第一种可能的实现方式中,所述接收装置通过所述MAC层通信连接接收所述发送装置发送的数据报文之前,还包括:
所述接收装置接收所述发送装置发送的MAC层通信连接请求消 息;
所述接收装置向所述发送装置发送所述MAC层通信连接确认消息。
结合第二方面的第一种可能的实现方式,在第二种可能的实现方式中,所述数据报文包括所述数据报文的序列号,所述方法还包括:
所述接收装置根据所述数据报文携带的所述数据报文的序列号,确定所述数据报文是否出现错误。
结合第二方面的第二种可能的实现方式,在第三种可能的实现方式中,所述如果所述接收装置确定接收到的所述数据报文出现错误,则通过所述MAC层通信连接向所述发送装置发送所述数据报文的NAK信息,包括:
所述如果所述接收装置确定接收到的所述数据报文出现错误,则所述接收装置根据所述数据报文,生成数据重传报文,所述数据重传报文包括NAK信息以及所述NAK信息的序列号,所述NAK信息的序列号与所述数据报文的序列号指示的数据报文一致,所述数据重传报文用于指示所述接收装置没有正确接收所述数据报文;
所述接收装置通过所述MAC层通信连接向所述发送装置发送所述数据重传报文。
结合第二方面的第三种可能的实现方式,在第四种可能的实现方式中,所述接收装置通过所述MAC层通信连接向所述发送装置发送所述数据重传报文,包括:
所述接收装置通过预定义的扩展MAC帧结构,向所述接收装置发送所述数据重传报文;
其中,所述预定义的扩展MAC帧结构包括报文的源MAC地址、报文的目的MAC地址、报文的以太网数据帧类型、报文的序列号、报文的类型;
则所述数据重传报文包括所述接收装置的MAC地址、所述发送装置的MAC地址、以太网数据帧类型、所述数据重传报文的序列号和NAK信息。
结合第二方面至第二方面的第四种可能的实现方式中的任一种,在第五种可能的实现方式中,所述通过所述MAC层通信连接向所述发送装置发送所述数据报文的否定应答NAK信息之后,还包括:
所述接收装置通过所述MAC层通信连接接收所述发送装置重新发送的所述数据报文。
第三方面,一种发送装置,包括:
发送单元,用于通过与接收装置建立的媒体介入控制MAC层通信连接向所述接收装置发送数据报文;
所述发送单元,还用于当确定所述接收装置未正常接收到所述数据报文时,通过所述MAC层通信连接向所述接收装置重新发送所述数据报文。
结合第三方面,在第一种可能的实现方式中,所述发送单元,还用于根据所述接收装置的MAC地址,向所述接收装置发送MAC层通信连接请求消息;
所述发送装置还包括接收单元和连接单元,
所述接收单元,用于接收所述接收装置发送的MAC层通信连接确认消息;
所述连接单元,用于根据所述接收单元接收的所述MAC层通信连接确认消息在所述MAC层与所述发送装置建立通信连接。
结合第三方面的第一种可能的实现方式,在第二种可能的实现方式中,所述发送单元,还用于确定在预设时间内未接收到所述数据报文的响应信息时,通过所述MAC层通信连接向所述接收装置重新发送所述数据报文。
结合第三方面的第一种可能的实现方式,在第三种可能的实现方式中,所述发送单元,还用于当所述发送装置通过所述MAC层通信连接接收到所述接收装置发送的所述数据报文的否定应答NAK信息时,根据所述数据报文的NAK信息,通过所述MAC层通信连接向所述接收装置重新发送所述数据报文,所述数据报文的NAK信息用于指示所述接收装置未正常接收到所述数据报文。
结合第三方面的第三种可能的实现方式,在第四种可能的实现方式中,所述数据报文包括所述数据报文的序列号;
所述接收单元,还用于通过所述MAC层通信连接接收所述接收装置发送的数据重传报文,所述数据重传报文包括NAK信息以及所述NAK信息的序列号;
所述接收单元,还用于当所述NAK信息的序列号与所述数据报文的序列号指示的数据报文一致时,确定通过所述MAC层通信连接接收到所述数据报文的NAK信息。
结合第三方面至第三方面的第四种可能的实现方式中的任一种,在第五种可能的实现方式中,所述发送单元,还用于通过预定义的扩展MAC帧结构,向所述接收装置发送数据报文;
其中,所述预定义的扩展MAC帧结构包括报文的源MAC地址、报文的目的MAC地址、报文的以太网数据帧类型、报文的序列号、报文的类型;
则所述数据报文包括所述发送装置的MAC地址、所述接收装置的MAC地址、以太网数据帧类型、数据报文的序列号和所述数据报文的类型。
第四方面,一种接收装置,包括:
接收单元,用于通过与发送装置建立的媒体介入控制MAC层通信连接接收所述发送装置发送的数据报文;
发送单元,用于当接收到的所述数据报文出现错误时,通过所述MAC层通信连接向所述发送装置发送所述数据报文的否定应答NAK信息,所述数据报文的NAK信息用于指示所述接收装置没有正确接收所述数据报文。
结合第四方面,在第一种可能的实现方式中,所述接收单元,还用于接收所述发送装置发送的MAC层通信连接请求消息;
所述接收装置还包括控制单元,用于生成MAC层通信连接确认消息;
所述发送单元,用于将所述控制单元生成的所述MAC层通信连 接确认消息发送至所述发送装置。
结合第四方面的第一种可能的实现方式,在第二种可能的实现方式中,所述数据报文包括所述数据报文的序列号,
所述控制单元,还用于根据所述数据报文携带的所述数据报文的序列号,确定所述数据报文是否出现错误。
结合第四方面的第二种可能的实现方式,在第三种可能的实现方式中,所述控制单元,还用于当接收到的所述数据报文出现错误时,根据所述数据报文,生成数据重传报文,所述数据重传报文包括NAK信息以及所述NAK信息的序列号,所述NAK信息的序列号与所述数据报文的序列号指示的数据报文一致,所述数据重传报文用于指示所述接收装置没有正确接收所述数据报文;
所述发送单元,还用于通过所述MAC层通信连接向所述发送装置发送所述控制单元生成的所述数据重传报文。
结合第四方面的第三种可能的实现方式,在第四种可能的实现方式中,所述发送单元,还用于通过预定义的扩展MAC帧结构,向所述接收装置发送所述数据重传报文;
其中,所述预定义的扩展MAC帧结构包括报文的源MAC地址、报文的目的MAC地址、报文的以太网数据帧类型、报文的序列号、报文的类型;
则所述数据重传报文包括所述接收装置的MAC地址、所述发送装置的MAC地址、以太网数据帧类型、所述数据重传报文的序列号和NAK信息。
结合第四方面至第四方面的第四种可能的实现方式中的任一种,在第五种可能的实现方式中,所述接收单元,还用于通过所述MAC层通信连接接收所述发送装置重新发送的所述数据报文。
本发明实施例提供的一种数据传输方法及装置,发送装置通过与接收装置建立的媒体介入控制MAC层通信连接向接收装置发送数据报文,如果发送装置确定数据报文未能正确传输时,则发送装置通过MAC层通信连接向接收装置重新发送数据报文,从而在MAC层实现了保证以太网数据可靠传输的机制,避免了现有技术中仅通过高层协 议对以太网数据的传输进行调度,能够在MAC层出现误码、丢包和传输超时等未能正确传输数据报文的情形时,及时重传数据报文,解决了现有技术中MAC层出现误码时存在的数据传输效率太低、时延太长的问题。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明的实施例提供的一种数据传输方法流程示意图;
图2为本发明的实施例提供的另一种数据传输方法流程示意图;
图3为本发明的实施例提供的再一种数据传输方法流程示意图;
图4为本发明的实施例提供的一种发送装置结构示意图;
图5为本发明的实施例提供的一种接收装置结构示意图;
图6为本发明的实施例提供的另一种发送装置的结构示意图;
图7为本发明的实施例提供的另一种接收装置的结构示意图;
图8为本发明的实施例提供一种数据传输***的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明的实施例提供一种数据传输方法,应用于发送装置,参照图1所示,包括以下步骤:
101、发送装置通过与接收装置建立的媒体介入控制MAC层通信连接向接收装置发送数据报文。
在本发明实施例中,所述发送装置应用于以太网中,所述发送装 置已经与所述接收装置建立了媒体介入控制MAC层通信连接,因此所述发送装置可以通过与接收装置建立的媒体介入控制MAC层通信连接向接收装置发送数据报文,其中,MAC层位于OSI(Open System Interconnection,开放***互联)模型的数据链路层,是OSI模型的下层的协议,主要负责物理层物理介质的控制与连接。
102、如果发送装置确定数据报文未能正确传输时,则发送装置通过所述MAC层通信连接向接收装置重新发送数据报文。
对于数据报文未能正确传输,可以是发生了误码、丢包、传输超时等需要发送装置重新发送数据报文的情况,例如接收装置没有接收到数据报文,或者收到的数据报文出错,或者经过很长时间才能接收到数据报文。所述发送装置在确定所述数据报文未能正确传输时,可以通过所述MAC层通信连接向接收装置重新发送数据报文,从而在MAC层建立了数据重传检测和保障的机制,保证了在MAC层出现误码、丢包和传输超时等未能正确传输数据报文的情形时,及时重传数据报文,有效减少MAC层出现误码时带来的数据传输效率太低、时延太长的问题。
具体的,数据报文未能正确传输的情况可以包括:
发送装置在发出数据报文后,接收到接收装置发送的NAK(Negative Acknowledgement,否定应答)信息,则向发送装置重新发送数据报文。其中,否定应答NAK信息代表接收装置没有正确接收数据报文,接收装置通过向发送装置发送NAK信息指示发送装置重新发送数据报文;
发送装置在预设时间内既没有收到接收装置发送的ACK(Acknowledgement,肯定应答)信息也没有收到接收装置发送的NAK信息,其中,数据报文的ACK信息用于指示接收装置正确接收数据报文。可选的,发送装置在数据报文发出时开始计时,收到接收装置发送的ACK信息或者NAK信息则停止计时,进一步可选的,如果在预设时间内既未收到NAK信息也未收到NAK信息也停止计时,即计时的时间长度达到预设时间则停止计时。具体的,在信息传输过程中,发送装置在预设时间内没有收到数据报文的响应信息可能是因为网络拥塞或者丢包的情况导致接收装置没有接收到数据报文 或经过很长时间才接收到数据报文,这时,发送装置都会重新发送数据报文,保证了数据重传的效率。
这样,通过在MAC层实现判断数据报文是否被正确接收,并在需要的情况下对数据报文进行重新发送,有效减少了由高层协议实现判断和重新发送所带来的时延。
本发明实施例提供的一种数据传输方法,发送装置通过与接收装置建立的媒体介入控制MAC层通信连接向接收装置发送数据报文,如果发送装置确定数据报文未能正确传输时,则发送装置通过MAC层通信连接向接收装置重新发送数据报文,从而在MAC层实现了保证以太网数据可靠传输的机制,避免了现有技术中仅通过高层协议对以太网数据的传输进行调度,能够在MAC层出现误码、丢包和传输超时等未能正确传输数据报文的情形时,及时重传数据报文,解决了现有技术中MAC层出现误码时存在的数据传输效率太低、时延太长的问题。
本发明的实施例提供另一种数据传输方法,应用于接收装置,参照图2所示,包括以下步骤:
201、接收装置通过与发送装置建立的媒体介入控制MAC层通信连接,接收发送装置发送的数据报文。
可选的,接收装置接收到发送装置发送的数据报文,或者,因为误码、拥塞、丢包等问题,可能导致接收装置收到的数据报文出错、经过很长时间才能接收到数据报文或者无法收到数据报文。
202、如果接收装置确定接收到的数据报文出现错误,则通过MAC层通信连接向发送装置发送数据报文的否定应答NAK信息。
其中,数据报文的NAK信息用于指示接收装置没有正确接收数据报文。
可选的,如果接收装置接收到数据报文,则对收到的数据报文进行判断:
如果数据报文没有出错,则接收装置生成相应的ACK信息,并将该ACK信息通过MAC层通信连接发送至发送装置;
如果数据报文出错,则接收装置生成相应的NAK信息,并将该 NAK信息通过MAC层通信连接发送至发送装置。
本发明实施例提供的一种数据传输方法,发送装置通过与接收装置建立的媒体介入控制MAC层通信连接向接收装置发送数据报文,如果接收装置确定接收到的数据报文出现错误,则通过MAC层通信连接向发送装置发送数据报文的否定应答NAK信息,发送装置通过MAC层通信连接向接收装置重新发送数据报文,从而在MAC层实现了保证以太网数据可靠传输的机制,避免了现有技术中仅通过高层协议对以太网数据的传输进行调度,能够在MAC层出现误码、丢包和传输超时等未能正确传输数据报文的情形时,及时重传数据报文,解决了现有技术中MAC层出现误码时存在的数据传输效率太低、时延太长的问题。
本发明的实施例提供的数据传输方法,通过接收装置通过与发送装置建立的媒体介入控制MAC层通信连接,接收发送装置发送的数据报文,如果接收装置确定接收到的数据报文出现错误,则通过MAC层通信连接向发送装置发送数据报文的否定应答NAK信息,数据报文的NAK信息用于指示接收装置没有正确接收数据报文,解决了现有技术中MAC层出现误码时存在的数据传输效率太低、时延太长的问题。
基于上述图1和图2对应的实施例,本发明的实施例提供了一种数据传输方法,参照图3所示包括以下步骤:
301、发送装置根据接收装置的MAC地址,向接收装置发送MAC层通信连接请求消息。
在本实施例中,所述发送装置和所述接收装置都属于以太网中的网络设备。为了实现MAC层的数据报文传输,所述发送装置可以利用MAC层通信连接表项与所述接收装置建立MAC层通信连接,所述MAC层通信连接表项中记录了能够建立MAC层通信连接的对端的信息,例如MAC地址,从而所述发送装置能够获取到接收装置的MAC地址,并根据接收装置的MAC地址,向接收装置发送MAC层通信连接请求消息,以向所述接收装置请求建立MAC层通信连接。
具体地,在以太网中可以包括多个网络设备,所述发送装置可以为以太网中的第一网络设备,参照表一,表一为第一网络设备的MAC 层通信连接表项,该MAC层通信连接表项记录了第一网络设备与其他网络设备间的MAC层通信连接关系。第一网络设备通过每条MAC层通信连接中的目标地址(DA,Destination Address)和源地址(SA,Source Address)与该条MAC层通信连接另一端的网络设备建立MAC层通信连接。其中,源地址为发起MAC层通信连接请求的网络设备的地址,即第一网络设备的地址,目标地址为目标网络设备的地址,即接收通信连接请求的网络设备的地址。
表一
通信连接编号 目标地址 源地址
0 第一目标网络设备 第一网络设备
1 第二目标网络设备 第一网络设备
2 第三目标网络设备 第一网络设备
进一步,本发明的实施例还可以提供的一种MAC层帧结构,使得在本发明所有实施例中,所述发送装置和接收装置之间所有的MAC层数据报文的发送和接收都可以使用该帧结构,例如发送装置使用该帧结构向接收装置发送MAC层通信连接请求消息,又例如发送装置使用该帧结构向接收装置发送数据报文。该帧结构包括以下内容:
1)目的MAC地址,例如,可以占用6字节;
2)源MAC地址,例如,可以占用6字节;
3)Etype:即Ethernet Type,表示以太网数据帧类型,例如可以定义Etype=0X2000时,代表无损以太网数据帧;可以定义Etype占用2字节。
4)报文的序列号,用于接收确认及对重新发送进行管理;可以定义占用2字节,
5)报文的类型,不同数值代表不同报文类型,从而能够快速确定该报文的类型,例如是带有确认消息的报文,带有NAK消息的报文,心态报文等。可选的,此处列举一种定义如下,在这种方式中,ACK/NAK信息包含于报文的类型字段中:
0000:没有ACK/NAK消息;
0001:带有ACK消息的数据;
0010:纯ACK消息;
0011:带有NAK消息的数据;
0100:纯NAK消息;
0101:同步消息;
0110:同步ACK消息;
0111:心跳报文;
1000:配置报文;
1001:无需对端回响应的报文;
1011:需要对端回响应的报文;
当然,报文的类型字段也可以包含其他定义,此处只是列举一部分进行说明。
其中,ACK(Acknowledgement),代表确认信息;NAK(Negative Acknowledgement),代表非确认信息;
ACK信息/NAK信息序列号字段,可以占用2字节。结合报文的类型字段,如果报文的类型字段包含ACK信息,则ACK信息序列号可以是当前接收的数据报文的报文序列号,用于指示当前接收的数据报文已经正确接收。如果报文的类型字段包含NAK信息,则NAK信息序列号可以是上一个正确接收的数据报文的报文序列号,与当前接收的数据报文相对应,用于指示当前接收的数据报文出错,需要重新发送。
6)有效载荷,可以承载所有协议,包括TCP/IP、FCOE等需要高可靠连接的其他协议,使得本发明实施例所示的方法能够支持各类通信协议。
此处,可选的,发送装置向接收装置发送的MAC层通信连接请求报文中的报文的类型为0101。
302、接收装置向发送装置发送MAC层通信连接确认消息。
此处,接收装置向发送装置发送的MAC层通信连接确认消息的MAC层报文的类型为0110。
303、发送装置根据MAC层通信连接确认消息在MAC层与发送装置建立通信连接。
发送装置向接收装置发起同步消息,接收设备在收到同步消息后向发送设备回复同步确认消息并进入同步状态,准备接收发送装置发送的数据报文。发送设备收到接收设备的同步确认消息之后进入同步状态,开始发送数据报文。则发送装置与接收装置建立起MAC层通信连接。
发送装置与接收装置在MAC层建立通信连接之后,可以通过表二对通信连接信息进行监控和管理,表二为MAC层通信连接管理表项,记录了多个网络设备之间的MAC层通信连接状态。该MAC层通信连接管理表项可以包含多个源网络设备和多个目标网络设备之间的通信连接,每条通信连接也可以包括多项信息,在此仅以3个源网络设备和2个目标网络设备之间MAC层通信连接的开关状态进行示例性说明,这并不代表本发明的MAC层通信连接管理表项必须包含表二中的信息或者仅包含表二中的信息。
表二
Figure PCTCN2014091789-appb-000001
Figure PCTCN2014091789-appb-000002
304、发送装置通过与接收装置建立的媒体介入控制MAC层通信连接向接收装置发送数据报文。
可选的,发送装置将数据报文存储在缓存中,以便于在接收装置没有正确接收数据报文时重新发送。当接收装置正确接收数据报文后,发送装置可以将该报文从缓存中清除。
305、接收装置根据数据报文携带的数据报文的序列号,确定数据报文是否出现错误。
发送装置在数据传输过程中可以对报文进行编号,编号从0号开始,每发送一个,数据报文的序列号加1,接收装置接收发送装置发送的数据时,报文序列号也可以从0开始算起。接收装置接收到报文后,在MAC层对数据报文进行解析得到数据报文的报文序列号,正确的报文序列号应该是上一个接收的数据报文的报文序列号加1,即与上一个接收的数据报文的报文序列号连续,否则就代表接收的数据报文出错。
如果数据报文没有出错,则接收装置可以生成ACK信息,并将该ACK信息通过MAC层通信连接发送至发送装置,其中,该ACK信息包括该数据报文的序列号,用于指示携带该序列号的数据报文已经正确接收。
可选的,发送装置根据接收到的ACK信息将缓存的数据报文删除;
如果接收设备收到的报文序列号不正确,则接收装置丢弃出错数据,并生成相应的NAK信息。该NAK信息的序列号为上一个已经正确接收报文的序列号,用于指示发送设备重新发送当前接收的出错报文。接收设备将该NAK信息通过数据重传报文发送至发送设备,该NAK信息用于指示接收装置未正确接收到数据报文。
当然,根据报文序列号判断报文是否出错只是本实施例提供的一种具体实施方式,也可以通过校验码等其他形式来验证数据报文是否出错,对于如何判断数据报文是否出错,本发明不做限制。
306、发送装置通过MAC层通信连接向接收装置重新发送数据报文。
可选的,发送装置在数据报文发出时开始计时,收到接收装置发送的ACK信息或者NAK信息则停止计时,进一步可选的,如果在预设时间内既未收到确认信息也未收到非确认信息也停止计时,即计时的时间长度达到预设时间。其中,预设时间可以根据具体情况自行设定。
发送装置通过MAC层通信连接向接收装置重新发送数据报文包括两种情况:
第一种情况,如果发送装置确定在预设时间内既未接收到数据报文的ACK信息,也没有收到数据报文的NAK信息,代表可能数据报文丢失或者ACK/NAK信息丢失或者传输超时等情况,此时发送装置通过MAC层通信连接向接收装置重新发送数据报文。
第二种情况,如果发送装置在预设时间内通过MAC层通信连接接收到数据报文的否定应答NAK信息,则发送装置根据数据报文的NAK信息通过MAC层通信连接向接收装置重新发送数据报文。
307、接收装置通过MAC层通信连接接收发送装置重新发送的数据报文。
接收装置通过在MAC层判断数据包是否出错,并根据判断结果通过MAC层通信连接向接收装置发送相应的ACK/NAK信息,分别代表数据报文已经正确接收,或者数据报文未能正确接收。NAK信息用于指示发送装置重新发送数据报文。这样,减少了由高层协议实现判断和重新发送所带来的时延。
本发明中,在发送装置与接收装置在MAC层建立通信连接之后,接收装置可以向发送装置发送数据,发送装置可以接收接收装置发送的数据。发送装置与接收装置可以同时相互发送、接收数据。以发送装置为例,发送装置在发出数据报文Ta的同时,可以接收接收装置 发送的数据报文Ra,然后在MAC层判断数据报文Ra是否出错,并根据判断结果向接收设备发送ACK信息或NAK信息。该ACK信息或NAK信息可以直接包含在发送装置向接收装置发送的数据报文Tb的数据报文的帧结构中,此时,MAC层数据包的报文的类型可以是0001或者0011,其中0001代表带有ACK确认消息的数据,0011代表带有NAK非确认消息的数据。
本发明实施例提供的一种数据传输方法,发送装置通过与接收装置建立的媒体介入控制MAC层通信连接向接收装置发送数据报文,如果发送装置确定数据报文未能正确传输时,则发送装置通过MAC层通信连接向接收装置重新发送数据报文,从而在MAC层实现了保证以太网数据可靠传输的机制,避免了现有技术中仅通过高层协议对以太网数据的传输进行调度,能够在MAC层出现误码、丢包和传输超时等未能正确传输数据报文的情形时,及时重传数据报文,解决了现有技术中MAC层出现误码时存在的数据传输效率太低、时延太长的问题。
本发明的实施例提供一种发送装置401,参照图4所示,该发送装置401包括发送单元4011。
发送单元4011,用于通过与接收装置建立的媒体介入控制MAC层通信连接向所述接收装置发送数据报文。
发送单元4011,还用于当确定所述接收装置未正常接收到所述数据报文时,通过所述MAC层通信连接向所述接收装置重新发送所述数据报文。
可选的,发送单元4011,还用于根据接收装置的MAC地址,向接收装置发送MAC层通信连接请求消息。
发送装置401,还包括接收单元4012和连接单元4013,
接收单元4012,用于接收接收装置发送的MAC层通信连接确认消息。
连接单元4013,用于根据接收单元4012接收的MAC层通信连接确认消息在MAC层与发送装置建立通信连接。
可选的,发送单元4011,还用于当发送装置确定在预设时间内 未接收到数据报文的响应信息时,通过MAC层通信连接向接收装置重新发送数据报文。
可选的,发送装置401,还包括接收单元4012,
接收单元4012,用于通过MAC层通信连接接收到接收装置发送的数据报文的否定应答NAK信息。
发送单元4011,还用于当发送装置通过MAC层通信连接接收到接收装置发送的数据报文的否定应答NAK信息时,根据数据报文的NAK信息,通过MAC层通信连接向接收装置重新发送数据报文,数据报文的NAK信息用于指示接收装置未正常接收到数据报文。
可选的,数据报文包括数据报文的序列号,发送装置401还包括接收单元4012。
接收单元4012,还用于通过MAC层通信连接接收接收装置发送的数据重传报文,数据重传报文包括NAK信息以及NAK信息的序列号。
接收单元4012,还用于当NAK信息的序列号与数据报文的序列号指示的数据报文一致时,确定通过MAC层通信连接接收到数据报文的NAK信息。
可选的,发送单元4011,还用于通过预定义的扩展MAC帧结构,向接收装置发送数据报文。
其中,预定义的扩展MAC帧结构包括报文的源MAC地址、报文的目的MAC地址、报文的以太网数据帧类型、报文的序列号、报文的类型。
则数据报文包括发送装置的MAC地址、接收装置的MAC地址、以太网数据帧类型、数据报文的序列号和数据报文的类型。
本发明实施例提供的一种发送装置,通过与接收装置建立的媒体介入控制MAC层通信连接向接收装置发送数据报文,如果发送装置确定数据报文未能正确传输时,则发送装置通过MAC层通信连接向接收装置重新发送数据报文,从而在MAC层实现了保证以太网数据可靠传输的机制,避免了现有技术中仅通过高层协议对以太网数据的传输进行调度,能够在MAC层出现误码、丢包和传输超时等未能正 确传输数据报文的情形时,及时重传数据报文,解决了现有技术中MAC层出现误码时存在的数据传输效率太低、时延太长的问题。
本发明的实施例提供一种接收装置,参照图5所示,该接收装置501包括接收单元5011和发送单元5012。
其中,接收单元5011,用于通过与发送装置建立的媒体介入控制MAC层通信连接接收发送装置发送的数据报文。
发送单元5012,用于当接收到的数据报文出现错误时,通过MAC层通信连接向发送装置发送数据报文的否定应答NAK信息,数据报文的NAK信息用于指示接收装置501没有正确接收数据报文。
可选的,接收单元5011,还用于接收发送装置发送的MAC层通信连接请求消息。
接收装置501还包括控制单元5013,用于生成MAC层通信连接确认消息。
发送单元5012,用于将控制单元5013生成的MAC层通信连接确认消息发送至发送装置。
可选的,数据报文包括数据报文的序列号,控制单元5013,还用于根据数据报文携带的数据报文的序列号,确定数据报文是否出现错误。
可选的,控制单元5013,还用于当接收到的数据报文出现错误时,根据数据报文,生成数据重传报文,数据重传报文包括NAK信息以及NAK信息的序列号,数据重传报文的序列号与数据报文的序号一致,数据重传报文用于指示接收装置501没有正确接收数据报文。
发送单元5012,还用于通过MAC层通信连接向发送装置发送控制单元5013生成的数据重传报文。
可选的,发送单元5012,还用于通过预定义的扩展MAC帧结构,向接收装置501发送数据重传报文。
其中,预定义的扩展MAC帧结构包括报文的源MAC地址、报文的目的MAC地址、报文的以太网数据帧类型、报文的序列号、报 文的类型。
则数据重传报文包括接收装置501的MAC地址、发送装置的MAC地址、以太网数据帧类型、数据重传报文的序列号和NAK信息。
可选的,接收单元5011,还用于通过MAC层通信连接接收发送装置重新发送的数据报文。
本发明实施例提供的一种接收装置,通过与发送装置建立的媒体介入控制MAC层通信连接向接收装置发送数据报文,如果接收装置确定接收到的数据报文出现错误,则通过MAC层通信连接向发送装置发送数据报文的否定应答NAK信息,发送装置通过MAC层通信连接向接收装置重新发送数据报文,从而在MAC层实现了保证以太网数据可靠传输的机制,避免了现有技术中仅通过高层协议对以太网数据的传输进行调度,能够在MAC层出现误码、丢包和传输超时等未能正确传输数据报文的情形时,及时重传数据报文,解决了现有技术中MAC层出现误码时存在的数据传输效率太低、时延太长的问题。
本发明的实施例提供另一种发送装置601,参照图6所示,该设备可以嵌入或本身就是微处理计算机,比如:通用计算机、客户定制机、手机终端或平板机等便携设备,以太网终端,存储设备终端等终端设备,该发送装置601包括:至少一个处理器6011、存储器6012、总线6013、发送器6014和接收器6015,该至少一个处理器6011、存储器6012、发送器6014和接收器6015通过总线6013连接并完成相互间的通信。
该总线6013可以是ISA(Industry Standard Architecture,工业标准体系结构)总线、PCI(Peripheral Component,外部设备互连)总线、PCIe总线或EISA(Extended Industry Standard Architecture,扩展工业标准体系结构)总线等。该总线6013可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。其中:
存储器6012用于执行本发明方案的应用程序代码,执行本发明方案的应用程序代码保存在存储器中,并由处理器6011来控制执行。
该存储器可以是只读存储器ROM或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器RAM或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器EEPROM、只读光盘CD-ROM或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、FPGA(现场可编程逻辑门阵列)或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。这些存储器通过总线与处理器相连接。
处理器6011可能是一个中央处理器6011(Central Processing Unit,简称为CPU),或者是特定集成电路(Application Specific Integrated Circuit,简称为ASIC),或者是被配置成实施本发明实施例的一个或多个集成电路。
本发明实施例提供的一种发送装置,通过与接收装置建立的媒体介入控制MAC层通信连接向接收装置发送数据报文,如果发送装置确定数据报文未能正确传输时,则发送装置通过MAC层通信连接向接收装置重新发送数据报文,从而在MAC层实现了保证以太网数据可靠传输的机制,避免了现有技术中仅通过高层协议对以太网数据的传输进行调度,能够在MAC层出现误码、丢包和传输超时等未能正确传输数据报文的情形时,及时重传数据报文,解决了现有技术中MAC层出现误码时存在的数据传输效率太低、时延太长的问题。
本发明的实施例提供另一种接收装置701,参照图7所示,该设备可以嵌入或本身就是微处理计算机,比如:通用计算机、客户定制机、手机终端或平板机等便携设备,该发送装置701包括:至少一个处理器7011、存储器7012、总线7013、发送器7014和接收器7015,该至少一个处理器7011、存储器7012、发送器7014和接收器7015通过总线7013连接并完成相互间的通信。
该总线7013可以是ISA(Industry Standard Architecture,工业标准体系结构)总线、PCI(Peripheral Component,外部设备互连)总线或EISA(Extended Industry Standard Architecture,扩展工业标准体系结构)总线等。该总线7013可以分为地址总线、数据总线、控制 总线等。为便于表示,图7中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。其中:
存储器7012用于执行本发明方案的应用程序代码,执行本发明方案的应用程序代码保存在存储器中,并由处理器7011来控制执行。
该存储器可以是只读存储器ROM或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器RAM或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器EEPROM、只读光盘CD-ROM或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。这些存储器通过总线与处理器相连接。
处理器7011可能是一个中央处理器7011(Central Processing Unit,简称为CPU),或者是特定集成电路(Application Specific Integrated Circuit,简称为ASIC),或者是被配置成实施本发明实施例的一个或多个集成电路。
处理器7011,用于调用存储器7012中的程序代码,用以执行上述图5对应的设备实施例中控制单元的操作,具体描述参照图5对应的设备实施例,这里不再赘述。
本发明实施例提供的一种接收装置,通过与发送装置建立的媒体介入控制MAC层通信连接向接收装置发送数据报文,如果接收装置确定接收到的数据报文出现错误,则通过MAC层通信连接向发送装置发送数据报文的否定应答NAK信息,发送装置通过MAC层通信连接向接收装置重新发送数据报文,从而在MAC层实现了保证以太网数据可靠传输的机制,避免了现有技术中仅通过高层协议对以太网数据的传输进行调度,能够在MAC层出现误码、丢包和传输超时等未能正确传输数据报文的情形时,及时重传数据报文,解决了现有技术中MAC层出现误码时存在的数据传输效率太低、时延太长的问题。
本发明的实施例提供一种数据传输***801,参照图8所示,该***包括发送装置8011和接收装置8012。
其中发送装置8011为图4对应的实施例中所描述的发送装置,接收装置8012为图5对应的实施例中所描述的接收装置;
或者发送装置8011为图6对应的实施例中所描述的发送装置,接收装置8012为图7对应的实施例中所描述的接收装置;
本发明实施例提供的一种数据传输***,发送装置通过与接收装置建立的媒体介入控制MAC层通信连接向接收装置发送数据报文,如果发送装置确定数据报文未能正确传输时,则发送装置通过MAC层通信连接向接收装置重新发送数据报文,从而在MAC层实现了保证以太网数据可靠传输的机制,避免了现有技术中仅通过高层协议对以太网数据的传输进行调度,能够在MAC层出现误码、丢包和传输超时等未能正确传输数据报文的情形时,及时重传数据报文,解决了现有技术中MAC层出现误码时存在的数据传输效率太低、时延太长的问题。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本发明可以用硬件实现,或固件实现,或它们的组合方式来实现或软硬件结合实现、或硬件编程、逻辑等实现。当使用软件实现时,可以将上述功能存储在计算机可读介质中或作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是计算机能够存取的任何可用介质。以此为例但不限于:计算机可读介质可以包括RAM(Random Access Memory,随机存储器)、ROM(Read Only Memory,只读内存)、EEPROM(Electrically Erasable Programmable Read Only Memory,电可擦可编程只读存储器)、CD-ROM(Compact Disc Read Only Memory,即只读光盘)或其他光盘存储、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质。此外。任何连接可以适当的成为计算机可读介质。例如,如果软件是使用同轴电缆、光纤光缆、双绞线、DSL(Digital Subscriber Line,数字用户专线)或者诸如红外线、无线电和微波之类的无线技术从网站、服务器或者其他远程源传输的,那么同轴电缆、光纤光缆、双绞线、DSL或者 诸如红外线、无线和微波之类的无线技术包括在所属介质的定影中。如本发明所使用的,盘和碟包括CD(Compact Disc,压缩光碟)、激光碟、光碟、DVD碟(Digital Versatile Disc,数字通用光)、软盘和蓝光光碟,其中盘通常磁性的复制数据,而碟则用激光来光学的复制数据。上面的组合也应当包括在计算机可读介质的保护范围之内。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。

Claims (24)

  1. 一种数据传输方法,其特征在于,包括:
    发送装置通过与接收装置建立的媒体介入控制MAC层通信连接向所述接收装置发送数据报文;
    如果所述发送装置确定所述数据报文未能正确传输时,则所述发送装置通过所述MAC层通信连接向所述接收装置重新发送所述数据报文。
  2. 根据权利要求1所述的方法,其特征在于,所述发送装置通过与接收装置建立的媒体介入控制MAC层通信连接向所述接收装置发送数据报文之前,所述方法还包括:
    所述发送装置根据所述接收装置的MAC地址,向所述接收装置发送MAC层通信连接请求消息;
    所述发送装置接收所述接收装置发送的MAC层通信连接确认消息,并根据所述MAC层通信连接确认消息在所述MAC层与所述发送装置建立通信连接。
  3. 根据权利要求2所述的方法,其特征在于,则所述发送装置通过所述MAC层通信连接向所述接收装置重新发送所述数据报文包括:
    如果所述发送装置确定在预设时间内未接收到所述数据报文的响应信息,则所述发送装置通过所述MAC层通信连接向所述接收装置重新发送所述数据报文。
  4. 根据权利要求2所述的方法,其特征在于,则所述发送装置通过所述MAC层通信连接向所述接收装置重新发送所述数据报文,包括:
    如果所述发送装置通过所述MAC层通信连接接收到所述数据报文的否定应答NAK信息,则所述发送装置根据所述数据报文的NAK信息通过所述MAC层通信连接向所述接收装置重新发送所述数据报文,所述数据报文的NAK信息用于指示所述接收装置未正确接收到所述数据报文。
  5. 根据权利要求4所述的方法,其特征在于,所述数据报文包括所述数据报文的序列号,所述方法还包括:
    所述发送装置通过所述MAC层通信连接接收所述接收装置发送的数据重传报文,所述数据重传报文包括NAK信息以及所述NAK信息的序列号;
    当所述NAK信息的序列号与所述数据报文的序列号指示的数据报文一致时,所述发送装置确定通过所述MAC层通信连接接收到所述数据报文的NAK信息。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述发送装置通过与接收装置建立的媒体介入控制MAC层通信连接向所述接收装置发送数据报文,包括:所述发送装置通过预定义的扩展MAC帧结构,向所述接收装置发送数据报文;
    其中,所述预定义的扩展MAC帧结构包括报文的源MAC地址、报文的目的MAC地址、报文的以太网数据帧类型、报文的序列号、报文的类型;
    则所述数据报文包括所述发送装置的MAC地址、所述接收装置的MAC地址、以太网数据帧类型、数据报文的序列号和所述数据报文的类型。
  7. 一种数据传输方法,其特征在于,包括:
    接收装置通过与发送装置建立的媒体介入控制MAC层通信连接,接收所述发送装置发送的数据报文;
    如果所述接收装置确定接收到的所述数据报文出现错误,则通过所述MAC层通信连接向所述发送装置发送所述数据报文的否定应答NAK信息,所述数据报文的NAK信息用于指示所述接收装置没有正确接收所述数据报文。
  8. 根据权利要求7所述的方法,其特征在于,所述接收装置通过所述MAC层通信连接接收所述发送装置发送的数据报文之前,还包括:
    所述接收装置接收所述发送装置发送的MAC层通信连接请求消 息;
    所述接收装置向所述发送装置发送所述MAC层通信连接确认消息。
  9. 根据权利要求8所述的方法,其特征在于,所述数据报文包括所述数据报文的序列号,所述方法还包括:
    所述接收装置根据所述数据报文携带的所述数据报文的序列号,确定所述数据报文是否出现错误。
  10. 根据权利要求9所述的方法,其特征在于,所述如果所述接收装置确定接收到的所述数据报文出现错误,则通过所述MAC层通信连接向所述发送装置发送所述数据报文的NAK信息,包括:
    所述如果所述接收装置确定接收到的所述数据报文出现错误,则所述接收装置根据所述数据报文,生成数据重传报文,所述数据重传报文包括NAK信息以及所述NAK信息的序列号,所述NAK信息的序列号与所述数据报文的序列号指示的数据报文一致,所述数据重传报文用于指示所述接收装置没有正确接收所述数据报文;
    所述接收装置通过所述MAC层通信连接向所述发送装置发送所述数据重传报文。
  11. 根据权利要求10所述的方法,其特征在于,所述接收装置通过所述MAC层通信连接向所述发送装置发送所述数据重传报文,包括:
    所述接收装置通过预定义的扩展MAC帧结构,向所述接收装置发送所述数据重传报文;
    其中,所述预定义的扩展MAC帧结构包括报文的源MAC地址、报文的目的MAC地址、报文的以太网数据帧类型、报文的序列号、报文的类型;
    则所述数据重传报文包括所述接收装置的MAC地址、所述发送装置的MAC地址、以太网数据帧类型、数据重传报文的序列号和NAK信息。
  12. 根据权利要求7-11任一项所述的方法,其特征在于,所述 通过所述MAC层通信连接向所述发送装置发送所述数据报文的否定应答NAK信息之后,还包括:
    所述接收装置通过所述MAC层通信连接接收所述发送装置重新发送的所述数据报文。
  13. 一种发送装置,其特征在于,包括:
    发送单元,用于通过与接收装置建立的媒体介入控制MAC层通信连接向所述接收装置发送数据报文;
    所述发送单元,还用于当确定所述接收装置未正常接收到所述数据报文时,通过所述MAC层通信连接向所述接收装置重新发送所述数据报文。
  14. 根据权利要求13所述的装置,其特征在于,
    所述发送单元,还用于根据所述接收装置的MAC地址,向所述接收装置发送MAC层通信连接请求消息;
    所述发送装置还包括接收单元和连接单元,
    所述接收单元,用于接收所述接收装置发送的MAC层通信连接确认消息;
    所述连接单元,用于根据所述接收单元接收的所述MAC层通信连接确认消息在所述MAC层与所述发送装置建立通信连接。
  15. 根据权利要求14所述的装置,其特征在于,
    所述发送单元,还用于当所述发送装置确定在预设时间内未接收到所述数据报文的响应信息时,通过所述MAC层通信连接向所述接收装置重新发送所述数据报文。
  16. 根据权利要求14所述的装置,其特征在于,
    所述发送单元,还用于当所述发送装置通过所述MAC层通信连接接收到所述接收装置发送的所述数据报文的否定应答NAK信息时,根据所述数据报文的NAK信息,通过所述MAC层通信连接向所述接收装置重新发送所述数据报文,所述数据报文的NAK信息用于指示所述接收装置未正常接收到所述数据报文。
  17. 根据权利要求16所述的装置,其特征在于,所述数据报文包括所述数据报文的序列号;
    所述接收单元,还用于通过所述MAC层通信连接接收所述接收装置发送的数据重传报文,所述数据重传报文包括NAK信息以及所述NAK信息的序列号;
    所述接收单元,还用于当所述NAK信息的序列号与所述数据报文的序列号指示的数据报文一致时,确定通过所述MAC层通信连接接收到所述数据报文的NAK信息。
  18. 根据权利要求13-17任一项所述的装置,其特征在于,
    所述发送单元,还用于通过预定义的扩展MAC帧结构,向所述接收装置发送数据报文;
    其中,所述预定义的扩展MAC帧结构包括报文的源MAC地址、报文的目的MAC地址、报文的以太网数据帧类型、报文的序列号、报文的类型;
    则所述数据报文包括所述发送装置的MAC地址、所述接收装置的MAC地址、以太网数据帧类型、数据报文的序列号和所述数据报文的类型。
  19. 一种接收装置,其特征在于,包括:
    接收单元,用于通过与发送装置建立的媒体介入控制MAC层通信连接接收所述发送装置发送的数据报文;
    发送单元,用于当接收到的所述数据报文出现错误时,通过所述MAC层通信连接向所述发送装置发送所述数据报文的否定应答NAK信息,所述数据报文的NAK信息用于指示所述接收装置没有正确接收所述数据报文。
  20. 根据权利要求19所述的装置,其特征在于,
    所述接收单元,还用于接收所述发送装置发送的MAC层通信连接请求消息;
    所述接收装置还包括控制单元,用于生成MAC层通信连接确认消息;
    所述发送单元,用于将所述控制单元生成的所述MAC层通信连接确认消息发送至所述发送装置。
  21. 根据权利要求20所述的装置,其特征在于,所述数据报文包括所述数据报文的序列号,
    所述控制单元,还用于根据所述数据报文携带的所述数据报文的序列号,确定所述数据报文是否出现错误。
  22. 根据权利要求21所述的装置,其特征在于,
    所述控制单元,还用于当接收到的所述数据报文出现错误时,根据所述数据报文,生成数据重传报文,所述数据重传报文包括NAK信息以及所述NAK信息的序列号,所述NAK信息的序列号与所述数据报文的序号指示的数据报文一致,所述数据重传报文用于指示所述接收装置没有正确接收所述数据报文;
    所述发送单元,还用于通过所述MAC层通信连接向所述发送装置发送所述控制单元生成的所述数据重传报文。
  23. 根据权利要求22所述的装置,其特征在于,
    所述发送单元,还用于通过预定义的扩展MAC帧结构,向所述接收装置发送所述数据重传报文;
    其中,所述预定义的扩展MAC帧结构包括报文的源MAC地址、报文的目的MAC地址、报文的以太网数据帧类型、报文的序列号、报文的类型;
    则所述数据重传报文包括所述接收装置的MAC地址、所述发送装置的MAC地址、以太网数据帧类型、数据重传报文的序列号和NAK信息。
  24. 根据权利要求19-23任一项所述的装置,其特征在于,
    所述接收单元,还用于通过所述MAC层通信连接接收所述发送装置重新发送的所述数据报文。
PCT/CN2014/091789 2014-04-29 2014-11-20 一种数据传输方法及装置 WO2015165255A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410178081.4A CN103973414B (zh) 2014-04-29 2014-04-29 一种数据传输方法及装置
CN201410178081.4 2014-04-29

Publications (1)

Publication Number Publication Date
WO2015165255A1 true WO2015165255A1 (zh) 2015-11-05

Family

ID=51242493

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/091789 WO2015165255A1 (zh) 2014-04-29 2014-11-20 一种数据传输方法及装置

Country Status (2)

Country Link
CN (1) CN103973414B (zh)
WO (1) WO2015165255A1 (zh)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103973414B (zh) * 2014-04-29 2018-03-09 华为技术有限公司 一种数据传输方法及装置
CN104243111B (zh) * 2014-09-01 2017-12-26 广州华多网络科技有限公司 一种数据包传输的方法和装置
WO2016106482A1 (zh) * 2014-12-29 2016-07-07 华为技术有限公司 误码信息传递方法和网络设备及通信***
CN108712373B (zh) * 2018-03-30 2022-01-11 深圳市风云实业有限公司 单向通信方法、装置、用户终端及计算机可读存储介质
CN113541874A (zh) * 2020-04-15 2021-10-22 华为技术有限公司 一种数据传输方法及网络设备
CN112398567B (zh) * 2020-11-17 2021-10-29 珠海格力电器股份有限公司 加密通信过程中时钟同步方法和装置以及多设备***
CN116248231A (zh) * 2022-12-29 2023-06-09 成都赛力斯科技有限公司 一种应用于汽车的报文传输方法、装置、设备和介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013072801A1 (en) * 2011-11-17 2013-05-23 International Business Machines Corporation System to improve an ethernet network
CN103490868A (zh) * 2012-09-19 2014-01-01 开曼群岛威睿电通股份有限公司 反向链路数据重传方法以及使用该方法的装置
CN103973414A (zh) * 2014-04-29 2014-08-06 华为技术有限公司 一种数据传输方法及装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101018108A (zh) * 2006-02-10 2007-08-15 华为技术有限公司 数据传输方法和***及数据发送和接收装置
CN102802263A (zh) * 2011-05-25 2012-11-28 中兴通讯股份有限公司 一种mac层上行动态调度的方法和装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013072801A1 (en) * 2011-11-17 2013-05-23 International Business Machines Corporation System to improve an ethernet network
CN103490868A (zh) * 2012-09-19 2014-01-01 开曼群岛威睿电通股份有限公司 反向链路数据重传方法以及使用该方法的装置
CN103973414A (zh) * 2014-04-29 2014-08-06 华为技术有限公司 一种数据传输方法及装置

Also Published As

Publication number Publication date
CN103973414A (zh) 2014-08-06
CN103973414B (zh) 2018-03-09

Similar Documents

Publication Publication Date Title
WO2015165255A1 (zh) 一种数据传输方法及装置
JP6987428B2 (ja) 通信システムにおける方法および装置
US10430374B2 (en) Selective acknowledgement of RDMA packets
JP5523350B2 (ja) Tcpフロー制御のための方法及び装置
US9577791B2 (en) Notification by network element of packet drops
US7496038B2 (en) Method for faster detection and retransmission of lost TCP segments
CN104025525A (zh) 网络元件关于分组丢弃的通知
WO2019001042A1 (zh) 数据传输方法及相关设备
KR102046792B1 (ko) 송신 노드로부터 목적지 노드로의 데이터 전송 방법
JP6806411B2 (ja) コネクションレス伝送における同期維持のためのシステムおよび方法
US10932159B2 (en) Data transmission method, data receiving device, and data sending device
US8738984B2 (en) Apparatus for processing retransmission failure in radio link control (RLC) layer
CN104780028A (zh) 一种实现tcp数据报文重传的方法及设备
US11258721B2 (en) Radio link control (RLC) acknowledged mode (AM) data reception
KR101018685B1 (ko) 광대역 무선통신시스템에서 자동 재송 요구 리셋을제어하기 위한 장치 및 방법
US8769137B2 (en) Systems and methods for negotiated accelerated block option for trivial file transfer protocol (TFTP)
US20160182608A1 (en) Retransmission control network node and related method
AU2014231331B2 (en) System and method for reliable messaging between application sessions across volatile networking conditions
WO2020259277A1 (zh) 参数优化方法、装置、基站、服务器及存储介质
US20120072520A1 (en) System and Method for Establishing Reliable Communication in a Connection-Less Environment
KR102609328B1 (ko) 무선 통신 방법 및 디바이스
JP6268027B2 (ja) 通信システム、送信装置、及び通信方法
EP3574600A1 (en) Communication protocol packet retransmission

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: 14890544

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14890544

Country of ref document: EP

Kind code of ref document: A1