Embodiment
As previously mentioned, under Bidir-PIM protocol, the load balancing of equal-cost route cannot be realized as PIM DM/SM.This is because: on a router, once RP elects, a RPF interface of its correspondence and one group of DF interface are just decided (follow-up the RPF interface of on router and one group of DF interface are called RPF_DF_TABLE), (the * of the bidirectional pim on router, G) in list item, its RPF interface and DF interface all come from the RPF_DF_TABLE on this router, if (the * under same RP, G) list item employs different RPF interfaces, then its DF interface list also may be different, result just may violate the multinomial principle in above-mentioned Bidir-PIM agreement, cause occurring loop or forwarding obstructed.
With an example, this problem is described below:
In the networking shown in Fig. 2, assuming that S4 arrives RP there is equal-cost route S4-> S2-> S1-> R1 and S4-> S3-> S1-> R1, wherein the IP address of the interface S2.4 of S2 sensing S4 is greater than the IP address that S3 points to the interface S3.4 of S4.
After agreement is stable, RPF interface on S4 is S4.2, now suppose that S4.3 is chosen as DF mouth (can be accomplished by the configuration of certain routing priority), then S3.4 is not just DF interface, and S2.4 will inevitably elect DF interface (because must not be DF interface by aforementioned principle RPF interface S4.2) as simultaneously.
Under normal circumstances, after Client1 sends (*, G) joins request and arrives S4, if S4 chooses RPF interface from RPF_DF_TABLE, S4.2 then can be chosen upstream to send PIM join request, S2 can correctly process, and finally can set up correct forward-path.If S4 chooses the interface of certain down hop in equal-cost route as incoming interface after calculating by HASH as common PIM agreement, then may choose interface S4.3, attempt upstream to send PIM by S4-> S3-> S1-> R1 hop-by-hop to join request, S3.4 due to S3 is not DF interface, therefore this message must not be processed, cause finally to form (*, G) list item on S3, whole forward-path is obstructed.
The essence of this problem is: by bidirectional pim protocol, RPF interface is inevitable is not DF interface, in RPF_DF_TABLE, RPF interface only may exist one, and if (the * of bidirectional pim, G) list item uses RPF interface not to be the RPF interface come from RPF_DF_TABLE, then the RPF interface chosen may cause this interface to have the dual role of RPF interface and DF interface simultaneously, and it is chaotic that result causes agreement to be run.
Be not difficult to find out from Such analysis, why single RP cannot realize the Multicast load splitting under single broadcast route equivalence condition, and basic reason is on current router a RPF interface and one group can only be had in single RP, RPF_DF_TABLE to connect DF interface.
According to above analysis, the embodiment of the present invention is to a RP, run multiple DF and elect example, different RPF_DF_TABLE is generated by different equal-cost route interfaces, different (*, G) list item is mapped in different RPF_DF_TABLE and obtains RPF interface and corresponding DF interface, just can address this problem.
Below in conjunction with accompanying drawing, the embodiment of the present invention is described in detail.
In the embodiment of the present invention, the router in bidirectional pim territory provides user configuration interface, realize bidirectional pim by this user's configuration interface and carry out load balancing by singlecast router.Concrete, by the user's configuration interface on each router in whole Bidir-PIM territory, configuration allows the equal-cost route number M realizing load balancing, can synchronously configure the equal-cost route number M allowing to realize load balancing like this in whole multicast domain.
Based on above-mentioned configuration, the embodiment of the present invention has carried out corresponding improvement to bidirectional pim DF election mechanism, by the DF interface election multiple example type under same for existing bidirectional pim RP, namely point to the processing procedure of M DF election under same RP, independently select the DF interface list corresponding with RPF interface separately.
Concrete, router, according to user configured M value, generates M DF and elects example, and each DF elects the corresponding RPF_DF_TABLE of example.If the direction of the current RP of going to exists N bar equal-cost route on this router, corresponding set of interfaces is ECMP_INTERFACE_SET={P
0, P
1p
n-1.Then M DF elects RPF interface poll from ECMP_INTERFACE_SET that example is corresponding to select, and such as, the RPF interface in the 0th RPF_DF_TABLE is P0, and the RPF interface in the 1st RPF_DF_TABLE is P
1, the RPF interface in i-th RPF_DF_TABLE is P
i%N(wherein % represents complementation), the rest may be inferred.
After electing example to determine RPF interface to each DF, router is that each DF elects example to generate corresponding DF election message, being elected by corresponding DF the instance number of example to be carried on DF elects message to send to PIM neighbours, specify according to bidirectional pim agreement, DF elects in message and carries route metric value, the method to set up of this route metric value still follows existing bidirectional pim agreement regulation, such as, router campaigns for DF on a certain link, if its interface is on the link the RPF interface towards this RPA, then the metric of route that its is issued must be infinitely great.Each router in Bidir-PIM territory is according to bidirectional pim consensus standard, message and the routing iinformation of self is elected according to the DF that its PIM neighbours received send, elect each DF respectively and elect the DF interface list that example is corresponding, wherein, each DF on router elects example independently to process DF corresponding to this instance number and elects message, elects to elect corresponding DF the DF interface list that example is corresponding.Such as, the election message carrying instance number 0 that router sends for its each PIM neighbours, elects the DF interface of DF election corresponding to example 0, the DF interface list namely in RPF_DF_TABLE (0); The election message carrying instance number 1 that router sends for its each PIM neighbours, elects the DF interface of DF election corresponding to example 1, the DF interface list namely in RPF_DF_TABLE (1); By that analogy.
According to bidirectional pim consensus standard, the message format of DF election as shown in Figure 3, can utilize Rsvd field (reserved field) wherein to carry DF and elect instance number.Rsvd field is totally 4 bit, 16 DF examples can be identified, instance number 0-15, accordingly, the equal-cost route number M allowing to realize load balancing that each router configures, its span can be: 1=< M <=16.Certainly, message (as new field elects instance number to carry DF) or alternate manner can also be elected wherein by expansion DF, elect instance number to send to PIM neighbours DF, if so, can as required not by the restriction of above-mentioned M span.
The following describes Bidir-PIM territory complete DF election after multicast service implementation procedure.Before description multicast service implementation procedure, first the following concept in bidirectional pim agreement is described: towards that direction of RPA (tree root) in distribution tree, be called up, namely multicast data flow flows to that direction of RPL from multicast source; Distribution tree carries that direction of RPA (tree root), is called descending, and namely multicast data flow flows to that direction of recipient from RPL.
The multicast service that the embodiment of the present invention provides realizes principle:
On up direction from multicast source to RP, when multicast data flow sends to RP direction, different multicast group G calculates through HASH, be mapped to different RPF_DF_TABLE, from wherein obtaining corresponding RPF interface, by bidirectional pim protocol specification, multicast data flow can be sent to RP from this RPF interface, deposit in case at equal-cost route, these RPF interfaces come from the ECMP_INTERFACE_SET={P corresponding to equal-cost route
0, P
1p
n-1, thus achieve multicast message and share on different interfaces and mail to RP.
From RP to the down direction of multicast receivers, when downstream interface adds multicast group G, through carrying out HASH calculating to multicast group G, be mapped to different RPF_DF_TABLE, from wherein obtaining corresponding RPF interface, by bidirectional pim protocol specification, multicast joins request and is sent to the DF interface of upstream router from this RPF interface, deposit in case at equal-cost route, these RPF interfaces come from the ECMP_INTERFACE_SET={P corresponding to equal-cost route
0, P
1p
n-1, joining request from different interfaces to RP direction of the different multicast group G of result sends, the most at last multicast data flow never homology equivalence routing interface guide downstream recipients into.
According to above principle, Fig. 4 shows router from the processing procedure after its DF interface to multicast data message, Fig. 5 show router join message from its DF interface to multicast after processing procedure.
As shown in Figure 4, when router is after its DF interface to multicast data message, perform following steps:
Step 401, obtains the multicast group G that multicast data message is corresponding, the multicast forwarding list item that inquiry is corresponding.
Step 402, if find corresponding multicast forwarding list item, then proceeds to step 403; If do not inquire corresponding multicast forwarding list item, then proceed to step 404.
Step 403, the multicast forwarding list item according to finding forwards this multicast data message.
Step 404, matches corresponding RPF_DF_TABLE according to multicast group G, generates the multicast forwarding list item of multicast group G according to this RPF_DF_TABLE, and forwards this multicast data message according to the multicast forwarding list item generated.
A kind of specific implementation of this step can be: multicast group G is carried out HASH computing by router, corresponding RPF_DF_TABLE (as selected the RPF_DF_TABLE that numbering is identical with this operation result) is selected according to this operation result, inquire about the RPF interface in this RPF_DF_TABLE, this RPF interface is added to (* as outgoing interface, in the outgoing interface list of G) list item, then by this multicast data message from this RPF interface to RPA direction forwarding.
When connecting the router of RPA after its RPF interface to multicast data message, according to bidirectional pim agreement, shared tree that can be corresponding according to the corresponding multicast group taking RPA as tree root, to this multicast data message of downstream device forwards.That is, when router is after its RPF interface to multicast data message, the multicast forwarding list item that inquiry is corresponding, and forward this multicast data message according to the multicast forwarding list item inquired.
As shown in Figure 5, after router joins message from its DF interface to multicast, perform following steps:
Step 501, from multicast join message middle acquisition ask the multicast group G that adds, match corresponding RPF_DF_TABLE according to multicast group G, the multicast forwarding list item that inquiry is corresponding.
Step 502, if inquire corresponding multicast forwarding list item, then proceeds to step 503; If do not inquire corresponding multicast forwarding list item, then proceed to step 504.
Step 503, sends multicast by the RPF interface upstream device in the RPF_DF_TABLE that multicast group G is corresponding and joins message.
Step 504, the RPF_DF_TABLE corresponding according to multicast group G generates multicast forwarding list item, and is joined message by the RPF interface upstream device transmission multicast in this RPF_DF_TABLE.
A kind of specific implementation of this step can be: multicast group G is carried out HASH computing by router, corresponding RPF_DF_TABLE (as selected the RPF_DF_TABLE that numbering is identical with this operation result) is selected according to this operation result, inquire about the RPF interface in this RPF_DF_TABLE, the receiving interface that the RPF interface inquired and this multicast join message is added to (* as outgoing interface, in the outgoing interface list of G) list item, then send multicast by this RPF interface inquired to RPA direction and join message.
In above-mentioned flow process, if the multicast that router receives client transmission from DF interface to its local multicast connected joins message as IGMP report message, then generate PIM to join message, and send this PIM by the RPF interface upstream device in RPF_DF_TABLE corresponding to multicast group G and join message.If the PIM that router sends from DF interface to its downstream router joins message, then being joined message by this PIM is forwarded by the RPF interface upstream device in RPF_DF_TABLE corresponding to multicast group G.
After the router connecting RPA joins message from its DF interface to multicast, according to bidirectional pim agreement, this multicast that terminates joins message.Like this, from the router be connected to RPA with the router of multicast reception client's side link, generate multicast group G corresponding take RPA as the shared tree branch of tree root, so that this multicast data message after from its RPF interface to the multicast data message of multicast group G, forwards along this shared tree branch by the router be connected with RPA.
In order to ensure the realization of multicast service when singlecast router changes, in another embodiment of the invention, on the basis of previous embodiment, after each router in Bidir-PIM territory finds that singlecast router changes, ECMP_INTERFACE_SET is regenerated according to the singlecast router after change, recalculate the RPF interface of M RPF_DF_TABLE accordingly, and by DF election process, generate corresponding DF interface list, thereafter multicast adition process and multicast data flow forwarding process identical with previous embodiment, do not repeat them here.
Above embodiment describes for M > 1, obviously, when configuring M=1, be equivalent to support 1 equal-cost route at most, the actual bidirectional pim agreement situation being degenerated to standard, now the reserved word segment value of DF EB packet is 0, is compatible with existing protocol.
In order to the clearer explanation embodiment of the present invention, below for the multicast architecture shown in Fig. 6, the multicast service implementation procedure of the embodiment of the present invention is described.
As shown in Figure 6, a whole multicast domain global configuration RP, namely configures RP on R1, each router configures bidirectional pim and support that equal-cost route realizes load balancing by multicast group address, and configuration allows the equal-cost route number M=4 realizing load balancing.
From multicast source (Server1 in figure) on the up direction of RP, there are two equal-cost route R3-> R4-> R1 and R3-> R2-> R1 in R3 to R1, on from RP to the down direction of multicast reception client (Client1 in figure), there are two equal-cost route S4-> S2-> S1-> R1 and S4-> S3-> S1-> R1 in S4 to R1.
Owing to being configured with M=4, therefore upper to same RP at R1, R2, R3, R4, run 4 DF and elect example.On R3, owing to there is equal-cost route, ECMP_INTERFACE_SET={R3.4, R3.2} is totally two interfaces, according to HASH result of calculation and agreement ruuning situation, the RPF interface of RPF_DF_TABLE (i) selects the individual interface of " i%N " (herein N=2) in ECMP_INTERFACE_SET to be RPF interface, and after DF election, each relevant interface role is as shown in table 1:
Table 1
In table 1, non RPF interface is that " non-RPF " itself may be DF interface in addition because another one interface is selected in order to RPF interface, also may not be DF interface, is also therefore unknown to the state of end interface, specifically depends on the ruuning situation of agreement.
In like manner, owing to being configured with M=4, therefore upper to same RP at S1, S2, S2, S4, run 4 DF and elect example.On S4 equipment, owing to there is equal-cost route, ECMP_INTERFACE_SET={S4.2, R4.3} is totally two interfaces, RPF interface according to HASH result of calculation and agreement ruuning situation RPF_DF_TABLE (i) selects the individual interface of " i%N " (herein N=2) in ECMP_INTERFACE_SET to be RPF interface, after DF election, each relevant interface role is as shown in table 2
Table 2
In table 2, non RPF interface is that " non-RPF " itself may be DF interface in addition because another one interface is selected in order to RPF interface, also may not be DF interface, is also therefore unknown to the state of end interface, specifically depends on the ruuning situation of agreement.
Have sent two multicast data flows (S, G1) and (S, G2) from Server1, then the agreement of up direction and data flow ruuning situation as follows:
Multicast data flow (S is sent from Server1, G1) R3 is arrived, through carrying out HASH calculating to multicast group G1 address, assuming that have selected RPF_DF_TABLE (0), so generating table entry (* on R3, G1), RPF interface is wherein R3.4, according to protocol specification, data message continues to send to RPF interface direction, so be sent to the interface R4.3 of R4, because this interface is DF interface, the RPF interface on this equipment can be forwarded to by protocol requirement, so final multicast packet flows through R3-> R4-> R1, along road generating forward list item (*, G1).
Similarly, multicast data flow (S is sent from Server1, G2) R3 is arrived, through carrying out HASH calculating to multicast group G2 address, assuming that have selected RPF_DF_TABLE (3), so generating table entry (* on R3, G2), RPF interface is wherein R3.2, according to protocol specification, data message continues to send to RPF interface direction, so be sent to the interface R2.3 of R2, because this interface is DF interface, the RPF interface on this equipment can be forwarded to by protocol requirement, so final message is through R3-> R2-> R1, along road generating forward list item (*, G2).
If from Client1 request receiving two multicast data flows (*, G1) and (*, G2), then the agreement of down direction and data run situation as follows:
Send joining request of multicast group G1 from Client1 and arrive S4, S4 is through carrying out HASH calculating to multicast group G1 address, assuming that have selected RPF_DF_TABLE (0), so generating table entry (* on S4, G1), RPF interface is wherein S4.2, according to protocol specification, continue to send (* to RPF interface direction, G1) join request, so the interface S2.4 of S2 receives joining request of downstream, because this interface is DF interface in RPF_DF_TABLE (0), (* can be generated by protocol requirement, G1) list item, the outgoing interface of this list item points to S2.4, and continue upstream S1 transmission (*, G1) join request, final at R1-> S1-> S2-> S4 along road generating forward list item (*, G1), multicast data flow is guided into recipient from RP.
Similarly, (the * that Client1 sends, G2) join request and finally to trigger at R1-> S1-> S3-> S4 along road generating forward list item (*, G2), guide multicast data flow into recipient from RP.
Based on identical technical conceive, the embodiment of the present invention additionally provides a kind of routing device being applied to PIM network and above-mentioned flow process.
See Fig. 7, be the structural representation of the routing device that the embodiment of the present invention provides, this routing device can comprise:
Configuration module 701, for configure allow to realize the equal-cost route number (being expressed as M) of load balancing;
DF elects instance processes module 702, and for the equal-cost route number M according to allowed load balancing, the appointment forwarding router DF generating respective numbers (M) elects example, and elects the DF interface of each DF election corresponding to example; Wherein, the reverse path of each DF election corresponding to example forwards RPF interface is that routing device poll from its equal-cost route set of interfaces chooses;
Multicast forwarding list item processing module 703, for joining message or multicast data message from DF interface to multicast when this equipment, and when not inquiring corresponding multicast forwarding-table item, match corresponding DF according to corresponding multicast group and elect example, obtain the RPF interface of DF election corresponding to example matched, generate corresponding multicast forwarding-table item, and the multicast received to be joined message or multicast data message elects the RPF interface corresponding to example to send to RP direction by the DF that matches; Wherein, the RPF interface in the multicast forwarding list item outgoing interface list generated elects the RPF interface corresponding to example for the DF that matches;
Multicast forwarding module 704, for receiving multicast data message when this equipment, and when inquiring corresponding multicast forwarding-table item, the multicast forwarding list item according to inquiring forwards described multicast data message.
Concrete, DF elects instance processes module 702 to can be each DF election example and generates the EB packet carrying corresponding DF election instance number, and sends to respective neighbours; According to the EB packet carrying same instance number that its neighbours send, the DF corresponding to described same instance number elects example to carry out DF election.Concrete, DF elects instance processes module 702 DF can be elected examples Example number be carried on the reserved field of EB packet.
Concrete, multicast forwarding list item processing module 703 is when the DF corresponding according to corresponding multicast group coupling elects example, HASH computing can be carried out to corresponding multicast group, determine that the DF mated with HASH operation result elects instance number, elected by the DF matched DF corresponding to instance number to elect example to elect example as the DF mated with corresponding multicast group.
Further, DF elect instance processes module 702 also for: when finding this equipment clean culture routing variable, generate equal-cost route set of interfaces according to the singlecast router after change; And according to the equal-cost route number of allowed load balancing, the DF generating respective numbers elects example, and elect the DF interface of each DF election corresponding to example; Wherein, the RPF interface of each DF election corresponding to example is that routing device poll from its equal-cost route set of interfaces chooses.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add required general hardware platform by software and realize, and can certainly pass through hardware, but in a lot of situation, the former is better execution mode.Based on such understanding, technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in a storage medium, comprising some instructions in order to make a station terminal equipment (can be mobile phone, personal computer, server, or the network equipment etc.) perform method described in each embodiment of the present invention.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should look protection scope of the present invention.