CN108322326B - Interface state control method, message transmission method and device - Google Patents

Interface state control method, message transmission method and device Download PDF

Info

Publication number
CN108322326B
CN108322326B CN201710503089.7A CN201710503089A CN108322326B CN 108322326 B CN108322326 B CN 108322326B CN 201710503089 A CN201710503089 A CN 201710503089A CN 108322326 B CN108322326 B CN 108322326B
Authority
CN
China
Prior art keywords
network card
card interface
state
interface
virtual network
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
CN201710503089.7A
Other languages
Chinese (zh)
Other versions
CN108322326A (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 H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C 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 H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201710503089.7A priority Critical patent/CN108322326B/en
Publication of CN108322326A publication Critical patent/CN108322326A/en
Application granted granted Critical
Publication of CN108322326B publication Critical patent/CN108322326B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance or administration or management of packet switching networks
    • H04L41/14Arrangements for maintenance or administration or management of packet switching networks involving network analysis or design, e.g. simulation, network model or planning
    • H04L41/145Arrangements for maintenance or administration or management of packet switching networks involving network analysis or design, e.g. simulation, network model or planning involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing packet switching networks
    • H04L43/08Monitoring based on specific metrics
    • H04L43/0805Availability
    • H04L43/0817Availability functioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING; 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Abstract

The invention provides an interface state control method, a message transmission method and a device, wherein the interface state control method comprises the following steps: maintaining an interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs; and controlling the state of a virtual network card interface connected with the physical network card interface according to the state of the physical network card interface in the interface response chain. The embodiment of the invention can ensure that the virtual network card interface is consistent with the corresponding physical network card interface.

Description

Interface state control method, message transmission method and device
Technical Field
The present invention relates to the field of network communication technologies, and in particular, to an interface state control method, a packet transmission method, and an apparatus.
Background
NFV (Network Functions Virtualization) operates in a virtualized environment, relying on an underlying hypervisor (an intermediate software layer that runs between a physical server and an operating system) to provide virtualized resources. The virtualized resources include virtualized hardware such as a hard disk, a Central Processing Unit (CPU), a memory, and a network card, which are all realized by hypervisor simulation.
Currently, network card resources used in the NFV implementation scheme mainly include common virtual network cards (including fully virtualized network cards or semi virtualized network cards) and the like.
Disclosure of Invention
The invention provides an interface state control method, a message transmission method and a message transmission device, which are used for solving the problem that a virtual machine in the conventional NFV (network function virtualization) implementation scheme cannot sense the state change of a physical network card interface.
According to a first aspect of the embodiments of the present invention, there is provided an interface state control method applied to a virtualization layer of a Network Function Virtualization (NFV), the method including:
maintaining an interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs;
and controlling the state of a virtual network card interface connected with the physical network card interface according to the state of the physical network card interface in the interface response chain.
According to a second aspect of the embodiments of the present invention, there is provided an interface state control apparatus applied to a virtualization layer of a network function virtualization NFV, the apparatus including:
the maintenance unit is used for maintaining the interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs;
and the control unit is used for controlling the state of the virtual network card interface connected with the physical network card interface according to the state of the physical network card interface in the interface response chain.
According to a third aspect of embodiments of the present invention, there is provided an interface state control apparatus comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to:
maintaining an interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs;
and controlling the state of a virtual network card interface connected with the physical network card interface according to the state of the physical network card interface in the interface response chain.
According to a fourth aspect of the embodiments of the present invention, there is provided a message transmission method applied to a host that enables Network Function Virtualization (NFV), the method including:
maintaining an interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs;
when a message needs to be transmitted through a target virtual network card interface, determining the state of the target virtual network card interface according to the state of a physical network card interface in an interface response chain corresponding to the target virtual network card interface;
when the state of the target virtual network card interface is an UP starting state, transmitting a message through the target virtual network card interface;
and when the state of the target virtual network card interface is a Down closing state, refusing to transmit the message through the target virtual network card interface.
According to a fifth aspect of embodiments of the present invention, there is provided a message transmission apparatus applied to a host that enables Network Function Virtualization (NFV), the apparatus including:
the maintenance unit is used for maintaining the interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs;
the determining unit is used for determining the state of a target virtual network card interface according to the state of a physical network card interface in an interface response chain corresponding to the target virtual network card interface when a message needs to be transmitted through the target virtual network card interface;
the transmission unit is used for transmitting a message through the target virtual network card interface when the state of the target virtual network card interface is UP; and when the state of the target virtual network card interface is the Down state, refusing to transmit the message through the target virtual network card interface.
According to a sixth aspect of embodiments of the present invention, there is provided a message transmitting apparatus comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to:
maintaining an interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs;
when a message needs to be transmitted through a target virtual network card interface, determining the state of the target virtual network card interface according to the state of a physical network card interface in an interface response chain corresponding to the target virtual network card interface;
when the state of the target virtual network card interface is an UP starting state, transmitting a message through the target virtual network card interface;
and when the state of the target virtual network card interface is a Down closing state, refusing to transmit the message through the target virtual network card interface.
By the embodiment of the invention, the interface response chain is maintained, and the state of the virtual network card interface connected with the physical network card interface is controlled according to the state of the physical network card interface in the interface response chain, so that the virtual network card interface is ensured to be consistent with the corresponding physical network card interface state.
Drawings
Fig. 1 is a schematic flowchart of an interface state control method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a specific application scenario provided in the embodiment of the present invention;
fig. 3 is a schematic flowchart of a message transmission method according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a hardware structure of an interface state control apparatus according to an embodiment of the present invention;
fig. 5 is a functional block diagram of an interface state control logic according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware structure of a message transmission apparatus according to an embodiment of the present invention;
fig. 7 is a functional structure diagram of a message transmission control logic according to an embodiment of the present invention.
Detailed Description
At present, for an NFV implementation scheme in which a used network card resource is a common virtual network card, a virtual machine cannot sense a state change of a physical network card interface, so that a situation that a state of the virtual network card interface of the virtual machine is inconsistent with a state of the physical network card interface may occur, and further, a virtual machine service may not run normally in a specific scene.
In order to make the technical solutions in the embodiments of the present invention better understood and make the above objects, features and advantages of the embodiments of the present invention more comprehensible, the technical solutions in the embodiments of the present invention are described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart illustrating an interface state control method according to an embodiment of the present invention, where the method may be applied to a virtualization layer of an NFV, as shown in fig. 1, the interface state control method may include the following steps:
step 101, maintaining an interface response chain; the interface response chain comprises a corresponding relation between the virtual network card interface and the physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs.
In the embodiment of the present invention, in order to enable a virtual machine to sense a change in an interface state of a physical network card, a corresponding interface response chain may be maintained according to a connection relationship between a deployed virtual network card interface and a physical network card interface of each virtual machine, so that when the state of the physical network card interface changes, the corresponding virtual machine may be notified of the change in the interface state of the physical network card according to the interface response chain, in consideration of a situation that a virtual machine using a common virtual network card cannot know a change in the interface state of the physical network card, which may cause the state of the virtual network card interface of the virtual machine to be inconsistent with the state of the physical network card interface, and thus a virtual machine service cannot normally run in a specific scene.
For example, assuming that a virtual machine 1 and a virtual machine 2 are deployed on a host 1, and the virtual machine 1 and the virtual machine 2 are respectively connected to a physical network card interface C through a virtual network card interface a1 and a virtual network card interface B1, the host 1 may maintain an interface response chain as shown in table 1:
TABLE 1
Virtual machine 1 Virtual network card interface A1 Physical network card interface C
Virtual machine 2 Virtual network card interface B1 Physical network card interface C
As an optional implementation, the maintaining an interface response chain may include:
when the virtual machine is established, judging whether the virtual machine enables a physical network card interface state response function;
and if so, creating an interface response chain corresponding to the virtual machine.
In this embodiment, in order to improve the controllability of the technical solution provided by the implementation of the present invention, a physical network card interface state response function may be introduced to the virtual machine, and when the virtual machine enables the physical network card interface state response function, a corresponding interface response chain needs to be created for the virtual machine, and a physical network card interface state change notification is performed according to the interface response chain; when the virtual machine does not enable the physical network card interface state response function, a corresponding interface response chain does not need to be established for the virtual machine, and the physical network card interface state change notification does not need to be carried out.
Accordingly, in this embodiment, when a virtual machine is created, it may be determined whether the virtual machine enables a physical network card interface status response function; if the virtual machine enables the physical network card interface state response function, an interface response chain corresponding to the virtual machine can be established; otherwise, the interface response chain corresponding to the virtual machine may not be created.
For example, in this embodiment, a field for indicating whether the virtual machine enables the physical network card interface state response function may be added to the configuration file of the virtual machine, and when the value of the field is the first identification value, it indicates that the corresponding virtual machine enables the physical network card interface state response function; when the value of the field is a second identification value, indicating that the corresponding virtual machine does not enable the physical network card interface state response function; further, whether the virtual machine enables the physical network card interface state response function may be determined according to the value of the field in the configuration file of the virtual machine, and when it is determined that the virtual machine enables the physical network card interface state response function, an interface response chain corresponding to the virtual machine is created.
Further, in this embodiment, after creating the interface response chain corresponding to the virtual machine, the method may further include:
and when the virtual machine adds a virtual network card interface, deletes the virtual network card interface or deletes the virtual machine, updating the interface response chain corresponding to the virtual machine.
In this embodiment, after an interface response chain is created for a virtual machine, the interface response chain corresponding to the virtual machine maintained by the virtual machine may be updated according to a change of the virtual network card interface of the virtual machine (e.g., adding a virtual network card interface, deleting a virtual network card interface, etc.) or a change of the virtual machine (e.g., deleting a virtual machine, etc.).
When the virtual machine is detected to be added with the virtual network card interface, a corresponding interface response chain can be newly added for the virtual machine.
For example, taking the interface response chain of the virtual machine 1 shown in table 1 as an example, assuming that the virtual network card interface a2 is newly added on the virtual machine 1, and the virtual network card interface a2 is connected with the physical network card interface D, the updated interface response chain of the virtual machine 1 may be as shown in table 2:
TABLE 2
When detecting that the virtual machine deletes the virtual network card interface, the information corresponding to the virtual network card interface in the interface response chain corresponding to the virtual machine maintained by the virtual machine can be deleted.
When detecting that the virtual machine is deleted, the interface response chain corresponding to the virtual machine maintained by the virtual machine itself may be deleted.
And step 102, controlling the state of a virtual network card interface connected with the physical network card interface according to the state of the physical network card interface in the interface response chain.
In the embodiment of the present invention, after the interface response chain is maintained, the state of the virtual network card interface connected to the physical network card interface may be controlled according to the state of the physical network card interface in the interface response chain, so as to ensure that the state of the virtual network card interface is consistent with the state of the corresponding physical network card interface.
As an optional implementation manner, in an embodiment of the present invention, when a virtual network card interface is connected to a single physical network card interface, the controlling, according to the state of the physical network card interface in the interface response chain, the state of the virtual network card interface connected to the physical network card interface includes:
for any virtual network card interface, when the state of a physical network card interface connected with the virtual network card interface is changed from an UP (on) state to a Down (off) state, controlling the state of the virtual network card interface to be switched to the Down state;
for any virtual network card interface, when the state of the physical network card interface connected with the virtual network card interface is changed from a Down state to an UP state, the state of the virtual network card interface is controlled to be switched to the UP state.
In this embodiment, when a virtual network card interface is connected to a single physical network card interface (i.e. one virtual network card interface is connected to one physical network card interface), if it is detected that the state of the physical network card interface connected to a certain virtual network card interface (hereinafter referred to as a target virtual network card interface) changes from the UP state to the Down state, the target virtual network card interface may be switched to the Down state.
When the state of the physical network card interface connected with the target virtual network card interface is detected to be changed from the Down state to the UP state, the target virtual network card interface can be switched to the UP state.
For example, taking the interface response chain shown in table 1 as an example, assuming that the host 1 detects that the state of the physical network card interface C changes from the UP state to the Down state, the host 1 may switch the virtual network card interface a1 and the virtual network card interface B1 to the Down state.
As another optional implementation manner, in an embodiment of the present invention, when a virtual network card interface is connected to multiple physical network card interfaces, the controlling, according to the state of a physical network card interface in an interface response chain, the state of the virtual network card interface connected to the physical network card interface includes:
for any virtual network card interface, when the states of a plurality of physical network card interfaces connected with the virtual network card interface are all changed from an UP state to a Down state, controlling the state of the virtual network card interface to be switched to the Down state;
for any virtual network card interface, when the states of a plurality of physical network card interfaces connected with the virtual network card interface are all Down states and the state of at least one physical network card interface is switched from the Down state to the UP state, the state of the virtual network card interface is controlled to be switched to the UP state.
In this embodiment, when the virtual network card interface is connected to multiple physical network card interfaces (that is, one virtual network card interface is connected to multiple physical network card interfaces), if the states of the multiple physical network card interfaces connected to the target virtual network card interface are all changed from the UP state to the Down state, it is determined that the physical network card interface connected to the target virtual network card interface is in the Down state, and at this time, the state of the target virtual network card interface may be switched to the Down state.
In addition, if the state of at least one physical network card interface of the plurality of physical network card interfaces connected with the target virtual network card interface is changed from the Down state to the UP state, it is determined that the physical network card interface connected with the target virtual network card interface is in the UP state, and at this time, the state of the target virtual network card interface can be switched to the UP state.
For example, assume that host 2 maintains an interface response chain as shown in table 3:
TABLE 3
In this example, when the host 2 detects that the states of the physical network card interface E1 and the physical network card interface E2 both change from the UP state to the Down state, the host 2 may switch the state of the virtual network card interface C1 to the Down state.
When the states of the physical network card interface E1 and the physical network card interface E2 are both Down states, and the host 2 detects that the physical network card interface E1 changes from the Down state to the UP state, the host 2 may switch the state of the virtual network card interface C1 to the UP state.
As can be seen, in the method flow shown in fig. 1, the state of the virtual network card interface connected to the physical network card interface is controlled by maintaining the interface response chain and according to the state of the physical network card interface in the interface response chain, so that it is ensured that the virtual network card interface is consistent with the corresponding physical network card interface.
In order to enable those skilled in the art to better understand the technical solution provided by the embodiment of the present invention, the technical solution provided by the embodiment of the present invention is described below with reference to a specific application scenario.
Referring to fig. 2, which is a schematic diagram of a specific application scenario provided in the embodiment of the present invention, as shown in fig. 2, in the application scenario, two virtual machines (VM 11 and VM 12) exist on Host a, a virtual network card interface a1 on a virtual network card a1 of VM11 and a virtual network card interface a2 on a virtual network card a2 of VM 12 are connected to a physical network card interface a of a physical network card a through Linux (an operating system) bridge 10; a virtual machine (VM 20) exists on the Host B, and a virtual network card interface B on a virtual network card B of the VM 20 is connected with a physical network card interface B of the physical network card B through a Linux bridge 20; three virtual machines (VM 31, VM 32 and VM 33) exist on Host C, wherein a virtual network card interface C1 on a virtual network card C1 of VM31 is connected with the Linux bridge 31, a virtual network card interface C2 on the virtual network card C2 of VM 32 and a virtual network card interface C3 on the virtual network card C3 of VM 33 are connected with the Linux bridge 32, and the Linux bridge 31 and the Linux bridge 32 are connected with a physical network card interface C of the physical network card C through the Linux bridge 33.
In this embodiment, a field, such as a physical status field, for indicating whether the virtual machine enables the physical network card interface status response function is added to the configuration file of the virtual machine, and when the value of the field is a first identification value (such as 0x1), it indicates that the virtual machine enables the physical network card interface status response function; when the value of the field is a second identification value (e.g. 0x0), it indicates that the virtual machine does not enable the physical network card interface status response function.
In this embodiment, the network card resource used by the virtual machine is a common virtual network card, a virtualization layer (hypervisor) monitors the state of the physical network card interface, and when the kernel notifies an UP/Down event of the physical network card interface, the virtualization layer controls the state change of the corresponding virtual network card interface.
Based on the application scenario shown in fig. 2, the implementation flow of the interface state control scheme provided in the embodiment of the present invention is as follows:
1. the virtualization layers of the Host A, the Host B and the Host C respectively judge whether the virtual machine of the local machine enables the physical network card interface state response function;
in this embodiment, it is assumed that the physical status fields in the configuration files of virtual machine 11, virtual machine 12, virtual machine 20, virtual machine 31, virtual machine 32, and virtual machine 33 are all "0 x 1", that is, each virtual machine enables the physical network card interface status response function;
2. the virtualization layers of Host a, Host B, and Host C maintain interface response chains as shown in tables 4, 5, and 6, respectively:
TABLE 4
TABLE 5
Virtual machine 20 Virtual network interface B Physical network card interface B
TABLE 6
Virtual machine 31 Virtual network card interface C1 Physical network card interface C
Virtual machine 32 Virtual network card interface C2 Physical network card interface C
Virtual machine 33 Virtual network card interface C3 Physical network card interface C
As can be seen, in the embodiment of the present invention, when a multi-layer Linux bridge is nested (e.g., Host C), the Host needs to record a correspondence between the virtual network card interfaces and the physical network card interfaces that are connected to each other through the multi-layer Linux bridge.
3. Assuming that at a certain moment, when the state of the physical network card interface a notified by the kernel is changed from the UP state to the Down state event by the virtualization layer of Host a, the virtualization layer of Host a may respectively switch the states of the virtual network card interface a1 and the virtual network card interface a2 to the Down state;
4. at another moment, when the virtualization layer of Host a receives an event that the state of the physical network card interface a notified by the kernel changes from the Down state to the UP state, the virtualization layer of Host a may switch the states of the virtual network card interface a1 and the virtual network card interface a2 to the UP state, respectively.
Similarly, the virtualization layers of Host B and Host C may also perform notification of the change of the physical network card interface state according to the descriptions in steps 3 to 4, and specific implementation thereof is not described herein again.
Referring to fig. 3, a schematic flow chart of a message transmission method according to an embodiment of the present invention is provided, where the message transmission method may be applied to a host that enables NFV, and as shown in fig. 3, the message transmission method may include the following steps:
it should be noted that, in the embodiment of the present invention, the execution subject of step 301 to step 304 may be the aforementioned host or a management module in the host, such as a Central Processing Unit (CPU), and for convenience of description, the execution subject of step 301 to step 304 is taken as the host for the following description.
Step 301, maintaining an interface response chain; the interface response chain comprises a corresponding relation between the virtual network card interface and the physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs.
In the embodiment of the present invention, specific implementation of the host maintenance interface response chain may refer to related description in the method flow shown in fig. 1, and details of the embodiment of the present invention are not described herein again.
Step 302, when a message needs to be transmitted through the target virtual network card interface, determining the state of the target virtual network card interface according to the state of the physical network card interface in the response chain corresponding to the target virtual network card interface.
In the embodiment of the present invention, the target virtual network card interface does not refer to a fixed virtual network card interface, but may refer to any virtual network card interface of any virtual machine deployed on the host, and the following description of the embodiment of the present invention is not repeated.
In the embodiment of the present invention, when the host needs to transmit a message through the target virtual network card interface, the host may query the self-maintained interface response chain according to the target virtual network card interface to determine the physical network card interface connected to the target virtual network card interface, and further determine the state of the target virtual network card interface according to the state of the physical network card interface of the target virtual network card interface.
For example, assuming that the target virtual network card interface is connected to a single physical network card interface, when the state of the physical network card interface connected to the target virtual network card interface is an UP state, the host may determine that the state of the target virtual network card interface is an UP state; when the state of the physical network card interface connected to the target virtual network card interface is the Down state, the host may determine that the state of the target virtual network card interface is the Down state.
For another example, assuming that the target virtual network card interface is connected to multiple physical network card interfaces, when the state of at least one physical network card interface of the multiple physical network card interfaces connected to the target virtual network card interface is the UP state, the host may determine that the state of the target virtual network card interface is the UP state; when the states of the plurality of physical network card interfaces connected to the target virtual network card interface are all Down states, the host may determine that the state of the target virtual network card interface is the Down state.
And 303, transmitting the message through the target virtual network card interface when the state of the target virtual network card interface is the UP state.
In the embodiment of the invention, when the host determines that the state of the target virtual network card interface is the UP state, the host can transmit the message through the target virtual network card interface.
And step 304, when the state of the target virtual network card interface is a Down state, refusing to transmit the message through the target virtual network card interface.
In the embodiment of the invention, when the host determines that the state of the target virtual network card interface is the Down state, the host refuses to transmit the message through the target virtual network card interface.
As can be seen from the above description, in the technical solution provided in the embodiment of the present invention, the state of the virtual network card interface connected to the physical network card interface is controlled according to the state of the physical network card interface in the interface response chain by maintaining the interface response chain, so that the state of the virtual network card interface is ensured to be consistent with the state of the corresponding physical network card interface.
The method provided by the present invention is described above. The following describes the apparatus provided by the present invention:
fig. 4 is a schematic diagram of a hardware structure of an interface state control apparatus according to an embodiment of the present invention. The interface state control apparatus may include a processor 401, a machine-readable storage medium 402 having machine-executable instructions stored thereon. The processor 401 and the machine-readable storage medium 402 may communicate via a system bus 403. Also, the processor 401 may perform the interface state control method described above by reading and executing machine-executable instructions in the machine-readable storage medium 402 corresponding to the interface state control logic.
The machine-readable storage medium 402 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
As shown in fig. 5, the interface state control logic may include a maintenance unit 501 and a control unit 502. Wherein:
a maintenance unit 501, configured to maintain an interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs;
a control unit 502, configured to control, according to the state of the physical network card interface in the interface response chain, the state of the virtual network card interface connected to the physical network card interface.
Preferably, the maintenance unit 501 is specifically configured to, when a virtual machine is created, determine whether the virtual machine enables a physical network card interface status response function; and if so, creating an interface response chain corresponding to the virtual machine.
Preferably, the maintenance unit 501 is further configured to update the interface response chain corresponding to the virtual machine when the virtual machine adds a virtual network card interface, deletes a virtual network card interface, or deletes the virtual machine.
Preferably, the control unit 502 is specifically configured to, when a virtual network card interface is in one-to-one connection with a physical network card interface, for any virtual network card interface, control the state of the virtual network card interface to be switched to a Down state when the state of the physical network card interface connected to the virtual network card interface is changed from an UP state to a Down state; for any virtual network card interface, when the state of the physical network card interface connected with the virtual network card interface is changed from a Down state to an UP state, the state of the virtual network card interface is controlled to be switched to the UP state.
Preferably, the control unit 502 is specifically configured to, when one virtual network card interface is connected to multiple physical network card interfaces, for any virtual network card interface, when the states of the multiple physical network card interfaces connected to the virtual network card interface are all changed from an UP state to a Down state, control the state of the virtual network card interface to be switched to the Down state; for any virtual network card interface, when the states of a plurality of physical network card interfaces connected with the virtual network card interface are all Down states and the state of at least one physical network card interface is switched from the Down state to the UP state, the state of the virtual network card interface is controlled to be switched to the UP state.
Fig. 6 is a schematic diagram of a hardware structure of a message transmission apparatus according to an embodiment of the present invention. The message transmitting device may include a processor 601, a machine-readable storage medium 602 having stored thereon machine-executable instructions. The processor 601 and the machine-readable storage medium 602 may communicate via a system bus 603. Also, the processor 601 may perform the message transmission method described above by reading and executing machine-executable instructions in the machine-readable storage medium 602 corresponding to the message transmission control logic.
The machine-readable storage medium 602 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: RAM, volatile memory, non-volatile memory, flash memory, storage drives, solid state drives, any type of storage disk, or similar storage media, or a combination thereof.
As shown in fig. 7, the message transmission control logic may include a maintenance unit 701, a determination unit 702, and a transmission unit 703. Wherein:
a maintenance unit 701, configured to maintain an interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs;
a determining unit 702, configured to determine, when a message needs to be transmitted through a target virtual network card interface, a state of the target virtual network card interface according to a state of a physical network card interface in an interface response chain corresponding to the target virtual network card interface;
a transmission unit 703, configured to transmit a message through the target virtual network card interface when the state of the target virtual network card interface is UP; and when the state of the target virtual network card interface is the Down state, refusing to transmit the message through the target virtual network card interface.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (15)

1. An interface state control method applied to a virtualization layer of a Network Function Virtualization (NFV), the method comprising:
maintaining an interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs; the corresponding relation between the virtual network card interface and the physical network card interface comprises that a plurality of virtual network card interfaces correspond to one physical network card interface, or one virtual network card interface corresponds to a plurality of physical network card interfaces;
and controlling the state of a virtual network card interface connected with the physical network card interface according to the state of the physical network card interface in the interface response chain.
2. The method of claim 1, wherein maintaining the interface response chain comprises:
when the virtual machine is established, judging whether the virtual machine enables a physical network card interface state response function;
and if so, creating an interface response chain corresponding to the virtual machine.
3. The method of claim 2, wherein after creating the interface response chain corresponding to the virtual machine, further comprising:
and when the virtual machine adds a virtual network card interface, deletes the virtual network card interface or deletes the virtual machine, updating the interface response chain corresponding to the virtual machine.
4. The method of claim 1, wherein when the virtual network card interface is connected to a single physical network card interface,
the controlling the state of the virtual network card interface connected with the physical network card interface according to the state of the physical network card interface in the interface response chain comprises the following steps:
for any virtual network card interface, when the state of a physical network card interface connected with the virtual network card interface is changed from an UP starting state to a Down closing state, controlling the state of the virtual network card interface to be switched to a Down state;
for any virtual network card interface, when the state of the physical network card interface connected with the virtual network card interface is changed from a Down state to an UP state, the state of the virtual network card interface is controlled to be switched to the UP state.
5. The method of claim 1, wherein when the virtual network card interface is connected to a plurality of physical network card interfaces,
the controlling the state of the virtual network card interface connected with the physical network card interface according to the state of the physical network card interface in the interface response chain comprises the following steps:
for any virtual network card interface, when the states of a plurality of physical network card interfaces connected with the virtual network card interface are all changed from an UP state to a Down state, controlling the state of the virtual network card interface to be switched to the Down state;
for any virtual network card interface, when the states of a plurality of physical network card interfaces connected with the virtual network card interface are all Down states and the state of at least one physical network card interface is switched from the Down state to the UP state, the state of the virtual network card interface is controlled to be switched to the UP state.
6. An interface state control apparatus applied to a virtualization layer of a Network Function Virtualization (NFV), the apparatus comprising:
the maintenance unit is used for maintaining the interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs; the corresponding relation between the virtual network card interface and the physical network card interface comprises that a plurality of virtual network card interfaces correspond to one physical network card interface, or one virtual network card interface corresponds to a plurality of physical network card interfaces;
and the control unit is used for controlling the state of the virtual network card interface connected with the physical network card interface according to the state of the physical network card interface in the interface response chain.
7. The apparatus of claim 6,
the maintenance unit is specifically configured to, when the virtual machine is created, determine whether the virtual machine enables a physical network card interface status response function; and if so, creating an interface response chain corresponding to the virtual machine.
8. The apparatus of claim 7,
and the maintenance unit is further configured to update the interface response chain corresponding to the virtual machine when the virtual machine adds a virtual network card interface, deletes a virtual network card interface, or deletes the virtual machine.
9. The apparatus of claim 6,
the control unit is specifically configured to, when the virtual network card interface is in one-to-one connection with the physical network card interface, for any virtual network card interface, control the state of the virtual network card interface to be switched to a Down state when the state of the physical network card interface connected to the virtual network card interface changes from an UP state to a Down state; for any virtual network card interface, when the state of the physical network card interface connected with the virtual network card interface is changed from a Down state to an UP state, the state of the virtual network card interface is controlled to be switched to the UP state.
10. The apparatus of claim 6,
the control unit is specifically configured to, when one virtual network card interface is connected with multiple physical network card interfaces, for any virtual network card interface, control the state of the virtual network card interface to be switched to a Down state when the states of the multiple physical network card interfaces connected to the virtual network card interface are all changed from an UP state to a Down state; for any virtual network card interface, when the states of a plurality of physical network card interfaces connected with the virtual network card interface are all Down states and the state of at least one physical network card interface is switched from the Down state to the UP state, the state of the virtual network card interface is controlled to be switched to the UP state.
11. An interface state control apparatus comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to:
maintaining an interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs; the corresponding relation between the virtual network card interface and the physical network card interface comprises that a plurality of virtual network card interfaces correspond to one physical network card interface, or one virtual network card interface corresponds to a plurality of physical network card interfaces;
and controlling the state of a virtual network card interface connected with the physical network card interface according to the state of the physical network card interface in the interface response chain.
12. The apparatus of claim 11, wherein the processor is further caused by the machine executable instructions to perform the interface state control method of any of claims 2 to 4.
13. A message transmission method applied to a host that enables network functions to virtualize NFV, the method comprising:
maintaining an interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs; the corresponding relation between the virtual network card interface and the physical network card interface comprises that a plurality of virtual network card interfaces correspond to one physical network card interface, or one virtual network card interface corresponds to a plurality of physical network card interfaces;
when a message needs to be transmitted through a target virtual network card interface, determining the state of the target virtual network card interface according to the state of a physical network card interface in an interface response chain corresponding to the target virtual network card interface;
when the state of the target virtual network card interface is an UP starting state, transmitting a message through the target virtual network card interface;
and when the state of the target virtual network card interface is a Down closing state, refusing to transmit the message through the target virtual network card interface.
14. A message transmission apparatus for enabling a network function virtualizing a host of an NFV, the apparatus comprising:
the maintenance unit is used for maintaining the interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs; the corresponding relation between the virtual network card interface and the physical network card interface comprises that a plurality of virtual network card interfaces correspond to one physical network card interface, or one virtual network card interface corresponds to a plurality of physical network card interfaces;
the determining unit is used for determining the state of a target virtual network card interface according to the state of a physical network card interface in an interface response chain corresponding to the target virtual network card interface when a message needs to be transmitted through the target virtual network card interface;
the transmission unit is used for transmitting a message through the target virtual network card interface when the state of the target virtual network card interface is UP; and when the state of the target virtual network card interface is the Down state, refusing to transmit the message through the target virtual network card interface.
15. A message transmitting device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to:
maintaining an interface response chain; the interface response chain comprises a corresponding relation between a virtual network card interface and a physical network card interface which are connected with each other and a virtual machine to which the virtual network card interface belongs; the corresponding relation between the virtual network card interface and the physical network card interface comprises that a plurality of virtual network card interfaces correspond to one physical network card interface, or one virtual network card interface corresponds to a plurality of physical network card interfaces;
when a message needs to be transmitted through a target virtual network card interface, determining the state of the target virtual network card interface according to the state of a physical network card interface in an interface response chain corresponding to the target virtual network card interface;
when the state of the target virtual network card interface is an UP starting state, transmitting a message through the target virtual network card interface;
and when the state of the target virtual network card interface is a Down closing state, refusing to transmit the message through the target virtual network card interface.
CN201710503089.7A 2017-06-27 2017-06-27 Interface state control method, message transmission method and device Active CN108322326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710503089.7A CN108322326B (en) 2017-06-27 2017-06-27 Interface state control method, message transmission method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710503089.7A CN108322326B (en) 2017-06-27 2017-06-27 Interface state control method, message transmission method and device
PCT/CN2018/092731 WO2019001398A1 (en) 2017-06-27 2018-06-26 State control of virtual network card interface, and packet transmission

Publications (2)

Publication Number Publication Date
CN108322326A CN108322326A (en) 2018-07-24
CN108322326B true CN108322326B (en) 2021-02-26

Family

ID=62891472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710503089.7A Active CN108322326B (en) 2017-06-27 2017-06-27 Interface state control method, message transmission method and device

Country Status (2)

Country Link
CN (1) CN108322326B (en)
WO (1) WO2019001398A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10992515B1 (en) 2019-06-10 2021-04-27 Cisco Technology, Inc. Link state tracking for virtual interfaces
CN112491570A (en) * 2019-09-11 2021-03-12 中兴通讯股份有限公司 Method, device and storage medium for setting link state of virtual network card

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101129032A (en) * 2005-02-25 2008-02-20 Ip输入公司 Hardware abstraction layer
CN102609298A (en) * 2012-01-11 2012-07-25 中国科学技术大学苏州研究院 Network card virtualizing system and network card virtualizing method on basis of hardware array expansion
CN103428226A (en) * 2013-08-30 2013-12-04 天津汉柏汉安信息技术有限公司 Method and system for communication of user state and inner core
US8665747B2 (en) * 2009-12-03 2014-03-04 Cisco Technology, Inc. Preventing loops on network topologies built with virtual switches and VMS
CN106878204A (en) * 2016-12-21 2017-06-20 新华三技术有限公司 The creation method and device of a kind of virtual machine

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8260986B2 (en) * 2009-09-29 2012-09-04 Hitachi, Ltd. Methods and apparatus for managing virtual ports and logical units on storage systems
US8656389B2 (en) * 2011-08-22 2014-02-18 Vmware, Inc. Virtual port command processing during migration of virtual machine

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101129032A (en) * 2005-02-25 2008-02-20 Ip输入公司 Hardware abstraction layer
US8665747B2 (en) * 2009-12-03 2014-03-04 Cisco Technology, Inc. Preventing loops on network topologies built with virtual switches and VMS
CN102609298A (en) * 2012-01-11 2012-07-25 中国科学技术大学苏州研究院 Network card virtualizing system and network card virtualizing method on basis of hardware array expansion
CN103428226A (en) * 2013-08-30 2013-12-04 天津汉柏汉安信息技术有限公司 Method and system for communication of user state and inner core
CN106878204A (en) * 2016-12-21 2017-06-20 新华三技术有限公司 The creation method and device of a kind of virtual machine

Also Published As

Publication number Publication date
CN108322326A (en) 2018-07-24
WO2019001398A1 (en) 2019-01-03

Similar Documents

Publication Publication Date Title
US20190354513A1 (en) Dynamic Storage Tiering in a Virtual Environment
US10198377B2 (en) Virtual machine state replication using DMA write records
US9619308B2 (en) Executing a kernel device driver as a user space process
US9519795B2 (en) Interconnect partition binding API, allocation and management of application-specific partitions
TWI625674B (en) Systems and methods for nvme controller virtualization to support multiple virtual machines running on a host
US9575856B2 (en) Preventing migration of a virtual machine from affecting disaster recovery of replica
US20180210801A1 (en) Container monitoring method and apparatus
US9639293B2 (en) Migration of newly allocated data to a storage tier
CN107111533B (en) Virtual machine cluster backup
US9413683B2 (en) Managing resources in a distributed system using dynamic clusters
EP3117311B1 (en) Method and system for implementing virtual machine images
US8875133B2 (en) Migration of virtual machines
EP3140734B1 (en) Mechanism for providing external access to a secured networked virtualization environment
US8621603B2 (en) Methods and structure for managing visibility of devices in a clustered storage system
US9582221B2 (en) Virtualization-aware data locality in distributed data processing
US9229749B2 (en) Compute and storage provisioning in a cloud environment
JP6607783B2 (en) Distributed cache cluster management
US9921955B1 (en) Flash write amplification reduction
US8683589B2 (en) Providing protection against unauthorized network access
US9912752B1 (en) Retention-based data management in a network-based data store
US8937965B2 (en) Storage system comprising function for migrating virtual communication port added to physical communication port
CN102834822B (en) By trooping of sharing of virtual machine quick-full backup
US9239765B2 (en) Application triggered state migration via hypervisor
US7475217B2 (en) Method of managing storage capacity in storage system, a storage device and a computer system
CA2978889C (en) Opportunistic resource migration to optimize resource placement

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