Identification method, switch, network and computer readable storage medium

By sending parameter changes and altering port states between switches that support the LLDP protocol, unknown devices in the link layer can be identified, solving the problem of existing technologies being unable to identify devices that do not support the protocol and improving data transmission security.

CN115801703BActive Publication Date: 2026-02-24FS COM LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211260793.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-14
Publication Date
2026-02-24
Estimated Expiration
2042-10-14

AI Technical Summary

Technical Problem

In existing technologies, link layer discovery protocols or private probe protocols cannot identify unsupported network devices, resulting in the presence of unknown devices in the link and affecting data transmission security.

Method used

The first switch sends modified parameters to the second switch, changes the output port status of the first switch, and identifies the presence of intermediate devices by comparing the port status changes. The identification is performed using the configuration information of the storage device of the switch that supports the LLDP protocol.

Benefits of technology

It achieves the goal of identifying unknown devices in the link layer, thereby improving the security of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115801703B_ABST
    Figure CN115801703B_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of network communication, and provides a recognition method, a switch, a network and a computer readable storage medium, which comprises the following steps: a first switch sends a change parameter to a second switch, the first switch changes a port state of a first output port of the first switch according to the change parameter, and the second switch determines whether there is unknown equipment between the second switch and the first switch according to the port state of a second input port of the second switch and the change parameter. The recognition method provided by the application realizes the purpose of recognizing unknown equipment in the link layer by changing the state of the port, and improves the security of data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of network communication technology, and in particular relates to identification methods, switches, networks and computer-readable storage media. Background Technology

[0002] With the continuous development of network communication technology, the number of device layers in the network is also expanding with the increase in terminals. Due to the wide variety and complex configuration of network devices, the Link Layer Discovery Protocol (LLDP) or proprietary probe protocols are currently used to identify all network devices in the network link layer and determine the link layer topology by probing the connection relationships between devices in the network.

[0003] However, when there are network devices in the link layer that do not support the link layer discovery protocol or the private probe protocol, other network devices cannot identify the device through the link layer discovery protocol or the private probe protocol, resulting in the presence of unknown devices in the link and affecting the security of data transmission. Summary of the Invention

[0004] This application provides an identification method, a switch, a network, and a computer-readable storage medium. By changing the port status, it achieves the purpose of identifying unknown devices in the network and improves the security of data transmission.

[0005] In a first aspect, embodiments of this application provide an identification method applied to a preset network, the preset network including a first switch and a second switch, the method comprising:

[0006] The first switch sends the changed parameters to the second switch;

[0007] The first switch changes the port status of the first output port according to the changed parameters. The port status of the first output port is consistent with the port status of the first input port. The first input port is the input port of the first terminal that is physically connected to the first switch.

[0008] The second switch determines the identification result based on the port status of the second input port of the second switch and the changed parameters, wherein the identification result is used to indicate whether the second switch is the first terminal or the second switch is not the first terminal.

[0009] It should be understood that when the first output port is directly connected to the second input port, that is, when there is no intermediate device between the first switch and the second switch, the second input port will change with the change of the parameters of the first output port. The port status changes of the first output port and the second input port are consistent. Therefore, the second switch can obtain the status of the first output port after the change by receiving the changed parameters, and confirm whether there is an intermediate device between the first switch and the second switch by comparing the port status of the second input port with the status of the first output port after the change.

[0010] In one possible implementation of the first aspect, the first switch sends change parameters to the second switch, including:

[0011] The first switch obtains the index number of the first output port and the port change information;

[0012] The first switch determines the index number of the second input port based on the index number of the first output port;

[0013] The first switch generates the change parameters based on the index number of the second input port and the port change information;

[0014] The first switch sends the changed parameters to the second switch.

[0015] In one possible implementation of the first aspect, the first switch sends the changed parameters to the second switch, including:

[0016] The first switch obtains the physical address of the second switch;

[0017] The first switch sends the changed parameters to the second switch based on the physical address of the second switch.

[0018] It should be understood that the first switch and the second switch are network devices that support the LLDP protocol. Both the first switch and the second switch store the device configuration information of adjacent devices, including the physical address of the device and the index number of the connection port, as well as other device information.

[0019] In one possible implementation of the first aspect, the port change information includes a change type and a change value, wherein the change type includes a port rate and the change value includes a transmission rate value.

[0020] Accordingly, the second switch determines the identification result based on the port status of the second input port of the second switch and the changed parameters, including:

[0021] The second switch obtains the port rate of the second input port;

[0022] The second switch determines the identification result based on the port rate of the second input port and the transmission rate value.

[0023] In one possible implementation of the first aspect, the change type includes a port transmission type, and the change value includes a transmission type value;

[0024] Accordingly, the second switch determines the identification result based on the port status of the second input port of the second switch and the changed parameters, including:

[0025] The second switch obtains the port transmission type of the second input port;

[0026] The second switch determines the identification result based on the port transmission type of the second input port and the transmission type value.

[0027] In one possible implementation of the first aspect, the port status of the second input port further includes a port status change flag, which is used to indicate whether there is a port status change of the second input port within a preset time period;

[0028] Accordingly, the second switch determines the identification result based on the port status of the second input port of the second switch and the changed parameters, including:

[0029] When the change type is port rate, if the second switch determines that the port rate of the obtained second input port is consistent with the transmission rate value, and the port state change flag is the first preset flag, then the identification result is determined to be that the second switch is the first terminal.

[0030] When the change type is port transmission type, if the second switch determines that the port transmission type of the obtained second input port is consistent with the transmission type value, and the port status change flag is the second preset flag, then the identification result is determined to be that the second switch is the first terminal;

[0031] When the change type is port rate, if the second switch determines that the port rate of the obtained second input port is consistent with the transmission rate value, and the port state change flag is the third preset flag, then the identification result is determined to be that the second switch is not the first terminal.

[0032] When the change type is port transmission type, if the second switch determines that the port transmission type of the obtained second input port is consistent with the transmission type value, and the port state change flag is the fourth preset flag, then the identification result is determined to be that the second switch is not the first terminal.

[0033] In one possible implementation of the first aspect, the preset network further includes a network management server;

[0034] After the second switch determines the identification result based on the port status of the second input port of the second switch and the changed parameters, the process further includes:

[0035] If the identification result determined by the second switch is that the second switch is not the first terminal, then the second switch sends the identification result to the network management server;

[0036] The network management server confirms the topology of the preset network based on the identification results.

[0037] Secondly, embodiments of this application provide a switch, including an interface module and a control module:

[0038] The interface module includes at least one port for connecting to a port of a switch;

[0039] The control module includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the identification method executed by the first switch in the first aspect, or the identification method executed by the second switch in any of the second aspects.

[0040] Thirdly, embodiments of this application provide a network including at least two switches as described in the second aspect.

[0041] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the identification method executed by the first switch in the first aspect, or the identification method executed by the second switch in any of the second aspects.

[0042] It is understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.

[0043] The beneficial effects of this application's embodiments compared to existing technologies are as follows: By configuring the first switch to send changed parameters to the second switch, the first switch changes the port state of its first output port according to the changed parameters. Since the port state of the first output port is consistent with the port state of the first input port (the input port of the first terminal physically connected to the first switch), the second switch compares the port state of its second input port with the changed parameters of the first output port to confirm whether there is an intermediate device between the first and second switches. The identification method provided in this application achieves the purpose of identifying unknown devices in the link layer by changing the port state, thereby improving the security of data transmission. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 This is a schematic diagram of the switch connection relationship provided in the embodiments of this application. Figure 1 ;

[0046] Figure 2 This is a schematic diagram of the switch connection relationship provided in the embodiments of this application. Figure 2 ;

[0047] Figure 3 This is a flowchart illustrating the identification method provided in the embodiments of this application. Figure 1 ;

[0048] Figure 4 This is a flowchart illustrating the identification method provided in the embodiments of this application. Figure 2 ;

[0049] Figure 5 This is a schematic diagram of the structure of the switch provided in the embodiment of this application. Detailed Implementation

[0050] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0051] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0052] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0053] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0054] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0055] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.

[0056] In existing technologies, the link layer is used to provide data transmission services to the network layer on top of the services provided by the physical layer, reliably transmitting data from the network layer to the network layer of adjacent nodes. For example, network devices in the link layer typically use the Link Layer Discovery Protocol (LLDP) to announce device information to neighboring devices, enabling the network devices to store the device configuration information of neighboring devices for querying by the network management system and determining the communication status of the link.

[0057] For example, a network device at the link layer can be a switch or a router. Figure 1 This is a schematic diagram of the switch connection relationship provided in the embodiments of this application. Figure 1In this embodiment of the invention, the preset network includes a first switch 101 and a second switch 102. In one possible scenario, such as... Figure 1 As shown, there is no intermediate device between the first switch 101 and the second switch 102; that is, the first output port of the first switch 101 is directly connected to the second input port of the second switch 102. Figure 1 In the example scenario, the second input port of the second switch 102 changes according to the state of the first output port of the first switch 101. Figure 2 This is a schematic diagram of the switch connection relationship provided in the embodiments of this application. Figure 2 In another possible scenario, such as Figure 2 As shown, the preset network includes a first switch 101, a second switch 102, and a third switch 103, wherein the third switch 103 does not support the LLDP protocol. The first output port of the first switch 101 is connected to the first input port of the third switch 103, and the second output port of the third switch 103 is connected to the second input port of the second switch 102. Figure 2 In the example scenario, when the state of the first output port of the first switch 101 changes, the port state of the second input port of the second switch 102 will not change because there is a third switch 103 between the first switch 101 and the second switch 102. Figure 1 and Figure 2 In two example scenarios, this embodiment of the invention proposes a method to determine whether there is an unknown device between the first switch and the second switch by changing the state of the first output port of the first switch and setting the second switch to compare the state of the second input port with the state of the first output port.

[0058] Figure 3 This is a flowchart illustrating the identification method provided in the embodiments of this application. Figure 1 .like Figure 3 As shown, the identification method provided in this application embodiment may include the following steps:

[0059] S301: The first switch sends the changed parameters to the second switch.

[0060] In this embodiment of the invention, a connection is established between the first switch at the link layer and the configuration terminal. An identification command can be entered into the command-line interface of the configuration terminal. This command includes port change information for the first output port. For example, the identification command also includes the index number of the first output port whose status needs to be changed. It should be noted that the identification command is a switch control command configured in this embodiment of the invention for identifying network devices. Both the first switch and the second switch are network devices that support the identification command and are capable of correctly parsing it.

[0061] For example, after parsing the identification command, the first switch obtains the index number of the first output port and the port change information. It should be noted that both the first and second switches are link-layer devices supporting the LLDP protocol. The first switch stores device information for all adjacent devices communicating with it. Therefore, the first switch can determine the index number of the second input port based on the device information of the second switch communicating with the first output port. The first switch then generates change parameters based on the index number of the second input port and the port change information.

[0062] In this embodiment of the invention, the specific process of the first switch sending changed parameters to the second switch is as follows: the first switch obtains the physical address of the second switch based on the stored device information of the second switch, and then sends the changed parameters to the second switch based on the physical address of the second switch. For example, the first switch generates a transmission message based on the changed parameters, using the pre-stored physical addresses of the first and second switches as the source and destination addresses of the transmission message, respectively, and sends the message to be transmitted to the second switch. It should be noted that the transmission message also includes the network type of a preset network. For example, if the preset network where the first and second switches are located is Ethernet, the transmission message also includes an Ethernet type parameter.

[0063] S302: The first switch changes the port status of the first output port of the first switch according to the changed parameters. The port status of the first output port is consistent with the port status of the first input port. The first input port is the input port of the first terminal that is physically connected to the first switch.

[0064] In this embodiment of the invention, after sending the change parameters to the second switch, the first switch changes the port status of its first output port according to the change parameters. It should be noted that the port change information in the change parameters is used to instruct the first switch to change the status of the first output port. For example, the port change information includes a change type and a change value, where the change type matches the change value. Specifically, the change type can be port rate and / or port transmission type, and correspondingly, the change value is the transmission rate value and / or transmission type value. For example, a transmission type value of 1 or 2, where a transmission type value of 1 represents a half-duplex transmission type, and a transmission type value of 2 represents a full-duplex transmission type.

[0065] For example, the specific process by which the first switch changes the port status of its first output port according to the changed parameters is as follows: The change type and corresponding change value in the port change information are confirmed. For instance, if the change type is port speed and the change value is 1000M, the first switch will change the port speed of the first output port to 1000M; if the change type is port transmission type and the change value is 2, the first switch will change the port transmission type of the first output port to full-duplex transmission type; if the change type includes both port speed and port transmission type, and the change value includes both 1000M and 2, the first switch will change the port speed of the first output port to 1000M and simultaneously change the port transmission type to full-duplex transmission type.

[0066] It should be noted that the first input port of the first terminal is the port physically connected to the first output port. Since the port states of the two directly connected ports are completely identical, when the port state of the first output port changes, the first input port of the first terminal will also change accordingly.

[0067] S303: The second switch determines the identification result based on the port status and changed parameters of the second input port of the second switch. The identification result is used to indicate whether the second switch is the first terminal or the second switch is not the first terminal.

[0068] For example, the specific process by which the second switch determines the identification result based on the port status and changed parameters of the second input port is as follows: if the change type is port rate, the second switch obtains the port rate of the second input port and determines the identification result based on the port rate and transmission rate value of the second input port; if the change type is port transmission type, the second switch obtains the port transmission type of the second input port and determines the identification result based on the port transmission type and transmission type value of the second input port.

[0069] In this embodiment of the invention, the identification result is used to indicate whether the second switch is a first terminal directly connected to the first switch. When the second switch determines that the port rate of the second input port is consistent with the transmission rate value in the port change information, it indicates that the change of the second input port of the second switch is consistent with the port status change of the first input port. The identification result determined by the second switch is that the second switch is the first terminal, that is, there is no intermediate device between the first switch and the second switch. Figure 1The example illustrates the connection relationship between the first and second switches. Correspondingly, if the second switch determines that the port rate of its second input port is inconsistent with the transmission rate value in the port change information, it indicates that the second input port of the second switch has not changed according to the port status of the first output port. The identification result determined by the second switch is that the second switch is not the first terminal, meaning that there is an intermediate device between the first and second switches, such as... Figure 2 The example shows the connection relationships between the first switch, the second switch, and the third switch.

[0070] The identification method provided in this embodiment involves setting a first switch to send changed parameters to a second switch. The first switch changes the port status of its first output port according to the changed parameters. Since the port status of the first output port is consistent with the port status of the first input port (the input port of the first terminal physically connected to the first switch), the second switch compares the port status of its second input port with the changed parameters of the first output port to confirm whether there is an intermediate device between the first switch and the second switch. This achieves the purpose of identifying unknown devices in the link layer and improves the security of data transmission.

[0071] In one possible design, the port status of the second input port obtained by the second switch also includes a port status transition flag, which indicates whether there is a port status transition of the second input port within a preset time period. Figure 3 Based on the identification method provided in the embodiment, the specific process of determining the identification result according to the port state change flag is as follows:

[0072] When the change type is port rate, if the second switch determines that the port rate of the obtained second input port is consistent with the transmission rate value, and the port status change flag is the first preset flag, then the identification result is determined that the second switch is the first terminal; when the change type is port transmission type, if the second switch determines that the port transmission type of the obtained second input port is consistent with the transmission type value, and the port status change flag is the second preset flag, then the identification result is determined that the second switch is the first terminal; when the change type is port rate, if the second switch determines that the port rate of the obtained second input port is consistent with the transmission rate value, and the port status change flag is the third preset flag, then the identification result is determined that the second switch is not the first terminal; when the change type is port transmission type, if the second switch determines that the port transmission type of the obtained fourth input port is consistent with the transmission type value, and the port status change flag is the second preset flag, then the identification result is determined that the second switch is not the first terminal.

[0073] In this embodiment of the invention, the second switch monitors the changes in the change type, change parameters, and enable state of the second input port within a preset time period to determine the corresponding port state change flag. For example, the port state change flag includes a first preset flag, a second preset flag, a third preset flag, and a fourth preset flag. It should be noted that since changes in the state of the second input port affect its enable state, this embodiment of the invention can further improve the accuracy of the identification results by monitoring changes in the enable state of the second input port. Specifically, within the preset time period, if the second switch detects that the enable state of the second input port has at least one open state and at least one closed state, it indicates that the enable state of the second input port has also changed; if the second switch detects that the enable state of the second input port has not changed within the preset time period, remaining either open or closed, it indicates that the enable state of the second input port has not changed.

[0074] For example, the first preset flag indicates that the port rate of the second input port has changed within a preset time period, and the enable state of the second input port has also changed. When the port state change flag is the first preset flag, the identification result generated by the second switch is that the second switch is the first terminal, such as... Figure 1 The example shows the connection relationship between the first switch and the second switch.

[0075] For example, the second preset flag indicates that the port transmission type of the second input port has changed within a preset time period, and the enable state of the second input port has also changed. When the port state change flag is the second preset flag, the identification result generated by the second switch is that the second switch is the first terminal, such as... Figure 1 The example shows the connection relationship between the first switch and the second switch.

[0076] For example, the third preset flag indicates that the port rate of the second input port has changed within a preset time period, but the enable state of the second input port has not changed. When the port state change flag is the third preset flag, the identification result generated by the second switch is that the second switch is not the first terminal, such as... Figure 2 The example shows the connection relationship between the first switch and the second switch.

[0077] For example, the fourth preset flag indicates that the port transmission type of the second input port has changed within a preset time period, but the enabled state of the second input port has not changed. When the port state change flag is the fourth preset flag, the identification result generated by the second switch is that the second switch is not the first terminal, such as... Figure 2 The example shows the connection relationship between the first switch and the second switch.

[0078] The identification method provided in this embodiment improves the accuracy of the identification results by setting a second switch to further determine the identification results based on the change type, change value, and port status change flag of the second input port contained in the port change information.

[0079] Figure 4 This is a flowchart illustrating the identification method provided in the embodiments of this application. Figure 2 .exist Figure 3 Based on the identification method provided in the embodiment, after the S303 second switch determines the identification result according to the port status and changed parameters of the second input port of the second switch, as follows: Figure 4 As shown, it also includes:

[0080] S401: If the identification result determined by the second switch is that the second switch is not the first terminal, then the second switch will send the identification result to the network management server.

[0081] S402: The network management server confirms the topology of the preset network based on the identification results.

[0082] In this embodiment of the invention, the preset network also includes a network management server. For example, when the second switch determines that it is not the first terminal, meaning there is an unknown intermediate device between the first and second switches, the second switch promptly sends the identification result to the network management server in the background network management center. This allows the network management server to reconfirm the link layer topology based on the identification result. Specifically, the network management server determines the physical address of the intermediate device based on the physical addresses of the first and second switches, and sends a query command to the intermediate device to obtain its device parameters, thereby reconfirming the link layer topology.

[0083] The identification method provided in this embodiment, when it is confirmed that there is an unknown intermediate device between the first switch and the second switch, promptly sends the identification result to the network management server, so that the network management server can confirm the topology of the preset network based on the identification result, thereby improving the topology of the link layer and enhancing data transmission security.

[0084] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0085] Figure 5 This is a schematic diagram of the structure of the switch provided in an embodiment of this application. Figure 5As shown, the switch 50 in this embodiment includes an interface module 51 and a control module 52. The interface module 51 includes at least one port for connecting to a port of the switch. The control module 52 includes at least one processor 521. Figure 5 (Only one is shown in the diagram), memory 522, and computer program 523 stored in the memory 522 and executable on the at least one processor 521, wherein the processor 521 executes the computer program 523 to implement the steps executed by the first switch or the steps executed by the second switch in any of the above-described identification method embodiments.

[0086] The processor 521 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0087] In some embodiments, the memory 522 may be an internal storage unit of the switch 50, such as a hard drive or memory of the switch 50. In other embodiments, the memory 522 may be an external storage device of the switch 50, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the switch 50. Furthermore, the switch 50 may include both internal storage units and external storage devices. The memory 522 is used to store the operating system, applications, boot loader, data, and other programs, such as the program code of the computer program. The memory 522 can also be used to temporarily store data that has been output or will be output.

[0088] This application also provides a network comprising at least two... Figure 5 The switch described in the embodiment.

[0089] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the steps executed by the first switch or the second switch in any of the above-described identification method embodiments.

[0090] This application provides a computer program product that, when run on a terminal device, enables the terminal device to execute the steps performed by the first switch or the second switch in any of the above-described identification method embodiments.

[0091] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / terminal equipment, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0092] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0093] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0094] In the embodiments provided in this application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0095] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0096] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A recognition method, characterized in that, Applied to a preset network, the preset network including a first switch and a second switch, the method includes: The first switch sends the changed parameters to the second switch; The first switch changes the port status of the first output port according to the changed parameters. The port status of the first output port is consistent with the port status of the first input port. The first input port is the input port of the first terminal physically connected to the first switch. The first input port is the port physically connected to the first output port. The second switch determines the identification result based on the port status of the second input port of the second switch and the changed parameters, wherein the identification result is used to indicate whether the second switch is the first terminal or the second switch is not the first terminal; The first switch sends change parameters to the second switch, including: the first switch obtaining the physical address of the second switch; and the first switch sending the change parameters to the second switch based on the physical address of the second switch.

2. The identification method as described in claim 1, characterized in that, The first switch sends changed parameters to the second switch, including: The first switch obtains the index number of the first output port and the port change information; The first switch determines the index number of the second input port based on the index number of the first output port; The first switch generates the change parameters based on the index number of the second input port and the port change information; The first switch sends the changed parameters to the second switch.

3. The identification method as described in claim 2, characterized in that, The port change information includes the change type and the change value. The change type includes the port rate, and the change value includes the transmission rate value. Accordingly, the second switch determines the identification result based on the port status of the second input port of the second switch and the changed parameters, including: The second switch obtains the port rate of the second input port; The second switch determines the identification result based on the port rate of the second input port and the transmission rate value.

4. The identification method as described in claim 3, characterized in that, The change type includes port transmission type, and the change value includes transmission type value; Accordingly, the second switch determines the identification result based on the port status of the second input port of the second switch and the changed parameters, including: The second switch obtains the port transmission type of the second input port; The second switch determines the identification result based on the port transmission type of the second input port and the transmission type value.

5. The identification method as described in claim 4, characterized in that, The port status of the second input port also includes a port status change flag, which is used to indicate whether the port status of the second input port changes within a preset time period; Accordingly, the second switch determines the identification result based on the port status of the second input port of the second switch and the changed parameters, including: When the change type is port rate, if the second switch determines that the port rate of the obtained second input port is consistent with the transmission rate value, and the port state change flag is the first preset flag, then the identification result is determined to be that the second switch is the first terminal. When the change type is port transmission type, if the second switch determines that the port transmission type of the obtained second input port is consistent with the transmission type value, and the port status change flag is the second preset flag, then the identification result is determined to be that the second switch is the first terminal; When the change type is port rate, if the second switch determines that the port rate of the obtained second input port is consistent with the transmission rate value, and the port state change flag is the third preset flag, then the identification result is determined to be that the second switch is not the first terminal. When the change type is port transmission type, if the second switch determines that the port transmission type of the obtained fourth input port is consistent with the transmission type value, and the port status change flag is the second preset flag, then the identification result is determined to be that the second switch is not the first terminal.

6. The identification method according to any one of claims 1 to 5, characterized in that, The preset network also includes a network management server; After the second switch determines the identification result based on the port status of the second input port of the second switch and the changed parameters, the process further includes: If the identification result determined by the second switch is that the second switch is not the first terminal, then the second switch sends the identification result to the network management server; The network management server confirms the topology of the preset network based on the identification results.

7. A switch, characterized in that, Includes interface modules and control modules; The interface module includes at least one port, which is used to connect to other switches; The control module includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the identification method performed by the first switch as claimed in any one of claims 1 to 6, or the identification method performed by the second switch as claimed in any one of claims 1 to 6.

8. A network system, characterized in that, It includes at least two switches as described in claim 7.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the identification method executed by the first switch as described in any one of claims 1 to 6, or the identification method executed by the second switch as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Link determination method and device, controller and storage medium

    CN113225210A