CN111163187B - MAC address generation method and device for virtual machine network port - Google Patents

MAC address generation method and device for virtual machine network port Download PDF

Info

Publication number
CN111163187B
CN111163187B CN201911424834.4A CN201911424834A CN111163187B CN 111163187 B CN111163187 B CN 111163187B CN 201911424834 A CN201911424834 A CN 201911424834A CN 111163187 B CN111163187 B CN 111163187B
Authority
CN
China
Prior art keywords
mac address
virtual machine
bit
network port
identification information
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
CN201911424834.4A
Other languages
Chinese (zh)
Other versions
CN111163187A (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.)
Qianxin Technology Group Co Ltd
Secworld Information Technology Beijing Co Ltd
Original Assignee
Qianxin Technology Group Co Ltd
Secworld Information Technology Beijing 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 Qianxin Technology Group Co Ltd, Secworld Information Technology Beijing Co Ltd filed Critical Qianxin Technology Group Co Ltd
Priority to CN201911424834.4A priority Critical patent/CN111163187B/en
Publication of CN111163187A publication Critical patent/CN111163187A/en
Application granted granted Critical
Publication of CN111163187B publication Critical patent/CN111163187B/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
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses
    • 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/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
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/30Managing network names, e.g. use of aliases or nicknames
    • H04L61/3015Name registration, generation or assignment
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers

Abstract

The present disclosure provides a method for generating an MAC address of a virtual machine network port, including: acquiring attribute information of a network port of the virtual machine, and generating an MAC address of the network port based on the attribute information.

Description

MAC address generation method and device for virtual machine network port
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a MAC address of a virtual machine network port, a computer system, and a computer-readable storage medium.
Background
With the rapid development of virtual environments and cloud technologies, Virtual Network Functions (VNFs) are also increasingly applied to many scenes such as work and life. As VNF technology matures, the number of virtual machines in a cloud environment has increased.
Currently, the MAC address of the network port of a virtual machine is generally generated randomly. However, as the service of the cloud environment becomes more and more complex, the number of virtual machines to be deployed also becomes more and more, and the MAC addresses generated at random cannot meet the requirement of effective management.
Disclosure of Invention
In view of this, the present disclosure provides a method and an apparatus for generating a MAC address of a network port of a virtual machine.
One aspect of the present disclosure provides a method for generating a MAC address of a virtual machine network port, including: acquiring attribute information of a network port of a virtual machine, and generating an MAC address of the network port based on the attribute information.
According to an embodiment of the present disclosure, the attribute information comprises a combination of at least one or more of the following information: port identification information of the network port, virtual machine identification information of a virtual machine to which the network port belongs, load balancing group identification information of a load balancing group to which the virtual machine belongs, type information of a type to which the load balancing group belongs, tenant identification information of a tenant to which the load balancing group belongs, and cluster identification information of a cluster to which the tenant belongs
According to an embodiment of the present disclosure, the MAC address of the network port comprises a plurality of bits. The generating the MAC address of the network port based on the attribute information includes: and determining the bit position and bit number of the MAC address corresponding to the attribute information, converting the attribute information into address data with corresponding bit number, and writing the address data into the corresponding bit position.
According to the embodiment of the disclosure, the attribute information of the network port includes a plurality of attribute information, and for each attribute information of the plurality of attribute information, corresponding bit positions on the MAC address do not overlap with each other.
According to an embodiment of the present disclosure, the port identification information corresponds to positions of bits 0 to 3 of the MAC address, the virtual machine identification information corresponds to positions of bits 4 to 7 of the MAC address, the load balancing group identification information corresponds to positions of bits 8 to 15 of the MAC address, the type information corresponds to positions of bits 16 to 22 of the MAC address, the tenant identification information corresponds to positions of bits 23 to 33 of the MAC address, and the cluster identification information corresponds to positions of bits 34 to 39 of the MAC address.
Another aspect of the present disclosure provides an apparatus for generating a MAC address of a network port of a virtual machine, which includes an obtaining module and a generating module. The acquisition module is used for acquiring the attribute information of the network port of the virtual machine. The generation module is used for generating the MAC address of the network port based on the attribute information.
According to an embodiment of the present disclosure, the attribute information comprises a combination of at least one or more of the following information: port identification information of the network port, virtual machine identification information of a virtual machine to which the network port belongs, load balancing group identification information of a load balancing group to which the virtual machine belongs, type information of a type to which the load balancing group belongs, tenant identification information of a tenant to which the load balancing group belongs, and cluster identification information of a cluster to which the tenant belongs.
According to an embodiment of the present disclosure, the MAC address of the network port comprises a plurality of bits. The generating the MAC address of the network port based on the attribute information includes: and determining the bit position and bit number of the MAC address corresponding to the attribute information, converting the attribute information into address data with corresponding bit number, and writing the address data into the corresponding bit position.
According to the embodiment of the disclosure, the attribute information of the network port includes a plurality of attribute information, and for each attribute information of the plurality of attribute information, corresponding bit positions on the MAC address do not overlap with each other.
According to an embodiment of the present disclosure, the port identification information corresponds to positions of bits 0 to 3 of the MAC address, the virtual machine identification information corresponds to positions of bits 4 to 7 of the MAC address, the load balancing group identification information corresponds to positions of bits 8 to 15 of the MAC address, the type information corresponds to positions of bits 16 to 22 of the MAC address, the tenant identification information corresponds to positions of bits 23 to 33 of the MAC address, and the cluster identification information corresponds to positions of bits 34 to 39 of the MAC address.
Another aspect of the present disclosure provides a computer system comprising: one or more processors, and a computer readable storage medium storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the method as described above.
Another aspect of the disclosure provides a non-volatile storage medium storing computer-executable instructions for implementing the method as described above when executed.
Another aspect of the disclosure provides a computer program comprising computer executable instructions for implementing the method as described above when executed.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates an application scenario of the MAC address generation method and apparatus for a virtual machine network port according to an embodiment of the present disclosure;
fig. 2 schematically shows a flow chart of a MAC address generation method of a virtual machine network port according to an embodiment of the present disclosure;
fig. 3 schematically illustrates a block diagram of a MAC address generation apparatus of a virtual machine network port according to an embodiment of the present disclosure; and
FIG. 4 schematically shows a block diagram of a computer system suitable for implementing the information processing method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs, unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). It will be further understood by those within the art that virtually any disjunctive word and/or phrase presenting two or more alternative terms, whether in the description, claims, or drawings, should be understood to contemplate the possibilities of including one of the terms, either of the terms, or both terms. For example, the phrase "a or B" should be understood to include the possibility of "a" or "B", or "a and B".
The embodiment of the present disclosure provides a method for generating an MAC address of a virtual machine network port, including: acquiring attribute information of a network port of the virtual machine, and generating an MAC address of the network port based on the attribute information.
Fig. 1 schematically illustrates an application scenario 100 of the MAC address generation method and apparatus for a virtual machine network port according to an embodiment of the present disclosure.
It should be noted that fig. 1 is only an example of an application scenario in which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, an application scenario 100 according to an embodiment of the present disclosure may include a tenant 110 and a cluster 120.
According to an embodiment of the present disclosure, a tenant 110 may apply to create one or more virtual machines in a cluster 120.
In the disclosed embodiment, the cluster 120 may provide the tenant 110 with a configuration interface through which the tenant 110 may configure the virtual machine it is to create. For example, when the tenant 110 creates a virtual machine, configuration information such as a product type, an image template, a virtual machine specification, the number of virtual machine network ports, a load balancing algorithm, and the like may be selected by the create virtual machine group module as shown in fig. 1.
The virtual machine group creating module in the embodiment of the present disclosure may include, for example, a module a, a module B, and a module C. The module a may provide a configuration interface of a security product type, for example, for a tenant to select a product type, a service port, and the like. Module B may provide, for example, a configuration interface for mirroring the template for the tenant to select a boot style, a disk drive type, and the like. The module C may provide a configuration interface of the virtual machine rule, for example, for the tenant to select a virtual machine CPU, a memory, a disk, and the like.
The virtual machine group of the embodiment of the disclosure can support a load balancing function, and a virtual machine is created in the created virtual machine group, and the virtual machine can inherit the configuration information of the virtual machine group.
According to the embodiment of the present disclosure, the cluster 120 may create a virtual machine for the tenant 110 based on the configuration information thereof, and configure a corresponding number of network ports for the virtual machine. And the attribute information of each network port can be acquired, and the MAC address of each network port is generated, so that each network port can be effectively managed.
Fig. 2 schematically shows a flowchart of a MAC address generation method for a virtual machine network port according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S201 to S202.
In operation S201, attribute information of a network port of a virtual machine is acquired.
In operation S202, a MAC address of the network port is generated based on the attribute information.
According to the embodiment of the present disclosure, before obtaining the attribute information of the network port of the virtual machine, the method may further include: the method comprises the steps of receiving a creation request of creating a virtual machine from a user, creating the virtual machine based on the creation request, configuring a network port for the virtual machine, and obtaining attribute information of the network port.
According to the embodiment of the disclosure, a user may be, for example, a tenant renting a cloud service, and the tenant may request to create a virtual machine in a cluster having a specific function.
In embodiments of the present disclosure, a user may request that one or more virtual machines be created. The user may also request to create one or more load balancing groups, where each load balancing group may include at least one virtual machine.
It is understood that each cluster may provide virtual machines for multiple tenants, and a tenant may also create virtual machines in multiple clusters.
In the disclosed embodiments, the creation request may include, for example, configuration information about the virtual machine to be created. For example, configuration information such as virtual machine type, mirror template, virtual machine specification, number of virtual machine network ports, load balancing algorithm, etc. may be included.
It can be understood that different clusters have different requirements for configuration information of the virtual machine, and the disclosure does not limit this.
According to the embodiment of the disclosure, according to a creation request of a user, a corresponding virtual machine or a virtual machine group is created in a corresponding cluster for the user, and a corresponding number of network ports are configured for each virtual machine.
According to an embodiment of the present disclosure, the attribute information may include at least one of the following information: the method comprises the steps of obtaining port identification information of a network port, virtual machine identification information of a virtual machine to which the network port belongs, load balancing group identification information of a load balancing group to which the virtual machine belongs, type information of a type to which the load balancing group belongs, tenant identification information of a tenant to which the load balancing group belongs, and cluster identification information of a cluster to which the tenant belongs.
In the embodiment of the present disclosure, in general, a cloud service may be deployed with a plurality of clusters, each cluster may be distinguished by different cluster identification information, for example, a cluster ID (cluster _ ID) may be configured for each cluster. There may be one or more tenants in a cluster, each of which may be distinguished by different tenant identification information, e.g., a tenant ID (tenant _ ID) may be configured for each tenant. A tenant may deploy multiple load balancing groups in a cluster, each load balancing group may be distinguished by different load balancing group identification information, for example, a load balancing group ID (group _ ID) may be configured for each load balancing group. The load balancing group may have a plurality of types, for example, a firewall type, a Web protection type, and the like, each of which may be distinguished by type information, for example, a type identifier (vnf _ type) may be configured for each type. One or more virtual machines can be deployed under one load balancing group, each virtual machine can be distinguished by different virtual machine identification information, and for example, a virtual machine ID (vnf _ ID) can be configured for each virtual machine. One virtual machine may deploy one or more network ports, each of which may be distinguished by different port identification information, e.g., a port ID (portjd) may be configured for each network port.
According to an embodiment of the present disclosure, a MAC address of a network port of a virtual machine includes a plurality of bits. For example, the MAC address of a network port may be composed of a 48-bit binary number.
In the embodiment of the present disclosure, generating the MAC address of the network port based on the attribute information may be, for example, determining a bit position and a bit number of the MAC address corresponding to the attribute information, converting the attribute information into address data of a corresponding bit number, and writing the address data into the corresponding bit position. If the attribute information of the network port includes a plurality of attribute information in the attribute information, for each attribute information in the plurality of attribute information, the bit positions corresponding to the plurality of attribute information on the MAC address do not overlap with each other.
For example, the attribute information may include port identification information, virtual machine identification information, load balancing group type information, tenant identification information, and cluster identification information of the network port, and the MAC address of the network port is generated based on the attribute information.
For example, the port identification information may correspond to the positions of bits 0 to 3 of the MAC address. The port identification information may be converted into address data of 4-bit number, and the address data of 4-bit number may be written into the positions of 0 th bit to 3 rd bit of the MAC address.
The virtual machine identification information may correspond to the positions of the 4 th bit to the 7 th bit of the MAC address. The virtual machine identification information may be converted into 4-bit-number address data, and the 4-bit-number address data may be written into the 4 th to 7 th bit positions of the MAC address.
The load balancing group identification information may correspond to the positions of the 8 th bit through the 15 th bit of the MAC address. The load balancing group identification information may be converted into 8-bit-number address data, and the 8-bit-number address data may be written into the 8 th to 15 th bit positions of the MAC address.
The type information may correspond to the positions of the 16 th bit to the 22 th bit of the MAC address. The type information may be converted into address data of 7 bit number and the address data of 7 bit number may be written into the positions of the 16 th bit to the 22 nd bit of the MAC address.
The tenant identification information may correspond to positions of 23 rd to 33 th bits of the MAC address. The tenant identification information may be converted into address data of 11 bit numbers and the address data of 11 bit numbers is written in the positions of the 23 rd bit to the 33 th bit of the MAC address.
The cluster identification information may correspond to the positions of bits 34 to 39 of the MAC address. The cluster identification information may be converted into address data of 6-bit number, and the address data of 6-bit number may be written into the positions of the 34 th bit to the 39 th bit of the MAC address.
Wherein, the first 8 bits (positions of the 40 th bit to the 47 th bit) of the MAC address may be different.
It should be understood that the above examples are only for facilitating understanding, and the embodiments of the present disclosure do not limit the bit positions and bit numbers corresponding to the attribute information, and those skilled in the art may set the bit positions and bit numbers according to actual situations.
The MAC address of each network port is generated based on the attribute information of each network port, and compared with a traditional MAC address random generation method, the MAC address conflict problem of each network port is avoided.
According to the method and the device, the MAC address of the network port is generated through the port identification information of the network port, the virtual machine identification information of the virtual machine to which the network port belongs, the load balancing group identification information of the load balancing group to which the virtual machine belongs, the type information of the type of the load balancing group, the tenant identification information of the tenant to which the load balancing group belongs and the cluster identification information of the cluster to which the tenant belongs, so that the cluster, the tenant, the virtual machine type, the load balancing group, the virtual machine and the virtual machine port information of the virtual machine can be analyzed through reverse analysis of the MAC address, the fault problem can be conveniently located and solved, and effective management is achieved.
Fig. 3 schematically shows a block diagram of a MAC address generation apparatus 300 of a virtual machine network port according to an embodiment of the present disclosure.
As shown in fig. 3, the apparatus 300 includes an obtaining module 310 and a generating module 320.
The obtaining module 310 is configured to obtain attribute information of a network port of a virtual machine.
The generating module 320 is configured to generate a MAC address of the network port based on the attribute information.
According to an embodiment of the present disclosure, the attribute information includes at least one of the following information: the method comprises the steps of obtaining port identification information of a network port, virtual machine identification information of a virtual machine to which the network port belongs, load balancing group identification information of a load balancing group to which the virtual machine belongs, type information of a type to which the load balancing group belongs, tenant identification information of a tenant to which the load balancing group belongs, and cluster identification information of a cluster to which the tenant belongs.
According to an embodiment of the disclosure, the MAC address of the network port comprises a plurality of bits. Generating a MAC address of the network port based on the attribute information, comprising: and determining the bit position and bit number of the MAC address corresponding to the attribute information, converting the attribute information into address data with corresponding bit number, and writing the address data into the corresponding bit position.
According to the embodiment of the disclosure, the attribute information of the network port includes a plurality of attribute information, and for each attribute information of the plurality of attribute information, corresponding bit positions on the MAC address do not overlap with each other.
According to the embodiment of the disclosure, the port identification information corresponds to the positions of the 0 th bit to the 3 rd bit of the MAC address. The virtual machine identification information corresponds to the positions of the 4 th bit to the 7 th bit of the MAC address. The load balancing group identification information corresponds to the positions of the 8 th bit to the 15 th bit of the MAC address. The type information corresponds to the positions of the 16 th bit to the 22 nd bit of the MAC address. The tenant identification information corresponds to positions of 23 rd bit to 33 th bit of the MAC address. The cluster identification information corresponds to the positions of the 34 th bit to the 39 th bit of the MAC address.
It should be noted that the implementation, solved technical problems, realized functions, and achieved technical effects of each module/unit/subunit and the like in the apparatus part embodiment are respectively the same as or similar to the implementation, solved technical problems, realized functions, and achieved technical effects of each corresponding step in the method part embodiment, and are not described herein again.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be implemented at least partly as a computer program module, which when executed, may perform a corresponding function.
FIG. 4 schematically shows a block diagram of a computer system suitable for implementing the information processing method according to an embodiment of the present disclosure. The computer system illustrated in FIG. 4 is only one example and should not impose any limitations on the functionality or scope of use of embodiments of the disclosure.
As shown in fig. 4, a computer system 400 according to an embodiment of the present disclosure includes a processor 401 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. Processor 401 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 401 may also include onboard memory for caching purposes. Processor 401 may include a single processing unit or multiple processing units for performing the different actions of the method flows described with reference to fig. 2 in accordance with embodiments of the present disclosure.
In the RAM 403, various programs and data necessary for the operation of the system 400 are stored. The processor 401, ROM 402 and RAM 403 are connected to each other by a bus 404. The processor 401 performs various operations described above with reference to fig. 2 by executing programs in the ROM 402 and/or the RAM 403. Note that the programs may also be stored in one or more memories other than the ROM 402 and RAM 403. The processor 401 may also perform the various operations described above with reference to fig. 2 by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, system 400 may also include an input/output (I/O) interface 405, input/output (I/O) interface 405 also connected to bus 404. The system 400 may also include one or more of the following components connected to the I/O interface 405: an input portion 406 including a keyboard, a mouse, and the like; an output section 407 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
According to an embodiment of the present disclosure, the method described above with reference to the flow chart may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 409, and/or installed from the removable medium 411. The computer program, when executed by the processor 401, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
It should be noted that the computer readable media shown in the present disclosure may be computer readable signal media or computer readable storage media or any combination of the two. A computer 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 of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), 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. In the present disclosure, a computer 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. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-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 computer readable signal medium may also be any computer readable medium that is not a computer 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 computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing. According to embodiments of the present disclosure, a computer-readable medium may include the ROM 402 and/or RAM 403 and/or one or more memories other than the ROM 402 and RAM 403 described above.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As another aspect, the present disclosure also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to perform the method as described above.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (9)

1. A method for generating an MAC address of a virtual machine network port comprises the following steps:
acquiring attribute information of a network port of a virtual machine; and
generating a MAC address of the network port based on the attribute information; the attribute information includes load balancing group identification information of a load balancing group to which the virtual machine belongs.
2. The method of claim 1, wherein the attribute information further comprises a combination of at least one or more of:
port identification information of the network port, virtual machine identification information of a virtual machine to which the network port belongs, type information of a type to which the load balancing group belongs, tenant identification information of a tenant to which the load balancing group belongs, and cluster identification information of a cluster to which the tenant belongs.
3. The method of claim 2, wherein:
the MAC address of the network port comprises a plurality of bits;
the generating the MAC address of the network port based on the attribute information includes:
determining the bit position and bit number of the MAC address corresponding to the attribute information; and
and converting the attribute information into address data with corresponding bit digits, and writing the address data into corresponding bit positions.
4. The method of claim 3, wherein the attribute information of the network port comprises a plurality of attribute information, for each of which corresponding bit positions on the MAC address do not coincide with each other.
5. The method of claim 4, wherein:
the port identification information corresponds to the positions from 0 bit to 3 bit of the MAC address;
the virtual machine identification information corresponds to the positions from the 4 th bit to the 7 th bit of the MAC address;
the load balancing group identification information corresponds to the positions of the 8 th bit to the 15 th bit of the MAC address;
the type information corresponds to the positions from 16 th bit to 22 th bit of the MAC address;
the tenant identification information corresponds to positions of 23 rd bit to 33 th bit of the MAC address; and
the cluster identification information corresponds to the positions of bits 34 to 39 of the MAC address.
6. An apparatus for generating a MAC address of a network port of a virtual machine, comprising:
the acquisition module is used for acquiring the attribute information of the network port of the virtual machine; and
a generation module, configured to generate a MAC address of the network port based on the attribute information; the attribute information includes load balancing group identification information of a load balancing group to which the virtual machine belongs.
7. The apparatus of claim 6, wherein the attribute information further comprises a combination of at least one or more of:
port identification information of the network port, virtual machine identification information of a virtual machine to which the network port belongs, type information of a type to which the load balancing group belongs, tenant identification information of a tenant to which the load balancing group belongs, and cluster identification information of a cluster to which the tenant belongs.
8. A computer system, comprising:
one or more processors;
a computer-readable storage medium for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-5.
9. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 5.
CN201911424834.4A 2019-12-31 2019-12-31 MAC address generation method and device for virtual machine network port Active CN111163187B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911424834.4A CN111163187B (en) 2019-12-31 2019-12-31 MAC address generation method and device for virtual machine network port

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911424834.4A CN111163187B (en) 2019-12-31 2019-12-31 MAC address generation method and device for virtual machine network port

Publications (2)

Publication Number Publication Date
CN111163187A CN111163187A (en) 2020-05-15
CN111163187B true CN111163187B (en) 2022-08-16

Family

ID=70560712

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911424834.4A Active CN111163187B (en) 2019-12-31 2019-12-31 MAC address generation method and device for virtual machine network port

Country Status (1)

Country Link
CN (1) CN111163187B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685587A (en) * 2012-09-07 2014-03-26 深圳市腾讯计算机系统有限公司 Method and device for assigning MAC (Media Access Control) address
WO2018103043A1 (en) * 2016-12-08 2018-06-14 华为技术有限公司 Message processing method and device in a cloud computing system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103227843B (en) * 2012-08-31 2016-05-04 杭州华三通信技术有限公司 A kind of physical link address management method and device
US10216535B2 (en) * 2015-01-09 2019-02-26 Mediatek Inc. Efficient MAC address storage for virtual machine applications

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685587A (en) * 2012-09-07 2014-03-26 深圳市腾讯计算机系统有限公司 Method and device for assigning MAC (Media Access Control) address
WO2018103043A1 (en) * 2016-12-08 2018-06-14 华为技术有限公司 Message processing method and device in a cloud computing system

Also Published As

Publication number Publication date
CN111163187A (en) 2020-05-15

Similar Documents

Publication Publication Date Title
US20220078078A1 (en) Fpga-enabled compute instances
US10834047B2 (en) Address management in an overlay network environment
US11443226B2 (en) Training a machine learning model in a distributed privacy-preserving environment
CN109213611B (en) Cross-process communication method, device, terminal and storage medium
US9886398B2 (en) Implicit sharing in storage management
US10901749B2 (en) Running a kernel-dependent application in a container
US20150128268A1 (en) Malicious attack prevention through cartography of co-processors at datacenter
US11546431B2 (en) Efficient and extensive function groups with multi-instance function support for cloud based processing
US10956232B2 (en) Instructing the use of application programming interface commands in a runtime environment
US11150926B2 (en) Native code generation for cloud services
US10936385B2 (en) Running kernel dependent applications inside a container
US20140157289A1 (en) Hybrid platform-dependent simulation interface
US10026500B2 (en) Address translation stimuli generation for post-silicon functional validation
US10656855B2 (en) Memory management in a programmable device
CN112395568A (en) Interface authority configuration method, device, equipment and storage medium
US20190310856A1 (en) Executing instructions based on a shared physical register
CN111163187B (en) MAC address generation method and device for virtual machine network port
US20230131198A1 (en) Featureless machine enhancement discovery and verification
US20220114023A1 (en) Infrastructure as code deployment mechanism
US10554586B2 (en) Physical port identification using software controlled LEDs
US20150058513A1 (en) Dynamically resizing direct memory access (dma) windows
CN115220869A (en) Resource allocation method, device, equipment and medium
US11475167B2 (en) Reserving one or more security modules for a secure guest
US10223284B2 (en) Flexible I/O DMA address allocation in virtualized systems
US11520961B2 (en) Heterogeneous-computing based emulator

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 332, 3 / F, Building 102, 28 xinjiekouwei street, Xicheng District, Beijing 100088

Applicant after: Qianxin Technology Group Co.,Ltd.

Applicant after: Qianxin Wangshen information technology (Beijing) Co.,Ltd.

Address before: Room 332, 3 / F, Building 102, 28 xinjiekouwei street, Xicheng District, Beijing 100088

Applicant before: Qianxin Technology Group Co.,Ltd.

Applicant before: LEGENDSEC INFORMATION TECHNOLOGY (BEIJING) Inc.

GR01 Patent grant
GR01 Patent grant