CN106998299B - Method, device and system for identifying network equipment in data center network - Google Patents

Method, device and system for identifying network equipment in data center network Download PDF

Info

Publication number
CN106998299B
CN106998299B CN201610046155.8A CN201610046155A CN106998299B CN 106998299 B CN106998299 B CN 106998299B CN 201610046155 A CN201610046155 A CN 201610046155A CN 106998299 B CN106998299 B CN 106998299B
Authority
CN
China
Prior art keywords
network
network device
control device
equipment
hierarchy type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610046155.8A
Other languages
Chinese (zh)
Other versions
CN106998299A (en
Inventor
王蛟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XFusion Digital Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201610046155.8A priority Critical patent/CN106998299B/en
Publication of CN106998299A publication Critical patent/CN106998299A/en
Application granted granted Critical
Publication of CN106998299B publication Critical patent/CN106998299B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/15Interconnection of switching modules
    • H04L49/1553Interconnection of ATM switching modules, e.g. ATM switching fabrics

Landscapes

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

Abstract

本发明公开了一种数据中心网络中网络设备的识别方法、装置及系统,属于网络技术领域。所述方法用于数据中心网络中的控制设备,所述方法包括:接收所述数据中心网络中第一网络设备发送的连接报文,所述连接报文包括所述第一网络设备的层级标识;根据所述层级标识,识别所述第一网络设备的层级类型;根据预先获取的与所述控制设备建立连接的各个网络设备的拓扑信息,以及所述第一网络设备的层级类型,识别与所述控制设备建立连接的各个网络设备的层级类型。本发明降低了对数据中心网络中网络设备进行识别时的计算复杂度,解决了相关技术中的识别算法复杂度较高的问题。本发明用于识别数据中心网络中的网络设备。

The invention discloses a method, device and system for identifying network equipment in a data center network, belonging to the field of network technology. The method is used for a control device in a data center network, and the method includes: receiving a connection message sent by a first network device in the data center network, where the connection message includes a layer identifier of the first network device ; according to the layer identifier, identifying the layer type of the first network device; according to the pre-acquired topology information of each network device that establishes a connection with the control device, and the layer type of the first network device, identifying and The hierarchical type of each network device to which the control device establishes a connection. The invention reduces the calculation complexity when identifying the network equipment in the data center network, and solves the problem of high complexity of the identification algorithm in the related art. The invention is used to identify network devices in a data center network.

Description

数据中心网络中网络设备的识别方法、装置及系统Method, device and system for identifying network equipment in data center network

技术领域technical field

本发明涉及网络技术领域,特别涉及一种数据中心网络中网络设备的识别方法、装置及系统。The invention relates to the field of network technology, in particular to a method, device and system for identifying network equipment in a data center network.

背景技术Background technique

数据中心网络是应用于数据中心内的网络,数据中心网络通过交换机和路由器等网络设备将一定数量的服务器连接起来,组成具有高带宽、高可靠性以及负载均衡的服务器网络,能够对外提供计算和存储等服务。在数据中心网络中的网络设备部署完成后,各网络设备需要与数据中心的控制设备建立连接,以便控制设备对该各个网络设备进行控制和管理。之后,控制设备能够通过拓扑发现过程,获取各个网络设备的拓扑信息,并根据获取到的拓扑信息,识别数据中心网络的拓扑结构,以及每个网络设备的层级类型,例如架顶交换机、汇聚层交换机和核心层交换机等。最后,控制设备能够根据识别的结果,向不同层级类型的网络设备下发对应的配置文件,从而实现数据中心网络中网络设备的自动化配置。The data center network is a network applied in the data center. The data center network connects a certain number of servers through network devices such as switches and routers to form a server network with high bandwidth, high reliability and load balancing, which can provide external computing and Storage and other services. After the network devices in the data center network are deployed, each network device needs to establish a connection with the control device of the data center, so that the control device can control and manage each network device. Afterwards, the control device can obtain the topology information of each network device through the topology discovery process, and identify the topology structure of the data center network and the layer type of each network device based on the obtained topology information, such as top-of-rack switches and aggregation layers. switches and core layer switches, etc. Finally, the control device can deliver corresponding configuration files to network devices of different levels and types according to the identification results, thereby realizing automatic configuration of network devices in the data center network.

相关技术中,2009年SIGCOMM会议论文“PortLand:A Scalable Fault-TolerantLayer 2Data Center Network Fabric”中介绍了一种对数据中心网络中的网络设备依据拓扑层级进行位置识别的方案。在该方案中,控制设备可以获取并分析当前连接至控制设备的网络设备的拓扑信息,该拓扑信息中包括每个网络设备与其他网络设备的连接状况,若某个网络设备的端口数为K,且该网络设备的K个端口中有不超过K/2个端口连接有其他网络设备,则控制设备可以将该网络设备的层级类型识别为架顶交换机;进一步的,控制设备可以将与该架顶交换机连接的网络设备的层级类型识别为汇聚层交换机,并将所有端口都连接至汇聚层交换机的网络设备的层级类型识别为核心层交换机。In related technologies, the 2009 SIGCOMM conference paper "PortLand: A Scalable Fault-TolerantLayer 2Data Center Network Fabric" introduced a scheme for identifying the location of network devices in the data center network according to the topology level. In this solution, the control device can obtain and analyze the topology information of the network devices currently connected to the control device, the topology information includes the connection status of each network device with other network devices, if the number of ports of a certain network device is K , and no more than K/2 of the K ports of the network device are connected to other network devices, the control device can identify the layer type of the network device as a top-of-rack switch; further, the control device can connect with the The layer type of the network device connected to the top-of-rack switch is identified as an aggregation layer switch, and the layer type of the network device whose ports are all connected to the aggregation layer switch is identified as a core layer switch.

但是,上述网络设备发现方案,在识别架顶交换机时,需要对所有网络设备的连接状况进行分析,该方案的计算复杂度较高,网络设备的识别灵活性较低。However, in the above-mentioned network device discovery solution, when identifying the top-of-rack switch, it is necessary to analyze the connection status of all network devices. This solution has high computational complexity and low flexibility in network device identification.

发明内容Contents of the invention

为了解决相关技术中对网络设备进行位置识别时计算复杂度较高的问题,本发明实施例提供了一种数据中心网络中网络设备的识别方法、装置及系统。所述技术方案如下:In order to solve the problem of high computational complexity in identifying the location of network equipment in the related art, embodiments of the present invention provide a method, device and system for identifying network equipment in a data center network. Described technical scheme is as follows:

第一方面,提供了一种数据中心网络中网络设备的识别方法,用于数据中心网络中的控制设备,该方法包括:In the first aspect, a method for identifying network devices in a data center network is provided, which is used for a control device in a data center network, and the method includes:

接收该数据中心网络中第一网络设备发送的连接报文,该连接报文包括该第一网络设备的层级标识;Receive a connection message sent by a first network device in the data center network, where the connection message includes a layer identifier of the first network device;

根据该层级标识,识别该第一网络设备的层级类型;Identify the layer type of the first network device according to the layer identifier;

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型。According to the pre-acquired topology information of each network device that establishes a connection with the control device, and the layer type of the first network device, identify the layer type of each network device that establishes a connection with the control device.

可选的,该根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,包括:Optionally, identifying the layer type of each network device establishing a connection with the control device according to the pre-acquired topology information of each network device establishing a connection with the control device and the layer type of the first network device, including:

将确定了层级类型的网络设备划分为已识别网络设备,该确定了层级类型的网络设备包括该第一网络设备;classifying network devices whose hierarchical type is determined as identified network devices, where the network devices whose hierarchical type is determined include the first network device;

判断与该控制设备建立连接的各个网络设备中是否存在与该已识别网络设备连接且未被识别的待识别网络设备;Judging whether there is an unidentified network device to be identified that is connected to the identified network device among the network devices that establish a connection with the control device;

当与该控制设备建立连接的各个网络设备中存在该待识别网络设备时,根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该已识别网络设备的层级类型,识别该待识别网络设备的层级类型;When the network device to be identified exists in each network device that establishes a connection with the control device, identify the network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the identified network device. The layer type of the network device to be identified;

重复上述步骤,直至与该控制设备建立连接的各个网络设备中不存在与该已识别网络设备连接且未被识别的待识别网络设备。The above steps are repeated until there is no unidentified network device to be identified that is connected to the identified network device among the network devices that establish a connection with the control device.

可选的,当该第一网络设备的层级类型为虚拟交换机、核心层交换机或者软交换机时,该根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,包括:Optionally, when the layer type of the first network device is a virtual switch, a core layer switch or a soft switch, according to the pre-acquired topology information of each network device that establishes a connection with the control device, and the first network device The layer type of the network device identifies the layer type of each network device that establishes a connection with the control device, including:

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该第一网络设备连接的第二网络设备的层级类型;Identifying the layer type of the second network device connected to the first network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the first network device;

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第二网络设备的层级类型,识别与该第二网络设备连接且未被识别的第三网络设备的层级类型;identifying the layer type of an unrecognized third network device connected to the second network device according to the pre-acquired topology information of each network device establishing a connection with the control device and the layer type of the second network device;

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第三网络设备的层级类型,识别与该第三网络设备连接且未被识别的第四网络设备的层级类型。According to the pre-acquired topology information of each network device connected to the control device and the layer type of the third network device, identify the layer type of the unrecognized fourth network device connected to the third network device.

可选的,在该根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第三网络设备的层级类型,识别与该第三网络设备连接且未被识别的第四网络设备的层级类型之后,该方法还包括:Optionally, identify an unidentified fourth network connected to the third network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the third network device After the hierarchical type of the device, the method also includes:

判断与该控制设备建立连接的各个网络设备中未被识别的网络设备的个数是否大于第一预设阈值,以及该第四网络设备的个数是否大于第二预设阈值;judging whether the number of unrecognized network devices among the network devices establishing a connection with the control device is greater than a first preset threshold, and whether the number of the fourth network device is greater than a second preset threshold;

当该与该控制设备建立连接的各个网络设备中未被识别的网络设备的个数大于第一预设阈值,或该第四网络设备的个数大于第二预设阈值时,执行识别更正过程,该识别更正过程包括:When the number of unrecognized network devices among the network devices establishing a connection with the control device is greater than the first preset threshold, or the number of the fourth network device is greater than the second preset threshold, an identification correction process is performed , the identification correction process includes:

确定已识别的该第三网络设备的个数n;Determine the number n of the identified third network devices;

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,判断该第四网络设备所连接的网络设备中该第三网络设备的个数m是否大于或等于 According to the pre-acquired topology information of each network device that establishes a connection with the control device, determine whether the number m of the third network device among the network devices connected to the fourth network device is greater than or equal to

当该第四网络设备所连接的网络设备中该第三网络设备的个数m大于或等于时,将该第四网络设备的层级类型更正为与该第二网络设备相同的层级类型。When the number m of the third network devices among the network devices connected to the fourth network device is greater than or equal to , correct the layer type of the fourth network device to be the same layer type as that of the second network device.

可选的,当该第一网络设备的层级类型为虚拟交换机、核心层交换机或者软交换机时,该根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,包括:Optionally, when the layer type of the first network device is a virtual switch, a core layer switch or a soft switch, according to the pre-acquired topology information of each network device that establishes a connection with the control device, and the first network device The layer type of the network device identifies the layer type of each network device that establishes a connection with the control device, including:

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该第一网络设备连接的第二网络设备的层级类型;Identifying the layer type of the second network device connected to the first network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the first network device;

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第二网络设备的层级类型,识别与该第二网络设备连接且未被识别的第三网络设备的层级类型;identifying the layer type of an unrecognized third network device connected to the second network device according to the pre-acquired topology information of each network device establishing a connection with the control device and the layer type of the second network device;

确定已识别的该第三网络设备的个数n;Determine the number n of the identified third network devices;

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,判断第四网络设备所连接的网络设备中该第三网络设备的个数m是否大于或等于该第四网络设备为与该第三网络建立连接且未被识别的网络设备;According to the pre-acquired topology information of each network device that establishes a connection with the control device, determine whether the number m of the third network device among the network devices connected to the fourth network device is greater than or equal to The fourth network device is an unidentified network device that establishes a connection with the third network;

当该第四网络设备所连接的网络设备中该第三网络设备的个数m大于或等于时,将该第四网络设备的层级类型识别为与该第二网络设备相同的层级类型;When the number m of the third network devices among the network devices connected to the fourth network device is greater than or equal to , identifying the layer type of the fourth network device as the same layer type as the second network device;

当该第四网络设备所连接的网络设备中该第三网络设备的个数m小于时,根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第三网络设备的层级类型,识别该第四网络设备的层级类型。When the number m of the third network devices among the network devices connected to the fourth network device is less than At this time, the layer type of the fourth network device is identified according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the third network device.

可选的,在该该根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型之后,该方法还包括:Optionally, after identifying the layer type of each network device that establishes a connection with the control device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the first network device , the method also includes:

当存在新增的网络设备与该控制设备建立连接时,获取该新增的网络设备的拓扑信息;When there is a newly added network device to establish a connection with the control device, acquiring topology information of the newly added network device;

根据该新增的网络设备的拓扑信息、与该控制设备建立连接的各个网络设备的拓扑信息以及与该控制设备建立连接的各个网络设备的层级类型,识别该新增的网络设备的层级类型;Identifying the layer type of the newly added network device according to the topology information of the newly added network device, the topology information of each network device establishing a connection with the control device, and the layer type of each network device establishing a connection with the control device;

根据该新增的网络设备的拓扑信息,更新与该控制设备建立连接的各个网络设备的拓扑信息;Updating the topology information of each network device connected to the control device according to the topology information of the newly added network device;

根据该新增的网络设备的层级类型和该更新后的与该控制设备建立连接的各个网络设备的拓扑信息,重新识别该各个网络设备的层级类型。The layer type of each network device is re-identified according to the layer type of the newly added network device and the updated topology information of each network device establishing a connection with the control device.

可选的,该第一网络设备的层级类型为虚拟交换机或软交换机,该第二网络设备的层级类型为架顶交换机,该第三网络设备的层级类型为汇聚层交换机,该第四网络设备的层级类型为核心层交换机。Optionally, the layer type of the first network device is a virtual switch or a soft switch, the layer type of the second network device is a top-of-rack switch, the layer type of the third network device is an aggregation layer switch, and the fourth network device The layer type is core layer switch.

可选的,该连接报文包括该第一网络设备向该控制设备发送的握手消息、心跳消息或属性上报消息。Optionally, the connection message includes a handshake message, a heartbeat message or an attribute report message sent by the first network device to the control device.

第二方面,提供一种数据中心网络中网络设备的识别方法,用于数据中心网络中的第一网络设备,该方法包括:In a second aspect, a method for identifying a network device in a data center network is provided, which is used for a first network device in the data center network, and the method includes:

向该数据中心网络中的控制设备发送连接报文,该连接报文包括该第一网络设备的层级标识,以便于该控制设备根据该层级标识,识别该第一网络设备的层级类型。Sending a connection message to the control device in the data center network, where the connection message includes the layer identifier of the first network device, so that the control device can identify the layer type of the first network device according to the layer identifier.

第三方面,提供一种数据中心网络中网络设备的识别装置,该装置位于数据中心网络中的控制设备中,该装置包括:In a third aspect, a device for identifying network equipment in a data center network is provided, the device is located in a control device in the data center network, and the device includes:

接收单元,用于接收该数据中心网络中第一网络设备发送的连接报文,该连接报文包括该第一网络设备的层级标识;A receiving unit, configured to receive a connection message sent by a first network device in the data center network, where the connection message includes a layer identifier of the first network device;

第一识别单元,用于根据该层级标识,识别该第一网络设备的层级类型;a first identifying unit, configured to identify the layer type of the first network device according to the layer identifier;

第二识别单元,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型。The second identifying unit is configured to identify the layer type of each network device establishing connection with the control device according to the pre-acquired topology information of each network device establishing connection with the control device and the layer type of the first network device.

可选的,该第二识别单元,还用于:Optionally, the second identification unit is also used for:

将确定了层级类型的网络设备划分为已识别网络设备,该确定了层级类型的网络设备包括该第一网络设备;classifying network devices whose hierarchical type is determined as identified network devices, where the network devices whose hierarchical type is determined include the first network device;

判断与该控制设备建立连接的各个网络设备中是否存在与该已识别网络设备连接且未被识别的待识别网络设备;Judging whether there is an unidentified network device to be identified that is connected to the identified network device among the network devices that establish a connection with the control device;

当与该控制设备建立连接的各个网络设备中存在该待识别网络设备时,根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该已识别网络设备的层级类型,识别该待识别网络设备的层级类型;When the network device to be identified exists in each network device that establishes a connection with the control device, identify the network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the identified network device. The layer type of the network device to be identified;

重复上述步骤,直至与该控制设备建立连接的各个网络设备中不存在与该已识别网络设备连接且未被识别的待识别网络设备。The above steps are repeated until there is no unidentified network device to be identified that is connected to the identified network device among the network devices that establish a connection with the control device.

可选的,当该第一网络设备的层级类型为虚拟交换机、核心层交换机或者软交换机时,该第二识别单元,包括:Optionally, when the layer type of the first network device is a virtual switch, a core layer switch or a soft switch, the second identification unit includes:

第一识别模块,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该第一网络设备连接的第二网络设备的层级类型;The first identification module is configured to identify the level of the second network device connected to the first network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the level type of the first network device type;

第二识别模块,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第二网络设备的层级类型,识别与该第二网络设备连接且未被识别的第三网络设备的层级类型;The second identification module is configured to identify an unrecognized third network device connected to the second network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the second network device. The layer type of the network device;

第三识别模块,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第三网络设备的层级类型,识别与该第三网络设备连接且未被识别的第四网络设备的层级类型。The third identification module is configured to identify the unrecognized fourth network device connected to the third network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the third network device. Hierarchy type of network device.

可选的,该第二识别单元,还包括:Optionally, the second identification unit also includes:

第一判断模块,用于判断与该控制设备建立连接的各个网络设备中未被识别的网络设备的个数是否大于第一预设阈值,以及该第四网络设备的个数是否大于第二预设阈值;The first judging module is used to judge whether the number of unrecognized network devices among the various network devices establishing a connection with the control device is greater than the first preset threshold, and whether the number of the fourth network devices is greater than the second preset threshold. set threshold;

更正模块,用于当该与该控制设备建立连接的各个网络设备中未被识别的网络设备的个数大于第一预设阈值,或该第四网络设备的个数大于第二预设阈值时,执行识别更正过程,该识别更正过程包括:A correction module, configured to be used when the number of unidentified network devices among the network devices establishing a connection with the control device is greater than a first preset threshold, or the number of the fourth network device is greater than a second preset threshold , execute the recognition correction process, the recognition correction process includes:

确定已识别的该第三网络设备的个数n;Determine the number n of the identified third network devices;

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,判断该第四网络设备所连接的网络设备中该第三网络设备的个数m是否大于或等于 According to the pre-acquired topology information of each network device that establishes a connection with the control device, determine whether the number m of the third network device among the network devices connected to the fourth network device is greater than or equal to

当该第四网络设备所连接的网络设备中该第三网络设备的个数m大于或等于时,将该第四网络设备的层级类型更正为与该第二网络设备相同的层级类型。When the number m of the third network devices among the network devices connected to the fourth network device is greater than or equal to , correct the layer type of the fourth network device to be the same layer type as that of the second network device.

可选的,当该第一网络设备的层级类型为虚拟交换机、核心层交换机或者软交换机时,该第二识别单元,还包括:Optionally, when the layer type of the first network device is a virtual switch, a core layer switch or a soft switch, the second identification unit further includes:

第四识别模块,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该第一网络设备连接的第二网络设备的层级类型;The fourth identification module is configured to identify the level of the second network device connected to the first network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the level type of the first network device type;

第五识别模块,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第二网络设备的层级类型,识别与该第二网络设备连接且未被识别的第三网络设备的层级类型;The fifth identification module is configured to identify an unrecognized third network device connected to the second network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the second network device. The layer type of the network device;

确定模块,用于确定已识别的该第三网络设备的个数n;A determining module, configured to determine the number n of the identified third network devices;

第二判断模块,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,判断第四网络设备所连接的网络设备中该第三网络设备的个数m是否大于或等于该第四网络设备为与该第三网络建立连接且未被识别的网络设备;The second judging module is configured to judge whether the number m of the third network devices among the network devices connected to the fourth network device is greater than or equal to The fourth network device is an unidentified network device that establishes a connection with the third network;

第六识别模块,用于当该第四网络设备所连接的网络设备中该第三网络设备的个数m大于或等于时,将该第四网络设备的层级类型识别为与该第二网络设备相同的层级类型;The sixth identification module is used when the number m of the third network devices among the network devices connected to the fourth network device is greater than or equal to , identifying the layer type of the fourth network device as the same layer type as the second network device;

第七识别模块,用于当该第四网络设备所连接的网络设备中该第三网络设备的个数m小于时,根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第三网络设备的层级类型,识别该第四网络设备的层级类型。The seventh identification module is used when the number m of the third network devices among the network devices connected to the fourth network device is less than At this time, the layer type of the fourth network device is identified according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the third network device.

可选的,该装置还包括:Optionally, the device also includes:

获取单元,用于当存在新增的网络设备与该控制设备建立连接时,获取该新增的网络设备的拓扑信息;An acquiring unit, configured to acquire topology information of the newly added network device when there is a newly added network device establishing a connection with the control device;

第三识别单元,用于根据该新增的网络设备的拓扑信息、与该控制设备建立连接的各个网络设备的拓扑信息以及与该控制设备建立连接的各个网络设备的层级类型,识别该新增的网络设备的层级类型;The third identification unit is configured to identify the newly added network device according to the topology information of the newly added network device, the topology information of each network device connected to the control device, and the layer type of each network device connected to the control device. The layer type of the network device;

更新单元,用于根据该新增的网络设备的拓扑信息,更新与该控制设备建立连接的各个网络设备的拓扑信息;An update unit, configured to update the topology information of each network device that establishes a connection with the control device according to the topology information of the newly added network device;

第四识别单元,用于根据该新增的网络设备的层级类型和该更新后的与该控制设备建立连接的各个网络设备的拓扑信息,重新识别该各个网络设备的层级类型。The fourth identifying unit is configured to re-identify the layer type of each network device according to the layer type of the newly added network device and the updated topology information of each network device establishing a connection with the control device.

可选的,该第一网络设备的层级类型为虚拟交换机或软交换机,该第二网络设备的层级类型为架顶交换机,该第三网络设备的层级类型为汇聚层交换机,该第四网络设备的层级类型为核心层交换机。Optionally, the layer type of the first network device is a virtual switch or a soft switch, the layer type of the second network device is a top-of-rack switch, the layer type of the third network device is an aggregation layer switch, and the fourth network device The layer type is core layer switch.

可选的,该连接报文包括该第一网络设备向该控制设备发送的握手消息、心跳消息或属性上报消息。Optionally, the connection message includes a handshake message, a heartbeat message or an attribute report message sent by the first network device to the control device.

第四方面,提供一种数据中心网络中网络设备的识别装置,该装置位于数据中心网络中的第一网络设备中,该装置包括:In a fourth aspect, there is provided an identification device for a network device in a data center network, the device is located in a first network device in the data center network, and the device includes:

发送单元,用于向该数据中心网络中的控制设备发送连接报文,该连接报文包括该第一网络设备的层级标识,以便于该控制设备根据该层级标识,识别该第一网络设备的层级类型。A sending unit, configured to send a connection message to the control device in the data center network, where the connection message includes the layer identifier of the first network device, so that the control device can identify the first network device according to the layer identifier Hierarchy type.

第五方面,提供一种数据中心网络中网络设备的识别装置,该装置位于数据中心网络中的控制设备中,该装置包括:处理器,存储器和总线;该总线用于连接该处理器和该存储器,该处理器用于执行该存储器中存储的程序,该程序包括第一方面任一所述的方法。In a fifth aspect, there is provided an identification device for network equipment in a data center network, the device is located in a control device in the data center network, and the device includes: a processor, a memory, and a bus; the bus is used to connect the processor and the A memory, the processor is used to execute the program stored in the memory, and the program includes the method described in any one of the first aspect.

第六方面,提供一种数据中心网络中网络设备的识别装置,该装置位于数据中心网络中的第一网络设备中,该装置包括:处理器,存储器和总线;该总线用于连接该处理器和该存储器,该处理器用于执行该存储器中存储的程序,该程序包括第二方面所述的方法。According to the sixth aspect, there is provided an identification device for a network device in a data center network, the device is located in a first network device in the data center network, and the device includes: a processor, a memory, and a bus; the bus is used to connect the processor and the memory, the processor is used to execute the program stored in the memory, and the program includes the method described in the second aspect.

第七方面,提供一种数据中心网络中网络设备的识别系统,该系统包括控制设备和第一网络设备,该控制设备包括第三方面任一所述的数据中心网络中网络设备的识别装置;该第一网络设备包括第四方面所述的数据中心网络中网络设备的识别装置。In a seventh aspect, a system for identifying network equipment in a data center network is provided, the system includes a control device and a first network device, and the control device includes the device for identifying network equipment in a data center network as described in any one of the third aspects; The first network device includes the device for identifying network devices in the data center network described in the fourth aspect.

第八方面,提供一种数据中心网络中网络设备的识别系统,该系统包括控制设备和第一网络设备,该控制设备包括第五方面所述的数据中心网络中网络设备的识别装置;该第一网络设备包括第六方面所述的数据中心网络中网络设备的识别装置。In an eighth aspect, a system for identifying network equipment in a data center network is provided, the system includes a control device and a first network device, and the control device includes the device for identifying network equipment in a data center network as described in the fifth aspect; the first A network device includes the device for identifying network devices in the data center network according to the sixth aspect.

本发明实施例提供的技术方案带来的有益效果是:The beneficial effects brought by the technical solution provided by the embodiments of the present invention are:

本发明实施例提供了一种数据中心网络中网络设备的识别方法、装置及系统,该方法用于数据中心网络中的控制设备中,该方法包括:接收该数据中心网络中第一网络设备发送的连接报文,该连接报文包括该第一网络设备的层级标识;根据该层级标识,识别该第一网络设备的层级类型;根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,因此本发明实施例提供的网络设备的识别方法可以根据第一网络设备发送的连接报文中所携带的层级标识,识别该第一网络设备的层级类型,无需对该第一网络设备的连接状况进行分析,因此降低了对数据中心网络中网络设备进行识别时的计算复杂度,网络设备的识别灵活性较高。Embodiments of the present invention provide a method, device, and system for identifying network equipment in a data center network. The method is used in a control device in a data center network. The method includes: receiving a message sent by the first network equipment in the data center network. A connection message, the connection message includes the layer identifier of the first network device; according to the layer identifier, identify the layer type of the first network device; according to the pre-acquired topology of each network device that establishes a connection with the control device Information, as well as the layer type of the first network device, identifies the layer type of each network device that establishes a connection with the control device, so the network device identification method provided by the embodiment of the present invention can be based on the connection message sent by the first network device The layer identifier carried in the , identifies the layer type of the first network device, and does not need to analyze the connection status of the first network device, thus reducing the computational complexity of identifying network devices in the data center network. Network devices The recognition flexibility is high.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.

图1是相关技术中数据中心网络的拓扑结构示意图;FIG. 1 is a schematic diagram of a topology structure of a data center network in the related art;

图2-1是本发明实施例提供的一种数据中心网络的系统架构图;FIG. 2-1 is a system architecture diagram of a data center network provided by an embodiment of the present invention;

图2-2是本发明实施例提供的一种数据中心网络中网络设备的识别方法的流程图;FIG. 2-2 is a flow chart of a method for identifying network devices in a data center network provided by an embodiment of the present invention;

图3-1是本发明实施例提供的另一种数据中心网络中网络设备的识别方法的流程图;FIG. 3-1 is a flow chart of another method for identifying network devices in a data center network provided by an embodiment of the present invention;

图3-2是本发明实施例提供的一种数据中心网络中网络设备的部分拓扑结构示意图;FIG. 3-2 is a schematic diagram of a partial topology structure of a network device in a data center network provided by an embodiment of the present invention;

图3-3是本发明实施例提供的另一种数据中心网络中网络设备的部分拓扑结构示意图;FIG. 3-3 is a schematic diagram of a partial topology structure of network devices in another data center network provided by an embodiment of the present invention;

图3-4是本发明实施例提供的又一种数据中心网络中网络设备的部分拓扑结构示意图;3-4 are schematic diagrams of partial topology structures of network devices in another data center network provided by an embodiment of the present invention;

图4-1是本发明实施例提供的又一种数据中心网络中网络设备的识别方法的流程图;FIG. 4-1 is a flow chart of another method for identifying network devices in a data center network provided by an embodiment of the present invention;

图4-2是本发明实施例提供的再一种数据中心网络中网络设备的部分拓扑结构示意图;FIG. 4-2 is a schematic diagram of a partial topology structure of another network device in a data center network provided by an embodiment of the present invention;

图4-3是本发明实施例提供的一种识别更正过程的方法流程图;Fig. 4-3 is a flow chart of a method for identifying and correcting a process provided by an embodiment of the present invention;

图5是本发明实施例提供的再一种数据中心网络中网络设备的识别方法的流程图;FIG. 5 is a flowchart of another method for identifying network devices in a data center network provided by an embodiment of the present invention;

图6-1是本发明实施例提供的一种数据中心网络中网络设备的识别装置的结构示意图;Fig. 6-1 is a schematic structural diagram of an identification device for network equipment in a data center network provided by an embodiment of the present invention;

图6-2是本发明实施例提供的另一种数据中心网络中网络设备的识别装置的结构示意图;FIG. 6-2 is a schematic structural diagram of another device for identifying network equipment in a data center network provided by an embodiment of the present invention;

图6-3是本发明实施例提供的一种第二识别单元的结构示意图;Fig. 6-3 is a schematic structural diagram of a second identification unit provided by an embodiment of the present invention;

图6-4是本发明实施例提供的另一种第二识别单元的结构示意图;Fig. 6-4 is a schematic structural diagram of another second identification unit provided by an embodiment of the present invention;

图7是本发明实施例提供的又一种数据中心网络中网络设备的识别装置的结构示意图;FIG. 7 is a schematic structural diagram of another device for identifying network equipment in a data center network provided by an embodiment of the present invention;

图8是本发明实施例提供的再一种数据中心网络中网络设备的识别装置的结构示意图;FIG. 8 is a schematic structural diagram of another device for identifying network equipment in a data center network provided by an embodiment of the present invention;

图9是本发明实施例提供的再一种数据中心网络中网络设备的识别装置的结构示意图。FIG. 9 is a schematic structural diagram of another apparatus for identifying network equipment in a data center network according to an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。In order to make the object, technical solution and advantages of the present invention clearer, the implementation manner of the present invention will be further described in detail below in conjunction with the accompanying drawings.

图1是相关技术中数据中心网络的拓扑结构示意图,如图1所示,以数据中心网络的拓扑结构为树形结构为例,该树形结构可以包括最底层的多个服务器01,与该服务器01连接的接入层交换机,也称为架顶交换机(英文:Top OfRack;简称:TOR)02、与该架顶交换机02连接的汇聚层交换机(英文:End OfRow;简称:EOR)03,以及与该汇聚层交换机03连接的核心层交换机04,该不同层级的交换机互联起来为服务器01之间的通讯提供通讯通道。当数据中心网络中的各个网络设备(包括服务器和不同层级的交换机)根据预设的拓扑结构部署完成后,该各个网络设备需要与数据中心网络的控制平面建立连接,以便该控制平面能够对该各个网络设备进行管理和控制,例如,向各个网络设备下发配置文件,实现网络设备的自动化配置等。Fig. 1 is a schematic diagram of the topology structure of the data center network in the related art. As shown in Fig. 1, taking the topology structure of the data center network as a tree structure as an example, the tree structure may include a plurality of servers 01 at the bottom, and the The access layer switch connected to the server 01 is also called a top-of-rack switch (English: Top OfRack; abbreviation: TOR) 02, and a convergence layer switch (English: End OfRow; abbreviation: EOR) 03 connected to the top-of-rack switch 02, As well as the core layer switch 04 connected to the aggregation layer switch 03, the switches at different levels are interconnected to provide communication channels for communication between the servers 01. After each network device (including servers and switches at different levels) in the data center network is deployed according to the preset topology, each network device needs to establish a connection with the control plane of the data center network so that the control plane can Each network device is managed and controlled, for example, configuration files are delivered to each network device to realize automatic configuration of network devices, etc.

图2-1是本发明实施例提供的一种数据中心网络的系统架构图,如图2-1所示,该数据中心网络可以划分为控制平面和数据平面,其中控制平面是由一个或多个控制设备10组成的,数据平面则包括多个网络设备00,其中,该多个网络设备00可以根据数据中心网络拓扑结构的不同,划分为不同的层级。示例的,若该数据中心网络的拓扑结构为两层的树形结构,则该多个网络设备可以划分为两种层级类型的网络设备,例如:接入层交换机和汇聚层交换机;若该数据中心网络的拓扑结构为三层的胖树(Fat-Tree)结构,则该多个网络设备可以划分为三种不同层级类型的网络设备,例如:接入层交换机、汇聚层交换机和核心层交换机;若数据中心网络的拓扑结构为三层Fat-Tree结构,且该数据中心网络的服务器中安装了虚拟交换机或者软交换机,则可以将该虚拟交换机或者软交换机作为该数据中心网络拓扑结构的第四层扩展,此时该数据中心网络中网络设备的层级类型可以包括四种:虚拟交换机或者软交换机、接入层交换机、汇聚层交换机和核心层交换机。该不同层级类型的网络设备00与控制平面中的控制设备10建立连接后,控制设备10可以对该不同网络设备00的层级类型进行识别,以便向不同层级类型的网络设备下发不同的配置文件,从而实现数据中心网络中网络设备的自动化配置,例如在图2-1中,椭圆形区域内的网络设备已与控制设备10建立了连接,则控制设备10可以对该椭圆形区域内的网络设备进行层级类型的识别。Figure 2-1 is a system architecture diagram of a data center network provided by an embodiment of the present invention. As shown in Figure 2-1, the data center network can be divided into a control plane and a data plane, wherein the control plane consists of one or more The data plane includes a plurality of network devices 00, wherein the plurality of network devices 00 can be divided into different levels according to different data center network topologies. For example, if the topology of the data center network is a two-layer tree structure, the plurality of network devices can be divided into two types of network devices, for example: access layer switches and aggregation layer switches; if the data The topology of the central network is a three-layer Fat-Tree structure, and the multiple network devices can be divided into three different types of network devices, such as: access layer switches, aggregation layer switches, and core layer switches ; If the topology of the data center network is a three-layer Fat-Tree structure, and a virtual switch or soft switch is installed in the server of the data center network, the virtual switch or soft switch can be used as the first Four-layer extension, at this time, the network device layer types in the data center network can include four types: virtual switches or soft switches, access layer switches, aggregation layer switches, and core layer switches. After the network devices 00 of different layer types establish connections with the control device 10 in the control plane, the control device 10 can identify the layer types of the different network devices 00, so as to issue different configuration files to network devices of different layer types , so as to realize the automatic configuration of network devices in the data center network. For example, in Figure 2-1, the network devices in the oval area have established a connection with the control device 10, and the control device 10 can control the network in the oval area. The device performs identification of the hierarchy type.

图2-2是本发明实施例提供的一种数据中心网络中网络设备的识别方法的流程图,该方法可以应用于图2-1所示的控制设备10中,如图2-2所示,该方法包括:Fig. 2-2 is a flowchart of a method for identifying network devices in a data center network provided by an embodiment of the present invention. This method can be applied to the control device 10 shown in Fig. 2-1, as shown in Fig. 2-2 , the method includes:

步骤201、接收该数据中心网络中第一网络设备发送的连接报文,该连接报文包括该第一网络设备的层级标识。Step 201. Receive a connection message sent by a first network device in the data center network, where the connection message includes a layer identifier of the first network device.

步骤202、根据该层级标识,识别该第一网络设备的层级类型。Step 202: Identify the layer type of the first network device according to the layer identifier.

步骤203、根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型。Step 203: According to the pre-acquired topology information of each network device establishing a connection with the control device and the layer type of the first network device, identify the layer type of each network device establishing a connection with the control device.

综上所述,本发明实施例提供一种数据中心网络中网络设备的识别方法,控制设备可以根据接收到的第一网络设备发送的连接报文中包括的层级标识,快速识别该第一网络设备的层级类型,进而再根据各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,该方法在识别第一网络设备的层级类型时,无需对该第一网络设备的连接状况进行分析,因此降低了对数据中心网络中网络设备进行识别时的计算复杂度,网络设备的识别灵活性较高。To sum up, the embodiments of the present invention provide a method for identifying network devices in a data center network. The control device can quickly identify the first network device according to the level identifier included in the connection message sent by the first network device received. The layer type of the device, and then according to the topology information of each network device and the layer type of the first network device, identify the layer type of each network device that establishes a connection with the control device. This method identifies the layer type of the first network device type, there is no need to analyze the connection status of the first network device, so the computational complexity of identifying the network device in the data center network is reduced, and the identification flexibility of the network device is relatively high.

本发明实施例提供另一种数据中心网络中网络设备的识别方法,该方法可以应用于数据中心网络中的第一网络设备中,该第一网络设备可以为图2-1中任一网络设备,该方法包括:An embodiment of the present invention provides another method for identifying network devices in a data center network. This method can be applied to the first network device in the data center network. The first network device can be any network device in Figure 2-1 , the method includes:

向数据中心网络中的控制设备发送连接报文,该连接报文包括该第一网络设备的层级标识,以便于该控制设备根据该层级标识,识别该第一网络设备的层级类型。Send a connection message to the control device in the data center network, where the connection message includes the layer identifier of the first network device, so that the control device can identify the layer type of the first network device according to the layer identifier.

在本发明实施例中,该第一网络设备可以为数据中心网络中任一层级类型的网络设备,示例的,假设该第一网络设备的层级类型为虚拟交换机,则该数据中心网络中的每个虚拟交换机与控制设备建立连接时,该每个虚拟交换机所发送的连接报文中都包括该虚拟交换机的层级标识。控制设备与各个网络设备建立连接的过程中,可以先根据层级标识识别第一网络设备的层级类型,再根据各个网络设备的拓扑信息以及第一网络设备的层级类型,逐一识别其他网络设备的层级类型。In this embodiment of the present invention, the first network device may be any layer type network device in the data center network. For example, assuming that the layer type of the first network device is a virtual switch, each network device in the data center network When a virtual switch establishes a connection with the control device, the connection message sent by each virtual switch includes the layer identifier of the virtual switch. In the process of establishing a connection between the control device and each network device, it can first identify the layer type of the first network device according to the layer identifier, and then identify the layers of other network devices one by one according to the topology information of each network device and the layer type of the first network device type.

综上所述,本发明实施例提供一种数据中心网络中网络设备的识别方法,第一网络设备向控制设备发送的连接报文中可以包括该第一网络设备的层级标识,因此控制设备可以根据该层级标识,快速识别第一网络设备的层级类型,进而再根据各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,因此,控制设备在识别第一网络设备的层级类型时,无需对该第一网络设备的连接状况进行分析,因此降低了对数据中心网络中各网络设备进行识别时的计算复杂度,网络设备的识别灵活性较高。To sum up, the embodiments of the present invention provide a method for identifying network devices in a data center network. The connection message sent by the first network device to the control device may include the layer identifier of the first network device, so the control device can quickly identify the layer type of the first network device according to the layer identification, and then identify the layer type of each network device that establishes a connection with the control device according to the topology information of each network device and the layer type of the first network device, Therefore, when the control device identifies the hierarchical type of the first network device, it does not need to analyze the connection status of the first network device, thus reducing the computational complexity of identifying each network device in the data center network, and the network device Recognition flexibility is high.

图3-1是本发明实施例提供的另一种数据中心网络中网络设备的识别方法的流程图,该方法可以应用于图2-1所示的控制设备10中,如图3-1所示,该方法包括:Fig. 3-1 is a flowchart of another method for identifying network devices in a data center network provided by an embodiment of the present invention. This method can be applied to the control device 10 shown in Fig. 2-1, as shown in Fig. 3-1 , the method includes:

步骤301、接收数据中心网络中第一网络设备发送的连接报文,该连接报文包括该第一网络设备的层级标识。Step 301. Receive a connection message sent by a first network device in the data center network, where the connection message includes a layer identifier of the first network device.

在本发明实施例中,当数据中心网络中的各个网络设备均部署完成后,该各个网络设备需要与该数据中心网络中的控制平面建立连接,在建立连接的过程中,第一网络设备向控制平面中控制设备发送的连接报文可以包括该第一网络设备的层级标识,该层级标识用于指示该第一网络设备的层级类型,即该第一网络设备在数据中心网络的拓扑结构中所处的层级,因此控制设备通过该层级标识即可识别出该第一网络设备的层级类型,并可以确定该第一网络设备与其他网络设备的相对位置关系。其中,该第一网络设备可以为任一层级类型的网络设备,例如可以为虚拟交换机、软交换机或者其他相同类型的网络设备,也可以为核心层交换机或者其他相同类型的网络设备,该连接报文可以为第一网络设备向控制设备发送的连接请求报文,也可以为连接响应报文或者属性上报消息等,本发明实施例对此不做限定。In the embodiment of the present invention, after each network device in the data center network is deployed, each network device needs to establish a connection with the control plane in the data center network. During the connection establishment process, the first network device sends The connection message sent by the control device in the control plane may include the layer identifier of the first network device, and the layer identifier is used to indicate the layer type of the first network device, that is, the first network device is in the topological structure of the data center network Therefore, the control device can recognize the layer type of the first network device through the layer identifier, and can determine the relative positional relationship between the first network device and other network devices. Wherein, the first network device may be any type of network device, for example, it may be a virtual switch, a soft switch or other network devices of the same type, or it may be a core layer switch or other network devices of the same type. The message may be a connection request message sent by the first network device to the control device, or may be a connection response message or an attribute report message, etc., which is not limited in this embodiment of the present invention.

需要说明的是,控制设备与网络设备建立连接时,可以是控制设备主动向网络设备发送控制通道连接请求,也可以是网络设备主动向控制设备发送控制通道连接请求,本发明实施例对此不作限定。该控制设备与网络设备建立连接的过程可以参考相关技术,本发明实施例对此不做赘述。It should be noted that when the control device establishes a connection with the network device, the control device may actively send a control channel connection request to the network device, or the network device may actively send a control channel connection request to the control device. limited. For the process of establishing a connection between the control device and the network device, reference may be made to related technologies, which will not be described in detail in this embodiment of the present invention.

步骤302、根据该层级标识,识别该第一网络设备的层级类型。Step 302: Identify the layer type of the first network device according to the layer identifier.

控制设备接收到第一网络设备发送的连接报文后,可以根据该连接报文中携带的层级标识,识别该第一网络设备的层级类型。示例的,若该第一网络设备为虚拟交换机,则数据中心网络中的虚拟交换机向控制设备发送的连接报文中可以包括虚拟交换机的层级标识,控制设备可以根据第一网络设备发送的连接报文中所包括的层级标识,将该第一网络设备的层级类型识别为虚拟交换机。After receiving the connection message sent by the first network device, the control device can identify the layer type of the first network device according to the layer identifier carried in the connection message. For example, if the first network device is a virtual switch, the connection packet sent by the virtual switch in the data center network to the control device may include the level identifier of the virtual switch, and the control device may The layer identifier included herein identifies the layer type of the first network device as a virtual switch.

步骤303、将确定了层级类型的网络设备划分为已识别网络设备,该确定了层级类型的网络设备包括该第一网络设备。Step 303: Classify network devices whose hierarchical type is determined as identified network devices, where the network devices whose hierarchical type is determined include the first network device.

由于数据中心网络的拓扑结构一般为规则结构,因此,控制设备识别完第一网络设备的层级类型后,可以根据第一网络设备的层级类型,依次识别与该第一网络设备连接的其他网络设备的层级类型。在控制设备识别各个网络设备层级类型的过程中,为了判断是否继续执行识别算法,控制设备可以将已确定了层级类型的网络设备划分为已识别网络设备。示例的,图3-2是本发明实施例提供的一种数据中心网络中网络设备的部分拓扑结构示意图,如图3-2所示,假设与控制设备10建立连接的网络设备包括SW1至SW6,且其中第一网络设备为SW1,控制设备根据SW1发送的连接报文,识别出该SW1的层级类型为虚拟交换机后,控制设备可以确定的已识别网络设备包括:SW1。Since the topology structure of the data center network is generally a regular structure, after the control device identifies the layer type of the first network device, it can sequentially identify other network devices connected to the first network device according to the layer type of the first network device tier type. During the process of the control device identifying the hierarchical types of various network devices, in order to determine whether to continue to execute the identification algorithm, the control device may classify the network devices whose hierarchical types have been determined as identified network devices. As an example, Fig. 3-2 is a schematic diagram of a partial topology structure of network devices in a data center network provided by an embodiment of the present invention. As shown in Fig. 3-2, it is assumed that the network devices that establish a connection with the control device 10 include SW1 to SW6 , and the first network device is SW1, after the control device recognizes that the layer type of SW1 is a virtual switch according to the connection message sent by SW1, the identified network devices that the control device can determine include: SW1.

步骤304、判断与该控制设备建立连接的各个网络设备中是否存在与该已识别网络设备连接且未被识别的待识别网络设备。Step 304, judging whether there is an unidentified network device to be identified that is connected to the identified network device among the network devices that establish a connection with the control device.

当与该控制设备建立连接的各个网络设备中存在该待识别网络设备时,执行步骤305,当与该控制设备建立连接的各个网络设备中不存在该待识别网络设备时,执行步骤306。在本发明实施例中,为了提高判断待识别网络设备时的判断效率,控制设备可以仅判断各个网络设备中是否存在与最近识别的网络设备连接且未被识别的待识别网络设备。示例的,假设在图3-2中,控制设备根据SW1发送的连接报文识别了该第一网络设备SW1的层级类型为软交换机,然后根据该SW1的层级类型,识别了与该SW1连接的SW2的层级类型,此时,SW2的层级类型可以为架顶交换机,则此时控制设备划分的已识别网络设备可以包括:SW1和SW2,由于其中SW2为最近识别的网络设备,则控制设备在判断是否存在待识别网络设备时,可以仅判断是否存在与该SW2连接且未被识别的待识别网络设备,由于在图3-2中,SW3与SW2连接,且SW3未被控制设备识别,则控制设备可以确定存在待识别网络设备:SW3。When the network device to be identified exists among the network devices establishing a connection with the control device, step 305 is performed; when the network device to be identified does not exist among the network devices establishing a connection with the control device, step 306 is performed. In the embodiment of the present invention, in order to improve the judgment efficiency when judging the network device to be recognized, the control device may only judge whether there is an unrecognized network device connected to the most recently recognized network device in each network device. As an example, assume that in Figure 3-2, the control device recognizes that the layer type of the first network device SW1 is a soft switch according to the connection message sent by SW1, and then identifies the network device connected to the SW1 according to the layer type of the SW1. The layer type of SW2, at this time, the layer type of SW2 can be a top-of-rack switch, then the identified network devices divided by the control device at this time can include: SW1 and SW2, because SW2 is the most recently identified network device, the control device is in When judging whether there is a network device to be identified, you can only judge whether there is a network device to be identified that is connected to the SW2 and has not been identified. Since in Figure 3-2, SW3 is connected to SW2, and SW3 is not recognized by the control device, then The control device may determine that there is a network device to be identified: SW3.

步骤305、根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该已识别网络设备的层级类型,识别该待识别网络设备的层级类型。Step 305: Identify the layer type of the network device to be identified according to the pre-acquired topology information of each network device establishing a connection with the control device and the layer type of the identified network device.

在本发明实施例中,控制设备与网络设备建立连接后,控制设备可以通过拓扑发现过程,获取与该控制设备建立连接的各个网络设备的拓扑信息,其中,在该拓扑发现过程中,控制设备可以向与该控制设备建立连接的各个网络设备发送链路层发现协议(英文:Link Layer Discovery Protocol;简称:LLDP)报文,然后再根据该各个网络设备反馈的报文,获取该各个网络设备的拓扑信息,并将该各个网络设备的拓扑信息存储在数据中心网络中的存储器中,其中,该各个网络设备的拓扑信息包括各个网络设备之间的连接关系。示例的,如图3-2所示,假设数据中心网络中,与控制设备10建立连接的网络设备包括:SW1至SW6,则控制设备通过拓扑发现过程,获取到的网络设备SW1至SW6的拓扑信息可以如表1所示,该拓扑信息中记录了各个网络设备之间的连接关系,例如,SW1通过0号端口与SW2的0号端口连接,SW2通过1号端口与SW3的0号端口连接,SW3通过2号端口与SW3的1号端口连接等等。In the embodiment of the present invention, after the control device establishes a connection with the network device, the control device can obtain topology information of each network device that establishes a connection with the control device through a topology discovery process, wherein, in the topology discovery process, the control device A link layer discovery protocol (English: Link Layer Discovery Protocol; abbreviation: LLDP) message can be sent to each network device that establishes a connection with the control device, and then the information of each network device can be obtained according to the message fed back by each network device. and store the topology information of each network device in a memory in the data center network, wherein the topology information of each network device includes connection relationships between each network device. For example, as shown in Figure 3-2, assuming that in the data center network, the network devices that establish connections with the control device 10 include: SW1 to SW6, then the control device obtains the topology of the network devices SW1 to SW6 through the topology discovery process The information can be shown in Table 1. The connection relationship between various network devices is recorded in the topology information. For example, SW1 is connected to port 0 of SW2 through port 0, and SW2 is connected to port 0 of SW3 through port 1. , SW3 is connected to port 1 of SW3 through port 2 and so on.

表1Table 1

SW1:Port0-------SW2:Port0SW1: Port0-------SW2: Port0 SW2:Port1-------SW3:Port0SW2: Port1-------SW3: Port0 SW3:Port2-------SW4:Port1SW3: Port2-------SW4: Port1 ...... …

对于待识别网络设备:SW3,控制设备可以根据表1所示的拓扑信息,以及已识别网络设备的层级类型:SW1为虚拟交换机,SW2为架顶交换机,识别该待识别网络设备SW3的层级类型为汇聚层交换机。For the network device to be identified: SW3, the control device can identify the layer type of the network device to be identified SW3 according to the topology information shown in Table 1 and the layer type of the identified network device: SW1 is a virtual switch, and SW2 is a top-of-rack switch It is the aggregation layer switch.

之后,控制设备可以重复执行上述步骤303至步骤305,直至与该控制设备建立连接的各个网络设备中不存在与该已识别网络设备连接且未被识别的待识别网络设备,因此本发明实施例提供的网络设备的识别方法,其识别过程不受网络拓扑结构的限制,可以灵活识别具有不同层级结构的网络拓扑,提高了网络设备识别的灵活性。Afterwards, the control device can repeatedly execute the above-mentioned steps 303 to 305 until there is no network device to be identified that is connected to the identified network device and has not been identified among the network devices that establish a connection with the control device. Therefore, the embodiment of the present invention The identification method of the provided network equipment is not limited by the network topology structure in its identification process, can flexibly identify network topologies with different hierarchical structures, and improves the flexibility of network equipment identification.

需要说明的是,控制设备每识别完一个网络设备的层级类型,可以在拓扑信息中对该网络设备的层级类型进行标记,例如,对于图3-2所示的拓扑结构,控制设备完成对网络设备SW1至SW6的识别后,在拓扑信息中标记的各个网络设备的层级类型可以如表2所示,例如,将SW1标记为虚拟交换机,将SW4标记为核心层交换机。It should be noted that after the control device identifies the layer type of a network device, it can mark the layer type of the network device in the topology information. For example, for the topology shown in Figure 3-2, the control device completes the network After the devices SW1 to SW6 are identified, the hierarchical type of each network device marked in the topology information may be as shown in Table 2, for example, SW1 is marked as a virtual switch, and SW4 is marked as a core layer switch.

表2Table 2

步骤306、当存在新增的网络设备与该控制设备建立连接时,获取该新增的网络设备的拓扑信息。Step 306, when there is a newly added network device establishing a connection with the control device, acquire topology information of the newly added network device.

在本发明实施例中,由于数据中心网络中各个网络设备与控制设备建立连接的过程不是同步执行的,因此在控制设备对已经与该控制设备建立连接的各个网络设备进行识别的过程中,又出现新增的网络设备与该控制设备建立连接时,控制设备可以通过拓扑发现过程获取该新增的网络设备的拓扑信息。示例的,假设数据中心网络的部分拓扑结构如图3-3所示,且控制设备已完成了对网络设备SW31至SW35的识别,其中,SW31和SW32为第一网络设备,其层级类型为软交换机,SW33和SW34的层级类型为架顶交换机,SW35的层级类型为汇聚层交换机。当存在新增的网络设备SW36与该控制设备建立连接时,控制设备可以获取该SW36的拓扑信息,该拓扑信息中可以包括SW35与SW36的连接关系。In the embodiment of the present invention, since the process of establishing a connection between each network device and the control device in the data center network is not performed synchronously, during the process of the control device identifying each network device that has established a connection with the control device, When a newly added network device establishes a connection with the control device, the control device may obtain topology information of the newly added network device through a topology discovery process. As an example, assume that the partial topology of the data center network is shown in Figure 3-3, and the control device has completed the identification of network devices SW31 to SW35, where SW31 and SW32 are the first network devices, and their layer type is soft For switches, the layer type of SW33 and SW34 is a top-of-rack switch, and the layer type of SW35 is an aggregation layer switch. When a newly added network device SW36 establishes a connection with the control device, the control device may acquire topology information of the SW36, and the topology information may include the connection relationship between SW35 and SW36.

步骤307、根据该新增的网络设备的拓扑信息、与该控制设备建立连接的各个网络设备的拓扑信息以及与该控制设备建立连接的各个网络设备的层级类型,识别该新增的网络设备的层级类型。Step 307: According to the topology information of the newly added network device, the topology information of each network device establishing connection with the control device, and the hierarchy type of each network device establishing connection with the control device, identify the new network device Hierarchy type.

控制设备获取到新增的网络设备的拓扑信息后,可以根据已经确定的各个网络设备的层级类型,识别该新增的网络设备的层级类型。示例的,如图3-3所示,由于该网络设备SW36的拓扑信息包括SW36与SW35相连,且网络设备SW35的层级类型为汇聚层交换机,则控制设备可以确定该新增的网络设备SW36为核心层交换机。After obtaining the topology information of the newly added network device, the control device may identify the layer type of the newly added network device according to the determined layer type of each network device. For example, as shown in Figure 3-3, since the topology information of the network device SW36 includes that SW36 is connected to SW35, and the layer type of the network device SW35 is a convergence layer switch, the control device can determine that the newly added network device SW36 is Core layer switch.

需要说明的是,若该新增的交换机的层级类型与第一网络设备的层级类型相同,则该新增的网络设备在与控制设备建立连接时,向控制设备发送的连接报文中可以包括该新增的网络设备的层级标识,此时,控制设备可以直接根据该层级标识识别该新增的网络设备的层级类型。It should be noted that if the layer type of the newly added switch is the same as that of the first network device, when the newly added network device establishes a connection with the control device, the connection message sent to the control device may include The layer identifier of the newly added network device. At this time, the control device can directly identify the layer type of the newly added network device according to the layer identifier.

步骤308、根据该新增的网络设备的拓扑信息,更新与该控制设备建立连接的各个网络设备的拓扑信息。Step 308 , according to the topology information of the newly added network device, update the topology information of each network device that establishes a connection with the control device.

该新增的网络设备与控制设备建立连接后,控制设备可以根据获取到的该新增的网络设备的拓扑信息,实时更新与该控制设备建立连接的各个网络设备的拓扑信息。After the newly added network device establishes a connection with the control device, the control device can update the topology information of each network device connected with the control device in real time according to the obtained topology information of the newly added network device.

步骤309、根据该新增的网络设备的层级类型和该更新后的与该控制设备建立连接的各个网络设备的拓扑信息,重新识别该各个网络设备的层级类型。Step 309: Re-identify the layer type of each network device according to the layer type of the newly added network device and the updated topology information of each network device establishing a connection with the control device.

当新增的网络设备与控制设备建立连接后,各个网络设备之间的连接情况肯能会发生变化,基于更新前的拓扑信息所识别的各个网络设备的层级类型可能会存在错误,因此控制设备可以根据该新增的网络设备的层级类型和该更新后的与该控制设备建立连接的各个网络设备的拓扑信息,重新识别该各个网络设备的层级类型。该重新识别的过程可以参考上述步骤303至步骤305,本发明实施例不再赘述。After the newly added network device establishes a connection with the control device, the connection between each network device may change, and the hierarchical type of each network device identified based on the topology information before the update may be wrong, so the control device The layer type of each network device may be re-identified according to the layer type of the newly added network device and the updated topology information of each network device establishing a connection with the control device. For the re-identification process, reference may be made to the above steps 303 to 305, which will not be repeated in this embodiment of the present invention.

示例的,假设如图3-4所示,新增的网络设备为SW32,在该网络设备SW32与控制设备建立连接之前,控制设备已完成了对网络设备SW31以及网络设备SW33至SW36的识别,其具体识别结果为:SW31的层级类型为软交换机,SW33的层级类型为架顶交换机,SW35的层级类型为汇聚层交换机,SW34和SW36的层级类型为核心层交换机。当SW32与控制设备建立连接后,控制设备识可以根据该SW32发送的连接报文中所携带的层级标识,识别该网络设备SW32为软交换机,并且可以获取到该新增的网络设备SW32的拓扑信息,该SW32拓扑信息可以包括:SW32与SW34连接。进一步的,控制设备可以根据该新增的网络设备SW32的层级类型:软交换机,以及该新增的网络设备SW32的拓扑信息,将网络设备SW34的层级类型重新识别为架顶交换机。For example, assuming that as shown in Figure 3-4, the newly added network device is SW32, and before the network device SW32 establishes a connection with the control device, the control device has completed the identification of the network device SW31 and network devices SW33 to SW36, The specific identification results are: the layer type of SW31 is a soft switch, the layer type of SW33 is a top-of-rack switch, the layer type of SW35 is an aggregation layer switch, and the layer types of SW34 and SW36 are core layer switches. After the SW32 establishes a connection with the control device, the control device can identify the network device SW32 as a soft switch according to the layer identification carried in the connection message sent by the SW32, and can obtain the topology of the newly added network device SW32 Information, the SW32 topology information may include: the connection between SW32 and SW34. Further, the control device may re-identify the layer type of the network device SW34 as a top-of-rack switch according to the layer type of the newly added network device SW32: soft switch, and the topology information of the newly added network device SW32.

在实际应用中,控制设备可以周期性的对与该控制设备连接的各个网络设备的层级类型进行识别,并不断根据新增的网络设备的拓扑信息,重新识别并更正误识别的网络设备,提高了控制设备对数据中心网络中各个网络设备识别时的识别准确度。In practical applications, the control device can periodically identify the layer type of each network device connected to the control device, and continuously re-identify and correct the misidentified network device according to the topology information of the newly added network device, so as to improve In order to control the recognition accuracy of each network device in the data center network when the control device recognizes it.

需要说明的是,本发明实施例提供的数据中心网络中网络设备的识别方法的步骤的先后顺序可以进行适当调整,步骤也可以根据情况进行相应增减,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本发明的保护范围之内,因此不再赘述。It should be noted that the order of the steps of the method for identifying network devices in the data center network provided by the embodiment of the present invention can be appropriately adjusted, and the steps can also be increased or decreased according to the situation. Within the technical scope disclosed by the invention, any easily conceivable change method shall be covered within the scope of protection of the present invention, so details are not repeated here.

综上所述,本发明实施例提供一种数据中心网络中网络设备的识别方法,控制设备可以根据接收到的第一网络设备发送的连接报文中包括的层级标识,快速识别该第一网络设备的层级类型,进而再根据各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,该方法在识别第一网络设备的层级类型时,无需对该第一网络设备的连接状况进行分析,因此降低了对数据中心网络中网络设备进行识别时的计算复杂度,网络设备的识别灵活性较高,并且本发明实施例提供的网络设备的识别方法,在对数据中心网络中的网络设备进行识别的过程中,不受网络拓扑结构的限制,能够灵活识别不同拓扑结构下的网络设备;此外,相关技术中的网络设备发现方案只能对完全态拓扑结构下的网络设备进行识别,但数据中心网络在组网时是由起始的非完全态拓扑逐渐完善至完全态拓扑的,即数据中心网络的生命周期中包括较长的非完全态拓扑周期,本发明实施例提供的网络设备的识别方法不仅可以对完全态拓扑结构下的网络设备进行识别,还能够对该非完全态拓扑结构下的网络设备进行识别。To sum up, the embodiments of the present invention provide a method for identifying network devices in a data center network. The control device can quickly identify the first network device according to the level identifier included in the connection message sent by the first network device received. The layer type of the device, and then according to the topology information of each network device and the layer type of the first network device, identify the layer type of each network device that establishes a connection with the control device. This method identifies the layer type of the first network device type, there is no need to analyze the connection status of the first network device, so the computational complexity of identifying the network device in the data center network is reduced, and the identification flexibility of the network device is high, and the embodiment of the present invention provides The network device identification method, in the process of identifying network devices in the data center network, is not limited by the network topology structure, and can flexibly identify network devices under different topological structures; in addition, the network device discovery scheme in the related art Only network devices under the complete topology can be identified, but the data center network is gradually improved from the initial incomplete topology to the complete topology during networking, that is, the life cycle of the data center network includes a long The network device identification method provided by the embodiment of the present invention can not only identify the network device under the complete topology structure, but also identify the network device under the incomplete topology structure.

在本发明实施例中,当第一网络设备的层级类型为虚拟交换机、核心层交换机或者软交换机时,则该数据中心网络的拓扑结构可能包括四层拓扑,假设第一网络设备的层级类型为软交换机,此时,控制设备识别数据中心网络中各个网络设备的层级类型的过程可以如图4-1所示,该方法包括:In the embodiment of the present invention, when the layer type of the first network device is a virtual switch, core layer switch or soft switch, the topology of the data center network may include a four-layer topology, assuming that the layer type of the first network device is For the soft switch, at this time, the process for the control device to identify the hierarchical type of each network device in the data center network can be shown in Figure 4-1. The method includes:

步骤401、接收该数据中心网络中第一网络设备发送的连接报文,该连接报文包括该第一网络设备的层级标识。Step 401. Receive a connection message sent by a first network device in the data center network, where the connection message includes a layer identifier of the first network device.

示例的,假设数据中心网络的拓扑结构为如图4-2所示的Fat-tree结构,且第一网络设备为软交换机SW41,在该各个网络设备SW41至SW410与控制设备建立连接的过程中,第一网络设备SW41向控制设备发送的连接报文中可以包括SW41的层级标识:软交换机。As an example, assume that the topology of the data center network is a Fat-tree structure as shown in Figure 4-2, and the first network device is a soft switch SW41. During the process of establishing connections between the network devices SW41 to SW410 and the control device The connection message sent by the first network device SW41 to the control device may include the layer identifier of SW41: soft switch.

步骤402、根据该层级标识,识别该第一网络设备的层级类型。Step 402: Identify the layer type of the first network device according to the layer identifier.

控制设备接收各个网络设备发送的连接报文,并根据第一网络设备所发送的连接报文中携带的层级标识,确定该第一网络设备SW41的层级类型:软交换机。The control device receives the connection message sent by each network device, and determines the layer type of the first network device SW41 according to the layer identifier carried in the connection message sent by the first network device: soft switch.

步骤403、根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该第一网络设备连接的第二网络设备的层级类型。Step 403: Identify the layer type of the second network device connected to the first network device according to the pre-acquired topology information of each network device connected to the control device and the layer type of the first network device.

示例的,控制设备在与网络设备SW41至SW410建立连接后,可以通过拓扑发现过程,获取该网络设备SW41至SW410的拓扑信息,该拓扑信息中个包括该各个网络设备SW41至SW410的连接关系,之后,控制设备可以根据该拓扑信息以及已识别的第一网络设备SW41的层级类型:软交换机,识别与该第一网络设备SW41连接的第二网络设备:SW42的层级类型,该第二网络设备SW42的层级类型可以为架顶交换机。For example, after the control device establishes a connection with the network devices SW41 to SW410, it can obtain the topology information of the network devices SW41 to SW410 through a topology discovery process, and the topology information includes the connection relationship of the respective network devices SW41 to SW410, After that, the control device can identify the second network device connected to the first network device SW41: the layer type of SW42 according to the topology information and the identified layer type of the first network device SW41: soft switch, the second network device The layer type of SW42 can be a top-of-rack switch.

步骤404、根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第二网络设备的层级类型,识别与该第二网络设备连接且未被识别的第三网络设备的层级类型。Step 404: According to the pre-acquired topology information of each network device that establishes a connection with the control device, and the layer type of the second network device, identify the layer of the unrecognized third network device that is connected to the second network device type.

进一步的,控制设备可以根据第二网络设备SW42的层级类型:架顶交换机,识别与该第二网络设备SW42连接且未被识别的第三网络设备:SW46至SW49的层级类型,该第三网络设备SW46至SW49的层级类型可以为汇聚层交换机。Further, the control device can identify the unrecognized third network device connected to the second network device SW42 according to the layer type of the second network device SW42: the top-of-rack switch: the layer types of SW46 to SW49, the third network The layer types of the devices SW46 to SW49 may be aggregation layer switches.

步骤405、根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第三网络设备的层级类型,识别与该第三网络设备连接且未被识别的第四网络设备的层级类型。Step 405, according to the pre-acquired topology information of each network device that establishes a connection with the control device, and the layer type of the third network device, identify the layer of the unidentified fourth network device connected to the third network device type.

控制设备根据已确定的第三网络设备SW46至SW49的层级类型,可以进一步识别与该第三网络设备SW46至SW49中任一网络设备有连接关系且未被识别的第四网络设备的层级类型,示例的,该第四网络设备可以包括SW43至SW45以及SW410,控制设备识别的该第四网络设备SW43至SW45以及SW410的层级类型可以为核心层交换机。The control device may further identify the layer type of an unidentified fourth network device that has a connection relationship with any network device in the third network device SW46 to SW49 according to the determined layer type of the third network device SW46 to SW49, For example, the fourth network device may include SW43 to SW45 and SW410, and the layer type of the fourth network device SW43 to SW45 and SW410 recognized by the control device may be a core layer switch.

步骤406、判断与该控制设备建立连接的各个网络设备中未被识别的网络设备的个数是否大于第一预设阈值,以及该第四网络设备的个数是否大于第二预设阈值。Step 406 , judging whether the number of unrecognized network devices among the network devices establishing a connection with the control device is greater than a first preset threshold, and whether the number of the fourth network device is greater than a second preset threshold.

当与该控制设备建立连接的各个网络设备中未被识别的网络设备的个数大于第一预设阈值,或该第四网络设备的个数大于第二预设阈值时,控制设备可以确定已识别网络设备中可能存在误识别的情况,并执行步骤407;当与该控制设备建立连接的各个网络设备中未被识别的网络设备的个数不大于第一预设阈值,且该第四网络设备的个数大于第二预设阈值时,则控制设备可以确定已识别网络设备的识别结果无误,结束识别进程。When the number of unrecognized network devices among the network devices establishing connections with the control device is greater than the first preset threshold, or the number of the fourth network devices is greater than the second preset threshold, the control device may determine that Recognize that there may be misidentification among the network devices, and execute step 407; when the number of unrecognized network devices among the network devices that establish a connection with the control device is not greater than the first preset threshold, and the fourth network When the number of devices is greater than the second preset threshold, the control device may determine that the recognition results of the recognized network devices are correct, and end the recognition process.

示例的,假设该第一预设阈值和第二预设阈值均为2,则在图4-2所示的拓扑结构中,由于与该控制设备建立连接的各个网络设备中未被识别的网络设备的个数为0,小于该第一预设阈值,但第四网络设备的个数为4,大于该第二预设阈值:2,因此控制设备可以确定该已识别的网络设备中可能存在误识别的网络设备,并执行步骤407进行更正。For example, assuming that the first preset threshold and the second preset threshold are both 2, in the topology shown in Figure 4-2, due to the unrecognized network in each network device establishing a connection with the control device The number of devices is 0, which is less than the first preset threshold, but the number of fourth network devices is 4, which is greater than the second preset threshold: 2, so the control device can determine that there may be Misrecognized network equipment, and perform step 407 to correct it.

步骤407、执行识别更正过程。Step 407, execute a recognition correction process.

当与该控制设备建立连接的各个网络设备中未被识别的网络设备的个数大于第一预设阈值,或该第四网络设备的个数大于第二预设阈值时,则控制设备可以确定已确定了层级类型的网络设备中可能存在误识别的网络设备,并执行识别更正过程,如图4-3所示,该识别更正过程包括:When the number of unrecognized network devices among the network devices establishing a connection with the control device is greater than the first preset threshold, or the number of the fourth network device is greater than the second preset threshold, the control device may determine that It has been determined that there may be misrecognized network devices among the network devices of the layer type, and the recognition and correction process is performed, as shown in Figure 4-3. The recognition and correction process includes:

步骤4071、确定已识别的第三网络设备的个数n。Step 4071. Determine the number n of identified third network devices.

其中,该已识别的第三网络设备的个数n是指连接至同一个第二网络设备的第三网络设备的个数。示例的,在图4-2所示的拓扑结构中,由于第三网络设备SW46至SW49均连接至第二网络设备SW42,因此控制设备可以确定已识别的第三网络设备的个数为:n=4。Wherein, the number n of the identified third network devices refers to the number of third network devices connected to the same second network device. For example, in the topology shown in FIG. 4-2, since the third network devices SW46 to SW49 are all connected to the second network device SW42, the control device can determine that the number of identified third network devices is: n =4.

步骤4072、根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,判断该第四网络设备所连接的网络设备中该第三网络设备的个数m是否大于或等于 Step 4072: Determine whether the number m of the third network device among the network devices connected to the fourth network device is greater than or equal to

其中,表示向上取整,当该第四网络设备所连接的网络设备中该第三网络设备的个数m大于或等于时,执行步骤4073;当该第四网络设备所连接的网络设备中该第三网络设备的个数m小于时,结束识别更正过程。in, Indicates rounding up, when the number m of the third network device among the network devices connected to the fourth network device is greater than or equal to , execute step 4073; when the number m of the third network devices among the network devices connected to the fourth network device is less than , the recognition correction process ends.

需要说明的是,若已识别的网络设备中第四网络设备的个数大于1,则上述步骤4072中,需要对每个第四网络设备所连接的网络设备进行分析和统计。示例的,对于第四网络设备SW43,根据控制设备预先获取的与该控制设备建立连接的各个网络设备的拓扑信息可知,与第四网络设备SW43连接的网络设备中,第三网络设备的个数m=4,由于m大于则控制设备可以执行步骤4073;对于第四网络设备SW410,由于该SW410仅与SW46连接,即该第四网络设备SW410所连接的第三网络设备的个数m=1,小于此时,控制设备可以确定对该第四网络设备SW410的层级类型的识别结果是正确的,并结束识别更正过程。It should be noted that, if the number of the fourth network device among the identified network devices is greater than 1, in the above step 4072, it is necessary to analyze and count the network devices connected to each fourth network device. For example, for the fourth network device SW43, according to the topology information of each network device that establishes a connection with the control device obtained in advance by the control device, it can be known that among the network devices connected to the fourth network device SW43, the number of third network devices m=4, since m is greater than Then the control device can execute step 4073; for the fourth network device SW410, since the SW410 is only connected to SW46, that is, the number of third network devices connected to the fourth network device SW410 is m=1, less than At this time, the control device may determine that the recognition result of the hierarchical type of the fourth network device SW410 is correct, and end the recognition correction process.

步骤4073、将该第四网络设备的层级类型更正为与该第二网络设备相同的层级类型。Step 4073: Correct the layer type of the fourth network device to be the same layer type as that of the second network device.

当该第四网络设备所连接的网络设备中该第三网络设备的个数m大于或等于时,控制设备可以确定对该第四网络设备的层级类型的识别结果有误,并将该第四网络设备的层级类型更正为与该第二网络设备相同的层级类型。示例的,控制设备可以将第四网络设备:SW43至SW45的层级类型更正为与该第二网络设备SW42相同的类型,即将第四网络设备SW43至SW45的层级类型更正为架顶交换机。When the number m of the third network devices among the network devices connected to the fourth network device is greater than or equal to , the control device may determine that the recognition result of the layer type of the fourth network device is wrong, and correct the layer type of the fourth network device to be the same layer type as that of the second network device. For example, the control device may correct the fourth network device: SW43 to SW45 to be the same type as the second network device SW42, that is, correct the fourth network device SW43 to SW45 to be a top-of-rack switch.

需要说明的是,本发明实施例提供的数据中心网络中网络设备的识别方法的步骤的先后顺序可以进行适当调整,步骤也可以根据情况进行相应增减,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本发明的保护范围之内,因此不再赘述。It should be noted that the order of the steps of the method for identifying network devices in the data center network provided by the embodiment of the present invention can be appropriately adjusted, and the steps can also be increased or decreased according to the situation. Within the technical scope disclosed by the invention, any easily conceivable change method shall be covered within the scope of protection of the present invention, so details are not repeated here.

综上所述,本发明实施例提供一种数据中心网络中网络设备的识别方法,控制设备可以根据接收到的第一网络设备发送的连接报文中包括的层级标识,快速识别该第一网络设备的层级类型,进而再根据各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,该方法在识别第一网络设备的层级类型时,无需对该第一网络设备的连接状况进行分析,因此降低了对数据中心网络中网络设备进行识别时的计算复杂度,网络设备的识别灵活性较高。To sum up, the embodiments of the present invention provide a method for identifying network devices in a data center network. The control device can quickly identify the first network device according to the level identifier included in the connection message sent by the first network device received. The layer type of the device, and then according to the topology information of each network device and the layer type of the first network device, identify the layer type of each network device that establishes a connection with the control device. This method identifies the layer type of the first network device type, there is no need to analyze the connection status of the first network device, so the computational complexity of identifying the network device in the data center network is reduced, and the identification flexibility of the network device is relatively high.

在本发明实施例中,当第一网络设备的层级类型为虚拟交换机、核心层交换机或者软交换机时,则说明该数据中心网络的拓扑结构可能包括四层拓扑,假设第一网络设备的层级类型为软交换机,此时,控制设备识别数据中心网络中各个网络设备的层级类型的过程还可以如图5所示,该方法包括:In the embodiment of the present invention, when the layer type of the first network device is a virtual switch, core layer switch or soft switch, it means that the topology of the data center network may include a four-layer topology, assuming that the layer type of the first network device It is a soft switch. At this time, the process for the control device to identify the hierarchical type of each network device in the data center network can also be shown in Figure 5. The method includes:

步骤501、接收该数据中心网络中第一网络设备发送的连接报文,该连接报文包括该第一网络设备的层级标识。Step 501. Receive a connection message sent by a first network device in the data center network, where the connection message includes a layer identifier of the first network device.

步骤502、根据该层级标识,识别该第一网络设备的层级类型;Step 502: Identify the layer type of the first network device according to the layer identifier;

步骤503、根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该第一网络设备连接的第二网络设备的层级类型。Step 503: Identify the layer type of the second network device connected to the first network device according to the pre-acquired topology information of each network device connected to the control device and the layer type of the first network device.

步骤504、根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第二网络设备的层级类型,识别与该第二网络设备连接且未被识别的第三网络设备的层级类型。Step 504: According to the pre-acquired topology information of each network device that establishes a connection with the control device, and the layer type of the second network device, identify the layer of the unidentified third network device connected to the second network device type.

上述步骤501至步骤504的具体实现过程可以参考步骤401至步骤404,本发明实施例不再赘述。For the specific implementation process of the above step 501 to step 504, reference may be made to step 401 to step 404, which will not be repeated in this embodiment of the present invention.

步骤505、确定已识别的该第三网络设备的个数n。Step 505. Determine the number n of the identified third network devices.

控制设备识别第三网络设备的层级类型后,可以先确定已识别的第三网络设备的个数n,其中,该已识别的第三网络设备的个数n是指连接至同一个第二网络设备的第三网络设备的个数。。示例的,假设在图4-2所示的拓扑结构中,控制设备已识别的第三网络设备为SW46至SW49,则控制设备可以确定第三网络设备的个数n=4。After the control device recognizes the layer type of the third network device, it may first determine the number n of the recognized third network devices, wherein the number n of the recognized third network devices refers to The number of third network devices of the device. . For example, assuming that in the topology shown in FIG. 4-2, the third network devices identified by the control device are SW46 to SW49, the control device may determine that the number n=4 of the third network devices.

步骤506、根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,判断第四网络设备所连接的网络设备中该第三网络设备的个数m是否大于或等于 Step 506: According to the pre-acquired topology information of each network device that establishes a connection with the control device, determine whether the number m of the third network device among the network devices connected to the fourth network device is greater than or equal to

其中,该第四网络设备为与该第三网络建立连接且未被识别的网络设备,若该第四网络设备的个数大于1,则控制设备需要分别判断每个第四网络设备所连接的网络设备中该第三网络设备的个数m是否大于或等于当该第四设备所连接的网络设备中该第三网络设备的个数m大于或等于时,执行步骤507;当该第四网络设备所连接的网络设备中该第三网络设备的个数m小于时,执行步骤508。Wherein, the fourth network device is an unrecognized network device that establishes a connection with the third network. If the number of the fourth network device is greater than 1, the control device needs to separately determine the number of network devices connected to each fourth network device. Whether the number m of the third network device in the network device is greater than or equal to When the number m of the third network devices among the network devices connected to the fourth device is greater than or equal to , execute step 507; when the number m of the third network devices among the network devices connected to the fourth network device is less than , execute step 508.

示例的,如图4-2所示,与第三网络SW46至SW49建立连接且未被识别的网络设备包括网络设备SW43至SW45及SW410,则控制设备可以确定第四网络设备为SW43至SW45及SW410。对于第四网络设备SW43至SW45,由于该SW43至SW45分别与m=4个第三网络设备建立有连接,因此控制设备可以执行步骤507;对于第四网络设备SW410,由于该SW410所连接的网络设备中仅包括m=1个第三网络设备SW46,则控制设备可以执行步骤508。For example, as shown in Figure 4-2, the unrecognized network devices that have established connections with the third network SW46 to SW49 include network devices SW43 to SW45 and SW410, then the control device can determine that the fourth network devices are SW43 to SW45 and SW410. SW410. For the fourth network equipment SW43 to SW45, since the SW43 to SW45 respectively establish connections with m=4 third network equipment, the control equipment can perform step 507; for the fourth network equipment SW410, because the network connected to the SW410 The device only includes m=1 third network device SW46, and the control device may execute step 508.

步骤507、将该第四网络设备的层级类型识别为与该第二网络设备相同的层级类型。Step 507. Identify the stratum type of the fourth network device as the same stratum type as that of the second network device.

示例的,控制设备可以将第四网络设备:SW43至SW45的层级类型识别为与第二网络设备:SW42相同的类型,即将第四网络设备SW43至SW45的层级类型识别为架顶交换机。For example, the control device may identify the fourth network device: SW43 to SW45 as the same type as the second network device: SW42, that is, identify the fourth network device SW43 to SW45 as a top-of-rack switch.

步骤508、根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第三网络设备的层级类型,识别该第四网络设备的层级类型。Step 508: Identify the layer type of the fourth network device according to the pre-acquired topology information of each network device establishing a connection with the control device and the layer type of the third network device.

当该第四设备所连接的网络设备中该第三网络设备的个数m大于或等于时,控制设备可以根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第三网络设备的层级类型,识别该第四网络设备的层级类型。示例的,对于SW410,控制设备可以根据如图4-2所示的拓扑结构以及第三网络设备SW46的层级类型:汇聚层交换机,识别该第四网络设备SW410的层级类型为核心层交换机。When the number m of the third network devices among the network devices connected to the fourth device is greater than or equal to At this time, the control device may identify the layer type of the fourth network device according to the pre-acquired topology information of each network device establishing a connection with the control device and the layer type of the third network device. For example, for SW410, the control device may identify the layer type of the fourth network device SW410 as a core layer switch according to the topology shown in FIG. 4-2 and the layer type of the third network device SW46: aggregation layer switch.

需要说明的是,由于Fat-tree结构可以包括多个Pod,每个Pod中包括一定数量的第二网络设备和第三网络设备,其中,每个第三网络设备所连接的第二网络设备均为与该第三网络设备位于同一Pod中的第二网络设备。若各个Pod中包括的第三网络设备的数量不相等,则在上述步骤505中,控制设备所确定已识别的第三网络设备的个数n也不相同,即每个Pod可以对应于一个已识别的第三网络设备的个数n,因此在识别第四网络设备的层级类型时,需要根据每个第四网络设备所连接的第三网络设备所位于的Pod,确定该Pod所对应的已识别的第三网络设备的个数n。It should be noted that since the Fat-tree structure may include multiple Pods, each Pod includes a certain number of second network devices and third network devices, where the second network devices connected to each third network device are is a second network device located in the same Pod as the third network device. If the number of third network devices included in each Pod is not equal, then in the above step 505, the number n of identified third network devices determined by the control device is also different, that is, each Pod can correspond to a The number n of identified third network devices. Therefore, when identifying the layer type of the fourth network device, it is necessary to determine the Pod corresponding to the Pod according to the Pod where the third network device connected to each fourth network device is located. The number n of identified third network devices.

还需要说明的是,本发明实施例提供的数据中心网络中网络设备的识别方法的步骤的先后顺序可以进行适当调整,步骤也可以根据情况进行相应增减,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本发明的保护范围之内,因此不再赘述。It should also be noted that the order of the steps of the method for identifying network devices in the data center network provided by the embodiment of the present invention can be appropriately adjusted, and the steps can also be increased or decreased according to the situation. Within the technical scope disclosed in the present invention, any easily conceivable change method shall be covered in the protection scope of the present invention, so details are not repeated here.

综上所述,本发明实施例提供一种数据中心网络中网络设备的识别方法,控制设备可以根据接收到的第一网络设备发送的连接报文中包括的层级标识,快速识别该第一网络设备的层级类型,进而再根据各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,该方法在识别第一网络设备的层级类型时,无需对该第一网络设备的连接状况进行分析,因此降低了对数据中心网络中网络设备进行识别时的计算复杂度,网络设备的识别灵活性较高。To sum up, the embodiments of the present invention provide a method for identifying network devices in a data center network. The control device can quickly identify the first network device according to the level identifier included in the connection message sent by the first network device received. The layer type of the device, and then according to the topology information of each network device and the layer type of the first network device, identify the layer type of each network device that establishes a connection with the control device. This method identifies the layer type of the first network device type, there is no need to analyze the connection status of the first network device, so the computational complexity of identifying the network device in the data center network is reduced, and the identification flexibility of the network device is relatively high.

需要说明的是,在实际应用中,操作人员可以根据数据中心网络中各个服务器的配置情况,在控制设备中配置对应的网络设备识别算法。示例的,当数据中心网络中的各个服务器中均设置有虚拟交换机或软交换机时,控制设备可以采用基于图4-1所示的网络设备的识别方法对数据中心网络中的各个网络设备的层级类型进行识别;当数据中心网络中只有部分服务器中设置有虚拟交换机或软交换机时,控制设备可以采用基于图5所示的网络设备的识别方法对数据中心网络中的各个网络设备的层级类型进行识别。It should be noted that in practical applications, the operator can configure the corresponding network device identification algorithm in the control device according to the configuration of each server in the data center network. For example, when each server in the data center network is equipped with a virtual switch or a soft switch, the control device can use the network device identification method shown in Figure 4-1 to identify the level of each network device in the data center network. type; when only some servers in the data center network are equipped with virtual switches or soft switches, the control device can use the network device identification method shown in Figure 5 to identify the hierarchical types of each network device in the data center network identify.

还需要说明的是,本发明提供的各个实施例中,该第一网络设备的层级类型为虚拟交换机或软交换机时,该第二网络设备的层级类型可以为架顶交换机,该第三网络设备的层级类型可以为汇聚层交换机,该第四网络设备的层级类型可以为核心层交换机;当该第一网络设备的层级类型为核心层交换机时,该第二网络设备的层级类型可以为汇聚层交换机,该第三网络设备的层级类型可以为架顶交换机,该第四网络设备的层级类型可以为虚拟交换机或软交换机。It should also be noted that, in each of the embodiments provided by the present invention, when the layer type of the first network device is a virtual switch or a soft switch, the layer type of the second network device may be a top-of-rack switch, and the third network device The layer type of the network device can be an aggregation layer switch, and the layer type of the fourth network device can be a core layer switch; when the layer type of the first network device is a core layer switch, the layer type of the second network device can be an aggregation layer A switch, the layer type of the third network device may be a top-of-rack switch, and the layer type of the fourth network device may be a virtual switch or a soft switch.

还需要说明的是,本发明提供的各个实施例中,该第一网络设备向控制设备发送的连接报文可以包括该第一网络设备向该控制设备发送的握手消息、心跳消息或属性上报消息,其中,该握手消息可以为基于OpenFlow协议的hello消息,属性上报消息可以为用于响应属性请求消息(比如,feature_request或类似消息)的属性响应消息(比如,feature_reply或类似消息),该属性上报消息还可以为与该属性响应消息类型相似的其他消息,本发明实施例对此不做限定;此外,本发明提供的各个实施例中,第一网络设备的层级类型。It should also be noted that, in each embodiment provided by the present invention, the connection message sent by the first network device to the control device may include a handshake message, a heartbeat message or an attribute report message sent by the first network device to the control device , wherein, the handshake message can be a hello message based on the OpenFlow protocol, and the attribute report message can be an attribute response message (for example, feature_reply or similar message) for responding to an attribute request message (for example, feature_request or similar message), and the attribute report The message may also be another message similar to the type of the attribute response message, which is not limited in this embodiment of the present invention; in addition, in each embodiment provided by the present invention, the layer type of the first network device.

图6-1是本发明实施例提供的一种数据中心网络中网络设备的识别装置的结构示意图,该装置位于数据中心网络中的控制设备中,如图6-1所示,该装置包括:Figure 6-1 is a schematic structural diagram of an identification device for network equipment in a data center network provided by an embodiment of the present invention. The device is located in a control device in the data center network. As shown in Figure 6-1, the device includes:

接收单元601,用于接收该数据中心网络中第一网络设备发送的连接报文,该连接报文包括该第一网络设备的层级标识。The receiving unit 601 is configured to receive a connection message sent by a first network device in the data center network, where the connection message includes a layer identifier of the first network device.

第一识别单元602,用于根据该层级标识,识别该第一网络设备的层级类型。The first identifying unit 602 is configured to identify the layer type of the first network device according to the layer identifier.

第二识别单元603,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型。The second identification unit 603 is configured to identify the layer type of each network device that establishes a connection with the control device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the first network device .

综上所述,本发明实施例提供一种数据中心网络中网络设备的识别装置,该装置位于数据中心网络中的控制设备中,控制设备可以根据接收到的第一网络设备发送的连接报文中包括的层级标识,快速识别该第一网络设备的层级类型,进而再根据各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,该方法在识别第一网络设备的层级类型时,无需对该第一网络设备的连接状况进行分析,因此降低了对数据中心网络中网络设备进行识别时的计算复杂度,网络设备的识别灵活性较高。To sum up, the embodiment of the present invention provides an identification device for a network device in a data center network. The device is located in a control device in the data center network, and the control device can receive a connection message sent by the first network device. The layer identification included in the network device quickly identifies the layer type of the first network device, and then identifies the layer of each network device that establishes a connection with the control device according to the topology information of each network device and the layer type of the first network device type, this method does not need to analyze the connection status of the first network device when identifying the layer type of the first network device, thus reducing the computational complexity when identifying network devices in the data center network, and the identification of network devices High flexibility.

图6-2是本发明实施例提供的另一种数据中心网络中网络设备的识别装置的结构示意图,该装置位于数据中心网络中的控制设备中,如图6-2所示,该装置包括:Figure 6-2 is a schematic structural diagram of another device for identifying network equipment in a data center network provided by an embodiment of the present invention. The device is located in the control device in the data center network. As shown in Figure 6-2, the device includes :

接收单元601,用于接收该数据中心网络中第一网络设备发送的连接报文,该连接报文包括该第一网络设备的层级标识。The receiving unit 601 is configured to receive a connection message sent by a first network device in the data center network, where the connection message includes a layer identifier of the first network device.

第一识别单元602,用于根据该层级标识,识别该第一网络设备的层级类型。The first identifying unit 602 is configured to identify the layer type of the first network device according to the layer identifier.

第二识别单元603,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型。The second identification unit 603 is configured to identify the layer type of each network device that establishes a connection with the control device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the first network device .

获取单元604,用于当存在新增的网络设备与该控制设备建立连接时,获取该新增的网络设备的拓扑信息。The obtaining unit 604 is configured to obtain topology information of the newly added network device when there is a newly added network device establishing a connection with the control device.

第三识别单元605,用于根据该新增的网络设备的拓扑信息、与该控制设备建立连接的各个网络设备的拓扑信息以及与该控制设备建立连接的各个网络设备的层级类型,识别该新增的网络设备的层级类型。The third identifying unit 605 is configured to identify the newly added network device according to the topology information of the newly added network device, the topology information of each network device establishing a connection with the control device, and the layer type of each network device establishing a connection with the control device. The layer type of the added network device.

更新单元606,用于根据该新增的网络设备的拓扑信息,更新与该控制设备建立连接的各个网络设备的拓扑信息。An updating unit 606, configured to update the topology information of each network device that establishes a connection with the control device according to the topology information of the newly added network device.

第四识别单元607,用于根据该新增的网络设备的层级类型和该更新后的与该控制设备建立连接的各个网络设备的拓扑信息,重新识别该各个网络设备的层级类型。The fourth identifying unit 607 is configured to re-identify the layer type of each network device according to the layer type of the newly added network device and the updated topology information of each network device establishing a connection with the control device.

可选的,该第二识别单元603,还用于:Optionally, the second identification unit 603 is also used to:

将确定了层级类型的网络设备划分为已识别网络设备,该确定了层级类型的网络设备包括该第一网络设备;classifying network devices whose hierarchical type is determined as identified network devices, where the network devices whose hierarchical type is determined include the first network device;

判断与该控制设备建立连接的各个网络设备中是否存在与该已识别网络设备连接且未被识别的待识别网络设备;Judging whether there is an unidentified network device to be identified that is connected to the identified network device among the network devices that establish a connection with the control device;

当与该控制设备建立连接的各个网络设备中存在该待识别网络设备时,根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该已识别网络设备的层级类型,识别该待识别网络设备的层级类型;When the network device to be identified exists in each network device that establishes a connection with the control device, identify the network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the identified network device. The layer type of the network device to be identified;

重复上述步骤,直至与该控制设备建立连接的各个网络设备中不存在与该已识别网络设备连接且未被识别的待识别网络设备。The above steps are repeated until there is no unidentified network device to be identified that is connected to the identified network device among the network devices that establish a connection with the control device.

可选的,当该第一网络设备的层级类型为虚拟交换机、核心层交换机或者软交换机时,如图6-3所示,该第二识别单元603,包括:Optionally, when the layer type of the first network device is a virtual switch, a core layer switch or a soft switch, as shown in FIG. 6-3, the second identification unit 603 includes:

第一识别模块6031,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该第一网络设备连接的第二网络设备的层级类型。The first identification module 6031 is configured to identify the second network device connected to the first network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the first network device Hierarchy type.

第二识别模块6032,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第二网络设备的层级类型,识别与该第二网络设备连接且未被识别的第三网络设备的层级类型。The second identification module 6032 is configured to identify the unrecognized second network device that is connected to the second network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the second network device Three hierarchical types of network devices.

第三识别模块6033,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第三网络设备的层级类型,识别与该第三网络设备连接且未被识别的第四网络设备的层级类型。The third identifying module 6033 is configured to identify the unrecognized third network device that is connected to the third network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the third network device Four hierarchical types of network devices.

可选的,如图6-3所示,该第二识别单元,还可以包括:Optionally, as shown in Figure 6-3, the second identification unit may also include:

第一判断模块6034,用于判断与该控制设备建立连接的各个网络设备中未被识别的网络设备的个数是否大于第一预设阈值,以及该第四网络设备的个数是否大于第二预设阈值。The first judging module 6034 is used to judge whether the number of unrecognized network devices among the network devices establishing connections with the control device is greater than the first preset threshold, and whether the number of the fourth network device is greater than the second preset threshold.

更正模块6035,用于当该与该控制设备建立连接的各个网络设备中未被识别的网络设备的个数大于第一预设阈值,或该第四网络设备的个数大于第二预设阈值时,执行识别更正过程,该识别更正过程包括:Correction module 6035, configured to when the number of unrecognized network devices among the network devices establishing a connection with the control device is greater than the first preset threshold, or the number of the fourth network device is greater than the second preset threshold , execute the recognition correction process, the recognition correction process includes:

确定已识别的该第三网络设备的个数n;Determine the number n of the identified third network devices;

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,判断该第四网络设备所连接的网络设备中该第三网络设备的个数m是否大于或等于 According to the pre-acquired topology information of each network device that establishes a connection with the control device, determine whether the number m of the third network device among the network devices connected to the fourth network device is greater than or equal to

当该第四网络设备所连接的网络设备中该第三网络设备的个数m大于或等于时,将该第四网络设备的层级类型更正为与该第二网络设备相同的层级类型。When the number m of the third network devices among the network devices connected to the fourth network device is greater than or equal to , correct the layer type of the fourth network device to be the same layer type as that of the second network device.

可选的,当该第一网络设备的层级类型为虚拟交换机、核心层交换机或者软交换机时,图6-4是本发明实施例提供的另一种第二识别单元603的结构示意图,如图6-4所示,该第二识别单元603包括:Optionally, when the layer type of the first network device is a virtual switch, a core layer switch or a soft switch, FIG. 6-4 is a schematic structural diagram of another second identification unit 603 provided by an embodiment of the present invention, as shown in 6-4, the second identification unit 603 includes:

第四识别模块6036,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该第一网络设备连接的第二网络设备的层级类型。The fourth identification module 6036 is configured to identify the second network device connected to the first network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the first network device Hierarchy type.

第五识别模块6037,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第二网络设备的层级类型,识别与该第二网络设备连接且未被识别的第三网络设备的层级类型;The fifth identifying module 6037 is configured to identify the unrecognized unrecognized second network device connected to the second network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the second network device. 3. Hierarchical types of network equipment;

确定模块6038,用于确定已识别的该第三网络设备的个数n。A determining module 6038, configured to determine the number n of the identified third network devices.

第二判断模块6039,用于根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,判断第四网络设备所连接的网络设备中该第三网络设备的个数m是否大于或等于该第四网络设备为与该第三网络建立连接且未被识别的网络设备。The second judging module 6039 is configured to judge whether the number m of the third network devices among the network devices connected to the fourth network device is greater than or equal to The fourth network device is an unidentified network device that establishes a connection with the third network.

第六识别模块6040,用于当该第四网络设备所连接的网络设备中该第三网络设备的个数m大于或等于时,将该第四网络设备的层级类型识别为与该第二网络设备相同的层级类型。The sixth identification module 6040 is used for when the number m of the third network devices among the network devices connected to the fourth network device is greater than or equal to , identify the layer type of the fourth network device as the same layer type as the second network device.

第七识别模块6041,用于当该第四网络设备所连接的网络设备中该第三网络设备的个数m小于时,根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第三网络设备的层级类型,识别该第四网络设备的层级类型。The seventh identification module 6041 is used for when the number m of the third network devices among the network devices connected to the fourth network device is less than At this time, the layer type of the fourth network device is identified according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the third network device.

可选的,该第一网络设备的层级类型为虚拟交换机或软交换机,该第二网络设备的层级类型为架顶交换机,该第三网络设备的层级类型为汇聚层交换机,该第四网络设备的层级类型为核心层交换机。Optionally, the layer type of the first network device is a virtual switch or a soft switch, the layer type of the second network device is a top-of-rack switch, the layer type of the third network device is an aggregation layer switch, and the fourth network device The layer type is core layer switch.

可选的,该连接报文包括该第一网络设备向该控制设备发送的握手消息、心跳消息或属性上报消息。Optionally, the connection message includes a handshake message, a heartbeat message or an attribute report message sent by the first network device to the control device.

综上所述,本发明实施例提供一种数据中心网络中网络设备的识别装置,该装置位于数据中心网络中的控制设备中,控制设备可以根据接收到的第一网络设备发送的连接报文中包括的层级标识,快速识别该第一网络设备的层级类型,进而再根据各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,该方法在识别第一网络设备的层级类型时,无需对该第一网络设备的连接状况进行分析,因此降低了对数据中心网络中网络设备进行识别时的计算复杂度,网络设备的识别灵活性较高。To sum up, the embodiment of the present invention provides an identification device for a network device in a data center network. The device is located in a control device in the data center network, and the control device can receive a connection message sent by the first network device. The layer identification included in the network device quickly identifies the layer type of the first network device, and then identifies the layer of each network device that establishes a connection with the control device according to the topology information of each network device and the layer type of the first network device type, this method does not need to analyze the connection status of the first network device when identifying the layer type of the first network device, thus reducing the computational complexity when identifying network devices in the data center network, and the identification of network devices High flexibility.

图7是本发明实施例提供的又一种数据中心网络中网络设备的识别装置的结构示意图,该装置位于数据中心网络中的第一网络设备中,如图7所示,该装置包括:FIG. 7 is a schematic structural diagram of another device for identifying network equipment in a data center network provided by an embodiment of the present invention. The device is located in the first network device in the data center network. As shown in FIG. 7 , the device includes:

发送单元701,用于向该数据中心网络中的控制设备发送连接报文,该连接报文包括该第一网络设备的层级标识,以便于该控制设备根据该层级标识,识别该第一网络设备的层级类型。The sending unit 701 is configured to send a connection message to the control device in the data center network, where the connection message includes the layer identifier of the first network device, so that the control device can identify the first network device according to the layer identifier tier type.

图8是本发明实施例提供的再一种数据中心网络中网络设备的识别装置的结构示意图,该装置位于数据中心网络中的控制设备中,如图8所示,该装置包括:包括至少一个处理器801(例如CPU),至少一个网络接口802或者其他通信接口,存储器803,和至少一个通信总线804,用于实现这些装置之间的连接通信。处理器801用于执行存储器803中存储的可执行模块,例如计算机程序。存储器803可能包含高速随机存取存储器(RAM:Random AccessMemory),也可能还包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。通过至少一个网络接口802(可以是有线或者无线)实现该数据中心网络中网络设备的识别装置与至少一个其他网元之间的通信连接,可以使用互联网,广域网,本地网,城域网等。Fig. 8 is a schematic structural diagram of another device for identifying network equipment in a data center network provided by an embodiment of the present invention. The device is located in a control device in a data center network. As shown in Fig. 8 , the device includes: at least one A processor 801 (such as a CPU), at least one network interface 802 or other communication interfaces, a memory 803, and at least one communication bus 804 are used to implement communication between these devices. The processor 801 is used to execute executable modules, such as computer programs, stored in the memory 803 . The memory 803 may include a high-speed random access memory (RAM: Random Access Memory), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. Through at least one network interface 802 (which may be wired or wireless), the communication connection between the identification device of the network equipment in the data center network and at least one other network element can be realized, and the Internet, wide area network, local network, metropolitan area network, etc. can be used.

在一些实施方式中,存储器803存储了程序8031,程序8031可以被处理器801执行,这个程序8031包括:In some implementations, the memory 803 stores a program 8031, the program 8031 can be executed by the processor 801, and the program 8031 includes:

接收该数据中心网络中第一网络设备发送的连接报文,该连接报文包括该第一网络设备的层级标识;Receive a connection message sent by a first network device in the data center network, where the connection message includes a layer identifier of the first network device;

根据该层级标识,识别该第一网络设备的层级类型;Identify the layer type of the first network device according to the layer identifier;

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型。According to the pre-acquired topology information of each network device that establishes a connection with the control device, and the layer type of the first network device, identify the layer type of each network device that establishes a connection with the control device.

可选的,该根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,包括:Optionally, identifying the layer type of each network device establishing a connection with the control device according to the pre-acquired topology information of each network device establishing a connection with the control device and the layer type of the first network device, including:

将确定了层级类型的网络设备划分为已识别网络设备,该确定了层级类型的网络设备包括该第一网络设备;classifying network devices whose hierarchical type is determined as identified network devices, where the network devices whose hierarchical type is determined include the first network device;

判断与该控制设备建立连接的各个网络设备中是否存在与该已识别网络设备连接且未被识别的待识别网络设备;Judging whether there is an unidentified network device to be identified that is connected to the identified network device among the network devices that establish a connection with the control device;

当与该控制设备建立连接的各个网络设备中存在该待识别网络设备时,根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该已识别网络设备的层级类型,识别该待识别网络设备的层级类型;When the network device to be identified exists in each network device that establishes a connection with the control device, identify the network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the identified network device. The layer type of the network device to be identified;

重复上述步骤,直至与该控制设备建立连接的各个网络设备中不存在与该已识别网络设备连接且未被识别的待识别网络设备。The above steps are repeated until there is no unidentified network device to be identified that is connected to the identified network device among the network devices that establish a connection with the control device.

可选的,当该第一网络设备的层级类型为虚拟交换机、核心层交换机或者软交换机时,该根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,包括:Optionally, when the layer type of the first network device is a virtual switch, a core layer switch or a soft switch, according to the pre-acquired topology information of each network device that establishes a connection with the control device, and the first network device The layer type of the network device identifies the layer type of each network device that establishes a connection with the control device, including:

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该第一网络设备连接的第二网络设备的层级类型;Identifying the layer type of the second network device connected to the first network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the first network device;

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第二网络设备的层级类型,识别与该第二网络设备连接且未被识别的第三网络设备的层级类型;identifying the layer type of an unrecognized third network device connected to the second network device according to the pre-acquired topology information of each network device establishing a connection with the control device and the layer type of the second network device;

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第三网络设备的层级类型,识别与该第三网络设备连接且未被识别的第四网络设备的层级类型。According to the pre-acquired topology information of each network device connected to the control device and the layer type of the third network device, identify the layer type of the unrecognized fourth network device connected to the third network device.

可选的,在该根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第三网络设备的层级类型,识别与该第三网络设备连接且未被识别的第四网络设备的层级类型之后,该方法还包括:Optionally, identify an unidentified fourth network connected to the third network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the third network device After the hierarchical type of the device, the method also includes:

判断与该控制设备建立连接的各个网络设备中未被识别的网络设备的个数是否大于第一预设阈值,以及该第四网络设备的个数是否大于第二预设阈值;judging whether the number of unrecognized network devices among the network devices establishing a connection with the control device is greater than a first preset threshold, and whether the number of the fourth network device is greater than a second preset threshold;

当该与该控制设备建立连接的各个网络设备中未被识别的网络设备的个数大于第一预设阈值,或该第四网络设备的个数大于第二预设阈值时,执行识别更正过程,该识别更正过程包括:When the number of unrecognized network devices among the network devices establishing a connection with the control device is greater than the first preset threshold, or the number of the fourth network device is greater than the second preset threshold, an identification correction process is performed , the identification correction process includes:

确定已识别的该第三网络设备的个数n;Determine the number n of the identified third network devices;

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,判断该第四网络设备所连接的网络设备中该第三网络设备的个数m是否大于或等于 According to the pre-acquired topology information of each network device that establishes a connection with the control device, determine whether the number m of the third network device among the network devices connected to the fourth network device is greater than or equal to

当该第四网络设备所连接的网络设备中该第三网络设备的个数m大于或等于时,将该第四网络设备的层级类型更正为与该第二网络设备相同的层级类型。When the number m of the third network devices among the network devices connected to the fourth network device is greater than or equal to , correct the layer type of the fourth network device to be the same layer type as that of the second network device.

可选的,当该第一网络设备的层级类型为虚拟交换机、核心层交换机或者软交换机时,该根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,包括:Optionally, when the layer type of the first network device is a virtual switch, a core layer switch or a soft switch, according to the pre-acquired topology information of each network device that establishes a connection with the control device, and the first network device The layer type of the network device identifies the layer type of each network device that establishes a connection with the control device, including:

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该第一网络设备连接的第二网络设备的层级类型;Identifying the layer type of the second network device connected to the first network device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the first network device;

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第二网络设备的层级类型,识别与该第二网络设备连接且未被识别的第三网络设备的层级类型;identifying the layer type of an unrecognized third network device connected to the second network device according to the pre-acquired topology information of each network device establishing a connection with the control device and the layer type of the second network device;

确定已识别的该第三网络设备的个数n;Determine the number n of the identified third network devices;

根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,判断第四网络设备所连接的网络设备中该第三网络设备的个数m是否大于或等于该第四网络设备为与该第三网络建立连接且未被识别的网络设备;According to the pre-acquired topology information of each network device that establishes a connection with the control device, determine whether the number m of the third network device among the network devices connected to the fourth network device is greater than or equal to The fourth network device is an unidentified network device that establishes a connection with the third network;

当该第四网络设备所连接的网络设备中该第三网络设备的个数m大于或等于时,将该第四网络设备的层级类型识别为与该第二网络设备相同的层级类型;When the number m of the third network devices among the network devices connected to the fourth network device is greater than or equal to , identifying the layer type of the fourth network device as the same layer type as the second network device;

当该第四网络设备所连接的网络设备中该第三网络设备的个数m小于时,根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第三网络设备的层级类型,识别该第四网络设备的层级类型。When the number m of the third network devices among the network devices connected to the fourth network device is less than At this time, the layer type of the fourth network device is identified according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the third network device.

可选的,在该该根据预先获取的与该控制设备建立连接的各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型之后,该方法还包括:Optionally, after identifying the layer type of each network device that establishes a connection with the control device according to the pre-acquired topology information of each network device that establishes a connection with the control device and the layer type of the first network device , the method also includes:

当存在新增的网络设备与该控制设备建立连接时,获取该新增的网络设备的拓扑信息;When there is a newly added network device to establish a connection with the control device, acquiring topology information of the newly added network device;

根据该新增的网络设备的拓扑信息、与该控制设备建立连接的各个网络设备的拓扑信息以及与该控制设备建立连接的各个网络设备的层级类型,识别该新增的网络设备的层级类型;Identifying the layer type of the newly added network device according to the topology information of the newly added network device, the topology information of each network device establishing a connection with the control device, and the layer type of each network device establishing a connection with the control device;

根据该新增的网络设备的拓扑信息,更新与该控制设备建立连接的各个网络设备的拓扑信息;Updating the topology information of each network device connected to the control device according to the topology information of the newly added network device;

根据该新增的网络设备的层级类型和该更新后的与该控制设备建立连接的各个网络设备的拓扑信息,重新识别该各个网络设备的层级类型。The layer type of each network device is re-identified according to the layer type of the newly added network device and the updated topology information of each network device establishing a connection with the control device.

可选的,该第一网络设备的层级类型为虚拟交换机或软交换机,该第二网络设备的层级类型为架顶交换机,该第三网络设备的层级类型为汇聚层交换机,该第四网络设备的层级类型为核心层交换机。Optionally, the layer type of the first network device is a virtual switch or a soft switch, the layer type of the second network device is a top-of-rack switch, the layer type of the third network device is an aggregation layer switch, and the fourth network device The layer type is core layer switch.

可选的,该连接报文包括该第一网络设备向该控制设备发送的握手消息、心跳消息或属性上报消息。Optionally, the connection message includes a handshake message, a heartbeat message or an attribute report message sent by the first network device to the control device.

综上所述,本发明实施例提供一种数据中心网络中网络设备的识别装置,控制设备可以根据接收到的第一网络设备发送的连接报文中包括的层级标识,快速识别该第一网络设备的层级类型,进而再根据各个网络设备的拓扑信息,以及该第一网络设备的层级类型,识别与该控制设备建立连接的各个网络设备的层级类型,该方法在识别第一网络设备的层级类型时,无需对该第一网络设备的连接状况进行分析,因此降低了对数据中心网络中网络设备进行识别时的计算复杂度,网络设备的识别灵活性较高。To sum up, the embodiment of the present invention provides an identification device for a network device in a data center network, and the control device can quickly identify the first network device according to the level identifier included in the received connection message sent by the first network device. The layer type of the device, and then according to the topology information of each network device and the layer type of the first network device, identify the layer type of each network device that establishes a connection with the control device. This method identifies the layer type of the first network device type, there is no need to analyze the connection status of the first network device, so the computational complexity of identifying the network device in the data center network is reduced, and the identification flexibility of the network device is relatively high.

图9是本发明实施例提供的再一种数据中心网络中网络设备的识别装置的结构示意图,该装置位于数据中心网络中的控制设备中,如图9所示,该装置包括:该装置包括:包括至少一个处理器901(例如CPU),至少一个网络接口902或者其他通信接口,存储器903,和至少一个通信总线904,用于实现这些装置之间的连接通信。处理器901用于执行存储器903中存储的可执行模块,例如计算机程序。存储器903可能包含高速随机存取存储器(RAM:Random Access Memory),也可能还包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。通过至少一个网络接口902(可以是有线或者无线)实现该数据中心网络中网络设备的识别装置与至少一个其他网元之间的通信连接,可以使用互联网,广域网,本地网,城域网等。FIG. 9 is a schematic structural diagram of another device for identifying network equipment in a data center network provided by an embodiment of the present invention. The device is located in a control device in a data center network. As shown in FIG. 9 , the device includes: the device includes : including at least one processor 901 (such as a CPU), at least one network interface 902 or other communication interfaces, a memory 903, and at least one communication bus 904, for realizing connection and communication between these devices. The processor 901 is used to execute executable modules, such as computer programs, stored in the memory 903 . The memory 903 may include a high-speed random access memory (RAM: Random Access Memory), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. The communication connection between the identification device of the network equipment in the data center network and at least one other network element is realized through at least one network interface 902 (which may be wired or wireless), and the Internet, wide area network, local network, metropolitan area network, etc. can be used.

在一些实施方式中,存储器903存储了程序9031,程序9031可以被处理器901执行,这个程序9031包括:In some implementations, the memory 903 stores a program 9031, and the program 9031 can be executed by the processor 901. The program 9031 includes:

向该数据中心网络中的控制设备发送连接报文,该连接报文包括该第一网络设备的层级标识,以便于该控制设备根据该层级标识,识别该第一网络设备的层级类型。Sending a connection message to the control device in the data center network, where the connection message includes the layer identifier of the first network device, so that the control device can identify the layer type of the first network device according to the layer identifier.

本发明实施例提供一种数据中心网络中网络设备的识别系统,该系统包括控制设备和第一网络设备;An embodiment of the present invention provides a network device identification system in a data center network, the system includes a control device and a first network device;

该控制设备包括可以包括如图6-1至图6-4任一所示的数据中心网络中网络设备的识别装置;The control device includes an identification device that may include network devices in the data center network as shown in any one of Figures 6-1 to 6-4;

该第一网络设备可以包括如图7所示的数据中心网络中网络设备的识别装置。The first network device may include an identification device for a network device in the data center network as shown in FIG. 7 .

本发明实施例提供另一种数据中心网络中网络设备的识别系统,该系统包括控制设备和第一网络设备;An embodiment of the present invention provides another network device identification system in a data center network, the system includes a control device and a first network device;

该控制设备可以包括图8所示的数据中心网络中网络设备的识别装置;该第一网络设备可以包括图9所示的数据中心网络中网络设备的识别装置。The control device may include the device for identifying network devices in the data center network shown in FIG. 8 ; the first network device may include the device for identifying network devices in the data center network shown in FIG. 9 .

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described devices and units can refer to the corresponding process in the foregoing method embodiments, and details are not repeated here.

以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection of the present invention. within range.

Claims (19)

1. A method for identifying network equipment in a data center network is used for control equipment in the data center network, and the method comprises the following steps:
receiving a connection message sent by first network equipment in the data center network, wherein the connection message comprises a hierarchical identifier of the first network equipment;
identifying a hierarchy type of the first network device according to the hierarchy identification;
and identifying the hierarchy type of each network device connected with the control device according to the pre-acquired topology information of each network device connected with the control device and the hierarchy type of the first network device.
2. The method according to claim 1, wherein the identifying, according to the topology information of each network device that establishes connection with the control device and the hierarchy type of the first network device, the hierarchy type of each network device that establishes connection with the control device comprises:
dividing the hierarchy type-determined network devices into identified network devices, the hierarchy type-determined network devices including the first network device;
judging whether network equipment to be identified which is connected with the identified network equipment and is not identified exists in each network equipment which is connected with the control equipment;
when the network equipment to be identified exists in each network equipment which is connected with the control equipment, identifying the hierarchy type of the network equipment to be identified according to the pre-acquired topology information of each network equipment which is connected with the control equipment and the hierarchy type of the identified network equipment;
and repeating the steps until the network equipment to be identified which is connected with the identified network equipment and is not identified does not exist in each network equipment which is connected with the control equipment.
3. The method of claim 1, wherein when the hierarchy type of the first network device is a virtual switch, a core layer switch, or a soft switch, the identifying the hierarchy type of each network device connected to the control device according to the topology information of each network device connected to the control device and the hierarchy type of the first network device, which are acquired in advance, comprises:
identifying the hierarchy type of second network equipment connected with the first network equipment according to the pre-acquired topology information of each network equipment connected with the control equipment and the hierarchy type of the first network equipment;
identifying the hierarchy type of third network equipment which is connected with the second network equipment and is not identified according to the topology information of each network equipment which is acquired in advance and is connected with the control equipment and the hierarchy type of the second network equipment;
and identifying the hierarchy type of a fourth network device which is connected with the third network device and is not identified according to the topology information of each network device which is acquired in advance and is connected with the control device and the hierarchy type of the third network device.
4. The method according to claim 3, wherein after identifying a hierarchy type of a fourth network device that is connected to the third network device and is not identified, based on topology information of each network device that establishes a connection with the control device acquired in advance and the hierarchy type of the third network device, the method further comprises:
judging whether the number of unidentified network devices in each network device which establishes connection with the control device is larger than a first preset threshold value or not, and whether the number of fourth network devices is larger than a second preset threshold value or not;
when the number of unrecognized network devices among the network devices that establish connection with the control device is greater than a first preset threshold, or the number of fourth network devices is greater than a second preset threshold, performing a recognition correction process, where the recognition correction process includes:
determining the number n of the identified third network devices;
judging whether the number m of the third network devices in the network devices connected with the fourth network device is greater than or equal to the number m of the third network devices in the network devices connected with the fourth network device according to the pre-acquired topology information of each network device connected with the control deviceWherein,represents rounding up;
when the number m of the third network devices in the network devices connected with the fourth network device is greater than or equal toAnd correcting the hierarchy type of the fourth network device to be the same as the hierarchy type of the second network device.
5. The method of claim 1, wherein when the hierarchy type of the first network device is a virtual switch, a core layer switch, or a soft switch, the identifying the hierarchy type of each network device connected to the control device according to the topology information of each network device connected to the control device and the hierarchy type of the first network device, which are acquired in advance, comprises:
identifying the hierarchy type of second network equipment connected with the first network equipment according to the pre-acquired topology information of each network equipment connected with the control equipment and the hierarchy type of the first network equipment;
identifying the hierarchy type of third network equipment which is connected with the second network equipment and is not identified according to the topology information of each network equipment which is acquired in advance and is connected with the control equipment and the hierarchy type of the second network equipment;
determining the number n of the identified third network devices;
judging whether the number m of the third network devices in the network devices connected with the fourth network device is greater than or equal to the number m of the third network devices in the network devices connected with the fourth network device according to the pre-acquired topology information of each network device connected with the control deviceThe fourth network device is a network device which is connected with the third network and is not identified;
when the number m of the third network devices in the network devices connected with the fourth network device is greater than or equal toIdentifying a hierarchy type of the fourth network device as the same hierarchy type as the second network device;
when the number m of the third network devices in the network devices connected with the fourth network device is less thanAnd then, identifying the hierarchy type of the fourth network device according to the topology information of each network device which is acquired in advance and is connected with the control device and the hierarchy type of the third network device.
6. The method according to any one of claims 1 to 5, wherein after identifying the hierarchy type of each network device that establishes connection with the control device according to the topology information of each network device that establishes connection with the control device, which is acquired in advance, and the hierarchy type of the first network device, the method further comprises:
when the newly added network equipment is connected with the control equipment, acquiring the topology information of the newly added network equipment;
identifying the hierarchy type of the newly added network equipment according to the topology information of the newly added network equipment, the topology information of each network equipment which is connected with the control equipment and the hierarchy type of each network equipment which is connected with the control equipment;
updating the topology information of each network device connected with the control device according to the topology information of the newly added network device;
and re-identifying the hierarchy type of each network device according to the hierarchy type of the newly added network device and the updated topology information of each network device which is connected with the control device.
7. The method of claim 3 or 5, wherein the first network device is a virtual switch or a soft switch, the second network device is a top-of-rack switch, the third network device is a convergence layer switch, and the fourth network device is a core layer switch.
8. The method according to any one of claims 1 to 5,
the connection packet includes a handshake message, a heartbeat message, or an attribute report message sent by the first network device to the control device.
9. A method for identifying a network device in a data center network, the method being used for a first network device in the data center network, the method comprising:
and sending a connection message to a control device in the data center network, wherein the connection message comprises a hierarchy identifier of the first network device, so that the control device can identify the hierarchy type of the first network device according to the hierarchy identifier.
10. An apparatus for identifying a network device in a data center network, the apparatus being located in a control device in the data center network, the apparatus comprising:
a receiving unit, configured to receive a connection packet sent by a first network device in the data center network, where the connection packet includes a hierarchical identifier of the first network device;
a first identification unit, configured to identify a hierarchy type of the first network device according to the hierarchy identifier;
and the second identification unit is used for identifying the hierarchy type of each network device which is connected with the control device according to the topology information of each network device which is connected with the control device and is acquired in advance and the hierarchy type of the first network device.
11. The apparatus of claim 10, wherein the second identifying unit is further configured to:
dividing the hierarchy type-determined network devices into identified network devices, the hierarchy type-determined network devices including the first network device;
judging whether network equipment to be identified which is connected with the identified network equipment and is not identified exists in each network equipment which is connected with the control equipment;
when the network equipment to be identified exists in each network equipment which is connected with the control equipment, identifying the hierarchy type of the network equipment to be identified according to the pre-acquired topology information of each network equipment which is connected with the control equipment and the hierarchy type of the identified network equipment;
and repeating the steps until the network equipment to be identified which is connected with the identified network equipment and is not identified does not exist in each network equipment which is connected with the control equipment.
12. The apparatus of claim 10, wherein when the hierarchical type of the first network device is a virtual switch, a core layer switch, or a soft switch, the second identifying unit comprises:
the first identification module is used for identifying the hierarchy type of second network equipment connected with the first network equipment according to the topology information of each network equipment which is acquired in advance and is connected with the control equipment and the hierarchy type of the first network equipment;
the second identification module is used for identifying the hierarchy type of third network equipment which is connected with the second network equipment and is not identified according to the topology information of each network equipment which is acquired in advance and is connected with the control equipment and the hierarchy type of the second network equipment;
and the third identification module is used for identifying the hierarchy type of a fourth network device which is connected with the third network device and is not identified according to the topology information of each network device which is connected with the control device and is acquired in advance and the hierarchy type of the third network device.
13. The apparatus of claim 12, wherein the second identification unit further comprises:
the first judgment module is used for judging whether the number of unidentified network devices in each network device which establishes connection with the control device is larger than a first preset threshold value or not and whether the number of the fourth network devices is larger than a second preset threshold value or not;
a correction module, configured to execute a recognition correction process when the number of unrecognized network devices in the network devices that establish connection with the control device is greater than a first preset threshold, or the number of fourth network devices is greater than a second preset threshold, where the recognition correction process includes:
determining the number n of the identified third network devices;
judging whether the number m of the third network devices in the network devices connected with the fourth network device is greater than or equal to the number m of the third network devices in the network devices connected with the fourth network device according to the pre-acquired topology information of each network device connected with the control deviceWherein,represents rounding up;
when the number m of the third network devices in the network devices connected with the fourth network device is greater than or equal toAnd correcting the hierarchy type of the fourth network device to be the same as the hierarchy type of the second network device.
14. The apparatus of claim 10, wherein when the hierarchical type of the first network device is a virtual switch, a core layer switch, or a soft switch, the second identifying unit further comprises:
a fourth identification module, configured to identify, according to topology information of each network device that establishes a connection with the control device and a hierarchy type of the first network device, a hierarchy type of a second network device that is connected with the first network device;
a fifth identification module, configured to identify, according to topology information of each network device that is acquired in advance and that establishes connection with the control device, and a hierarchy type of the second network device, a hierarchy type of a third network device that is connected to the second network device and that is not identified;
a determining module, configured to determine the number n of the identified third network devices;
a second judging module, configured to judge, according to topology information of each network device that establishes a connection with the control device and that is obtained in advance, whether or not the number m of the third network devices in the network devices connected to the fourth network device is greater than or equal toThe fourth network device is a network device which is connected with the third network and is not identified;
a sixth identification module, configured to identify the network device to which the fourth network device is connectedThe number m of the third network devices is greater than or equal toIdentifying a hierarchy type of the fourth network device as the same hierarchy type as the second network device;
a seventh identifying module, configured to, when the number m of the third network devices in the network devices connected to the fourth network device is smaller thanAnd then, identifying the hierarchy type of the fourth network device according to the topology information of each network device which is acquired in advance and is connected with the control device and the hierarchy type of the third network device.
15. The apparatus of any one of claims 10 to 14, further comprising:
the acquisition unit is used for acquiring the topology information of the newly added network equipment when the newly added network equipment is connected with the control equipment;
a third identification unit, configured to identify a hierarchy type of the newly added network device according to topology information of the newly added network device, topology information of each network device that establishes a connection with the control device, and a hierarchy type of each network device that establishes a connection with the control device;
the updating unit is used for updating the topology information of each network device which is connected with the control device according to the topology information of the newly added network device;
and a fourth identifying unit, configured to re-identify the hierarchy type of each network device according to the hierarchy type of the newly added network device and the updated topology information of each network device that establishes a connection with the control device.
16. The apparatus of claim 12 or 14, wherein the first network device is a virtual switch or a soft switch, the second network device is a top-of-rack switch, the third network device is a convergence layer switch, and the fourth network device is a core layer switch.
17. The apparatus according to any one of claims 10 to 14,
the connection packet includes a handshake message, a heartbeat message, or an attribute report message sent by the first network device to the control device.
18. An apparatus for identifying network devices in a data center network, the apparatus being located in a first network device in the data center network, the apparatus comprising:
a sending unit, configured to send a connection packet to a control device in the data center network, where the connection packet includes a hierarchical identifier of the first network device, so that the control device identifies a hierarchical type of the first network device according to the hierarchical identifier.
19. A system for identifying network devices in a data center network, the system comprising: a control device and a first network device;
the control device comprises identification means of a network device in the data centre network according to any one of claims 10 to 17;
the first network device comprises the identification means of a network device in a data center network of claim 18.
CN201610046155.8A 2016-01-22 2016-01-22 Method, device and system for identifying network equipment in data center network Active CN106998299B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610046155.8A CN106998299B (en) 2016-01-22 2016-01-22 Method, device and system for identifying network equipment in data center network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610046155.8A CN106998299B (en) 2016-01-22 2016-01-22 Method, device and system for identifying network equipment in data center network

Publications (2)

Publication Number Publication Date
CN106998299A CN106998299A (en) 2017-08-01
CN106998299B true CN106998299B (en) 2019-10-18

Family

ID=59428522

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610046155.8A Active CN106998299B (en) 2016-01-22 2016-01-22 Method, device and system for identifying network equipment in data center network

Country Status (1)

Country Link
CN (1) CN106998299B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108418727B (en) * 2018-01-26 2020-04-24 中国科学院信息工程研究所 Method and system for detecting network equipment
CN108566296B (en) * 2018-03-26 2021-07-06 新华三技术有限公司 Network device layering method, network management device and computer readable storage medium
CN108880899B (en) * 2018-06-30 2021-10-15 华为技术有限公司 A method and server for generating a network topology map
CN109150661B (en) * 2018-08-30 2020-06-09 新华三技术有限公司 Equipment discovery method and device
CN113315655A (en) * 2021-05-24 2021-08-27 恒隆通信技术有限公司 Information configuration method of intelligent networking environment and intelligent networking system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102143007A (en) * 2011-05-03 2011-08-03 中国南方电网有限责任公司 Distribution-based hierarchical network topology discovery method
CN102420775A (en) * 2012-01-10 2012-04-18 西安电子科技大学 Routing method for module-expansion-based data center network topology system
CN103269387A (en) * 2013-05-21 2013-08-28 中国科学院计算技术研究所 A data center network address automatic configuration method
CN103441935A (en) * 2013-08-16 2013-12-11 北京星网锐捷网络技术有限公司 Method and device capable of automatically recognizing adjacency relation between server and access switch
CN104518927A (en) * 2014-12-15 2015-04-15 清华大学 Detecting method and device of error connection in data center network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102143007A (en) * 2011-05-03 2011-08-03 中国南方电网有限责任公司 Distribution-based hierarchical network topology discovery method
CN102420775A (en) * 2012-01-10 2012-04-18 西安电子科技大学 Routing method for module-expansion-based data center network topology system
CN103269387A (en) * 2013-05-21 2013-08-28 中国科学院计算技术研究所 A data center network address automatic configuration method
CN103441935A (en) * 2013-08-16 2013-12-11 北京星网锐捷网络技术有限公司 Method and device capable of automatically recognizing adjacency relation between server and access switch
CN104518927A (en) * 2014-12-15 2015-04-15 清华大学 Detecting method and device of error connection in data center network

Also Published As

Publication number Publication date
CN106998299A (en) 2017-08-01

Similar Documents

Publication Publication Date Title
CN106998299B (en) Method, device and system for identifying network equipment in data center network
US12316500B2 (en) Method and system for network topology enforcement
CN102204188B (en) Routing computation method and host node device in virtual network element
US9565099B2 (en) Spanning tree in fabric switches
US9990243B2 (en) Using spanning tree protocol to determine a layer 2 topology of an ethernet type network
CN103401786B (en) Network topology foundation, path clustering, message transmitting method and device, system
CN111245747B (en) Networking method for data center network and data center network
US10277464B2 (en) Client auto-configuration in a multi-switch link aggregation
US20150271103A1 (en) Distributed hot standby links for vlag
CN103516824B (en) Network topology identification method based on IP layer and equipment
CN107306215B (en) A data processing method, system and node
CN103812748B (en) Mapping method of survivable virtual network
WO2016155589A1 (en) Forwarding multicast packets
EP2838227A1 (en) Connectivity detection method, device and system
US20170338976A1 (en) Method for Obtaining Port Path and Apparatus
CN105743801A (en) Method and device of flow forwarding of stack system
CN102546432B (en) Method and device for planning packet transmission bearer network capacity
US9515881B2 (en) Method, device, and system for packet processing
CN104092576A (en) Network topology calculation method and device
CN108696453A (en) The power telecom network SDN Business Streams cognitive method and system of lightweight
CN103856385B (en) Virtual network mapping method based on link priority
CN104767681B (en) A kind of data center network method for routing for tolerating error connection line
CN109347734A (en) A kind of file transmitting method, device, the network equipment and computer-readable medium
US9853891B2 (en) System and method for facilitating communication
CN104901884B (en) Wide area network SDN collecting topologies implementation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20211222

Address after: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province

Patentee after: xFusion Digital Technologies Co., Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right