A kind of processing method of fast multicastTechnical field
The invention belongs to the multicasting technology in the internet communication, particularly a kind of fast multicast processing method.
Background technology
Multicast is the network technology of the single packet of the disposable transmission of a kind of permission one or more senders (multicast source) to a plurality of recipients.Multicast source sends to particular multicast group to packet, and the address that only belongs to this multicast group just can receive packet, therefore multicast can be saved the network bandwidth greatly, because no matter what destination addresses are arranged, on any link of whole network, only transmit single packet, in addition, multicast has reduced the congested possibility of backbone network appearance.Wherein, the main frame in the multicast group can be at same physical network, if when the support of multicast router is arranged, main frame can also be from different physical networks.
Realize that in the IP multicast transmission process, sender's (multicast source), recipient and lower floor's network between the two all must be supported multicast, mainly comprise following several respects:
1) switch, multicast router must be supported multicast;
2) network interface of main frame is supported multicast;
3) have a cover to be used to the igmpinternet that adds, leave, inquire about, promptly IGMP (v1, v2, v3);
4) a cover IP address assignment strategy is arranged, and the three layers of IP multicast address can be mapped to second layer MAC Address;
5) application software of support IP multicast;
6) all multicast router, TCP/IP stack, fire compartment walls between sender's (multicast source) and recipient all need be supported multicast;
7) TCP/IP of main frame realizes supporting to send and receive the IP multicast.
At present, the IP multicasting technology obtains the extensive support of hardware, software vendor, such as, the Ethernet card of new production is nearly all supported multicast; Some multicast router is not only supported DVMRP, PIM Routing Protocol, IGMP igmpinternet, and supports proprietary igmpinternet CGMP, and the Windows95 of Microsoft supports IP multicast and IGMPvl for another example, and Windows 98 also supports IGMPv2.Can adopt IP tunnel (Tunneling) technology as transition scheme for the middle multicast router of not supporting the IP multicast transmission.The applied environment that this shows the IP multicasting technology possesses substantially.
But, in present multicast realization technology, message sends to a group of recipients, these recipients use a logical address sign, and multicast router can be forwarded to a plurality of interfaces to multicast information bag copy on one's own initiative, promptly there are what interfaces need send multicast message, multicast router sends after just multicast message need being duplicated several parts, like this along with the increase of the interface quantity that sends, not only the consumption of the memory headroom of multicast router increases, and the load of multicast router also will increase, thereby reduce the disposal ability of multicast router, influence the speed of multicast.
Summary of the invention
The technical problem to be solved in the present invention provides a kind of processing method of fast multicast, thereby reduces the operating load that multicast replication produces on the multicast router, realizes fast multicast.
In order to address the above problem, the invention provides a kind of processing method of fast multicast, in this method, three layers of multicast table of multicast router inquiry, after hitting certain bar list item, it is identical with multicast group outgoing interface number value in described three layers of multicast table that the rolling counters forward value that sends multicast message is set;
Described multicast router sends the multicast message that carryLayer 2 Multicast header corresponding with it to described each multicast group outgoing interface successively according to described three layers of multicast table, after the multicast message of each multicast group outgoing interface sends and finishes, the count value of notifying described multicast router to control the counter of described transmissionmulticast message subtracts 1, when the count value of described counter was zero, described multicast router finished to send multicast message.
Further, in the said method, comprise multicast group IP, multicast group outgoing interface number and pre-packaged good describedLayer 2 Multicast header in described three layers of multicast table at least.
Described three layers of multicast table also comprise source IP information.
Further, in the said method, described multicast router generatescorresponding Layer 2 Multicast header according to the type of described multicast group outgoing interface when generating multicast routing entry, generate described three layers of multicast table according to multicast group IP, multicast group outgoing interface number again.
Wherein, when described multicast group outgoing interface type was ether interface, describedLayer 2 Multicast header comprised that the outgoing interface of protocol type, source Media Access Control address, forwarding multicasting message incoming interface sign, forwarding multicasting message identifies and the Media Access Control address information of the multicast group outgoing interface of forwarding multicasting message.
Described multicast router hits in described three layers of multicast table behind certain bar list item, adopt segmentation chain type storage mode to storeLayer 2 Multicast header and the three layers of multicast message of multicast message described in this list item, wherein use linear storage mode to store with thecorresponding Layer 2 Multicast header of described each multicast group outgoing interface.
Further, in the said method, described multicast router discharges three layers of space that multicast message is shared in the internal memory after finishing to send multicast message.
Further, in the said method, after the multicast message of described multicast group outgoing interface sent and finishes, described interface sends multicast message by form of message to described multicast router notice to be finished.
The present invention is by the counting to multicast message, thereby each interface of having avoided transmitting all will duplicate message one time, saved owing to duplicate shared memory headroom, under a lot of situation of the interface number of transmitting, can save a large amount of memory headrooms, and replace copy operation, reduce the burden of multicast router load greatly multicast message by the reducing that adds to the multicast message counting, improve the operating efficiency of multicast router, realize that level is broadcast fast.
Description of drawings
Fig. 1 is the flow chart that the present invention realizes fast multicast;
Fig. 2 is multicast message storage mode schematic diagram in the multicast router internal memory in the technical solution of the present invention.
Embodiment
Main design of the present invention is, when multicast routing entry generates, multicast router generatescorresponding Layer 2 Multicast header according to different multicast group outgoing interfaces, theLayer 2 Multicast header of multicast message uses linear storage mode in the internal memory of multicast router, theLayer 2 Multicast header of multicast message and three layers of multicast message adopt segmentation chain type file layout, like this, after multicast router is searched multicast table and is hit certain bar list item, just can determine the number of the multicast message interface that sends, be about to send the number of multicast message and theLayer 2 Multicast header of each interface, and the rolling counters forward value of control transmission multicast message is identical with the number value of the multicast message interface of transmission, it is every like this when a forwarding interface sends a multicast message, get final product sending with the multicast message of thecorresponding Layer 2 Multicast header of this interface in the internal memory by multicast table, and each interface transmission multicast message finishes back transmission message to multicast router, the counter that control sendsmulticast message subtracts 1, when counter is 0, represent that this multicast message sends end, discharge three layers of space that multicast message is shared in the internal memory, but do not discharge theLayer 2 Multicast header, saved the copy operation of multicast router like this, improved the operating efficiency of multicast router greatly multicast message.
Below in conjunction with the drawings and the specific embodiments technical solution of the present invention is described in further detail.
A kind of fast multicast method is based on reverse path and propagates (RPF, reverse path forwarding) and generate that multicast tree proposed, and specifically is divided into following steps, as shown in Figure 1:
Step 101: after multicast packets enters multi-cast system, judge and receive whether network interface is the RPF interface, if, then be forwarded to an output network set of interfaces, source medium access control (MAC, Media Access Control) address is replaced by the output network interface mac address, sets up three layers of multicast table, as shown in table 1, otherwise abandon this bag;
Three layers of multicast table of table 1
In the table 1, IPSRCExpression source IP; IPGRPExpression multicast group IP; Out Int Num shows this multicast group outgoing interface number; MACSRCExpression source MAC; VidINExpression forwarding multicasting message incoming interface sign VLAN ID; VidOUT1...OUT2The multicast group outgoing interface sign VLAN ID of expression forwarding multicasting message; MACOUT1...OUT2The MAC Address of the multicast group outgoing interface of expression forwarding multicasting message.
In this step, (S, G) Dui Ying three layers of multicast table comprise IP to specify list item with the source of multicast routing protocolSRC, IPGRPAnd pre-packagedgood Layer 2 Multicast header; And with not to the transmission source mate (*, G) three of the list item correspondence layers of multicast table comprise *, IPGRPAnd pre-packagedgood Layer 2 Multicast header; Wherein theLayer 2 Multicast header is the required information of L2 encapsulation, and this information is difference along with the difference of multicast group outgoing interface type.In the present embodiment, the multicast group outgoing interface is an ether interface, and this moment, theLayer 2 Multicast header comprised protocol type, MACSRC, VidIN, VidOUT1, MACOUT1, VidOUT2, MACOUT2... VidOUTN, MACOUTNEtc. information; In other embodiments, the multicast group interface is the packet interface (POS on the synchronous optical network, Packet Over SONET/SDH) or asynchronous transfer mode interface (ATM, Asynchronous Transfer Mode) etc. the time, theLayer 2 Multicast header can comprise protocol type and the information such as control address relevant with the L2 packaging information.
Step 102, multicast router by use (S, G) or (* G), searches three layers of multicast table, matches multicast list, can determine which interface multicast message will send to, thereby determines the number and the multicast group outgoing interface information of forwarding multicasting message;
Wherein outgoing interface information comprises interface identifier and the required information of L2 encapsulation, in the present embodiment, outgoing interface information comprises interface identifier and MAC Address, multicast group outgoing interface information is according to the difference of its type and difference in other embodiments, for example, multicast group outgoing interface information also can be interface identifier, protocol type and the required information such as relevant control address of L2 encapsulation;
Step 103: multicast router judges whether to hit any multicast item, if, enter step 104, otherwise abandon multicast message, and the counter O reset of control transmission multicast message, changestep 108 then over to;
Step 104: multicast router is according to the multicast list that hits, determines the number that E-Packets and the relevant information of outgoing interface, and the count value that will send the counter of multicast message simultaneously changes to the individual numerical value Out Int Num of forwarding multicasting message;
Step 105: multicast router sends by the multicast message of thecorresponding Layer 2 Multicast header of multicast group outgoing interface of three layers of multicast table in the multicast list that hits;
Step 106: after each multicast group outgoing interface sent ENMES, interface hardware sent this interface of message informing multicast router and sends end, after multicast router receives this message, the control counter count value that sends multicast message was subtracted 1;
Step 107: multicast router judges whether send multicast message control counter count value is zero, if enterstep 108, otherwise returnstep 105;
Step 108: multicast router discharges three layers of memory headroom that multicast message is shared, finishes forwarding multicasting message.
State in realization in the process of fast multicast, because the multicast group outgoing interface has nothing in common with each other, so the L2 encapsulation of the multicast message that sends at different multicast group outgoing interfaces is different, therefore multicast router is stored in the internal memory by mode shown in Figure 2 multicast message, be about to multicast message and adopt the segmented storage, just other content of theLayer 2 Multicast header of multicast message and multicast message adopts chain type fragmented storage, adopts linear storage mode for two layers of head of different multicast group outgoing interfaces.
From the foregoing description as can be seen, the present invention is by the counting to multicast message, thereby each interface of having avoided transmitting all will duplicate message one time, saved owing to duplicate shared memory headroom, simultaneously also reduced the time that internal storage access is taken, under a lot of situation of the interface number of transmitting, can save a large amount of memory headrooms, and replace copy operation to multicast message by the reducing that adds to multicast message counting, reduce the burden of multicast router load greatly, improve the operating efficiency of multicast router, realize that level is broadcast fast.
Certainly; the present invention also can have other various embodiments; under the situation that does not deviate from spirit of the present invention and essence thereof; those of ordinary skill in the art are when making various corresponding changes and distortion according to the present invention, and these change and be out of shape the protection range that all should belong to the appended claim of the present invention accordingly.