Multi-subnet routing information distribution method and device, medium and equipment

By dividing the OpenStack platform into multiple Layer 3 subnets and segmenting routing information into data segments, the limitation on the number of Layer 3 subnets was solved, enabling the distribution of routing information across multiple subnets and improving user experience and platform performance.

CN118646718BActive Publication Date: 2026-01-13SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410713989.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2026-01-13
Estimated Expiration
2044-06-04

AI Technical Summary

Technical Problem

The OpenStack platform has limitations on the number of Layer 3 subnets it can divide into, and it cannot effectively distribute routing information to more than 25 Layer 3 subnets, resulting in a poor user experience.

Method used

By dividing the OpenStack platform into multiple Layer 3 subnets, and when the total length exceeds a threshold, the routing information of other Layer 3 networks is cut into multiple data segments, each segment being less than the threshold length, and data packets are generated and returned to the virtual machine, thus realizing the distribution of multi-subnet routing information.

Benefits of technology

It breaks through the OpenStack platform's limitation on the number of Layer 3 subnets, improves user experience, enhances data plane performance and public cloud platform performance, and improves the user experience of cloud services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118646718B_ABST
    Figure CN118646718B_ABST
Patent Text Reader

Abstract

The application provides a multi-subnet routing information issuing method and device, a medium and equipment. The method comprises the following steps: creating a two-layer tenant network for a user; dividing the two-layer tenant network into multiple three-layer subnets according to the user demand; creating at least one virtual machine in each three-layer subnet of the multiple three-layer subnets, and allocating an IP address to each virtual machine; determining the total length of the routing information of each three-layer network except the three-layer subnet to which the virtual machine belongs; if the total length is greater than or equal to a length threshold, dividing the routing information of each three-layer network except the three-layer subnet into multiple data segments, and the length of each data segment is less than the length threshold; generating a data packet, and returning the data packet to the virtual machine to realize the issuing of the multi-subnet routing information. The method provided by the embodiment of the application can divide the two-layer tenant network into more than 25 three-layer subnets, break through the limitation of the number of three-layer subnets divided by the original OpenStack platform, and improve the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of public cloud technology, and in particular to a method, apparatus, medium, and device for distributing multi-subnet routing information. Background Technology

[0002] In recent years, public cloud virtual networks based on OpenStack have developed rapidly. Customers use the network services provided by OpenStack by creating Layer 2 tenant networks and dividing them into Layer 3 subnets. In the actual production environment of public cloud platforms, customers are more often enterprises, and enterprises often habitually divide each of their departments into a Layer 3 subnet. Therefore, if an enterprise has many departments, it will need to divide into more Layer 3 subnets.

[0003] However, due to the inherent limitations of OpenStack, it is difficult for a Layer 2 tenant network to be divided into more than 25 Layer 3 subnets. Otherwise, it will be unable to distribute the routing information of the Layer 3 subnets to each newly created virtual machine, which will bring a significant negative user experience to the platform. Summary of the Invention

[0004] To address at least one of the above technical problems, embodiments of the present invention provide a method, apparatus, medium, and device for distributing multi-subnet routing information.

[0005] According to a first aspect, the multi-subnet routing information distribution method provided in this embodiment of the invention is executed by an OpenStack platform, and the method includes:

[0006] Create a Tier 2 tenant network for users;

[0007] Based on user needs, the Layer 2 tenant network is divided into multiple Layer 3 subnets;

[0008] Create at least one virtual machine in each of the plurality of three-layer subnets;

[0009] For any virtual machine's IP address request, an IP address is assigned to the virtual machine based on the set of IP addresses corresponding to the Layer 3 subnet to which the virtual machine belongs;

[0010] Determine the total length of routing information for all Layer 3 networks other than the Layer 3 subnet to which the virtual machine belongs; if the total length is greater than or equal to a length threshold, divide the routing information of the other Layer 3 networks into multiple data segments, and the length of each data segment is less than the length threshold; wherein, the length threshold is an upper limit value for the length of data segments used to indicate errors and discard data segments.

[0011] Based on the IP address and the various data segments of the routing information of the other Layer 3 networks, a data packet is generated and returned to the virtual machine to realize the distribution of multi-subnet routing information.

[0012] In one embodiment, the OpenStack platform is deployed with control nodes, compute nodes, and network nodes; wherein the control nodes are used to provide management support services, the compute nodes are used to provide cloud computing services, and the network nodes are used to provide network services.

[0013] In one embodiment, creating a Tier 2 tenant network for users includes:

[0014] For users logging into the control node, a network creation page is provided, enabling the users to perform operations on the network creation page such as creating a Layer 2 tenant network, creating a corresponding route for the Layer 2 tenant network, and creating a corresponding subnet resource pool for the Layer 2 tenant network; wherein, the subnet resource pool includes the IP address range covered by the Layer 2 tenant network.

[0015] In one embodiment, dividing the Layer 2 tenant network into multiple Layer 3 subnets according to user needs includes:

[0016] For users logging into the control node, a partitioning page is provided, allowing the user to select the Layer 2 tenant network on the partitioning page. Based on the user's needs, the selected Layer 2 tenant network is divided into multiple Layer 3 subnets. An IP address set is automatically assigned to each Layer 3 subnet, and one IP address from each Layer 3 subnet's IP address set is placed into the routing. The IP address sets corresponding to the multiple Layer 3 subnets belong to the subnet resource pool corresponding to the selected Layer 2 tenant network.

[0017] In one embodiment, creating at least one virtual machine in each of the plurality of Layer 3 subnets includes:

[0018] For users who log in to the control node, a virtual machine creation page is provided, allowing the user to select a Layer 3 subnet on the virtual machine creation page, create a corresponding port for the selected Layer 3 subnet, and create at least one corresponding virtual machine for the port, thus obtaining at least one virtual machine corresponding to the selected Layer 3 subnet.

[0019] In one embodiment, the network node has a first component and a second component, wherein...

[0020] The first component is used to: determine whether the total length is greater than or equal to a length threshold; if the total length is greater than or equal to the length threshold, divide the routing information of the other three-layer networks into multiple data segments, and the length of each data segment is less than the length threshold, and send each data segment to the second component;

[0021] The second component is used to: if each data segment is less than the length threshold, then encapsulate the data packet according to the IP address and the routing information of the other Layer 3 networks, and return the data packet to the virtual machine;

[0022] The source code of the first component and the source code of the second component are modified according to the RFC3396 standard document, and the first component and the second component implement their respective processing logic; the RFC3396 standard document is a long option encoding standard document based on the Dynamic Host Configuration Protocol.

[0023] In one embodiment, the virtual machine is used to: send a DHCP discovery broadcast packet through a corresponding port during the startup phase;

[0024] Correspondingly, the first component is used to: before determining whether the total length is greater than or equal to the length threshold, listen to each port; if a port sends the DHCP discovery broadcast packet, determine the Layer 3 subnet to which the virtual machine that sent the DHCP discovery broadcast packet belongs, and determine the total length of the routing information of each other Layer 3 network except the Layer 3 subnet to which the virtual machine belongs.

[0025] The virtual machine is used to: after receiving at least one of the data packets, select a data packet, and then send a response message to the second component that sent the data packet, so that the second component records the IP address assigned to the virtual machine and the MAC address of the virtual machine, and sends an acknowledgment message to the virtual machine;

[0026] The IP address in the data packet selected by the virtual machine is the IP address assigned to the virtual machine. The routing information of the other Layer 3 networks in the selected data packet can be viewed through the console of the virtual machine.

[0027] According to a second aspect, the multi-subnet routing information distribution device provided in this embodiment of the invention is deployed on an OpenStack platform, and the device includes:

[0028] The network creation module is used to create Tier 2 tenant networks for users;

[0029] The subnetting module is used to divide the Layer 2 tenant network into multiple Layer 3 subnets according to user needs;

[0030] The virtual machine creation module is used to create at least one virtual machine in each of the plurality of Layer 3 subnets;

[0031] The IP allocation module is used to allocate an IP address to any virtual machine in response to its IP address request, based on the set of IP addresses corresponding to the Layer 3 subnet to which the virtual machine belongs.

[0032] The data segmentation module is used to determine the total length of routing information for all Layer 3 networks other than the Layer 3 subnet to which the virtual machine belongs; if the total length is greater than or equal to a length threshold, the routing information of the other Layer 3 networks is divided into multiple data segments, and the length of each data segment is less than the length threshold; wherein, the length threshold is an upper limit value for the length of data segments used to indicate errors and discard data segments.

[0033] The message generation module is used to generate data packets based on the IP address and the various data segments of the routing information of the other Layer 3 networks, and return the data packets to the virtual machine to realize the distribution of multi-subnet routing information.

[0034] According to a third aspect, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method provided in the first aspect.

[0035] According to a fourth aspect, the computing device provided in the embodiments of the present invention includes a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method provided in the first aspect.

[0036] The multi-subnet routing information distribution method, apparatus, medium, and device provided in this invention first create a Layer 2 tenant network for the user. Then, according to user needs, the Layer 2 tenant network is divided into multiple Layer 3 subnets. At least one virtual machine (VM) is created in each of the multiple Layer 3 subnets, and an IP address is assigned to each VM. The total length of the routing information for all other Layer 3 networks (excluding the Layer 3 subnet to which the VM belongs) is determined. If the total length is greater than or equal to a length threshold, the routing information for the other Layer 3 networks is divided into multiple data segments, with each data segment having a length less than the length threshold to prevent errors and ensure that data segments are not discarded. Finally, based on the IP address and the data segments of the routing information for the other Layer 3 networks, a data packet is generated and returned to the VM, thereby realizing the distribution of multi-subnet routing information. Because this embodiment of the invention judges the total length of the routing information of the other Layer 3 networks, when it exceeds the length threshold, the routing information of the other Layer 3 networks is cut into multiple data segments, and the length of each data segment is less than the length threshold. This avoids error problems and prevents data segment dropping. Therefore, the method provided by this embodiment of the invention can divide a Layer 2 tenant network into more than 25 Layer 3 subnets, breaking through the limitation on the number of Layer 3 subnets in the native OpenStack platform, improving user experience, improving the data plane performance of the OpenStack platform, and improving the performance of the public cloud platform and the user experience of cloud services without affecting normal network services. Attached Figure Description

[0037] Figure 1 This is a flowchart illustrating a method for distributing multi-subnet routing information in one embodiment of the present invention.

[0038] Figure 2 This is a structural block diagram of a multi-subnet routing information distribution device according to an embodiment of the present invention. Detailed Implementation

[0039] In a first aspect, embodiments of the present invention provide a method for distributing multi-subnet routing information, the method being executed by the OpenStack platform, see [link to relevant documentation]. Figure 1 The method includes the following steps S110 to S160:

[0040] S110, Create a Tier 2 tenant network for users;

[0041] In specific scenarios, the OpenStack platform can be deployed in DVR mode, meaning the OpenStack platform can have control nodes, compute nodes, and network nodes deployed. The control nodes provide management support services, the compute nodes provide cloud computing services, and the network nodes provide network services. DVR mode refers to Distributed Virtual Router mode.

[0042] For example, set up one control node, two compute nodes, and two network nodes.

[0043] OpenStack is an open-source cloud computing management platform project that combines several main components to provide cloud computing services. Each component can be understood as a collection of open-source software projects, with virtual machines serving as the network component in the OpenStack platform to provide network services to users.

[0044] Based on the OpenStack platform described above, the S110 can specifically include:

[0045] For users logging into the control node, a network creation page is provided, enabling the users to perform operations on the network creation page such as creating a Layer 2 tenant network, creating a corresponding route for the Layer 2 tenant network, and creating a corresponding subnet resource pool for the Layer 2 tenant network; wherein, the subnet resource pool includes the IP address range covered by the Layer 2 tenant network.

[0046] In other words, after logging into the control node, users can see the network creation page provided by the control node, and then perform the operation of creating a Layer 2 tenant network on the network creation page. Then, a route is created for the Layer 2 tenant network, and a subnet resource pool is created for the Layer 2 tenant network, so that the subnet segments can be automatically allocated when creating a Layer 3 subnet later.

[0047] S120. Based on user needs, the Layer 2 tenant network is divided into multiple Layer 3 subnets;

[0048] For example, if a company has 100 departments, and each department corresponds to a Tier 3 subnet, then the Tier 2 tenant network is divided into 100 Tier 3 subnets.

[0049] In one embodiment, dividing the Layer 2 tenant network into multiple Layer 3 subnets according to user needs may include:

[0050] For users logging into the control node, a partitioning page is provided, allowing the user to select the Layer 2 tenant network on the partitioning page. Based on the user's needs, the selected Layer 2 tenant network is divided into multiple Layer 3 subnets. An IP address set is automatically assigned to each Layer 3 subnet, and one IP address from each Layer 3 subnet's IP address set is placed into the routing. The IP address sets corresponding to the multiple Layer 3 subnets belong to the subnet resource pool corresponding to the selected Layer 2 tenant network.

[0051] In other words, after logging into the control node, users can see the partitioning page. On this page, users enter the number N of Layer 3 subnets, and the Layer 2 tenant network will be divided into N Layer 3 subnets. Furthermore, the OpenStack platform selects a subnet segment from the subnet resource pool for each Layer 3 subnet; that is, it assigns a set of IP addresses to each Layer 3 subnet, ensuring that the IP address sets of different Layer 3 subnets do not overlap. Then, each Layer 3 subnet is added to the routing table; specifically, one IP address from each Layer 3 subnet's IP address set is added to the routing table.

[0052] S130. Create at least one virtual machine in each of the plurality of three-layer subnets;

[0053] In one embodiment, the creation of at least one virtual machine in each of the plurality of Layer 3 subnets in S130 may specifically include: providing a virtual machine creation page for users who log in to the control node, allowing the users to select a Layer 3 subnet on the virtual machine creation page, creating a corresponding port for the selected Layer 3 subnet, and creating at least one corresponding virtual machine for the port, thereby obtaining at least one virtual machine corresponding to the selected Layer 3 subnet.

[0054] For example, after logging into the control node, users can see the virtual machine creation page. On the virtual machine creation page, users can select the Layer 3 subnet corresponding to their department, then create the corresponding port for the selected Layer 3 subnet, and then create 10 virtual machines for that port.

[0055] S140. For any virtual machine's IP address request, assign an IP address to the virtual machine based on the set of IP addresses corresponding to the Layer 3 subnet to which the virtual machine belongs;

[0056] For example, if a department has 10 employees, it is necessary to create 10 virtual machines in the corresponding Layer 3 subnet of the department. For each virtual machine, an IP address request is generated, and then an IP address is assigned to each virtual machine. The IP address comes from the IP address set of the corresponding Layer 3 subnet of the department.

[0057] S150. Determine the total length of routing information for all Layer 3 networks other than the Layer 3 subnet to which the virtual machine belongs; if the total length is greater than or equal to a length threshold, divide the routing information of the other Layer 3 networks into multiple data segments, and the length of each data segment is less than the length threshold; wherein, the length threshold is an upper limit value for the length of a data segment used to indicate an error and discard the data segment.

[0058] In other words, if the total length of the routing information of all other Layer 3 networks besides the Layer 3 subnet to which the virtual machine belongs is greater than or equal to the length threshold, the routing information of the other Layer 3 networks will be segmented into multiple data segments. Each data segment is less than the length threshold, which will not cause an error and will not result in the routing information being discarded.

[0059] S160. Based on the IP address and the data segments of the routing information of the other Layer 3 networks, generate a data packet and return the data packet to the virtual machine to realize the distribution of multi-subnet routing information.

[0060] In other words, the data packet includes the IP address assigned to the virtual machine and the routing information of each of the other Layer 3 subnets besides the Layer 3 subnet mentioned by the virtual machine. After the data packet is sent to the virtual machine, the routing information of multiple Layer 3 subnets is distributed.

[0061] In one embodiment, the network node may have a first component and a second component, wherein...

[0062] The first component is used to: determine whether the total length is greater than or equal to a length threshold; if the total length is greater than or equal to the length threshold, divide the routing information of the other three-layer networks into multiple data segments, and the length of each data segment is less than the length threshold, and send each data segment to the second component;

[0063] The second component is used to: if each data segment is less than the length threshold, then encapsulate the data packet according to the IP address and the routing information of the other Layer 3 networks, and return the data packet to the virtual machine;

[0064] The source code of the first component and the source code of the second component are modified according to the RFC3396 standard document, and the first component and the second component implement their respective processing logic; the RFC3396 standard document is a long option encoding standard document based on the Dynamic Host Configuration Protocol.

[0065] For example, the first component is the neutron-dhcp-agent component, and the second component is the Dnsmasq component. For example, the default length can be 255 bytes.

[0066] For example, if the neutron-dhcp-agent component detects that the total length exceeds 255 bytes, it will segment the routing information of the other Layer 3 networks into multiple data segments, each segment being less than 255 bytes in length. Each data segment will then be sent to the Dnsmasq component. Upon receiving each data segment, the Dnsmasq component will not trigger an error because the segment length is less than 255 bytes, and therefore will not discard the received data segment. The Dnsmasq component will encapsulate the data segments corresponding to the IP address assigned to the virtual machine and the routing information of the other Layer 3 networks into a data packet, also known as a DHCPOFFER message, and then return the DHCPOFFER message to the virtual machine.

[0067] In order to enable the first and second components to have the above logic, the source code of the first and second components can be modified according to the RFC3396 standard document, so that the modified first and second components can each implement the above processing logic.

[0068] Among them, RFC3396 is a standard document for encoding long options in the Dynamic Host Configuration Protocol (DHCPv4) Author(s).

[0069] In one embodiment, the virtual machine is used to: send a DHCP discovery broadcast packet through a corresponding port during the startup phase;

[0070] Correspondingly, the first component is used to: before determining whether the total length is greater than or equal to the length threshold, listen to each port; if a port sends the DHCP discovery broadcast packet, determine the Layer 3 subnet to which the virtual machine that sent the DHCP discovery broadcast packet belongs, and determine the total length of the routing information of each other Layer 3 network except the Layer 3 subnet to which the virtual machine belongs.

[0071] The virtual machine is used to: after receiving at least one of the data packets, select a data packet, and then send a response message to the second component that sent the data packet, so that the second component records the IP address assigned to the virtual machine and the MAC address of the virtual machine, and sends an acknowledgment message to the virtual machine;

[0072] The IP address in the data packet selected by the virtual machine is the IP address assigned to the virtual machine. The routing information of the other Layer 3 networks in the selected data packet can be viewed through the console of the virtual machine.

[0073] In other words, after a virtual machine (VM) is created and started, it sends DHCP discovery broadcast packets through its corresponding port. The first component listens on the ports of each Layer 3 subnet. When it detects a DHCP discovery broadcast packet, it determines the Layer 3 subnet of the VM sending the packet and the total length of routing information for all other Layer 3 subnets. The first component checks this total length; if it exceeds a length threshold, it segments the routing information for all other Layer 3 subnets into multiple data segments. Each segment is then sent to the second component. Since each segment's length is below the threshold, the second component does not trigger an error and therefore does not discard the segments. The second component encapsulates the assigned IP address for the VM and the routing information for all other Layer 3 subnets into a DHCPOFFER message, which it then sends to the VM. In real-world scenarios, there might be a situation where multiple first and second components exist. In this case, the virtual machine (VM) will receive DHCPOFFER messages from multiple second components. Therefore, the VM needs to select one DHCPOFFER message from these multiple messages and then send a response to the second component that sent the message. The second component that sent the message will then record the IP address and MAC address assigned to the VM. After recording, the second component will send a confirmation message back to the VM to indicate that the IP address and MAC address have been recorded.

[0074] After logging into the control node, users can view the compute node where the virtual machine is located, and then log into the compute node where the virtual machine is located. After logging in, they can enter the virtual machine's console and view the routing table corresponding to the virtual machine. This routing table records the routing information of the other Layer 3 networks.

[0075] For example, for the 100th Layer 3 subnet, a port port1 is created, and then a virtual machine VM1 is created for that port. Based on the method provided in this embodiment of the invention, the user can view the routing information of the first 99 Layer 3 subnets on the console of the virtual machine VM1.

[0076] For example, the first component is the neutron-dhcp-agent component, and the second component is the Dnsmasq component. The purpose of deploying the Dnsmasq component on the network node is to provide DHCP service for the virtual machines created on the compute node, and it is also responsible for sending subnet routing information to the virtual machines on the compute node; the purpose of deploying the neutron-dhcp-agent component on the network node is to manage the Dnsmasq component.

[0077] Dnsmasq is a small and convenient tool for configuring domain names and DHCP, suitable for small networks. It provides DNS functionality and optional DHCP functionality.

[0078] DHCP stands for Dynamic Host Configuration Protocol, a standard protocol defined by RFC 1541. This protocol allows servers to dynamically assign IP addresses and configuration information to clients. Dynamic Host Configuration Protocol is a local area network (LAN) protocol.

[0079] Understandably, the number of subnet routing information sent to virtual machines by the native OpenStack platform is unlikely to exceed 25. This is because when the length of multiple subnet routing information exceeds 255 bytes, the Dnsmasq process will report an error and discard all subnet routing information.

[0080] However, because the total length of the routing information of the other Layer 3 networks is judged in this embodiment of the invention, when it exceeds the length threshold, the routing information of the other Layer 3 networks will be cut into multiple data segments, and the length of each data segment is less than the length threshold. This avoids error problems and prevents data segment dropping. Therefore, the method provided by this embodiment of the invention can divide the Layer 2 tenant network into more than 25 Layer 3 subnets, breaking through the limitation on the number of Layer 3 subnets in the native OpenStack platform, improving user experience, improving the data plane performance of the OpenStack platform, and improving the performance of the public cloud platform and the user experience of cloud services without affecting normal network services.

[0081] Secondly, embodiments of the present invention provide a multi-subnet routing information distribution device, which is deployed on an OpenStack platform, see [link to relevant documentation]. Figure 2 The device 100 includes:

[0082] Network creation module 110 is used to create a Layer 2 tenant network for users;

[0083] The subnetting module 120 is used to divide the Layer 2 tenant network into multiple Layer 3 subnets according to user needs;

[0084] The virtual machine creation module 130 is used to create at least one virtual machine in each of the plurality of three-layer subnets;

[0085] IP allocation module 140 is used to allocate an IP address to any virtual machine in response to its IP address request, based on the set of IP addresses corresponding to the Layer 3 subnet to which the virtual machine belongs;

[0086] The data segmentation module 150 is used to determine the total length of the routing information of each Layer 3 network other than the Layer 3 subnet to which the virtual machine belongs; if the total length is greater than or equal to a length threshold, the routing information of each of the other Layer 3 networks is divided into multiple data segments, and the length of each data segment is less than the length threshold; wherein, the length threshold is an upper limit value of the length used to indicate errors and discard data segments.

[0087] The message generation module 160 is used to generate data packets based on the IP address and the various data segments of the routing information of the other Layer 3 networks, and return the data packets to the virtual machine to realize the distribution of multi-subnet routing information.

[0088] In one embodiment, the OpenStack platform is deployed with control nodes, compute nodes, and network nodes; wherein the control nodes are used to provide management support services, the compute nodes are used to provide cloud computing services, and the network nodes are used to provide network services.

[0089] In one embodiment, the network creation module is specifically used to: provide a network creation page for users logging into the control node, so that the users can perform operations on the network creation page to create a Layer 2 tenant network, create a corresponding route for the Layer 2 tenant network, and create a corresponding subnet resource pool for the Layer 2 tenant network; wherein the subnet resource pool includes the IP address range covered by the Layer 2 tenant network.

[0090] In one embodiment, the subnetting module is specifically used to: provide a subnetting page for users logging into the control node, allowing the users to select the Layer 2 tenant network on the subnetting page; divide the selected Layer 2 tenant network into multiple Layer 3 subnets according to user needs; automatically assign an IP address set to each Layer 3 subnet; and put one IP address from the IP address set of each Layer 3 subnet into the routing; wherein, each IP address set corresponding to the multiple Layer 3 subnets belongs to the subnet resource pool corresponding to the selected Layer 2 tenant network.

[0091] In one embodiment, the virtual machine creation module is specifically used to: provide a virtual machine creation page for users who log in to the control node, so that the users can select a three-layer subnet on the virtual machine creation page, create a corresponding port for the selected three-layer subnet, and create at least one corresponding virtual machine for the port, thereby obtaining at least one virtual machine corresponding to the selected three-layer subnet.

[0092] In one embodiment, the network node has a first component and a second component, wherein...

[0093] The first component is used to: determine whether the total length is greater than or equal to a length threshold; if the total length is greater than or equal to the length threshold, divide the routing information of the other three-layer networks into multiple data segments, and the length of each data segment is less than the length threshold, and send each data segment to the second component;

[0094] The second component is used to: if each data segment is less than the length threshold, then encapsulate the data packet according to the IP address and the routing information of the other Layer 3 networks, and return the data packet to the virtual machine;

[0095] The source code of the first component and the source code of the second component are modified according to the RFC3396 standard document, and the first component and the second component implement their respective processing logic; the RFC3396 standard document is a long option encoding standard document based on the Dynamic Host Configuration Protocol.

[0096] In one embodiment, the virtual machine is used to: send a DHCP discovery broadcast packet through a corresponding port during the startup phase; correspondingly, the first component is used to: listen to each port before determining whether the total length is greater than or equal to the length threshold; if a port sends the DHCP discovery broadcast packet, determine the Layer 3 subnet to which the virtual machine sending the DHCP discovery broadcast packet belongs, and determine the total length of the routing information of each other Layer 3 network besides the Layer 3 subnet to which the virtual machine belongs; the virtual machine is used to: after receiving at least one of the data packets, select a data packet, and then send a response packet back to the second component that sent the data packet, so that the second component records the IP address assigned to the virtual machine and the MAC address of the virtual machine, and sends an acknowledgment message back to the virtual machine; wherein, the IP address in the data packet selected by the virtual machine is the IP address assigned to the virtual machine, and the routing information of each other Layer 3 network in the selected data packet can be viewed through the console of the virtual machine.

[0097] It is understood that explanations of the contents, specific implementation methods, beneficial effects, examples, etc. in the system provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0098] Thirdly, embodiments of the present invention provide a computer-readable medium storing computer instructions, which, when executed by a processor, cause the processor to perform the method provided in the first aspect.

[0099] Specifically, a system or apparatus equipped with a storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer (or CPU or MPU) of the system or apparatus may read and execute the program code stored in the storage medium.

[0100] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.

[0101] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0102] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0103] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion module connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion module execute some and all of the actual operations, thereby realizing the function of any of the above embodiments.

[0104] It is understood that explanations, specific implementation methods, beneficial effects, examples, etc. of the contents in the computer-readable medium provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0105] Fourthly, one embodiment of this specification provides a computing device including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method of any embodiment of the specification.

[0106] It is understood that explanations, specific implementation methods, beneficial effects, examples, etc. of the computing device provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0107] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0108] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, widgets, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0109] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for distributing multi-subnet routing information, characterized in that, The method is executed by an OpenStack platform, and the method comprises: creating a Layer 2 tenant network for a user; dividing the Layer 2 tenant network into a plurality of Layer 3 subnets according to user requirements; creating at least one virtual machine in each of the plurality of Layer 3 subnets; for an IP address request of any one virtual machine, allocating an IP address to the virtual machine according to an IP address set corresponding to the Layer 3 subnet to which the virtual machine belongs; determining the total length of routing information of each Layer 3 network other than the Layer 3 subnet to which the virtual machine belongs; if the total length is greater than or equal to a length threshold, dividing the routing information of the each Layer 3 network into a plurality of data segments, and the length of each data segment is less than the length threshold; wherein the length threshold is an upper limit of the length of a data segment that prompts an error and discards the data segment; generating a data packet according to the IP address and each data segment of the routing information of the each Layer 3 network, and returning the data packet to the virtual machine to implement the delivery of multi-subnet routing information.

2. The method of claim 1, wherein, The OpenStack platform is deployed with a control node, a computing node and a network node; wherein the control node is used to provide management support services, the computing node is used to provide cloud computing services, and the network node is used to provide network services.

3. The method of claim 2, wherein, The method for creating a Layer 2 tenant network for a user comprises: for a user logged into the control node, providing a network creation page to enable the user to perform operations of creating a Layer 2 tenant network on the network creation page, perform operations of creating corresponding routing for the Layer 2 tenant network, and perform operations of creating a corresponding subnet resource pool for the Layer 2 tenant network; wherein the subnet resource pool includes an IP address range covered by the Layer 2 tenant network.

4. The method of claim 3, wherein, The method for dividing the Layer 2 tenant network into a plurality of Layer 3 subnets according to user requirements comprises: for a user logged into the control node, providing a division page to enable the user to select the Layer 2 tenant network on the division page, divide the selected Layer 2 tenant network into a plurality of Layer 3 subnets according to user requirements, automatically allocate an IP address set to each Layer 3 subnet, and put an IP address in the IP address set of each Layer 3 subnet into the routing; wherein each IP address set corresponding to the plurality of Layer 3 subnets belongs to a subnet resource pool corresponding to the selected Layer 2 tenant network.

5. The method of claim 4, wherein, The method for creating at least one virtual machine in each of the plurality of Layer 3 subnets comprises: for a user logged into the control node, providing a virtual machine creation page to enable the user to select a Layer 3 subnet on the virtual machine creation page, create a corresponding port for the selected Layer 3 subnet, create at least one corresponding virtual machine for the port, and obtain at least one virtual machine corresponding to the selected Layer 3 subnet.

6. The method of claim 5, wherein, The network node has a first component and a second component, wherein The first component is configured to determine whether the total length is greater than or equal to a length threshold, and if the total length is greater than or equal to the length threshold, divide the routing information of the other three-layer networks into a plurality of data segments, each data segment having a length less than the length threshold, and send each data segment to the second component; The second component is configured to, if each data segment is less than the length threshold, encapsulate the data packet according to the IP address and the routing information of the other three-layer networks, and return the data packet to the virtual machine; The source code of the first component and the source code of the second component are modified according to an RFC3396 standard document, and the first component and the second component implement respective processing logic.

7. The method of claim 6, wherein, The virtual machine is configured to send a DHCP discovery broadcast packet through a corresponding port in a starting stage. Correspondingly, the first component is configured to, before the determination of whether the total length is greater than or equal to the length threshold, listen to each port, and if the DHCP discovery broadcast packet is listened to from a port, determine a three-layer subnet to which a virtual machine sending the DHCP discovery broadcast packet belongs, and determine the total length of the routing information of the other three-layer networks except the three-layer subnet to which the virtual machine belongs. The virtual machine is configured to, after receiving at least one data packet, select a data packet, and then feed back a response packet to the second component sending the data packet, so that the second component records an IP address allocated to the virtual machine and a MAC address of the virtual machine, and feeds back confirmation information to the virtual machine. The IP address in the data packet selected by the virtual machine is the IP address allocated to the virtual machine, and the routing information of the other three-layer networks in the selected data packet can be viewed through a console of the virtual machine.

8. A multi-subnet routing information distribution apparatus, characterized by comprising: The device is deployed on an OpenStack platform, and the device comprises: A network creation module configured to create a two-layer tenant network for a user; A subnet division module configured to divide the two-layer tenant network into a plurality of three-layer subnets according to user requirements; A virtual machine creation module configured to create at least one virtual machine in each of the plurality of three-layer subnets; An IP allocation module configured to, for an IP address request of any virtual machine, allocate an IP address to the virtual machine according to an IP address set corresponding to a three-layer subnet to which the virtual machine belongs; A data segmentation module configured to determine a total length of routing information of the other three-layer networks except the three-layer subnet to which the virtual machine belongs, divide the routing information of the other three-layer networks into a plurality of data segments if the total length is greater than or equal to a length threshold, and each data segment has a length less than the length threshold, wherein the length threshold is an upper limit value of the length for prompting an error and discarding a data segment. The packet generation module is configured to generate a data packet according to the IP address and each data segment of the routing information of each of the other three-layer networks, and return the data packet to the virtual machine to implement the distribution of the multi-subnet routing information.

9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer readable medium, and when the computer program is executed in the computer, the computer program causes the computer to execute the method of any one of claims 1-7.

10. A computing device, comprising: A computer readable medium comprises a memory and a processor, the memory stores executable code, and the processor executes the executable code to implement the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Tenant dividing method in SDN network, device and SDN network system

    CN106559338A

  • Bandwidth Control in Multi-Tenant Virtual Networks

    US20150040121A1