CN114629819B - Network detection method and device, electronic equipment and storage medium - Google Patents

Network detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114629819B
CN114629819B CN202011455863.XA CN202011455863A CN114629819B CN 114629819 B CN114629819 B CN 114629819B CN 202011455863 A CN202011455863 A CN 202011455863A CN 114629819 B CN114629819 B CN 114629819B
Authority
CN
China
Prior art keywords
interface
node
message
under test
interface information
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
CN202011455863.XA
Other languages
Chinese (zh)
Other versions
CN114629819A (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.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology 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 China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202011455863.XA priority Critical patent/CN114629819B/en
Publication of CN114629819A publication Critical patent/CN114629819A/en
Application granted granted Critical
Publication of CN114629819B publication Critical patent/CN114629819B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity

Landscapes

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

Abstract

本申请实施例公开了一种网络检测方法及系统,电子设备及存储介质,所述网络检测方法可包括:获取被测节点的以太网接口的第一接口信息;向所述被测节点发送第一指示;接收所述被测节点基于所述第一指示发送的第一报文;其中,所述第一报文至少携带有所述被测节点发送所述第一报文的以太网接口的第二接口信息;根据所述第二接口信息及所述第一接口信息的匹配结果,确定所述检测节点和所述被测节点之间接口连通性。如此,可基于报文中的接口信息,实现网络中被测节点与检测节点连通性的准确检测。

The embodiment of the present application discloses a network detection method and system, an electronic device and a storage medium, wherein the network detection method may include: obtaining the first interface information of the Ethernet interface of the node under test; sending a first indication to the node under test; receiving a first message sent by the node under test based on the first indication; wherein the first message carries at least the second interface information of the Ethernet interface of the node under test sending the first message; and determining the interface connectivity between the detection node and the node under test based on the matching result of the second interface information and the first interface information. In this way, accurate detection of the connectivity between the node under test and the detection node in the network can be achieved based on the interface information in the message.

Description

一种网络检测方法及装置、电子设备及存储介质A network detection method and device, electronic equipment and storage medium

技术领域Technical Field

本发明涉及网络技术领域,尤其涉及一种网络检测方法及系统、电子设备及存储介质。The present invention relates to the field of network technology, and in particular to a network detection method and system, electronic equipment and storage medium.

背景技术Background Art

现有技术中公有云由于单个机房规模极大,一般由硬件集成工程师协同软件实施工程师在数据中心现场进行联合部署。不同于一般部署在集中式数据中心的公有云,边缘云的特点是单个机房规模很小,机房极多,但在地理分布上极为分散。而边缘计算由于上述这些特殊性,一般要求软件实施人员在远程进行批量化自动化部署,以降低人力成本,提高部署效率。边缘计算部署时经常会碰到由于硬件实施人员和软件实施人员存在沟通不到位,导致硬件没有按照要求配置好;软件实施人员在远端发现由于硬件问题无法部署会严重影响进度,而其中很大一部分硬件问题是网络的连通性和配置问题。In the prior art, public clouds are usually deployed jointly on-site in data centers by hardware integration engineers and software implementation engineers due to the large scale of a single computer room. Unlike public clouds that are generally deployed in centralized data centers, edge clouds are characterized by small single computer rooms, a large number of computer rooms, and extremely dispersed geographical distribution. Due to the above-mentioned particularities, edge computing generally requires software implementation personnel to perform batch automated deployment remotely to reduce labor costs and improve deployment efficiency. When deploying edge computing, it is often encountered that the hardware is not configured as required due to insufficient communication between hardware implementation personnel and software implementation personnel; software implementation personnel find that the remote deployment cannot be carried out due to hardware problems, which will seriously affect the progress, and a large part of the hardware problems are network connectivity and configuration problems.

针对上述硬件问题中的网络连通性问题,对于边缘计算这种特殊场景的云计算,现有技术中往往采用因特网包探索(Packet Internet Groper,ping)方法进行网络连通性的检测。使用ping方法检测网络时,必须在服务器网络接口上配置网际互联协议(InternetProtocol,IP)地址,但是在使用了虚拟交换机(virtual switch)或者直通网卡(SingleRoot I/O Virtualization,SRIOV)等特殊配置和加速硬件时,业务网、存储网、外网的网卡上一般不会配置IP地址,也不存在虚拟局域网(Virtual Local Area Network,VLAN)子接口,这些网络报文一般不经过内核的网络协议栈,导致不能使用传统的ping方法进行检测。In view of the network connectivity problem in the above hardware problems, for cloud computing in special scenarios such as edge computing, the existing technology often uses the Internet Packet Groper (ping) method to detect network connectivity. When using the ping method to detect the network, the Internet Protocol (IP) address must be configured on the server network interface. However, when using special configurations and acceleration hardware such as virtual switches or single root I/O virtualization (SRIOV), the network cards of the business network, storage network, and external network are generally not configured with IP addresses, and there are no virtual local area network (VLAN) sub-interfaces. These network packets generally do not pass through the kernel's network protocol stack, resulting in the inability to use the traditional ping method for detection.

发明内容Summary of the invention

有鉴于此,本发明实施例提供一种网络检测方法及系统、电子设备及存储介质。In view of this, embodiments of the present invention provide a network detection method and system, an electronic device, and a storage medium.

本发明的技术方案是这样实现的:The technical solution of the present invention is achieved in this way:

第一方面,本发明实施例提供一种网络检测方法,应用于边缘计算集群内的检测节点中,包括:In a first aspect, an embodiment of the present invention provides a network detection method, which is applied to a detection node in an edge computing cluster, including:

获取被测节点的以太网接口的第一接口信息;Obtaining first interface information of the Ethernet interface of the node under test;

向被测节点发送第一指示;Sending a first indication to the node under test;

接收被测节点基于第一指示发送的第一报文,其中,第一报文至少携带有被测节点发送第一报文的以太网接口的第二接口信息;Receiving a first message sent by the node under test based on the first indication, wherein the first message carries at least second interface information of the Ethernet interface of the node under test that sends the first message;

根据第二接口信息及第一接口信息的匹配结果,确定检测节点和被测节点之间接口连通性。According to the matching result of the second interface information and the first interface information, the interface connectivity between the detection node and the detected node is determined.

进一步地,接收被测节点基于第一指示发送的最大传输单元MTU长度值为第一阈值的第一报文;Further, receiving a first message having a maximum transmission unit MTU length value of a first threshold value sent by the measured node based on the first indication;

接收被测节点基于第一阈值,依次发送的MTU长度值按预设间隔值递增的多个第一报文;Receiving a plurality of first messages, the MTU length values of which are sent in sequence by the node under test based on the first threshold and are increased according to a preset interval value;

根据接收到的多个第一报文的MTU长度值,确定MTU长度最大值。The maximum MTU length is determined according to the MTU length values of the received multiple first messages.

进一步地,根据接收到的多个第一报文的MTU长度值,确定MTU长度最大值,包括:Further, determining the maximum MTU length according to the MTU length values of the received multiple first messages includes:

若成功接收到多个第一报文,读取每个接收到第一报文的MTU长度值,并确定多个第一报文中的MTU长度最大值。If multiple first messages are successfully received, the MTU length value of each received first message is read, and the maximum MTU length value among the multiple first messages is determined.

进一步地,确定被测节点中以太网接口的类型;Further, determining the type of Ethernet interface in the node under test;

根据以太网接口的类型,确定以太网接口的物理接口信息,其中,物理接口信息,用于由第一指示携带发送至被测节点,供被测节点确定发送第一报文的以太网接口所对应的物理接口。The physical interface information of the Ethernet interface is determined according to the type of the Ethernet interface, wherein the physical interface information is used to be carried by the first indication and sent to the node under test, so that the node under test can determine the physical interface corresponding to the Ethernet interface that sends the first message.

进一步地,第一指示,用于指示被测节点根据物理接口信息发送第一报文。Furthermore, the first indication is used to instruct the node under test to send a first message according to the physical interface information.

进一步地,获取被测节点的以太网接口的第一接口信息,至少包括:Further, obtaining first interface information of the Ethernet interface of the node under test at least includes:

获取被测节点的以太网接口的接口名称。Get the interface name of the Ethernet interface of the node under test.

进一步地,根据第二接口信息及第一接口信息的匹配结果,确定检测节点和被测节点之间接口连通性,包括:Further, according to the matching result of the second interface information and the first interface information, determining the interface connectivity between the detection node and the detected node includes:

若存在与第二接口信息匹配的第一接口信息,则确定检测节点和被测节点之间接口连通;If there is first interface information matching the second interface information, determining that the interface between the detection node and the detected node is connected;

若不存在与第二接口信息匹配的第一接口信息,则确定检测节点和被测节点之间接口不连通。If there is no first interface information matching the second interface information, it is determined that the interface between the detection node and the detected node is not connected.

第二方面,本发明实施例提供一种网络检测方法,应用于边缘计算集群内的被测节点中,包括:In a second aspect, an embodiment of the present invention provides a network detection method, which is applied to a tested node in an edge computing cluster, including:

接收检测节点发送的第一指示;receiving a first indication sent by a detection node;

基于第一指示发送第一报文,其中,第一报文至少携带有被测节点发送第一报文的以太网接口的第二接口信息;第二接口信息,用于供检测节点根据与第一接口信息的匹配结果,确定检测节点和被测节点之间接口连通性。A first message is sent based on the first indication, wherein the first message carries at least second interface information of the Ethernet interface of the node under test that sends the first message; the second interface information is used for the detection node to determine the interface connectivity between the detection node and the node under test based on a matching result with the first interface information.

进一步地,基于第一指示发送第一报文,包括:Further, sending a first message based on the first indication includes:

基于第一指示发送MTU长度值为第一阈值的第一报文;Sending a first message with an MTU length value of a first threshold based on the first indication;

基于第一阈值,依次发送MTU长度值按预设间隔值递增的多个第一报文。Based on the first threshold, a plurality of first messages whose MTU length values increase incrementally according to a preset interval value are sent in sequence.

进一步地,当第一报文的MTU长度值达到第二阈值时,停止发送第一报文。Further, when the MTU length value of the first message reaches a second threshold, sending the first message is stopped.

第三方面,本发明实施例提供一种网络检测装置,应用于边缘计算集群内的检测节点中,包括:In a third aspect, an embodiment of the present invention provides a network detection device, which is applied to a detection node in an edge computing cluster, including:

获取模块,用于获取被测节点的以太网接口的第一接口信息;An acquisition module, used to acquire first interface information of the Ethernet interface of the node under test;

第一发送模块,用于向被测节点发送第一指示;A first sending module, used to send a first indication to the node under test;

第一接收模块,用于接收被测节点基于第一指示发送的第一报文,其中,第一报文至少携带有被测节点发送第一报文的以太网接口的第二接口信息;A first receiving module, configured to receive a first message sent by the node under test based on the first indication, wherein the first message carries at least second interface information of the Ethernet interface through which the node under test sends the first message;

确定模块,用于根据第二接口信息及第一接口信息的匹配结果,确定检测节点和被测节点之间接口连通性。The determination module is used to determine the interface connectivity between the detection node and the detected node according to the matching result of the second interface information and the first interface information.

进一步地,所述第一接收模块还用于:Furthermore, the first receiving module is also used for:

接收被测节点基于第一指示发送的最大传输单元MTU长度值为第一阈值的第一报文;Receiving a first message with a maximum transmission unit MTU length value of a first threshold value sent by the measured node based on the first indication;

接收被测节点基于第一阈值,依次发送的MTU长度值按预设间隔值递增的多个第一报文;Receiving a plurality of first messages, the MTU length values of which are sent in sequence by the node under test based on the first threshold and are increased according to a preset interval value;

所述确定模块还用于:The determining module is also used for:

根据接收到的多个第一报文的MTU长度值,确定MTU长度最大值。The maximum MTU length is determined according to the MTU length values of the received multiple first messages.

进一步地,所述确定模块,具体用于:Furthermore, the determination module is specifically used to:

若成功接收到多个第一报文,读取每个接收到第一报文的MTU长度值,并确定多个第一报文中的MTU长度最大值。If multiple first messages are successfully received, the MTU length value of each received first message is read, and the maximum MTU length value among the multiple first messages is determined.

进一步地,所述确定模块还用于:Furthermore, the determining module is also used for:

确定被测节点中以太网接口的类型;Determine the type of Ethernet interface in the node under test;

根据以太网接口的类型,确定以太网接口的物理接口信息,其中,物理接口信息,用于由第一指示携带发送至被测节点,供被测节点确定发送第一报文的以太网接口所对应的物理接口。The physical interface information of the Ethernet interface is determined according to the type of the Ethernet interface, wherein the physical interface information is used to be carried by the first indication and sent to the node under test, so that the node under test can determine the physical interface corresponding to the Ethernet interface that sends the first message.

进一步地,所述确定模块,具体用于:Furthermore, the determination module is specifically used to:

若存在与第二接口信息匹配的第一接口信息,则确定检测节点和被测节点之间接口连通;If there is first interface information matching the second interface information, determining that the interface between the detection node and the detected node is connected;

若不存在与第二接口信息匹配的第一接口信息,则确定检测节点和被测节点之间接口不连通。If there is no first interface information matching the second interface information, it is determined that the interface between the detection node and the detected node is not connected.

第四方面,本发明实施例提供一种网络检测装置,应用于边缘计算集群内的被测节点中,包括:In a fourth aspect, an embodiment of the present invention provides a network detection device, which is applied to a node under test in an edge computing cluster, including:

第二接收模块,用于接收检测节点发送的第一指示;A second receiving module, used to receive a first indication sent by the detection node;

第二发送模块,用于基于第一指示发送第一报文,其中,第一报文至少携带有被测节点发送第一报文的以太网接口的第二接口信息;第二接口信息,用于供检测节点根据与第一接口信息的匹配结果,确定检测节点和被测节点之间接口连通性。The second sending module is used to send a first message based on the first indication, wherein the first message carries at least the second interface information of the Ethernet interface of the tested node that sends the first message; the second interface information is used for the detection node to determine the interface connectivity between the detection node and the tested node based on the matching result with the first interface information.

进一步地,所述第二发送模块,具体用于:Furthermore, the second sending module is specifically configured to:

基于第一指示发送MTU长度值为第一阈值的第一报文;Sending a first message with an MTU length value of a first threshold based on the first indication;

基于第一阈值,依次发送MTU长度值按预设间隔值递增的多个第一报文。Based on the first threshold, a plurality of first messages whose MTU length values increase incrementally according to a preset interval value are sent in sequence.

进一步地,所述装置还包括:Furthermore, the device also includes:

停止装置,用于当第一报文的MTU长度值达到第二阈值时,停止发送第一报文。The stopping device is used to stop sending the first message when the MTU length value of the first message reaches a second threshold.

第五方面,本发明实施例提供一种电子设备,所述电子设备包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器;In a fifth aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising: a processor and a memory for storing a computer program that can be run on the processor;

处理器运行所述计算机程序时,执行前述一个或多个技术方案所述方法的步骤。When the processor runs the computer program, it executes the steps of the method described in one or more of the above technical solutions.

第六方面,本发明实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令;计算机可执行指令被处理器执行后,能够实现前述一个或多个技术方案所述方法。In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions; after the computer-executable instructions are executed by a processor, the method described in one or more of the aforementioned technical solutions can be implemented.

本发明提供的网络检测方法,获取被测节点的以太网接口的第一接口信息;向所述被测节点发送第一指示;接收所述被测节点基于所述第一指示发送的第一报文,其中,所述第一报文至少携带有所述被测节点发送所述第一报文的以太网接口的第二接口信息;根据所述第二接口信息及所述第一接口信息的匹配结果,确定所述检测节点和所述被测节点之间接口连通性。如此,根据被测节点发送的报文中携带的接口信息,可以确定发送报文的接口。通过基于报文的收发和接口信息的匹配,一方面对被测节点和检测节点之间的链路连通性进行确定,另一方面,通过接口匹配,可以实现对开放式系统互联通信参考模型中2层网络连通性的检测。The network detection method provided by the present invention obtains the first interface information of the Ethernet interface of the node under test; sends a first indication to the node under test; receives a first message sent by the node under test based on the first indication, wherein the first message carries at least the second interface information of the Ethernet interface of the node under test that sends the first message; and determines the interface connectivity between the detection node and the node under test based on the matching result of the second interface information and the first interface information. In this way, the interface for sending the message can be determined based on the interface information carried in the message sent by the node under test. By matching based on the sending and receiving of the message and the interface information, on the one hand, the link connectivity between the node under test and the detection node is determined, and on the other hand, through interface matching, the detection of Layer 2 network connectivity in the open system interconnection communication reference model can be realized.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本发明实施例提供的一种网络检测方法的流程示意图;FIG1 is a schematic diagram of a flow chart of a network detection method provided by an embodiment of the present invention;

图2为本发明实施例提供的一种网络检测方法的流程示意图;FIG2 is a schematic diagram of a flow chart of a network detection method provided by an embodiment of the present invention;

图3为本发明实施例提供的一种网络检测方法的流程示意图;FIG3 is a schematic diagram of a flow chart of a network detection method provided by an embodiment of the present invention;

图4为本发明实施例提供的一种网络检测方法的流程示意图;FIG4 is a schematic diagram of a flow chart of a network detection method provided by an embodiment of the present invention;

图5为本发明实施例提供的一种网络检测方法的流程示意图;FIG5 is a schematic diagram of a flow chart of a network detection method provided by an embodiment of the present invention;

图6为本发明实施例提供的一种网络检测方法的流程示意图;FIG6 is a schematic diagram of a flow chart of a network detection method provided by an embodiment of the present invention;

图7为本发明实施例提供的一种网络检测方法的流程示意图;FIG7 is a schematic diagram of a flow chart of a network detection method provided by an embodiment of the present invention;

图8为本发明实施例提供的一种网络检测方法的流程示意图;FIG8 is a schematic diagram of a flow chart of a network detection method provided by an embodiment of the present invention;

图9为本发明实施例提供的一种网络检测装置的结构示意图;FIG9 is a schematic diagram of the structure of a network detection device provided by an embodiment of the present invention;

图10为本发明实施例提供的一种网络检测装置的结构示意图;FIG10 is a schematic diagram of the structure of a network detection device provided by an embodiment of the present invention;

图11为本发明实施例提供的一种边缘计算集群的结构示意图;FIG11 is a schematic diagram of the structure of an edge computing cluster provided by an embodiment of the present invention;

图12为本发明实施例提供的一种网络检测方法的流程示意图。FIG. 12 is a flow chart of a network detection method provided in an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,所描述的实施例不应视为对本发明的限制,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present invention. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.

在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

在以下的描述中,所涉及的术语“第一\第二\第三”仅仅是是区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本发明实施例能够以除了在这里图示或描述的以外的顺序实施。In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present invention described herein can be implemented in an order other than that illustrated or described herein.

除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本发明实施例的目的,不是旨在限制本发明。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.

如图1所示,本发明实施例提供一种网络检测方法,所述方法包括:As shown in FIG1 , an embodiment of the present invention provides a network detection method, the method comprising:

S110:获取被测节点的以太网接口的第一接口信息;S110: Acquire first interface information of the Ethernet interface of the node under test;

S120:向所述被测节点发送第一指示;S120: Send a first indication to the node under test;

S130:接收所述被测节点基于所述第一指示发送的第一报文,其中,所述第一报文至少携带有所述被测节点发送所述第一报文的以太网接口的第二接口信息;S130: Receive a first message sent by the node under test based on the first indication, wherein the first message carries at least second interface information of the Ethernet interface of the node under test that sends the first message;

S140:根据所述第二接口信息及所述第一接口信息的匹配结果,确定所述检测节点和被测节点之间接口连通性。S140: Determine the interface connectivity between the detection node and the detected node according to the matching result of the second interface information and the first interface information.

这里,被测节点是边缘计算集群中用于实现业务功能的各个节点,例如访问节点及存储节点等。被测节点所处的网络,例如存储网等,在检测前应预先完成物理连接,且网络检测工具客户端可运行于被测节点。检测节点是独立存在的用于对被测节点连通性进行检测的节点,例如可用于运行网络检测工具服务端的节点,检测节点与被测节点所处的网络连通,且检测节点的IP地址已完成配置。以太网接口是用于网络数据连接的接口,例如FDDI接口、BNC接口、Console接口等。第一接口信息用于标识每个以太网接口的身份,例如eth0、eth1等接口名称。Here, the node under test is each node in the edge computing cluster used to implement business functions, such as access nodes and storage nodes. The network where the node under test is located, such as a storage network, should be physically connected in advance before detection, and the network detection tool client can run on the node under test. The detection node is an independent node used to detect the connectivity of the node under test, such as a node that can be used to run the network detection tool server. The detection node is connected to the network where the node under test is located, and the IP address of the detection node has been configured. The Ethernet interface is an interface for network data connection, such as an FDDI interface, a BNC interface, a Console interface, etc. The first interface information is used to identify the identity of each Ethernet interface, such as interface names such as eth0 and eth1.

在一个实施例中,检测节点在向被测节点发送第一指示之前,可远程使用预启动执行环境(Preboot eXecution Environment,PXE)或者远程智能平台管理接口(Intelligent Platform Management Interface,IPMI)的方式,启动每个被测节点上的自生操作系统(LiveCD)。被测节点的LiveCD被启动后,开始读取全局配置文件,并监听检测节点的指令。检测节点向被测节点发送停止发包指令,使被测节点不再进行报文发送以进入到适宜网络检测的状态,从而降低被测节点一边与检测节点进行网络检测的报文发送,另一边正常收发数据报文对检测的干扰。在被测节点停止发送数据报文之后,检测节点向被测节点发送第一指示,被测节点接受到第一指示,进入到网络检测的检测状态,即进入到向检测节点以外的其他设备发送数据报文的状态,并向检测节点发送第一报文,因此检测节点在发送第一指示之后,会接收被测节点发送的第一报文。In one embodiment, before sending the first instruction to the node under test, the detection node can remotely use the preboot execution environment (Preboot eXecution Environment, PXE) or the remote intelligent platform management interface (Intelligent Platform Management Interface, IPMI) to start the self-generated operating system (LiveCD) on each node under test. After the LiveCD of the node under test is started, it starts to read the global configuration file and listen to the instructions of the detection node. The detection node sends a stop packet sending instruction to the node under test, so that the node under test no longer sends messages to enter a state suitable for network detection, thereby reducing the interference of the node under test sending messages for network detection with the detection node on one side and normal data message transmission and reception on the other side. After the node under test stops sending data messages, the detection node sends the first instruction to the node under test, and the node under test receives the first instruction and enters the detection state of network detection, that is, enters the state of sending data messages to other devices other than the detection node, and sends the first message to the detection node, so the detection node will receive the first message sent by the node under test after sending the first instruction.

在另一个实施例中,获取被测节点的以太网接口的第一接口信息,可以为直接获取边缘计算集群中被测节点中每个接口的接口名称,也可以为获取边缘计算集群中所有网络的网络信息列表,例如存储网等网络,网络信息列表可至少包含:网络中的接口名称,以供对接口组合信息的具体记录。根据每个网络的网络信息列表中记录的接口名称,生成网络的接口组合列表,其中包含网络中所有接口名称双向的全连接组合,例如一个业务网拥有接口名称为a,b,c的三个接口,则该业务网的接口组合列表包括[a-b,b-a,a-c,c-a,b-c,c-b]。In another embodiment, obtaining the first interface information of the Ethernet interface of the node under test can be to directly obtain the interface name of each interface in the node under test in the edge computing cluster, or to obtain the network information list of all networks in the edge computing cluster, such as storage networks, etc. The network information list may at least include: the interface name in the network, so as to provide a specific record of the interface combination information. According to the interface name recorded in the network information list of each network, an interface combination list of the network is generated, which contains a bidirectional fully connected combination of all interface names in the network. For example, if a business network has three interfaces with interface names a, b, and c, then the interface combination list of the business network includes [a-b, b-a, a-c, c-a, b-c, c-b].

在本发明实施例中,检测节点可以预先准备全局配置文件,用于指明和记录边缘计算集群中每个网络的虚拟局域网身份标识(VLAN Identity document,VLAN ID)信息、期望MTU值、绑定接口和其从属接口关系,其中,绑定接口为多个物理接口绑定形成的一个独立接口。遍历被测节点中主机上的所有以太网接口,并获取第一接口信息。可选地,获取每个以太网接口的接口名称并记录。检测节点的服务端中生成第一指示,第一指示用于指示被测节点发送预设格式和内容的第一报文。例如用于指示被测节点开始发送报文的“发送报文”指令等,并将第一指示发送至运行于被测节点的客户端中。In an embodiment of the present invention, the detection node may prepare a global configuration file in advance, which is used to indicate and record the virtual local area network identity (VLAN Identity document, VLAN ID) information, expected MTU value, binding interface and its subordinate interface relationship of each network in the edge computing cluster, wherein the binding interface is an independent interface formed by binding multiple physical interfaces. Traverse all Ethernet interfaces on the host in the node under test and obtain the first interface information. Optionally, obtain the interface name of each Ethernet interface and record it. A first indication is generated in the server of the detection node, and the first indication is used to instruct the node under test to send a first message of a preset format and content. For example, a "send message" instruction is used to instruct the node under test to start sending a message, and the first indication is sent to the client running on the node under test.

第一报文用于供检测节点和被测节点收发以测试节点间的连通性,第一报文的格式和内容由检测节点定义,格式可以为JS对象简谱(JavaScript Object Notation,JSON)格式。对于第一报文内容,可以首先确定其初始报文内容,初始报文至少包含所在被测节点的主机的序列号、用于标识发送该报文的接口的第二接口信息、VLAN ID、MTU长度值、发送报文时的时间戳。其中VLAN ID从配置文件中获取。实际报文内容为初始报文内容后加长度为N的空格,N由期望MTU长度(T1)减去初始报文长度、被测节点网际互联协议(InternetProtocol,IP)头部长度(20字节)以及被测节点用户数据报协议(User DatagramProtocol,UDP)头部(8字节)得到。可选地,基于第二接口信息,和检测节点接收报文的接口,可以得到每个第一报文传输的源接口和目的接口。对应地,根据报文中记录的第二接口信息,以及获取到的第一接口信息,进行匹配,亦可以是根据报文的源接口和目的接口的组合,在对应网络的接口信息列表中进行匹配,即可确定网络中所需检测的被测节点与检测节点之间接口的连通性。The first message is used for the detection node and the tested node to send and receive to test the connectivity between the nodes. The format and content of the first message are defined by the detection node, and the format can be JS Object Notation (JSON) format. For the first message content, its initial message content can be determined first, and the initial message contains at least the serial number of the host of the tested node, the second interface information for identifying the interface sending the message, the VLAN ID, the MTU length value, and the timestamp when the message is sent. The VLAN ID is obtained from the configuration file. The actual message content is the initial message content plus a space of length N, and N is obtained by subtracting the initial message length, the Internet Protocol (IP) header length (20 bytes) of the tested node, and the User Datagram Protocol (UDP) header (8 bytes) of the tested node from the expected MTU length (T1). Optionally, based on the second interface information and the interface of the detection node receiving the message, the source interface and destination interface of each first message transmission can be obtained. Correspondingly, matching is performed based on the second interface information recorded in the message and the obtained first interface information, or matching is performed in the interface information list of the corresponding network based on the combination of the source interface and destination interface of the message, so as to determine the connectivity of the interface between the tested node and the detection node to be detected in the network.

如此,被测节点向检测节点发送携带接口标识信息的报文,使得检测节点可以明确得知发出第一报文的接口,以便在连通性检测中更具有针对性地确定被测节点的待测以太网接口。可以基于接收到的报文中的接口信息,与节点中的全量接口信息进行匹配,准确确定网络中存在的连通性问题。而且,亦可准确获得连通成功或失败的接口信息,以便记录并提供精确全面的问题报告给测试人员进行修复。In this way, the node under test sends a message carrying interface identification information to the detection node, so that the detection node can clearly know the interface that sent the first message, so as to more specifically determine the Ethernet interface to be tested of the node under test in the connectivity test. Based on the interface information in the received message, it can be matched with the full interface information in the node to accurately determine the connectivity problems existing in the network. Moreover, the interface information of successful or failed connectivity can also be accurately obtained, so as to record and provide accurate and comprehensive problem reports to testers for repair.

在一些实施例中,如图2所示,所述方法还包括:In some embodiments, as shown in FIG2 , the method further includes:

S150:接收所述被测节点基于所述第一指示发送的最大传输单元MTU长度值为第一阈值的所述第一报文;S150: Receive the first message with a maximum transmission unit MTU length value of a first threshold value sent by the measured node based on the first indication;

S160:接收所述被测节点基于所述第一阈值,依次发送的所述MTU长度值按预设间隔值递增的多个所述第一报文;S160: receiving a plurality of first messages, which are sent sequentially by the measured node based on the first threshold and whose MTU length values are increased according to a preset interval value;

S170:根据接收到的多个所述第一报文的MTU长度值,确定MTU长度最大值。S170: Determine a maximum MTU length according to the received MTU length values of the multiple first messages.

在本发明实施例中,第一指示还可以携带MTU长度值的取值范围,例如包含一个第一阈值为1400和预设间隔值为100。可选地,第一指示中还可以携带一个第二阈值,其中第二阈值大于第一阈值,例如第二阈值可以为9600。则被测节点接收到第一指示后,首先发送一条MTU长度值为1400的第一报文,然后基于预设间隔值100,依次发送MTU长度值分别为1500、1600、1700…9600的多条第一报文。由于被测节点的接口具有MTU长度最大值,当第一报文的MTU长度值超出该接口所能承受的MTU长度最大值时,被测节点无法继续发送第一报文。同理,由于检测节点的接口具有不同的MTU长度最大值,因此当第一报文的MTU长度值超过检测节点所能承受的MTU长度最大值时,检测节点无法继续接收到第一报文。因而根据最终检测节点接收到的所有第一报文的MTU长度值,可以确定网络中所能进行传输的MTU长度最大值。In an embodiment of the present invention, the first indication may also carry a value range of the MTU length value, for example, including a first threshold of 1400 and a preset interval value of 100. Optionally, the first indication may also carry a second threshold, wherein the second threshold is greater than the first threshold, for example, the second threshold may be 9600. After receiving the first indication, the node under test first sends a first message with an MTU length value of 1400, and then, based on the preset interval value of 100, sequentially sends multiple first messages with MTU length values of 1500, 1600, 1700 ... 9600. Since the interface of the node under test has a maximum MTU length, when the MTU length value of the first message exceeds the maximum MTU length that the interface can bear, the node under test cannot continue to send the first message. Similarly, since the interface of the detection node has different maximum MTU lengths, when the MTU length value of the first message exceeds the maximum MTU length that the detection node can bear, the detection node cannot continue to receive the first message. Therefore, according to the MTU length values of all first messages received by the final detection node, the maximum MTU length that can be transmitted in the network can be determined.

如此,通过被测节点发送的携带不同MTU长度值的多个第一报文,可以检测由被测节点和检测节点所在的网络中所能用于传输的MTU长度最大值。在利用被测节点发送报文检测可达性的同时,又能同时确定出MTU长度最大值,进而得知网络中的数据传输能力。In this way, the maximum MTU length that can be used for transmission in the network where the node under test and the detection node are located can be detected by sending multiple first messages carrying different MTU length values from the node under test. While using the node under test to send messages to detect reachability, the maximum MTU length can be determined at the same time, thereby obtaining the data transmission capacity in the network.

在一些实施例中,如图3所示,所述S170,包括:In some embodiments, as shown in FIG3 , the S170 includes:

S171:若成功接收到多个所述第一报文,读取每个接收到所述第一报文的所述MTU长度值,并确定所述多个所述第一报文中的MTU长度最大值。S171: If multiple first messages are successfully received, read the MTU length value of each received first message, and determine the maximum MTU length value among the multiple first messages.

在本发明实施例中,对于检测节点最终接收成功的所有第一报文,进行MTU长度值的获取,以确定MTU长度最大值。可选地,当检测节点在距离上一次接收到第一报文后的预设时间内没有再接收到第一报文时,确定本检测周期的第一报文发送已结束,则开始读取每条第一报文的MTU长度值。In an embodiment of the present invention, for all first messages that are finally successfully received by the detection node, the MTU length value is obtained to determine the maximum MTU length. Optionally, when the detection node does not receive the first message again within a preset time after the last reception of the first message, it is determined that the first message sending of this detection cycle has ended, and then the MTU length value of each first message is read.

在一个实施例中,检测节点每次接收到一条第一报文,立即读取报文中携带的MTU长度值并记录,当本检测周期结束后,将统计的所有MTU长度值进行比较,确定其中的MTU长度最大值。In one embodiment, each time the detection node receives a first message, it immediately reads and records the MTU length value carried in the message. After the detection cycle ends, it compares all the counted MTU length values to determine the maximum MTU length.

在另一个实施例中,由于被测节点按递增序列依次发送不同MTU长度值的第一报文,因此,检测节点接收到的第一报文的时间顺序也是按照MTU长度值依次递增顺序的。所以当一个检测周期结束后,最后一条接收到的第一报文的MTU长度值应为本周期内的MTU长度最大值。因此,若成功接收到多个所述第一报文,读取最后一个接收到的第一报文的MTU长度值,并确定为MTU长度最大值。In another embodiment, since the node under test sends first messages with different MTU length values in ascending order, the time sequence of the first messages received by the detection node is also in ascending order according to the MTU length value. Therefore, after a detection cycle ends, the MTU length value of the last received first message should be the maximum MTU length in this cycle. Therefore, if multiple first messages are successfully received, the MTU length value of the last received first message is read and determined as the maximum MTU length.

如此,由于各节点所能传输的MTU长度最大值各不相同,因此在检测节点和被测节点的报文收发过程结束后,通过每个报文的MTU长度值的读取和比对,确定出其中的最大值,也就是本次检测的被测节点与检测节点所在的网络所能传输的MTU长度最大值。进而基于MTU长度最大值即可分析得到网络的数据传输能力。In this way, since the maximum value of the MTU length that can be transmitted by each node is different, after the message sending and receiving process of the detection node and the detected node is completed, the maximum value among them is determined by reading and comparing the MTU length value of each message, that is, the maximum value of the MTU length that can be transmitted by the detected node and the network where the detection node is located. Then, based on the maximum value of the MTU length, the data transmission capacity of the network can be analyzed.

在一些实施例中,如图4所示,所述方法还包括:In some embodiments, as shown in FIG4 , the method further includes:

S100:确定所述被测节点中所述以太网接口的类型;S100: Determine the type of the Ethernet interface in the node under test;

S101:根据所述以太网接口的类型,确定所述以太网接口的物理接口信息,其中,所述物理接口信息,用于由所述第一指示携带发送至所述被测节点,供所述被测节点确定发送所述第一报文的以太网接口所对应的物理接口。S101: Determine physical interface information of the Ethernet interface according to the type of the Ethernet interface, wherein the physical interface information is used to be carried by the first indication and sent to the measured node, so that the measured node can determine the physical interface corresponding to the Ethernet interface that sends the first message.

在本发明实施例中,针对被测节点中以太网接口的类型进行确定,例如确定eth0接口的类型是有线接口,进而根据所确定的以太网接口类型,确定以太网接口在网络中映射的物理接口信息,例如eth0有线接口对应的物理接口信息是直通网卡物理功能(SingleRoot I/O Virtualization Physical Function,SRIOV PF)接口。确定所有以太网接口的类型之后,记录被测节点中所有以太网接口映射的物理接口信息。第一指示可携带所记录的物理接口信息发送至被测节点,指示被测节点通过物理接口信息对应的物理接口发送第一报文。In an embodiment of the present invention, the type of the Ethernet interface in the node under test is determined, for example, it is determined that the type of the eth0 interface is a wired interface, and then according to the determined Ethernet interface type, the physical interface information mapped by the Ethernet interface in the network is determined, for example, the physical interface information corresponding to the eth0 wired interface is a straight-through network card physical function (Single Root I/O Virtualization Physical Function, SRIOV PF) interface. After determining the types of all Ethernet interfaces, the physical interface information mapped by all Ethernet interfaces in the node under test is recorded. The first indication can carry the recorded physical interface information and be sent to the node under test, instructing the node under test to send a first message through the physical interface corresponding to the physical interface information.

如此,可以将被测节点的发送接口限制为物理接口,实现对网络中物理接口的可达性测试。根据开放式系统互联通信参考模型(Open System Interconnection ReferenceModel,OSI)中的七层定义,2层网络为数据链路层。基于对物理接口的连通性测试,即可实现对边缘计算集群的2层网络的连通性检测。In this way, the sending interface of the node under test can be limited to the physical interface, and the reachability test of the physical interface in the network can be realized. According to the seven-layer definition in the Open System Interconnection Reference Model (OSI), the 2-layer network is the data link layer. Based on the connectivity test of the physical interface, the connectivity test of the 2-layer network of the edge computing cluster can be realized.

在一些实施例中,所述第一指示,用于指示所述被测节点根据所述物理接口信息发送所述第一报文。被测节点可以根据第一指示的报文内容格式,以及物理接口信息,确定所需发送的报文以及发送报文的接口。In some embodiments, the first indication is used to instruct the measured node to send the first message according to the physical interface information. The measured node can determine the message to be sent and the interface to send the message according to the message content format of the first indication and the physical interface information.

如此,被测节点可以只通过所需的物理接口发送第一报文,实现对网络中物理接口的可达性测试,进而可实现对边缘计算集群的2层网络的连通性检测,提高对网络分层架构单独测试的效率。In this way, the node under test can send the first message only through the required physical interface to implement the reachability test of the physical interface in the network, and then realize the connectivity detection of the 2-layer network of the edge computing cluster, thereby improving the efficiency of separate testing of the network layered architecture.

在一些实施例中,所述获取被测节点的以太网接口的第一接口信息,至少包括:获取被测节点的以太网接口的接口名称。In some embodiments, the obtaining of the first interface information of the Ethernet interface of the node under test at least includes: obtaining the interface name of the Ethernet interface of the node under test.

接口名称是以太网接口的标识信息,例如eht0,eth1等。基于接口名称对待测以太网接口进行身份识别,可以在网络的完全部署之前,即尚未对接口的IP地址进行配置时,预先实现对网络连通性的准确检测。The interface name is the identification information of the Ethernet interface, such as eht0, eth1, etc. By identifying the Ethernet interface to be tested based on the interface name, accurate detection of network connectivity can be achieved in advance before the network is fully deployed, that is, before the IP address of the interface is configured.

在一些实施例中,如图5所示,所述S140,包括:In some embodiments, as shown in FIG5 , the S140 includes:

S141:若存在与所述第二接口信息匹配的所述第一接口信息,则确定所述检测节点和所述被测节点之间接口连通;S141: If there is the first interface information matching the second interface information, determining that the interface between the detection node and the detected node is connected;

S142:若不存在与所述第二接口信息匹配的所述第一接口信息,则确定所述检测节点和所述被测节点之间接口不连通。S142: If the first interface information matching the second interface information does not exist, determine that the interface between the detection node and the detected node is not connected.

在本发明实施例中,对于接收到的第一报文中携带的第二接口信息,表征与检测节点传输成功的被测节点中的待测接口。第一接口信息表征被测节点中以太网接口的全量接口信息,将二者进行匹配。如果在被测节点的全量第一接口信息中存在与第二接口信息匹配的第一接口信息,则表明当前与检测节点成功传输报文的接口,来自于目标被测节点中。In an embodiment of the present invention, the second interface information carried in the received first message represents the interface to be tested in the tested node that has successfully transmitted with the detection node. The first interface information represents the full interface information of the Ethernet interface in the tested node, and the two are matched. If there is first interface information matching the second interface information in the full first interface information of the tested node, it indicates that the interface that currently successfully transmits the message with the detection node comes from the target tested node.

在一个实施例中,检测节点读取接收到的第一报文中的源接口与目的接口,其中源接口为被测节点中发出第一报文的接口,即与第二接口信息对应的接口;目的接口为检测节点中接收第一报文的接口。并基于根据每个网络的网络信息列表生成的接口组合列表,在接口组合列表中查找所述第一报文中源接口与目的接口的组合。如果在列表中存在相同的接口组合,则表明源接口与目的接口所处的网络可连通。In one embodiment, the detection node reads the source interface and the destination interface in the received first message, wherein the source interface is the interface in the detected node that sends the first message, that is, the interface corresponding to the second interface information; the destination interface is the interface in the detection node that receives the first message. And based on the interface combination list generated according to the network information list of each network, the combination of the source interface and the destination interface in the first message is searched in the interface combination list. If the same interface combination exists in the list, it indicates that the networks where the source interface and the destination interface are located are connectable.

在另一个实施例中,收集边缘计算集群中所有检测节点接收到的第一报文,并记录报文内容至报文列表,其中至少包括:第一报文的源接口与目的接口,以及所属检测节点和被测节点。在接口组合列表中获取接口组合,在报文列表中进行查找匹配。如果存在相同的接口组合对应的第一报文,则表明源接口与目的接口所处的网络可连通。例如:在报文列表中查找源接口信息,如果没有找到,则记录在问题报告中,问题原因是:未找到服务器,并备注当前连接测试的源接口和目的接口,检测节点和被测节点,然后继续查找匹配;In another embodiment, the first messages received by all detection nodes in the edge computing cluster are collected, and the message contents are recorded in a message list, which at least includes: the source interface and destination interface of the first message, and the detection node and the node under test to which it belongs. The interface combination is obtained in the interface combination list, and a search and match is performed in the message list. If there is a first message corresponding to the same interface combination, it indicates that the network where the source interface and the destination interface are located is connected. For example: search for the source interface information in the message list. If it is not found, it is recorded in the problem report. The cause of the problem is: the server is not found, and the source interface and destination interface of the current connection test, the detection node and the node under test are noted, and then the search and match continues;

在报文列表中查找被测节点信息,如果没有找到,则记录在问题报告中,问题原因是:未找到源节点,并备注当前连接测试的源接口和目的接口,检测节点和被测节点,然后继续查找匹配;Search the tested node information in the message list. If not found, record it in the problem report. The problem reason is: the source node is not found, and note the source interface and destination interface of the current connection test, the detection node and the tested node, and then continue to search for matches;

如果并未发现有匹配值,则记录在问题报告中,问题原因是:网卡连接错误或者是交换机VLAN未配置正确,并备注当前连接测试的源接口和目的接口,检测节点和被测节点,然后继续查找匹配;If no matching value is found, it will be recorded in the problem report. The cause of the problem is: the network card connection is wrong or the switch VLAN is not configured correctly. The source interface and destination interface of the current connection test, the detection node and the tested node will be noted, and then continue to search for matches;

如果发现有匹配值,比较前述确定的MTU长度最大值和全局配置文件中记录的期望MTU值。如果MTU长度最大值小于期望MTU值,则记录在问题报告中,问题原因是:网络MTU小于期望MTU值,并备注当前连接测试的源接口和目的接口,检测节点和被测节点,然后继续查找匹配;If a match is found, compare the maximum MTU length determined above with the expected MTU value recorded in the global configuration file. If the maximum MTU length is less than the expected MTU value, record it in the problem report, and the cause of the problem is: the network MTU is less than the expected MTU value, and note the source and destination interfaces of the current connection test, the detection node and the node being tested, and then continue to search for a match;

如图6所示,本发明实施例提供了一种网络检测方法,应用于边缘计算集群内的被测节点中,包括:As shown in FIG6 , an embodiment of the present invention provides a network detection method, which is applied to a node under test in an edge computing cluster, including:

S210:接收所述检测节点发送的所述第一指示;S210: Receive the first indication sent by the detection node;

S220:基于所述第一指示发送所述第一报文,其中,所述第一报文至少携带有所述被测节点发送所述第一报文的以太网接口的第二接口信息;所述第二接口信息,用于供所述检测节点根据与所述第一接口信息的匹配结果,确定所述检测节点和所述被测节点之间接口连通性。S220: Send the first message based on the first indication, wherein the first message carries at least second interface information of the Ethernet interface of the measured node that sends the first message; the second interface information is used for the detection node to determine the interface connectivity between the detection node and the measured node based on a matching result with the first interface information.

在本发明实施例中,被测节点接收到第一指示后,向检测节点发送指定内容的第一报文。其中,第一报文至少携带发送报文的第二接口信息,用以提供给检测节点,由检测节点将第一接口信息与第二接口信息进行匹配,基于匹配结果确定检测节点与被测节点之间的连通性。In the embodiment of the present invention, after receiving the first instruction, the node under test sends a first message of specified content to the detection node, wherein the first message carries at least the second interface information of the message to be sent, which is provided to the detection node, and the detection node matches the first interface information with the second interface information, and determines the connectivity between the detection node and the node under test based on the matching result.

在一个实施例中,被测节点在第一次接收第一指示,进入检测程序之前,可由测试人员远程使用预启动执行环境(Preboot eXecution Environment,PXE)或者远程智能平台管理接口(Intelligent Platform Management Interface,IPMI)的方式,启动每个被测节点上的自生操作系统(LiveCD)。被测节点的LiveCD被启动后,开始读取全局配置文件,并监听检测节点的指令。被测节点接收检测节点发送的“停止发包”指令和“监听报文”指令,使自身的发包状态初始化,并准备接收第一指示。In one embodiment, before the tested node receives the first indication for the first time and enters the detection program, the tester can remotely use the preboot execution environment (Preboot eXecution Environment, PXE) or the remote intelligent platform management interface (Intelligent Platform Management Interface, IPMI) to start the self-generated operating system (LiveCD) on each tested node. After the LiveCD of the tested node is started, it starts to read the global configuration file and listen to the instructions of the detection node. The tested node receives the "stop sending packets" instruction and the "listen for messages" instruction sent by the detection node, initializes its own packet sending state, and prepares to receive the first indication.

在另一个实施例中,被测节点读取检测节点的第一指示中携带的物理接口信息,并确定物理接口信息对应的本节点中的物理接口。进而通过确定的物理接口向检测节点发送第一报文。In another embodiment, the node under test reads the physical interface information carried in the first indication of the detection node, determines the physical interface in the node corresponding to the physical interface information, and then sends the first message to the detection node through the determined physical interface.

如此,被测节点通过接收检测节点的指令,进入网络连通性检测阶段,发送指定内容的第一报文,可以使检测节点准确获知第一报文的发送接口信息。进而以供检测节点匹配确定指定接口的连通情况,亦可以生成更加精确全面的问题报告供测试人员调试网络。In this way, the node under test enters the network connectivity detection phase by receiving the instruction of the detection node and sending the first message with the specified content, so that the detection node can accurately know the information of the sending interface of the first message. Then, the detection node can match and determine the connectivity of the specified interface, and can also generate a more accurate and comprehensive problem report for testers to debug the network.

在一些实施例中,如图7所示,所述S220,包括:In some embodiments, as shown in FIG. 7 , the S220 includes:

S221:基于所述第一指示发送所述MTU长度值为第一阈值的所述第一报文;S221: Sending the first message with the MTU length value being a first threshold based on the first indication;

S222:基于所述第一阈值,依次发送所述MTU长度值按预设间隔值递增的多个所述第一报文。S222: Based on the first threshold, send in sequence a plurality of first messages whose MTU length values increase incrementally according to a preset interval value.

在本发明实施例中,被测节点接收的第一指示携带MTU长度值的取值范围,例如包含一个第一阈值1400和预设间隔值100。则被测节点接收到第一指示后,首先发送一条MTU长度值为1400的第一报文,然后基于预设间隔值100,依次发送MTU长度值分别为1500、1600、1700…的多条第一报文。In the embodiment of the present invention, the first indication received by the measured node carries a value range of the MTU length value, for example, including a first threshold value of 1400 and a preset interval value of 100. After receiving the first indication, the measured node first sends a first message with an MTU length value of 1400, and then, based on the preset interval value of 100, sequentially sends multiple first messages with MTU length values of 1500, 1600, 1700, ...

由于被测节点的接口具有MTU长度最大值,当第一报文的MTU长度值超出该接口所能承受的MTU长度最大值时,被测节点无法继续发送第一报文。同理,由于检测节点的接口具有不同的MTU长度最大值,因此当第一报文的MTU长度值超过检测节点所能承受的MTU长度最大值时,检测节点无法继续接收到第一报文。因而根据最终检测节点接收到的所有第一报文的MTU长度值,可以确定网络中所能进行传输的MTU长度最大值。Since the interface of the node under test has a maximum MTU length, when the MTU length value of the first message exceeds the maximum MTU length that the interface can bear, the node under test cannot continue to send the first message. Similarly, since the interface of the detection node has different maximum MTU lengths, when the MTU length value of the first message exceeds the maximum MTU length that the detection node can bear, the detection node cannot continue to receive the first message. Therefore, based on the MTU length values of all first messages received by the final detection node, the maximum MTU length that can be transmitted in the network can be determined.

如此,通过被测节点发送的携带不同MTU长度值的多个第一报文,可以检测由被测节点和检测节点所在的网络中所能用于传输的MTU长度最大值。在利用被测节点发送报文检测可达性的同时,又能同时确定出MTU长度最大值,进而得知网络中的数据传输能力。In this way, the maximum MTU length that can be used for transmission in the network where the node under test and the detection node are located can be detected by sending multiple first messages carrying different MTU length values from the node under test. While using the node under test to send messages to detect reachability, the maximum MTU length can be determined at the same time, thereby obtaining the data transmission capacity in the network.

在一些实施例中,如图8所示,所述方法还包括:In some embodiments, as shown in FIG8 , the method further includes:

S223:当所述第一报文的所述MTU长度值达到第二阈值时,停止发送所述第一报文。S223: When the MTU length value of the first message reaches a second threshold, stop sending the first message.

在本发明实施例中,第一指示还可以携带第二阈值,其中第二阈值大于第一阈值。例如包含一个第一阈值为1400和预设间隔值为100,以及第二阈值为9600。则被测节点接收到第一指示后,首先发送一条MTU长度值为1400的第一报文,然后基于预设间隔值100,依次发送MTU长度值分别为1500、1600、1700…9600的多条第一报文。由于被测节点的接口具有MTU长度最大值,当第一报文的MTU长度值超出该接口所能承受的MTU长度最大值时,被测节点无法继续发送第一报文。同理,由于检测节点的接口具有不同的MTU长度最大值,因此当第一报文的MTU长度值超过检测节点所能承受的MTU长度最大值时,检测节点无法继续接收到第一报文。因此设置第一报文MTU长度值的第二阈值,可以及时停止无效的报文发送过程。In an embodiment of the present invention, the first indication may also carry a second threshold, wherein the second threshold is greater than the first threshold. For example, a first threshold of 1400 and a preset interval value of 100 are included, and a second threshold of 9600 is included. After receiving the first indication, the node under test first sends a first message with an MTU length value of 1400, and then, based on the preset interval value of 100, sends multiple first messages with MTU length values of 1500, 1600, 1700 ... 9600 in sequence. Since the interface of the node under test has a maximum MTU length, when the MTU length value of the first message exceeds the maximum MTU length that the interface can bear, the node under test cannot continue to send the first message. Similarly, since the interface of the detection node has different maximum MTU lengths, when the MTU length value of the first message exceeds the maximum MTU length that the detection node can bear, the detection node cannot continue to receive the first message. Therefore, by setting the second threshold of the MTU length value of the first message, the invalid message sending process can be stopped in time.

如此,对于需要进行检测数据传输能力的检测节点和被测节点,由于对两个节点所能传输的MTU长度最大值不确定,对于被测节点发送的携带递增序列MTU长度值的第一报文,应设置第二阈值用以合理限制第一报文的发送过程。对于MTU长度最大值小于第二阈值的被测节点,可以减少生成无法发送的报文的资源浪费,提高网络检测效率。In this way, for the detection node and the tested node that need to detect the data transmission capacity, since the maximum value of the MTU length that can be transmitted by the two nodes is uncertain, for the first message sent by the tested node carrying the increasing sequence MTU length value, a second threshold should be set to reasonably limit the sending process of the first message. For the tested node whose maximum MTU length is less than the second threshold, the waste of resources generated by the message that cannot be sent can be reduced, and the network detection efficiency can be improved.

如图9所示,本发明实施例提供了一种网络检测装置,应用于边缘计算集群内的检测节点中,包括:As shown in FIG9 , an embodiment of the present invention provides a network detection device, which is applied to a detection node in an edge computing cluster, including:

获取模块110,用于获取被测节点的以太网接口的第一接口信息;The acquisition module 110 is used to acquire first interface information of the Ethernet interface of the node under test;

第一发送模块120,用于向所述被测节点发送第一指示;A first sending module 120, configured to send a first indication to the node under test;

第一接收模块130,用于接收所述被测节点基于所述第一指示发送的第一报文,其中,所述第一报文至少携带有所述被测节点发送所述第一报文的以太网接口的第二接口信息;A first receiving module 130 is configured to receive a first message sent by the node under test based on the first indication, wherein the first message carries at least second interface information of the Ethernet interface of the node under test that sends the first message;

确定模块140,用于根据所述第二接口信息及所述第一接口信息的匹配结果,确定所述检测节点和所述被测节点之间接口连通性。The determination module 140 is used to determine the interface connectivity between the detection node and the detected node according to the matching result of the second interface information and the first interface information.

在一些实施例中,所述第一接收模块130,还用于:In some embodiments, the first receiving module 130 is further configured to:

接收所述被测节点基于所述第一指示发送的最大传输单元MTU长度值为第一阈值的所述第一报文;Receiving the first message with a maximum transmission unit MTU length value of a first threshold value sent by the measured node based on the first indication;

接收所述被测节点基于所述第一阈值,依次发送的所述MTU长度值按预设间隔值递增的多个所述第一报文;Receiving a plurality of first messages, which are sent sequentially by the measured node based on the first threshold and whose MTU length values are increased according to a preset interval value;

所述确定模块140还用于:The determination module 140 is further configured to:

根据接收到的多个所述第一报文的MTU长度值,确定MTU长度最大值。Determine the maximum MTU length based on the MTU length values of the multiple received first messages.

在一些实施例中,所述确定模块140,具体用于:In some embodiments, the determining module 140 is specifically configured to:

若成功接收到多个所述第一报文,读取每个接收到所述第一报文的所述MTU长度值,并确定所述多个所述第一报文中的MTU长度最大值。If multiple first messages are successfully received, read the MTU length value of each received first message, and determine the maximum MTU length value among the multiple first messages.

在一些实施例中,所述确定模块140,还用于:In some embodiments, the determining module 140 is further configured to:

确定所述被测节点中所述以太网接口的类型;Determining the type of the Ethernet interface in the node under test;

根据所述以太网接口的类型,确定所述以太网接口的物理接口信息,其中,所述物理接口信息,用于由所述第一指示携带发送至所述被测节点,供所述被测节点确定发送所述第一报文的以太网接口所对应的物理接口。According to the type of the Ethernet interface, determine the physical interface information of the Ethernet interface, wherein the physical interface information is used to be carried by the first indication and sent to the node under test, so that the node under test can determine the physical interface corresponding to the Ethernet interface that sends the first message.

在一些实施例中,所述确定模块140,具体用于:In some embodiments, the determining module 140 is specifically configured to:

若存在与所述第二接口信息匹配的所述第一接口信息,则确定所述检测节点和所述被测节点之间接口连通;If there is the first interface information matching the second interface information, determining that the interface between the detection node and the measured node is connected;

若不存在与所述第二接口信息匹配的所述第一接口信息,则确定所述检测节点和所述被测节点之间接口不连通。If the first interface information matching the second interface information does not exist, it is determined that the interface between the detection node and the detected node is not connected.

如图10所示,本发明实施例提供了一种网络检测装置,应用于边缘计算集群内的被测节点中,包括:As shown in FIG10 , an embodiment of the present invention provides a network detection device, which is applied to a node under test in an edge computing cluster, including:

第二接收模块210,用于接收所述检测节点发送的所述第一指示;A second receiving module 210, configured to receive the first indication sent by the detection node;

第二发送模块220,用于基于所述第一指示发送所述第一报文,其中,所述第一报文至少携带有所述被测节点发送所述第一报文的以太网接口的第二接口信息;所述第二接口信息,用于供所述检测节点根据与所述第一接口信息的匹配结果,确定所述检测节点和所述被测节点之间接口连通性。The second sending module 220 is used to send the first message based on the first indication, wherein the first message carries at least the second interface information of the Ethernet interface of the measured node to send the first message; the second interface information is used for the detection node to determine the interface connectivity between the detection node and the measured node based on the matching result with the first interface information.

在一些实施例中,所述第二发送模块220,具体用于:In some embodiments, the second sending module 220 is specifically configured to:

基于所述第一指示发送所述MTU长度值为第一阈值的所述第一报文;Sending the first message with the MTU length value being a first threshold based on the first indication;

基于所述第一阈值,依次发送所述MTU长度值按预设间隔值递增的多个所述第一报文。Based on the first threshold, a plurality of the first messages whose MTU length values increase incrementally according to a preset interval value are sent in sequence.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further comprises:

停止模块230,用于当所述第一报文的所述MTU长度值达到第二阈值时,停止发送所述第一报文。The stopping module 230 is configured to stop sending the first message when the MTU length value of the first message reaches a second threshold.

以下结合上述任一实施例提供一个具体示例:A specific example is provided below in combination with any of the above embodiments:

1.如图11所示,网络检测工具分为服务端和客户端,服务端运行在独立的检测节点上,并且要求检测节点和被测边缘计算集群所有节点的管理网是连通的并且IP地址是配置好的,各被测节点的业务网、存储网、外网是预先在物理上互相连接好的,不要求配置IP和VLAN。客户端运行在各个被测节点上。1. As shown in Figure 11, the network detection tool is divided into a server and a client. The server runs on an independent detection node, and requires that the management network of the detection node and all nodes of the edge computing cluster under test are connected and the IP address is configured. The business network, storage network, and external network of each node under test are physically connected to each other in advance, and IP and VLAN configuration is not required. The client runs on each node under test.

2.准备全局配置文件,需要指明每台服务器的业务网、存储网、外网的VLAN ID信息、MTU期望值、BOND绑定接口和其从属端口关系。2. Prepare a global configuration file, which needs to specify the VLAN ID information, MTU expected value, BOND binding interface and its subordinate port relationship of each server's business network, storage network, and external network.

3.网络检测人员通过远程使用PXE或者远程IPMI加载虚拟ISO方式,在每个服务器上都启动带有网络检测工具自生操作系统(LiveCD)。3. The network detection personnel load the virtual ISO remotely using PXE or remote IPMI to start the self-generated operating system (LiveCD) with the network detection tool on each server.

4.各被测节点的自生操作系统启动后,网络监测工具客户端会自动启动,读取全局配置文件,并监听服务端的调用命令,包括发送报文、停止发包、监听报文。4. After the self-generated operating system of each node under test is started, the network monitoring tool client will automatically start, read the global configuration file, and listen to the call commands of the server, including sending messages, stopping packet sending, and monitoring messages.

5.服务端向所有节点的客户端发送"停止发包"指令,保证所有节点当处于初始状态。5. The server sends a "stop sending packets" command to the clients of all nodes to ensure that all nodes are in the initial state.

6.服务端向所有节点的客户端发送"监听报文"指令,保证所有节点当前发包状态处于监听状态。6. The server sends a "listen message" command to the clients of all nodes to ensure that the current packet sending status of all nodes is in the listening state.

7.定义特定的报文组P,报文组要求如下:7. Define a specific message group P. The message group requirements are as follows:

a)获取本节点的主机序列号,后续可用于区分报文来源。a) Get the host serial number of this node, which can be used to distinguish the source of the message later.

b)定义初始报文内容,内容可以为json格式,至少包含本主机的主机序列号、网络接口名称、网络VLAN ID、MTU长度值、发送报文时的时间戳。其中vlan_id从配置文件中获取。b) Define the initial message content, which can be in json format and at least include the host serial number of the host, network interface name, network VLAN ID, MTU length value, and timestamp when the message is sent. The vlan_id is obtained from the configuration file.

c)实际报文内容为:初始报文内容+长度为N的空格。N=期望MTU长度(T1)-初始报文长度-IP头部长度(20字节)-UDP头部(8字节)。c) The actual message content is: initial message content + space of length N. N = expected MTU length (T1) - initial message length - IP header length (20 bytes) - UDP header (8 bytes).

8.如图12所示,向所有节点的网络检测工具发送"发送报文"指令,报文组P要求重复向指定端口列表L中发送3次,避免由于特殊情况丢包导致结果不正确,每次发送的报文组要求如下:8. As shown in Figure 12, send the "send message" command to the network detection tools of all nodes. The message group P is required to be sent to the specified port list L repeatedly for 3 times to avoid incorrect results due to packet loss in special circumstances. The requirements for the message group sent each time are as follows:

a)遍历主机上所有网络接口,生成接口列表L1。a) Traverse all network interfaces on the host and generate an interface list L1.

b)判断每个接口,在L1中移除本地环回接口,SRIOV的VF接口,虚拟网卡接口,VLAN接口,只留下物理端口,SRIOV PF端口和BOND绑定端口进行后续检测,生成接口列表L2。b) Determine each interface and remove the local loopback interface, SRIOV VF interface, virtual network card interface, and VLAN interface in L1, leaving only the physical port, SRIOV PF port, and BOND binding port for subsequent detection to generate the interface list L2.

c)判断每个接口,如果是BOND端口,则找到其所有从属接口(slave),记录从属关系,并加到L2中,生成接口列表L。c) Determine each interface. If it is a BOND port, find all its slave interfaces (slave), record the slave relationship, and add it to L2 to generate the interface list L.

d)对列表L中的每个接口,以及多种MTU长度的组合,向外发送广播报文P,所有节点的相关接口正常情况下都会收到报文。MTU长度取值范围为1400,1500,1600...9600,每次递增100。报文P的实际内容中需要填入:发送报文的接口名称,本次发送报文的MTU值:mtu,协商速率双工模式以及发送报文的当前时间戳。d) For each interface in the list L, and for multiple combinations of MTU lengths, a broadcast message P is sent out, and all the relevant interfaces of the nodes will receive the message under normal circumstances. The MTU length range is 1400, 1500, 1600...9600, increasing by 100 each time. The actual content of the message P needs to be filled in: the name of the interface sending the message, the MTU value of the message sent this time: mtu, the negotiated rate duplex mode, and the current timestamp of the message sent.

9.所有节点的网络检测工具监听到接口传来的报文,并保存报文内容到列表C中。9. The network detection tools of all nodes monitor the messages sent from the interface and save the message contents to list C.

10.检查所有节点网络检测工具的发送状态,并等待所有节点报文发送完毕。10. Check the sending status of all node network detection tools and wait for all node messages to be sent.

11.在网络监测工具服务端处,收集所有节点的报文内容列表C。报文内容包括:源/目的主机节点序列号,源/目的网卡接口名,源网卡接口名,VLAN_ID,MTU,连接速率,双工模式,时间戳。11. At the network monitoring tool server, collect the message content list C of all nodes. The message content includes: source/destination host node serial number, source/destination network card interface name, source network card interface name, VLAN_ID, MTU, connection rate, duplex mode, and timestamp.

12.在网络监测工具服务端处,比较报文连接信息,并记录问题报告R,比较方法如下:12. At the network monitoring tool server, compare the message connection information and record the problem report R. The comparison method is as follows:

a)遍历所有节点信息,得到节点序列号。a) Traverse all node information and obtain the node sequence number.

b)遍历所有网络,包括网络类型:业务网、存储网、外网,获得网络的期望vlan_id,期望mtu,bond从属接口,按照字典结构:{网络类型:{节点序列号:{网络信息}}}方式,保存到字典(all_networks)中。b) Traverse all networks, including network types: business network, storage network, external network, obtain the expected vlan_id, expected mtu, bond slave interface of the network, and save them in the dictionary (all_networks) according to the dictionary structure: {network type: {node serial number: {network information}}}.

c)根据上述信息,分别生成业务网、存储网、外网的网络信息列表,其中包含所有节点序列号、网卡名称。c) Based on the above information, generate network information lists for the business network, storage network, and external network, which include all node serial numbers and network card names.

d)根据网络信息列表,生成网卡接口的全连接的组合列表。d) Generate a fully connected combination list of network card interfaces based on the network information list.

e)遍历全连接组合列表中的源节点S1,源网卡N1,目的节点D1,目的网卡M1,根据all_network中的信息,取出每个网络的期望vlan_id:V1。e) Traverse the source node S1, source network card N1, destination node D1, destination network card M1 in the fully connected combination list, and according to the information in all_network, take out the expected vlan_id: V1 of each network.

f)遍历中,如果发现源节点和目的节点的名称一样,则跳过继续。f) During the traversal, if the source node and the destination node have the same name, skip and continue.

g)在报文内容列表C中查找源节点(H)信息,如果没有找到,则记录在问题报告R中,问题原因是:未找到服务器H,并备注当前连接测试的源节点,源网卡,目的节点,目的网卡。然后跳过继续。g) Search for the source node (H) information in the message content list C. If it is not found, record it in the problem report R. The problem reason is: server H is not found, and note the source node, source network card, destination node, and destination network card of the current connection test. Then skip and continue.

h)在报文内容列表C中查找源网卡(D)信息,如果没有找到,则记录在问题报告R中,问题原因是:未找到源网卡D,并备注当前连接测试的源节点,源网卡,目的节点,目的网卡。然后跳过继续。h) Search for the source network card (D) information in the message content list C. If it is not found, record it in the problem report R. The problem reason is: the source network card D is not found, and note the source node, source network card, destination node, and destination network card of the current connection test. Then skip and continue.

i)在报文内容列表C中查找源网卡(D)下所连接的所有源网卡名列表(SL),并初始化变量"网卡连通状态"(has_connected_netdev)为"假"(False)。i) Search the list (SL) of all source network card names connected to the source network card (D) in the message content list C, and initialize the variable "network card connection status" (has_connected_netdev) to "false" (False).

j)遍历所连接的所有源网卡名列表(SL),并获取其中的源节点序列号S2、源网卡N2、实际vlan id:V2、实际测试的mtu值。j) Traverse all connected source network card name lists (SL) and obtain the source node serial number S2, source network card N2, actual vlan id: V2, and actual tested mtu value.

k)如果源网卡名列表(SL)中发现有网卡匹配:D1=S2,M1=N2,且V1=V2,则保存变量has_connected_netdev为"真"(True),并记录下该网卡匹配下,最大的测试mtu值:T2。k) If a network card match is found in the source network card name list (SL): D1 = S2, M1 = N2, and V1 = V2, then save the variable has_connected_netdev as "True" and record the maximum test mtu value under the network card match: T2.

l)如果源网卡名列表(SL)全部遍历完后,并未发现有匹配值(即:has_connected_netdev为"假"),则记录在问题报告R中,问题原因是:网卡连接错误或者是交换机VLAN未配置正确,并备注当前连接测试的源节点,源网卡,目的节点,目的网卡。然后跳过继续。l) If no matching value is found after all source network card name lists (SL) are traversed (i.e. has_connected_netdev is "false"), record it in the problem report R, the cause of the problem is: network card connection error or switch VLAN is not configured correctly, and note the source node, source network card, destination node, and destination network card of the current connection test. Then skip and continue.

m)如果源网卡名列表(SL)全部遍历完后,发现有匹配值(即:has_connected_netdev为"真"),比较最大mtu值T2和配置文件中的期望MTU值T1。如果T2小于T1,则记录在问题报告R中,问题原因是:网络MTU小于期望MTU值,并备注当前连接测试的源节点,源网卡,目的节点,目的网卡。然后跳过继续。m) If a match is found after all the source network card name lists (SL) are traversed (i.e. has_connected_netdev is "true"), compare the maximum MTU value T2 with the expected MTU value T1 in the configuration file. If T2 is less than T1, record it in the problem report R, the cause of the problem is: the network MTU is less than the expected MTU value, and note the source node, source network card, destination node, and destination network card of the current connection test. Then skip and continue.

n)读取全局配置,找到BOND绑定网卡以及其从属接口关系,并和报文内容列表C中的协商速率以及双工模式进行比较。如果发现同一个bond网卡下多个从属接口的实际协商速率或实际双工模式不一致,则在R问题记录中记录为BOND网卡从属接口速率或双工不一致问题,然后跳过继续。n) Read the global configuration, find the BOND bonded network card and its subordinate interface relationship, and compare them with the negotiated rate and duplex mode in the message content list C. If it is found that the actual negotiated rates or actual duplex modes of multiple subordinate interfaces under the same bonded network card are inconsistent, record it as a BOND network card subordinate interface rate or duplex inconsistency problem in the R problem record, and then skip to continue.

13.返回问题报告结果R给网络连通性测试人员。13. Return the problem report result R to the network connectivity tester.

本发明实施例还提供一种电子设备,所述电子设备包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,处理器运行所述计算机程序时,执行前述一个或多个技术方案所述方法的步骤。An embodiment of the present invention further provides an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor, and when the processor runs the computer program, the steps of the method described in one or more of the above technical solutions are executed.

本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,计算机可执行指令被处理器执行后,能够实现前述一个或多个技术方案所述方法。An embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. After the computer-executable instructions are executed by a processor, the methods described in one or more of the above-mentioned technical solutions can be implemented.

本实施例提供的计算机存储介质可为非瞬间存储介质。The computer storage medium provided in this embodiment may be a non-transient storage medium.

在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它行驶的。In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other.

上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

另外,在本发明各实施例中的各功能单元可以全部集成在一个处理模块中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的行驶实现,也可以采用硬件加软件功能单元的行驶实现。In addition, all functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented by hardware or by hardware plus software functional units.

在一些情况下,上述任一两个技术特征不冲突的情况下,可以组合成新的方法技术方案。In some cases, if any two of the above technical features do not conflict with each other, they can be combined into a new method technical solution.

在一些情况下,上述任一两个技术特征不冲突的情况下,可以组合成新的设备技术方案。In some cases, if any two of the above technical features do not conflict with each other, they can be combined into a new equipment technical solution.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks or optical disks, etc., various media that can store program codes.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (19)

1.一种网络检测方法,其特征在于,应用于边缘计算集群内的检测节点中,包括:1. A network detection method, characterized in that it is applied to a detection node in an edge computing cluster, comprising: 获取被测节点的以太网接口的第一接口信息;Obtaining first interface information of the Ethernet interface of the node under test; 向所述被测节点发送第一指示;Sending a first indication to the node under test; 接收所述被测节点基于所述第一指示发送的第一报文,其中,所述第一报文至少携带有所述被测节点发送所述第一报文的以太网接口的第二接口信息;Receiving a first message sent by the node under test based on the first indication, wherein the first message carries at least second interface information of the Ethernet interface of the node under test that sends the first message; 根据所述第二接口信息及所述第一接口信息的匹配结果,确定所述检测节点和所述被测节点之间接口连通性;Determine the interface connectivity between the detection node and the node under test according to the matching result of the second interface information and the first interface information; 其中,所述获取被测节点的以太网接口的第一接口信息,包括:获取被测节点的以太网接口的接口名称;所述第二接口信息包括:发送所述第一报文的以太网接口的接口名称;所述检测节点是独立存在的用于对所述被测节点连通性进行检测的节点。Among them, the obtaining of the first interface information of the Ethernet interface of the node under test includes: obtaining the interface name of the Ethernet interface of the node under test; the second interface information includes: the interface name of the Ethernet interface that sends the first message; the detection node is an independent node used to detect the connectivity of the node under test. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, characterized in that the method further comprises: 接收所述被测节点基于所述第一指示发送的最大传输单元MTU长度值为第一阈值的所述第一报文;Receiving the first message with a maximum transmission unit MTU length value of a first threshold value sent by the measured node based on the first indication; 接收所述被测节点基于所述第一阈值,依次发送的所述MTU长度值按预设间隔值递增的多个所述第一报文;Receiving a plurality of first messages, which are sent sequentially by the measured node based on the first threshold and whose MTU length values are increased according to a preset interval value; 根据接收到的多个所述第一报文的MTU长度值,确定MTU长度最大值。Determine the maximum MTU length based on the MTU length values of the multiple received first messages. 3.根据权利要求2所述的方法,其特征在于,所述根据接收到的多个所述第一报文的MTU长度值,确定MTU长度最大值,包括:3. The method according to claim 2, wherein determining the maximum MTU length according to the MTU length values of the received plurality of first messages comprises: 若成功接收到多个所述第一报文,读取每个接收到所述第一报文的所述MTU长度值,并确定所述多个所述第一报文中的MTU长度最大值。If multiple first messages are successfully received, read the MTU length value of each received first message, and determine the maximum MTU length value among the multiple first messages. 4.根据权利要求1所述的方法,其特征在于,所述方法还包括:4. The method according to claim 1, characterized in that the method further comprises: 确定所述被测节点中所述以太网接口的类型;Determining the type of the Ethernet interface in the node under test; 根据所述以太网接口的类型,确定所述以太网接口的物理接口信息,其中,所述物理接口信息,用于由所述第一指示携带发送至所述被测节点,供所述被测节点确定发送所述第一报文的以太网接口所对应的物理接口。According to the type of the Ethernet interface, determine the physical interface information of the Ethernet interface, wherein the physical interface information is used to be carried by the first indication and sent to the node under test, so that the node under test can determine the physical interface corresponding to the Ethernet interface that sends the first message. 5.根据权利要求4所述的方法,其特征在于,所述第一指示,用于指示所述被测节点根据所述物理接口信息发送所述第一报文。5 . The method according to claim 4 , wherein the first indication is used to instruct the node under test to send the first message according to the physical interface information. 6.根据权利要求1所述的方法,其特征在于,所述根据所述第二接口信息及所述第一接口信息的匹配结果,确定所述检测节点和被测节点之间接口连通性,包括:6. The method according to claim 1, characterized in that the determining the interface connectivity between the detection node and the detected node according to the matching result of the second interface information and the first interface information comprises: 若存在与所述第二接口信息匹配的所述第一接口信息,则确定所述检测节点和所述被测节点之间接口连通;If there is the first interface information matching the second interface information, determining that the interface between the detection node and the measured node is connected; 若不存在与所述第二接口信息匹配的所述第一接口信息,则确定所述检测节点和所述被测节点之间接口不连通。If the first interface information matching the second interface information does not exist, it is determined that the interface between the detection node and the detected node is not connected. 7.一种网络检测方法,其特征在于,应用于边缘计算集群内的被测节点中,包括:7. A network detection method, characterized in that it is applied to a tested node in an edge computing cluster, comprising: 接收检测节点发送的第一指示;receiving a first indication sent by a detection node; 基于所述第一指示发送第一报文,其中,所述第一报文至少携带有所述被测节点发送所述第一报文的以太网接口的第二接口信息;所述第二接口信息,用于供所述检测节点根据与第一接口信息的匹配结果,确定所述检测节点和所述被测节点之间接口连通性;Sending a first message based on the first indication, wherein the first message carries at least second interface information of the Ethernet interface of the node under test that sends the first message; the second interface information is used for the detection node to determine the interface connectivity between the detection node and the node under test according to a matching result with the first interface information; 其中,所述第二接口信息包括:发送所述第一报文的以太网接口的接口名称;所述第一接口信息包括:被测节点的以太网接口的接口名称;所述检测节点是独立存在的用于对所述被测节点连通性进行检测的节点。The second interface information includes: the interface name of the Ethernet interface that sends the first message; the first interface information includes: the interface name of the Ethernet interface of the node under test; the detection node is an independent node used to detect the connectivity of the node under test. 8.根据权利要求7所述的方法,其特征在于,所述基于所述第一指示发送所述第一报文,包括:8. The method according to claim 7, wherein sending the first message based on the first indication comprises: 基于所述第一指示发送所述MTU长度值为第一阈值的所述第一报文;Sending the first message with the MTU length value being a first threshold based on the first indication; 基于所述第一阈值,依次发送所述MTU长度值按预设间隔值递增的多个所述第一报文。Based on the first threshold, a plurality of the first messages whose MTU length values increase incrementally according to a preset interval value are sent in sequence. 9.根据权利要求8所述的方法,其特征在于,所述方法还包括:9. The method according to claim 8, characterized in that the method further comprises: 当所述第一报文的所述MTU长度值达到第二阈值时,停止发送所述第一报文。When the MTU length value of the first message reaches a second threshold, stop sending the first message. 10.一种网络检测装置,其特征在于,应用于边缘计算集群内的检测节点中,包括:10. A network detection device, characterized in that it is applied to a detection node in an edge computing cluster, comprising: 获取模块,用于获取被测节点的以太网接口的第一接口信息;An acquisition module, used to acquire first interface information of the Ethernet interface of the node under test; 第一发送模块,用于向所述被测节点发送第一指示;A first sending module, used to send a first indication to the node under test; 第一接收模块,用于接收所述被测节点基于所述第一指示发送的第一报文,其中,所述第一报文至少携带有所述被测节点发送所述第一报文的以太网接口的第二接口信息;A first receiving module, configured to receive a first message sent by the node under test based on the first indication, wherein the first message carries at least second interface information of the Ethernet interface of the node under test that sends the first message; 确定模块,用于根据所述第二接口信息及所述第一接口信息的匹配结果,确定所述检测节点和所述被测节点之间接口连通性;A determination module, configured to determine the interface connectivity between the detection node and the detected node according to a matching result of the second interface information and the first interface information; 其中,所述获取模块具体用于:获取被测节点的以太网接口的接口名称;The acquisition module is specifically used to: acquire the interface name of the Ethernet interface of the node under test; 所述第二接口信息包括:发送所述第一报文的以太网接口的接口名称;所述检测节点是独立存在的用于对所述被测节点连通性进行检测的节点。The second interface information includes: the interface name of the Ethernet interface that sends the first message; the detection node is an independent node used to detect the connectivity of the node under test. 11.根据权利要求10所述的装置,其特征在于,所述第一接收模块还用于:11. The device according to claim 10, wherein the first receiving module is further used for: 接收所述被测节点基于所述第一指示发送的最大传输单元MTU长度值为第一阈值的所述第一报文;Receiving the first message with a maximum transmission unit MTU length value of a first threshold value sent by the measured node based on the first indication; 接收所述被测节点基于所述第一阈值,依次发送的所述MTU长度值按预设间隔值递增的多个所述第一报文;Receiving a plurality of first messages, which are sent sequentially by the measured node based on the first threshold and whose MTU length values are increased according to a preset interval value; 所述确定模块还用于:The determining module is also used for: 根据接收到的多个所述第一报文的MTU长度值,确定MTU长度最大值。Determine the maximum MTU length according to the MTU length values of the received multiple first messages. 12.根据权利要求11所述的装置,其特征在于,所述确定模块,具体用于:12. The device according to claim 11, characterized in that the determining module is specifically used to: 若成功接收到多个所述第一报文,读取每个接收到所述第一报文的所述MTU长度值,并确定所述多个所述第一报文中的MTU长度最大值。If multiple first messages are successfully received, read the MTU length value of each received first message, and determine the maximum MTU length value among the multiple first messages. 13.根据权利要求10所述的装置,其特征在于,所述确定模块还用于:13. The device according to claim 10, wherein the determining module is further configured to: 确定所述被测节点中所述以太网接口的类型;Determining the type of the Ethernet interface in the node under test; 根据所述以太网接口的类型,确定所述以太网接口的物理接口信息,其中,所述物理接口信息,用于由所述第一指示携带发送至所述被测节点,供所述被测节点确定发送所述第一报文的以太网接口所对应的物理接口。According to the type of the Ethernet interface, determine the physical interface information of the Ethernet interface, wherein the physical interface information is used to be carried by the first indication and sent to the node under test, so that the node under test can determine the physical interface corresponding to the Ethernet interface that sends the first message. 14.根据权利要求10所述的装置,其特征在于,所述确定模块,具体用于:14. The device according to claim 10, characterized in that the determining module is specifically used to: 若存在与所述第二接口信息匹配的所述第一接口信息,则确定所述检测节点和所述被测节点之间接口连通;If there is the first interface information matching the second interface information, determining that the interface between the detection node and the measured node is connected; 若不存在与所述第二接口信息匹配的所述第一接口信息,则确定所述检测节点和所述被测节点之间接口不连通。If the first interface information matching the second interface information does not exist, it is determined that the interface between the detection node and the detected node is not connected. 15.一种网络检测装置,其特征在于,应用于边缘计算集群内的被测节点中,包括:15. A network detection device, characterized in that it is applied to a node under test in an edge computing cluster, comprising: 第二接收模块,用于接收检测节点发送的第一指示;A second receiving module, used to receive a first indication sent by the detection node; 第二发送模块,用于基于所述第一指示发送第一报文,其中,所述第一报文至少携带有所述被测节点发送所述第一报文的以太网接口的第二接口信息;所述第二接口信息,用于供所述检测节点根据与第一接口信息的匹配结果,确定所述检测节点和所述被测节点之间接口连通性;A second sending module, configured to send a first message based on the first indication, wherein the first message carries at least second interface information of the Ethernet interface of the node under test that sends the first message; the second interface information is used by the detection node to determine the interface connectivity between the detection node and the node under test according to a matching result with the first interface information; 其中,所述第二接口信息包括:发送所述第一报文的以太网接口的接口名称;所述第一接口信息包括:被测节点的以太网接口的接口名称;所述检测节点是独立存在的用于对所述被测节点连通性进行检测的节点。The second interface information includes: the interface name of the Ethernet interface that sends the first message; the first interface information includes: the interface name of the Ethernet interface of the node under test; the detection node is an independent node used to detect the connectivity of the node under test. 16.根据权利要求15所述的装置,其特征在于,所述第二发送模块,具体用于:16. The device according to claim 15, characterized in that the second sending module is specifically used to: 基于所述第一指示发送所述MTU长度值为第一阈值的所述第一报文;Sending the first message with the MTU length value being a first threshold based on the first indication; 基于所述第一阈值,依次发送所述MTU长度值按预设间隔值递增的多个所述第一报文。Based on the first threshold, a plurality of the first messages whose MTU length values increase incrementally according to a preset interval value are sent in sequence. 17.根据权利要求16所述的装置,其特征在于,所述装置还包括:17. The device according to claim 16, characterized in that the device further comprises: 停止装置,用于当所述第一报文的所述MTU长度值达到第二阈值时,停止发送所述第一报文。A stopping device is used to stop sending the first message when the MTU length value of the first message reaches a second threshold. 18.一种电子设备,其特征在于,所述电子设备包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器;其中,18. An electronic device, characterized in that the electronic device comprises: a processor and a memory for storing a computer program that can be run on the processor; wherein: 所述处理器运行所述计算机程序时,执行权利要求1至9任一项所述网络检测方法的步骤。When the processor runs the computer program, the processor executes the steps of the network detection method according to any one of claims 1 to 9. 19.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机可执行指令;所述计算机可执行指令被处理器执行后,能够实现如权利要求1至9任一项所述网络检测方法。19. A computer-readable storage medium, characterized in that the computer-readable storage medium stores computer-executable instructions; after the computer-executable instructions are executed by a processor, the network detection method according to any one of claims 1 to 9 can be implemented.
CN202011455863.XA 2020-12-10 2020-12-10 Network detection method and device, electronic equipment and storage medium Active CN114629819B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011455863.XA CN114629819B (en) 2020-12-10 2020-12-10 Network detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011455863.XA CN114629819B (en) 2020-12-10 2020-12-10 Network detection method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114629819A CN114629819A (en) 2022-06-14
CN114629819B true CN114629819B (en) 2024-10-25

Family

ID=81894999

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011455863.XA Active CN114629819B (en) 2020-12-10 2020-12-10 Network detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114629819B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108055151A (en) * 2017-12-11 2018-05-18 日立楼宇技术(广州)有限公司 Port management method, device, network node and the storage medium of network node
WO2020029928A1 (en) * 2018-08-07 2020-02-13 华为技术有限公司 Method for establishing bgp session and sending interface address and alias, and network device

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100561954C (en) * 2007-09-29 2009-11-18 华为技术有限公司 Method, system and the equipment of control detection of connectivity
US8218433B2 (en) * 2009-01-07 2012-07-10 Alcatel Lucent Monitoring connectivity in ring networks
PL2656550T3 (en) * 2010-12-21 2016-09-30 Network node hosting a plurality of connectivity supervision sessions towards a plurality of router interfaces
US8824308B2 (en) * 2011-05-19 2014-09-02 Calix, Inc. Ethernet OAM to ATM OAM interworking for loopback capability
CN102291266A (en) * 2011-09-13 2011-12-21 中兴通讯股份有限公司 Loopback (LB) detection method and device
CN102857379B (en) * 2012-09-18 2016-08-03 中兴通讯股份有限公司 The protection control method of ethernet ring network inter-node connectivity, device and primary nodal point
US9590850B2 (en) * 2013-08-08 2017-03-07 Cisco Technology, Inc. Discovery of connectivity and compatibility in a communication network
CN104092687B (en) * 2014-07-14 2018-02-09 新华三技术有限公司 A kind of bgp session method for building up and device
CN105357076B (en) * 2015-11-20 2019-01-29 中国建设银行股份有限公司 Network connectivty detection method and device between a kind of node
CN110768862B (en) * 2019-09-23 2021-03-09 烽火通信科技股份有限公司 Cloud platform physical link connectivity detection device, method and system
CN110830324B (en) * 2019-10-28 2021-09-03 烽火通信科技股份有限公司 Method and device for detecting network connectivity of data center and electronic equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108055151A (en) * 2017-12-11 2018-05-18 日立楼宇技术(广州)有限公司 Port management method, device, network node and the storage medium of network node
WO2020029928A1 (en) * 2018-08-07 2020-02-13 华为技术有限公司 Method for establishing bgp session and sending interface address and alias, and network device

Also Published As

Publication number Publication date
CN114629819A (en) 2022-06-14

Similar Documents

Publication Publication Date Title
CN110661669B (en) Network topology automatic discovery method of network equipment based on ICMP, TCP and UDP protocols
US7440415B2 (en) Virtual network addresses
CN111431758B (en) Cloud network equipment testing method and device, storage medium and computer equipment
US20070297349A1 (en) Method and System for Collecting Information Relating to a Communication Network
US7131031B2 (en) System and method for on-line diagnosing of network interface cards
CN109194551B (en) Method, device and system for testing performance of real-time Ethernet equipment
EP3140960B1 (en) Methods, systems, and computer readable media for providing fuzz testing functionality
EP1695486B1 (en) Method and system for collecting information relating to a communication network
CN109714221B (en) Method, device and system for determining network data packet
CN111030873A (en) Fault diagnosis method and device
CN108924005B (en) Network detection method, network detection apparatus, medium, and device
US20100094994A1 (en) Network structure information acquiring method and device
WO2024103783A1 (en) Dynamic host configuration protocol testing method, electronic device and computer storage medium
CN112463572B (en) Cross-border multi-service dial testing software testing system and method thereof
CN114205218B (en) Container network fault diagnosis method and system
TWI538441B (en) Process system for constructing network structure deployment diagram and the method thereof and computer program product storing network structure deployment analysis program are provided to analyze the network structure deployment of target network
CN114629819B (en) Network detection method and device, electronic equipment and storage medium
CN100421381C (en) Method and device for obtaining information of operation and failure state for network equipment
CN114598629B (en) A terminal type identification automatic test system and computer equipment
CN116708224A (en) Network equipment health evaluation method, device and storage medium
JP4411188B2 (en) Online system and communication method
CN111917602A (en) Method and device for detecting availability of IP address and electronic equipment
CN115150298B (en) Virtual gateway testing method and device, storage medium and electronic equipment
CN110213783B (en) Base station monitoring method, device and system
CN119383114A (en) A parallel test device supporting multiple communication interfaces

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