CN108683572B - Network detection method and system based on Openstack - Google Patents

Network detection method and system based on Openstack Download PDF

Info

Publication number
CN108683572B
CN108683572B CN201810789887.5A CN201810789887A CN108683572B CN 108683572 B CN108683572 B CN 108683572B CN 201810789887 A CN201810789887 A CN 201810789887A CN 108683572 B CN108683572 B CN 108683572B
Authority
CN
China
Prior art keywords
network
service module
creating
protocol
virtual machine
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
CN201810789887.5A
Other languages
Chinese (zh)
Other versions
CN108683572A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201810789887.5A priority Critical patent/CN108683572B/en
Publication of CN108683572A publication Critical patent/CN108683572A/en
Application granted granted Critical
Publication of CN108683572B publication Critical patent/CN108683572B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • 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/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/08Protocols specially adapted for terminal emulation, e.g. Telnet
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Landscapes

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

Abstract

The invention provides a network detection method and a system based on OpenStack, wherein the method comprises the following steps: s1, creating a service module project based on OpenStack, and creating an external network and an internal network for the service module project; s2, creating a virtual machine, and configuring the virtual machine in an internal network; s3, creating a router, and adding an internal network interface and an external network interface for the router; s4, adding a network detection protocol to a service module project; s5, distributing a floating IP for the service module project, and binding the floating IP to a virtual machine; s6, the virtual machine console closes the firewall; s7, judging whether the network is communicated or not by the virtual machine console through a network detection protocol; the system comprises: the system comprises a network creating module, a virtual machine creating module, a router creating module, a network detection protocol adding module, a floating IP distribution module, a firewall closing module and a network judging module.

Description

Network detection method and system based on Openstack
Technical Field
The invention belongs to the field of network testing, and particularly relates to a network detection method and system based on OpenStack.
Background
The OpenStack is an open-source cloud computing management platform project, and is formed by combining several main components to complete specific work. OpenStack supports almost all types of cloud environments, and the project aims to provide a cloud computing management platform which is simple to implement, can be expanded in a large scale, is rich and has a unified standard. OpenStack provides an infrastructure as a service (IaaS) solution through various complementary services, each of which provides an API for integration, but each service module first determines whether the network is good before testing, such as service modules for functions such as elastic scaling, load balancing, container service, and service orchestration. Each module tester depends on the network tester to firstly detect whether the network is intact, and if the network is not good, the related function tests related to the network functions cannot be carried out.
Therefore, it is very necessary to provide a network detection method and system based on Openstack to solve the above-mentioned drawbacks in the prior art.
Disclosure of Invention
The invention aims to provide a network detection method and system based on OpenStack to solve the technical problems, aiming at the defect that each service module based on OpenStack depends on network test in function test and related function test of network functions cannot be carried out when the network is not good.
In order to achieve the purpose, the invention provides the following technical scheme:
a network detection method based on OpenStack comprises the following steps:
s1, creating a service module project based on OpenStack, and creating an external network and an internal network for the service module project;
s2, creating a virtual machine, and configuring the virtual machine in an internal network;
s3, creating a router, and adding an internal network interface and an external network interface for the router;
s4, adding a network detection protocol to a service module project;
s5, distributing a floating IP for the service module project, and binding the floating IP to a virtual machine;
s6, the virtual machine console closes the firewall;
and S7, judging whether the network is connected or not by the virtual machine console through a network detection protocol.
Further, the specific steps of step S1 are as follows:
s11, creating a service module project based on OpenStack;
s12, establishing an external network for the service module project, and establishing an external network subnet;
and S13, creating an internal network for the service module project and creating an internal network subnet. And dividing the network to prepare for the next IP configuration and network detection.
Further, the network detection protocol adopts an ICMP protocol or a TCP protocol. The ICMP protocol and the TCP protocol are commonly used network communication protocols.
Further, the specific steps of step S4 are as follows:
s41, configuring a security group of a service module project;
s42, adding an export protocol and an entry protocol of ICMP for the security group of the service module project;
the specific steps of step S7 are as follows:
s71, connecting a virtual machine console with any external network address through a ping command, and judging whether ping is conducted or not;
s72, if the ping is on, the network of the service module project is communicated;
and S73, if the ping is not enabled, the network of the service module project is disabled. The ICMP protocol may check whether the network is good through ping.
Further, the specific steps of step S4 are as follows:
s41, configuring a security group of a service module project;
s42, adding an export protocol and an entry protocol of the TCP to the security group of the service module project;
the specific steps of step S7 are as follows:
s71, the virtual machine console logs in a host of an external network through a remote login ssh command and judges whether the login is successful;
s72, if the login is successful, the network of the service module project is connected;
and S73, if the login is not successful, the network of the service module project is not communicated. The TCP protocol can check whether the network is good through ssh login.
Further, the service module items include an elastic expansion function module item, a load balancing module item, a container server module item, and a service arrangement module item. The service module project is not limited to this, and the project of any non-network function module can adopt the scheme.
The invention also provides the following technical scheme:
an OpenStack-based network detection system, comprising:
the network creating module is used for creating service module projects based on OpenStack and creating an external network and an internal network for the service module projects;
the virtual machine creating module is used for creating a virtual machine and configuring the virtual machine to an internal network, and the internal network automatically allocates a virtual machine IP;
the router creating module is used for creating a router and adding an internal network interface and an external network interface for the router;
the network detection protocol adding module is used for adding a network detection protocol to the service module project;
the floating IP distribution module is used for distributing a floating IP for the service module project and binding the floating IP to the virtual machine;
the firewall closing module is used for closing the firewall by the virtual machine console;
and the network judgment module is used for judging whether the network is communicated or not by the virtual machine console through a network detection protocol.
Further, the network creation module includes:
a service module project creating unit, configured to create a service module project based on OpenStack;
the external network creating unit is used for creating an external network for the service module project and creating an external network subnet;
and the internal network creating unit is used for creating an internal network for the service module project and creating an internal network subnet. And dividing the network to prepare for the next IP configuration and network detection.
Further, the network detection protocol adopts an ICMP protocol or a TCP protocol. The ICMP protocol and the TCP protocol are commonly used network communication protocols, the ICMP protocol can check whether the network is good or not in a ping mode, and the TCP protocol can check whether the network is good or not in an ssh login mode.
Further, the service module items include an elastic expansion function module item, a load balancing module item, a container server module item, and a service arrangement module item. The service module project is not limited to this, and the project of any non-network function module can adopt the scheme.
The invention has the beneficial effects that:
the invention realizes that all testers can detect whether the network is normal by themselves, so that the testers of the service item module are free from relying on the network testers, thereby shortening the test early-stage verification time and improving the test efficiency.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
Therefore, compared with the prior art, the invention has prominent substantive features and remarkable progress, and the beneficial effects of the implementation are also obvious.
Drawings
FIG. 1 is a flow chart of a method of the present invention;
FIG. 2 is a schematic diagram of the system of the present invention;
wherein, 1-a network creation module; 2-a virtual machine creation module; 3-a router creation module; 4-network detection protocol adding module; 5-a floating IP allocation module; 6-firewall closing module; 7-network judgment module.
The specific implementation mode is as follows:
in order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Example 1:
as shown in fig. 1, the present invention provides an OpenStack-based network detection method, which includes the following steps:
s1, creating a service module project based on OpenStack, and creating an external network and an internal network for the service module project; the method comprises the following specific steps:
s11, creating a service module project based on OpenStack;
s12, establishing an external network for the service module project, and establishing an external network subnet;
s13, establishing an internal network for the service module project, and establishing an internal network subnet;
s2, creating a virtual machine, and configuring the virtual machine in an internal network;
s3, creating a router, and adding an internal network interface and an external network interface for the router;
s4, adding a network detection protocol to a service module project;
s5, distributing a floating IP for the service module project, and binding the floating IP to a virtual machine;
s6, the virtual machine console closes the firewall;
and S7, judging whether the network is connected or not by the virtual machine console through a network detection protocol.
The network detection protocol in the above embodiment 1 may adopt ICMP protocol or TCP protocol;
when the network detection protocol employs the ICMP protocol,
the specific steps of step S4 are as follows:
s41, configuring a security group of a service module project;
s42, adding an export protocol and an entry protocol of ICMP for the security group of the service module project;
the specific steps of step S7 are as follows:
s71, connecting a virtual machine console with any external network address through a ping command, and judging whether ping is conducted or not;
s72, if the ping is on, the network of the service module project is communicated;
and S73, if the ping is not enabled, the network of the service module project is disabled.
When the network detection protocol employs the TCP protocol,
the specific steps of step S4 are as follows:
s41, configuring a security group of a service module project;
s42, adding an export protocol and an entry protocol of the TCP to the security group of the service module project;
the specific steps of step S7 are as follows:
s71, the virtual machine console logs in a host of an external network through a remote login ssh command and judges whether the login is successful;
s72, if the login is successful, the network of the service module project is connected;
and S73, if the login is not successful, the network of the service module project is not communicated.
The service module items in the embodiment 1 include an elastic expansion function module item, a load balancing module item, a container server module item, and a service arrangement module item.
Example 2:
a network detection method based on OpenStack comprises the following steps:
s1, creating a service module project based on OpenStack, and creating an external network and an internal network for the service module project; the method comprises the following specific steps:
s11, creating a service module project based on OpenStack;
step S12, creating an external network ExternalNet under the service module project, and creating a subnet ExternalSubNet;
step S13, creating an internal network InnerNet and creating a subnet InnerSubNet;
s2, creating a virtual machine, configuring an internal network InnerNet by a network, and successfully allocating a virtual machine IP when the virtual machine is successfully created;
s3, a router is created, an external network of the router selects ExternalNet, and an interface of an intranet InnerNet is added into an interface of the router;
s4, adding a network detection protocol to a service module project; for the security group under the service module project, all protocols of ICMP outlet and inlet need to be added, and the protocol can check whether the network is good or not by means of ping. It is also possible to add all TCP egress and ingress protocols that can check the network for good or bad by means of ssh login.
S5, distributing floating IP for the service module project, and selecting the established ExternalNet by the external network; and binding the allocated floating IP to the virtual machine so that the virtual machine can be communicated with an external network through the floating IP.
S6, opening a console of the virtual machine, closing a firewall of the virtual machine, and if the firewall is not closed, all the flow can not pass through;
and S7, judging whether the network is connected or not through a network detection protocol on a control console of the virtual machine, if the network can ping a hundred-degree website in a ping mode, if the network can ping, indicating that the function of the network system is normal.
Example 3:
as shown in fig. 2, the present invention provides an OpenStack-based network detection system, including:
the network creating module 1 is used for creating service module projects based on OpenStack and creating an external network and an internal network for the service module projects; the service module projects comprise an elastic telescopic function module project, a load balancing module project, a container server module project and a service arrangement module project; the network creation module 1 includes:
a service module project creating unit, configured to create a service module project based on OpenStack;
the external network creating unit is used for creating an external network for the service module project and creating an external network subnet;
the internal network creating unit is used for creating an internal network for the service module project and creating an internal network subnet;
the virtual machine creating module 2 is used for creating a virtual machine and configuring the virtual machine to an internal network, and the internal network automatically allocates a virtual machine IP;
the router creating module 3 is used for creating a router and adding an internal network interface and an external network interface for the router;
the network detection protocol adding module 4 is used for adding a network detection protocol to the service module project; the network detection protocol adopts an ICMP protocol or a TCP protocol;
the floating IP distribution module 5 is used for distributing a floating IP for the service module project and binding the floating IP to the virtual machine;
the firewall closing module 6 is used for closing the firewall by the virtual machine console;
and the network judgment module 7 is used for judging whether the network is communicated or not by the virtual machine console through a network detection protocol.
The embodiments of the present invention are illustrative rather than restrictive, and the above-mentioned embodiments are only provided to help understanding of the present invention, so that the present invention is not limited to the embodiments described in the detailed description, and other embodiments derived from the technical solutions of the present invention by those skilled in the art also belong to the protection scope of the present invention.

Claims (6)

1. A network detection method based on OpenStack is characterized by comprising the following steps:
s1, creating a service module project based on OpenStack, and creating an external network and an internal network for the service module project;
s2, creating a virtual machine, and configuring the virtual machine in an internal network;
s3, creating a router, and adding an internal network interface and an external network interface for the router;
s4, adding a network detection protocol to a service module project; the network detection protocol adopts an ICMP protocol or a TCP protocol; the method comprises the following specific steps:
s41, configuring a security group of a service module project;
s42, adding an exit protocol and an entry protocol of ICMP or TCP to the security group of the service module project;
s5, distributing a floating IP for the service module project, and binding the floating IP to a virtual machine;
s6, the virtual machine console closes the firewall;
s7, judging whether the network is connected or not by the virtual machine console through a network detection protocol;
when the network security protocol is an ICMP protocol, the specific steps are as follows:
s71, connecting a virtual machine console with any external network address through a ping command, and judging whether ping is conducted or not;
s72, if the ping is on, the network of the service module project is communicated;
s73, if the ping can not be conducted, the network of the service module project is not conducted;
when the network security protocol is a TCP protocol, the specific steps are as follows:
s71, the virtual machine console logs in a host of an external network through a remote login ssh command and judges whether the login is successful;
s72, if the login is successful, the network of the service module project is connected;
and S73, if the login is not successful, the network of the service module project is not communicated.
2. The OpenStack-based network detection method according to claim 1, wherein the step S1 specifically includes the following steps:
s11, creating a service module project based on OpenStack;
s12, establishing an external network for the service module project, and establishing an external network subnet;
and S13, creating an internal network for the service module project and creating an internal network subnet.
3. The OpenStack-based network detection method of claim 1, wherein the service module items comprise elastic scaling function module items, load balancing module items, container server module items, and service orchestration module items.
4. An OpenStack-based network detection system, comprising:
the network creating module (1) is used for creating service module projects based on OpenStack and creating an external network and an internal network for the service module projects;
the virtual machine creating module (2) is used for creating a virtual machine and configuring the virtual machine to an internal network, and the internal network automatically allocates a virtual machine IP;
the router creating module (3) is used for creating a router and adding an internal network interface and an external network interface for the router;
the network detection protocol adding module (4) is used for adding a network detection protocol to the service module project; the network detection protocol adopts an ICMP protocol or a TCP protocol; configuring a security group of service module projects; adding an exit protocol and an entry protocol of ICMP or TCP to a security group of a service module project;
the floating IP distribution module (5) is used for distributing a floating IP for the service module project and binding the floating IP to the virtual machine;
the firewall closing module (6) is used for closing the firewall by the virtual machine console;
the network judgment module (7) is used for judging whether the network is communicated or not by the virtual machine console through a network detection protocol;
when the network security protocol is an ICMP protocol, the judging process is as follows:
the virtual machine console is connected with any external network address through a ping command and judges whether ping is conducted or not;
if the ping is on, the network of the service module project is connected;
if the ping connection cannot be carried out, the network of the service module project is not connected;
when the network security protocol is a TCP protocol, the judging process is as follows:
the virtual machine console logs in a host of an external network through a remote login ssh command and judges whether the logging is successful or not;
if the login is successful, the network of the service module project is communicated;
if the login is not successful, the network of the service module item is not communicated.
5. An OpenStack-based network detection system according to claim 4, wherein the network creation module (1) comprises:
a service module project creating unit, configured to create a service module project based on OpenStack;
the external network creating unit is used for creating an external network for the service module project and creating an external network subnet;
and the internal network creating unit is used for creating an internal network for the service module project and creating an internal network subnet.
6. The OpenStack-based network detection system of claim 4, wherein the service module items comprise elastic scaling function module items, load balancing module items, container server module items, and service orchestration module items.
CN201810789887.5A 2018-07-18 2018-07-18 Network detection method and system based on Openstack Active CN108683572B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810789887.5A CN108683572B (en) 2018-07-18 2018-07-18 Network detection method and system based on Openstack

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810789887.5A CN108683572B (en) 2018-07-18 2018-07-18 Network detection method and system based on Openstack

Publications (2)

Publication Number Publication Date
CN108683572A CN108683572A (en) 2018-10-19
CN108683572B true CN108683572B (en) 2021-02-02

Family

ID=63814065

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810789887.5A Active CN108683572B (en) 2018-07-18 2018-07-18 Network detection method and system based on Openstack

Country Status (1)

Country Link
CN (1) CN108683572B (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103227734A (en) * 2013-04-27 2013-07-31 华南理工大学 Method for detecting abnormity of OpenStack cloud platform
CN104579842A (en) * 2015-01-12 2015-04-29 浪潮电子信息产业股份有限公司 Processing method for obtaining state of cluster monitoring calculation nodes based on socket communication
CN105227344B (en) * 2015-08-21 2019-03-22 烽火通信科技股份有限公司 Software defined network simulation system and method based on OpenStack
US20170171150A1 (en) * 2015-12-14 2017-06-15 Le Holdings (Beijing) Co., Ltd. Method and apparatus for processing public ip
CN106603330A (en) * 2016-12-07 2017-04-26 国云科技股份有限公司 Cloud platform virtual machine connection state checking method
CN107577519A (en) * 2017-09-18 2018-01-12 郑州云海信息技术有限公司 A kind of virtual machine pressure method and device
CN107741874B (en) * 2017-10-12 2021-05-14 武汉中地数码科技有限公司 Automatic creating method and system for GIS cloud virtual machine

Also Published As

Publication number Publication date
CN108683572A (en) 2018-10-19

Similar Documents

Publication Publication Date Title
CN101668022B (en) Virtual network isolation system established on virtual machine and implementation method thereof
US8949399B2 (en) Dynamic configuration of virtual machines
CN103718527B (en) Communication security processing method, apparatus and system
WO2018157299A1 (en) Virtualization method for optical line terminal (olt) device, and related device
CN102082707B (en) Parallel processing performance test method for multinuclear firewall
CN111130931B (en) Detection method and device for illegal external connection equipment
CN104394029B (en) A kind of total line detecting methods of AFDX based on hybrid channel
CN104468388A (en) Method for testing load balancing of network card based on Linux system
CN110913024B (en) Cloud platform information synchronization method, system, control device and storage medium
CN106230655A (en) A kind of network pressure testing method and device
CN104539483A (en) Network testing system
CN110008005B (en) Cloud platform-based power grid communication resource virtual machine migration system and method
CN104506403B (en) A kind of virtual network management method for supporting multi-stage isolation
CN109787864A (en) A kind of network automatic test approach, device, terminal and storage medium based on Netperf
CN107341103A (en) The method of testing and system of a kind of software compatibility
CN108810191A (en) Floating IP address detection method based on OpenStack and system
CN108141381B (en) System and method to coordinate cable test results with cable test configuration
CN108683572B (en) Network detection method and system based on Openstack
CN201499183U (en) Virtual network separation system
CN105553865B (en) A kind of FC exchanger chips credit management test method
CN107017998B (en) Method and system for implementing CGN flexible backup
CN103765837B (en) The message processing method of multi-CPU and system, crosspoint, veneer
CN103441894A (en) Method and system for L2TP concurrent connection performance test
CN105262628A (en) Campus dormitory network management system based on multi-operator link sharing
CN105162650B (en) A method of monitoring redundancy network interface card switching time

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210106

Address after: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Applicant after: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Address before: Room 1601, 16 / F, 278 Xinyi Road, Zhengdong New District, Zhengzhou City, Henan Province, 450000

Applicant before: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant