CN113225210A - Link determination method, device, controller and storage medium - Google Patents

Link determination method, device, controller and storage medium Download PDF

Info

Publication number
CN113225210A
CN113225210A CN202110424566.7A CN202110424566A CN113225210A CN 113225210 A CN113225210 A CN 113225210A CN 202110424566 A CN202110424566 A CN 202110424566A CN 113225210 A CN113225210 A CN 113225210A
Authority
CN
China
Prior art keywords
port
message
switch
link
switches
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110424566.7A
Other languages
Chinese (zh)
Inventor
黄国华
彭雨林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Sundray Technologies Co ltd
Original Assignee
Shenzhen Sundray Technologies Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Sundray Technologies Co ltd filed Critical Shenzhen Sundray Technologies Co ltd
Priority to CN202110424566.7A priority Critical patent/CN113225210A/en
Publication of CN113225210A publication Critical patent/CN113225210A/en
Pending legal-status Critical Current

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/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • 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/26Route discovery packet

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a link determining method, a device, a controller and a storage medium, wherein the link determining method comprises the following steps: sending a first message to at least one of the two switches; the first message is used for indicating the corresponding switch to modify the port configuration according to the set parameters; the two switches are interconnected with a second port of a second switch through a first port of a first switch; after the first message is sent, receiving a second message reported by all or part of the two switches; the second message represents the port state change of the corresponding switch; determining a link type between the first port and a second port based on the second message.

Description

Link determination method, device, controller and storage medium
Technical Field
The present application relates to the field of network technologies, and in particular, to a link determining method, an apparatus, a controller, and a storage medium.
Background
In a Software Defined Network (SDN) technology, a controller manages all switches in a whole Network through a standard protocol (OpenFlow), completes information collection of all ports of the switches and an overall Network topology, and performs global routing calculation according to the overall Network topology. The SDN controller performs Link Discovery through a Link Layer Discovery Protocol (LLDP), and identifies and manages a network topology structure according to information collected by the Discovery Protocol.
In the related technology, a network topological graph is constructed through LLDP, transparent devices between network device ports cannot be sensed, the type of a link needs to be determined manually, and the link determination efficiency is not high.
Disclosure of Invention
In view of the above, embodiments of the present application provide a link determining method, apparatus, controller and storage medium to at least solve the problem of inefficient link determination.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a link determining method, which is applied to a controller and comprises the following steps:
sending a first message to at least one of the two switches; the first message is used for indicating the corresponding switch to modify the port configuration according to the set parameters; the two switches are interconnected with a second port of a second switch through a first port of a first switch;
after the first message is sent, receiving a second message reported by all or part of the two switches; the second message represents the port state change of the corresponding switch;
determining a link type between the first port and a second port based on the second message.
Wherein, in the scheme, the first step of the method,
the sending a first message to at least one of the two switches includes:
sending the first message to the first switch to cause the first switch to perform a first port configuration operation based on the first message; the first port configuration operation is characterized by being enabled after the first port is disabled;
the receiving of the second message reported by all or part of the two switches includes:
receiving the second message reported by the second switch; the second message characterizes a port state change of the second port.
In the foregoing solution, before the sending the first message to at least one of the two switches, the method further includes:
sending a third message to the second switch; the third message is used for instructing the second switch to monitor the port state change of the second port.
In the foregoing solution, before the receiving the second message reported by the second switch, the method further includes:
sending a fourth message to the second switch; the fourth message is used for instructing the second switch to report the second message.
In the foregoing solution, the determining a link type between the first port and the second port based on the second message includes:
under the condition that the second message represents that the port state of the second port is changed from a normal working state to a non-working state and then to a normal working state, determining that the link type between the first port and the second port is a physical link;
and under the condition that the second message represents that the port state of the first port remains unchanged, determining that the link type between the first port and the second port is a logical link.
In the above-mentioned scheme, the first step of the method,
the sending a first message to at least one of the two switches includes:
sending the first message to the first switch and the second switch to cause the switches to perform a second port configuration operation based on the first message; the second port configuration operation is characterized by modifying auto-negotiation parameters of the corresponding port; the auto-negotiation parameters comprise port rate and duplex mode;
the receiving of the second message reported by all or part of the two switches includes:
receiving the second messages reported by the first switch and the second switch; and the second message represents the change condition of the auto-negotiation parameters of the opposite terminal port monitored by the switch reporting the second message.
In the foregoing solution, the determining a link type between the first port and the second port based on the second message includes:
determining that the link type between the first port and the second port is a physical link under the condition that the second message represents that the auto-negotiation parameter of the first port or the second port changes;
and under the condition that the second message characterizes that the auto-negotiation parameters of the first port and the second port are kept unchanged, determining that the link type between the first port and the second port is a logical link.
An embodiment of the present application further provides a link determining apparatus, including:
a first sending unit, configured to send a first message to at least one of the two switches; the first message is used for indicating the corresponding switch to modify the port configuration according to the set parameters; the two switches are interconnected with a second port of a second switch through a first port of a first switch;
the receiving unit is used for receiving a second message reported by all or part of the two switches after the first message is sent; the second message represents the port state change of the corresponding switch;
a determining unit, configured to determine a link type between the first port and the second port based on the second message.
An embodiment of the present application further provides a controller, including: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is configured to execute the steps of any of the above-mentioned link determining methods when running the computer program.
An embodiment of the present application further provides a storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the steps of any one of the above-mentioned link determining methods.
In the embodiment of the present invention, a controller sends a first message to at least one of two switches, instructs the switches to modify port configurations according to a set parameter, and reports a second message about a change in port state of the switches by all or a part of the two switches, and the controller determines, based on the second message, a link type between a first port and a second port, that is, determines whether links between egress ports are directly connected or whether transparent devices exist between the ports, thereby improving efficiency of link determination.
Drawings
Fig. 1 is a schematic diagram of a network topology of an actual physical link provided in the related art;
fig. 2 is a schematic diagram of a network topology provided in the related art;
fig. 3 is a schematic flowchart of a link determining method according to an embodiment of the present application;
fig. 4 is a schematic diagram of a network system according to an embodiment of the present application;
fig. 5 is a schematic diagram of a link monitoring model according to an embodiment of the present application;
fig. 6 is a schematic diagram of another link monitoring model provided in the embodiment of the present application;
fig. 7 is a schematic diagram illustrating a port state change of a physical link according to an embodiment of the present application;
fig. 8 is a schematic diagram illustrating a port state change of a logical link according to an embodiment of the present application;
fig. 9 is a schematic workflow diagram of a link determination method according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a link determining apparatus according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a controller according to an embodiment of the present application.
Detailed Description
When the network topology is carried out, the controller carries out link discovery through the LLDP and identifies and manages the network topology structure according to the information collected by the LLDP. LLDP is a two-layer protocol in 802.1ab, provides a standard link layer discovery mode, is a protocol for information announcement and acquisition, is a unidirectional protocol, and only actively announces a working mode, and transmitted information announcement does not need to be confirmed and cannot request to acquire some information by sending a request. In a network with actual physical links as shown in fig. 1, a network topology diagram is constructed through LLDP, and transparent devices between ports of network devices cannot be perceived, so that only the network topology diagram shown in fig. 2 can be obtained. When the network link fault is checked and positioned, the type of the link needs to be determined manually, and the efficiency of link determination is not high.
Based on this, in various embodiments of the present application, a first message is sent by a controller to at least one switch of two switches, the switch is instructed to modify a port configuration according to a setting parameter, a second message about a change of a port state of the switch is reported by all or a part of the two switches, and the controller determines a link type between a first port and a second port, that is, determines whether a link between egress ports is directly connected or whether a transparent device exists between the ports, based on the second message, thereby improving efficiency of link determination.
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Fig. 3 is a schematic flowchart of a link determining method according to an embodiment of the present application, where an execution subject of the flowchart is a controller. May be used in a network system as shown in fig. 4. As shown in fig. 3, the link determining method includes:
step 301: sending a first message to at least one of the two switches; the first message is used for indicating the corresponding switch to modify the port configuration according to the set parameters; the two switches are interconnected by a first port of a first switch and a second port of a second switch.
The controller sends a first message to at least one of the two switches, wherein the first message is used for indicating the switch receiving the first message to modify the port configuration according to the set parameters, and the two switches are interconnected with the second port of the second switch through the first port of the first switch.
Here, the first message may be used to instruct the switch to disable a set port and re-enable the disabled port after a set length of time; the switch can also be used for instructing the switch to read the auto-negotiation parameter of the corresponding port of the other switch, modify the auto-negotiation parameter of the port, read the auto-negotiation parameter of the corresponding port of the other switch, and report the change of the auto-negotiation parameter of the port of the other switch; the auto-negotiation parameters include link data transmission rate and/or simplex-duplex operation mode.
As shown in fig. 5 and fig. 6, the first switch and the second switch are normally on-line on the controller, and the controller topology discovery function identifies that the first switch and the second switch are interconnected through the first port of the first switch and the second port of the second switch. The network topology link relates to at least two network devices, the controller is used for issuing an instruction to the network devices or instructing the network devices to monitor the state of the port, and the controller can only send a first message to one of the switches or can simultaneously send the first message to at least two switches.
Step 302: after the first message is sent, receiving a second message reported by all or part of the two switches; the second message characterizes a port state change of the corresponding switch.
After the controller sends the first message, the switch which receives the first message modifies the port configuration according to the indication of the first message, all or part of the two switches monitor the port state of the corresponding switch to obtain a second message, the second message is reported to the controller, and the controller receives the second message which is reported by all or part of the two switches. And the second message represents the port state change of the corresponding switch, including the change of the link working state, the link data transmission rate and/or the simplex and duplex working mode.
Here, the controller receives the second message reported by all or part of the two switches, which may be obtained by monitoring the port state change of another switch by the switch receiving the first message; or another switch monitors that the port state of the switch receiving the first message changes, and obtains the port state according to the change of the port state of the other switch.
Step 303: determining a link type between the first port and a second port based on the second message.
The controller determines a link type between the first port of the first switch and the second port of the second switch based on a second message reported by the switches. The determined link type may be a physical link or a logical link; if the link between the two switches is a logical link, representing that third-party unknown equipment exists between the two switches, namely transparent equipment exists; the transparent device is a device which cannot be identified when link discovery is performed through LLDP, and at least comprises a repeater, a bridge and a HUB.
In one embodiment, the sending the first message to at least one of the two switches includes:
sending the first message to the first switch to cause the first switch to perform a first port configuration operation based on the first message; the first port configuration operation is characterized by being enabled after the first port is disabled;
the receiving of the second message reported by all or part of the two switches includes:
receiving the second message reported by the second switch; the second message characterizes a port state change of the second port.
The controller sends a first message to the first switch. Based on the received first message, the first switch disables the first port and then enables the first port. And in the process of disabling and re-enabling the port of the first switch, the second switch records the port state change of the second port, determines a second message and reports the second message to the controller. And the controller receives a second message reported by the second switch.
Here, the switch confirms that the link between the first switch and the second switch is recovered before receiving the second message reported by the switch, so that the problem that the controller cannot receive the second message due to communication between the controller and the switch is avoided. The first switch may enable the first port after a set time by setting a timer. The second message may be obtained by the second switch according to a port state change of the second port, when the second switch monitors that the port state of the first port of the first switch changes.
In one embodiment, before the sending the first message to at least one of the two switches, the method further comprises:
sending a third message to the second switch; the third message is used for instructing the second switch to monitor the port state change of the second port.
And the controller sends a third message to the second switch, and the third message is used for indicating the second switch to monitor the port state change of the second port when the port state of the first port changes. Based on the third message, the second switch monitors the port state change of the second port to obtain a second message. In this way, before the controller sends the first message for instructing to modify the port configuration to the switch, the switch starts to monitor the port state change of the set port, and the port state change process of the set port can be monitored when the switch modifies the port configuration.
In an embodiment, before the receiving the second message reported by the second switch, the method further includes:
sending a fourth message to the second switch; the fourth message is used for instructing the second switch to report the second message.
And the controller sends a fourth message to the second switch, and the fourth message is used for indicating the second switch to report the monitored port state change of the second port. And reporting the monitored second message by the second switch based on the fourth message. And the controller receives a second message reported by the second switch. When three or more network devices exist in a network topology link and a controller needs to determine a plurality of link types, each link type is determined respectively through a link determination method, and after port state change data among the links are collected, a second message representing the port state change of the switch is actively acquired from the switch by the controller, so that the controller can determine the link types among the ports in a unified manner, and computing resources are saved.
In an embodiment, the determining a link type between the first port and the second port based on the second message includes:
under the condition that the second message represents that the port state of the second port is changed from a normal working state to a non-working state and then to a normal working state, determining that the link type between the first port and the second port is a physical link;
and under the condition that the second message represents that the port state of the first port remains unchanged, determining that the link type between the first port and the second port is a logical link.
The controller determines a link type between the first port and the second port according to a port state change procedure of the second port based on the received second message. As shown in the port state change diagram of the physical link shown in fig. 7, when the second message indicates that the port state of the second port changes from the normal operating state to the non-operating state and then to the normal operating state in the process of disabling and re-enabling the first port, the port state change of the first port may cause the port state change of the second port, the port state change processes of the second port and the first port are the same, and it may be determined that the first port and the second port are directly connected, so as to determine that the link type between the first port and the second port is the physical link. As shown in the port state change diagram of the logical link shown in fig. 8, when the second message indicates that the port state of the second port remains unchanged, that is, remains in a normal operating state, in the process of disabling and re-enabling the first port, the port state change of the first port does not cause the port state change of the second port, the port state change processes of the second port and the first port are not the same, it may be determined that a transparent device implementing a communication protocol exists between the two ports, and it is determined that the link type between the first port and the second port is a logical link. In this way, by analyzing the change process of the port state of the second port, the link type between the first port and the second port can be determined, thereby improving the efficiency of link determination.
In one embodiment, the sending the first message to at least one of the two switches includes:
sending the first message to the first switch and the second switch to cause the switches to perform a second port configuration operation based on the first message; the second port configuration operation is characterized by modifying auto-negotiation parameters of the corresponding port;
the receiving of the second message reported by all or part of the two switches includes:
receiving the second messages reported by the first switch and the second switch; and the second message represents the change condition of the auto-negotiation parameters of the opposite terminal port monitored by the switch reporting the second message.
The controller sends a first message to the first switch. Based on the received first message, the first switch firstly modifies the auto-negotiation parameters of the first port, then monitors the auto-negotiation parameters of the second port, and finally recovers the original auto-negotiation parameters of the first port, determines a second message based on the original configuration of the first port and the monitored auto-negotiation parameters of the second port, and reports the second message to the controller. And the controller receives the second message reported by the first switch and sends the first message to the second switch. Based on the received first message, the second switch firstly modifies the auto-negotiation parameter of the second port, then monitors the auto-negotiation parameter of the first port, finally recovers the original auto-negotiation parameter of the second port, determines a second message based on the original configuration of the second port and the detected auto-negotiation parameter of the first port, and reports the second message to the controller. The auto-negotiation parameters include link data transmission rate and/or simplex-duplex operation mode. The controller respectively sends the first message to the first switch and the second switch and respectively receives the second message reported by the first switch and the second switch, so that the link connection can be ensured to be kept in the link determining process.
Here, the controller may wait for a preset time, and receive the second message reported by the switch after confirming that the first switch and the second switch are normally accessed, so as to avoid that the controller cannot receive the second message due to a problem in communication between the controller and the switch. In practical application, the switch modifies the auto-negotiation parameters of its own port, and can be implemented by the following modes: if the original configuration of the port is the auto-negotiation configuration, the auto-negotiation configuration is closed, the link data transmission rate is set as the original link data transmission rate, and the duplex mode is set as the original duplex mode; and if the port is originally configured to be in the forced mode, opening the auto-negotiation configuration.
In an embodiment, the determining a link type between the first port and the second port based on the second message includes:
determining that the link type between the first port and the second port is a physical link under the condition that the second message represents that the auto-negotiation parameter of the first port or the second port changes;
and under the condition that the second message characterizes that the auto-negotiation parameters of the first port and the second port are kept unchanged, determining that the link type between the first port and the second port is a logical link.
The controller determines a link type between the first port and the second port according to a port state change process of the first port and the second port based on the received second message. When the second message indicates that the auto-negotiation parameter of the first port or the second port changes compared with the original configuration, the change of the auto-negotiation parameter of the first port will cause the change of the auto-negotiation parameter of the second port, and the change process of the auto-negotiation parameter of the second port and the auto-negotiation parameter of the first port is the same, so that the type of the link between the first port and the second port can be determined to be a physical link. When the second message indicates that the auto-negotiation parameters of the first port and the second port remain unchanged, the auto-negotiation parameter change indicating the first port causes the auto-negotiation parameter change of the second port, and the auto-negotiation parameter change process of the second port and the auto-negotiation parameter change process of the first port are different, so that the link type between the first port and the second port can be determined to be a logical link. Here, the original configuration of the first port or the second port may be determined by the original configuration of the opposite port.
In the embodiment of the application, the controller sends the first message to at least one of the two switches, instructs the switches to modify the port configuration according to the set parameters, and reports the second message about the change of the port state of the switches by all or part of the two switches, and the controller determines the type of the link between the first port and the second port based on the second message, that is, determines whether the link between the output ports is directly connected, and if the link is directly connected, it indicates that no third-party device, that is, a transparent device, exists between the ports, so that the type of the link between the ports of the two switches can be accurately determined, thereby realizing refinement of network topology and improving the efficiency of link determination. When network link faults such as packet loss are checked and positioned, whether third-party unknown equipment exists between the switches under unified management of the controller can be determined, and the efficiency of troubleshooting is improved.
The present application will be described in further detail with reference to the following application examples.
The work flow diagram of the link determination method shown in conjunction with fig. 9 includes the following steps:
step 901: the controller discovers switches that communicate with a two-tier network or a three-tier network of the controller.
Step 902: the controller activates the discovered switch to the controller.
Step 903: the controller establishes a tunnel connection with the switch.
Step 904: the controller discovers the network topology of the line switches on the controller.
Step 905: the controller instructs the switch to modify the port configuration, receives messages reported by the switch and characterizing both ends of a link in the network topology, and determines the link type between the ports based on whether the port state changes. When the working state of the port changes, namely the working state changes of the two ports are kept consistent, determining the type of a link between the first port and the second port as a physical link; and when the working state of the port is kept unchanged, namely the working state of the two ports is inconsistent, determining that the type of the link between the first port and the second port is a logical link.
Therefore, the switch is activated to be on line to the same controller, the controller identifies the network topology of the switch through the network topology discovery function, and for the network ports which are logically interconnected in the two layers in the network topology, the working state of the link at one end of the interconnected port is changed within a period of time, whether the working state of the link at the opposite end port is changed or not is monitored, the state consistency detection of the link interconnected port is realized, and whether the interconnected port is directly connected with the physical link or not is realized.
Based on the consistency of the link working states of the physical link interconnection ports, whether the connection relation between the network ports is a logical link connection or a physical link connection can be determined. By which the link type in the network topology discovered by the controller can be determined.
In an application embodiment, the process of determining the link type is as follows:
a controller end:
step 1: the controller sends a message to the second switch informing the second switch to monitor the second port status.
Step 2: the controller sends a message to the first switch informing the first switch to determine the port link type of the first port.
And step 3: the controller waits for the first port of the first switch to be linked back with the second port of the second switch.
And 4, step 4: the controller obtains a port state change of a second port of the second switch.
And 5: the controller analyzes the change of the port state of the second port of the second switch, if the second port of the second switch is changed from the link normal working state to the link non-working state and then is restored from the link non-working state to the link normal working state, the first port of the first switch and the second port of the second switch are determined to be physical links, and if the second port of the second switch is not changed in state and is always in the link normal working state, the first port of the first switch and the second port of the second switch are determined to be logical links.
A first switch end:
step 1: a message sent by the controller to the local device to determine the first port link type is received.
Step 2: the native first port is disabled.
And step 3: and starting a local re-starting timer, and setting the time length of the timer to be 3 seconds.
And 4, step 4: and after the time length is set (3 seconds) in the step 3, the local first port is restarted.
A second switch end:
step 1: and receiving a port state change message sent to the local monitoring second port by the controller.
Step 2: and starting a timer for reading the state of the second port, setting the time length of the timer to be 200 milliseconds, reading the state of the second port after setting the time length at each interval, and recording.
And step 3: after 3 seconds the timer started in step 2 is closed.
And 4, step 4: and receiving a message that the controller acquires the port state change of the second port.
And 5: and sending the port state change of the second port to the controller.
In the two ports connected by the physical link, the link working state of one port changes, the link working state of the opposite end also changes correspondingly, and the link working state of the opposite end does not change correspondingly in the two ports connected by the logical link.
In this approach, a link disconnection during the determination of the link type can result in a change in the network topology, and therefore the link between the two ports needs to be restored.
In an application embodiment, the process of determining the link type is as follows:
a controller end:
step 1: the controller sends a message to the first switch and the second switch, informs the first switch to modify the auto-negotiation parameter of the first port and informs the second switch to modify the auto-negotiation parameter of the second port;
step 2: waiting for 3 seconds, and confirming that the first switch and the second switch normally access;
and step 3: acquiring the change condition of the auto-negotiation parameters of the second port monitored by the first switch and the change condition of the auto-negotiation parameters of the first port monitored by the second switch;
and 4, step 4: analyzing messages reported by the first switch and the second switch, and judging the link type;
if the first port of the first switch monitors that the auto-negotiation parameters of the opposite-end network port are changed or the second port of the second switch monitors that the auto-negotiation parameters of the opposite-end network port are changed, the first port of the first switch and the second port of the second switch are judged to be directly connected through a physical link, and if the first port of the first switch and the second port of the second switch do not monitor that the auto-negotiation parameters of the opposite-end network port are changed, the first port of the first switch and the second port of the second switch are judged to be interconnected through a logical link.
A first switch end, a second switch end:
step 1: receiving a message of auto-negotiation parameters sent to a local modification port by a controller;
step 2: reading the self-negotiation configuration of the port to be determined of the local machine on the opposite-end network port, and then delaying for 1 second;
and step 3: modifying the self-negotiation configuration of a port to be determined of the local machine, if the original configuration of the port to be determined is self-negotiation, closing the self-negotiation, setting the rate as the original link data transmission rate, and setting the duplex mode as the original duplex mode; if the original configuration is a forced mode, starting the auto-negotiation configuration, and delaying for 1 second;
and 4, step 4: reading the auto-negotiation parameters of the opposite end port of the port to be determined of the local machine, and delaying for 1 second;
and 5: recovering the original configuration of the port to be determined of the local computer;
step 6: and reporting the change condition of the auto-negotiation parameters of the opposite terminal port to the controller.
The auto-negotiation parameters of the opposite end are correspondingly changed when the auto-negotiation parameters of one port are changed in the two ports connected by the physical link, and the auto-negotiation parameters of the opposite end are not correspondingly changed when the auto-negotiation parameters of the two ports connected by the logical link are not changed. For a network port directly connected with a physical link, an auto-negotiation parameter of an opposite-end equipment port can be obtained in a physical layer, on the basis, the auto-negotiation parameter of the opposite-end port can be monitored by changing the auto-negotiation parameter, and the link is ensured to be continuous in the link determination process.
In order to implement the method according to the embodiment of the present application, an embodiment of the present application further provides a link determining apparatus, as shown in fig. 10, where the apparatus includes:
a first sending unit 1001, configured to send a first message to at least one of the two switches; the first message is used for indicating the corresponding switch to modify the port configuration according to the set parameters; the two switches are interconnected with a second port of a second switch through a first port of a first switch;
a receiving unit 1002, configured to receive, after sending the first message, a second message reported by all or part of the two switches; the second message represents the port state change of the corresponding switch;
a determining unit 1003, configured to determine, based on the second message, a link type between the first port and the second port.
In one embodiment of the present invention,
the first sending unit 1001 is configured to send the first message to the first switch, so that the first switch performs a first port configuration operation based on the first message; the first port configuration operation is characterized by being enabled after the first port is disabled;
a receiving unit 1002, configured to receive the second message reported by the second switch; the second message characterizes a port state change of the second port.
In one embodiment, the apparatus further comprises:
a second sending unit, configured to send a third message to the second switch; the third message is used for instructing the second switch to monitor the port state change of the second port.
In one embodiment, the apparatus further comprises:
a third sending unit, configured to send a fourth message to the second switch; the fourth message is used for instructing the second switch to report the second message.
In one embodiment, the determining unit 1003 is configured to:
under the condition that the second message represents that the port state of the second port is changed from a normal working state to a non-working state and then to a normal working state, determining that the link type between the first port and the second port is a physical link;
and under the condition that the second message represents that the port state of the first port remains unchanged, determining that the link type between the first port and the second port is a logical link.
In one embodiment of the present invention,
the first sending unit 1001 is configured to send the first message to the first switch and the second switch, so that the switches perform a second port configuration operation based on the first message; the second port configuration operation is characterized by modifying auto-negotiation parameters of the corresponding port;
a receiving unit 1002, configured to receive the second message reported by the first switch and the second switch; and the second message represents the change condition of the auto-negotiation parameters of the opposite terminal port monitored by the switch reporting the second message.
In one embodiment, the determining unit 1003 is configured to:
determining that the link type between the first port and the second port is a physical link under the condition that the second message represents that the auto-negotiation parameter of the first port or the second port changes;
and under the condition that the second message characterizes that the auto-negotiation parameters of the first port and the second port are kept unchanged, determining that the link type between the first port and the second port is a logical link.
In practical applications, the first sending unit 1001, the receiving unit 1002, the second sending unit, and the third sending unit may be implemented by a communication interface in a link-based determining device, and the determining unit 1003 may be implemented by a processor in the link-based determining device.
It should be noted that: in the link determining apparatus provided in the above embodiment, only the division of the program modules is exemplified when determining the link, and in practical applications, the above processing distribution may be completed by different program modules according to needs, that is, the internal structure of the apparatus may be divided into different program modules to complete all or part of the above-described processing. In addition, the link determining apparatus and the link determining method provided in the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Based on the hardware implementation of the program module, and in order to implement the method for determining a side link of a controller in the embodiment of the present application, an embodiment of the present application further provides a controller, as shown in fig. 11, where the controller 1100 includes:
a communication interface 1110 capable of performing information interaction with other devices such as a network device and the like;
the processor 1120 is connected to the communication interface 1110 to implement information interaction with other devices, and is configured to execute a method provided by one or more technical solutions of the controller side when running a computer program. And the computer program is stored on the memory 1130.
Of course, in practice, the various components in the controller 1100 are coupled together by a bus system 1140. It is understood that the bus system 1140 is used to enable communications for connections between these components. The bus system 1140 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as the bus system 1140 in fig. 11.
The memory 1130 in the embodiment of the present application is used to store various types of data to support the operation of the controller 1100. Examples of such data include: any computer program for operating on the controller 1100.
It will be appreciated that the memory 1130 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 1130 described in embodiments herein is intended to comprise, without being limited to, these and any other suitable types of memory.
The method disclosed in the embodiments of the present application may be applied to the processor 1120, or implemented by the processor 1120. Processor 1120 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 1120. The processor 1120 described above may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. Processor 1120 may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium that is located in the memory 1130 and the processor 1120 reads the program in the memory 1130 to perform the steps of the method described above in conjunction with its hardware.
Optionally, when the processor 1120 executes the program, the corresponding processes implemented by the controller in the methods according to the embodiments of the present application are implemented, and for brevity, are not described herein again.
In an exemplary embodiment, the present application further provides a storage medium, specifically a computer storage medium, for example, a memory 1130 storing computer programs, which are respectively executable by the processor 1120 of the electronic device to perform the steps of the foregoing remote access method. The computer readable storage medium may be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, electronic device and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
Alternatively, the integrated units described above in the present application may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The technical means described in the embodiments of the present application may be arbitrarily combined without conflict. Unless otherwise specified and limited, the term "coupled" is to be construed broadly, e.g., as meaning electrical connections, or as meaning communications between two elements, either directly or indirectly through intervening media, as well as the specific meanings of such terms as understood by those skilled in the art.
In addition, in the examples of the present application, "first", "second", and the like are used for distinguishing similar objects, and are not necessarily used for describing a specific order or a sequential order. It should be understood that "first \ second \ third" distinct objects may be interchanged under appropriate circumstances such that the embodiments of the application described herein may be implemented in an order other than those illustrated or described herein.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Various combinations of the specific features in the embodiments described in the detailed description may be made without contradiction, for example, different embodiments may be formed by different combinations of the specific features, and in order to avoid unnecessary repetition, various possible combinations of the specific features in the present application will not be described separately.

Claims (10)

1. A link determining method applied to a controller, the method comprising:
sending a first message to at least one of the two switches; the first message is used for indicating the corresponding switch to modify the port configuration according to the set parameters; the two switches are interconnected with a second port of a second switch through a first port of a first switch;
after the first message is sent, receiving a second message reported by all or part of the two switches; the second message represents the port state change of the corresponding switch;
determining a link type between the first port and a second port based on the second message.
2. The method of claim 1,
the sending a first message to at least one of the two switches includes:
sending the first message to the first switch to cause the first switch to perform a first port configuration operation based on the first message; the first port configuration operation is characterized by being enabled after the first port is disabled;
the receiving of the second message reported by all or part of the two switches includes:
receiving the second message reported by the second switch; the second message characterizes a port state change of the second port.
3. The method of claim 2, wherein prior to said sending the first message to at least one of the two switches, the method further comprises:
sending a third message to the second switch; the third message is used for instructing the second switch to monitor the port state change of the second port.
4. The method of claim 2, wherein prior to receiving the second message reported by the second switch, the method further comprises:
sending a fourth message to the second switch; the fourth message is used for instructing the second switch to report the second message.
5. The method of any of claims 2 to 4, wherein the determining the type of link between the first port and the second port based on the second message comprises:
under the condition that the second message represents that the port state of the second port is changed from a normal working state to a non-working state and then to a normal working state, determining that the link type between the first port and the second port is a physical link;
and under the condition that the second message represents that the port state of the first port remains unchanged, determining that the link type between the first port and the second port is a logical link.
6. The method of claim 1,
the sending a first message to at least one of the two switches includes:
sending the first message to the first switch and the second switch to cause the switches to perform a second port configuration operation based on the first message; the second port configuration operation is characterized by modifying auto-negotiation parameters of the corresponding port;
the receiving of the second message reported by all or part of the two switches includes:
receiving the second messages reported by the first switch and the second switch; and the second message represents the change condition of the auto-negotiation parameters of the opposite terminal port monitored by the switch reporting the second message.
7. The method of claim 6, wherein the determining a link type between the first port and the second port based on the second message comprises:
determining that the link type between the first port and the second port is a physical link under the condition that the second message represents that the auto-negotiation parameter of the first port or the second port changes;
and under the condition that the second message characterizes that the auto-negotiation parameters of the first port and the second port are kept unchanged, determining that the link type between the first port and the second port is a logical link.
8. A link determining apparatus, comprising:
a first sending unit, configured to send a first message to at least one of the two switches; the first message is used for indicating the corresponding switch to modify the port configuration according to the set parameters; the two switches are interconnected with a second port of a second switch through a first port of a first switch;
the receiving unit is used for receiving a second message reported by all or part of the two switches after the first message is sent; the second message represents the port state change of the corresponding switch;
a determining unit, configured to determine a link type between the first port and the second port based on the second message.
9. A controller characterized by a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is configured to perform the steps of the link determination method according to any one of claims 1 to 7 when running the computer program.
10. A storage medium having stored thereon a computer program, characterized in that the computer program, when being executed by a processor, carries out the steps of the link determination method according to any one of claims 1 to 7.
CN202110424566.7A 2021-04-20 2021-04-20 Link determination method, device, controller and storage medium Pending CN113225210A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110424566.7A CN113225210A (en) 2021-04-20 2021-04-20 Link determination method, device, controller and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110424566.7A CN113225210A (en) 2021-04-20 2021-04-20 Link determination method, device, controller and storage medium

Publications (1)

Publication Number Publication Date
CN113225210A true CN113225210A (en) 2021-08-06

Family

ID=77088048

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110424566.7A Pending CN113225210A (en) 2021-04-20 2021-04-20 Link determination method, device, controller and storage medium

Country Status (1)

Country Link
CN (1) CN113225210A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102014024A (en) * 2010-12-03 2011-04-13 福建星网锐捷网络有限公司 Method, system and device for detecting network intercept of direct-connecting link and network equipment
CN105812201A (en) * 2014-12-31 2016-07-27 华为技术有限公司 Link state detection method, device and system
CN108337111A (en) * 2018-01-05 2018-07-27 新华三技术有限公司 Obtain the method and device of network node topology
US20190335386A1 (en) * 2018-04-25 2019-10-31 Hewlett Packard Enterprise Development Lp Protocol to detect if uplink is connected to 802.1d noncompliant device
US20200280568A1 (en) * 2017-09-18 2020-09-03 Cyber Sepio Systems Ltd Improved system, method, and computer program product for securing a computer system from threats introduced by malicious transparent network devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102014024A (en) * 2010-12-03 2011-04-13 福建星网锐捷网络有限公司 Method, system and device for detecting network intercept of direct-connecting link and network equipment
CN105812201A (en) * 2014-12-31 2016-07-27 华为技术有限公司 Link state detection method, device and system
US20200280568A1 (en) * 2017-09-18 2020-09-03 Cyber Sepio Systems Ltd Improved system, method, and computer program product for securing a computer system from threats introduced by malicious transparent network devices
CN108337111A (en) * 2018-01-05 2018-07-27 新华三技术有限公司 Obtain the method and device of network node topology
US20190335386A1 (en) * 2018-04-25 2019-10-31 Hewlett Packard Enterprise Development Lp Protocol to detect if uplink is connected to 802.1d noncompliant device

Similar Documents

Publication Publication Date Title
US20200267069A1 (en) Link switching method, link switching device, network communication system, and computer-readable storage medium
CN101908986B (en) Method and equipment for detecting link fault
US11706080B2 (en) Providing dynamic serviceability for software-defined data centers
CN109960634A (en) A kind of method for monitoring application program, apparatus and system
CN112333013B (en) Self-adaptive networking method, device, router and storage medium
CN103686854A (en) Method and device for controlling AP
CN105897623B (en) A kind of transmission method and device of data
CN109194497A (en) Double SRIO Network Backup Systems of software-oriented radio system
CN113746821A (en) Intelligent device control method and device, storage medium and electronic device
CN113645048B (en) Network card switching method and device and field programmable gate array FPGA
CN113225210A (en) Link determination method, device, controller and storage medium
CN116137603B (en) Link fault detection method and device, storage medium and electronic device
CN111949449A (en) Firmware recovery method, device, system, computer equipment and storage medium
CN111262745A (en) Information processing platform redundancy system design
CN114124803B (en) Device management method and device, electronic device and storage medium
CN115599494A (en) Virtual machine migration method and device, upgrading method and server
CN114257500A (en) Fault switching method, system and device for internal network of super-converged cluster
CN107248935B (en) System and method for network management to discover and monitor network elements
CN106250255B (en) A kind of management method and device of system exception
TW201021467A (en) Method for recovering electric power equipment automatically
Kitamura Configuration of a Power-saving High-availability Server System Incorporating a Hybrid Operation Method
CN114817096B (en) System, method, equipment and computer readable medium for switching serial ports of BMC and BIOS
CN116719403B (en) Method, device, equipment and medium for repairing abnormal state of VR power supply
CN109274516B (en) Extended network bridge and online control method thereof
CN115729737A (en) Fault alarm processing method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210806

RJ01 Rejection of invention patent application after publication