[go: up one dir, main page]

CN116032421B - Ethernet link control device and storage medium - Google Patents

Ethernet link control device and storage medium Download PDF

Info

Publication number
CN116032421B
CN116032421B CN202211496316.5A CN202211496316A CN116032421B CN 116032421 B CN116032421 B CN 116032421B CN 202211496316 A CN202211496316 A CN 202211496316A CN 116032421 B CN116032421 B CN 116032421B
Authority
CN
China
Prior art keywords
message
module
data
ethernet link
link control
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202211496316.5A
Other languages
Chinese (zh)
Other versions
CN116032421A (en
Inventor
李彧
刘雷波
谢拓
彭贵强
冯春阳
苟鹏飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hexin Technology Co ltd
Tsinghua University
Original Assignee
Hexin Technology Co ltd
Tsinghua University
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 Hexin Technology Co ltd, Tsinghua University filed Critical Hexin Technology Co ltd
Priority to CN202211496316.5A priority Critical patent/CN116032421B/en
Publication of CN116032421A publication Critical patent/CN116032421A/en
Application granted granted Critical
Publication of CN116032421B publication Critical patent/CN116032421B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Communication Control (AREA)

Abstract

The present disclosure relates to an ethernet link control apparatus and a storage medium, the apparatus including a transmitting part including: the frame identifier encapsulation module is used for adding a frame identifier field into the Ethernet message to obtain a data message; the transmitting end retransmission buffer module is used for buffering the data message; a sending end message module for generating a control message; the transmitting end retransmission control module is used for controlling the transmitting end retransmission buffer module and the transmitting end message module; and the transmitting end data selector is used for transmitting the data message and/or the control message to other Ethernet link control devices. The present disclosure provides an ethernet link control device, which adds a frame identifier field in an ethernet packet to accurately implement flow control and packet retransmission, and also can generate a control packet, determine a corresponding operation according to the control packet, accurately and reliably ensure data transmission, ensure high utilization of resources, and simultaneously can be flexibly applicable to various application scenarios.

Description

以太网链路控制装置和存储介质Ethernet link control device and storage medium

技术领域Technical Field

本公开涉及以太网流量控制领域,尤其涉及一种以太网链路控制装置和存储介质。The present disclosure relates to the field of Ethernet flow control, and in particular to an Ethernet link control device and a storage medium.

背景技术Background technique

以太网凭借成本低、速度快、兼容性强、支持设备数量多等特点,广泛应用于工业控制、数字金融、智能驾驶、医疗健康等领域。传统以太网提供的是尽力投递服务,无法满足可靠传输、无丢包等需求。因此,在特定的领域,需要增加相应的机制,以满足可靠性要求。Ethernet is widely used in industrial control, digital finance, smart driving, medical health and other fields due to its low cost, high speed, strong compatibility and large number of supported devices. Traditional Ethernet provides best-effort delivery services and cannot meet the requirements of reliable transmission and zero packet loss. Therefore, in specific fields, corresponding mechanisms need to be added to meet reliability requirements.

现有公开文献中报道了很多提高以太网可靠性的方法,例如为了提升网络性能,提出了大量冗余协议方法,但这些基于冗余的方法需要冗余路径,硬件成本高,资源利用率低,无法同时满足资源利用率高、灵活性强等特性。Many methods for improving Ethernet reliability have been reported in existing public literature. For example, in order to improve network performance, a large number of redundant protocol methods have been proposed. However, these redundancy-based methods require redundant paths, have high hardware costs, and have low resource utilization. They cannot simultaneously meet the characteristics of high resource utilization and strong flexibility.

发明内容Summary of the invention

有鉴于此,本公开提出了一种以太网链路控制装置和存储介质。In view of this, the present disclosure proposes an Ethernet link control device and a storage medium.

根据本公开的一方面,提供了一种以太网链路控制装置,包括发送部件,所述发送部件包括:According to one aspect of the present disclosure, an Ethernet link control device is provided, comprising a sending component, wherein the sending component comprises:

帧标识符封装模块,用于获取以太网报文,在所述以太网报文中添加帧标识符字段,得到数据报文,并将所述数据报文提供给发送端数据选择器和发送端重传缓存模块;A frame identifier encapsulation module, used to obtain an Ethernet message, add a frame identifier field to the Ethernet message, obtain a data message, and provide the data message to a sending end data selector and a sending end retransmission buffer module;

发送端重传缓存模块,用于缓存所述数据报文;根据发送端重传控制模块的指示提供对应的数据报文至发送端数据选择器,或者,释放对应的数据报文的缓存空间;A sending end retransmission buffer module, used to buffer the data message; provide the corresponding data message to the sending end data selector according to the instruction of the sending end retransmission control module, or release the buffer space of the corresponding data message;

发送端报文模块,用于根据发送端重传控制模块的指示生成控制报文,并将所述控制报文提供给发送端数据选择器;A sending end message module, used to generate a control message according to the instruction of the sending end retransmission control module, and provide the control message to the sending end data selector;

发送端重传控制模块,用于控制发送端重传缓存模块和发送端报文模块;当根据来自其它以太网链路控制装置的控制报文确定数据报文需要重传时,控制发送端重传缓存模块将对应的数据报文提供给发送端数据选择器,控制发送端报文模块生成相应的控制报文并将所述控制报文提供给发送端数据选择器;当根据来自其它以太网链路控制装置的控制报文确定数据报文传输成功时,控制发送端重传缓存模块释放对应的数据报文的缓存空间;A sending end retransmission control module, used to control a sending end retransmission buffer module and a sending end message module; when it is determined that a data message needs to be retransmitted according to a control message from another Ethernet link control device, the sending end retransmission buffer module is controlled to provide the corresponding data message to a sending end data selector, and the sending end message module is controlled to generate a corresponding control message and provide the control message to the sending end data selector; when it is determined that the data message is successfully transmitted according to a control message from another Ethernet link control device, the sending end retransmission buffer module is controlled to release the corresponding data message buffer space;

发送端数据选择器,用于将所述以太网链路控制装置生成的数据报文和/或控制报文发送给其它以太网链路控制装置。The sending end data selector is used to send the data message and/or control message generated by the Ethernet link control device to other Ethernet link control devices.

在一种可能的实现方式中,所述装置连接于以太网MAC和报文缓存模块:In a possible implementation, the device is connected to an Ethernet MAC and a message buffer module:

其中,所述帧标识符封装模块从所述报文缓存模块获取以太网报文;Wherein, the frame identifier encapsulation module obtains the Ethernet message from the message buffer module;

所述发送端数据选择器通过所述以太网MAC将数据报文和/或控制报文发送给其它以太网链路控制装置。The transmitting end data selector sends the data message and/or the control message to other Ethernet link control devices through the Ethernet MAC.

在一种可能的实现方式中,所述装置还包括接收部件,所述接收部件包括:In a possible implementation manner, the apparatus further includes a receiving component, and the receiving component includes:

接收端分发模块,用于接收来自其它以太网链路控制装置的报文,并判断所述报文为数据报文还是控制报文;当所述报文为数据报文时,用于判断所述数据报文是否符合传输要求,当符合传输要求并且所述报文缓存模块有可用空间时,将所述数据报文提供给帧标识符删除模块,控制接收端报文模块生成相应的控制报文以提供给发送端数据选择器;如果不符合传输要求和/或报文缓存模块没有可用空间时,用于控制接收端报文模块生成相应的控制报文以提供给发送端数据选择器;当所述报文为控制报文时,用于将所述控制报文提供给发送端重传控制模块;A receiving end distribution module, used for receiving messages from other Ethernet link control devices, and determining whether the message is a data message or a control message; when the message is a data message, used for determining whether the data message meets the transmission requirements, and when it meets the transmission requirements and the message buffer module has available space, providing the data message to the frame identifier deletion module, controlling the receiving end message module to generate a corresponding control message to provide to the sending end data selector; if it does not meet the transmission requirements and/or the message buffer module has no available space, used for controlling the receiving end message module to generate a corresponding control message to provide to the sending end data selector; when the message is a control message, used for providing the control message to the sending end retransmission control module;

帧标识符删除模块,用于删除添加在数据报文中的帧标识符字段;A frame identifier deletion module, used for deleting a frame identifier field added to a data message;

接收端报文模块,用于根据接收端分发模块的指示生成相应的控制报文,并将所述控制报文提供给发送端数据选择器。The receiving end message module is used to generate a corresponding control message according to the instruction of the receiving end distribution module, and provide the control message to the sending end data selector.

在一种可能的实现方式中,符合传输要求的条件包括所述数据报文的帧标识符正确,并且所述数据报文的循环冗杂校验CRC无误。In a possible implementation, the condition that meets the transmission requirement includes that the frame identifier of the data message is correct and the cyclic redundancy check CRC of the data message is correct.

在一种可能的实现方式中,所述接收端报文模块生成的控制报文包括:In a possible implementation, the control message generated by the receiving end message module includes:

成功接收PA报文,用于表示数据报文传输成功;当接收端分发模块判断接收的来自其它以太网链路控制装置的报文为数据报文,所述数据报文符合传输要求并且报文缓存模块有可用空间时,控制接收端报文模块生成PA报文;当其它以太网链路控制装置接收到所述PA报文时,所述其它以太网链路控制装置的发送端重传控制模块确定所述数据报文传输成功;Successfully receiving a PA message indicates that the data message is successfully transmitted; when the receiving end distribution module determines that the message received from the other Ethernet link control device is a data message, the data message meets the transmission requirements and the message buffer module has available space, the receiving end message module is controlled to generate a PA message; when the other Ethernet link control device receives the PA message, the sending end retransmission control module of the other Ethernet link control device determines that the data message is successfully transmitted;

需要重传PR报文,用于表示数据报文需要重传;当接收端分发模块判断接收的来自其它以太网链路控制装置的报文为数据报文,所述数据报文符合传输要求但是报文缓存模块没有可用空间时,控制接收端报文模块生成PR报文;当其它以太网链路控制装置接收到所述PR报文时,所述其它以太网链路控制装置的发送端重传控制模块确定所述数据报文需要重传;A PR message needs to be retransmitted, which is used to indicate that a data message needs to be retransmitted; when the receiving end distribution module determines that the message received from other Ethernet link control devices is a data message, and the data message meets the transmission requirements but there is no available space in the message buffer module, the receiving end message module is controlled to generate a PR message; when the other Ethernet link control devices receive the PR message, the sending end retransmission control module of the other Ethernet link control devices determines that the data message needs to be retransmitted;

未成功接收PNA报文,用于表示数据报文需要重传;当接收端分发模块判断接收的来自其它以太网链路控制装置的报文为数据报文,所述数据报文不符合传输要求时,控制接收端报文模块生成PNA报文;当其它以太网链路控制装置接收到所述PNA报文时,所述其它以太网链路控制装置的发送端重传控制模块确定所述数据报文需要重传。Failure to successfully receive a PNA message indicates that the data message needs to be retransmitted; when the receiving end distribution module determines that the message received from other Ethernet link control devices is a data message and the data message does not meet the transmission requirements, the receiving end message module is controlled to generate a PNA message; when other Ethernet link control devices receive the PNA message, the sending end retransmission control module of the other Ethernet link control devices determines that the data message needs to be retransmitted.

在一种可能的实现方式中,当所述接收部件的接收端报文模块根据接收端分发模块的指示发送PR报文或PNA报文后,所述接收部件进入重传等待状态;In a possible implementation, after the receiving end message module of the receiving component sends a PR message or a PNA message according to the instruction of the receiving end distribution module, the receiving component enters a retransmission waiting state;

当所述接收部件在重传等待状态时,所述接收部件的接收端分发模块不再接收来自其它以太网链路控制装置的数据报文。When the receiving component is in the retransmission waiting state, the receiving end distribution module of the receiving component no longer receives data messages from other Ethernet link control devices.

在一种可能的实现方式中,发送端报文模块生成的控制报文包括:In a possible implementation, the control message generated by the message module at the sending end includes:

解除重传状态RFR报文,用于解除接收部件的重传等待状态;当发送端重传控制模块接收到来自其它以太网链路控制装置的PR报文或PNA报文时,确定数据报文需要重传,控制发送端报文模块生成RFR报文;当其它以太网链路控制装置接收到所述RFR报文时,所述其它以太网链路控制装置的接收部件解除重传等待状态,恢复接收来自其它以太网链路控制装置的数据报文。The RFR message for releasing the retransmission state is used to release the retransmission waiting state of the receiving component; when the sending end retransmission control module receives the PR message or the PNA message from other Ethernet link control devices, it determines that the data message needs to be retransmitted, and controls the sending end message module to generate the RFR message; when other Ethernet link control devices receive the RFR message, the receiving components of the other Ethernet link control devices release the retransmission waiting state and resume receiving the data messages from other Ethernet link control devices.

在一种可能的实现方式中,发送端报文模块生成的控制报文还包括:In a possible implementation, the control message generated by the message module at the sending end further includes:

请求链路状态LReq报文,用于请求了解接收部件的状态;当发送端重传控制模块至少两次接收到来自其它以太网链路控制装置的同一个帧标识符的PNA报文时,发送端重传控制模块控制发送端报文模块生成LReq报文;The link status request LReq message is used to request to know the status of the receiving component; when the sending end retransmission control module receives the PNA message with the same frame identifier from other Ethernet link control devices at least twice, the sending end retransmission control module controls the sending end message module to generate the LReq message;

其中,当所述以太网链路控制装置与其它以太网链路控制装置首次建立连接时,主动生成并发送LReq报文。When the Ethernet link control device establishes a connection with other Ethernet link control devices for the first time, it actively generates and sends an LReq message.

在一种可能的实现方式中,当其它以太网链路控制装置接收到所述LReq报文时,所述其它以太网链路控制装置的接收端分发模块指示接收端报文模块生成的控制报文包括:In a possible implementation, when the other Ethernet link control device receives the LReq message, the receiving end distribution module of the other Ethernet link control device instructs the receiving end message module to generate a control message including:

回复链路状态LRsp报文,用于反馈接收部件的状态;当接收端分发模块接收到来自其它以太网链路控制装置的LReq报文时,控制接收端报文模块生成LRsp报文;其中,LRsp报文中包括所需的数据报文的帧标识符。Reply link status LRsp message to feedback the status of the receiving component; when the receiving end distribution module receives the LReq message from other Ethernet link control devices, it controls the receiving end message module to generate an LRsp message; wherein the LRsp message includes the frame identifier of the required data message.

在一种可能的实现方式中,所述装置还包括备用通道Bypass,所述备用通道用于将以太网报文提供给发送端数据选择器,以发送至其它以太网链路控制装置。In a possible implementation, the device further includes a backup channel Bypass, and the backup channel is used to provide the Ethernet message to the transmitting end data selector to send it to other Ethernet link control devices.

根据本公开的另一方面,提出一种以太网链路控制装置,包括:According to another aspect of the present disclosure, an Ethernet link control device is provided, comprising:

处理器;processor;

用于存储处理器可执行指令的存储器;a memory for storing processor-executable instructions;

其中,所述处理器被配置为在执行所述存储器存储的指令时,实现上述装置。Wherein, the processor is configured to implement the above-mentioned device when executing the instructions stored in the memory.

根据本公开的另一方面,提出一种非易失性计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述计算机程序指令被处理器执行时实现上述装置。According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, characterized in that the computer program instructions implement the above-mentioned device when executed by a processor.

根据本公开的另一方面,提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器实现上述装置。According to another aspect of the present disclosure, a computer program product is provided, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device implements the above-mentioned device.

基于此,本公开提供了一种以太网链路控制装置,能同时实现流量控制和报文重传。本公开通过在以太网报文中添加帧标识符字段得到数据报文并将其缓存,可以相当于对每个以太网报文进行编号,在流量控制和报文重传时能够精准地进行处理。同时根据不同情况生成相应的控制报文,根据控制报文确定相应的操作,将对应的数据报文和/或控制报文发送给其它以太网链路控制装置,因而能准确并且可靠地保障数据传输,保证资源的高利用率,同时适用于多种应用场景,灵活度高。Based on this, the present disclosure provides an Ethernet link control device that can simultaneously realize flow control and message retransmission. The present disclosure obtains data messages by adding a frame identifier field in the Ethernet message and caches it, which is equivalent to numbering each Ethernet message, and can accurately process flow control and message retransmission. At the same time, corresponding control messages are generated according to different situations, corresponding operations are determined according to the control messages, and corresponding data messages and/or control messages are sent to other Ethernet link control devices, thereby accurately and reliably ensuring data transmission and ensuring high resource utilization. At the same time, it is applicable to a variety of application scenarios and has high flexibility.

根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

包含在说明书中并且构成说明书的一部分的附图与说明书一起示出了本公开的示例性实施例、特征和方面,并且用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

图1示出了PFC报文格式的示意图。FIG1 is a schematic diagram showing a PFC message format.

图2示出了根据本公开一实施例的以太网链路控制装置的框图。FIG2 shows a block diagram of an Ethernet link control device according to an embodiment of the present disclosure.

图3示出了根据本公开一实施例的数据报文的示意图。FIG3 shows a schematic diagram of a data message according to an embodiment of the present disclosure.

图4示出了根据本公开一实施例的控制报文的示意图。FIG. 4 shows a schematic diagram of a control message according to an embodiment of the present disclosure.

图5示出了根据本公开一实施例的六种控制报文的示意图。FIG5 shows a schematic diagram of six control messages according to an embodiment of the present disclosure.

图6示出了根据本公开一实施例的以太网链路控制装置的框图。FIG6 shows a block diagram of an Ethernet link control device according to an embodiment of the present disclosure.

图7示出了根据本公开一实施例的控制报文的传输与反馈的流程图FIG. 7 shows a flow chart of transmission and feedback of control messages according to an embodiment of the present disclosure.

图8示出了根据本公开一实施例的两个以太网链路控制装置之间传输报文的框图。FIG8 shows a block diagram of message transmission between two Ethernet link control devices according to an embodiment of the present disclosure.

具体实施方式Detailed ways

以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

另外,为了更好的说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present disclosure.

以太网的流量控制分为两种,一种为半双工下的流量控制,一般采用背压技术;另一种为全双工下的流量控制。IEEE 802.3X定义了流量控制机制,即停等机制PAUSE流控,用于在一个链路上消除由于拥塞而导致的丢包,当网络出现拥塞时会把整个端口的流量都停止,从而会把正常的流量都中断,造成误杀。There are two types of Ethernet flow control: one is half-duplex flow control, which generally uses back pressure technology; the other is full-duplex flow control. IEEE 802.3X defines a flow control mechanism, namely the PAUSE flow control mechanism, which is used to eliminate packet loss caused by congestion on a link. When the network is congested, the flow of the entire port will be stopped, thereby interrupting normal flow and causing false positives.

同时,在企业数据中心内,会融合针对不同应用所部属的多个不同的网络,传统的流量控制机制(如PAUSE流控)无法实现多种流量共享链路的需求。为此,提出了PFC(Priority-based Flow Control,优先级流控)。图1示出了PFC报文格式的示意图,在PFC中,网络流量可以分为0-7,共8个优先级,因此可以在一条以太网链路上创建8个虚拟通道,并为每条虚拟通道指定一个IEEE 802.1P优先等级,每个优先级都各自维护一个虚拟通道,分别实现独立的PAUSE机制,可以实现单独暂停和重启任意一条虚拟通道,将各虚拟通道隔离,避免相互影响,真正实现多种流量共享链路。At the same time, in the enterprise data center, multiple different networks deployed for different applications will be integrated. Traditional flow control mechanisms (such as PAUSE flow control) cannot meet the needs of multiple traffic sharing links. For this reason, PFC (Priority-based Flow Control) is proposed. Figure 1 shows a schematic diagram of the PFC message format. In PFC, network traffic can be divided into 0-7, a total of 8 priorities, so 8 virtual channels can be created on an Ethernet link, and an IEEE 802.1P priority level is specified for each virtual channel. Each priority maintains a virtual channel and implements an independent PAUSE mechanism. It can achieve the individual suspension and restart of any virtual channel, isolate each virtual channel, avoid mutual influence, and truly realize multiple traffic sharing links.

PFC报文格式中的目的地址DA(Destination Address)、源地址SA(SourceAddress)、报文类型Type、帧校验序列FCS(Frame Check Sequence)与普通流控报文相似,如图1所示,PFC报文中还有控制操作码control opcode、优先级启用向量priority_enable_vector和time[n],其中priority_enable_vector占用2-byte,高字节置0,低字节的每个位(共8位)代表相应的time[n](time[0]-time[7])是否有效,其中当某一位为0时,则代表该位对应的time[n]无效;当某一位为1时,则代表该位对应的time[n]有效。time[n]代表接收站点应该停止优先级为n的报文的发送时间。当time[n]有效且time[n]不为0时,如果优先级为n的发送没有停止就停止它,并根据time[n]表示的时间启动一个定时器,在该定时器到期之前,该优先级的发送就会被停止。当time[n]无效时或当time[n]有效且time[n]为0时,如果该优先级的发送是被停止的,可以关闭相应的定时器并启动该优先级继续发送数据。在全双工下的流量控制中,如果一端发现其在某个优先级上出现了拥塞,可以向另一端发送PFC报文来通知另一端在一段时间内不要再在某个优先级上发送数据,如果一端发现其在某个优先级上的拥塞解除了,可以向另一端发送PFC报文来通知另一端可以重新在某个优先级上发送数据。简单来说,如果一端发现其在某个优先级上的拥塞状态发生了变化,可以向另一端发送PFC报文来通告这个变化。然而为了消除由于拥塞导致的丢包,PFC报文的发送必须满足一定的时间要求,如果PFC报文发送过晚的话会导致数据因为接收缓存空间不足而被丢弃;如果PFC报文发送过早的话会降低网络利用率。更严重的问题是,PFC无法实现在网络发生错误时重传报文。The destination address DA (Destination Address), source address SA (Source Address), message type Type, and frame check sequence FCS (Frame Check Sequence) in the PFC message format are similar to those of ordinary flow control messages, as shown in Figure 1. The PFC message also contains a control opcode, a priority enable vector priority_enable_vector, and time[n]. Priority_enable_vector occupies 2 bytes, with the high byte set to 0. Each bit of the low byte (8 bits in total) represents whether the corresponding time[n] (time[0]-time[7]) is valid. When a bit is 0, it means that the time[n] corresponding to the bit is invalid; when a bit is 1, it means that the time[n] corresponding to the bit is valid. Time[n] represents the time when the receiving station should stop sending messages with priority n. When time[n] is valid and time[n] is not 0, if the transmission of priority n has not stopped, it will be stopped, and a timer will be started according to the time represented by time[n]. Before the timer expires, the transmission of the priority will be stopped. When time[n] is invalid or when time[n] is valid and time[n] is 0, if the transmission of the priority is stopped, the corresponding timer can be turned off and the priority can be started to continue sending data. In full-duplex flow control, if one end finds that it has congestion on a certain priority, it can send a PFC message to the other end to notify the other end not to send data on a certain priority for a period of time. If one end finds that its congestion on a certain priority is relieved, it can send a PFC message to the other end to notify the other end that it can send data on a certain priority again. In simple terms, if one end finds that its congestion status on a certain priority has changed, it can send a PFC message to the other end to notify the change. However, in order to eliminate packet loss caused by congestion, the sending of PFC messages must meet certain time requirements. If the PFC message is sent too late, the data will be discarded due to insufficient receiving buffer space; if the PFC message is sent too early, the network utilization rate will be reduced. A more serious problem is that PFC cannot retransmit messages when errors occur in the network.

基于此,本公开提供了一种以太网链路控制装置,能同时实现流量控制和报文重传。本公开通过在以太网报文中添加帧标识符字段得到数据报文并将其缓存,可以相当于对每个以太网报文进行编号,在流量控制和报文重传时能够精准地进行处理。同时根据不同情况生成相应的控制报文,根据控制报文确定相应的操作,将对应的数据报文和/或控制报文发送给其它以太网链路控制装置,因而能准确并且可靠地保障数据传输,保证资源的高利用率,同时适用于多种应用场景,灵活度高。Based on this, the present disclosure provides an Ethernet link control device that can simultaneously realize flow control and message retransmission. The present disclosure obtains data messages by adding a frame identifier field in the Ethernet message and caches it, which is equivalent to numbering each Ethernet message, and can accurately process flow control and message retransmission. At the same time, corresponding control messages are generated according to different situations, corresponding operations are determined according to the control messages, and corresponding data messages and/or control messages are sent to other Ethernet link control devices, thereby accurately and reliably ensuring data transmission and ensuring high resource utilization. At the same time, it is applicable to a variety of application scenarios and has high flexibility.

图2示出了根据本公开一实施例的以太网链路控制装置的框图。如图2所示,该装置包括发送部件,所述发送部件包括:FIG2 shows a block diagram of an Ethernet link control device according to an embodiment of the present disclosure. As shown in FIG2 , the device includes a sending component, and the sending component includes:

帧标识符封装模块11,用于获取以太网报文,在所述以太网报文中添加帧标识符字段,得到数据报文,并将所述数据报文提供给发送端数据选择器15和发送端重传缓存模块12。The frame identifier encapsulation module 11 is used to obtain an Ethernet message, add a frame identifier field in the Ethernet message, obtain a data message, and provide the data message to the sending end data selector 15 and the sending end retransmission buffer module 12.

其中,在以太网报文中添加帧标识符字段后得到数据报文,然后将所述数据报文提供给本装置的发送端数据选择器15,这里可以通过AXI-Stream(Advanced eXtensibleInterface-Stream,高级可扩展接口流协议)总线进行传输,然后发送端数据选择器15会将所述数据报文发送给其它以太网链路控制装置,同时,帧标识符封装模块11还将所述数据报文提供给本装置的发送端重传缓存模块12,发送端重传缓存模块12将所述数据报文缓存起来,并且可以记录所述数据报文的帧标识符,可相当于记录对应编号,当需要某一帧标识符的数据报文时能方便取出使用。Among them, after adding the frame identifier field to the Ethernet message, a data message is obtained, and then the data message is provided to the sending end data selector 15 of this device, which can be transmitted through the AXI-Stream (Advanced eXtensibleInterface-Stream) bus, and then the sending end data selector 15 will send the data message to other Ethernet link control devices. At the same time, the frame identifier encapsulation module 11 also provides the data message to the sending end retransmission cache module 12 of this device. The sending end retransmission cache module 12 caches the data message and can record the frame identifier of the data message, which is equivalent to recording the corresponding number. When a data message with a certain frame identifier is needed, it can be conveniently taken out and used.

其中,图3示出了根据本公开一实施例的数据报文的示意图,图中所示的数据报文从左至右包括目的地址DA(Destination Address)、源地址SA(Source Address)、种类Type、帧标识符Frame ID、数据Data、帧校验序列FCS(Frame Check Sequence),与现有技术的以太网报文(例如图1的PFC报文)相比多了一项帧标识符字段,使用帧标识符对以太网报文进行编号,以便精准地进行传输控制。在本公开一具体实施例中,可以每接收一个以太网报文,得到的数据报文的帧标识符的值加1,实现不重复地编号,方便管理。Among them, FIG3 shows a schematic diagram of a data message according to an embodiment of the present disclosure. The data message shown in the figure includes a destination address DA (Destination Address), a source address SA (Source Address), a type Type, a frame identifier Frame ID, data Data, and a frame check sequence FCS (Frame Check Sequence) from left to right. Compared with the Ethernet message of the prior art (such as the PFC message of FIG1), there is an additional frame identifier field. The frame identifier is used to number the Ethernet message for accurate transmission control. In a specific embodiment of the present disclosure, each time an Ethernet message is received, the value of the frame identifier of the obtained data message can be increased by 1, so as to achieve non-repetitive numbering and facilitate management.

发送端重传缓存模块12,用于缓存所述数据报文;根据发送端重传控制模块14的指示提供对应的数据报文至发送端数据选择器15,或者,释放对应的数据报文的缓存空间。The sending end retransmission buffer module 12 is used to buffer the data message; provide the corresponding data message to the sending end data selector 15 according to the instruction of the sending end retransmission control module 14, or release the buffer space of the corresponding data message.

其中,发送端重传缓存模块12将所述数据报文缓存起来,并且可以记录所述数据报文的帧标识符,可相当于记录对应编号,当需要重传某一帧标识符的数据报文时能方便快捷地提供给本装置的发送端数据选择器15,或者当确定某一数据报文发送成功不需要再重传时释放所述数据报文的缓存空间。Among them, the sending end retransmission cache module 12 caches the data message and can record the frame identifier of the data message, which can be equivalent to recording the corresponding number. When a data message with a certain frame identifier needs to be retransmitted, it can be conveniently and quickly provided to the sending end data selector 15 of this device, or when it is determined that a certain data message has been sent successfully and does not need to be retransmitted, the cache space of the data message is released.

其中,在本公开一具体实施例中,可以在发送端重传缓存模块12中建立一个列表,每个帧标识符对应的数据报文存入发送端重传缓存中时可用标签记录,方便存储管理。此时发送端重传缓存可以相当于一个抽屉,当将帧标识符为1的数据报文提供给发送端数据选择器15的同时也将该数据报文缓存至抽屉中,将该抽屉层编号为1。如果发送端重传缓存模块确定帧标识符为1的数据报文发送成功,则找到编号为1的抽屉层,将存入其中的帧标识符为1的数据报文删除,即释放缓存空间。如果发送端重传缓存模块12确定帧标识符为1的数据报文没有发送成功,需要重新传输,则找到编号为1的抽屉层,将存入其中的帧标识符为1的数据报文取出,重新提供给发送端数据选择器15,由发送端数据选择器15重新发送给其它以太网链路控制装置。Among them, in a specific embodiment of the present disclosure, a list can be established in the retransmission cache module 12 at the sending end, and the data message corresponding to each frame identifier can be recorded with a label when it is stored in the retransmission cache of the sending end, so as to facilitate storage management. At this time, the retransmission cache of the sending end can be equivalent to a drawer. When the data message with a frame identifier of 1 is provided to the data selector 15 at the sending end, the data message is also cached in the drawer, and the drawer layer is numbered 1. If the retransmission cache module at the sending end determines that the data message with a frame identifier of 1 is successfully sent, the drawer layer numbered 1 is found, and the data message with a frame identifier of 1 stored therein is deleted, that is, the cache space is released. If the retransmission cache module 12 at the sending end determines that the data message with a frame identifier of 1 is not successfully sent and needs to be retransmitted, the drawer layer numbered 1 is found, the data message with a frame identifier of 1 stored therein is taken out, and it is re-provided to the data selector 15 at the sending end, and the data selector 15 at the sending end re-sends it to other Ethernet link control devices.

发送端报文模块13,用于根据发送端重传控制模块的指示生成控制报文,并将所述控制报文提供给发送端数据选择器;The sending end message module 13 is used to generate a control message according to the instruction of the sending end retransmission control module, and provide the control message to the sending end data selector;

其中,控制报文又称RTC(Reliable Transmission Control,可靠传输控制)报文。图4示出了根据本公开一实施例的控制报文的示意图,在图4所示的示例中,从左至右的第一部分是长度为6-byte的目的地址字段,可自行定义不作限制,默认值为0x01-80-c2-00-00-02。第二部分是长度为6-byte的源地址字段。第三部分是长度为2-byte的RTC种类字段,可自行定义不作限制,默认值为0x88-88,这里的RTC种类可以跟以太网报文的种类一样(如图1的PFC Ethertype),也可以自行设置,可规定自行设置时2-byte的16位不能是全0或全1,此外不作其它限定。第四部分是长度为2-byte的控制操作码字段,值为02-0x,可以有六种操作码,分别对应六种控制报文(如图5示出了根据本公开一实施例的六种控制报文的示意图)。第五部分是长度为2-byte的帧标识符字段,对应控制报文的帧标识符。第六部分是长度为2-byte的未成功接收PNA或需要重传PR原因字段,这部分内容为当此控制报文为PNA报文或者PR报文时的原因,例如帧校验序列错误、帧标识符不匹配、缓存资源不足等。最后是长度为4-byte的FCS(frame check sequence,帧校验序列),是报文的CRC(CyclicRedundancy Check,循环冗杂校验)功能,用于数据传输检错,可以保证数据传输的准确性和完整性。Among them, the control message is also called RTC (Reliable Transmission Control) message. Figure 4 shows a schematic diagram of a control message according to an embodiment of the present disclosure. In the example shown in Figure 4, the first part from left to right is a 6-byte destination address field, which can be defined by itself without restriction, and the default value is 0x01-80-c2-00-00-02. The second part is a 6-byte source address field. The third part is a 2-byte RTC type field, which can be defined by itself without restriction, and the default value is 0x88-88. The RTC type here can be the same as the type of Ethernet message (such as PFC Ethertype in Figure 1), or it can be set by itself. It can be stipulated that the 16 bits of 2-byte cannot be all 0 or all 1 when setting by itself, and no other restrictions are made. The fourth part is a 2-byte control operation code field, the value of which is 02-0x. There can be six operation codes, corresponding to six control messages (such as a schematic diagram of six control messages according to an embodiment of the present disclosure shown in Figure 5). The fifth part is the 2-byte frame identifier field, which corresponds to the frame identifier of the control message. The sixth part is the 2-byte reason field for unsuccessful reception of PNA or need for retransmission of PR, which contains the reason when the control message is a PNA message or a PR message, such as frame check sequence error, frame identifier mismatch, insufficient cache resources, etc. The last part is the 4-byte FCS (frame check sequence), which is the CRC (Cyclic Redundancy Check) function of the message, used for data transmission error detection, which can ensure the accuracy and integrity of data transmission.

发送端重传控制模块14,用于控制发送端重传缓存模块12和发送端报文模块13;当根据来自其它以太网链路控制装置的控制报文确定数据报文需要重传时,控制发送端重传缓存模块12将对应的数据报文提供给发送端数据选择器15,控制发送端报文模块13生成相应的控制报文并将所述控制报文提供给发送端数据选择器15;当根据来自其它以太网链路控制装置的控制报文确定数据报文传输成功时,控制发送端重传缓存模块12释放对应的数据报文的缓存空间。The sending end retransmission control module 14 is used to control the sending end retransmission cache module 12 and the sending end message module 13; when it is determined that the data message needs to be retransmitted according to the control message from other Ethernet link control devices, the sending end retransmission cache module 12 is controlled to provide the corresponding data message to the sending end data selector 15, and the sending end message module 13 is controlled to generate a corresponding control message and provide the control message to the sending end data selector 15; when it is determined that the data message transmission is successful according to the control message from other Ethernet link control devices, the sending end retransmission cache module 12 is controlled to release the cache space of the corresponding data message.

其中,来自其它以太网链路控制装置的控制报文可以带来两种信息,一种是数据报文需要重传,一种是数据报文传输成功。发送端重传控制模块14需要根据接收到的控制报文的信息控制发送端重传缓存模块12和发送端报文模块13。当确定数据报文需要重传时,控制发送端报文模块13生成相应的控制报文并控制发送端重传缓存模块12找出对应的数据报文,将所述控制报文和数据报文都提供给发送端数据选择器15。当确定数据报文传输成功时,控制发送端重传缓存模块12释放对应的数据报文的缓存空间。Among them, the control message from other Ethernet link control devices can bring two kinds of information, one is that the data message needs to be retransmitted, and the other is that the data message is successfully transmitted. The sending end retransmission control module 14 needs to control the sending end retransmission buffer module 12 and the sending end message module 13 according to the information of the received control message. When it is determined that the data message needs to be retransmitted, the sending end message module 13 is controlled to generate a corresponding control message and the sending end retransmission buffer module 12 is controlled to find the corresponding data message, and the control message and the data message are provided to the sending end data selector 15. When it is determined that the data message is successfully transmitted, the sending end retransmission buffer module 12 is controlled to release the corresponding data message cache space.

发送端数据选择器15,用于将所述以太网链路控制装置生成的数据报文和/或控制报文发送给其它以太网链路控制装置。The sending end data selector 15 is used to send the data message and/or control message generated by the Ethernet link control device to other Ethernet link control devices.

其中,有三个模块能提供数据报文或控制报文至发送端数据选择器15:来自帧标识符封装模块11的数据报文,来自发送端重传缓存模块12的数据报文,来自发送端报文模块13的控制报文。在每个发送周期,发送端数据选择器15会根据实际应用情况选择其中一种报文发送给其它以太网链路控制装置。Among them, there are three modules that can provide data messages or control messages to the sending end data selector 15: data messages from the frame identifier encapsulation module 11, data messages from the sending end retransmission buffer module 12, and control messages from the sending end message module 13. In each sending cycle, the sending end data selector 15 will select one of the messages according to the actual application situation and send it to other Ethernet link control devices.

图6示出了根据本公开一实施例的以太网链路控制装置的框图。如图6所示,FIG6 shows a block diagram of an Ethernet link control device according to an embodiment of the present disclosure. As shown in FIG6,

在一种可能的实现方式中,该装置连接于以太网MAC和报文缓存模块:In a possible implementation, the device is connected to an Ethernet MAC and a message buffer module:

其中,所述帧标识符封装模块11从所述报文缓存模块获取以太网报文;所述发送端数据选择器15通过所述以太网MAC(Medium Access Control,媒体介质访问控制)将数据报文和/或控制报文发送给其它以太网链路控制装置。其中,报文缓存模块和以太网MAC可基于现有技术实现,即本公开实施例的以太网链路控制装置可位于原有的报文缓存模块和以太网MAC之间。图6中的发送端报文缓存模块和接收端报文缓存模块可以集成在一起,发送端以太网MAC和接收端以太网MAC也可以集成在一起。The frame identifier encapsulation module 11 obtains the Ethernet message from the message buffer module; the transmitting end data selector 15 sends the data message and/or control message to other Ethernet link control devices through the Ethernet MAC (Medium Access Control). The message buffer module and the Ethernet MAC can be implemented based on the existing technology, that is, the Ethernet link control device of the embodiment of the present disclosure can be located between the original message buffer module and the Ethernet MAC. The transmitting end message buffer module and the receiving end message buffer module in FIG6 can be integrated together, and the transmitting end Ethernet MAC and the receiving end Ethernet MAC can also be integrated together.

在一种可能的实现方式中,所述装置还包括接收部件,所述接收部件包括:In a possible implementation manner, the apparatus further includes a receiving component, and the receiving component includes:

接收端分发模块21,用于接收来自其它以太网链路控制装置的报文,并判断所述报文为数据报文还是控制报文;当所述报文为数据报文时,用于判断所述数据报文是否符合传输要求,当符合传输要求并且所述报文缓存模块有可用空间时,将所述数据报文提供给帧标识符删除模块22,控制接收端报文模块23生成相应的控制报文以提供给发送端数据选择器15;如果不符合传输要求和/或报文缓存模块没有可用空间时,用于控制接收端报文模块23生成相应的控制报文以提供给发送端数据选择器15;当所述报文为控制报文时,用于将所述控制报文提供给发送端重传控制模块14。The receiving end distribution module 21 is used to receive messages from other Ethernet link control devices and determine whether the message is a data message or a control message; when the message is a data message, it is used to determine whether the data message meets the transmission requirements. When it meets the transmission requirements and the message cache module has available space, the data message is provided to the frame identifier deletion module 22 to control the receiving end message module 23 to generate a corresponding control message to provide to the sending end data selector 15; if it does not meet the transmission requirements and/or the message cache module has no available space, it is used to control the receiving end message module 23 to generate a corresponding control message to provide to the sending end data selector 15; when the message is a control message, it is used to provide the control message to the sending end retransmission control module 14.

其中,由于其它以太网链路控制装置的发送端数据选择器15可以发送数据报文和/或控制报文,所以接收端分发模块21首先可以判断所接收的报文是数据报文还是控制报文。Among them, since the sending end data selector 15 of other Ethernet link control devices can send data messages and/or control messages, the receiving end distribution module 21 can first determine whether the received message is a data message or a control message.

其中,当接收端分发模块21确定接收到的是数据报文时,可分为两种情况,一种是接收端分发模块21确定所述数据报文符合传输要求并且接收端报文缓存模块有可用空间时,可将所述数据报文提供给帧标识符删除模块22,控制接收端报文模块23生成相应的控制报文以提供给本装置发送端数据选择器15。另一种情况是接收端分发模块21确定所述数据报文不符合传输要求和/或报文缓存模块没有可用空间时,可以控制接收端报文模块23生成相应的控制报文以提供给本装置的发送端数据选择器15。发送端数据选择器15可以将两种情况生成的控制报文发送给发来所述数据报文的对应的其它以太网链路控制装置。Among them, when the receiving end distribution module 21 determines that what is received is a data message, it can be divided into two situations. One is that when the receiving end distribution module 21 determines that the data message meets the transmission requirements and the receiving end message buffer module has available space, the data message can be provided to the frame identifier deletion module 22, and the receiving end message module 23 can be controlled to generate a corresponding control message to provide to the sending end data selector 15 of this device. Another situation is that when the receiving end distribution module 21 determines that the data message does not meet the transmission requirements and/or the message buffer module has no available space, the receiving end message module 23 can be controlled to generate a corresponding control message to provide to the sending end data selector 15 of this device. The sending end data selector 15 can send the control messages generated in the two situations to the corresponding other Ethernet link control devices that sent the data message.

其中,当接收端分发模块21确定接收到的是控制报文时,可将所述控制报文提供给本装置的发送端重传控制模块14,发送端重传控制模块14可根据所述控制报文的信息进行下一步处理。When the receiving end distribution module 21 determines that what is received is a control message, the control message may be provided to the sending end retransmission control module 14 of the device, and the sending end retransmission control module 14 may perform the next step of processing according to the information of the control message.

在一个示例中,帧标识符删除模块22的工作方式如下。当接收端分发模块21确定接收到的是数据报文时,且所述数据报文符合传输要求并且接收端报文缓存模块有可用空间时,可将所述数据报文提供给帧标识符删除模块22,帧标识符删除模块22可以将帧标识符封装模块11添加的帧标识符字段删除,并将删除帧标识符字段后的数据报文,即以太网报文,发送至接收端报文缓存模块,成功完成以太网报文的从其它以太网链路控制装置连接的发送端报文缓存模块到本装置连接的接收端报文缓存模块的传输。In one example, the frame identifier deletion module 22 works as follows. When the receiving end distribution module 21 determines that what is received is a data message, and the data message meets the transmission requirements and the receiving end message buffer module has available space, the data message can be provided to the frame identifier deletion module 22, and the frame identifier deletion module 22 can delete the frame identifier field added by the frame identifier encapsulation module 11, and send the data message after the frame identifier field is deleted, that is, the Ethernet message, to the receiving end message buffer module, and successfully complete the transmission of the Ethernet message from the sending end message buffer module connected to other Ethernet link control devices to the receiving end message buffer module connected to this device.

在一个示例中,接收端报文模块23的工作方式如下。当接收端分发模块21确定接收到的是数据报文时,可分为两种情况,一种是接收端分发模块21确定所述数据报文符合传输要求并且接收端报文模块23确定接收端报文缓存模块有可用空间时,接收端报文模块23可生成相应的控制报文。另一种情况是接收端分发模块21确定所述数据报文不符合传输要求和/或接收端报文模块23确定报文缓存模块没有可用空间时,接收端报文模块23可以生成相应的控制报文。两种情况可以生成不同的控制报文,所述控制报文可以提供给本装置的发送端数据选择器15,发送端数据选择器15可以将两种情况生成的控制报文发送给发来所述数据报文的对应的其它以太网链路控制装置。In one example, the receiving end message module 23 works as follows. When the receiving end distribution module 21 determines that what is received is a data message, it can be divided into two situations. One is that when the receiving end distribution module 21 determines that the data message meets the transmission requirements and the receiving end message module 23 determines that the receiving end message buffer module has available space, the receiving end message module 23 can generate a corresponding control message. Another situation is that when the receiving end distribution module 21 determines that the data message does not meet the transmission requirements and/or the receiving end message module 23 determines that the message buffer module has no available space, the receiving end message module 23 can generate a corresponding control message. Different control messages can be generated in the two situations, and the control messages can be provided to the sending end data selector 15 of this device. The sending end data selector 15 can send the control messages generated in the two situations to the corresponding other Ethernet link control devices that sent the data message.

在一种可能的实现方式中,符合传输要求的条件包括所述数据报文的帧标识符正确,并且所述数据报文的循环冗杂校验CRC无误。In a possible implementation, the condition that meets the transmission requirement includes that the frame identifier of the data message is correct and the cyclic redundancy check CRC of the data message is correct.

其中,接收端分发模块21可以先判断接收到的报文是数据报文还是控制报文,当确定是数据报文时,接收端分发模块21可再判断是否符合传输要求。符合传输要求的条件可以包括所述数据报文的帧标识符正确,即可以是接收端报文缓存模块需要的或可接收的帧标识符对应的数据报文,同时所述数据报文的循环冗杂校验CRC无误。通过检查数据报文是否符合传输要求,可以保证数据传输的准确性和完整性。Among them, the receiving end distribution module 21 can first determine whether the received message is a data message or a control message. When it is determined to be a data message, the receiving end distribution module 21 can then determine whether it meets the transmission requirements. The conditions for meeting the transmission requirements may include that the frame identifier of the data message is correct, that is, it can be a data message corresponding to the frame identifier required or receivable by the receiving end message buffer module, and the cyclic redundancy check CRC of the data message is correct. By checking whether the data message meets the transmission requirements, the accuracy and integrity of data transmission can be guaranteed.

图5示出了根据本公开一实施例的六种控制报文的示意图,如图5所示,本装置的发送部件每发送一个数据报文给其它装置,其它装置的接收部件可以反馈一个控制报文给本装置。相似的,本装置每收到一个其它装置的数据报文,可以反馈给其它装置一个控制报文。FIG5 shows a schematic diagram of six control messages according to an embodiment of the present disclosure. As shown in FIG5, each time the sending component of the present device sends a data message to other devices, the receiving component of the other devices can feed back a control message to the present device. Similarly, each time the present device receives a data message from other devices, it can feed back a control message to the other devices.

在一种可能的实现方式中,所述接收端报文模块23生成的控制报文包括:In a possible implementation, the control message generated by the receiving end message module 23 includes:

成功接收PA报文,用于表示数据报文传输成功;当接收端分发模块21判断接收的来自其它以太网链路控制装置的报文为数据报文,所述数据报文符合传输要求并且报文缓存模块有可用空间时,控制接收端报文模块23生成PA报文;当其它以太网链路控制装置接收到所述PA报文时,所述其它以太网链路控制装置的发送端重传控制模块14确定所述数据报文传输成功。Successfully receiving a PA message indicates that the data message transmission is successful; when the receiving end distribution module 21 determines that the message received from other Ethernet link control devices is a data message, and the data message meets the transmission requirements and the message cache module has available space, the receiving end message module 23 is controlled to generate a PA message; when other Ethernet link control devices receive the PA message, the sending end retransmission control module 14 of the other Ethernet link control devices determines that the data message transmission is successful.

其中,PA报文是接收部件中的接收端报文模块23生成的控制报文。当发送部件中的发送端数据选择器15发送数据报文(添加了帧标识符字段的以太网报文),接收部件中的接收端分发模块21接收该数据报文并检查帧标识符和循环冗杂校验,如果没有错误且接收端报文模块23判断接收端报文缓存模块有可用空间,则接收部件中的接收端报文模块23发送PA报文给本装置的发送部件中的发送端数据选择器15,由发送端数据选择器15将PA报文发送给发来所述数据报文的对应的其它以太网链路控制装置。其它以太网链路控制装置可以由接收端分发模块判断该报文为控制报文,并将其提供给发送端重传控制模块,由发送端重传控制模块确定所述数据报文已经传输成功,控制发送端发送端重传缓存模块释放对应的数据报文的缓存空间,进而继续发送其它数据报文。Among them, the PA message is a control message generated by the receiving end message module 23 in the receiving component. When the sending end data selector 15 in the sending component sends a data message (an Ethernet message with a frame identifier field added), the receiving end distribution module 21 in the receiving component receives the data message and checks the frame identifier and the cyclic redundancy check. If there is no error and the receiving end message module 23 determines that the receiving end message buffer module has available space, the receiving end message module 23 in the receiving component sends the PA message to the sending end data selector 15 in the sending component of this device, and the sending end data selector 15 sends the PA message to the corresponding other Ethernet link control device that sent the data message. The receiving end distribution module of other Ethernet link control devices can determine that the message is a control message and provide it to the sending end retransmission control module. The sending end retransmission control module determines that the data message has been successfully transmitted, controls the sending end retransmission buffer module to release the corresponding data message buffer space, and then continues to send other data messages.

需要重传PR报文,用于表示数据报文需要重传;当接收端分发模块21判断接收的来自其它以太网链路控制装置的报文为数据报文,所述数据报文符合传输要求但是报文缓存模块没有可用空间时,控制接收端报文模块23生成PR报文;当其它以太网链路控制装置接收到所述PR报文时,所述其它以太网链路控制装置的发送端重传控制模块14确定所述数据报文需要重传。The PR message needs to be retransmitted, which is used to indicate that the data message needs to be retransmitted; when the receiving end distribution module 21 determines that the message received from other Ethernet link control devices is a data message, and the data message meets the transmission requirements but the message cache module has no available space, the receiving end message module 23 is controlled to generate a PR message; when other Ethernet link control devices receive the PR message, the sending end retransmission control module 14 of the other Ethernet link control devices determines that the data message needs to be retransmitted.

其中,PR报文是接收部件中的接收端报文模块23生成的控制报文。当发送部件中的发送端数据选择器15发送数据报文(添加了帧标识符字段的以太网报文),接收部件中的接收端分发模块21接收该数据报文并检查帧标识符和循环冗杂校验,如果没有错误但接收端报文模块23判断接收端报文缓存模块没有可用空间,则接收部件中的接收端报文模块23发送PR报文给本装置的发送部件中的发送端数据选择器15,由发送端数据选择器15将PR报文发送给发来所述数据报文的对应的其它以太网链路控制装置。其它以太网链路控制装置可以由接收端分发模块判断该报文为控制报文,并将其提供给发送端重传控制模块,由发送端重传控制模块确定所述数据报文需要重传,控制发送端发送端重传缓存模块提供对应的数据报文给发送端数据选择器,进而重新发送该数据报文。Among them, the PR message is a control message generated by the receiving end message module 23 in the receiving component. When the sending end data selector 15 in the sending component sends a data message (an Ethernet message with a frame identifier field added), the receiving end distribution module 21 in the receiving component receives the data message and checks the frame identifier and the cyclic redundancy check. If there is no error but the receiving end message module 23 determines that the receiving end message buffer module has no available space, the receiving end message module 23 in the receiving component sends the PR message to the sending end data selector 15 in the sending component of this device, and the sending end data selector 15 sends the PR message to the corresponding other Ethernet link control device that sent the data message. The receiving end distribution module of other Ethernet link control devices can determine that the message is a control message and provide it to the sending end retransmission control module. The sending end retransmission control module determines that the data message needs to be retransmitted, controls the sending end retransmission buffer module to provide the corresponding data message to the sending end data selector, and then retransmits the data message.

未成功接收PNA报文,用于表示数据报文需要重传;当接收端分发模块21判断接收的来自其它以太网链路控制装置的报文为数据报文,所述数据报文不符合传输要求时,控制接收端报文模块23生成PNA报文;当其它以太网链路控制装置接收到所述PNA报文时,所述其它以太网链路控制装置的发送端重传控制模块14确定所述数据报文需要重传。The PNA message is not successfully received, indicating that the data message needs to be retransmitted; when the receiving end distribution module 21 determines that the message received from other Ethernet link control devices is a data message and the data message does not meet the transmission requirements, the receiving end message module 23 is controlled to generate a PNA message; when other Ethernet link control devices receive the PNA message, the sending end retransmission control module 14 of the other Ethernet link control devices determines that the data message needs to be retransmitted.

其中,PNA报文是接收部件中的接收端报文模块23生成的控制报文。当发送部件中的发送端数据选择器15发送数据报文(添加了帧标识符字段的以太网报文),接收部件中的接收端分发模块21接收该数据报文并检查帧标识符和循环冗杂校验,如果有错误,则接收部件中的接收端报文模块23发送PNA报文给本装置的发送部件中的发送端数据选择器15,由发送端数据选择器15将PNA报文发送给发来所述数据报文的对应的其它以太网链路控制装置。其它以太网链路控制装置可以由接收端分发模块判断该报文为控制报文,并将其提供给发送端重传控制模块,由发送端重传控制模块确定所述数据报文需要重传,控制发送端发送端重传缓存模块提供对应的数据报文给发送端数据选择器,进而重新发送该数据报文。Among them, the PNA message is a control message generated by the receiving end message module 23 in the receiving component. When the sending end data selector 15 in the sending component sends a data message (an Ethernet message with a frame identifier field added), the receiving end distribution module 21 in the receiving component receives the data message and checks the frame identifier and cyclic redundancy check. If there is an error, the receiving end message module 23 in the receiving component sends the PNA message to the sending end data selector 15 in the sending component of this device, and the sending end data selector 15 sends the PNA message to the corresponding other Ethernet link control device that sent the data message. The receiving end distribution module of the other Ethernet link control device can determine that the message is a control message and provide it to the sending end retransmission control module. The sending end retransmission control module determines that the data message needs to be retransmitted, controls the sending end retransmission buffer module to provide the corresponding data message to the sending end data selector, and then retransmits the data message.

在一种可能的实现方式中,当所述接收部件的接收端报文模块23根据接收端分发模块21的指示发送PR报文或PNA报文后,所述接收部件进入重传等待状态。当所述接收部件在重传等待状态时,所述接收部件的接收端分发模块21不再接收来自其它以太网链路控制装置的数据报文。In a possible implementation, after the receiving end message module 23 of the receiving component sends a PR message or a PNA message according to the instruction of the receiving end distribution module 21, the receiving component enters a retransmission waiting state. When the receiving component is in the retransmission waiting state, the receiving end distribution module 21 of the receiving component no longer receives data messages from other Ethernet link control devices.

其中,在接收部件在重传等待状态时,接收端分发模块21可以不接收来自其它以太网链路控制装置的数据报文,但是可以接收来自其它以太网链路控制装置的部分控制报文,比如解除重传状态RFR报文和请求链路状态LReq报文。Among them, when the receiving component is in the retransmission waiting state, the receiving end distribution module 21 may not receive data packets from other Ethernet link control devices, but may receive some control packets from other Ethernet link control devices, such as the release retransmission state RFR packet and the request link state LReq packet.

在一种可能的实现方式中,发送端报文模块生成的控制报文包括:In a possible implementation, the control message generated by the message module at the sending end includes:

解除重传状态RFR报文,用于解除接收部件的重传等待状态;当发送端重传控制模块14接收到来自其它以太网链路控制装置的PR报文或PNA报文时,确定数据报文需要重传,控制发送端报文模块13生成RFR报文;当其它以太网链路控制装置接收到所述RFR报文时,所述其它以太网链路控制装置的接收部件解除重传等待状态,恢复接收来自其它以太网链路控制装置的数据报文。The RFR message for releasing the retransmission state is used to release the retransmission waiting state of the receiving component; when the sending end retransmission control module 14 receives the PR message or the PNA message from other Ethernet link control devices, it determines that the data message needs to be retransmitted, and controls the sending end message module 13 to generate an RFR message; when other Ethernet link control devices receive the RFR message, the receiving components of the other Ethernet link control devices release the retransmission waiting state and resume receiving data messages from other Ethernet link control devices.

其中,来自其它以太网链路控制装置的控制报文可以带来两种信息,一种是数据报文需要重传,即控制报文为PR报文或PNA报文,一种是数据报文传输成功,即控制报文为PA报文。当其它以太网链路控制装置发送PR报文或PNA报文后,该装置的接收部件可能会进入重传等待状态,此时给该装置发送RFR报文可以解除它的重传等待状态,可以让它继续接收本装置后续给它重新发送的数据报文。简单来说,在本装置接收到来自其它以太网链路控制装置的PR报文或PNA报文后,可以先给其它以太网链路控制装置发送RFR报文解除其重传等待状态,然后根据PR报文或PNA报文的信息重新发送对应的数据报文给该装置。由此可见,本公开可以逐个处理出现问题的以太网报文,如果出错可以立刻处理当前有问题的以太网报文,能及时保障数据传输的准确性和可靠性。Among them, the control message from other Ethernet link control devices can bring two kinds of information, one is that the data message needs to be retransmitted, that is, the control message is a PR message or a PNA message, and the other is that the data message is successfully transmitted, that is, the control message is a PA message. When other Ethernet link control devices send PR messages or PNA messages, the receiving component of the device may enter a retransmission waiting state. At this time, sending an RFR message to the device can release its retransmission waiting state, allowing it to continue to receive the data message resent to it by this device later. In short, after the device receives a PR message or a PNA message from other Ethernet link control devices, it can first send an RFR message to the other Ethernet link control device to release its retransmission waiting state, and then resend the corresponding data message to the device according to the information of the PR message or the PNA message. It can be seen from this that the present disclosure can process problematic Ethernet messages one by one, and if an error occurs, the current problematic Ethernet message can be processed immediately, which can timely ensure the accuracy and reliability of data transmission.

在一种可能的实现方式中,发送端报文模块13生成的控制报文还包括:In a possible implementation, the control message generated by the sending end message module 13 further includes:

请求链路状态LReq报文,用于请求了解接收部件的状态;当发送端重传控制模块14至少两次(次数可根据需要设置)接收到来自其它以太网链路控制装置的同一个帧标识符的PNA报文时,发送端重传控制模块14控制发送端报文模块13生成LReq报文。其中,当所述以太网链路控制装置与其它以太网链路控制装置首次建立连接时,主动生成并发送LReq报文。The link status request LReq message is used to request to know the status of the receiving component; when the sending end retransmission control module 14 receives the PNA message with the same frame identifier from other Ethernet link control devices at least twice (the number can be set as needed), the sending end retransmission control module 14 controls the sending end message module 13 to generate an LReq message. When the Ethernet link control device establishes a connection with other Ethernet link control devices for the first time, it actively generates and sends the LReq message.

在一种可能的实现方式中,当其它以太网链路控制装置接收到所述LReq报文时,所述其它以太网链路控制装置的接收端分发模块指示接收端报文模块生成的控制报文包括:In a possible implementation, when the other Ethernet link control device receives the LReq message, the receiving end distribution module of the other Ethernet link control device instructs the receiving end message module to generate a control message including:

回复链路状态LRsp报文,用于反馈接收部件的状态;当接收端分发模块接收到来自其它以太网链路控制装置的LReq报文时,控制接收端报文模块生成LRsp报文;其中,LRsp报文中包括所需的数据报文的帧标识符。Reply link status LRsp message to feedback the status of the receiving component; when the receiving end distribution module receives the LReq message from other Ethernet link control devices, it controls the receiving end message module to generate an LRsp message; wherein the LRsp message includes the frame identifier of the required data message.

其中,当本装置发送端重传控制模块14至少两次接收到来自其它以太网链路控制装置的同一个帧标识符的PNA报文时,由于PNA报文表示之前发送过去的数据报文不符合传输要求,可能由于帧标识符错误或循环冗杂校验错误,本装置不清楚具体情况,所以本装置发送部件的发送报文模块13可以发送LReq报文,用于请求了解其它装置接收部件的状态,其它装置接收部件的接收端报文模块23在接收到后可以生成LRsp报文进行反馈,所述LRsp报文中可以包括所需的数据报文的帧标识符,可向本装置表明其它装置所期望得到哪个帧标识符的数据报文。Among them, when the retransmission control module 14 of the sending end of this device receives the PNA message with the same frame identifier from other Ethernet link control devices at least twice, because the PNA message indicates that the data message sent before does not meet the transmission requirements, it may be due to a frame identifier error or a cyclic redundancy check error. The present device is not clear about the specific situation, so the sending message module 13 of the sending component of this device can send an LReq message to request to understand the status of the receiving component of other devices. After receiving the receiving end message module 23 of the receiving component of other devices, it can generate an LRsp message for feedback. The LRsp message can include the frame identifier of the required data message, which can indicate to the present device which frame identifier data message other devices expect to obtain.

其中,当与其它以太网链路控制装置首次建立连接时,本装置和其它装置互相不清楚对方的状态,本装置发送部件的发送报文模块13也可以主动发送LReq报文,用于请求了解其它装置接收部件的状态,其它装置接收部件的接收端报文模块23在接收到后可以生成LRsp进行反馈,所述LRsp报文中可以包括所需的数据报文的帧标识符,可向本装置表明其它装置所期望得到哪个帧标识符的数据报文。Among them, when the connection is established with other Ethernet link control devices for the first time, the present device and the other devices are not clear about each other's status. The sending message module 13 of the sending component of the present device can also actively send an LReq message to request to know the status of the receiving component of the other device. The receiving end message module 23 of the receiving component of the other device can generate an LRsp for feedback after receiving it. The LRsp message can include the frame identifier of the required data message, which can indicate to the present device which data message with which frame identifier the other device expects to obtain.

其中,当本装置的发送端重传控制模块14从LRsp报文中确定其它装置需要哪个数据报文后,可以控制发送端重传缓存模块将所述数据报文提供给本装置的发送端数据选择器15,由发送端数据选择器15发送给对应的其它以太网链路控制装置。Among them, when the sending end retransmission control module 14 of this device determines which data message other devices need from the LRsp message, it can control the sending end retransmission cache module to provide the data message to the sending end data selector 15 of this device, and the sending end data selector 15 sends it to the corresponding other Ethernet link control devices.

相似地,本装置接收部件接收到来自其它以太网链路控制装置的LReq报文时,反馈LRsp报文,所述LRsp报文中包括所需的数据报文的帧标识符,用于向其它装置表明本装置所期望得到哪个帧标识符的数据报文,同时可以解除自身的由于发送PNA报文而进入的重传等待状态,然后可以接收其它装置重新发来的数据报文,实现数据报文在多个以太网链路控制装置之间的同步。Similarly, when the receiving component of this device receives an LReq message from other Ethernet link control devices, it feeds back an LRsp message, wherein the LRsp message includes the frame identifier of the required data message, and is used to indicate to other devices which data message with which frame identifier this device expects to obtain. At the same time, it can release its own retransmission waiting state due to sending a PNA message, and then it can receive the data messages resent by other devices, thereby realizing the synchronization of data messages between multiple Ethernet link control devices.

在一种可能的实现方式中,所述装置还包括备用通道Bypass。所述备用通道用于将以太网报文提供给发送端数据选择器,以发送至其它以太网链路控制装置。In a possible implementation, the device further includes a backup channel Bypass. The backup channel is used to provide the Ethernet message to the transmitting end data selector to send it to other Ethernet link control devices.

其中,所诉备用通道可以相当于跳过以太网链路控制模块,在实际应用中有两种通道,可以使用备用通道,即工作在传统以太网下进行数据传输(发送的时候不用添加帧标识符直接发送,接收的时候也不用删除帧标识符直接接收到报文缓存模块里),也可以不使用备用通道,即使用本公开的以太网链路控制装置。Among them, the backup channel mentioned can be equivalent to skipping the Ethernet link control module. In actual applications, there are two channels. The backup channel can be used, that is, data transmission can be performed under the traditional Ethernet (no frame identifier needs to be added when sending, and the frame identifier does not need to be deleted when receiving, and it is directly received into the message cache module). Alternatively, the backup channel may not be used, that is, the Ethernet link control device disclosed in the present invention is used.

图7示出了根据本公开一实施例的控制报文的传输与反馈的流程图。其中,Tx为本装置发送部件,Rx为其它装置接收部件,Msg为数据报文。Fig. 7 shows a flow chart of transmission and feedback of control messages according to an embodiment of the present disclosure, wherein Tx is a sending component of the device, Rx is a receiving component of other devices, and Msg is a data message.

如图8所示,在链路建立之后,本装置发送部件可以主动发送LReq报文,请求其它以太网链路控制装置的状态。其它装置的接收部件接收到LReq报文后,可以回复LRsp报文(见图7(a))。如果本装置在规定时间内接收到LRsp报文,则可以继续正常使用本装置;否则,工作在传统以太网模式,可以通过备用通道跳过本装置。当本装置发送端在规定时间内接收到LRsp报文时,对其中所包含的帧标识符字段进行解析,确定对应的数据报文并发送给其它装置,完成同步。As shown in Figure 8, after the link is established, the sending component of this device can actively send an LReq message to request the status of other Ethernet link control devices. After receiving the LReq message, the receiving component of other devices can reply with an LRsp message (see Figure 7(a)). If this device receives the LRsp message within the specified time, it can continue to use the device normally; otherwise, it works in the traditional Ethernet mode and can skip the device through the backup channel. When the sending end of this device receives the LRsp message within the specified time, it parses the frame identifier field contained therein, determines the corresponding data message and sends it to other devices to complete the synchronization.

本装置发送部件将添加了帧标识符的以太网报文,即数据报文Msg,发送至其它装置的接收部件,接收部件可以确认帧标识符和循环冗杂校验是否正确,如果是正确的,可以将帧标识符字段删除,得到以太网报文,然后可将所述以太网报文发送到接收端报文缓存模块,同时可以发送PA报文到本装置发送端(见图7(b)),发送部件在接收到PA报文后可删除缓存的发送成功的数据报文,然后发送部件可以继续发送下一个帧标识符的数据报文。The sending component of this device sends the Ethernet message with the frame identifier added, that is, the data message Msg, to the receiving component of other devices. The receiving component can confirm whether the frame identifier and the cyclic redundancy check are correct. If they are correct, the frame identifier field can be deleted to obtain the Ethernet message, and then the Ethernet message can be sent to the receiving end message cache module. At the same time, the PA message can be sent to the sending end of this device (see Figure 7(b)). After receiving the PA message, the sending component can delete the cached data message that has been successfully sent, and then the sending component can continue to send the data message with the next frame identifier.

当其它装置接收端报文缓存模块缓存资源不足时,其它装置接收部件可以发送PR报文。如果帧标识符和/或循环冗杂校验错误,可以发送PNA报文。当接收端发送PNA/PR报文后,其它装置的接收部件进入重传等待状态。在重传等待状态下,可以不接收数据报文,但可以接收RFR报文或LReq报文。当接收到RFR时,可以退出重传状态,重新接收新的报文(见图7(c))。或者接收到LReq报文后反馈给本装置LRsp报文,同时其它装置接收端可以退出重传状态,等待数据报文到达。When the cache resources of the message cache module of the receiving end of other devices are insufficient, the receiving components of other devices can send PR messages. If the frame identifier and/or cyclic redundancy check are wrong, a PNA message can be sent. After the receiving end sends the PNA/PR message, the receiving components of other devices enter the retransmission waiting state. In the retransmission waiting state, data messages may not be received, but RFR messages or LReq messages may be received. When RFR is received, the retransmission state can be exited and new messages can be received again (see Figure 7(c)). Or after receiving the LReq message, the LRsp message is fed back to this device. At the same time, the receiving end of other devices can exit the retransmission state and wait for the arrival of data messages.

当本装置发送部件接收到PNA/PR报文时,可以立刻停止当前数据报文的发送,首先发送RFR报文,然后重传相应的缓存的数据报文。当发送部件至少两次收到同一个帧标识符对应的PNA报文时,发送LReq报文,请求了解其它装置的状态(见图7(d))。When the sending component of the device receives a PNA/PR message, it can immediately stop sending the current data message, first send an RFR message, and then retransmit the corresponding cached data message. When the sending component receives a PNA message corresponding to the same frame identifier at least twice, it sends an LReq message to request to know the status of other devices (see Figure 7 (d)).

图8示出了根据本公开一实施例的两个以太网链路控制装置之间传输报文的框图。FIG8 shows a block diagram of message transmission between two Ethernet link control devices according to an embodiment of the present disclosure.

如图8所示,当以太网链路控制装置A给以太网链路控制装置B发送以太网报文时的流程可以为:As shown in FIG8 , the process when the Ethernet link control device A sends an Ethernet message to the Ethernet link control device B may be:

在发送部件A中:帧标识符封装模块A11从发送端报文缓存模块A中获取以太网报文,加上帧标识符字段得到一个数据报文,将所述数据报文发送至发送端数据选择器A15中,同时也缓存至发送端重传缓存模块A12中,发送端数据选择器A15将该数据报文发送至以太网链路控制装置B中接收部件B的接收端分发模块B41。In the sending component A: the frame identifier encapsulation module A11 obtains the Ethernet message from the sending end message cache module A, adds the frame identifier field to obtain a data message, and sends the data message to the sending end data selector A15, and also caches it in the sending end retransmission cache module A12. The sending end data selector A15 sends the data message to the receiving end distribution module B41 of the receiving component B in the Ethernet link control device B.

在接收部件B中:接收端分发模块B41接收所述数据报文,首先接收端分发模块B41可以判断接收到的报文是数据报文还是控制报文,此时接收到的是数据报文,接收端分发模块B41再判断帧标识符和循环冗杂校验是否正确,如果二者中有一者或二者不正确,接收端报文模块B43可以生成PNA报文。如果帧标识符和循环冗杂校验都没有问题,接收端报文模块B43可以再判断接收端报文缓存模块B是否有可用空间,如果没有可用空间,接收端报文模块B43可用生成PR报文,并且接收端分发模块B41可以将该数据报文丢弃。如果有可用空间,接收端报文模块B43可以生成PA报文,并且接收端分发模块B41可以将该数据报文提供给帧标识符删除模块B42,删除其帧标识符后存入接收端报文缓存模块B中,可以成功实现该以太网报文的传输。上述PA/PR/PNA报文可以提供给发送部件B的发送端数据选择器B35中,值得注意的是,当发送PNA/PR报文后接收部件B进入重传等待状态。In the receiving component B: the receiving end distribution module B41 receives the data message. First, the receiving end distribution module B41 can determine whether the received message is a data message or a control message. At this time, the received message is a data message. The receiving end distribution module B41 then determines whether the frame identifier and the cyclic redundancy check are correct. If one or both of them are incorrect, the receiving end message module B43 can generate a PNA message. If there are no problems with the frame identifier and the cyclic redundancy check, the receiving end message module B43 can then determine whether there is available space in the receiving end message cache module B. If there is no available space, the receiving end message module B43 can generate a PR message, and the receiving end distribution module B41 can discard the data message. If there is available space, the receiving end message module B43 can generate a PA message, and the receiving end distribution module B41 can provide the data message to the frame identifier deletion module B42, and store it in the receiving end message cache module B after deleting its frame identifier, so that the transmission of the Ethernet message can be successfully realized. The above PA/PR/PNA message can be provided to the transmitting end data selector B35 of the transmitting component B. It is worth noting that after sending the PNA/PR message, the receiving component B enters the retransmission waiting state.

在发送部件B中:发送端数据选择器B35收到PA/PR/PNA报文,将其发送至以太网链路控制装置A中接收部件A中的接收端分发模块A21。In the sending component B: the sending end data selector B35 receives the PA/PR/PNA message and sends it to the receiving end distribution module A21 in the receiving component A in the Ethernet link control device A.

在接收部件A中:接收端分发模块A21收到来自以太网链路控制装置B的报文,首先接收端分发模块A21可以判断接收到的报文是数据报文还是控制报文,此时是控制报文,接收端分发模块A21可以将所述控制报文提供给发送部件A的发送端重传控制模块A14。In the receiving component A: the receiving end distribution module A21 receives a message from the Ethernet link control device B. First, the receiving end distribution module A21 can determine whether the received message is a data message or a control message. In this case, it is a control message. The receiving end distribution module A21 can provide the control message to the sending end retransmission control module A14 of the sending component A.

在发送部件A中:如果发送端重传控制模块A14接收到的PA报文,则发送端重传控制模块A14可以控制发送端重传缓存模块A12释放刚才发送的数据报文的缓存空间(即删除缓存);如果接收到的是PR/PNA报文。则发送端重传控制模块A14控制发送端重传缓存模块A12找出刚才发送的数据报文并将其提供给发送端数据选择器A15,并且发送端重传控制模块A14还可以控制发送端报文模块A13生成RFR报文提供给发送端数据选择器A15,由发送端数据选择器A15可以先发送RFR报文解除接收部件B的重传等待状态,然后可以将数据报文重新发送至接收部件B的接收端分发模块B41中再次进行判断。In the sending component A: if the PA message is received by the sending end retransmission control module A14, the sending end retransmission control module A14 can control the sending end retransmission buffer module A12 to release the buffer space of the data message just sent (i.e. delete the buffer); if the PR/PNA message is received, the sending end retransmission control module A14 controls the sending end retransmission buffer module A12 to find the data message just sent and provide it to the sending end data selector A15, and the sending end retransmission control module A14 can also control the sending end message module A13 to generate an RFR message and provide it to the sending end data selector A15, and the sending end data selector A15 can first send an RFR message to release the retransmission waiting state of the receiving component B, and then resend the data message to the receiving end distribution module B41 of the receiving component B for further judgment.

其中,如果以太网链路装置B至少两次发送针对同一个帧标识符的PNA报文的话以太网链路装置A的发送端重传控制模块A14可以控制发送端报文模块A13生成LReq报文,发送至装置B的接收端分发模块B41,接收端分发模块B41判断其为控制报文,将其提供给发送端重传控制模块B34,发送端重传控制模块B34可以控制发送端报文模块B33生成LRsp报文,将LRsp报文提供给发送端数据选择器B35,发送至装置A的接收端分发模块A21,接收端分发模块A21判断其为控制报文,将其提供到发送端重传控制模块A14,发送端重传控制模块A14可以控制发送端重传缓存模块A12找出LRsp报文中指示的数据报文并将所述数据报文提供给发送端数据选择器A15,发送端数据选择器A15可以将所述数据报文发给装置B。Among them, if the Ethernet link device B sends a PNA message for the same frame identifier at least twice, the sending end retransmission control module A14 of the Ethernet link device A can control the sending end message module A13 to generate an LReq message, and send it to the receiving end distribution module B41 of the device B. The receiving end distribution module B41 determines that it is a control message and provides it to the sending end retransmission control module B34. The sending end retransmission control module B34 can control the sending end message module B33 to generate an LRsp message, and provide the LRsp message to the sending end data selector B35, and send it to the receiving end distribution module A21 of the device A. The receiving end distribution module A21 determines that it is a control message and provides it to the sending end retransmission control module A14. The sending end retransmission control module A14 can control the sending end retransmission buffer module A12 to find the data message indicated in the LRsp message and provide the data message to the sending end data selector A15. The sending end data selector A15 can send the data message to the device B.

同理,也可以在多个以太网链路控制装置之间传输报文,流程同上,此时某一装置的发送端数据选择器中可能包括:来自本装置帧标识符封装模块的数据报文,来自本装置发送端重传缓存模块的数据报文,来自本装置发送端报文模块的控制报文,来自本装置接收端报文模块的控制报文,来自发送端报文缓存模块通过备用通道而来的以太网报文。发送端数据选择器会根据实际应用情况选择其中一种报文发送给对应的其它以太网链路控制装置。Similarly, messages can also be transmitted between multiple Ethernet link control devices, and the process is the same as above. At this time, the data selector of the sending end of a device may include: data messages from the frame identifier encapsulation module of this device, data messages from the sending end retransmission buffer module of this device, control messages from the sending end message module of this device, control messages from the receiving end message module of this device, and Ethernet messages from the sending end message buffer module through the backup channel. The sending end data selector will select one of the messages according to the actual application situation and send it to the corresponding other Ethernet link control devices.

其中,多个装置之间互相发送控制报文,通过控制报文执行相应操作,实现了以太网链路之间的协商和同步功能,同时控制报文和数据报文中含有独一无二的帧标识符字段,能精准地实现流量控制和错误重传。Among them, multiple devices send control messages to each other and perform corresponding operations through control messages, realizing the negotiation and synchronization functions between Ethernet links. At the same time, the control messages and data messages contain unique frame identifier fields, which can accurately realize flow control and error retransmission.

其中,发送端重传缓存模块12、发送端报文模块13、发送端重传控制模块14、接收端报文模块23可以集合成一个控制报文的生成及处理模块。控制报文的生成及处理模块可以基于CGRA(Coarse-grained Reconfigurable Array,可重构阵列)实现。CGRA是一种空域上的并行计算模式,以空域的硬件结构组织不同粒度和不同功能的计算资源。在运行时,根据数据流的特点,让配置好的硬件资源互连形成相对固定的计算通路,以接近“专用电路”的方式进行计算;当算法和应用变换时,再次通过配置,重构为不同的计算通路去执行不同的任务。可以在没有传统指令驱动的计算架构中取指和译码操作的延时和能耗开销,也可以在在计算过程中以接近“专用电路”的方式执行。此外,CGRA架构算力可以弹性扩展,适用于从云端到边缘端中对高能效和灵活性有综合要求的场景。Among them, the sending end retransmission cache module 12, the sending end message module 13, the sending end retransmission control module 14, and the receiving end message module 23 can be combined into a control message generation and processing module. The control message generation and processing module can be implemented based on CGRA (Coarse-grained Reconfigurable Array). CGRA is a parallel computing mode in the airspace, which organizes computing resources of different granularities and functions with the hardware structure of the airspace. At run time, according to the characteristics of the data flow, the configured hardware resources are interconnected to form a relatively fixed computing path, and the calculation is performed in a manner close to a "dedicated circuit"; when the algorithm and application change, they are reconfigured again to perform different tasks through configuration. The delay and energy consumption overhead of instruction fetch and decoding operations can be reduced in the computing architecture without the traditional instruction-driven operation, and can also be executed in a manner close to a "dedicated circuit" during the computing process. In addition, the computing power of the CGRA architecture can be flexibly expanded, which is suitable for scenarios with comprehensive requirements for high energy efficiency and flexibility from the cloud to the edge.

其中,在本公开一具体实施例中,在单工模式下,连续发了3220个报文,没有丢包。满速带宽为102.4GB/s,带宽利用率为79.03%,平均带宽为80.93GB/s;在双工模式下,连续收发了3287个报文,没有丢包。带宽利用率为68.92%,平均带宽为70.58GB/s。工作效率较传统以太网MAC控制器有大幅提高,同时本公开还增加了报文重传缓存和处理功能,通过自定义控制报文实现流量控制和错误重传,保障数据的可靠传输。Among them, in a specific embodiment of the present disclosure, in simplex mode, 3220 messages were sent continuously without packet loss. The full-speed bandwidth is 102.4GB/s, the bandwidth utilization rate is 79.03%, and the average bandwidth is 80.93GB/s; in duplex mode, 3287 messages were sent and received continuously without packet loss. The bandwidth utilization rate is 68.92%, and the average bandwidth is 70.58GB/s. The working efficiency is greatly improved compared with the traditional Ethernet MAC controller. At the same time, the present disclosure also adds message retransmission caching and processing functions, realizes flow control and error retransmission through custom control messages, and ensures reliable data transmission.

需要说明的是,尽管以图3、4、5作为示例介绍了一种以太网链路控制装置生成的数据/控制报文如上,但本领域技术人员能够理解,本公开应不限于此。事实上,完全可根据个人情况和/或实际应用场景灵活设定相应的报文。同时,尽管以图2、6、7、8作为示例介绍了一种以太网链路控制装置如上,但本领域技术人员能够理解,本公开应不限于此。事实上,也可以根据个人情况和/或实际应用场景灵活使用、组装各模块,不限于本示例给出的内容。It should be noted that, although Figures 3, 4, and 5 are used as examples to introduce a data/control message generated by an Ethernet link control device as above, those skilled in the art will understand that the present disclosure should not be limited to this. In fact, the corresponding message can be flexibly set according to personal circumstances and/or actual application scenarios. At the same time, although Figures 2, 6, 7, and 8 are used as examples to introduce an Ethernet link control device as above, those skilled in the art will understand that the present disclosure should not be limited to this. In fact, the modules can also be flexibly used and assembled according to personal circumstances and/or actual application scenarios, and are not limited to the contents given in this example.

本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述装置。计算机可读存储介质可以是易失性或非易失性计算机可读存储介质。The embodiment of the present disclosure also provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above-mentioned device is implemented. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

本公开实施例还提出一种以太网链路控制装置,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为在执行所述存储器存储的指令时,实现上述装置。The embodiment of the present disclosure further proposes an Ethernet link control device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above device when executing the instructions stored in the memory.

本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器实现上述装置。The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device implements the above-mentioned apparatus.

附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and/or flow chart, and the combination of the square boxes in the block diagram and/or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (9)

1. An ethernet link control device, comprising a transmitting means, the transmitting means comprising:
The frame identifier encapsulation module is used for acquiring an Ethernet message, adding a frame identifier field into the Ethernet message to obtain a data message, and providing the data message to the data selector at the transmitting end and the retransmission buffer module at the transmitting end;
the transmitting end retransmission buffer module is used for buffering the data message; providing corresponding data messages to a data selector of a transmitting end according to the indication of a retransmission control module of the transmitting end, or releasing the buffer space of the corresponding data messages;
The transmitting end message module is used for generating a control message according to the indication of the transmitting end retransmission control module and providing the control message to the transmitting end data selector;
The transmitting end retransmission control module is used for controlling the transmitting end retransmission buffer module and the transmitting end message module; when the data message is determined to need to be retransmitted according to the control messages from other Ethernet link control devices, a control transmitting end retransmission buffer module provides the corresponding data message for a transmitting end data selector, and a control transmitting end message module generates the corresponding control message and provides the control message for the transmitting end data selector; when the successful transmission of the data message is determined according to the control messages from other Ethernet link control devices, the retransmission buffer module of the transmitting end is controlled to release the buffer space of the corresponding data message;
a transmitting end data selector, configured to transmit a data packet and/or a control packet generated by the ethernet link control device to other ethernet link control devices;
the device is connected with an Ethernet MAC and message buffer module:
the frame identifier encapsulation module acquires an Ethernet message from the message cache module;
the transmitting end data selector transmits data messages and/or control messages to other Ethernet link control devices through the Ethernet MAC;
the apparatus further comprises a receiving means comprising:
The receiving end distribution module is used for receiving messages from other Ethernet link control devices and judging whether the messages are data messages or control messages; when the message is a data message, the message buffer module is used for judging whether the data message meets the transmission requirement, and when the data message meets the transmission requirement and has available space, the data message is provided for the frame identifier deleting module to control the receiving end message module to generate a corresponding control message to be provided for the transmitting end data selector; if the transmission requirement is not met and/or the message buffer module has no available space, the message buffer module is used for controlling the receiving end message module to generate a corresponding control message so as to be provided for the transmitting end data selector; when the message is a control message, the message is used for providing the control message to a retransmission control module of a transmitting end;
A frame identifier deleting module for deleting the frame identifier field added in the data message;
The receiving end message module is used for generating a corresponding control message according to the indication of the receiving end distribution module and providing the control message to the transmitting end data selector;
The control message generated by the receiving end message module comprises:
Successfully receiving the PA message, wherein the PA message is used for indicating that the data message is successfully transmitted; when a receiving end distribution module judges that received messages from other Ethernet link control devices are data messages, the data messages meet transmission requirements and a message buffer module has available space, the receiving end message module is controlled to generate PA messages; when other Ethernet link control devices receive the PA message, a transmitting end retransmission control module of the other Ethernet link control devices determines that the data message is successfully transmitted;
PR message needs to be retransmitted to indicate that data message needs to be retransmitted; when the receiving end distribution module judges that the received message from other Ethernet link control devices is a data message, and the data message accords with the transmission requirement but the message buffer module has no available space, the receiving end message module is controlled to generate a PR message; when other Ethernet link control devices receive the PR message, a transmitting end retransmission control module of the other Ethernet link control devices determines that the data message needs to be retransmitted;
The unsuccessful receiving PNA message is used for indicating that the data message needs to be retransmitted; when the receiving end distribution module judges that the received message from other Ethernet link control devices is a data message, and the data message does not accord with the transmission requirement, the receiving end message module is controlled to generate a PNA message; when other Ethernet link control devices receive the PNA message, a transmitting end retransmission control module of the other Ethernet link control devices determines that the data message needs to be retransmitted.
2. The ethernet link control device of claim 1 wherein the condition for meeting transmission requirements includes that the frame identifier of the data message is correct and that the cyclic redundancy check, CRC, of the data message is error free.
3. The Ethernet link control device of claim 1, wherein,
After a receiving end message module of the receiving part sends PR message or PNA message according to the indication of a receiving end distribution module, the receiving part enters a retransmission waiting state;
when the receiving part is in a retransmission waiting state, a receiving end distribution module of the receiving part does not receive data messages from other Ethernet link control devices.
4. The ethernet link control device according to claim 1, wherein the control message generated by the sender message module comprises:
Releasing the retransmission state RFR message, which is used for releasing the retransmission waiting state of the receiving component; when a transmitting end retransmission control module receives PR messages or PNA messages from other Ethernet link control devices, determining that the data messages need to be retransmitted, and controlling a transmitting end message module to generate RFR messages; when the other Ethernet link control device receives the RFR message, the receiving part of the other Ethernet link control device releases the retransmission waiting state and resumes receiving the data message from the other Ethernet link control device.
5. The ethernet link control device according to claim 1, wherein the control message generated by the sender message module further comprises:
A request link state LReq message for requesting knowledge of the state of the receiving element; when the transmitting end retransmission control module receives PNA messages with the same frame identifier from other Ethernet link control devices at least twice, the transmitting end retransmission control module controls the transmitting end message module to generate LReq messages;
When the ethernet link control device establishes connection with other ethernet link control devices for the first time, a LReq message is actively generated and sent.
6. The ethernet link control device of claim 5 wherein the receiving end distribution module of the other ethernet link control device indicates the control message generated by the receiving end message module when the other ethernet link control device receives the LReq message comprises:
A reply link state LRsp message for feeding back the state of the receiving component; when the receiving end distribution module receives LReq messages from other Ethernet link control devices, the receiving end message module is controlled to generate LRsp messages; wherein LRsp messages include the frame identifier of the required data message.
7. The ethernet link control device of claim 1 further comprising a backup tunnel for providing ethernet messages to the sender data selector for transmission to other ethernet link control devices.
8. An ethernet link control device, comprising:
a processor;
a memory for storing processor-executable instructions;
Wherein the processor is configured to implement the apparatus of any one of claims 1 to 7 when executing the instructions stored by the memory.
9. A non-transitory computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the apparatus of any of claims 1 to 7.
CN202211496316.5A 2022-11-24 2022-11-24 Ethernet link control device and storage medium Active CN116032421B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211496316.5A CN116032421B (en) 2022-11-24 2022-11-24 Ethernet link control device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211496316.5A CN116032421B (en) 2022-11-24 2022-11-24 Ethernet link control device and storage medium

Publications (2)

Publication Number Publication Date
CN116032421A CN116032421A (en) 2023-04-28
CN116032421B true CN116032421B (en) 2024-07-23

Family

ID=86074885

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211496316.5A Active CN116032421B (en) 2022-11-24 2022-11-24 Ethernet link control device and storage medium

Country Status (1)

Country Link
CN (1) CN116032421B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116582220A (en) * 2023-05-06 2023-08-11 中国人民解放军战略支援部队信息工程大学 Device and method for reliable transmission at Ethernet link level

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102075436A (en) * 2011-02-10 2011-05-25 成都市华为赛门铁克科技有限公司 Ethernet, and data transmitting method and device thereof
CN112865931A (en) * 2020-12-30 2021-05-28 京信网络系统股份有限公司 Data retransmission processing method, device, equipment and readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10404625B2 (en) * 2013-10-29 2019-09-03 Intel Corporation Ethernet enhancements
CN114844842A (en) * 2022-05-07 2022-08-02 湖南戎腾网络科技有限公司 Data transmission method, device, electronic device and readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102075436A (en) * 2011-02-10 2011-05-25 成都市华为赛门铁克科技有限公司 Ethernet, and data transmitting method and device thereof
CN112865931A (en) * 2020-12-30 2021-05-28 京信网络系统股份有限公司 Data retransmission processing method, device, equipment and readable storage medium

Also Published As

Publication number Publication date
CN116032421A (en) 2023-04-28

Similar Documents

Publication Publication Date Title
US11063884B2 (en) Ethernet enhancements
US11991072B2 (en) System and method for facilitating efficient event notification management for a network interface controller (NIC)
US9379852B2 (en) Packet recovery method, communication system, information processing device, and program
RU2540815C2 (en) Interruption, at least in part, of frame transmission
US20190342225A1 (en) Methods and apparatus for early delivery of data link layer packets
US10469200B2 (en) Minimum latency link layer metaframing and error correction
US7751328B2 (en) System and method for efficient network flow control
US10461886B2 (en) Transport layer identifying failure cause and mitigation for deterministic transport across multiple deterministic data links
US12368534B2 (en) Data transmission method and network device
CN116032421B (en) Ethernet link control device and storage medium
US12255737B2 (en) Method and apparatus for packet wash in networks
CN114301576B (en) Method and communication device for generating and transmitting acknowledgement frames in an IEEE802.15.4 network
CN114070475A (en) Method and device for sending bit block
EP3672189B1 (en) Data transmission method, device and system
CN115714991A (en) Method, apparatus and storage medium for transmitting time-resolved network packets
CN118740748A (en) Network transmission method, readable storage medium and intelligent device
US20250150384A1 (en) Switch controller, sending controller and methods for use in switch controller and sending controller
CN120614089A (en) Data transmission method, device, equipment, system, storage medium and program product
KR20060111323A (en) TCCP based communication control device and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant