CN113206760B - Interface configuration updating method and device for VRF resource allocation and electronic equipment - Google Patents

Interface configuration updating method and device for VRF resource allocation and electronic equipment Download PDF

Info

Publication number
CN113206760B
CN113206760B CN202110477642.0A CN202110477642A CN113206760B CN 113206760 B CN113206760 B CN 113206760B CN 202110477642 A CN202110477642 A CN 202110477642A CN 113206760 B CN113206760 B CN 113206760B
Authority
CN
China
Prior art keywords
interface
target interface
vrf
configuration
data table
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110477642.0A
Other languages
Chinese (zh)
Other versions
CN113206760A (en
Inventor
霍云峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN202110477642.0A priority Critical patent/CN113206760B/en
Publication of CN113206760A publication Critical patent/CN113206760A/en
Application granted granted Critical
Publication of CN113206760B publication Critical patent/CN113206760B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure provides an interface configuration updating method and device for VRF resource allocation and electronic equipment. The interface configuration updating method comprises the following steps: responding to an interface updating instruction to update a VRF corresponding to a target interface, and generating configuration information and an IP address of the target interface; writing the interface name, the VRF identifier and the state identifier of the target interface into a preset data table according to the configuration information, and sending a configuration updating instruction comprising the configuration information to a user mode program; after the user mode program finishes the configuration updating of the target interface, setting the state identifier of the target interface in the preset data table as a preset value; and reading the preset data table, and sending an IP address setting instruction to the user mode program when the state identifier of the target interface is the preset value, wherein the IP address setting instruction comprises the IP address of the target interface. The embodiment of the disclosure can avoid the interface configuration failure in the process of changing the VRF by the interface.

Description

Interface configuration updating method and device for VRF resource allocation and electronic equipment
Technical Field
The present disclosure relates to the field of information technology, and in particular, to an interface configuration updating method and apparatus for VRF resource allocation, and an electronic device.
Background
With the increasing development of network technology, more and more functions are supported by network devices. The network equipment virtualization application realizes the purpose of one machine with multiple purposes, flexibly allocates resources to improve the resource utilization rate, and each virtual equipment is mutually independent, physically isolated and safely isolated, has independent hardware resources and management authority, can be regarded as physical equipment, flexibly networks, can allocate exclusive network resources for different network systems, and simultaneously reduces the user investment. The VRF (Virtual Routing Forwarding, Virtual Routing and Forwarding) technology is a novel virtualization technology for virtualizing a physical device into multiple logical devices. When dividing the logic devices, each logic device only has an independent routing table and a set of interfaces. VRF is mainly the isolation of the forwarding layer, and the system resource is shared and preemptive.
When a user sets the VRF, system resources (such as an allocation interface) need to be divided for the VRF, and in order to improve the working efficiency, the related technology uses an automatic script tool to issue interface configuration information and interface IP addresses in batch. In this process, the following faults often occur: the network equipment operates normally, but after the network equipment is restarted, the communication function is abnormal due to circuit maintenance or other reasons, which brings great inconvenience and trouble to the work of users, and even brings economic loss.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to an interface configuration updating method, apparatus and electronic device for VRF resource allocation, which are used to overcome, at least to some extent, the problem of communication failure after restart, which often occurs in network devices using VRF technology.
According to a first aspect of the embodiments of the present disclosure, there is provided an interface configuration update method, including: responding to an interface updating instruction to update a VRF corresponding to a target interface, and generating configuration information and an IP address of the target interface; writing the interface name, the VRF identifier and the state identifier of the target interface into a preset data table according to the configuration information, and sending a configuration updating instruction comprising the configuration information to a user mode program; after the user mode program finishes the configuration updating of the target interface, setting the state identifier of the target interface in the preset data table as a preset value; and reading the preset data table, and sending an IP address setting instruction to the user mode program when the state identifier of the target interface is the preset value, wherein the IP address setting instruction comprises the IP address of the target interface.
In an exemplary embodiment of the disclosure, the state identifier includes a start time of the target interface change VRF.
In an exemplary embodiment of the present disclosure, after reading the preset data table, the method further includes:
and when the state identifier of the target interface is not the preset value, setting the state identifier as the preset value after a preset time length, and sending the IP address setting instruction to the user mode program.
In an exemplary embodiment of the present disclosure, the writing the interface name, the VRF identifier, and the state identifier of the target interface into the preset data table according to the configuration information includes:
registering interface structure information according to the interface name, the VRF identifier and the state identifier;
and writing the interface structure information into the structure linked list.
In an exemplary embodiment of the present disclosure, after reading the preset data table, the method further includes:
when the state identifier of the target interface is not the preset value, judging whether the difference between the current time and the time corresponding to the state identifier exceeds a preset time length or not;
if the preset time length is exceeded, setting the state identifier as the preset value, and sending the IP address setting instruction to the user state program;
and if the preset time length is not exceeded, the preset data table is read again.
In an exemplary embodiment of the disclosure, the setting the state identifier of the target interface in the preset data table to a preset value after the user mode program completes the configuration update of the target interface includes:
and responding to the configuration updating completion message of the user mode program, and setting the state identifier as the preset value.
In an exemplary embodiment of the disclosure, the setting the state identifier of the target interface in the preset data table to a preset value after the user mode program completes the configuration update of the target interface includes:
and responding to a state identifier updating instruction of the user state program, and setting the state identifier as the preset value.
According to a second aspect of the embodiments of the present disclosure, there is provided an interface configuration updating apparatus, including:
the interface configuration generation module is set to respond to an interface updating instruction to update the VRF corresponding to the target interface and generate configuration information and an IP address of the target interface;
the identification information registration module is set to write the interface name, the VRF identifier and the state identifier of the target interface into a preset data table according to the configuration information and send a configuration updating instruction comprising the configuration information to a user mode program;
an identification information updating module configured to set the state identifier of the target interface in the preset data table to a preset value after the user mode program completes configuration updating of the target interface;
and the IP address setting module is used for reading the preset data table and sending an IP address setting instruction to the user mode program when the state identifier of the target interface is the preset value, wherein the IP address setting instruction comprises the IP address of the target interface.
According to a third aspect of the present disclosure, there is provided an electronic apparatus comprising: a memory; and a processor coupled to the memory, the processor configured to perform the method of any of the above based on instructions stored in the memory.
According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a program which, when executed by a processor, implements an interface configuration update method as recited in any one of the above.
The embodiment of the disclosure writes the updated state identifier of the target interface in the preset data table, and issues the IP address of the target interface to the user mode program only when the state identifier is the preset value, so that the IP address can be prevented from being issued to the user mode program before the configuration information is modified, the IP address of the target interface is further prevented from being cleared by subsequent configuration information updating actions, and the problem that the network device using the VRF technology often has communication faults after restarting can be successfully solved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
Fig. 1 is a flowchart of an interface configuration update method in an exemplary embodiment of the present disclosure.
Fig. 2 is a sub-flowchart of step S2 in one embodiment of the present disclosure.
FIG. 3 is a sub-flowchart of step S4 in one embodiment of the present disclosure.
Fig. 4 is an overall flowchart of an interface configuration update process in one embodiment of the present disclosure.
Fig. 5 is a block diagram of an interface configuration update apparatus in an exemplary embodiment of the present disclosure.
Fig. 6 is a block diagram of an electronic device in an exemplary embodiment of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Further, the drawings are merely schematic illustrations of the present disclosure, in which the same reference numerals denote the same or similar parts, and thus, a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The following detailed description of exemplary embodiments of the disclosure refers to the accompanying drawings.
Fig. 1 is a flowchart of an interface configuration update method in an exemplary embodiment of the present disclosure.
Referring to fig. 1, an interface configuration update method 100 may include:
step S1, responding to the interface updating instruction to update the VRF corresponding to the target interface, and generating the configuration information and the IP address of the target interface;
step S2, writing the interface name, VRF identifier and state identifier of the target interface into a preset data table according to the configuration information, and sending a configuration update instruction including the configuration information to a user mode program;
step S3, after the user mode program completes the configuration update of the target interface, setting the state identifier of the target interface in the preset data table as a preset value;
step S4, reading the preset data table, and sending an IP address setting instruction to the user mode program when the status identifier of the target interface is the preset value, where the IP address setting instruction includes an IP address of the target interface.
The embodiment of the disclosure writes the updated state identifier of the target interface in the preset data table, and issues the IP address of the target interface to the user mode program only when the state identifier is the preset value, so that the IP address can be prevented from being issued to the user mode program before the configuration information is modified, the IP address of the target interface is further prevented from being cleared by subsequent configuration information updating actions, and the problem that the network device using the VRF technology often has communication faults after restarting can be successfully solved.
The inventor of the present disclosure finds that a network device using a VRF technology often has communication failures after restart, and finds that the problem is caused by that an IP address of a new interface is not successfully issued to a user mode program when a kernel reallocates VRF resources after restart through data analysis and experiments. On the basis of the above, the inventor experimentally found the following reasons:
when the system divides resources for the VRF, firstly, the kernel logs out the original interface of the VRF and deletes the configuration information (including an IP address) of the original interface, then registers the new interface and sends an interface change event to the user mode program through a netlink communication mechanism after initializing the new interface so as to delete the previous interface configuration information recorded by the user mode program and send the new interface configuration information. Meanwhile, an IP address of a new interface is created in the kernel and is sent to the database process of the user mode program to be stored. Because the two actions are executed concurrently, when the device is restarted, the original interface configuration information of the database is lost, when the device is restarted and the interface configuration information is recovered, the configuration information of the new interface cannot be normally issued, but the IP address of the new interface can be normally issued and recorded into the database by the user state program. Therefore, when the configuration information of the new interface is successfully issued subsequently, the user mode program deletes the original configuration information in the database according to the configuration information updating instruction, and also deletes the IP address of the new interface which is just recorded at the same time, thereby causing the problem of communication failure of the equipment after restart.
On this basis, the inventors set up an interface configuration update method 100 to solve the above problem. The interface configuration update method 100 may be performed by a kernel-mode program in the system.
The steps of the interface configuration update method 100 will be described in detail below.
In step S1, the VRF corresponding to the target interface is updated in response to the interface update instruction, and the configuration information and the IP address of the target interface are generated.
The VRF may also be referred to as a VPN Routing and Forwarding Instance (VPN Routing & Forwarding Instance). Each VRF may be considered a virtual router that includes the following elements: an independent routing table, which of course also includes an independent address space; a set of interfaces attributed to this VRF; a set of routing protocols for the present VRF only. Multiple VRFs may be set on one physical device, that is, one physical device is virtualized into multiple logical devices.
Therefore, when resources are partitioned for a VRF, a corresponding interface needs to be partitioned for the VRF, configuration information and an IP address related to the interface are generated, and the configuration information and the IP address are issued to a user mode program, so that the user mode program can use the corresponding VRF to realize network communication through the interface.
In the embodiment of the present disclosure, the interface update instruction is, for example, a VRF new instruction, a VRF update instruction, or another instruction for instructing to partition an interface for one VRF. The kernel-state system process may determine a target interface in response to the interface update instruction, update the VRF corresponding to the interface (i.e., partition the target interface to the VRF), and generate configuration information and an IP address of the target interface.
In one embodiment, the generation and subsequent issuing of the IP address of the target interface may be implemented by a script program that runs in parallel with a kernel-mode program that generates the interface configuration information. The process of generating the IP address of the target interface may be: and after judging that the address of the target interface is legal, establishing the IP address of the target interface in the kernel through a netlink message. netlink is an asynchronous communication mechanism, that is, messages transmitted between a kernel and a user mode program are stored in a socket cache queue, and when the messages are sent, the messages are only stored in a socket receiving queue of a receiver, and the receiver does not need to wait for receiving the messages.
In step S2, the interface name, the VRF identifier, and the state identifier of the target interface are written into a preset data table according to the configuration information, and a configuration update instruction including the configuration information is sent to the user mode program.
In the embodiment of the present disclosure, after the target interface is allocated to a VRF, the interface name of the target interface, the identifier of the VRF, and the state identifier may be recorded in a preset data table.
Fig. 2 is a sub-flowchart of step S2 in one embodiment of the present disclosure.
Referring to fig. 2, in an embodiment, the preset data table is a structure linked list, and the step S2 includes:
step S21, registering the interface structure information according to the interface name, VRF identifier and state identifier;
in step S22, the interface structure information is written into the structure linked list.
The process shown in fig. 2 can also be implemented by the following embodiments:
registering a structure linked list in a kernel memory, wherein the structure in the linked list comprises the following members: interface name (ifname), VRF identifier (VRF _ id), status identifier of the interface.
Binding the target interface and the corresponding VRF, calling a flow for processing the interface change VRF in the kernel by a command line through a system, after the kernel finishes processing, when the kernel sends an interface change event (configuration update instruction) to a user mode program through a netlink mechanism, setting structure information of the target interface which has applied for the memory, setting an interface name ifname of the kernel dividing VRF interface resources at the moment, an identifier of the VRF to which the interface belongs and a state identifier of the interface, and taking the structure information as node information to be hung on a preset structure linked list.
In one embodiment, the status identifier is, for example, a starting time (running _ time) of the target interface change VRF. The start time may be represented by a time stamp, which may be determined by a difference between the start time and a preset time point.
While the interface information is stored in the structure linked list, an interface change event (configuration update instruction) can be sent to the user mode program through a netlink mechanism, so that the user mode program deletes the original interface configuration information and updates the interface configuration information of the target interface.
The user mode program has a monitoring process for monitoring the information of the interface change VRF sent by the kernel to the user mode program through the netlink, and the process clears the configuration information before the target interface changes the VRF after receiving the information of the interface change VRF and sets the configuration information of the VRF to which the target interface currently belongs.
In step S3, after the user mode program completes the configuration update of the target interface, the status identifier of the target interface in the preset data table is set as a preset value.
Step S3 may be dominated by either a kernel-mode program or a user-mode program.
In an embodiment of the present disclosure, when step S3 is dominated by the kernel-mode program, the state identifier may be set to the preset value in response to a configuration update completion message of the user-mode program. That is, the user mode program may be configured to send a configuration update completion message after completing the configuration information deletion and the configuration information update according to the configuration update instruction. The configuration update complete message may include, for example, the interface name of the target interface.
After receiving the configuration update completion message, the kernel mode program automatically sets the state identifier of the target interface to a preset value in a preset data table (e.g., a structure linked list) according to the interface name.
In another embodiment of the present disclosure, when step S3 is dominated by the user-state program, the state identifier may be set to the preset value in response to a state identifier update instruction of the user-state program. That is, after completing the deletion of the configuration information and the update of the configuration information according to the configuration update instruction, the user mode program may be configured to traverse an interface information structure linked list (i.e., a preset data table) in the kernel, and update the state identifier corresponding to the target interface to a preset value, so as to indicate that the target interface changes the end of the whole process of binding the VRF.
In one embodiment, the preset value may be zero, for example. That is, after the user mode program completes the configuration update of the target interface, the state identifier of the target interface may be cleared in the preset data table.
In step S4, the preset data table is read, and an IP address setting instruction is sent to the user mode program when the status identifier of the target interface is the preset value, where the IP address setting instruction includes an IP address of the target interface.
Step S4 may also be accomplished by a script program that generates the IP address of the target interface. After the IP address of the target interface is generated, the value of the status identifier of the target interface in the preset data table may be monitored. If the value of the status identifier of the target interface is found to be a preset value (for example, zero), it indicates that the configuration information of the target interface has been successfully issued, and at this time, an IP address setting instruction may be sent to the user mode program, so that the user mode program records the new IP address of the target interface in the database, without worrying about that the IP address is deleted in the configuration updating process.
In one embodiment of the present disclosure, if the status identifier of the target interface is not the preset value, the preset data table may be read in a loop until the value of the status identifier of the target interface is found to be the preset value.
However, in an actual working condition, there may be a situation that the monitoring process of the user mode program is turned off due to some unexpected reasons, at this time, the user mode program cannot monitor the message of the interface change VRF sent by the kernel, and the configuration information of the target interface cannot be successfully issued, so that the value of the status identifier of the target interface is not updated.
At this time, in order to prevent the program from generating a dead loop, in another embodiment of the present disclosure, if the status identifier of the target interface is not the preset value, the status identifier may be set to the preset value after a preset time period, and the IP address setting instruction may be sent to the user mode program.
By normally setting the IP address after the preset time length, the problem that the program is in endless loop due to the fault of the user mode program can be avoided. The preset duration can also be aging time, and the aging time can ensure that the IP address can be normally set when the monitoring process does not exist.
In another embodiment of the present disclosure, the above object may also be achieved in another manner.
FIG. 3 is a sub-flowchart of step S4 in one embodiment of the present disclosure.
Referring to fig. 3, in one embodiment, step S4 may include:
step S41, reading the preset data table;
step S42, determining whether the status identifier of the target interface is the preset value;
step S43, when the status identifier of the target interface is the preset value, an IP address setting instruction is sent to the user status program, and the IP address setting instruction comprises the IP address of the target interface;
step S44, when the status identifier of the target interface is not the preset value, determining whether a difference between the current time and the time corresponding to the status identifier exceeds a preset duration, if so, entering step S45, and if not, returning to step S41 to re-read the preset data table.
Step S45, setting the status identifier as the preset value, and sending the IP address setting instruction to the user mode program.
By circularly reading the preset data table and judging, the change condition of the state identifier can be found in time, the IP address setting instruction can be issued in time, the dead cycle of the program can be terminated in time when the user-mode program fails, and the reliability is improved.
Fig. 4 is an overall flowchart of an interface configuration update process in one embodiment of the present disclosure.
Referring to fig. 4, in step S401, after the command line concurrent execution flow starts, the structure linked list is registered in the kernel first. The command line concurrent execution flow may be initiated in response to a VRF resource allocation request.
In step S402, after the kernel has processed the interface change VRF procedure, the kernel determines a change VRF timestamp of the target interface.
In step S403, it is determined whether the target interface has a corresponding node in the structure linked list. If not, the process proceeds to step S404, and if yes, the process proceeds to step S405.
In step S404, the application memory stores structure information of the target interface, and the structure information is hung on the structure linked list as a node.
In step S405, the change VRF timestamp of the target interface in the structure linked list is updated, and a configuration update instruction is sent to the user mode.
In step S406, after the user mode has processed the interface configuration flow, the change VRF timestamp of the target interface is cleared.
In step S407, an IP address of the target interface is generated. Step S407 may be performed in parallel with step S401.
In step S408, it is determined whether the changed VRF timestamp of the target interface is zero, and if so, the process proceeds to step S412, otherwise, the process proceeds to step S409.
In step S409, the value of the target interface change VRF timestamp is checked at intervals, and the difference between the current time and the target interface change VRF timestamp is determined.
In step S410, it is determined whether the difference exceeds a preset aging time, if so, the process proceeds to step S411, otherwise, the process returns to step S409.
In step S411, the change VRF timestamp of the target interface is cleared.
In step S412, the procedure of setting the IP address of the interface is normally performed.
In summary, the embodiments of the present disclosure may be performed by the following sequence:
firstly, registering interface structure information in a kernel memory to store an interface name of an interface and a VRF identifier to which the interface belongs, and sending the starting time of the interface change VRF notification to a user mode by the kernel. And when the kernel finishes processing the interface change flow, updating the interface change VRF time stamp, if the interface does not exist, re-applying for interface information, storing the interface name, the VRF identifier to which the interface belongs and the change VRF time stamp. After the user mode monitoring process monitors an interface change message sent to the user mode by the kernel and processes all configuration flows, the time of changing the VRF timestamp of the interface is cleared, and the data of changing the VRF timestamp is updated to the kernel; setting an interface IP address, traversing a kernel structure linked list to confirm whether a VRF time stamp of the interface is 0, if so, normally executing an IP address setting process, otherwise, commanding a line to wait; checking the value of the VRF timestamp changed by the interface at intervals, comparing the current time with the VRF timestamp changed, setting the VRF timestamp changed to 0 if the time interval between the current time and the VRF timestamp changed is larger than the preset aging time, and normally executing a command for setting an IP address; and if the time interval between the first time and the second time is less than the preset aging time, but the changed VRF time stamp is not 0, re-reading the changed VRF time stamp of the interface.
The embodiment of the disclosure checks the state identifier of the target interface to determine whether the process of binding the VRF by the interface is completed or not when the command of setting the IP address of the target interface is executed, and continues to execute the command of setting the IP address only after the binding of the VRF by the interface is completed, so that the problem of communication failure caused by loss of the IP address of the target interface when the VRF resource is reallocated after equipment is restarted in the related art can be avoided. By automatically setting the IP address after the preset aging time, the phenomenon of program endless loop caused by the hang-up of the monitoring process due to an unexpected condition can be prevented.
Corresponding to the above method embodiment, the present disclosure further provides an interface configuration updating apparatus, which may be used to execute the above method embodiment.
Fig. 5 is a block diagram of an interface configuration update apparatus in an exemplary embodiment of the present disclosure.
Referring to fig. 5, the interface configuration updating apparatus 500 may include:
an interface configuration generation module 51 configured to respond to an interface update instruction to update the VRF corresponding to the target interface, and generate configuration information and an IP address of the target interface;
an identification information registration module 52 configured to write the interface name, the VRF identifier, and the state identifier of the target interface into a preset data table according to the configuration information, and send a configuration update instruction including the configuration information to the user mode program;
an identification information updating module 53, configured to set the status identifier of the target interface in the preset data table to a preset value after the user mode program completes configuration update of the target interface;
an IP address setting module 54 configured to read the preset data table, and send an IP address setting instruction to the user mode program when the state identifier of the target interface is the preset value, where the IP address setting instruction includes an IP address of the target interface.
In an exemplary embodiment of the disclosure, the state identifier includes a start time of the target interface change VRF.
In an exemplary embodiment of the present disclosure, the preset data table is a structure linked list, and the identification information registration module 52 is configured to:
registering interface structure information according to the interface name, the VRF identifier and the state identifier;
and writing the interface structure body information into the structure body linked list.
In an exemplary embodiment of the present disclosure, the IP address setting module 54 is configured to:
and when the state identifier of the target interface is not the preset value, setting the state identifier as the preset value after a preset time length, and sending the IP address setting instruction to the user mode program.
In an exemplary embodiment of the present disclosure, the IP address setting module 54 is configured to:
when the state identifier of the target interface is not the preset value, judging whether the difference between the current time and the time corresponding to the state identifier exceeds a preset time length or not;
if the preset time length is exceeded, setting the state identifier as the preset value, and sending the IP address setting instruction to the user state program;
and if the preset time length is not exceeded, the preset data table is read again.
In an exemplary embodiment of the present disclosure, the identification information updating module 53 is configured to: and responding to the configuration updating completion message of the user mode program, and setting the state identifier as the preset value.
In an exemplary embodiment of the present disclosure, the identification information updating module 53 is configured to: and responding to a state identifier updating instruction of the user state program, and setting the state identifier as the preset value.
Since the functions of the apparatus 500 have been described in detail in the corresponding method embodiments, the disclosure is not repeated herein.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 600 according to this embodiment of the invention is described below with reference to fig. 6. The electronic device 600 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the electronic device 600 is in the form of a general purpose computing device. The components of the electronic device 600 may include, but are not limited to: the at least one processing unit 610, the at least one memory unit 620, and a bus 630 that couples the various system components including the memory unit 620 and the processing unit 610.
Wherein the memory unit stores program code that may be executed by the processing unit 610 to cause the processing unit 610 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary method" of this specification. For example, the processing unit 610 may perform a method as shown in embodiments of the present disclosure.
The storage unit 620 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)6201 and/or a cache memory unit 6202, and may further include a read-only memory unit (ROM) 6203.
The memory unit 620 may also include programs/utilities 6204 having a set (at least one) of program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may comprise an implementation of a network environment.
Bus 630 may be one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 600, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 600 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 650. Also, the electronic device 600 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 660. As shown, the network adapter 660 communicates with the other modules of the electronic device 600 over the bus 630. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, to name a few.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
The program product for implementing the above method according to an embodiment of the present invention may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), 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.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily appreciated that the processes illustrated in the above figures are not intended to indicate or limit the temporal order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice in the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. An interface configuration update method for VRF resource allocation, comprising:
responding to an interface updating instruction to update a VRF corresponding to a target interface, and generating configuration information and an IP address of the target interface;
writing the interface name, the VRF identifier and the state identifier of the target interface into a preset data table according to the configuration information, and sending a configuration updating instruction comprising the configuration information to a user mode program;
after the user mode program finishes the configuration updating of the target interface, setting the state identifier of the target interface in the preset data table as a preset value;
and reading the preset data table, and sending an IP address setting instruction to the user mode program when the state identifier of the target interface is the preset value, wherein the IP address setting instruction comprises the IP address of the target interface.
2. The interface configuration update method of claim 1, wherein the state identifier comprises a start time for the target interface change VRF.
3. The interface configuration updating method according to claim 1, wherein the preset data table is a structure linked list, and the writing the interface name, the VRF identifier, and the state identifier of the target interface into the preset data table according to the configuration information comprises:
registering interface structure information according to the interface name, the VRF identifier and the state identifier;
and writing the interface structure information into the structure linked list.
4. The interface configuration updating method according to any one of claims 1 to 3, further comprising, after reading the preset data table:
and when the state identifier of the target interface is not the preset value, setting the state identifier as the preset value after a preset time length, and sending the IP address setting instruction to the user mode program.
5. The interface configuration update method of claim 2, after reading the preset data table, further comprising:
when the state identifier of the target interface is not the preset value, judging whether the difference between the current time and the time corresponding to the state identifier exceeds a preset time length or not;
if the preset time length is exceeded, setting the state identifier as the preset value, and sending the IP address setting instruction to the user state program;
and if the preset time length is not exceeded, the preset data table is read again.
6. The interface configuration update method of claim 1, wherein the setting the status identifier of the target interface in the preset data table to a preset value after the user mode program completes the configuration update of the target interface comprises:
and responding to the configuration updating completion message of the user mode program, and setting the state identifier as the preset value.
7. The interface configuration update method of claim 1, wherein the setting the status identifier of the target interface in the preset data table to a preset value after the user mode program completes the configuration update of the target interface comprises:
and responding to a state identifier updating instruction of the user state program, and setting the state identifier as the preset value.
8. An interface configuration update apparatus for VRF resource allocation, comprising:
the interface configuration generation module is set to respond to an interface updating instruction to update the VRF corresponding to the target interface and generate configuration information and an IP address of the target interface;
the identification information registration module is set to write the interface name, the VRF identifier and the state identifier of the target interface into a preset data table according to the configuration information and send a configuration updating instruction comprising the configuration information to a user mode program;
an identification information updating module configured to set the state identifier of the target interface in the preset data table to a preset value after the user mode program completes configuration updating of the target interface;
and the IP address setting module is used for reading the preset data table and sending an IP address setting instruction to the user mode program when the state identifier of the target interface is the preset value, wherein the IP address setting instruction comprises the IP address of the target interface.
9. An electronic device, comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform the interface configuration update method of any of claims 1-7 based on instructions stored in the memory.
10. A computer-readable storage medium on which a program is stored, which when executed by a processor implements the interface configuration update method according to any one of claims 1 to 7.
CN202110477642.0A 2021-04-30 2021-04-30 Interface configuration updating method and device for VRF resource allocation and electronic equipment Active CN113206760B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110477642.0A CN113206760B (en) 2021-04-30 2021-04-30 Interface configuration updating method and device for VRF resource allocation and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110477642.0A CN113206760B (en) 2021-04-30 2021-04-30 Interface configuration updating method and device for VRF resource allocation and electronic equipment

Publications (2)

Publication Number Publication Date
CN113206760A CN113206760A (en) 2021-08-03
CN113206760B true CN113206760B (en) 2022-06-24

Family

ID=77029505

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110477642.0A Active CN113206760B (en) 2021-04-30 2021-04-30 Interface configuration updating method and device for VRF resource allocation and electronic equipment

Country Status (1)

Country Link
CN (1) CN113206760B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060117048A (en) * 2005-05-12 2006-11-16 이화여자대학교 산학협력단 Address management for mobile sctp handover
CN102982141A (en) * 2012-11-20 2013-03-20 北京搜狐新媒体信息技术有限公司 Method and device for realizing distributed database agent
US9536561B1 (en) * 2015-12-08 2017-01-03 International Business Machines Corporation Writing dummy indices on a tape medium partition
CN106603319A (en) * 2017-03-02 2017-04-26 腾讯科技(深圳)有限公司 Fault processing method, management server, and logic server
CN110417870A (en) * 2019-07-05 2019-11-05 北京达佳互联信息技术有限公司 configuration file management method, device, equipment and storage medium
CN111651178A (en) * 2020-05-27 2020-09-11 平安普惠企业管理有限公司 Container configuration updating method and device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060117048A (en) * 2005-05-12 2006-11-16 이화여자대학교 산학협력단 Address management for mobile sctp handover
CN102982141A (en) * 2012-11-20 2013-03-20 北京搜狐新媒体信息技术有限公司 Method and device for realizing distributed database agent
US9536561B1 (en) * 2015-12-08 2017-01-03 International Business Machines Corporation Writing dummy indices on a tape medium partition
CN106603319A (en) * 2017-03-02 2017-04-26 腾讯科技(深圳)有限公司 Fault processing method, management server, and logic server
CN110417870A (en) * 2019-07-05 2019-11-05 北京达佳互联信息技术有限公司 configuration file management method, device, equipment and storage medium
CN111651178A (en) * 2020-05-27 2020-09-11 平安普惠企业管理有限公司 Container configuration updating method and device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于TCP/IP网络环境下网卡冗余热备的实现;张士民;《信息技术与信息化》;20161125(第11期);全文 *
嵌入式网络化设备的可靠性与安全性设计;黄皎等;《计算机工程与设计》;20090128(第02期);全文 *

Also Published As

Publication number Publication date
CN113206760A (en) 2021-08-03

Similar Documents

Publication Publication Date Title
KR102236522B1 (en) Method and apparatus for processing information
JP5427574B2 (en) Virtual computer migration management method, computer using the migration management method, virtualization mechanism using the migration management method, and computer system using the migration management method
US8473692B2 (en) Operating system image management
US10838829B2 (en) Method and apparatus for loading data from a mirror server and a non-transitory computer readable storage medium
US10067692B2 (en) Method and apparatus for backing up and restoring cross-virtual machine application
WO2018054081A1 (en) Fault processing method, virtual infrastructure management system and service management system
US8910160B1 (en) Handling of virtual machine migration while performing clustering operations
US9442791B2 (en) Building an intelligent, scalable system dump facility
US20140012721A1 (en) Managing use of lease resources allocated on fallover in a high availability computing environment
CN109656742B (en) Node exception handling method and device and storage medium
US9323620B2 (en) Implementing shared adapter configuration updates concurrent with maintenance actions in a virtualized system
CN109168328B (en) Virtual machine migration method and device and virtualization system
US20220114145A1 (en) Resource Lock Management Method And Apparatus
WO2018137520A1 (en) Service recovery method and apparatus
CN111459623B (en) Method, device and computer for restoring running of application program
CN110520844A (en) Cloud management platform, virtual machine management method and its system
CN108964977B (en) Node exception handling method and system, storage medium and electronic device
JP2007133544A (en) Failure information analysis method and its implementation device
CN115292408A (en) Master-slave synchronization method, device, equipment and medium for MySQL database
US20230308342A1 (en) Network service management apparatus and network service management method
US8819481B2 (en) Managing storage providers in a clustered appliance environment
CN112596371A (en) Control card switching method and device, electronic equipment and storage medium
CN113206760B (en) Interface configuration updating method and device for VRF resource allocation and electronic equipment
US20230254200A1 (en) Network service management apparatus and network service management method
CN114691304A (en) Method, device, equipment and medium for realizing high availability of cluster virtual machine

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant