Method and device for realizing distributed DHCP (Dynamic Host Configuration Protocol) service

By using ServerLeaf switches and SDN controllers in the OpenStack cloud platform to implement distributed DHCP services, the response delay problem caused by centralized deployment is solved, the efficiency of cloud computing services is improved, and the high performance and high reliability of DHCP services are achieved.

CN119254718APending Publication Date: 2025-01-03CHINA TELECOM DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411385317.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The centralized deployment of DHCP services in the OpenStack cloud platform results in long transmission paths and long response delays. Especially in the case of virtual machines with multiple computing nodes, it becomes a bottleneck in the efficiency of cloud computing services.

Method used

Decentralized DHCP service is realized through ServerLeaf switch, and SDN controller and Openstack cloud platform cooperate to configure DHCP service on the ServerLeaf switch connected to the server where the virtual machine is located. The virtual machine only needs to get the IP address in one hop, making full use of hardware forwarding performance and high availability Technology, dynamically configure IP addresses.

Benefits of technology

It shortens the communication time of DHCP request response, realizes high performance and high reliability of DHCP services, supports the DHCP service requirements of large-scale data centers, and ensures the performance and reliability of OpenStack network functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254718A_ABST
    Figure CN119254718A_ABST
Patent Text Reader

Abstract

The invention relates to a method and a device for realizing a distributed DHCP (Dynamic Host Configuration Protocol) service, and belongs to the technical field of DHCP services, the method comprises the following steps: creating a subnet on an Openstack cloud platform, and starting a DHCP service corresponding to the subnet; the method comprises the following steps: creating a virtual machine on a cloud platform, linking the virtual machine to a subnet, scheduling the virtual machine to a server, creating a virtual machine instance on the server, and sending a notification after creating the virtual machine instance; the SDN controller analyzes a server where the virtual machine is located, a switch connected with the server and a port of the switch connected with the server where the virtual machine is located according to the notification, obtains virtual machine information, and associates the virtual machine information with the switch connected with the server where the virtual machine is located; the SDN controller configures a DHCP service of a switch connected with a server where the virtual machine is located; and the virtual machine sends a DHCP request, and the switch connected with the server where the virtual machine is located sends the IP address allocated by the cloud platform back to the virtual machine according to the configured DHCP service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of implementing distributed DHCP services, and in particular, relates to a method and device for implementing distributed DHCP services. Background Art

[0002] With the rapid development of cloud computing technology, OpenStack cloud platform has gradually become the main private cloud and public cloud to provide scalable and elastic cloud computing services. Openstack cloud platform is an open source project designed to provide software for the construction and management of public and private clouds. The primary task of the Openstack project is to simplify the cloud deployment process and bring good scalability to it. OpenStack cloud platform covers all aspects such as network, virtualization, operating system, server, etc.

[0003] The DHCP service currently provided by the Openstack cloud platform is centrally deployed on the network node, and the virtual machine is deployed on the computing node. The virtual machine and the DHCP service are interconnected through the virtual machine switch and the physical network between the network node and the computing node. The virtual switch divides the virtual machines and DHCP services in different subnets through VLAN. A DHCP service can connect to one or more subnets and provide DHCP services for all virtual machines in the subnet. The transmission path for message interaction between the DHCP server and the VM includes the virtual switch of the computing node where the virtual machine is located, the virtual switch in the network node, and the basic network (physical switch) between the computing node and the network node. Due to the long transmission path, the DHCP server has a long delay in responding to the VM service request. Especially when the DHCP server needs to provide DHCP services for VMs located in multiple computing nodes, due to the long transmission path and large access traffic, the response delay of the DHCP server becomes a bottleneck restricting the efficiency of cloud computing services. Summary of the invention

[0004] In view of the above deficiencies in the prior art, the purpose of the invention is to provide a method and device for implementing distributed DHCP services, which implements distributed DHCP services through Serverleaf switches and solves the problems of large capacity, high performance and high reliability of DHCP.

[0005] A first aspect of the present invention provides a method for implementing a distributed DHCP service, which is applied to a system including an Openstack cloud platform, an SDN controller, and a ServerLeaf switch, including:

[0006] Create a subnet on the Openstack cloud platform and enable the DHCP service corresponding to the subnet;

[0007] Create a virtual machine on the Openstack cloud platform, associate the virtual machine with a subnet, schedule the virtual machine to a server, create a virtual machine instance on the server, and send an LLDP notification after the virtual machine instance is created;

[0008] The SDN controller analyzes the server where the virtual machine is located, the ServerLeaf switch connected to the server where the virtual machine is located, and the port of the ServerLeaf switch connected to the server where the virtual machine is located based on the LLDP notification, obtains the virtual machine information, and associates it with the ServerLeaf switch connected to the server where the virtual machine is located.

[0009] The SDN controller configures the DHCP service of the ServerLeaf switch connected to the server where the virtual machine is located;

[0010] The virtual machine sends a DHCP request, and the ServerLeaf switch connected to the server where the virtual machine is located sends the IP address assigned by the Openstack cloud platform back to the virtual machine through a DHCP response based on the configured DHCP service.

[0011] Furthermore, in the above method for implementing a distributed DHCP service, creating a subnet on the Openstack cloud platform and enabling the DHCP service corresponding to the subnet include:

[0012] The Openstack cloud platform sends a subnet creation message to the SDN controller;

[0013] After receiving the message of creating a subnet, the SDN controller enables the DHCP service corresponding to the subnet by configuring the DHCP service function.

[0014] Furthermore, in the above method for implementing a distributed DHCP service, associating a virtual machine with a subnet and scheduling the virtual machine to a server includes:

[0015] Set the properties of the virtual machine;

[0016] The Openstack cloud platform assigns a MAC address and an IP address to the virtual network card mounted on each virtual machine and records them in the Openstack cloud platform database;

[0017] The SDN controller stores the virtual machine information in the SDN controller database;

[0018] The Nova component of the Openstack cloud platform schedules the virtual machine to the first server through a scheduling algorithm;

[0019] Among them, the attributes of the virtual machine include: the number of vcpu cores, memory size and virtual network card associated subnet; the virtual machine information includes: virtual machine name, assigned MAC address and IP address.

[0020] Furthermore, in the above method for implementing a distributed DHCP service, the SDN controller analyzes the server where the virtual machine is located, the ServerLeaf switch connected to the server where the virtual machine is located, and the port of the ServerLeaf switch connected to the server where the virtual machine is located according to the LLDP notification, including:

[0021] The SDN controller topology management function analyzes the topology information of the entire physical network through LLDP notification, including the servers connected to each port of the ServerLeaf switch;

[0022] The SDN controller uses the server name in the LLDP notification to analyze the ServerLeaf switch connected to the server and the port connecting the ServerLeaf switch to the server.

[0023] The SDN controller obtains the MAC address assigned to the virtual machine by analyzing the MAC address notified by LLDP, and queries the corresponding IP address through the MAC address assigned to the virtual machine.

[0024] Furthermore, in the above method for implementing a distributed DHCP service, the SDN controller configures the DHCP service of the ServerLeaf switch connected to the server where the virtual machine is located, including:

[0025] The SDN controller configures a DHCP address pool on the ServerLeaf switch connected to the server where the virtual machine is located;

[0026] Associate the interface connecting the server where the virtual machine is located with the ServerLeaf switch and configure it to the corresponding VRF;

[0027] Associate the DHCP address pool to the same VRF.

[0028] Furthermore, in the above method for implementing a distributed DHCP service, the ServerLeaf switch connected to the server where the virtual machine is located sends the IP address allocated by the Openstack cloud platform back to the virtual machine through a DHCP response according to the configured DHCP service, including:

[0029] The DHCP request is passed through the virtual machine network and the server's network card to the port on the ServerLeaf switch that is connected to the server;

[0030] Access the DHCP service through the VRF connected by the port;

[0031] The DHCP service replies a DHCP response to the virtual machine based on the configured address pool;

[0032] The DHCP response is sent back to the server where the virtual machine is located through the VRF and ServerLeaf switches connected to the server port, and then back to the virtual machine operating system through the virtual network card.

[0033] The virtual machine will obtain an IP address and configure it to the virtual network card.

[0034] Furthermore, in the above method for implementing a distributed DHCP service, the content of the LLDP notification includes at least: a ServerLeaf switch name, a ServerLeaf switch port, a MAC address, and a server name.

[0035] A second aspect of the present invention further provides a device for implementing a distributed DHCP service, in a switch system, comprising:

[0036] The first creation module is used to create a subnet on the Openstack cloud platform and start the DHCP service corresponding to the subnet;

[0037] The second creation module is used to create a virtual machine on the Openstack cloud platform, associate the virtual machine with a subnet, schedule the virtual machine to a server, create a virtual machine instance on the server, and send an LLDP notification after the virtual machine instance is created;

[0038] Analysis module: used by the SDN controller to analyze the server where the virtual machine is located, the ServerLeaf switch connected to the server where the virtual machine is located, and the port of the ServerLeaf switch connected to the server where the virtual machine is located according to the LLDP notification, obtain the virtual machine information, and associate it with the ServerLeaf switch connected to the server where the virtual machine is located;

[0039] Configuration module: used by the SDN controller to configure the DHCP service of the ServerLeaf switch connected to the server where the virtual machine is located;

[0040] Sending module: used by the virtual machine to send DHCP requests. The ServerLeaf switch connected to the server where the virtual machine is located sends the IP address assigned by the Openstack cloud platform back to the virtual machine through a DHCP response based on the configured DHCP service.

[0041] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor and a memory;

[0042] The processor is used to execute any one of the above methods for implementing distributed DHCP services by calling the program or instruction stored in the memory.

[0043] In a fourth aspect of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores a program or instruction. The program or instruction enables a computer to execute any one of the above methods for implementing a distributed DHCP service.

[0044] The beneficial effects of the present invention are as follows: the IP address required by the virtual machine is directly configured on the ServerLeaf switch connected to the server, and the virtual machine can obtain the required IP address with just one hop; the method of using the switch to implement distributed DHCP service fully utilizes the forwarding performance of the hardware, realizes the nearby forwarding of DHCP service, and fully utilizes the high availability technology of the switch; supports the large-capacity requirements of large-scale data centers for DHCP services, and the DHCP services distributed on multiple ServerLeaf switches form a logically unified DHCP service. When the ServerLeaf switches increase with the increase in the number of servers, the capacity of the DHCP service is also increasing; through the topology discovery technology, the IP address required by DHCP is dynamically configured to the switch directly connected to the virtual machine, which greatly shortens the communication time of DHCP request response, and the corresponding configuration of the virtual machine can be obtained with just one hop. IP address configured; use switch high availability technologies, such as MLAG and stacking, to achieve local high availability of DHCP; by configuring a large number of ServerLeaf switch DHCP services, realize distributed computing of DHCP services, thereby achieving global DHCP service high availability; when some ServerLeaf switches are down or damaged, only the servers directly connected to this ServerLeaf switch and the virtual machines deployed on the servers are affected, and other servers and virtual machines deployed on the servers are not affected in any way and can still successfully obtain the configured IP address; by connecting Openstack and hardware SDN solutions, high-quality private cloud solutions can be created quickly and efficiently, effectively improving the performance and reliability of OpenStack network functions; it can meet the general needs of large capacity, high performance, and high reliability of DHCP in Openstack and hardware SDN solutions. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.

[0046] Figure 1 A method diagram for implementing a distributed DHCP service provided by an embodiment of the present invention;

[0047] Figure 2A method diagram for creating a subnet on an Openstack cloud platform and enabling a DHCP service corresponding to the subnet is provided in an embodiment of the present invention;

[0048] Figure 3 A method diagram for associating a virtual machine to a subnet and scheduling the virtual machine to a server provided in an embodiment of the present invention;

[0049] Figure 4 A method diagram of configuring a DHCP service of a ServerLeaf switch connected to a server where a virtual machine is located by an SDN controller provided in an embodiment of the present invention;

[0050] Figure 5 A method diagram for sending an IP address allocated by an Openstack cloud platform back to a virtual machine via a DHCP response is provided in an embodiment of the present invention;

[0051] Figure 6 A diagram of a device for implementing a distributed DHCP service provided by an embodiment of the present invention;

[0052] Figure 7 A schematic block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0053] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.

[0054] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.

[0055] In the description of the present invention, the terms "first", "second", and "third" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be internal communication between two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0056] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.

[0057] The present invention proposes a method, device, electronic device and storage medium for implementing distributed DHCP service, and implements distributed DHCP service through a Serverleaf switch, thereby solving the problems of large capacity, high performance and high reliability of DHCP.

[0058] Before introducing the embodiments of the present invention, professional terms involved in the present invention are first introduced.

[0059] SDN: Software Defined Network, SDN separation is achieved through SDN controller and SDN data plane.

[0060] DHCP: Dynamic Host Configuration Protocol, used for centralized dynamic management and configuration of user IP addresses.

[0061] ServerLeaf: Server access switch.

[0062] LLDP: Link Layer Discovery Protocol, Link Layer Discovery Protocol is a data link layer protocol that network devices can send in the local network to notify other devices of their own status. It is a protocol that enables devices in the network to discover each other and notify status and exchange information.

[0063] VRF: Virtual Routing Forwarding is a logical division of physical devices. Each logical unit is called a VPN instance, and the instances are isolated at the routing level.

[0064] Method Embodiment

[0065] Figure 1 A diagram of a method for implementing distributed DHCP service provided by an embodiment of the present invention.

[0066] In a first aspect of the present invention, a method for implementing a distributed DHCP service is proposed, which is applied to a system including an Openstack cloud platform, an SDN controller and a ServerLeaf switch, and combined with Figure 1 , including five steps from S1 to S5:

[0067] S1: Create a subnet on the Openstack cloud platform and enable the DHCP service corresponding to the subnet.

[0068] Specifically, in the embodiment of the present invention, the Openstack cloud platform provides a function of creating a subnet. When creating a subnet, it is necessary to enable the DHCP service corresponding to the subnet and specify an IP address pool.

[0069] Here, the Openstack cloud platform provides the ML2 interface. The SDN controller needs to provide a standard ML2 implementation and connect to the Openstack cloud platform. After that, the Openstack cloud platform will create subnets and pass subnet DHCP information to the SDN controller in the standard ML2 interface.

[0070] S2: Create a virtual machine on the Openstack cloud platform, associate the virtual machine with a subnet, schedule the virtual machine to a server, create a virtual machine instance on the server, and send an LLDP notification after the virtual machine instance is created.

[0071] Specifically, in an embodiment of the present invention, a virtual machine is created on an Openstack cloud platform, and the properties of the virtual machine are set, wherein the properties of the virtual machine include: the number of vcpu cores, the memory size, and the subnet associated with the virtual network card; Openstack Nova schedules the virtual machine to a server according to a scheduling algorithm, and creates a virtual machine instance on the server; after the virtual machine instance is successfully created, an LLDP notification is issued to declare that the virtual machine instance is successfully created; and creating the virtual machine instance includes: creating a virtual network card required for the virtual machine, and mounting it to the virtual machine instance.

[0072] S3: The SDN controller analyzes the server where the virtual machine is located, the ServerLeaf switch connected to the server where the virtual machine is located, and the port of the ServerLeaf switch connected to the server where the virtual machine is located according to the LLDP notification, obtains the virtual machine information, and associates it with the ServerLeaf switch connected to the server where the virtual machine is located.

[0073] Specifically, in an embodiment of the present invention, after the virtual machine sends an LLDP notification, the ServerLeaf switch port connected to the server where the virtual machine is located will receive the LLDP notification. The ServerLeaf switch reports the LLDP notification sent by the virtual machine to the SDN controller. The SDN controller analyzes the LLDP notification reported by the virtual machine, obtains the virtual machine information, and associates it with the ServerLeaf switch that reports the LLDP notification.

[0074] S4: The SDN controller configures the DHCP service of the ServerLeaf switch connected to the server where the virtual machine is located.

[0075] Specifically, in the embodiment of the present invention, the SDN controller queries the corresponding subnet and DHCP information, IP address pool information according to the virtual machine information, configures the DHCP service of the ServerLeaf switch connected to the server where the virtual machine is located, sends the IP address and MAC address pair configured by the Openstack cloud platform to the corresponding DHCP service, and waits for the virtual machine to send a DHCP request.

[0076] S5: The virtual machine sends a DHCP request. The ServerLeaf switch connected to the server where the virtual machine is located sends the IP address assigned by the Openstack cloud platform back to the virtual machine through a DHCP response based on the configured DHCP service.

[0077] Specifically, in the embodiment of the present invention, the virtual machine obtains IP address information through the ServerLeaf switch connected to the server where the virtual machine is located. After the virtual machine is started, it will send a broadcast message of a DHCP request. When the broadcast message of the DHCP request reaches the ServerLeaf switch connected to the server where the virtual machine is located, the ServerLeaf switch directly sends the IP address allocated by Openstack back to the virtual machine through a DHCP response based on the DHCP service configured in step S4.

[0078] Figure 2 A method diagram for creating a subnet on an Openstack cloud platform and enabling a DHCP service corresponding to the subnet is provided in an embodiment of the present invention.

[0079] Furthermore, in the above method for implementing distributed DHCP service, a subnet is created on the Openstack cloud platform, and the DHCP service corresponding to the subnet is enabled. Figure 2 , and also includes two steps S21 to S22:

[0080] S21: The Openstack cloud platform sends a message about creating a subnet to the SDN controller;

[0081] S22: After receiving the message of creating a subnet, the SDN controller enables the DHCP service corresponding to the subnet by configuring the DHCP service function.

[0082] Specifically, in the embodiment of the present invention, after receiving the message that the Openstack cloud platform creates a subnet, the SDN controller analyzes the DHCP configuration and configures all serverleaf switches to enable the DHCP service corresponding to the subnet.

[0083] Here, the SDN controller manages the ServerLeaf switch through Netconf or CLI protocol, and starts the DHCP service of the ServerLeaf switch by configuring the DHCP service function. The following is an example of starting the DHCP server on the ServerLeaf switch:

[0084] #DHCP start starts the DHCP service (#DHCP stop shuts down the DHCP service)

[0085] The command line on the ServerLeaf switch is similar to the above command. The ServerLeaf switches of different manufacturers may be different. When the SDN controller manages ServerLeaf switches of different manufacturers, it will make appropriate adjustments according to the specific command line, and this does not limit the protection scope of the present invention.

[0086] Figure 3 A method diagram for associating a virtual machine with a subnet and scheduling the virtual machine to a server is provided in an embodiment of the present invention.

[0087] Furthermore, in the above method for implementing distributed DHCP service, the virtual machine is associated with the subnet, the virtual machine is scheduled to a server, and the Figure 3 , including four steps from S31 to S34:

[0088] S31: Set the properties of the virtual machine;

[0089] S32: The Openstack cloud platform allocates a MAC address and an IP address to the virtual network card mounted on each virtual machine, and records them in the Openstack cloud platform database;

[0090] S33: The SDN controller stores the virtual machine information in the SDN controller database;

[0091] S34: The Nova component of the Openstack cloud platform schedules the virtual machine to the first server through a scheduling algorithm;

[0092] Among them, the attributes of the virtual machine include: the number of vcpu cores, memory size and virtual network card associated subnet; the virtual machine information includes: virtual machine name, assigned MAC address and IP address.

[0093] Specifically, in the embodiment of the present invention, the Neutron module of the virtual network of the Openstack cloud platform allocates a MAC address and an IP address to the virtual network card mounted on each virtual machine, and records them in the Openstack cloud platform database, and notifies the SDN controller through the ML2 interface. The SDN controller stores the virtual machine information in the SDN controller database, and waits for the virtual machine to go online for configuration delivery. The Openstack cloud platform schedules the virtual machine through the Nova component and schedules it to a suitable physical server.

[0094] Furthermore, in the above method for implementing a distributed DHCP service, the SDN controller analyzes the server where the virtual machine is located, the ServerLeaf switch connected to the server where the virtual machine is located, and the port of the ServerLeaf switch connected to the server where the virtual machine is located according to the LLDP notification, including:

[0095] The SDN controller topology management function analyzes the topology information of the entire physical network through LLDP notification, including the servers connected to each port of the ServerLeaf switch;

[0096] The SDN controller uses the server name in the LLDP notification to analyze the ServerLeaf switch connected to the server and the port connecting the ServerLeaf switch to the server.

[0097] The SDN controller obtains the MAC address assigned to the virtual machine by analyzing the MAC address notified by LLDP, and queries the corresponding IP address through the MAC address assigned to the virtual machine.

[0098] Specifically, in an embodiment of the present invention, the topology management function of the SDN controller analyzes the topology information of the entire physical network through LLDP notification, including the servers connected to each port of the ServerLeaf switch, and records the results in the SDN controller database; the server where the virtual machine is located, the ServerLeaf switch connected to the server, and the port of the ServerLeaf switch connected to the server are analyzed through the above method.

[0099] Figure 4 A method diagram of a method for an SDN controller to configure a DHCP service of a ServerLeaf switch connected to a server where a virtual machine is located is provided in an embodiment of the present invention.

[0100] Furthermore, in the above method for implementing a distributed DHCP service, the SDN controller configures the DHCP service of the ServerLeaf switch connected to the server where the virtual machine is located, and combines Figure 4 , including three steps from S41 to S43:

[0101] S41: The SDN controller configures a DHCP address pool on the ServerLeaf switch connected to the server where the virtual machine is located;

[0102] S42: Associate the interface connecting the server where the virtual machine is located with the ServerLeaf switch and configure it to the corresponding VRF;

[0103] S43: Associate the DHCP address pool to the same VRF.

[0104] Specifically, in the embodiment of the present invention, the SDN controller is connected to the ServerLeaf switch connected to the server where the virtual machine is located through the management interface, and a DHCP address pool is configured on the ServerLeaf switch. The configuration command examples used are as follows:

[0105] #DHCP pool N1 (Configure DHCP pool)

[0106] #ip pool (configure IP address pool)

[0107] After the SDN controller configures the DHCP address pool on the ServerLeaf switch, it associates the interface connecting the server where the virtual machine is located with the ServerLeaf switch and configures it to the corresponding VRF. The VRF here is automatically created on the ServerLeaf switch by the SDN controller when creating a subnet, and then associates the DHCP address pool with the same VRF.

[0108] At this point, the SDN controller automatically configures the DHCP address pool on the ServerLeaf switch connected to the physical server where the virtual machine is located based on the LLDP message initiated by the virtual machine, and connects to the virtual machine network where the virtual machine is located.

[0109] Figure 5 A method diagram of sending an IP address allocated by an Openstack cloud platform back to a virtual machine via a DHCP response is provided in an embodiment of the present invention.

[0110] Furthermore, in the above-mentioned method for implementing a distributed DHCP service, the ServerLeaf switch connected to the server where the virtual machine is located sends the IP address allocated by the Openstack cloud platform back to the virtual machine through a DHCP response according to the configured DHCP service. Figure 5 , including five steps from S51 to S55:

[0111] S51: The DHCP request is transmitted to the port of the ServerLeaf switch connected to the server through the virtual machine network and the server's network card;

[0112] S52: Access DHCP service through the VRF connected by the port;

[0113] S53: The DHCP service replies a DHCP response to the virtual machine according to the configured address pool;

[0114] S54: The DHCP response is returned to the server where the virtual machine is located through the port connected to the server through the VRF and ServerLeaf switches, and then returned to the virtual machine operating system through the virtual network card.

[0115] S55: The virtual machine obtains an IP address and configures it to the virtual network card.

[0116] Specifically, in the embodiment of the present invention, after the virtual machine is successfully created, the operating system of the virtual machine is started, and the virtual network card of the virtual machine is configured by default to enable the DHCP client. When the virtual network is started, the virtual machine will issue a DHCP request, and this DHCP request is transmitted to the port connected to the server by the virtual machine network and the server's network card; the DHCP service is accessed through the VRF connected to this port, and DHCP replies to the virtual machine with a DHCP response message according to the configured address pool. The DHCP response message passes through the VRF, the port connected to the ServerLeaf switch and the physical server, and returns to the server where the virtual machine is located, and then returns to the virtual machine operating system through the virtual network card. The virtual machine will obtain an IP address configured to the virtual network card. At this point, the virtual machine completes obtaining an IP address through a DHCP request, and the ServerLeaf switch returns the configured IP address to the virtual machine.

[0117] Furthermore, in the above method for implementing a distributed DHCP service, the content of the LLDP notification includes at least: a ServerLeaf switch name, a ServerLeaf switch port, a MAC address, and a server name.

[0118] Device Embodiment

[0119] Figure 6 A diagram of a device for implementing distributed DHCP service provided by an embodiment of the present invention.

[0120] In a second aspect of the present invention, a device for implementing a distributed DHCP service is also provided. In a switch system, Figure 6 ,include:

[0121] The first creation module 61 is used to create a subnet on the Openstack cloud platform and enable the DHCP service corresponding to the subnet.

[0122] Specifically, in the embodiment of the present invention, the Openstack cloud platform provides a function of creating a subnet. When creating a subnet, the first creation module 61 needs to enable the DHCP service corresponding to the subnet and specify an IP address pool.

[0123] Here, the Openstack cloud platform provides the ML2 interface. The SDN controller needs to provide a standard ML2 implementation and connect to the Openstack cloud platform. After that, the Openstack cloud platform will create subnets and pass subnet DHCP information to the SDN controller in the standard ML2 interface.

[0124] The second creation module 62 is used to create a virtual machine on the Openstack cloud platform, associate the virtual machine with a subnet, schedule the virtual machine to a server, create a virtual machine instance on the server, and send an LLDP notification after the virtual machine instance is created.

[0125] Specifically, in the embodiment of the present invention, the second creation module 62 creates a virtual machine on the Openstack cloud platform and sets the properties of the virtual machine, the properties of the virtual machine include: the number of vcpu cores, the memory size and the virtual network card associated subnet; OpenstackNova schedules the virtual machine to a server according to the scheduling algorithm, and creates a virtual machine instance on the server; after the virtual machine instance is successfully created, an LLDP notification will be issued to declare that the virtual machine instance is successfully created; creating a virtual machine instance includes: creating the virtual network card required for the virtual machine, and mounting it to this virtual machine instance.

[0126] Analysis module 63: used for the SDN controller to analyze the server where the virtual machine is located, the ServerLeaf switch connected to the server where the virtual machine is located, and the port of the ServerLeaf switch connected to the server where the virtual machine is located according to the LLDP notification, obtain the virtual machine information, and associate it with the ServerLeaf switch connected to the server where the virtual machine is located.

[0127] Specifically, in an embodiment of the present invention, after the virtual machine sends an LLDP notification, the ServerLeaf switch port connected to the server where the virtual machine is located will receive the LLDP notification, and the ServerLeaf switch will report the LLDP notification sent by the virtual machine to the SDN controller. The analysis module 63 of the SDN controller analyzes the LLDP notification reported by the virtual machine, obtains the virtual machine information, and associates it with the ServerLeaf switch that reports the LLDP notification.

[0128] Configuration module 64: used by the SDN controller to configure the DHCP service of the ServerLeaf switch connected to the server where the virtual machine is located.

[0129] Specifically, in the embodiment of the present invention, the SDN controller queries the corresponding subnet and DHCP information, IP address pool information according to the virtual machine information, and the configuration module 64 configures the DHCP service of the ServerLeaf switch connected to the server where the virtual machine is located, and sends the IP address and MAC address pair configured by the Openstack cloud platform to the corresponding DHCP service, waiting for the virtual machine to send a DHCP request.

[0130] Sending module 65: used for the virtual machine to send a DHCP request. The ServerLeaf switch connected to the server where the virtual machine is located sends the IP address allocated by the Openstack cloud platform back to the virtual machine through a DHCP response according to the configured DHCP service.

[0131] Specifically, in the embodiment of the present invention, the virtual machine obtains IP address information through the ServerLeaf switch connected to the server where the virtual machine is located. After the virtual machine is started, the sending module 65 will send a broadcast message of the DHCP request. When the broadcast message of the DHCP request reaches the ServerLeaf switch connected to the server where the virtual machine is located, the ServerLeaf switch directly sends the IP address allocated by Openstack back to the virtual machine through a DHCP response based on the DHCP service configured in step S4.

[0132] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor and a memory;

[0133] The processor is used to execute any one of the above methods for implementing distributed DHCP services by calling the program or instruction stored in the memory.

[0134] In a fourth aspect of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores a program or instruction. The program or instruction enables a computer to execute any one of the above methods for implementing a distributed DHCP service.

[0135] Figure 7 It is a schematic block diagram of an electronic device provided by an embodiment of the present invention.

[0136] like Figure 7 As shown, the electronic device includes: at least one processor 701, at least one memory 702 and at least one communication interface 703. The various components in the electronic device are coupled together through a bus system 704. The communication interface 703 is used to transmit information between external devices. It can be understood that the bus system 704 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 704 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 7 Various buses are labeled as bus system 704 .

[0137] It can be understood that the memory 702 in this embodiment can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories.

[0138] In some implementations, the memory 702 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system and application programs.

[0139] The operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. A program that implements any method of a method for implementing a distributed DHCP service provided in an embodiment of the present invention can be included in the application.

[0140] In the embodiment of the present invention, the processor 701 calls the program or instruction stored in the memory 702, specifically, the program or instruction stored in the application program, and the processor 701 is used to execute the steps of each embodiment of the method for implementing distributed DHCP service provided in the embodiment of the present invention.

[0141] Create a subnet on the Openstack cloud platform and enable the DHCP service corresponding to the subnet;

[0142] Create a virtual machine on the Openstack cloud platform, associate the virtual machine with a subnet, schedule the virtual machine to a server, create a virtual machine instance on the server, and send an LLDP notification after the virtual machine instance is created;

[0143] The SDN controller analyzes the server where the virtual machine is located, the ServerLeaf switch connected to the server where the virtual machine is located, and the port of the ServerLeaf switch connected to the server where the virtual machine is located based on the LLDP notification, obtains the virtual machine information, and associates it with the ServerLeaf switch connected to the server where the virtual machine is located.

[0144] The SDN controller configures the DHCP service of the ServerLeaf switch connected to the server where the virtual machine is located;

[0145] The virtual machine sends a DHCP request, and the ServerLeaf switch connected to the server where the virtual machine is located sends the IP address assigned by the Openstack cloud platform back to the virtual machine through a DHCP response based on the configured DHCP service.

[0146] Any method in the method for implementing a distributed DHCP service provided in an embodiment of the present invention can be applied to the processor 701, or implemented by the processor 701. The processor 701 can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 701 or an instruction in the form of software. The above processor 701 can be a general-purpose processor, a digital signal processor (DigitalSignal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0147] The steps of any method in the method for implementing a distributed DHCP service provided by the embodiment of the present invention can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software units in the decoding processor. The software unit can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 702, and the processor 701 reads the information in the memory 702 and completes the steps of the method in combination with its hardware.

[0148] Those skilled in the art will appreciate that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present invention and to form different embodiments.

[0149] Those skilled in the art will appreciate that the description of each embodiment has its own emphasis, and for parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0150] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims. The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed by the present invention, and these modifications or substitutions should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

[0151] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for implementing a distributed DHCP service, characterized in that: Applied in systems including Openstack cloud platform, SDN controller and ServerLeaf switch, including: Create a subnet on the Openstack cloud platform and enable the DHCP service corresponding to the subnet; Create a virtual machine on the Openstack cloud platform, associate the virtual machine with a subnet, schedule the virtual machine to a server, create a virtual machine instance on the server, and send an LLDP notification after the virtual machine instance is created; The SDN controller analyzes the server where the virtual machine is located, the ServerLeaf switch connected to the server where the virtual machine is located, and the port of the ServerLeaf switch connected to the server where the virtual machine is located based on the LLDP notification, obtains the virtual machine information, and associates it with the ServerLeaf switch connected to the server where the virtual machine is located. The SDN controller configures the DHCP service of the ServerLeaf switch connected to the server where the virtual machine is located; The virtual machine sends a DHCP request, and the ServerLeaf switch connected to the server where the virtual machine is located sends the IP address assigned by the Openstack cloud platform back to the virtual machine through a DHCP response based on the configured DHCP service.

2. A method for implementing distributed DHCP service according to claim 1, characterized in that: The steps to create a subnet on the Openstack cloud platform and enable the DHCP service corresponding to the subnet include: The Openstack cloud platform sends a subnet creation message to the SDN controller; After receiving the message of creating a subnet, the SDN controller enables the DHCP service corresponding to the subnet by configuring the DHCP service function.

3. A method for implementing distributed DHCP service according to claim 1, characterized in that: The step of associating the virtual machine with the subnet and scheduling the virtual machine to a server includes: Set the properties of the virtual machine; The Openstack cloud platform assigns a MAC address and an IP address to the virtual network card mounted on each virtual machine and records them in the Openstack cloud platform database; The SDN controller stores the virtual machine information in the SDN controller database; The Nova component of the Openstack cloud platform schedules the virtual machine to the first server through a scheduling algorithm; Among them, the attributes of the virtual machine include: the number of vcpu cores, memory size and virtual network card associated subnet; the virtual machine information includes: virtual machine name, assigned MAC address and IP address.

4. A method for implementing distributed DHCP service according to claim 1, characterized in that: The SDN controller analyzes the server where the virtual machine is located, the ServerLeaf switch connected to the server where the virtual machine is located, and the port of the ServerLeaf switch connected to the server where the virtual machine is located according to the LLDP notification, including: The SDN controller topology management function analyzes the topology information of the entire physical network through LLDP notification, including the servers connected to each port of the ServerLeaf switch; The SDN controller uses the server name in the LLDP notification to analyze the ServerLeaf switch connected to the server and the port connecting the ServerLeaf switch to the server. The SDN controller obtains the MAC address assigned to the virtual machine by analyzing the MAC address notified by LLDP, and queries the corresponding IP address through the MAC address assigned to the virtual machine.

5. A method for implementing distributed DHCP service according to claim 1, characterized in that: The SDN controller configures the DHCP service of the ServerLeaf switch connected to the server where the virtual machine is located, including: The SDN controller configures a DHCP address pool on a ServerLeaf switch connected to a server where the virtual machine is located; Associate the interface connecting the server where the virtual machine is located with the ServerLeaf switch and configure it to the corresponding VRF; Associate the DHCP address pool to the same VRF.

6. A method for implementing distributed DHCP service according to claim 1, characterized in that: The ServerLeaf switch connected to the server where the virtual machine is located sends the IP address assigned by the Openstack cloud platform back to the virtual machine through a DHCP response according to the configured DHCP service, including: The DHCP request is passed through the virtual machine network and the server's network card to the port on the ServerLeaf switch that is connected to the server; Access the DHCP service through the VRF connected by the port; The DHCP service replies a DHCP response to the virtual machine based on the configured address pool; The DHCP response is sent back to the server where the virtual machine is located through the VRF and ServerLeaf switches connected to the server port, and then back to the virtual machine operating system through the virtual network card. The virtual machine will obtain an IP address and configure it to the virtual network card.

7. A method for implementing distributed DHCP service according to claim 1, characterized in that: The content of the LLDP notification includes at least: ServerLeaf switch name, ServerLeaf switch port, MAC address and server name.

8. A device for implementing distributed DHCP service, characterized in that: Applied in systems including Openstack cloud platform, SDN controller and ServerLeaf switch, including: The first creation module is used to create a subnet on the Openstack cloud platform and enable the DHCP service corresponding to the subnet; The second creation module is used to create a virtual machine on the Openstack cloud platform, associate the virtual machine with a subnet, schedule the virtual machine to a server, create a virtual machine instance on the server, and send an LLDP notification after the virtual machine instance is created; Analysis module: used by the SDN controller to analyze the server where the virtual machine is located, the ServerLeaf switch connected to the server where the virtual machine is located, and the port of the ServerLeaf switch connected to the server where the virtual machine is located according to the LLDP notification, obtain the virtual machine information, and associate it with the ServerLeaf switch connected to the server where the virtual machine is located; Configuration module: used by the SDN controller to configure the DHCP service of the ServerLeaf switch connected to the server where the virtual machine is located; Sending module: used by the virtual machine to send DHCP requests. The ServerLeaf switch connected to the server where the virtual machine is located sends the IP address assigned by the Openstack cloud platform back to the virtual machine through a DHCP response based on the configured DHCP service.

9. An electronic device, characterized in that: include: Processor and memory; The processor is used to execute the method for implementing distributed DHCP service as claimed in any one of claims 1 to 7 by calling the program or instruction stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute a method for implementing a distributed DHCP service as claimed in any one of claims 1 to 7.

Citation Information

Cited By

  • Communication method, device and system and electronic equipment

    CN120455435A