CN102479101A - Binding method for network interface - Google Patents

Binding method for network interface Download PDF

Info

Publication number
CN102479101A
CN102479101A CN2010105703433A CN201010570343A CN102479101A CN 102479101 A CN102479101 A CN 102479101A CN 2010105703433 A CN2010105703433 A CN 2010105703433A CN 201010570343 A CN201010570343 A CN 201010570343A CN 102479101 A CN102479101 A CN 102479101A
Authority
CN
China
Prior art keywords
binding
network interface
driver
electronic installation
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.)
Pending
Application number
CN2010105703433A
Other languages
Chinese (zh)
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.)
Inventec Corp
Original Assignee
Inventec Corp
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 Inventec Corp filed Critical Inventec Corp
Priority to CN2010105703433A priority Critical patent/CN102479101A/en
Publication of CN102479101A publication Critical patent/CN102479101A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides a binding method for a network interface, which comprises the following steps of: firstly, checking if an electronic device is loaded with a binding driver, for loading the binding driver; if yes, reloading the binding driver after the binding driver is unloaded; allocating a network address and a network mask to a virtual network interface; setting a plurality of entity network interfaces as the subordinate interfaces of the virtual network interface; obtaining a binding mode, thereby setting the binding mode to the virtual network interface; and executing the binding driver, thereby binding the entity network interfaces as the virtual network interfaces.

Description

The binding method of network interface
Technical field
The present invention relates to a kind of binding method of network interface, and particularly relate to a kind of binding method and computer program product thereof of avoiding the network interface of boots.
Background technology
Along with development of science and technology, world-wide web universal day by day, people use the frequency of world-wide web also significantly to promote, and therefore how to strengthen Network Transmission usefulness and then are one of present research.Wherein, link aggregation (Link aggregation) is a kind of a plurality of network cables (cable)/parallel connection in connectivity port (port) that utilizes, under limited equipment, to increase the technology of connection speed.For example, network card binding promptly is a kind of link aggregation technology.
Network card binding is to combine to throw the net to block to increase the network bandwidth more, uses and realizes that bandwidth is integrated to reach, (Quality of Service, integral body QoS) solves service quality in the multi-path access.For instance; The card transfer rate of supposing whenever to throw the net is 100Mb; To bind (bonding) be a Microsoft Loopback Adapter (that is to say these four throw the net that card will be treated as be a Microsoft Loopback Adapter) to card if throw the net four, and the transfer rate of this Microsoft Loopback Adapter then is 400Mb/s.And the method for traditional network card binding is to set through writing configuration file (configuration file), and start again after setting completion.
Summary of the invention
The present invention provides a kind of binding method and computer program product thereof of network interface, can under the state of restarting systems not, bind action.
Particularly, the present invention proposes a kind of binding method of network interface.This binding method is applicable to electronic installation.At first, whether the inspection electronic installation loaded binding driver, is written into will bind driver.If the loaded binding driver of electronic installation after driver is bound in unloading, is written into the binding driver again.Then, distribution network address and network shade are given a virtual network interface.And, set a plurality of physical network interfaces slave interface of virtual network interface for this reason.In addition, obtain binding pattern to be set to virtual network interface.Afterwards, carry out the binding driver so that above-mentioned physical network interface is bound virtual network interface.
In one embodiment of this invention, the binding method of above-mentioned network interface comprises also whether the inspection electronic installation exists above-mentioned physical network interface.
In one embodiment of this invention; Above-mentionedly obtaining binding pattern with after being set to virtual network interface; Can the binding pattern of virtual network interface be shown, and can show the medium access control address of above-mentioned physical network interface, watch for the user to display unit.
In one embodiment of this invention, above-mentioned inspection electronic installation whether the step of loaded binding driver be to utilize whether inspection one variable is that null value is judged.If variable is a null value, judge that electronic installation is not written into the binding driver, therefore directly be written into the binding driver.If variable is not a null value, judges the loaded binding driver of electronic installation, thereby after driver is bound in unloading, be written into the binding driver again.
Based on above-mentioned; The present invention is the binding method that automatically performs network interface; Can save the time of manually writing configuration file (configuration file), and can under without the situation of restarting systems, accomplish the binding action, and then save the time of restarting systems.
For letting the above-mentioned feature and advantage of the present invention can be more obviously understandable, hereinafter is special lifts embodiment, and conjunction with figs. elaborates as follows.
Description of drawings
Fig. 1 is the binding method process flow diagram according to a kind of network interface of one embodiment of the invention.
Fig. 2 is a kind of input interface synoptic diagram of selecting binding pattern according to one embodiment of the invention.
Fig. 3 is a kind of display interface synoptic diagram that shows binding result according to one embodiment of the invention.
The main element symbol description
S105-S135: each step of the binding method of the network interface of one embodiment of the invention
Embodiment
Fig. 1 is the binding method process flow diagram according to a kind of network interface of one embodiment of the invention.Present embodiment is applicable to electronic installation.
At first, in step S105, whether the inspection electronic installation loaded binding driver (bonding driver).Whether for instance, can set up a variable to write down the binding driver loaded.When not being written into the binding driver, this variable is null value (Null), and when being written into the binding driver, just the result is write variable so far.In view of the above, whether be that null value can learn whether the binding driver is loaded by this variable of inspection.If this variable is a null value, judge that electronic installation is not written into the binding driver as yet, execution in step S115 is written into the binding driver.If this variable is not a null value, judge the loaded binding driver of electronic installation, execution in step S110, driver is bound in unloading (unload).Afterwards, be written into the binding driver more again, shown in step S115.This is not remove fully and running after having influence on for fear of preceding parameter of once binding flow process.
With linux system, be used for that the network interface of throwing the net is regarded as same more and use and provide the function of load balance (load-balancing) and fault-tolerant (fault-tolerance) to be referred to as " Bonding ".Suppose, set up variable “ $BONDINGDRV " write down whether bind driver loaded.Therefore, lsmod instruction capable of using and grep instruct and check variable “ $BONDINGDRV after start ", whether loaded to confirm binding driver.Wherein, the lsmod instruction is in order to list the module of all loaded systems, and the grep instruction then is the word string that is used for searching in the file.If variable “ $BONDINGDRV " be not null value, utilize rmmod to instruct earlier and unload the binding driver, be written into the binding driver more again.And if variable “ $BONDINGDRV " be null value, then directly utilize modprobe to instruct and be written into the binding driver.After being written into the binding driver, again the result is assigned to variable “ $BONDINGDRV " lining.
After being written into the binding driver, shown in step S120, distribution network address (Internet Protocol Address) and network shade (netmask) are given a virtual network interface.The title of this virtual network interface for example is " bond0 ".For example, a group network address and network shade be can distribute automatically, also can a group network address and network shade be specified by the user.
In addition, before being written into the binding driver, can check whether there are at least two physical network interfaces in the electronic installation earlier.This is because will exist two or more physical network interfaces can carry out binding function at least.If there is not the physical network interface in electronic installation or only exist a physical network interface then to stop binding function.
Then, in step S125, subordinate (slave) interface that to set a plurality of physical network interfaces be virtual network interface.At least select two physical network interfaces, so that selected physical network interface is bound single virtual network interface.
Each physical network interface all has its control of corresponding medium access (Media Access Control, MAC) address
Afterwards, in step S130, obtain binding pattern to be set to virtual network interface.At this, predeterminable wherein a kind of binding pattern is set to virtual network interface.Perhaps, provide an input interface to supply the user to select wherein a kind of binding pattern.After each parameter is all set completion, shown in step S135, carry out and bind driver so that above-mentioned physical network interface is bound virtual network interface.
In addition, a kind of computer program can be provided, it comprises programmed instruction in order to carry out the binding method of above-mentioned network interface.(for example the setting up organization chart procedure code fragment, sign-off list procedure code fragment, setting program chip segment and deployment program chip segment) that this computer program is made up of most procedure code fragments basically; And these procedure code fragments can be accomplished the binding method of above-mentioned network interface in being written into electronic installation and after carrying out.
For example, write this computer program with program language scripts such as " Shell Script " and can provide user's interface to supply the user to select parameter and show to bind result afterwards.
For instance, Fig. 2 is a kind of input interface synoptic diagram of selecting binding pattern according to one embodiment of the invention.Please with reference to Fig. 2, in the present embodiment, binding pattern comprises seven kinds of patterns.Pattern 0 (Balance Round-Robin) pattern that circulates in regular turn for balance, pattern 1 are backup (Active Backup) pattern initiatively, and pattern 2 is balance mutual exclusion or (Balance XOR) pattern; Pattern 43 is broadcasting (Broadcast) pattern; Pattern 4 is 802.3ad pattern (according to the standard of IEEE802.3ad), and pattern 5 is traffic load balance (Transmit Load Balance, TLB) pattern; Pattern 6 is for adapting to load balance (Adaptive Load Balance, ALB) pattern.The user can key in the binding pattern that desire is selected in this input interface.
Fig. 3 is a kind of display interface synoptic diagram that shows binding result according to one embodiment of the invention.Please, after selected physical network interface is bound virtual network interface, can this display interface be presented in the display unit for user's reference with reference to Fig. 3.The title of each physical network interface and corresponding medium access control (Media Access Control, MAC) address have been shown in this display interface.Wherein, " eth0 ", " eth1 ", " eth2 " reach " eth3 " and represent four physical network interfaces respectively, and " bond0 " is virtual network interface.With " eth0 ", its MAC Address is " 00:23:AE:FB:52:FF ".
After virtual network interface is set up completion, also can in display interface, show the version of binding driver, the binding pattern (is pattern 0 at this) of virtual network interface, and the state of each physical network interface.
In sum, the present invention utilizes script to write a computer program to carry out the binding method of above-mentioned network interface, can under without the situation of restarting systems, accomplish the binding action in view of the above, and carry out computing with virtual network interface.Can save the time of restarting systems thus, and save the time of manually writing configuration file (configuration file).
Though the present invention discloses as above with embodiment, so it is not in order to limiting the present invention, any under those of ordinary skill in the technical field, when can doing a little change and retouching, and do not break away from the spirit and scope of the present invention.

Claims (6)

1. the binding method of a network interface is applicable to electronic installation, and this binding method comprises:
Check whether loaded binding driver of this electronic installation;
Should bind driver if this electronic installation is loaded, behind this binding driver of unloading, be written into this binding driver again;
Distribution network address and network shade are given virtual network interface;
Set the slave interface of a plurality of physical network interfaces for this virtual network interface;
Obtain binding pattern to be set to this virtual network interface; And
Carry out this binding driver so that those physical network interfaces are bound this virtual network interface.
2. the binding method of network interface according to claim 1 wherein also comprises:
Check whether this electronic installation exists those physical network interfaces.
3. the binding method of network interface according to claim 1, wherein obtain this binding pattern with the step that is set to this virtual network interface after, also comprise:
This binding pattern that shows this virtual network interface is to display unit.
4. the binding method of network interface according to claim 1, wherein obtain this binding pattern with the step that is set to this virtual network interface after, also comprise:
The medium access control address that shows those physical network interfaces.
5. the binding method of network interface according to claim 1, wherein check this electronic installation whether the step of loaded this binding driver comprise:
Whether the inspection variable is null value.
6. the binding method of network interface according to claim 5, wherein this variable of inspection whether be null value step after, also comprise:
If this variable is a null value, judges that this electronic installation is not written into this binding driver, and directly be written into this binding driver; And
If this variable is not a null value, judges loaded this binding driver of this electronic installation, and after unloading should be bound driver, be written into this binding driver again.
CN2010105703433A 2010-11-24 2010-11-24 Binding method for network interface Pending CN102479101A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010105703433A CN102479101A (en) 2010-11-24 2010-11-24 Binding method for network interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010105703433A CN102479101A (en) 2010-11-24 2010-11-24 Binding method for network interface

Publications (1)

Publication Number Publication Date
CN102479101A true CN102479101A (en) 2012-05-30

Family

ID=46091754

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105703433A Pending CN102479101A (en) 2010-11-24 2010-11-24 Binding method for network interface

Country Status (1)

Country Link
CN (1) CN102479101A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108985397A (en) * 2018-06-15 2018-12-11 北京信安世纪科技股份有限公司 A kind of method, apparatus and computer storage medium for inquiring Bond information
CN113722000A (en) * 2021-11-03 2021-11-30 苏州浪潮智能科技有限公司 Intelligent network card configuration method and device, electronic equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6157965A (en) * 1998-02-27 2000-12-05 Intel Corporation System and method for binding a virtual device driver to a network driver interface
CN1556625A (en) * 2004-01-05 2004-12-22 联想(北京)有限公司 Data transmission method of network equipment based on multinetwork card and device
US20090007099A1 (en) * 2007-06-27 2009-01-01 Cummings Gregory D Migrating a virtual machine coupled to a physical device
CN101815014A (en) * 2010-02-09 2010-08-25 上海百络信息技术有限公司 Real-time network data capture method based on connection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6157965A (en) * 1998-02-27 2000-12-05 Intel Corporation System and method for binding a virtual device driver to a network driver interface
CN1556625A (en) * 2004-01-05 2004-12-22 联想(北京)有限公司 Data transmission method of network equipment based on multinetwork card and device
US20090007099A1 (en) * 2007-06-27 2009-01-01 Cummings Gregory D Migrating a virtual machine coupled to a physical device
CN101815014A (en) * 2010-02-09 2010-08-25 上海百络信息技术有限公司 Real-time network data capture method based on connection

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108985397A (en) * 2018-06-15 2018-12-11 北京信安世纪科技股份有限公司 A kind of method, apparatus and computer storage medium for inquiring Bond information
CN108985397B (en) * 2018-06-15 2022-02-18 北京信安世纪科技股份有限公司 Method and device for inquiring Bond information and computer storage medium
CN113722000A (en) * 2021-11-03 2021-11-30 苏州浪潮智能科技有限公司 Intelligent network card configuration method and device, electronic equipment and readable storage medium
CN113722000B (en) * 2021-11-03 2022-02-18 苏州浪潮智能科技有限公司 Intelligent network card configuration method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US11513808B2 (en) Automatic switching and deployment of software or firmware based USB4 connection managers
US8521929B2 (en) Virtual serial port management system and method
US10333865B2 (en) Transformation of peripheral component interconnect express compliant virtual devices in a network environment
US8468276B2 (en) Configuring an input/output adapter
US9026818B2 (en) Priority-based power capping in data processing systems
US8336061B2 (en) Driver configuration
US20150095472A1 (en) Resource Affinity Via Dynamic Reconfiguration for Multi-Queue Network Adapters
US8918568B2 (en) PCI express SR-IOV/MR-IOV virtual function clusters
US10372639B2 (en) System and method to avoid SMBus address conflicts via a baseboard management controller
CN106557444B (en) Method and device for realizing SR-IOV network card and method and device for realizing dynamic migration
US9417886B2 (en) System and method for dynamically changing system behavior by modifying boot configuration data and registry entries
US20100106881A1 (en) Hot plug ad hoc computer resource allocation
US8271707B2 (en) Method and system for PCI hybrid function
CN110113184B (en) KVM virtual machine network optimization method and device under SR-IOV environment
US20160371107A1 (en) System and Method to Discover Virtual Machines from a Management Controller
US20150370576A1 (en) Method to Facilitate Rapid Deployment and Redeployment of an Inforamtion Handling System
US8671228B1 (en) System and methods for managing virtual adapter instances
US20170017515A1 (en) Virtual Network Provisioning Prior to Virtual Machine Manager Launch by Loading a Partitioned Network Device with Attribute Data
US20170132164A1 (en) Unified Extensible Firmware Interface System Management Mode Initialization Protections with System Management Interrupt Transfer Monitor Sandboxing
DE112020006858T5 (en) DYNAMIC INTERRUPT DEPLOYMENT
CN105790991A (en) Link aggregation method and system for virtualization server and intelligent network adapter thereof
CN104731635A (en) Virtual machine access control method and virtual machine access control system
WO2013101086A1 (en) Boot strap processor assignment for a multi-core processing unit
EP2491489A1 (en) Communication between partitions in a logically partitioned system by bypassing the network stack when communicating between applications executed on the same data processing system
CN112698871A (en) Network adapter configuration using OPTION-ROM in multi-CPU device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20120530