CN104320302A - Detecting method and device for RPR topology inconformity - Google Patents

Detecting method and device for RPR topology inconformity Download PDF

Info

Publication number
CN104320302A
CN104320302A CN201410603607.9A CN201410603607A CN104320302A CN 104320302 A CN104320302 A CN 104320302A CN 201410603607 A CN201410603607 A CN 201410603607A CN 104320302 A CN104320302 A CN 104320302A
Authority
CN
China
Prior art keywords
rpr
topology
ring
node
source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410603607.9A
Other languages
Chinese (zh)
Inventor
张为
徐鹏飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201410603607.9A priority Critical patent/CN104320302A/en
Publication of CN104320302A publication Critical patent/CN104320302A/en
Pending legal-status Critical Current

Links

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The invention provides a detecting method and device for RPR topology inconformity. The method comprises the steps that an RPR node receives a topology protection message and judges whether an MAC address of a source RPR node, carried in the received topology message, of the topology protection message is identical with a MAC address of itself or not; if yes, random data which the topology protection message is filled when the source RPR node generates the topology message on an RPR where the source RPR node is located when receiving the topology protection message are compared with random data which the topology protection message is filled with when the RPR node generates the topology protection message on the RPR; if the comparison result shows that the random data are inconsistent, the state of the RPR is determined, a topology database of the RPR and a topology database of a reverse RPR are traversed so as to determine RPR topology inconformity according to the traversal result. According to the detecting method and device for RPR topology inconformity, when an RPR node meets an RPR node with the MAC address being the same as that of itself, the nodes can be separated according to the corresponding random data, and therefore detection of topology inconformity is more accurate.

Description

Method and device for detecting RPR topology inconsistency
Technical Field
The present invention relates to the field of network communication technologies, and in particular, to a method and an apparatus for detecting an RPR topology inconsistency.
Background
RPR (Resilient Packet Ring) is a new MAC (Media Access Control) protocol defined by IEEE 802.17 working group, and the RPR protocol can detect inconsistency of RPR networking topology.
Specifically, an RPR network generally includes a plurality of RPR nodes, which may be network devices for transceiving data. The RPR network has a reverse dual-Ring structure, and is generally referred to as an Outer Ring (0 Ring) in which the data frame transmission direction is clockwise, and an Inner Ring (1 Ring) in which the data frame transmission direction is counterclockwise. Further, in the RPR networking, the topology protection packet is used to notify all RPR nodes in the RPR networking of the changed topology information when the RPR topology changes, so that the RPR nodes store the changed topology information.
Currently, a method for detecting an inconsistency of an RPR topology includes the following steps:
a: the RPR node receives the topology protection message, according to the hop count of the source RPR node carried by the topology protection message, a topology database corresponding to an RPR ring (for example, the topology protection message is received in a clockwise direction, that is, the RPR ring where the RPR node is located is a0 ring) where the current source RPR node is located when the current source RPR node receives the topology protection message is inquired, if a database table entry corresponding to the hop count of the source RPR node exists in the topology database of the RPR ring, the topology database of the current RPR ring is updated, otherwise, a database table entry corresponding to the hop count of the source RPR node is created in the topology database of the current RPR ring according to the topology protection message.
B: judging the ring state of the RPR ring according to the topology database of the current RPR ring, wherein if the edge (True) exists in the topology database of the current RPR ring, the ring state is an open ring; if there is no edge (False) in the topology database of the current RPR ring, the ring state is a closed loop.
C: according to the ring state, traversing the topology database of the RPR ring and the reverse RPR ring (namely 1 ring), and calculating the number HopsRx of other RPR nodes except the RPR node on the RPR ring or the reverse RPR ring. Taking calculation of the HopsRx on the RPR ring as an example, if the ring state of the RPR ring is a closed ring, the HopsRx is the number of hops at the end of traversing the topology database of the RPR ring minus 1; if the ring state of the RPR ring is open loop, HopsRx is the hop count at the end of traversal.
D: determining that the RPR topology is inconsistent. The RPR topology inconsistency is determined according to any one of the following three ways, and after the RPR topology inconsistency is determined by any one way, the other two ways are not determined.
(1) And when the ring state is a closed ring, traversing the topology database of the RPR ring and the reverse RPR ring thereof, and if the RPR node is not traversed, determining that the RPR topology is inconsistent.
(2) And when the ring state is an open ring, traversing the topology database of the RPR ring and the reverse RPR ring thereof, and determining that the RPR topology is inconsistent if the RPR node is traversed.
(3) Traversing the MAC address a of the RPR node corresponding to the hoss (x) in the topology database of the RPR ring, traversing the MAC address b of the RPR node corresponding to the hoss (HopsRx-hoss) (x) and +1 in the topology database of the reverse RPR ring, determining whether the MAC address a is the same as the MAC address b, and if not, determining that the RPR topology is inconsistent. Wherein, the values of the hops (x) are the hops values in the topology database.
However, when the detection method is used to detect networking of RPR nodes including MAC address duplication, for a certain RPR node, when the RPR node traverses a corresponding topology database, when another RPR node having the same MAC address as the RPR node is traversed, the RPR node is considered to have traversed itself (actually not), which results in an inaccurate detection result of topology inconsistency.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for detecting an RPR topology inconsistency, so as to solve the problem in the prior art that when an RPR node with a duplicate MAC address exists in an RPR topology, a detection result of the topology inconsistency is not accurate enough.
The invention provides a method for detecting the topology inconsistency of a Resilient Packet Ring (RPR), which comprises the following steps:
the RPR node receives the topology protection message and judges whether the MAC address of the source RPR node of the topology protection message carried in the received topology protection message is the same as the MAC address of the RPR node;
if so, comparing random data filled when the source RPR node generates the topology protection message on an RPR ring where the source RPR node receives the topology protection message with random data filled when the source RPR node generates the topology protection message on the RPR ring;
and when the comparison result is inconsistent, sending the topology protection message through a sending port on the RPR ring, and when the preset time is reached, determining the ring state of the RPR ring according to the topology database of the RPR ring, and traversing the RPR ring and the topology database of the reverse RPR ring according to the determined ring state to determine that the RPR topology is inconsistent according to the traversal result.
Preferably, the RPR node obtains the random data filled when the source RPR node generates the topology protection packet on the RPR ring where the source RPR node itself receives the topology protection packet, by:
after receiving the topology protection message, the RPR node queries a topology database of the current RPR ring according to the hop count of the source RPR node carried in the topology protection message;
if the database table entry corresponding to the source RPR node hop count exists in the topology database of the current RPR ring, updating the topology database of the current RPR ring, acquiring random data in the database table entry corresponding to the source RPR node hop count from the updated topology database of the RPR ring, and determining the random data as random data filled when the source RPR node generates the topology protection message on the RPR ring where the source RPR node receives the topology protection message;
if the database table entry corresponding to the hop count of the source RPR node does not exist in the topology database of the current RPR ring, the database table entry corresponding to the hop count of the source RPR node is created according to the received topology protection message, and random data in the created database table entry is determined as random data filled when the source RPR node generates the topology protection message on the RPR ring where the source RPR node receives the topology protection message.
Preferably, the method further comprises:
and when judging that the MAC address of the source RPR node of the topology protection message carried in the topology protection message is different from the MAC address of the RPR node, the RPR node sends the topology protection message through a sending port on the RPR ring, and when the preset time is reached, the ring state of the RPR ring is determined according to the topology database of the RPR ring, and the RPR ring and the topology database of the reverse RPR ring are traversed according to the determined ring state, so that the RPR topology is determined to be inconsistent according to the traversal result.
Preferably, the method further comprises:
and when the RPR node judges that the MAC address of the source RPR node of the topology protection message carried in the topology protection message is the same as the MAC address of the RPR node, the comparison result is consistent, and the preset time is reached, determining the ring state of the RPR ring according to the topology database of the RPR ring, traversing the RPR ring and the topology database of the reverse RPR ring according to the determined ring state, and determining that the RPR topology is inconsistent according to the traversal result.
Preferably, the RPR node traverses the topology database of the RPR ring and its reverse RPR ring according to the determined ring state of the RPR ring to determine that the RPR topologies are inconsistent according to the traversal result, specifically including:
when the RPR node determines that the ring state of the RPR ring is an open ring, and when traversing the topology database of the RPR ring, if traversing the RPR node with the MAC address same as the MAC address of the RPR node, comparing whether random data corresponding to the RPR node in the topology database of the RPR ring is the same as random data filled when the RPR node generates a topology protection message on the RPR ring; if the RPR topology is the same as the RPR topology, determining that the RPR node is traversed, and determining that the RPR topology is inconsistent; or,
according to the determined ring state of the RPR ring, when the MAC address of the RPR node corresponding to the hoss on the RPR ring is determined to be the same as the MAC address of the RPR node corresponding to the hops-hoss +1 on the reverse RPR ring, traversing the topology database of the RPR ring and the reverse RPR ring thereof to determine whether the RPR node with the same MAC address is included, and if so, determining that the RPR topology is not consistent; and when the ring state of the RPR ring is an open ring, the HopsRx is the hop count at the end of traversal and is subtracted by 1.
The invention also provides a device for detecting the topology inconsistency of the RPR, which comprises:
the judging unit is used for receiving the topology protection message and judging whether the MAC address of the source RPR node of the topology protection message carried in the received topology protection message is the same as the MAC address of the source RPR node;
a comparing unit, configured to compare, when the determination result is the same, random data that is filled when the source RPR node generates the topology protection packet on an RPR ring on which the source RPR node receives the topology protection packet, with random data that is filled when the source RPR node generates the topology protection packet on the RPR ring;
and the RPR topology determining unit is used for sending the topology protection message through a sending port on the RPR ring when the comparison result is inconsistent, determining the ring state of the RPR ring according to the topology database of the RPR ring when the preset time is reached, and traversing the RPR ring and the topology database of the reverse RPR ring according to the determined ring state so as to determine that the RPR topology is inconsistent according to the traversal result.
Preferably, the method further comprises the following steps:
an obtaining unit, configured to obtain random data that is filled when the source RPR node generates the topology protection packet on an RPR ring where the source RPR node receives the topology protection packet;
the acquiring unit is specifically configured to, after receiving the topology protection packet, query a topology database of the current RPR ring according to a hop count of a source RPR node carried in the topology protection packet; if the database table entry corresponding to the source RPR node hop count exists in the topology database of the current RPR ring, updating the topology database of the current RPR ring, acquiring random data in the database table entry corresponding to the source RPR node hop count from the updated topology database of the RPR ring, and determining the random data as random data filled when the source RPR node generates the topology protection message on the RPR ring where the source RPR node receives the topology protection message; if the database table entry corresponding to the hop count of the source RPR node does not exist in the topology database of the current RPR ring, the database table entry corresponding to the hop count of the source RPR node is created according to the received topology protection message, and random data in the created database table entry is determined as random data filled when the source RPR node generates the topology protection message on the RPR ring where the source RPR node receives the topology protection message.
Preferably, the RPR topology determining unit is further configured to send the topology protection packet through a sending port on the RPR ring when it is determined that the MAC address of the source RPR node of the topology protection packet carried in the topology protection packet is different from the MAC address of the source RPR node, and when the preset time is reached, determine the ring state of the RPR ring according to the topology database of the RPR ring, and traverse the RPR ring and the topology database of the reverse RPR ring according to the determined ring state, so as to determine that the RPR topologies are inconsistent according to the traversal result.
Preferably, the RPR topology determining unit is further configured to determine, when it is determined that the MAC address of the source RPR node of the topology protection packet carried in the topology protection packet is the same as the MAC address of the source RPR node, the comparison result is consistent, and the preset time is reached, a ring state of the RPR ring according to the topology database of the RPR ring, and traverse the RPR ring and the topology database of the reverse RPR ring according to the determined ring state, so as to determine that the RPR topologies are inconsistent according to the traversal result.
Preferably, the RPR topology determining unit is specifically configured to, when it is determined that the ring state of the RPR ring is an open ring, and when the topology database of the RPR ring is traversed, compare whether random data corresponding to a corresponding RPR node in the topology database of the RPR ring is the same as random data filled when the RPR node generates a topology protection packet on the RPR ring if a RPR node having a MAC address that is the same as its own MAC address is traversed; if the RPR topology is the same as the RPR topology, determining that the RPR node is traversed, and determining that the RPR topology is inconsistent; or,
the RPR topology determining unit is specifically configured to, according to the determined ring state of the RPR ring, determine that the MAC address of the RPR node corresponding to the hops on the RPR ring is the same as the MAC address of the RPR node corresponding to the hops-hops +1 on the reverse RPR ring, traverse the topology database of the RPR ring and the reverse RPR ring thereof, and determine whether the RPR nodes having the same MAC address are included, and if so, determine that the RPR topologies are inconsistent; and when the ring state of the RPR ring is an open ring, the HopsRx is the hop count at the end of traversal and is subtracted by 1.
The invention provides a method and a device for detecting topology inconsistency of RPR, in the method, random data is filled in a topology protection message, so that when an RPR node encounters an RPR node with the same MAC address as the RPR node, the RPR node can be distinguished according to the corresponding random data, namely, the RPR node with the repeated MAC address is distinguished, and the detection of the topology inconsistency is more accurate.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for detecting an RPR topology inconsistency according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for detecting topology inconsistency of RPRs according to another embodiment of the present invention;
FIG. 3 is a schematic diagram of an RPR topology provided by an embodiment of the present invention;
fig. 4 is a flowchart of a method for acquiring padding random data when a source RPR node generates a topology protection packet according to an embodiment of the present invention;
fig. 5 is a schematic view of an application scenario of a detection apparatus for detecting RPR topology inconsistency according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a detection apparatus for detecting RPR topology inconsistency according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problem in the prior art that when an RPR node with a repeated MAC address exists in an RPR topology, a detection result of topology inconsistency is not accurate enough, the present invention describes a detection method of the RPR topology inconsistency provided by the present invention with reference to fig. 1, fig. 2, fig. 3, and fig. 4. Compared with the prior art, in the method, random data is filled in the topology protection message, so that when the RPR node encounters the RPR node with the same MAC address as the RPR node, the RPR node can be distinguished according to the corresponding random data, namely, the RPR node with the repeated MAC address is distinguished, and further, the detection of topology inconsistency is more accurate.
As shown in fig. 1, the present invention provides a method for detecting an RPR topology inconsistency, which may include the following steps:
step 101: the RPR node receives the topology protection message and judges whether the MAC address of the source RPR node of the topology protection message carried in the received topology protection message is the same as the MAC address of the RPR node.
Step 102: if so, comparing the random data filled when the source RPR node generates the topology protection message on the RPR ring where the source RPR node receives the topology protection message with the random data filled when the source RPR node generates the topology protection message on the RPR ring.
When the MAC address of the source RPR node is the same as the MAC address of the source RPR node, the following two cases may be included: the first case is that the source RPR node is the same node as itself; the second case is that the source RPR node is a different node than itself. In order to determine which situation is, the invention compares the random data filled when the source RPR node generates the topology protection message on the RPR ring where the source RPR node receives the topology protection message with the random data filled when the source RPR node generates the topology protection message on the RPR ring, if the comparison result is consistent, the first situation is indicated, and if the comparison result is inconsistent, the second situation is indicated.
In the present invention, the random data may be one or a combination of numbers, letters, underlines. After the random data is generated, the random data is not changed until the topology protection message is transmitted back to the source RPR node, and the random data is a unique value, that is, the random data filled in the topology protection message sent to each RPR node is different, so that the RPR nodes with repeated MAC addresses are distinguished by comparing the corresponding random data.
Step 103: and when the comparison result is inconsistent, sending the topology protection message through a sending port on the RPR ring, and when the preset time is reached, determining the ring state of the RPR according to the topology database of the RPR ring, and traversing the RPR ring and the topology database of the reverse RPR ring according to the determined ring state to determine that the RPR topology is inconsistent according to the traversal result.
In the present invention, each RPR node on an RPR maintains a topology database of an outer ring and a topology database of an inner ring, where, taking the content that the topology database of the outer ring maintained in the RPR node may include as an example, the content that the topology database of the outer ring and the topology database of the inner ring maintained in each RPR node may include is described as follows: hop count hops; MAC address of RPR node corresponding to hoss value in outer ring direction; random data filled when the corresponding RPR node sends the topology protection message in the outer ring direction (namely clockwise direction); the hops value in the outer ring direction corresponds to the span edge of the RPR node, and if the span edge is True, the span edge is indicated as an edge; if spanEdge is False, it indicates no edge.
In the invention, for the RPR node, when the topology protection message is just received, the current RPR may be in a state of unstable topology and can be stabilized after a period of time, so that a preset time is set for improving the accuracy of the detection result of inconsistent topology, so that the RPR node reaches a topology stable state when executing subsequent traversal operation.
According to the scheme, random data are filled in the sent topology protection message, when the RPR node determines that the MAC address of the source RPR node sending the topology protection message is the same as the MAC address of the source RPR node, the corresponding random data are compared to determine whether the source RPR node and the source RPR node are the same, and therefore detection of topology inconsistency is more accurate.
As shown in fig. 2, to further explain the scheme of the present invention, an embodiment of the present invention provides a method for detecting an RPR topology inconsistency, where a node a1 in fig. 3 is used as an RPR node of the present invention, where the present invention takes a topology protection packet sent by a source RPR node in an outer ring direction as an example for explanation, and the method may include the following steps:
step 201: node a1 receives the topology protection message.
As shown in fig. 3, the structure of the RPR is shown schematically, and the RPR includes node a0, node B0, node C0, node a1, node B1, and node C1. The MAC addresses of the node a0 and the node a1, the node B0 and the node B1, and the node C0 and the node C11 are the same and different RPR nodes, and the MAC addresses of the node a0, the node B0, and the node C0 are MAC _ A, MAC _ B, MAC _ C, respectively.
Step 202: judging whether the MAC address of the source RPR node of the topology protection message carried in the received topology protection message is the same as the MAC address of the source RPR node, if so, executing step 203; if not, go to step 206.
If the source RPR node sending the topology protection packet is node a0, the MAC address of node a0 is MAC _ a, which is the same as the MAC address of node a 1. If the source RPR node sending the topology protection packet is a node other than the node a1, the MAC addresses of the source RPR node and the node a1 are different.
Step 203: and acquiring random data filled when the source RPR node generates the topology protection message on the outer ring.
Step 204: comparing the random data filled when the source RPR node generates the topology protection message on the outer ring with the random data filled when the source RPR node generates the topology protection message on the outer ring, and if the comparison result is inconsistent, executing step 205; if the comparison result is consistent, go to step 206.
In the invention, the RPR node can distinguish whether the RPR node with the same MAC address and the source RPR node are the same RPR node or not according to the random data filled when the source RPR node generates the topology protection message on the outer ring. For example, the random data filled when the source RPR node generates the topology protection packet on the outer ring is 123, and the random data filled when the present RPR node generates the topology protection packet in the direction of sending to the outer ring is 25r, so as to distinguish that the present RPR node and the source RPR node are two different nodes.
In order to ensure the uniqueness of random data filled when generating the topology protection message, the unique random data can be generated by using the time point generated by the topology protection message according to the difference of the time points of different RPR nodes when generating the topology protection message. For example, at 12:00 (time accuracy is minute) of 1/2014, node a1 generates a topology protection packet to be sent in the outer-loop direction, and generates corresponding random data according to the generation time, such as: 201401011200, and filling the generated random data in the topology protection message. At 12:01 of 1/2014, the node a0 generates a topology protection packet sent to the outer loop direction, and generates corresponding random data according to the generation time, such as: 201401011201, and filling the generated random data in the topology protection message. When the node a1 receives the topology protection packet sent by the node a0 in the outer loop direction, the random data 201401011201 corresponding to the topology protection packet is compared with the random data 201401011200 corresponding to the topology protection packet sent by the node a1 in the outer loop direction, and the comparison results are different, so that the node a1 and the node a0 having the same MAC address are distinguished. In the invention, the accuracy of the time point corresponding to the random data, such as millisecond, can be set according to the minimum time difference of different RPR nodes in generating the topology protection message.
The invention also comprises a sending period for setting the topology protection message for the RPR node, so that the RPR node periodically sends the topology protection message according to the set sending period, and when the RPR topology changes, the topology protection message must be sent even if the set period is not reached.
In addition, the topology protection packet also carries a sequence number, where the sequence number is used to identify the number of changes of the content included in the topology protection packet, for example, the sequence number of the first-time transmission of the topology protection packet is 1, if the content of the topology protection packet is not changed when the topology protection packet is transmitted for the second time according to a preset period, the sequence number is still 1, and if the content of the topology protection packet is changed when the topology protection packet is transmitted, the sequence number is added with 1, that is, 2.
As shown in fig. 4, the node a1 may obtain the random data filled when the source RPR node generates the topology protection packet on the outer ring by the following method:
step 401: after receiving the topology protection message, the node a1 queries whether a database table entry corresponding to the source RPR node hop count exists in the current outer ring topology database according to the source RPR node hop count carried in the topology protection message, and if yes, executes step 402; if not, go to step 403.
The topology protection packet also carries a hop count of a source RPR node, for example, the hop count of the source RPR node is hops ═ 3, and the node a1 queries a local outer-loop topology database according to the hop count of the source RPR node. The outer loop topology database is shown in table 1 below.
TABLE 1
Hop count hops=1 hops=2 hops=3 hops=4 hops=5 hops=6
RPR node C0 B0 A0 C1 B1 A1
SpanEdge[0] False False False False True False
SpanEdge[1] False False False False True False
Random data c0 b0 a0 c1 b1 a1
As can be seen from table 1, when the hop count of the source RPR node is hos ═ 3, the database entry corresponding to hos ═ 3 exists in the local outer ring topology database of the node a1, so step 402 is executed.
Step 402: and updating the current outer ring topology database, acquiring random data in a database table entry corresponding to the hop count of the source RPR node from the updated outer ring topology database, and determining the random data as the random data filled when the source RPR node generates the topology protection message on the outer ring.
The node a1 updates the current outer ring topology database according to the topology data packet, wherein if the hop count hoss of the source RPR node in the updated outer ring topology database is 3, the random data in the database table entry corresponding to the hop count hoss is a00, as shown in table 2.
TABLE 2
Hop count hops=1 hops=2 hops=3 hops=4 hops=5 hops=6
RPR node C0 B0 A0 C1 B1 A1
SpanEdge[0] False False False False False False
SpanEdge[1] False False False False False False
Random data c0 b0 a00 c1 b1 a1
Therefore, according to the updated outer ring topology database, the random data in the database table entry corresponding to the source RPR node hop count hoss of 3 is obtained as a 00.
In this step, according to step 203, if the sequence number in the received topology protection message is the same as the sequence number stored in the topology protection message, the current topology database is not updated, otherwise, the current topology database is updated. When the sequence numbers of the topology protection messages sent by all the nodes in the RPR are unchanged, the topology state tends to be stable, and each RPR node discards the topology protection messages stored by the RPR node.
Step 403: and creating a database table entry corresponding to the hop count of the source RPR node according to the received topology protection message, and determining random data in the created database table entry as random data filled when the source RPR node generates the topology protection message on an outer ring.
If, in step 401, the node a1 does not include a database entry corresponding to the hos ═ 3 in the topology database of the current outer ring, then the node a1 needs to create a database entry corresponding to the source RPR node hop count according to the topology protection packet, and create a database entry according to various information carried in the topology protection packet.
The created database entry is shown in table 3.
TABLE 3
Hop count hops=3
RPR node A0
SpanEdge[0] False
SpanEdge[1] False
Random data a00
If the random data a00 in table 3 is the node a1, the random data a00 is determined as the random data filled when the topology protection packet is generated on the outer ring by the source RPR node.
In summary, it is determined that the random data filled when the source RPR node generates the topology protection packet on the outer ring is a 00.
In the present invention, the manner of determining the random data filled when the node a1 generates the topology protection packet on the outer ring includes: the node a1 determines the random data of the corresponding node a1 as a1 according to its outer ring topology database, as shown in table 2. Comparing the random data a00 filled when the source RPR node generates the topology protection message on the outer ring with the random data a1 when the node A1 generates the topology protection message on the outer ring, wherein the comparison result is inconsistent.
In addition, if the node a1 receives the topology protection packet sent by the source RPR node in the outer ring direction, and the node a1 has not sent the topology protection packet in the outer ring direction yet, at this time, the local outer ring topology database of the node a1 may not include the random data corresponding to the node a1, and the random data a00 filled when the source RPR node generates the topology protection packet in the outer ring is not comparable to the random data when the node a1 generates the topology protection packet in the outer ring, so the comparison result is definitely inconsistent.
Step 205: and sending the topology protection message through a sending port on the outer ring of the topology protection message, and executing the step 206.
Step 206: and when the preset time is reached, determining the ring state of the RPR ring according to the topology database of the outer ring, traversing the topology databases of the outer ring and the inner ring according to the determined ring state, and determining that the RPR topology is inconsistent according to the traversal result.
And when the preset time is reached, namely the local outer ring topology database and the inner ring topology database are in a stable state, determining the ring state of the RPR ring according to the local outer ring topology database. The node a1 determines that the ring state of its own outer ring is an open ring by traversing local outer ring topology databases SpanEdge [0] and SpanEdge [1] to see if True is included, otherwise, determines that the ring state of the outer ring is a closed ring.
In the invention, when the ring state of the outer ring is determined, the local outer ring topology database and the local inner ring topology database are traversed so as to determine that the RPR topology is inconsistent according to the traversal result. The RPR topology inconsistency can be determined by any one of the following modes, and when the RPR topology inconsistency is determined by one of the modes, the other modes do not need to be verified:
1. when the ring state of the outer ring is a closed ring, the number of the RPR nodes in the local outer ring topology database traversed by the node a1 is not equal to the number of the RPR nodes in the local inner ring topology database traversed by the node a 1.
2. When the ring state of the outer ring is a closed ring, when the node a1 traverses to the RPR node whose MAC address is the same as its own MAC address, comparing the random data corresponding to the RPR node in the outer ring topology database with the random data filled when the node itself generates the topology protection packet on the outer ring.
3. When the ring state of the outer ring is open loop, when the node a1 traverses to the RPR node whose MAC address is the same as its own MAC address, comparing that the random data corresponding to the corresponding RPR node in the outer ring topology database is the same as the random data filled when generating the topology protection packet on the outer ring, determining that the RPR node has been traversed, and determining that the RPR topology is inconsistent.
4. In the local outer ring topology database of the node A1, the MAC address of the corresponding RPR node when the hop count is hoss is inconsistent with the MAC address of the RPR node when the hop count is HopsRx-hoss +1 in the local inner ring topology database of the node A1; if the RPR nodes are the same, whether the outer ring or the inner ring comprises the RPR nodes with the same MAC address or not needs to be determined, and if yes, the RPR topology is determined to be inconsistent; wherein the HopsRx is the number of RPR nodes except for the node a1 in the local outer ring topology database or the inner ring topology database of the node a1, if the ring state of the outer ring is a closed ring, the HopsRx is hops-1 (the hops is the hop count of the node a1 traversing the local outer ring topology database or the inner ring topology database at the end of traversal minus 1), and if the ring state of the outer ring is an open ring, the HopsRx is hops (the hops is the hop count of the node a1 traversing the local outer ring topology database or the inner ring topology database at the end of traversal).
According to the scheme, random data are filled in the topology protection message, so that when the RPR node encounters the RPR node with the same MAC address as the RPR node, the RPR node can be distinguished according to the corresponding random data, namely, the RPR node with the repeated MAC address is distinguished, and further, the detection of topology inconsistency is more accurate.
As shown in fig. 5 and fig. 6, an embodiment of the present invention provides a device for detecting RPR topology inconsistency. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. From a hardware level, as shown in fig. 5, a hardware structure diagram of a device where a detection apparatus for detecting RPR topology inconsistency according to an embodiment of the present invention is located is shown, where in addition to the CPU, the memory, the network interface, and the nonvolatile memory shown in fig. 5, the device where the apparatus is located may also include other hardware, such as a forwarding chip responsible for processing a packet, in general. Taking a software implementation as an example, as shown in fig. 6, as a logical apparatus, the apparatus is formed by reading, by a CPU of a device in which the apparatus is located, corresponding computer program instructions in a non-volatile memory into a memory for execution. The apparatus 60 for detecting RPR topology inconsistency provided in this embodiment includes:
a determining unit 601, configured to receive a topology protection packet, and determine whether an MAC address of a source RPR node of the topology protection packet carried in the received topology protection packet is the same as an MAC address of the source RPR node;
a comparing unit 602, configured to compare, when the determination result is the same, random data that is filled when the source RPR node generates the topology protection packet on an RPR ring where the source RPR node receives the topology protection packet, with random data that is filled when the source RPR node generates the topology protection packet on the RPR ring;
an RPR topology determining unit 603, configured to send the topology protection packet through a sending port on the RPR ring when the comparison result is inconsistent, and determine the ring state of the RPR ring according to the topology database of the RPR ring when a preset time is reached, and traverse the topology database of the RPR ring and the reverse RPR ring according to the determined ring state, so as to determine that the RPR topologies are inconsistent according to the traversal result.
Further, the method also comprises the following steps:
an obtaining unit 604, configured to obtain random data that is filled when the source RPR node generates the topology protection packet on an RPR ring where the source RPR node receives the topology protection packet;
the acquiring unit is specifically configured to, after receiving the topology protection packet, query a topology database of the current RPR ring according to a hop count of a source RPR node carried in the topology protection packet; if the database table entry corresponding to the source RPR node hop count exists in the topology database of the current RPR ring, updating the topology database of the current RPR ring, acquiring random data in the database table entry corresponding to the source RPR node hop count from the updated topology database of the RPR ring, and determining the random data as random data filled when the source RPR node generates the topology protection message on the RPR ring where the source RPR node receives the topology protection message; if the database table entry corresponding to the hop count of the source RPR node does not exist in the topology database of the current RPR ring, the database table entry corresponding to the hop count of the source RPR node is created according to the received topology protection message, and random data in the created database table entry is determined as random data filled when the source RPR node generates the topology protection message on the RPR ring where the source RPR node receives the topology protection message.
Further, the RPR topology determining unit is further configured to send the topology protection packet through a sending port on the RPR ring when it is determined that the MAC address of the source RPR node of the topology protection packet carried in the topology protection packet is different from the MAC address of the RPR node, and when the preset time is reached, determine the ring state of the RPR ring according to the topology database of the RPR ring, and traverse the RPR ring and the topology database of the reverse RPR ring according to the determined ring state, so as to determine that the RPR topologies are inconsistent according to the traversal result.
Further, the RPR topology determining unit is further configured to determine, when it is determined that the MAC address of the source RPR node of the topology protection packet carried in the topology protection packet is the same as the MAC address of the source RPR node, the comparison result is consistent, and the preset time is reached, a ring state of the RPR ring according to the topology database of the RPR ring, and traverse the RPR ring and the topology database of the reverse RPR ring according to the determined ring state, so as to determine that the RPR topologies are inconsistent according to the traversal result.
Further, the RPR topology determining unit is specifically configured to, when it is determined that the ring state of the RPR ring is an open ring, and when the topology database of the RPR ring is traversed, compare whether random data corresponding to a corresponding RPR node in the topology database of the RPR ring is the same as random data filled when the RPR node generates a topology protection packet on the RPR ring if a RPR node having a MAC address that is the same as the MAC address of the RPR node is traversed; if the RPR topology is the same as the RPR topology, determining that the RPR node is traversed, and determining that the RPR topology is inconsistent; or,
the RPR topology determining unit is specifically configured to, according to the determined ring state of the RPR ring, determine that the MAC address of the RPR node corresponding to the hops on the RPR ring is the same as the MAC address of the RPR node corresponding to the hops-hops +1 on the reverse RPR ring, traverse the topology database of the RPR ring and the reverse RPR ring thereof, and determine whether the RPR nodes having the same MAC address are included, and if so, determine that the RPR topologies are inconsistent; and when the ring state of the RPR ring is an open ring, the HopsRx is the hop count at the end of traversal and is subtracted by 1.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for detecting RPR topology inconsistency includes:
the RPR node receives the topology protection message and judges whether the MAC address of the source RPR node of the topology protection message carried in the received topology protection message is the same as the MAC address of the RPR node;
if so, comparing random data filled when the source RPR node generates the topology protection message on an RPR ring where the source RPR node receives the topology protection message with random data filled when the source RPR node generates the topology protection message on the RPR ring;
and when the comparison result is inconsistent, sending the topology protection message through a sending port on the RPR ring, and when the preset time is reached, determining the ring state of the RPR ring according to the topology database of the RPR ring, and traversing the RPR ring and the topology database of the reverse RPR ring according to the determined ring state to determine that the RPR topology is inconsistent according to the traversal result.
2. The method according to claim 1, wherein the RPR node obtains the random data filled when the source RPR node generates the topology protection packet on the RPR ring on which the source RPR node itself receives the topology protection packet, by:
after receiving the topology protection message, the RPR node queries a topology database of the current RPR ring according to the hop count of the source RPR node carried in the topology protection message;
if the database table entry corresponding to the source RPR node hop count exists in the topology database of the current RPR ring, updating the topology database of the current RPR ring, acquiring random data in the database table entry corresponding to the source RPR node hop count from the updated topology database of the RPR ring, and determining the random data as random data filled when the source RPR node generates the topology protection message on the RPR ring where the source RPR node receives the topology protection message;
if the database table entry corresponding to the hop count of the source RPR node does not exist in the topology database of the current RPR ring, the database table entry corresponding to the hop count of the source RPR node is created according to the received topology protection message, and random data in the created database table entry is determined as random data filled when the source RPR node generates the topology protection message on the RPR ring where the source RPR node receives the topology protection message.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
and when judging that the MAC address of the source RPR node of the topology protection message carried in the topology protection message is different from the MAC address of the RPR node, the RPR node sends the topology protection message through a sending port on the RPR ring, and when the preset time is reached, the ring state of the RPR ring is determined according to the topology database of the RPR ring, and the RPR ring and the topology database of the reverse RPR ring are traversed according to the determined ring state, so that the RPR topology is determined to be inconsistent according to the traversal result.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
and when the RPR node judges that the MAC address of the source RPR node of the topology protection message carried in the topology protection message is the same as the MAC address of the RPR node, the comparison result is consistent, and the preset time is reached, determining the ring state of the RPR ring according to the topology database of the RPR ring, traversing the RPR ring and the topology database of the reverse RPR ring according to the determined ring state, and determining that the RPR topology is inconsistent according to the traversal result.
5. The method according to claim 1, wherein the RPR node traverses the topology database of the RPR ring and its reverse RPR ring according to the determined ring state of the RPR ring to determine that the RPR topology is inconsistent according to a traversal result, specifically comprising:
when the RPR node determines that the ring state of the RPR ring is an open ring, and when traversing the topology database of the RPR ring, if traversing the RPR node with the MAC address same as the MAC address of the RPR node, comparing whether random data corresponding to the RPR node in the topology database of the RPR ring is the same as random data filled when the RPR node generates a topology protection message on the RPR ring; if the RPR topology is the same as the RPR topology, determining that the RPR node is traversed, and determining that the RPR topology is inconsistent; or,
according to the determined ring state of the RPR ring, when the MAC address of the RPR node corresponding to the hoss on the RPR ring is determined to be the same as the MAC address of the RPR node corresponding to the hops-hoss +1 on the reverse RPR ring, traversing the topology database of the RPR ring and the reverse RPR ring thereof to determine whether the RPR node with the same MAC address is included, and if so, determining that the RPR topology is not consistent; and when the ring state of the RPR ring is an open ring, the HopsRx is the hop count at the end of traversal and is subtracted by 1.
6. A device for detecting RPR topology inconsistency, comprising:
the judging unit is used for receiving the topology protection message and judging whether the MAC address of the source RPR node of the topology protection message carried in the received topology protection message is the same as the MAC address of the source RPR node;
a comparing unit, configured to compare, when the determination result is the same, random data that is filled when the source RPR node generates the topology protection packet on an RPR ring on which the source RPR node receives the topology protection packet, with random data that is filled when the source RPR node generates the topology protection packet on the RPR ring;
and the RPR topology determining unit is used for sending the topology protection message through a sending port on the RPR ring when the comparison result is inconsistent, determining the ring state of the RPR ring according to the topology database of the RPR ring when the preset time is reached, and traversing the RPR ring and the topology database of the reverse RPR ring according to the determined ring state so as to determine that the RPR topology is inconsistent according to the traversal result.
7. The apparatus of claim 6, further comprising:
an obtaining unit, configured to obtain random data that is filled when the source RPR node generates the topology protection packet on an RPR ring where the source RPR node receives the topology protection packet;
the acquiring unit is specifically configured to, after receiving the topology protection packet, query a topology database of the current RPR ring according to a hop count of a source RPR node carried in the topology protection packet; if the database table entry corresponding to the source RPR node hop count exists in the topology database of the current RPR ring, updating the topology database of the current RPR ring, acquiring random data in the database table entry corresponding to the source RPR node hop count from the updated topology database of the RPR ring, and determining the random data as random data filled when the source RPR node generates the topology protection message on the RPR ring where the source RPR node receives the topology protection message; if the database table entry corresponding to the hop count of the source RPR node does not exist in the topology database of the current RPR ring, the database table entry corresponding to the hop count of the source RPR node is created according to the received topology protection message, and random data in the created database table entry is determined as random data filled when the source RPR node generates the topology protection message on the RPR ring where the source RPR node receives the topology protection message.
8. The apparatus according to claim 6 or 7, wherein the RPR topology determining unit is further configured to, when it is determined that the MAC address of the source RPR node of the topology protection packet carried in the topology protection packet is different from the MAC address of the source RPR node, send the topology protection packet through a sending port on the RPR ring, and when the preset time is reached, determine a ring state of the RPR ring according to the topology database of the RPR ring, and traverse the RPR ring and the topology database of the reverse RPR ring according to the determined ring state, so as to determine that RPR topologies are inconsistent according to a traversal result.
9. The apparatus according to claim 6 or 7, wherein the RPR topology determining unit is further configured to determine, when it is determined that the MAC address of the source RPR node of the topology protection packet carried in the topology protection packet is the same as the MAC address of the source RPR node, the comparison result is consistent, and the preset time is reached, a ring state of the RPR ring according to the topology database of the RPR ring, and traverse the RPR ring and the topology database of the reverse RPR ring according to the determined ring state, so as to determine that the RPR topologies are inconsistent according to the traversal result.
10. The apparatus according to claim 6, wherein the RPR topology determining unit is specifically configured to, when it is determined that the ring state of the RPR ring is an open ring and when traversing the topology database of the RPR ring, compare whether random data corresponding to a corresponding RPR node in the topology database of the RPR ring is the same as random data filled when generating the topology protection packet on the RPR ring by itself if traversing an RPR node whose MAC address is the same as its own MAC address; if the RPR topology is the same as the RPR topology, determining that the RPR node is traversed, and determining that the RPR topology is inconsistent; or,
the RPR topology determining unit is specifically configured to, according to the determined ring state of the RPR ring, determine that the MAC address of the RPR node corresponding to the hops on the RPR ring is the same as the MAC address of the RPR node corresponding to the hops-hops +1 on the reverse RPR ring, traverse the topology database of the RPR ring and the reverse RPR ring thereof, and determine whether the RPR nodes having the same MAC address are included, and if so, determine that the RPR topologies are inconsistent; and when the ring state of the RPR ring is an open ring, the HopsRx is the hop count at the end of traversal and is subtracted by 1.
CN201410603607.9A 2014-10-30 2014-10-30 Detecting method and device for RPR topology inconformity Pending CN104320302A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410603607.9A CN104320302A (en) 2014-10-30 2014-10-30 Detecting method and device for RPR topology inconformity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410603607.9A CN104320302A (en) 2014-10-30 2014-10-30 Detecting method and device for RPR topology inconformity

Publications (1)

Publication Number Publication Date
CN104320302A true CN104320302A (en) 2015-01-28

Family

ID=52375477

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410603607.9A Pending CN104320302A (en) 2014-10-30 2014-10-30 Detecting method and device for RPR topology inconformity

Country Status (1)

Country Link
CN (1) CN104320302A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111989899A (en) * 2018-04-27 2020-11-24 三菱电机株式会社 Monitoring device, network system, topology management method, and monitoring program
CN114971938A (en) * 2022-06-07 2022-08-30 上海山源电子科技股份有限公司 Method and device for detecting override-proof network topology of coal mine power supply system and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1937561A (en) * 2006-03-03 2007-03-28 华为技术有限公司 Ring-closure determining method and device for resilient packet ring
CN101207545A (en) * 2006-12-15 2008-06-25 华为技术有限公司 Method and system for detection of repeat media access control address on elastic grouping ring
CN101277243A (en) * 2007-03-28 2008-10-01 华为技术有限公司 System, node as well as method for detecting MAC address collision in loop network
US20100226260A1 (en) * 2007-02-13 2010-09-09 Vishal Zinjuvadia Spanning tree ring protocol

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1937561A (en) * 2006-03-03 2007-03-28 华为技术有限公司 Ring-closure determining method and device for resilient packet ring
CN101207545A (en) * 2006-12-15 2008-06-25 华为技术有限公司 Method and system for detection of repeat media access control address on elastic grouping ring
US20100226260A1 (en) * 2007-02-13 2010-09-09 Vishal Zinjuvadia Spanning tree ring protocol
CN101277243A (en) * 2007-03-28 2008-10-01 华为技术有限公司 System, node as well as method for detecting MAC address collision in loop network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陆珠兴,: ""RPR技术内嵌于MSTP设备的研究及实现"", 《中国优秀硕士学位论文全文数据库-信息科技辑》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111989899A (en) * 2018-04-27 2020-11-24 三菱电机株式会社 Monitoring device, network system, topology management method, and monitoring program
CN111989899B (en) * 2018-04-27 2022-03-08 三菱电机株式会社 Monitoring device, network system, topology management method, and computer-readable recording medium
CN114971938A (en) * 2022-06-07 2022-08-30 上海山源电子科技股份有限公司 Method and device for detecting override-proof network topology of coal mine power supply system and storage medium

Similar Documents

Publication Publication Date Title
Fehnker et al. Automated analysis of AODV using UPPAAL
US8442931B2 (en) Graph-based data search
US20160149805A1 (en) Utilizing remote storage for network formation in iot networks
EP3451592B1 (en) Packet transmission between vxlan domains
CN110100479B (en) Device and method for optimizing routing failure by using modified non-path DAO signaling
CN104243318A (en) MAC (media access control) address learning method and MAC address learning device in VXLAN (virtual extensible local area network)
US20140219078A1 (en) Binary search-based approach in routing-metric agnostic topologies for node selection to enable effective learning machine mechanisms
CN109274593B (en) Information storage method and device
CN110768901B (en) Route issuing method, route selection method, related device and system
WO2020007372A1 (en) Control method and device employing industrial ethernet
CN105187279A (en) Traffic statistical and real-time ranking method
CN106465238A (en) Service discovery method and device in neighbor awareness network
CN111886843A (en) Low power consumption Bluetooth network maintenance method, electronic device, Bluetooth network and medium
Winkler et al. An overview of recent results for consensus in directed dynamic networks
CN107147581B (en) Maintenance method and device for routing table entry
US10425485B2 (en) Integrating information centric networking (ICN) over low power and lossy networks (LLNs)
CN104320302A (en) Detecting method and device for RPR topology inconformity
US9893979B2 (en) Network topology discovery by resolving loops
CN106878177B (en) Route processing method and device
CN109617817B (en) Method and device for generating forwarding table entry of MLAG networking
US9667439B2 (en) Determining connections between disconnected partial trees
US10148515B2 (en) Determining connections of non-external network facing ports
CN109450765B (en) Method and device for collecting topology information
CN105634999B (en) A kind of aging method and device of Media Access Control address
CN105340227B (en) Method, controller, interchanger and the system that information is transmitted between open flows flow table

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant after: Xinhua three Technology Co., Ltd.

Address before: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant before: Huasan Communication Technology Co., Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20150128

RJ01 Rejection of invention patent application after publication