Multicast stream control method, system and field programmable gate array
Technical field
The present invention relates to technical field of multicast, be specifically related to multicast stream control method, system and field programmable gate array (FPGA, Field Programmable Gate Array).
Background technology
In the high-performance distributed equipment that adopts the switching network technology, need control the speed that incoming interface sends message by fluidics, guarantee that congestion packet loss does not take place switching network.
Fig. 1 is a repeater system model between the unicast message plate, and as shown in Figure 1, unicast message is sent from two incoming interface plate LPU_a and LPU_b, arrives outgoing interface plate LPU_c through switching network.Definition of data stream is the up stage from the incoming interface plate to switching network, and definition of data stream is the descending stage from switching network to the outgoing interface plate.Descending outgoing interface plate is given each up incoming interface plate with reference to the actual flow of each incoming interface plate with the outlet bandwidth fair allocat, and up incoming interface buttress sends to descending outgoing interface plate according to the bandwidth scheduling unicast message that is assigned to.This cover scheduling mechanism is realized by the FPGA in the interface board, what adopt is the up pattern of downlink drive, can avoid up transmitted traffic uncontrollably to give same descending outgoing interface plate, and it is congested to cause switching network to take place at this descending outgoing interface plate place, and then causes packet loss.
FPGA unicast schedule mode is as shown in Figure 2, and is specific as follows:
01: the FPGA of incoming interface plate divides a unicast queue for each outgoing interface plate in the packet buffer of this plate, each inner queue further is divided into a plurality of subqueues according to priority again.Simultaneously, FPGA is that each outgoing interface plate is safeguarded a token bucket, and the token number in the token bucket regularly increases progressively, and the token number that at every turn increases progressively is by the outlet bandwidth decision of outgoing interface plate.
When the outlet bandwidth of certain outgoing interface plate increased, this outgoing interface plate can notify each incoming interface plate to increase the token number that this outgoing interface plate corresponding token bucket regularly increases progressively; When the outlet bandwidth of certain outgoing interface plate reduced, this outgoing interface plate can notify each incoming interface plate to reduce the token number that this outgoing interface plate corresponding token bucket regularly increases progressively.
02: during uplink scheduling, the FPGA of incoming interface plate carries out poll according to outgoing interface plate sequence number between unicast queue, if in certain formation message is arranged, then further selects message based on priority between the subqueue of this formation.
The preferential message of selecting in the high priority subqueue if the high priority subqueue is empty, is then selected the message in the low priority subqueue.
03: before sending selecteed message, carry out the token assessment, when in the outgoing interface plate corresponding token bucket of message token being arranged, message is sent to switching network; Otherwise the message of discarded this selection continues the next formation of poll.
Switching network itself is supported multicast replication, and there is the Layer 2 Multicast table its inside, can message be copied to a plurality of outgoing interface plates based on multicast ID.Because multicast message will mail to a plurality of descending outgoing interface plates, therefore, can't determine bandwidth to multicast message by the bandwidth of an outgoing interface plate.At present, forwarding has three kinds of patterns between the multicast plate:
Pattern one:
During message, be responsible for multicast message is duplicated between up transmission multicast plate, many parts of messages after duplicating are distributed to different outgoing interface plates by switching network by CPU.
Pattern two:
Adopt the exchange chip of band Flow Control function, this class exchange chip integrates packet buffer, queue management, queue scheduling and switching network mostly.After multicast message is read, be duplicated into many parts from packet buffer, deliver to the different queue and the unicast message of queue management module according to the difference of outgoing interface plate and wait in line scheduling together, different outgoing interface plates is delivered to by switching network in the back that is scheduled.
Pattern three:
Adopt the switching network of supporting multicast replication.As shown in Figure 3, multicast message sends from incoming interface plate LPU_a, duplicates through switching network and sends to two outgoing interface plate LPU_b and LPU_c.Switching network under this pattern, its clean culture flow control algorithm is more complete, distribute by downlink bandwidth and to drive the scheduling of up unicast message, but because the corresponding a plurality of outgoing interface plates of multicast message, the pattern of downlink drive uplink scheduling can't be used, uplink assignment fixed-bandwidth and the auxiliary mode of considering descending remaining bandwidth can only be adopted.
Pattern one and pattern two are similar, all are to carry out multicast replication up, and switching network just plays the effect of message switching.Enter before the switching network because duplicate to occur in, a multicast message has become many parts when entering switching network, has increased the burden of switching network, and can't utilize the multicast replication function of switching network.The influence of internal storage access bottleneck when pattern one is subjected to the restriction of CPU disposal ability and copy packet in addition, performance is lower.
Three pairs of unicast messages of pattern have extraordinary fluid control effect, but because the downlink bandwidth operating position is a reference of multicasting schedule, the main uplink assignment fixed-bandwidth that leans on is given multicast message, the fluid control effect of multicast message is poor, may cause switching network because the internal buffer is overflowed packet loss, and cause having originally the unicast message of Flow Control also to be dropped.
Summary of the invention
The invention provides multicast stream control method, system and FPGA,, improve multicast Flow Control performance with in the distributed environment that adopts the switching network technology.
Technical scheme of the present invention is achieved in that
A kind of multicast stream control method is applied in the distributed environment that adopts the switching network technology, and the incoming interface plate is provided with a unicast queue for each outgoing interface plate, and the incoming interface plate is provided with a multicast queue separately, and this method comprises:
The incoming interface plate is cached to multicast queue with the multicast message that receives;
The incoming interface plate carries out poll to the unicast queue of multicast queue and all outgoing interface plates, if the poll result is a multicast message, then in the outgoing interface plate of multicast message, selects to have the outgoing interface plate of available bandwidth, and multicast message is sent to selected outgoing interface plate.
Described incoming interface plate is provided with a multicast queue separately and further comprises: for multicast queue and each unicast queue are provided with priority,
Described incoming interface plate is polled as the unicast queue of multicast queue and all outgoing interface plates: the incoming interface buttress is according to the priority of individual queue, and the unicast queue of multicast queue and all outgoing interface plates is carried out poll.
Describedly for multicast queue and each unicast queue are provided with priority be: the priority of multicast queue is set to the highest.
The incoming interface plate is provided with a token bucket for each outgoing interface plate in advance, and according to the token number in the outlet bandwidth adjustment token bucket of outgoing interface plate,
Described in the outgoing interface plate of multicast message, the outgoing interface plate of selecting to have available bandwidth is: judge respectively in the token bucket of each outgoing interface plate of multicast message whether token is arranged, if determine that this interface board has available bandwidth; Otherwise, determine that this interface board does not have available bandwidth.
Describedly multicast message sent to selected outgoing interface plate comprise:
The incoming interface plate is revised as selected outgoing interface plate information with the outgoing interface information in the multicast message, and multicast message is sent to switching network; Switching network is according to the outgoing interface plate information in the multicast message, and copy packet sends to each outgoing interface plate with message.
A kind of on-site programmable gate array FPGA is arranged in the distributed incoming interface plate that adopts the switching network technology, comprising:
Formation is provided with module, for each outgoing interface plate is provided with a unicast queue, simultaneously, a multicast queue is set separately;
Formation poll module, the unicast queue of poll multicast queue and each outgoing interface plate sends to the bandwidth evaluation module with the poll result;
The bandwidth evaluation module receives the poll result, if the poll result is a multicast message, in the outgoing interface plate of multicast message, selection has the outgoing interface plate of available bandwidth, and the outgoing interface information in the multicast message is revised as selected outgoing interface plate information, and multicast message is sent to switching network.
Described bandwidth evaluation module comprises:
Token bucket is provided with module, for each outgoing interface plate is provided with a token bucket;
The token adjusting module according to the outlet bandwidth of outgoing interface plate, adjusts the token number in the token bucket of interface board;
The token evaluation module, receive the poll result, if the poll result is a multicast message, each the outgoing interface plate to multicast message carries out the token assessment respectively, the outgoing interface information of multicast message is revised as the outgoing interface plate information that assessment is passed through, multicast message is sent to switching network.
Described FPGA further comprises: priority is provided with module, for multicast queue and each unicast queue are provided with priority,
And described formation poll module is according to the priority of individual queue, the unicast queue of poll multicast queue and each outgoing interface plate.
A kind of multicast flow control system comprises: at least one incoming interface plate, switching network and at least one outgoing interface plate, wherein,
The incoming interface plate is provided with a unicast queue for each outgoing interface plate in local cache, and a multicast queue is set separately, and the multicast message that receives is cached to multicast queue; Unicast queue to multicast queue and all outgoing interface plates carries out poll, if the poll result is a multicast message, then in the outgoing interface plate of multicast message, selection has the outgoing interface plate of available bandwidth, outgoing interface information in the multicast message is revised as selected outgoing interface plate information, and multicast message is sent to switching network;
Switching network, the receiving group message, the outgoing interface plate information reproduction message according in the multicast message sends to each outgoing interface plate with message.
Compared with prior art, among the present invention, the incoming interface plate is provided with a unicast queue for each outgoing interface plate, simultaneously, for multicast message is provided with a multicast queue separately, the multicast message that receives is cached to multicast queue; The incoming interface plate carries out poll to the unicast queue of multicast queue and all outgoing interface plates, if the poll result is a multicast message, then in the outgoing interface plate of multicast message, selects to have the outgoing interface plate of available bandwidth, and multicast message is sent to selected outgoing interface plate.The present invention makes the same scheduling of accepting the downlink bandwidth distribution with unicast message of multicast message, can be according to the outlet bandwidth of downstream interface, adjust the outgoing interface of multicast message, guaranteed that congestion packet loss does not take place for switching network and descending outgoing interface, has improved the performance of multicast Flow Control.
In addition, the present invention does not carry out multicast replication up, and carries out multicast replication at switching network, has utilized the Multicast Replication Capability of switching network, and has saved upstream bandwidth.
Description of drawings
Fig. 1 is a repeater system illustraton of model between existing unicast message plate;
Fig. 2 is existing FPGA unicast schedule schematic diagram;
Fig. 3 is a repeater system illustraton of model between existing multicast message plate;
The flow chart that in the distributed environment that adopts the switching network technology, carries out the multicast Flow Control that Fig. 4 provides for the embodiment of the invention;
Transmit schematic diagram between clean culture that Fig. 5 provides for the embodiment of the invention and multicast message plate;
Fig. 6 becomes schematic diagram for the multicast Flow Control set of systems that the embodiment of the invention provides;
The structural representation of the FPGA of the incoming interface plate that Fig. 7 provides for the embodiment of the invention.
Embodiment
The present invention is further described in more detail below in conjunction with drawings and the specific embodiments.
The flow chart that in the distributed environment that adopts the switching network technology, carries out the multicast Flow Control that Fig. 4 provides for the embodiment of the invention, as shown in Figure 4, its concrete steps are as follows:
Step 401: the FPGA of each incoming interface plate for each outgoing interface plate is provided with a unicast queue, simultaneously, is provided with a multicast queue for multicast message separately in the packet buffer of this plate in the packet buffer of this plate.
Each unicast queue inside can further be divided into a plurality of subqueues according to priority.
Because the outgoing interface plate of multicast message can't pre-determine, and therefore, a multicast queue is set separately in the buffer memory of message.
Step 402: the FPGA of incoming interface plate is that each outgoing interface plate is safeguarded a token bucket, and the token number in the token bucket regularly increases progressively, and the number that at every turn increases progressively is by the outlet bandwidth decision of outgoing interface plate.
This step 402 safeguards that with the token bucket in the existing unicast schedule mode step is identical.
Step 403:FPGA is cached to multicast message in the multicast queue from CPU receiving group message.
Step 404: uplink scheduling begins, and FPGA carries out poll to the unicast queue of multicast queue and all outgoing interface plates.
Step 405: judge that the poll result is unicast message or multicast message, if unicast message, execution in step 406; If multicast message, execution in step 407.
Step 406:FPGA adopts existing unicast schedule mode to handle this unicast message, and this flow process finishes.
Step 407:FPGA extracts the multicast ID in the multicast message.
Step 408:FPGA carries out the token assessment one by one to each outgoing interface plate of multicast ID correspondence, judges in the token bucket of each outgoing interface plate whether token is arranged that is:, and FPGA records the outgoing interface plate sequence number of the token bucket correspondence of token.
Step 409:FPGA revises the multicast ID in the multicast message according to the outgoing interface plate sequence number of record, and multicast message is sent to switching network.
For example: suppose that a multicast message is ready for sending outgoing interface plate 0,2 and 5, then the multicast ID in the multicast message is b00100101, after process FPGA carries out the token bucket assessment, cause this outgoing interface plate assessment not passed through because do not have token in the outgoing interface plate 2 corresponding token buckets, the multicast ID that then revises in the multicast message is b00100001, thereby switching network only can duplicate multicast message and provide interface board 0 and 5.
Step 410: switching network receiving group message, the multicast ID in the analytic message obtains each outgoing interface plate sequence number, according to this outgoing interface plate sequence number copy packet, then each message is mail to each outgoing interface plate respectively.
The outgoing interface plate that the token assessment is not passed through can not receive this multicast message, because assessment is not depleted to the bandwidth of this outgoing interface plate by in fact representing the incoming interface plate, it also is acceptable that abandoning of multicast message taken place.
Transmit schematic diagram between clean culture that Fig. 5 provides for the embodiment of the invention and multicast message plate, as shown in Figure 5, multicast queue is independent of outside the unicast queue of all outgoing interface plates, the corresponding token bucket of each outgoing interface plate, poll carries out between multicast queue and all unicast queues, if the poll result is a multicast message, then can carry out the token assessment to the outgoing interface plate of multicast message one by one, so that only multicast message is sent to the outgoing interface plate that assessment is passed through.
In the application scenario that has, may wish the priority treatment multicast message, at this moment, polling mode can be revised as strict priority+polling mode, be multicast queue and each unicast queue priority is set, and be provided with the priority of multicast queue the highest, when poll, according to the priority of individual queue, but,, multicast message is admitted to switching network thereby just having more opportunity with regard to the priority scheduling multicast queue.
Fig. 6 becomes schematic diagram for the multicast Flow Control set of systems that the embodiment of the invention provides, and as shown in Figure 6, it mainly comprises: at least one incoming interface plate 61, switching network 62 and at least one outgoing interface plate 63, m among the figure is the number of incoming interface plate, and n is the number of outgoing interface plate, and m 〉=1, n 〉=1, wherein:
Incoming interface plate 61: in the packet buffer of this plate,, simultaneously, in the packet buffer of this plate, for multicast message a multicast queue is set separately for each outgoing interface plate is provided with a unicast queue; Safeguard a token bucket for each outgoing interface plate, the token number in the token bucket regularly increases progressively according to the outlet bandwidth of outgoing interface plate, and the multicast message that receives is cached in the multicast queue; Uplink scheduling begins, unicast queue to multicast queue and all outgoing interface plates carries out poll, if the poll result is a multicast message, extract the multicast ID in the multicast message, each outgoing interface plate to multicast ID correspondence carries out the token assessment one by one, the outgoing interface plate sequence number of passing through according to assessment is revised the multicast ID in the multicast message, and multicast message is sent to switching network 62.
Switching network 62: the receiving group message, the multicast ID in the analytic message obtains each outgoing interface plate sequence number, according to this outgoing interface plate sequence number copy packet, then each message is mail to each outgoing interface plate respectively.
The structural representation of the FPGA of the incoming interface plate that Fig. 7 provides for the embodiment of the invention, as shown in Figure 7, it mainly comprises: formation is provided with module 71, token bucket is provided with module 72, token adjusting module 73, formation poll module 74 and token evaluation module 75, wherein:
Formation is provided with module 71: in the packet buffer of this plate, for each outgoing interface plate is provided with a unicast queue, simultaneously, in the packet buffer of this plate, for multicast message a multicast queue is set separately.
Token bucket is provided with module 72: for each outgoing interface plate is safeguarded a token bucket.
Token adjusting module 73:, regularly adjust the token number in the token bucket of interface board according to the outlet bandwidth of each outgoing interface plate.
Formation poll module 74: uplink scheduling begins, and the unicast queue of multicast queue and all outgoing interface plates is carried out poll, and the poll result is sent to token evaluation module 75.
Token evaluation module 75: receive the poll result that formation poll module 74 is sent, if the poll result is a multicast message, extract the multicast ID in the multicast message, each outgoing interface plate to multicast ID correspondence carries out the token assessment one by one, the outgoing interface plate sequence number of passing through according to assessment is revised the multicast ID in the multicast message, and multicast message is sent to switching network.
Token bucket is provided with module 72, token adjusting module 73, token evaluation module 75 is collectively referred to as the bandwidth evaluation module.
In actual applications, FPGA also can comprise: priority is provided with module, is used to multicast queue and each unicast queue that priority is set, as: the priority of multicast queue can be provided with the highest.
Simultaneously, formation poll module 74 according to the priority of individual queue, is carried out poll to the unicast queue of multicast queue and all outgoing interface plates when uplink scheduling begins.
The above only is process of the present invention and method embodiment, in order to restriction the present invention, all any modifications of being made within the spirit and principles in the present invention, is not equal to replacement, improvement etc., all should be included within protection scope of the present invention.