Physical network topology discovery method and system based on machine learning

Through machine learning algorithms, analyzing the traffic speed of switch ports and building a classifier model, solving the accuracy and efficiency problems of physical network topology discovery in the existing technology, and achieving efficient and accurate physical network topology generation.

CN120342884APending Publication Date: 2025-07-18SHANGHAI INST OF ELECTROMECHANICAL ENG
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510470748.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The existing physical network topology discovery methods have problems such as poor accuracy, low efficiency and low accuracy. Especially when there are many network devices, it is impossible to effectively generate an accurate physical network topology.

Method used

Using machine learning, we collect the switch's port traffic speed time series, build a classifier model, use the training set to classify the difference time series, generate a physical network topology, and avoid dependence on network protocols and device models.

Benefits of technology

It realizes efficient and accurate physical network topology generation, can process large amounts of sample data, ensure the correctness of classification results, and is suitable for switches without specific functions enabled.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120342884A_ABST
    Figure CN120342884A_ABST
Patent Text Reader

Abstract

The invention provides a physical network topology discovery method and system based on machine learning, and the method comprises the steps: carrying out the improvement of a physical network topology discovery method based on port flow speed, building a classifier model, carrying out the generation of a physical network topology through a machine learning mode, and guaranteeing the correctness of a classification result. And the physical network topology generation process is more efficient. The problem that network protocols and network equipment models depend on in the physical network topology discovery process is avoided, the physical network topology is generated in a machine learning mode, the correctness of the classification result is ensured, and the physical network topology generation process is more efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer networks, and more specifically, to a method and system for physical network topology discovery based on machine learning. Background Art

[0002] The physical network topology consists of switches, terminal devices, etc. within the same subnet, and is a simplified model reflecting the overall network structure. The automatic generation of the physical network topology of an unknown subnet is a prerequisite for network management work and also plays a key role in network operation and maintenance work. Commonly used physical network topology discovery methods mainly include the method based on the Address Forward Table (AFT), the method based on the Internet Control Message Protocol (ICMP), and the method based on port traffic.

[0003] The implementation process of the network topology discovery method based on the address forward table is relatively simple. The AFT of network devices records data such as the address forward table data and interface configuration information of the devices. Administrators can obtain the AFT data of each network device through the Simple Network Management Protocol (SNMP), and parse the physical network topology structure from the AFT data. However, since the AFT data contains virtual device information, and in the case of a large number of network devices, the AFT cannot record all address forwarding information, resulting in a problem of poor accuracy of the physical network topology.

[0004] ICMP is used to transfer control information between IP hosts and network switching devices. By sending an ICMP probe message from the source site to the destination site, the routing situation between the source site and the destination site is determined based on multiple hop sites in the path information returned by the network device. Since this method requires sending probe messages to all sites in the network to generate a complete physical network topology structure, it will increase the network load and the efficiency is low.

[0005] The physical network topology discovery method based on port traffic can be implemented without relying on a specific network protocol and the device models in the network. This method analyzes the port traffic between two devices to determine whether there is a physical association between the devices, and then generates a physical topology structure. Due to factors such as the network packet loss rate and the asynchronous acquisition time of the port traffic of each device, the traffic of two connected ports is not the same. During the similarity matching process, it is impossible to set a clear similarity threshold, resulting in a low accuracy rate of the physical network topology.

[0006] Patent Document CN101873230B (Application No.: 201010225146.8) discloses a method and apparatus for discovering a physical network topology. The method includes: taking a subnet as a unit, automatically discovering the physical network topology of the subnet according to the media access control address forwarding table and the address resolution protocol table of network devices in the subnet; analyzing the discovery result of the physical network topology of the subnet to obtain the physical network topology of the entire network. The apparatus includes: a subnet physical network topology discovery module and an entire network physical network topology acquisition module.

[0007] Through the analysis of the above various physical network topology generation methods, it can be seen that there are certain drawbacks in the prior art. At the same time, considering the relatively high maturity of current machine learning algorithms, therefore, the present invention adopts the method of machine learning, aims to solve the defects of the above physical network topology discovery method, and proposes a physical network topology discovery method and system based on machine learning. Summary of the Invention

[0008] Aiming at the defects in the prior art, the object of the present invention is to provide a physical network topology discovery method and system based on machine learning.

[0009] According to a physical network topology discovery method based on machine learning provided by the present invention, it includes:

[0010] Step S1: Collect the port traffic speed time series of each switch in the network, and the port traffic speed time series includes: port inflow speed time series and port outflow speed time series;

[0011] Step S2: Calculate the difference time series based on the port inflow speed time series and the port outflow speed time series between two ports of different switches;

[0012] Step S3: Build a classifier model based on machine learning, build a training set based on the difference time series corresponding to two switch ports with actual physical relationships and the difference time series corresponding to two switch ports without actual physical relationships, and use the training set to train the classifier model to obtain the trained classifier model;

[0013] Step S4: Obtain the port inflow speed time series and the port outflow speed time series of all switch ports in the target subnet whose port mode is not access; and preprocess the obtained port inflow speed time series and port outflow speed time series to obtain the preprocessed port inflow speed time series and port outflow speed time series;

[0014] Step S5: Generate a binary array of physical relationship ports to be confirmed, calculate the difference time series of the port inflow velocity time series and the port outflow velocity time series corresponding to each binary number in the binary array, and input the difference time series into the trained classifier model to obtain a set R of binary numbers with a classification result of 1;

[0015] Step S6: For each binary number in the set R of binary numbers, find the set SB(sn) of switch binary numbers corresponding to it, where sn = 0, 1,..., v, and remove duplicate binary numbers;

[0016] Step S7: Generate a physical network topology using a preset structure matrix and output the physical network topology.

[0017] Preferably, the port inflow velocity time series includes:

[0018]

[0019] The port outflow velocity time series includes:

[0020]

[0021] Wherein, represents the port inflow velocity time series; represents the port outflow velocity time series; p is the port label, and the time interval between two time points t = n - 1 and t = n is Δt.

[0022] Preferably, the step S2 includes:

[0023]

[0024] Wherein, r, d ∈ p, and r and d do not belong to the same switch.

[0025] Preferably, the training set constructed based on the difference time series includes a positive sample set and a negative sample set;

[0026] The positive sample set includes: Let r' and d' be two switch ports with an actual physical relationship, and calculate the difference time series S r′,d′ (t) based on the switch port r' and the switch port d'; Let ΔL ∈ R be the length of the sample difference time series, ΔL ≤ t, and use ΔL as the window with a step size of 1 to translate and intercept the sample difference time series on S r′,d′ (t), then t - ΔL + 1 sample difference time series are formed. By setting different r' and d', more sample difference time series can be obtained to form the positive sample set K 1(s), where s = 0, 1,..., l, and generate a sequence of length l with all elements being 1 as the labeled sequence L of the positive sample set 1 (s);

[0027] The negative sample set includes: Let r″ and d″ be two switch ports that do not have an actual physical relationship. According to the generation method of the aforementioned positive sample set, an anti-sample set K of length l is obtained 0 (s) and the labeled sequence L of the anti-sample set 0 (s).

[0028] Preferably, in step S4, the switch port mode is the link type of the switch Ethernet port, including: access mode, trunk mode, and hybrid mode;

[0029] The access mode only allows one Vlan to pass through;

[0030] The trunk mode and the hybrid mode allow multiple Vlans to pass through.

[0031] Preferably, in step S4, the obtained port inflow speed time series and port outflow speed time series are preprocessed to obtain the preprocessed port inflow speed time series and port outflow speed time series, including:

[0032] Perform data cleaning on the obtained port inflow speed time series and port outflow speed time series, remove the time series with all elements being zero in the port inflow speed time series and port outflow speed time series, and remove the corresponding ports.

[0033] Preferably, step S5 includes: Let <r, d> be a binary number composed of two ports whose physical relationship needs to be confirmed, where r ≠ d and r and d do not belong to the same switch. Generate binary numbers for all ports in p to obtain a binary array set P(dn) of size h, dn = 0, 1,..., h - 1.

[0034] Preferably, step S7 includes:

[0035] Step S7.1: Let DSM(i, j) n×n be a zero matrix, where n is the number of switches in SB(sn), i and j are switch numbers, the left list of the matrix represents the switch receiving traffic, and the upper list of the matrix represents the switch outputting traffic;

[0036] Step S7.2: Construct a design structure matrix, and for all binary numbers in SB(sn), set DSM(i, j) n×n = 1;

[0037] Step S7.3: Swap DSM(i,j) n×n The rows and columns of make it a lower triangular matrix;

[0038] Step S7.4: Find DSM(i,j) n×n The switch number corresponding to the row where all elements are 0 is the first-layer switch;

[0039] Step S7.5: DSM(i,j) n×n The row numbers corresponding to the coordinates whose first column elements are 1 are the second-layer switches, and the others are the third-layer switches.

[0040] A physical network topology discovery system based on machine learning is provided according to the present invention, comprising:

[0041] Module M1: Collecting the port flow speed time series of each switch in the network, wherein the port flow speed time series includes: port inflow speed time series and port outflow speed time series;

[0042] Module M2: Calculate the difference time series based on the port inflow speed time series and the port outflow speed time series between two ports of different switches;

[0043] Module M3: constructing a classifier model based on machine learning, constructing a training set based on a difference time series corresponding to two switch ports having an actual physical relationship and a difference time series corresponding to two switch ports having no actual physical relationship, and training the classifier model using the training set to obtain a trained classifier model;

[0044] Module M4: obtaining the port inflow speed time series and port outflow speed time series of all switches in the target subnet whose port mode is not access; and preprocessing the obtained port inflow speed time series and port outflow speed time series to obtain the preprocessed port inflow speed time series and port outflow speed time series;

[0045] Module M5: Generate a binary array of ports with physical relations to be confirmed, and for each binary number in the binary array, obtain a spherical difference value time series of the port inflow velocity time series and the port outflow velocity time series, and input the difference value time series into the trained classifier model to obtain a binary number set R with a classification result of 1;

[0046] Module M6: for each binary number in the binary number set R, find the corresponding set of switch binary numbers SB(sn), sn=0,1,...,v, and remove duplicate binary numbers;

[0047] Module M7: Generate a physical network topology structure using a preset structure matrix and output the physical network topology structure.

[0048] Preferably, the training set constructed based on the difference time series includes a positive sample set and a negative sample set;

[0049] The positive sample set includes: Let r' and d' be two switch ports with an actual physical relationship. Calculate the difference time series S r′,d′ (t) based on the switch port r' and the switch port d'; Let ΔL ∈ R be the length of the sample difference time series, ΔL ≤ t. With ΔL as the window and a step size of 1, translate and intercept the sample difference time series on S r′,d′ (t), then t - ΔL + 1 sample difference time series are formed. By setting different r' and d', more sample difference time series can be obtained to form the positive sample set K 1 (s), where s = 0, 1,..., l, and generate a sequence of length l with all elements being 1 as the label sequence L 1 (s);

[0050] The negative sample set includes: Let r'' and d'' be two switch ports without an actual physical relationship. According to the generation method of the aforementioned positive sample set, obtain the anti-sample set K of length l 0 (s) and the label sequence L of the anti-sample set 0 (s);

[0051] The module M5 includes: Let <r, d> be a binary number composed of two ports whose physical relationship needs to be confirmed, where r ≠ d and r and d do not belong to the same switch. Generate binary numbers for all ports in p to obtain a binary array set P(dn) of size h, dn = 0, 1,..., h - 1;

[0052] The module M7 includes:

[0053] Module M7.1: Let DSM(i, j) n×n be a zero matrix, where n is the number of switches in SB(sn), i and j are switch numbers, the left list of the matrix represents the switch receiving traffic, and the upper list of the matrix represents the switch outputting traffic;

[0054] Module M7.2: Construct a design structure matrix. For all binary numbers in SB(sn), set DSM(i, j) n×n = 1;

[0055] Module M7.3: Swap the rows and columns of DSM(i, j) n×n to make it a lower triangular matrix;

[0056] Module M7.4: Find DSM(i, j) n×nThe switch numbers corresponding to the rows with all elements being 0 are the first - layer switches;

[0057] Module M7.5: DSM(i, j) n×n The row numbers corresponding to the coordinates where the first - column elements are 1 are the second - layer switches, and the others are the third - layer switches.

[0058] Compared with the prior art, the present invention has the following beneficial effects:

[0059] 1. The present invention only focuses on the switch - port traffic and does not depend on specific network protocols, and can also be implemented for dumb switches that do not enable the corresponding functions;

[0060] 2. The machine - learning algorithm adopted by the present invention can achieve feature extraction of a large amount of sample data, and then guide the execution process of the classifier model to ensure the correctness of the classification results. At the same time, the switch - layer calculation is carried out by designing the structure matrix, making the physical network topology generation process more efficient.

[0061] 3. The present invention establishes a classifier model and uses machine learning to generate the physical network topology, avoiding the problems of network - protocol and network - device - model dependence in the physical network topology discovery process. Using machine learning to generate the physical network topology ensures the correctness of the classification results and makes the physical network topology generation process more efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] By reading the detailed description of the non - restrictive embodiments with reference to the following drawings, other features, objects, and advantages of the present invention will become more obvious:

[0063] Figure 1 is the flowchart of the physical network topology discovery method based on machine learning of the present invention;

[0064] Figure 2 is the design structure matrix diagram;

[0065] Figure 3 is the changed design structure matrix;

[0066] Figure 4 is the subnet physical network topology structure;

[0067] Figure 5 is the port - traffic speed time - series comparison diagram. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0068] The present invention will be described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but do not limit the present invention in any form. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several changes and improvements can still be made. These all belong to the protection scope of the present invention.

[0069] Embodiment 1

[0070] A method for physical network topology discovery based on machine learning provided by the present invention includes:

[0071] In order to avoid the problems of network protocol and network device model dependence in the physical network topology discovery process, the present invention improves the physical network topology discovery method based on port traffic speed and uses machine learning to generate the physical network topology.

[0072] The port traffic speed is the size of the bytes transmitted by the switch port per unit time. The switch port traffic speed includes two categories: port inflow speed and port outflow speed. Among them, the port inflow speed is the traffic speed flowing to the switch where the port is located, and the port outflow speed is the traffic speed of the switch where the port is located flowing to the next switch port.

[0073] When using this method to generate the physical network topology, it is necessary to collect the time series of the port traffic speed of each switch in the network;

[0074] The port traffic speed time series is a sequence composed of the port traffic speeds corresponding to a series of equally spaced time points. Among them, the port inflow speed time series and the port outflow speed time series are defined as follows:

[0075]

[0076]

[0077] Among them, p is the port label, and the time interval between two time points t = n - 1 and t = n is Δt;

[0078] To implement the present invention using machine learning algorithms, the difference time series needs to be used as a sample;

[0079] The difference time series is the difference between the port inflow speed time series and the port outflow speed time series between two ports of different switches, specifically as follows:

[0080]

[0081] Among them, r, d ∈ p, and r and d do not belong to the same switch.

[0082] Construct a classifier model, which is a machine learning algorithm model for classifying difference time series in the present invention, including a training set, an algorithm program, algorithm parameters, and an input object;

[0083] The training set is a historical experience data set for constructing the classifier model, including a positive sample set and a negative sample set.

[0084] The positive sample set is obtained by analyzing the existing physical network topology structure and port traffic speed data. Let r' and d' be two switch ports with actual physical relationships. The difference time series S r′,d′ (t) can be obtained through equations (1), (2), and (3). Let ΔL ∈ R be the length of the sample difference time series, ΔL ≤ t. Taking ΔL as the window and a step size of 1, shift and intercept the sample difference time series on S r′,d′ (t), then t - ΔL + 1 sample difference time series are formed. By setting different r' and d', more sample difference time series can be obtained to form the positive sample set K 1 (s), where s = 0, 1,..., l, and a sequence with a length of l and all elements being 1 is generated as the labeled sequence L 1 (s) of the positive sample set.

[0085] The negative sample set is obtained by analyzing the existing physical network topology structure and port traffic speed data. Let r'' and d'' be two switch ports without actual physical relationships. According to the generation method of the positive sample set described above, a negative sample set K 0 (s) with a length of l and the labeled sequence L 0 (s) of the negative sample set can be obtained.

[0086] The algorithm program is the code implemented by the machine learning algorithm;

[0087] The algorithm parameters are the parameters of the machine learning algorithm that can affect the results;

[0088] The input object is a set of difference time series to be classified by the classifier model.

[0089] The method for discovering the physical network topology based on machine learning includes the following steps:

[0090] Step 1: Extract the training data set to obtain the positive sample set K 1 (s) with a length of l, the labeled sequence L 1 (s) of the positive sample set, the negative sample set K 0 (s), and the labeled sequence L 0 (s) of the negative sample set;

[0091] Step 2: Extract input objects of the classifier model. With a time interval of Δt, obtain the time series sets of the inflow speeds of the ports with port modes other than "access" in all switches of the unknown subnet and the time series sets of the outflow speeds of the ports

[0092] The unknown subnet is the subnet for which the physical network topology structure is to be generated;

[0093] The switch port mode is the link type of the switch Ethernet port, including three modes: access mode, trunk mode, and hybrid mode. Among them, the access mode only allows one Vlan to pass through and is generally used to connect to terminal devices, while the trunk mode and hybrid mode can allow multiple Vlans to pass through and are generally used to connect to other switches or terminal devices.

[0094] Step 3: Clean the time series data of the port traffic speeds, and eliminate and the time series sets in which all elements are zero and and remove the corresponding ports from p;

[0095] Step 4: Generate a binary array of ports with physical relationships to be confirmed. Let <r, d> be a binary number composed of two ports with physical relationships to be confirmed, where r ≠ d and r and d do not belong to the same switch. Generate binary numbers for all ports in p to obtain a binary array set P(dn) of size h, dn = 0, 1,..., h - 1;

[0096] Step 5: Classify the difference time series using the classifier model. Specifically:

[0097] For the time series of the inflow speed and the time series of the outflow speed of the ports corresponding to each binary number in the binary array P(dn), find the difference time series, and input the difference time series into the classifier model to obtain a set R of binary numbers with a classification result of 1.

[0098] Step 6: Extract the set of binary numbers of switches with physical relationships. Specifically:

[0099] For each binary number in R, find the set SB(sn) of the corresponding binary numbers of switches, sn = 0, 1,..., v, and remove the duplicate binary numbers.

[0100] Step 7: Generate the physical network topology structure using the design structure matrix, which specifically includes the following 5 steps:

[0101] Step 7.1: Let DSM(i, j) n×nis a zero matrix, where n is the number of switches in SB(sn), i and j are switch numbers, the list on the left side of the matrix represents the switches receiving traffic, and the list on the upper side of the matrix represents the switches outputting traffic;

[0102] Step 7.2: Construct a design structure matrix. For all binary numbers in SB(sn), set DSM(i,j) n×n = 1;

[0103] Step 7.3: Swap the rows and columns of DSM(i,j) n×n to make it a lower triangular matrix;

[0104] Step 7.4: Find the switch numbers corresponding to the rows where all elements in DSM(i,j) n×n are 0, which are the first-layer switches;

[0105] Step 7.5: The row numbers corresponding to the coordinates where the first-column elements in DSM(i,j) n×n are 1 are the second-layer switches, and the others are the third-layer switches.

[0106] Step 8: Output the physical network topology structure.

[0107] The present invention also provides a physical network topology discovery system based on machine learning. The physical network topology discovery system based on machine learning can be implemented by executing the process steps of the physical network topology discovery method based on machine learning. That is, those skilled in the art can understand the physical network topology discovery method based on machine learning as the preferred implementation manner of the physical network topology discovery system based on machine learning.

[0108] Example 2

[0109] Example 2 is a preferred example of Example 1

[0110] To better illustrate the purpose and advantages of the present invention, the present invention will be further described below through a physical network topology generation example in combination with the drawings and tables.

[0111] According to a physical network topology discovery method based on machine learning provided by the present invention, its steps are as Figure 1 shown, including:

[0112] Step 1: Extract the training data set to obtain a positive sample set K 1 (s) with a length of l, a positive sample set label sequence L 1 (s), a negative sample set K 0 (s), and a label sequence L 0 (s) of the negative sample set;

[0113] In this embodiment, set l = 300, the length of the difference time series of the training set samples is 200, and the time interval is 5 minutes.

[0114] Step 2: Extract the input objects of the classifier model;

[0115] In this embodiment, taking 8 switches in the subnet as an example, the switches are numbered in sequence, and a total of p = 16 ports with port modes not "access" among the 8 switches are obtained. With a time interval of Δt = 5 min, the inflow speed time series set of the 16 ports is statistically calculated and the outflow speed time series set of the ports The length of the time series is 200 for both.

[0116] Step 3: Clean the time series data of the port traffic speed, and eliminate and the time series sets in which all elements are zero and and eliminate the corresponding ports from p, and a total of 16 ports and their corresponding port traffic speed time series are obtained;

[0117] Step 4: Generate a binary array of ports with physical relationships to be confirmed. Let <r, d> be a binary number composed of two ports with physical relationships to be confirmed, where r ≠ d and r and d do not belong to the same switch. Generate binary numbers for the 16 ports to obtain a binary array set P(dn) with a size of h = 210, where dn = 0, 1,..., 209;

[0118] Step 5: Classify the difference time series using the classifier model. In this embodiment, the code implementation of the kNN algorithm is selected as the algorithm program of the classifier model. Set the algorithm parameter k = 3 of the classifier model, initialize the iteration sequence i = 0, and initialize the binary number list R of the classification results. Specifically, it includes the following 5 steps:

[0119] Step 5.1: Extract the binary number P(i) from P(dn), and extract the port outflow speed time series and from and the port inflow speed time series according to P(i), and calculate the difference time series

[0120] Step 5.2: Input S i (t) into the classifier model to obtain the classification result r. The function called by the algorithm program of the classifier model is:

[0121] r = kMeans(k, S i (t), K 1 (s), L 1(s),K 0 (s),L 0 (s))

[0122] Step 5.3: Determine whether r is equal to 1. If so, append the binary number S i (t) to R; if not, proceed to the next step;

[0123] Step 5.4: Let i = i + 1, and determine whether i is equal to 210. If so, proceed to the next step; if not, jump to Step 5.1.

[0124] Step 6: For each binary number in the set R, find the corresponding set SB(sn) composed of non-repeated switch binary numbers, where sn = 0, 1,..., v. In this embodiment, v = 6;

[0125] Step 7: Generate a physical network topology using the design structure matrix, which specifically includes the following 5 steps:

[0126] Step 7.1: Let DSM(i,j) 8×8 be a 0 matrix, where i and j are switch numbers. The list on the left side of the matrix represents the switch that receives traffic, and the list on the upper side of the matrix represents the switch that outputs traffic;

[0127] Step 7.2: Construct the design structure matrix. According to all the binary numbers in SB(sn), set DSM(i,j) 8×8 = 1;

[0128] Step 7.3: Swap the rows and columns of DSM(i,j) 8×8 to make it a lower triangular matrix;

[0129] Step 7.4: Find the switch number corresponding to the row in DSM(i,j) 8×8 where all elements are 0, which is the first-layer switch, and the switch number is (2);

[0130] Step 7.5: The row numbers corresponding to the coordinates where the first-column elements in DSM(i,j) 8×8 are 1 are the second-layer switches, and the switch numbers are (0, 1). The others are the third-layer switches, and the switch numbers are (3, 4, 5, 6, 7);

[0131] Step 8: Output the physical network topology.

[0132] In this embodiment, the numbers of 8 switches and their corresponding port numbers are shown in Table 1:

[0133] Table 1 is the switch and port number table

[0134]

[0135]

[0136] The binary number list of the classification results after being classified by the classifier model is shown in Table 2 as follows:

[0137] Table 2 Classification Result List

[0138] Serial number Outflow switch number Outflow port number Inflow switch number Inflow port number 1 0 0 3 11 2 2 9 1 7 3 1 4 6 14 4 0 2 5 13 5 2 8 0 3 6 1 5 7 15 7 0 1 4 12

[0139] Using the physical network topology discovery method based on machine learning described in the present invention, the physical network topology structure of the subnet is generated, which is consistent with the actual physical network topology structure. The designed structure matrix is as Figure 2 shown, and the changed designed structure matrix is as Figure 3 shown. The generated physical network topology structure of the subnet is as Figure 4 shown, and the comparison diagram of the port traffic speed time series of ports with port numbers 8 and 3 is as Figure 5 shown.

[0140] Those skilled in the art know that in addition to implementing the systems, devices and their respective modules provided by the present invention in the form of pure computer-readable program codes, the method steps can be logically programmed to enable the systems, devices and their respective modules provided by the present invention to be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. to implement the same program. Therefore, the systems, devices and their respective modules provided by the present invention can be regarded as a kind of hardware component, and the modules included therein for implementing various programs can also be regarded as the structures within the hardware component; the modules for implementing various functions can also be regarded as either software programs for implementing the method or the structures within the hardware component.

[0141] The specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Without conflict, the embodiments of the present application and the features in the embodiments can be combined arbitrarily with each other.

Claims

1. A method for discovering physical network topologies based on machine learning, characterized in that, Including: Step S1: Collect the port traffic speed time series of each switch in the network. The port traffic speed time series includes: the port inflow speed time series and the port outflow speed time series. Step S2: Calculate the difference time series based on the port inflow speed time series and the port outflow speed time series between two ports of different switches. Step S3: Build a classifier model based on machine learning. Build a training set based on the difference time series corresponding to two switch ports with actual physical relationships and the difference time series corresponding to two switch ports without actual physical relationships. Use the training set to train the classifier model to obtain the trained classifier model. Step S4: Obtain the port inflow speed time series and the port outflow speed time series of all switch ports in the target subnet whose port modes are not access; and preprocess the obtained port inflow speed time series and port outflow speed time series to obtain the preprocessed port inflow speed time series and port outflow speed time series. Step S5: Generate a binary array of ports with physical relationships to be confirmed, calculate the difference time series for the port inflow speed time series and the port outflow speed time series corresponding to each binary number in the binary array, and input the difference time series into the trained classifier model to obtain a set R of binary numbers with a classification result of 1. Step S6: For each binary number in the set R of binary numbers, find the set SB(sn) of corresponding switch binary numbers, where sn = 0, 1,..., v, and remove duplicate binary numbers. Step S7: Generate the physical network topology using a preset structure matrix and output the physical network topology.

2. The method for discovering a physical network topology based on machine learning according to claim 1, wherein The port inflow speed time series includes: The port outflow speed time series includes: Among them, represents the time series of the port inflow velocity; represents the time series of the port outflow velocity; p is the port label, and the time interval between two time points t = n - 1 and t = n is Δt.

3. The method for discovering the physical network topology based on machine learning according to claim 1, characterized in that, The step S2 includes: Where r, d ∈ p, and r and d do not belong to the same switch.

4. The method for discovering a physical network topology based on machine learning according to claim 1, wherein Building the training set based on the difference time series includes a positive sample set and a negative sample set. The positive sample set includes: Let r' and d' be two switch ports with actual physical relationships, and calculate the difference time series S r′,d′ (t) based on switch port r' and switch port d'; Let ΔL ∈ R be the length of the sample difference time series, ΔL ≤ t. Taking ΔL as the window and a step size of 1, translate and intercept the sample difference time series on S r′,d′ (t), then t - ΔL + 1 sample difference time series are formed. By setting different r' and d', more sample difference time series can be obtained to form the positive sample set K 1 (s), where s = 0, 1,..., l, and generate a sequence of length l with all elements being 1 as the label sequence L 1 (s); The negative sample set includes: Let r″ and d″ be two switch ports that do not have an actual physical relationship. According to the generation method of the aforementioned positive sample set, an anti-sample set K 0 (s) and the label sequence L 0 (s) of the anti-sample set are obtained.

5. The method for discovering a physical network topology based on machine learning according to claim 1, wherein In step S4, the link types of the switch ports are the switch Ethernet port link types, including: access mode, trunk mode, and hybrid mode. The access mode only allows one Vlan to pass through. The trunk mode and the hybrid mode allow multiple Vlans to pass through.

6. The method for discovering a physical network topology based on machine learning according to claim 1, wherein In step S4, preprocessing the obtained port inflow speed time series and port outflow speed time series to obtain the preprocessed port inflow speed time series and port outflow speed time series includes: Perform data cleaning on the obtained port inflow speed time series and port outflow speed time series, remove the time series in which all elements in the port inflow speed time series and the port outflow speed time series are zero, and remove the corresponding ports.

7. The method for discovering a physical network topology based on machine learning according to claim 1, characterized in that Step S5 includes: Let <r, d> be a binary number composed of two ports with physical relationships to be confirmed, where r ≠ d and r and d do not belong to the same switch. Generate binary numbers for all ports in p to obtain a set P(dn) of binary arrays of size h, where dn = 0, 1,..., h - 1.

8. The method for discovering a physical network topology based on machine learning according to claim 1, characterized in that The step S7 includes: Step S7.1: Set DSM(i,j) n×n as a zero matrix, where n is the number of switches in SB(sn), i and j are switch numbers, the left list of the matrix represents the switches receiving traffic, and the upper list of the matrix represents the switches outputting traffic; Step S7.2: Construct a design structure matrix and set DSM(i, j) for all the binary numbers in SB(sn). n×n = 1; Step S7.3: Interchange the rows and columns of DSM(i,j) n×n to make it a lower triangular matrix; Step S7.4: Find DSM(i,j) n×n The switch numbers corresponding to the rows in which all elements are 0 in n×n are the first-layer switches; Step S7.5: DSM(i,j) n×n The row numbers corresponding to the coordinates where the first column elements in n×n are 1 are for the second-layer switches, and the others are for the third-layer switches.

9. A physical network topology discovery system based on machine learning, characterized in that, including: Module M1: Collect the port traffic speed time series of each switch in the network. The port traffic speed time series includes: the port inflow speed time series and the port outflow speed time series; Module M2: Calculate the difference time series based on the port inflow speed time series and the port outflow speed time series between two ports of different switches; Module M3: Construct a classifier model based on machine learning. Construct a training set based on the difference time series corresponding to two switch ports with actual physical relationships and the difference time series corresponding to two switch ports without actual physical relationships. Use the training set to train the classifier model to obtain the trained classifier model; Module M4: Obtain the port inflow speed time series and the port outflow speed time series of all switch ports in the target subnet whose port modes are not access; and preprocess the obtained port inflow speed time series and port outflow speed time series to obtain the preprocessed port inflow speed time series and port outflow speed time series; Module M5: Generate a binary array of ports with physical relationships to be confirmed, calculate the difference time series for the port inflow speed time series and the port outflow speed time series corresponding to each binary number in the binary array, and input the difference time series into the trained classifier model to obtain a set R of binary numbers with a classification result of 1; Module M6: For each binary number in the set R of binary numbers, find the set SB(sn) of switch binary numbers corresponding to it, where sn = 0, 1,..., v, and remove duplicate binary numbers; Module M7: Generate the physical network topology structure using a preset structure matrix and output the physical network topology structure.

10. The physical network topology discovery system based on machine learning according to claim 9, characterized in that, Constructing the training set based on the difference time series includes a positive sample set and a negative sample set; The positive sample set includes: Let r' and d' be two switch ports with actual physical relationships, and calculate the difference time series S r′,d′ (t) based on switch port r' and switch port d'; Let ΔL ∈ R be the length of the sample difference time series, ΔL ≤ t, and use ΔL as the window with a step size of 1 to translate and intercept the sample difference time series on S r′,d′ (t), then t - ΔL + 1 sample difference time series are formed. By setting different r' and d', more sample difference time series can be obtained to form the positive sample set K 1 (s), where s = 0, 1,..., l, and generate a sequence of length l with all elements being 1 as the label sequence L 1 (s); The negative sample set includes: Let r″ and d″ be two switch ports that do not have an actual physical relationship. According to the method for generating the positive sample set described above, an anti-sample set K 0 (s) and the labeled sequence L 0 (s) of the anti-sample set are obtained; Module M5 includes: Let <r, d> be a binary number composed of two ports with physical relationships to be confirmed, where r ≠ d and r and d do not belong to the same switch. Generate binary numbers for all ports in p to obtain a binary array set P(dn) of size h, where dn = 0, 1,..., h - 1; Module M7 includes: Module M7.1: Let DSM(i,j) n×n be a zero matrix, where n is the number of switches in SB(sn), i and j are switch numbers, the left list of the matrix represents the switches receiving traffic, and the upper list of the matrix represents the switches outputting traffic; Module M7.2: Construct a design structure matrix and set DSM(i,j) for all binary numbers in SB(sn). n×n = 1; Module M7.3: Swap DSM(i,j) n×n for rows and columns to make it a lower triangular matrix; Module M7.4: Find DSM(i, j) n×n The switch numbers corresponding to the rows in n×n where all elements are 0 are the first-layer switches; Module M7.5: DSM(i, j) n×n The row numbers corresponding to the coordinates where the first column elements are 1 in n×n are for the second - layer switches, and the others are for the third - layer switches.

Citation Information

Patent Citations

  • Method and device for discovering physical network topology

    CN101873230B