WO2015149523A1 - Method and apparatus for rapid sending and detection processing of oam packet, and storage medium - Google Patents

Method and apparatus for rapid sending and detection processing of oam packet, and storage medium Download PDF

Info

Publication number
WO2015149523A1
WO2015149523A1 PCT/CN2014/090899 CN2014090899W WO2015149523A1 WO 2015149523 A1 WO2015149523 A1 WO 2015149523A1 CN 2014090899 W CN2014090899 W CN 2014090899W WO 2015149523 A1 WO2015149523 A1 WO 2015149523A1
Authority
WO
WIPO (PCT)
Prior art keywords
packet
message
sending
detection
session
Prior art date
Application number
PCT/CN2014/090899
Other languages
French (fr)
Chinese (zh)
Inventor
张倍荣
吴立群
胡达
钱晓东
王志忠
Original Assignee
深圳市中兴微电子技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2015149523A1 publication Critical patent/WO2015149523A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity

Definitions

  • the invention relates to the network operation, management & maintenance (OAM) technology, and particularly relates to a method, a device and a storage medium for quickly transmitting and detecting OAM messages.
  • OAM network operation, management & maintenance
  • the OAM function has become very important in the public telecommunication network, especially for networks that need to provide service quality assurance.
  • the OAM function performs real-time detection and status reporting of link status, performs link error management and provides fast switching capability.
  • the OAM function can provide millisecond-level transmission and detection time, which speeds up network convergence, reduces application interruption time, and improves network reliability.
  • the OAM function on the Ethernet switch is mainly implemented by two technologies: Bidirectional Forwarding Detection (BFD) and Connectivity Fault Management (CFM).
  • BFD Bidirectional Forwarding Detection
  • CFM Connectivity Fault Management
  • the BFD protocol provides a common, standardized media-independent and protocol-independent fast fault detection mechanism.
  • BFD can quickly detect the fault of the bidirectional forwarding path between two network devices for each upper layer protocol, such as routing protocols and Multi-Protocol Label Switching (MPLS).
  • MPLS Multi-Protocol Label Switching
  • CFM is a Layer 2 Ethernet OAM protocol defined by the IEEE 802.1ag standard. It can guarantee that Ethernet can also provide carrier-class requirements, including the ability to detect, recover, and manage network anomalies or abnormal problems such as downgrading and failure of some services.
  • the Ethernet CCM packet is the most important one in the CFM packet.
  • the detection terminal periodically sends CCM packets to advertise the connectivity of the peer link. It can also provide Remote Defect Indication (RDI).
  • RDI Remote Defect Indication
  • the traditional device uses a multi-core CPU to specifically send and receive BFD or Ethernet CCM packets.
  • a multi-core CPU is called a secondary CPU.
  • the secondary CPU is used to encapsulate, send, receive, and decapsulate BFD or Ethernet CCM packets, implement packet statistics, and report detection events to the primary CPU.
  • the session specifications of BFD and Ethernet CCM packets that need to be supported by 100G Ethernet switch devices are getting larger and larger.
  • the current mainstream BFD sessions are 2K, and the local maintenance association End Point (LMEP) of the Ethernet CCM.
  • the specification is 2K
  • the Remote Maintenance Association End Point (RMEP) specification is 8K.
  • auxiliary CPU mode For the implementation of the auxiliary CPU mode, the larger the session specification, the faster the CPU performance is degraded. It is difficult to satisfy the performance of 50ms failover for many time-sensitive services such as voice and video data. If you use a higher performance CPU, the cost and power consumption will be greatly improved.
  • FPGA Field Programmable Gate Array
  • This method can meet the required performance of the device, but Still can't solve the problem of cost and power consumption.
  • the traditional method is implemented separately for the transmission and detection of BFD and Ethernet CCM messages. Since BFD and Ethernet CCM transmission and detection functions may not be enabled in different network application scenarios, this Implementation will also cause idle and waste of resources.
  • the embodiments of the present invention are directed to a method, an apparatus, and a storage medium for rapidly transmitting and detecting OAM messages.
  • the embodiment of the invention provides a method for rapidly transmitting and detecting OAM packets, OAM.
  • the session type is BFD or CCM.
  • the method includes: the network device stores the BFD packet and the CCM packet sending parameter in the first random access memory (RAM), and the BFD packet and the CCM packet.
  • the detection parameters are stored in the second RAM;
  • the network device determines the packet type according to the sending parameter, and sends the packet to be processed
  • the network device determines whether a message arrives, and performs corresponding detection processing according to the detection parameter.
  • the embodiment of the present invention further provides an apparatus for rapidly transmitting and detecting OAM messages, the apparatus comprising: a first random access memory (RAM), a second RAM, a message sending module, and a message detecting module;
  • a first random access memory RAM
  • a second RAM a message sending module
  • a message detecting module a message detecting module
  • a first RAM configured to store a transmission parameter of a bidirectional forwarding detection (BFD) packet and a connectivity detection information (CCM) packet;
  • BFD bidirectional forwarding detection
  • CCM connectivity detection information
  • a second RAM configured to store detection parameters of the BFD packet and the CCM packet
  • the packet sending module is configured to determine a packet type according to the sending parameter, and send the packet to be processed;
  • the packet detection module is configured to determine whether a packet arrives, and perform corresponding detection processing according to the detection parameter.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer program is stored therein, and the computer program is used to execute the method for quickly transmitting and detecting the OAM message.
  • the OAM session type is a BFD or a CCM
  • the network device stores the transmission parameters of the BFD packet and the CCM packet to the first random.
  • the detection parameters of the BFD message and the CCM message are stored in the second RAM, and the network device determines the message type according to the transmission parameter, and sends and processes the message according to whether there is The packet arrives to detect the packet; thus, the present invention is based on the BFD packet and the CCM packet.
  • the parameter resources related to the sending and detecting processes are shared, so that the network device can not only meet the performance requirements, but also save the device resources and reduce the performance when the user flexibly configures each session according to different application scenarios. Cost and power consumption.
  • FIG. 1 is a schematic flowchart of a method for sending and detecting a message according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of an apparatus for sending and detecting a message according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a packet sending module and a packet detecting module according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of a packet sending process according to an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart of a packet detection process according to an embodiment of the present invention.
  • the network device stores the sending parameters of the BFD packet and the CCM packet in the first RAM, and stores the detection parameters of the BFD packet and the CCM packet in the second RAM, and the network device according to the The sending parameter determines the type of the packet, and the packet is sent and processed, and the packet is detected and processed according to whether the packet arrives.
  • the network device when the session type is BFD, the network device needs to establish a session first, for example, establishing a BFD session between the first network device and the second network device; when the session type is CCM, the network The method for establishing a packet in a BFD session or a CCM session is performed by using the method provided by the embodiment of the present invention;
  • the embodiment of the invention provides a method for sending and detecting a message.
  • the specific process is shown in Figure 1.
  • the method mainly includes the following steps:
  • Step 101 The network device stores the transmission parameters of the bidirectional forwarding detection (BFD) message and the connectivity detection information (CCM) message into the first random access memory (RAM), and the BFD The detection parameters of the message and the CCM message are stored in the second RAM;
  • BFD bidirectional forwarding detection
  • CCM connectivity detection information
  • the network device configures the interface to send the BFD packet and the CCM packet sending parameter of the user to the sending configuration entry of the first RAM.
  • the sending parameter includes: the session number, the sending enable, and the sending parameter. Packet sending period, packet type, and packet length.
  • the interface is configured to configure the packet information to the external DDR3 for the network device to read the packet.
  • the storage space occupied by the packet is smaller.
  • the off-chip DDR3 is used to store the message, thereby saving the internal storage space of the network device sending and detecting the processing chip, and reducing the cost of the chip;
  • the configuration interface may be a CPU interface, or may be a data configuration interface of other main processing chips;
  • the sending parameter further includes: a Diagnosing Code (Diag) field; the network device also writes the current time into the sending configuration entry as the sending time of the last packet;
  • Diag Diagnosing Code
  • the Diag field uses a binary number of 0-31 to represent the last session state of the sender network device
  • the number of configurations of the BFD packet and the CCM packet can be arbitrary, and the total number does not exceed the depth of the RAM in the network device, that is, the number of sent and configured packets does not exceed the depth of the first RAM.
  • the number of detection configurations of the packet does not exceed the depth of the second RAM. It is not recommended to cross the transmission parameters of the BFD packet and the CCM packet. Therefore, the BFD packet and the CCM packet are configured in the DDR3.
  • the starting address can be mapped to the session number one by one, and the same address does not correspond to different session numbers.
  • the network device maintains a local timer for polling the network device to send configuration entries. Time base
  • the detection parameters of the BFD packet and the CCM packet are stored in the second RAM.
  • the network device configures the interface to write the BFD packet and the CCM packet detection parameters.
  • the current time is written in the configuration entry as the arrival time of the previous packet;
  • the detection parameters include: detection enable, packet detection period, and packet detection type;
  • the detection parameters cannot be crossed during configuration; the timer of the local maintenance is also used to configure the timing of the configuration of the polling.
  • Step 102 The network device determines a packet type according to the sending parameter, and performs a sending process on the packet.
  • the network device periodically polls the sending configuration entry of the first RAM, and when the sending enable is valid, calculates the difference between the current time of the timer and the sending time of the last packet, when the difference is greater than the report.
  • the packet is sent, the packet is configured as a sending instance.
  • the packet is not processed, and the polling is continued.
  • the network device periodically polls and sends each entry in the configuration entry.
  • the packet sending period is 3.3 ms
  • the current time is 10.0 ms
  • the last packet is sent.
  • the difference is 4ms, and the difference is greater than the packet transmission period of 3.3ms. This means that the packet can be sent and sent, so it needs to form a transmission instance; if the last packet is sent for 8ms. , indicating that the polling operation of the next session is continued until the sending time is reached;
  • the component sending example is specifically: extracting the packet sending information according to the packet type, and updating the last sending time in the sending configuration entry to the current time;
  • the message sending information includes: a session number, a packet type, and a packet length;
  • the packet sending information further includes: a Diag field;
  • the session number, the packet type, the packet length, and the Diag field in the configuration entry are extracted as the packet sending information, and the configuration entry is sent.
  • the sending time of the last message in the middle is updated to 0.1s in the current time, 0.3s;
  • the packet is read, modified, and sent according to the message sending information
  • the reading is specifically: obtaining a base address of the message stored in the DDR3 according to the session number, and obtaining all addresses starting from the base address of the message according to the packet length and the data bit width of the DDR3, Read the message;
  • the storage space and the storage address occupied by the message information stored in the DDR3 corresponding to the session number in the transmission parameter are fixed. Therefore, the DDR3 report can be obtained according to the session number of the message.
  • the base address of the file storage such as the base address of the message storage is 0x0010, the length of the message is 128 bytes, and the data bit width of DDR3 is 128 bits.
  • the storage address of the message in DDR3 is 0x0010 to 0x0017, and these storages are read.
  • the content in the unit is the message;
  • the modification is specifically: reading the state of the corresponding session in the network device according to the packet type, and determining whether the modification is needed according to the state;
  • the packet type is BFD
  • the status of the corresponding BFD session is read.
  • the replacement flag 1 is added to the packet.
  • the packet type is CCM
  • the state of the corresponding CCM session is read, and when the state is a session interruption, a modification flag 1 is added to the packet;
  • one bit can be reserved as the modification flag bit.
  • the reserved modification flag bit is added with the flag 1;
  • the modification flag may not be set in the sending parameter, may be added at the beginning or the end of the message, or may be stored in the network device in other manners, and is read when the message is sent and processed;
  • the addition position is not limited, and the replacement mark may also be 0 or other mark, and the actual application is specifically set according to the application requirements;
  • the sending is specifically: when the packet type is BFD, and the replacement flag is 1, the Diag field in the packet is replaced with the Diag field in the packet sending information, and is sent according to the network device.
  • the characteristics of the channel are assembled by sending the message into a prescribed format;
  • the RDI field in the packet is replaced with 1, and the packet is assembled into a specified format according to the characteristics of the transmission channel of the network device;
  • the characteristic of the sending channel is a communication protocol established between network devices for sending a message
  • the specified format is a message format specified in the foregoing communication protocol, specifically, a data format, an encoding rule, a data content, and the like;
  • the replacement flag is 1
  • the Diag field in the packet is 0, and the Diag field in the packet transmission information is 1, the Diag field in the packet is replaced with 1, and then sent according to
  • the characteristics of the channel are used to assemble the message into a specified format, for example, to transmit data of 1024 bits width according to the specified format.
  • Step 103 The network device performs corresponding detection processing according to whether a packet arrives at the packet;
  • the network device determines whether a packet arrives, and sometimes, the packet is detected according to the packet type. When not, the network device periodically polls the second RAM detection configuration entry, when the detection is enabled. When valid, the time difference between the timer and the last packet arrival time is calculated. When the difference is greater than the packet detection period, it is determined that the session has a timeout interrupt, and the time in the update detection configuration entry is the current time. Generating interrupt information; when the difference is less than the message detection period, continuing the timing polling operation and determining whether a message arrives;
  • the session is BFD, the timeout interrupt occurs.
  • the Diag field needs to be recorded for the upper layer to read. If the session is CCM, the RDI state needs to be updated.
  • the network device periodically polls and sends each entry in the configuration entry.
  • the packet sending period is 3.3 ms
  • the current time is 10.0 ms
  • the last packet is sent.
  • the difference is 4ms, and the difference is greater than the packet transmission period of 3.3ms. This means that the packet can be sent and sent, so it needs to form a transmission instance; if the last packet is sent for 8ms. , indicating that the time of the next session has not been sent. Inquiry operation
  • the packet When a packet arrives, the packet is detected according to the packet type and the session number in the packet. Specifically, when the packet type is BFD, the session number in the packet is extracted, and the session is read. The previous Diag field corresponding to the number compares the previous Diag field with the Diag field in the message. When the change is made, the session is interrupted, the current Diag field is recorded, and the interrupt information is generated and processed. , to determine that the session is not interrupted, update the arrival time of the last message as the current time;
  • the previous Diag field corresponding to the session number may be stored in the second RAM, or may be stored in other RAMs in the network device, and the designer selects a suitable storage unit according to specific scenarios and requirements;
  • the session number in the BFD packet is 01
  • the previous Diag field corresponding to the session 01 is 0, and the Diag field in the packet is 1. If the two are different, the session number 01 is interrupted.
  • the session number in the packet is extracted, the previous RDI field corresponding to the session number is read, and the previous RDI field is compared with the RDI field in the packet.
  • the current RDI field is recorded, the RDI status counter is updated, and an interrupt information is generated.
  • the arrival time of the last message is updated to the current time, and the RDI is updated.
  • Status counter where
  • the previous RDI field corresponding to the session number may be stored in the second RAM, and may be stored in other RAMs of the network device, and the designer selects a suitable storage unit according to specific scenarios and requirements;
  • the RDI field corresponding to the session 11 is read. If the value is 1, the RDI field in the message is 0, and the two are different.
  • the updating the RDI status counter in the detecting process is specifically: updating a corresponding entry in the fourth RAM for storing the RDI state; when detecting the timeout interrupt, adding 1 to the value in the corresponding entry according to the MAID index in the detection parameter;
  • the MAID of the corresponding entry in the fourth RAM is read according to the session number in the message, and the RDI entry is indexed by the MAID to determine whether the value in the RDI entry is 0. When it is 0, no action is made. Operation, when non-zero, the operation is decremented by 1;
  • the method for generating and detecting the message further includes: when the network device detects the processing of the packet, determines that the session is interrupted, generates the interrupt information, and stores the interrupt information in the third RAM of the network device for maintenance, and The interrupt information is reported to the upper device.
  • the device structure of the message sending and detecting process provided by the embodiment of the present invention is as shown in FIG. 2, and the device includes a first RAM 21, a second RAM 22, a message sending module 23, and a message detecting module 24;
  • the first RAM 21 is configured to store the sending parameters of the BFD packet and the CCM packet;
  • the second RAM 22 is configured to store detection parameters of the BFD packet and the CCM packet.
  • the packet sending module 23 is configured to determine a packet type according to the sending parameter, and send the packet to be processed;
  • the packet detecting module 24 is configured to determine whether a packet arrives, and perform corresponding detection processing according to the detection parameter;
  • the first RAM 21 and the second RAM 22 may be separately disposed in the network device, or may be the internal RAM of the network device processing chip, as long as the storage space is required;
  • the first RAM 21 is configured to write the BFD packet and the CCM packet sending parameter configured by the user into the sending configuration entry of the first RAM 21 through the configuration interface, and write the current time as the last packet sending time. Enter the sending configuration entry;
  • the sending parameters include: a session number, a sending enable, a packet sending period, a packet type, and a packet length.
  • the sending parameter further includes: a Diagnose Code (Diag) field;
  • the second RAM 22 is configured to write the detection parameters of the BFD packet and the CCM packet configured by the user into the detection configuration entry of the second RAM 22 through the configuration interface, and the current time is Write the detection configuration entry as the arrival time of the last packet;
  • the detection parameters include: detection enable, packet detection period, and packet detection type;
  • the packet information is configured in the external DDR3 through the configuration interface, so that the network device can read the packet;
  • the configuration interface may be a CPU interface, or may be a data configuration interface of other main processing chips;
  • the packet sending module 23 and the packet detecting module 24 can be implemented by a processing chip in the network device; for example, can be implemented by a switch main chip in the network switch;
  • the packet sending module 23 specifically includes: an information component module 31 and a packet sending preprocessing module 32;
  • the information component module 31 is configured to periodically poll the transmission configuration entry of the first RAM 21. When the transmission enable is valid, calculate the difference between the current time of the timer and the transmission time of the previous message, when the difference is When the packet is sent, the packet is sent to the packet sending pre-processing module 32. When the difference is smaller than the packet sending period, the packet is not processed, and the polling operation is continued.
  • the packet sending pre-processing module 32 is configured to read, modify, and send the packet according to the sending instance
  • the specific configuration is to extract the packet sending information according to the packet type, and update the last sending time in the sending configuration entry to the current time;
  • the message sending information includes: a session number, a packet type, and a packet length;
  • the packet sending information further includes: a Diag field;
  • the packet sending pre-processing module 32 is configured to: when the packet is read according to the packet sending information, the packet is obtained according to the session number, and the packet is stored in a base address in the DDR3, and then according to the packet length and The data bit width of the DDR3 is obtained from all addresses from the base address of the message storage, and the message is read;
  • the configuration is to read the state of the corresponding session in the network device according to the packet type, and then determine whether the modification is needed according to the state;
  • the packet type is BFD
  • the status of the corresponding BFD session is read.
  • the replacement flag 1 is added to the packet.
  • the packet type is CCM
  • the state of the corresponding CCM session is read, and when the state is a session interruption, a modification flag 1 is added to the packet;
  • the configuration is as follows: when the packet type is BFD, and the replacement flag is 1, the Diag field in the packet is replaced with the Diag in the packet sending information. Field, according to the characteristics of the transmission channel of the network device, the message is assembled into a prescribed format and sent out;
  • the RDI field in the packet is replaced with 1, and the packet is assembled into a specified format according to the characteristics of the transmission channel of the network device;
  • the characteristic of the sending channel is a communication protocol established between the network devices and configured to send a message
  • the specified format is a message format specified in the communication protocol, such as a data format, an encoding rule, a data content, and the like;
  • the packet detecting module 24 is configured to determine whether a packet arrives. Whenever, the packet is detected according to the packet type and the session number in the packet. When not, the second RAM 22 is periodically polled. The configuration entry is used to calculate the difference between the current value of the timer and the arrival time of the last packet when the detection is enabled. When the difference is greater than the packet detection period, it is determined that the session has a timeout interrupt, and the update detection configuration is updated. The time in the entry generates interrupt information; when the difference is not greater than the packet detection period, the timing polling operation is continued, and it is determined whether a packet arrives;
  • the Diag field is changed for the packet to be sent.
  • the module 32 reads; for the CCM message, when the session is interrupted, the RDI state is updated;
  • the packet detecting module 24 when a packet arrives and the packet type is BFD, is specifically configured to extract a session number in the packet, and read a previous Diag field corresponding to the session number, where the packet is detected. A Diag field is compared with the Diag field in the message. When the change is made, the session is interrupted, the current Diag field is recorded, and the interrupt information is generated. When there is no change, the session is determined to be uninterrupted, and the arrival time of the last message is updated. current time;
  • the packet detecting module 24 when a packet arrives and the packet type is CCM, is specifically configured to extract a session number in the packet, and read a previous RDI field corresponding to the session number, where the packet is detected. An RDI field is compared with the RDI field in the message. When there is a change, the session is interrupted, the current RDI field is recorded, the RDI status counter is updated, and the interrupt information is generated. When there is no change, the session is determined to be uninterrupted, and the update is last. The arrival time of the packet is the current time, and the RDI status counter is updated according to the MAID corresponding to the packet;
  • the update RDI status counter in the above detection process is specifically: updating the corresponding entry of the fourth RAM for storing the RDI state; when detecting the timeout interrupt, according to the detection parameter
  • the MAID index adds 1 to the value in the corresponding entry; when receiving the CCM message, reads the MAID of the corresponding entry in the fourth RAM according to the session number in the message, and uses the MAID to index the RDI entry to determine Whether the value in the RDI entry is 0. When it is 0, no operation is performed. When it is not 0, the value is decremented by 1;
  • the network device further includes an interrupt reporting module 25 and a third RAM 26;
  • the interrupt reporting module 25 is configured to, after the packet detecting module 24 generates the interrupt information, store the interrupt information in the third RAM 26 for maintenance, and report the interrupt information to the upper device;
  • the interrupt information includes: a session number, a packet type, and a session interruption type;
  • the third RAM 26 stores the real-time session Down/Up status, Latch session Down/Up state, real-time Diag change state, latch Diag change state, and Diag field;
  • the third RAM 26 stores the real-time session Down/Up state, the latched session Down/Up state, the real-time RDI change state, and the latched RDI change state; since the session data between the network devices is relatively large, for convenience
  • FIG. 4 is a schematic flowchart of a packet sending process according to an embodiment of the present disclosure, which specifically includes the following steps:
  • Step 401 The first RAM 21 stores the sending parameters of the BFD packet and the CCM packet according to the configuration.
  • the first RAM 21 writes the session number, the transmission enable, the packet sending period, the packet type, and the packet length configured by the user into the sending configuration entry of the first RAM 21 through the configuration interface; for the BFD packet, the sending The parameter further includes a Diag field; the current time is also written into the sending configuration entry as the sending time of the last packet;
  • the message information is stored in the external DDR3 through the configuration interface, so that the network device can read the message.
  • Step 402 The information component module 31 periodically polls to determine whether the transmission enable is valid, and whether the time exceeds the sending period;
  • the information component module 31 periodically polls the transmission configuration entry of the first RAM 21, and when the transmission enable is valid, calculates the current time of the timer in the network device and the transmission time of the last message stored in the first RAM 21. If the difference is greater than the packet sending period in the sending parameter, step 403 is performed. When the difference is less than the packet sending period, the packet is not processed, and step 408 is performed.
  • Step 403 The information component module 31 extracts the packet sending information according to the packet type, and further The last packet transmission time in the new transmission configuration table;
  • the information component module 31 sends the packet sending information according to the packet type to the packet preprocessing module 32, and updates the sending configuration table in the first RAM 21.
  • the last message sent in the item is the current time;
  • the message sending information includes: a session number, a packet type, and a packet length;
  • the packet sending information also includes the Diag field.
  • Step 404 The packet sending and processing module 32 obtains the base address corresponding to the packet according to the packet sending information, and reads the packet.
  • the message sending and processing module 32 can obtain the base address of the message stored in the DDR3 according to the session number in the message sending information, and obtain the message storage according to the packet length and the data bit width of the DDR3. All storage addresses from the base address, read the message;
  • the specific reading method is the same; but the modification method is different, the BFD packet modification step 405, the CCM message modification step 406;
  • Step 405 The message sending and processing module 32 reads the session state, and determines whether to replace the Diag field in the packet.
  • the packet sending pre-processing module 32 reads the status of the corresponding BFD session in the packet detecting module 24, and adds a replacement flag 1 to the packet when the state is a session interruption.
  • Step 406 The message sending and processing module 32 reads the session state, and determines whether to replace the RDI field in the packet.
  • the packet sending pre-processing module 32 reads the status of the corresponding CCM session in the packet detecting module 24.
  • the modification flag 1 is added to the packet.
  • Step 407 The message sending and processing module 32 assembles and sends the message according to the replacement flag.
  • the packet sending pre-processing module 32 replaces the Diag field in the packet with the Diag field in the packet sending information, according to The characteristics of the transmission channel of the network device are assembled into a prescribed format and sent out;
  • the packet sending pre-processing module 32 replaces the RDI field in the packet with 1, and assembles the packet into a prescribed format according to the characteristics of the transmission channel of the network device. .
  • Step 408 The information component module 31 continues the timed polling
  • the information component module 31 continues to periodically poll the transmission configuration entry of the first RAM 21, and when the transmission enable is valid, repeats the transmission step of FIG.
  • FIG. 5 is a schematic flowchart of a packet detection process according to an embodiment of the present invention, which specifically includes the following steps:
  • Step 501 The second RAM 22 stores detection parameters of the BFD packet and the CCM packet.
  • the second RAM 22 writes the detection parameters of the BFD packet and the CCM packet configured by the user into the detection configuration entry of the second RAM 22 through the configuration interface, and writes the current time into the detection configuration entry as the previous report. Arrival time of the text;
  • the detection parameters include: detection enable, message detection period, and message detection type.
  • Step 502 The message detecting module 24 determines whether a message arrives.
  • step 503 when a packet arrives, step 503 is performed.
  • step 510 is performed.
  • Step 503 The packet detecting module 24 determines the packet type.
  • step 504 when the packet type is BFD, step 504 is performed, and when the packet type is CCM, step 507 is performed.
  • Step 504 The message detecting module 24 determines whether the Diag field is changed.
  • the packet detecting module 24 reads the session number in the packet, reads the previous Diag field corresponding to the session number, and compares the previous Diag field with the Diag field in the packet. Step 506 is executed, and when there is no change, step 505 is performed.
  • Step 505 The message detecting module 24 updates the time
  • the Diag field when the Diag field is not changed, it is determined that the session is not interrupted, and the last packet arrival time is updated as the current time.
  • Step 506 The message detecting module 24 records the current Diag field, and generates an interrupt information.
  • the packet detecting module 24 determines that the session is interrupted, and records the current Diag field in the detection configuration entry, and generates interrupt information including the session number, the packet type, and the session interrupt type, and sends the interrupt information to the interrupt reporting module 25.
  • Step 507 The message detecting module 24 determines whether the RDI field is changed.
  • the packet detecting module 24 extracts the session number in the packet, reads the previous RDI field corresponding to the session number, and uses the previous RDI field and the current packet. In the RDI field comparison, when there is a change, step 508 is performed, and when there is no change, step 509 is performed.
  • Step 508 The message detecting module 24 records the current RDI field, generates an interrupt information, and updates the RDI status counter.
  • the packet detecting module 24 records the current RDI field, generates interrupt information including the session number, the packet type, and the session interrupt type, and sends the interrupt information to the interrupt reporting module 25, and updates the RDI status counter.
  • Step 509 The message detecting module 24 updates the time and updates the RDI status counter.
  • the packet detecting module 24 updates the RDI status counter by updating the arrival time of the last packet in the configuration configuration entry to the current time.
  • Step 510 The packet detecting module 24 determines whether the packet sending period is exceeded.
  • the packet detecting module 24 calculates a difference between the current value of the timer and the arrival time of the previous packet when the packet is not received.
  • step 511 is performed.
  • step 512 is performed.
  • Step 511 The packet detecting module 24 updates the time and generates an interrupt information.
  • the packet detecting module 24 detects the arrival time of the last packet in the configuration entry.
  • the information is updated to the current time, and the interrupt information including the session number, the message type, and the session interrupt type is generated and sent to the interrupt reporting module 25.
  • Step 512 The message detecting module 24 continues to determine whether a message arrives.
  • the present invention is described in accordance with a flowchart, and/or block diagram of a method, apparatus (system), and computer program product for rapidly transmitting and detecting OAM messages according to an embodiment. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
  • These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device.
  • the embodiment of the present invention further implements a computer storage medium, wherein the computer program is stored therein, and the computer program is used to execute the method for quickly transmitting and detecting OAM messages in the foregoing embodiment.
  • the method for sending and detecting a message configures the sending parameters of the BFD message and the CCM message into the first RAM, and the BFD message and the CCM message are
  • the detection parameter is configured in the second RAM, and the network device determines the packet type according to the sending parameter, sends a message to the packet, and then determines whether a packet arrives, and performs corresponding detection processing according to the detection parameter, so that the packet is reported.
  • the parameters related to the sending and checking process can be used to share resources, so that the network device can flexibly configure the session in different scenarios, and at the same time meet the performance requirements, save resources, and reduce costs.

Abstract

Disclosed is a method for rapid sending and detection processing of an operation, administration and maintenance (OAM) packet. An OAM session type is bidirectional forwarding detection (BFD) or a continuity check message (CCM). A network device stores sending parameters of a BFD packet and a CCM packet into a first random access memory (RAM) and stores detection parameters of the BFD packet and the CCM packet into a second RAM; a sending end of the network device determines a packet type according to the sending parameters and performs sending processing of the packet; and a detection end determines whether the packet arrives and performs corresponding detection processing according to the detection parameters. Also disclosed are an apparatus for sending and detection processing of a packet, and a storage medium. The apparatus comprises a packet sending module and a packet detection module.

Description

一种OAM报文快速发送和检测处理的方法、装置及存储介质Method, device and storage medium for rapid transmission and detection processing of OAM message 技术领域Technical field
本发明涉及网络操作、管理&维护(OAM,Operation,Administration&Maintenance)技术,尤其涉及一种OAM报文快速发送和检测处理的方法、装置及存储介质。The invention relates to the network operation, management & maintenance (OAM) technology, and particularly relates to a method, a device and a storage medium for quickly transmitting and detecting OAM messages.
背景技术Background technique
OAM功能在公众电信网中已经变得十分重要,尤其是对需要提供服务质量保障的网络,OAM功能对链路状态实时检测及状态上报,进行链路的差错管理并提供快速切换的能力。OAM功能能够提供毫秒级的发送和检测时间,从而加快网络收敛速度,减少应用中断时间,提高网络的可靠性。以太网交换机上的OAM功能主要通过双向转发检测(BFD,Bidirectional Forwarding Detection)和连接性故障管理(CFM,Connectivity Fault Management)两种技术实现。The OAM function has become very important in the public telecommunication network, especially for networks that need to provide service quality assurance. The OAM function performs real-time detection and status reporting of link status, performs link error management and provides fast switching capability. The OAM function can provide millisecond-level transmission and detection time, which speeds up network convergence, reduces application interruption time, and improves network reliability. The OAM function on the Ethernet switch is mainly implemented by two technologies: Bidirectional Forwarding Detection (BFD) and Connectivity Fault Management (CFM).
BFD协议提供了一个通用的标准化的介质无关和协议无关的快速故障检测机制。BFD可以为各上层协议如各路由协议、多协议标签交换(MPLS,Multi-Protocol Label Switching)等统一地快速检测两台网络设备间双向转发路径的故障,检测时间达到毫秒级。The BFD protocol provides a common, standardized media-independent and protocol-independent fast fault detection mechanism. BFD can quickly detect the fault of the bidirectional forwarding path between two network devices for each upper layer protocol, such as routing protocols and Multi-Protocol Label Switching (MPLS). The detection time reaches milliseconds.
CFM是由IEEE802.1ag标准定义的一种二层以太网OAM协议。可以保证以太网也能够提供电信级的要求,包括能够对一些业务降级和失败等网络异常错误或者异常问题能够进行及时检测、恢复和管理的功能。以太网CCM报文是CFM报文中最为重要的一种,检测端定期发送CCM报文用以通告对端链路的连通性,同时可以提供远端故障指示(RDI,Remote Defect Indication)功能。 CFM is a Layer 2 Ethernet OAM protocol defined by the IEEE 802.1ag standard. It can guarantee that Ethernet can also provide carrier-class requirements, including the ability to detect, recover, and manage network anomalies or abnormal problems such as downgrading and failure of some services. The Ethernet CCM packet is the most important one in the CFM packet. The detection terminal periodically sends CCM packets to advertise the connectivity of the peer link. It can also provide Remote Defect Indication (RDI).
为了满足以太网交换机设备中BFD和以太网CCM报文快速发送、快速检测的需要,传统的设备会使用一个多核CPU来专门来进行BFD或者以太网CCM报文的快速收发和故障检测,这样的多核CPU称为辅助CPU。辅助CPU主要用于BFD或者以太网CCM报文封装、发送、接收和解封装处理,实现报文统计功能并上报检测事件到主CPU。如今,100G以太网交换机设备需要支持的BFD和以太网CCM报文的会话规格越来越大,目前主流规格BFD会话数为2K,以太网CCM的本地维护端点(LMEP,Local Maintenance association End Point)规格为2K,远端维护端点(RMEP,Remote Maintenance association End Point)规格为8K。对采用辅助CPU方式的实现,会话规格越大CPU性能下降就越快,对于许多时间敏感的业务如语音、视频数据要求50ms故障切换的性能,是很难满足的。如果采用更高性能的CPU,成本和功耗会大大提升。还有一种是通过侧挂现场可编程门阵列(FPGA,Field Programmable Gate Array)的方式用于实现BFD和以太网CCM报文快速发送和检测功能,这种方式可以满足设备所需的性能,但是依然无法解决成本和功耗的问题。另外传统的方法对于BFD和以太网CCM报文的发送和检测处理都是单独实现的,由于在不同的网络应用场景中可能不会同时启用BFD和以太网CCM的发送和检测功能,因此这种实现也会造成资源的闲置和浪费。In order to meet the requirements of fast transmission and fast detection of BFD and Ethernet CCM packets in an Ethernet switch device, the traditional device uses a multi-core CPU to specifically send and receive BFD or Ethernet CCM packets. A multi-core CPU is called a secondary CPU. The secondary CPU is used to encapsulate, send, receive, and decapsulate BFD or Ethernet CCM packets, implement packet statistics, and report detection events to the primary CPU. Nowadays, the session specifications of BFD and Ethernet CCM packets that need to be supported by 100G Ethernet switch devices are getting larger and larger. The current mainstream BFD sessions are 2K, and the local maintenance association End Point (LMEP) of the Ethernet CCM. The specification is 2K, and the Remote Maintenance Association End Point (RMEP) specification is 8K. For the implementation of the auxiliary CPU mode, the larger the session specification, the faster the CPU performance is degraded. It is difficult to satisfy the performance of 50ms failover for many time-sensitive services such as voice and video data. If you use a higher performance CPU, the cost and power consumption will be greatly improved. There is also a way to implement fast transmission and detection of BFD and Ethernet CCM messages by means of a Field Programmable Gate Array (FPGA). This method can meet the required performance of the device, but Still can't solve the problem of cost and power consumption. In addition, the traditional method is implemented separately for the transmission and detection of BFD and Ethernet CCM messages. Since BFD and Ethernet CCM transmission and detection functions may not be enabled in different network application scenarios, this Implementation will also cause idle and waste of resources.
可见,目前已有BFD和以太网CCM报文的发送和检测处理的实现,无法在不提高成本与功耗的情况下、满足以太网交换机设备的需求。It can be seen that the implementation of the transmission and detection processing of BFD and Ethernet CCM packets can not meet the requirements of Ethernet switch equipment without increasing cost and power consumption.
发明内容Summary of the invention
为解决现有存在的问题,本发明实施例期望提供一种OAM报文快速发送和检测处理的方法、装置及存储介质。In order to solve the existing problems, the embodiments of the present invention are directed to a method, an apparatus, and a storage medium for rapidly transmitting and detecting OAM messages.
本发明实施例的技术方案是这样实现的:The technical solution of the embodiment of the present invention is implemented as follows:
本发明实施例提供一种OAM报文快速发送和检测处理的方法,OAM 会话类型为BFD或CCM,该方法包括:网络设备将BFD报文和CCM报文的发送参数存储到第一随机存取存储器(RAM,Random Access Memory)中,将BFD报文和CCM报文的检测参数存储到第二RAM中;The embodiment of the invention provides a method for rapidly transmitting and detecting OAM packets, OAM. The session type is BFD or CCM. The method includes: the network device stores the BFD packet and the CCM packet sending parameter in the first random access memory (RAM), and the BFD packet and the CCM packet. The detection parameters are stored in the second RAM;
网络设备根据所述发送参数确定报文类型,对报文进行发送处理;The network device determines the packet type according to the sending parameter, and sends the packet to be processed;
网络设备判断是否有报文到达,并根据所述检测参数进行相应的检测处理。The network device determines whether a message arrives, and performs corresponding detection processing according to the detection parameter.
本发明实施例还提供一种OAM报文快速发送和检测处理的装置,该装置包括:第一随机存取存储器(RAM)、第二RAM、报文发送模块、报文检测模块;其中,The embodiment of the present invention further provides an apparatus for rapidly transmitting and detecting OAM messages, the apparatus comprising: a first random access memory (RAM), a second RAM, a message sending module, and a message detecting module;
第一RAM,配置为存储双向转发检测(BFD)报文和连通性检测信息(CCM)报文的发送参数;a first RAM configured to store a transmission parameter of a bidirectional forwarding detection (BFD) packet and a connectivity detection information (CCM) packet;
第二RAM,配置为存储BFD报文和CCM报文的检测参数;a second RAM configured to store detection parameters of the BFD packet and the CCM packet;
报文发送模块,配置为根据所述发送参数确定报文类型,对报文进行发送处理;The packet sending module is configured to determine a packet type according to the sending parameter, and send the packet to be processed;
报文检测模块,配置为判断是否有报文到达,并根据所述检测参数进行相应的检测处理。The packet detection module is configured to determine whether a packet arrives, and perform corresponding detection processing according to the detection parameter.
本发明实施例还提供一种计算机存储介质,其中,其中存储有计算机程序,该计算机程序用于执行上述的OAM报文快速发送和检测处理的方法。The embodiment of the invention further provides a computer storage medium, wherein the computer program is stored therein, and the computer program is used to execute the method for quickly transmitting and detecting the OAM message.
本发明实施例提供的一种OAM报文快速发送和检测处理的方法、装置及存储介质,OAM会话类型为BFD或CCM,网络设备将BFD报文和CCM报文的发送参数存储到第一随机存取存储器(RAM,Random Access Memory)中,将BFD报文和CCM报文的检测参数存储在第二RAM中,网络设备根据发送参数确定报文类型,对报文进行发送处理,根据是否有报文到达对报文进行检测处理;如此,本发明根据BFD报文和CCM报文 在发送和检测处理中的共同点,将发送和检测处理相关的参数资源共享,使网络设备在用户根据不同应用场景灵活配置每种会话时,不仅可以满足性能要求,还可以节省设备资源、降低成本和功耗。A method, a device, and a storage medium for rapidly transmitting and detecting an OAM packet according to an embodiment of the present invention. The OAM session type is a BFD or a CCM, and the network device stores the transmission parameters of the BFD packet and the CCM packet to the first random. In the access memory (RAM, Random Access Memory), the detection parameters of the BFD message and the CCM message are stored in the second RAM, and the network device determines the message type according to the transmission parameter, and sends and processes the message according to whether there is The packet arrives to detect the packet; thus, the present invention is based on the BFD packet and the CCM packet. In the common point of the sending and detecting processes, the parameter resources related to the sending and detecting processes are shared, so that the network device can not only meet the performance requirements, but also save the device resources and reduce the performance when the user flexibly configures each session according to different application scenarios. Cost and power consumption.
附图说明DRAWINGS
图1为本发明实施例提供的报文发送和检测处理的方法流程示意图;FIG. 1 is a schematic flowchart of a method for sending and detecting a message according to an embodiment of the present invention;
图2为本发明实施例提供的报文发送和检测处理的装置结构示意图;2 is a schematic structural diagram of an apparatus for sending and detecting a message according to an embodiment of the present invention;
图3为本发明实施例提供的报文发送模块和报文检测模块的结构示意图;FIG. 3 is a schematic structural diagram of a packet sending module and a packet detecting module according to an embodiment of the present disclosure;
图4为本发明实施例提供的报文发送流程示意图;4 is a schematic diagram of a packet sending process according to an embodiment of the present invention;
图5为本发明实施例提供的报文检测处理流程示意图。FIG. 5 is a schematic flowchart of a packet detection process according to an embodiment of the present invention.
具体实施方式detailed description
本发明实施例中,网络设备将BFD报文和CCM报文的发送参数存储到第一RAM中,将BFD报文和CCM报文的检测参数存储到第二RAM中,网络设备再根据所述发送参数确定报文类型,对报文进行发送处理,根据是否有报文到达来对报文进行相应的检测处理。In the embodiment of the present invention, the network device stores the sending parameters of the BFD packet and the CCM packet in the first RAM, and stores the detection parameters of the BFD packet and the CCM packet in the second RAM, and the network device according to the The sending parameter determines the type of the packet, and the packet is sent and processed, and the packet is detected and processed according to whether the packet arrives.
下面通过附图及具体实施例对本发明做进一步的详细说明。The invention will be further described in detail below with reference to the drawings and specific embodiments.
为了实现本发明提供的方法,当会话类型为BFD时,网络设备之间需要先建立会话,例如,在第一网络设备和第二网络设备之间建立BFD会话;当会话类型为CCM时,网络设备间不需上述建链过程;BFD会话或CCM会话中报文发送和检测处理的方法采用本发明实施例提供的方法;In order to implement the method provided by the present invention, when the session type is BFD, the network device needs to establish a session first, for example, establishing a BFD session between the first network device and the second network device; when the session type is CCM, the network The method for establishing a packet in a BFD session or a CCM session is performed by using the method provided by the embodiment of the present invention;
本发明实施例提供一种报文发送和检测处理的方法,具体流程如图1所示,该方法主要包括以下几个步骤:The embodiment of the invention provides a method for sending and detecting a message. The specific process is shown in Figure 1. The method mainly includes the following steps:
步骤101:网络设备将双向转发检测(BFD)报文和连通性检测信息(CCM)报文的发送参数存储到第一随机存取存储器(RAM)中,将BFD 报文和CCM报文的检测参数存储到第二RAM中;Step 101: The network device stores the transmission parameters of the bidirectional forwarding detection (BFD) message and the connectivity detection information (CCM) message into the first random access memory (RAM), and the BFD The detection parameters of the message and the CCM message are stored in the second RAM;
具体的,网络设备通过配置接口,将用户配置的BFD报文和CCM报文的发送参数写入第一RAM的发送配置表项中;其中,所述发送参数包括:会话号、发送使能、报文发送周期、报文类型、报文长度;此外,通过配置接口将报文信息配置到外置DDR3中,以供网络设备对报文进行读取;由于发送报文所占用的存储空间较大,本发明实施例使用片外DDR3来存储报文,如此,节省了网络设备发送和检测处理芯片的内部存储空间,降低了芯片成本;Specifically, the network device configures the interface to send the BFD packet and the CCM packet sending parameter of the user to the sending configuration entry of the first RAM. The sending parameter includes: the session number, the sending enable, and the sending parameter. Packet sending period, packet type, and packet length. In addition, the interface is configured to configure the packet information to the external DDR3 for the network device to read the packet. The storage space occupied by the packet is smaller. In the embodiment of the present invention, the off-chip DDR3 is used to store the message, thereby saving the internal storage space of the network device sending and detecting the processing chip, and reducing the cost of the chip;
所述配置接口可以是CPU接口,也可以是其它主处理芯片的数据配置接口;The configuration interface may be a CPU interface, or may be a data configuration interface of other main processing chips;
对于BFD报文,所述发送参数还包括:诊断码(Diag)字段;网络设备还将当前时间写入所述发送配置表项中,作为上一次报文的发送时间;其中,For the BFD packet, the sending parameter further includes: a Diagnosing Code (Diag) field; the network device also writes the current time into the sending configuration entry as the sending time of the last packet;
所述Diag字段,利用0-31的二进制数来表示发送方网络设备最近一次的会话状态;The Diag field uses a binary number of 0-31 to represent the last session state of the sender network device;
基于实际应用中方案实现考虑,BFD报文和CCM报文的配置数目可以任意,总数不超过网络设备中RAM的深度即可,即:报文的发送配置数目不超过所述第一RAM的深度,报文的检测配置数目不超过所述第二RAM的深度;而且不建议在配置BFD报文和CCM报文的发送参数时将它们交叉,如此,BFD报文和CCM报文配置在DDR3中的起始地址就可以和会话号一一形成映射,不会有相同地址对应不同会话号的情况出现;另外,网络设备维护一个本地的计时器,用于为网络设备轮询发送配置表项提供时间基准;Based on the implementation of the solution in the actual application, the number of configurations of the BFD packet and the CCM packet can be arbitrary, and the total number does not exceed the depth of the RAM in the network device, that is, the number of sent and configured packets does not exceed the depth of the first RAM. The number of detection configurations of the packet does not exceed the depth of the second RAM. It is not recommended to cross the transmission parameters of the BFD packet and the CCM packet. Therefore, the BFD packet and the CCM packet are configured in the DDR3. The starting address can be mapped to the session number one by one, and the same address does not correspond to different session numbers. In addition, the network device maintains a local timer for polling the network device to send configuration entries. Time base
将BFD报文和CCM报文的检测参数存储到第二RAM具体为:网络设备通过配置接口,将用户配置的BFD报文和CCM报文的检测参数写入 第二RAM的检测配置表项中,将当前时间写入配置表项中,作为上一次报文的到达时间;其中,The detection parameters of the BFD packet and the CCM packet are stored in the second RAM. The network device configures the interface to write the BFD packet and the CCM packet detection parameters. In the detection configuration entry of the second RAM, the current time is written in the configuration entry as the arrival time of the previous packet;
所述检测参数包括:检测使能、报文检测周期和报文检测类型;The detection parameters include: detection enable, packet detection period, and packet detection type;
与上述发送参数的配置相同,检测参数在配置时也不能交叉;同样利用本地维护的计时器来为轮询检测配置表项定时。As with the configuration of the above-mentioned transmission parameters, the detection parameters cannot be crossed during configuration; the timer of the local maintenance is also used to configure the timing of the configuration of the polling.
步骤102:网络设备根据所述发送参数确定报文类型,对报文进行发送处理;Step 102: The network device determines a packet type according to the sending parameter, and performs a sending process on the packet.
具体的,网络设备定时轮询第一RAM的发送配置表项,当发送使能有效时,将计时器的当前时间和上一次报文的发送时间计算出差值,当所述差值大于报文发送周期时,组成发送实例,当所述差值小于报文发送周期时,不对报文进行处理,继续定时轮询;Specifically, the network device periodically polls the sending configuration entry of the first RAM, and when the sending enable is valid, calculates the difference between the current time of the timer and the sending time of the last packet, when the difference is greater than the report. When the packet is sent, the packet is configured as a sending instance. When the difference is smaller than the packet sending period, the packet is not processed, and the polling is continued.
例如,网络设备定时轮询发送配置表项中的各个条目,当发送配置表项中的发送使能有效,报文发送周期为3.3ms,当前时间为10.0ms,上一次报文的发送时间为6ms时,则它们的差值为4ms,该差值大于报文发送周期3.3ms,此时就表示报文可以进行发发送,则需要组成发送实例;如果上一次报文的发送时间为8ms时,则表示未到发送时间,继续下一会话的轮询操作;For example, the network device periodically polls and sends each entry in the configuration entry. When the sending configuration in the sending configuration entry is valid, the packet sending period is 3.3 ms, the current time is 10.0 ms, and the last packet is sent. At 6ms, the difference is 4ms, and the difference is greater than the packet transmission period of 3.3ms. This means that the packet can be sent and sent, so it needs to form a transmission instance; if the last packet is sent for 8ms. , indicating that the polling operation of the next session is continued until the sending time is reached;
所述组成发送实例具体为:根据报文类型,提取报文发送信息,并更新发送配置表项中的上一次发送时间为当前时间;The component sending example is specifically: extracting the packet sending information according to the packet type, and updating the last sending time in the sending configuration entry to the current time;
所述报文发送信息包括:会话号、报文类型、报文长度;The message sending information includes: a session number, a packet type, and a packet length;
对于BFD报文,报文发送信息还包括:Diag字段;For the BFD packet, the packet sending information further includes: a Diag field;
例如,在需要组成发送实施,且报文类型为BFD时,将发送配置表项中的会话号、报文类型、报文长度以及Diag字段提取出来作为报文发送信息,并将发送配置表项中的上一次报文的发送时间0.15s更新为当前时间0.3s; For example, if the packet is sent to the BFD, the session number, the packet type, the packet length, and the Diag field in the configuration entry are extracted as the packet sending information, and the configuration entry is sent. The sending time of the last message in the middle is updated to 0.1s in the current time, 0.3s;
在组成所述发送实例后,根据所述报文发送信息对报文进行读取、修改和发送;其中,After the sending of the sending instance, the packet is read, modified, and sent according to the message sending information;
所述读取具体为:根据所述会话号得到报文存储在DDR3中的基地址,再根据所述报文长度和所述DDR3的数据位宽得到报文存储的基地址起的所有地址,读出报文;The reading is specifically: obtaining a base address of the message stored in the DDR3 according to the session number, and obtaining all addresses starting from the base address of the message according to the packet length and the data bit width of the DDR3, Read the message;
例如,在配置发送参数时,发送参数中的会话号对应的存储在DDR3中的报文信息所占的存储空间和存储地址是一定的,因此,就可以根据报文的会话号得到DDR3中报文存储的基地址,如报文存储的基地址为0x0010,报文长度为128bytes,DDR3的数据位宽为128bit,则报文在DDR3中的存储地址为0x0010至0x0017,读取这几个存储单元中的内容,即为报文;For example, when the transmission parameter is configured, the storage space and the storage address occupied by the message information stored in the DDR3 corresponding to the session number in the transmission parameter are fixed. Therefore, the DDR3 report can be obtained according to the session number of the message. The base address of the file storage, such as the base address of the message storage is 0x0010, the length of the message is 128 bytes, and the data bit width of DDR3 is 128 bits. The storage address of the message in DDR3 is 0x0010 to 0x0017, and these storages are read. The content in the unit is the message;
所述修改具体为:根据报文类型读取网络设备中相应会话的状态,再根据所述状态判断是否需要进行修改;其中,The modification is specifically: reading the state of the corresponding session in the network device according to the packet type, and determining whether the modification is needed according to the state;
当报文类型为BFD时,读取相应BFD会话的状态,当所述状态为会话中断时,为报文添加替换标记1;When the packet type is BFD, the status of the corresponding BFD session is read. When the status is the session interrupt, the replacement flag 1 is added to the packet.
当报文类型为CCM时,读取相应的CCM会话的状态,当所述状态为会话中断时,为报文添加修改标记1;When the packet type is CCM, the state of the corresponding CCM session is read, and when the state is a session interruption, a modification flag 1 is added to the packet;
例如,在配置每个报文的发送参数时,可以预留1位作为修改标记位,当本步骤中读取的会话状态为会话中断时,在预留的修改标记位添加标记1;所述修改标记也可以不设置在发送参数中,可以添加在报文的开头或结尾,也可以采用其它的方式存储在网络设备中,在对报文进行发送处理时读取;本发明对替换标记的添加位置不做限定,而且所述替换标记也可以为0或其它标记,实际应用中根据应用需求来做具体设置;For example, when configuring the sending parameters of each packet, one bit can be reserved as the modification flag bit. When the session state read in this step is a session interruption, the reserved modification flag bit is added with the flag 1; The modification flag may not be set in the sending parameter, may be added at the beginning or the end of the message, or may be stored in the network device in other manners, and is read when the message is sent and processed; The addition position is not limited, and the replacement mark may also be 0 or other mark, and the actual application is specifically set according to the application requirements;
所述发送具体为:当报文类型为BFD,且替换标记为1时,将报文中的Diag字段替换为所述报文发送信息中的Diag字段,根据网络设备的发送 通道的特性将报文组装成规定的格式发送出去;The sending is specifically: when the packet type is BFD, and the replacement flag is 1, the Diag field in the packet is replaced with the Diag field in the packet sending information, and is sent according to the network device. The characteristics of the channel are assembled by sending the message into a prescribed format;
当报文类型为CCM,且修改标记为1时,将报文中的RDI字段替换成1,根据网络设备的发送通道的特性将报文组装成规定的格式发送出去;When the packet type is CCM and the modification flag is 1, the RDI field in the packet is replaced with 1, and the packet is assembled into a specified format according to the characteristics of the transmission channel of the network device;
其中,所述发送通道的特性为网络设备之间建立的用于发送报文的通信协议;The characteristic of the sending channel is a communication protocol established between network devices for sending a message;
所述规定的格式为上述通信协议中所规定的报文格式,具体如,数据格式、编码规则、数据内容等;The specified format is a message format specified in the foregoing communication protocol, specifically, a data format, an encoding rule, a data content, and the like;
例如,当报文类型为BFD时,替换标记为1,报文中的Diag字段为0,报文发送信息中的Diag字段为1,则将报文中的Diag字段替换为1,再根据发送通道的特性将报文组装成规定格式发送,如,根据规定格式组成1024bit位宽的数据发送出去。For example, when the packet type is BFD, the replacement flag is 1, the Diag field in the packet is 0, and the Diag field in the packet transmission information is 1, the Diag field in the packet is replaced with 1, and then sent according to The characteristics of the channel are used to assemble the message into a specified format, for example, to transmit data of 1024 bits width according to the specified format.
步骤103:网络设备根据是否有报文到达对报文进行相应的检测处理;Step 103: The network device performs corresponding detection processing according to whether a packet arrives at the packet;
具体的,网络设备判断是否有报文到达,当有时,根据报文类型对报文进行相应的检测处理,当没有时,网络设备定时轮询第二RAM的检测配置表项,当检测使能有效时,将计时器的当时间和上一次报文到达时间计算出差值,当所述差值大于报文检测周期时,判定会话发生超时中断,更新检测配置表项中的时间为当前时间,产生中断信息;当所述差值小于报文检测周期时,继续进行定时轮询操作,并判断是否有报文到达;Specifically, the network device determines whether a packet arrives, and sometimes, the packet is detected according to the packet type. When not, the network device periodically polls the second RAM detection configuration entry, when the detection is enabled. When valid, the time difference between the timer and the last packet arrival time is calculated. When the difference is greater than the packet detection period, it is determined that the session has a timeout interrupt, and the time in the update detection configuration entry is the current time. Generating interrupt information; when the difference is less than the message detection period, continuing the timing polling operation and determining whether a message arrives;
如果会话为BFD,发生超时中断时,还需将Diag字段记录下来供上层读取;如果会话为CCM,还需更新RDI状态;If the session is BFD, the timeout interrupt occurs. The Diag field needs to be recorded for the upper layer to read. If the session is CCM, the RDI state needs to be updated.
例如,网络设备定时轮询发送配置表项中的各个条目,当发送配置表项中的发送使能有效,报文发送周期为3.3ms,当前时间为10.0ms,上一次报文的发送时间为6ms时,则它们的差值为4ms,该差值大于报文发送周期3.3ms,此时就表示报文可以进行发发送,则需要组成发送实例;如果上一次报文的发送时间为8ms时,则表示未到发送时间,继续下一会话的轮 询操作;For example, the network device periodically polls and sends each entry in the configuration entry. When the sending configuration in the sending configuration entry is valid, the packet sending period is 3.3 ms, the current time is 10.0 ms, and the last packet is sent. At 6ms, the difference is 4ms, and the difference is greater than the packet transmission period of 3.3ms. This means that the packet can be sent and sent, so it needs to form a transmission instance; if the last packet is sent for 8ms. , indicating that the time of the next session has not been sent. Inquiry operation
当有报文到达时,根据报文类型和报文中的会话号对报文进行相应的检测处理具体为:当报文类型是BFD时,提取报文中的会话号,读取所述会话号对应的上一个Diag字段,将所述上一个Diag字段与报文中的Diag字段比较,当改变时,判定所述会话中断,记录当前Diag字段,产生中断信息并进行处理,当没有改变时,判定会话没有中断,更新上一次报文的到达时间为当前时间;其中,When a packet arrives, the packet is detected according to the packet type and the session number in the packet. Specifically, when the packet type is BFD, the session number in the packet is extracted, and the session is read. The previous Diag field corresponding to the number compares the previous Diag field with the Diag field in the message. When the change is made, the session is interrupted, the current Diag field is recorded, and the interrupt information is generated and processed. , to determine that the session is not interrupted, update the arrival time of the last message as the current time;
所述会话号对应的上一个Diag字段可以存储在第二RAM中,也可以存储在网络设备中的其它RAM中,设计人员根据具体场景和需求选择合适的存储单元;The previous Diag field corresponding to the session number may be stored in the second RAM, or may be stored in other RAMs in the network device, and the designer selects a suitable storage unit according to specific scenarios and requirements;
例如,当BFD报文中的会话号为01时,读取01号会话对应的上一个Diag字段为0,报文中的Diag字段为1,两个不同,则说明01号会话中断;For example, when the session number in the BFD packet is 01, the previous Diag field corresponding to the session 01 is 0, and the Diag field in the packet is 1. If the two are different, the session number 01 is interrupted.
当有报文到达,且报文类型是CCM时,提取报文中的会话号,读取所述会话号对应的上一个RDI字段,将所述上一个RDI字段与报文中的RDI字段比较,当有改变时,判定所述会话中断,记录当前RDI字段,更新RDI状态计数器,产生中断信息,当没有改变时,判定会话没有中断,更新上一次报文的到达时间为当前时间,更新RDI状态计数器;其中,When a packet arrives and the packet type is CCM, the session number in the packet is extracted, the previous RDI field corresponding to the session number is read, and the previous RDI field is compared with the RDI field in the packet. When there is a change, it is determined that the session is interrupted, the current RDI field is recorded, the RDI status counter is updated, and an interrupt information is generated. When there is no change, it is determined that the session is not interrupted, and the arrival time of the last message is updated to the current time, and the RDI is updated. Status counter; where
所述会话号对应的上一个RDI字段可以存储在第二RAM中,可以存储在网络设备的其它RAM中,设计人员根据具体场景和需求选择合适的存储单元;The previous RDI field corresponding to the session number may be stored in the second RAM, and may be stored in other RAMs of the network device, and the designer selects a suitable storage unit according to specific scenarios and requirements;
例如,CCM报文中的会话号为11时,读取11号会话对应的RDI字段,如为1,此时报文中的RDI字段为0,两个不同,判定11号会话中断;For example, when the session number in the CCM message is 11, the RDI field corresponding to the session 11 is read. If the value is 1, the RDI field in the message is 0, and the two are different.
上述检测处理中更新RDI状态计数器具体为:更新用于存储RDI状态的第四RAM中的相应条目;当检测出超时中断时,根据检测参数中MAID索引将对应条目中的数值加1操作;当接收到CCM报文时,且判定当前会 话中断时,根据报文中的会话号读取所述第四RAM中相应条目的MAID,用所述MAID索引RDI条目,判断RDI条目中的数值是否为0,当为0时,不做任何操作,当非0时,对所述数值减1操作;The updating the RDI status counter in the detecting process is specifically: updating a corresponding entry in the fourth RAM for storing the RDI state; when detecting the timeout interrupt, adding 1 to the value in the corresponding entry according to the MAID index in the detection parameter; When receiving a CCM message, and determining that it is currently When the message is interrupted, the MAID of the corresponding entry in the fourth RAM is read according to the session number in the message, and the RDI entry is indexed by the MAID to determine whether the value in the RDI entry is 0. When it is 0, no action is made. Operation, when non-zero, the operation is decremented by 1;
上述报文发生和检测处理的方法还包括:在网络设备对报文进行检测处理,判定会话发生中断时,产生中断信息,将所述中断信息存储在网络设备的第三RAM中进行维护,并将所述中断信息上报给上层设备。The method for generating and detecting the message further includes: when the network device detects the processing of the packet, determines that the session is interrupted, generates the interrupt information, and stores the interrupt information in the third RAM of the network device for maintenance, and The interrupt information is reported to the upper device.
本发明实施例提供的报文发送和检测处理的装置结构如图2所示,该装置包括第一RAM21、第二RAM22、报文发送模块23、报文检测模块24;其中,The device structure of the message sending and detecting process provided by the embodiment of the present invention is as shown in FIG. 2, and the device includes a first RAM 21, a second RAM 22, a message sending module 23, and a message detecting module 24;
第一RAM21,配置为存储BFD报文和CCM报文的发送参数;The first RAM 21 is configured to store the sending parameters of the BFD packet and the CCM packet;
第二RAM22,配置为存储BFD报文和CCM报文的检测参数;The second RAM 22 is configured to store detection parameters of the BFD packet and the CCM packet.
报文发送模块23,配置为根据所述发送参数确定报文类型,对报文进行发送处理;The packet sending module 23 is configured to determine a packet type according to the sending parameter, and send the packet to be processed;
报文检测模块24,配置为判断是否有报文到达来,并根据所述检测参数进行相应的检测处理;The packet detecting module 24 is configured to determine whether a packet arrives, and perform corresponding detection processing according to the detection parameter;
上述第一RAM21、第二RAM22可以单独设置在网络设备中,也可以是网络设备处理芯片的内部RAM,只要满足存储空间的需求即可;其中,The first RAM 21 and the second RAM 22 may be separately disposed in the network device, or may be the internal RAM of the network device processing chip, as long as the storage space is required;
所述第一RAM21,具体配置为通过配置接口将用户配置的BFD报文和CCM报文的发送参数写入第一RAM21的发送配置表项中,将当前时间作为上一次报文发送时间也写入所述发送配置表项中;其中,The first RAM 21 is configured to write the BFD packet and the CCM packet sending parameter configured by the user into the sending configuration entry of the first RAM 21 through the configuration interface, and write the current time as the last packet sending time. Enter the sending configuration entry; where
所述发送参数包括:会话号、发送使能、报文发送周期、报文类型、报文长度;其中,The sending parameters include: a session number, a sending enable, a packet sending period, a packet type, and a packet length.
对于BFD报文,所述发送参数还包括:诊断码(Diag)字段;For the BFD packet, the sending parameter further includes: a Diagnose Code (Diag) field;
所述第二RAM22,具体配置为通过配置接口将用户配置的BFD报文和CCM报文的检测参数写入第二RAM22的检测配置表项中,将当前时间 写入检测配置表项中,作为上一次报文的到达时间;其中,The second RAM 22 is configured to write the detection parameters of the BFD packet and the CCM packet configured by the user into the detection configuration entry of the second RAM 22 through the configuration interface, and the current time is Write the detection configuration entry as the arrival time of the last packet;
所述检测参数包括:检测使能、报文检测周期和报文检测类型;The detection parameters include: detection enable, packet detection period, and packet detection type;
此外,报文信息通过配置接口被配置到外置的DDR3中,以供网络设备对报文进行读取;In addition, the packet information is configured in the external DDR3 through the configuration interface, so that the network device can read the packet;
所述配置接口可以是CPU接口,也可以是其它主处理芯片的数据配置接口;The configuration interface may be a CPU interface, or may be a data configuration interface of other main processing chips;
所述报文发送模块23、报文检测模块24都可以由网络设备中的处理芯片来实现;例如,可以由网络交换机中的交换机主芯片来实现;The packet sending module 23 and the packet detecting module 24 can be implemented by a processing chip in the network device; for example, can be implemented by a switch main chip in the network switch;
如图3所示的报文发送模块和报文检测模块的结构示意图所示,报文发送模块23具体包括:信息组成模块31、报文发送预处理模块32;As shown in the schematic diagram of the packet sending module and the packet detecting module, the packet sending module 23 specifically includes: an information component module 31 and a packet sending preprocessing module 32;
信息组成模块31,配置为定时轮询第一RAM21的发送配置表项,当发送使能有效时,将计时器的当前时间和上一次报文的发送时间计算出差值,当所述差值大于报文发送周期时,组成发送实例发送至报文发送预处理模块32,当所述差值小于报文发送周期时,不对报文进行处理,继续定时轮询操作;The information component module 31 is configured to periodically poll the transmission configuration entry of the first RAM 21. When the transmission enable is valid, calculate the difference between the current time of the timer and the transmission time of the previous message, when the difference is When the packet is sent, the packet is sent to the packet sending pre-processing module 32. When the difference is smaller than the packet sending period, the packet is not processed, and the polling operation is continued.
报文发送预处理模块32,配置为根据所述发送实例对报文进行读取、修改和发送;The packet sending pre-processing module 32 is configured to read, modify, and send the packet according to the sending instance;
信息组成模块31组成发送实例时,具体配置为根据报文类型,提取报文发送信息,并更新发送配置表项中的上一次发送时间为当前时间;其中,When the information component module 31 is configured as a sending instance, the specific configuration is to extract the packet sending information according to the packet type, and update the last sending time in the sending configuration entry to the current time;
所述报文发送信息包括:会话号、报文类型、报文长度;The message sending information includes: a session number, a packet type, and a packet length;
对于BFD报文,报文发送信息还包括:Diag字段;For the BFD packet, the packet sending information further includes: a Diag field;
报文发送预处理模块32在根据所述报文发送信息对报文进行读取时,具体配置为根据所述会话号得到报文存储在DDR3中的基地址,再根据所述报文长度和所述DDR3的数据位宽得到报文存储的基地址起的所有地址,读出报文; The packet sending pre-processing module 32 is configured to: when the packet is read according to the packet sending information, the packet is obtained according to the session number, and the packet is stored in a base address in the DDR3, and then according to the packet length and The data bit width of the DDR3 is obtained from all addresses from the base address of the message storage, and the message is read;
报文发送预处理模块32对报文进行修改时,具体配置为根据报文类型读取网络设备中相应会话的状态,再根据所述状态判断是否需要进行修改;其中,When the packet sending pre-processing module 32 modifies the packet, the configuration is to read the state of the corresponding session in the network device according to the packet type, and then determine whether the modification is needed according to the state;
当报文类型为BFD时,读取相应BFD会话的状态,当所述状态为会话中断时,为报文添加替换标记1;When the packet type is BFD, the status of the corresponding BFD session is read. When the status is the session interrupt, the replacement flag 1 is added to the packet.
当报文类型为CCM时,读取相应的CCM会话的状态,当所述状态为会话中断时,为报文添加修改标记1;When the packet type is CCM, the state of the corresponding CCM session is read, and when the state is a session interruption, a modification flag 1 is added to the packet;
报文发送预处理模块32在对报文进行发送时,具体配置为当报文类型为BFD,且替换标记为1时,将报文中的Diag字段替换为所述报文发送信息中的Diag字段,根据网络设备的发送通道的特性将报文组装成规定的格式发送出去;When the packet sending pre-processing module 32 sends the packet, the configuration is as follows: when the packet type is BFD, and the replacement flag is 1, the Diag field in the packet is replaced with the Diag in the packet sending information. Field, according to the characteristics of the transmission channel of the network device, the message is assembled into a prescribed format and sent out;
当报文类型为CCM,且修改标记为1时,将报文中的RDI字段替换成1,根据网络设备的发送通道的特性将报文组装成规定的格式发送出去;When the packet type is CCM and the modification flag is 1, the RDI field in the packet is replaced with 1, and the packet is assembled into a specified format according to the characteristics of the transmission channel of the network device;
其中,所述发送通道的特性为网络设备之间建立的配置为发送报文的通信协议;The characteristic of the sending channel is a communication protocol established between the network devices and configured to send a message;
所述规定的格式为所述通信协议中规定的报文格式,如,数据格式、编码规则、数据内容等;The specified format is a message format specified in the communication protocol, such as a data format, an encoding rule, a data content, and the like;
报文检测模块24,配置为判断是否有报文到达,当有时,根据报文类型和报文中的会话号对报文进行相应的检测处理;当没有时,定时轮询第二RAM22的检测配置表项,当检测使能有效时,将计时器的当前值和上一次报文到达时间计算出差值,当所述差值大于报文检测周期时,判定会话发生超时中断,更新检测配置表项中的时间,产生中断信息;当所述差值不大于报文检测周期时,继续进行定时轮询操作,并判断是否有报文到达;The packet detecting module 24 is configured to determine whether a packet arrives. Whenever, the packet is detected according to the packet type and the session number in the packet. When not, the second RAM 22 is periodically polled. The configuration entry is used to calculate the difference between the current value of the timer and the arrival time of the last packet when the detection is enabled. When the difference is greater than the packet detection period, it is determined that the session has a timeout interrupt, and the update detection configuration is updated. The time in the entry generates interrupt information; when the difference is not greater than the packet detection period, the timing polling operation is continued, and it is determined whether a packet arrives;
且对于BFD报文,当判断会话中断时,改变Diag字段供报文发送预处 理模块32读取;对于CCM报文,当判断会话中断时,更新RDI状态;For a BFD packet, when the session is interrupted, the Diag field is changed for the packet to be sent. The module 32 reads; for the CCM message, when the session is interrupted, the RDI state is updated;
所述报文检测模块24,当有报文到达,且报文类型是BFD时,具体配置为提取报文中的会话号,读取所述会话号对应的上一个Diag字段,将所述上一个Diag字段与报文中的Diag字段比较,当改变时,判定所述会话中断,记录当前Diag字段,产生中断信息,当没有改变时,判定会话没有中断,更新上一次报文的到达时间为当前时间;The packet detecting module 24, when a packet arrives and the packet type is BFD, is specifically configured to extract a session number in the packet, and read a previous Diag field corresponding to the session number, where the packet is detected. A Diag field is compared with the Diag field in the message. When the change is made, the session is interrupted, the current Diag field is recorded, and the interrupt information is generated. When there is no change, the session is determined to be uninterrupted, and the arrival time of the last message is updated. current time;
所述报文检测模块24,当有报文到达,且报文类型为CCM时,具体配置为提取报文中的会话号,读取所述会话号对应的上一个RDI字段,将所述上一个RDI字段与报文中的RDI字段比较,当有改变时,判定所述会话中断,记录当前RDI字段,更新RDI状态计数器,产生中断信息,当没有改变时,判定会话没有中断,更新上一次报文的到达时间为当前时间,根据报文对应的MAID更新RDI状态计数器;The packet detecting module 24, when a packet arrives and the packet type is CCM, is specifically configured to extract a session number in the packet, and read a previous RDI field corresponding to the session number, where the packet is detected. An RDI field is compared with the RDI field in the message. When there is a change, the session is interrupted, the current RDI field is recorded, the RDI status counter is updated, and the interrupt information is generated. When there is no change, the session is determined to be uninterrupted, and the update is last. The arrival time of the packet is the current time, and the RDI status counter is updated according to the MAID corresponding to the packet;
在CCM会话检测出超时中断或接收到CCM报文时,上述检测处理中更新RDI状态计数器具体为:更新用于存储RDI状态的第四RAM的相应条目;当检测出超时中断时,根据检测参数中MAID索引将对应条目中的数值加1操作;当接收到CCM报文时,根据报文中的会话号读取所述第四RAM中相应条目的MAID,用所述MAID索引RDI条目,判断RDI条目中的数值是否为0,当为0时,不做任何操作,当非0时,对所述数值减1操作;When the CCM session detects the timeout interrupt or receives the CCM message, the update RDI status counter in the above detection process is specifically: updating the corresponding entry of the fourth RAM for storing the RDI state; when detecting the timeout interrupt, according to the detection parameter The MAID index adds 1 to the value in the corresponding entry; when receiving the CCM message, reads the MAID of the corresponding entry in the fourth RAM according to the session number in the message, and uses the MAID to index the RDI entry to determine Whether the value in the RDI entry is 0. When it is 0, no operation is performed. When it is not 0, the value is decremented by 1;
所述网络设备还包括中断上报模块25和第三RAM26;The network device further includes an interrupt reporting module 25 and a third RAM 26;
中断上报模块25,配置为在所述报文检测模块24产生中断信息后,将所述中断信息存储在第三RAM26中进行维护,并将所述中断信息上报给上层设备;其中,The interrupt reporting module 25 is configured to, after the packet detecting module 24 generates the interrupt information, store the interrupt information in the third RAM 26 for maintenance, and report the interrupt information to the upper device;
中断信息包括:会话号、报文类型、会话中断类型;The interrupt information includes: a session number, a packet type, and a session interruption type;
对于BFD会话,所述第三RAM26中存储了实时会话Down/Up状态、 锁存会话Down/Up状态、实时Diag改变状态、锁存Diag改变状态以及Diag字段;For the BFD session, the third RAM 26 stores the real-time session Down/Up status, Latch session Down/Up state, real-time Diag change state, latch Diag change state, and Diag field;
对于CCM会话,所述第三RAM26存储了实时会话Down/Up状态、锁存会话Down/Up状态、实时RDI改变状态和锁存RDI改变状态;由于网络设备间的会话数据会比较多,为了方便进行中断查找,可以利用中断区域的指示寄存器,如,可以利用8个32位的中断区域指示寄存器,来表示0~8k-1个会话的状态,每个寄存器中的1位表示32个会话的状态。For the CCM session, the third RAM 26 stores the real-time session Down/Up state, the latched session Down/Up state, the real-time RDI change state, and the latched RDI change state; since the session data between the network devices is relatively large, for convenience For interrupt lookup, you can use the interrupt register of the interrupt area. For example, you can use 8 32-bit interrupt area indication registers to indicate the status of 0~8k-1 sessions. One bit in each register indicates 32 sessions. status.
图4所示为本发明实施例提供的报文发送的具体流程示意图,具体包括以下步骤:FIG. 4 is a schematic flowchart of a packet sending process according to an embodiment of the present disclosure, which specifically includes the following steps:
步骤401:第一RAM21根据配置存储BFD报文和CCM报文的发送参数;Step 401: The first RAM 21 stores the sending parameters of the BFD packet and the CCM packet according to the configuration.
具体的,第一RAM21通过配置接口将用户配置的会话号、发送使能、报文发送周期、报文类型、报文长度写入第一RAM21的发送配置表项中;对于BFD报文,发送参数还包括Diag字段;同时将当前时间写入所述发送配置表项中,作为上一次报文的发送时间;Specifically, the first RAM 21 writes the session number, the transmission enable, the packet sending period, the packet type, and the packet length configured by the user into the sending configuration entry of the first RAM 21 through the configuration interface; for the BFD packet, the sending The parameter further includes a Diag field; the current time is also written into the sending configuration entry as the sending time of the last packet;
此外,报文信息通过配置接口被存储到外置的DDR3中,以供网络设备对报文进行读取。In addition, the message information is stored in the external DDR3 through the configuration interface, so that the network device can read the message.
步骤402:信息组成模块31定时轮询,判断发送使能是否有效,且时间是否超过发送周期;Step 402: The information component module 31 periodically polls to determine whether the transmission enable is valid, and whether the time exceeds the sending period;
具体的,信息组成模块31定时轮询第一RAM21的发送配置表项,当发送使能有效时,将网络设备中计时器的当前时间和第一RAM21中存储的上一次报文的发送时间计算出差值,当所述差值大于发送参数中的报文发送周期时,执行步骤403,当所述差值小于所述报文发送周期时,不对报文进行处理,执行步骤408。Specifically, the information component module 31 periodically polls the transmission configuration entry of the first RAM 21, and when the transmission enable is valid, calculates the current time of the timer in the network device and the transmission time of the last message stored in the first RAM 21. If the difference is greater than the packet sending period in the sending parameter, step 403 is performed. When the difference is less than the packet sending period, the packet is not processed, and step 408 is performed.
步骤403:信息组成模块31根据报文类型,提取报文发送信息,并更 新发送配置表中的上一次报文发送时间;Step 403: The information component module 31 extracts the packet sending information according to the packet type, and further The last packet transmission time in the new transmission configuration table;
具体的,信息组成模块31在步骤402中所述的差值大于报文发送周期时,根据报文类型提取报文发送信息发送至报文预处理模块32,并更新第一RAM21中发送配置表项中的上一次报文发送时间为当前时间;其中,Specifically, when the difference is greater than the packet sending period in step 402, the information component module 31 sends the packet sending information according to the packet type to the packet preprocessing module 32, and updates the sending configuration table in the first RAM 21. The last message sent in the item is the current time;
所述报文发送信息包括:会话号、报文类型、报文长度;The message sending information includes: a session number, a packet type, and a packet length;
对于BFD报文,报文发送信息还包括:Diag字段。For BFD packets, the packet sending information also includes the Diag field.
步骤404:报文发送预处理模块32根据报文发送信息得到报文对应的基地址,读取报文;Step 404: The packet sending and processing module 32 obtains the base address corresponding to the packet according to the packet sending information, and reads the packet.
具体的,报文发送预处理模块32根据报文发送信息中的会话号可以得到报文存储在上述DDR3中的基地址,根据报文长度和所述DDR3的数据位宽就可以得到报文存储的基地址起的所有存储地址,读取报文;Specifically, the message sending and processing module 32 can obtain the base address of the message stored in the DDR3 according to the session number in the message sending information, and obtain the message storage according to the packet length and the data bit width of the DDR3. All storage addresses from the base address, read the message;
对于BFD报文和CCM报文来说,它们具体的读取方法是相同的;但是修改方法有所区别,BFD报文的修改执行步骤405,CCM报文的修改执行步骤406;For the BFD packet and the CCM packet, the specific reading method is the same; but the modification method is different, the BFD packet modification step 405, the CCM message modification step 406;
步骤405:报文发送预处理模块32读取会话状态,判断是否替换报文中的Diag字段;Step 405: The message sending and processing module 32 reads the session state, and determines whether to replace the Diag field in the packet.
具体的,报文发送预处理模块32读取报文检测模块24中相应BFD会话的状态,当所述状态为会话中断时,为报文添加替换标记1。Specifically, the packet sending pre-processing module 32 reads the status of the corresponding BFD session in the packet detecting module 24, and adds a replacement flag 1 to the packet when the state is a session interruption.
步骤406:报文发送预处理模块32读取会话状态,判断是否替换报文中的RDI字段;Step 406: The message sending and processing module 32 reads the session state, and determines whether to replace the RDI field in the packet.
具体的,报文发送预处理模块32读取报文检测模块24中相应CCM会话的状态,当所述状态为会话中断时,为报文添加修改标记1。Specifically, the packet sending pre-processing module 32 reads the status of the corresponding CCM session in the packet detecting module 24. When the status is a session interruption, the modification flag 1 is added to the packet.
步骤407:报文发送预处理模块32根据替换标记,组装发送报文;Step 407: The message sending and processing module 32 assembles and sends the message according to the replacement flag.
具体的,当报文类型为BFD,且替换标记为1时,报文发送预处理模块32将报文中的Diag字段替换为所述报文发送信息中的Diag字段,根据 网络设备的发送通道的特性将报文组装成规定的格式发送出去;Specifically, when the packet type is BFD and the replacement flag is 1, the packet sending pre-processing module 32 replaces the Diag field in the packet with the Diag field in the packet sending information, according to The characteristics of the transmission channel of the network device are assembled into a prescribed format and sent out;
当报文类型为CCM,且修改标记为1时,报文发送预处理模块32将报文中的RDI字段替换成1,根据网络设备的发送通道的特性将报文组装成规定的格式发送出去。When the packet type is CCM and the modification flag is 1, the packet sending pre-processing module 32 replaces the RDI field in the packet with 1, and assembles the packet into a prescribed format according to the characteristics of the transmission channel of the network device. .
步骤408:信息组成模块31继续定时轮询;Step 408: The information component module 31 continues the timed polling;
具体的,信息组成模块31继续定时轮询第一RAM21的发送配置表项,当发送使能有效时,重复图4的发送步骤。Specifically, the information component module 31 continues to periodically poll the transmission configuration entry of the first RAM 21, and when the transmission enable is valid, repeats the transmission step of FIG.
图5所示为本发明实施例提供的报文检测处理流程示意图,具体包括以下步骤:FIG. 5 is a schematic flowchart of a packet detection process according to an embodiment of the present invention, which specifically includes the following steps:
步骤501:第二RAM22存储BFD报文和CCM报文的检测参数;Step 501: The second RAM 22 stores detection parameters of the BFD packet and the CCM packet.
具体的,第二RAM22通过配置接口将用户配置的BFD报文和CCM报文的检测参数写入第二RAM22的检测配置表项中,将当前时间写入检测配置表项中,作为上一次报文的到达时间;其中,Specifically, the second RAM 22 writes the detection parameters of the BFD packet and the CCM packet configured by the user into the detection configuration entry of the second RAM 22 through the configuration interface, and writes the current time into the detection configuration entry as the previous report. Arrival time of the text;
所述检测参数包括:检测使能、报文检测周期和报文检测类型。The detection parameters include: detection enable, message detection period, and message detection type.
步骤502:报文检测模块24判断是否有报文到达;Step 502: The message detecting module 24 determines whether a message arrives.
具体的,当有报文到达时,执行步骤503,当没有报文到达时,执行步骤510。Specifically, when a packet arrives, step 503 is performed. When no packet arrives, step 510 is performed.
步骤503:报文检测模块24判断报文类型;Step 503: The packet detecting module 24 determines the packet type.
具体的,当报文类型为BFD时,执行步骤504,当报文类型为CCM时,执行步骤507。Specifically, when the packet type is BFD, step 504 is performed, and when the packet type is CCM, step 507 is performed.
步骤504:报文检测模块24判断Diag字段是否改变;Step 504: The message detecting module 24 determines whether the Diag field is changed.
具体的,所述报文检测模块24读取报文中的会话号,读取该会话号对应的上一个Diag字段,将所述上一个Diag字段与报文中的Diag字段比较,当改变时,执行步骤506,当没有改变时,执行步骤505。Specifically, the packet detecting module 24 reads the session number in the packet, reads the previous Diag field corresponding to the session number, and compares the previous Diag field with the Diag field in the packet. Step 506 is executed, and when there is no change, step 505 is performed.
步骤505:报文检测模块24更新时间; Step 505: The message detecting module 24 updates the time;
具体的,当所述Diag字段没有改变时,判断会话没有中断,更新上一次报文到达时间为当前时间。Specifically, when the Diag field is not changed, it is determined that the session is not interrupted, and the last packet arrival time is updated as the current time.
步骤506:报文检测模块24记录当前Diag字段,产生中断信息;Step 506: The message detecting module 24 records the current Diag field, and generates an interrupt information.
具体的,报文检测模块24判定会话中断,将当前的Diag字段记录在所述检测配置表项中,产生包括会话号、报文类型、会话中断类型的中断信息发送给中断上报模块25。Specifically, the packet detecting module 24 determines that the session is interrupted, and records the current Diag field in the detection configuration entry, and generates interrupt information including the session number, the packet type, and the session interrupt type, and sends the interrupt information to the interrupt reporting module 25.
步骤507:报文检测模块24判断RDI字段是否改变;Step 507: The message detecting module 24 determines whether the RDI field is changed.
具体的,在接收到的报文类型为CCM时,报文检测模块24提取报文中的会话号,读取该会话号对应的上一个RDI字段,将所述上一个RDI字段与当前报文中的RDI字段比较,当有改变时,执行步骤508,当没有改变时,执行步骤509。Specifically, when the received packet type is CCM, the packet detecting module 24 extracts the session number in the packet, reads the previous RDI field corresponding to the session number, and uses the previous RDI field and the current packet. In the RDI field comparison, when there is a change, step 508 is performed, and when there is no change, step 509 is performed.
步骤508:报文检测模块24记录当前RDI字段,产生中断信息,更新RDI状态计数器;Step 508: The message detecting module 24 records the current RDI field, generates an interrupt information, and updates the RDI status counter.
具体的,报文检测模块24记录当前的RDI字段,产生包括会话号、报文类型、会话中断类型的中断信息发送给中断上报模块25,并更新RDI状态计数器。Specifically, the packet detecting module 24 records the current RDI field, generates interrupt information including the session number, the packet type, and the session interrupt type, and sends the interrupt information to the interrupt reporting module 25, and updates the RDI status counter.
步骤509:报文检测模块24更新时间,更新RDI状态计数器;Step 509: The message detecting module 24 updates the time and updates the RDI status counter.
具体的,报文检测模块24将检测配置表项中的上一次报文的到达时间更新为当前时间,更新RDI状态计数器。Specifically, the packet detecting module 24 updates the RDI status counter by updating the arrival time of the last packet in the configuration configuration entry to the current time.
步骤510:报文检测模块24判断是否超过报文发送周期;Step 510: The packet detecting module 24 determines whether the packet sending period is exceeded.
具体的,报文检测模块24在判断没有报文到达时,将计时器当前值和上一次报文的到达时间计算出差值,当所述差值大于报文检测周期时,执行步骤511,当所述差值不大于报文检测周期时,执行步骤512。Specifically, the packet detecting module 24 calculates a difference between the current value of the timer and the arrival time of the previous packet when the packet is not received. When the difference is greater than the packet detection period, step 511 is performed. When the difference is not greater than the packet detection period, step 512 is performed.
步骤511:报文检测模块24,更新时间,产生中断信息;Step 511: The packet detecting module 24 updates the time and generates an interrupt information.
具体的,报文检测模块24将检测配置表项中的上一次报文的到达时间 更新为当前时间,并产生包括会话号、报文类型、会话中断类型的中断信息发送给中断上报模块25。Specifically, the packet detecting module 24 detects the arrival time of the last packet in the configuration entry. The information is updated to the current time, and the interrupt information including the session number, the message type, and the session interrupt type is generated and sent to the interrupt reporting module 25.
步骤512:报文检测模块24继续判断是否有报文到达。Step 512: The message detecting module 24 continues to determine whether a message arrives.
本发明是根据实施例提供的一种OAM报文快速发送和检测处理的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described in accordance with a flowchart, and/or block diagram of a method, apparatus (system), and computer program product for rapidly transmitting and detecting OAM messages according to an embodiment. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
相应的,本发明实施例还实现一种计算机存储介质,其中,其中存储有计算机程序,该计算机程序用于执行上述实施例的OAM报文快速发送和检测处理的方法。Correspondingly, the embodiment of the present invention further implements a computer storage medium, wherein the computer program is stored therein, and the computer program is used to execute the method for quickly transmitting and detecting OAM messages in the foregoing embodiment.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above is only the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in Within the scope of protection of the present invention.
工业实用性Industrial applicability
从上述实施例可以看出,本发明提供的报文的发送和检测处理的方法,通过将BFD报文和CCM报文的发送参数配置到第一RAM中,将BFD报文和CCM报文的检测参数配置到第二RAM中,网络设备根据所述发送参数确定报文类型,对报文进行发送处理,再判断是否有报文到达,并根据所述检测参数进行相应的检测处理,使得报文发送和检查处理相关的参数可以实现资源共享,使网络设备在不同场景下灵活配置会话时,同时达到满足性能需求和节省资源、降低成本的目的。 It can be seen from the foregoing embodiment that the method for sending and detecting a message according to the present invention configures the sending parameters of the BFD message and the CCM message into the first RAM, and the BFD message and the CCM message are The detection parameter is configured in the second RAM, and the network device determines the packet type according to the sending parameter, sends a message to the packet, and then determines whether a packet arrives, and performs corresponding detection processing according to the detection parameter, so that the packet is reported. The parameters related to the sending and checking process can be used to share resources, so that the network device can flexibly configure the session in different scenarios, and at the same time meet the performance requirements, save resources, and reduce costs.

Claims (23)

  1. 一种操作、管理和维护(OAM)报文快速发送和检测处理的方法,OAM会话类型为双向转发检测(BFD)或连通性检测信息(CCM),该方法还包括:An operation, management, and maintenance (OAM) message fast transmission and detection processing method, the OAM session type is bidirectional forwarding detection (BFD) or connectivity detection information (CCM), and the method further includes:
    网络设备将BFD报文和CCM报文的发送参数存储到第一随机存取存储器(RAM)中,将BFD报文和CCM报文的检测参数存储到第二RAM中;The network device stores the transmission parameters of the BFD message and the CCM message in the first random access memory (RAM), and stores the detection parameters of the BFD message and the CCM message in the second RAM;
    网络设备根据所述发送参数确定报文类型,对报文进行发送处理;The network device determines the packet type according to the sending parameter, and sends the packet to be processed;
    网络设备判断是否有报文到达,并根据所述检测参数进行相应的检测处理。The network device determines whether a message arrives, and performs corresponding detection processing according to the detection parameter.
  2. 根据权利要求1所述的方法,其中,该方法还包括:网络设备对报文进行检测处理,判定会话发生中断,并产生中断信息后,将所述中断信息存储在第三RAM中进行维护,并将中断信息上报给上层设备;The method according to claim 1, wherein the method further comprises: the network device detecting the message, determining that the session is interrupted, and generating the interrupt information, storing the interrupt information in the third RAM for maintenance, And reporting the interrupt information to the upper device;
    所述中断信息包括:会话号、报文类型、会话中断类型。The interrupt information includes: a session number, a message type, and a session interruption type.
  3. 根据权利要求2所述的方法,其中,所述网络设备将BFD报文和CCM报文的发送参数存储到第一RAM中为:网络设备通过配置接口将用户配置的BFD报文和CCM报文的发送参数写入第一RAM的发送配置表项中;其中,The method of claim 2, wherein the network device stores the BFD packet and the CCM packet transmission parameter in the first RAM, the network device configures the BFD packet and the CCM packet configured by the user through the configuration interface. The sending parameters are written into the sending configuration entry of the first RAM; wherein
    所述发送参数包括:会话号、发送使能、报文发送周期、报文类型和报文长度;其中,The sending parameters include: a session number, a sending enable, a packet sending period, a packet type, and a packet length.
    对于BFD报文,所述发送参数还包括:诊断码(Diag)字段。For the BFD packet, the sending parameter further includes: a Diagnose Code (Diag) field.
  4. 根据权利要求3所述的方法,其中,在将所述发送参数写入第一RAM中时,将当前时间写入所述发送配置表项中,作为上一次报文发送时间。 The method according to claim 3, wherein when the transmission parameter is written in the first RAM, the current time is written in the transmission configuration table entry as the last message transmission time.
  5. 根据权利要求4所述的方法,其中,所述将BFD报文和CCM报文的检测参数存储到第二RAM中为:网络设备通过配置接口将用户配置的BFD报文和CCM报文的检测参数写入第二RAM的检测配置表项中;其中,The method according to claim 4, wherein the storing the detection parameters of the BFD message and the CCM message in the second RAM is: the network device detects the BFD message and the CCM message configured by the user through the configuration interface. The parameter is written into the detection configuration entry of the second RAM; wherein
    所述检测参数包括:检测使能、报文检测周期和报文检测类型。The detection parameters include: detection enable, message detection period, and message detection type.
  6. 根据权利要求5所述的方法,其中,该方法还包括:在将所述检测参数写入第二RAM中时,将当前时间写入所述检测配置表项中,作为上一次报文的到达时间。The method according to claim 5, wherein the method further comprises: writing the current time into the detection configuration table item when the detection parameter is written in the second RAM as the arrival of the last message time.
  7. 根据权利要求6所述的方法,其中,所述根据发送参数确定报文类型,对报文进行发送处理为:网络设备定时轮询第一RAM的发送配置表项,当发送使能有效时,将计时器的当前时间和上一次报文的发送时间计算出差值,当所述差值大于报文发送周期时,组成发送实例,当发送使能无效或所述差值小于报文发送周期时,不对报文进行处理,继续定时轮询操作。The method according to claim 6, wherein the determining the message type according to the sending parameter, and transmitting the message to: the network device periodically polling the sending configuration entry of the first RAM, when the sending enable is effective, The difference between the current time of the timer and the sending time of the previous packet is calculated. When the difference is greater than the packet sending period, the sending instance is formed. When the sending enable is invalid or the difference is smaller than the packet sending period. When the message is not processed, the timed polling operation is continued.
  8. 根据权利要求7所述的方法,其中,所述组成发送实例具体为:根据报文类型,提取报文发送信息,并更新发送配置表项中的上一次报文发送时间为当前时间;其中,The method according to claim 7, wherein the composition sending example is: extracting the packet sending information according to the packet type, and updating the sending time of the last packet in the sending configuration entry to the current time;
    所述报文发送信息包括:会话号、报文类型和报文长度;The message sending information includes: a session number, a packet type, and a packet length.
    对于BFD报文,报文发送信息还包括:Diag字段。For BFD packets, the packet sending information also includes the Diag field.
  9. 根据权利要求8所述的方法,其中,在组成发送实例后,该方法还包括:根据所述报文发送信息对报文进行读取、修改和发送;其中,The method according to claim 8, wherein, after the sending of the sending instance, the method further comprises: reading, modifying, and transmitting the message according to the message sending information; wherein
    所述读取为:根据所述会话号得到报文存储在双倍速率同步动态随机存储器(DDR3)中的基地址,再根据所述报文长度和所述DDR3的数据位宽得到报文存储的基地址起的所有地址,读出报文;其中,The reading is: obtaining a base address of the message stored in the double rate synchronous dynamic random access memory (DDR3) according to the session number, and obtaining the message storage according to the packet length and the data bit width of the DDR3. All addresses from the base address, read the message;
    所述DDR3为存储报文信息的外置DDR3;The DDR3 is an external DDR3 for storing message information;
    所述修改:根据报文类型读取网络设备中相应会话的状态,再根据所述状态判断是否需要进行修改;其中, The modification: reading the state of the corresponding session in the network device according to the packet type, and determining whether the modification is needed according to the state; wherein
    当报文类型为BFD时,读取相应BFD会话的状态,当所述状态为会话中断时,为报文添加替换标记1;When the packet type is BFD, the status of the corresponding BFD session is read. When the status is the session interrupt, the replacement flag 1 is added to the packet.
    当报文类型为CCM时,读取相应的CCM会话的状态,当所述状态为会话中断时,为报文添加修改标记1;When the packet type is CCM, the state of the corresponding CCM session is read, and when the state is a session interruption, a modification flag 1 is added to the packet;
    所述发送为:当报文类型为BFD,且替换标记为1时,将报文中的Diag字段替换为所述报文发送信息中的Diag字段,根据网络设备的发送通道的特性将报文组装成规定的格式发送出去;The sending is: when the packet type is BFD, and the replacement flag is 1, the Diag field in the packet is replaced with the Diag field in the packet sending information, and the packet is sent according to the characteristics of the sending channel of the network device. Assembled into a prescribed format and sent out;
    当报文类型为CCM,且修改标记为1时,将报文中的RDI字段替换成1,根据网络设备的发送通道的特性将报文组装成规定的格式发送出去。When the packet type is CCM and the modification flag is 1, the RDI field in the packet is replaced with 1, and the packet is assembled into a specified format according to the characteristics of the transmission channel of the network device.
  10. 根据权利要求2所述的方法,其中,所述网络设备判断是否有报文到达,并根据检测参数进行相应的检测处理为:网络设备判断是否有报文到达,当有时,根据报文类型和报文中的会话号对报文进行相应的检测处理,当没有时,网络设备定时轮询第二RAM的检测配置表项,当检测使能有效时,将计时器的当前值和上一次报文到达时间计算出差值,当所述差值大于报文检测周期时,判定会话发生超时中断,更新所述检测配置表项中的时间为当前时间,产生中断信息;当所述差值小于报文检测周期时,继续进行定时轮询操作,并判断是否有报文到达。The method according to claim 2, wherein the network device determines whether a packet arrives, and performs corresponding detection processing according to the detection parameter: the network device determines whether a packet arrives, and sometimes, according to the packet type and The session number in the packet performs corresponding detection processing on the packet. When not, the network device periodically polls the detection configuration entry of the second RAM. When the detection is enabled, the current value of the timer and the previous report are When the difference is greater than the packet detection period, it is determined that the session has a timeout interrupt, and the time in the detection configuration entry is updated to the current time, and the interrupt information is generated; when the difference is smaller than During the message detection period, the timing polling operation is continued, and it is determined whether or not a message arrives.
  11. 根据权利要求10所述的方法,其中,当有报文到达时,根据报文类型和报文中的会话号对报文进行相应的检测处理具体为:当报文类型是BFD时,提取报文中的会话号,读取所述会话号对应的上一个Diag字段,将所述上一个Diag字段与报文中的Diag字段比较,当改变时,判定所述会话中断,记录当前Diag字段,产生中断信息并进行处理,当没有改变时,判定会话没有中断,更新上一次报文的到达时间为当前时间。The method according to claim 10, wherein, when a message arrives, the corresponding detection processing of the message according to the message type and the session number in the message is: when the message type is BFD, the report is extracted. The session number in the text reads the previous Diag field corresponding to the session number, compares the previous Diag field with the Diag field in the message, and when it changes, determines that the session is interrupted, and records the current Diag field. Interrupt information is generated and processed. When there is no change, it is determined that the session is not interrupted, and the arrival time of the last message is updated to the current time.
  12. 根据权利要求11所述的方法,其中,当有报文到达,且报文类型是CCM时,提取报文中的会话号,读取所述会话号对应的上一个RDI字 段,将所述上一个RDI字段与报文中的RDI字段比较,当有改变时,判定所述会话中断,记录当前RDI字段,更新RDI状态计数器,产生中断信息,当没有改变时,判定会话没有中断,更新上一次报文的到达时间为当前时间,并更新RDI状态计数器。The method according to claim 11, wherein when a message arrives and the message type is CCM, the session number in the message is extracted, and the previous RDI word corresponding to the session number is read. Segment, comparing the previous RDI field with the RDI field in the message, when there is a change, determining that the session is interrupted, recording the current RDI field, updating the RDI status counter, generating an interrupt message, and determining the session when there is no change Without interruption, update the arrival time of the last message to the current time and update the RDI status counter.
  13. 一种操作、管理和维护(OAM)报文快速发送和检测处理的装置,所述装置包括:第一随机存取存储器(RAM)、第二RAM、报文发送模块、报文检测模块;其中,An apparatus for operating, managing, and maintaining (OAM) message fast transmission and detection processing, the apparatus comprising: a first random access memory (RAM), a second RAM, a message sending module, and a message detecting module; ,
    第一RAM,配置为存储双向转发检测(BFD)报文和连通性检测信息(CCM)报文的发送参数;a first RAM configured to store a transmission parameter of a bidirectional forwarding detection (BFD) packet and a connectivity detection information (CCM) packet;
    第二RAM,配置为存储BFD报文和CCM报文的检测参数;a second RAM configured to store detection parameters of the BFD packet and the CCM packet;
    报文发送模块,配置为根据所述发送参数确定报文类型,对报文进行发送处理;The packet sending module is configured to determine a packet type according to the sending parameter, and send the packet to be processed;
    报文检测模块,配置为判断是否有报文到达,并根据所述检测参数进行相应的检测处理。The packet detection module is configured to determine whether a packet arrives, and perform corresponding detection processing according to the detection parameter.
  14. 根据权利要求13所述的装置,其中,所述装置还包括中断上报模块和第三RAM;The apparatus according to claim 13, wherein said apparatus further comprises an interrupt reporting module and a third RAM;
    中断上报模块,配置为在所述检测模块产生中断信息后,将所述中断信息存储在第三RAM中进行维护,并将所述中断信息上报给上层设备;The interrupt reporting module is configured to, after the detecting module generates the interrupt information, store the interrupt information in the third RAM for maintenance, and report the interrupt information to the upper device;
    所述中断信息包括:会话号、报文类型和会话中断类型。The interrupt information includes: a session number, a message type, and a session interruption type.
  15. 根据权利要求14所述的装置,其中,所述第一RAM,配置为通过配置接口将用户配置的BFD报文和CCM报文的发送参数写入第一RAM的发送配置表项中,将当前时间作为上一次报文发送时间也写入所述发送配置表项中;其中,The device according to claim 14, wherein the first RAM is configured to write a BFD packet and a CCM packet transmission parameter configured by the user into a sending configuration entry of the first RAM through the configuration interface, and the current The time is also written into the sending configuration entry as the last packet sending time;
    所述发送参数包括:会话号、发送使能、报文发送周期、报文类型、报文长度;其中, The sending parameters include: a session number, a sending enable, a packet sending period, a packet type, and a packet length.
    对于BFD报文,所述发送参数还包括:诊断码(Diag)字段。For the BFD packet, the sending parameter further includes: a Diagnose Code (Diag) field.
  16. 根据权利要求15所述的装置,其中,所述第二RAM,配置为通过配置接口将用户配置的BFD报文和CCM报文的检测参数写入第二RAM的检测配置表项中,将当前时间写入检测配置表项中,作为上一次报文的到达时间;其中,The device of claim 15, wherein the second RAM is configured to write the BFD message and the CCM message detection parameter configured by the user into the detection configuration entry of the second RAM through the configuration interface, and the current Time is written in the detection configuration entry as the arrival time of the last packet;
    所述检测参数包括:检测使能、报文检测周期和报文检测类型。The detection parameters include: detection enable, message detection period, and message detection type.
  17. 根据权利要求16所述的装置,其中,所述报文发送模块包括:信息组成模块和报文发送预处理模块;其中,The device according to claim 16, wherein the message sending module comprises: an information component module and a message sending preprocessing module; wherein
    信息组成模块,配置为定时轮询第一RAM的发送配置表项,当发送使能有效时,将计时器的当前时间和上一次报文的发送时间计算出差值,当所述差值大于报文发送周期时,组成发送实例,当所述差值小于报文发送周期时,不对报文进行处理,继续定时轮询操作;The information component module is configured to periodically poll the sending configuration entry of the first RAM. When the sending enable is valid, calculate the difference between the current time of the timer and the sending time of the last packet, when the difference is greater than When the packet is sent, the packet is configured as a sending instance. When the difference is smaller than the packet sending period, the packet is not processed and the polling operation is continued.
    报文发送预处理模块,配置为根据所述发送实例对报文进行读取、修改和发送。The packet sending pre-processing module is configured to read, modify, and send the packet according to the sending instance.
  18. 根据权要求17所述的装置,其中,所述信息组成模块组成发送实例时,配置为根据报文类型,提取报文发送信息,并更新发送配置表项中的上一次发送时间为当前时间;其中,The device according to claim 17, wherein the information component module is configured to extract the packet sending information according to the packet type, and update the last sending time in the sending configuration entry to the current time; among them,
    所述报文发送信息包括:会话号、报文类型和报文长度;The message sending information includes: a session number, a packet type, and a packet length.
    对于BFD报文,报文发送信息还包括:Diag字段。For BFD packets, the packet sending information also includes the Diag field.
  19. 根据权利要求18所述的装置,其中,所述报文发送预处理模块在根据所述报文发送信息对报文进行读取时,配置为根据所述会话号得到报文存储在双倍速率同步动态随机存储器(DDR3)中的基地址,再根据所述报文长度和所述DDR3的数据位宽得到报文存储的基地址起的所有地址,读出报文;其中,The device according to claim 18, wherein the message sending and processing module is configured to store the message according to the session number and store the data at a double rate when the message is read according to the message sending information. Synchronizing the base address in the dynamic random access memory (DDR3), and then obtaining all the addresses from the base address of the message according to the packet length and the data bit width of the DDR3, and reading the message;
    所述DDR3为存储报文信息的外置DDR3; The DDR3 is an external DDR3 for storing message information;
    报文发送预处理模块对报文进行修改时,配置为根据报文类型读取网络设备中相应会话的状态,再根据所述状态判断是否需要进行修改;其中,When the packet sending pre-processing module modifies the packet, it is configured to read the state of the corresponding session in the network device according to the packet type, and then determine whether it needs to be modified according to the state;
    当报文类型为BFD时,读取相应BFD会话的状态,当所述状态为会话中断时,为报文添加替换标记1;When the packet type is BFD, the status of the corresponding BFD session is read. When the status is the session interrupt, the replacement flag 1 is added to the packet.
    当报文类型为CCM时,读取相应的CCM会话的状态,当所述状态为会话中断时,为报文添加修改标记1;When the packet type is CCM, the state of the corresponding CCM session is read, and when the state is a session interruption, a modification flag 1 is added to the packet;
    报文发送预处理模块在对报文进行发送时,配置为当报文类型为BFD,且替换标记为1时,将报文中的Diag字段替换为所述报文发送信息中的Diag字段,根据网络设备的发送通道的特性将报文组装成规定的格式发送出去;The packet sending pre-processing module, when the packet is sent, is configured to replace the Diag field in the packet with the Diag field in the packet sending information when the packet type is BFD and the replacement flag is 1. The packets are assembled into a prescribed format according to the characteristics of the transmission channel of the network device;
    当报文类型为CCM,且修改标记为1时,将报文中的RDI字段替换成1,根据网络设备的发送通道的特性将报文组装成规定的格式发送出去。When the packet type is CCM and the modification flag is 1, the RDI field in the packet is replaced with 1, and the packet is assembled into a specified format according to the characteristics of the transmission channel of the network device.
  20. 根据权利要求19所述的装置,其中,所述报文检测模块,配置为判断是否有报文到达,当有时,根据报文类型和报文中的会话号对报文进行相应的检测处理,当没有时,定时轮询第二RAM的检测配置表项,当检测使能有效时,将计时器的当前值和上一次报文到达时间计算出差值,当所述差值大于报文检测周期时,判定会话发生超时中断,产生中断信息;当所述差值小于报文检测周期时,继续进行定时轮询操作,并判断是否有报文到达。The device according to claim 19, wherein the packet detecting module is configured to determine whether a packet arrives, and sometimes, according to the packet type and the session number in the packet, the packet is detected and processed accordingly. When not, periodically polling the detection configuration entry of the second RAM, when the detection enable is valid, calculating the difference between the current value of the timer and the arrival time of the previous packet, when the difference is greater than the packet detection During the period, it is determined that the session has a timeout interrupt, and an interrupt information is generated. When the difference is less than the packet detection period, the timing polling operation is continued, and it is determined whether a packet arrives.
  21. 根据权利要求20所述的装置,其中,当有报文到达,且报文类型是BFD时,所述报文检测模块,配置为提取报文中的会话号,读取所述会话号对应的上一个Diag字段,将所述上一个Diag字段与报文中的Diag字段比较,当改变时,判定所述会话中断,记录当前Diag字段,产生中断信息,当没有改变时,判定会话没有中断,更新上一次报文的到达时间为当前时间。 The device according to claim 20, wherein, when a packet arrives and the packet type is BFD, the packet detecting module is configured to extract a session number in the packet, and read the corresponding session number. The previous Diag field compares the previous Diag field with the Diag field in the message. When the change is made, the session is interrupted, the current Diag field is recorded, and the interrupt information is generated. When there is no change, the session is determined to be uninterrupted. Update the arrival time of the last message as the current time.
  22. 根据权利要求21所述的装置,其中,当有报文到达,且报文类型为CCM时,所述报文检测模块,配置为提取报文中的会话号,读取所述会话号对应的上一个RDI字段,将所述上一个RDI字段与报文中的RDI字段比较,当有改变时,判定所述会话中断,记录当前RDI字段,产生中断信息,当没有改变时,判定会话没有中断,更新上一次报文的到达时间为当前时间。The device according to claim 21, wherein, when a packet arrives and the packet type is CCM, the packet detecting module is configured to extract a session number in the packet, and read the corresponding session number. The last RDI field compares the previous RDI field with the RDI field in the message, and when there is a change, determines that the session is interrupted, records the current RDI field, generates an interrupt message, and when there is no change, determines that the session is not interrupted. Update the arrival time of the last message to the current time.
  23. 一种计算机存储介质,其中,其中存储有计算机程序,该计算机程序用于执行权利要求1至12任一项所述的OAM报文快速发送和检测处理的方法。 A computer storage medium, wherein a computer program for executing the method for quickly transmitting and detecting OAM messages according to any one of claims 1 to 12 is stored.
PCT/CN2014/090899 2014-04-02 2014-11-12 Method and apparatus for rapid sending and detection processing of oam packet, and storage medium WO2015149523A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410132004.5A CN104980293B (en) 2014-04-02 2014-04-02 A kind of OAM message is quickly sent and the method and device of detection processing
CN201410132004.5 2014-04-02

Publications (1)

Publication Number Publication Date
WO2015149523A1 true WO2015149523A1 (en) 2015-10-08

Family

ID=54239368

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/090899 WO2015149523A1 (en) 2014-04-02 2014-11-12 Method and apparatus for rapid sending and detection processing of oam packet, and storage medium

Country Status (2)

Country Link
CN (1) CN104980293B (en)
WO (1) WO2015149523A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109274600A (en) * 2017-07-18 2019-01-25 华为技术有限公司 A kind of method that detection block sends and receives, the network equipment and system
CN114938346A (en) * 2022-05-13 2022-08-23 苏州盛科通信股份有限公司 Method and device for realizing quick service switching by cooperation of chip and CPU

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107800626B (en) * 2016-08-31 2020-10-09 阿里巴巴集团控股有限公司 Data message processing method, device and equipment
CN111565132B (en) * 2020-04-24 2021-11-30 烽火通信科技股份有限公司 Overtime detection method and system for bidirectional forwarding detection message
CN114301852A (en) * 2020-09-23 2022-04-08 深圳市中兴微电子技术有限公司 Message transmission control, generation and transmission method, configuration method, equipment and medium
CN112422442B (en) * 2020-10-21 2022-07-05 鹏城实验室 Method for processing session interrupt message of bidirectional forwarding detection protocol and storage medium
CN112328322B (en) * 2020-10-26 2023-08-01 银盛支付服务股份有限公司 Method and system for localization of Apollo configuration

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478421A (en) * 2008-12-05 2009-07-08 中兴通讯股份有限公司 OAM packet timing processing system and method
CN101848223A (en) * 2010-05-25 2010-09-29 中兴通讯股份有限公司 Network processor-based method and device for realizing quick bidirectional forwarding detection of messages

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8054830B2 (en) * 2005-12-07 2011-11-08 Alcatel Lucent Managing the distribution of control protocol information in a network node
KR100872453B1 (en) * 2006-08-31 2008-12-08 영남대학교 산학협력단 BFD/OAM BASED SYSTEM FOR AND BFD/OAM BASED METHOD OF MONITORING FAILURES AND MEASURING PERFORMANCE IN DiffServ-over-MPLS
US8804534B2 (en) * 2007-05-19 2014-08-12 Cisco Technology, Inc. Interworking between MPLS/IP and Ethernet OAM mechanisms
US8824302B2 (en) * 2012-07-23 2014-09-02 Alcatel Lucent Proxy maintenance endpoint at provider edge switch
CN103152205B (en) * 2013-03-22 2016-02-10 烽火通信科技股份有限公司 Based on OAM processing method and the device of stream index

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478421A (en) * 2008-12-05 2009-07-08 中兴通讯股份有限公司 OAM packet timing processing system and method
CN101848223A (en) * 2010-05-25 2010-09-29 中兴通讯股份有限公司 Network processor-based method and device for realizing quick bidirectional forwarding detection of messages

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
MIZRAHI, T. ET AL., AN OVERVIEW OF OPERATIONS, ADMINISTRATION, AND MAINTENANCE (OAM) MECHANISMS DRAFT-IETF-OPSAWG-OAM-OVERVIEW-OO.TXT, 17 January 2010 (2010-01-17), XP055228580 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109274600A (en) * 2017-07-18 2019-01-25 华为技术有限公司 A kind of method that detection block sends and receives, the network equipment and system
US11539607B2 (en) 2017-07-18 2022-12-27 Huawei Technologies Co., Ltd. Detection block sending and receiving method, and network device and system
CN114938346A (en) * 2022-05-13 2022-08-23 苏州盛科通信股份有限公司 Method and device for realizing quick service switching by cooperation of chip and CPU

Also Published As

Publication number Publication date
CN104980293A (en) 2015-10-14
CN104980293B (en) 2019-05-31

Similar Documents

Publication Publication Date Title
WO2015149523A1 (en) Method and apparatus for rapid sending and detection processing of oam packet, and storage medium
JP4542045B2 (en) Data communication apparatus and method
EP3139560B1 (en) Packet processing method, device and computer storage medium
US7869376B2 (en) Communicating an operational state of a transport service
JP5913635B2 (en) Redundant network connection
WO2016107369A1 (en) Method and device for managing data transmission channel
EP2536066A1 (en) Link detecting method, apparatus and system
WO2018210213A1 (en) Method and device for implementing ioam packaging and storage medium
EP2961101B1 (en) Method, system and optical network terminal for ethernet performance detection
CN105791126B (en) Ternary Content Addressable Memory (TCAM) table look-up method and device
WO2019128273A1 (en) Method, device and system for determining connection relation of network devices
US20170222864A1 (en) Method and Apparatus for Implementing Operation, Administration, and Maintenance Function
WO2020088683A1 (en) Method for processing routing event record entry, network device and control device
CN104283711A (en) Fault detection method based on BFD, nodes and system
US20230111966A1 (en) Ethernet storage system, and information notification method and related apparatus thereof
US20140092725A1 (en) Method and first network node for managing an ethernet network
US8670299B1 (en) Enhanced service status detection and fault isolation within layer two networks
JP2012227804A (en) Information processing device, and control method for information processing device
CN104702498A (en) Method and device for reducing the number of optical connections through coordination protection
WO2015184759A1 (en) Apparatus and method for state detection and fault tolerance of service network port
CN103840965B (en) Method for enhancing quick fault convergence in RSTP
CN108282383B (en) Method and equipment for realizing fault processing
WO2022048466A1 (en) Operation administration and maintenance (oam) packet processing method and device
WO2014008809A1 (en) Frame loss detection method and system
JP5304200B2 (en) Network management system, network management method, manager and agent

Legal Events

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

Ref document number: 14888049

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: DECISION TO REFUSE A EUROPEAN PATENT APPLICATION (EPO FORM 1205A DATED 28/02/2017)

122 Ep: pct application non-entry in european phase

Ref document number: 14888049

Country of ref document: EP

Kind code of ref document: A1