Message Transmission Control, Generation, Transmission Method, Configuration Method, Device, and Medium
By allocating trigger and packet configuration space for each session in an on-chip storage device, the hardware logic judges and generates messages, solving the problem of taking into account both OAM transmission performance and flexibility, and achieving efficient and flexible message transmission.
Patent Information
- Application Number
- CN202011008846.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-23
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2040-09-23
AI Technical Summary
The prior art cannot ensure both OAM transmission performance and flexibility, resulting in excessive OAM message processor resource usage or poor format curing, resulting in poor flexibility and scalability.
The trigger configuration space and group packet configuration space are allocated for each session in the on-chip storage device. The configuration information is read through hardware logic to determine whether to send messages, and generate messages to be transmitted. It supports multiple protocols and message types, including custom protocols and message types.
It realizes efficient message transmission, saves processor resources, supports flexible protocols and message types, smooths burst traffic, and ensures high-precision transmission.
Smart Images

Figure CN114301852B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technologies, and particularly to a method for controlling message transmission, a method for generating a message, a method for transmitting a message, a configuration method, an electronic device, and a computer-readable medium. Background Art
[0002] The operation, administration, and maintenance (OAM) function is crucial for ensuring the quality of service of a network. The OAM function can detect and report the link status in real time, and can perform link error management and provide the ability for fast handover, which helps to improve the reliability of the network. With the development of network communication technologies, increasingly high bandwidth and low latency requirements call for more frequent and rapid network operations. At the same time, the networking mode of telecommunication networks is becoming more and more complex and is in a state of continuous update, and network operations often need to be flexibly used in combination with multiple OAM protocols.
[0003] The prior art cannot achieve both OAM transmission performance and flexibility. Summary of the Invention
[0004] Embodiments of the present disclosure provide a method for controlling message transmission, a method for generating a message, a method for transmitting a message, a configuration method, an electronic device, and a computer-readable medium.
[0005] In a first aspect, embodiments of the present disclosure provide a method for controlling message transmission, including:
[0006] Reading trigger configuration information of the current session from a trigger configuration space of the current session, where a plurality of trigger configuration spaces are included in an on-chip storage device, each of the trigger configuration spaces corresponds to a session, and the current session is one of the plurality of sessions;
[0007] Determining whether the current session needs to send a message according to the trigger configuration information;
[0008] In a case where the current session needs to send a message, writing a session identifier of the current session and message information of the message that the current session needs to send into the on-chip storage device.
[0009] In some embodiments, the trigger configuration information includes at least one message type supported by the current session, and the step of determining whether the current session needs to send a message according to the trigger configuration information includes:
[0010] Determining whether trigger conditions of messages of various message types are satisfied according to the trigger configuration information;
[0011] When the triggering condition of the message of at least one of the multiple message types is satisfied, it is determined that the current session needs to send a message.
[0012] In some embodiments, the triggering configuration information further includes the sending period of the messages of various message types. The step of determining whether the triggering condition of the message of a message type is satisfied according to the triggering configuration information includes:
[0013] Determine whether the sending period of the message of the message type is satisfied;
[0014] When the sending period of the message of the message type is satisfied, it is determined that the triggering condition of the message of the message type is satisfied.
[0015] In some embodiments, before the step of determining whether the sending period of the message of the message type is satisfied, the step of determining whether the triggering condition of the message of the message type is satisfied according to the triggering configuration information includes:
[0016] Determine whether the message of the message type is the first packet to be sent;
[0017] When the message of the message type is the first packet to be sent, it is determined that the triggering condition of the message of the message type is satisfied;
[0018] When the message of the message type is not the first packet to be sent, execute the step of determining whether the sending period of the message of the message type is satisfied.
[0019] In some embodiments, before the step of determining whether the message of the message type is the first packet to be sent, the step of determining whether the triggering condition of the message of the message type is satisfied according to the triggering configuration information further includes:
[0020] Determine whether the sending condition of the message of the message type is satisfied;
[0021] When the sending condition of the message of the message type is satisfied, execute the step of determining whether the message of the message type is the first packet to be sent
[0022] When 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.
[0023] In some embodiments, the triggering configuration information further includes the sending enable information of the current session. Before the step of determining whether the sending condition of the message of the message type is satisfied, the step of determining whether the triggering condition of the message of the message type is satisfied according to the triggering configuration information further includes:
[0024] Determine whether the sending enable of the current session is enabled according to the sending enable information;
[0025] When the transmission enabling of the current session is turned on, perform the step of determining whether the transmission condition of the message of the message type is satisfied;
[0026] When the transmission enabling of the current session is not turned on, determine that the trigger condition of the message of the message type is not satisfied.
[0027] In some embodiments, the message for which the trigger condition is satisfied is the message that needs to be sent in the current session, the trigger configuration information further includes the protocol type of the current session and the information to be carried by the messages of various message types, and the message information includes the protocol type of the current session, the message type of the message for which the trigger condition is satisfied, and the information to be carried by the message for which the trigger condition is satisfied.
[0028] In some embodiments, the message transmission control method further includes:
[0029] According to the number of sessions to be polled and the polling granularity configured, read the trigger configuration information of the next session from the trigger configuration space of the next session of the current session, so as to implement polling of multiple sessions, where the polling granularity represents the time interval between two consecutive sessions during polling.
[0030] In some embodiments, the number of sessions to be polled and the polling granularity satisfy the following formula:
[0031] Reference pulse period = the number of sessions to be polled × polling granularity;
[0032] The message transmission control method further includes:
[0033] In response to a reference pulse, initiate polling of multiple sessions.
[0034] In a second aspect, an embodiment of the present disclosure provides a message generation method, including:
[0035] 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;
[0036] According to the session identifier of the target session, read the packet assembly configuration information and the message template of the target session from the packet assembly configuration space of the target session, where the on-chip storage device includes multiple packet assembly configuration spaces, each packet assembly configuration space corresponds to a session, and the target session is one of the multiple sessions;
[0037] Generate the message to be transmitted of the target session according to the message information, the packet assembly configuration information, and the message template;
[0038] Write the message to be transmitted into the on-chip storage device.
[0039] In some embodiments, the step of generating the message to be transmitted for the target session according to the message information, the packet assembly configuration information, and the message template includes:
[0040] Replace the corresponding fields in the message template according to the message information;
[0041] Replace the private header fields in the message template according to the packet assembly configuration information.
[0042] In some embodiments, the message information includes the protocol type of the target session, the message type of the message to be sent by the target session, and the information to be carried by the message to be sent by the target session. The step of replacing the corresponding fields in the message template according to the message information includes:
[0043] Replace the corresponding fields in the message template according to the protocol type of the target session, the message type of the message to be sent by the target session, and the information to be carried by the message to be sent by the target session.
[0044] In some embodiments, the packet assembly configuration information includes the message length and the message offset value. The step of replacing the private header fields in the message template according to the packet assembly configuration information includes:
[0045] Replace the private header fields in the message template according to the message length and the message offset value.
[0046] In some embodiments, the step of replacing the private header fields in the message template according to the packet assembly configuration information further includes:
[0047] Perform message routing according to the packet assembly configuration information.
[0048] In some embodiments, the step of generating the message to be transmitted for the target session according to the message information, the packet assembly configuration information, and the message template further includes:
[0049] Replace the corresponding global configuration fields in the initial message according to the global configuration information.
[0050] In some embodiments, the message information includes the message type of the message to be sent by the target session. The step of generating the message to be transmitted for the target session according to the message information, the packet assembly configuration information, and the message template includes:
[0051] When the message type of the message to be sent by the target session is a custom message, use the message template as the message to be transmitted.
[0052] In a third aspect, an embodiment of the present disclosure provides a message transmission method, including:
[0053] Read a target message to be transmitted from an on-chip storage device, where the target message to be transmitted is a message to be transmitted that is generated according to the message generation method described in the second aspect of the embodiments of the present disclosure and written into a cache.
[0054] Transmit the target message to be transmitted.
[0055] In some embodiments, before the step of reading a target message to be transmitted from an on-chip storage device, the message transmission method further includes:
[0056] Determine the message to be transmitted with the highest priority in the on-chip storage device.
[0057] Determine the message to be transmitted with the highest priority as the target message to be transmitted.
[0058] In some embodiments, the step of determining the message to be transmitted with the highest priority in the on-chip storage device includes:
[0059] Determine the message to be transmitted with the highest priority according to a shaping signal and a backpressure signal.
[0060] In some embodiments, before the step of reading a target message to be transmitted from an on-chip storage device, the message transmission method further includes:
[0061] Judge whether there is a message to be transmitted in the on-chip storage device according to a pre-stage cache empty / full signal.
[0062] In the case where there is a message to be transmitted in the on-chip storage device, execute the step of reading a target message to be transmitted from the on-chip storage device.
[0063] In a fourth aspect, an embodiment of the present disclosure provides a configuration method, including:
[0064] Respectively configure trigger configuration information of each session in trigger configuration spaces of multiple sessions, where the trigger configuration information is used to judge whether each session needs to send a message. Among them, the on-chip storage device of the chip includes multiple trigger configuration spaces, and each trigger configuration space corresponds to a session.
[0065] Respectively configure packet assembly configuration information and a message template of each session in packet assembly configuration spaces of multiple sessions, where the packet assembly configuration information and the message template are used to generate a message to be transmitted by the session when the session needs to send a message. Among them, the on-chip storage device of the chip includes multiple packet assembly configuration spaces, and each packet assembly configuration space corresponds to a session.
[0066] In some embodiments, the trigger configuration information includes at least one of the protocol type of the session, at least one message type supported by the session, the transmission period of messages of various message types, the transmission enable information of the session, and the information to be carried in messages of various message types.
[0067] In some embodiments, the packet assembly configuration information includes at least one of the message length and the message offset value.
[0068] In some embodiments, the configuration method further includes:
[0069] Configuring the number of sessions to be polled and the polling granularity, where the polling granularity represents the time interval between two consecutive sessions during polling.
[0070] In some embodiments, the number of sessions to be polled and the polling granularity satisfy the following formula:
[0071] Reference pulse period = the number of sessions to be polled × polling granularity.
[0072] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including:
[0073] One or more processors;
[0074] A storage device having stored thereon one or more programs, which when executed by the one or more processors cause the one or more processors to implement at least one of the following methods:
[0075] The message transmission control method according to the first aspect of the embodiments of the present disclosure;
[0076] The message generation method according to the second aspect of the embodiments of the present disclosure;
[0077] The message transmission method according to the third aspect of the embodiments of the present disclosure;
[0078] The configuration method according to the fourth aspect of the embodiments of the present disclosure.
[0079] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable medium having stored thereon a computer program, which when executed by a processor implements at least one of the following methods:
[0080] The message transmission control method according to the first aspect of the embodiments of the present disclosure;
[0081] The message generation method according to the second aspect of the embodiments of the present disclosure;
[0082] The message transmission method according to the third aspect of the embodiments of the present disclosure;
[0083] The configuration method according to the fourth aspect of the embodiments of the present disclosure.
[0084] In the message transmission control method provided by the embodiments of the present disclosure, trigger configuration spaces for storing trigger configuration information of each session are allocated for multiple sessions in the on-chip storage device. The hardware logic determines whether each session needs to send a message by reading the trigger configuration information configured into the trigger configuration space by the software running on the on-board microcontroller unit. The hardware logic can further assemble and transmit the message according to the session identifier and message information of the sessions that need to send messages in the on-chip storage device, so that the processor does not need to spend a large amount of resources to process and store the complete message, ensuring performance; at the same time, in the embodiments of the present disclosure, the protocol type of each session can be configured, each session can send multiple types of messages at the same time, and custom protocol types and message types are supported, ensuring flexibility and scalability; by accessing the trigger configuration space in the on-chip storage device one by one to determine whether a message needs to be sent, it can also effectively smooth the burst traffic and achieve high-precision message sending.
[0085] In the message generation method provided by the embodiments of the present disclosure, packet assembly configuration spaces for storing packet assembly configuration information and message templates of each session are allocated for multiple sessions in the on-chip storage device. The hardware logic reads the packet assembly configuration information and message templates in the packet assembly configuration space to generate the message to be transmitted. Among them, the protocol type of each session can be any one of multiple protocol types, and the generated message to be transmitted can be any one of multiple message types, ensuring flexibility and scalability; only message templates are stored in the on-chip storage device, and complete messages of various message types do not need to be stored; when generating the message to be transmitted according to the message template, only the fields other than the shared content in the message template need to be configured, and the complete message does not need to be processed, thus saving storage resources and computing resources.
[0086] In the message transmission method provided by the embodiments of the present disclosure, the hardware logic reads the message to be transmitted according to the second aspect of the embodiments of the present disclosure from the on-chip storage device and transmits it. The message type of the message to be transmitted can be any one of multiple message types, and the protocol type of the session corresponding to the message to be transmitted can be one of multiple protocol types, ensuring flexibility and scalability.
[0087] In the configuration method provided by the embodiments of the present disclosure, the on-board microcontroller 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 determine whether each session needs to send a message by reading the trigger configuration information; the on-board microcontroller unit configures packet assembly 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 message to be transmitted by reading the packet assembly configuration information and message templates in the packet assembly configuration space, and further enables the hardware logic of the chip to transmit the message to be transmitted; the on-board microcontroller unit configures multiple protocol types for multiple sessions and configures multiple message types for each session, so that each session can send messages of multiple message types, thereby ensuring flexibility and scalability, saving computing resources and storage resources, and also being able to effectively smooth burst traffic and achieve high-precision message sending. Description of the Drawings
[0088] Figure 1 is a flowchart of a message transmission control method in the embodiments of the present disclosure;
[0089] Figure 2 is a flowchart of some steps in another message transmission control method in the embodiments of the present disclosure;
[0090] Figure 3 is a flowchart of some steps in yet another message transmission control method in the embodiments of the present disclosure;
[0091] Figure 4 is a flowchart of some steps in still another message transmission control method in the embodiments of the present disclosure;
[0092] Figure 5 is a flowchart of a message generation method in the embodiments of the present disclosure;
[0093] Figure 6 is a flowchart of some steps in another message generation method in the embodiments of the present disclosure;
[0094] Figure 7 is a flowchart of some steps in yet another message generation method in the embodiments of the present disclosure;
[0095] Figure 8 is a flowchart of some steps in still another message generation method in the embodiments of the present disclosure;
[0096] Figure 9 is a flowchart of some steps in still another message generation method in the embodiments of the present disclosure;
[0097] Figure 10 is a flowchart of a message transmission method in the embodiments of the present disclosure;
[0098] Figure 11It is a flowchart of some steps in another message transmission method in an embodiment of the present disclosure;
[0099] Figure 12 It is a flowchart of a configuration method in an embodiment of the present disclosure;
[0100] Figure 13 It is a flowchart of some steps in another configuration method in an embodiment of the present disclosure;
[0101] Figure 14 It is a block diagram of the composition of an electronic device in an embodiment of the present disclosure;
[0102] Figure 15 It is a block diagram of the composition of a computer-readable medium in an embodiment of the present disclosure. Detailed implementation manners
[0103] To enable those skilled in the art to better understand the technical solutions of the present disclosure, the message transmission control method, message generation method, message transmission method, configuration method, electronic device, and computer-readable medium provided in the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0104] Hereinafter, example embodiments will be described more fully with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of this disclosure to those skilled in the art.
[0105] In the case of no conflict, the embodiments of the present disclosure and the features in the embodiments may be combined with each other.
[0106] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0107] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include the plural forms unless the context clearly indicates otherwise. It will also be understood that when the terms "comprises" and / or "is made of" are used in this specification, it specifies the presence of the stated features, wholes, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their groups.
[0108] Unless otherwise defined, all terms (including technical and scientific terms) used herein shall 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 commonly used dictionaries shall be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and this disclosure, and shall not be interpreted as having an idealized or overly formal meaning unless expressly so defined herein.
[0109] Through research by the inventors of the embodiments of the present disclosure, it is found that in the prior art, in order to ensure the flexibility of OAM, a large amount of resources of the processor are required to process and store complete OAM packets, resulting in very low OAM transmission performance; in order to ensure the OAM transmission performance, the OAM packet format needs to be solidified, resulting in poor flexibility and scalability. Neither the existing software nor hardware implementations of OAM packet transmission can ensure both OAM transmission performance and flexibility at the same time.
[0110] In view of this, in a first aspect, referring to Figure 1 , the embodiments of the present disclosure provide a method for controlling message transmission, including:
[0111] In step S110, read the trigger configuration information of the current session from the trigger configuration space of the current session, where the on-chip storage device includes multiple trigger configuration spaces, each of the trigger configuration spaces corresponds to a session, and the current session is one of the multiple sessions;
[0112] In step S120, determine whether the current session needs to send a message according to the trigger configuration information;
[0113] In step S130, when the current session needs to send a message, write the session identifier of the current session and the message information of the message that the current session needs to send into the on-chip storage device.
[0114] In the embodiments of the present disclosure, trigger configuration spaces for storing the trigger configuration information of each session are allocated in the on-chip storage device, and the trigger configuration information of the sessions in the trigger configuration spaces is configured by software running on the on-board microcontroller unit (MCU).
[0115] In the embodiments of the present disclosure, the protocol type of each session is configurable, and the embodiments of the present disclosure do not make special limitations on the configurable protocol types. For example, the protocol types include, but are not limited to: Ethernet OAM, Multi-Protocol Label Switching Transport Profile (MPLS_TP) OAM, Bidirectional Forwarding Detection (BFD). In addition, the embodiments of the present disclosure also support custom OAM protocol types, and the custom OAM protocol types can be used for protocol extension. It should be noted that in the embodiments of the present disclosure, when a session configures a custom OAM protocol type, the session can send any type of message.
[0116] In the embodiments of the present disclosure, each session is capable of sending OAM messages of multiple message types, and the embodiments of the present disclosure do not make special limitations on the message types. For example, the message types may include Connectivity Verification (CV), BFD, Client Signal Fail (CSF), Automatic Protection Switching (APS), Alarm Indication Signal (AIS), etc., and may also be 2544 messages, Link-State Packet (LSP) messages, etc. In addition, the embodiments of the present disclosure also support custom message types, and the custom message types can be used for extension.
[0117] In the embodiments 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, and it is determined whether the session needs to send a message according to the trigger configuration information. When a message needs to be sent, the session identifier of the session and the message information of the message that the session needs to send are written into the on-chip storage device, so that the hardware logic further assembles and transmits the message according to the session identifier and the message information of the sessions that need to send messages 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.
[0118] In the embodiments of the present disclosure, there is no special limitation on 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 by polling, and it is determined whether a session needs to send a message. It should be noted that in the embodiments of the present disclosure, since there is a time interval between accessing two consecutive trigger configuration spaces in the on-chip storage device and determining whether a message needs to be sent, multiple sessions can be prevented from sending messages at the same moment, thus effectively smoothing the burst traffic; accessing the trigger configuration space in the on-chip storage device one by one to determine whether a message needs to be sent can also achieve high-precision message sending.
[0119] In the embodiments of the present disclosure, there is no special limitation on the specific form of the session identifier of a session. For example, the session identifier can be the session number of the session, and the hardware logic reads the trigger configuration space of each session one by one through the session numbers of multiple sessions. As an alternative implementation, the session identifiers of multiple sessions are session numbers numbered continuously starting from 0. The hardware logic first accesses the trigger configuration space corresponding to session number 0 and determines whether the session with session number 0 needs to send a message; then increments the session number by 1, accesses the trigger configuration space corresponding to session number 1, and determines whether the session with session number 1 needs to send a message... and so on until the trigger configuration space corresponding to the last session number is accessed.
[0120] As an alternative implementation, the on-chip storage device includes a First In First Out (FIFO) memory. In step S130, the hardware logic writes the session identifier of the current session and the message information of the message that the current session needs to send into the FIFO memory in the on-chip storage device.
[0121] In the message transmission control method provided by the embodiments of the present disclosure, a trigger configuration space for storing the trigger configuration information of each session is allocated in the on-chip storage device. The hardware logic determines whether each session needs to send a message by reading the trigger configuration information configured into the trigger configuration space by the software running on the on-board microcontroller unit. The hardware logic can further assemble and transmit messages according to the session identifier and message information of the sessions that need to send messages in the on-chip storage device, so that the processor does not need to spend a large amount of resources to process and store complete messages, ensuring performance; at the same time, in the embodiments of the present disclosure, the protocol type of each session is configurable, each session can send multiple types of messages simultaneously, and custom protocol types and message types are supported, ensuring flexibility and scalability; accessing the trigger configuration space in the on-chip storage device one by one to determine whether a message needs to be sent can also effectively smooth the burst traffic and achieve high-precision message sending.
[0122] In the embodiments 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 the session, all, some, or none of the packets of the multiple packet types supported by the session can be triggered. The embodiments of the present disclosure do not make special limitations on this. In the embodiments 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 the trigger conditions for the packets of various packet types. The hardware logic determines whether the trigger conditions for the packets of various packet types are met by accessing the trigger configuration space of the session. When the trigger conditions for the packets of multiple packet types are not met, it is determined that the session does not need to send packets; otherwise, it is determined that the session needs to send packets.
[0123] Correspondingly, in some embodiments, the trigger configuration information includes at least one packet type supported by the current session. Refer to Figure 2 , step S120 includes:
[0124] In step S121, it is determined whether the trigger conditions for the packets of various said packet types are met according to the trigger configuration information;
[0125] When the trigger conditions for at least one of the packets of the multiple said packet types are met, it is determined that the current session needs to send packets;
[0126] When the trigger conditions for the packets of the multiple said packet types are not met, it is determined that the current session does not need to send packets.
[0127] In the embodiments of the present disclosure, after the OAM connection is established, the two OAM entities at both ends send OAM protocol data units (PDUs, Protocol Data Units) at regular time intervals to detect whether the OAM connection is normal. If an OAM entity at one end does not receive an OAM PDU sent by the OAM entity at the other end within the connection timeout period, it is considered that the OAM connection is interrupted. In the embodiments of the present disclosure, the transmission period of the packets of various packet types supported by the session is configured in the trigger configuration space of each session. Among them, in the same session, the transmission periods of the packets of different packet types can be the same or different, and the embodiments of the present disclosure do not make special limitations on this. As an optional implementation manner, when the hardware logic accesses the trigger configuration space of the session, it determines whether the packets of various packet types meet the trigger conditions according to whether the current time meets the transmission periods of the packets of various packet types. Only when the time when the hardware logic accesses the trigger configuration space of the session meets the transmission period of the packet, the packet information of the packet whose transmission period is met is written into the on-chip storage device through step S130, and the hardware logic further assembles and transmits the packet, thereby ensuring the transmission periods of the packets of various packet types.
[0128] Accordingly, in some embodiments, the trigger configuration information further includes the transmission period of packets of various packet types. Referring to Figure 3 , step S121 includes:
[0129] In step S1211, determine whether the transmission period of packets of the packet type is satisfied;
[0130] When the transmission period of packets of the packet type is satisfied, it is determined that the trigger condition of packets of the packet type is satisfied;
[0131] When the transmission period of packets of the packet type is not satisfied, it is determined that the trigger condition of packets of the packet type is not satisfied.
[0132] The embodiments of the present disclosure do not make special limitations on how to execute step S211 to determine whether the transmission period of packets is satisfied. For example, according to the reference pulse (3.33 ms) of the timer, when the reference pulse corresponding to the transmission period of the packet arrives, it means that the transmission period of the packet is satisfied.
[0133] The embodiments of the present disclosure also support the first-packet transmission. It should be noted that at the starting moment of the process of periodically transmitting packets, the first transmission of a packet is the first-packet transmission. In the embodiments of the present disclosure, when a packet of a certain packet type is the first-packet transmission, it is determined that the trigger condition of packets of the packet type is satisfied, and the packet information of the packet with the satisfied transmission period is written into the on-chip storage device through step S130, and the packet is further assembled and transmitted by the hardware logic.
[0134] Accordingly, referring to Figure 3 , in some embodiments, before step S1211, step S121 further includes:
[0135] In step S1212, determine whether the packet of the packet type is the first-packet transmission;
[0136] When the packet of the packet type is the first-packet transmission, it is determined that the trigger condition of packets of the packet type is satisfied;
[0137] When the packet of the packet type is not the first-packet transmission, execute step S1211.
[0138] In some embodiments, referring to Figure 3 , before step S1212, step S121 further includes:
[0139] In step S1213, determine whether the transmission condition of packets of the packet type is satisfied;
[0140] When the sending condition of the message of the message type is satisfied, step S1212 is executed;
[0141] When 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.
[0142] The embodiments of the present disclosure do not make special limitations on how to determine whether the sending condition of the message is satisfied. For example, it can be determined whether the sending condition of the message is satisfied according to the monitoring of the link performance. When it is necessary to measure the packet loss, delay, and jitter of the link and count various types of traffic, it is determined that the sending condition of the message is satisfied; it can also be determined whether the sending condition of the message is satisfied according to the detection and alarm of the link fault. When it is necessary to detect the link fault, it is determined that the sending condition of the message is satisfied; it can also be determined whether the sending condition of the message is satisfied according to the loop test of the link. When it is necessary to check whether there is a loop in the link, it is determined that the sending condition of the message is satisfied.
[0143] In the embodiments of the present disclosure, the trigger configuration information configured in the trigger configuration space of the software running on the on-board MCU further includes sending enable information. The sending enable information can define whether the sending enable of the session is enabled. The hardware logic determines whether the session supports sending messages and the message types supported by the session by judging whether the sending enable is enabled.
[0144] Correspondingly, in some embodiments, the trigger configuration information further includes the sending enable information of the current session. Refer to Figure 3 , before step S1213, step S121 further includes:
[0145] In step S1214, it is determined whether the sending enable of the current session is enabled according to the sending enable information;
[0146] When the sending enable of the current session is enabled, step S1213 is executed;
[0147] When 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.
[0148] In the embodiments of the present disclosure, the sending enable of the current session includes a global enable. The global enable being enabled indicates that the current session supports sending messages; the sending enable further includes multiple session enables, and each session enable corresponds to a message type. For example, the session enables include CV / BFD enable, CSF enable, APS enable, etc. The session enable being enabled indicates that the current session supports the message type corresponding to the session enable.
[0149] In the embodiments of the present disclosure, the hardware logic determines whether the messages of various message types meet the trigger conditions by accessing the trigger configuration space of the session. When the trigger conditions of the messages of at least one message type are met, it is determined that the session needs to send a message. At this time, the message whose trigger condition is met is the message that the session needs to send. It should be noted that one or more message types of messages may need to be sent in the same session simultaneously.
[0150] It should be noted that in the embodiments of the present disclosure, when sending a message, certain information usually needs to be carried in the message. For example, the signal failure reason information sf_reason is carried in the CSF message. As an alternative implementation manner, the hardware logic in the embodiments of the present disclosure generates and transmits a message according to the protocol type of the session, the message type of the message that the session needs to send, and the information that the message needs to carry.
[0151] Correspondingly, in some embodiments, the message whose trigger condition is met is the message that the current session needs to send, the trigger configuration information further includes the protocol type of the current session and the information to be carried by the 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 met, and the information to be carried by the message whose trigger condition is met.
[0152] In the embodiments 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. The embodiments of the present disclosure do not make special limitations on how to access the trigger configuration space in the on-chip storage device one by one. As an alternative 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.
[0153] Correspondingly, referring to Figure 4 , in some embodiments, the message transmission control method further includes:
[0154] In step S140, according to the number of sessions to be polled and the polling granularity configured, the trigger configuration information of the next session is read from the trigger configuration space of the next session of the current session to implement polling of multiple sessions, where the polling granularity represents the time interval between two consecutive sessions during polling.
[0155] It should be noted that, in the embodiments of the present disclosure, the polling of multiple sessions is performed periodically, and multiple sessions to be polled are polled within each polling period. It can ensure that the time interval between two consecutive polls of the same session is the polling period, thereby ensuring the sending accuracy. For example, the session identifiers of multiple sessions are session numbers that are continuously numbered starting from 0. When the polling period 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 a message; then increments the session number by 1, accesses the trigger configuration space corresponding to session number 1, and determines whether the session with session number 1 needs to send a message... and so on, until all trigger configuration spaces corresponding to all session numbers are accessed; then resets the session number to be accessed to 0. When the next polling period arrives, polling is initiated again starting from session 0.
[0156] In the embodiments of the present disclosure, the hardware logic polls multiple sessions according to the number of sessions to be polled and the polling granularity configured, which can make the polling moments of multiple sessions within one polling period evenly distributed within the polling period, thereby effectively smoothing the burst traffic.
[0157] As an optional implementation manner, every time the reference pulse of the timer arrives, the hardware logic initiates the polling of multiple sessions, that is, the polling period is 3.33 ms.
[0158] Correspondingly, in some embodiments, the number of sessions to be polled and the polling granularity satisfy formula (1):
[0159] Reference pulse period = the number of sessions to be polled × polling granularity (1)
[0160] Refer to Figure 4 , the message transmission control method further includes:
[0161] In step S150, in response to the reference pulse, initiate the polling of multiple sessions.
[0162] In the embodiments 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 consecutive polls of each session is 3.33 ms, and can make the error reach the nanosecond level; using the reference 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 the polling of multiple sessions, thereby ensuring the sending period of the message.
[0163] Second aspect, refer to Figure 5 , the embodiments of the present disclosure provide a message generation method, including:
[0164] In step S210, the session identifier of the target session and the message information of the message that the target session needs to send are read from the on-chip storage device;
[0165] In step S220, according to the session identifier of the target session, the packet assembly configuration information and the message template of the target session are read from the packet assembly configuration space of the target session, where there are multiple packet assembly configuration spaces in the on-chip storage device, and each packet assembly configuration space corresponds to a session, and the target session is one of the multiple sessions;
[0166] In step S230, the message to be transmitted of the target session is generated according to the message information, the packet assembly configuration information, and the message template;
[0167] In step S240, the message to be transmitted is written into the on-chip storage device.
[0168] In the embodiment of the present disclosure, the session identifier of the target session and the message information of the message that the target session needs to send read by the hardware logic from the on-chip storage device in step S210 are written into the on-chip storage device by the hardware logic through the message transmission control method described in the first aspect of the embodiment of the present disclosure.
[0169] As an optional implementation manner, the hardware logic reads the session identifier of the target session and the message information of the message that the target session needs to send from the FIFO memory in the on-chip storage device.
[0170] It should be noted that the session identifiers of multiple sessions and the message information of the corresponding multiple messages that need to be sent can be stored in the on-chip storage device at the same time. The target session described in the embodiment of the present disclosure refers to the session that the hardware logic is currently processing among the above multiple sessions, rather than specifically referring to a certain session.
[0171] In the embodiment of the present disclosure, packet assembly configuration spaces for storing the packet assembly configuration information and message templates of each session are allocated in the on-chip storage device. The packet assembly configuration information and message templates of the sessions in the packet assembly configuration spaces are configured by the software running on the on-board MCU. The hardware logic accesses the corresponding packet assembly configuration space according to the session identifier read from the on-chip storage device. The embodiment of the present disclosure does not make special limitations on the specific form of the session identifier of the session. For example, the session identifier can be the session number of the session.
[0172] In the embodiments of the present disclosure, a message template is configured for each session. As an alternative implementation, messages of different message types in the same session share the same message template. It should be noted that sharing the same message template for messages of different message types means that the content shared by messages of different message types is pre-configured in the message template. For example, in the message template, messages of different message types share message header contents such as destination address (DA), source address (SA), virtual local area network (VLAN) tag, ACH, etc., and the issued header, as well as other user-defined contents. Only the message template is stored in the on-chip storage device, and there is no need to store the complete messages of various message types; when generating the message to be transmitted according to the message template, only the fields other than the shared contents in the message template need to be configured, and there is no need to process the complete message, thus saving storage resources and computing resources.
[0173] As an alternative implementation, in the embodiments of the present disclosure, some or all of the packet assembly configuration information and the message template in the packet assembly configuration space can be shared, thereby further saving storage resources.
[0174] In the embodiments of the present disclosure, the protocol type of each session is configurable, and the embodiments of the present disclosure do not make special limitations on the configurable protocol types. For example, the protocol types include but are not limited to: Ethernet OAM, MPLS_TP OAM, BFD. In addition, the embodiments of the present disclosure also support custom OAM protocol types, and the custom OAM protocol types can be used for protocol extension. It should be noted that in the embodiments of the present disclosure, when a session configures a custom OAM protocol type, the session can send any type of message.
[0175] In the embodiments of the present disclosure, each session can send OAM messages of multiple message types, and the embodiments of the present disclosure do not make special limitations on the message types. For example, the message types can include CV, BFD, CSF, APS, AIS, etc., and can also be 2544 messages, LSP messages, etc. In addition, the embodiments of the present disclosure also support custom message types, and the custom message types can be used for extension.
[0176] Accordingly, 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 can be any one of multiple protocol types. For example, it can be any one of Ethernet OAM, MPLS_TPOAM, BFD, and custom protocol types. In step S230, the packet type of the packet to be transmitted generated according to the packet information read by the hardware logic from the on-chip storage device can be any one of multiple packet types. For example, it can be any one of CV, BFD, CSF, APS, AIS, and custom packet types. The embodiments of the present disclosure do not make special limitations on this.
[0177] As an alternative implementation, the on-chip storage device includes a scheduling cache. In step S240, the hardware logic writes the packet to be transmitted into the scheduling cache in the on-chip storage device, and further schedules the transmission of the packet to be transmitted by the hardware logic. As an alternative implementation, the scheduling cache is a FIFO memory.
[0178] In the packet generation method provided by the embodiments of the present disclosure, a packet assembly configuration space for storing the packet assembly configuration information and packet templates of each session is allocated in the on-chip storage device. The hardware logic reads the packet assembly configuration information and packet templates in the packet assembly configuration space to generate the packet to be transmitted. Among them, the protocol type of each session can be any one of multiple protocol types, and the generated packet to be transmitted can be any one of multiple packet types, ensuring flexibility and scalability; only packet templates are stored in the on-chip storage device, and it is not necessary to store the complete packets of various packet types; when generating the packet to be transmitted according to the packet template, only the fields other than the shared content in the packet template need to be configured, and it is not necessary to process the complete packet, thereby saving storage resources and computing resources.
[0179] In the embodiments of the present disclosure, the packet template is configured with the content shared by packets of multiple packet types. The hardware logic replaces the fields other than the content shared by packets of multiple packet types in the packet template according to the packet information read from the on-chip storage device and the packet assembly configuration information read from the packet assembly configuration space, and then the packet to be transmitted can be generated.
[0180] Accordingly, referring to Figure 6 , in some embodiments, step S230 includes:
[0181] In step S231, replace the corresponding fields in the packet template according to the packet information;
[0182] In step S232, replace the private header fields in the packet template according to the packet assembly configuration information.
[0183] It should be noted that in the embodiments of the present disclosure, for the same message template, when generating messages of different message types, the fields in the message template that need to be replaced can be the same or different; when the message templates are different, when generating messages of the same message type, the fields in the message template that need to be replaced can be the same or different. The embodiments of the present disclosure do not make special limitations 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.
[0184] It should also be noted that in the embodiments of the present disclosure, the corresponding fields refer to the fields in the message template that can carry message information.
[0185] Correspondingly, in some embodiments, the message information includes the protocol type of the target session, the message type of the message to be sent by the target session, and the information to be carried by the message to be sent by the target session. Referring to Figure 7 , step S231 includes:
[0186] In step S2311, according to the protocol type of the target session, the message type of the message to be sent by the target session, and the information to be carried by the message to be sent by the target session, replace the corresponding fields in the message template.
[0187] Correspondingly, in some embodiments, the packet assembly configuration information includes the message length and the message offset value. Referring to Figure 7 , step S232 includes:
[0188] In step S2321, according to the message length and the message offset value, replace the private header fields in the message template.
[0189] In the embodiments of the present disclosure, the hardware logic simultaneously completes message routing and the replacement of private header fields in the message template, thereby reducing the processing overhead of the central processing unit (CPU, Central Processing Unit).
[0190] Correspondingly, referring to Figure 7 , in some embodiments, step S232 further includes:
[0191] In step S232, perform message routing according to the packet assembly configuration information.
[0192] In the embodiments of the present disclosure, the message template further includes global configuration fields, and the global configuration fields are used to reduce CPU operations. In the embodiments of the present disclosure, the hardware logic replaces the global configuration fields in the message template according to the global configuration, thereby further reducing the CPU overhead.
[0193] Correspondingly, referring to Figure 8 , in some embodiments, step S230 further includes:
[0194] In step S233, according to the global configuration information, replace the corresponding global configuration fields in the initial message.
[0195] In the embodiments of the present disclosure, the session supports custom protocol types and custom message types. As an alternative implementation, when the message type of the message to be sent is a custom message type, there is no need to replace the fields in the message template, and directly read the message template in the packet assembly configuration space as the message to be transmitted, thereby ensuring the scalability of the message.
[0196] Correspondingly, referring to Figure 9 , in some embodiments, step S230 further includes:
[0197] In step S234, when the message type of the message that the target session needs to send is a custom message, use the message template as the message to be transmitted.
[0198] In a third aspect, referring to Figure 10 , the embodiments of the present disclosure provide a message transmission method, including:
[0199] In step S310, read a target message to be transmitted from the on-chip storage device, where the target message to be transmitted is a message to be transmitted that is generated according to the message generation method described in the second aspect of the embodiments of the present disclosure and written into the cache;
[0200] In step S320, transmit the target message to be transmitted.
[0201] In the embodiments of the present disclosure, multiple messages to be transmitted may be stored in the on-chip storage device at the same time, and the message types of the multiple messages to be transmitted may be the same or different. The embodiments of the present disclosure do not make special limitations on this. For example, the message type may be CV, BFD, CSF, APS, AIS, 2544 message, LSP message, etc. In addition, the embodiments of the present disclosure also support custom message types, and the custom message types can be used for extension.
[0202] In the embodiments of the present disclosure, the multiple messages to be transmitted may correspond to the same session or multiple sessions. The embodiments of the present disclosure do not make special limitations on this. For example, the protocol types include but are not limited to: Ethernet OAM, MPLS_TPOAM, BFD. In addition, the embodiments of the present disclosure also support custom OAM protocol types, and the custom OAM protocol types can be used for protocol extension.
[0203] As an alternative implementation, the on-chip storage device includes a scheduling cache. In step S310, the hardware logic reads the target packet to be transmitted from the scheduling cache in the on-chip storage device. As an alternative implementation, the scheduling cache is a FIFO memory.
[0204] In the packet transmission method provided by the embodiments of the present disclosure, the hardware logic reads the packet to be transmitted according to the second aspect of the embodiments of the present disclosure from the on-chip storage device and transmits it. The packet type of the packet to be transmitted can be any one of multiple packet types, and the protocol type of the session corresponding to the packet to be transmitted can be one of multiple protocol types, ensuring flexibility and scalability.
[0205] As an alternative implementation, the hardware logic schedules and transmits the packets to be transmitted in the on-chip storage device according to the priorities of the packets to be transmitted.
[0206] Correspondingly, referring to Figure 11 In some embodiments, before step S310, the packet transmission method further includes:
[0207] In step S331, determine the packet to be transmitted with the highest priority in the on-chip storage device;
[0208] In step S332, determine the packet to be transmitted with the highest priority as the target packet to be transmitted.
[0209] The embodiments of the present disclosure make special provisions on how to determine the packet to be transmitted with the highest priority in the on-chip storage device. As an alternative implementation, the hardware logic determines the packet to be transmitted with the highest priority according to the shaping signal and the backpressure signal.
[0210] In some embodiments, referring to Figure 11 Before step S310, the packet transmission method further includes
[0211] In step S340, determine whether there is a packet to be transmitted in the on-chip storage device according to the empty / full signal of the pre-stage cache;
[0212] In the case where there is a packet to be transmitted in the on-chip storage device, execute step S310.
[0213] Fourthly, referring to Figure 12 The embodiments of the present disclosure provide a configuration method, including:
[0214] In step S410, trigger configuration information for each of the sessions is respectively configured in the trigger configuration spaces of multiple sessions. The trigger configuration information is used to determine whether each of the sessions needs to send a message. Among them, the on-chip storage device of the chip includes multiple trigger configuration spaces, and each trigger configuration space corresponds to one session;
[0215] In step S420, packet assembly configuration information and message templates for each of the sessions are respectively configured in the packet assembly configuration spaces of multiple sessions. The packet assembly configuration information and the message templates are used to generate the message to be transmitted for the session when the session needs to send a message. Among them, the on-chip storage device of the chip includes multiple packet assembly configuration spaces, and each packet assembly configuration space corresponds to one session.
[0216] The configuration method provided by the embodiments of the present disclosure is used for the on-board MCU to configure the chip. The on-board 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 determine whether each session needs to send a message according to the message transmission control method described in the first aspect of the embodiments of the present disclosure; the on-board MCU configures the packet assembly 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 embodiments of the present disclosure.
[0217] In the embodiments of the present disclosure, the on-board MCU can configure different protocol types for multiple sessions. The embodiments of the present disclosure do not make special limitations on the protocol types. For example, the protocol types include but are not limited to: Ethernet OAM, MPLS_TP OAM, BFD. In addition, the embodiments of the present disclosure also support custom OAM protocol types, and the custom OAM protocol types can be used for protocol extension. It should be noted that in the embodiments of the present disclosure, when a session configures a custom OAM protocol type, the session can send messages of any type.
[0218] In the embodiments of the present disclosure, the on-board MCU can configure multiple message types for each session, so that each session can send OAM messages of multiple message types. The embodiments of the present disclosure do not make special limitations on the message types. For example, the message types can include CV, BFD, CSF, APS, AIS, etc., and can also be 2544 messages, LSP messages, etc. In addition, the embodiments of the present disclosure also support custom message types, and the custom message types can be used for extension.
[0219] In the configuration method provided by the embodiments 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 message by reading the trigger configuration information; the on-board MCU configures packet assembly 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 a message to be transmitted by reading the packet assembly configuration information and the message templates in the packet assembly configuration space, and further enables the hardware logic of the chip to transmit the message to be transmitted; the on-board MCU configures multiple protocol types for multiple sessions and multiple message types for each session, so that each session can send messages of multiple message types, thereby ensuring flexibility and scalability, saving computing resources and storage resources, and also being able to effectively smooth burst traffic and achieve high-precision message sending.
[0220] In some embodiments, the trigger configuration information includes at least one of the protocol type of the session, at least one message type supported by the session, the transmission period of messages of various message types, the transmission enable information of the session, and the information to be carried by messages of various message types.
[0221] In some embodiments, the packet assembly configuration information includes at least one of the message length and the message offset value.
[0222] In the embodiments of the present disclosure, the on-board MCU configures the number and polling granularity of the sessions to be polled in the on-chip storage device of the chip, so that the hardware logic of the chip can poll multiple sessions according to the configured number and polling granularity of the sessions to be polled, so that the polling times of multiple sessions within one polling period are evenly distributed within the polling period, thereby effectively smoothing burst traffic.
[0223] Correspondingly, referring to Figure 13 , in some embodiments, the configuration method further includes:
[0224] In step S430, configure the number and polling granularity of the sessions to be polled, where the polling granularity represents the time interval between two adjacent sessions before and after polling.
[0225] As an optional implementation manner, the number and polling granularity of the sessions to be polled configured by the on-board MCU in the on-chip storage device of the chip satisfy formula (2):
[0226] Reference pulse period = the number of sessions to be polled × polling granularity (2)
[0227] When the number and polling granularity of sessions to be polled configured in the on-chip storage device of the chip satisfy formula (2), the hardware logic of the chip initiates polling of multiple sessions each time the reference pulse of the timer arrives, thereby effectively smoothing burst traffic and ensuring the transmission period of the message.
[0228] In a fifth aspect, referring to Figure 14 , an embodiment of the present disclosure provides an electronic device, which includes:
[0229] One or more processors 101;
[0230] A memory 102, on which one or more programs are stored. When the one or more programs are executed by the one or more processors, the one or more processors implement at least one of the following methods:
[0231] The message transmission control method according to the first aspect of the embodiments of the present disclosure;
[0232] The message generation method according to the second aspect of the embodiments of the present disclosure;
[0233] The message transmission method according to the third aspect of the embodiments of the present disclosure;
[0234] The configuration method according to the fourth aspect of the embodiments of the present disclosure.
[0235] 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.
[0236] Wherein, the processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU), etc.; the memory 102 is a device with data storage capabilities, including but not limited to a random access memory (RAM, more specifically such as SDRAM, DDR, etc.), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory (FLASH); the I / O interface (read / write interface) 103 is connected between the processor 101 and the memory 102, and can implement information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus), etc.
[0237] In some embodiments, the processor 101, the memory 102, and the I / O interface 103 are interconnected through a bus 104, and further connected to other components of the computing device.
[0238] In a sixth aspect, referring to Figure 15 , an embodiment of the present disclosure provides a computer-readable medium, on which a computer program is stored. When the program is executed by a processor, it implements at least one of the following methods:
[0239] Message transmission control method according to the first aspect of the embodiments of the present disclosure;
[0240] Message generation method according to the second aspect of the embodiments of the present disclosure;
[0241] Message transmission method according to the third aspect of the embodiments of the present disclosure;
[0242] Configuration method according to the fourth aspect of the embodiments of the present disclosure.
[0243] To enable those skilled in the art to more clearly understand the technical solutions provided by the embodiments of the present disclosure, the following uses specific embodiments to elaborate in detail on the technical solutions provided by the embodiments of the present disclosure:
[0244] Embodiment 1
[0245] In the first embodiment, all sessions are polled, and it is determined whether the current session needs to send a message according to the timer and the alarm status. In the first embodiment, the current session can send Ethernet OAM messages, TP1731 messages, BFD messages, and messages of custom message 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 ID of the current session and the message type of the message to be sent.
[0246] In the first embodiment, the polling period is the reference pulse (3.3 ms). Each time the reference pulse of the timer arrives, polling starts from session 0, so that the interval between two consecutive polls of each session can be guaranteed to be 3.3 ms, with an error at the nanosecond level, thereby improving the sending accuracy.
[0247] In the first embodiment, for scenarios with a sending period of 10 ms, 100 ms, 1 s, etc., since they are integer multiples of 3.33 ms, the corresponding reference pulse and the 3.33 ms pulse are simultaneously pulled high and remain high throughout the polling period.
[0248] In the first embodiment, the polling granularity and the number of polled sessions are configurable. For example, when the main frequency is 1 GHz and there are a total of 128K sessions, and only 30K sessions are used in a certain scenario, the polling granularity is configured to 100 ns and the polling number is configured to 30K. When the reference pulse (3.3 ms) arrives, polling starts from session 0, polls session 1 after 100 ns, polls session 2 after 100 ns,... until session 30K ends the polling. The polling times of the 30K sessions are evenly distributed within a 3 ms time range. This can ensure that regardless of the number of sessions sending messages and regardless of the message sending period configured for each session, burst traffic can be effectively smoothed and evenly distributed.
[0249] Embodiment 2
[0250] In Embodiment 2, the hardware logic reads the message information of the message to be sent from the on-chip storage device. The message information of the message to be sent includes the session ID of the session of the message to be sent and the message type of the message to be sent; reads the packet assembly configuration information and the message template according to the session ID of the session of the message to be sent; then replaces the corresponding fields in the message template according to the packet assembly configuration information and the message type of the message to be sent, and assembles and generates the message to be transmitted; writes the message to be transmitted into the cache.
[0251] In Embodiment 2, messages of different message types in the same session share the same message template, thus saving the storage resources of the cache and the CPU processing resources while ensuring flexibility. The message template includes message header contents such as DA, SA, VLAN, label, ACH, etc., and other user-defined contents. In Embodiment 2, the message template is default configured in the cv / bfd message format. 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; if it is other messages, the version, opcode, flags, TLV, etc. fields will be replaced.
[0252] In Embodiment 2, the global configuration fields in the message template are also replaced according to the protocol type and the global configuration, including the TC value of the innermost label, the channeltype value, the mel value, etc.
[0253] In Embodiment 2, if the message to be sent is a message of a custom message type, no operation of replacing the message template fields will be performed, and the message template configured by the CPU will be directly read as the message to be transmitted, thus ensuring the scalability of the message.
[0254] Embodiment 3
[0255] The sending process of the OAM message includes:
[0256] Step 1: The onboard MCU configures the trigger configuration information for each session in the trigger configuration space of the chip's on-chip storage device, including the session protocol type (Ethernet OAM / MPLS-TP OAM / BFD OAM / custom type), CV / BFD enable, CC enable, LM pre-activation enable, CSF enable, CSF send type (LOS / FDI / RDI / DCI / Soft), CSF trigger type (port alarm trigger / working path flow point alarm trigger / protection path flow point alarm trigger), CSF trigger alarm index, APS enable, send cycle, send cycle granularity, send priority, etc.
[0257] Step 2: The onboard MCU configures the packet configuration information for each session in the packet configuration space in the chip's on-chip storage device, including the session's trunk routing logical port ID, packet length, packet offset value, checksum, ttl, channeltype, gal, label, and seqnum replacement enable.
[0258] Step 3: The onboard MCU configures the PDU message template for each session in the packet configuration space in the chip's on-chip storage device;
[0259] Step 4: The onboard MCU configures the corresponding sending headers for each session in the packet configuration space in the chip's on-chip storage device;
[0260] Step 5: The chip's hardware logic periodically polls all sessions. For each message type in each session, it first determines whether the global enable and session enable are turned on, and then determines whether the sending conditions are met. If the sending conditions are met, it then determines whether it is the first packet to be sent. If it is the first packet, it is triggered immediately. If not, it determines whether the current message configuration period matches the current period signal. To ensure the sending period and sending accuracy, the trigger operation is only performed when the corresponding period signal is pulled high.
[0261] Step 6: The chip's hardware logic 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 information to be carried in the message, such as sf_reason of the csf message.
[0262] Step 7: The chip's hardware logic reads the packet configuration information and PDU message template according to the session number read from the on-chip storage device, and replaces the fields in the PDU message template and the fields in the private header according to the protocol type of the session, the message type of the message to be sent, and the information to be replaced. Then, the assembled message to be transmitted is written to the scheduling cache in the on-chip storage device;
[0263] Step 8: The hardware logic of the chip performs sp scheduling based on the shaping signal and the backpressure signal of the subsequent module, and sends out the OAM packet and the 2544 packet.
[0264] Thus, the sending process of an OAM packet is completed.
[0265] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and their appropriate combinations. In the hardware implementation, the division of the functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be executed by several physical components in cooperation. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, a communication medium typically contains computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0266] Example embodiments have been disclosed herein, and although specific terms have been employed, they are used for and should be construed only for general descriptive purposes and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly stated, features, characteristics, and / or elements described in connection with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in connection with other embodiments. Accordingly, those skilled in the art will understand that various forms and details may be changed without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. A message transmission control method, comprising: Reading trigger configuration information of the current session from a 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 current session is one of the plurality of sessions; Judging whether the current session needs to send a message according to the trigger configuration information; When the current session needs to send a message, writing a session identifier of the current session and message information of the message that the current session needs to send into the on-chip storage device; The message transmission control method further includes: According to the number of sessions to be polled and the polling granularity configured, reading trigger configuration information of the next session from a trigger configuration space of the next session of the current session, so as to implement polling of the plurality of sessions, wherein the polling granularity represents a time interval between two sessions before and after polling.
2. The message transmission control method according to claim 1, wherein, The trigger configuration information includes at least one message type supported by the current session. The step of judging whether the current session needs to send a message according to the trigger configuration information includes: Judging whether trigger conditions of messages of various message types are satisfied according to the trigger configuration information; When trigger conditions of messages of at least one of the multiple message types are satisfied, determining that the current session needs to send a message.
3. The message transmission control method according to claim 2, wherein, The trigger configuration information further includes a sending period of messages of various message types. The step of judging whether trigger conditions of messages of the message type are satisfied according to the trigger configuration information includes: Judging whether the sending period of the message of the message type is satisfied; When the sending period of the message of the message type is satisfied, determining that the trigger conditions of the message of the message type are satisfied.
4. The message transmission control method according to claim 3, wherein, Before the step of judging whether the sending period of the message of the message type is satisfied, the step of judging whether trigger conditions of the message of the message type are satisfied according to the trigger configuration information includes: Judging whether the message of the message type is a first-packet transmission; When the message of the message type is a first-packet transmission, determining that the trigger conditions of the message of the message type are satisfied; When the message of the message type is not a first-packet transmission, performing the step of judging whether the sending period of the message of the message type is satisfied.
5. The message transmission control method according to claim 4, wherein, Before the step of judging whether the message of the message type is a first-packet transmission, the step of judging whether trigger conditions of the message of the message type are satisfied according to the trigger configuration information further includes: Judging whether sending conditions of the message of the message type are satisfied; When the sending conditions of the message of the message type are satisfied, performing the step of judging whether the message of the message type is a first-packet transmission; When the sending conditions of the message of the message type are not satisfied, determining that the trigger conditions of the message of the message type are not satisfied.
6. The message transmission control method according to claim 5, wherein, The trigger configuration information further includes sending enable information of the current session. Before the step of judging whether sending conditions of the message of the message type are satisfied, the step of judging whether trigger conditions of the message of the message type are satisfied according to the trigger configuration information further includes: Judge whether the transmission enabling of the current session is enabled according to the said transmission enabling information; In the case where the transmission enabling of the current session is enabled, execute the step of judging whether the transmission condition of the message of the said message type is satisfied; In the case where the transmission enabling of the current session is not enabled, determine that the triggering condition of the message of the said message type is not satisfied.
7. The message transmission control method according to any one of claims 2 to 6, wherein, The message whose triggering condition is satisfied is the message that the current session needs to send, the said triggering configuration information further includes the protocol type of the current session, the information to be carried by the messages of various said message types, and the message information includes the protocol type of the current session, the message type of the message whose triggering condition is satisfied, and the information to be carried by the message whose triggering condition is satisfied.
8. The message transmission control method according to claim 1, wherein, The number and polling granularity of the said sessions to be polled satisfy the following formula: Reference pulse period Number of said sessions to be polled Polling granularity; The said message transmission control method further includes: In response to a reference pulse, initiate polling of multiple said sessions.
9. A message generation method, including: 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; According to the session identifier of the target session, read the packet assembly configuration information and message template of the target session from the packet assembly configuration space of the target session. Among them, the on-chip storage device includes multiple packet assembly configuration spaces, and each said packet assembly configuration space corresponds to a session, and the target session is one of the multiple said sessions; Generate the message to be transmitted of the target session according to the said message information, the said packet assembly configuration information, and the said message template; Write the said message to be transmitted into the on-chip storage device; The said message generation method further includes: Initiate polling of multiple sessions according to the configured number and polling granularity of the sessions to be polled; among them, the said polling granularity represents the time interval between two said sessions before and after polling; The said on-chip storage device is the on-chip storage device of the chip; The session identifier of the target session and the message information of the message that the target session needs to send are written into the on-chip storage device by the hardware logic of the chip according to the message transmission control method described in claim 1.
10. The message generation method according to claim 9, wherein, The step of generating the message to be transmitted of the target session according to the said message information, the said packet assembly configuration information, and the said message template includes: Replace the corresponding fields in the message template according to the said message information; Replace the private header fields in the message template according to the said packet assembly configuration information.
11. The message generation method according to claim 10, wherein, The said message information includes the protocol type of the target session, the message type of the message that the target session needs to send, and the information to be carried by the message that the target session needs to send. The step of replacing the corresponding fields in the message template according to the said message information includes: Replace the corresponding fields in the message template according to the protocol type of the target session, the message type of the message that the target session needs to send, and the information to be carried by the message that the target session needs to send.
12. The message generation method according to claim 10, wherein, The said packet assembly configuration information includes the message length and message offset value. The step of replacing the private header fields in the message template according to the said packet assembly configuration information includes: Replace the private header fields in the message template according to the said message length and the said message offset value.
13. The message generation method according to claim 12, wherein, The steps of replacing the private header field in the message template according to the packet assembly configuration information further include: Perform message routing according to the packet assembly configuration information.
14. The message generation method according to any one of claims 10 to 13, wherein, The steps of generating the message to be transmitted for the target session according to the message information, the packet assembly configuration information, and the message template further include: Replace the corresponding global configuration fields in the initial message according to the global configuration information.
15. The message generation method according to claim 9, wherein, The message information includes the message type of the message that the target session needs to send. The steps of generating the message to be transmitted for the target session according to the message information, the packet assembly configuration information, and the message template include: When the message type of the message that the target session needs to send is a custom message, use the message template as the message to be transmitted.
16. A message transmission method, including: Read a target message to be transmitted from an on-chip storage device, where the target message to be transmitted is a message to be transmitted that is generated according to the message generation method described in any one of claims 9 to 15 and written into a cache; Transmit the target message to be transmitted.
17. The message transmission method according to claim 16, wherein, Before the step of reading a target message to be transmitted from an on-chip storage device, the message transmission method further includes: Determine the message to be transmitted with the highest priority in the on-chip storage device; Determine the message to be transmitted with the highest priority as the target message to be transmitted.
18. The message transmission method according to claim 17, wherein, The steps of determining the message to be transmitted with the highest priority in the on-chip storage device include: Determine the message to be transmitted with the highest priority according to a shaping signal and a backpressure signal.
19. The message transmission method according to any one of claims 16 to 18, wherein Before the step of reading a target message to be transmitted from an on-chip storage device, the message transmission method further includes: Judge whether there is a message to be transmitted in the on-chip storage device according to a pre-stage cache empty / full signal; When there is a message to be transmitted in the on-chip storage device, execute the step of reading a target message to be transmitted from the on-chip storage device.
20. A configuration method, including: Respectively configure the trigger configuration information of each session in the trigger configuration spaces of multiple sessions, where the trigger configuration information is used to judge whether each session needs to send a message. Among them, the on-chip storage device of the chip includes multiple trigger configuration spaces, and each trigger configuration space corresponds to a session; Respectively configure the packet assembly configuration information and the message template of each session in the packet assembly configuration spaces of multiple sessions. The packet assembly configuration information and the message template are used to generate the message to be transmitted for the session when the session needs to send a message. Among them, the on-chip storage device of the chip includes multiple packet assembly configuration spaces, and each packet assembly configuration space corresponds to a session; The configuration method further includes: Configure the number of sessions to be polled and the polling granularity, where the polling granularity represents the time interval between two consecutive sessions during polling.
21. The configuration method according to claim 20, wherein, The trigger configuration information includes at least one of the protocol type of the session, at least one message type supported by the session, the sending period of messages of various message types, the sending enable information of the session, and the information to be carried by messages of various message types.
22. The configuration method according to claim 20, wherein, The packet assembly configuration information includes at least one of the message length and the message offset value.
23. The configuration method according to claim 20, wherein, The number of sessions to be polled and the polling granularity satisfy the following formula: Reference pulse period Number of said sessions to be polled Polling granularity.
24. An electronic device, comprising: one or more processors; a storage device storing one or more programs, which 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 8; The message generation method according to any one of claims 9 to 15; The message transmission method according to any one of claims 16 to 19; The configuration method according to any one of claims 20 to 23.
25. A computer-readable medium storing a computer program, 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 8; The message generation method according to any one of claims 9 to 15; The message transmission method according to any one of claims 16 to 19; The configuration method according to any one of claims 20 to 23.
Citation Information
Patent Citations
OAM packet timing processing system and method
CN101478421A
Method and device for quickly transmitting and detecting OAM message
CN104980293A