Content of the invention
In view of this, the communication means between a kind of virtual unit of present invention offer and device are virtual in prior art to solve
The problem of service port communication is taken between equipment.
Specifically, the present invention is achieved through the following technical solutions:
The present invention provides the communication means between a kind of virtual unit, and what methods described was applied in physical equipment virtual sets
Standby, methods described includes:
In the outgoing direction that the exit port forwarding the first message is local first interconnection port, by described first message loopback
To described first interconnection port enter direction, afterwards by described first message from described first interconnection port enter direction mirror picture to
The outgoing direction of the second interconnection port of opposite end virtual unit, the second interconnection of described first interconnection port peer end of the connection virtual unit
Port;
When opposite end virtual unit is by the outgoing direction of the second message mirror to local first interconnection port, by the second message ring
Return to the first interconnection port enters direction, is that the second message determines the exit port forwarding and forwarded.
Further, described first message is entered direction mirror picture to the second of opposite end virtual unit from the first interconnection port
The outgoing direction of interconnection port, including:
Locally finding the mirror policy that occurrence is the first interconnection port, the priority of described mirror policy is higher than virtual
The priority of the isolation rule between equipment, described mirror policy also includes action-item, and described action-item is by the first message mirror
Outgoing direction as the second interconnection port to opposite end virtual unit;
Action-item based on described mirror policy is by the second interconnection port of the first message mirror to opposite end virtual unit
Outgoing direction.
Further, the exit port of the first message is forwarded to determine by following steps:
In the forwarding-table item locally finding the first message coupling;
The exit port of forwarding-table item is defined as forwarding the exit port of the first message.
Further, the exit port of the first message is forwarded to determine by following steps:
When to identify described first message be the message that the CPU on described physical equipment sends, by local first interconnection port
Outgoing direction be appointed as forwarding the exit port of the first message.
Further, methods described also includes:
The exit port of described forwarding the first message is the outgoing direction of local first interconnection port is according to load balancing mode
Go out from the first interconnection port group selection;
Described second message is to enter direction mirror as to this equipment by opposite end virtual unit from the second interconnection port;Its
In, opposite end virtual unit is to select going out from the second interconnection port according to load balancing mode from the second interconnection port group
Direction sends execution mirror image operation during the second message.
Based on identical design, the present invention also provides the communicator between a kind of virtual unit, and described device is applied to thing
Virtual unit in reason equipment, described device includes:
Mirror image unit, for forward the first message exit port be local first interconnection port outgoing direction when, by institute
That states that the first message loops back to described first interconnection port enters direction, afterwards by described first message from described first interconnection port
Enter direction mirror picture to the outgoing direction of the second interconnection port of opposite end virtual unit, described first interconnection port peer end of the connection is virtual
Second interconnection port of equipment;
Retransmission unit, in opposite end virtual unit by the outgoing direction of the second message mirror to local first interconnection port
When, enter direction by what the second message was looped back to the first interconnection port, be that the second message determines the exit port forwarding and forwarded.
Further, described mirror image unit, specifically for locally finding the mirror image plan that occurrence is the first interconnection port
Slightly, the priority of described mirror policy is higher than the priority of the isolation rule between virtual unit, and described mirror policy also includes
Action-item, described action-item is by the outgoing direction of the second interconnection port of the first message mirror to opposite end virtual unit;Based on institute
State the action-item of mirror policy by the outgoing direction of the second interconnection port of the first message mirror to opposite end virtual unit.
Further, described device also includes:
First determining unit, in the forwarding-table item locally finding the first message coupling;Exit port by forwarding-table item
It is defined as forwarding the exit port of the first message.
Further, described device also includes:
When second determining unit is the message that the CPU on described physical equipment sends for identifying described first message, will
The outgoing direction of local first interconnection port is appointed as forwarding the exit port of the first message.
Further, described device also includes:
Port select unit, for according to load balancing mode from local first interconnection port group selection the first interconnection port
Outgoing direction as forward described first message exit port;
Described second message in described retransmission unit is to enter direction mirror by opposite end virtual unit from the second interconnection port
As to this equipment;Wherein, opposite end virtual unit be according to load balancing mode select from the second interconnection port group from
The outgoing direction of the second interconnection port sends execution mirror image operation during the second message.
As can be seen here, the present invention is by being the outgoing direction of local first interconnection port in the exit port forwarding the first message
When, enter direction by what described first message looped back to described first interconnection port, afterwards by described first message from described first
Interconnection port enter direction mirror picture to the outgoing direction of the second interconnection port of opposite end virtual unit, then through loopback mechanism, make report
What literary composition was forwarded to this interconnection port enters direction.Therefore the present invention realizes leading between multi-tenant virtual unit by inner passage
Letter, improves the utilization rate of internal bandwidth, and the networking breaking away from External cable limits so that disposing more flexibility and reliability, and drops
Low hardware cost.
Specific embodiment
In order to solve the problems, such as prior art, the invention provides the communication means between a kind of virtual unit and dress
Put, during the outgoing direction being local first interconnection port by the exit port in forwarding the first message, by described first message loopback
To described first interconnection port enter direction, afterwards by described first message from described first interconnection port enter direction mirror picture to
The outgoing direction of the second interconnection port of opposite end virtual unit, then through loopback mechanism, make message be forwarded to entering of this interconnection port
Direction.The communication that therefore present invention realizes between multi-tenant virtual unit by the inner passage between interconnection port, improves
The utilization rate of internal bandwidth, the networking breaking away from External cable limits so that disposing more flexibility and reliability, and reduces hardware
This.
Refer to Fig. 1, be the place of the communication means between a kind of one of illustrative embodiments of present invention virtual unit
Reason flow chart, the method is applied to the virtual unit in physical equipment, at least includes two virtual units, thing in this physical equipment
Reason equipment can provide the user setting function, if that is, user needs local virtual equipment and opposite end virtual unit to be communicated,
Then can be configured in this physical equipment, specifically, can be in advance in local virtual equipment with opposite end virtual unit
It is respectively provided with the first interconnection port and second interconnection port of neighborhood each other, methods described includes:
Step 101, forward the first message exit port be local first interconnection port outgoing direction when, by the first message
Loop back to the first interconnection port enters direction;
In the present embodiment, local virtual equipment is forwarding the first interconnection port that the exit port of the first message is local to go out
During direction, direction can be entered by what described first message looped back to described first interconnection port, wherein said outgoing direction refers to message
From virtual unit to the direction of outgoing;Enter direction and refer to the direction that message enters from export-oriented virtual unit;As an embodiment, this
In loopback refer to the first message is first forwarded to the link layer unit of physical equipment from the outgoing direction of described first interconnection port
When (for example, mac/phy chip), judge whether the exit port of this first message is interconnection port, if so, then from link layer unit
Enter direction by what the first message passed back to described first interconnection port;If it is not, then by the first message according to normal flow from first
The outgoing direction of interconnection port is tabled look-up forwarding.In prior art, due to the message of outgoing direction is set in link layer can only outgoing
Instruction, therefore the message of outgoing direction can only be sent to the equipment beyond physical equipment, so just needing in exit port by external
Cable is realizing the interaction between virtual unit.And the present invention can by loopback mechanism by message from the outgoing direction of interconnection port
Passing back to into direction, being forwarded by the inner passage between virtual unit further, thus saving external cable
Expense, and the utilization rate of internal bandwidth can be improved.
Step 102, by the first message from the first interconnection port enter direction mirror picture to opposite end virtual unit second interconnection
The outgoing direction of port;
In the present embodiment, mirror policy can be issued on local virtual equipment, mirror policy includes occurrence in advance
And action-item, wherein occurrence for source port be the first interconnection port enter direction;Action-item is that the first message mirror is extremely right
The outgoing direction of the second interconnection port of end virtual unit, can successfully be mirrored to opposite end virtual unit for guarantee message, can this mirror
As the priority of strategy is higher than the priority of the isolation rule between virtual unit.The first interconnection port when local virtual equipment
Enter after direction receives this first message, can locally find the mirror policy that occurrence is the first interconnection port, Ran Houji
In described mirror policy action-item by the outgoing direction of the second interconnection port of the first message mirror to opposite end virtual unit;Then
By the first packet loss at the first interconnection port.
Opposite end virtual unit, after the first message that the outgoing direction of the second interconnection port is connected to, can be reported first further
Literary composition is looped back to the direction that enters of this second interconnection port, the loop back method principle phase in concrete loop back method and local virtual equipment
With here is omitted.
In the same manner, when opposite end virtual unit is by the outgoing direction of the second message mirror to local first interconnection port, locally empty
Propose and standby can enter direction by what the second message was looped back to the first interconnection port, if the destination address non-interconnected port of the second message
Address, then for second message determine forward exit port and forwarded.
In optional embodiment of the present invention, local virtual equipment determines exit port specifically for the first message, first at this
Ground finds the forwarding-table item of the first message coupling by source port;Then the exit port in this forwarding-table item is defined as forwarding
The exit port of one message.
If additionally, the first message be by CPU send when directly to specify exit port be described first interconnection port, due to the
One message does not carry out tabling look-up forwarding it is impossible to application mirror image is regular in exchange chip.Therefore, when local virtual equipment identifies institute
When to state the first message be the protocol massages that the CPU on described physical equipment sends, can be by the side of going out of local first interconnection port
To being appointed as forwarding the exit port of the first message;By this first message from the outgoing direction of the first interconnection port after forwarding process
Loop back to the first interconnection port enters direction.
In optional embodiment of the present invention, local virtual equipment can will be local many including the first interconnection port
Individual interconnection port aggregates into the first interconnection port group, and in the same manner, opposite end virtual unit can will be many including the second interconnection port
Individual interconnection port aggregates into the second interconnection port group, and each local interconnection port group has uniquely corresponding interconnection port in opposite end
Group.Therefore when the first interconnection port group receives the message being sent to the second interconnection port group, can by load balancing mode from
Select the first interconnection port to carry out message forwarding in first interconnection port group, the first message is looped back to described first interconnection port
Enter direction, afterwards the first message is entered direction mirror picture to the second interconnection port of opposite end virtual unit from the first interconnection port
Outgoing direction.
When opposite end virtual unit sends the second message, can select from the second interconnection port group according to load balancing mode
Select out from the outgoing direction of the second interconnection port as the exit port of the second message, after loopback, the second message second is interconnected
The outgoing direction entering the first interconnection port to the first interconnection port group of local virtual equipment for the direction mirror picture of port.Therefore originally
Invention can improve the utilization rate of bandwidth and the forward efficiency of message between virtual unit by load balancing.
For making the objects, technical solutions and advantages of the present invention become more apparent, with reference to Fig. 2 to the solution of the present invention
It is described in further detail.
Refer to the connection diagram that Fig. 2 is multi-tenant virtual unit in the embodiment of the present invention, the wherein CPU of physical equipment
May include master control borad CPU and multiple veneer CPU, such as veneer 1CPU to veneer NCPU, the CPU on every piece of board all with multi-tenant
Virtual unit MDC1, MDC2 connect, wherein, each MDC both can be made up of the forwarding chip of a veneer or by
The forwarding chip of multiple veneers is constituted, and the port of a forwarding chip can only belong to a MDC, as shown in Fig. 2 shown
On MDC1, port P1 and P2 is set, MDC2 arranges port P3 and P4, described port P1, P2, P3, P4 are on network board
Physical port.
In the prior art, if desired MDC1 is communicated with MDC2, then need the physical port on MDC1 and MDC2
Coupled together by physical circuit, and in embodiments of the invention, the script on network board can be needed to carry out physical cord
The port that road connects is arranged to interconnection port, so that the interconnection port between MDC is communicated by inner passage, thus avoiding
External cable.
In the present embodiment, if there is the corresponding relation of multiple interconnection port between MDC, plurality of interconnection port right
Multiple interconnection port of the corresponding opposite end MDC of interconnection port that can be local MDC should be related to, or local MDC's is many
One interconnection port of the corresponding opposite end MDC of individual interconnection port;Or be multiple interconnection port correspondence opposite end MDC of local MDC
Multiple interconnection port;So the polymerization of these interconnection port can be become interconnection port group, the interconnection port of both end of which MDC
Port number in group can be different.For example, if the port P3 of the port P1 of MDC1 and MDC2 is interconnection port, the end of MDC1
The port P4 of mouth P2 and MDC2 is interconnection port, then port P1 and port P2 can be polymerized to the interconnection port group 1 on MDC1;
Port P3 and port P4 is polymerized to the interconnection port group 2 on MDC2.When interconnection port group receives message, can be according to load point
The mode of load, selects an interconnection port and undertakes message forwarding work.Specific load sharing method is with subject of the present invention no
Close, no longer describe in detail herein.
Refer to the Message processing flow process of Fig. 3, including step:
Step 301, reception message, determine the exit port of message;
In the present embodiment, when MDC1 receives when being data message of message by the port of itself, can be according to data
The destination address of message searches two-layer retransmitting table/tri- layer retransmitting table, the exit port determining this data message on MDC2, due to
Interconnection port group 1 and interconnection port group 2 is pre-set, then MDC1 can determine that the exit port of local terminal is between MDC1 and MDC2
Interconnection port in interconnection port group 1, for example, it is possible to go out end according to mode selection port P1 of load balancing as this message
Mouthful.
Additionally, if this message is the protocol massages of 1 exit port specified receiving from CPU, this message does not forward
List item, then be that the exit port that this message is specified is forwarded according to CPU.
Step 302, message is entered direction from what the outgoing direction of port was looped back to port;
In the present embodiment, when MDC1 determines the exit port of message for interconnection port P1, institute can be completed on forwarding chip
After having repeating process, before interconnection port P1 is gone out, enter direction by what this message entered that downlink layer is looped back to this interconnection port P1.
As shown in the four-headed arrow at Fig. 2 middle port P1, port P3.
Step 303, by this message mirror to opposite end interconnection port, and abandon the message of local terminal;
When message reaches after entering direction of interconnection port P1, the mirror image entering direction that source port is P1 is searched according to occurrence
Strategy, the action-item that this mirror policy is recorded is specially the outgoing direction of message mirror to interconnection port P3;Thus further according to this
Mirror policy, replicates this message to the outgoing direction of interconnection port P3;Then according to the drop policy pre-setting, MDC1 is mutual
Packet loss on connection port P1.
Whether step 304, the exit port judging this message are interconnection port, if so, then go to step 302;If it is not, then turning step
Rapid 305;
After MDC2 receives this message from the outgoing direction of interconnection port P3, two can be searched according to the destination address of this message
Layer retransmitting table/tri- layer retransmitting table, determines whether the exit port of this message is interconnection port.
Step 305, this message is forwarded from the outgoing direction of this interconnection port, and terminate.
When the exit port determining this message is interconnection port, the operation of repeat step 301, until this message is forwarded to
Target port;When determining the exit port non-interconnected port of this message, this message can be forwarded to target according to forwarding-table item
Port.
Therefore, the present invention can carry out the intercommunication between virtual unit by inner passage under conditions of not needing line.
Based on identical design, the present invention also provides the communicator between a kind of virtual unit, and this device can pass through soft
Part is realized it is also possible to be realized by way of hardware or software and hardware combining.As a example implemented in software, the virtual unit of the present invention
Between communicator as the device on a logical meaning, be by meter corresponding in memorizer by the CPU of its place equipment
Calculation machine programmed instruction runs after reading and forms.
Refer to Fig. 4 a, be the communicator 400 between a kind of one of illustrative embodiments of present invention virtual unit,
Described device is applied to the virtual unit in physical equipment, and the basic running environment of this device includes CPU, memorizer, network interface,
Exchange chip and other hardware, from logic level, the logical structure of this device 400 as shown in Figure 4 b, including:
Mirror image unit 401, for forward the first message exit port be local first interconnection port outgoing direction when, will
What described first message looped back to described first interconnection port enters direction, afterwards from described first, described first message is interconnected end
Mouthful enter direction mirror picture to the outgoing direction of the second interconnection port of opposite end virtual unit, described first interconnection port peer end of the connection is empty
Propose the second standby interconnection port;
Retransmission unit 402, in opposite end virtual unit by the side of going out of the second message mirror to local first interconnection port
Xiang Shi, enters direction by what the second message was looped back to the first interconnection port, is that the second message determines the exit port forwarding and carries out turning
Send out.
Optionally, described mirror image unit 401, specifically for locally finding the mirror image plan that occurrence is the first interconnection port
Slightly, the priority of described mirror policy is higher than the priority of the isolation rule between virtual unit, and described mirror policy also includes
Action-item, described action-item is by the outgoing direction of the second interconnection port of the first message mirror to opposite end virtual unit;Based on institute
State the action-item of mirror policy by the outgoing direction of the second interconnection port of the first message mirror to opposite end virtual unit.
Optionally, described device also includes:
First determining unit 403, in the forwarding-table item locally finding the first message coupling;By forwarding-table item go out end
Mouth is defined as forwarding the exit port of the first message.
Optionally, described device also includes:
Second determining unit 404, for identifying that described first message is the message that the CPU on described physical equipment sends
When, the outgoing direction of local first interconnection port is appointed as forwarding the exit port of the first message.
Optionally, described device also includes:
Port select unit 405, for interconnecting from local first interconnection port group selection first according to load balancing mode
The outgoing direction of port is as the exit port forwarding described first message;
Described second message in described retransmission unit 402 is to enter direction by opposite end virtual unit from the second interconnection port
Mirror image is to this equipment;Wherein, opposite end virtual unit is to select from the second interconnection port group according to load balancing mode
Execution mirror image operation when the outgoing direction of the second interconnection port sends the second message.
As can be seen here, the present invention is by being the outgoing direction of local first interconnection port in the exit port forwarding the first message
When, enter direction by what described first message looped back to described first interconnection port, afterwards by described first message from described first
Interconnection port enter direction mirror picture to the outgoing direction of the second interconnection port of opposite end virtual unit, then through loopback mechanism, make report
What literary composition was forwarded to this interconnection port enters direction.Therefore the present invention realizes leading between multi-tenant virtual unit by inner passage
Letter, improves the utilization rate of internal bandwidth, and the networking breaking away from External cable limits so that disposing more flexibility and reliability, and drops
Low hardware cost.
In said apparatus, the process of realizing of the function of unit and effect specifically refers to corresponding step in said method
Realize process, will not be described here.
For device embodiment, because it corresponds essentially to embodiment of the method, thus real referring to method in place of correlation
The part applying example illustrates.Device embodiment described above is only schematically, wherein said as separating component
The unit illustrating can be or may not be physically separate, as the part that unit shows can be or can also
It is not physical location, you can with positioned at a place, or can also be distributed on multiple NEs.Can be according to actual
Need to select the purpose to realize application scheme for some or all of module therein.Those of ordinary skill in the art are not paying
In the case of going out creative work, you can to understand and to implement.
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all essences in the present invention
Within god and principle, any modification, equivalent substitution and improvement done etc., should be included within the scope of protection of the invention.