[go: up one dir, main page]

CN114301852A - Message transmission control, generation, transmission method and configuration method, device and medium - Google Patents

Message transmission control, generation, transmission method and configuration method, device and medium Download PDF

Info

Publication number
CN114301852A
CN114301852A CN202011008846.1A CN202011008846A CN114301852A CN 114301852 A CN114301852 A CN 114301852A CN 202011008846 A CN202011008846 A CN 202011008846A CN 114301852 A CN114301852 A CN 114301852A
Authority
CN
China
Prior art keywords
message
session
packet
configuration information
trigger
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.)
Pending
Application number
CN202011008846.1A
Other languages
Chinese (zh)
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.)
Sanechips Technology Co Ltd
Original Assignee
Sanechips Technology Co Ltd
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 Sanechips Technology Co Ltd filed Critical Sanechips Technology Co Ltd
Priority to CN202011008846.1A priority Critical patent/CN114301852A/en
Priority to PCT/CN2021/119623 priority patent/WO2022063126A1/en
Publication of CN114301852A publication Critical patent/CN114301852A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6275Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present disclosure provides a message transmission control method, including: reading trigger configuration information from a trigger configuration space of a current session; judging whether the current session needs to send a message or not according to the trigger configuration information; and writing the session identifier of the current session and the message information of the message to be sent into the on-chip storage device under the condition that the current session needs to send the message. The present disclosure also provides a message generating method, including: reading a session identifier of a target session and message information of a message to be sent from an on-chip storage device; reading package configuration information and a message template from a package configuration space of a target session; generating a message to be transmitted according to the message information, the package configuration information and the message template; and writing the message to be transmitted into the on-chip storage device. The present disclosure also provides a message transmission method, which can transmit a message to be transmitted in the on-chip storage device. The disclosure also provides a configuration method, an electronic device and a computer readable medium.

Description

报文传输控制、生成、传输方法及配置方法、设备、介质Message transmission control, generation, transmission method and configuration method, device and medium

技术领域technical field

本发明涉及通信技术领域,特别涉及一种报文传输控制方法、一种报文生成方法、一种报文传输方法、一种配置方法、一种电子设备、一种计算机可读介质。The present invention relates to the field of communication technologies, and in particular, to a message transmission control method, a message generation method, a message transmission method, a configuration method, an electronic device, and a computer-readable medium.

背景技术Background technique

操作维护管理(OAM,Operation Administration and Maintenance)功能对于保障网络的服务质量至关重要。OAM功能能够实时检测并上报链路状态,并且能够进行链路的差错管理、提供快速切换的能力,有助于提高网络的可靠性。随着网络通信技术的发展,越来越高的带宽和低延迟需求要求更加频繁和快速的网络操作,同时,电信网络的组网方式也越来越复杂,并且处于不断更新的状态,网络操作经常需要结合多种OAM协议灵活使用。Operation and maintenance management (OAM, Operation Administration and Maintenance) function is very important to guarantee the service quality of the network. The OAM function can detect and report link status in real time, manage link errors, and provide fast handover capabilities, helping to improve network reliability. With the development of network communication technology, higher and higher bandwidth and lower latency requirements require more frequent and faster network operations. At the same time, the networking methods of telecommunication networks are becoming more and more complex and are constantly updated. It is often necessary to combine multiple OAM protocols flexibly.

现有技术无法实现OAM发送性能和灵活性兼顾。The prior art cannot achieve both OAM transmission performance and flexibility.

发明内容SUMMARY OF THE INVENTION

本公开实施例提供一种报文传输控制方法、一种报文生成方法、一种报文传输方法、一种配置方法、一种电子设备、一种计算机可读介质。Embodiments of the present disclosure provide a message transmission control method, a message generation method, a message transmission method, a configuration method, an electronic device, and a computer-readable medium.

第一方面,本公开实施例提供一种报文传输控制方法,包括:In a first aspect, an embodiment of the present disclosure provides a packet transmission control method, including:

从当前会话的触发配置空间中读取所述当前会话的触发配置信息,其中,片上存储设备中包括多个触发配置空间,每一个所述触发配置空间对应一个会话,所述当前会话为多个所述会话中的一者;The trigger configuration information of the current session is read from the trigger configuration space of the current session, wherein the on-chip storage device includes multiple trigger configuration spaces, each of the trigger configuration spaces corresponds to a session, and the current session contains multiple trigger configuration spaces. one of the sessions;

根据所述触发配置信息判断所述当前会话是否需要发送报文;Determine whether the current session needs to send a message according to the trigger configuration information;

在所述当前会话需要发送报文的情况下,将所述当前会话的会话标识和所述当前会话需要发送的报文的报文信息写入所述片上存储设备。In the case that the current session needs to send a message, the session identifier of the current session and the message information of the message to be sent by the current session are written into the on-chip storage device.

在一些实施例中,所述触发配置信息包括所述当前会话支持的至少一种报文类型,根据所述触发配置信息判断所述当前会话是否需要发送报文的步骤包括:In some embodiments, the trigger configuration information includes at least one packet type supported by the current session, and the step of determining whether the current session needs to send packets according to the trigger configuration information includes:

根据所述触发配置信息判断各种所述报文类型的报文的触发条件是否满足;According to the trigger configuration information, determine whether the trigger conditions of the packets of various types of the packets are satisfied;

在多种所述报文类型中的至少一者的报文的触发条件满足的情况下,判定所述当前会话需要发送报文。In the case that the trigger condition of the message of at least one of the plurality of message types is satisfied, it is determined that the current session needs to send a message.

在一些实施例中,所述触发配置信息还包括各种所述报文类型的报文的发送周期,根据所述触发配置信息判断所述报文类型的报文的触发条件是否满足的步骤包括:In some embodiments, the trigger configuration information further includes the sending period of the packets of various types of the packets, and the step of determining whether the trigger conditions of the packets of the packet types are satisfied according to the trigger configuration information includes the following steps: :

判断所述报文类型的报文的发送周期是否满足;Judging whether the sending period of the message of the message type is satisfied;

在所述报文类型的报文的发送周期满足的情况下,判定所述报文类型的报文的触发条件满足。In the case that the sending period of the message of the message type is satisfied, it is determined that the trigger condition of the message of the message type is satisfied.

在一些实施例中,判断所述报文类型的报文的发送周期是否满足的步骤之前,根据所述触发配置信息判断所述报文类型的报文的触发条件是否满足的步骤包括:In some embodiments, before the step of judging whether the sending period of the message of the message type is satisfied, the step of judging whether the trigger condition of the message of the message type is satisfied according to the trigger configuration information includes:

判断所述报文类型的报文是否为首包发送;Determine whether the message of the message type is sent as the first packet;

在所述报文类型的报文为首包发送的情况下,判定所述报文类型的报文的触发条件满足;In the case that the message of the message type is sent as the first packet, it is determined that the trigger condition of the message of the message type is satisfied;

在所述报文类型的报文非首包发送的情况下,执行判断所述报文类型的报文的发送周期是否满足的步骤。In the case that the message of the message type is not sent as the first packet, the step of judging whether the sending period of the message of the message type is satisfied is performed.

在一些实施例中,判断所述报文类型的报文是否为首包发送的步骤之前,根据所述触发配置信息判断所述报文类型的报文的触发条件是否满足的步骤还包括:In some embodiments, before the step of judging whether the message of the message type is sent as the first packet, the step of judging whether the trigger condition of the message of the message type is satisfied according to the trigger configuration information further includes:

判断所述报文类型的报文的发送条件是否满足;Judging whether the sending condition of the message of the message type is satisfied;

在所述报文类型的报文的发送条件满足的情况下,执行判断所述报文类型的报文是否为首包发送的步骤In the case that the sending condition of the message of the message type is satisfied, the step of judging whether the message of the message type is sent as the first packet is performed

在所述报文类型的报文的发送条件不满足的情况下,判定所述报文类型的报文的触发条件不满足。In the case that the sending condition of the message of the message type is not satisfied, it is determined that the triggering condition of the message of the message type is not satisfied.

在一些实施例中,所述触发配置信息还包括所述当前会话的发送使能信息,判断所述报文类型的报文的发送条件是否满足的步骤之前,根据所述触发配置信息判断所述报文类型的报文的触发条件是否满足的步骤还包括:In some embodiments, the trigger configuration information further includes sending enable information of the current session, and before the step of judging whether the sending condition of the packet of the packet type is satisfied, the trigger configuration information is used to determine the The steps of whether the trigger condition of the message of the message type is satisfied further include:

根据所述发送使能信息判断所述当前会话的发送使能是否开启;Determine whether the sending enable of the current session is enabled according to the sending enable information;

在所述当前会话的发送使能开启的情况下,执行判断所述报文类型的报文的发送条件是否满足的步骤;Under the condition that the sending enable of the current session is turned on, execute the step of judging whether the sending condition of the message of the message type is satisfied;

在所述当前会话的发送使能未开启的情况下,判定所述报文类型的报文的触发条件不满足。In the case that the sending enable of the current session is not enabled, it is determined that the triggering condition of the message of the message type is not satisfied.

在一些实施例中,触发条件满足的报文为所述当前会话需要发送的报文,所述触发配置信息还包括所述当前会话的协议类型、各种所述报文类型的报文的待携带信息,所述报文信息包括所述当前会话的协议类型、触发条件满足的报文的报文类型、触发条件满足的报文的待携带信息。In some embodiments, the packet that satisfies the trigger condition is the packet that needs to be sent by the current session, and the trigger configuration information further includes the protocol type of the current session, the waiting list of the packets of various packet types. Carrying information, the packet information includes the protocol type of the current session, the packet type of the packet satisfying the trigger condition, and the to-be-carried information of the packet satisfying the trigger condition.

在一些实施例中,所述报文传输控制方法还包括:In some embodiments, the packet transmission control method further includes:

根据配置的需要轮询的所述会话的数量和轮询粒度,从当前会话的下一个会话的触发配置空间中读取所述下一个会话的触发配置信息,以实现对多个所述会话的轮询,其中,所述轮询粒度表示轮询前后两个所述会话的时间间隔。According to the configured number of the sessions that need to be polled and the polling granularity, the trigger configuration information of the next session is read from the trigger configuration space of the next session of the current session, so as to realize the synchronization of multiple sessions. polling, wherein the polling granularity represents the time interval between the two sessions before and after the polling.

在一些实施例中,需要轮询的所述会话的数量和轮询粒度满足以下公式:In some embodiments, the number of the sessions that need to be polled and the polling granularity satisfy the following formula:

基准脉冲周期=需要轮询的所述会话的数量×轮询粒度;Baseline pulse period = the number of the sessions that need to be polled × polling granularity;

所述报文传输控制方法还包括:The message transmission control method further includes:

响应于基准脉冲,发起对多个所述会话的轮询。In response to the reference pulse, polling for a plurality of the sessions is initiated.

第二方面,本公开实施例提供一种报文生成方法,包括:In a second aspect, an embodiment of the present disclosure provides a method for generating a message, including:

从片上存储设备中读取目标会话的会话标识和所述目标会话需要发送的报文的报文信息;Read the session identifier of the target session and the message information of the message to be sent by the target session from the on-chip storage device;

根据所述目标会话的会话标识,从所述目标会话的组包配置空间读取所述目标会话的组包配置信息和报文模板,其中,所述片上存储设备中包括多个组包配置空间,每一个所述组包配置空间对应一个会话,所述目标会话为多个所述会话中的一者;According to the session identifier of the target session, the grouping configuration information and message template of the target session are read from the grouping configuration space of the target session, wherein the on-chip storage device includes a plurality of grouping configuration spaces , each of the group package configuration spaces corresponds to a session, and the target session is one of a plurality of the sessions;

根据所述报文信息、所述组包配置信息和所述报文模板生成所述目标会话的待传输报文;generating the to-be-transmitted packet of the target session according to the packet information, the packet configuration information and the packet template;

将所述待传输报文写入所述片上存储设备。Write the to-be-transmitted message into the on-chip storage device.

在一些实施例中,根据所述报文信息、所述组包配置信息和所述报文模板生成所述目标会话的待传输报文的步骤包括:In some embodiments, the step of generating the to-be-transmitted packet of the target session according to the packet information, the packet configuration information and the packet template includes:

根据所述报文信息替换所述报文模板中的相应字段;Replacing the corresponding fields in the message template according to the message information;

根据所述组包配置信息替换所述报文模板中的私有头字段。The private header field in the message template is replaced according to the packet configuration information.

在一些实施例中,所述报文信息包括所述目标会话的协议类型、所述目标会话需要发送的报文的报文类型、所述目标会话需要发送的报文的待携带信息,根据所述报文信息替换所述报文模板中的相应字段的步骤包括:In some embodiments, the packet information includes the protocol type of the target session, the packet type of the packet to be sent by the target session, and the to-be-carried information of the packet to be sent by the target session. The step of replacing the corresponding fields in the message template with the message information includes:

根据所述目标会话的协议类型、所述目标会话需要发送的报文类型、所述目标会话需要发送的报文的待携带信息,替换所述报文模板中的相应字段。The corresponding fields in the message template are replaced according to the protocol type of the target session, the message type to be sent by the target session, and the to-be-carried information of the message to be sent by the target session.

在一些实施例中,所述组包配置信息包括报文长度、报文偏移值,根据所述组包配置信息替换所述报文模板中的私有头字段的步骤包括:In some embodiments, the grouping configuration information includes a message length and a message offset value, and the step of replacing the private header field in the message template according to the grouping configuration information includes:

根据所述报文长度、所述报文偏移值替换所述报文模板中的私有头字段。The private header field in the message template is replaced according to the message length and the message offset value.

在一些实施例中,根据所述组包配置信息替换所述报文模板中的私有头字段的步骤包括还包括:In some embodiments, the step of replacing the private header field in the message template according to the packet configuration information includes further comprising:

根据所述组包配置信息进行报文选路。The packet routing is performed according to the packet configuration information.

在一些实施例中,根据所述报文信息、所述组包配置信息和所述报文模板生成所述目标会话的待传输报文的步骤还包括:In some embodiments, the step of generating the to-be-transmitted packet of the target session according to the packet information, the packet configuration information and the packet template further includes:

根据全局配置信息,替换所述初始报文中对应的全局配置字段。The corresponding global configuration field in the initial message is replaced according to the global configuration information.

在一些实施例中,所述报文信息包括所述目标会话需要发送的报文的报文类型,根据所述报文信息、所述组包配置信息和所述报文模板生成所述目标会话的待传输报文的步骤包括:In some embodiments, the packet information includes a packet type of a packet to be sent by the target session, and the target session is generated according to the packet information, the packet configuration information and the packet template The steps of the message to be transmitted include:

在所述目标会话需要发送的报文的报文类型为自定义报文的情况下,将所述报文模板作为所述待传输报文。In the case that the message type of the message to be sent by the target session is a self-defined message, the message template is used as the to-be-transmitted message.

第三方面,本公开实施例提供一种报文传输方法,包括:In a third aspect, an embodiment of the present disclosure provides a message transmission method, including:

从片上存储设备中读取目标待传输报文,所述目标待传输报文为根据本公开实施例第二方面所述的报文生成方法生成并写入缓存的待传输报文;Read the target message to be transmitted from the on-chip storage device, where the target message to be transmitted is the message to be transmitted that is generated according to the message generation method described in the second aspect of the embodiment of the present disclosure and written into the cache;

传输所述目标待传输报文。The target to-be-transmitted message is transmitted.

在一些实施例中,从片上存储设备中读取目标待传输报文的步骤之前,所述报文传输方法还包括:In some embodiments, before the step of reading the target message to be transmitted from the on-chip storage device, the message transmission method further includes:

确定所述片上存储设备中具有最高优先级的待传输报文;determining the message to be transmitted with the highest priority in the on-chip storage device;

将具有最高优先级的待传输报文确定为所述目标待传输报文。The to-be-transmitted message with the highest priority is determined as the target to-be-transmitted message.

在一些实施例中,确定所述片上存储设备中具有最高优先级的待传输报文的步骤包括:In some embodiments, the step of determining the message to be transmitted with the highest priority in the on-chip storage device includes:

根据整形信号和反压信号确定具有最高优先级的待传输报文。The message to be transmitted with the highest priority is determined according to the shaping signal and the back pressure signal.

在一些实施例中,从片上存储设备中读取目标待传输报文的步骤之前,所述报文传输方法还包括:In some embodiments, before the step of reading the target message to be transmitted from the on-chip storage device, the message transmission method further includes:

根据前级缓存空满信号判断所述片上存储设备中是否存在待传输报文;Determine whether there is a message to be transmitted in the on-chip storage device according to the pre-level cache empty signal;

在所述片上存储设备中存在待传输报文的情况下,执行从片上存储设备中读取目标待传输报文的步骤。In the case that the message to be transmitted exists in the on-chip storage device, the step of reading the target to-be-transmitted message from the on-chip storage device is performed.

第四方面,本公开实施例提供一种配置方法,包括:In a fourth aspect, an embodiment of the present disclosure provides a configuration method, including:

在多个会话的触发配置空间中分别配置各个所述会话的触发配置信息,所述触发配置信息用于判断各个所述会话是否需要发送报文,其中,芯片的片上存储设备中包括多个触发配置空间,每一个所述触发配置空间对应一个会话;Trigger configuration information for each of the sessions is configured in the trigger configuration spaces of multiple sessions, and the trigger configuration information is used to determine whether each session needs to send a message, wherein the on-chip storage device of the chip includes multiple triggers configuration space, each of the trigger configuration spaces corresponds to a session;

在多个所述会话的组包配置空间中分别配置各个所述会话的组包配置信息和报文模板,所述组包配置信息和所述报文模板用于当所述会话需要发送报文时生成所述会话的待传输报文,其中,所述芯片的片上存储设备中包括多个组包配置空间,每一个所述组包配置空间对应一个会话。The grouping configuration information and the message template of each of the sessions are respectively configured in the grouping configuration spaces of the multiple sessions, and the grouping configuration information and the message template are used when the session needs to send a message When generating the to-be-transmitted message of the session, the on-chip storage device of the chip includes a plurality of packet configuration spaces, and each of the packet configuration spaces corresponds to a session.

在一些实施例中,所述触发配置信息包括所述会话的协议类型、所述会话支持的至少一种报文类型、各种所述报文类型的报文的发送周期、所述会话的发送使能信息、各种所述报文类型的报文的待携带信息中的至少一者。In some embodiments, the trigger configuration information includes a protocol type of the session, at least one packet type supported by the session, a transmission period of packets of various types of packets, and a transmission period of the session. At least one of enabling information and information to be carried in packets of various types of the packets.

在一些实施例中,所述组包配置信息包括报文长度、报文偏移值中的至少一者。In some embodiments, the grouping configuration information includes at least one of a packet length and a packet offset value.

在一些实施例中,所述配置方法还包括:In some embodiments, the configuration method further includes:

配置需要轮询的所述会话的数量和轮询粒度,所述轮询粒度表示轮询前后两个所述会话的时间间隔。Configure the number of the sessions to be polled and the polling granularity, where the polling granularity represents the time interval between the two sessions before and after the polling.

在一些实施例中,需要轮询的所述会话的数量和轮询粒度满足以下公式:In some embodiments, the number of the sessions that need to be polled and the polling granularity satisfy the following formula:

基准脉冲周期=需要轮询的所述会话的数量×轮询粒度。Baseline pulse period = number of said sessions that need to be polled x polling granularity.

第五方面,本公开实施例提供一种电子设备,包括:In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including:

一个或多个处理器;one or more processors;

存储装置,其上存储有一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现以下方法中的至少一者:A storage device having one or more programs stored thereon that, when executed by the one or more processors, cause the one or more processors to implement at least one of the following methods:

根据本公开实施例第一方面所述的报文传输控制方法;The packet transmission control method according to the first aspect of the embodiments of the present disclosure;

根据本公开实施例第二方面所述的报文生成方法;The method for generating a message according to the second aspect of the embodiment of the present disclosure;

根据本公开实施例第三方面所述的报文传输方法;The message transmission method according to the third aspect of the embodiments of the present disclosure;

根据本公开实施例第四方面所述的配置方法。According to the configuration method described in the fourth aspect of the embodiment of the present disclosure.

第六方面,本公开实施例提供一种计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现以下方法中的至少一者:In a sixth aspect, an embodiment of the present disclosure provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, implements at least one of the following methods:

根据本公开实施例第一方面所述的报文传输控制方法;The packet transmission control method according to the first aspect of the embodiments of the present disclosure;

根据本公开实施例第二方面所述的报文生成方法;The method for generating a message according to the second aspect of the embodiment of the present disclosure;

根据本公开实施例第三方面所述的报文传输方法;The message transmission method according to the third aspect of the embodiments of the present disclosure;

根据本公开实施例第四方面所述的配置方法。According to the configuration method described in the fourth aspect of the embodiment of the present disclosure.

在本公开实施例提供的报文传输控制方法中,在片上存储设备中为多个会话分配了用于存储各个会话的触发配置信息的触发配置空间,硬件逻辑通过读取由板载微控制单元上运行的软件配置到触发配置空间中的触发配置信息,判断各个会话是否需要发送报文,硬件逻辑还能够进一步根据片上存储设备中需要发送报文的会话的会话标识和报文信息组装报文并传输,从而使处理器无需花费大量资源处理和存储完整报文,保证了性能;同时,在本公开实施例中,每一个会话的协议类型可配置,每一个会话都能够同时发送多种报文,并且支持自定义协议类型和报文类型,保证了灵活性和扩展性;通过逐个访问片上存储设备中的触发配置空间判断是否需要发送报文还能够有效平滑突发流量,实现高精度发送报文。In the message transmission control method provided by the embodiment of the present disclosure, a trigger configuration space for storing trigger configuration information of each session is allocated to a plurality of sessions in the on-chip storage device, and the hardware logic is configured by the on-board micro-control unit by reading The software running on the device configures the trigger configuration information in the trigger configuration space to determine whether each session needs to send a message. The hardware logic can further assemble the message according to the session identifier and message information of the session that needs to send the message in the on-chip storage device. and transmission, so that the processor does not need to spend a lot of resources to process and store the complete message, and the performance is guaranteed; at the same time, in the embodiment of the present disclosure, the protocol type of each session can be configured, and each session can send multiple messages at the same time. It supports custom protocol types and packet types, ensuring flexibility and scalability; by accessing the trigger configuration space in the on-chip storage device one by one to determine whether a packet needs to be sent, it can also effectively smooth burst traffic and achieve high-precision transmission. message.

在本公开实施例提供的报文生成方法中,在片上存储设备中为多个会话分配了用于存储各个会话的组包配置信息和报文模板的组包配置空间,硬件逻辑读取组包配置空间中的组包配置信息和报文模板生成待传输报文,其中,各个会话的协议类型可以是多种协议类型中的任意一种,生成的待传输报文可以是多种报文类型中的任意一种,保证了灵活性和扩展性;在片上存储设备中只存储报文模板,而不需要存储各种报文类型的完整报文;在根据报文模板生成待传输报文时,只需配置报文模板中共享内容以外的字段,而不需要对完整的报文进行处理,从而节约了存储资源和计算资源。In the packet generation method provided by the embodiment of the present disclosure, a packet configuration space for storing packet configuration information and packet templates of each session is allocated to a plurality of sessions in an on-chip storage device, and hardware logic reads the packet. Packet configuration information and message templates in the configuration space generate messages to be transmitted, where the protocol type of each session can be any one of multiple protocol types, and the generated messages to be transmitted can be of multiple message types Any one of them ensures flexibility and scalability; only the message template is stored in the on-chip storage device, and it is not necessary to store complete messages of various message types; when generating the message to be transmitted according to the message template , you only need to configure fields other than the shared content in the message template, and do not need to process the complete message, thus saving storage resources and computing resources.

在本公开实施例提供的报文传输方法中,硬件逻辑从片上存储设备中读取硬件逻辑根据本公开实施例第二方面所述的待传输报文并传输。待传输报文的报文类型可以是多种报文类型中的任意一种,待传输报文对应的会话的协议类型可以是多种协议类型中的一种,保证了灵活性和扩展性。In the packet transmission method provided by the embodiment of the present disclosure, the hardware logic reads the to-be-transmitted packet according to the second aspect of the embodiment of the present disclosure and transmits the hardware logic from the on-chip storage device. The packet type of the to-be-transmitted packet may be any one of multiple packet types, and the protocol type of the session corresponding to the to-be-transmitted packet may be one of multiple protocol types, which ensures flexibility and extensibility.

在本公开实施例提供的配置方法中,板载微控制单元在芯片的片上存储设备中为多个会话配置触发配置信息,使得芯片的硬件逻辑能够通过读取触发配置信息,判断各个会话是否需要发送报文;板载微控制单元在芯片的片上存储设备中为多个会话配置组包配置信息和报文模板,使得芯片的硬件逻辑能够通过读取组包配置空间中的组包配置信息和报文模板生成待传输报文,并使得芯片的硬件逻辑进一步传输待传输报文;板载微控制单元为多个会话配置多种协议类型,并为每一个会话配置多种报文类型,使得每个会话都能够发送多种报文类型的报文,从而保证了灵活性、扩展性,节约了计算资源、存储资源,还能够有效平滑突发流量,实现高精度发送报文。In the configuration method provided by the embodiment of the present disclosure, the on-board micro-control unit configures trigger configuration information for multiple sessions in the on-chip storage device of the chip, so that the hardware logic of the chip can read the trigger configuration information to determine whether each session needs Sending messages; the on-board microcontroller configures grouping configuration information and message templates for multiple sessions in the on-chip storage device of the chip, so that the hardware logic of the chip can read the grouping configuration information and message templates in the grouping configuration space by reading the grouping configuration information and The message template generates the message to be transmitted, and enables the hardware logic of the chip to further transmit the message to be transmitted; the on-board micro-control unit configures multiple protocol types for multiple sessions, and configures multiple packet types for each session, so that Each session can send packets of multiple packet types, which ensures flexibility and scalability, saves computing resources and storage resources, and can effectively smooth burst traffic and achieve high-precision packet sending.

附图说明Description of drawings

图1是本公开实施中一种报文传输控制方法的流程图;1 is a flowchart of a method for controlling message transmission in the implementation of the present disclosure;

图2是本公开实施例中另一种报文传输控制方法中部分步骤的流程图;2 is a flowchart of some steps in another message transmission control method in an embodiment of the present disclosure;

图3是本公开实施例中又一种报文传输控制方法中部分步骤的流程图;3 is a flowchart of some steps in yet another message transmission control method in an embodiment of the present disclosure;

图4是本公开实施例中再一种报文传输控制方法中部分步骤的流程图;4 is a flowchart of some steps in still another message transmission control method in an embodiment of the present disclosure;

图5是本公开实施中一种报文生成方法的流程图;5 is a flowchart of a method for generating a message in the implementation of the present disclosure;

图6是本公开实施例中另一种报文生成方法中部分步骤的流程图;6 is a flowchart of some steps in another message generation method in an embodiment of the present disclosure;

图7是本公开实施例中又一种报文生成方法中部分步骤的流程图;7 is a flowchart of some steps in yet another message generation method in an embodiment of the present disclosure;

图8是本公开实施例中再一种报文生成方法中部分步骤的流程图;8 is a flowchart of some steps in yet another message generation method in an embodiment of the present disclosure;

图9是本公开实施例中再一种报文生成方法中部分步骤的流程图;9 is a flowchart of some steps in yet another message generation method in an embodiment of the present disclosure;

图10是本公开实施例中一种报文传输方法的流程图;10 is a flowchart of a message transmission method in an embodiment of the present disclosure;

图11是本公开实施例中另一种报文传输方法中部分步骤的流程图;11 is a flowchart of some steps in another message transmission method in an embodiment of the present disclosure;

图12是本公开实施例中一种配置方法的流程图;12 is a flowchart of a configuration method in an embodiment of the present disclosure;

图13是本公开实施例中另一种配置方法中部分步骤的流程图;13 is a flowchart of some steps in another configuration method in an embodiment of the present disclosure;

图14是本公开实施例中一种电子设备的组成框图;14 is a block diagram of an electronic device in an embodiment of the present disclosure;

图15是本公开实施例中一种计算机可读介质的组成框图。FIG. 15 is a block diagram of the composition of a computer-readable medium in an embodiment of the present disclosure.

具体实施方式Detailed ways

为使本领域的技术人员更好地理解本公开的技术方案,下面结合附图对本公开实施例提供的报文传输控制方法、报文生成方法、报文传输方法、配置方法、电子设备、计算机可读介质进行详细描述。In order to make those skilled in the art better understand the technical solutions of the present disclosure, the following describes the message transmission control method, message generation method, message transmission method, configuration method, electronic device, computer provided by the embodiments of the present disclosure with reference to the accompanying drawings. Readable media are described in detail.

在下文中将参考附图更充分地描述示例实施例,但是所述示例实施例可以以不同形式来体现且不应当被解释为限于本文阐述的实施例。反之,提供这些实施例的目的在于使本公开透彻和完整,并将使本领域技术人员充分理解本公开的范围。Example embodiments are described more fully hereinafter with reference to the accompanying drawings, but which may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

在不冲突的情况下,本公开各实施例及实施例中的各特征可相互组合。Various embodiments of the present disclosure and various features of the embodiments may be combined with each other without conflict.

如本文所使用的,术语“和/或”包括一个或多个相关列举条目的任何和所有组合。As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.

本文所使用的术语仅用于描述特定实施例,且不意欲限制本公开。如本文所使用的,单数形式“一个”和“该”也意欲包括复数形式,除非上下文另外清楚指出。还将理解的是,当本说明书中使用术语“包括”和/或“由……制成”时,指定存在所述特征、整体、步骤、操作、元件和/或组件,但不排除存在或添加一个或多个其它特征、整体、步骤、操作、元件、组件和/或其群组。The terminology used herein is used to describe particular embodiments only and is not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that when the terms "comprising" and/or "made of" are used in this specification, the stated features, integers, steps, operations, elements and/or components are specified to be present, but not precluded or Add one or more other features, integers, steps, operations, elements, components, and/or groups thereof.

除非另外限定,否则本文所用的所有术语(包括技术和科学术语)的含义与本领域普通技术人员通常理解的含义相同。还将理解,诸如那些在常用字典中限定的那些术语应当被解释为具有与其在相关技术以及本公开的背景下的含义一致的含义,且将不解释为具有理想化或过度形式上的含义,除非本文明确如此限定。Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in common dictionaries should be construed as having meanings consistent with their meanings in the context of the related art and the present disclosure, and will not be construed as having idealized or over-formal meanings, unless expressly so limited herein.

经本公开实施例的发明人研究发现,现有技术中,为了保证OAM的灵活性,需要处理器花费大量资源处理和存储完整的OAM报文,导致OAM发送性能很低;为了保证OAM发送性能,则需要固化OAM报文格式,导致灵活性和扩展性较差。现有的OAM报文发送的软件和硬件实现均无法同时保证OAM发送性能和灵活性。The inventors of the embodiments of the present disclosure found that, in the prior art, in order to ensure the flexibility of OAM, the processor needs to spend a lot of resources to process and store complete OAM packets, resulting in low OAM transmission performance; in order to ensure OAM transmission performance , the OAM packet format needs to be solidified, resulting in poor flexibility and scalability. The existing software and hardware implementations of OAM packet transmission cannot simultaneously guarantee the OAM transmission performance and flexibility.

有鉴于此,第一方面,参照图1,本公开实施例提供一种报文传输控制方法,包括:In view of this, in the first aspect, referring to FIG. 1 , an embodiment of the present disclosure provides a packet transmission control method, including:

在步骤S110中,从当前会话的触发配置空间中读取所述当前会话的触发配置信息,其中,片上存储设备中包括多个触发配置空间,每一个所述触发配置空间对应一个会话,所述当前会话为多个所述会话中的一者;In step S110, the trigger configuration information of the current session is read from the trigger configuration space of the current session, wherein the on-chip storage device includes a plurality of trigger configuration spaces, each of the trigger configuration spaces corresponds to a session, and the The current session is one of a plurality of said sessions;

在步骤S120中,根据所述触发配置信息判断所述当前会话是否需要发送报文;In step S120, according to the trigger configuration information, determine whether the current session needs to send a message;

在步骤S130中,在所述当前会话需要发送报文的情况下,将所述当前会话的会话标识和所述当前会话需要发送的报文的报文信息写入所述片上存储设备。In step S130, when the current session needs to send a message, the session identifier of the current session and the message information of the message to be sent by the current session are written into the on-chip storage device.

在本公开实施例中,在片上存储设备中为多个会话分配了用于存储各个会话的触发配置信息的触发配置空间,触发配置空间中会话的触发配置信息由板载微控制单元(MCU,Microcontroller Unit)上运行的软件配置。In the embodiment of the present disclosure, a trigger configuration space for storing the trigger configuration information of each session is allocated to a plurality of sessions in the on-chip storage device, and the trigger configuration information of the session in the trigger configuration space is controlled by the on-board microcontroller unit (MCU, Software configuration running on the Microcontroller Unit).

在本公开实施例中,每个会话的协议类型可配置,本公开实施例对于可配置的协议类型不做特殊限定。例如,协议类型包括但不限于:以太网OAM、多协议标签交换-传送架构(MPLS_TP,Multi-Protocol Label Switching Transport Profile)OAM、双向转发检测(BFD,Bidirectional Forwarding Detection)。此外,本公开实施例还支持自定义的OAM协议类型,自定义的OAM协议类型可以用于协议扩展。需要说明的是,在本公开实施例中,当会话配置自定义的OAM协议类型时,会话可以发送任意类型的报文。In the embodiment of the present disclosure, the protocol type of each session is configurable, and the embodiment of the present disclosure does not specifically limit the configurable protocol type. For example, the protocol types include but are not limited to: Ethernet OAM, Multi-Protocol Label Switching Transport Profile (MPLS_TP, Multi-Protocol Label Switching Transport Profile) OAM, and Bidirectional Forwarding Detection (BFD). In addition, the embodiment of the present disclosure also supports a custom OAM protocol type, and the custom OAM protocol type can be used for protocol extension. It should be noted that, in this embodiment of the present disclosure, when a user-defined OAM protocol type is configured for a session, the session can send any type of packets.

在本公开实施例中,每个会话均能够发送多种报文类型的OAM报文,本公开实施例对报文类型不做特殊限定。例如,报文类型可以包括连通性检测(CV,ConnectivityVerification)、BFD、客户信号失效(CSF,Client Signal Fail)、自动保护倒换(APS,Automatic Protection Switching)、告警指示(AIS,Alarm Indication Signal)等,还可以是2544报文、链路状态包(LSP,Link-State Packet)报文等。此外,本公开实施例还支持自定义报文类型,自定义报文类型可以用于扩展。In the embodiment of the present disclosure, each session can send OAM packets of multiple packet types, and the embodiment of the present disclosure does not specifically limit the packet types. For example, the packet types may include Connectivity Verification (CV, Connectivity Verification), BFD, Client Signal Fail (CSF, Client Signal Fail), Automatic Protection Switching (APS, Automatic Protection Switching), Alarm Indication (AIS, Alarm Indication Signal), etc. , and may also be a 2544 message, a Link-State Packet (LSP, Link-State Packet) message, and the like. In addition, the embodiments of the present disclosure also support custom message types, and the custom message types can be used for expansion.

在本公开实施例中,硬件逻辑逐个访问片上存储设备中的触发配置空间,判断各个会话是否需要发送报文。对应于每一个会话,都通过步骤S110至步骤S130读取该会话的触发配置信息,根据触发配置信息判断该会话是否需要发送报文,并在需要发送报文时,将该会话的会话标识和该会话需要发送的报文的报文信息写入片上存储设备,以使硬件逻辑进一步根据片上存储设备中需要发送报文的会话的会话标识和报文信息组装报文并传输。步骤S110至步骤S130中所述的当前会话即硬件逻辑当前访问的触发配置空间对应的会话。In the embodiment of the present disclosure, the hardware logic accesses the trigger configuration space in the on-chip storage device one by one to determine whether each session needs to send a message. Corresponding to each session, the trigger configuration information of the session is read through steps S110 to S130, according to the trigger configuration information, it is judged whether the session needs to send a message, and when a message needs to be sent, the session identifier and The message information of the message to be sent by the session is written into the on-chip storage device, so that the hardware logic further assembles and transmits the message according to the session identifier and message information of the session that needs to send the message in the on-chip storage device. The current session described in steps S110 to S130 is the session corresponding to the trigger configuration space currently accessed by the hardware logic.

本公开实施例对于如何逐个访问片上存储设备中的触发配置空间不做特殊限定,例如,可以通过轮询方式访问片上存储设备中的触发配置空间,并判断会话是否需要发送报文。需要说明的是,在本公开实施例中,由于逐个访问片上存储设备中的触发配置空间的过程中,访问前后两个触发配置空间并判断是否需要发送报文存在时间间隔,因此可以避免多个会话在相同时刻发送报文造成突发流量,从而有效平滑突发流量;逐个访问片上存储设备中的触发配置空间判断是否需要发送报文还能够实现高精度发送报文。This embodiment of the present disclosure does not specifically limit how to access the trigger configuration space in the on-chip storage device one by one. For example, the trigger configuration space in the on-chip storage device can be accessed in a polling manner, and it is determined whether the session needs to send a message. It should be noted that, in the embodiment of the present disclosure, since in the process of accessing the trigger configuration spaces in the on-chip storage device one by one, there is a time interval between accessing the two trigger configuration spaces before and after and judging whether a message needs to be sent, so multiple The session sends packets at the same time to cause burst traffic, thereby effectively smoothing the burst traffic; accessing the trigger configuration space in the on-chip storage device one by one to determine whether the packet needs to be sent can also achieve high-precision packet sending.

本公开实施例对于会话的会话标识的具体形式不做特殊限定。例如,会话标识可以是会话的会话号,硬件逻辑通过多个会话的会话号逐个读取会话的触发配置空间。作为一种可选的实施方式,多个会话的会话标识为从0开始连续编号的会话号,硬件逻辑首先访问会话号0对应的触发配置空间,判断会话号0的会话是否需要发送报文;然后将会话号加1,访问会话号1对应的触发配置空间,判断会话号1的会话是否需要发送报文……依次类推,直至访问最后一个会话号对应的触发配置空间。The embodiment of the present disclosure does not specifically limit the specific form of the session identifier of the session. For example, the session identifier may be the session number of the session, and the hardware logic reads the trigger configuration space of the sessions one by one through the session numbers of the multiple sessions. As an optional implementation manner, the session identifiers of multiple sessions are session numbers consecutively numbered from 0, and the hardware logic first accesses the trigger configuration space corresponding to session number 0 to determine whether the session of session number 0 needs to send a message; Then add 1 to the session number, access the trigger configuration space corresponding to session number 1, and determine whether the session of session number 1 needs to send a message... and so on, until the trigger configuration space corresponding to the last session number is accessed.

作为一种可选的实施方式,片上存储设备中包括先进先出(FIFO,First InputFirst Output)存储器,在步骤S130中,硬件逻辑将当前会话的会话标识和所述当前会话需要发送的报文的报文信息写入所述片上存储设备中的FIFO存储器中。As an optional implementation manner, the on-chip storage device includes a first-in, first-out (FIFO, First InputFirst Output) memory, and in step S130, the hardware logic compares the session identifier of the current session and the message to be sent by the current session. The message information is written into the FIFO memory in the on-chip storage device.

在本公开实施例提供的报文传输控制方法中,在片上存储设备中为多个会话分配了用于存储各个会话的触发配置信息的触发配置空间,硬件逻辑通过读取由板载微控制单元上运行的软件配置到触发配置空间中的触发配置信息,判断各个会话是否需要发送报文,硬件逻辑还能够进一步根据片上存储设备中需要发送报文的会话的会话标识和报文信息组装报文并传输,从而使处理器无需花费大量资源处理和存储完整报文,保证了性能;同时,在本公开实施例中,每一个会话的协议类型可配置,每一个会话都能够同时发送多种报文,并且支持自定义协议类型和报文类型,保证了灵活性和扩展性;通过逐个访问片上存储设备中的触发配置空间判断是否需要发送报文还能够有效平滑突发流量,实现高精度发送报文。In the message transmission control method provided by the embodiment of the present disclosure, a trigger configuration space for storing trigger configuration information of each session is allocated to a plurality of sessions in the on-chip storage device, and the hardware logic is configured by the on-board micro-control unit by reading The software running on the device configures the trigger configuration information in the trigger configuration space to determine whether each session needs to send a message. The hardware logic can further assemble the message according to the session identifier and message information of the session that needs to send the message in the on-chip storage device. and transmission, so that the processor does not need to spend a lot of resources to process and store the complete message, and the performance is guaranteed; at the same time, in the embodiment of the present disclosure, the protocol type of each session can be configured, and each session can send multiple messages at the same time. It supports custom protocol types and packet types, ensuring flexibility and scalability; by accessing the trigger configuration space in the on-chip storage device one by one to determine whether a packet needs to be sent, it can also effectively smooth burst traffic and achieve high-precision transmission. message.

在本公开实施例中,每一个会话都能同时发送多种报文类型的报文,即每一个会话能够支持多种报文类型。硬件逻辑访问会话的触发配置空间时,会话支持的多种报文类型的报文可以全部触发,也可以部分触发,还可以全部不触发。本公开实施例对此不做特殊限定。在本公开实施例中,片上存储设备的触发配置空间中配置的触发配置信息中,包括会话支持的报文类型、及各种报文类型的报文的触发条件。硬件逻辑通过访问会话的触发配置空间,分别判断各种报文类型的报文的触发条件是否满足,当多种报文类型的报文的触发条件都不满足时,则判定会话不需要发送报文,否则判定会话需要发送报文。In the embodiment of the present disclosure, each session can simultaneously send packets of multiple packet types, that is, each session can support multiple packet types. When the hardware logic accesses the trigger configuration space of a session, the packets of multiple packet types supported by the session can be all triggered, partially triggered, or not triggered at all. This embodiment of the present disclosure makes no special limitation on this. In the embodiment of the present disclosure, the trigger configuration information configured in the trigger configuration space of the on-chip storage device includes the packet types supported by the session and trigger conditions for packets of various packet types. By accessing the trigger configuration space of the session, the hardware logic determines whether the trigger conditions of the packets of various packet types are met. When the trigger conditions of the packets of multiple packet types are not met, it is determined that the session does not need to send packets. message, otherwise it is determined that the session needs to send a message.

相应地,在一些实施例中,所述触发配置信息包括所述当前会话支持的至少一种报文类型,参照图2,步骤S120包括:Correspondingly, in some embodiments, the trigger configuration information includes at least one packet type supported by the current session. Referring to FIG. 2 , step S120 includes:

在步骤S121中,根据所述触发配置信息判断各种所述报文类型的报文的触发条件是否满足;In step S121, according to the trigger configuration information, it is judged whether the trigger conditions of the packets of various types of the packets are satisfied;

在多种所述报文类型中的至少一者的报文的触发条件满足的情况下,判定所述当前会话需要发送报文;In the case that the trigger condition of the message of at least one of the plurality of message types is satisfied, it is determined that the current session needs to send a message;

在多种所述报文类型的报文的触发条件均不满足的情况下,判定所述当前会话不需要发送报文。In the case that the triggering conditions of the messages of the multiple message types are not satisfied, it is determined that the current session does not need to send messages.

在本公开实施例中,OAM连接建立后,两端的OAM实体会以一定的时间间隔为周期发送OAM协议数据单元(PDU,Protocol Data Unit)来检测OAM连接是否正常.如果一端OAM实体在连接超时时间内未收到对端OAM实体发来的OAM PDU,则认为OAM连接中断。在本公开实施例中,在每个会话的触发配置空间中配置有会话支持的各种报文类型的报文的发送周期。其中,同一个会话中,不同报文类型的报文的发送周期可以相同,也可以不同,本公开实施例对此不做特殊限定。作为一种可选的实施方式,硬件逻辑访问会话的触发配置空间时,根据当前时刻是否满足各种报文类型的报文的发送周期,判断各种报文类型的报文是否满足触发条件。只有硬件逻辑访问会话的触发配置空间的时刻满足报文的发送周期时,才通过步骤S130将发送周期满足的报文的报文信息写入片上存储设备,并由硬件逻辑进一步组装报文并传输,从而保证了各种报文类型的报文的发送周期。In the embodiment of the present disclosure, after the OAM connection is established, the OAM entities at both ends will periodically send OAM protocol data units (PDUs, Protocol Data Units) at certain time intervals to detect whether the OAM connection is normal. If the OAM PDU sent by the peer OAM entity is not received within the time, it is considered that the OAM connection is interrupted. In the embodiment of the present disclosure, the trigger configuration space of each session is configured with the sending period of packets of various packet types supported by the session. Wherein, in the same session, the sending period of packets of different packet types may be the same or different, which is not specifically limited in this embodiment of the present disclosure. As an optional implementation manner, when the hardware logic accesses the trigger configuration space of the session, it is judged whether the packets of various packet types meet the triggering conditions according to whether the current moment satisfies the transmission period of the packets of various packet types. Only when the moment when the hardware logic accesses the trigger configuration space of the session meets the sending period of the message, the message information of the message whose sending period is satisfied is written into the on-chip storage device through step S130, and the message is further assembled and transmitted by the hardware logic. , thereby ensuring the sending period of various types of packets.

相应地,在一些实施例中,所述触发配置信息还包括各种所述报文类型的报文的发送周期,参照图3,步骤S121包括:Correspondingly, in some embodiments, the trigger configuration information further includes the sending period of the packets of various types of the packets. Referring to FIG. 3 , step S121 includes:

在步骤S1211中,判断所述报文类型的报文的发送周期是否满足;In step S1211, it is judged whether the sending period of the message of the message type is satisfied;

在所述报文类型的报文的发送周期满足的情况下,判定所述报文类型的报文的触发条件满足;In the case that the sending period of the message of the message type is satisfied, it is determined that the trigger condition of the message of the message type is satisfied;

在所述报文类型的报文的发送周期不满足的情况下,判定所述报文类型的报文的触发条件不满足。In the case that the sending period of the message of the message type is not satisfied, it is determined that the triggering condition of the message of the message type is not satisfied.

本公开实施例对于如何执行步骤S211以判断报文的发送周期是否满足不作特殊限定。例如,可以根据定时器的基准脉冲(3.33ms),当报文的发送周期对应的基准脉冲到来时,则表示报文的发送周期满足。This embodiment of the present disclosure does not make any special limitation on how to execute step S211 to determine whether the sending period of the packet is satisfied. For example, according to the reference pulse (3.33ms) of the timer, when the reference pulse corresponding to the sending period of the message arrives, it means that the sending period of the message is satisfied.

本公开实施例还支持首包发送。需要说明的是,在周期性发送报文的过程的起始时刻,第一次发送报文即为首包发送。在本公开实施例中,当某种报文类型的报文为首包发送时,则判定该报文类型的报文的触发条件满足,并通过步骤S130将发送周期满足的报文的报文信息写入片上存储设备,并由硬件逻辑进一步组装报文并传输。This embodiment of the present disclosure also supports sending the first packet. It should be noted that, at the beginning of the process of periodically sending a message, the first time a message is sent is the first packet sending. In the embodiment of the present disclosure, when a message of a certain message type is sent as the first packet, it is determined that the trigger condition of the message of the message type is satisfied, and the message information of the message whose transmission period is satisfied is sent through step S130. Writes to the on-chip storage device, and further assembles the message by hardware logic and transmits it.

相应地,参照图3,在一些实施例中,在步骤S1211之前,步骤S121还包括:Correspondingly, referring to FIG. 3, in some embodiments, before step S1211, step S121 further includes:

在步骤S1212中,判断所述报文类型的报文是否为首包发送;In step S1212, determine whether the message of the message type is sent as the first packet;

在所述报文类型的报文为首包发送的情况下,判定所述报文类型的报文的触发条件满足;In the case that the message of the message type is sent as the first packet, it is determined that the trigger condition of the message of the message type is satisfied;

在所述报文类型的报文非首包发送的情况下,执行步骤S1211。In the case that the message of the message type is not sent as the first packet, step S1211 is performed.

在一些实施例中,参照图3,在步骤S1212之前,步骤S121还包括:In some embodiments, referring to FIG. 3, before step S1212, step S121 further includes:

在步骤S1213中,判断所述报文类型的报文的发送条件是否满足;In step S1213, it is judged whether the sending condition of the message of the message type is satisfied;

在所述报文类型的报文的发送条件满足的情况下,执行步骤S1212;In the case that the sending condition of the message of the message type is satisfied, step S1212 is performed;

在所述报文类型的报文的发送条件不满足的情况下,判定所述报文类型的报文的触发条件不满足。In the case that the sending condition of the message of the message type is not satisfied, it is determined that the triggering condition of the message of the message type is not satisfied.

本公开实施例对如何判断报文的发送条件是否满足不做特殊限定。例如,可以根据对链路性能的监测判断报文的发送条件是否满足,当需要对链路的丢包、时延和抖动等进行衡量以及对各类流量进行统计时,判定报文的发送条件满足;也可以根据对链路故障侦测和告警判断报文的发送条件是否满足,当需要对链路故障进行侦测时判定报文的发送条件满足;还可以根据对链路的环路测试判断报文的发送条件是否满足,当需要对链路中是否存在环路时,判定报文的发送条件满足。The embodiments of the present disclosure do not make special restrictions on how to determine whether the sending conditions of the packets are satisfied. For example, it is possible to judge whether the conditions for sending packets are satisfied according to the monitoring of link performance. When it is necessary to measure the packet loss, delay, and jitter of the link, and to collect statistics on various types of traffic, the conditions for sending packets can be judged. Satisfied; it can also judge whether the transmission conditions of the packets are satisfied according to the link failure detection and alarm, and determine whether the transmission conditions of the packets are satisfied when the link failure needs to be detected; it can also be determined according to the loop test of the link It is judged whether the sending conditions of the packets are satisfied. When it is necessary to check whether there is a loop in the link, it is judged that the sending conditions of the packets are satisfied.

在本公开实施例中,板载MCU上运行的软件在会话的触发配置空间配置的触发配置信息中,还包括发送使能信息,发送使能信息能够定义会话的发送使能是否开启,硬件逻辑通过判断发送使能是否开启来判断会话是否支持发送报文以及会话支持发送的报文类型。In the embodiment of the present disclosure, the software running on the onboard MCU further includes sending enable information in the trigger configuration information configured in the trigger configuration space of the session. The sending enable information can define whether the sending enable of the session is enabled, and the hardware logic Determine whether the session supports sending packets and the type of packets that the session supports by judging whether the sending enable is enabled.

相应地,在一些实施例中,所述触发配置信息还包括所述当前会话的发送使能信息,参照图3,在步骤S1213之前,步骤S121还包括:Correspondingly, in some embodiments, the trigger configuration information further includes sending enable information of the current session. Referring to FIG. 3, before step S1213, step S121 further includes:

在步骤S1214中,根据所述发送使能信息判断所述当前会话的发送使能是否开启;In step S1214, according to the sending enable information, determine whether the sending enable of the current session is enabled;

在所述当前会话的发送使能开启的情况下,执行步骤S1213;In the case that the sending enable of the current session is enabled, step S1213 is performed;

在所述当前会话的发送使能未开启的情况下,判定所述报文类型的报文的触发条件不满足。In the case that the sending enable of the current session is not enabled, it is determined that the triggering condition of the message of the message type is not satisfied.

在本公开实施例中,当前会话的发送使能包括全局使能,全局使能开启表示当前会话支持发送报文;发送使能还包括多个会话使能,每一个会话使能对应一种报文类型,例如,会话使能包括CV/BFD使能、CSF使能、APS使能等,会话使能开启表示当前会话支持该会话使能对应的报文类型。In the embodiment of the present disclosure, the sending enable of the current session includes a global enable, and the global enable is turned on to indicate that the current session supports sending packets; the sending enable also includes multiple session enables, and each session enable corresponds to a message The message type, for example, the session enable includes CV/BFD enable, CSF enable, APS enable, etc. The session enable enable indicates that the current session supports the message type corresponding to the session enable.

在本公开实施例中,硬件逻辑通过访问会话的触发配置空间,分别判断各种报文类型的报文是否满足触发条件,当至少一种报文类型的报文的触发条件满足时,则判定会话需要发送报文。此时,触发条件满足的报文即为会话需要发送的报文。需要说明的是,同一会话同时可以有一种或多种报文类型的报文需要发送。In the embodiment of the present disclosure, the hardware logic separately determines whether the packets of various packet types satisfy the triggering conditions by accessing the trigger configuration space of the session, and when the triggering conditions of the packets of at least one type of packet are satisfied, then determine whether the packets of the various packet types satisfy the triggering conditions Sessions need to send messages. In this case, the packets that satisfy the trigger conditions are the packets that need to be sent by the session. It should be noted that, the same session may have one or more types of packets to be sent at the same time.

需要说明的是,在本公开实施例中,发送报文时,报文中通常需要携带某些信息,例如,在CSF报文中携带信号失效原因信息sf_reason。作为一种可选的实施方式,本公开实施例中的硬件逻辑根据会话的协议类型、会话需要发送的报文的报文类型、报文需要携带的信息生成报文并传输。It should be noted that, in the embodiment of the present disclosure, when a message is sent, the message usually needs to carry some information, for example, the signal failure reason information sf_reason is carried in the CSF message. As an optional implementation manner, the hardware logic in the embodiment of the present disclosure generates and transmits the message according to the protocol type of the session, the message type of the message to be sent by the session, and the information to be carried in the message.

相应地,在一些实施例中,触发条件满足的报文为所述当前会话需要发送的报文,所述触发配置信息还包括所述当前会话的协议类型、各种所述报文类型的报文的待携带信息,所述报文信息包括所述当前会话的协议类型、触发条件满足的报文的报文类型、触发条件满足的报文的待携带信息。Correspondingly, in some embodiments, the packet that satisfies the trigger condition is the packet that needs to be sent by the current session, and the trigger configuration information further includes the protocol type of the current session, and the packets of various types of the packet. information to be carried of the message, where the message information includes the protocol type of the current session, the message type of the message that satisfies the trigger condition, and the to-be-carried information of the message that satisfies the trigger condition.

在本公开实施例中,硬件逻辑逐个访问片上存储设备中的触发配置空间,判断各个会话是否需要发送报文。本公开实施例对于如何逐个访问片上存储设备中的触发配置空间不做特殊限定。作为一种可选的实施方式,可以通过轮询方式访问片上存储设备中的触发配置空间,并判断会话是否需要发送报文。In the embodiment of the present disclosure, the hardware logic accesses the trigger configuration space in the on-chip storage device one by one to determine whether each session needs to send a message. This embodiment of the present disclosure does not specifically limit how to access the trigger configuration space in the on-chip storage device one by one. As an optional implementation manner, the trigger configuration space in the on-chip storage device can be accessed in a polling manner, and it is determined whether the session needs to send a message.

相应地,参照图4,在一些实施例中,所述报文传输控制方法还包括:Correspondingly, referring to FIG. 4 , in some embodiments, the packet transmission control method further includes:

在步骤S140中,根据配置的需要轮询的所述会话的数量和轮询粒度,从当前会话的下一个会话的触发配置空间中读取所述下一个会话的触发配置信息,以实现对多个所述会话的轮询,其中,所述轮询粒度表示轮询前后两个所述会话的时间间隔。In step S140, according to the configured number of the sessions to be polled and the polling granularity, the trigger configuration information of the next session is read from the trigger configuration space of the next session of the current session, so as to realize a multi-to-many polling of the sessions, wherein the polling granularity represents the time interval between the two sessions before and after the polling.

需要说明的是,在本公开实施例中,对多个会话的轮询是周期性执行的,在每个轮询周期内对需要轮询的多个会话都进行轮询。能够保证对同一个会话的前后两次轮询的时间间隔为轮询周期,从而保证发送精度。例如,多个会话的会话标识为从0开始连续编号的会话号,当轮询周期到来时,硬件逻辑首先访问会话号0对应的触发配置空间,判断会话号0的会话是否需要发送报文;然后将会话号加1,访问会话号1对应的触发配置空间,判断会话号1的会话是否需要发送报文……依此类推,直至对所有所有会话号对应的触发配置空间都进行访问;然后将要访问的会话号重置为0,当下一个轮询周期到来时,再次从会话0开始发起轮询。It should be noted that, in this embodiment of the present disclosure, the polling of multiple sessions is performed periodically, and multiple sessions that need to be polled are polled in each polling period. It can be ensured that the time interval between the two polling before and after the same session is the polling cycle, thereby ensuring the transmission accuracy. For example, the session identifiers of multiple sessions are session numbers that are consecutively numbered from 0. When the polling cycle arrives, the hardware logic first accesses the trigger configuration space corresponding to session number 0 to determine whether the session with session number 0 needs to send messages; Then add 1 to the session number, access the trigger configuration space corresponding to session number 1, and determine whether the session of session number 1 needs to send a message... and so on, until the trigger configuration space corresponding to all session numbers is accessed; then Reset the session number to be accessed to 0, and start polling from session 0 again when the next polling cycle comes.

在本公开实施例中,硬件逻辑根据配置的需要轮询的所述会话的数量和轮询粒度对多个会话进行轮询,能够使一个轮询周期内对多个会话的轮询时刻在轮询周期内均匀分布,从而有效平滑突发流量。In this embodiment of the present disclosure, the hardware logic polls multiple sessions according to the configured number of the sessions that need to be polled and the polling granularity, so that the polling time of multiple sessions in one polling period can be It is evenly distributed in the query period, so as to effectively smooth the burst traffic.

作为一种可选的实施方式,每次定时器的基准脉冲到来时,硬件逻辑发起对多个会话的轮询,即轮询周期为3.33ms。As an optional implementation manner, every time the reference pulse of the timer arrives, the hardware logic initiates polling of multiple sessions, that is, the polling period is 3.33 ms.

相应地,在一些实施例中,需要轮询的所述会话的数量和轮询粒度满足公式(1):Accordingly, in some embodiments, the number of the sessions that need to be polled and the polling granularity satisfy formula (1):

基准脉冲周期=需要轮询的所述会话的数量×轮询粒度 (1)Baseline pulse period = number of said sessions that need to be polled x polling granularity (1)

参照图4,所述报文传输控制方法还包括:4, the message transmission control method further includes:

在步骤S150中,响应于基准脉冲,发起对多个所述会话的轮询。In step S150, in response to the reference pulse, polling of a plurality of said sessions is initiated.

在本公开实施例中,硬件逻辑响应于基准脉冲发起对多个会话的轮询能够保证每个会话前后两次轮询的时间间隔都为3.33ms,并能够使误差达到纳秒级别;以基准脉冲作为轮询周期还能够保证在会话中任意一种报文类型的报文的发送周期满足时,硬件逻辑都发起对多个会话的轮询,从而能够保证报文的发送周期。In the embodiment of the present disclosure, the hardware logic initiating the polling of multiple sessions in response to the reference pulse can ensure that the time interval between two pollings before and after each session is 3.33ms, and the error can reach the nanosecond level; The pulse as the polling period can also ensure that when the sending period of any type of message in the session is satisfied, the hardware logic initiates polling of multiple sessions, thereby ensuring the sending period of the packets.

第二方面,参照图5,本公开实施例提供一种报文生成方法,包括:In the second aspect, referring to FIG. 5 , an embodiment of the present disclosure provides a method for generating a message, including:

在步骤S210中,从片上存储设备中读取目标会话的会话标识和所述目标会话需要发送的报文的报文信息;In step S210, read the session identifier of the target session and the message information of the message that the target session needs to send from the on-chip storage device;

在步骤S220中,在根据所述目标会话的会话标识,从所述目标会话的组包配置空间读取所述目标会话的组包配置信息和报文模板,其中,所述片上存储设备中包括多个组包配置空间,每一个所述组包配置空间对应一个会话,所述目标会话为多个所述会话中的一者;In step S220, according to the session identifier of the target session, the grouping configuration information and the message template of the target session are read from the grouping configuration space of the target session, wherein the on-chip storage device includes A plurality of group configuration spaces, each of the group configuration spaces corresponds to a session, and the target session is one of the plurality of sessions;

在步骤S230中,根据所述报文信息、所述组包配置信息和所述报文模板生成所述目标会话的待传输报文;In step S230, the to-be-transmitted message of the target session is generated according to the message information, the packet configuration information and the message template;

在步骤S240中,将所述待传输报文写入所述片上存储设备。In step S240, the to-be-transmitted message is written into the on-chip storage device.

在本公开实施例中,步骤S210中硬件逻辑从片上存储设备中读取的目标会话的会话标识和所述目标会话需要发送的报文的报文信息,是硬件逻辑通过本公开实施例第一方面所述的报文传输控制方法写入到所述片上存储设备中的。In the embodiment of the present disclosure, the session identifier of the target session read by the hardware logic from the on-chip storage device in step S210 and the message information of the message to be sent by the target session are the first step of the hardware logic in the embodiment of the present disclosure. The message transmission control method described in the aspect is written into the on-chip storage device.

作为一种可选的实施方式,硬件逻辑从片上存储设备中的FIFO存储器中读取目标会话的会话标识和所述目标会话需要发送的报文的报文信息。As an optional implementation manner, the hardware logic reads the session identifier of the target session and the message information of the message to be sent by the target session from the FIFO memory in the on-chip storage device.

需要说明的是,片上存储设备中可以同时存储有多个会话的会话标识以及对应的多个会话需要发送的报文的报文信息。本公开实施例所述的目标会话是指上述多个会话中硬件逻辑正在处理的会话,而不用于特指某一个会话。It should be noted that the on-chip storage device may simultaneously store session identifiers of multiple sessions and packet information of packets to be sent by the corresponding multiple sessions. The target session described in the embodiments of the present disclosure refers to the session being processed by the hardware logic among the above-mentioned multiple sessions, and is not used to refer to a specific session.

在本公开实施例中,在片上存储设备中为多个会话分配了用于存储各个会话的组包配置信息和报文模板的组包配置空间,组包配置空间中会话的组包配置信息和报文模板由板载MCU上运行的软件配置。硬件逻辑根据从片上存储设备中读取的会话标识访问对应的组包配置空间。本公开实施例对于会话的会话标识的具体形式不做特殊限定。例如,会话标识可以是会话的会话号。In the embodiment of the present disclosure, a grouping configuration space for storing grouping configuration information and message templates of each session is allocated to a plurality of sessions in the on-chip storage device, and the grouping configuration information of the session in the grouping configuration space and The message template is configured by software running on the onboard MCU. The hardware logic accesses the corresponding group package configuration space according to the session ID read from the on-chip storage device. The embodiment of the present disclosure does not specifically limit the specific form of the session identifier of the session. For example, the session identification may be the session number of the session.

在本公开实施例中,为每个会话配置了报文模板。作为一种可选的实施方式,同一会话的不同报文类型的报文共享同一个报文模板。需要说明的是,不同报文类型的报文共享同一个报文模板是指,在报文模板中预先配置了不同报文类型的报文共享的内容,例如,在报文模板中,不同报文类型的报文共享目的地址(DA,Destination Address)、源地址(SA,Source Address)、虚拟局域网(VLAN,Virtual Local Area Network)标签、ACH等报文头内容和下发头、以及其他用户自定义内容。在片上存储设备中只存储报文模板,而不需要存储各种报文类型的完整报文;在根据报文模板生成待传输报文时,只需配置报文模板中共享内容以外的字段,而不需要对完整的报文进行处理,从而节约了存储资源和计算资源。In the embodiment of the present disclosure, a message template is configured for each session. As an optional implementation manner, packets of different packet types in the same session share the same packet template. It should be noted that the fact that packets of different packet types share the same packet template means that the content shared by packets of different packet types is preconfigured in the packet template. The messages of the message type share the destination address (DA, Destination Address), source address (SA, Source Address), virtual local area network (VLAN, Virtual Local Area Network) label, ACH and other message header content and delivery header, and other users custom content. Only the message template is stored in the on-chip storage device, and it is not necessary to store the complete messages of various message types. There is no need to process complete packets, thereby saving storage resources and computing resources.

作为一种可选的实施方式,在本公开实施例中,组包配置空间中组包配置信息和报文模板的部分或全部信息可以共享,从而进一步节约存储资源。As an optional implementation manner, in this embodiment of the present disclosure, part or all of the packet configuration information and the packet template information in the packet configuration space may be shared, thereby further saving storage resources.

在本公开实施例中,每个会话的协议类型可配置,本公开实施例对于可配置的协议类型不做特殊限定。例如,协议类型包括但不限于:以太网OAM、MPLS_TP OAM、BFD。此外,本公开实施例还支持自定义的OAM协议类型,自定义的OAM协议类型可以用于协议扩展。需要说明的是,在本公开实施例中,当会话配置自定义的OAM协议类型时,会话可以发送任意类型的报文。In the embodiment of the present disclosure, the protocol type of each session is configurable, and the embodiment of the present disclosure does not specifically limit the configurable protocol type. For example, the protocol types include but are not limited to: Ethernet OAM, MPLS_TP OAM, BFD. In addition, the embodiment of the present disclosure also supports a custom OAM protocol type, and the custom OAM protocol type can be used for protocol extension. It should be noted that, in this embodiment of the present disclosure, when a user-defined OAM protocol type is configured for a session, the session can send any type of packets.

在本公开实施例中,每个会话均能够发送多种报文类型的OAM报文,本公开实施例对报文类型不做特殊限定。例如,报文类型可以包括CV、BFD、CSF、APS、AIS等,还可以是2544报文、LSP报文等。此外,本公开实施例还支持自定义报文类型,自定义报文类型可以用于扩展。In the embodiment of the present disclosure, each session can send OAM packets of multiple packet types, and the embodiment of the present disclosure does not specifically limit the packet types. For example, the packet types may include CV, BFD, CSF, APS, AIS, etc., and may also be 2544 packets, LSP packets, and the like. In addition, the embodiments of the present disclosure also support custom message types, and the custom message types can be used for expansion.

相应地,在步骤S210中,硬件逻辑从片上存储设备中读取的会话标识对应的目标会话的协议类型可以是多种协议类型中的任意一种,例如,可以是以太网OAM、MPLS_TPOAM、BFD、自定义协议类型中的任意一种。在步骤S230中,根据硬件逻辑从片上存储设备中的读取的报文信息生成的待传输报文的报文类型可以是多种报文类型中的任意一种,例如,可以是CV、BFD、CSF、APS、AIS、自定义报文类型中的任意一种。本公开实施例对此不做特殊限定。Correspondingly, in step S210, the protocol type of the target session corresponding to the session identifier read by the hardware logic from the on-chip storage device may be any one of multiple protocol types, for example, may be Ethernet OAM, MPLS_TPOAM, BFD , any of the custom protocol types. In step S230, the message type of the to-be-transmitted message generated from the read message information in the on-chip storage device according to the hardware logic may be any one of multiple message types, for example, may be CV, BFD , CSF, APS, AIS, and any of the user-defined packet types. This embodiment of the present disclosure makes no special limitation on this.

作为一种可选的实施方式,片上存储设备中包括调度缓存,在步骤S240中,硬件逻辑将待传输报文写入片上存储设备中的调度缓存中,并进一步由硬件逻辑调度传输待传输报文。作为一种可选的实施方式,调度缓存为FIFO存储器。As an optional implementation manner, the on-chip storage device includes a scheduling buffer. In step S240, the hardware logic writes the to-be-transmitted message into the scheduling buffer in the on-chip storage device, and further schedules the transmission of the to-be-transmitted message by the hardware logic. arts. As an optional implementation manner, the scheduling buffer is a FIFO memory.

在本公开实施例提供的报文生成方法中,在片上存储设备中为多个会话分配了用于存储各个会话的组包配置信息和报文模板的组包配置空间,硬件逻辑读取组包配置空间中的组包配置信息和报文模板生成待传输报文,其中,各个会话的协议类型可以是多种协议类型中的任意一种,生成的待传输报文可以是多种报文类型中的任意一种,保证了灵活性和扩展性;在片上存储设备中只存储报文模板,而不需要存储各种报文类型的完整报文;在根据报文模板生成待传输报文时,只需配置报文模板中共享内容以外的字段,而不需要对完整的报文进行处理,从而节约了存储资源和计算资源。In the packet generation method provided by the embodiment of the present disclosure, a packet configuration space for storing packet configuration information and packet templates of each session is allocated to a plurality of sessions in an on-chip storage device, and hardware logic reads the packet. Packet configuration information and message templates in the configuration space generate messages to be transmitted, where the protocol type of each session can be any one of multiple protocol types, and the generated messages to be transmitted can be of multiple message types Any one of them ensures flexibility and scalability; only the message template is stored in the on-chip storage device, and it is not necessary to store complete messages of various message types; when generating the message to be transmitted according to the message template , you only need to configure fields other than the shared content in the message template, and do not need to process the complete message, thus saving storage resources and computing resources.

在本公开实施例中,报文模板中配置有多种报文类型的报文共享的内容。硬件逻辑根据从片上存储设备中读取的报文信息、从组包配置空间中读取的组包配置信息,替换报文模板中多种报文类型的报文共享的内容以外的字段,即可生成待传输报文。In this embodiment of the present disclosure, the message template is configured with content shared by messages of multiple message types. The hardware logic replaces the fields other than the content shared by the packets of multiple packet types in the packet template according to the packet information read from the on-chip storage device and the packet configuration information read from the packet configuration space, that is, A message to be transmitted can be generated.

相应地,参照图6,在一些实施例中,步骤S230包括:Correspondingly, referring to FIG. 6 , in some embodiments, step S230 includes:

在步骤S231中,根据所述报文信息替换所述报文模板中的相应字段;In step S231, replace the corresponding field in the message template according to the message information;

在步骤S232中,根据所述组包配置信息替换所述报文模板中的私有头字段。In step S232, the private header field in the message template is replaced according to the packet configuration information.

需要说明的是,在本公开实施例中,对应于同一报文模板,生成不同报文类型的报文,需要替换的报文模板中的字段可以相同、也可以不同;报文模板不同,生成相同报文类型的报文,需要替换的报文模板中的字段可以相同、也可以不同。本公开实施例对此不做特殊限定。硬件逻辑根据从片上存储设备中读取的报文信息确定需要发送的报文的报文类型。It should be noted that, in the embodiment of the present disclosure, corresponding to the same message template, to generate messages of different message types, the fields in the message templates that need to be replaced may be the same or different; For packets of the same packet type, the fields in the packet template to be replaced can be the same or different. This embodiment of the present disclosure makes no special limitation on this. The hardware logic determines the message type of the message to be sent according to the message information read from the on-chip storage device.

还需要说明的是,在本公开实施例中,相应字段是指报文模板中能够承载报文信息的字段。It should also be noted that, in this embodiment of the present disclosure, a corresponding field refers to a field in the message template that can carry message information.

相应地,在一些实施例中,所述报文信息包括所述目标会话的协议类型、所述目标会话需要发送的报文的报文类型、所述目标会话需要发送的报文的待携带信息,参照图7,步骤S231包括:Correspondingly, in some embodiments, the packet information includes the protocol type of the target session, the packet type of the packet to be sent by the target session, and the to-be-carried information of the packet to be sent by the target session. , referring to FIG. 7, step S231 includes:

在步骤S2311中,根据所述目标会话的协议类型、所述目标会话需要发送的报文类型、所述目标会话需要发送的报文的待携带信息,替换所述报文模板中的相应字段。In step S2311, the corresponding fields in the message template are replaced according to the protocol type of the target session, the message type to be sent by the target session, and the to-be-carried information of the message to be sent by the target session.

相应地,在一些实施例中,所述组包配置信息包括报文长度、报文偏移值,参照图7,步骤S232包括:Correspondingly, in some embodiments, the grouping configuration information includes packet length and packet offset value. Referring to FIG. 7 , step S232 includes:

在步骤S2321中,根据所述报文长度、所述报文偏移值替换所述报文模板中的私有头字段。In step S2321, the private header field in the message template is replaced according to the message length and the message offset value.

在本公开实施例中,硬件逻辑同时完成报文选路及报文模板中私有头字段的替换,从而减轻中央处理器(CPU,Central Processing Unit)的处理开销。In the embodiment of the present disclosure, the hardware logic simultaneously completes the packet routing and the replacement of the private header field in the packet template, thereby reducing the processing overhead of a central processing unit (CPU, Central Processing Unit).

相应地,参照图7,在一些实施例中,步骤S232还包括:Correspondingly, referring to FIG. 7 , in some embodiments, step S232 further includes:

在步骤S232中,根据所述组包配置信息进行报文选路。In step S232, packet routing is performed according to the packet configuration information.

在本公开实施例中,报文模板中还包括全局配置字段,全局配置字段用于减少CPU操作。本公开实施例中,硬件逻辑根据全局配置替换报文模板中的全局配置字段,从而进一步较少CPU开销。In this embodiment of the present disclosure, the message template further includes a global configuration field, and the global configuration field is used to reduce CPU operations. In the embodiment of the present disclosure, the hardware logic replaces the global configuration field in the message template according to the global configuration, thereby further reducing the CPU overhead.

相应地,参照图8,在一些实施例中,步骤S230还包括:Correspondingly, referring to FIG. 8 , in some embodiments, step S230 further includes:

在步骤S233中,根据全局配置信息,替换所述初始报文中对应的全局配置字段。In step S233, the corresponding global configuration field in the initial message is replaced according to the global configuration information.

在本公开实施例中,会话支持自定义协议类型和自定义报文类型。作为一种可选的实施方式,当需要发送的报文的报文类型为自定义报文类型时,无需替换报文模板中的字段,直接读取组包配置空间中的报文模板作为待传输报文,从而保证报文的可扩展性。In this embodiment of the present disclosure, the session supports a user-defined protocol type and a user-defined packet type. As an optional implementation manner, when the packet type of the packet to be sent is a custom packet type, it is not necessary to replace the fields in the packet template, and the packet template in the packet configuration space is directly read as the pending packet type. The message is transmitted to ensure the scalability of the message.

相应地,参照图9,在一些实施例中,步骤S230还包括:Correspondingly, referring to FIG. 9 , in some embodiments, step S230 further includes:

在步骤S234中,在所述目标会话需要发送的报文的报文类型为自定义报文的情况下,将所述报文模板作为所述待传输报文。In step S234, when the message type of the message to be sent by the target session is a custom message, the message template is used as the message to be transmitted.

第三方面,参照图10,本公开实施例提供一种报文传输方法,包括:In a third aspect, referring to FIG. 10 , an embodiment of the present disclosure provides a message transmission method, including:

在步骤S310中,从片上存储设备中读取目标待传输报文,所述目标待传输报文为根据本公开实施例第二方面所述的报文生成方法生成并写入缓存的待传输报文;In step S310, the target message to be transmitted is read from the on-chip storage device, where the target message to be transmitted is the message to be transmitted that is generated and written into the cache according to the message generation method described in the second aspect of the embodiment of the present disclosure. arts;

在步骤S320中,传输所述目标待传输报文。In step S320, the target message to be transmitted is transmitted.

在本公开实施例中,片上存储设备中可以同时存储有多个待传输报文,多个待传输报文的报文类型可以相同,也可以不同。本公开实施例对此不做特殊限定。例如,报文类型可以是CV、BFD、CSF、APS、AIS、2544报文、LSP报文等。此外,本公开实施例还支持自定义报文类型,自定义报文类型可以用于扩展。In the embodiment of the present disclosure, the on-chip storage device may store multiple messages to be transmitted at the same time, and the message types of the multiple messages to be transmitted may be the same or different. This embodiment of the present disclosure makes no special limitation on this. For example, the packet type may be CV, BFD, CSF, APS, AIS, 2544 packet, LSP packet, and so on. In addition, the embodiments of the present disclosure also support custom message types, and the custom message types can be used for expansion.

在本公开实施例中,多个待传输报文可以对应于同一个会话,也可以对应于多个会话。本公开实施例对此不做特殊限定。例如,协议类型包括但不限于:以太网OAM、MPLS_TPOAM、BFD。此外,本公开实施例还支持自定义的OAM协议类型,自定义的OAM协议类型可以用于协议扩展。In this embodiment of the present disclosure, multiple packets to be transmitted may correspond to the same session, or may correspond to multiple sessions. This embodiment of the present disclosure makes no special limitation on this. For example, the protocol types include but are not limited to: Ethernet OAM, MPLS_TPOAM, BFD. In addition, the embodiment of the present disclosure also supports a custom OAM protocol type, and the custom OAM protocol type can be used for protocol extension.

作为一种可选的实施方式,片上存储设备中包括调度缓存,在步骤S310中,硬件逻辑从片上存储设备中的调度缓存中读取目标待传输报文。作为一种可选的实施方式,调度缓存为FIFO存储器。As an optional implementation manner, the on-chip storage device includes a scheduling buffer. In step S310, the hardware logic reads the target to-be-transmitted message from the scheduling buffer in the on-chip storage device. As an optional implementation manner, the scheduling buffer is a FIFO memory.

在本公开实施例提供的报文传输方法中,硬件逻辑从片上存储设备中读取硬件逻辑根据本公开实施例第二方面所述的待传输报文并传输。待传输报文的报文类型可以是多种报文类型中的任意一种,待传输报文对应的会话的协议类型可以是多种协议类型中的一种,保证了灵活性和扩展性。In the packet transmission method provided by the embodiment of the present disclosure, the hardware logic reads the to-be-transmitted packet according to the second aspect of the embodiment of the present disclosure and transmits the hardware logic from the on-chip storage device. The packet type of the to-be-transmitted packet may be any one of multiple packet types, and the protocol type of the session corresponding to the to-be-transmitted packet may be one of multiple protocol types, which ensures flexibility and extensibility.

作为一种可选的实施方式,硬件逻辑根据待传输报文的优先级对片上存储设备中的待传输报文进行调度传输。As an optional implementation manner, the hardware logic schedules and transmits the to-be-transmitted packets in the on-chip storage device according to the priority of the to-be-transmitted packets.

相应地,参照图11,在一些实施例中,在步骤S310之前,所述报文传输方法还包括:Correspondingly, referring to FIG. 11 , in some embodiments, before step S310, the message transmission method further includes:

在步骤S331中,确定所述片上存储设备中具有最高优先级的待传输报文;In step S331, determine the message to be transmitted with the highest priority in the on-chip storage device;

在步骤S332中,将具有最高优先级的待传输报文确定为所述目标待传输报文。In step S332, the message to be transmitted with the highest priority is determined as the target message to be transmitted.

本公开实施例对于如何确定片上存储设备中具有最高优先级的待传输报文做特殊限定。作为一种可选的实施方式,硬件逻辑根据整形信号和反压信号确定具有最高优先级的待传输报文。The embodiments of the present disclosure make special restrictions on how to determine the message to be transmitted with the highest priority in the on-chip storage device. As an optional implementation manner, the hardware logic determines the packet to be transmitted with the highest priority according to the shaping signal and the back pressure signal.

在一些实施例中,参照图11,在步骤S310之前,所述报文传输方法还包括In some embodiments, referring to FIG. 11 , before step S310, the message transmission method further includes

在步骤S340中,根据前级缓存空满信号判断所述片上存储设备中是否存在待传输报文;In step S340, it is judged whether there is a message to be transmitted in the on-chip storage device according to the front-level cache empty signal;

在所述片上存储设备中存在待传输报文的情况下,执行步骤S310。If there is a message to be transmitted in the on-chip storage device, step S310 is performed.

第四方面,参照图12,本公开实施例提供一种配置方法,包括:In a fourth aspect, referring to FIG. 12 , an embodiment of the present disclosure provides a configuration method, including:

在步骤S410中,在多个会话的触发配置空间中分别配置各个所述会话的触发配置信息,所述触发配置信息用于判断各个所述会话是否需要发送报文,其中,芯片的片上存储设备中包括多个触发配置空间,每一个所述触发配置空间对应一个会话;In step S410, the trigger configuration information of each of the sessions is respectively configured in the trigger configuration spaces of the multiple sessions, and the trigger configuration information is used to determine whether each of the sessions needs to send a message, wherein the on-chip storage device of the chip including multiple trigger configuration spaces, each of which corresponds to a session;

在步骤S420中,在多个所述会话的组包配置空间中分别配置各个所述会话的组包配置信息和报文模板,所述组包配置信息和所述报文模板用于当所述会话需要发送报文时生成所述会话的待传输报文,其中,所述芯片的片上存储设备中包括多个组包配置空间,每一个所述组包配置空间对应一个会话。In step S420, the grouping configuration information and the message template of each of the sessions are respectively configured in the grouping configuration spaces of the multiple sessions, and the grouping configuration information and the message template are used when the When a session needs to send a packet, a to-be-transmitted packet of the session is generated, wherein the on-chip storage device of the chip includes a plurality of packet configuration spaces, and each of the packet configuration spaces corresponds to a session.

本公开实施例提供的配置方法用于板载MCU对芯片进行配置。板载MCU在芯片的片上存储设备中配置多个会话的触发配置信息,使得芯片的硬件逻辑能够根据本公开实施例第一方面所述的报文传输控制方法判断各个会话是否需要发送报文;板载MCU在芯片的片上存储设备中配置多个会话的组包配置信息和报文模板,使得芯片的硬件逻辑能够根据本公开实施例第二方面所述的报文生成方法生成待传输报文。The configuration method provided by the embodiment of the present disclosure is used for the on-board MCU to configure the chip. The onboard MCU configures the trigger configuration information of multiple sessions in the on-chip storage device of the chip, so that the hardware logic of the chip can judge whether each session needs to send a message according to the message transmission control method described in the first aspect of the embodiment of the present disclosure; The onboard MCU configures the packet configuration information and message templates of multiple sessions in the on-chip storage device of the chip, so that the hardware logic of the chip can generate the message to be transmitted according to the message generation method described in the second aspect of the embodiment of the present disclosure .

在本公开实施例中,板载MCU可以为多个会话配置不同的协议类型。本公开实施例对协议类型不做特殊限定。例如,协议类型包括但不限于:以太网OAM、MPLS_TP OAM、BFD。此外,本公开实施例还支持自定义的OAM协议类型,自定义的OAM协议类型可以用于协议扩展。需要说明的是,在本公开实施例中,当会话配置自定义的OAM协议类型时,会话可以发送任意类型的报文。In the embodiment of the present disclosure, the onboard MCU can configure different protocol types for multiple sessions. This embodiment of the present disclosure does not specifically limit the protocol type. For example, the protocol types include but are not limited to: Ethernet OAM, MPLS_TP OAM, BFD. In addition, the embodiment of the present disclosure also supports a custom OAM protocol type, and the custom OAM protocol type can be used for protocol extension. It should be noted that, in this embodiment of the present disclosure, when a user-defined OAM protocol type is configured for a session, the session can send any type of packets.

在本公开实施例中,板载MCU可以为每个会话配置多种报文类型,以使得每个会话均能够发送多种报文类型的OAM报文。本公开实施例对报文类型不做特殊限定。例如,报文类型可以包括CV、BFD、CSF、APS、AIS等,还可以是2544报文、LSP报文等。此外,本公开实施例还支持自定义报文类型,自定义报文类型可以用于扩展。In the embodiment of the present disclosure, the onboard MCU can configure multiple packet types for each session, so that each session can send OAM packets of multiple packet types. The embodiment of the present disclosure does not specifically limit the packet type. For example, the packet types may include CV, BFD, CSF, APS, AIS, etc., and may also be 2544 packets, LSP packets, and the like. In addition, the embodiments of the present disclosure also support custom message types, and the custom message types can be used for expansion.

在本公开实施例提供的配置方法中,板载MCU在芯片的片上存储设备中为多个会话配置触发配置信息,使得芯片的硬件逻辑能够通过读取触发配置信息,判断各个会话是否需要发送报文;板载MCU在芯片的片上存储设备中为多个会话配置组包配置信息和报文模板,使得芯片的硬件逻辑能够通过读取组包配置空间中的组包配置信息和报文模板生成待传输报文,并使得芯片的硬件逻辑进一步传输待传输报文;板载MCU为多个会话配置多种协议类型,并为每一个会话配置多种报文类型,使得每个会话都能够发送多种报文类型的报文,从而保证了灵活性、扩展性,节约了计算资源、存储资源,还能够有效平滑突发流量,实现高精度发送报文。In the configuration method provided by the embodiment of the present disclosure, the on-board MCU configures trigger configuration information for multiple sessions in the on-chip storage device of the chip, so that the hardware logic of the chip can determine whether each session needs to send a report by reading the trigger configuration information. The onboard MCU configures the packet configuration information and message templates for multiple sessions in the on-chip storage device of the chip, so that the hardware logic of the chip can generate the packet configuration information and packet templates by reading the packet configuration information in the packet configuration space. The message to be transmitted, and make the hardware logic of the chip further transmit the message to be transmitted; the onboard MCU configures multiple protocol types for multiple sessions, and configures multiple packet types for each session, so that each session can send Packets of multiple packet types, thus ensuring flexibility and scalability, saving computing resources and storage resources, effectively smoothing burst traffic, and realizing high-precision packet sending.

在一些实施例中,所述触发配置信息包括所述会话的协议类型、所述会话支持的至少一种报文类型、各种所述报文类型的报文的发送周期、所述会话的发送使能信息、各种所述报文类型的报文的待携带信息中的至少一者。In some embodiments, the trigger configuration information includes a protocol type of the session, at least one packet type supported by the session, a transmission period of packets of various types of packets, and a transmission period of the session. At least one of enabling information and information to be carried in packets of various types of the packets.

在一些实施例中,所述组包配置信息包括报文长度、报文偏移值中的至少一者。In some embodiments, the grouping configuration information includes at least one of a packet length and a packet offset value.

在本公开实施例中,板载MCU在芯片的片上存储设备中配置需要轮询的会话的数量和轮询粒度,以使得芯片的硬件逻辑能够根据配置的需要轮询的会话的数量和轮询粒度对多个会话进行轮询,从而能够使一个轮询周期内对多个会话的轮询时刻在轮询周期内均匀分布,从而有效平滑突发流量。In the embodiment of the present disclosure, the on-board MCU configures the number of sessions to be polled and the polling granularity in the on-chip storage device of the chip, so that the hardware logic of the chip can configure the number of sessions to be polled and the polling granularity according to the configuration The granularity polls multiple sessions, so that the polling time of multiple sessions in one polling period can be evenly distributed in the polling period, thereby effectively smoothing the burst traffic.

相应地,参照图13,在一些实施例中,所述配置方法还包括:Correspondingly, referring to FIG. 13 , in some embodiments, the configuration method further includes:

在步骤S430中,配置需要轮询的所述会话的数量和轮询粒度,所述轮询粒度表示轮询前后两个所述会话的时间间隔。In step S430, the number of the sessions to be polled and the polling granularity are configured, and the polling granularity represents the time interval between the two sessions before and after the polling.

作为一种可选的实施方式,板载MCU在芯片的片上存储设备中配置的需要轮询的会话的数量和轮询粒度满足公式(2):As an optional implementation manner, the number of sessions that need to be polled and the polling granularity configured by the on-board MCU in the on-chip storage device of the chip satisfy formula (2):

基准脉冲周期=需要轮询的所述会话的数量×轮询粒度 (2)Baseline pulse period = number of said sessions that need to be polled x polling granularity (2)

当芯片的片上存储设备中配置的需要轮询的会话的数量和轮询粒度满足公式(2)时,芯片的硬件逻辑在每次定时器的基准脉冲到来时发起对多个会话的轮询,从而既能有效平滑突发流量,还能保证报文的发送周期。When the number of sessions that need to be polled and the polling granularity configured in the chip's on-chip storage device satisfy formula (2), the chip's hardware logic initiates polling for multiple sessions each time the timer's reference pulse arrives. In this way, the burst traffic can be effectively smoothed, and the packet sending period can also be guaranteed.

第五方面,参照图14,本公开实施例提供一种电子设备,其包括:In a fifth aspect, referring to FIG. 14 , an embodiment of the present disclosure provides an electronic device, which includes:

一个或多个处理器101;one or more processors 101;

存储器102,其上存储有一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现实现以下方法中的至少一者:The memory 102, on which one or more programs are stored, when the one or more programs are executed by the one or more processors, causes the one or more processors to implement at least one of the following methods:

根据本公开实施例第一方面所述的报文传输控制方法;The packet transmission control method according to the first aspect of the embodiments of the present disclosure;

根据本公开实施例第二方面所述的报文生成方法;The method for generating a message according to the second aspect of the embodiment of the present disclosure;

根据本公开实施例第三方面所述的报文传输方法;The message transmission method according to the third aspect of the embodiments of the present disclosure;

根据本公开实施例第四方面所述的配置方法。According to the configuration method described in the fourth aspect of the embodiment of the present disclosure.

在一些实施例中,所述电子设备还包括:一个或多个I/O接口103,连接在处理器与存储器之间,配置为实现处理器与存储器的信息交互。In some embodiments, the electronic device further includes: one or more I/O interfaces 103, connected between the processor and the memory, and configured to implement information interaction between the processor and the memory.

其中,处理器101为具有数据处理能力的器件,其包括但不限于中央处理器(CPU)等;存储器102为具有数据存储能力的器件,其包括但不限于随机存取存储器(RAM,更具体如SDRAM、DDR等)、只读存储器(ROM)、带电可擦可编程只读存储器(EEPROM)、闪存(FLASH);I/O接口(读写接口)103连接在处理器101与存储器102间,能实现处理器101与存储器102的信息交互,其包括但不限于数据总线(Bus)等。The processor 101 is a device with data processing capability, including but not limited to a central processing unit (CPU), etc.; the memory 102 is a device with data storage capability, including but not limited to random access memory (RAM, more specifically Such as SDRAM, DDR, etc.), read only memory (ROM), electrified erasable programmable read only memory (EEPROM), flash memory (FLASH); I/O interface (read and write interface) 103 is connected between the processor 101 and the memory 102 , can realize the information interaction between the processor 101 and the memory 102, which includes but is not limited to a data bus (Bus) and the like.

在一些实施例中,处理器101、存储器102和I/O接口103通过总线104相互连接,进而与计算设备的其它组件连接。In some embodiments, processor 101, memory 102, and I/O interface 103 are interconnected by bus 104, which in turn is connected to other components of the computing device.

第六方面,参照图15,本公开实施例提供一种计算机可读介质,其上存储有计算机程序,程序被处理器执行时实现实现以下方法中的至少一者:In a sixth aspect, referring to FIG. 15 , an embodiment of the present disclosure provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, implements at least one of the following methods:

根据本公开实施例第一方面所述的报文传输控制方法;The packet transmission control method according to the first aspect of the embodiments of the present disclosure;

根据本公开实施例第二方面所述的报文生成方法;The method for generating a message according to the second aspect of the embodiment of the present disclosure;

根据本公开实施例第三方面所述的报文传输方法;The message transmission method according to the third aspect of the embodiments of the present disclosure;

根据本公开实施例第四方面所述的配置方法。According to the configuration method described in the fourth aspect of the embodiment of the present disclosure.

为了使本领域技术人员能够更清楚地理解本公开实施例提供的技术方案,下面通过具体的实施例,对本公开实施例提供的技术方案进行详细说明:In order to enable those skilled in the art to more clearly understand the technical solutions provided by the embodiments of the present disclosure, the technical solutions provided by the embodiments of the present disclosure will be described in detail below through specific embodiments:

实施例一Example 1

在本实施例一中,轮询所有会话,根据定时器和告警状态判断当前会话是否需要发送报文。在本实施例一中,当前会话能够发送以太网OAM报文、TP1731报文、bfd报文、自定义报文类型的报文。当当前会话需要发送报文时,硬件逻辑将需要发送的报文的基本信息写入片上存储设备中,需要发送的报文的基本信息包括当前会话的会话号和需要发送的报文的报文类型。In the first embodiment, all sessions are polled, and whether the current session needs to send a message is judged according to the timer and the alarm state. In the first embodiment, the current session can send Ethernet OAM packets, TP1731 packets, bfd packets, and packets of user-defined packet types. When the current session needs to send a message, the hardware logic writes the basic information of the message to be sent into the on-chip storage device. The basic information of the message to be sent includes the session number of the current session and the message of the message to be sent. type.

在本实施例一中,以基准脉冲(3.3ms)为轮询周期。每次定时器的基准脉冲到来时,都从会话0开始发起轮询,这样可以保证每个会话前后两次轮询的间隔都为3.3ms,误差在纳秒级别,从而提高发送精度。In the first embodiment, the reference pulse (3.3ms) is used as the polling period. Every time the reference pulse of the timer arrives, polling is initiated from session 0, which ensures that the interval between two polls before and after each session is 3.3ms, and the error is at the nanosecond level, thereby improving the sending accuracy.

在本实施例一中,对于发送周期为10ms、100ms、1s等场景,由于是3.33ms的整数倍,其对应的基准脉冲和3.33ms脉冲同时拉高,并持续整个轮询周期。In the first embodiment, for scenarios such as the sending period of 10ms, 100ms, 1s, etc., since it is an integer multiple of 3.33ms, the corresponding reference pulse and the 3.33ms pulse are pulled high at the same time, and last for the entire polling period.

在本实施例一中,轮询粒度和轮询的会话数量可配置。例如,主频为主频为1Ghz,总共128K个会话,在某场景下只会使用其中的30k个会话,则将轮询粒度配为100ns,轮询数量配为30k,当基准脉冲(3.3ms)到来时,从会话0开始轮询,100ns后轮询会话1,100ns后轮询会话2,...一直到会话30k结束轮询,30k个会话的轮询时刻在3ms的时间范围内均匀分布。这样可以保证无论有多少个会话在发送报文,无论每个会话配置的报文发送周期多少,都可以有效平滑突发流量,使其均匀分布。In Embodiment 1, the polling granularity and the number of polling sessions are configurable. For example, if the main frequency is 1Ghz, there are 128K sessions in total, and only 30k sessions will be used in a certain scenario, then the polling granularity is set to 100ns, and the number of polls is set to 30k. When the reference pulse (3.3ms) ) comes, start polling from session 0, poll session 1 after 100ns, poll session 2 after 100ns, ... until session 30k ends polling, the polling time of 30k sessions is evenly within the time range of 3ms distributed. This ensures that no matter how many sessions are sending packets and no matter how many packets are sent in each session, the burst traffic can be effectively smoothed and evenly distributed.

实施例二Embodiment 2

在本实施例二中,硬件逻辑从片上存储设备中读取需要发送的报文的报文信息,需要发送的报文的报文信息包括需要发送报文的会话的会话号和需要发送的报文的报文类型;根据需要发送报文的会话的会话号读取组包配置信息和报文模板;然后根据组包配置信息和需要发送的报文的报文类型替换报文模板中的相应字段,组装生成待传输报文;将待传输报文写入缓存。In the second embodiment, the hardware logic reads the message information of the message to be sent from the on-chip storage device, and the message information of the message to be sent includes the session number of the session that needs to send the message and the message to be sent. The message type of the message; read the packet configuration information and the message template according to the session number of the session that needs to send the message; field, assemble and generate the message to be transmitted; write the message to be transmitted into the cache.

在本实施例二中,同一会话的不同报文类型的报文共享同一个报文模板,从而在保证灵活性的同时节约缓存的存储资源和CPU处理资源。报文模板包括DA、SA、VLAN、标签、ACH等报文头内容,以及其他用户可自定义的内容。在本实施例二中,报文模板默认按照cv/bfd报文格式配置。组装生成待传输报文时,从缓存中读取报文模板后,如果需要发送的报文是cv报文,则会替换rdi、seqnum、lm_cnt字段;如果需要发送的报文是bfd报文,则会替换diag、sta、checksum字段;如果是其他报文,则会替换version、opcode、flags、TLV等字段。In the second embodiment, the messages of different message types in the same session share the same message template, thereby saving the storage resources of the cache and the processing resources of the CPU while ensuring flexibility. The packet template includes packet header contents such as DA, SA, VLAN, tag, and ACH, as well as other user-defined contents. In the second embodiment, the message template is configured according to the cv/bfd message format by default. When assembling and generating the message to be transmitted, after reading the message template from the cache, if the message to be sent is a cv message, the rdi, seqnum, and lm_cnt fields will be replaced; if the message to be sent is a bfd message, The diag, sta, and checksum fields will be replaced; for other packets, the version, opcode, flags, TLV and other fields will be replaced.

在本实施例二中,还根据协议类型和全局配置替换报文模板中的全局配置字段,包括最内层标签的TC值、channeltype值、mel值等。In the second embodiment, the global configuration field in the message template is also replaced according to the protocol type and the global configuration, including the TC value, channeltype value, mel value, etc. of the innermost label.

在本实施例二中,如果需要发送的报文是自定义报文类型的报文,则不进行任何替换报文模板字段的操作,直接读取CPU配置的报文模板作为待传输报文,从而保证报文的可扩展性。In the second embodiment, if the message to be sent is a message of a user-defined message type, no operation of replacing the message template field is performed, and the message template configured by the CPU is directly read as the message to be transmitted. So as to ensure the scalability of the message.

实施例三Embodiment 3

OAM报文的发送流程包括:The sending process of OAM message includes:

第一步:板载MCU在芯片的片上存储设备中的触发配置空间中配置每个会话的触发配置信息,包括会话的协议类型(以太oam/MPLS-TP oam/bfd oam/自定义类型),cv/bfd使能,cc使能,lm预激活使能,csf使能,csf发送类型(los/fdi/rdi/dci/soft),csf触发类型(端口告警触发/工作路径流点告警触发/保护路径流点告警触发),csf触发告警索引,aps使能,发送周期,发送周期粒度,发送优先级等;Step 1: The onboard MCU configures the trigger configuration information of each session in the trigger configuration space in the chip's on-chip storage device, including the protocol type of the session (Ethernet oam/MPLS-TP oam/bfd oam/custom type), cv/bfd enable, cc enable, lm pre-activation enable, csf enable, csf sending type (los/fdi/rdi/dci/soft), csf trigger type (port alarm trigger/work path flow point alarm trigger/ Protection path flow point alarm trigger), csf trigger alarm index, aps enable, sending cycle, sending cycle granularity, sending priority, etc.;

第二步:板载MCU在芯片的片上存储设备中的组包配置空间中配置每个会话的组包配置信息,包括会话发送trunk选路逻辑端口id,报文长度,报文偏移值,checksum、ttl、channeltype、gal、label、seqnum替换使能等;Step 2: The onboard MCU configures the grouping configuration information of each session in the grouping configuration space in the on-chip storage device of the chip, including the logical port id of the session sending trunk route selection, the message length, and the message offset value. checksum, ttl, channeltype, gal, label, seqnum replacement enable, etc.;

第三步:板载MCU在芯片的片上存储设备中的组包配置空间中配置每个会话的PDU报文模板;Step 3: The onboard MCU configures the PDU message template of each session in the packet configuration space in the on-chip storage device of the chip;

第四步:板载MCU在芯片的片上存储设备中的组包配置空间中中配置各个会话对应的下发头;Step 4: The on-board MCU configures the delivery header corresponding to each session in the package configuration space in the on-chip storage device of the chip;

第五步:芯片的硬件逻辑周期性地轮询所有会话,对于每个会话的每种报文类型,首先判断全局使能和会话使能是否打开,然后判断发送条件是否满足,若满足发送条件,则再判断是否是首包发送,若是首包,则立即触发,若不是,则判断当前报文配置周期是否与当前周期信号相匹配,为了保证发送周期和发送精度,只有在对应的周期信号拉高时,才进行触发操作;Step 5: The hardware logic of the chip polls all sessions periodically. For each message type of each session, first determine whether the global enable and session enable are turned on, and then determine whether the sending conditions are met. If the sending conditions are met , then judge whether it is the first packet to be sent. If it is the first packet, it will be triggered immediately. If not, judge whether the current packet configuration period matches the current period signal. In order to ensure the transmission period and transmission accuracy, only the corresponding period signal When it is pulled high, the trigger operation is performed;

第六步:芯片的硬件逻辑将需要发送的报文的报文信息写入片上存储设备,需要发送的报文的报文信息包括当前会话的会话号、协议类型、以及需要在报文中携带的待携带信息,如csf报文的sf_reason等。Step 6: The hardware logic of the chip writes the message information of the message to be sent into the on-chip storage device. The message information of the message to be sent includes the session number of the current session, the protocol type, and the message that needs to be carried in the message. The information to be carried, such as sf_reason of csf packets, etc.

第七步:芯片的硬件逻辑根据根据从片上存储设备中读取的会话号读取组包配置信息、PDU报文模板,并根据会话的协议类型、需要发送的报文的报文类型及待替换信息替换PDU报文模板中的字段和私有头中的字段,然后把组装完成的待传输报文写入片上存储设备中的调度缓存;Step 7: The hardware logic of the chip reads the packet configuration information and the PDU message template according to the session number read from the on-chip storage device, and according to the protocol type of the session, the message type of the message to be sent, and the message to be sent. The replacement information replaces the fields in the PDU message template and the fields in the private header, and then writes the assembled message to be transmitted into the scheduling cache in the on-chip storage device;

第八步:芯片的硬件逻辑根据整形信号和后级模块的反压信号进行sp调度,把OAM报文和2544报文发送出去。Step 8: The hardware logic of the chip performs sp scheduling according to the shaping signal and the back pressure signal of the subsequent module, and sends the OAM message and the 2544 message.

至此,一个OAM报文的发送流程完成。So far, the process of sending an OAM packet is completed.

本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其它数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其它存储器技术、CD-ROM、数字多功能盘(DVD)或其它光盘存储、磁盒、磁带、磁盘存储或其它磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其它的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其它传输机制之类的调制数据信号中的其它数据,并且可包括任何信息递送介质。Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, functional modules/units in the systems, and devices can be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical components Components execute cooperatively. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit . Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those of ordinary skill in the art, the term computer storage media includes both volatile and nonvolatile implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules or other data flexible, removable and non-removable media. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices, or may Any other medium used to store desired information and that can be accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and can include any information delivery media, as is well known to those of ordinary skill in the art .

本文已经公开了示例实施例,并且虽然采用了具体术语,但它们仅用于并仅应当被解释为一般说明性含义,并且不用于限制的目的。在一些实例中,对本领域技术人员显而易见的是,除非另外明确指出,否则可单独使用与特定实施例相结合描述的特征、特性和/或元素,或可与其它实施例相结合描述的特征、特性和/或元件组合使用。因此,本领域技术人员将理解,在不脱离由所附的权利要求阐明的本公开的范围的情况下,可进行各种形式和细节上的改变。Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should only be construed in a general descriptive sense and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that features, characteristics and/or elements described in connection with a particular embodiment may be used alone or in combination with other embodiments, unless expressly stated otherwise. Features and/or elements are used in combination. Accordingly, it will be understood by those of ordinary skill in the art that various changes in form and details may be made therein without departing from the scope of the present disclosure as set forth in the appended claims.

Claims (27)

1. A message transmission control method comprises the following steps:
reading trigger configuration information of a current session from a trigger configuration space of the current session, wherein the on-chip storage device comprises a plurality of trigger configuration spaces, each trigger configuration space corresponds to one session, and the current session is one of the plurality of sessions;
judging whether the current session needs to send a message or not according to the trigger configuration information;
and under the condition that the current session needs to send the message, writing the session identifier of the current session and the message information of the message which needs to be sent by the current session into the on-chip storage device.
2. The packet transmission control method according to claim 1, wherein the trigger configuration information includes at least one packet type supported by the current session, and the step of determining whether the current session needs to send a packet according to the trigger configuration information includes:
judging whether the triggering conditions of the messages of various message types are met or not according to the triggering configuration information;
and under the condition that the triggering condition of at least one message in the message types is met, judging that the current session needs to send the message.
3. The message transmission control method according to claim 2, wherein the trigger configuration information further includes transmission periods of messages of various message types, and the step of determining whether the trigger condition of the message type is satisfied according to the trigger configuration information includes:
judging whether the sending period of the message type is satisfied;
and under the condition that the sending period of the message type is met, judging that the triggering condition of the message type is met.
4. The message transmission control method according to claim 3, wherein the step of determining whether the trigger condition of the message type is satisfied according to the trigger configuration information includes, before the step of determining whether the transmission cycle of the message type is satisfied:
judging whether the message of the message type is sent as a first packet or not;
judging that the triggering condition of the message type is met under the condition that the message of the message type is sent as a first packet;
and under the condition that the message of the message type is not sent in the first packet, executing the step of judging whether the sending period of the message type is met.
5. The message transmission control method according to claim 4, wherein the step of determining whether the trigger condition of the message type is satisfied according to the trigger configuration information before the step of determining whether the message of the message type is sent as the first packet further comprises:
judging whether the sending condition of the message type is met;
executing the step of judging whether the message of the message type is sent as the first packet or not under the condition that the sending condition of the message type is met
And under the condition that the sending condition of the message type is not satisfied, judging that the triggering condition of the message type is not satisfied.
6. The message transmission control method according to claim 5, wherein the trigger configuration information further includes transmission enabling information of the current session, and the step of determining whether the trigger condition of the message type is satisfied according to the trigger configuration information further includes, before the step of determining whether the transmission condition of the message type is satisfied:
judging whether the sending enabling of the current session is started or not according to the sending enabling information;
executing a step of judging whether the sending condition of the message type is met or not under the condition that the sending enabling of the current session is started;
and under the condition that the sending enabling of the current session is not started, judging that the triggering condition of the message type is not met.
7. The message transmission control method according to any one of claims 2 to 6, wherein the message whose trigger condition is satisfied is a message that needs to be sent by the current session, the trigger configuration information further includes a protocol type of the current session and information to be carried of messages of various message types, and the message information includes the protocol type of the current session, the message type of the message whose trigger condition is satisfied, and the information to be carried of the message whose trigger condition is satisfied.
8. The message transmission control method according to any of claims 1 to 6, wherein the message transmission control method further comprises:
and reading the trigger configuration information of the next session from the trigger configuration space of the next session of the current session according to the configured number of the sessions needing to be polled and the polling granularity so as to realize polling of a plurality of the sessions, wherein the polling granularity represents the time interval of two sessions before and after polling.
9. The message transmission control method according to claim 8, wherein the number of sessions to be polled and the polling granularity satisfy the following formula:
the reference pulse period is the number of the sessions needing polling x the polling granularity;
the message transmission control method further comprises the following steps:
polling of a plurality of the sessions is initiated in response to a reference pulse.
10. A message generation method comprises the following steps:
reading a session identifier of a target session and message information of a message to be sent by the target session from an on-chip storage device;
reading group package configuration information and a message template of the target session from a group package configuration space of the target session according to a session identifier of the target session, wherein the on-chip storage device comprises a plurality of group package configuration spaces, each group package configuration space corresponds to one session, and the target session is one of the sessions;
generating a message to be transmitted of the target session according to the message information, the group package configuration information and the message template;
and writing the message to be transmitted into the on-chip storage device.
11. The message generation method according to claim 10, wherein the step of generating the message to be transmitted of the target session according to the message information, the group packet configuration information, and the message template includes:
replacing the corresponding field in the message template according to the message information;
and replacing the private header field in the message template according to the group package configuration information.
12. The message generating method according to claim 11, wherein the message information includes a protocol type of the target session, a message type of a message that needs to be sent by the target session, and information to be carried of the message that needs to be sent by the target session, and the step of replacing a corresponding field in the message template according to the message information includes:
and replacing corresponding fields in the message template according to the protocol type of the target session, the message type required to be sent by the target session and the information to be carried by the message required to be sent by the target session.
13. The packet generation method of claim 11, wherein the packet configuration information includes a packet length and a packet offset value, and the step of replacing the private header field in the packet template according to the packet configuration information includes:
and replacing a private header field in the message template according to the message length and the message offset value.
14. The message generation method of claim 13, wherein replacing the private header field in the message template according to the set of packet configuration information comprises further comprising:
and selecting the route of the message according to the group packet configuration information.
15. The packet generation method according to any one of claims 11 to 14, wherein the step of generating the packet to be transmitted of the target session according to the packet information, the group packet configuration information, and the packet template further includes:
and replacing the corresponding global configuration field in the initial message according to the global configuration information.
16. The message generation method according to claim 10, wherein the message information includes a message type of a message that needs to be sent by the target session, and the step of generating the message to be transmitted by the target session according to the message information, the group packet configuration information, and the message template includes:
and under the condition that the message type of the message needing to be sent by the target session is a self-defined message, taking the message template as the message to be transmitted.
17. A message transmission method comprises the following steps:
reading a target message to be transmitted from an on-chip storage device, wherein the target message to be transmitted is a message to be transmitted which is generated according to the message generation method of any one of claims 10 to 16 and is written into a cache;
and transmitting the message to be transmitted by the target.
18. The message transmission method according to claim 17, wherein before the step of reading the target message to be transmitted from the on-chip storage device, the message transmission method further comprises:
determining a message to be transmitted with the highest priority in the on-chip storage device;
and determining the message to be transmitted with the highest priority as the target message to be transmitted.
19. The message transmission method according to claim 18, wherein the step of determining the message to be transmitted with the highest priority in the on-chip storage device comprises:
and determining the message to be transmitted with the highest priority according to the shaping signal and the backpressure signal.
20. The message transmission method according to any of claims 17 to 19, wherein, prior to the step of reading the message to be transmitted from the on-chip storage device, the message transmission method further comprises:
judging whether a message to be transmitted exists in the on-chip storage equipment or not according to a preceding-stage cache empty-full signal;
and under the condition that the message to be transmitted exists in the on-chip storage equipment, executing a step of reading a target message to be transmitted from the on-chip storage equipment.
21. A method of configuration, comprising:
respectively configuring trigger configuration information of each session in trigger configuration spaces of a plurality of sessions, wherein the trigger configuration information is used for judging whether each session needs to send a message or not, an on-chip storage device of a chip comprises a plurality of trigger configuration spaces, and each trigger configuration space corresponds to one session;
respectively configuring group package configuration information and a message template of each session in a plurality of group package configuration spaces of the sessions, wherein the group package configuration information and the message template are used for generating messages to be transmitted of the sessions when the sessions need to send the messages, an on-chip storage device of the chip comprises a plurality of group package configuration spaces, and each group package configuration space corresponds to one session.
22. The configuration method according to claim 21, wherein the trigger configuration information includes at least one of a protocol type of the session, at least one packet type supported by the session, a transmission cycle of packets of each of the packet types, transmission enabling information of the session, and information to be carried by packets of each of the packet types.
23. The configuration method of claim 21, wherein the set of packet configuration information comprises at least one of a packet length, a packet offset value.
24. The configuration method according to any one of claims 20 to 22, wherein the configuration method further comprises:
configuring the number of the sessions needing polling and a polling granularity, wherein the polling granularity represents the time interval between the two sessions before and after polling.
25. The configuration method of claim 24, wherein the number of sessions requiring polling and the polling granularity satisfy the following formula:
the base pulse period is the number of sessions that need to be polled x the polling granularity.
26. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon that, when executed by the one or more processors, cause the one or more processors to implement at least one of the following methods:
the message transmission control method according to any one of claims 1 to 9;
the message generation method according to any one of claims 10 to 16;
the message transmission method according to any one of claims 17 to 20;
the configuration method according to any one of claims 21 to 25.
27. A computer-readable medium, on which a computer program is stored which, when executed by a processor, implements at least one of the following methods:
the message transmission control method according to any one of claims 1 to 9;
the message generation method according to any one of claims 10 to 16;
the message transmission method according to any one of claims 17 to 20;
the configuration method according to any one of claims 21 to 25.
CN202011008846.1A 2020-09-23 2020-09-23 Message transmission control, generation, transmission method and configuration method, device and medium Pending CN114301852A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011008846.1A CN114301852A (en) 2020-09-23 2020-09-23 Message transmission control, generation, transmission method and configuration method, device and medium
PCT/CN2021/119623 WO2022063126A1 (en) 2020-09-23 2021-09-22 Packet transmission control method, packet generation method, packet transmission method, configuration method, device, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011008846.1A CN114301852A (en) 2020-09-23 2020-09-23 Message transmission control, generation, transmission method and configuration method, device and medium

Publications (1)

Publication Number Publication Date
CN114301852A true CN114301852A (en) 2022-04-08

Family

ID=80846223

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011008846.1A Pending CN114301852A (en) 2020-09-23 2020-09-23 Message transmission control, generation, transmission method and configuration method, device and medium

Country Status (2)

Country Link
CN (1) CN114301852A (en)
WO (1) WO2022063126A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116095163A (en) * 2023-01-04 2023-05-09 芜湖雄狮汽车科技有限公司 Batch message sending method, device, electronic equipment and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116155731B (en) * 2023-04-14 2023-06-20 中国人民解放军国防科技大学 A communication control method and device for a control path supporting RMT

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478421A (en) * 2008-12-05 2009-07-08 中兴通讯股份有限公司 OAM packet timing processing system and method
CN102255786A (en) * 2010-05-20 2011-11-23 中国移动通信集团广西有限公司 Service message processing method and device
CN104980293A (en) * 2014-04-02 2015-10-14 深圳市中兴微电子技术有限公司 Method and device for quickly transmitting and detecting OAM message
CN108521343A (en) * 2018-03-26 2018-09-11 烽火通信科技股份有限公司 A kind of processing method and processing device of OAM message

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106470222A (en) * 2015-08-18 2017-03-01 中兴通讯股份有限公司 A kind of document transmission method, device and application server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478421A (en) * 2008-12-05 2009-07-08 中兴通讯股份有限公司 OAM packet timing processing system and method
CN102255786A (en) * 2010-05-20 2011-11-23 中国移动通信集团广西有限公司 Service message processing method and device
CN104980293A (en) * 2014-04-02 2015-10-14 深圳市中兴微电子技术有限公司 Method and device for quickly transmitting and detecting OAM message
CN108521343A (en) * 2018-03-26 2018-09-11 烽火通信科技股份有限公司 A kind of processing method and processing device of OAM message

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116095163A (en) * 2023-01-04 2023-05-09 芜湖雄狮汽车科技有限公司 Batch message sending method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
WO2022063126A1 (en) 2022-03-31

Similar Documents

Publication Publication Date Title
US11722407B2 (en) Packet processing method and apparatus
WO2019033857A1 (en) Packet control method and network device
US9071529B2 (en) Method and apparatus for accelerating forwarding in software-defined networks
CN112825510A (en) Method and device for updating mapping relation
CN110351196B (en) Load balancing method and system based on accurate congestion feedback in cloud data center
CN113711572A (en) Message transmission method and device
WO2018113425A1 (en) Method, apparatus and system for detecting time delay
CN113328902B (en) Network performance detection method and device and network equipment
KR102763178B1 (en) Method and device for controlling data transmission, and storage medium
US12040966B2 (en) Path switching method, device, and system
WO2018210213A1 (en) Method and device for implementing ioam packaging and storage medium
WO2018036173A1 (en) Network load balancing method, device and system
WO2022063126A1 (en) Packet transmission control method, packet generation method, packet transmission method, configuration method, device, and medium
WO2021227947A1 (en) Network control method and device
WO2017036180A1 (en) Packet processing method and device
CN108206787A (en) A kind of congestion-preventing approach and device
US20230318970A1 (en) Packet Processing Method and Apparatus
EP3136633A1 (en) Network module for sending and/or receiving of data packages from a network arrangement and method
CN114513429A (en) Transmission method of detection message, method and device for determining reverse path
WO2021244262A1 (en) Packet processing method, device and system
CN116208547B (en) Message transmission method and device
WO2022257854A1 (en) Message publishing method and apparatus, and forwarding path processing method and apparatus
US12088471B2 (en) Method and apparatus for determining port orientation
WO2023241063A1 (en) Packet processing method, device and system, and storage medium
WO2022048466A1 (en) Operation administration and maintenance (oam) packet processing method and device

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
CB02 Change of applicant information
CB02 Change of applicant information

Country or region after: China

Address after: 2nd Floor, 2nd Floor, ZTE Industrial Park, No. 2 Xili Chuangyan Road, Xili Community, Xili Street, Nanshan District, Shenzhen City, Guangdong Province 518055

Applicant after: SANECHIPS TECHNOLOGY Co.,Ltd.

Address before: 518055 Zhongxing Industrial Park, Liuxian Avenue, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: SANECHIPS TECHNOLOGY Co.,Ltd.

Country or region before: China

CB02 Change of applicant information
CB02 Change of applicant information

Country or region after: China

Address after: 518055, 2nd Floor, ZTE Industrial Park, No. 2 Chuangyan Road, Xili Community, Xili Street, Nanshan District, Shenzhen City, Guangdong Province, China

Applicant after: SANECHIPS TECHNOLOGY Co.,Ltd.

Address before: 2nd Floor, 2nd Floor, ZTE Industrial Park, No. 2 Xili Chuangyan Road, Xili Community, Xili Street, Nanshan District, Shenzhen City, Guangdong Province 518055

Applicant before: SANECHIPS TECHNOLOGY Co.,Ltd.

Country or region before: China