An IPv6 subnet prefix announcement implementation method, device, equipment and storage medium
By adding an IPv6 subnet prefix advertiser to the server controller to handle virtual machine routing requests and send responses, the problem of long cross-node access paths for virtual machines is solved, IPv6 address configuration efficiency is improved, and server resources are saved.
Patent Information
- Application Number
- CN202211328845.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-27
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2042-10-27
AI Technical Summary
In an OpenStack cloud network environment, when virtual machines need to obtain IPv6 addresses and related information through the radvd process, the cross-compute node access path becomes long, the number of processes becomes excessive, server resources are consumed, and efficiency is low.
Add an IPv6 subnet prefix advertiser to the server controller to obtain the subnet information corresponding to the virtual machine port and add it to the cache list. Process routing requests based on the cache list and send routing responses directly to improve efficiency.
By reducing the number of virtual machine cross-node access paths, the number of radvd processes was reduced, improving the efficiency of obtaining and configuring IPv6 addresses and related information, and saving server resources.
Smart Images

Figure CN115695374B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, and particularly relates to an IPv6 subnet prefix announcement implementation method and device, equipment and a storage medium. BACKGROUND
[0002] With the continuous development of cloud platform network technology, in the current open source cloud computing management platform project OpenStack (referred to as cloud platform), a virtual machine needs to learn the configuration mode of an IPv6 address of a virtual machine port (referred to as port, tap port or virtual machine network card) through an IPv6 neighbor discovery protocol (NDP), learn host subnet routing and obtain an IPv6 information acquisition mode.
[0003] Specifically, in an OpenStack cloud network environment, each virtual private cloud (VPC) starts a router advertisement daemon (radvd), and sends and responds to IPv6 subnet prefix information through the radvd. The radvd is an IPv6 route advertisement daemon, which is responsible for listening to IPv6 router requests and sending IPv6 route advertisements. The information of these IPv6 route advertisements contains relevant flag bits, and a virtual machine can automatically configure its IPv6 address and other parameters (such as an IPv6 address acquisition mode, a host domain name system (DNS) acquisition mode, etc.) according to the flag bits. The virtual machine can also set a default route according to the IPv6 route advertisements.
[0004] In the above method, since the virtual machine needs to obtain the IPv6 route advertisement through the radvd process to configure the IPv6 address, the virtual machine and the radvd process are deployed on different computing nodes, the virtual machine needs to access across the computing nodes, and the path of the virtual machine responding to and announcing the IPv6 route information is relatively long. Moreover, in the process of implementing the IPv6 address configuration of the virtual machine, a radvd process needs to be started after a VPC is started, the number of radvd processes is too large, and the radvd processes exist for a long time, which consumes server CPU and memory resources. Therefore, the efficiency of the virtual machine obtaining the IPv6 address and related information and performing configuration is low. SUMMARY
[0005] The application provides an IPv6 subnet prefix announcement implementation method and device, equipment and a storage medium, which are used for improving the efficiency of virtual machines in acquiring IPv6 addresses and related information and in configuration.
[0006] To achieve the above object, the application adopts the following technical scheme.
[0007] In a first aspect, an IPv6 subnet prefix announcement implementation method is provided. The method comprises: adding an IPv6 subnet prefix announcer in a controller of a server; obtaining a plurality of subnet information corresponding to a plurality of virtual machine ports in the server, and adding the plurality of subnet information to a subnet cache list, one virtual machine port corresponding to one subnet information, each subnet information comprising at least one of the following: a virtual machine port IP address, a virtual machine port subnet prefix, a virtual machine IPv6 address acquisition mode, and a flag bit; when a target registration event is listened to by the IPv6 subnet prefix announcer, receiving a route request RS sent by a target virtual machine; determining a route response RA corresponding to the route request RS based on the subnet cache list, and sending the route response RA to the target virtual machine through the controller of the server, the route response RA being used for the target virtual machine to acquire an IPv6 address, the route response RA comprising an IPv6 subnet prefix.
[0008] In a possible implementation, the method further comprises: adding a target flow table on an integrated network bridge of the server, the target flow table comprising at least one of the following: a virtual machine port identifier, a source MAC address, an ICMPv6 protocol, and a route request RS corresponding message protocol number, the target flow table being used for sending the route request RS sent by the target virtual machine to the controller of the server.
[0009] In a possible implementation, before receiving the route request RS sent by the target virtual machine when the target registration event is listened to by the IPv6 subnet prefix announcer, the method further comprises: based on the target flow table, sending the route request RS sent by the target virtual machine to the controller of the server.
[0010] In a possible implementation, the method further comprises: when the target registration event is not listened to by the IPv6 subnet prefix announcer, based on the subnet cache list, sending a route response RA to the plurality of virtual machines every interval of a preset time length.
[0011] In a possible implementation, the method further comprises: when a first virtual machine is added in the server, determining subnet information corresponding to the first virtual machine, and adding the subnet information corresponding to the first virtual machine to the subnet cache list through the IPv6 subnet prefix announcer; when a second virtual machine in the server is deleted, deleting the subnet information corresponding to the second virtual machine from the subnet cache list through the IPv6 subnet prefix announcer.
[0012] In a second aspect, an IPv6 subnet prefix advertisement implementation device is provided, which comprises a processing unit, an obtaining unit and a transmission unit. The processing unit is configured to add an IPv6 subnet prefix announcer in a controller of a server. The obtaining unit is configured to obtain a plurality of subnet information corresponding to a plurality of virtual machine ports in the server. The processing unit is further configured to add the plurality of subnet information into a subnet cache list, one subnet information corresponding to one virtual machine port, and each subnet information comprising at least one of a virtual machine port IP address, a virtual machine port subnet prefix, a virtual machine IPv6 address obtaining mode and a flag bit. The transmission unit is configured to receive a route solicitation (RS) sent by a target virtual machine when a target registration event is detected by the IPv6 subnet prefix announcer. The processing unit is further configured to determine a route advertisement (RA) corresponding to the RS based on the subnet cache list. The transmission unit is further configured to send the RA to the target virtual machine through the controller of the server, the RA being used by the target virtual machine to obtain an IPv6 address, and the RA comprising an IPv6 subnet prefix.
[0013] In a possible implementation, the processing unit is further configured to add a target flow table on an integrated network bridge of the server, the target flow table comprising at least one of a virtual machine port identifier, a source MAC address, an ICMPv6 protocol and a message protocol number corresponding to the RS, and the target flow table being used to send the RS sent by the target virtual machine to the controller of the server.
[0014] In a possible implementation, the transmission unit is further configured to send the RS sent by the target virtual machine to the controller of the server based on the target flow table.
[0015] In a possible implementation, the transmission unit is further configured to send the RA to the plurality of virtual machines at a preset interval based on the subnet cache list when the target registration event is not detected by the IPv6 subnet prefix announcer.
[0016] In a possible implementation, the processing unit is further configured to determine subnet information corresponding to a first virtual machine when the first virtual machine is added in the server, and add the subnet information corresponding to the first virtual machine into the subnet cache list through the IPv6 subnet prefix announcer. The processing unit is further configured to delete subnet information corresponding to a second virtual machine from the subnet cache list through the IPv6 subnet prefix announcer when the second virtual machine is deleted in the server.
[0017] In a third aspect, an electronic device includes a processor and a memory. The memory is configured to store one or more programs including computer-executable instructions. When the electronic device is running, the processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the method for implementing IPv6 subnet prefix advertisement according to the first aspect.
[0018] In a fourth aspect, a computer-readable storage medium storing one or more programs is provided. The one or more programs include instructions that, when executed by a computer, cause the computer to perform the method for implementing IPv6 subnet prefix advertisement according to the first aspect.
[0019] The present application provides a method, device and storage medium for implementing IPv6 subnet prefix advertisement, which is applied to a scenario where a virtual machine obtains IPv6 address and related information and is configured. When the virtual machine needs to obtain IPv6 address and related information and is configured, an IPv6 subnet prefix advertiser can be added in a controller of a server. Further, a plurality of subnet information corresponding to a plurality of virtual machine ports in the server is obtained, and the plurality of subnet information is added to a subnet cache list. When a target registration event is listened to by the IPv6 subnet prefix advertiser, a route solicitation (RS) sent by a target virtual machine corresponding to the target registration event is received. Then, a route advertisement (RA) including an IPv6 subnet prefix corresponding to the RS is determined based on the subnet cache list, and the RA for the target virtual machine to obtain the IPv6 address is sent to the target virtual machine through the controller of the server, so that the target virtual machine obtains the IPv6 address based on the RA. Through the above method, when the virtual machine needs to obtain IPv6 address and related information and is configured, the RA corresponding to the RS sent by the target virtual machine can be determined based on the subnet cache list, and the RA for the target virtual machine to obtain the IPv6 address is sent to the target virtual machine through the controller of the server. Thus, the problem that the virtual machine needs to access IPv6 routing information across computing nodes, resulting in a long path for the virtual machine to respond to and advertise IPv6 routing information, is solved. Therefore, the efficiency of the virtual machine to obtain IPv6 address and related information and be configured is improved. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 A traffic path diagram for a virtual machine to obtain IPv6 address and related information is provided for an embodiment of the present application.
[0021] Figure 2 A specific flow diagram for a virtual machine to obtain IPv6 address and related information is provided for an embodiment of the present application.
[0022] Figure 3A schematic diagram of the structure of an IPv6 subnet prefix advertisement implementation system provided for an embodiment of this application;
[0023] Figure 4 A flowchart illustrating an IPv6 subnet prefix advertisement implementation method provided in this application. Figure 1 ;
[0024] Figure 5 A flowchart illustrating an IPv6 subnet prefix advertisement implementation method provided for embodiments of this application. Figure 2 ;
[0025] Figure 6 A flowchart illustrating an IPv6 subnet prefix advertisement implementation method provided in this application. Figure 3 ;
[0026] Figure 7 A flowchart illustrating an IPv6 subnet prefix advertisement implementation method provided in this application. Figure 4 ;
[0027] Figure 8 A flowchart illustrating an IPv6 subnet prefix advertisement implementation method provided in this application. Figure 5 ;
[0028] Figure 9 A schematic diagram illustrating the specific process of an IPv6 subnet prefix advertisement implementation method provided for an embodiment of this application;
[0029] Figure 10 A schematic diagram of the structure of an IPv6 subnet prefix advertisement implementation device provided for an embodiment of this application;
[0030] Figure 11 This is a schematic diagram of an electronic device structure provided for an embodiment of this application. Detailed Implementation
[0031] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0032] In the description of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. "And / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" and "multiple" refer to two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.
[0033] In current cloud platforms, such asFigure 1 As shown, the traffic path for virtual machine to acquire IPv6 address and related information is shown. The virtual machine sends IPv6 Router Solicitation (RS, Type 133) packet to physical network device (switch, router, etc.) through integrated bridge (may be referred to as br-int or Ovs-bridge). The physical network device forwards the IPv6 Router Solicitation (RS) to radvd daemon through integrated bridge. The radvd daemon replies IPv6 Router Advertisement (RA, Type 134) packet for acquiring IPv6 address and related information, and re-sends the IPv6 Router Advertisement (RA) to the virtual machine through the physical network device, wherein the IPv6 Router Advertisement (RA) is used to inform the virtual machine to acquire IPv6 address and the way to configure IPv6 address, the way to acquire other information, and IPv6 address subnet prefix and other information. In the above path, when the virtual machine starts the auxiliary process radvd through the namespace of the virtual router, the RS request sent by the virtual machine reaches the namespace of the virtual router, and the auxiliary process radvd is started through the namespace of the virtual router.
[0034] Specifically, in OpenStack Neutron (Openstack's virtual network service) VPC (subnet under virtual machine network subnet), there are two key attributes ipv6_ra_mode and ipv6_address_mode (both of which can be set to the following three values: Stateless address autoconfiguration (slaac), stateful dynamic host configuration protocol for IPv6 (dhcpv6-), and stateless dynamic host configuration protocol for IPv6 (dhcpv6-stateless)). According to the two key attributes ipv6_ra_mode and ipv6_address_mode, the corresponding radvd configuration can be generated. Through the radvd configuration, the two key attributes control the RA response key flag (Autonumuous Flag and Managed Flag) of radvd, and ultimately affect the IPv6 address of the virtual machine, the IPv6 address configuration mode, and other information configuration mode. Among them, if ipv6_ra_mode is set to a value, it means that the virtual machine uses radvd through OpenStack Neutron to set the IPv6 address; if no value is set, it means that the virtual machine uses an external IPv6 router through non-OpenStack to set the IPv6 address.
[0035] ipv6_address_mod controls three key flag bits (Autonumuous Flag, Managed Flag, Other Flag) in the RA response of radvd by setting the following three values: slaac, dhcpv6-stateful and dhcpv6-stateless. For example, if ipv6_address_mod is set to slaac, A = 1, M = 0, O = 0, which means that the virtual machine uses SLAAC to configure IPv6 address according to the announcement configured by radvd through OpenStack, router; if ipv6_address_mod is set to dhcpv6-stateful, A = 0, M = 1, O = 1, which means that the virtual machine acquires IPv6 address through DHCPv6 and acquires other extended information through DHCPv6; if ipv6_address_mod is set to dhcpv6-stateless, A = 1, M = 0, O = 1, which means that the virtual machine uses SLAAC to configure IPv6 address according to the announcement configured by radvd through OpenStack, router, and acquires other extended information through DHCPv6. The specific settings of ipv6_ra_mode and ipv6_address_mode are shown in Table 1:
[0036] Table 1
[0037]
[0038]
[0039] In the current cloud network environment, after the virtual machine is started, it needs to configure IPv6 related configuration for the virtual network card device according to the VPC related configuration, for example: the way of learning IPv6 address configuration, the way of configuring IPv6 address information, the way of learning and acquiring other information (such as DNS, routing information, gateway information, etc.), and the way of configuring and acquiring other information.
[0040] For example, Figure 2As shown, the specific flow chart of the virtual machine obtaining IPv6 address and related information and configuration is shown. The virtual machine starts to configure the network card and automatically generates IPv6 local link address. Further, the virtual machine sends IPv6 route request RS and receives IPv6 route response RA (containing IPv6 subnet prefix and parameters) through radvd daemon. The virtual machine determines the way of generating IPv6 address according to the Autonumuous Flag of the RA message and generates the link route and gateway of the subnet according to the Autonumuous Flag. If the Autonumuous Flag of the RA message is 1, the virtual machine automatically generates IPv6 address using IPv6 subnet, generates the link route and gateway of the subnet. If the Autonumuous Flag of the RA message is 0, the virtual machine does not generate IPv6 address, generates the link route and gateway of the subnet. The virtual machine determines whether to send DHCPv6 request to obtain IPv6 address and other information, whether to configure the obtained IPv6 address and other information according to the Managed Flag of the RA message. If the Managed Flag of the RA message is 1, the virtual machine sends DHCPv6 request to obtain IPv6 address and other information, configures the obtained IPv6 address and other information. If the Managed Flag of the RA message is 0, the virtual machine determines whether to send DHCPv6 request to obtain other information, whether to configure the obtained other information according to the Other Flag of the RA message. If the Other Flag of the RA message is 1, the virtual machine sends DHCPv6 request to obtain other information, configures the obtained other information. If the Other Flag of the RA message is 0, the virtual machine does not send DHCPv6 request to obtain other information, does not configure the obtained other information.
[0041] In the method for the virtual machine to obtain IPv6 address and related information through the radvd daemon and to perform configuration, the virtual machine needs to obtain IPv6 route advertisement and perform IPv6 address configuration through the radvd process deployed on different computing nodes. Therefore, the virtual machine needs to access IPv6 route information across computing nodes, resulting in a long path for the virtual machine to respond to and advertise IPv6 route information. Moreover, each access of the virtual machine starts a corresponding VPC, and each VPC start needs to start a radvd process. In the entire cloud resource pool, the number of radvd is consistent with the number of VPCs, resulting in too many radvd processes being started. If in a distributed virtual router (DVR) environment, the radvd process also needs to be started again in the namespace of each virtual router of each computing node, and the number of radvd daemon processes is further increased, thereby resulting in low efficiency of the virtual machine to obtain IPv6 address and related information and to perform configuration.
[0042] Meanwhile, in the above method, the related protocol is usually used to interact with the radvd only when the virtual machine needs to configure IPv6 address and related information, and the radvd process exists for a long time, resulting in consumption of server CPU and memory resources. If in a distributed virtual router environment, the radvd process is started throughout the life cycle of the virtual router. Therefore, the virtual router needs to implement a complete process management mechanism for the radvd, thereby increasing management complexity.
[0043] The embodiment of the present application provides an IPv6 subnet prefix announcement implementation method. When a virtual machine needs to obtain an IPv6 address and related information and is configured, an IPv6 subnet prefix announcer can be added in a controller of a server. Further, a plurality of subnet information corresponding to a plurality of virtual machine ports in the server is obtained, and the plurality of subnet information is added to a subnet cache list. When a target registration event is listened to by the IPv6 subnet prefix announcer, a route request RS sent by a target virtual machine corresponding to the target registration event is received. Then, a route response RA including an IPv6 subnet prefix corresponding to the route request RS is determined based on the subnet cache list, and the route response RA used by the target virtual machine to obtain the IPv6 address is sent to the target virtual machine by the controller of the server, so that the target virtual machine obtains the IPv6 address based on the route response RA. Through the above method, when the virtual machine needs to obtain the IPv6 address and related information and is configured, the route response RA corresponding to the route request RS sent by the target virtual machine can be determined based on the subnet cache list, and the route response RA used by the target virtual machine to obtain the IPv6 address is sent to the target virtual machine by the controller of the server. Therefore, the problem that the virtual machine needs to access IPv6 routing information across a computing node, resulting in a long path for the virtual machine to respond to and announce the IPv6 routing information, is solved. Therefore, the efficiency of the virtual machine to obtain the IPv6 address and related information and to be configured is improved.
[0044] The IPv6 subnet prefix announcement implementation method provided by the embodiment of the present application can be applied to an IPv6 subnet prefix announcement implementation system. Figure 3 The structure of the IPv6 subnet prefix announcement implementation system is shown. As shown in Figure 3 The IPv6 subnet prefix announcement implementation system 20 includes a virtual machine 31, an open virtual switch (openvswitch) 32 and a controller (openvswitch-agent) 33. The open virtual switch 32 includes an integrated bridge 321 and a tunnel bridge (br-tun) 322; the integrated bridge 321 includes a tap port; the controller 33 includes an IPv6 subnet prefix announcer (ra_speaker extension plug-in) 331; and the IPv6 subnet prefix announcer 331 includes EventOFPPacketIn and PaketOut.
[0045] The virtual machine 31 is configured to send a route request RS to the integrated bridge 321; the integrated bridge 321 is configured to forward the route request RS to the IPv6 subnet prefix announcer 331 of the controller 33 and forward a route response RA to the virtual machine 31; and the IPv6 subnet prefix announcer 331 of the controller 33 is configured to assemble and send the route response RA to the integrated bridge 321.
[0046] With reference to the accompanying drawings, the IPv6 subnet prefix announcement implementation method provided by the embodiments of the present application is described below. As shown in Figure 4 The IPv6 subnet prefix announcement implementation method provided by the embodiments of the present application includes S201-S204.
[0047] S201, an Internet Protocol version 6 (IPv6) subnet prefix announcer is added in a controller of a server.
[0048] It should be noted that the controller is an open virtual switch (openvswitch-agent) on the server, and the openvswitch-agent can be a process running on the server. The IPv6 subnet prefix announcer can be a software device on the controller of the server.
[0049] S202, a plurality of subnet information corresponding to a plurality of virtual machine ports in the server is obtained, and the plurality of subnet information is added to a subnet cache list.
[0050] Each subnet information includes at least one of the following: a virtual machine port IP address, a virtual machine port subnet prefix, a virtual machine IPv6 address obtaining mode, and a flag bit.
[0051] It can be understood that when the IPv6 subnet prefix announcer is initialized, all subnet information corresponding to all virtual machine ports in the server can be obtained through a resource cache Remote Procedure Call (RPC), and all subnet information is added to the subnet cache list.
[0052] It should be noted that the resource cache RPC is a method provided by OpenStack Neutron.
[0053] S203, when a target registration event is listened to by the IPv6 subnet prefix announcer, a route request (RS) sent by a target virtual machine is received.
[0054] It can be understood that the IPv6 subnet prefix announcer can listen to the target registration event through EventOFPPacketIn, and when the target registration event is listened to, the RS sent by the target virtual machine is received.
[0055] Optionally, the target registration event can be the RS sent by the target virtual machine.
[0056] It should be noted that EventOFPPacketIn is a function of the IPv6 subnet prefix announcer.
[0057] S204, determine a route reply RA corresponding to the route request RS based on the subnet cache list, and send the route reply RA to the target virtual machine through the controller of the server.
[0058] The route reply RA is used for the target virtual machine to obtain an IPv6 address, and the route reply RA includes an IPv6 subnet prefix.
[0059] It can be understood that the IPv6 subnet prefix announcer can assemble the route reply RA corresponding to the route request RS based on the subnet information corresponding to the target virtual machine sending the route request RS in the subnet cache list, and send the route reply RA to the target virtual machine through the PaketOut mechanism on the controller of the server.
[0060] It should be noted that the PaketOut mechanism is a function of the controller.
[0061] The present application provides an IPv6 subnet prefix announcement implementation method, which is applied to the scene of virtual machines obtaining IPv6 addresses and related information and being configured. When the virtual machines need to obtain IPv6 addresses and related information and be configured, an IPv6 subnet prefix announcer can be added in the controller of the server. Further, a plurality of subnet information corresponding to a plurality of virtual machine ports in the server is obtained, and the plurality of subnet information is added to a subnet cache list. When a target registration event is listened to by the IPv6 subnet prefix announcer, a route request RS sent by a target virtual machine corresponding to the target registration event is received. Then, a route reply RA including an IPv6 subnet prefix corresponding to the route request RS is determined based on the subnet cache list, and the route reply RA for the target virtual machine to obtain the IPv6 address is sent to the target virtual machine through the controller of the server, so that the target virtual machine obtains the IPv6 address based on the route reply RA. Through the above method, when the virtual machines need to obtain IPv6 addresses and related information and be configured, the route reply RA corresponding to the route request RS sent by the target virtual machine can be determined based on the subnet cache list, and the route reply RA for the target virtual machine to obtain the IPv6 address is sent to the target virtual machine through the controller of the server. Thus, the problem that the virtual machines need to access IPv6 routing information across computing nodes, resulting in a long path for the virtual machines to respond to and announce IPv6 routing information, is solved. Therefore, the efficiency of the virtual machines obtaining IPv6 addresses and related information and being configured is improved.
[0062] In one design, as shown in FIG. 1, Figure 5 The IPv6 subnet prefix announcement implementation method provided by the embodiment of the present application further includes S301:
[0063] S301, a target flow table is added on an integrated network bridge of a server.
[0064] The target flow table includes at least one of the following: a virtual machine port identifier, a source MAC address, an ICMPv6 protocol, and a message protocol number corresponding to the route request RS, and is used to send the route request RS sent by the target virtual machine to the controller of the server.
[0065] Optionally, the matching rule of the target flow table includes a virtual machine port identifier, a source MAC address, an ICMPv6 protocol, and a message protocol number (for example, 133) corresponding to the route request RS.
[0066] For example, the matching information of the route request RS on the target flow table is: icmp6, in_port="vm-tap", dl_src=fa:16:3e:8a:5f:88, icmp_type=133, nd_target=fda7:a5cc:3460:5::72 actions=CONTROLLER:0.
[0067] In one design, as shown in Figure 6 The method further includes S401 before the method in step 203:
[0068] S401: Based on the target flow table, send the route request RS sent by the target virtual machine to the controller of the server.
[0069] It can be understood that when the target flow table located on the integrated bridge matches the route request RS sent by the target virtual machine based on the matching rule, the integrated bridge sends the route request RS from the target virtual machine to the controller of the server.
[0070] In one design, as shown in Figure 7 The method further includes S501:
[0071] S501: When no target registration event is monitored by the IPv6 subnet prefix announcer, based on the subnet cache list, send a route response RA to the multiple virtual machines every interval of a preset time length.
[0072] It can be understood that when no target registration event is monitored by the IPv6 subnet prefix announcer located on the controller through the EventOFPPacketIn, the IPv6 subnet prefix announcer can start a timing cycle, and send a route response RA to all virtual machines in the server through the PaketOut mechanism of the controller every interval of a preset time length.
[0073] In one design, as shown in Figure 8As shown, the IPv6 subnet prefix announcement implementation method provided by the embodiment of the present application further includes S601-S602:
[0074] S601, when a first virtual machine is added in the server, determining the subnet information corresponding to the first virtual machine, and adding the subnet information corresponding to the first virtual machine into the subnet cache list through the IPv6 subnet prefix announcer.
[0075] It can be understood that when the first virtual machine is added in the server, the IPv6 subnet prefix announcer can determine the subnet information corresponding to the first virtual machine through the handle_port method, and add the subnet information corresponding to the first virtual machine into the subnet cache list.
[0076] It should be noted that the handle_port method is a function of the IPv6 subnet prefix announcer.
[0077] Optionally, after adding the subnet information corresponding to the first virtual machine in the server into the subnet cache list, the IPv6 subnet prefix announcer can send a route reply RA to the first virtual machine every interval of a preset time length based on the subnet information corresponding to the first virtual machine in the subnet cache list.
[0078] S602, when a second virtual machine in the server is deleted, deleting the subnet information corresponding to the second virtual machine from the subnet cache list through the IPv6 subnet prefix announcer.
[0079] It can be understood that when the second virtual machine in the server is deleted, the IPv6 subnet prefix announcer can determine the subnet information corresponding to the deleted second virtual machine through the delete_port method, and delete the subnet information corresponding to the second virtual machine from the subnet cache list.
[0080] It should be noted that the delete_port method is a function of the IPv6 subnet prefix announcer.
[0081] In an implementation manner, as Figure 9As shown, a specific flow chart of an IPv6 subnet prefix advertisement implementation method is shown. When IPv6 address and related information of a virtual machine needs to be acquired and configured, first, a controller is started, an IPv6 subnet prefix advertiser is initialized, subnet information corresponding to all virtual machine ports in a server is acquired, and the subnet information corresponding to all virtual machine ports is added to a subnet cache list. The IPv6 subnet prefix advertiser judges whether an IPv6 route request RS is listened to. If the IPv6 route request RS is listened to, the IPv6 route request RS is received, and based on subnet information corresponding to a target virtual machine in the subnet cache list, an IPv6 route response RA is assembled, and the IPv6 route response RA is sent to the target virtual machine. If the IPv6 route request RS is not listened to, a timing cycle is started, and based on subnet information in the subnet cache list, the IPv6 route response RA is assembled and sent to all virtual machines in the server in a timing manner. When a virtual machine port is added in the server, subnet information corresponding to the added virtual machine port is added to the subnet cache list. When a virtual machine port is deleted in the server, the deleted virtual machine port is deleted from the subnet cache list.
[0082] The embodiment of the present application provides an IPv6 subnet prefix advertisement implementation method, which can implement distributed IPv6 subnet prefix advertisement in a cloud network environment. The method can completely replace the function of radvd. The method of responding and advertising IPv6 route information in each computing node is used to solve the problem that a virtual machine needs to access IPv6 route information across computing nodes, and the availability of a link cannot be guaranteed when the virtual machine accesses the IPv6 route information, thereby affecting the IPv6 related configuration of the virtual machine. In the above method, when a virtual machine starts and configures an IPv6 address, an auxiliary process radvd does not need to be started, and server resources are not consumed. When radvd is started in a centralized virtual router namespace, the problem that the centralized network node is down, thereby causing the related route information acquisition mechanism to be unavailable is solved. Meanwhile, the down of a single computing node does not affect the response and advertisement of IPv6 route information of other nodes.
[0083] The above mainly introduces the scheme provided by the embodiment of the present application from the perspective of the method. To implement the above functions, the hardware structure and / or software module corresponding to the execution of each function are included. Those skilled in the art should easily realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present text can be realized in the form of hardware or the combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driven hardware depends on the specific application and design constraints of the technical scheme. The professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0084] The embodiment of the present application can divide the functional modules of the IPv6 subnet prefix announcement implementation method according to the above method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated in one processing module. The above integrated module can be realized in the form of hardware or in the form of a software functional module. Optionally, the division of the modules in the embodiment of the present application is illustrative, and is merely a logical function division. In actual implementation, another division manner can be used.
[0085] Figure 10 A structure diagram of an IPv6 subnet prefix announcement implementation device provided by the embodiment of the present application is shown in FIG. 4. As shown in FIG. 4, the IPv6 subnet prefix announcement implementation device 40 is used to improve the efficiency of virtual machines in acquiring IPv6 addresses and related information and in configuration, for example, is used to execute the IPv6 subnet prefix announcement implementation method shown in FIG. 3. Figure 10 Figure 4 The IPv6 subnet prefix announcement implementation device 40 includes a processing unit 401, an acquisition unit 402, and a transmission unit 403.
[0086] The processing unit 401 is used to add an Internet Protocol version 6 (IPv6) subnet prefix announcer in a controller of a server.
[0087] The acquisition unit 402 is used to acquire a plurality of subnet information corresponding to a plurality of virtual machine ports in the server.
[0088] The processing unit 401 is further used to add the plurality of subnet information to a subnet cache list, one virtual machine port corresponds to one subnet information, and each subnet information includes at least one of the following: a virtual machine port IP address, a virtual machine port subnet prefix, a virtual machine obtaining IPV6 address mode, and a flag bit.
[0089] The transmission unit 403 is used to receive a route solicitation (RS) sent by a target virtual machine when a target registration event is listened to by the IPv6 subnet prefix announcer.
[0090] The processing unit 401 is further used to determine a route advertisement (RA) corresponding to the RS based on the subnet cache list.
[0091] The transmission unit 403 is further used to send the RA to the target virtual machine through the controller of the server, the RA is used for the target virtual machine to acquire an IPv6 address, and the RA includes an IPv6 subnet prefix.
[0092] In a possible implementation, the processing unit 401 is further configured to add a target flow table on an integrated network bridge of the server, the target flow table comprising at least one of the following: a virtual machine port identifier, a source MAC address, an ICMPv6 protocol, a message protocol number corresponding to a route request RS, and the target flow table being configured to send a route request RS sent by a target virtual machine to a controller of the server.
[0093] In a possible implementation, the transmission unit 403 is further configured to send, based on the target flow table, a route request RS sent by a target virtual machine to a controller of the server.
[0094] In a possible implementation, the transmission unit 403 is further configured to send, based on the subnet cache list, a route reply RA to a plurality of virtual machines at a preset time interval when no target registration event is monitored by the IPv6 subnet prefix announcer.
[0095] In a possible implementation, the processing unit 401 is further configured to, when a first virtual machine is added in the server, determine subnet information corresponding to the first virtual machine, and add the subnet information corresponding to the first virtual machine to the subnet cache list through the IPv6 subnet prefix announcer; and the processing unit 401 is further configured to, when a second virtual machine in the server is deleted, delete, through the IPv6 subnet prefix announcer, subnet information corresponding to the second virtual machine from the subnet cache list.
[0096] In a case where the functions of the above integrated modules are implemented in the form of hardware, the embodiment of the present application provides another possible structural diagram of an electronic device involved in the above embodiment. As shown in Figure 11 , an electronic device 60 is configured to improve the efficiency of a virtual machine in acquiring an IPv6 address and related information and in configuration, for example, to perform Figure 4 , an IPv6 subnet prefix announcement implementation method. The electronic device 60 comprises a processor 601, a memory 602, and a bus 603. The processor 601 and the memory 602 can be connected through the bus 603.
[0097] The processor 601 is a control center of a communication device, which can be one processor or a general term of a plurality of processing elements. For example, the processor 601 can be a general central processing unit (CPU), or other general-purpose processors, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0098] As an embodiment, the processor 601 can include one or more CPUs, for example, the CPU 0 and the CPU 1 shown in Figure 11 .
[0099] The memory 602 can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM), or other type of dynamic storage device that can store information and instructions for execution by the processor 601, an electrically erasable programmable read-only memory (EEPROM), a magnetic disk storage medium, or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
[0100] As one possible implementation, the memory 602 can exist independently of the processor 601, and the memory 602 can be connected to the processor 601 through the bus 603 for storing instructions or program code. When the processor 601 invokes and executes the instructions or program code stored in the memory 602, the method for IPv6 subnet prefix advertisement provided by the embodiments of the present application can be implemented.
[0101] In another possible implementation, the memory 602 can also be integrated with the processor 601.
[0102] The bus 603 can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Figure 11 Only one thick line is used to represent the bus in the figure, but it does not mean that there is only one bus or only one type of bus.
[0103] It should be noted that Figure 11 The structure shown does not constitute a limitation on the electronic device 60. In addition to Figure 11 the components shown, the electronic device 60 can include more or fewer components than shown, or combine some components, or different component arrangements.
[0104] As an example, in combination with Figure 10 , the functions implemented by the processing unit 401, the obtaining unit 402, and the transmission unit 403 in the electronic device are the same as the functions of the processor 601 in Figure 11 .
[0105] Optionally, as shown in Figure 11 The electronic device 60 provided by the embodiments of the present application can further include a communication interface 604.
[0106] The communication interface 604 is configured to connect with other devices through a communication network. The communication network can be an Ethernet, a wireless access network, a wireless local area network (WLAN), etc. The communication interface 604 can include a receiving unit configured to receive data, and a sending unit configured to send data.
[0107] In one design, the communication interface in the electronic device provided by the embodiments of the present application can be integrated in the processor.
[0108] From the above description of the embodiments, those skilled in the art can clearly understand that, for the convenience and brevity, only the division of the above functional units is taken as an example for illustration. In actual application, the above functions can be completed by different functional units according to the needs, i.e., the internal structure of the device is divided into different functional units to complete all or part of the functions described above. The specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0109] The embodiments of the present application further provide a computer readable storage medium, which stores instructions. When a computer executes the instructions, the computer executes each step in the method flow shown in the foregoing method embodiments.
[0110] The embodiments of the present application provide a computer program product containing instructions, which, when executed on a computer, cause the computer to execute the IPv6 subnet prefix announcement implementation method in the foregoing method embodiments.
[0111] The computer readable storage medium, for example, can be, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), registers, a hard disk, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. The computer readable storage medium can be any tangible medium that is capable of storing programming for use by or in connection with an instruction execution system, apparatus, or device.
[0112] An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. Of course, the storage medium can be a part of the processor. Consistent with the teachings provided herein, the processor can execute instructions embodied by computer readable storage medium. The instructions may, and often do, alter the state of the processor, thereby affecting what the processor does.
[0113] In embodiments of the present application, the computer readable storage medium can be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.
[0114] Since the electronic device, the computer readable storage medium, and the computer program product in embodiments of the present application can be applied to the above method, the technical effects they can obtain can be referred to the above method embodiments, which will not be described here in embodiments of the present application.
[0115] The above is merely specific implementation of the present application, but the protection scope of the present application is not limited thereto, any change or replacement within the technical scope disclosed in the present application should be covered in the protection scope of the present application.
Claims
1. A method for IPv6 subnet prefix advertisement implementation, characterized in that, The method comprises: adding an Internet Protocol version 6 (IPv6) subnet prefix announcer in a controller of a server; acquiring a plurality of subnet information corresponding to a plurality of virtual machine ports in the server, and adding the plurality of subnet information to a subnet cache list, one virtual machine port corresponding to one subnet information, each subnet information comprising at least one of a virtual machine port IP address, a virtual machine port subnet prefix, a virtual machine IPv6 address acquisition mode, and a flag bit; when a target registration event is listened to by the IPv6 subnet prefix announcer, receiving a route request (RS) sent by a target virtual machine; based on subnet information corresponding to the target virtual machine sending the RS in the subnet cache list, assembling a route answer (RA) corresponding to the RS, and sending the RA to the target virtual machine through the controller of the server, the RA being used for the target virtual machine to acquire an IPv6 address, the RA comprising an IPv6 subnet prefix; the method further comprises: when a first virtual machine is added in the server, determining subnet information corresponding to the first virtual machine, and adding the subnet information corresponding to the first virtual machine to the subnet cache list through the IPv6 subnet prefix announcer; when a second virtual machine in the server is deleted, deleting subnet information corresponding to the second virtual machine from the subnet cache list through the IPv6 subnet prefix announcer.
2. The method of claim 1, wherein, the method further comprises: adding a target flow table on an integrated bridge of the server, the target flow table comprising at least one of a virtual machine port identifier, a source MAC address, an ICMPv6 protocol, and a message protocol number corresponding to the RS, the target flow table being used for sending the RS sent by the target virtual machine to the controller of the server.
3. The method of claim 2, wherein, before the step of when a target registration event is listened to by the IPv6 subnet prefix announcer, receiving a route request (RS) sent by a target virtual machine, the method further comprises: based on the target flow table, sending the RS sent by the target virtual machine to the controller of the server.
4. The method according to any one of claims 1 to 3, characterized in that, the method further comprises: when the target registration event is not listened to by the IPv6 subnet prefix announcer, based on the subnet cache list, sending the RA to the plurality of virtual machines every interval of a preset time length.
5. An IPv6 subnet prefix advertisement implementation device, characterized in that, The IPv6 subnet prefix announcement implementation device comprises a processing unit, an acquisition unit, and a transmission unit. The processing unit is configured to add an Internet Protocol version 6 (IPv6) subnet prefix announcer in a controller of a server. The acquisition unit is configured to acquire a plurality of subnet information corresponding to a plurality of virtual machine ports in the server. The processing unit is further configured to add the plurality of subnet information to a subnet cache list, one virtual machine port corresponding to one subnet information, each subnet information comprising at least one of a virtual machine port IP address, a virtual machine port subnet prefix, a virtual machine IPv6 address acquisition mode, and a flag bit. The transmission unit is configured to receive a route request (RS) sent by a target virtual machine when a target registration event is monitored by the IPv6 subnet prefix announcer; The processing unit is further configured to assemble a route answer (RA) corresponding to the RS based on subnet information corresponding to the target virtual machine sending the RS in the subnet cache list; The transmission unit is further configured to send the RA to the target virtual machine through a controller of the server, the RA being used by the target virtual machine to obtain an IPv6 address, and the RA including an IPv6 subnet prefix; The processing unit is further configured to determine subnet information corresponding to a first virtual machine when the first virtual machine is added to the server, and add the subnet information corresponding to the first virtual machine to the subnet cache list through the IPv6 subnet prefix announcer; The processing unit is further configured to delete subnet information corresponding to a second virtual machine from the subnet cache list through the IPv6 subnet prefix announcer when the second virtual machine is deleted from the server.
6. The apparatus for IPv6 subnet prefix advertisement implementation according to claim 5, wherein, The processing unit is further configured to add a target flow table to an integrated bridge of the server, the target flow table including at least one of a virtual machine port identifier, a source MAC address, an ICMPv6 protocol, and a message protocol number corresponding to the RS, and the target flow table being used to send the RS sent by the target virtual machine to a controller of the server.
7. The apparatus for IPv6 subnet prefix advertisement implementation according to claim 6, wherein, The transmission unit is further configured to send the RS sent by the target virtual machine to the controller of the server based on the target flow table.
8. The apparatus for IPv6 subnet prefix advertisement implementation according to any of claims 5 to 7, characterized in that, The transmission unit is further configured to send the RA to the plurality of virtual machines at a preset time interval based on the subnet cache list when the target registration event is not monitored by the IPv6 subnet prefix announcer.
9. An electronic device, comprising: The electronic device comprises: A processor and a memory; wherein the memory is configured to store one or more programs, the one or more programs including computer execution instructions, and when the electronic device is running, the processor executes the computer execution instructions stored in the memory to enable the electronic device to perform the IPv6 subnet prefix announcement implementation method in any one of claims 1-4.
10. A computer-readable storage medium storing one or more programs, the one or more programs comprising instructions for: The one or more programs include instructions that, when executed by a computer, cause the computer to perform the IPv6 subnet prefix announcement implementation method in any one of claims 1-4.
Citation Information
Patent Citations
Method for dynamically configuring IPv6 (internet protocol version 6) for home gateway
CN102594940A
IPv6 address configuration method, device and equipment and readable storage medium
CN111756870A