Summary of the invention
Purpose of the present invention is exactly to provide multi-version multicast protocol amalgamation method for the defective that overcomes above-mentioned prior art existence.
Purpose of the present invention can be achieved through the following technical solutions: multi-version multicast protocol amalgamation method, it is characterized in that, this method is carried out format conversion with the multicast protocol message of the multiple version in the switching equipment multicast group with unified format, again the multicast group information of consolidation form message is carried out tissue treatment, by result's conversion the result after the tissue treatment is converted to the form of the chip that can write direct at last.
Described switching equipment comprises switch or switch device more than two layers and two layers.
The multicast protocol of described multiple version comprises IGMPv1 (RFC1112), IGMPv2 (RFC2236), the IGMPv3 (RFC3376) based on IPv4, based on MLDv1 (RFC2710), the MLDv2 (RFC3810) of IPv6.
Described unified format is:
Multicast address in the message;
Type of message: type of message is divided into INCLUDE, EXCLUDE according to pattern; The INCLUDE modal representation receives from the specific multicast data in the source address list, and the EXCLUDE modal representation receives all the specific multicast data except that source address list;
Source address list: source address list is included in the multicast source address under every kind of pattern, receive this all multicast group data of source address list since then for the INCLUDE modal representation, receive this all multicast group data outside the source address list since then for the EXCLUDE modal representation;
Change flag: state changes if message is represented the main frame multicast group, and change flag then is set; If message is general inquiry response message, change flag is not set then; Whether this sign is used for decision-making and this message is transmitted.
Described format conversion comprises the conversion of IGMPv1, IGMPv2, IGMPv3 protocol massages form, the conversion of MLDv1, MLDv2 protocol massages form; The conversion of described IGMPv1, IGMPv2, IGMPv3 protocol massages form mainly is the message that is sent by host side at IGMPv1, IGMPv2, IGMPv3, comprise that IGMPv1 report message, IGMPv2 report message, IGMPv2 finish message, IGMPv3 report message, wherein the IGMPv3 report message comprises the message of six subtypes; The conversion of described MLDv1, MLDv2 protocol massages form mainly is the message that is sent by host side at MLDv1, MLDv2, comprise that MLDv1 report message, MLDv1 finish message, MLDv2 report message, wherein the MLDv2 report message comprises the message of six subtypes.
Being converted to of described IGMPv1, IGMPv2, IGMPv3 protocol massages form:
The IGMPv1 report message: the IGMPv1 report message is taken as the EXCLUDE pattern, and source address list is empty consolidation form message, if received this message in this polling cycle, then declines condition change flag; If do not receive this message in this polling cycle, condition change flag then be set;
The IGMPv2 report message: the IGMPv2 report message is taken as the EXCLUDE pattern, and source address list is empty consolidation form message, if received this message in this polling cycle, then declines condition change flag; If do not receive this message in this polling cycle, condition change flag then be set;
IGMPv2 finishes message: IGMPv2 finishes message and is taken as the INCLUDE pattern, and source address list is empty consolidation form message; Condition change flag is set;
IGMPv3 report message subtype one: IGMPv3 report message subtype one is taken as the INCLUDE pattern, and source address list is the consolidation form message of message source address list, if received this message in this polling cycle, then declines condition change flag; If do not receive this message in this polling cycle, condition change flag then be set;
IGMPv3 report message subtype two: IGMPv3 report message subtype two is taken as the EXCLUDE pattern, and source address list is the consolidation form message of message source address list, if received this message in this polling cycle, then declines condition change flag; If do not receive this message in this polling cycle, condition change flag then be set;
IGMPv3 report message subtype three: IGMPv3 report message subtype three is taken as the INCLUDE pattern, and source address list is the consolidation form message of message source address list, and condition change flag is set;
IGMPv3 report message subtype four: IGMPv3 report message subtype four is taken as the EXCLUDE pattern, and source address list is the consolidation form message of message source address list, and condition change flag is set;
IGMPv3 report message subtype five: IGMPv3 report message subtype five is taken as the INCLUDE pattern, and source address list is the consolidation form message of message source address list, if received this message in this polling cycle, then declines condition change flag; If do not receive this message in this polling cycle, condition change flag then be set;
IGMPv3 report message subtype six: for multicast monitoring, this message is not handled, directly with its forwarding.
Being converted to of described MLDv1, MLDv2 protocol massages form:
The MLDv1 report message: the MLDv1 report message is taken as the EXCLUDE pattern, and source address list is empty consolidation form message, if received this message in this polling cycle, then declines condition change flag; If do not receive this message in this polling cycle, condition change flag then be set;
MLDv1 finishes message: MLDv1 finishes message and is taken as the INCLUDE pattern, and source address list is empty consolidation form message, and condition change flag is set;
MLDv2 report message subtype one: MLDv2 report message subtype one is taken as the INCLUDE pattern, and source address list is the consolidation form message of message source address list, if received this message in this polling cycle, then declines condition change flag; If do not receive this message in this polling cycle, condition change flag then be set.
MLDv2 report message subtype two: MLDv2 report message subtype two is taken as the EXCLUDE pattern, and source address list is the consolidation form message of message source address list, if received this message in this polling cycle, then declines condition change flag; If do not receive this message in this polling cycle, condition change flag then be set.
MLDv2 report message subtype three: MLDv2 report message subtype three is taken as the INCLUDE pattern, and source address list is the consolidation form message of message source address list, and condition change flag is set;
MLDv2 report message subtype four: MLDv2 report message subtype four is taken as the EXCLUDE pattern, and source address list is the consolidation form message of message source address list, and condition change flag is set;
MLDv2 report message subtype five: MLDv2 report message subtype five is taken as the INCLUDE pattern, and source address list is the consolidation form message of message source address list, if received this message in this polling cycle, then declines condition change flag; If do not receive this message in this polling cycle, condition change flag then be set;
MLDv2 report message subtype six: for multicast monitoring, this message is not handled, directly with its forwarding.
Described multicast group information comprises multicast destination address, multicast source address, can also comprise port numbers, vlan number.
Described tissue treatment is: for the message of INCLUDE pattern, if the multicast group destination address is identical, directly all source addresses at the INCLUDE of term of validity message are merged, promptly ask intersection; For the message of EXCLUDE pattern,, all source address lists at the EXCLUDE of term of validity message are sought common ground if the multicast group destination address is identical; If the multicast group destination address is identical, EXCLUDE source address set is deducted the set of INCLUDE source address, the end product that obtains is exactly the source address set under the last EXCLUDE pattern, promptly asks difference set; If there is not the message of EXCLUDE pattern, then last result is exactly the source address set under the INCLUDE pattern.
Described result is converted to: for the tissue treatment result of INCLUDE pattern, directly with multicast destination address and source address one by one write chip; For the tissue treatment result of EXCLUDE pattern, on the source address clauses and subclauses of correspondence, write overhead port list, increase a wildcard item simultaneously; Can not distinguish source address as fruit chip, those needs write the multicast destination address, and port list is the port list sum of all same multicast group.
Compared with prior art, the present invention makes switching equipment can adapt to any multicast protocol version environment of networking, has improved the switching equipment reliability.
Embodiment
The invention will be further described below in conjunction with accompanying drawing.
As shown in Figure 2, multi-version multicast protocol amalgamation method, this method is carried out format conversion with the multicast protocol message of the multiple version in the switching equipment multicast group with unified format, again the multicast group information of consolidation form message is carried out tissue treatment, by result's conversion the result after the tissue treatment is converted to the form of the chip that can write direct at last.
Present embodiment is mainly used in the multicast protocol of switch and monitors, can monitor Layer 2 Multicast monitoring (SNOOPING) the realization fusion of (SNOOPING) or MLDv1, MLDv2 to the Layer 2 Multicast of IGMPv1, IGMPv2, IGMPv3, promptly handling example with one just can unify the message of three protocol versions is monitored and handled, simplified the realization that Layer 2 Multicast is monitored so greatly, the multicast protocol environment that can adapt to many versions improves equipment dependability.The key of present embodiment is the message of each version of multicast protocol of listening to is converted to unified format, then this unified format is organized and is added up, and the result of processing writes the multicast table of chip, the distribution of control multicast packet after through conversion.
Present embodiment is mainly used in switch, general implementation method as IGMP SNOOPING or MLDSNOOPING, convert the message of various protocols version to tissue and statistics that unified format is carried out multicast group afterwards again, this unified format will can not be lost the amount of information of any message, and the result of statistical disposition will write chip.
A plurality of version multicast protocols comprise following several: based on IGMPv1 (RFC1112), the IGMPv2 (RFC2236) of IPv4, IGMPv3 (RFC3376) with based on MLDv1 (RFC2710), the MLDv2 (RFC3810) of IPv6.
Switching equipment comprises switch or class switch device more than two layers and two layers.
IGMP SNOOPING or MLD SNOOPING are a kind of protocol listening technology, be meant passive accept protocol massages and handle accordingly, but these handle the normal operation that can not have influence on protocol.
Unified format is a kind of form that can not lose any release protocol message information.
The message information amount mainly is meant the multicast group that comprises in the message and the information of multicast source, if further expand, can comprise port numbers and the vlan number of receiving message.
Tissue and statistics to multicast group are a kind of strategies, are a kind of methods that can effectively carry out the multicast group statistics.
The concrete scheme of present embodiment is as follows:
1. change the form of IGMPv1, IGMPv2, IGMPv3 message
Mainly be at the message that sends by host side of IGMPv1, IGMPv2, IGMPv3, comprise that IGMPv1 report message, IGMPv2 report message, IGMPv2 finish message and IGMPv3 report message, wherein the IGMPv3 report message comprises the message of six subtypes.The unified format structure comprises following information:
(1) multicast group
It is exactly the multicast address in the message.
(2) type of message
Type of message is divided into INCLUDE, EXCLUDE according to pattern.The INCLUDE modal representation receives from the specific multicast data in the source address list, and the EXCLUDE modal representation receives all the specific multicast data except that source address list.
(3) source address list
Source address list is included in the multicast source address under every kind of pattern, receive this all multicast group data of source address list since then for the INCLUDE modal representation, receive this all multicast group data outside the source address list since then for the EXCLUDE modal representation.
(4) change flag
State changes if message is represented the main frame multicast group, and change flag then is set; If message is general inquiry response message, change flag is not set then.Whether this sign is used for decision-making and this message is transmitted.
The method that converts unified message format from multiple igmp host end message to is as follows:
(1) IGMPv1 report message
The IGMPv1 report message is taken as the EXCLUDE pattern, and source address list is empty consolidation form message.If received this message in this polling cycle, then decline condition change flag; If do not receive this message in this polling cycle, condition change flag then be set.
(2) IGMPv2 report message
The IGMPv2 report message is taken as the EXCLUDE pattern, and source address list is empty consolidation form message.If received this message in this polling cycle, then decline condition change flag; If do not receive this message in this polling cycle, condition change flag then be set.
(3) IGMPv2 finishes message
IGMPv2 finishes message and is taken as the INCLUDE pattern, and source address list is empty consolidation form message.Condition change flag is set.
(4) IGMPv3 report message----subtype 1
IGMPv3 report message----subtype 1 is taken as the INCLUDE pattern, and source address list is the consolidation form message of message source address list.If received this message in this polling cycle, then decline condition change flag; If do not receive this message in this polling cycle, condition change flag then be set.
(5) IGMPv3 report message----subtype 2
IGMPv3 report message----subtype 2 is taken as the EXCLUDE pattern, and source address list is the consolidation form message of message source address list.If received this message in this polling cycle, then decline condition change flag; If do not receive this message in this polling cycle, condition change flag then be set.
(6) IGMPv3 report message----subtype 3
IGMPv3 report message----subtype 3 is taken as the INCLUDE pattern, and source address list is the consolidation form message of message source address list.Condition change flag is set.
(7) IGMPv3 report message----subtype 4
IGMPv3 report message----subtype 4 is taken as the EXCLUDE pattern, and source address list is the consolidation form message of message source address list.Condition change flag is set.
(8) IGMPv3 report message----subtype 5
IGMPv3 report message----subtype 5 is taken as the INCLUDE pattern, and source address list is the consolidation form message of message source address list.If received this message in this polling cycle, then decline condition change flag; If do not receive this message in this polling cycle, condition change flag then be set.
(9) IGMPv3 report message----subtype 6
For multicast monitoring, this message is not handled, directly with its forwarding.
2. change the protocol massages form of MLDv1, MLDv2
Mainly be at the message that is sent by host side of MLDv1, MLDv2, comprise that MLDv1 report message, MLDv1 finish message and MLDv2 report message, wherein the MLDv2 report message comprises the message of six subtypes.The unified format structure comprises following information:
(1) multicast group
It is exactly the multicast address in the message.
(2) type of message
Type of message is divided into INCLUDE, EXCLUDE according to pattern.
(3) source address list
Source address list is included in the multicast source address under every kind of pattern, receive this all multicast group data of source address list since then for the INCLUDE modal representation, receive this all multicast group data outside the source address list since then for the EXCLUDE modal representation.
(4) change flag
State changes if message is represented the main frame multicast group, and change flag then is set; If message is general inquiry response message, change flag is not set then.Whether this sign is used for decision-making and this message is transmitted.
The method that converts consolidation form from multiple MLD host side message to is as follows:
(1) MLDv1 report message
The MLDv1 report message is taken as the EXCLUDE pattern, and source address list is empty consolidation form message.If received this message in this polling cycle, then decline condition change flag; If do not receive this message in this polling cycle, condition change flag then be set.
(2) MLDv1 finishes message
MLDv1 finishes message and is taken as the INCLUDE pattern, and source address list is empty consolidation form message.Condition change flag is set.
(3) MLDv2 report message----subtype 1
MLDv2 report message----subtype 1 is taken as the INCLUDE pattern, and source address list is the consolidation form message of message source address list.If received this message in this polling cycle, then decline condition change flag; If do not receive this message in this polling cycle, condition change flag then be set.
(4) MLDv2 report message----subtype 2
MLDv2 report message----subtype 2 is taken as the EXCLUDE pattern, and source address list is the consolidation form message of message source address list.If received this message in this polling cycle, then decline condition change flag; If do not receive this message in this polling cycle, condition change flag then be set.
(5) MLDv2 report message----subtype 3
MLDv2 report message----subtype 3 is taken as the INCLUDE pattern, and source address list is the consolidation form message of message source address list.Condition change flag is set.
(6) MLDv2 report message----subtype 4
MLDv2 report message----subtype 4 is taken as the EXCLUDE pattern, and source address list is the consolidation form message of message source address list.Condition change flag is set.
(7) MLDv2 report message----subtype 5
MLDv2 report message----subtype 5 is taken as the INCLUDE pattern, and source address list is the consolidation form message of message source address list.If received this message in this polling cycle, then decline condition change flag; If do not receive this message in this polling cycle, condition change flag then be set.
(8) MLDv2 report message----subtype 6
For multicast monitoring, this message is not handled, directly with its forwarding.
3. the multicast group of consolidation form message is organized and added up
The project that need carry out multicast group tissue and statistics comprises multicast destination address, multicast source address, may also comprise port numbers and vlan number.
(1) for the statistical method of INCLUDE pattern consolidation form message
For the message of INCLUDE pattern,, can directly all source addresses merging at the INCLUDE of term of validity message be got final product if the multicast group destination address is identical.Promptly be one and ask the union operation on mathematics.
(2) for the statistical method of EXCLUDE pattern consolidation form message
For the message of EXCLUDE pattern, if the multicast group destination address is identical, all source address lists at the EXCLUDE of term of validity message can be sought common ground gets final product.
(3) INCLUDE pattern and EXCLUDE pattern are unified the statistical method of message
First two steps have been carried out unified processing respectively to all INCLUDE patterns and EXCLUDE pattern message, and an ensuing step carries out comprehensively the two exactly.If the multicast group destination address is identical, EXCLUDE source address set can be deducted the set of INCLUDE source address, the end product that obtains is exactly the source address set under the last EXCLUDE pattern, is one and asks the difference set operation on mathematics; If there is not the message of EXCLUDE pattern, then last result is exactly the source address set under the INCLUDE pattern.
4. statistics is converted to the method for hardware multicast forwarding-table item
Three steps of front can obtain the needed multicast information of each port basically, and the statistics that will have the same multicast destination address is added up port list again one time, just can prepare to have write chip.
In general, the clauses and subclauses on the chip all are destination address, source address, port list or the expansion that also has other.For the end product of INCLUDE pattern, can be directly with multicast destination address and source address one by one write chip; And, should on the source address clauses and subclauses of correspondence, write overhead port list for the last statistics of EXCLUDE pattern, increase a wildcard item simultaneously.
Can not distinguish source address as fruit chip, those needs write the multicast destination address and get final product, and port list is the port list sum of all same multicast group.