WO2021083208A1 - 网络拓扑发现方法及节点设备 - Google Patents

网络拓扑发现方法及节点设备 Download PDF

Info

Publication number
WO2021083208A1
WO2021083208A1 PCT/CN2020/124378 CN2020124378W WO2021083208A1 WO 2021083208 A1 WO2021083208 A1 WO 2021083208A1 CN 2020124378 W CN2020124378 W CN 2020124378W WO 2021083208 A1 WO2021083208 A1 WO 2021083208A1
Authority
WO
WIPO (PCT)
Prior art keywords
port
node device
child node
link
role
Prior art date
Application number
PCT/CN2020/124378
Other languages
English (en)
French (fr)
Inventor
沈利
魏含宇
胡寅亮
范多亮
吕云屏
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP20880534.1A priority Critical patent/EP4047877A4/en
Publication of WO2021083208A1 publication Critical patent/WO2021083208A1/zh
Priority to US17/731,686 priority patent/US11855875B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • H04L45/124Shortest path evaluation using a combination of metrics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/26Route discovery packet
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/42Centralised routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/48Routing tree calculation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports

Definitions

  • This application relates to the computer field, and in particular to a network topology discovery method and node equipment.
  • topology is the core of the entire network operation.
  • the number of network nodes increases, the number of ports increases exponentially, and it becomes very difficult to configure or discover the topology manually.
  • This application provides a network topology discovery method and node equipment to realize topology discovery.
  • a network topology discovery method including: sending a link discovery message to a child node device through a first port; receiving a link discovery message sent by the child node device through a second port of the child node device A response message, where the link discovery response message includes the identification of the child node device and the identification of the second port; and based on the link discovery response message, a first link is determined, and the first link is The link between the first port and the second port.
  • the node device When the node device detects that the link of the port is connected, it discovers the existing topological relationship through the exchange of messages, which can realize the discovery of the network topology.
  • the method further includes: before the sending the link discovery message to the child node device through the first port, the method further includes: detecting that the link corresponding to the first port is connected.
  • the link discovery can be triggered by the root node device detecting that the link corresponding to its own port is connected, and the root node device does not need to perform network topology discovery all the time.
  • the method further includes: based on the first link, instructing the child node device to set the second port as an uplink port.
  • At least one port of the child node device is an uplink port to facilitate communication with the root node device.
  • the instructing the child node device to set the second port as an uplink port based on the first link includes: sending a port role to the child node device through the first port Update message, the port role update message includes the identifier of the child node device, the identifier of the second port, and the role information of the second port, and the port role update message is used to instruct the child node device according to the Role setting is performed on the role information of the second port; and a port role update response message sent by the child node device through the second port is received.
  • the method further includes: if the child node device is the first discovered device, sending a device discovery message to the child node device through the first port, the device discovery message including the child node Device identification; and receiving a device discovery response message sent by the child node device through the second port, the device discovery response message including the identification of the child node device, the identification of all ports of the child node device, Status and port capabilities.
  • the root node device can learn about the identification, status, and port capabilities of all ports of the new device so as to communicate with the new device.
  • the first child node device is directly connected to the root node device, and the second child node device is not directly connected to the root node device, and the first port sends the message to the child node device.
  • the method further includes: receiving a port state change message sent by the first child node device, where the port state change message is used to indicate that the third port of the first child node device is There is a link connection between the fourth port of the second child node device.
  • the directly connected device When the directly connected device detects a change in the port status between the directly connected device and the indirectly connected device, the directly connected device reports to the root node device so that the root node device can discover the topological relationship with the indirectly connected device.
  • the link discovery message includes an identifier of at least one egress port
  • the port role update message includes an identifier of at least one egress port
  • the device discovery message includes an identifier of at least one egress port
  • the root node device When a child node device (which can be a directly connected device or a non-directly connected device) forwards a message, the root node device carries at least one outgoing port identifier in the message to indicate that the child node device forwards according to the outgoing port identifier without requiring itself Process the message.
  • the method further includes: when it is detected that the status of the first link changes, determining the child node device whose port role needs to be updated; The child node device sends a port role update message, the port role update message includes the identification of the outgoing port of the intermediate child node device between the root node device and the child node device whose role needs to be updated; and the port role update is received Reply to the message.
  • the role of the port of the child node device on the link can be re-modified through calculation to refresh the topology.
  • a network topology discovery method which includes: receiving a link discovery message sent by a root node device, where the link discovery message includes an identifier of a third port; The device forwards the link discovery message; receives a link discovery response message sent by the second child node device through the fourth port, where the link discovery response message includes the identifier of the second child node device and the fourth port And sending the link discovery response message to the root node device.
  • the method further includes: detecting that there is a link connection between the third port of the first child node device and the fourth port of the second child node device; and sending a port state change message to the root node device, The port status change message is used to indicate that the third port has a link connection
  • the method further includes: receiving a port role update message sent by the root node device, the port role update message including an identifier of the second child node device, an identifier of the third port, The identification of the fourth port and the role information of the fourth port, and the port role update message is used to instruct the second child node device to perform role setting according to the role information of the fourth port; Three ports send the port role update message to the second child node device; receive the port role update response message sent by the second child node device through the fourth port; and send the root node device Port role update response message.
  • the method further includes: if the second child node device is a first discovered device, receiving a device discovery message sent by the root node device, where the device discovery message includes the second child node device The identifier of the third port and the identifier of the third port; the device discovery message is sent to the second child node device through the third port; the device discovery message sent by the second child node device is received through the fourth port A response message, where the device discovery response message includes the identification of the second child node device, the identification, status, and port capabilities of all ports of the second child node device; and sending the device discovery to the root node device Reply to the message.
  • a network topology discovery method including: receiving a link discovery message sent by a root node device through a first port; and sending a link discovery response message to the root node device through a second port, the The link discovery response message includes the identifier of the child node device and the identifier of the second port.
  • the method further includes: receiving a port role update message sent by the root node device through the first port, the port role update message including the identifier of the child node device, and the identifier of the second port And the role information of the second port, the port role update message is used to instruct the child node device to perform role setting according to the role information of the second port; Performing role setting on the second port; and sending a port role update response message to the root node device through the second port.
  • the method further includes: if the child node device is the first discovered device, receiving a device discovery message sent by the root node device through the first port, where the device discovery message includes the child node device. An identifier of the node device; and sending a device discovery response message to the root node device through the second port, the device discovery response message including the identifier of the child node device, the identifiers of all ports of the child node device, Status and port capabilities.
  • the first child node device is directly connected to the root node device, and the second child node device is not directly connected to the root node device, and the method further includes: sending a port status to the root node device A change message, where the port state change message is used to indicate that there is a link connection between the third port of the first child node device and the fourth port of the second child node device.
  • the link discovery message includes an identifier of at least one egress port
  • the port role update message includes an identifier of at least one egress port
  • the device discovery message includes an identifier of at least one egress port
  • a node device is provided, and the node device is configured to implement the behavior function of the root node device in the foregoing first aspect or any one of the methods in the first aspect.
  • the function can be realized by hardware, or by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above-mentioned functions.
  • a seed node device is provided, and the child node device is used to implement the behavior function of the intermediate node device in the foregoing second aspect or any one of the implementation methods of the second aspect.
  • the function can be realized by hardware, or by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above-mentioned functions.
  • a seed node device is provided, and the child node device is used to implement the behavior function of the child node device in the foregoing third aspect or any one of the implementation methods of the third aspect.
  • the function can be realized by hardware, or by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above-mentioned functions.
  • a node device including: a processor and a physical interface, where the processor is configured to execute the foregoing first aspect or the method in any one of the first aspects.
  • a node device including: a processor and a physical interface, where the processor is configured to execute the foregoing second aspect or any one of the implementation methods of the second aspect.
  • a node device including: a processor and a physical interface, where the processor is configured to execute the foregoing third aspect or the method in any implementation of the third aspect.
  • a computer-readable storage medium stores instructions that, when run on a computer, cause the computer to execute the methods described in the above aspects.
  • a computer program product containing instructions which when run on a computer, causes the computer to execute the methods described in the above aspects.
  • a communication system including the above-mentioned node device.
  • FIG. 1 is a schematic diagram of a network topology architecture provided by an embodiment of this application.
  • Figure 2 is a schematic diagram of a specific example of an enterprise network topology architecture
  • FIG. 3 is a schematic flowchart of a network topology discovery method provided by an embodiment of this application.
  • FIG. 4 is a schematic flowchart of a network topology discovery method in a direct connection scenario provided by an embodiment of the application;
  • Figure 5 is a schematic diagram of an enterprise network topology architecture in a direct connection scenario
  • FIG. 6 is a schematic flowchart of a network topology discovery method in a non-direct connection scenario provided by an embodiment of the application;
  • Figure 7 is a schematic diagram of an enterprise network topology architecture in a non-direct connection scenario
  • FIG. 8 is a schematic flowchart of another network topology discovery method provided by an embodiment of this application.
  • FIG. 9 is a schematic diagram of an exemplary link state change
  • FIG. 10 is a schematic diagram of another example of a link state change
  • FIG. 11 is a schematic structural diagram of a node device provided by an embodiment of this application.
  • FIG. 12 is a schematic structural diagram of a sub-node device provided by an embodiment of this application.
  • FIG. 13 is a schematic structural diagram of yet another sub-node device provided by an embodiment of this application.
  • FIG. 14 is a schematic structural diagram of a node device provided by an embodiment of this application.
  • FIG. 1 is a schematic diagram of a network topology architecture provided by an embodiment of the application.
  • the network topology architecture includes a root node device (ROOT) 10, and one or more first sub-node devices 11 (only one first sub-node is illustrated in the figure). Device), and one or more second sub-node devices 12 (only one second sub-node device is illustrated in the figure).
  • ROOT root node device
  • the network topology architecture may also include more sub-node devices.
  • the root node device, the first child node device, and the second child node device have one or more ports.
  • the first port of the root node device is connected to the second port of the first child node device, and the third port of the first child node device is connected to the fourth port of the second child node device.
  • the root node device is directly connected to the first child node device; the second child node device is connected to the root node device through the first child node device, that is, the second child node device is not directly connected to the root node device.
  • the method in the embodiment of the present application can be applied to any network architecture, such as an enterprise network, a campus network, and a data center network.
  • FIG. 2 is a schematic diagram of a specific example of an enterprise network topology, in which the core switch serves as the ROOT switch of the entire network to discover the entire network topology.
  • the core switch serves as the ROOT switch of the entire network to discover the entire network topology.
  • any switch inside the network can be used as a ROOT, but generally the uppermost core switch has the strongest control plane capability.
  • the core switch is generally selected as the ROOT.
  • the core switch is connected to port 1 of aggregation switch (AGG) 1 through port 4
  • the core switch is connected to port 1 of aggregation switch 2 through port 5
  • port 4 of aggregation switch 1 is connected to the access switch.
  • the embodiment of the present application provides a network topology discovery solution to realize the automatic discovery of the above-mentioned network topology relationship.
  • FIG. 3 is a schematic flowchart of a network topology discovery method provided by an embodiment of this application, and the method may include:
  • the root node device sends a link discovery message to the child node device through the first port.
  • the child node device receives the link discovery message.
  • the root node device can be connected to one or more directly connected child node devices, and it can also be connected to one or more indirectly connected child node devices through the directly connected child node devices.
  • the child node device at the opposite end of the link to be discovered may be a directly connected child node device of the root node device, or an indirectly connected child node device of the root node device.
  • the root node device When there is a link between the root node device to be discovered and the child node device, the root node device sends a link discovery message to the child node device through the first port to execute the link discovery process.
  • the root node device Before S101, it may further include: detecting that the link corresponding to the first port is connected.
  • the root node device detects that the link corresponding to its first port is connected, the root node device is connected to the link directly connected to the child node device; when the root node device receives the port reported by the directly connected child node device When the status change message, the port corresponding to the directly connected child node device is connected, and the link between the directly connected child node device and the indirect child node device of the next layer is connected.
  • the root node device sends a link discovery message to the directly connected child node device, or sends a link discovery message to the indirectly connected child node device through the directly connected child node device that has been discovered.
  • the child node device sends a link discovery response message through the second port of the child node device.
  • the root node device receives the link discovery response message.
  • the child node device receives the above-mentioned link discovery message through the connected link (specifically through the second port), and parses the message type as a link discovery message.
  • the child node device constructs a link discovery response message, and the link discovery response message includes the identifier of the child node device and the identifier of the second port.
  • the child node device sends the link discovery response message through the second port. Specifically, if the directly connected child node device responds, the directly connected child node device sends the link discovery response message through the second port; if the non-directly connected child node device responds, the directly connected child node device passes the The discovered directly connected child node device sends the link discovery response message.
  • the root node device determines the first link based on the link discovery response message, where the first link is the link between the first port and the second port.
  • the root node device receives the above-mentioned link discovery response message through the connected link, analyzes the message type, and recognizes it as a link discovery response message.
  • the identification of the child node device and the identification of the second port are parsed, and the first link is determined.
  • the first link is the link between the first port and the second port.
  • the root node device instructs the child node device to set the second port as an uplink port based on the first link. For example, when the first link is a link in the shortest path (SPF) from the root node device to the child node device, the root node device instructs the child node device to set the second port as an uplink port. That is, the root node device calculates that the first link is on the shortest path through the shortest path, and the second port needs to be set as the uplink port.
  • SPF shortest path
  • the root node device may instruct the child node device to set the second port as an uplink port in other interaction messages.
  • the root node device may also set the second port as an uplink port through a separate interactive message child node device. Then the method may also include S104 to S106:
  • the root node device sends a port role update message to the child node device through the first port.
  • the child node device receives the port role update message.
  • the root node device sends a port role update message to the directly connected child node device, or sends a port role update message to the non-directly connected child node device through the directly connected child node device that has been discovered.
  • the port role update message includes the identifier of the child node device, the identifier of the second port, and the role information of the second port.
  • the port role update message is used to instruct the child node device to set the role according to the role information of the second port.
  • the port role update message is used to instruct the child node device to set the second port as an uplink port.
  • the child node device sets the role of the second port according to the role information of the second port.
  • the child node device After receiving the aforementioned port role update message, the child node device analyzes the message type and recognizes that the message is a port role update message. According to the role information of the second port carried in the message, the second port is an uplink port.
  • the child node device sends a port role update response message through the second port.
  • the root node device receives the port role update response message.
  • the port role update response message is sent to the root node device; if the response is a non-connected child node device, the port role update response message is forwarded through the directly connected node device .
  • the port role update response message is used to indicate the success or failure of port role setting.
  • the method may further include S107 to S108:
  • the root node device sends a device discovery message to the child node device through the first port, where the device discovery message includes the identifier of the child node device.
  • the child node device receives the device discovery message.
  • the root node device sends a device discovery message to the directly connected child node device, or forwards the device discovery message to the indirectly connected child node device through the directly connected child node device.
  • the child node device sends a device discovery response message through the second port.
  • the device discovery response message includes the identifier of the child node device, and the identifiers, status, and port capabilities of all ports of the child node device.
  • the root node device receives the device discovery response message.
  • the child node device After receiving the device discovery message, the child node device parses the message type, recognizes that the message type is a device discovery message, and constructs a device discovery response message.
  • the device response message carries the identification of the child node device, and the identification and status of all ports of the child node device (up/down) and capability (such as link bandwidth) and other device information.
  • the child node device sends the device sending response message to the root node device through the second port.
  • a network topology discovery method provided by an embodiment of the present application, when a node device detects that a link of a port is connected, the existing topology relationship is discovered through message interaction, and the discovery of the network topology can be realized.
  • FIG. 4 is a schematic flowchart of a method for discovering a network topology in a direct connection scenario according to an embodiment of the application. This embodiment is described with reference to the enterprise network topology architecture in the direct connection scenario shown in FIG. 5.
  • the root node device may be a core switch.
  • Two node devices, AGG1 and AGG2 are connected to the root node device, and ACC1 is connected to AGG1. Among them, the link between AGG1 and the root node device, and the link between AGG2 and the root node device are connected, but the root node device has not yet discovered the network topology relationship between the root node device and AGG1 and AGG2; ACC1 and AGG1 The link between is not yet connected.
  • the network topology discovery includes two stages: link discovery stage and device discovery stage.
  • the root node device finds that the links corresponding to its multiple downlink ports are connected, and according to the port serial number, it performs link discovery one by one. Specifically, the network topology discovery of a single link between the root node device and AGG1 is described as an example, and the network topology discovery of the link between the root node device and AGG2 is similar to this.
  • the root node device is connected to port 1 of AGG1 through port 1.
  • S201 The root node device sends a link discovery message from port 1.
  • the root node device can send a link discovery message through the link.
  • AGG1 at the other end of the link receives the link discovery message.
  • the root node device may also start a timer after sending a link discovery message from port 1, and wait for the node device to return a response message within the timing period.
  • AGG1 sends a link discovery response message through port 1 of AGG1.
  • AGG1 After AGG1 receives the link discovery message, it parses the message type field. If it is a link discovery message, it constructs a link discovery response message. The message carries the device identification of AGG1 and the identification of the receiving port AGG1.1, which is sent from AGG1.1 Link discovery response message.
  • the root node device discovers the link: ROOT device.1 ⁇ ->AGG1.1 according to the identification of port 1 of AGG1 and the identification of port 1 of the root node device.
  • the root node device After receiving the link discovery response message, the root node device parses the message type field and judges that it is a link discovery response message, obtains the device identification of AGG1 and the identification of the receiving port AGG1.1 carried in the message, and sends the link discovery message in combination
  • the port ROOT device.1 of the root node device of the device that is, the link ROOT device.1 ⁇ ->AGG1.1 is found.
  • the root node device may repeatedly initiate the link discovery process after the timing time has elapsed until it receives a link discovery response message, or until the number of retransmissions fails, and records the abnormality.
  • the root node device sends a port role update message.
  • the root node device After discovering the new link, the root node device uses the shortest path firsh (SPF) algorithm to calculate that the new link is on the shortest path, and then constructs a port role update message.
  • the port role update message carries the identification of the target device (the identification of AGG1), the identification of the target port (the identification of the port AGG1.1 of AGG1), and the role information of the target port (AGG1.1).
  • the root node device sends the port role update message to AGG1.
  • AGG1 sets port AGG1.1 as an uplink port according to the above-mentioned role information.
  • AGG1 After AGG1 receives the port role update message, it parses the message type field and finds that it is a port role update message. From the message, it parses out the identity of AGG1, the identity of the port AGG1.1 of AGG1, and the role information of AGG1.1. Compare the device ID with this device ID. If it is inconsistent, it means that the message is not sent to itself and is discarded; otherwise, the port indicated by the message is set to the indicated port role. In this example, the target port is AGG1.1, and the role of the target port is an uplink port, then AGG1 sets AGG1.1 as an uplink port.
  • AGG1 sends a port role update response message to the root node device.
  • AGG1 constructs a port role update response message, and sends the port role update response message to the root node device from the upstream port AGG1.1.
  • the root node device After the root node device receives the port role update response message, it indicates that the port role is set successfully, and records the successfully set uplink port.
  • S207 The root node device judges that the AGG1 at the opposite end of the link is a new device.
  • the root node device judges whether the link-to-terminal node device is a new device discovered for the first time, if not, it ends the network topology discovery process; if it is, it enters the device discovery phase.
  • AGG1 is the new device discovered for the first time.
  • S208 The root node device sends a device discovery message to AGG1.
  • the root node device sends a device discovery message through the local port ROOT device.1 of the newly discovered link, starts a timer, and waits for AGG1 to return a response message.
  • AGG1 sends a device discovery response message to the root node device.
  • AGG1 After receiving the device discovery message, AGG1 parses the message type, recognizes that the message type is a device discovery message, and constructs a device discovery response message.
  • the device response message carries the identification of AGG1, the identification, status (up/down) and status (up/down) of all ports of AGG1 Device information such as capabilities (such as link bandwidth).
  • AGG1 sends a response message from the device to the root node device from the upstream port AGG1.1.
  • the root node device After receiving the device response message, the root node device parses the message type, and after judging that the device discovery response message, parses the above device information carried in the message, records the device information, completes the device discovery, and refreshes the topology.
  • the root node device may repeatedly initiate the device discovery process after the timing time has elapsed until it receives a device discovery response message, or until the number of retransmissions fails, and records the exception.
  • a network topology discovery method provided by an embodiment of the present application, when the root node device detects that the link of the port is connected, the existing topology relationship is discovered through the exchange of messages, and the discovery of the network topology can be realized.
  • FIG. 6 is a schematic flowchart of a network topology discovery method in a non-direct connection scenario provided by an embodiment of the application. This embodiment is described with reference to the enterprise network topology architecture in the indirect connection scenario shown in FIG. 7.
  • the root node device may be a core switch.
  • Two node devices, AGG1 and AGG2 are connected to the root node device, and ACC1 is connected to AGG1.
  • the root node device On the link between AGG1 and the root node device, and the link between AGG2 and the root node device, the root node device has discovered the network topology relationship between the root node device and AGG1 and AGG2; between ACC1 and AGG1 The link between the root node device has been connected, but the root node device has not yet discovered the network topology relationship between the root node device and ACC1.
  • the network topology discovery includes two phases: the link discovery phase and the device discovery phase. Between the link discovery phases, the intermediate node device also reports the intermediate node device and the device to the root node device. The link between the node devices of the next layer is connected.
  • the intermediate node device is AGG1.
  • AGG1 detects that the link corresponding to its own port AGG1.4 is connected.
  • the directly connected device AGG1 detects the port status change (port AGG1.4 changes from the down state to the up state), that is, it detects that the link corresponding to AGG1.4 is connected.
  • port status change port AGG1.4 changes from the down state to the up state
  • the link corresponding to AGG1.4 is connected.
  • the link corresponding to AGG1.4 is connected: one is that it was not connected before and is now connected; the other is that the link between AGG1 and ACC1 is connected, but AGG1 and the root node device The link between is not connected.
  • the link between AGG1 and the root node device is now connected. Therefore, AGG1 can detect that the link corresponding to AGG1.4 is connected.
  • AGG1 sends a port state change message to the root node device.
  • AGG1 sends a port state change message to the root node device through an uplink port.
  • the port state change message carries the identity of AGG1, the identity of AGG1.4, and the state of AGG1.4 (up).
  • the root node device After receiving the above-mentioned port status change message, the root node device parses the message type, recognizes it as a port status change message, parses the AGG1 identifier, AGG1.4 identifier, and AGG1.4 status (up) carried in the message, and enters the chain Road discovery stage.
  • the root node device sends a link discovery message.
  • the link discovery message needs to be sent to the new device through AGG1.
  • the source routing method can be used: the root node device calculates the device that reports the port status change message (ie AGG1). ) (The root node device can also calculate the shortest path in advance. If there are multiple shortest paths, select one shortest path as the default path to send and receive control plane messages), and send the link discovery message from the port corresponding to AGG1.
  • the link discovery message carries the identifier of the out port AGG1.4, and can also carry the message type.
  • the link discovery message is sent from the ROOT device.1 port of the root node device.
  • AGG1 detects that the link discovery message has a next-level egress port, strips off the first-level port, and forwards the link discovery message.
  • the AGG1 After the AGG1 receives the link discovery message, it detects that the link discovery message carries the outgoing port number, removes the identification of the outgoing port, and forwards the link discovery message from the parsed outgoing port.
  • ACC1 finds that the link discovery message is sent to itself, and replies with a link discovery response message.
  • ACC1 receives the link discovery message through the connected link of ACC1 and AGG1, and analyzes the message type. If the message does not carry the port identifier, it means that the message should be processed by it. The analysis shows that the message type is a link discovery message , Construct a link discovery response message, the link discovery response message includes the identifier of ACC1 and the identifier of the port ACC1.1 of ACC1. ACC1 sends the link discovery response message from the receiving port.
  • the AGG1 node After receiving the above link discovery response message, the AGG1 node forwards the link discovery response message to the root node device according to the default port.
  • AGG1 After AGG1 receives the link discovery response message through the connected link of ACC1 and AGG1, it forwards the link discovery response message to the root node device according to the default uplink port. Among them, after the root node device discovers AGG1, one or more ports of AGG1 can be set as uplink ports, and one of the uplink ports can be set as the default port.
  • the root node device discovers the link ROOT device.1 ⁇ ->AGG1.1 ⁇ ->ACC1.1 according to the identifier of the ACC1.1 port and the discovered link ROOT device.1 ⁇ ->AGG1.1.
  • the root node device After the root node device receives the link discovery response message, it parses the message type, recognizes that the message is a link discovery response message, and parses out the ACC1 identifier and the port identifier of ACC1.1 carried in the link discovery response message, combined with the existing link discovery response message. Discover the topology (ROOT equipment.1 ⁇ ->AGG1.1), then complete the discovery link: ROOT equipment.1 ⁇ ->AGG1.1 ⁇ ->ACC1.1.
  • the root node device may repeatedly initiate the link discovery process after the timing time has elapsed until it receives a link discovery response message, or until the number of retransmissions fails, and records the abnormality.
  • the root node device calculates that the link is on the shortest path.
  • the root node device uses the SPF algorithm to calculate that the link is on the shortest path (currently, because ACC1 has only one link connected to the discovered network, it is the shortest path), so the root node device needs to set the uplink port of ACC1.
  • the root node device sends a port role update message.
  • the root node device constructs a port role update message.
  • the port role update message carries the identifier of ACC1, the identifier of ACC1.1, and the role information of ACC1.1 (in this example, the indication is set to the upstream port), and then the outbound port (AGG1) is encapsulated along the way. .4), the port role update message is sent through source routing.
  • AGG1 detects that the link discovery message has a next-level egress port, strips the first-level port, and forwards the port role update message to ACC1.
  • AGG1 After receiving the port role update message, AGG1 detects that the message carries the outgoing port number, parses out the port number, removes the identification of the outgoing port, and forwards the port role update message from the parsed outgoing port.
  • ACC1 sets ACC1.1 as an uplink port according to the port role update message.
  • ACC1 After ACC1 receives the port role update message, if the message does not carry the out port identifier, it means that the message should be processed by it (in this example, there is only one out port identifier, which has been removed by AGG1, so the message is processed by ACC1) . ACC1 parses out that the message type is a port role update message, and sets ACC1.1 as an uplink port according to the updated role information indicated.
  • ACC1 constructs a port role update response message, which is used to indicate that the setting has been successful, and sends the message through the uplink port.
  • the AGG1 node After receiving the port role update response message, the AGG1 node forwards the port role update response message according to the default port.
  • the root node device After the root node device receives the port role update response message, it records the uplink port.
  • the root node device judges that the ACC1 at the opposite end of the link is a new device.
  • the root node device judges whether the link-to-terminal node device is a new device discovered for the first time, if not, it ends the network topology discovery process; if it is, it enters the device discovery phase.
  • ACC1 is a new device discovered for the first time.
  • the root node device sends a device discovery message, and the device discovery message carries the identifier of AGG1.4.
  • the device discovery message is sent through source routing: the root node device constructs a device discovery message, then encapsulates the identification of the outgoing port along the way (identification of AGG1.4), and then routes it through the source Send the device discovery message in the same way.
  • AGG1 detects that the link discovery message has the next-level outgoing port, strips off the first-level port, and forwards the device discovery message.
  • the discovery message carries the identification of the outgoing port, resolves the identification of the outgoing port, removes the identification of the outgoing port, and forwards the device discovery message from the resolved outgoing port.
  • the device discovery response message includes the identification of ACC1 and the identification, status and capability of all ports of ACC1.
  • ACC1 After ACC1 receives the device discovery message from the above outgoing port, it detects that the message does not carry the outgoing port identifier, indicating that this message should be processed by it (in this example, there is only one outgoing port identifier, which has been removed by AGG1, so the message Processed by ACC1). ACC1 parses out that the message type is a device discovery message, constructs a device discovery response message, and carries device information: the identification of ACC1, the identification, status (up/down) and capabilities (such as link bandwidth) of all ports of ACC1, etc., from the above uplink ACC1.4 sends the device discovery response message.
  • the AGG1 node After receiving the device discovery response message of ACC1, the AGG1 node forwards the device discovery response message according to the default port.
  • the root node device records device information, completes device registration, and refreshes the topology.
  • the root node device may repeatedly initiate the device discovery process after the timing time has elapsed until it receives a device discovery response message, or until the number of retransmissions fails, and records the exception.
  • the topology discovery is initiated by the root node device centrally, and the child node devices only do simple responses and the most basic status report.
  • the calculation and state maintenance are all supported by the root node device, and the child node devices are extremely controlled. simple.
  • the intermediate node device when the intermediate node device detects that the link with the port of the next layer node device is connected, it reports to the root node device, and the root node device discovers through message interaction
  • the topology relationship existing between the root node device and the next layer node device of the intermediate node device can realize the discovery of the network topology.
  • FIG. 8 is a method flowchart of another network topology discovery method provided by an embodiment of the application, and the method may include:
  • the root node device When the root node device detects that the link status corresponding to its own port has changed, or the link corresponding to the port of the non-directly connected child node device reported has changed, it can determine the new shortest path through SPF calculation. The root node device determines the second link that can reach the child node device whose link status has changed, and determines the child node device whose port role needs to be updated.
  • the root node device sends a port role update message.
  • the directly connected node device before the change may be updated to a non-directly connected node device. Therefore, it needs to be forwarded through other directly connected node devices and/or non-directly connected node devices (referred to as "intermediate node devices") Port role update message.
  • the root node device constructs a port role update message, and the port role update message carries the identification of the outgoing port of the intermediate child node device, the identification of the target port, and the role information of the target port.
  • the target port is the port of the role to be updated.
  • the intermediate child node device detects that the port role update message has a next-level egress port, strips off the port of one layer, and forwards the port role update message to the child node device of the next layer.
  • the intermediate node device receives the port role update message and detects that the message includes the identification of the outgoing port. Therefore, the identification of the outgoing port is parsed, the identification of the outgoing port of the intermediate node device is removed, and the message is forwarded from the analyzed outgoing port. .
  • the child node device receives the port role update message, detects that the message does not include the identifier of the outgoing port, and can determine that the message should be processed by itself. Therefore, the role of the target port is updated according to the role information of the target port carried in the message.
  • S405 The child node device sends a port role update response message.
  • the child node device After the child node device updates the role of the target port, it constructs a port role update response message.
  • the response message is used to indicate the success or failure of the role update.
  • the intermediate node device After receiving the port role update response message, the intermediate node device forwards the port role response message according to the default port.
  • the root node device After the root node device receives the response, it records the port role as a downstream port.
  • the root node device detects a directly connected link status change (the link of ROOT.4 ⁇ ->AGG1.1 is disconnected), and the SPF algorithm is used to calculate The shortest path.
  • the root node device found through calculation that the devices that have changed on the shortest path are ACC1, ACC2, and AGG1, and the devices that need to modify the port roles are ACC2 and AGG1.
  • AGG1.7 ⁇ —>ACC2.1 is one of the shortest paths.
  • ACC2 can interact with the root node device and AGG1 through the uplink port ACC2.1, but now ROOT.4 ⁇ —> The link between AGG1.1 is disconnected, and the shortest path from the root node device to ACC2 needs to be recalculated, and the role of ACC2.1 needs to be updated. Since ACC2 is a non-directly connected device of the root node device, the port role update message is sent through source routing.
  • the root node device constructs a port role update message, which carries the identification of the target device (identification of ACC2), the identification of the target port (identification of ACC2.1) and role information, and then encapsulates the identification of the outbound port along the way (outgoing port AGG2 of AGG2). .8), sent to ACC2 through source routing.
  • AGG2 finds that the message carries the identification of the outgoing port, it parses the identification of the outgoing port, removes the identification of the outgoing port, and forwards the message from the parsed outgoing port.
  • ACC2 detects that the message does not carry the port identifier, indicating that this message should be processed by it.
  • ACC2 parses that the type of the message is a port role update message, further parses the target port and role information therein, and updates the target port (ACC2.1) to a downstream port. ACC2 constructs a port role update response message and sends the message from the upstream port. AGG2 receives the message, and forwards the message to the root node device through the uplink port. This message is used to indicate the success or failure of the role update. The root node device receives the message. If the message indicates that the role update is successful, it means that this operation is successful; if the message indicates that the role update has failed, it means that this operation has failed.
  • the port bitmap of ACC2 includes the bitmap of the port status and the bitmap of the link connection.
  • the port identifiers are ACC2.1, ACC2.2...ACC2.10 from right to left.
  • the bit "0" indicates that the port is a downstream port
  • the bit "1" indicates that the port is an upstream port.
  • ACC2.1 is updated from the upstream port to the downstream port, and the port status value of ACC2.1 is updated from bit "1" to bit “0"; in the same way, the same role can be performed on ACC2.2
  • the ACC2.2 is updated from the downstream port to the upstream port, and the port status value of ACC2.2 is updated from bit "0" to bit "1".
  • the bit "0" indicates that the link corresponding to the port is not connected, and the bit "1" indicates that the link corresponding to the port is connected.
  • the links of ports ACC2.1, ACC2.2, ACC2.6, and ACC2.9 are connected, and the bit value corresponding to these ports is "1".
  • FIG. 10 another schematic diagram of link status change, ROOT.4 ⁇ —>AGG1.1 link port, the recalculated shortest path from the root node device to AGG1 is ROO.5 ⁇ —>AGG2 .1, AGG2.8 ⁇ —>ACC2.2, ACC2.1 ⁇ —>AGG1.7, and the role of AGG1.7 before the link is disconnected is the downlink port. Therefore, according to the calculated new shortest path, the role of AGG1.7 needs to be updated.
  • the AGG1 changes from a directly connected device to a non-directly connected device of the root node device. Therefore, the root node device sends a port role update message by way of source routing.
  • the root node device constructs a port role update message, which carries the identification of the target device (identification of AGG1), the identification of the target port (identification of AGG1.7), and role information. Then encapsulate the identifiers of the outbound ports (AGG2.8, ACC2.1) along the way, and send the message to AGG1 by way of source routing. After AGG2 receives the message, it finds that the message carries the identification of the outgoing port, analyzes the identification of the outgoing port, removes the identification of AGG2.8, and forwards the message from the analyzed outgoing port AGG2.8.
  • ACC2 After receiving the message, ACC2 finds that the message carries the identification of the outgoing port, analyzes the identification of the outgoing port, removes the identification of ACC2.1, and forwards the message from the analyzed outgoing port ACC2.1.
  • AGG1 receives the message and detects that the message does not carry the port identifier, indicating that the message should be processed by it, and parses that the type of the message is a port role update message, and then parses out the target port and role information, according to For this role information, AGG1.7 is updated as an uplink port.
  • AGG1 constructs a port role update response message and sends it from the uplink port; the downlink port of ACC2 receives the response message and forwards it to AGG2 through the uplink port; the downlink port of AGG2 receives the response message and forwards it to the root node device through the uplink port.
  • the response message is used to indicate the success or failure of the role update.
  • the root node device receives the response message. If the response message indicates that the role update is successful, it indicates that the operation is successful and the topology is refreshed; if the response message indicates that the role update failed, it indicates that the operation has failed.
  • the port bitmap of AGG1 includes the bitmap of the port status and the bitmap of the link connection.
  • the port identifiers are AGG1.1, AGG1.2...AGG1.10 from right to left.
  • the bit "0" indicates that the port is a downstream port
  • the bit "1" indicates that the port is an upstream port.
  • the same role update operation can also be performed to change AGG1.1 from When the upstream port is updated to the downstream port, the port status value of AGG1.1 is updated from bit "1" to bit "0".
  • the bit "0" indicates that the link corresponding to the port is not connected
  • the bit "1” indicates that the link corresponding to the port is connected.
  • the links of the ports AGG1.4 and AGG1.7 are connected, and the bit value corresponding to these ports is "1".
  • the role of the port of the child node device on the link can be re-modified through calculation to refresh the topology structure.
  • an embodiment of the present application also provides a node device 1000, which can be applied to the foregoing FIG. 3, FIG. 4, FIG. 6, and FIG.
  • the network topology method shown in 8 may be the root node device in the above-mentioned network topology discovery method.
  • the node device 1000 includes a sending unit 11, a receiving unit 12, and a determining unit 13, and may also include a detecting unit 14 and an indicating unit 15. Exemplary:
  • the sending unit 11 is configured to send a link discovery message to the child node device through the first port;
  • the receiving unit 12 is configured to receive a link discovery response message sent by the child node device through the second port of the child node device, where the link discovery response message includes the identifier of the child node device and the second The identification of the port;
  • the determining unit 13 is configured to determine a first link based on the link discovery response message, where the first link is a link between the first port and the second port.
  • the detection unit 14 is configured to detect that the link corresponding to the first port is connected.
  • the instruction unit 15 is configured to instruct the child node device to set the second port as an uplink port based on the first link.
  • the sending unit 11 is configured to send a port role update message to the child node device through the first port, where the port role update message includes the identifier of the child node device, and the second port And the role information of the second port, the port role update message is used to instruct the child node device to perform role setting according to the role information of the second port;
  • the receiving unit 12 is configured to receive a port role update response message sent by the child node device through the second port.
  • the sending unit 11 is configured to send a device discovery message to the child node device through the first port if the child node device is a device discovered for the first time, and the device discovery message includes the The identification of the child node device;
  • the receiving unit 12 is configured to receive a device discovery response message sent by the child node device through the second port, where the device discovery response message includes the identifier of the child node device, and all ports of the child node device The identification, status, and port capabilities of the device.
  • the first child node device is directly connected to the root node device
  • the second child node device is not directly connected to the root node device
  • the receiving unit 12 is configured to receive the first child node device.
  • a port state change message sent by the device where the port state change message is used to indicate that there is a link connection between the third port of the first child node device and the fourth port of the second child node device.
  • the link discovery message includes an identifier of at least one egress port
  • the port role update message includes an identifier of at least one egress port
  • the device discovery message includes an identifier of at least one egress port
  • the determining unit 13 is further configured to determine the child node device whose port role needs to be updated when the status of the first link is detected to change;
  • the sending unit 11 is configured to send a port role update message to the child node device that needs to update the role through the second link, where the port role update message includes the root node device and the role that needs to be updated.
  • the receiving unit 12 is configured to receive a port role update response message.
  • the root node device when the root node device detects that the link of the port is connected, the existing topology relationship is discovered through the interaction of messages, and the discovery of the network topology can be realized.
  • an embodiment of the present application also provides a sub-node device 2000, which can be applied to the foregoing FIG. 3, FIG. 4, and FIG. 6, In the network topology method shown in Figure 8.
  • the child node device 2000 includes: a receiving unit 21, a sending unit 22, and may also include a detecting unit 23. Exemplary:
  • the receiving unit 21 is configured to receive a link discovery message sent by a root node device, where the link discovery message includes an identifier of the third port;
  • the sending unit 22 is configured to forward the link discovery message to the second child node device through the third port;
  • the receiving unit 21 is further configured to receive a link discovery response message sent by the second child node device through a fourth port, where the link discovery response message includes the identifier of the second child node device and the fourth port Logo;
  • the sending unit 22 is further configured to send the link discovery response message to the root node device.
  • the detection unit 23 is configured to detect that there is a link connection between the third port of the first child node device and the fourth port of the second child node device;
  • the sending unit 22 is configured to send a port state change message to the root node device, where the port state change message is used to indicate that the third port has a link connection.
  • the receiving unit 21 is configured to receive a port role update message sent by the root node device, where the port role update message includes the identifier of the second child node device, and the port role update message of the third port An identifier, an identifier of the fourth port and role information of the fourth port, and the port role update message is used to instruct the second child node device to perform role setting according to the role information of the fourth port;
  • the sending unit 22 is configured to send the port role update message to the second child node device through the third port;
  • the receiving unit 21 is further configured to receive a port role update response message sent by the second child node device through the fourth port;
  • the sending unit 22 is further configured to send the port role update response message to the root node device.
  • the receiving unit 21 is configured to receive a device discovery message sent by the root node device if the second child node device is the first discovered device, and the device discovery message includes the second child node device.
  • the sending unit 22 is configured to send the device discovery message to the second child node device through the third port;
  • the receiving unit 21 is further configured to receive, through the fourth port, a device discovery response message sent by the second child node device, where the device discovery response message includes the identifier of the second child node device, and the first The identification, status and port capabilities of all ports of the two child node devices; and
  • the sending unit 22 is further configured to send the device discovery response message to the root node device.
  • the node device when the node device detects that the link of the port is connected, the existing topology relationship is discovered through the interaction of messages, which can realize the discovery of the network topology.
  • an embodiment of the present application also provides a node device 3000, which can be applied to the foregoing FIG. 3, FIG. 4, FIG. 6, and FIG. In the network topology method shown in 8.
  • the node device 3000 includes: a receiving unit 31 and a sending unit 32; and may also include a setting unit 33. Exemplary:
  • the receiving unit 31 is configured to receive a link discovery message sent by the root node device through the first port;
  • the sending unit 32 is configured to send a link discovery response message to the root node device through a second port, where the link discovery response message includes the identifier of the child node device and the identifier of the second port.
  • the receiving unit 31 is configured to receive a port role update message sent by the root node device through the first port, where the port role update message includes the identifier of the child node device, and the second port And role information of the second port, and the port role update message is used to instruct the child node device to perform role setting according to the role information of the second port;
  • the setting unit 33 is configured to set the role of the second port according to the role information of the second port;
  • the sending unit 32 is configured to send a port role update response message to the root node device through the second port.
  • the receiving unit 31 is configured to receive a device discovery message sent by the root node device through the first port if the child node device is a device discovered for the first time, and the device discovery message includes all The identification of the child node device;
  • the sending unit 32 is configured to send a device discovery response message to the root node device through the second port, where the device discovery response message includes the identifier of the child node device, the identifiers of all ports of the child node device, Status and port capabilities.
  • the first child node device is directly connected to the root node device
  • the second child node device is not directly connected to the root node device
  • the sending unit 32 is configured to send to the root node device A port state change message, where the port state change message is used to indicate that there is a link connection between the third port of the first child node device and the fourth port of the second child node device.
  • the link discovery message includes an identifier of at least one egress port
  • the port role update message includes an identifier of at least one egress port
  • the device discovery message includes an identifier of at least one egress port
  • the node device when the node device detects that the link of the port is connected, the existing topology relationship is discovered through the interaction of messages, and the discovery of the network topology can be realized.
  • FIG. 14 is a schematic structural diagram of a node device provided by an embodiment of this application.
  • the node device 4000 includes a physical interface 41 and a processor 42.
  • the physical interface 41 is used to send and receive messages.
  • the processor 42 is configured to execute the method steps performed by the root node device, the intermediate node device, or the target child node device in Fig. 3, Fig. 4, Fig. 6, and Fig. 8.
  • the number of physical interfaces 41 may be one or more.
  • the physical interface 41 may include a wireless interface and/or a wired interface.
  • the wireless interface may include a WLAN interface, a Bluetooth interface, a cellular network interface or any combination thereof.
  • the wired interface may include an Ethernet interface, an asynchronous transfer mode interface, a fiber channel interface, or any combination thereof.
  • the Ethernet interface can be an electrical interface or an optical interface.
  • the physical interface 41 does not necessarily include (although usually includes) an Ethernet interface.
  • the number of processors 42 may be one or more.
  • the processor 42 includes a central processing unit, a network processor, a graphics processing unit (GPU), an application specific integrated circuit, a programmable logic device, or any combination thereof.
  • the above-mentioned PLD may be a complex programmable logic device, a field programmable gate array, a general array logic or any combination thereof.
  • the processor 42 may include a control plane 421 and a forwarding plane 422.
  • the control plane 421 and the forwarding plane 422 can be implemented by independent circuits, or can be integrated into one circuit.
  • the processor 42 is a multi-core CPU. One or some of the multiple cores implement the control plane 421, and the other cores implement the forwarding plane 422.
  • control plane 421 is implemented by a CPU
  • the forwarding plane 422 is implemented by NP, ASIC, FPGA or any combination thereof.
  • the node device is a box-type network device
  • control plane 421 is implemented by a main control card
  • the forwarding plane 422 is implemented by a line card.
  • both the control plane 421 and the forwarding plane 422 are implemented by NPs with control plane capabilities.
  • the disclosed system, device, and method may be implemented in other ways.
  • the division of the unit is only a logical function division. In actual implementation, there can be other divisions.
  • multiple units or components can be combined or integrated into another system, or some features can be ignored or not. carried out.
  • the displayed or discussed mutual coupling, or direct coupling, or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software it can be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium.
  • the computer instructions can be sent from a website, computer, server, or data center to another via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) A website, computer, server or data center for transmission.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center integrated with one or more available media.
  • the usable medium can be read-only memory (ROM), random access memory (RAM), or magnetic media, such as floppy disks, hard disks, magnetic tapes, magnetic disks, or optical media, for example, Digital versatile disc (DVD) or semiconductor media, for example, solid state disk (SSD), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

本申请公开了一种网络拓扑发现方法及节点设备。在本申请中,根节点设备通过第一端口向子节点设备发送链路发现消息;接收该子节点设备通过该子节点设备的第二端口发送的链路发现应答消息,该链路发现应答消息包括该子节点设备的标识和该第二端口的标识;以及基于该链路发现应答消息,确定第一链路,该第一链路为该第一端口与该第二端口之间的链路。采用本申请的方案,在节点设备检测到端口的链路被连接上时,通过消息的交互发现存在的拓扑关系,可以实现网络拓扑的发现。

Description

网络拓扑发现方法及节点设备
本申请要求于2019年10月31日提交中国国家知识产权局、申请号为201911053346.7、发明名称为“网络拓扑发现方法及节点设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机领域,尤其涉及一种网络拓扑发现方法及节点设备。
背景技术
随着网络规模的增大,基于拓扑的网络应用场景越来越多,因此,拓扑是整个网络运营的核心。但随着网络节点数的增多,端口数量成倍增加,使用人工方式来配置或发现拓扑变得十分困难。
发明内容
本申请提供一种网络拓扑发现方法及节点设备,以实现拓扑发现。
第一方面,提供了一种网络拓扑发现方法,包括:通过第一端口向子节点设备发送链路发现消息;接收所述子节点设备通过所述子节点设备的第二端口发送的链路发现应答消息,所述链路发现应答消息包括所述子节点设备的标识和所述第二端口的标识;以及基于所述链路发现应答消息,确定第一链路,所述第一链路为所述第一端口与所述第二端口之间的链路。
在节点设备检测到端口的链路被连接上时,通过消息的交互发现存在的拓扑关系,可以实现网络拓扑的发现。
在一个实现中,所述方法还包括:所述通过第一端口向子节点设备发送链路发现消息之前,所述方法还包括:检测到所述第一端口对应的链路已连接上。
链路的发现可以是根节点设备在检测到自身端口对应的链路已连接上而触发的,根节点设备无需时刻进行网络拓扑发现。
在又一个实现中,所述方法还包括:基于所述第一链路,指示所述子节点设备将所述第二端口设置为上行口。
对于发现的网络拓扑,需要指示子节点设备的至少一个端口为上行口,以便于与根节点设备进行通信。
在又一个实现中,所述基于所述第一链路,指示所述子节点设备将所述第二端口设置为上行口,包括:通过所述第一端口向所述子节点设备发送端口角色更新消息,所述端口角色更新消息包括所述子节点设备的标识,第二端口的标识和所述第二端口的角色信息,所述端口角色更新消息用于指示所述子节点设备根据所述第二端口的角色信息进行角色设置;以及接收所述子节点设备通过所述第二端口发送的端口角色更新应答消息。
在又一个实现中,所述方法还包括:若所述子节点设备为首次发现设备,通过所述第一端口向所述子节点设备发送设备发现消息,所述设备发现消息包括所述子节点设备的标 识;以及接收所述子节点设备通过所述第二端口发送的设备发现应答消息,所述设备发现应答消息包括所述子节点设备的标识,所述子节点设备的所有端口的标识、状态和端口能力。
通过设备发现,根节点设备可以了解该新设备的所有端口的标识、状态和端口能力,以便与该新设备进行通信。
在又一个实现中,第一子节点设备与所述根节点设备直连,第二子节点设备与所述根节点设备非直连,所述通过所述第一端口向所述子节点设备发送链路发现消息之前,所述方法还包括:接收所述第一子节点设备发送的端口状态变化消息,所述端口状态变化消息用于指示所述第一子节点设备的第三端口与所述第二子节点设备的第四端口之间存在链路连接。
当直连设备检测到与非直连设备之间的端口状态发生变化时,直连设备上报给根节点设备,以使根节点设备发现与该非直连设备之间的拓扑关系。
在又一个实现中,所述链路发现消息包括至少一个出端口的标识,所述端口角色更新消息包括至少一个出端口的标识,以及所述设备发现消息包括至少一个出端口的标识。
由子节点设备(可以是直连设备或非直连设备)转发消息时,根节点设备在消息中携带至少一个出端口的标识,以表示该子节点设备按照出端口的标识进行转发,而无需自身处理该消息。
在又一个实现中,所述方法还包括:当检测到所述第一链路的状态发生变化时,确定需更新端口角色的子节点设备;通过所述第二链路向所述需要更新角色的子节点设备发送端口角色更新消息,所述端口角色更新消息包括所述根节点设备与所述需要更新角色的子节点设备之间的中间子节点设备的出端口的标识;以及接收端口角色更新应答消息。
当根节点设备检测到链路状态发生变化时,可以通过计算重新修改链路上的子节点设备的端口的角色,刷新拓扑结构。
第二方面,提供了一种网络拓扑发现方法,包括:接收根节点设备发送的链路发现消息,所述链路发现消息包括第三端口的标识;通过所述第三端口向第二子节点设备转发所述链路发现消息;接收所述第二子节点设备通过第四端口发送的链路发现应答消息,所述链路发现应答消息包括所述第二子节点设备的标识和第四端口的标识;以及向所述根节点设备发送所述链路发现应答消息。
在一个实现中,所述方法还包括:检测到第一子节点设备的第三端口与第二子节点设备的第四端口之间存在链路连接;以及向根节点设备发送端口状态变化消息,所述端口状态变化消息用于指示所述第三端口存在链路连接
在又一个实现中,所述方法还包括:接收所述根节点设备发送的端口角色更新消息,所述端口角色更新消息包括所述第二子节点设备的标识,所述第三端口的标识,所述第四端口的标识和所述第四端口的角色信息,所述端口角色更新消息用于指示所述第二子节点设备根据所述第四端口的角色信息进行角色设置;通过所述第三端口向所述第二子节点设备发送所述端口角色更新消息;通过所述第四端口接收所述第二子节点设备发送的端口角色更新应答消息;以及向所述根节点设备发送所述端口角色更新应答消息。
在又一个实现中,所述方法还包括:若所述第二子节点设备为首次发现设备,接收所 述根节点设备发送的设备发现消息,所述设备发现消息包括所述第二子节点设备的标识和所述第三端口的标识;通过所述第三端口向所述第二子节点设备发送所述设备发现消息;通过所述第四端口接收所述第二子节点设备发送的设备发现应答消息,所述设备发现应答消息包括所述第二子节点设备的标识,所述第二子节点设备的所有端口的标识、状态和端口能力;以及向所述根节点设备发送所述设备发现应答消息。
第三方面,提供了一种网络拓扑发现方法,包括:接收根节点设备通过第一端口发送的链路发现消息;以及通过第二端口向所述根节点设备发送链路发现应答消息,所述链路发现应答消息包括所述子节点设备的标识和所述第二端口的标识。
在一个实现中,所述方法还包括:接收所述根节点设备通过所述第一端口发送的端口角色更新消息,所述端口角色更新消息包括所述子节点设备的标识,第二端口的标识和所述第二端口的角色信息,所述端口角色更新消息用于指示所述子节点设备根据所述第二端口的角色信息进行角色设置;根据所述第二端口的角色信息,对所述第二端口进行角色设置;以及通过第二端口向所述根节点设备发送端口角色更新应答消息。
在又一个实现中,所述方法还包括:若所述子节点设备为首次发现设备,接收所述根节点设备通过所述第一端口发送的设备发现消息,所述设备发现消息包括所述子节点设备的标识;以及通过所述第二端口向所述根节点设备发送设备发现应答消息,所述设备发现应答消息包括所述子节点设备的标识,所述子节点设备的所有端口的标识、状态和端口能力。
在又一个实现中,第一子节点设备与所述根节点设备直连,第二子节点设备与所述根节点设备非直连,所述方法还包括:向所述根节点设备发送端口状态变化消息,所述端口状态变化消息用于指示所述第一子节点设备的第三端口与所述第二子节点设备的第四端口之间存在链路连接。
在又一个实现中,所述链路发现消息包括至少一个出端口的标识,所述端口角色更新消息包括至少一个出端口的标识,以及所述设备发现消息包括至少一个出端口的标识。
第四方面,提供了一种节点设备,该节点设备用于实现上述第一方面或第一方面的任一个实现中的方法中根节点设备的行为功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。
第五方面,提供了一种子节点设备,该子节点设备用于实现上述第二方面或第二方面的任一个实现中的方法中中间节点设备的行为功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。
第六方面,提供了一种子节点设备,该子节点设备用于实现上述第三方面或第三方面的任一个实现中方法中子节点设备的行为功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。
第七方面,提供了一种节点设备,包括:处理器和物理接口,所述处理器用于执行上述第一方面或第一方面的任一个实现中的方法。
第八方面,提供了一种节点设备,包括:处理器和物理接口,所述处理器用于执行上述第二方面或第二方面的任一个实现中的方法。
第九方面,提供了一种节点设备,包括:处理器和物理接口,所述处理器用于执行上 述第三方面或第三方面的任一个实现中的方法。
第十方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。
第十一方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。
第十二方面,提供了一种通信系统,包括上述的节点设备。
附图说明
图1为本申请实施例提供的一种网络拓扑架构示意图;
图2为具体示例的一种企业网络拓扑架构示意图;
图3为本申请实施例提供的一种网络拓扑发现方法的流程示意图;
图4为本申请实施例提供的直连场景下的一种网络拓扑发现方法的流程示意图;
图5为直连场景下的企业网络拓扑架构示意图;
图6为本申请实施例提供的非直连场景下的一种网络拓扑发现方法的流程示意图;
图7为非直连场景下的企业网络拓扑架构示意图;
图8为本申请实施例提供的又一种网络拓扑发现方法的流程示意图;
图9为示例的一种链路状态变化的示意图;
图10为示例的又一种链路状态变化的示意图;
图11为本申请实施例提供的一种节点设备的结构示意图;
图12为本申请实施例提供的一种子节点设备的结构示意图;
图13为本申请实施例提供的又一种子节点设备的结构示意图;
图14为本申请实施例提供的一种节点设备的结构示意图。
具体实施方式
下面结合本发明实施例中的附图对本发明实施例进行描述。
图1为本申请实施例提供的一种网络拓扑架构示意图,该网络拓扑架构包括根节点设备(ROOT)10、一个或多个第一子节点设备11(图中仅示例了一个第一子节点设备)、以及一个或多个第二子节点设备12(图中仅示例了一个第二子节点设备),当然,该网络拓扑架构还可以包括更多的子节点设备。其中,根节点设备、第一子节点设备和第二子节点设备具有一个或多个端口。在该示例中,根节点设备的第一端口连接第一子节点设备的第二端口,第一子节点设备的第三端口连接第二子节点设备的第四端口。根节点设备与第一子节点设备直连;第二子节点设备通过第一子节点设备连接至根节点设备,即第二子节点设备与根节点设备非直连。
本申请实施例的方法可应用于任何网络架构,例如企业网、园区网、数据中心网络等。
图2为具体示例的一种企业网络拓扑架构示意图,其中的核心交换机作为整网的ROOT交换机来发现整网拓扑。理论上网络内部任意一台交换机都可以作为ROOT,但一般最上层的核心交换机控制面能力最强,作为ROOT的节点对控制面有一定的要求,所以一般选择核心交换机作为ROOT。当有多个核心交换机时,可任意选择一台配置成ROOT,或者 通过一些选举算法从多个核心交换机中选出作为ROOT的交换机。在该示例中,核心交换机通过端口4连接至汇聚交换机(aggregation switch,AGG)1的端口1,核心交换机通过端口5连接至汇聚交换机2的端口1,汇聚交换机1的端口4连接至接入交换机(access switch,ACC)1的端口1,汇聚交换机1的端口7连接至接入交换机2的端口1,汇聚交换机2的端口8连接至接入交换机2的端口2,终端设备A连接至接入交换机A的端口3,以及终端设备B连接至接入交换机2的端口6。以上网络拓扑仅为示例。
本申请实施例提供一种网络拓扑发现方案,以实现自动发现上述网络拓扑关系。
下面通过一些具体的实施例进行详细描述。
图3为本申请实施例提供的一种网络拓扑发现方法的流程示意图,该方法可以包括:
S101、根节点设备通过第一端口向子节点设备发送链路发现消息。
相应地,子节点设备接收该链路发现消息。
如前所示的系统架构图,根节点设备可以连接一个或多个直连子节点设备,也可以通过直连子节点设备连接一个或多个非直连子节点设备。待发现链路对端的子节点设备可以是根节点设备的直连子节点设备,也可以是根节点设备的非直连子节点设备。
在当存在待发现的根节点设备与子节点设备之间的链路时,根节点设备通过第一端口向子节点设备发送链路发现消息,以执行链路发现流程。
在S101之前,还可以包括:检测到所述第一端口对应的链路已连接上。当根节点设备检测到自身的第一端口对应的链路被连接上时,则根节点设备与直连子节点设备的链路连接上;当根节点设备接收到直连子节点设备上报的端口状态变化消息时,则该直连子节点设备对应的端口被连接上,该直连子节点设备与下一层的非直连子节点设备的链路连接上。根节点设备向该直连子节点设备发送链路发现消息,或通过已发现的直连子节点设备向非直连子节点设备发送链路发现消息。
S102、子节点设备通过子节点设备的第二端口发送链路发现应答消息。
相应地,根节点设备接收该链路发现应答消息。
子节点设备通过已连接的链路(具体是通过第二端口)接收到上述链路发现消息,解析该消息类型为链路发现消息。子节点设备构造链路发现应答消息,链路发现应答消息包括子节点设备的标识和第二端口的标识。子节点设备通过第二端口发送该链路发现应答消息。具体地,如果是直连子节点设备进行应答,则直连子节点设备通过第二端口发送该链路发现应答消息;如果是非直连子节点设备进行应答,则非直连子节点设备通过已发现的直连子节点设备发送该链路发现应答消息。
S103、根节点设备基于链路发现应答消息,确定第一链路,第一链路为第一端口与第二端口之间的链路。
根节点设备通过已连接的链路接收到上述链路发现应答消息,解析消息类型,识别为链路发现应答消息。解析出其中的子节点设备的标识和第二端口的标识,确定第一链路,第一链路为第一端口与第二端口之间的链路。
进一步地,根节点设备基于第一链路,指示子节点设备将第二端口设置为上行口。例如,当第一链路为从根节点设备到子节点设备的最短路径(shortest path firsh,SPF)中的链路时,根节点设备指示子节点设备将第二端口设置为上行口。即根节点设备通过最短路 径计算出该第一链路在最短路径上,则需要设置第二端口为上行口。
具体地,在一个实现中,根节点设备可以在其它的交互消息中指示子节点设备将第二端口设置为上行口。
在又一个实现中,根节点设备也可以通过单独的交互消息子节点设备将第二端口设置为上行口。则该方法还可以包括S104~S106:
S104、根节点设备通过第一端口向子节点设备发送端口角色更新消息。
相应地,子节点设备接收该端口角色更新消息。
根节点设备向直连子节点设备发送端口角色更新消息,或通过已发现的直连子节点设备向非直连子节点设备发送端口角色更新消息。该端口角色更新消息包括子节点设备的标识,第二端口的标识和第二端口的角色信息,端口角色更新消息用于指示子节点设备根据第二端口的角色信息进行角色设置。在本实施例中,端口角色更新消息用于指示子节点设备设置第二端口为上行口。
S105、子节点设备根据第二端口的角色信息,对第二端口进行角色设置。
子节点设备接收到上述端口角色更新消息后,解析消息类型,识别该消息为端口角色更新消息。根据该消息中携带的第二端口的角色信息,将第二端口为上行端口。
S106、子节点设备通过第二端口发送端口角色更新应答消息。
相应地,根节点设备接收该端口角色更新应答消息。
具体地,如果进行应答的是直连子节点设备,则发送该端口角色更新应答消息给根节点设备;如果进行应答的是非连子节点设备,则通过直连节点设备转发该端口角色更新应答消息。该端口角色更新应答消息用于指示端口角色设置成功或失败。
若子节点设备为首次发现设备,则进一步地,该方法还可以包括S107~S108:
S107、根节点设备通过第一端口向子节点设备发送设备发现消息,设备发现消息包括子节点设备的标识。
相应地,子节点设备接收该设备发现消息。
根节点设备向直连子节点设备发送设备发现消息,或通过直连子节点设备转发该设备发现消息给非直连子节点设备。
S108、子节点设备通过第二端口发送设备发现应答消息,设备发现应答消息包括子节点设备的标识,子节点设备的所有端口的标识、状态和端口能力。
相应地,根节点设备接收该设备发现应答消息。
子节点设备收到设备发现消息后,解析消息类型,识别出消息类型为设备发现消息,构造设备发现应答消息,该设备应答消息携带子节点设备的标识,子节点设备的所有端口的标识、状态(up/down)和能力(例如链路带宽)等设备信息。子节点设备从第二端口发送该设备发送应答消息给根节点设备。
根据本申请实施例提供的一种网络拓扑发现方法,在节点设备检测到端口的链路被连接上时,通过消息的交互发现存在的拓扑关系,可以实现网络拓扑的发现。
下面分别从直连场景和非直连场景对上述网络拓扑发现方法进行详细描述:
图4为本申请实施例提供的直连场景下的一种网络拓扑发现方法的流程示意图。本实 施例结合图5所示的直连场景下的企业网络拓扑架构进行描述。在图5中,该根节点设备可以是核心交换机,该根节点设备下连接有AGG1和AGG2两个节点设备,AGG1下又连接有ACC1。其中,AGG1与根节点设备之间的链路、以及AGG2与根节点设备之间的链路连接上,但根节点设备尚未发现根节点设备与AGG1、AGG2之间的网络拓扑关系;ACC1和AGG1之间的链路尚未连接。
该网络拓扑发现包括两个阶段:链路发现阶段和设备发现阶段。
链路发现阶段:
根节点设备发现自身多个下行端口对应的链路被连接上,依照端口序号,逐一进行链路发现。具体以根节点设备与AGG1之间的单个链路的网络拓扑关系发现为例进行描述,根节点设备与AGG2之间的链路的网络拓扑发现与此相似。
其中,根节点设备通过端口1与AGG1的端口1连接。
S201、根节点设备从端口1发送链路发现消息。
由于根节点设备的端口1与AGG1的端口1之间的链路已连接上,因此,根节点设备可以通过该链路发送链路发现消息。相应地,该链路另一端的AGG1接收该链路发现消息。
具体地,根节点设备还可以从端口1发送链路发现消息后启动定时器,在计时时间内等待节点设备返回应答消息。
S202、AGG1通过AGG1的端口1发送链路发现应答消息。
AGG1接收到链路发现消息后,解析消息类型字段,若为链路发现消息,则构造链路发现应答消息,消息中携带AGG1的设备标识和接收端口AGG1.1的标识,从AGG1.1发出链路发现应答消息。
S203、根节点设备根据AGG1的端口1的标识和根节点设备的端口1的标识,发现链路:ROOT设备.1<->AGG1.1。
根节点设备接收到链路发现应答消息后,解析消息类型字段,判断为链路发现应答消息,获取该消息中携带的AGG1的设备标识和接收端口AGG1.1的标识,结合发送链路发现消息的根节点设备的端口ROOT设备.1,即发现了链路ROOT设备.1<->AGG1.1。
若根节点设备未收到链路发现应答消息,则可能的原因有:对端节点设备未收到链路发现消息,对端子节点设备不支持此种消息类型,子节点设备返回的链路发现应答消息未被根节点设备接收到。则根节点设备可以在计时时间到达之后重复发起该链路发现流程,直到接收到链路发现应答消息,或者超过重发次数失败为止,记录异常。
S204、根节点设备发送端口角色更新消息。
发现新链路后,根节点设备通过最短路径(shortest path firsh,SPF)算法,计算出新链路在最短路径上,则构造端口角色更新消息。该端口角色更新消息携带目标设备的标识(AGG1的标识),目标端口的标识(AGG1的端口AGG1.1的标识)以及目标端口(AGG1.1)的角色信息。根节点设备向AGG1发送该端口角色更新消息。
S205、AGG1根据上述角色信息设置端口AGG1.1为上行口。
AGG1接收到该端口角色更新消息后,解析消息类型字段,发现为端口角色更新消息,从消息中解析出AGG1的标识,AGG1的端口AGG1.1的标识以及AGG1.1的角色信息,将解析出来的设备标识与本设备标识进行比较,如不一致,则表示该消息不是发送给自身, 作丢弃处理;否则,将该消息所指示的端口设置成指示的端口角色。本示例中,目标端口为AGG1.1,目标端口角色为上行口,则AGG1将AGG1.1设置成上行口。
S206、AGG1向根节点设备发送端口角色更新应答消息。
AGG1构造端口角色更新应答消息,从上述上行口AGG1.1发送该端口角色更新应答消息给根节点设备。
根节点设备收到该端口角色更新应答消息后,表示端口角色设置成功,记录设置成功的上行口。
S207、根节点设备判断链路对端的AGG1为新设备。
根节点设备判断链路对端子节点设备是否为首次发现的新设备,若否,则结束该网络拓扑发现流程;若是,进入设备发现阶段。在本实施例中,AGG1为首次发现的新设备。
设备发现阶段:
S208、根节点设备向AGG1发送设备发现消息。
根节点设备通过新发现链路的本端端口ROOT设备.1发送设备发现消息,并启动定时器,等待AGG1返回应答消息。
S209、AGG1向根节点设备发送设备发现应答消息。
AGG1收到设备发现消息后,解析消息类型,识别出消息类型为设备发现消息,构造设备发现应答消息,该设备应答消息携带AGG1的标识,AGG1的所有端口的标识、状态(up/down)和能力(例如链路带宽)等设备信息。AGG1从上行口AGG1.1发送该设备发送应答消息给根节点设备。
根节点设备接收到该设备应答消息后,解析消息类型,判断为设备发现应答消息后,解析消息中携带的上述设备信息,记录设备信息,完成设备发现,刷新拓扑。
若根节点设备未收到设备发现应答消息,则可能的原因有:对端节点设备未收到设备发现消息,对端子节点设备不支持此种消息类型,子节点设备返回的设备发现应答消息未被根节点设备接收到。则根节点设备可以在计时时间到达之后重复发起该设备发现流程,直到接收到设备发现应答消息,或者超过重发次数失败为止,记录异常。
根据本申请实施例提供的一种网络拓扑发现方法,在根节点设备检测到端口的链路被连接上时,通过消息的交互发现存在的拓扑关系,可以实现网络拓扑的发现。
图6为本申请实施例提供的非直连场景下的一种网络拓扑发现方法的流程示意图。本实施例结合图7所示的非直连场景下的企业网络拓扑架构进行描述。在图7中,该根节点设备可以是核心交换机,该根节点设备下连接有AGG1和AGG2两个节点设备,AGG1下又连接有ACC1。其中,AGG1与根节点设备之间的链路、以及AGG2与根节点设备之间的链路连接上,根节点设备已发现根节点设备与AGG1、AGG2之间的网络拓扑关系;ACC1和AGG1之间的链路已连接,但根节点设备尚未发现根节点设备与ACC1之间的网络拓扑关系。
与直联场景下的网络拓扑发现不同,该网络拓扑发现除了包括链路发现阶段和设备发现阶段两个阶段,在链路发现阶段之间,中间节点设备还向根节点设备上报中间节点设备与下一层节点设备之间的链路被连接上。
在图7中,中间节点设备为AGG1。
S301、AGG1检测到自身端口AGG1.4对应的链路被连接上。
已经被发现的直连设备AGG1检测到端口状态变化(端口AGG1.4从down状态变为up状态),即检测到AGG1.4对应的链路被连接上。AGG1.4对应的链路被连接上有两种情况:一种是之前没连接上,现连接上;另一种情况是AGG1与ACC1之间的链路已连接上,但AGG1与根节点设备之间的链路未连接上,在上述实施例中,AGG1与根节点设备之间的链路现已连接上,因此,AGG1可以检测到AGG1.4对应的链路被连接上。
S302、AGG1向根节点设备发送端口状态变化消息。
AGG1通过一个上行口向根节点设备发送端口状态变化消息,该端口状态变化消息携带AGG1的标识,AGG1.4的标识,以及AGG1.4的状态(up)。
根节点设备收到上述端口状态变化消息后,解析消息类型,识别为端口状态变化消息,解析消息中携带的AGG1的标识,AGG1.4的标识,以及AGG1.4的状态(up),进入链路发现阶段。
链路发现阶段:
S303’、根节点设备发送链路发现消息。
与前述实施例中的链路发现不同的是,本实施例中,链路发现消息需要经过AGG1发往新设备,可采用源路由方式:根节点设备计算上报端口状态变化消息的设备(即AGG1)的最短路径(根节点设备也可以提前计算好该最短路径,如果存在多条最短路径,则选择一条最短路径作为默认路径收发控制面消息),从AGG1对应的端口发送链路发现消息,该链路发现消息携带出端口AGG1.4的标识,还可以携带消息类型。从根节点设备的ROOT设备.1端口发送该链路发现消息。
S303”、AGG1检测到链路发现消息有下一层出端口,剥离一层端口,并转发链路发现消息。
AGG1接收到链路发现消息后,检测到该链路发现消息携带了出端口号,去除出端口的标识,从解析出的该出端口转发该链路发现消息。
S304’、ACC1发现该链路发现消息发给自身,回复链路发现应答消息。
ACC1通过ACC1与AGG1已连接的链路接收到该链路发现消息,解析消息类型,如果消息中不携带出端口的标识,说明此消息应由它来处理,解析出消息类型为链路发现消息,构造链路发现应答消息,该链路发现应答消息包括ACC1的标识和ACC1的端口ACC1.1的标识。ACC1从接收端口发送该链路发现应答消息。
S304”、AGG1节点接收到上述链路发现应答消息后,按照默认端口转发该链路发现应答消息给根节点设备。
AGG1通过ACC1与AGG1已连接的链路接收到该链路发现应答消息后,按照默认的上行端口转发该链路发现应答消息给根节点设备。其中,根节点设备发现AGG1后,可以设置AGG1的一个或多个端口为上行口,并可以设置其中一个上行口为默认端口。
S305、根节点设备根据ACC1.1端口的标识以及已发现的链路ROOT设备.1<->AGG1.1,发现链路ROOT设备.1<->AGG1.1<->ACC1.1。
根节点设备接收到链路发现应答消息后,解析消息类型,识别出该消息为链路发现应 答消息,解析出该链路发现应答消息携带的ACC1的标识和ACC1.1的端口标识,结合已经发现的拓扑(ROOT设备.1<->AGG1.1),则完成发现链路:ROOT设备.1<->AGG1.1<->ACC1.1。
若根节点设备未收到链路发现应答消息,则可能的原因有:对端节点设备未收到链路发现消息,对端子节点设备不支持此种消息类型,子节点设备返回的链路发现应答消息未被根节点设备接收到。则根节点设备可以在计时时间到达之后重复发起该链路发现流程,直到接收到链路发现应答消息,或者超过重发次数失败为止,记录异常。
S306、根节点设备计算出该链路在最短路径上。
根节点设备通过SPF算法计算出该链路在最短路径上(当前因为ACC1只有一条链路连接到已发现的网络,所以是最短路径),因此根节点设备需要设置ACC1的上行口。
S307’、根节点设备发送端口角色更新消息。
根节点设备构造端口角色更新消息,该端口角色更新消息携带ACC1的标识,ACC1.1的标识,以及ACC1.1的角色信息(此例中指示设置为上行口),再封装沿途出端口(AGG1.4的标识),通过源路由的方式发送该端口角色更新消息。
S307”、AGG1检测到链路发现消息有下一层出端口,剥离一层端口,并转发端口角色更新消息给ACC1。
AGG1接收到该端口角色更新消息后,检测到该消息中携带了出端口号,解析出端口号,去除出端口的标识,从解析出的出端口转发该端口角色更新消息。
S308、ACC1根据该端口角色更新消息,设置ACC1.1为上行口。
ACC1接收到该端口角色更新消息后,如果消息中不携带出端口的标识,说明此消息应由它来处理(本例中只有一个出端口的标识,已被AGG1去除,所以消息由ACC1处理)。ACC1解析出消息类型为端口角色更新消息,根据所指示更新的角色信息,设置ACC1.1为上行口。
S309’、ACC1发送端口角色更新应答消息。
ACC1构造端口角色更新应答消息,该消息用于指示已经设置成功,通过该上行口发送该消息。
S309”、AGG1节点接收到上述端口角色更新应答消息后,按照默认端口转发该端口角色更新应答消息。
根节点设备收到该端口角色更新应答消息后,记录上行口。
S310、根节点设备判断链路对端的ACC1为新设备。
根节点设备判断链路对端子节点设备是否为首次发现的新设备,若否,则结束该网络拓扑发现流程;若是,进入设备发现阶段。在本实施例中,ACC1为首次发现的新设备。
设备发现阶段:
S311’、根节点设备发送设备发现消息,该设备发现消息携带AGG1.4的标识。
由于该新设备为根节点的非直连设备,通过源路由的方式发送设备发现消息:根节点设备构造设备发现消息,再封装沿途出端口的标识(AGG1.4的标识),然后通过源路由的方式发送该设备发现消息。
S311”、AGG1检测到链路发现消息有下一层出端口,剥离一层端口,并转发设备发现 消息。
AGG1接收到该设备发现消息后,发现消息中携带了出端口的标识,解析出端口的标识,去除出端口的标识,从解析的出端口转发该设备发现消息。
S312’、ACC1发送设备发现应答消息,该设备发现应答消息包括ACC1的标识,ACC1的所有端口的标识、状态和能力。
ACC1从上述出端口接收到设备发现消息后,检测到该消息中不携带出端口的标识,说明此消息应由它来处理(本示例中只有一个出端口的标识,已被AGG1去除,所以消息由ACC1处理)。ACC1解析出消息类型为设备发现消息,构造设备发现应答消息,携带设备信息:ACC1的标识,ACC1的所有端口的标识、状态(up/down)和能力(如链路带宽)等,从上述上行口ACC1.4发送该设备发现应答消息。
S312”、AGG1节点接收到ACC1的设备发现应答消息后,按照默认端口转发该设备发现应答消息。
S313、根节点设备记录设备信息,完成设备注册,刷新拓扑。
若根节点设备未收到设备发现应答消息,则可能的原因有:对端节点设备未收到设备发现消息,对端子节点设备不支持此种消息类型,子节点设备返回的设备发现应答消息未被根节点设备接收到。则根节点设备可以在计时时间到达之后重复发起该设备发现流程,直到接收到设备发现应答消息,或者超过重发次数失败为止,记录异常。
因此,在本实施例中,通过根节点设备集中发起拓扑发现,子节点设备只做简单的应答和最基础的状态报备,计算、状态维护都由根节点设备支持,子节点设备控制面极简。
根据本申请实施例提供的一种网络拓扑发现方法,在中间节点设备检测到与下一层节点设备的端口的链路被连接上时,上报给根节点设备,根节点设备通过消息的交互发现根节点设备与中间节点设备的下一层节点设备之间存在的拓扑关系,可以实现网络拓扑的发现。
当根节点设备检测到链路状态发生变化时,可以通过计算重新修改链路上的子节点设备的端口的角色。图8为本申请实施例提供的又一种网络拓扑发现方法的方法流程图,该方法可以包括:
S401、当检测到第一链路状态发生变化时,根节点设备确定需更新端口角色的子节点设备。
当根节点设备检测到自身端口对应的链路状态发生变化,或接收到上报的非直连子节点设备的端口对应的链路发生变化时,可以通过SPF计算确定新的最短路径。根节点设备确定可以到达链路状态发生变化的子节点设备的第二链路,并确定需更新端口角色的子节点设备。
S402、根节点设备发送端口角色更新消息。
由于重新确定了最短路径,变化前的直连节点设备可能更新为非直连节点设备,因此,需要通过其它直连节点设备和/或非直连节点设备(称为“中间节点设备”)转发端口角色更新消息。根节点设备构造端口角色更新消息,该端口角色更新消息携带中间子节点设备的出端口的标识,目标端口的标识以及目标端口的角色信息。该目标端口为待更新角色的端 口。
S403、中间子节点设备检测到端口角色更新消息有下一层出端口,剥离一层端口,并转发端口角色更新消息给下一层的子节点设备。
中间节点设备接收到该端口角色更新消息,检测到该消息中包括出端口的标识,因此,解析出端口的标识,去除该中间节点设备的出端口的标识,从解析出的出端口转发该消息。
S404、子节点设备根据该端口角色更新消息,更新端口角色。
最终,子节点设备接收到该端口角色更新消息,检测到该消息中不包括出端口的标识,可以确定该消息应由自身处理。因此,根据该消息中携带的目标端口的角色信息,更新目标端口的角色。
S405、子节点设备发送端口角色更新应答消息。
子节点设备更新目标端口的角色后,构造端口角色更新应答消息。该应答消息用于指示角色更新成功或失败。
S406、中间节点设备接收到上述端口角色更新应答消息后,按照默认端口转发端口角色应答消息。
根节点设备收到应答后,记录端口角色为下行口。
具体地,如图9所示的一种链路状态变化的示意图,根节点设备检测到直连链路状态变化(ROOT.4<->AGG1.1的链路断开),使用SPF算法计算出最短路径。根节点设备通过计算发现最短路径上发生变化的设备是ACC1、ACC2、AGG1,需要修改端口角色的设备为ACC2、AGG1。
具体地,ROOT.4<—>AGG1.1、AGG1.7<—>ACC2.1为其中一条最短路径,ACC2可以通过上行口ACC2.1与根节点设备、AGG1进行交互,但现在ROOT.4<—>AGG1.1之间的链路断开,则需要重新计算根节点设备到ACC2的最短路径,而ACC2.1的角色需要更新。由于ACC2为根节点设备的非直连设备,则通过源路由的方式发送端口角色更新消息。根节点设备构造端口角色更新消息,该消息携带目标设备的标识(ACC2的标识)、目标端口的标识(ACC2.1的标识)和角色信息,再封装沿途出端口的标识(AGG2的出端口AGG2.8),通过源路由的方式发送给ACC2。AGG2收到消息后,发现消息中携带了出端口的标识,则解析出端口的标识,去除出端口的标识,从解析的出端口转发该消息。ACC2接收到该消息后,检测到该消息中不携带出端口的标识,说明此消息应由它来处理。ACC2解析出该消息的类型为端口角色更新消息,进一步解析出其中的目标端口和角色信息,将目标端口(ACC2.1)更新为下行口。ACC2构造端口角色更新应答消息,从上行口发送该消息。AGG2收到该消息,通过上行口转发该消息至根节点设备。该消息用于指示角色更新成功或失败。根节点设备接收该消息,如果该消息指示角色更新成功,则表示本次操作成功;如果该消息指示角色更新失败,则表示本次操作失败。
如图9所示,ACC2的端口位图中,包括端口状态的位图和链路连接的位图。其中,在端口状态的位图和链路连接的位图中,端口的标识从右到左依次为ACC2.1、ACC2.2…ACC2.10。其中,在端口状态的位图中,比特“0”表示该端口为下行口,比特“1”表示该端口为上行口。通过上述角色更新操作,ACC2.1由上行口更新为下行口,则ACC2.1的端口状态值由比特“1”更新为比特“0”;同样的,也可以对ACC2.2执行同样的角色更新操 作,将ACC2.2由下行口更新为上行口,ACC2.2的端口状态值由比特“0”更新为比特“1”。在链路连接的位图中,比特“0”表示该端口对应的链路未连接,比特“1”表示该端口对应的链路已连接。当前,端口ACC2.1、ACC2.2、ACC2.6、ACC2.9的链路已连接,则这些端口对应的比特值为“1”。
如图10所示的又一种链路状态变化的示意图,ROOT.4<—>AGG1.1的链路端口,重新计算出的根节点设备到AGG1的最短路径为ROO.5<—>AGG2.1、AGG2.8<—>ACC2.2、ACC2.1<—>AGG1.7,而AGG1.7在链路断开前的角色为下行口。因此,根据计算出的新的最短路径,需要更新AGG1.7的角色。由于发生链路断开事件后,AGG1由直连设备变为根节点设备的非直连设备,因此,根节点设备通过源路由的方式发送端口角色更新消息。根节点设备构造端口角色更新消息,该消息携带目标设备的标识(AGG1的标识)、目标端口的标识(AGG1.7的标识)和角色信息。再封装沿途出端口的标识(AGG2.8、ACC2.1),通过源路由的方式发送该消息给AGG1。AGG2收到消息后,发现该消息携带了出端口的标识,解析出端口的标识,去除AGG2.8的标识,从解析出的出端口AGG2.8转发该消息。ACC2收到该消息后,发现该消息携带了出端口的标识,解析出端口的标识,去除ACC2.1的标识,从解析出的出端口ACC2.1转发该消息。AGG1接收到该消息,检测到该消息中不携带出端口的标识,说明此消息应由它来处理,并且解析出该消息的类型为端口角色更新消息,再解析出目标端口和角色信息,根据该角色信息,将AGG1.7更新为上行口。AGG1构造端口角色更新应答消息,从上行口发出;ACC2下行口接收到该应答消息,通过上行口转发至AGG2;AGG2下行口接收到该应答消息,通过上行口转发至根节点设备。该应答消息用于指示角色更新成功或失败。根节点设备接收该应答消息,如果该应答消息指示角色更新成功,则表示本次操作成功,刷新拓扑结构;如果该应答消息指示角色更新失败,则表示本次操作失败。
如图10所示,AGG1的端口位图中,包括端口状态的位图和链路连接的位图。其中,在端口状态的位图和链路连接的位图中,端口的标识从右到左依次为AGG1.1、AGG1.2…AGG1.10。其中,在端口状态的位图中,比特“0”表示该端口为下行口,比特“1”表示该端口为上行口。通过上述角色更新操作,AGG1.7的端口状态值由比特“0”更新为比特“1”,而AGG1.1对应的链路断开,也可以执行同样的角色更新操作,将AGG1.1由上行口更新为下行口,则AGG1.1的端口状态值由比特“1”更新为比特“0”。在链路连接的位图中,比特“0”表示该端口对应的链路未连接,比特“1”表示该端口对应的链路已连接。当前,端口AGG1.4、AGG1.7的链路已连接,则这些端口对应的比特值为“1”。
根据本申请实施例提供的一种网络拓扑发现方法,当根节点设备检测到链路状态发生变化时,可以通过计算重新修改链路上的子节点设备的端口的角色,刷新拓扑结构。
基于上述实施例中的网络拓扑发现方法的同一构思,如图11所示,本申请实施例还提供一种节点设备1000,该节点设备1000可应用于上述图3、图4、图6、图8所示的网络拓扑方法中,可以是上述网络拓扑发现方法中的根节点设备。该节点设备1000包括:发送单元11、接收单元12和确定单元13,还可以包括检测单元14、指示单元15。示例性的:
发送单元11,用于通过第一端口向子节点设备发送链路发现消息;
接收单元12,用于接收所述子节点设备通过所述子节点设备的第二端口发送的链路发现应答消息,所述链路发现应答消息包括所述子节点设备的标识和所述第二端口的标识;以及
确定单元13,用于基于所述链路发现应答消息,确定第一链路,所述第一链路为所述第一端口与所述第二端口之间的链路。
在一个实现中,检测单元14,用于检测到所述第一端口对应的链路已连接上。
在又一个实现中,指示单元15,用于基于所述第一链路,指示所述子节点设备将所述第二端口设置为上行口。
在又一个实现中,所述发送单元11,用于通过所述第一端口向所述子节点设备发送端口角色更新消息,所述端口角色更新消息包括所述子节点设备的标识,第二端口的标识和所述第二端口的角色信息,所述端口角色更新消息用于指示所述子节点设备根据所述第二端口的角色信息进行角色设置;以及
所述接收单元12,用于接收所述子节点设备通过所述第二端口发送的端口角色更新应答消息。
在又一个实现中,所述发送单元11,用于若所述子节点设备为首次发现设备,通过所述第一端口向所述子节点设备发送设备发现消息,所述设备发现消息包括所述子节点设备的标识;以及
所述接收单元12,用于接收所述子节点设备通过所述第二端口发送的设备发现应答消息,所述设备发现应答消息包括所述子节点设备的标识,所述子节点设备的所有端口的标识、状态和端口能力。
在又一个实现中,第一子节点设备与所述根节点设备直连,第二子节点设备与所述根节点设备非直连,所述接收单元12,用于接收所述第一子节点设备发送的端口状态变化消息,所述端口状态变化消息用于指示所述第一子节点设备的第三端口与所述第二子节点设备的第四端口之间存在链路连接。
在又一个实现中,所述链路发现消息包括至少一个出端口的标识,所述端口角色更新消息包括至少一个出端口的标识,以及所述设备发现消息包括至少一个出端口的标识。
在又一个实现中,所述确定单元13,还用于当检测到所述第一链路的状态发生变化时,确定需更新端口角色的子节点设备;
所述发送单元11,用于通过所述第二链路向所述需要更新角色的子节点设备发送端口角色更新消息,所述端口角色更新消息包括所述根节点设备与所述需要更新角色的子节点设备之间的中间子节点设备的出端口的标识;以及
所述接收单元12,用于接收端口角色更新应答消息。
有关上述各单元更详细的描述可以参考上述图3、图4、图6、图8所示实施例中根节点设备的相关描述,这里不加赘述。
根据本申请实施例提供的一种节点设备,在根节点设备检测到端口的链路被连接上时,通过消息的交互发现存在的拓扑关系,可以实现网络拓扑的发现。
基于上述实施例中的网络拓扑发现方法的同一构思,如图12所示,本申请实施例还提 供一种子节点设备2000,该子节点设备2000可应用于上述图3、图4、图6、图8所示的网络拓扑方法中。该子节点设备2000包括:接收单元21、发送单元22,还可以包括检测单元23。示例性的:
接收单元21,用于接收根节点设备发送的链路发现消息,所述链路发现消息包括第三端口的标识;
发送单元22,用于通过所述第三端口向第二子节点设备转发所述链路发现消息;
所述接收单元21,还用于接收所述第二子节点设备通过第四端口发送的链路发现应答消息,所述链路发现应答消息包括所述第二子节点设备的标识和第四端口的标识;以及
所述发送单元22,还用于向所述根节点设备发送所述链路发现应答消息。
在一个实现中,所述检测单元23,用于检测到第一子节点设备的第三端口与第二子节点设备的第四端口之间存在链路连接;以及
所述发送单元22,用于向根节点设备发送端口状态变化消息,所述端口状态变化消息用于指示所述第三端口存在链路连接。
在又一个实现中,所述接收单元21,用于接收所述根节点设备发送的端口角色更新消息,所述端口角色更新消息包括所述第二子节点设备的标识,所述第三端口的标识,所述第四端口的标识和所述第四端口的角色信息,所述端口角色更新消息用于指示所述第二子节点设备根据所述第四端口的角色信息进行角色设置;
所述发送单元22,用于通过所述第三端口向所述第二子节点设备发送所述端口角色更新消息;
所述接收单元21,还用于通过所述第四端口接收所述第二子节点设备发送的端口角色更新应答消息;以及
所述发送单元22,还用于向所述根节点设备发送所述端口角色更新应答消息。
在又一个实现中,所述接收单元21,用于若所述第二子节点设备为首次发现设备,接收所述根节点设备发送的设备发现消息,所述设备发现消息包括所述第二子节点设备的标识和所述第三端口的标识;
所述发送单元22,用于通过所述第三端口向所述第二子节点设备发送所述设备发现消息;
所述接收单元21,还用于通过所述第四端口接收所述第二子节点设备发送的设备发现应答消息,所述设备发现应答消息包括所述第二子节点设备的标识,所述第二子节点设备的所有端口的标识、状态和端口能力;以及
所述发送单元22,还用于向所述根节点设备发送所述设备发现应答消息。
有关上述各单元更详细的描述可以参考上述图3、图4、图6、图8所示实施例中中间节点设备的相关描述,这里不加赘述。
根据本申请实施例提供的一种节点设备,在节点设备检测到端口的链路被连接上时,通过消息的交互发现存在的拓扑关系,可以实现网络拓扑的发现。
基于上述实施例中的网络拓扑发现方法的同一构思,如图13所示,本申请实施例还提供一种节点设备3000,该节点设备3000可应用于上述图3、图4、图6、图8所示的网络 拓扑方法中。该节点设备3000包括:接收单元31和发送单元32;还可以包括设置单元33。示例性的:
接收单元31,用于接收根节点设备通过第一端口发送的链路发现消息;
发送单元32,用于通过第二端口向所述根节点设备发送链路发现应答消息,所述链路发现应答消息包括所述子节点设备的标识和所述第二端口的标识。
在一个实现中,所述接收单元31,用于接收所述根节点设备通过所述第一端口发送的端口角色更新消息,所述端口角色更新消息包括所述子节点设备的标识,第二端口的标识和所述第二端口的角色信息,所述端口角色更新消息用于指示所述子节点设备根据所述第二端口的角色信息进行角色设置;
设置单元33,用于根据所述第二端口的角色信息,对所述第二端口进行角色设置;
发送单元32,用于通过第二端口向所述根节点设备发送端口角色更新应答消息。
在又一个实现中,所述接收单元31,用于若所述子节点设备为首次发现设备,接收所述根节点设备通过所述第一端口发送的设备发现消息,所述设备发现消息包括所述子节点设备的标识;
发送单元32,用于通过所述第二端口向所述根节点设备发送设备发现应答消息,所述设备发现应答消息包括所述子节点设备的标识,所述子节点设备的所有端口的标识、状态和端口能力。
在又一个实现中,第一子节点设备与所述根节点设备直连,第二子节点设备与所述根节点设备非直连,所述发送单元32,用于向所述根节点设备发送端口状态变化消息,所述端口状态变化消息用于指示所述第一子节点设备的第三端口与所述第二子节点设备的第四端口之间存在链路连接。
在又一个实现中,所述链路发现消息包括至少一个出端口的标识,所述端口角色更新消息包括至少一个出端口的标识,以及所述设备发现消息包括至少一个出端口的标识。
有关上述各单元更详细的描述可以参考上述图3、图4、图6、图8所示实施例中子节点设备的相关描述,这里不加赘述。
根据本申请实施例提供的一种子节点设备,在节点设备检测到端口的链路被连接上时,通过消息的交互发现存在的拓扑关系,可以实现网络拓扑的发现。
本申请实施例还提供一种节点设备,图14为本申请实施例提供的一种节点设备的结构示意图。该节点设备4000包括物理接口41和处理器42。物理接口41用于收发消息。处理器42用于执行图3、图4、图6、图8中根节点设备、中间节点设备或目标子节点设备所执行的方法步骤。
物理接口41的数量可以为一个或多个。物理接口41可以包括无线接口和/或有线接口。例如,无线接口可以包括WLAN接口,蓝牙接口,蜂窝网络接口或其任意组合。有线接口可以包括以太网接口、异步传输模式接口、光纤通道接口或其任意组合。以太网接口可以为电接口或光接口。物理接口41并不一定包括(尽管通常包括)以太网接口。
处理器42的数量可以为一个或多个。处理器42包括中央处理器,网络处理器,图形处理器(graphics processing unit,GPU),专用集成电路,可编程逻辑器件或其任意组合。 上述PLD可以是复杂可编程逻辑器件,现场可编程门阵列,通用阵列逻辑或其任意组合。处理器42可以包括控制面421和转发面422。控制面421和转发面422可以由独立的电路实现,也可以整合在一个电路中。例如,处理器42为多核CPU。多个核中的一个或一些实现控制面421,其他的核实现转发面422。又例如,控制面421由CPU实现,转发面422由NP,ASIC,FPGA或其任意组合实现。又例如,节点设备为框式网络设备,控制面421由主控卡实现,转发面422由线卡实现。又例如,控制面421和转发面422都由带控制面能力的NP实现。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,该单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。所显示或讨论的相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者通过该计算机可读存储介质进行传输。该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是只读存储器(read-only memory,ROM),或随机存储存储器(random access memory,RAM),或磁性介质,例如,软盘、硬盘、磁带、磁碟、或光介质,例如,数字通用光盘(digital versatile disc,DVD)、或者半导体介质,例如,固态硬盘(solid state disk,SSD)等。

Claims (20)

  1. 一种网络拓扑发现方法,其特征在于,包括:
    通过第一端口向子节点设备发送链路发现消息;
    接收所述子节点设备通过所述子节点设备的第二端口发送的链路发现应答消息,所述链路发现应答消息包括所述子节点设备的标识和所述第二端口的标识;
    基于所述链路发现应答消息,确定第一链路,所述第一链路为所述第一端口与所述第二端口之间的链路。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    基于所述第一链路,指示所述子节点设备将所述第二端口设置为上行口。
  3. 根据权利要求2所述的方法,其特征在于,所述基于所述第一链路,指示所述子节点设备将所述第二端口设置为上行口,包括:
    通过所述第一端口向所述子节点设备发送端口角色更新消息,所述端口角色更新消息包括所述子节点设备的标识,第二端口的标识和所述第二端口的角色信息,所述端口角色更新消息用于指示所述子节点设备根据所述第二端口的角色信息进行角色设置;
    接收所述子节点设备通过所述第二端口发送的端口角色更新应答消息。
  4. 根据权利要求1~3任一项所述的方法,其特征在于,所述方法还包括:
    若所述子节点设备为首次发现设备,通过所述第一端口向所述子节点设备发送设备发现消息,所述设备发现消息包括所述子节点设备的标识;
    接收所述子节点设备通过所述第二端口发送的设备发现应答消息,所述设备发现应答消息包括所述子节点设备的标识,所述子节点设备的所有端口的标识、状态和端口能力。
  5. 根据权利要求4所述的方法,其特征在于,第一子节点设备与所述根节点设备直连,第二子节点设备与所述根节点设备非直连,所述通过所述第一端口向所述子节点设备发送链路发现消息之前,所述方法还包括:
    接收所述第一子节点设备发送的端口状态变化消息,所述端口状态变化消息用于指示所述第一子节点设备的第三端口与所述第二子节点设备的第四端口之间存在链路连接。
  6. 根据权利要求5所述的方法,其特征在于,所述链路发现消息包括至少一个出端口的标识,所述端口角色更新消息包括至少一个出端口的标识,以及所述设备发现消息包括至少一个出端口的标识。
  7. 根据权利要求1~6任一项所述的方法,其特征在于,所述方法还包括:
    当检测到所述第一链路的状态发生变化时,确定需更新端口角色的子节点设备;
    通过第二链路向所述需要更新角色的子节点设备发送端口角色更新消息,所述端口角色更新消息包括所述根节点设备与所述需要更新角色的子节点设备之间的中间子节点设备的出端口的标识;
    接收端口角色更新应答消息。
  8. 一种网络拓扑发现方法,其特征在于,包括:
    接收根节点设备通过第一端口发送的链路发现消息;
    通过第二端口向所述根节点设备发送链路发现应答消息,所述链路发现应答消息包括所述子节点设备的标识和所述第二端口的标识。
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:
    接收所述根节点设备通过所述第一端口发送的端口角色更新消息,所述端口角色更新消息包括所述子节点设备的标识,第二端口的标识和所述第二端口的角色信息,所述端口角色更新消息用于指示所述子节点设备根据所述第二端口的角色信息进行角色设置;
    根据所述第二端口的角色信息,对所述第二端口进行角色设置;
    通过第二端口向所述根节点设备发送端口角色更新应答消息。
  10. 根据权利要求8或9所述的方法,其特征在于,所述方法还包括:
    若所述子节点设备为首次发现设备,接收所述根节点设备通过所述第一端口发送的设备发现消息,所述设备发现消息包括所述子节点设备的标识;
    通过所述第二端口向所述根节点设备发送设备发现应答消息,所述设备发现应答消息包括所述子节点设备的标识,所述子节点设备的所有端口的标识、状态和端口能力。
  11. 根据权利要求10所述的方法,其特征在于,第一子节点设备与所述根节点设备直连,第二子节点设备与所述根节点设备非直连,所述方法还包括:
    向所述根节点设备发送端口状态变化消息,所述端口状态变化消息用于指示所述第一子节点设备的第三端口与所述第二子节点设备的第四端口之间存在链路连接。
  12. 根据权利要求11所述的方法,其特征在于,所述链路发现消息包括至少一个出端口的标识,所述端口角色更新消息包括至少一个出端口的标识,以及所述设备发现消息包括至少一个出端口的标识。
  13. 一种节点设备,其特征在于,包括:
    发送单元,用于通过第一端口向子节点设备发送链路发现消息;
    接收单元,用于接收所述子节点设备通过所述子节点设备的第二端口发送的链路发现应答消息,所述链路发现应答消息包括所述子节点设备的标识和所述第二端口的标识;
    确定单元,用于基于所述链路发现应答消息,确定第一链路,所述第一链路为所述第一端口与所述第二端口之间的链路。
  14. 根据权利要求13所述的节点设备,其特征在于:
    所述发送单元,用于通过所述第一端口向所述子节点设备发送端口角色更新消息,所述端口角色更新消息包括所述子节点设备的标识,第二端口的标识和所述第二端口的角色信息,所述端口角色更新消息用于指示所述子节点设备根据所述第二端口的角色信息进行角色设置;
    所述接收单元,用于接收所述子节点设备通过所述第二端口发送的端口角色更新应答消息。
  15. 根据权利要求13或14所述的节点设备,其特征在于:
    所述发送单元,用于若所述子节点设备为首次发现设备,通过所述第一端口向所述子节点设备发送设备发现消息,所述设备发现消息包括所述子节点设备的标识;
    所述接收单元,用于接收所述子节点设备通过所述第二端口发送的设备发现应答消息,所述设备发现应答消息包括所述子节点设备的标识,所述子节点设备的所有端口的标识、状态和端口能力。
  16. 根据权利要求13~15任一项所述的节点设备,其特征在于,第一子节点设备与所述根节点设备直连,第二子节点设备与所述根节点设备非直连;
    所述接收单元,用于接收所述第一子节点设备发送的端口状态变化消息,所述端口状态变化消息用于指示所述第一子节点设备的第三端口与所述第二子节点设备的第四端口之间存在链路连接。
  17. 根据权利要求13~16任一项所述的节点设备,其特征在于,所述节点设备还包括:
    所述确定单元,还用于当检测到所述第一链路的状态发生变化时,确定需更新端口角色的子节点设备;
    所述发送单元,用于通过第二链路向所述需要更新角色的子节点设备发送端口角色更新消息,所述端口角色更新消息包括所述根节点设备与所述需要更新角色的子节点设备之间的中间子节点设备的出端口的标识;
    所述接收单元,用于接收端口角色更新应答消息。
  18. 一种节点设备,其特征在于,包括:
    接收单元,用于接收根节点设备通过第一端口发送的链路发现消息;
    发送单元,用于通过第二端口向所述根节点设备发送链路发现应答消息,所述链路发现应答消息包括所述子节点设备的标识和所述第二端口的标识。
  19. 根据权利要求18所述的节点设备,其特征在于:
    所述接收单元,用于接收所述根节点设备通过所述第一端口发送的端口角色更新消息,所述端口角色更新消息包括所述子节点设备的标识,第二端口的标识和所述第二端口 的角色信息,所述端口角色更新消息用于指示所述子节点设备根据所述第二端口的角色信息进行角色设置;
    所述节点设备还包括:
    设置单元,用于根据所述第二端口的角色信息,对所述第二端口进行角色设置;
    所述发送单元,用于通过第二端口向所述根节点设备发送端口角色更新应答消息。
  20. 根据权利要求18或19所述的节点设备,其特征在于:
    所述接收单元,用于若所述子节点设备为首次发现设备,接收所述根节点设备通过所述第一端口发送的设备发现消息,所述设备发现消息包括所述子节点设备的标识;
    所述发送单元,用于通过所述第二端口向所述根节点设备发送设备发现应答消息,所述设备发现应答消息包括所述子节点设备的标识,所述子节点设备的所有端口的标识、状态和端口能力。
PCT/CN2020/124378 2019-10-31 2020-10-28 网络拓扑发现方法及节点设备 WO2021083208A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20880534.1A EP4047877A4 (en) 2019-10-31 2020-10-28 METHOD AND DEVICE FOR DISCOVERING A NETWORK TOPOLOGY
US17/731,686 US11855875B2 (en) 2019-10-31 2022-04-28 Network topology discovery method and node device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911053346.7 2019-10-31
CN201911053346.7A CN112751697B (zh) 2019-10-31 2019-10-31 网络拓扑发现方法及节点设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/731,686 Continuation US11855875B2 (en) 2019-10-31 2022-04-28 Network topology discovery method and node device

Publications (1)

Publication Number Publication Date
WO2021083208A1 true WO2021083208A1 (zh) 2021-05-06

Family

ID=75645064

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/124378 WO2021083208A1 (zh) 2019-10-31 2020-10-28 网络拓扑发现方法及节点设备

Country Status (4)

Country Link
US (1) US11855875B2 (zh)
EP (1) EP4047877A4 (zh)
CN (1) CN112751697B (zh)
WO (1) WO2021083208A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023131307A1 (zh) * 2022-01-10 2023-07-13 中兴通讯股份有限公司 微波网络根节点查询方法及装置、微波系统和存储介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113422798B (zh) * 2021-05-11 2022-09-16 华为技术有限公司 一种网络数据传输方法、装置、系统以及计算机
CN114024859B (zh) * 2021-11-24 2024-03-26 山西合力创新科技股份有限公司 基于设备和链路发现的网路拓扑生成方法、存储介质及终端
CN114338413B (zh) * 2021-12-30 2024-01-26 中国工商银行股份有限公司 网络中设备的拓扑关系的确定方法、装置以及存储介质
CN115208767B (zh) * 2022-05-12 2023-10-27 哈尔滨工业大学(深圳) 基于仿真技术的以太坊网络探测方法、装置、设备及介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020154606A1 (en) * 2001-02-19 2002-10-24 Duncan Robert James Network management apparatus and method for determining the topology of a network
US20120327766A1 (en) * 2011-06-24 2012-12-27 Cisco Technology, Inc. Level of hierarchy in mst for traffic localization and load balancing
CN102916884A (zh) * 2012-10-26 2013-02-06 江苏华丽网络工程有限公司 一种交换设备的拓扑发现方法
CN105376164A (zh) * 2015-11-25 2016-03-02 青岛信合一工贸有限公司 交换设备拓扑方式
CN105991435A (zh) * 2015-02-05 2016-10-05 华为技术有限公司 用于获取端口路径的方法及装置
CN110545194A (zh) * 2018-05-28 2019-12-06 华为技术有限公司 网络拓扑的生成方法及装置

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5506838A (en) * 1994-12-29 1996-04-09 Emc Corporation Packet propagation and dynamic route discovery apparatus and techniques
US6847614B2 (en) * 1998-04-20 2005-01-25 Broadcom Corporation Apparatus and method for unilateral topology discovery in network management
US8605623B2 (en) * 2002-05-31 2013-12-10 Koninklijke Philips N.V. Determining and configuring a communication path in a network
US9210073B2 (en) * 2004-04-30 2015-12-08 Hewlett-Packard Development Company, L.P. System and method for message routing in a network
US7542432B2 (en) * 2005-10-27 2009-06-02 Alcatel Lucent Resource matched topology database synchronization in communications networks having topology state routing protocols
JP5229343B2 (ja) * 2011-03-15 2013-07-03 オムロン株式会社 接続異常検出方法、ネットワークシステムおよびマスター装置
JP5821815B2 (ja) * 2012-09-11 2015-11-24 日立金属株式会社 通信システムおよび通信システムの処理方法
GB201219292D0 (en) * 2012-10-26 2012-12-12 Vodafone Ip Licensing Ltd Use of ORI interface to perform data and control word forwarding through REs in a multihop configuration
CN103905221A (zh) * 2012-12-26 2014-07-02 成都勤智数码科技股份有限公司 通用的拓扑链接准确发现方法
US9325608B2 (en) * 2012-12-28 2016-04-26 Dell Products L.P. Systems and methods for reducing information loss in an aggregated information handling system
US9094285B2 (en) * 2013-01-25 2015-07-28 Argela Yazilim ve Bilisim Teknolojileri San. ve Tic. A.S. Automatic discovery of multiple controllers in Software Defined Networks (SDNs)
CN105827439B (zh) * 2016-03-11 2019-02-01 范晓东 实现无线设备自组网的方法
US10771372B2 (en) * 2016-06-16 2020-09-08 Oracle International Corporation Transmitting test traffic on a communication link
CN108919762B (zh) * 2018-07-06 2021-05-25 东莞市李群自动化技术有限公司 基于工业以太网的控制方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020154606A1 (en) * 2001-02-19 2002-10-24 Duncan Robert James Network management apparatus and method for determining the topology of a network
US20120327766A1 (en) * 2011-06-24 2012-12-27 Cisco Technology, Inc. Level of hierarchy in mst for traffic localization and load balancing
CN102916884A (zh) * 2012-10-26 2013-02-06 江苏华丽网络工程有限公司 一种交换设备的拓扑发现方法
CN105991435A (zh) * 2015-02-05 2016-10-05 华为技术有限公司 用于获取端口路径的方法及装置
CN105376164A (zh) * 2015-11-25 2016-03-02 青岛信合一工贸有限公司 交换设备拓扑方式
CN110545194A (zh) * 2018-05-28 2019-12-06 华为技术有限公司 网络拓扑的生成方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4047877A4

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023131307A1 (zh) * 2022-01-10 2023-07-13 中兴通讯股份有限公司 微波网络根节点查询方法及装置、微波系统和存储介质

Also Published As

Publication number Publication date
US11855875B2 (en) 2023-12-26
CN112751697B (zh) 2023-11-21
EP4047877A1 (en) 2022-08-24
EP4047877A4 (en) 2022-11-16
CN112751697A (zh) 2021-05-04
US20220255836A1 (en) 2022-08-11

Similar Documents

Publication Publication Date Title
WO2021083208A1 (zh) 网络拓扑发现方法及节点设备
EP2813034B1 (en) Methods of redirecting network forwarding elements and related forwarding elements and controllers
EP2472795B1 (en) Method and system for re-building single ring network topology
US9813289B2 (en) Technique for configuring a software-defined network
US10972357B2 (en) SDN network system, controller, and controlling method
CN108432192B (zh) 流量转移方法和系统以及计算机可读存储介质
US10908942B2 (en) Virtualization device
US20120275316A1 (en) Failure Detection Method and Device for FCoE Virtual Link
EP2894812A1 (en) Method and apparatus for establishing a virtual interface for a set of mutual-listener devices
EP2770681B1 (en) Switch and switch system
EP4138443A1 (en) Communication method and apparatus
CN108134707B (zh) 一种路由检测的方法、系统及网络设备
WO2022082724A1 (en) Method and apparatus for multicast service support in time sensitive network
JP2021524204A (ja) サービス品質監視方法、及びシステム、並びに装置
ES2785562T3 (es) Arquitectura SDN, procedimiento de reenvío de mensajes basado en arquitectura SDN
US10084656B2 (en) TRILL network establishing method, node, and system
CN113132227A (zh) 更新路由信息的方法、装置、计算机设备和存储介质
US10587519B2 (en) Clos network load balancing method and apparatus
US20230209439A1 (en) Route discovery in a mesh network
EP4002779B1 (en) Method and apparatus for sharing information in redundant network, and computer storage medium
KR20190108255A (ko) Sdn 기반 이동 애드혹 네트워크 제어 방법 및 장치
CN105634786B (zh) 链路保活方法和装置
CN104253756A (zh) 一种lav切换方法和ed
CN113872787B (zh) 网络拓扑发现方法、装置和计算机可读存储介质
TWI838049B (zh) 網狀網路中的路由探索方法及裝置

Legal Events

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

Ref document number: 20880534

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020880534

Country of ref document: EP

Effective date: 20220518

NENP Non-entry into the national phase

Ref country code: DE