CN101729351A - Method and system for finding topology information, query request device and awaiting query device - Google Patents

Method and system for finding topology information, query request device and awaiting query device Download PDF

Info

Publication number
CN101729351A
CN101729351A CN200910221118A CN200910221118A CN101729351A CN 101729351 A CN101729351 A CN 101729351A CN 200910221118 A CN200910221118 A CN 200910221118A CN 200910221118 A CN200910221118 A CN 200910221118A CN 101729351 A CN101729351 A CN 101729351A
Authority
CN
China
Prior art keywords
queried
port
spanning tree
topology information
equipment
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.)
Granted
Application number
CN200910221118A
Other languages
Chinese (zh)
Other versions
CN101729351B (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.)
Beijing Zhigu Tech Co Ltd
Original Assignee
Fujian Star Net Communication 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 Fujian Star Net Communication Co Ltd filed Critical Fujian Star Net Communication Co Ltd
Priority to CN2009102211186A priority Critical patent/CN101729351B/en
Publication of CN101729351A publication Critical patent/CN101729351A/en
Application granted granted Critical
Publication of CN101729351B publication Critical patent/CN101729351B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The embodiment of the invention provides a method and a system for finding topology information, a query request device and awaiting query devices. The method comprises the following the steps of: sending a topology information request message to the adjacent awaiting query device for the adjacent awaiting query device to transmit the topology information message to an adjacent awaiting query device next level awaiting query device, wherein the topology information request message carries spaning tree types, query request device marks and mark information of all query devices to be queried; and if the spaning tree protocol of a spaning tree type mark accords with an operating spaning tree protocol, respectively receiving returned topology information reply message of all query devices to be queried, which carries query request device marks, port information of all awaiting query device parts participating in spaning tree protocol calculation and the awaiting query device marks of neighbor port of awaiting query device ports. The embodiment of the invention can confirm the logic topology relation among devices in a network having VLAN.

Description

Topology information discovery method and system, query request device and device to be queried
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a method and a system for discovering topology information, query request equipment and equipment to be queried.
Background
Topology discovery is an important function of network management platforms. The method mainly aims to acquire and maintain the existence information of the network devices and the connection relation information between the network devices, and provides a diagram of the connection state of the whole network on the basis of the existence information and the connection relation information, so that a network manager can be helped to know and know the topology structure of the whole network integrally. Discovering and tracking the topology of a network is essential for effective network management.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: the existing method for discovering network topology information is only suitable for Networks without Virtual Local Area Networks (VLANs), but not suitable for Networks with VLANs.
Disclosure of Invention
The embodiment of the invention provides a method and a system for discovering topology information, query request equipment and equipment to be queried, which are used for being suitable for a network with a VLAN.
The embodiment of the invention provides a method for discovering topology information, which comprises the following steps:
sending a topology information request message to adjacent equipment to be queried, wherein the topology information request message carries a spanning tree type, an inquiry request equipment identifier and identifier information of all the equipment to be queried, so that the adjacent equipment to be queried forwards the topology information request message to the next-stage adjacent equipment to be queried;
and respectively receiving topology information response messages returned by all the devices to be queried if the spanning tree protocol of the spanning tree type identifier is consistent with the running spanning tree protocol, wherein the topology information response messages carry the identifier of the query request device, the port information of the port of the device to be queried of all the devices to be queried participating in the spanning tree protocol calculation and the identifier of the device to be queried of the opposite port of the device to be queried.
An embodiment of the present invention further provides a query request device, including:
the device comprises a request module, a topology information query module and a topology information query module, wherein the request module is used for sending a topology information request message to adjacent devices to be queried, and the topology information request message carries a spanning tree type, a query request device identifier and identifier information of all the devices to be queried so that the adjacent devices to be queried can forward the topology information request message to the next-stage adjacent devices to be queried;
an obtaining module, configured to receive a topology information response message returned by all the devices to be queried if a spanning tree protocol of the spanning tree type identifier is consistent with an operating spanning tree protocol, where the topology information response message carries the identifier of the query request device, port information of a port of the device to be queried, where all the devices to be queried participate in spanning tree protocol calculation, and a device identifier of an opposite port of the device to be queried.
The embodiment of the invention also provides a device to be queried, which comprises:
a receiving module, configured to receive a topology information request packet, where the topology information request packet carries a spanning tree type, an identifier of a query request device, and identifier information of all devices to be queried;
a forwarding module, configured to forward the topology information request packet to a next-level adjacent device to be queried according to the identification information of all the devices to be queried;
and the providing module is used for returning a topology information response message according to the identification information of all the equipment to be queried and if the spanning tree protocol of the spanning tree type identification is consistent with the running spanning tree protocol, wherein the topology information response message carries the query request equipment identification, the port information of the port of the equipment to be queried, calculated by the spanning tree protocol of all the equipment to be queried, and the equipment to be queried identification of the opposite port of the equipment to be queried.
The embodiment of the invention further provides a system for discovering topology information, which comprises query request equipment and equipment to be queried,
the query request device is configured to send a topology information request message to the adjacent to-be-queried device, where the topology information request message carries a spanning tree type, a query request device identifier, and identifier information of all to-be-queried devices, and respectively receive a topology information response message returned by all to-be-queried devices, where the topology information response message carries the query request device identifier, port information of a to-be-queried device port where all to-be-queried devices participate in spanning tree protocol calculation, and a to-be-queried device identifier of an opposite port of the to-be-queried device port;
the device to be queried is used for receiving the topology information request message, forwarding the topology information request message to a next-level adjacent device to be queried according to the identification information of all the devices to be queried, and returning the topology information response message if the spanning tree protocol of the spanning tree type identification is consistent with the running spanning tree protocol according to the identification information of all the devices to be queried.
It can be known from the foregoing technical solutions that, after the query request device sends the topology information request message to the device to be queried, the device to be queried returns the topology information response message to the query request device according to the identification information of all the devices to be queried in the topology information request message, so that the query request device can obtain the port information of the port of the device to be queried, where all the devices to be queried participate in the spanning tree protocol calculation, and thus can confirm the physical topological relationship among devices in the network where the VLAN does not exist and the logical topological relationship among devices in the network where the VLAN exists.
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 schematic flowchart of a topology information discovery method according to an embodiment of the present invention;
fig. 2A is a schematic flowchart of a topology information discovery method according to a second embodiment of the present invention;
fig. 2B is a schematic view of a topology structure of an application scenario network of the topology information discovery method according to the second embodiment of the present invention;
fig. 3 is a schematic flowchart of a topology information discovery method according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a query requesting device according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a query requesting device according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a device to be queried according to a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a topology information discovery system according to a seventh embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present invention. 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.
Fig. 1 is a schematic flowchart of a method for discovering topology information according to an embodiment of the present invention, and as shown in fig. 1, the method for discovering topology information according to this embodiment may include the following steps:
step 101, sending a topology information request message to an adjacent device to be queried, where the topology information request message carries a spanning tree type, an identifier of a query request device and identifier information of all devices to be queried, so that the adjacent device to be queried forwards the topology information request message to a next-stage adjacent device to be queried;
and 102, respectively receiving topology information response messages returned by all the devices to be queried if the spanning tree protocol of the spanning tree type identifier is consistent with the running spanning tree protocol, wherein the topology information response messages carry the identifier of the query request device, the port information of the device port to be queried of all the devices to be queried participating in the spanning tree protocol calculation and the identifier of the device to be queried of the opposite port of the device port to be queried.
The query request device identifier may be a Media Access Control (MAC) address of the query request device; correspondingly, the device identifier to be queried of the peer port may be an MAC address of the device to be queried of the peer port.
In this embodiment, the identification information of all the devices to be queried may include two forms: when the devices to be queried are all devices in the network, the identification information of all the devices to be queried is a specific field value, for example: fffffffffff; when the device to be queried is a certain device in the network, the identification information of all the devices to be queried is the MAC address of the device.
The embodiment can be applied to a network without a VLAN, for example: the device to be queried in the network runs Spanning Tree protocols such as Spanning Tree Protocol (STP), Rapid Spanning Tree Protocol (RSTP), and the like, and can also be applied to a network in which a VLAN exists, for example: the device to be queried in the network runs Spanning Tree protocols such as Multiple Spanning Tree Protocol (MSTP for short).
In this embodiment, after the query request device sends the topology information request message to the device to be queried, the device to be queried returns a topology information response message to the query request device according to the identification information of all devices to be queried in the topology information request message, so that the query request device can obtain the port information of the port of the device to be queried, where all devices to be queried participate in the spanning tree protocol calculation, and thus can confirm the physical topology relationship among devices in the network where no VLAN exists and the logical topology relationship among devices in the network where the VLAN exists.
Fig. 2A is a schematic flowchart of a method for discovering topology information according to a second embodiment of the present invention, and as shown in fig. 2A, the method for discovering topology information according to this embodiment may include the following steps:
step 201, an inquiry request device sends a topology information request message to an adjacent device to be inquired, wherein the topology information request message carries a spanning tree type, an inquiry request device identifier and identifier information of all devices to be inquired, so that the adjacent device to be inquired forwards the topology information request message to the next-stage adjacent device to be inquired;
the content of the topology information request message may be carried in a data (data) field of an 802.3 data frame, and the format of the data frame may be as follows:
0 1 2 3 4 5 6
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| destination Address-
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Address of | source | non woven
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| Length | DSAP | SSAP | control | protocol | non-visual space
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
I identification | spanning tree type | message type | root |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Marking |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
I operate | live
+ -
| |
+ -
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| | FCS |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Wherein,
destination Address (Destination Address) field: 6 bytes. This field is used to identify the device that needs to receive the data frame. Here, we are compatible with the spanning tree protocol (STP, RSTP, MSTP, etc.), using the multicast address of the spanning tree protocol: 0180c 2000000;
source Address (Source Address) field: 6 bytes. This field is used to identify the device that sent the data frame;
length (Length) field: 2 bytes. The field is used for indicating the length of data contained in the data field of the data frame;
target service access point (DSAP) field: 1 byte, value 0x 42. This field indicates that the spanning tree protocol (STP, RSTP, MSTP, etc.);
source Service Access Point (SSAP) field: 1 byte, value 0x 42. This field indicates that the spanning tree protocol (STP, RSTP, MSTP, etc.);
control (Control) field: 1 byte, value 0x 03. This field indicates the 802.2 unnumbered data format with connectionless services;
protocol Identifier (Protocol Identifier) field: 2 bytes, value 0x 0000. This field indicates Spanning-tree Query Protocol (Spanning-tree Protocol);
spanning-tree type (Spanning-tree Mode) field: 2 bytes, the field indicates the type of the running spanning tree protocol, and may include spanning tree protocols such as STP, RSTP, MSTP, etc., and the corresponding values are as follows:
STP=0x1000;
RSTP=0x2000;
MSTP is 0x30, represents the number of spanning tree instances (Instance), excluding spanning tree Instance 0(Instance 0);
a message Type (Type) field: 1 byte. The field indicates the type of the packet carried in the data frame, and the value and meaning thereof are as follows:
the Type is 2, and the request message represents that the query request equipment requests the logical topological relation (including port information) of each equipment to be queried;
root identification (Root identity) field: 8 bytes. This field represents the root bridge information, including the priority and MAC address of the root bridge;
operation (Operation) field: this field indicates specific processing for spanning tree protocols (STP, RSTP, MSTP, etc.). Since the operation fields can correspond to different spanning tree protocols and have different lengths, the number of bytes of the operation field only defines an upper limit, namely not more than 1000 bytes.
Frame Check Sequence (FCS) field: 4 bytes. This field includes a 32-bit Cyclic Redundancy Check (CRC) value, generated by the sender device (the inquiry requesting device), calculated by the receiver device (the device to be inquired) to check for corrupted frames.
Further, the Operation field may further include the following field information:
when a Spanning-tree Mode (Spanning-tree Mode) field in the topology information request packet (i.e., type 2) takes a value of 0x1000 or 0x2000, the operation field may include the following information:
request mac (request mac) address field: 6 bytes. This field indicates the MAC address of the inquiry requesting device;
other mac (other mac) address field: 6 bytes. When the field takes the value of fffffffffff, the field indicates that all the devices to be inquired need to respond to the request message; when the field dereferencing is the MAC address of a certain device, the field indicates that only the device to be inquired corresponding to the address needs to respond to the request message;
when a Spanning-tree Mode (Spanning-tree Mode) field in the topology information request message (i.e., type 2) takes a value of 0x30, the operation field may include the following information:
request mac (request mac) address field: 6 bytes. This field indicates the MAC address of the inquiry requesting device;
other mac (other mac) address field: 6 bytes. When the field takes the value of fffffffffff, the field indicates that all the devices to be inquired need to respond to the request message; when the field dereferencing is the MAC address of a certain device, the field indicates that only the device to be inquired corresponding to the address needs to respond to the request message;
multiple Spanning Tree (MST) configuration summary (MST Configdigest) field: 16 bytes. The field is used for storing a configuration abstract of the equipment domain, and the content of the field is the MST configuration abstract (MST config digest) field in a Bridge Protocol Data Unit (BPDU for short);
202, receiving the topology information request message by the adjacent device to be queried, if the device to be queried identified by the identification information of all the devices to be queried includes the adjacent device to be queried (which may be a scenario including all devices to be queried in a network, or a scenario including only the adjacent device to be queried), and if a spanning tree protocol of the spanning tree type identification is consistent with a spanning tree protocol of the adjacent device to be queried, returning a topology information response message to the query request device through a port receiving the topology information request message, where the topology information response message carries the query request device identification, port information of a port of the device to be queried, which is calculated by the device to be queried participating in the spanning tree protocol, and a device to be queried identification of an opposite port of the device to be queried;
step 203, the adjacent device to be queried receives the topology information request message, and if the device to be queried identified by the identification information of all the devices to be queried does not include the adjacent device to be queried or the devices to be queried identified by the identification information of all the devices to be queried are all devices to be queried in the network, the topology information request message is forwarded to the next-stage adjacent device to be queried through other ports except the port for receiving the topology information request message;
similarly, the content of the topology information response message may also be carried in a data (data) field of an 802.3 data frame, and the format of the data frame may be as follows:
0 1 2 3 4 5 6
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| destination Address-
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Address of | source | non woven
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| Length | DSAP | SSAP | control | protocol | non-visual space
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
I identification | spanning tree type | message type | root |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Marking |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
I operate | live
+ -
| |
+ -
| |
+ -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| | FCS |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Wherein,
destination Address (Destination Address) field: 6 bytes. This field is used to identify the device that needs to receive the data frame. Here, we are compatible with the spanning tree protocol (STP, RSTP, MSTP, etc.), using the multicast address of the spanning tree protocol: 0180c 2000000;
source Address (Source Address) field: 6 bytes. This field is used to identify the device that sent the data frame;
length (Length) field: 2 bytes. The field is used for indicating the length of data contained in the data field of the data frame;
target service access point (DSAP) field: 1 byte, value 0x 42. This field indicates that the spanning tree protocol (STP, RSTP, MSTP, etc.);
source Service Access Point (SSAP) field: 1 byte, value 0x 42. This field indicates that the spanning tree protocol (STP, RSTP, MSTP, etc.);
control (Control) field: 1 byte, value 0x 03. This field indicates the 802.2 unnumbered data format with connectionless services;
protocol Identifier (Protocol Identifier) field: 2 bytes, value 0x 0000. This field indicates Spanning-tree Query Protocol (Spanning-tree Protocol);
spanning-tree type (Spanning-tree Mode) field: 2 bytes, the field indicates the type of the running spanning tree protocol, and may include spanning tree protocols such as STP, RSTP, MSTP, etc., and the corresponding values are as follows:
STP=0x1000;
RSTP=0x2000;
MSTP is 0x30, represents the number of spanning tree instances (Instance), excluding spanning tree Instance 0(Instance 0);
a message Type (Type) field: 1 byte. The field indicates the type of the packet carried in the data frame, and the value and meaning thereof are as follows:
the Type is 3, which represents the response message of the device to be queried responding to the query request device Type is 2;
root identification (Root identity) field: 8 bytes. This field represents the root bridge information, including the priority and MAC address of the root bridge;
operation (Operation) field: this field indicates specific processing for spanning tree protocols (STP, RSTP, MSTP, etc.). Since the operation fields can correspond to different spanning tree protocols and have different lengths, the number of bytes of the operation field only defines an upper limit, namely not more than 1000 bytes.
Frame Check Sequence (FCS) field: 4 bytes. This field includes a 32-bit Cyclic Redundancy Check (CRC) value, generated by the sender device (the inquiry requesting device), calculated by the receiver device (the device to be inquired) to check for corrupted frames.
Further, the Operation field may further include the following field information:
when a Spanning-tree Mode (Spanning-tree Mode) field in the topology information response packet (i.e., type — 3) takes a value of 0x1000 or 0x2000, the operation field may include the following information:
request mac (request mac) address field: 6 bytes. This field indicates the MAC address of the inquiry requesting device;
acknowledgement mac (reply mac) address field: 6 bytes. The field indicates the MAC address of the equipment to be inquired which replies the message;
packet count/Packet number field: 1 byte. The field is used for the number of messages transmitted in segments after the information quantity exceeds 1518 bytes, the first 4 bits represent the number of messages which need to be transmitted by the equipment to be inquired, and the last 4 bits represent that the message is the second message;
port information (Ports Status) field: one port occupies 4 bytes. The field is used for storing port information of a port of the equipment to be queried, which is calculated by the equipment to be queried participating in a spanning tree protocol, and the port information comprises information such as a port number, a spanning tree instance number, a port role, a port state and the like;
opposite-end MAC address (Neighbor MAC-address) field: 6 bytes. The field indicates the MAC address of the device to be queried of the opposite port of the device port to be queried, one device port to be queried corresponding to one opposite port.
Further, the port Status field may further include the following field information (taking a port as an example, the following field included in the port information is described):
port number (index) field: 2 bytes. The field is used for recording the value of the port number;
spanning tree Instance number (Instance ID) field: 1 byte. For STP and RSTP, the value of this field is 0;
port role (Port-role) field and Port status (Port-status) field: for a total of 1 byte. Wherein, 4 bits represent the port role, and the values corresponding to each are as follows:
root (Root) port 1000;
port 0100 is designated (Desg);
substitute (Altn) port 0010;
backup (Backup) port 0001;
the other 4 bits represent port states, and the corresponding values are as follows:
forwarding state (Forwarding) 0100;
learning state (Learning) 0010;
blocking state (Blocking) 0001;
when the Spanning-tree Mode field in the topology information response packet (i.e., type 3) takes the value of 0x30, the operation field may include the following information:
request mac (request mac) address field: 6 bytes. This field indicates the MAC address of the inquiry requesting device;
acknowledgement mac (reply mac) address field: 6 bytes. The field indicates the MAC address of the equipment to be inquired which replies the message;
packet count/Packet number field: 1 byte. The field is used for the number of messages transmitted in segments after the information quantity exceeds 1518 bytes, the first 4 bits represent the number of messages which need to be transmitted by the equipment to be inquired, and the last 4 bits represent that the message is the second message;
MST configuration digest (MST config digest) field: 16 bytes. The field is used for storing a configuration abstract of the equipment domain, and the content of the field is the MST configuration abstract (MST config digest) field in a Bridge Protocol Data Unit (BPDU for short);
port information (Ports Status) field: the field is used for storing port information of a port of the equipment to be queried, wherein the port information of the equipment to be queried participates in spanning tree protocol calculation, the port information comprises information such as a port number, a spanning tree instance number, a port role and a port state, the port number is used as an index, and the port role and the port state of the port in each spanning tree instance are recorded under each port. The number of spanning tree instances is recorded in the last 1 byte of the spanning tree type field. If there are n spanning tree instances, one port occupies 2+2 x (n +1) bytes;
opposite-end MAC address (Neighbor MAC-address) field: 6 bytes. The field indicates the MAC address of the device to be queried of the opposite port of the device port to be queried, one device port to be queried corresponding to one opposite port.
Further, the port Status field may further include the following field information (taking a port as an example, the following field included in the port information is described):
port number (index) field: 2 bytes. The field is used for recording the value of the port number;
spanning tree Instance number (Instance ID) field: 1 byte. This field is used to record the value of the spanning tree instance number.
Port role (Port-role) field and Port status (Port-status) field: for a total of 1 byte. Wherein, 4 bits represent the port role, and the values corresponding to each are as follows:
root (Root) port 1000;
port 0100 is designated (Desg);
substitute (Altn) port 0010;
backup (Backup) port 0001;
the other 4 bits represent port states, and the corresponding values are as follows:
forwarding state (Forwarding) 0100;
learning state (Learning) 0010;
blocking state (Blocking) 0001.
It should be noted that: the processing mode after the next-stage neighboring device to be queried adjacent to the query request device receives the topology information request message may refer to the processing performed by the neighboring device to be queried in this step, and details are not repeated here;
step 204, the query request device receives a topology information response message, and if the Spanning tree protocol identified by the Spanning tree type is consistent with the Spanning tree protocol operated by the query request device, stores the port information of the port of the device to be queried, in which all the devices to be queried participate in the Spanning tree protocol calculation, and the MAC address of the device to be queried of the opposite port of the device to be queried, into a preset Spanning tree port state (Spanning-tree Ports Status) table, and stores the MAC address of the device to be queried of the opposite port of the device to be queried into a preset MAC address (SwitchMAC) table;
before this step, the query requesting device may set a spanning tree port state table and a MAC address table in advance. The spanning tree port state table is used for storing port information of a port of query request equipment, which participates in spanning tree protocol calculation, of the query request equipment and an MAC address of equipment to be queried of an opposite port of the query request equipment; the MAC address table is used to store the MAC address of the query request device and the MAC address of the device to be queried of the opposite port of the query request device port.
In this step, after the query request device receives the topology information response message, when it is determined that a value of a request MAC (request MAC) address field in the topology information response message is an MAC address of the device, a port information (Ports Status) field and an opposite-end MAC address (Neighbor MAC-address) field in the topology information response message are stored in a Spanning-tree Ports Status table, and an opposite-end MAC address (Neighbor MAC-address) field is stored in a MAC address (Switch MAC) table.
Further, in order to avoid repeatedly storing the peer MAC address (Neighbor MAC-address) field, in this embodiment, before the step of storing the peer MAC address (Neighbor MAC-address) field in the MAC address table, a following determination may be performed according to the peer MAC address (Neighbor MAC-address) field: if the opposite-end MAC address (Neighbor MAC-address) field already exists in the MAC address table, the opposite-end MAC address (Neighbor MAC-address) field does not need to be stored in the MAC address table: and if the MAC address table does not have the opposite terminal MAC address field, storing the opposite terminal MAC address field into the MAC address table.
The Spanning-tree Ports Status table may include the following fields:
a reply mac (reply mac) address field;
a port number (index) field;
a spanning tree Instance number (Instance ID) field;
a Port role (Port-role) field and a Port status (Port-status) field;
a peer MAC address field;
the Spanning-tree Ports Status table is indexed by a reply mac (reply mac) address field, a port number (index) field, and a Spanning tree Instance number (Instance ID) field.
The MAC address (Switch MAC) table may contain the following fields:
a peer MAC address field.
For example: for example, the following table entry is in the Spanning-tree Ports Status table:
“Reply MAC-address=MAC1”;
“Port index=10”;
“Instance ID=1”;
“Port-status=Forwarding”;
“Port-role=Root”;
“Neighbor MAC-address=MAC2”。
the above entry describes the following information: in the spanning tree instance with spanning tree instance number 1, the device with address MAC1 is connected to the device with address MAC2 via the port with port number 10, the port state of the port is the forwarding state, and the port role is the root port.
In this embodiment, when the query request device receives the topology information response messages responded by the device to be queried corresponding to all MAC fields in the MAC address table, that is, when all MAC address fields in the MAC address table can query the table entry using the MAC address as the response MAC address field in the spanning tree port state table, it can be said that the two tables completely record the topology information of the network, so that the network topology structure can be clearly determined.
It should be noted that: after the device to be queried adjacent to the query request device and the next-stage adjacent device to be queried receive the topology information response message, checking that a request MAC (request MAC) address field in the topology information response message is not an MAC address of the device, not processing the received topology information request message, forwarding the topology information response message through a port corresponding to a request MAC (request MAC) address found in an MAC address table, and finally reaching the query request device.
In this embodiment, if the device to be queried does not run the spanning tree protocol (STP, RSTP, MSTP, etc.) and does not open the BPDU transparent transmission function, the received topology information request/response message is not processed and is not forwarded; if the equipment to be queried does not run spanning tree protocols (STP, RSTP, MSTP and the like) but the BPDU transparent transmission function is started, directly transmitting the received topology information request/response message to the next/previous-stage adjacent equipment to be queried without processing; if the device to be queried runs STP and RSTP and the value of a Spanning tree type (Spanning-tree mode) field in the received topology information request/response message is 0x1000 or 0x2000, the topology information request/response message may be correspondingly processed according to the relevant content of step 202/step 204; if the equipment to be inquired runs the MSTP and the value of a Spanning tree type (Spanning-tree mode) field in the received topology information request/response message is 0x30, checking whether an MST configuration digest (MST configuration digest) field in the topology information request/response message is the same as an MST configuration digest (MST configuration digest) field in a BPDU (BPDU) generated by the equipment to be inquired, if so, correspondingly processing the topology information request/response message according to the relevant content of the step 202/step 204, otherwise, directly discarding the received topology information request/response message without processing; if the device to be queried runs STP and RSTP, the value of the Spanning tree type (Spanning-tree Mode) field in the received topology information request/response message is 0x30 ANG, or the device to be queried runs MSTP, and the value of the Spanning tree type (Spanning-tree Mode) field in the received topology information request/response message is 0x1000 or 0x2000, which indicates that the Spanning tree protocol run by the device to be queried does not negotiate with other devices successfully, the received topology information request/response message is directly discarded without processing.
Fig. 2B is a schematic diagram of a topology structure of an application scenario network of the topology information discovery method provided in the second embodiment of the present invention, where each device in the topology runs MSTP, and the configuration in the domain is as follows:
Instance VLANs Mapped
-----------------------------------------
0 :1-39,104-1999,2101-4094
1 :41,43
2 :40,42
-----------------------------------------
in Instance 0, the root bridge is S1, and after the spanning tree protocol is calculated, the port roles and port states of the ports of the device may be as follows:
idx of S1 is 1, the port role is "desg", and the port status is "forwarding"
idx is 2, the role of the port is desg, and the state of the port is forwarding;
idx of S2 is 1, the port role is "root", and the port status is "forwarding"
idx is 2, the role of the port is desg, and the state of the port is forwarding "
idx is 3, the role of the port is desg, and the state of the port is forwarding;
idx of S3 is 1, the port role is "root", and the port status is "forwarding"
idx is 2, the port role is "altn", and the port state is "blocking"
idx is 3, the role of the port is desg, and the state of the port is forwarding;
idx of S4 is 1, the port role is "root", and the port status is "forwarding"
idx is 2, the port role is "altn" and the port state is "blocking".
In Instance1, the root bridge is S2, and after the spanning tree protocol is calculated, the port roles and port states of the ports of the device may be as follows:
idx of S1 is 1, the port role is "root", and the port status is "forwarding"
idx is 2, the role of the port is desg, and the state of the port is forwarding;
idx of S2 is 1, the port role is "desg", and the port status is "forwarding"
idx is 2, the role of the port is desg, and the state of the port is forwarding "
idx is 3, the role of the port is desg, and the state of the port is forwarding;
idx of S3 is 1, port role is "altn", and port status is "blocking"
idx is 2, the role of the port is root, and the state of the port is forwarding "
idx is 3, the port role is "altn", and the port state is "blocking";
idx of S4 is 1, the port role is "root", and the port status is "forwarding"
idx is 2, the port role is "desg", and the port status is "forwarding".
In Instance3, the root bridge is S3, and after the spanning tree protocol is calculated, the port color and port status of each port of the device can be as follows:
idx of S1 is 1, the port role is "desg", and the port status is "forwarding"
idx is 2, the port role is root, and the port state is forwarding;
idx of S2 is 1, port role is "altn", and port status is "blocking"
idx is 2, the role of the port is root, and the state of the port is forwarding "
idx is 3, the port role is "altn", and the port state is "blocking";
idx of S3 is 1, the port role is "desg", and the port status is "forwarding"
idx is 2, the role of the port is desg, and the state of the port is forwarding "
idx is 3, the role of the port is desg, and the state of the port is forwarding;
idx of S4 is 1, the port role is "desg", and the port status is "forwarding"
idx is 2, the port role is root, and the port state is forwarding.
After the "mapping-tree location-topology query" is run, returning the success of the query, and sequentially traversing the "mapping-tree portals" table by using the "show mapping-tree location-topology" to obtain the logical topology. Taking the topology as an example, in S4, a command "Switch # mapping-tree location-topology query" is first executed to obtain an execution result "mapping-tree location-topology query"; the command "Switch # show mapping-tree logic-topology" is then executed, resulting in the following execution results:
Spanning tree enabled protoCol mstp
-------------------------------------------------------------
MST 0 logic-topology
mac:00 d0 f8 10 04 01
inf fa 0/1(root/fwd)/ \inf fa 0/2(alte/blk)
/ \
inf fa 0/3(desg/fwd)/ \inf fa 0/3(desg/fwd)
/inf fa 0/2(desg/fwd) \
mac:00 d0 f8 10 02 01----------------------mac:00 d0 f8 10 03 01
\ inf fa 0/2(alte/blk)/
inf fa 0/1(root/fwd)\ /inf fa 0/1(root/fwd)
\ /
inf fa 0/1(desg/fwd)\ /inf fa 0/2(desg/fwd)
mac:00 d0 f8 10 01 01
-------------------------------------------------------------
MST 1 logiC-topology
mac:00 d0 f8 10 04 01
inf fa 0/1(root/fwd)/ \inf fa0/2(desg/fwd)
/ \
inf fa 0/3(desg/fwd)/ \inf fa 0/3(alte/blk)
/ inf fa 0/2(desg/fwd) \
mac:00 d0 f8 10 02 01 -----------------------------mac:00d0f8100301
\ in ffa 0/2(root/fwd)/
inf fa 0/1(desg/fwd)\ /inf fa 0/1(alte/blk)
\ /
inf fa 0/1(root/fwd)\ /inf fa 0/2(desg/fwd)
mac:00 d0 f8 10 01 01
-------------------------------------------------------------
MST 3 logic-topology
mac:00 d0 f8 10 04 01
inf fa 0/1(desg/fwd)/ \inf fa 0/2(root/fwd)
/ \
inf fa 0/3(alte/blk)/ \inf fa 0/3(desg/fwd)
/inf fa 0/2(desg/fwd) \
mac:00d0f8100201 ----------------------------mac:00d0f8100301
\ inf fa 0/2(desg/fwd)/
inf fa 0/1(alte/blk)\ /inf fa 0/1(desg/fwd)
\ /
inf fa 0/1(desg/fwd) \ /inf fa 0/2(root/fwd)
mac:00 d0 f8 10 01 01
-------------------------------------------------------------
by the operation result, the topology of the application scenario network can be clearly reproduced, and the logical topological relationship among the devices (S1, S2, S3, and S4) in the VLAN-existing network can be confirmed.
In this embodiment, after the query request device sends the topology information request message to the device to be queried, the device to be queried returns a topology information response message to the query request device according to the identification information of all devices to be queried in the topology information request message, so that the query request device can obtain the port information of the port of the device to be queried, where all devices to be queried participate in the spanning tree protocol calculation, and thus can confirm the physical topology relationship among devices in the network where no VLAN exists and the logical topology relationship among devices in the network where the VLAN exists.
Fig. 3 is a schematic flow chart of a method for discovering topology information according to a third embodiment of the present invention, and as shown in fig. 3, compared with the previous embodiment, the method for discovering topology information according to the present embodiment may further include the following steps:
step 301, when an inquiry request device sends a topology information request message to an adjacent device to be inquired, a timer is started;
step 302, the query request device determines whether the topology information response messages returned by all the devices to be queried identified by the MAC addresses in the MAC address table are received within a preset time of a timer, if the query request device receives the topology information response messages returned by all the devices to be queried identified by the MAC addresses in the MAC address table, step 303 is executed, otherwise step 304 is executed;
step 303, the query request device confirms that the query is successful, and generates a result of successful query;
step 304, the query request device confirms the failure of the query, and generates a result of the failure of the query.
Wherein the preset time of the timer may be set to 3 BPDU handshake times (hello-time).
Alternatively, in this embodiment, in step 303, if the query requesting device does not receive the topology information response messages returned by all the devices to be queried identified by the MAC address in the MAC address table within the preset time of the timer, the query requesting device may further execute step 201 again to send the topology information request message to the adjacent devices to be queried, and the identification information of all the devices to be queried may be a certain MAC address field in the MAC address table that has not been queried in the spanning tree port state table, that is, the value of the other MAC (othermac) address field in the topology information request message is the device to be queried whose MAC address is in the MAC address table and has not received the topology information response message, and further, the preset time of the timer may be halved, and the above-mentioned cycle is repeated. When the preset time of the timer is less than half of the BPDU handshake time, the query fails, and a query failure result is generated.
In this embodiment, the timer is started while the query request device sends the topology information request packet to the adjacent device to be queried, so as to determine whether the topology information acquired by the query request device is complete, thereby ensuring the integrity of the topology information, and enabling the network manager to confirm the logic result of the network. In addition, the embodiment of the invention is completely compatible with the related standards of the current spanning tree protocols (STP, RSTP and MSTP), and has the advantages of less change, convenient deployment and simplicity.
It should be noted that: while, for purposes of simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present invention is not limited by the illustrated ordering of acts, as some steps may occur in other orders or concurrently with other steps in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
Fig. 4 is a schematic structural diagram of an inquiry requesting device according to a fourth embodiment of the present invention, and as shown in fig. 4, the inquiry requesting device according to this embodiment may include a requesting module 41 and an obtaining module 42. The request module 41 sends a topology information request message to an adjacent device to be queried, where the topology information request message carries a spanning tree type, a query request device identifier, and identifier information of all devices to be queried, so that the adjacent device to be queried forwards the topology information request message to a next-stage adjacent device to be queried; the obtaining module 42 receives, if the spanning tree protocol of the spanning tree type identifier is consistent with the running spanning tree protocol, topology information response messages returned by all the devices to be queried, where the topology information response messages carry the identifier of the query request device, the port information of the device port to be queried of all the devices to be queried, which participate in the spanning tree protocol calculation, and the identifier of the device to be queried of the opposite port of the device port to be queried, respectively.
The functions of the query request device in the second embodiment of the present invention and the query request device in the third embodiment of the present invention may be implemented by the query request device provided in this embodiment, and the query request device may be a switch.
The query request device identifier may be a MAC address of the query request device; correspondingly, the device identifier to be queried of the peer port may be an MAC address of the device to be queried of the peer port.
The embodiment can be applied to a network without a VLAN, for example: the device to be queried in the network runs spanning tree protocols such as STP, RSTP, etc., and can also be applied to networks with VLANs, for example: the equipment to be inquired in the network runs a spanning tree protocol such as MSTP.
In this embodiment, after the request module sends the topology information request message to the device to be queried, the device to be queried returns a topology information response message to the acquisition module according to the identification information of all devices to be queried in the topology information request message, so that the acquisition module can acquire the port information of the port of the device to be queried, where all devices to be queried participate in the spanning tree protocol calculation, and thus can confirm the physical topology relationship among devices in the network where the VLAN does not exist and the logical topology relationship among devices in the network where the VLAN exists.
Fig. 5 is a schematic structural diagram of a query requesting device according to a fifth embodiment of the present invention, and as shown in fig. 5, as compared with the previous embodiment, the query requesting device of this embodiment may further include a setting module 51, configured to preset a spanning tree port state table for storing port information of a port of the query requesting device, where the query requesting device participates in spanning tree protocol calculation, and a MAC address of a device to be queried of an opposite port of the query requesting device, and a MAC address table for storing a MAC address of the query requesting device and a MAC address of a device to be queried of an opposite port of the query requesting device.
Further, the query requesting device of the present embodiment may further include a first processing module 52 and a second processing module 53. The first processing module 52 stores the port information of the port of the device to be queried, which is obtained by the obtaining module 42 and is calculated by the spanning tree protocol, of all the devices to be queried and the MAC address of the device to be queried of the opposite port of the device to be queried, into the spanning tree port state table set by the setting module 51; the second processing module 53 stores the MAC address of the device to be queried of the opposite port of the device to be queried, which is obtained by the obtaining module 42, into the MAC address table set by the setting module 51.
Fig. 6 is a schematic structural diagram of a device to be queried according to a sixth embodiment of the present invention, as shown in fig. 6, the device to be queried according to this embodiment may include a receiving module 61 for receiving a topology information request packet, where the topology information request packet carries a spanning tree type, an identifier of a query request device, and identifier information of all devices to be queried, a forwarding module 62 for forwarding the topology information request packet to a next-level adjacent device to be queried according to the identifier information of all devices to be queried, and a providing module 63 for returning a topology information response packet according to the identifier information of all devices to be queried if a spanning tree protocol of the spanning tree type identifier is consistent with an operating spanning tree protocol, where the topology information response packet carries the identifier of the query request device, port information of a port of the device to be queried, which is calculated by the spanning tree protocol of all devices to be queried, and an identifier of the device to be queried of an opposite port of the device to be queried And (4) identifying.
The functions of the device to be queried in the second embodiment of the present invention and the third embodiment of the present invention may be implemented by the device to be queried provided in this embodiment, and the device to be queried may be a switch.
The query request device identifier may be a MAC address of the query request device; correspondingly, the device identifier to be queried of the peer port may be an MAC address of the device to be queried of the peer port.
In this embodiment, the identification information of all the devices to be queried may include two forms: when the devices to be queried are all devices in the network, the identification information of all the devices to be queried is a specific field value, for example: ffffffffff, correspondingly, the providing module 63 may return a topology information response message according to the identification information of all the devices to be queried, and the forwarding module 62 may forward the topology information request message to a next-stage adjacent device to be queried according to the identification information of all the devices to be queried; when the device to be queried is a certain device in the network, the identification information of all the devices to be queried is the MAC address of the device, and accordingly, the providing module 63 may return a topology information response packet according to the identification information of all the devices to be queried.
In this embodiment, after the receiving module 61 receives the topology information request message, if the to-be-queried devices identified by the identification information of all the to-be-queried devices include the to-be-queried device (which may be a scenario including all the to-be-queried devices in a network, or a scenario including only the adjacent to-be-queried device), and the spanning tree protocol identified by the spanning tree type is consistent with the spanning tree protocol operated by the to-be-queried device, the providing module 63 provides a topology information response message returned through a port that receives the topology information request message; if the devices to be queried identified by the identification information of all the devices to be queried do not include the devices to be queried or the devices to be queried identified by the identification information of all the devices to be queried are all devices to be queried in the network, the forwarding module 62 forwards the topology information request message to the next-stage adjacent device to be queried through other ports except the port for receiving the topology information request message.
The embodiment can be applied to a network without a VLAN, for example: the device to be queried in the network runs spanning tree protocols such as STP, RSTP, etc., and can also be applied to networks with VLANs, for example: the equipment to be inquired in the network runs a spanning tree protocol such as MSTP.
In this embodiment, after receiving the topology information request message, the providing module returns a topology information response message according to the identification information of all the devices to be queried in the topology information request message, so that the devices to be queried can obtain the port information of the port of the device to be queried, where all the devices to be queried participate in the spanning tree protocol calculation, and thus can confirm the physical topology relationship among the devices in the network where the VLAN does not exist and the logical topology relationship among the devices in the network where the VLAN exists.
Fig. 7 is a schematic structural diagram of a topology information discovery system according to a seventh embodiment of the present invention, and as shown in fig. 7, the topology information discovery system according to this embodiment may include a query requesting device 71 and a device to be queried 72. Wherein,
the query request device 71 is configured to send a topology information request message to an adjacent device to be queried 72, where the topology information request message carries a spanning tree type, a query request device identifier, and identifier information of all devices to be queried 72, and respectively receive topology information response messages returned by all devices to be queried 72, where the topology information response messages carry the query request device identifier, port information of a device to be queried of the device to be queried 72 participating in spanning tree protocol calculation, and a device to be queried identifier of an opposite port of the device to be queried port;
the device to be queried 72 is configured to receive the topology information request message, forward the topology information request message to a next-stage adjacent device to be queried 72 according to the identification information of all the devices to be queried 72, and return the topology information response message if the spanning tree protocol identified by the spanning tree type is consistent with the running spanning tree protocol according to the identification information of all the devices to be queried 72.
The functions of the query request device in the second embodiment of the present invention and the query request device in the third embodiment of the present invention may be implemented by the query request device 71 in the topology information discovery system provided in this embodiment, and the query request device 71 may be an exchange; the functions of the device to be queried in the second embodiment of the present invention and the third embodiment of the present invention may be implemented by the device to be queried 72 in the topology information discovery system provided in this embodiment, and the device to be queried 72 may be a switch.
The query request device identifier may be a MAC address of the query request device; correspondingly, the device identifier to be queried of the peer port may be an MAC address of the device to be queried of the peer port.
In this embodiment, the identification information of all the devices to be queried may include two forms: when the devices to be queried are all devices in the network, the identification information of all the devices to be queried is a specific field value, for example: ffffffffff, correspondingly, the device to be queried 72 may return a topology information response message according to the identification information of all the devices to be queried, and forward the topology information request message to the next-stage adjacent device to be queried; when the device to be queried is a certain device in the network, the identification information of all the devices to be queried is the MAC address of the device, and correspondingly, the device to be queried 72 may return a topology information response packet according to the identification information of all the devices to be queried.
In this embodiment, after receiving a topology information request message, if the to-be-queried device identified by the identification information of all the to-be-queried devices includes the to-be-queried device (which may be a scenario including all the to-be-queried devices in a network, or a scenario including only the adjacent to-be-queried device), and the spanning tree protocol identified by the spanning tree type is consistent with the spanning tree protocol operated by the to-be-queried device, the to-be-queried device returns a topology information response message through a port receiving the topology information request message; if the devices to be queried identified by the identification information of all the devices to be queried do not include the devices to be queried or the devices to be queried identified by the identification information of all the devices to be queried are all the devices to be queried in the network, the devices to be queried forward the topology information request message to the next-stage adjacent devices to be queried through other ports except the port for receiving the topology information request message.
The embodiment can be applied to a network without a VLAN, for example: the device to be queried in the network runs spanning tree protocols such as STP, RSTP, etc., and can also be applied to networks with VLANs, for example: the equipment to be inquired in the network runs a spanning tree protocol such as MSTP.
In this embodiment, after the query request device sends the topology information request message to the device to be queried, the device to be queried returns a topology information response message to the query request device according to the identification information of all devices to be queried in the topology information request message, so that the query request device can obtain the port information of the port of the device to be queried, where all devices to be queried participate in the spanning tree protocol calculation, and thus can confirm the physical topology relationship among devices in the network where no VLAN exists and the logical topology relationship among devices in the network where the VLAN exists.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (12)

1. A method for discovering topology information, comprising:
sending a topology information request message to adjacent equipment to be queried, wherein the topology information request message carries a spanning tree type, an inquiry request equipment identifier and identifier information of all the equipment to be queried, so that the adjacent equipment to be queried forwards the topology information request message to the next-stage adjacent equipment to be queried;
and respectively receiving topology information response messages returned by all the devices to be queried if the spanning tree protocol of the spanning tree type identifier is consistent with the running spanning tree protocol, wherein the topology information response messages carry the identifier of the query request device, the port information of the port of the device to be queried of all the devices to be queried participating in the spanning tree protocol calculation and the identifier of the device to be queried of the opposite port of the device to be queried.
2. The method of claim 1, wherein the inquiry request device identification comprises a MAC address of the inquiry request device; the device identifier to be queried of the opposite end port comprises the MAC address of the device to be queried of the opposite end port.
3. The method of claim 2, further comprising: the method comprises the steps of presetting a spanning tree port state table for storing port information of a port of query request equipment, which participates in spanning tree protocol calculation, of the query request equipment and an MAC address of equipment to be queried of an opposite port of the query request equipment, and a MAC address table for storing the MAC address of the query request equipment and the MAC address of the equipment to be queried of the opposite port of the query request equipment.
4. The method of claim 3, further comprising:
storing the port information of the port of the equipment to be queried, which is calculated by the spanning tree protocol of all the equipment to be queried, and the MAC address of the equipment to be queried of the opposite port of the equipment to be queried in a spanning tree port state table; and
and storing the MAC address of the equipment to be inquired of the opposite end port of the equipment port to be inquired into the MAC address table.
5. The method of claim 4, further comprising:
if receiving the topology information response messages returned by all the devices to be inquired identified by the MAC addresses in the MAC address table within the preset time, the inquiry is successful;
and if the topology information response messages returned by all the devices to be inquired identified by the MAC addresses in the MAC address table are not received within the preset time, the inquiry is failed.
6. The method according to any of claims 1 to 5, wherein the port information comprises port number, spanning tree instance number, port role and port status.
7. The method of any one of claims 1 to 5, wherein the spanning tree protocol for the spanning tree type identifier comprises STP, RSTP or MSTP.
8. An inquiry request apparatus, comprising:
the device comprises a request module, a topology information query module and a topology information query module, wherein the request module is used for sending a topology information request message to adjacent devices to be queried, and the topology information request message carries a spanning tree type, a query request device identifier and identifier information of all the devices to be queried so that the adjacent devices to be queried can forward the topology information request message to the next-stage adjacent devices to be queried;
an obtaining module, configured to receive a topology information response message returned by all the devices to be queried if a spanning tree protocol of the spanning tree type identifier is consistent with an operating spanning tree protocol, where the topology information response message carries the identifier of the query request device, port information of a port of the device to be queried, where all the devices to be queried participate in spanning tree protocol calculation, and a device identifier of an opposite port of the device to be queried.
9. The apparatus according to claim 8, further comprising: the device comprises a setting module and a processing module, wherein the setting module is used for presetting a spanning tree port state table for storing port information of a port of query request equipment, which participates in spanning tree protocol calculation, of the query request equipment and an MAC address of equipment to be queried of an opposite port of the query request equipment, and an MAC address table for storing the MAC address of the query request equipment and the MAC address of the equipment to be queried of the opposite port of the query request equipment.
10. The apparatus according to claim 8 or 9, further comprising:
the first processing module is used for storing the port information of the port of the device to be queried, which is calculated by the spanning tree protocol and is participated by all the devices to be queried, and the MAC address of the device to be queried of the opposite port of the device to be queried into a spanning tree port state table set by the setting module;
and the second processing module is used for storing the MAC address of the equipment to be inquired of the opposite end port of the equipment port to be inquired into the MAC address table set by the setting module.
11. An apparatus to be queried, comprising:
a receiving module, configured to receive a topology information request packet, where the topology information request packet carries a spanning tree type, an identifier of a query request device, and identifier information of all devices to be queried;
a forwarding module, configured to forward the topology information request packet to a next-level adjacent device to be queried according to the identification information of all the devices to be queried;
and the providing module is used for returning a topology information response message according to the identification information of all the equipment to be queried and if the spanning tree protocol of the spanning tree type identification is consistent with the running spanning tree protocol, wherein the topology information response message carries the query request equipment identification, the port information of the port of the equipment to be queried, calculated by the spanning tree protocol of all the equipment to be queried, and the equipment to be queried identification of the opposite port of the equipment to be queried.
12. A topology information discovery system is characterized by comprising an inquiry request device and a device to be inquired,
the query request device is configured to send a topology information request message to the adjacent to-be-queried device, where the topology information request message carries a spanning tree type, a query request device identifier, and identifier information of all to-be-queried devices, and respectively receive a topology information response message returned by all to-be-queried devices, where the topology information response message carries the query request device identifier, port information of a to-be-queried device port where all to-be-queried devices participate in spanning tree protocol calculation, and a to-be-queried device identifier of an opposite port of the to-be-queried device port;
the device to be queried is used for receiving the topology information request message, forwarding the topology information request message to a next-level adjacent device to be queried according to the identification information of all the devices to be queried, and returning the topology information response message if the spanning tree protocol of the spanning tree type identification is consistent with the running spanning tree protocol according to the identification information of all the devices to be queried.
CN2009102211186A 2009-11-03 2009-11-03 Method and system for finding topology information, query request device and awaiting query device Active CN101729351B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009102211186A CN101729351B (en) 2009-11-03 2009-11-03 Method and system for finding topology information, query request device and awaiting query device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009102211186A CN101729351B (en) 2009-11-03 2009-11-03 Method and system for finding topology information, query request device and awaiting query device

Publications (2)

Publication Number Publication Date
CN101729351A true CN101729351A (en) 2010-06-09
CN101729351B CN101729351B (en) 2012-01-25

Family

ID=42449617

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009102211186A Active CN101729351B (en) 2009-11-03 2009-11-03 Method and system for finding topology information, query request device and awaiting query device

Country Status (1)

Country Link
CN (1) CN101729351B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103051477A (en) * 2012-12-24 2013-04-17 中兴通讯股份有限公司 Network topology automatic acquisition method and system, and network management system
CN108833179A (en) * 2018-06-25 2018-11-16 郑州云海信息技术有限公司 A kind of generation method and device of mainframe network topology
CN109428824A (en) * 2017-08-28 2019-03-05 中国电信股份有限公司 Host Topology g eneration method and system
CN110868318A (en) * 2019-11-01 2020-03-06 咪咕文化科技有限公司 Method and device for generating network access relationship, electronic equipment and storage medium
CN112804141A (en) * 2018-09-06 2021-05-14 华为技术有限公司 Method for sending message, network equipment and computer storage medium
CN114827003A (en) * 2022-03-21 2022-07-29 浪潮思科网络科技有限公司 Topology election method, device, equipment and medium of distributed system
CN115942458A (en) * 2023-03-10 2023-04-07 广州世炬网络科技有限公司 Method and system for positioning communication node

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103051477A (en) * 2012-12-24 2013-04-17 中兴通讯股份有限公司 Network topology automatic acquisition method and system, and network management system
WO2013189414A2 (en) * 2012-12-24 2013-12-27 中兴通讯股份有限公司 Automatic network topology acquisition method and system, and network query and management system
WO2013189414A3 (en) * 2012-12-24 2014-02-13 中兴通讯股份有限公司 Automatic network topology acquisition method and system, and network query and management system
CN109428824A (en) * 2017-08-28 2019-03-05 中国电信股份有限公司 Host Topology g eneration method and system
CN108833179A (en) * 2018-06-25 2018-11-16 郑州云海信息技术有限公司 A kind of generation method and device of mainframe network topology
CN112804141A (en) * 2018-09-06 2021-05-14 华为技术有限公司 Method for sending message, network equipment and computer storage medium
CN112804141B (en) * 2018-09-06 2023-09-26 华为技术有限公司 Method for transmitting message, network equipment and computer storage medium
CN110868318A (en) * 2019-11-01 2020-03-06 咪咕文化科技有限公司 Method and device for generating network access relationship, electronic equipment and storage medium
CN110868318B (en) * 2019-11-01 2022-10-18 咪咕文化科技有限公司 Method and device for generating network access relation, electronic equipment and storage medium
CN114827003A (en) * 2022-03-21 2022-07-29 浪潮思科网络科技有限公司 Topology election method, device, equipment and medium of distributed system
CN114827003B (en) * 2022-03-21 2024-05-14 浪潮思科网络科技有限公司 Topology election method, device, equipment and medium of distributed system
CN115942458A (en) * 2023-03-10 2023-04-07 广州世炬网络科技有限公司 Method and system for positioning communication node

Also Published As

Publication number Publication date
CN101729351B (en) 2012-01-25

Similar Documents

Publication Publication Date Title
US11601296B2 (en) Bit indexed explicit replication for layer 2 networking
CN101729351B (en) Method and system for finding topology information, query request device and awaiting query device
CN104579954B (en) The cross-domain retransmission method of message, device and communication equipment
US20120106339A1 (en) Probing Specific Customer Flow in Layer-2 Multipath Networks
EP2264949A1 (en) Forwarding frames in a computer network using shortest path bridging
CN110798403B (en) Communication method, communication device and communication system
US20130259050A1 (en) Systems and methods for multi-level switching of data frames
US20110058551A1 (en) Methods and apparatus for managing multicast traffic through a switch
US20110058548A1 (en) Methods and apparatus for managing multicast traffic through a switch
US10791051B2 (en) System and method to bypass the forwarding information base (FIB) for interest packet forwarding in an information-centric networking (ICN) environment
US20070223494A1 (en) Method for the resolution of addresses in a communication system
CN110661701B (en) Communication method, equipment and system for avoiding loop
CN107426343B (en) Method, system and apparatus for proxying traffic within a subnet across multiple interfaces within a network
US11855888B2 (en) Packet verification method, device, and system
KR20220093155A (en) Packet forwarding method, first network device and first device group
JP7247351B2 (en) Data transmission method and equipment
US9503272B2 (en) Fast convergence with multicast source mobility
JP7322088B2 (en) Packet detection method and first network device
JP7273125B2 (en) Method and first network device for transmitting BIERv6 packets
CN107547691B (en) Address resolution protocol message proxy method and device
WO2018024189A1 (en) Loopback detection method and apparatus
KR20230022251A (en) BIER OAM detection method, device, and system
JP2021191000A (en) BIERV6 packet forwarding method, device, and system
CN112543142A (en) Method and device for realizing RSTP (remote site transport protocol) ring network protocol based on FPGA (field programmable gate array)
WO2014086242A1 (en) Multicast forwarding method and apparatus in multi-link transparent internet, and routing bridge

Legal Events

Date Code Title Description
C06 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
ASS Succession or assignment of patent right

Owner name: BEIJING Z-GOOD TECHNOLOGY SERVICE CO., LTD.

Free format text: FORMER OWNER: FUJIAN XINGWANGRUIJIE NETWORK CO., LTD.

Effective date: 20140513

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 350002 FUZHOU, FUJIAN PROVINCE TO: 100085 HAIDIAN, BEIJING

TR01 Transfer of patent right

Effective date of registration: 20140513

Address after: 100085 Beijing city Haidian District No. 33 Xiaoying Road 1 1F06 room

Patentee after: BEIJING ZHIGU TECHNOLOGY SERVICES CO., LTD.

Address before: Cangshan District of Fuzhou City, Fujian province 350002 Jinshan Road No. 618 Garden State Industrial Park building 19#

Patentee before: Fujian Xingwangruijie Network Co., Ltd.

EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20100609

Assignee: Fujian Xingwangruijie Network Co., Ltd.

Assignor: BEIJING ZHIGU TECHNOLOGY SERVICES CO., LTD.

Contract record no.: 2014990000767

Denomination of invention: Method and system for finding topology information, query request device and awaiting query device

Granted publication date: 20120125

License type: Common License

Record date: 20140924

LICC Enforcement, change and cancellation of record of contracts on the licence for exploitation of a patent or utility model