Specific embodiment
Technical solution in embodiment in order to enable those skilled in the art to better understand the present invention, and make of the invention realThe above objects, features, and advantages for applying example can be more obvious and easy to understand, with reference to the accompanying drawing to technical side in the embodiment of the present inventionCase is described in further detail.
It is the method that VRRP is run under a kind of more sub-interfaces provided in an embodiment of the present invention, multiple sub-interface referring to Fig. 1Belong to the sub-interface of same three layers of physical interface, and the corresponding VRRP group of each sub-interface, multiple sub-interface are configured withIdentical VRID, as shown in Figure 1, this method may include:
Step 101, when itself for act on behalf of sub-interface when, determine the state of this sub-interface.
Step 102, when itself is non-proxy sub-interface, the shared state for acting on behalf of sub-interface.
In embodiments of the present invention, multiple sub-interface configuration phase to belong under same three layers of physical interface can be passed throughSame VRID (Virtual Route IDentifier, virtual flow-line mark), and certain in the specified sub-interface using the VRIDOne sub-interface is to act on behalf of sub-interface (can by way of specified virtual IP address authorized agency's sub-interface), uses the other of the VRIDSub-interface shares the state for acting on behalf of sub-interface.
It should be noted that in embodiments of the present invention, the VRID of sub-interface, the virtual IP address of sub-interface and sub-interfaceState refer both to the corresponding VRRP group VRID of sub-interface, virtual IP address and state, the embodiment of the present invention is subsequent no longer to be repeated.
In the embodiment of the present invention, for acting on behalf of sub-interface, need to carry out respective handling according to existing VRRP agreement, such as intoRow such as notices, elects, seizing, encapsulating at a series of processing, and for non-proxy sub-interface, it does not need according to existing VRRP agreementRespective handling is carried out, but can directly share the state for acting on behalf of sub-interface.
In the embodiment of the present invention, the shared state for acting on behalf of sub-interface may include:
When the state for acting on behalf of sub-interface is Initialize (initialization), the state of itself is also switched toInitialize;
When the state for acting on behalf of sub-interface is Master (master), the state of itself is also switched to Master;
When the state for acting on behalf of sub-interface is Backup (spare), the state of itself is also switched to Backup.
Specifically, in embodiments of the present invention, the state of sub-interface may include Initialize, Master andBackup, wherein the state for acting on behalf of sub-interface is elected according to existing VRRP agreement by state machine, and other and agencyThe identical sub-interface of sub-interface VRID does not need the process of conducting an election then, the directly shared state for acting on behalf of sub-interface.
In one embodiment, a large amount of sub-interfaces are migrated with the state transition for acting on behalf of sub-interface simultaneously in order to prevent,It has a negative impact to CPU, other sub-interfaces of the shared state for acting on behalf of sub-interface are monitoring to act on behalf of sub-interface state changeAfterwards, after a preset time in preset time threshold can be waited, then state transition is carried out.
For example, a random timer (Random_timer) can be set, timing length is (0, tn);Wherein, tnForPreset time threshold can be set, such as 50ms according to concrete application scene, 100ms etc..It is arranged after the random timer, whenWhen other sub-interfaces of the shared state for acting on behalf of sub-interface need to carry out state transition, one (0, t can be waited at randomn) sectionThe interior time, then carry out state transition.
In the embodiment of the present invention, corresponding process, agency can be configured for each sub-interface under three layers of physical interface respectivelyOther sub-interfaces except sub-interface can realize the state of monitoring agent sub-interface by the process, and according to acting on behalf of sub-interfaceState migration and carry out state transition.
In the embodiment of the present invention, it is contemplated that as physical interface UP, each sub-interface under the physical interface generally can be locatedIn available mode, and as physical interface Down, each sub-interface under the physical interface will be unavailable, i.e., same physical interfaceUnder each sub-interface reliability it is substantially consistent, therefore, it may not be necessary to be connect for each height under same physical interfaceMouth all establishes the detection method of a whole set of reliability, but can act on behalf of sub-interface by setting one, is born by acting on behalf of sub-interfaceComplete protocol interaction is blamed, and other sub-interfaces under the physical interface share the state for acting on behalf of sub-interface, are not necessarily to every heightInterface carries out the processing of VRRP agreement, to achieve the purpose that mitigate CPU burden.It referring to fig. 2, is provided in an embodiment of the present inventionThe method that VRRP is run under another more sub-interfaces, multiple sub-interface belong to the sub-interface of same three layers of physical interface, and everyThe corresponding VRRP group of one sub-interface, multiple sub-interface is configured with identical VRID, as shown in Figure 1, this method can wrapIt includes:
Step 201, Receiving Agent sub-interface configuration-direct.
It, can be identical by being configured for multiple sub-interface for belonging under same three layers of physical interface in the embodiment of the present inventionVRID, and in the specified sub-interface using the VRID a certain sub-interface be act on behalf of sub-interface (can be by specified virtual IP addressMode authorized agency sub-interface), the state for acting on behalf of sub-interface is shared using other sub-interfaces of the VRID.
Step 202 determines whether itself is to act on behalf of sub-interface according to acting on behalf of sub-interface configuration-direct.If so, going to stepRapid 203;Otherwise, step 204 is gone to.
In the embodiment of the present invention, acting on behalf of in sub-interface configuration-direct may include acting on behalf of the VRID of sub-interface, and virtualIP;It receives after acting on behalf of sub-interface configuration-direct, each sub-interface can be by comparing itself VRID and virtual IP address and generationThe VRID and virtual IP address for including in reason sub-interface configuration-direct, determine whether itself is to act on behalf of sub-interface.
When certain sub-interface determine itself VRID and virtual IP address with act on behalf of include in sub-interface configuration-direct agency sonWhen VRID and the virtual IP address difference of interface are identical, itself is determined to act on behalf of sub-interface;When certain sub-interface determines itselfVRID and virtual IP address from act on behalf of the VRID for acting on behalf of sub-interface for including in sub-interface configuration-direct and virtual IP section is differentWhen (VRID is different or virtual IP address is different) or all different, determine itself for non-proxy sub-interface.
In the embodiment of the present invention, when being equipment (below by taking routing device as an example) Configuration Agent sub-interface, road can be directed toIt is configured, can also be connect for single three layers of physics of routing device simultaneously by the sub-interface under multiple three layers of physical interfaces of equipmentSub-interface under mouthful is configured.
In the embodiment of the present invention, when multiple three layers of physical interfaces for routing device are configured, multiple three layersNon-proxy sub-interface under physical interface does not need to be handled according to VRRP agreement, but can directly share multipleThe state for acting on behalf of sub-interface under three layers of physical interface.
In the embodiment of the present invention, when single three layers of physical interface for routing device is configured, implementationIt can include but is not limited to following two:
In one embodiment, acting on behalf of in sub-interface configuration-direct further includes physical interface mark;
In this embodiment, in above-mentioned steps 202, determine whether itself is agency according to sub-interface configuration-direct is acted on behalf ofSub-interface may include:
When the physical interface of itself affiliated physical interface identifies and acts on behalf of the physical interface for including in sub-interface configuration-directIdentify it is identical, and the VRID of itself and virtual IP address and it is described act on behalf of include in sub-interface configuration-direct act on behalf of sub-interfaceWhen VRID and virtual IP address distinguish identical, itself is determined to act on behalf of sub-interface;Otherwise, it determines itself is non-proxy sub-interface.
In this embodiment, acting on behalf of to routing device issues may include physical interface mark in sub-interface configuration-directKnow, routing device receives after this acts on behalf of sub-interface configuration-direct, and each sub-interface can determine itself according to the configuration-directIt whether is to act on behalf of sub-interface.In this case, under only same three layers of physical interface it is identical with sub-interface VRID is acted on behalf of itsIts sub-interface just shares the state for acting on behalf of sub-interface under three layers of physical interface.
It in another embodiment, can when configuring VRID for the sub-interface under the three of routing device layer physical interfaceThink that the sub-interface under different three layers of physical interfaces configures different VRID.In turn, sub-interface is acted on behalf of when issuing to routing deviceThe VRID and virtual IP address for acting on behalf of sub-interface can be carried when configuration-direct, in the configuration-direct, connect without carrying physicsMouth mark.Since the VRID under different three layers of physical interface is different, the also non-proxy son of only same three layers of physical interfaceInterface can go to share the state for acting on behalf of sub-interface under three layers of physical interface.
It should be noted that in embodiments of the present invention, acting on behalf of the configuration of sub-interface in addition to generation can be issued by above-mentionedExcept the mode of reason sub-interface configuration-direct is realized, it can also realize otherwise, for example, can preset using phaseWith in the sub-interface of VRID, the smallest sub-interface of virtual IP address is to act on behalf of sub-interface;Alternatively, in sub-interface using identical VRID,The maximum sub-interface of virtual IP address is to act on behalf of sub-interface etc., and the specific implementation embodiment of the present invention repeats no more.
Step 203, the state for determining this sub-interface.
In the embodiment of the present invention, acts on behalf of sub-interface and need to carry out respective handling according to existing VRRP agreement, such as noticed,It a series of processing such as elects, seize, encapsulating, determining the state of itself.
In the embodiment of the present invention, the state of sub-interface may include Initialize, Master and Backup.
Step 204, the shared state for acting on behalf of sub-interface.
In the embodiment of the present invention, non-proxy sub-interface does not need to carry out respective handling according to existing VRRP agreement, but canDirectly to share the state for acting on behalf of sub-interface.
In the embodiment of the present invention, the shared state for acting on behalf of sub-interface may include:
When the state for acting on behalf of sub-interface is Initialize, the state of itself is also switched to Initialize;
When the state for acting on behalf of sub-interface is Master, the state of itself is also switched to Master;
When the state for acting on behalf of sub-interface is Backup, the state of itself is also switched to Backup.
In one embodiment, a large amount of sub-interfaces are migrated with the state transition for acting on behalf of sub-interface simultaneously in order to prevent,It has a negative impact to CPU, other sub-interfaces of the shared state for acting on behalf of sub-interface are monitoring to act on behalf of sub-interface state changeAfterwards, after a preset time in preset time threshold can be waited, then state transition is carried out.
For example, a random timer (Random_timer) can be set, timing length is (0, tn);Wherein, tnForPreset time threshold can be set, such as 50ms according to concrete application scene, 100ms etc..It is arranged after the random timer, whenWhen other sub-interfaces of the shared state for acting on behalf of sub-interface need to carry out state transition, one (0, t can be waited at randomn) sectionThe interior time, then carry out state transition.
In the embodiment of the present invention, corresponding process, agency can be configured for each sub-interface under three layers of physical interface respectivelyOther sub-interfaces except sub-interface can realize the state of monitoring agent sub-interface by the process, and according to acting on behalf of sub-interfaceState migration and carry out state transition.
It should be noted that in embodiments of the present invention, same sub-interface can correspond to multiple and different VRRP groups, at thisIn the case of, for any VRRP group of same sub-interface, phase can be carried out according to technical solution provided in an embodiment of the present inventionIt should handle, it can it is directed to each VRRP group respectively, configures identical VRID to belong to multiple sub-interfaces of three layers of physical interface, andUsing in each sub-interface of same VRID, only acting on behalf of sub-interface it needs to be determined that itself state, uses the non-proxy of the VRIDSub-interface can directly share the state for acting on behalf of sub-interface, and specific implementation repeats no more herein.
It is worth noting that the routing device in technical solution provided in an embodiment of the present invention can be to follow VRRPv2 editionsThe routing device of this or VRRPv3 version.
In order to make those skilled in the art more fully understand technical solution provided in an embodiment of the present invention, below with reference to specificApplication scenarios technical solution provided in an embodiment of the present invention is described.
Fig. 3 A is referred to, Fig. 3 A is VRRP group configuration schematic diagram under a kind of more sub-interfaces of typical case in the prior art.Such as Fig. 3 AIt is shown:
For 2 three layers of physical interface of Router 1 (router 1) and Router, created under each three layers of physical interface4k sub-interface, i.e. 4k VLAN termination, each sub-interface are tied to a VRF, the corresponding VRRP group of each VRF;Wherein,The VRID of each VRRP group can for any number in 1~255 (VRID of each VRRP group may be the same or different, in figure withFor 255), virtual IP address is respectively 10.100.1.254~10.115.254.254.Under normal circumstances, this 4k VRRP group meeting pairAnswer 4k VRRP state (Initialize, Master, Backup thrin).Under Master state, at regular intervals(Adver_Timer can configure, and default 1 second) can send a VRRP notification packet, and notice is under Backup stateVRRP group membership oneself also lives.At this point, if the VRRP group under multiple sub-interfaces under three layers of physical interface is atUnder Master state, and there are multiple such three layers of physical interfaces, then the pressure of CPU can be very big.
Please also refer to Fig. 3 B, Fig. 3 B is VRRP group configuration signal under a kind of more sub-interfaces provided in an embodiment of the present inventionFigure.It is as shown in Figure 3B:
For 2 three layers of physical interface of Router 1 (router 1) and Router, created under each three layers of physical interface4k sub-interface, i.e. 4k VLAN termination, each sub-interface are tied to a VRF, the corresponding VRRP group of each VRF;Wherein,The virtual IP address of each VRRP is respectively 10.100.1.254~10.115.254.254.In the embodiment of the present invention, connect in different sonsIt on mouth, configures same VRID (VRID can be any number in 1~255, in figure for 255), and specified using shouldThe state of the shared VRRP group using a certain virtual IP address (in figure by taking 10.100.1.254 as an example) of the VRRP group of VRID.Use the voidThe VRRP group of quasi- IP (10.100.1.254) abides by the state machine of VRRP agreement completely, is normally noticed, and elects, seizes,The a series of actions such as encapsulation.It is directly shared to be somebody's turn to do without above-mentioned movement for using the VRRP group of other virtual IP addresses of the VRIDThe state of specified virtual IP address.
When the state of the VRRP group using the virtual IP address is Initialize, all other VRRP group with the VRIDState be Initialize.
When the state of the VRRP group using the virtual IP address is Master, the shape of all other VRRP group with this VRIDState is Master.Wherein, except the Master state for the VRRP group for specifying virtual IP address using this is elected by state machineOuter, the every other VRRP group with this VRID, without normal Master election process.
When the state of the VRRP group using the virtual IP address is Backup, all other VRRP group with this VRID is cutChange to Backup state.
Based on above-mentioned configuration, except the VRRP group on sub-interface interface1.1 needs to carry out normal VRRP negotiation, a surnameClaim outside Master, the VRRP group on remaining sub-interface is negotiated without VRRP, the VRRP on directly shared interface1.1It organizes negotiating as a result, saving a large amount of cpu resource, reduces the load of CPU.
Through above description as can be seen that in technical solution provided in an embodiment of the present invention, by belong to same threeMultiple sub-interfaces of layer physical interface configure identical VRID, and to be connect using all sub-interface authorized agency of the VRIDMouthful, only act on behalf of sub-interface it needs to be determined that itself state, non-proxy sub-interface share the state for acting on behalf of sub-interface, withoutIt needs to carry out respective handling according to existing VRRP agreement, reduces the pressure of CPU when running VRRP under more sub-interfaces.
Fig. 4 is referred to, is the structural representation for running the device of VRRP under a kind of more sub-interfaces provided in an embodiment of the present inventionFigure, wherein the multiple sub-interface belongs to the sub-interface of same three layers of physical interface, and the corresponding VRRP of each sub-interfaceGroup, the multiple sub-interface identify VRID configured with identical virtual router, which corresponds to a sub-interface, such as Fig. 4 instituteShow, the apparatus may include:
Determination unit 410 is when acting on behalf of sub-interface, to determine the shape of the sub-interface for the corresponding sub-interface of described deviceState;
Shared cell 420, for sharing and acting on behalf of sub-interface when the corresponding sub-interface of described device is non-proxy sub-interfaceState.
Fig. 5 is referred to, is shown to run the structure of device of VRRP under the more sub-interfaces of another kind provided in an embodiment of the present inventionIt is intended to, for the embodiment on the basis of aforementioned embodiment illustrated in fig. 5, described device can also include: receiving unit 430;Wherein:
Receiving unit 430 is used for Receiving Agent sub-interface configuration-direct;
The determination unit 410 can be also used for determining that described device is corresponding according to the sub-interface configuration-direct of acting on behalf ofSub-interface whether be to act on behalf of sub-interface.
In one embodiment, described to act on behalf of including the VRID for acting on behalf of sub-interface in sub-interface configuration-direct, and virtually mutuallyNetworking protocol address ip;
Correspondingly, the determination unit 410 can be specifically used for the VRID when the corresponding sub-interface of described device, andVirtual IP address and it is described act on behalf of the VRID for acting on behalf of sub-interface for including in sub-interface configuration-direct and virtual IP address difference it is identical when,Itself is determined to act on behalf of sub-interface;Otherwise, it determines the corresponding sub-interface of described device is non-proxy sub-interface.
In one embodiment, described act on behalf of in sub-interface configuration-direct can also include that physical interface identifies;
Correspondingly, the determination unit 410 can be specifically used for working as the affiliated physical interface of the corresponding sub-interface of described devicePhysical interface mark it is identical as the physical interface mark that includes in sub-interface configuration-direct acted on behalf of, and described device correspondenceSub-interface VRID and virtual IP address and it is described act on behalf of the VRID for acting on behalf of sub-interface for including in sub-interface configuration-direct, withAnd virtual IP address difference it is identical when, determine the corresponding sub-interface of described device be act on behalf of sub-interface;Otherwise, it determines described device is correspondingSub-interface be non-proxy sub-interface.
In one embodiment, the shared cell 420, can be specifically used for:
When the state for acting on behalf of sub-interface is initialization Initialize, by the shape of the corresponding sub-interface of described deviceState is also switched to Initialize;
When the state for acting on behalf of sub-interface is main Master, the state of the corresponding sub-interface of described device is also switchedFor Master;
When the state for acting on behalf of sub-interface is spare Backup, the corresponding sub-interface state of described device is also switchedFor Backup.
In one embodiment, the shared cell 420 can monitor that the sub-interface state of acting on behalf of becomes specifically for working asAfter change, after waiting a random time in preset time threshold, the corresponding sub-interface state of described device is switched to describedState after acting on behalf of sub-interface variation.
The function of each unit and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatusRealization process, details are not described herein.
Fig. 6 is referred to, is one kind of equipment where running the device of VRRP under more sub-interfaces provided in an embodiment of the present inventionHardware structure diagram, including processor 610 and nonvolatile memory 620, processor 610 and nonvolatile memory 620 pass throughBus is connected.Wherein, processor 610 is used to execute the machine readable instructions module of the storage of nonvolatile memory 620.It is non-volatileProperty memory 620 be stored with the executable machine readable instructions module of processor 610.When being stored in nonvolatile memory 620In instruction module by processor 610 execute when, it can be achieved that aforementioned determination unit 410, shared cell 420 and receiving unit430 function.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method realityApply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unitThe unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be withIt is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actualThe purpose for needing to select some or all of the modules therein to realize the present invention program.Those of ordinary skill in the art are not payingOut in the case where creative work, it can understand and implement.
As seen from the above-described embodiment, it is configured by multiple sub-interfaces to belong to same three layers of physical interface identicalVRID, and using all sub-interface authorized agency sub-interfaces of the VRID, only to act on behalf of sub-interface it needs to be determined that itself shapeState, non-proxy sub-interface share the state for acting on behalf of sub-interface, without carrying out respective handling according to existing VRRP agreement,Reduce the pressure of CPU when running VRRP under more sub-interfaces.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention itsIts embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes orPerson's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present inventionOr conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by followingClaim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, andAnd various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.