CN103684585B - The method, apparatus and system of measuring and protecting group switching time - Google Patents

The method, apparatus and system of measuring and protecting group switching time Download PDF

Info

Publication number
CN103684585B
CN103684585B CN201210319882.9A CN201210319882A CN103684585B CN 103684585 B CN103684585 B CN 103684585B CN 201210319882 A CN201210319882 A CN 201210319882A CN 103684585 B CN103684585 B CN 103684585B
Authority
CN
China
Prior art keywords
message
protection group
packet
port
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210319882.9A
Other languages
Chinese (zh)
Other versions
CN103684585A (en
Inventor
孟万红
陈锐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201210319882.9A priority Critical patent/CN103684585B/en
Publication of CN103684585A publication Critical patent/CN103684585A/en
Application granted granted Critical
Publication of CN103684585B publication Critical patent/CN103684585B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides the method for measuring and protecting group switching time, equipment and system; be used in measuring and protecting group switching time in existing network; specifically comprise: the situation of change receiving the port of message according to the situation of change of port-mark entrained in the message that opposite end sends or local terminal; whether the protection group judging between opposite end and local terminal there occurs is switched; switch if there occurs, the temporal information utilizing protection group to switch the message of front and back calculates protection group switching time.Instant invention overcomes in prior art the drawback utilizing external tester measuring and protecting group switching time, can measure in existing network, meanwhile, utilize the port change sending or receive message to judge the method whether protection group switches to there will not be erroneous judgement.

Description

Method, equipment and system for measuring protection group switching time
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, a device, and a system for measuring a protection group switching time.
Background
With the improvement of the position of the access device in the network, various passive optical network (xPON) networks are utilized to perform fiber to the building/roadside/Home (FTTB/C/H, fiber to the building/currb/Home) networking or mobile bearing networking forms, which puts higher reliability requirements on the networking application of the Optical Line Terminal (OLT).
In order to ensure the reliability of the service, it is necessary to analyze possible fault points of the optical network system, and when a fault occurs at a fault point, it is necessary to use a line protection scheme for protection in order to ensure that the service is not interrupted. A commonly used protection scheme is to establish a protection group, also called protection mechanism or protection switching, in a link. One protection group includes devices in the protection link, the connection relationship between the devices, and the protection switching mechanism between the devices. In addition, a protection system composed of a plurality of protection groups may also be referred to as a protection group. Under normal working state, the main port bears service. When the main port link fails, the system automatically switches the service of the main port to the standby port, thereby ensuring the normal transmission of the service and providing the protection for the link. The protection group switching needs a certain time, and if the protection group switching time is too long, the network service quality is reduced and even interrupted, so the protection group switching time is a key index of the system. The protection group switching time refers to the time of link interruption caused by protection group switching of a link, and includes the switching time of the main and standby ports and the link recovery time after switching is completed.
The line protection scheme supported by the current optical network system includes gigabit-capable passive optical network protection type B (GPONTYPEB), GPONTYPEB dual homing, GPONTYPEC, ethernet passive optical network protection type B (EPONTYPEB), and EPONTYPED, and the network side protection scheme includes an ethernet port protection group, and the like. The switching of the protection groups of each line protection scheme requires a certain time. Each network layer has a certain requirement on service interruption time, and if the switching time of the protection group is too long, the quality of the network service is reduced and even interrupted. Therefore, in order to ensure that the service is not interrupted when a fault occurs, various protection means have corresponding requirements for switching performance, including requirements for switching time of the protection group.
Currently, for the measurement of the protection group switching time, a tester continuously sends a common ethernet packet, and when an opposite-end tester receives the packet, the number of packet losses when the opposite-end receives the packet is observed to estimate the switching time. This approach is not very operable in the existing network environment; and when the protection group is not switched but only link packet loss occurs, misjudgment can be performed, which results in inaccurate switching time of the protection group.
Disclosure of Invention
In order to solve the problems that the existing network operability of the prior art is not strong and misjudgment is easy when a packet is sent by a tester and an opposite terminal calculates a switching time scheme according to the number of packet losses, embodiments of the present invention provide a method, a device and a system for measuring the switching time of a protection group. Specifically, the method comprises the following steps:
according to a first aspect of the embodiments of the present invention, a method for measuring a switching time of a protection group is provided, including: the first equipment in the protection group is connected with the main port and the standby port of the second equipment in the protection group; the method comprises the steps that first equipment continuously receives messages for measuring the switching time of a protection group, every two adjacent messages for measuring the switching time of the protection group are sent by a sending end at a first time interval which is smaller than or equal to the maximum measurement error allowed by the measurement of the switching time of the protection group, and the messages for measuring the switching time of the protection group carry port identification of a sending port of the sending end; the first device compares whether the port identifiers carried in the first message and the second message are the same or not to judge whether the protection group is switched or not, wherein the second message is a message which is received by the first device and is from the second device and used for measuring the switching time of the protection group, and the first message is a previous message which is received by the first device and is from the second device and used for measuring the switching time of the protection group; and if the port identifications carried in the first message and the second message are different, the first equipment calculates the switching time of the protection group according to the time information of the first message and the second message.
In a first possible implementation manner of the first aspect, optionally, the calculating the protection group switching time according to the time information of the first packet and the second packet specifically includes: the time information of the first message is the receiving time of the first message received by the first equipment, and the time information of the second message is the receiving time of the second message received by the first equipment; the first equipment compares the receiving time of the second message with the receiving time of the first message to obtain the switching time of the protection group; or the time information of the first message is the sending time of the first message carried in the first message, and the time information of the second message is the sending time of the second message carried in the second message; the first equipment compares the sending time of the second message with the sending time of the first message to obtain the switching time of the protection group; or the time information of the first packet is the packet serial number and the packet transmission interval of the first packet carried in the first packet, the time information of the second packet is the packet serial number and the packet transmission interval of the second packet carried in the second packet, and the first device compares the difference between the packet serial number of the second packet and the packet serial number of the first packet, and multiplies the difference by the transmission interval carried in the first packet or the second packet to obtain the protection group switching time.
In a second possible implementation manner of the first aspect, further, the first device is an optical network unit ONU or an optical network terminal ONT, and the second device is an optical line terminal OLT; or, the first device is an OLT, and the second device is an optical network unit ONU or an optical network terminal ONT; or the first device is an access device, and the second device is a convergence device; or, the first device is a convergence device, and the second device is an access device.
In a third possible implementation manner of the first aspect, the message used for measuring the switching time of the protection group is a one-way delay measurement 1DM message, and the first time interval is 5 milliseconds.
According to a second aspect of the embodiments of the present invention, there is provided a method for measuring a switching time of a protection group, including: the main port and the standby port of the first equipment in the protection group are connected with the second equipment in the protection group; the method comprises the steps that first equipment receives messages for measuring the switching time of a protection group, every two adjacent messages for measuring the switching time of the protection group are sent by a sending end at a first time interval which is smaller than or equal to the maximum measurement error allowed by the measurement of the switching time of the protection group; the first device compares whether the main ports of the two adjacent received messages are the same or not so as to judge whether the protection group is inverted or not; if the active port of the first device receiving the messages twice is changed, the first device calculates the protection group switching time according to the time information of the first message and the second message, the second message is the first message which is received by the first device after the active port of the first device receiving the messages is changed and is from the second device, and the first message is the last message which is received by the first device and is from the second device and is used for measuring the protection group switching time.
In a first possible implementation manner of the second aspect, calculating the protection group switching time according to the time information of the first packet and the second packet specifically includes: the time information of the first message is the receiving time of the first message received by the first equipment, and the time information of the second message is the receiving time of the second message received by the first equipment; the first equipment compares the receiving time of the second message with the receiving time of the first message to obtain the protection switching time; or the time information of the first message is the sending time of the first message carried in the first message, and the time information of the second message is the sending time of the second message carried in the second message; the first equipment compares the sending time of the second message with the sending time of the first message to obtain the switching time of the protection group; or the time information of the first packet is the packet serial number and the packet transmission interval of the first packet carried in the first packet, the time information of the second packet is the packet serial number and the packet transmission interval of the second packet carried in the second packet, and the first device compares the difference between the packet serial number of the second packet and the packet serial number of the first packet, and multiplies the difference by the transmission interval carried in the first packet or the second packet to obtain the protection group switching time.
In a second possible implementation manner of the second aspect, further, the first device is an optical network unit ONU or an optical network terminal ONT, and the second device is an optical line terminal OLT; or, the first device is an OLT, and the second device is an ONU or an ONT; or, the first device is an access device, and the second device is a convergence device; or, the first device is a convergence device, and the second device is an access device.
In a third possible implementation manner of the second aspect, further, the message for measuring the protection switching time is a one-way delay measurement 1DM message, and the first time interval is 5 milliseconds.
According to a third aspect of the embodiments of the present invention, a method for measuring a switching time of a dual-homing protection group is provided, which specifically includes: the main port and the standby port of the first device in the protection group are respectively connected with the second device and the third device in the protection group; the method comprises the steps that first equipment receives a first message and a second message, the second message is a message which is received by the first equipment and is from second equipment or third equipment and used for measuring protection group switching time, and the first message is a last message which is received by the first equipment and is from the second equipment or the third equipment and used for measuring the protection group switching time; every two adjacent messages used for measuring the switching time of the protection group from the second equipment or the third equipment are sent by a sending end at a first time interval which is less than or equal to the maximum measurement error allowed by the measurement of the switching time of the protection group; the first device judges whether the main ports for receiving the first message and the second message are the same or not so as to judge whether the protection group is switched or not; or, the first device determines whether the device identifier carried in the first message is the same as the device identifier carried in the second message, so as to determine whether the protection group is switched; and if the first message and the second message are different, the first equipment calculates the switching time of the protection group according to the time information of the first message and the second message.
In a first possible implementation manner of the third aspect, calculating the protection group switching time according to the time information of the first packet and the second packet specifically includes: the time information of the first message is the receiving time of the first message received by the first equipment, and the time information of the second message is the receiving time of the second message received by the first equipment; the first equipment compares the receiving time of the second message with the receiving time of the first message to obtain the switching time of the protection group; or the time information of the first message is the sending time of the first message carried in the first message, and the time information of the second message is the sending time of the second message carried in the second message; and the first equipment compares the sending time of the second message with the sending time of the first message to obtain the switching time of the protection group.
In a second possible implementation manner of the third aspect, the first device is an optical network unit ONU or an optical network terminal ONT, and the second device and the third device are optical line terminals OLT; or, the first device is an access device, and the second device and the third device are convergence devices.
In a third possible implementation manner of the third aspect, the message used for measuring the protection switching time is a one-way delay measurement 1DM message, and the first time interval is 5 milliseconds.
The methods for measuring the switching time of the protection group in the first aspect, the second aspect and the third aspect disclosed in the embodiments of the present invention can measure the switching time of the protection group in the existing network, are convenient and fast, and overcome the disadvantage that an external tester must be used for measurement in the prior art. Meanwhile, the method disclosed by the embodiment of the invention judges whether the protection group switching occurs by using the change of the main port of the sending end or the receiving end, so that misjudgment can not occur, and the problem of inaccurate measurement caused by the fact that an external tester easily makes misjudgment in the prior art is solved.
According to a fourth aspect of the embodiments of the present invention, there is provided a network device, specifically, the network device includes: the receiving module is used for receiving the message; the analysis module is used for analyzing the message received by the receiving module and obtaining an analysis result; the storage module is used for storing the information from the analysis module; the processing module is used for acquiring a second port identifier and a first port identifier, comparing whether the second port identifier is the same as the first port identifier to judge whether switching occurs in a protection group between the network device and the first device, wherein the second port identifier is a port identifier carried in a second message from the parsing module, the first port identifier is a port identifier carried in a first message from the storage module, the second message is a message which is received by the network device and is used for measuring switching time of the protection group from the first device, and the first message is a message which is received by the network device and is used for measuring switching time of the protection group from the first device and is one of the second messages received by the network device; if the two messages are different, the processing module calculates the switching time of the protection group according to the time information of the first message and the second message.
In a first possible implementation manner of the fourth aspect, calculating the protection group switching time according to the time information of the first packet and the second packet specifically includes: the time information of the first message is the sending time of the first message carried in the first message, and the time information of the second message is the sending time of the second message carried in the second message; the processing module compares the sending time of the second message with the sending time of the first message to obtain the switching time of the protection group; or the time information of the first packet is the packet serial number and the packet transmission interval of the first packet carried in the first packet, the time information of the second packet is the packet serial number and the packet transmission interval of the second packet carried in the second packet, and the processing module compares the difference between the packet serial number of the second packet and the packet serial number of the first packet, and multiplies the difference by the transmission interval carried in the first packet or the second packet to obtain the protection group switching time.
In a second possible implementation manner of the fourth aspect, the network device further includes a monitoring module, configured to monitor a receiving time at which the receiving module receives the packet and send the receiving time obtained through monitoring to the processing module; specifically, calculating the protection group switching time according to the time information of the first packet and the second packet includes comparing, by the processing module, the receiving time of the second packet from the monitoring module with the receiving time of the first packet to obtain the protection group switching time.
According to a fifth aspect of the embodiments of the present invention, there is provided a network device, and specifically, the network device includes: the network equipment comprises a main port and a standby port; the receiving module is used for receiving the message; the monitoring module is used for monitoring the port of the receiving module for receiving the message and acquiring the port identification of the main port for receiving the message; the analysis module is used for analyzing the message received by the receiving module and obtaining an analysis result; the storage module is used for storing information from the monitoring module and the analysis module; the processing module is configured to obtain a second port identifier and a first port identifier, compare whether the second port identifier is the same as the first port identifier, and determine whether a protection group between the network device and the first device is switched, where the second port identifier is a port identifier of a main port from the monitoring module, the main port receiving a second packet, the first port identifier is a port identifier of a main port from the storage module, the main port receiving the first packet, the second packet is a packet from the first device, the second packet is used to measure a protection group switching time, and the first packet is a packet from the first device, the last packet of the second packet, the last packet of the first packet is used to measure a protection group switching time; and if the second port identification is different from the first port identification, the processing module calculates the switching time of the protection group according to the time information of the first message and the second message.
In a first possible implementation manner of the fifth aspect, calculating the protection group switching time according to the time information of the first packet and the second packet specifically includes: the time information of the first message is the sending time of the first message carried in the first message, and the time information of the second message is the sending time of the second message carried in the second message; the processing module compares the sending time of the second message with the sending time of the first message to obtain the switching time of the protection group; or the time information of the first packet is the packet serial number and the packet transmission interval of the first packet carried in the first packet, the time information of the second packet is the packet serial number and the packet transmission interval of the second packet carried in the second packet, and the processing module compares the difference between the packet serial number of the second packet and the packet serial number of the first packet, and multiplies the difference by the transmission interval carried in the first packet or the second packet to obtain the protection group switching time.
According to a sixth aspect of the embodiments of the present invention, there is provided a network device, which is applied in a dual-homing protection group, and specifically, the network device includes: a main port and a standby port; the receiving module is used for receiving the message; the monitoring module is used for monitoring the port of the receiving module for receiving the message and acquiring the port identification of the port for receiving the message; the analysis module is used for analyzing the message received by the receiving module and obtaining an analysis result; the storage module is used for storing information from the monitoring module and the analysis module; the processing module is used for acquiring a second port identifier and a first port identifier, comparing whether the second port identifier is the same as the first port identifier, and judging whether the dual-homing protection group is switched, wherein the second port identifier is a port identifier of a second port which is from the monitoring module and used for receiving a second message for measuring the switching time of the protection group, the second port is a main port when the network equipment receives the second message, the first port identifier is a port identifier of a first port which is from the storage module and used for receiving the first message for measuring the switching time of the protection group, the first port is a main port when the network equipment receives the first message, and the first message is a last message which is received by the network equipment and used for measuring the switching time of the protection group; and if the second port identification is different from the first port identification, the processing module calculates the switching time of the protection group according to the time information of the first message and the second message.
In a first possible implementation manner of the sixth aspect, the network device further includes an analysis module, configured to analyze the packet received by the receiving module and obtain an analysis result; calculating the protection group switching time according to the time information of the first packet and the current packet specifically comprises: the processing module acquires the receiving time of the first message from the storage module and the receiving time of the current message from the monitoring module, and compares the receiving time of the current message with the receiving time of the first message to acquire the switching time of the protection group; or, the processing module obtains the sending time carried in the first message from the storage module and the sending time carried in the current message from the analysis module, and compares the sending time carried in the current message with the sending time carried in the first message to obtain the protection group switching time.
According to a sixth aspect of the embodiments of the present invention, there is provided a network device, which is applied in a dual-homing protection group, and specifically, the network device includes: a main port and a standby port; the receiving module is used for receiving the message; the analysis module is used for analyzing the message received by the receiving module and sending the analysis result to the processing module; the storage module is used for storing the information from the analysis module; the processing module is used for acquiring a second device identifier and a first device identifier, and comparing whether the second device identifier is the same as the first device identifier to judge whether the dual-homing protection group is switched, wherein the second device identifier is a device identifier carried in a second message received by a second port of the analysis module and used for measuring switching time of the protection group, the second port is a main port when the network device receives the second message, the first device identifier is an identifier carried in a first message received by a first port of the storage module and used for measuring switching time of the protection group, the first port is a main port when the network device receives the first message, and the first message is a last message received by the network device and used for measuring switching time of the protection group; if the second equipment identifier is different from the first equipment identifier, the processing module calculates the protection group switching time according to the time information of the first message and the second message; the first message and the second message are messages which are sent by a sending end at a time interval which is less than or equal to the maximum measurement error allowed by the protection group switching time measurement and are used for measuring the protection group switching time; .
The network device for measuring the switching time of the protection group disclosed in the embodiments of the present invention can measure the switching time of the protection group in the existing network, which is convenient and fast, and overcomes the disadvantage that the external tester must be used for measurement in the prior art. Meanwhile, the network device disclosed by the embodiment of the invention judges whether the protection group switching occurs by using the change of the main port of the sending end or the receiving end, so that misjudgment can not occur, and the problem of inaccurate measurement caused by the fact that an external tester easily performs misjudgment in the prior art is solved.
According to a seventh aspect of the embodiments of the present invention, a system for measuring a switching time of a protection group is provided, specifically: the system comprises a first network device and a second network device which are connected with each other; the second network device is configured to generate a packet carrying a device identifier of the second network device, or generate a packet carrying a port identifier of a main port of the second network device and a device identifier of the second network device; sending the generated message to the first network equipment, wherein the time interval between every two adjacent messages sent by the second network equipment is less than or equal to the maximum measurement error allowed by the protection group switching time measurement; when a primary port and a standby port of a first device are connected with a second device to form a protection group, a first network device is used for judging whether a protection group between the first network device and the second network device is switched according to whether the primary ports of two adjacent messages for measuring the switching time of the protection group, which are from the second network device, are the same, and if the primary ports are different, the first network device measures the switching time of the protection group; or, when the first device connects the active port and the standby port of the second device to form a protection group, the first network device is configured to determine whether the protection group between the first network device and the second network device is switched according to whether port identifiers carried in two adjacent messages from the second network device for measuring the switching time of the protection group are the same, and if the port identifiers are different, the first network device measures the switching time of the protection group.
In a first possible implementation manner of the seventh aspect, the first network device is further configured to generate a packet carrying the device identifier of the first network device, or generate a packet carrying the port identifier of the active port of the first network device and the device identifier of the first network device; sending the generated message to a second network device, wherein the time interval between every two adjacent messages sent by the first network device is less than or equal to the maximum measurement error allowed by the protection group switching time measurement; when the first device connects the active port and the standby port of the second device to form a protection group, the second network device is further configured to determine whether the protection group between the first network device and the second network device is switched according to whether the active ports of the first network device, which receive two adjacent messages for measuring the switching time of the protection group, are the same, and if the active ports are different, the second network device measures the switching time of the protection group; or when the active port and the standby port of the first device are connected to the second device to form a protection group, the second network device is further configured to determine whether the protection group between the first network device and the second network device is switched according to whether port identifiers carried in two adjacent messages from the first network device for measuring the switching time of the protection group are the same, and if the port identifiers are different, the second network device measures the switching time of the protection group.
According to an eighth aspect of the embodiments of the present invention, there is provided a system for measuring a switching time of a dual-homing protection group, specifically: the system comprises a first network device, a second network device and a third network device, wherein a main port and a standby port of the first network device are respectively connected with the second network device and the third network device; the first network device is the network device disclosed in the sixth aspect of the embodiment of the present invention; the second network device is configured to generate a packet carrying a device identifier of the second network device, and continuously send the packet carrying the device identifier of the second network device to the first network device at a time interval less than or equal to a maximum measurement error allowed by protection group switching time measurement; the third network device is configured to generate a packet carrying a device identifier of the third network device, and continuously send the packet carrying the device identifier of the third network device to the first network device at a time interval less than or equal to a maximum measurement error allowed by protection group switching time measurement.
The system for measuring the switching time of the protection group in the seventh and eighth aspects disclosed in the embodiments of the present invention can measure the switching time of the protection group in the existing network, is convenient and fast, and overcomes the disadvantage that the external tester must be used for measurement in the prior art. Meanwhile, the system disclosed by the embodiment of the invention judges whether the protection group switching occurs by using the change of the main port of the sending end or the receiving end, so that misjudgment can not occur, and the problem of inaccurate measurement caused by the fact that an external tester easily performs misjudgment in the prior art is solved.
Drawings
In order to more clearly illustrate the invention and the related embodiments, the following figures are provided.
Fig. 1 is a flowchart of a method for measuring switching time of a protection group in first, second and third embodiments of the present invention;
fig. 2 is a flowchart of another method for measuring switching time of protection groups according to the first, second, and third embodiments of the present invention;
fig. 3 is a schematic diagram of a GPONTypeB and EPONTypeB protected group networking structure in the first embodiment of the present invention;
fig. 4 is a schematic diagram of an ethernet port protection group networking structure according to a second embodiment of the present invention;
fig. 5 is a schematic diagram of a GPONTypeC and eponpyped protected group networking structure in the third embodiment of the present invention;
fig. 6 is a flowchart of a method for measuring a protection group switching time in a four-GPON and EPON dual-homing protection group according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a GPON and EPON dual-homing protection group networking structure in a fourth embodiment of the present invention;
fig. 8 is a schematic structural diagram of a network device in the fifth, sixth, and seventh embodiments of the present invention;
fig. 9 is a schematic structural diagram of a network device in an eighth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the following embodiments and the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
The first implementation mode comprises the following steps: an embodiment of the present invention provides a method for measuring protection group switching time, where the method may be applied to a GPONTypeB or EPONTypeB networking structure, as shown in fig. 1 and fig. 2, the method includes:
the principle of implementation of the GPONTypeB and EPONTypeB protection mechanisms is similar, as shown in fig. 3. These two protection groups use 2: n optical splitter, there are two Passive Optical Network (PON) ports on OLT, which are simultaneously connected to the 2: the optical splitters of N are connected, only one PON port is in an active state, the port corresponding to the PON port is a main port, the other PON port is in a standby state, and the port corresponding to the PON port is a standby port. Of course, when the cost allows, there may be more than two ports on the OLT, where one port is active and the rest is in standby state. In the embodiment of the present invention, a plurality of messages or messages that can carry port identifiers may be used, and hereinafter, only ethernet messages are taken as an example, and the message used for measuring the protection group switching time may be a normal message or a message specially used for measuring the protection group switching time. The message specially used for measuring the protection group switching time may be a message with a specific identifier, or may be some specific messages, such as a detection-type message. For GPONTypeB and EPONTypeB protection groups, an MEP based on a protection group may be established on the OLT side, and an MEP based on a port may be established on each Optical Network Unit (ONU) or Optical Network Terminal (ONT), which is described as a specific ONU and is denoted as a first ONU, and a measurement method of each ONU or ONT is the same as that of the ONU.
The measurement method specifically includes, as shown in fig. 1:
step 101: as shown in S101 in fig. 1, the first ONU receives a message for measuring the protection group switching time from the OLT. The message for measuring the protection group switching time may be an ethernet message, or may be other types of messages, and the ethernet message is taken as an example below. The type of ethernet packet can be freely selected. The message for measuring the protection group switching time may be a specific message, and the message for transmitting the service may also be used for measurement. The time interval between every two adjacent messages from the OLT is less than or equal to the maximum measurement error allowed by the protection group switching time measurement. The ethernet messages from the OLT may be sent by the OLT, or may be sent by other MEPs established upstream of the OLT and forwarded by the OLT. The maximum measurement error allowed by the protection group switching time measurement is different according to the different measurement accuracy requirements, and may be set artificially, for example, for a GPONTypeB or an EPONTypeB protection group with a protection group switching time requirement of less than 50ms, under the condition of rough measurement, the maximum measurement error allowed by the protection group switching time measurement may be set artificially to be 7 ms. Certainly, it is more convenient, and the existing ethernet periodic message may be selected and used, and may be an ethernet message such as a one-way delay measurement 1DM message, a continuity check message CCM message, a loopback message LBM message, a link trace message LTM message, an alarm indication signal AIS message, a lock signal LCK message, a test TST message, an automatic protection switching APS message, a maintenance communication channel MCC message, a loss measurement message LMM message, a delay measurement DM message, an experimental OAM message EXM message, a vendor-specific OAM message VSM message, and the like. Optionally, in the case of selecting the 1DM packet, according to different precision requirements, the sending interval may be set to be less than or equal to 5ms, such as 1ms, 2ms, and 3.3 ms. These messages that can be used to measure the switching time of the protection group carry the identifier of the active port of the OLT, which is the device where the OLT is located. Optionally, the port identifier may be only a port number of the active port of the OLT, may be a combination of a media access control MAC address of the OLT and the port number of the active port, may also be a combination of an internet protocol IP address of the OLT and the port number of the active port, may also be a combination of an MEP identifier ID of the OLT and the port number of the active port set on a device where the OLT is located, and other identifiers that can be used to distinguish different active ports of the OLT may also be used. Optionally, the port identifier may be carried by using a TLV field of the ETHOAM packet. Optionally, the sent message may carry the sending time of the message. According to different requirements, the destination MAC address of the message transmission may be set to the MAC address of the first ONU or the multicast MAC address.
Step 102: as shown in S102 in fig. 1, after receiving a second packet carrying a port identifier for measuring the protection group switching time from the OLT, the first ONU searches for a first packet carrying the port identifier for measuring the protection group switching time from the OLT, which is received by the first ONU before the second packet, and compares whether the port identifiers carried in the two packets are the same. Under the condition of low precision requirement, the first ONU may also compare whether the port identifiers carried in the message before the first message and the second message are the same, and this method is also an object of protection applied by the present invention, and constitutes an equivalent scheme to that of the embodiment of the present invention. The message from the OLT can also carry other equipment identifiers used for identification so as to be identified by the ONU, and the MD level carried in the message can also be used for identification in the programmed maintenance domain MD. In general, the first ONU may also perform the comparison action after finding that the message is lost, and at this time, only compare the port identifier of the OLT active port carried in the last message received before the message is lost and the port identifier of the active port carried in the first message received after the message is received again. And continuously comparing the port identifications to judge whether the port identifications carried in the front and the back messages are the same. If the judgment in step 102 is the same, it indicates that the protection group has not been switched, and the measurement of the switching time of the protection group is not performed, the identifier for judging the source of the packet, the port identifier and the time information of the packet carried in the received packet are stored for later use, and the second packet and the next received packet for measuring the switching time of the protection group are continuously compared, and the comparison process is continued until the port identifier is found to be different or the measurement is overtime.
Step 103: as shown in S103 in fig. 1, if the determination in step 102 is different, which indicates that the protection group is switched, the switching time of the protection group is obtained according to the difference between the sending time and the receiving time used for the first packet and the second packet. The method for measuring and calculating may be to compare the receiving time of the first message and the receiving time of the second message to obtain the receiving time difference between the two messages. The calculation method can also comprise the following steps: the message carries the moment of sending the message; the calculation method is to compare the sending time carried by the two messages for comparing the port identifiers to obtain the sending time difference. When the message from the OLT is a periodic message, the calculating method may further include: each periodic message carries an integer serial number, and the serial numbers carried by the periodic messages sent sequentially are continuous; the calculation method is to compare the integer serial numbers carried by the two messages for comparing the port identifiers to obtain the difference of the integer serial numbers, and the obtained result is multiplied by the sending interval of the periodic message after the absolute value is taken. The calculated result can be directly regarded as the switching time of the protection group, and the measurement error range is zero to twice of the maximum sending interval of the sending end. Knowing the maximum OLT transmission time interval, the calculation can be subtracted by a maximum transmission interval, and the measurement error becomes zero to the maximum transmission interval at the transmitter. For example, when the message from the OLT is a 1DM message with a 3.3ms transmission interval, the measurement error range of the measurement of the first ONU at the receiving end is 0 to 6.6ms, and after subtracting one transmission interval, the measurement error becomes-3.3 ms to 3.3 ms. Under the condition that the sending time interval is short so as to ensure the measurement precision, the method can also calculate the protection group switching time by utilizing the time information of the message before the first message and the second message, and the method is an equivalent scheme of the embodiment of the invention.
Through step 101, step 102, and step 103, the first ONU can measure the protection group downlink switching time. In addition, the uplink switching time of the protection group can be measured through step 101a, step 102b, and step 103a, as shown in fig. 2. The measurement of the uplink switching time of the protection group and the measurement of the downlink switching time of the protection group can be performed independently or simultaneously. The simultaneous measurement does not necessarily require synchronization, but can realize the measurement of the downlink switching time and the uplink switching time of the protection group in the same protection group switching process.
Step 101 a: as shown in S201 in fig. 2, the OLT receives a message from the first ONU for measuring the protection group switching time. The message for measuring the protection group switching time may be an ethernet message, or may be other types of messages, and the ethernet message is taken as an example below. The type of ethernet packet can be freely selected. The message for measuring the protection group switching time may be a specific message, and the message for transmitting the service may also be used for measurement. The time interval between every two adjacent messages from the first ONU is less than or equal to the maximum measurement error allowed by the protection group switching time measurement. The maximum measurement error allowed by the protection group switching time measurement is different according to the different measurement accuracy requirements, and may be set artificially, for example, for a GPONTypeB or an EPONTypeB protection group with a protection group switching time requirement of less than 50ms, under the condition of rough measurement, the maximum measurement error allowed by the protection group switching time measurement may be set artificially to be 5 ms. Certainly, it is more convenient, and the existing ethernet periodic message may be selected and used, and may be an ethernet message such as a one-way delay measurement 1DM message, a continuity check message CCM message, a loopback message LBM message, a link trace message LTM message, an alarm indication signal AIS message, a lock signal LCK message, a test TST message, an automatic protection switching APS message, a maintenance communication channel MCC message, a loss measurement message LMM message, a delay measurement DM message, an experimental OAM message EXM message, a vendor-specific OAM message VSM message, and the like. Optionally, in the case of selecting the 1DM packet, according to different precision requirements, the sending interval may be set to be less than or equal to 5ms, such as 1ms, 2ms, and 3.3 ms. Optionally, the device identifiers include any one or a combination of any two of a media access control MAC address of the device where the OLT is located, a device number of the device where the OLT is located, an MEP identity ID of the OLT, and an internet protocol IP address of the device where the OLT is located, the combination of the MAC address, the device number, the MEPID, the IP address, and other information may be used as the device identifier of the device, and other identifiers capable of distinguishing different ONUs may also be used as the device identifier. Optionally, the device identifier may be carried in a type, length, and value TLV field in the packet. Optionally, the sent message may carry the sending time of the message. According to different requirements, the destination MAC address of the message transmission may be set to the MAC address of the first ONU or the multicast MAC address.
Step 102 a: as shown in S202 in fig. 2, the OLT compares whether the active ports receiving the two messages adjacent to each other are different. The message described here is not limited to the message sent by the first ONU. Under the condition of low precision requirement, the OLT may also compare whether the main port for receiving the packet changes at regular time, or may compare whether the main port for receiving two adjacent packets changes, and these two methods are also the subject of protection of the present invention, and constitute an equivalent scheme to the embodiments of the present invention. In general, the OLT may also perform the comparison action after finding that the message is lost, and at this time, may only compare the port identifier of the active port that receives the last message before the message is lost and the port identifier of the active port that receives the first message after the message is received again. Each port has a cache, and the OLT may determine the active port for receiving the packet by determining from which port the read packet comes from the cache corresponding to the port. And judging whether the main port used for receiving the message by the OLT changes or not by continuously comparing the main ports used for receiving the message before and after. If the primary ports used for receiving the messages are different before and after, which indicates that the protection group is switched, the time information for calculating the switching time of the protection group is obtained. In the embodiment of the invention, the OLT corresponds to a plurality of first ONUs, and the protection group switching time refers to the switching time of the equipment where the OLT and a certain specific ONU are located. Therefore, the messages for calculating the switching time need to come from the same ONU. Taking the case that the OLT measures the switching time of the protection group between the OLT and the first ONU, after determining that the protection group is switched, acquiring time information of the last message from the first ONU received by the OLT before the switching occurs; and acquiring time information of a first message from the first ONU received by the OLT after the occurrence of the inversion, for example, searching for the message by using a device identifier carried in the message and acquiring the time information. If the judgment in step 102a is the same, it indicates that the protection group is not switched, the device where the OLT is located receives the port identifier of the port of the next packet in the two packets for comparison and the corresponding time information for comparison in the next time, and continues to use the port identifier of the receiving port of the received packet and the port identifier of the port of the receiving port of the next packet, and this comparison process continues until the active port for receiving packets before and after the comparison is found to be different or the measurement is overtime.
Step 103 a: as shown in S203 in fig. 2, if the comparison result in step 102a is different, the OLT searches for a first packet received from the first ONU after the active port changes and used for measuring the switching time of the protection group, and a packet received from the first ONU on the first packet and used for measuring the switching time of the protection group. And calculating the sending time difference or the receiving time difference of the two messages according to the time information of the two messages to obtain the switching time of the protection group. Optionally, the method for calculating the time interval may be to compare the receiving time of the packet found in step 102b to obtain the receiving time difference. Optionally, the method for calculating the time interval may also be according to the sending time of the packet carried in the packet, or according to the integer serial number of the packet carried in the packet and the sending interval of the packet. The specific calculation method and error processing method are the same as those described in step 103, and are not described herein again. The message for measuring the protection group switching time may be a message specially used for measuring the protection group switching time, or may be a normal message. Under the condition of low precision requirement, other messages before and after the change of the main port can be used for calculation, and the method is an equivalent scheme of the embodiment of the invention. It should be noted that the two messages before and after calculation disclosed in the embodiment of the present invention refer to messages sent by the first ONU, and messages sent by other ONUs are not considered when measuring the uplink switching time of the ONU protection group where the first ONU is located. The OLT may identify a transmission source of the message by using the MAC address of the ONU where the first ONU is located, or other device identifier identifying the ONU, which is carried in the message.
It should be noted that the first ONU and the OLT may or may not synchronize the transmission message. The message type of the message sent by the first ONU and the message type of the message sent by the OLT may be the same or different. The messages sent by the first ONU and the OLT may be periodic messages, and the sending intervals of the periodic messages may be selected according to hardware conditions and types of the messages, and may be different. The smaller the transmission interval of the selected periodic message is, the higher the protection switching time precision measured by the opposite terminal is. In addition, under the condition that the OLT sends a multicast message, each ONU can measure the downlink switching time of each protection group in one switching, and under the condition that each ONU sends a periodic message to the OLT, the OLT can measure the uplink switching time of each protection group of each ONU in one switching, and the actions can be carried out simultaneously, so that each ONU and the OLT respectively measure the downlink and uplink switching time of each protection group of each ONU in one protection group switching process.
The method for measuring the switching time of the protection group disclosed by the embodiment of the invention can measure the switching time of the protection group in the existing network, is convenient and quick, and overcomes the defect that an external tester is required to be used for measurement in the prior art. Meanwhile, the method disclosed by the embodiment of the invention judges whether the protection group switching occurs by using the change of the main port of the sending end or the receiving end, so that misjudgment can not occur, and the problem of inaccurate measurement caused by the fact that an external tester easily makes misjudgment in the prior art is solved.
The second embodiment: an embodiment of the present invention provides a method for measuring a switching time of a protection group, as shown in fig. 1 and fig. 2.
As shown in fig. 4, an ethernet port protection group may be used for link protection between the aggregation device and the access device. The convergence device and the access device have two ports, and both ports of the device are enabled, but only the active port is in an active state, and the other port is in a standby state. In some cases, there may be more than one spare port for a protection group, and the method is equally applicable. In the embodiment of the present invention, a plurality of messages or messages that can carry port identifiers may be used, and hereinafter, only ethernet messages are taken as an example, and the message used for measuring the protection group switching time may be a normal message or a message specially used for measuring the protection group switching time. The message specially used for measuring the protection group switching time may be a message with a specific identifier, or may be some specific messages, such as a detection-type message. In the protection group shown in fig. 4, two links are respectively established at two ports of the access device and the convergence device, an MEP based on the protection group is established at the access device, and an MEP based on the protection group is established at the convergence device.
The specific measurement method is as follows:
step 201: as shown in S101 in fig. 1 or S201 in fig. 2, the access device receives a message from the aggregation device for measuring the protection group switching time. The message for measuring the protection group switching time may be an ethernet message, or may be other types of messages, and the ethernet message is taken as an example below. The type of ethernet packet can be freely selected. The message for measuring the protection group switching time may be a specific message, and the message for transmitting the service may also be used for measurement. The time interval between every two adjacent messages from the aggregation equipment is less than or equal to the maximum measurement error allowed by the protection group switching time measurement. The ethernet messages from the aggregation device may be sent by the aggregation device, or may be sent by other MEPs established upstream from the aggregation device. The maximum measurement error allowed by the protection group switching time measurement differs according to the measurement accuracy requirement, and may be set artificially, for example, in the case of a rough measurement, the maximum measurement error allowed by the protection group switching time measurement may be set artificially to be 100 ms. Certainly, it is more convenient, and the existing ethernet periodic message may be selected and used, and may be an ethernet message such as a one-way delay measurement 1DM message, a continuity check message CCM message, a loopback message LBM message, a link trace message LTM message, an alarm indication signal AIS message, a lock signal LCK message, a test TST message, an automatic protection switching APS message, a maintenance communication channel MCC message, a loss measurement message LMM message, a delay measurement DM message, an experimental OAM message EXM message, a vendor-specific OAM message VSM message, and the like. Optionally, in the case of selecting the 1DM packet, according to different precision requirements, the sending interval may be set to be less than or equal to 5ms, such as 1ms, 2ms, and 3.3 ms. Optionally, the messages from the aggregation devices may carry the active port identifier of the device where the aggregation device is located, that is, the aggregation device, and the carrying method may be that the relevant port identifier is issued to the hardware or software of the sending port through software, and when the message passes through the port, the hardware or software adds the corresponding identifier to the message. Optionally, the port identifier may be only a port number of the active port of the convergence device, may be a combination of a media access control MAC address of the convergence device and the port number of the active port, may also be a combination of an internet protocol IP address of the convergence device and the port number of the active port, may also be a combination of an MEP identity ID of the convergence device and the port number of the active port, and other identifiers that can be used to distinguish different active ports of the convergence device may also be used. Optionally, the TLV field of the packet from the aggregation device may carry the MAC address, the device number, or the MEPID of the aggregation device. Optionally, the sent message may carry the sending time of the message. According to different requirements, the destination MAC address of the message transmission can be set as the MAC address of the access equipment or the multicast MAC address.
Step 202: after receiving a second packet carrying a port identifier for measuring the protection group switching time from the aggregation device, the access device searches for a first packet carrying the port identifier for measuring the protection group switching time from the aggregation device, which is received by the access device before the packet, and compares whether the port identifiers carried in the two packets are the same, as shown in S102 in fig. 1. Under the condition of low precision requirement, the access device can also compare whether the port identifiers carried in the message before the first message and the second message are the same, and the method is also an object protected by the invention and forms an equivalent scheme with the embodiment of the invention. The device identification such as the source MAC address and the source IP address carried in the message can be used for identifying whether the message comes from the aggregation device, the message from the aggregation device can also carry other device identification used for identification so as to be identified by the access device, and the MD grade carried in the message can also be used for identification in a planned maintenance domain MD. In general, the access device may perform the comparison action after finding that the packet is lost, and at this time, may only compare the port identifier of the active port of the aggregation device carried in the last packet received before the packet is lost with the port identifier of the active port carried in the first packet received after the packet is received again. Or, as shown in S202 in fig. 2, comparing whether the active ports receiving the two adjacent messages are different. Under the condition of low precision requirement, the OLT may also compare whether the main port for receiving the packet changes at regular time, or may compare whether the main port for receiving two adjacent packets changes, and these two methods are also the subject of protection of the present invention, and constitute an equivalent scheme to the embodiments of the present invention. And continuously comparing the port identification or the receiving end main port to judge whether the port identification or the receiving end main port carried in the previous and next messages are the same. If the judgment in step 202 is the same, it indicates that the protection group is not switched, the access device stores relevant information, such as information for identifying the aggregation device, port identification, time information of the packet, and the like, and continues to compare, and the comparison process continues until the difference occurs between the active ports for receiving the packet before and after discovery or the port identifications carried in the packet before and after discovery, or the measurement is overtime.
Step 203: as shown in S103 in fig. 1 or S203 in fig. 2, if the determination in step 202 is different, which indicates that the protection group is switched, the access device obtains the protection group switching time according to the difference between the sending time and the receiving time of the two messages from the aggregation device before and after the protection group is switched, where the two messages are used for measuring the protection group switching time. Optionally, the two messages used for calculation may be two messages that are received adjacently and are from the aggregation device and used for measuring the switching time of the protection group, and under the condition that the accuracy requirement is not high, the two messages that are not adjacent may also be used for calculation. The calculation method can be based on the receiving time of the message or the sending time carried in the message, or based on the sequence number in the periodic message. The specific calculation method and error processing method are the same as those described in step 103 in the first embodiment, and are not described herein again.
Through step 201, step 202, and step 203, the access device where the access device is located can measure the protection group downlink switching time. Because the devices on both sides of the ethernet port protection group are symmetrical and both single devices are equipped with dual ports, the method for measuring the uplink switching time of the protection group is the same as the method for measuring the downlink switching time, i.e., the aggregation device can measure the uplink switching time of the protection group by the same method. The access device and the convergence device simultaneously transmit the messages, and the downlink switching time and the uplink switching time of the protection group can be simultaneously measured in the same protection group switching process. Under the condition that one aggregation device corresponds to a plurality of access devices, a message sent by each access device should carry a device identifier so that the aggregation device can identify identifiers from different access devices, and the measurement method is similar.
It should be noted that the access device and the aggregation device may or may not synchronize the transmission messages. The message type of the message sent by the access device and the message type of the message sent by the convergence device may be the same or different. The messages sent by the access device and the aggregation device can be periodic messages, the sending intervals of the periodic messages can be selected according to hardware conditions and the types of the messages, and the sending intervals of the periodic messages sent by the access device and the aggregation device can be different. The smaller the transmission interval of the selected periodic message is, the higher the protection switching time precision measured by the opposite terminal is.
The method for measuring the switching time of the protection group disclosed by the embodiment of the invention can measure the switching time of the protection group in the existing network, is convenient and quick, and overcomes the defect that an external tester is required to be used for measurement in the prior art. Meanwhile, the method disclosed by the embodiment of the invention judges whether the protection group switching occurs by using the change of the main port of the sending end or the receiving end, so that misjudgment can not occur, and the problem of inaccurate measurement caused by the fact that an external tester easily makes misjudgment in the prior art is solved.
The third embodiment is as follows: an embodiment of the present invention provides a method for measuring a protection group switching time, which may be applied to a networking structure such as GPONTypeC or EPONTypeD, as shown in fig. 1 and fig. 2.
The GPONTypeC protection group uses 2: the N optical splitter, EPONTypeD protection group, uses a 1: N optical splitter, but the protection mechanisms of the two are implemented in a similar manner, as shown in fig. 5. Two ports of the OLT are respectively connected with two optical splitters, and two ports of each ONU or ONT are respectively connected with the two optical splitters. Both the OLT and the ONU only have one PON port in the active state as an active port, and the other PON port in the standby state as a standby port. In some cases, there may be more than one spare port for a protection group, and the method is equally applicable. In the embodiment of the present invention, a plurality of messages or messages that can carry port identifiers may be used, and hereinafter, only ethernet messages are taken as an example, and the message used for measuring the protection group switching time may be a normal message or a message specially used for measuring the protection group switching time. The message specially used for measuring the protection group switching time may be a message with a specific identifier, or may be some specific messages, such as a detection-type message. MEPs based on protection groups are established at both the OLT and the ONUs, wherein a certain ONU or ONT is marked as a first ONU, and the measurement method of other ONUs or ONTs is the same as that of the ONU or ONT.
The specific measurement method is as follows:
step 301: as shown in S101 in fig. 1 or S201 in fig. 2, the first ONU receives a message from the OLT for measuring the protection group switching time. The message for measuring the protection group switching time may be an ethernet message, or may be other types of messages, and the ethernet message is taken as an example below. The type of ethernet packet can be freely selected. The message for measuring the protection group switching time may be a specific message, and the message for transmitting the service may also be used for measurement. The time interval between every two adjacent messages from the OLT is less than or equal to the maximum measurement error allowed by the protection group switching time measurement. The ethernet messages from the OLT may be sent by the OLT or by other MEPs established upstream from the OLT. The maximum measurement error allowed by the protection group switching time measurement differs according to the measurement accuracy requirement, and may be set artificially, for example, in the case of a rough measurement, the maximum measurement error allowed by the protection group switching time measurement may be set artificially to be 7 ms. Certainly, it is more convenient, and the existing ethernet periodic message may be selected and used, and may be an ethernet message such as a one-way delay measurement 1DM message, a continuity check message CCM message, a loopback message LBM message, a link trace message LTM message, an alarm indication signal AIS message, a lock signal LCK message, a test TST message, an automatic protection switching APS message, a maintenance communication channel MCC message, a loss measurement message LMM message, a delay measurement DM message, an experimental OAM message EXM message, a vendor-specific OAM message VSM message, and the like. Optionally, in the case of selecting the 1DM packet, according to different precision requirements, the sending interval may be set to be less than or equal to 5ms, such as 1ms, 2ms, and 3.3 ms. Optionally, the messages from the OLT may carry an identifier of an active port of the OLT, which is a device where the OLT is located, where the carrying method may be that the identifier of the relevant port is issued to hardware or software of the sending port through software, and when the message passes through the port, the hardware or software adds the corresponding identifier to the message. Optionally, the port identifier may be only a port number of the active port of the OLT, may be a combination of a MAC address of media access control of the OLT and the port number of the active port, may also be a combination of an IP address of an internet protocol of the OLT and the port number of the active port, may also be a combination of an MEP identifier ID of the OLT and the port number of the active port, and other identifiers that can be used to distinguish different active ports of the OLT may also be used. Optionally, the TLV field of the packet from the OLT may carry the MAC address of the OLT, or the device number, or the MEPID of the OLT. Optionally, the sent message may carry the sending time of the message. According to different requirements, the destination MAC address of the message transmission may be set to the MAC address of the first ONU or the multicast MAC address.
Step 302: after receiving a second packet carrying a port identifier for measuring the switching time of the protection group from the OLT, the first ONU searches for a previous first packet carrying a port identifier for measuring the switching time of the protection group from the OLT, which is received by the first ONU before the second packet, and compares whether the port identifiers carried in the two packets are the same, as shown in S102 in fig. 1. Under the condition of low precision requirement, the first ONU may also compare whether the port identifiers carried in the message before the first message and the second message are the same, and this method is also an object of protection applied by the present invention, and constitutes an equivalent scheme to that of the embodiment of the present invention. The message from the OLT can also carry other equipment identifiers used for identification so as to be identified by the ONU, and the MD level carried in the message can also be used for identification in the programmed maintenance domain MD. Or, the first ONU compares whether the active ports receiving the two adjacent messages are different, as shown in S202 in fig. 2. Under the condition of low precision requirement, the first ONU may also compare whether the active port for receiving the packet is changed at regular time, or compare whether the active port for receiving two adjacent packets is changed, and these two methods are also the subject of protection of the present invention, and constitute an equivalent scheme to the embodiments of the present invention. And continuously comparing the port identification or the receiving end main port to judge whether the port identification or the receiving end main port carried in the previous and next messages are the same. If the two are the same, it indicates that the protection group is not switched, the first ONU stores relevant information, including information for determining the source of the packet, time information of the packet, port information in the packet, and the like, for comparison in the next time, and continues the comparison process until the difference occurs between the primary port for receiving the packet before and after the discovery or the primary port of the OLT carried in the received packet or the measurement is overtime.
Step 303: as shown in S103 in fig. 1 or S203 in fig. 2, if the determination in step 302 is different, which indicates that protection switching occurs in the protection group, the protection group switching time is obtained according to the sending time difference or the receiving time difference between two messages for comparing port identifiers or two messages for comparing receiving ports. Under the condition of low requirement on measurement accuracy, other messages before and after the protection group switching can be used for calculation. The calculation method may be that the time interval is calculated by comparing the two messages for comparing the port identifiers or comparing the receiving times of the two messages of the receiving port, so as to obtain the receiving time difference between the two messages. The calculation method can also comprise the following steps: the message carries the moment of sending the message; the calculation method is to compare the two messages used for comparing the port identifiers or the sending time of the two messages used for comparing the receiving ports to obtain the sending time difference of the two messages. When the message from the OLT is a periodic message, the calculating method may further include: each periodic message carries an integer serial number, and the serial numbers carried by the periodic messages sent sequentially are continuous; the calculation method is to compare the two messages used for comparing the port identifiers or the integer serial numbers carried by the two messages of the receiving port to obtain the difference of the integer serial numbers of the two messages, and the obtained result is multiplied by the sending interval of the periodic message after the absolute value is taken. The calculated result can be directly regarded as the switching time of the protection group, and the measurement error range is from zero to the maximum allowable measurement error. Knowing the maximum sending time interval of the OLT, the calculation can be subtracted by a maximum time interval, and the measurement error ranges from zero to the maximum allowable measurement error. For example, when the message from the OLT is a 1DM message with a 3.3ms transmission interval, the measurement error range of the measurement of the first ONU at the receiving end is 0 to 6.6ms, and after subtracting one transmission interval, the measurement error becomes-3.3 ms to 3.3 ms. The messages used for calculation may be messages from the OLT, which are specially used for measuring the switching time of the protection group, or other messages from the OLT. If the comparison results in step 302 are the same, the relevant information is stored for later use, and the comparison is continued until the protection group is found to be switched or the measurement is overtime.
Through step 301, step 302, and step 303, the ONU where the first ONU is located can measure the protection group downlink switching time. In addition, the uplink switching time of the protection group can be measured through step 301a, step 302a, and step 303a, as shown in fig. 1 and fig. 2. The measurement of the uplink switching time of the protection group and the measurement of the downlink switching time of the protection group can be performed independently or simultaneously. The simultaneous measurement does not necessarily require synchronization, but can realize the measurement of the downlink switching time and the uplink switching time of the protection group in the same protection group switching process.
Step 301 a: as shown in S101 in fig. 1 or S201 in fig. 2, the OLT receives a message from the first ONU for measuring the protection group switching time. The message for measuring the protection group switching time may be an ethernet message, or may be other types of messages, and the ethernet message is taken as an example below. The type of ethernet packet can be freely selected. The message for measuring the protection group switching time may be a specific message, and the message for transmitting the service may also be used for measurement. The time interval between every two adjacent messages from the first ONU is less than or equal to the maximum measurement error allowed by the protection group switching time measurement. The maximum measurement error allowed by the protection group switching time measurement differs according to the measurement accuracy requirement, and may be set artificially, for example, in the case of a rough measurement, the maximum measurement error allowed by the protection group switching time measurement may be set artificially to be 5 ms. Certainly, it is more convenient, and the existing ethernet periodic message may be selected and used, and may be an ethernet message such as a one-way delay measurement 1DM message, a continuity check message CCM message, a loopback message LBM message, a link trace message LTM message, an alarm indication signal AIS message, a lock signal LCK message, a test TST message, an automatic protection switching APS message, a maintenance communication channel MCC message, a loss measurement message LMM message, a delay measurement DM message, an experimental OAM message EXM message, a vendor-specific OAM message VSM message, and the like. Optionally, in the case of selecting the 1DM packet, according to different precision requirements, the sending interval may be set to be less than or equal to 5ms, such as 1ms, 2ms, and 3.3 ms. The messages from the first ONU carry the device identifier of the device where the first ONU is located, i.e. the ONU. Optionally, the device identifiers include any one or a combination of any two of a media access control MAC address of the device where the OLT is located, a device number of the device where the OLT is located, an MEP identity ID of the OLT, and an internet protocol IP address of the device where the OLT is located, where a combination of the MAC address, the device number, the MEPID, the IP address, and other information may be used as the device identifier of the device, and other identifiers capable of distinguishing different ONUs may also be used as the device identifier. These messages from the first ONU carry the port identifier of the device where the first ONU is located, i.e. the main port of the ONU. Optionally, the port identifier may be only a port number of the main port of the ONU, may be a combination of a MAC address of the ONU and the port number of the main port, may also be a combination of an IP address of the ONU and the port number of the main port, may also be a combination of an MEP ID of the OLT and the port number of the main port, and other identifiers that can be used to distinguish different main ports of the ONU may also be used. Optionally, the device identifier may be carried in a type, length, and value TLV field in the packet. Optionally, the sent message may carry the sending time of the message. According to different requirements, the destination MAC address of the message transmission may be set to the MAC address of the first ONU or the multicast MAC address.
Step 302 a: the OLT compares the device identifier of the device where the first ONU is located, which is carried by the received message, with the device identifier carried by the message before the message is received, determines whether the device identifiers are the same, finds the port identifier of the last message stored by the OLT and the port identifier of the message with the same device identifier after the determination, and compares whether the port identifiers carried by the two messages are the same, as shown in S102 in fig. 1. The process of determining and searching may also be that the OLT directly searches the device identifier carried in the message in the stored entry related to the device identifier according to the device identifier of the device where the first ONU is located, which is carried in the received message, so as to determine the port identifier of the last received message carrying the device identifier before the OLT receives the message. Under the condition of low precision requirement, the OLT may also compare whether the port identifier carried in the message for receiving changes at regular time, or may compare whether the port identifier carried in two adjacent messages changes, and these two methods are also the subject of protection of the present invention, and constitute an equivalent scheme to the embodiments of the present invention. In general, the OLT may perform the comparing action after finding that the message is lost. And if the port identifications carried in two adjacent and nearest messages with the same equipment identification are different, the protection group is considered to be switched. Alternatively, the OLT continuously compares the receiving-end OLT active ports for receiving two adjacent messages, as shown in S202 in fig. 2. The message described here is not limited to the message sent by the first ONU. Under the condition of low precision requirement, the OLT may also compare whether the main port for receiving the packet changes at regular time, or may compare whether the main port for receiving two adjacent packets changes, and these two methods are also the subject of protection of the present invention, and constitute an equivalent scheme to the embodiments of the present invention. In general, the OLT may also perform the comparison action after finding that the message is lost, and at this time, may only compare the port identifier of the receiving-end active port that receives the last message before the message is lost and the port identifier of the receiving-end active port that receives the first message after the message is received again. And judging whether the main ports used for receiving the messages by the OLT are the same or not by continuously comparing the main ports used for receiving the messages before and after. And judging whether the port identifiers carried in the two adjacent OLT main ports for receiving the messages or two adjacent nearest messages with the same equipment identifier are the same or not through the comparison action. If the two judgment results are the same, it indicates that the protection group is not switched, the OLT stores relevant information, including information for judging the source of the message, time information of the message, port information carried in the message or port information of a port for receiving the message, etc., for comparison in the next time, and continues the comparison process until the difference occurs between the primary port for receiving the message before and after the discovery or the primary port of the OLT carried in the received message or the measurement is overtime.
Step 303 a: as shown in S103 in fig. 1 or S203 in fig. 2, if the determination in step 302a is different, which indicates that the protection group is switched, the protection group switching time is obtained according to the sending time difference or the receiving time difference of the two messages with the device identifier of the device where the first ONU is located, which is used for comparing the port identifiers. Optionally, the method for calculating the time interval may be to compare the receiving time of the two messages with the device identifier of the device where the first ONU is located in the port identifier in step 302a, so as to obtain the receiving time difference. Optionally, the method for calculating the time interval may also be according to the sending time of the packet carried in the packet, or according to the integer serial number of the packet carried in the packet and the sending interval of the packet. The specific calculation method is the same as that described in step 103 of the embodiment, and is not described herein again. Under the condition of low precision requirement, other messages before and after the change of the main port can be used for calculation, and the method is an equivalent scheme of the embodiment of the invention. It should be noted that, for the method of determining and finding the last port identifier with the same device identifier, and then comparing the port identifiers to determine whether the protection group switching occurs, the switching time can be directly calculated according to the two messages used for comparison. For the method for determining whether the protection group is rearranged by using the change of the receiving port, the calculated packet must be a packet from the first ONU, that is, the calculated packet is a first packet carrying the device identifier of the device where the first ONU is located and received last before the change of the receiving-end main port, and a second packet carrying the device identifier of the device where the first ONU is located and received first after the change of the receiving-end main port. Therefore, if the judgment in step 302a is different, which indicates that the protection group is switched, the switching time of the protection group is obtained according to the difference between the sending time or the receiving time of the first packet and the second packet. The calculation method may be that the time interval is calculated by comparing the receiving time of the first message and the receiving time of the second message to obtain the receiving time difference between the two messages. The calculation method can also comprise the following steps: the message carries the moment of sending the message; the calculation method is to compare the sending time of the first message and the second message to obtain the sending time difference of the two messages. When the message from the OLT is a periodic message, the calculating method may further include: each periodic message carries an integer serial number, and the serial numbers carried by the periodic messages sent sequentially are continuous; the calculation method is to compare the integer serial numbers carried by the first message and the second message to obtain the difference of the integer serial numbers of the two messages, and the obtained result is multiplied by the sending interval of the periodic message after the absolute value is taken. The calculated result can be directly regarded as the switching time of the protection group, and the measurement error range is from zero to the maximum allowable measurement error. Knowing the maximum sending time interval of the OLT, the calculation can be subtracted by a maximum time interval, and the measurement error ranges from zero to the maximum allowable measurement error. For example, when the message from the OLT is a 1DM message with a 3.3ms transmission interval, the measurement error range of the measurement of the first ONU at the receiving end is 0 to 6.6ms, and after subtracting one transmission interval, the measurement error becomes-3.3 ms to 3.3 ms. The OLT can identify the sending source of the message through the MAC address of the ONU where the first ONU is located, wherein the MAC address is carried in the message. Optionally, when the message sent by the first ONU carries the identifier of the other device of the ONU where the first ONU is located, the OLT may also identify whether the message is from the first ONU by identifying the device identifier.
It should be noted that the first ONU and the OLT may or may not synchronize the transmission message. The message type of the message sent by the first ONU and the message type of the message sent by the OLT may be the same or different. The messages sent by the first ONU and the OLT may be periodic messages, and the sending intervals of the periodic messages may be selected according to hardware conditions and types of the messages, and may be different. The smaller the transmission interval of the selected periodic message is, the higher the protection switching time precision measured by the opposite terminal is. In addition, under the condition that the OLT sends a multicast message, each ONU can measure the downlink switching time of each protection group in one switching, and under the condition that each ONU sends a periodic message to the OLT, the OLT can measure the uplink switching time of each protection group of each ONU in one switching, and the actions can be carried out simultaneously, so that each ONU and the OLT respectively measure the downlink and uplink switching time of each protection group of each ONU in one protection group switching process.
The method for measuring the switching time of the protection group disclosed by the embodiment of the invention can measure the switching time of the protection group in the existing network, is convenient and quick, and overcomes the defect that an external tester is required to be used for measurement in the prior art. Meanwhile, the method disclosed by the embodiment of the invention judges whether the protection group switching occurs by using the change of the main port of the sending end or the receiving end, so that misjudgment can not occur, and the problem of inaccurate measurement caused by the fact that an external tester easily makes misjudgment in the prior art is solved.
The fourth embodiment: an embodiment of the present invention provides a method for measuring a protection group switching time, which can be applied to a dual-homing network of a GPON or an EPON, as shown in fig. 2 and 6.
The GPON and EPON dual-homing protection group protection mechanisms are similar. As shown in fig. 7, the dual-homing protection group adds two ports, which belong to two different devices, to the same protection group through the local command line configuration of the network manager or the OLT. In the embodiment of the present invention, a plurality of messages or messages that can carry port identifiers may be used, and hereinafter, only ethernet messages are taken as an example, and the message used for measuring the protection group switching time may be a normal message or a message specially used for measuring the protection group switching time. The message specially used for measuring the protection group switching time may be a message with a specific identifier, or may be some specific messages, such as a detection-type message. Establishing MEPs based on ports in two OLTs, wherein the two OLTs are respectively marked as a first OLT and a second OLT, and assuming that the port where the first OLT is located before the protection group switching is an active port and the port where the second OLT is located is a standby port; each ONU or ONT establishes an MEP based on the protection group, which is described as a first ONU by taking a specific ONU as an example, and the measurement method of other ONUs or ONTs is the same as that of the ONU.
The specific method comprises the following steps:
step 401: as shown in S201 in fig. 2 or S301 in fig. 6, the first ONU receives a message for measuring the protection group switching time. The message for measuring the protection group switching time may be an ethernet message, or may be other types of messages, and the ethernet message is taken as an example below. The message for measuring the protection group switching time may be a specific message, and the message for transmitting the service may also be used for measurement. The received messages come from the first OLT or the second OLT, and the messages from the first OLT or the second OLT may be sent by the first OLT or the second OLT, or may be sent by an upstream MEP of the first OLT or the second OLT and forwarded by the first OLT or the second OLT. The sum of the time interval between every two adjacent messages from the first OLT and the time interval between every two adjacent messages from the second OLT is less than or equal to the maximum measurement error allowed by the protection group switching time measurement. The maximum measurement error allowed by the protection group switching time measurement differs according to the measurement accuracy requirement, and may be set artificially, for example, in the case of a rough measurement, the maximum measurement error allowed by the protection group switching time measurement may be set artificially to be 5 ms. Optionally, the messages from the first OLT and the second OLT may be existing ethernet periodic messages, which may be one-way delay measurement 1DM messages, continuity check messages CCM messages, loopback messages LBM messages, link trace messages LTM messages, alarm indication signals AIS messages, lock signals LCK messages, test TST messages, automatic protection switching APS messages, maintenance communication channel MCC messages, loss measurement messages LMM messages, delay measurement DM messages, experimental OAM messages EXM messages, supplier-specific OAM messages VSM messages, and other ethernet messages. Optionally, in the case of selecting the 1DM packet, according to different precision requirements, the sending interval may be set to be less than or equal to 5ms, such as 1ms, 2ms, and 3.3 ms. Optionally, the messages from the first OLT and the second OLT respectively carry the device identifiers of the device where the first OLT is located and the device where the second OLT is located. Optionally, the device identifiers include any one or a combination of any two of a media access control MAC address of the device where the MEP is located, a device number of the device where the MEP is located, an MEP identity ID, and an internet protocol IP address of the device where the MEP is located, where a combination of the MAC address, the device number, the MEPID, the IP address, and other information may be used as the device identifier of the device, and other identifiers capable of distinguishing different ONUs may also be used as the device identifier. Optionally, the messages from the first OLT and the second OLT may carry the sending time of the message. The destination MAC address sent may be set to the MAC address of the first ONU or a multicast MAC address, as required. Although the first OLT and the second OLT both send or forward messages to the first ONU, only the message from the first OLT can be sent to the first ONU because only the main port where the first OLT is located is in a working state and the port where the second OLT is located is in a standby state; after the protection group switching occurs, the port where the second OLT is located becomes the active port, and the first OLT exits the operating state, so that only the message from the second OLT can be sent to the first ONU.
Step 402: the first ONU compares the receiving-end active ports used for receiving the two adjacent front and back packets, as shown in S202 in fig. 2, or the first ONU compares the device identifiers carried in the two adjacent front and back packets, as shown in S302 in fig. 6. Under the condition of low precision requirement, the first ONU may also compare whether the device identifiers carried by other messages before and after the change of its main port are the same, or compare whether the ports receiving other messages before and after the change of its main port are the same, and this method is also an object of protection applied by the present invention, and constitutes an equivalent scheme to the embodiment of the present invention. In general, the first ONU may perform the comparison after finding that the packet is lost, and at this time, only compare the receiving-end primary port that receives the last packet before the packet is lost with the receiving-end primary port that receives the first packet after the packet is received again, or only compare the device identifier carried in the last packet received before the packet is lost with the device identifier carried in the first packet received after the packet is received again. It should be noted that the device identifier carried in the message for comparing and determining whether switching occurs refers to a device identifier of a device where the first OLT or the second OLT is located, and if the message is sent by an MEP upstream of the first OLT or the second OLT, the device identifier of the device where the first OLT or the second OLT is located is carried when the message is forwarded by the first OLT or the second OLT, and a source MAC address carried by an MEP upstream of the first OLT or the second OLT is not used for comparison. And if the first ONU finds that the compared information is changed, the first ONU determines that the protection group is switched. And judging whether the device identifiers carried in the two adjacent main ports for receiving the messages or the two adjacent nearest messages with the device identifiers are the same or not through the comparison. These device identifiers may be only source MAC addresses in messages sent by the device where the first OLT or the second OLT is located, or other device identifiers that can be used to distinguish the first OLT from the second OLT. If the two are the same, it indicates that the protection group is not switched, the first ONU stores relevant information including information for determining the source of the packet, time information of the packet, port information in the packet, and the like, for comparison in the next time, and continues the comparison until the switching of the protection group is found or the measurement is overtime.
Step 403: as shown in S203 in fig. 2 or S303 in fig. 6, if the determination in step 402 is different, which indicates that the protection group is switched, the switching time of the protection group is obtained according to the difference between the sending time and the receiving time of the two messages for comparison. Optionally, the method for calculating the time interval may be to compare the receiving times of the two messages for comparison to obtain a difference between the receiving times of the two messages. The calculation method may be the same as that in step 103 of the embodiment, and is not described again. Under the condition of low requirement on measurement accuracy, the message used for calculation may also be other messages used for measuring the switching time of the protection group before and after switching of the protection group.
Through step 401, step 402, and step 403, the ONU where the first ONU is located may measure the protection group downlink switching time. Optionally, the step may report the protection group downlink switching time measured by the first ONU to the second OLT. The first ONU reports the protection group downlink switching time measured in step 403 to the second OLT in a message. Generally, the uplink switching time and the downlink switching time of the protection group are relatively close, and the first ONU may report the measured downlink switching time of the protection group to the second OLT for reference. When needed, the second OLT may directly use the protection group downlink switching time reported by the first ONU as the protection group uplink switching time. When the messages from the first OLT and the second OLT are sent by an upstream MEP, the first ONU may also measure the uplink and downlink switching time of the dual-homing protection group simultaneously by sending the messages with the upstream MEP pair.
It should be noted that the messages from the first OLT and the second OLT may be synchronous or asynchronous. The message type of the message from the first OLT and the message type of the message from the second OLT may be the same or different. The messages from the first OLT and the second OLT may be periodic messages, the sending intervals of the periodic messages may be selected according to hardware conditions and types of the messages, and the sending intervals of the periodic messages sent by the first OLT and the second OLT may be different. The smaller the transmission interval of the selected periodic message is, the higher the protection switching time precision measured by the opposite terminal is. In addition, under the condition that the messages from the first OLT and the second OLT are multicast messages, each ONU can measure the downlink switching time of its protection group in one switching.
The method for measuring the switching time of the protection group disclosed by the embodiment of the invention can measure the switching time of the protection group in the existing network, is convenient and quick, and overcomes the defect that an external tester is required to be used for measurement in the prior art. Meanwhile, the method disclosed by the embodiment of the invention judges whether the protection group switching occurs by using the equipment identifier of the sending end or the change of the main port of the receiving end, so that misjudgment can not occur, and the problem of inaccurate measurement caused by the easy misjudgment of an external tester in the prior art is solved.
The fifth embodiment: an embodiment of the present invention provides a network device, as shown in fig. 8. Specifically, the apparatus comprises:
the receiving module is used for receiving the message;
the analysis module is used for analyzing the second message received by the receiving module and obtaining an analysis result, and the analysis module can be used for analyzing the port identifier and the equipment identifier contained in the message, and optionally can also be used for analyzing the sending time of the message carried in the message;
the storage module is used for storing the information from the analysis module, the information from the analysis module can be transmitted through the processing module or can be directly reported by the analysis module, and the information stored by the storage module comprises but is not limited to port identifiers, time information, equipment identifiers and corresponding relations among the port identifiers, the time information and the equipment identifiers which are carried in the messages;
the processing module is configured to obtain a second port identifier and a first port identifier, compare whether the second port identifier is the same as the first port identifier, and determine whether a protection group between the network device and the first device is switched, where the second port identifier is a port identifier carried in a second packet from the parsing module, the first port identifier is a port identifier carried in a first packet from the storage module, the second packet is a packet received by the network device from the first device and used for measuring protection group switching time, and the first packet is a packet received by the network device from the first device and used for measuring protection group switching time that is previous to the second packet received by the network device; the second port identifier can be directly reported by the analysis module, or can be reported to the processing module by the storage module after being reported to the storage module by the analysis module; if the comparison result is different, calculating the switching time of the protection group according to the time information of the first message and the second message, if the comparison result is the same, storing the port identifier of the corresponding message, the time information of the message, the equipment identifier of the message and the corresponding relation between the port identifier and the time information of the message by the storage module for later use, and continuously comparing until the switching time of the protection group is measured or the measurement is overtime; the processing module determines the port identifier of the last received message carrying the same device identifier before the device receives the message by judging whether the device identifier carried by the message in the analysis result is the same as the device identifier carried by the previously received message, and then compares whether the port identifiers carried by the two messages carrying the same device identifier are the same. The determining process may also be directly determining the port identifier of the last received packet carrying the same device identifier before the packet is received by the device according to the entry related to the device identifier stored in the processing module by the device identifier carried in the packet in the analysis result; optionally, the device identifier may include any one or a combination of any two of a maintenance domain MD level of the device that sends the packet, a media access control MAC address, a device number, an internet protocol IP address, and an MEP identity ID of an MEP on the device that sends the packet; the port identifier may include a port number of an active port of the device that sends the packet, an MAC address of the device that sends the packet, an IP address of the device that sends the packet, or an MEPID of an MEP on the device that sends the packet; in this case, the corresponding parsing module needs to be equipped with a function of parsing the device identifier and the port identifier carried in the message; the messages used for judgment and calculation may also be closer non-adjacent messages, for example, the processing module compares and calculates at regular time, or compares and calculates every several messages.
Optionally, when the two messages carry the sending time of the message, the calculating method includes subtracting the sending time of another message from the sending time carried in the later received message; optionally, when the message carries the sending time of the message, the method for calculating the sending time difference includes that, because most of the devices currently sending the message do not have a message caching mechanism, the sending time and the receiving time can be equal, so the calculated sending time difference can also be regarded as the receiving time difference of the message; or, optionally, when the two messages are two of a series of periodically transmitted messages and the two messages carry integer message sequence numbers of the messages and transmission intervals of the periodically transmitted messages, the calculation method includes subtracting an integer sequence number carried in another message from an integer sequence number carried in a later received message, taking an absolute value of the obtained result, and then multiplying the absolute value by the transmission intervals of the periodically transmitted messages, wherein the integer message sequence numbers carried in the periodically transmitted messages which are sequentially transmitted are continuous.
Optionally, the device may include a monitoring module, configured to monitor a receiving time at which the receiving module receives the packet and send the monitored receiving time to the processing module. In this case, the method for calculating the difference between the sending time and the receiving time may be that the receiving time of the later received message monitored by the monitoring module is subtracted from the receiving time of the other message monitored by the monitoring module. Optionally, the device may further include a generating module, configured to generate a packet carrying the port identifier of the active port of the device, or the device further includes a generating module, configured to generate a packet carrying the port identifier of the active port of the device and the device identifier of the device; the device may further include a sending module, configured to send the packet generated by the generating module, where a time interval between every two adjacent packets sent by the sending module is smaller than or equal to a maximum measurement error allowed by the protection group switching time measurement. Optionally, when the device includes one main port and at least one standby port, the monitoring module may be further configured to monitor the main port through which the device receives the packet and send a monitoring result to the determining module, where the determining module may determine whether the protection group is switched through a change of the main port at the receiving end, and if the protection group is switched, measure a switching time of the protection group.
The network device disclosed by the invention can be an ONU, an OLT or an ONT, an access device, a convergence device, other network entities and network devices.
The network device disclosed by the embodiment of the invention can judge whether the protection group is switched or not through the change of the information of the main port of the sending end carried in the received message, and if the switching occurs, the switching time of the protection group is calculated. Meanwhile, the network device can also be used for sending a message carrying a port identifier and/or a device identifier, and the opposite-end device can measure the protection group switching time by continuously sending the message. The network equipment can measure the switching time of the protection group in the current network, is convenient and quick, and overcomes the defect that an external tester is required to be used for measurement in the prior art. Meanwhile, the network device disclosed by the embodiment of the invention judges whether the protection group switching occurs by using the device identification of the sending end or the change of the main port of the receiving end, so that misjudgment can not occur, and the problem of inaccurate measurement caused by the easy misjudgment of an external tester in the prior art is solved.
Embodiment six: an embodiment of the present invention provides a network device, as shown in fig. 8. Specifically, the apparatus comprises:
the receiving module is used for receiving the message;
the monitoring module is used for monitoring a port for receiving the current message, acquiring a port identifier of the port for receiving the current message and reporting the port identifier to the processing module or the storage module, and optionally, the monitoring module can also be used for monitoring the moment when the equipment receives the message and reporting the moment to the processing module or the storage module;
the analysis module is used for analyzing the message received by the receiving module and obtaining an analysis result, wherein the analysis result can include but is not limited to sending time, equipment identification, port identification and the like carried in the message;
the storage module is used for storing information from the monitoring module and the analysis module, the information from the monitoring module and the analysis module can be directly reported by the monitoring module and the analysis module or can be transmitted by the processing module, and the information stored by the storage module comprises but is not limited to port identification, time information, equipment identification and corresponding relation between the port identification, the time information and the equipment identification which are carried in the message;
the processing module is configured to obtain a second port identifier and a first port identifier, compare whether the second port identifier is the same as the first port identifier, and determine whether a protection group between the network device and the first device is switched, where the second port identifier is a port identifier of a port from the monitoring module that receives a second packet, the first port identifier is a port identifier of a port from the storage module that receives the first packet, the second packet is a packet from the first device and used for measuring a protection group switching time, and the first packet is a previous packet of the second packet and used for measuring a protection group switching time from the first device; if the second port identifier is different from the first port identifier, the processing module calculates protection group switching time according to the time information of the first message and the second message; if the second port identification is the same as the first port identification, the storage module stores the port identification of the corresponding port for receiving the message, the time information carried by the message, the equipment identification of the message and the corresponding relation among the port identification, the time information carried by the message and the equipment identification of the message for later use, and continuously compares the port identification with the equipment identification until the switching of the protection group is found or the measurement is overtime; the analysis module analyzes the equipment identifier in the message and sends the analysis result to the processing module, and the processing module identifies the source of the message according to the analysis result. The first packet and the second packet are respectively the last packet from the same network device received by the device before the change of the active port for receiving packets and the first packet from the same network device received by the device after the change of the active port for receiving packets. Optionally, when the requirement on the measurement accuracy is not high, the first packet and the second packet may also be other packets before and after the change of the active port, for example, the second packet is a second packet after the change of the active port, and a penultimate packet before the change of the active port of the first packet; optionally, when the first message and the second message carry the sending time of the message, the method for calculating the sending time difference includes that the sending time of the first message carried in the first message is subtracted from the sending time of the second message carried in the second message, because most of the devices currently sending the message do not have a message caching mechanism, and the sending time and the receiving time may be equal, the calculated sending time difference may also be regarded as the receiving time difference of the message. Or, optionally, when the first packet and the second packet are two of a series of periodically transmitted packets and the first packet and the second packet carry the integer packet sequence numbers of the first packet and the second packet and the transmission interval of the periodically transmitted packets, respectively, the calculation method may include subtracting the integer sequence number carried in the first packet from the integer sequence number carried in the second packet, and multiplying the obtained result by the transmission interval carried in the first packet and the second packet after taking an absolute value, where the integer packet sequence numbers carried in the periodically transmitted packets that are sequentially transmitted are consecutive. Or, optionally, the monitoring module of the network device also has a function of monitoring a time when the device receives the message, and the calculating method may include subtracting the time when the monitoring module receives the first message, which is monitored by the monitoring module and reported to the processing module, from the time when the monitoring module receives the second message, which is monitored by the monitoring module and reported to the processing module. Optionally, the device identifier may include any one or a combination of any two of a maintenance domain MD level of the device that sends the packet, a media access control MAC address, a device number, an internet protocol IP address, and an MEP identity ID of an MEP on the device that sends the packet; in this case, the corresponding parsing module needs to be equipped with a function of parsing the device identifier and the port identifier carried in the message; the messages used for judgment and calculation may also be closer non-adjacent messages, for example, the processing module compares and calculates at regular time, or compares and calculates every several messages.
Optionally, the network device may further include a generating module, configured to generate a packet carrying a port identifier of the active port of the network device; or, the generating module is configured to generate a packet carrying a port identifier of the active port of the device and a device identifier of the device; the network device also comprises a sending module used for sending the message generated by generating the message, and the time interval between every two adjacent messages sent by the sending module is less than or equal to the maximum measurement error allowed by the protection group switching time measurement.
The network device disclosed by the invention can be an ONU, an OLT or an ONT, an access device, a convergence device, other network entities and network devices.
The network device disclosed by the embodiment of the invention can judge whether the protection group is switched or not through the change of the information of the main port of the receiving end for receiving the message, and if the switching is carried out, the switching time of the protection group is calculated. The network device disclosed by the embodiment of the invention can judge whether the protection group is switched or not through the change of the information of the main port of the sending end carried in the received message, and if the switching occurs, the switching time of the protection group is calculated. Meanwhile, the network device can also be used for sending a message carrying a port identifier and/or a device identifier, and the opposite-end device can measure the protection group switching time by continuously sending the message. The network equipment can measure the switching time of the protection group in the current network, is convenient and quick, and overcomes the defect that an external tester is required to be used for measurement in the prior art. Meanwhile, the network device disclosed by the embodiment of the invention judges whether the protection group switching occurs by using the device identification of the sending end or the change of the main port of the receiving end, so that misjudgment can not occur, and the problem of inaccurate measurement caused by the easy misjudgment of an external tester in the prior art is solved.
Embodiment seven: an embodiment of the present invention provides a network device, which may be used to measure a protection group switching time of a dual-homing protection group as shown in fig. 8. Specifically, the apparatus comprises:
the receiving module is used for receiving the message;
the monitoring module is used for monitoring a port for receiving the current message, acquiring a port identifier of the port for receiving the current message and reporting the port identifier to the processing module or the storage module, and optionally, the monitoring module can also be used for monitoring the moment when the equipment receives the message and reporting the moment to the processing module or the storage module;
the storage module is used for storing the information from the monitoring module, the information from the monitoring module can be directly reported by the monitoring module or can be transmitted by the processing module, and the information stored by the storage module comprises but is not limited to port identifiers, time information, equipment identifiers and corresponding relations among the port identifiers, the time information and the equipment identifiers which are carried in the messages;
the processing module is configured to obtain a second port identifier and a first port identifier, compare whether the second port identifier is the same as the first port identifier, and determine whether the dual homing protection group is switched, where the second port identifier is a port identifier of a second port from the monitoring module, where the second port receives a second packet used for measuring switching time of the protection group, the second port is a main port when the network device receives the second packet, the first port identifier is a port identifier of a first port from the storage module, where the first port receives a first packet used for measuring switching time of the protection group, the first port is a main port when the network device receives the first packet, and the first packet is a packet used for measuring switching time of the protection group, which is previous to the second packet received by the network device; the second port identifier from the monitoring module may be directly reported by the monitoring module, or may be forwarded by the processing module, where the port identifier is used in the device to determine which specific port the message is sent to or received from, and may be a port number of the port itself, an identifier assigned to the specific port by the device, or other identifiers that may be used to distinguish different ports; judging whether the second port identification is different from the first port identification to determine whether a receiving port of the network equipment is changed, if not, calculating protection group switching time according to the time information of the first message and the current message, if so, storing the port identification of the corresponding port for receiving the message, the time information carried by the message, the equipment identification of the message and the corresponding relation among the port identification, the time information carried by the message and the equipment identification of the message by a storage module, and using the port identification and the equipment identification for comparison continuously until the protection group switching time is measured or overtime is. Optionally, the network device may further include an analysis module, configured to analyze a sending time carried in a packet sent by the parallel processing module, and the processing module may obtain the protection group switching time by comparing the sending time of a last packet before a port of a received packet changes with the sending time of a first packet after the port of the received packet changes. Optionally, the processing module may obtain the protection group switching time by comparing the receiving time of the last message before the port receiving the message changes and the receiving time of the first message after the port receiving the message changes, which are monitored by the monitoring module; the messages used for judgment and calculation may also be closer non-adjacent messages, for example, the processing module compares and calculates at regular time, or compares and calculates every several messages.
Or, the parallel scheme corresponding to the disclosed method for determining whether the protection group is switched by using the change of the receiving port is that the network device includes: the receiving module is used for receiving the message; the analysis module is used for analyzing the current message received by the receiving module and sending an analysis result to the processing module; the storage module is used for storing the information from the analysis module; the processing module is configured to obtain a second device identifier and a first device identifier, compare whether the second device identifier is the same as the first device identifier, and determine whether the dual homing protection group is switched, where the second device identifier is a device identifier carried in a second packet received from a second port of the parsing module and used for measuring switching time of the protection group, the second port is a primary port when the network device receives the second packet, the first device identifier is an identifier carried in a first packet received from a first port of the storage module and used for measuring switching time of the protection group, the first port is a primary port when the network device receives the first packet, and the first packet is a last packet of the second packet received by the network device and used for measuring switching time of the protection group; comparing whether the second device identification is the same as the first device identification; if not, the processing module obtains the sending time carried in the first message from the storage module and the sending time carried in the current message in the analysis result, and compares the sending time of the current message with the sending time of the first message to obtain the protection group switching time. The judging module judges whether the device identifications carried in the two adjacent messages are the same or not according to the analysis result of the analyzing module, if the device identifications are different, the protection group is considered to be switched, and calculation is carried out. Optionally, the network device may further include a monitoring module, configured to monitor a receiving time of the received packet. The method for calculating the protection group switching time by the network device may be a sending time carried in a message analyzed by the analysis module, or a receiving time for receiving the message monitored by the monitoring module. If the processing module judges that the protection group is not switched, the storage module stores the equipment identification carried by the related message, the corresponding message sending or receiving time information and the like for later use, and continuously compares the equipment identification with the corresponding message sending or receiving time information and the like until the switching time of the protection group is measured or overtime is detected; the messages used for judgment and calculation may also be closer non-adjacent messages, for example, the processing module compares and calculates at regular time, or compares and calculates every several messages.
Optionally, the two network devices may further include a generating module, configured to generate a packet carrying a port identifier of the active port of the network device; or, the generating module is configured to generate a packet carrying a port identifier of the active port of the network device and a device identifier of the network device; the network device further includes a sending module, configured to send a packet generated by generating the packet, where a time interval between every two adjacent packets sent by the sending module is less than or equal to a maximum measurement error allowed by the protection group switching time measurement. By sending messages to the aggregation devices at the upstream of the two OLTs of the dual-homing opposite terminal, the simultaneous measurement of the uplink protection switching time of the dual-homing protection group and the downlink protection switching time of the protection group can be realized.
The two network devices disclosed above may be ONUs or ONTs, or access devices, or other network devices or network entities.
The network device disclosed by the embodiment of the invention can judge whether the protection group is switched or not through the change of the information of the main port of the receiving end of the received message or the change of the equipment identification information carried in the message, and if the switching occurs, the switching time of the protection group is calculated. The network device disclosed by the embodiment of the invention can judge whether the protection group is switched or not through the change of the information of the main port of the sending end carried in the received message, and if the switching occurs, the switching time of the protection group is calculated. Meanwhile, the network device can also be used for sending a message carrying a port identifier and/or a device identifier, and the opposite-end device can measure the protection group switching time by continuously sending the message. The network equipment can measure the switching time of the protection group in the current network, is convenient and quick, and overcomes the defect that an external tester is required to be used for measurement in the prior art. Meanwhile, the network device disclosed by the embodiment of the invention judges whether the protection group switching occurs by using the device identification of the sending end or the change of the main port of the receiving end, so that misjudgment can not occur, and the problem of inaccurate measurement caused by the easy misjudgment of an external tester in the prior art is solved.
The eighth embodiment: an embodiment of the present invention further provides a network device, as shown in fig. 9, including a processor, a memory, and a receiver, wherein the processor is coupled to the latter two. The network device may be configured to perform the method of embodiments one, two, three or four. Specifically, the receiver is configured to receive a message from outside the network device; the processor processes the received message, and specifically has the functions of the monitoring module, the analyzing module and the processing module in the fifth, sixth and seventh embodiments.
The processor may be a general purpose processor, such as an integrated circuit IC, and the programs it executes are stored in memory; the processor may also be an application specific integrated circuit (asic), or an FPGA (Field-programmable gate array), or other similar functional device.
According to the network device provided by the embodiment, the network device can measure the switching time of the protection group in the current network, is convenient and quick, and overcomes the defect that an external tester is required to be used for measurement in the prior art. Meanwhile, the network device disclosed by the embodiment of the invention judges whether the protection group switching occurs by using the device identification of the sending end or the change of the main port of the receiving end, so that misjudgment can not occur, and the problem of inaccurate measurement caused by the easy misjudgment of an external tester in the prior art is solved.
The ninth embodiment: the embodiment of the invention also provides a system for measuring the switching time of the protection group, which at least comprises the first network equipment and the second network equipment.
On one hand, if the system is configured by connecting the active port and the standby port of the first network device to the second device to form a protection group, for example, the network system shown in fig. 3 (in the figure, the OLT is the first network device, and 0NU (1) is the second network device): the second network device generates a packet carrying a device identifier of the second network device itself, or is used to generate a packet carrying a port identifier of a main port of the second network device and a device identifier of the second network device; the message generated by the second network device is a message used for measuring the switching time of the protection group, and is continuously sent to the first network device at a time interval which is less than or equal to the maximum measurement error allowed by the measurement of the switching time of the protection group. The first network device receives a message for measuring the switching time of the protection group from the second network device, and judges whether the main ports of the first device receiving two adjacent messages for measuring the switching time of the protection group are the same or not, so as to determine whether the switching of the protection group between the first network device and the second network device occurs or not, if the main receiving ports of the two adjacent messages are different, the first network device measures the switching time of the protection group. Specifically, the structure and function of the first network device may refer to the network device in the sixth embodiment; the second network device comprises a generating module for generating a message carrying a device identifier of the network device and used for measuring the switching time of the protection group, wherein the device identifier can maintain the domain MD level, the source MAC address, the IP address and the like in time, and the device identifier can be used for a receiving device to identify the source of the message; the second network device further includes a sending module, configured to continuously send, to the first network device, the packet carrying the device identifier of the network device and used for measuring the protection group switching time at a time interval that is less than or equal to a maximum measurement error allowed by the protection group switching time measurement.
On one hand, if the system is configured by a first network device connecting with an active port and a standby port of a second device to form a protection group, for example, the network system shown in fig. 3 (the ONU (1) in the figure is the first network device, and the OLT is the second network device): the second network device generates a packet carrying a device identifier of the second network device itself, or is used to generate a packet carrying a port identifier of a main port of the second network device and a device identifier of the second network device; the message generated by the second network device is a message used for measuring the switching time of the protection group, and is continuously sent to the first network device at a time interval which is less than or equal to the maximum measurement error allowed by the measurement of the switching time of the protection group. The method comprises the steps that a first network device receives a message used for measuring the switching time of a protection group from a second network device, judges whether port identifications carried in two adjacent messages used for measuring the switching time of the protection group from the second network device are the same or not so as to determine whether the protection group between the first network device and the second network device is switched or not, and if the port identifications of main ports of the second network device carried in the two adjacent messages are different, the first network device measures the switching time of the protection group. Specifically, the structure and function of the first network device may refer to the network device in the fifth embodiment; the second network device comprises a generating module, configured to generate a packet carrying a device identifier of the network device itself and a port identifier of a main port, and used for measuring switching time of the protection group, where the device identifier may maintain a domain MD level, a source MAC address, an IP address, and the like, the device identifier may be used by a receiving device to identify a source of the packet, and the port identifier of the main port may be used by the receiving device to determine the main port when the second device sends the packet; the second network device further includes a sending module, configured to continuously send, to the first network device, the packet carrying the device identifier of the network device and used for measuring the protection group switching time at a time interval that is less than or equal to a maximum measurement error allowed by the protection group switching time measurement.
In the system disclosed in this embodiment, the first network device and the second network device may be a sending end of a test packet and a measuring end of protection group switching time at the same time, that is, the first network device may further generate a packet for measuring protection group switching time, where the packet carries a port identifier of a main port of the first network device or simultaneously carries an equipment identifier of the first network device, and continuously sends the packet to the first network device at a time interval less than or equal to a maximum measurement error allowed by the protection group switching time measurement; similarly, the second network device may also perform the determining and measuring functions of the first network device as described in the previous two paragraphs, specifically, when the first device connects the active port and the standby port of the second device to form a protection group, the second network device is further configured to determine whether the protection group between the first network device and the second network device is switched according to whether the active port of the second network device that receives two adjacent messages for measuring the switching time of the protection group from the first network device is the same, and if the active ports are different, the second network device measures the switching time of the protection group; or when the active port and the standby port of the first device are connected to the second device to form a protection group, the second network device is further configured to determine whether the protection group between the first network device and the second network device is switched according to whether port identifiers carried in two adjacent messages from the first network device for measuring the switching time of the protection group are the same, and if the port identifiers are different, the second network device measures the switching time of the protection group.
According to the network system provided by the embodiment, the network system can measure the switching time of the protection group in the current network, is convenient and quick, and overcomes the defect that an external tester is required to be used for measurement in the prior art. Meanwhile, the network system disclosed by the embodiment of the invention judges whether the protection group switching occurs by using the equipment identifier of the sending end or the change of the main port of the receiving end, so that misjudgment can not occur, and the problem of inaccurate measurement caused by the easy misjudgment of an external tester in the prior art is solved.
Embodiment ten: the embodiment of the invention also provides a system for measuring the switching time of the protection group, which at least comprises a first network device, a second network device and a third network device. For example, as shown in fig. 7, the first network device may be an ONU (1), the second network device may be an OLT (1), and the third network device may be an OLT (2);
the first network device determines whether the device identifiers carried in two adjacent messages for testing the switching time of the protection group received by the first network device are the same, and if the device identifiers are not the same, the protection group is considered to be switched, and the switching time of the protection group is measured according to the time information of the two adjacent messages. Or the first network device determines whether the active ports receiving two adjacent messages for testing the switching time of the protection group are the same, if not, the protection group is considered to be switched, and the switching time of the protection group is measured according to the time information of the two adjacent messages. Specifically, the structure and function of the first network device implement the network device as described in embodiment mode seven.
Specifically, the second or third network device is configured to generate a packet carrying a device identifier of the network device and used for measuring the protection group switching time, and continuously send the packet carrying the device identifier of the network device and used for measuring the protection group switching time to the first network device at a time interval less than or equal to a maximum measurement error allowed by the protection group switching time measurement.
According to the network system provided by the embodiment, the network system can measure the switching time of the protection group in the current network, is convenient and quick, and overcomes the defect that an external tester is required to be used for measurement in the prior art. Meanwhile, the network system disclosed by the embodiment of the invention judges whether the protection group switching occurs by using the equipment identifier of the sending end or the change of the main port of the receiving end, so that misjudgment can not occur, and the problem of inaccurate measurement caused by the easy misjudgment of an external tester in the prior art is solved.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by hardware, firmware, or a combination thereof. When implemented in software, the functions described above may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a computer. Taking this as an example but not limiting: computer-readable media can include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. Furthermore, the method is simple. Any connection is properly termed a computer-readable medium. For example, if software is transmitted from a website, a server, or other remote source using a coaxial cable, a fiber optic cable, a twisted pair, a Digital Subscriber Line (DSL), or a wireless technology such as infrared, radio, and microwave, the coaxial cable, the fiber optic cable, the twisted pair, the DSL, or the wireless technology such as infrared, radio, and microwave are included in the fixation of the medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy Disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
In short, the above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (23)

1. A method for measuring switching time of a protection group, wherein a first device in the protection group is connected to a primary port and a standby port of a second device in the protection group, the method comprising:
the first device receives messages for measuring the switching time of the protection group, wherein every two adjacent messages for measuring the switching time of the protection group are sent by a sending end at a first time interval which is less than or equal to the maximum measurement error allowed by the measurement of the switching time of the protection group, and the messages for measuring the switching time of the protection group carry a port identification of a sending port of the sending end;
the first device compares whether port identifiers carried in a first message and a second message are the same to judge whether the protection group is switched, the second message is the message which is received by the first device and is from the second device and used for measuring the switching time of the protection group, and the first message is the last message which is from the second device and is used for measuring the switching time of the protection group, and the last message of the second message received by the first device;
and if the port identifiers carried in the first message and the second message are different, the first equipment calculates the protection group switching time according to the time information of the first message and the second message.
2. The method of claim 1, further comprising:
the calculating of the protection group switching time according to the time information of the first packet and the second packet specifically includes:
the time information of the first message is the receiving time of the first message received by the first equipment, and the time information of the second message is the receiving time of the second message received by the first equipment; the first equipment compares the receiving time of the second message with the receiving time of the first message to obtain the switching time of the protection group;
or the time information of the first message is the sending time of the first message carried in the first message, and the time information of the second message is the sending time of the second message carried in the second message; the first equipment compares the sending time of the second message with the sending time of the first message to obtain protection group switching time;
or, the time information of the first packet is the packet serial number and the packet transmission interval of the first packet carried in the first packet, the time information of the second packet is the packet serial number and the packet transmission interval of the second packet carried in the second packet, and the first device compares the difference between the packet serial number of the second packet and the packet serial number of the first packet, and multiplies the difference by the transmission interval carried in the first packet or the second packet to obtain the protection group switching time.
3. The method of claim 1, further comprising:
the first device is an optical network unit ONU or an optical network terminal ONT, and the second device is an optical line terminal OLT;
or, the first device is an OLT, and the second device is an optical network unit ONU or an optical network terminal ONT;
or, the first device is an access device, and the second device is a convergence device;
or, the first device is a convergence device, and the second device is an access device.
4. A method according to any one of claims 1 to 3, characterized in that:
the message for measuring the switching time of the protection group is a one-way delay measurement 1DM message, and the first time interval is 5 milliseconds.
5. A method for measuring switching time of a protection group, wherein an active port and a standby port of a first device in the protection group are connected to a second device in the protection group, the method comprising:
the first device receives messages for measuring the switching time of the protection group, wherein every two adjacent messages for measuring the switching time of the protection group are sent by a sending end at a first time interval which is less than or equal to the maximum measurement error allowed by the measurement of the switching time of the protection group;
the first device compares whether the main ports of the two adjacent received messages are the same or not so as to judge whether the protection group is switched or not;
if the active port of the first device receiving the messages twice is changed, the first device calculates the protection group switching time according to the time information of the first message and a second message, the second message is a first message which is received by the first device after the active port of the first device receiving the messages is changed and is from the second device and is used for measuring the protection group switching time, and the first message is a last message which is received by the first device and is from the second device and is used for measuring the protection group switching time.
6. The method of claim 5, further comprising:
the calculating of the protection group switching time according to the time information of the first packet and the second packet specifically includes:
the time information of the first message is the receiving time of the first message received by the first equipment, and the time information of the second message is the receiving time of the second message received by the first equipment; the first device compares the receiving time of the second message with the receiving time of the first message to obtain protection switching time;
or the time information of the first message is the sending time of the first message carried in the first message, and the time information of the second message is the sending time of the second message carried in the second message; the first equipment compares the sending time of the second message with the sending time of the first message to obtain protection group switching time;
or, the time information of the first packet is the packet serial number and the packet transmission interval of the first packet carried in the first packet, the time information of the second packet is the packet serial number and the packet transmission interval of the second packet carried in the second packet, and the first device compares the difference between the packet serial number of the second packet and the packet serial number of the first packet, and multiplies the difference by the transmission interval carried in the first packet or the second packet to obtain the protection group switching time.
7. The method of claim 6, further comprising:
the first device is an optical network unit ONU or an optical network terminal ONT, and the second device is an optical line terminal OLT;
or, the first device is an OLT, and the second device is an ONU or an ONT;
or, the first device is an access device, and the second device is a convergence device;
or, the first device is a convergence device, and the second device is an access device.
8. The method according to any one of claims 5 to 7, wherein:
the message for measuring the protection switching time is a one-way delay measurement 1DM message, and the first time interval is 5 milliseconds.
9. A method for measuring switching time of a protection group, wherein an active port and a standby port of a first device in the protection group are respectively connected to a second device and a third device in the protection group, the method comprising:
the first device receives a first message and a second message, the second message is a message which is received by the first device and is from the second device or the third device and is used for measuring the switching time of the protection group, and the first message is a last message which is received by the first device and is from the second device or the third device and is used for measuring the switching time of the protection group; every two adjacent messages for measuring the protection group switching time from the second device or the third device are sent by a sending end at a first time interval which is less than or equal to the maximum measurement error allowed by the protection group switching time measurement;
the first device judges whether the main ports of the first device receiving the first message and the second message are the same or not so as to judge whether the protection group is switched or not; or, the first device determines whether the device identifier carried in the first message is the same as the device identifier carried in the second message, so as to determine whether the protection group is switched;
and if the first message and the second message are different, the first equipment calculates the protection group switching time according to the time information of the first message and the second message.
10. The method of claim 9, wherein:
calculating the protection group switching time according to the time information of the first packet and the second packet specifically comprises:
the time information of the first message is the receiving time of the first message received by the first equipment, and the time information of the second message is the receiving time of the second message received by the first equipment; the first equipment compares the receiving time of the second message with the receiving time of the first message to obtain the switching time of the protection group;
or the time information of the first message is the sending time of the first message carried in the first message, and the time information of the second message is the sending time of the second message carried in the second message; and the first equipment compares the sending time of the second message with the sending time of the first message to obtain the switching time of the protection group.
11. The method of claim 10, wherein:
the first device is an optical network unit ONU or an optical network terminal ONT, and the second device and the third device are optical line terminals OLT;
or, the first device is an access device, and the second device and the third device are convergence devices.
12. The method of claim 11, wherein:
the message for measuring the protection switching time is a one-way delay measurement 1DM message, and the first time interval is 5 milliseconds.
13. A network device, characterized in that the network device comprises:
the receiving module is used for receiving the message;
the analysis module is used for analyzing the message received by the receiving module and obtaining an analysis result;
the storage module is used for storing the information from the analysis module;
the processing module is configured to obtain a second port identifier and a first port identifier, compare whether the second port identifier is the same as the first port identifier, and determine whether a protection group between the network device and the first device is switched, where the second port identifier is a port identifier carried in a second packet from the parsing module, the first port identifier is a port identifier carried in a first packet from the storage module, the second packet is a packet received by the network device from the first device and used for measuring a protection group switching time, and the first packet is a packet received by the network device from the first device and used for measuring a protection group switching time that is previous to the second packet from the first device;
and if the two messages are different, the processing module calculates the switching time of the protection group according to the time information of the first message and the second message.
14. The network device of claim 13, wherein:
the calculating of the protection group switching time according to the time information of the first packet and the second packet specifically includes:
the time information of the first message is the sending time of the first message carried in the first message, and the time information of the second message is the sending time of the second message carried in the second message; the processing module compares the sending time of the second message with the sending time of the first message to obtain the switching time of the protection group;
or, the time information of the first packet is a packet serial number and a packet transmission interval of the first packet carried in the first packet, the time information of the second packet is a packet serial number and a packet transmission interval of the second packet carried in the second packet, and the processing module compares the packet serial number of the second packet with the packet serial number of the first packet to obtain a difference value, and multiplies the difference value by the transmission interval carried in the first packet or the second packet to obtain the protection group switching time.
15. The network device of claim 13, wherein:
the network equipment also comprises a monitoring module, a processing module and a transmitting module, wherein the monitoring module is used for monitoring the receiving time of the message received by the receiving module and reporting the receiving time obtained by monitoring to the processing module;
the calculating of the protection group switching time according to the time information of the first packet and the second packet specifically includes: and the processing module compares the receiving time of the second message from the monitoring module with the receiving time of the first message to obtain the switching time of the protection group.
16. A network device, the network device comprising a primary port and a backup port, the network device comprising:
the receiving module is used for receiving the message;
the monitoring module is used for monitoring the port of the receiving module for receiving the message and acquiring the port identification of the main port for receiving the message;
the analysis module is used for analyzing the message received by the receiving module and obtaining an analysis result;
the storage module is used for storing information from the monitoring module and the analysis module;
the processing module is configured to obtain a second port identifier and a first port identifier, compare whether the second port identifier is the same as the first port identifier, and determine whether a protection group between the network device and the first device is switched, where the second port identifier is a port identifier of a main port from the monitoring module, the main port receiving a second packet, the first port identifier is a port identifier of a main port from the storage module, the main port receiving a first packet, the second packet is a packet from the first device, the second packet is used to measure a protection group switching time, and the first packet is a previous packet from the first device, the last packet of the second packet is used to measure a protection group switching time;
and if the second port identifier is different from the first port identifier, the processing module calculates the protection group switching time according to the time information of the first message and the second message.
17. The network device of claim 16, wherein:
the calculating of the protection group switching time according to the time information of the first packet and the second packet specifically includes:
the time information of the first message is the sending time of the first message carried in the first message, and the time information of the second message is the sending time of the second message carried in the second message; the processing module compares the sending time of the second message with the sending time of the first message to obtain the switching time of the protection group;
or, the time information of the first packet is a packet serial number and a packet transmission interval of the first packet carried in the first packet, the time information of the second packet is a packet serial number and a packet transmission interval of the second packet carried in the second packet, and the processing module compares the packet serial number of the second packet with the packet serial number of the first packet to obtain a difference value, and multiplies the difference value by the transmission interval carried in the first packet or the second packet to obtain the protection group switching time.
18. A network device applied to a dual-homing protection group, the network device comprising an active port and a standby port, the network device comprising:
the receiving module is used for receiving the message;
the monitoring module is used for monitoring the port of the receiving module for receiving the message and acquiring the port identification of the port for receiving the message;
the analysis module is used for analyzing the message received by the receiving module and obtaining an analysis result;
the storage module is used for storing information from the monitoring module and the analysis module;
the processing module is used for obtaining a second port identification and a first port identification, comparing whether the second port identification is the same as the first port identification, to judge whether the dual-homing protection group is switched, the second port identification is the port identification of the second port which receives the second message for measuring the switching time of the protection group from the monitoring module, the second port is a main port when the network device receives the second packet, the first port identifier is a port identifier of a first port which receives a first packet used for measuring the switching time of the protection group from the storage module, the first port is a main port when the network device receives the first message, and the first message is a last message used for measuring the switching time of the protection group in the second message received by the network device;
and if the second port identifier is different from the first port identifier, the processing module calculates the protection group switching time according to the time information of the first message and the second message.
19. The network device of claim 18, wherein:
the network equipment also comprises an analysis module used for analyzing the message received by the receiving module and obtaining an analysis result;
the calculating the protection group switching time according to the first packet and the time information of the current packet received by the receiving module specifically includes:
the processing module obtains the receiving time of the first message from the storage module and the receiving time of the current message from the monitoring module, and compares the receiving time of the current message with the receiving time of the first message to obtain protection group switching time;
or, the processing module obtains the sending time carried in the first message from the storage module and the sending time carried in the current message from the analysis module, and compares the sending time carried in the current message with the sending time carried in the first message to obtain the protection group switching time.
20. A network device applied to a dual-homing protection group, the network device comprising an active port and a standby port, the network device comprising:
the receiving module is used for receiving the message;
the analysis module is used for analyzing the message received by the receiving module and sending an analysis result to the processing module;
the storage module is used for storing the information from the analysis module;
the processing module is used for acquiring a second device identifier and a first device identifier, comparing whether the second device identifier is the same as the first device identifier, to judge whether the dual-homing protection group is switched, the second device identifier is a device identifier carried in a second message which is received by a second port of the analysis module and used for measuring the switching time of the protection group, the second port is a main port when the network device receives the second packet, the first device identifier is an identifier carried in a first packet received from the first port of the storage module and used for measuring the switching time of the protection group, the first port is a main port when the network device receives the first message, and the first message is a last message used for measuring the switching time of the protection group in the second message received by the network device; the first message and the second message are messages which are sent by a sending end at a time interval which is less than or equal to the maximum measurement error allowed by the protection group switching time measurement and are used for measuring the protection group switching time;
and if the second equipment identifier is different from the first equipment identifier, the processing module calculates the protection group switching time according to the time information of the first message and the second message.
21. A system for measuring the switching time of a protection group is characterized in that:
the system comprises a first network device and a second network device which are connected with each other;
the second network device is configured to generate a packet carrying the device identifier of the second network device and used for measuring the switching time of the protection group, or generate a packet carrying the port identifier of the active port of the second network device and the device identifier of the second network device and used for measuring the switching time of the protection group; sending the generated message to the first network device, wherein the time interval between every two adjacent messages sent by the second network device is less than or equal to the maximum measurement error allowed by the protection group switching time measurement;
when the active port and the standby port of the first network device are connected with the second network device to form a protection group, the first network device is configured to determine whether a protection group between the first network device and the second network device is switched according to whether the active ports, which receive two adjacent messages for measuring switching time of the protection group from the second network device, are the same, and if the active ports are different, the first network device measures switching time of the protection group; or,
when the first network device connects the active port and the standby port of the second network device to form a protection group, the first network device is configured to determine whether a protection group between the first network device and the second network device is switched according to whether port identifiers carried in two adjacent messages from the second network device for measuring protection group switching time are the same, and if the port identifiers are different, the first network device measures protection group switching time.
22. The system of claim 21, wherein:
the first network device is further configured to generate a packet carrying a device identifier of the first network device, or generate a packet carrying a port identifier of a main port of the first network device and a device identifier of the first network device; sending the generated message to the second network device, wherein the time interval between every two adjacent messages sent by the first network device is less than or equal to the maximum measurement error allowed by the protection group switching time measurement;
when the first network device connects the active port and the standby port of the second network device to form a protection group, the second network device is further configured to determine whether the protection group between the first network device and the second network device is switched according to whether the active ports, which receive two adjacent messages for measuring the switching time of the protection group from the first network device, are the same, and if the active ports are different, the second network device measures the switching time of the protection group; or,
when the active port and the standby port of the first network device are connected to the second network device to form a protection group, the second network device is further configured to determine whether the protection group between the first network device and the second network device is switched according to whether port identifiers carried in two adjacent messages from the first network device for measuring the switching time of the protection group are the same, and if the port identifiers are different, the second network device measures the switching time of the protection group.
23. A system for measuring the switching time of a protection group is characterized in that:
the system comprises a first network device, a second network device and a third network device, wherein an active port and a standby port of the first network device are respectively connected with the second network device and the third network device;
the first network device is any one of the network devices of claims 18, 19 and 20;
the second network device is configured to generate a packet carrying a device identifier of the second network device and used for measuring a protection group switching time, and continuously send the packet carrying the device identifier of the second network device to the first network device at a time interval less than or equal to a maximum measurement error allowed by protection group switching time measurement;
the third network device is configured to generate a packet carrying the device identifier of the third network device and used for measuring the switching time of the protection group, and continuously send the packet carrying the device identifier of the third network device to the first network device at a time interval that is less than or equal to a maximum measurement error allowed by the measurement of the switching time of the protection group.
CN201210319882.9A 2012-09-03 2012-09-03 The method, apparatus and system of measuring and protecting group switching time Active CN103684585B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210319882.9A CN103684585B (en) 2012-09-03 2012-09-03 The method, apparatus and system of measuring and protecting group switching time

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210319882.9A CN103684585B (en) 2012-09-03 2012-09-03 The method, apparatus and system of measuring and protecting group switching time

Publications (2)

Publication Number Publication Date
CN103684585A CN103684585A (en) 2014-03-26
CN103684585B true CN103684585B (en) 2016-01-27

Family

ID=50321012

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210319882.9A Active CN103684585B (en) 2012-09-03 2012-09-03 The method, apparatus and system of measuring and protecting group switching time

Country Status (1)

Country Link
CN (1) CN103684585B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109309615B (en) * 2017-07-27 2020-07-07 华为技术有限公司 Method and device for transmitting data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1479460A (en) * 2003-05-29 2004-03-03 上海交通大学 Passive optical network protection method
CN101499853A (en) * 2008-01-30 2009-08-05 华为技术有限公司 Optical path measuring method, optical network and network appliance
CN101964734A (en) * 2010-10-18 2011-02-02 中兴通讯股份有限公司 Method and device for measuring network port fault time
CN102412955A (en) * 2011-11-28 2012-04-11 华为技术有限公司 Method for obtaining time deviation between master device and slave device under condition of asymmetrical optical fibers and communication system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4039150B2 (en) * 2002-07-09 2008-01-30 株式会社デンソー Optical switch subsystem
EP2086137B1 (en) * 2008-02-04 2011-04-20 Alcatel Lucent Method for coordinating measurements and calibrations in a passive optical network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1479460A (en) * 2003-05-29 2004-03-03 上海交通大学 Passive optical network protection method
CN101499853A (en) * 2008-01-30 2009-08-05 华为技术有限公司 Optical path measuring method, optical network and network appliance
CN101964734A (en) * 2010-10-18 2011-02-02 中兴通讯股份有限公司 Method and device for measuring network port fault time
CN102412955A (en) * 2011-11-28 2012-04-11 华为技术有限公司 Method for obtaining time deviation between master device and slave device under condition of asymmetrical optical fibers and communication system

Also Published As

Publication number Publication date
CN103684585A (en) 2014-03-26

Similar Documents

Publication Publication Date Title
US8755685B2 (en) Joint switching method for an aggregation node, aggregation node and system
US9178755B2 (en) Time-based link fault localization
US7778543B2 (en) Passive optical network rogue optical network unit diagnostics
US9002197B2 (en) Sequence-based link fault localization
US9276670B2 (en) Self-diagnostic method for PON protection system, and PON protection system
KR101790698B1 (en) Method and apparatus for detecting optical line obstruction in passive optical network
CN106301837B (en) Passive optical network alarm detection method and device
US20150139637A1 (en) Monitoring of a passive optical network (pon)
US20090028553A1 (en) Method and apparatus of detecting abnormal behavior in a passive optical network (PON)
US20140056582A1 (en) Detecting and communicating potential optical fiber issues in optical networks
WO2009050459A1 (en) Communications network
WO2013107232A1 (en) Detection method and system based on pon system
CN101282586B (en) Method, system and apparatus for detecting optical fiber fault in passive optical network
US20140369676A1 (en) Pon system, olt, and onu
CN102368691B (en) Optical link protection switching realizing method in Ethernet passive optical network system
CN107294595B (en) Detection method and device for long-luminescence optical network unit and optical line terminal
WO2021249639A1 (en) Fault location in an optical ring network
KR20110061254A (en) Detecting apparatus and method for optical line in passive optical network system
JP5434461B2 (en) Fault ONU identification method and fault ONU identification apparatus
EP3399669B1 (en) An otdr test system and otdr test method for a twdm pon
CN103684585B (en) The method, apparatus and system of measuring and protecting group switching time
Wang et al. Implemention of a survivable EPON system supporting direct communication between ONUs
CN112218180B (en) Method, apparatus, storage medium, and program product for detecting status of optical fiber
KR20090114191A (en) Communication error processing apparatus and method for a subscriber's equipment on Passive Optical Network based on L3/L2 network
US20240080095A1 (en) Method and apparatus applied to pon system, system, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant