A kind of bandwidth allocation methods, controller and communication system
【Technical field】
The present invention relates to communication technical field, more particularly to a kind of bandwidth allocation methods, controller and communication system.
【Background technology】
Typically carried out data transmission using Transmission Control Protocol in data center.Transmission Control Protocol possesses the congestion control mechanism for carrying,
When the data for finding a streaming occur congestion, it will pass through the transmission window and congestion window for adjusting this stream
Size slowing down transmission rate, so as to be prevented effectively from the packet loss produced due to congestion, improve the efficiency of data transfer.
But relied solely on the congestion control mechanism of TCP if do not limited the transfer rate of data to coordinate number
According to the transmission flowed in center, final TCP will distribute to bandwidth fairness the stream in data center.However, in data center
Flow to toward having different priority, the stream with higher priority should be transmitted preferentially, such as inquired about from user
Stream than sound that background traffic (such as intra-company staff is used for the stream that scientific algorithm is produced) should obtain much sooner
Should.In order to the needs to meet different are transmitted to the stream in data center with different priority, before transmitting the data,
An agency can be first transferred data to, is passed with TCP again after being processed according to certain rule by this agency
It is defeated.
As shown in figure 1, main frame M3M is given simultaneously6, M7, M8Three main frames send data, same main frame M7Also M can be given1, M2, M3,
M4, M5Five main frames send data.In prior art, every main frame can be all averagely allocated to its outlet bandwidth from this master
The stream that machine sets out.Such as main frame M3Outlet bandwidth be r3, then from M3To M6, M7, M8Stream can highest with r3/ 3 speed
It is transmitted.Equally, if main frame M7Outlet bandwidth be r7, then from M7Each the stream most multipotency for setting out is with r7/ 5 speed is come
Transmission data.
Due to the priority for not accounting for flowing, so all of stream all obtains identical bandwidth.In this case, one
A little streams with higher priority may be responded timely, such as because the researcher of company is in the science of carrying out reality
Test, when causing data center to transmit substantial amounts of data, the request of domestic consumer comes, but due to institute in the art
Some stream all has identical priority, so the stream of domestic consumer is not timely responded, this is in actual product
In will have a strong impact on Consumer's Experience, bring loss to company.In addition, unilaterally may to a stream distribution outlet bandwidth
Congestion is caused in destination host or could not make full use of the ingress bandwidth of destination host, so as to cause the waste of bandwidth resources,
Such as in fig. 1, it is assumed that M3Outlet bandwidth and M7Ingress bandwidth all be r, then M3Highest by with the bandwidth of r/3 to M7Send out
Send data, and M7At most can only be processed from M with the speed of r/53Stream, then generate packet loss phenomenon, cause bandwidth money
The waste in source.
【The content of the invention】
The present invention provides a kind of ingress bandwidth based on data stream priority and source host outlet bandwidth and destination host etc.
Global information is carrying out method, controller and the communication system of bandwidth allocation.
The embodiment of the present invention provides a kind of bandwidth allocation methods, including:
Controller receives data stream bandwidth solicited message and the data stream priority information that each main frame sends;
According to the data stream bandwidth solicited message for receiving and data stream priority information, and each main frame
Inbound port bandwidth information and exit port bandwidth information, generate bandwidth allocation information;
The bandwidth allocation information is sent to each main frame.
The embodiment of the present invention also provides a kind of controller, including:
Receiver module, for receiving data stream bandwidth solicited message and the data stream priority information that each main frame sends;
Bandwidth allocation module, the data stream bandwidth solicited message and data flow for being received according to the receiver module is excellent
First level information, and the inbound port bandwidth information and exit port bandwidth information of each main frame, generate bandwidth allocation information;
Sending module, for sending the bandwidth allocation information to each main frame.
In addition, the embodiment of the present invention also provides a kind of communication system, including a controller and at least two main frames, it is described
Controller is used for, and receives data stream bandwidth solicited message and data stream priority information that each main frame sends;
According to the data stream bandwidth solicited message for receiving and data stream priority information, and each main frame
Inbound port bandwidth information and exit port bandwidth information, generate bandwidth allocation information;
The bandwidth allocation information is sent to each main frame.
Compared with prior art, the beneficial effects of the present invention is:The embodiment of the present invention according to data stream bandwidth by asking
Information and data stream priority information, and the inbound port bandwidth information and exit port bandwidth information are asked, bandwidth allocation is carried out,
The data flow that high priority can be caused is timely responded to, and the bandwidth resources of each main frame can reasonably be distributed, both
Congestion will not be caused because of over-allocation, also bandwidth resources will not be very little caused using insufficient because of distribution, it is to avoid
The waste of bandwidth resources.
【Description of the drawings】
Fig. 1 is a kind of data stream transmitting network topological diagram of the prior art;
Fig. 2 is the method flow diagram of the embodiment of the present invention one;
Fig. 3 is the data stream transmitting network topological diagram of the embodiment of the present invention two;
Fig. 4 is the data stream transmitting hum pattern of the embodiment of the present invention three;
Fig. 5 is the apparatus structure block diagram of the embodiment of the present invention four.
【Specific embodiment】
In order that the objects, technical solutions and advantages of the present invention become more apparent, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that specific embodiment described herein is only to explain the present invention, and
It is not used in the restriction present invention.
As long as additionally, technical characteristic involved in invention described below each embodiment is each other not
Constituting conflict just can be mutually combined.
Embodiment one:
The embodiment of the present invention one provides a kind of bandwidth allocation methods, as shown in Fig. 2 including:
S101, controller receives data stream bandwidth solicited message and the data stream priority information that each main frame sends;
Here, the number of main frame is m.This main frame is sent to every main frame the data flow band of destination host as source host
The priority of width request and the data flow issues controller.
S102, it is according to the data stream bandwidth solicited message for receiving and data stream priority information and described each
The inbound port bandwidth information and exit port bandwidth information of main frame, generates bandwidth allocation information;
Because the inbound port bandwidth and exit port bandwidth of every main frame are constant, so, controller is known in advance per platform
The inbound port bandwidth and exit port bandwidth of main frame, main frame MiInbound port bandwidth information be expressed as R (Pi in), exit port bandwidth letter
Breath is expressed as R (Pi out)。
Controller is received after the data stream bandwidth solicited message and data stream priority information of each main frame transmission, can be generated
Data stream bandwidth asks matrix R0And weights matrix W, wherein the R0The i-th row jth column elementFor main frame MiArrive
MjData flow fijBandwidth request, the i-th row jth column element ω of the weights matrix WijFor main frame MiTo MjNumber
According to stream fijWeights, and the R0M m matrix is with W, m represents the number of main frame, and i and j is natural number.
Specifically, to the matrix R0Often go, data flow f is first calculated successivelyijThe bandwidth of according to priority weights distributionWherein
Again willWithSmaller value in both is used as matrix R1In the i-th row jth row element
According to main frame MiExit port bandwidth R (Pi out) remaining bandwidth, update matrix R1In the i-th row jth row element
To the matrix R1Each column, successively calculate data flow fijThe bandwidth of according to priority weights distributionWherein
WillWithSmaller value in both is used as matrix R2In the i-th row jth row element
According to main frame MiInbound port bandwidth R (Pi in) remaining bandwidth, updateAfter each element updates, can obtain
Bandwidth allocation information.
S103, to each main frame the bandwidth allocation information is sent.
Specifically, the bandwidth allocation information related to the main frame can be sent or to each main frame transmission square to every main frame
Battle array R2Information, the i-th row jth column element thereinFor main frame MiTo MjData flow fijBandwidth value.
The embodiment of the present invention by according to data stream bandwidth solicited message and data stream priority information, and it is described enter end
Port band width information and exit port bandwidth information, carry out bandwidth allocation, and the data flow that can cause high priority is timely responded to,
The bandwidth resources of each main frame can reasonably be distributed, and congestion both will not have been caused because of over-allocation, also will not be because of
Distribution causes very little bandwidth resources using insufficient, it is to avoid the waste of bandwidth resources.
Embodiment two:
The embodiment of the present invention two provide a kind of bandwidth allocation methods, its data stream transmitting topological diagram as shown in figure 3, including
One controller and three main frames.From unlike embodiment one, the present embodiment is for the situation that main frame number of units is three, its bandwidth
Distribution method is similar with embodiment one, specially:
Controller receives data stream bandwidth solicited message and the data stream priority information that 3 main frames send;
In the data center being made up of three main frames, there are six data flows to need transmission, f is designated as respectively12, f13, f21,
f23, f31And f32, fijRepresent from main frame MiTo MjData flow, each data flow has its bandwidth request and priority.According to every
The priority of individual data flow gives a weights to it, and higher its weights of the priority of a data flow are also higher.ωijBased on
Machine MiTo MjData flow fijWeights,For main frame MiTo MjData flow fijBandwidth request,Represent master
Machine MiTo MjBetween without data flow.The embodiment of the present invention to do is to, under conditions of total bandwidth is limited, according to each data
The priority of stream is its distribution bandwidth.
Because the ingress bandwidth and outlet bandwidth of every main frame are constant, so controller knows in advance every main frame
Ingress bandwidth and outlet bandwidth.When controller receive the data stream bandwidth value request that every main frame sends and weights it
Afterwards, a bandwidth matrices and weights matrix are set up, R is designated as respectively0And W:
According to the data stream bandwidth solicited message for receiving and data stream priority information, and three main frames enter
Port bandwidth information and exit port bandwidth information, generate bandwidth allocation information;
Specifically, matrix R is updated by row first0Element value, i.e., the bandwidth that each stream should be assigned to.Matrix R0
The first row have two stream f12And f13, their weights are respectively ω12And ω13.Main frame M1Outlet bandwidth be R (P1 out), institute
With the distribution of according to priority weighting ratio, it should give stream f12The band of distribution is a width ofShould be to stream
f13The band of distribution is a width ofThen the bandwidth that comparing each stream should distribute is asked with this stream
The bandwidth asked.
IfShow to flow f12The bandwidth being assigned to can not meet or be just met for its bandwidth request, at this moment,
The bandwidth being assigned to is fully allocated to it, is madeThat is handleWithSmaller value in both is used as matrix R1In
The element of the i-th row jth row, whereas ifShow to flow f12The band being assigned to is wider than its bandwidth request, then not
Needs additionally allocate it again bandwidth outside its bandwidth request, so keepingIt is constant, i.e.,
Stream f is updated using same method13Bandwidth, it is complete to the corresponding Data Stream Processing of this line after, check M1's
Whether exit port has extra remaining bandwidth.According to M1Exit port bandwidth R (P1 out) remaining bandwidth, update matrix R1In i-th
The element of row jth rowSpecially:Such asCalculating distribute to stream f12Bandwidth do not divide completely
Dispensing it, therefore remaining certain bandwidth, remaining bandwidth isAt this moment it is examined in this line
Stream whether also need to bandwidth.Assume f13The bandwidth being assigned to is less than its bandwidth request, if
Just remaining bandwidth Rem (P1 out) be fully allocated to flow f13, otherwise only by remaining bandwidth Rem (P1 out) part distribute to stream f13
To meet its bandwidth request so thatTo matrix R0Every a line all carry out identical operation, this completes out
The bandwidth allocation of port, obtains new bandwidth matrices
Then, in R1On the basis of by row to these stream distribution bandwidths.Because each row both correspond to entering for main frame
Port, so carrying out bandwidth allocation equivalent to the inbound port to main frame by row distribution bandwidth.With R1First row as a example by, this row
Comprising two stream f21And f31.During bandwidth allocation is carried out to exit port, bandwidth is assigned with to them respectivelyWith
Known M1The a width of R (P of inbound port band1 in), flow f21And f31Weights be respectively ω21And ω31, so according to priority weighing
Value ratio, it should distribute to their bandwidth and be respectivelyWith
Note, when row distribution bandwidth is pressed, the bandwidth that each stream distributes is no more than them in distributed by row
Assigned bandwidth during bandwidth, because the bandwidth distributed to a stream when distributed by row bandwidth is exactly the source of this stream
The maximum bandwidth that main frame can be supported.Consider first to be more newly assigned to stream f21Bandwidth, ifShow to flow f21's
The bandwidth that destination host can be supported to be distributed to its bandwidth less than or equal to its source host, then will flow f21The band being assigned to
Width is updated to, whereas ifShow to flow f21Destination host can distribute to its band and be wider than
The bandwidth that it distributes in distributed by row, and each flows the bandwidth distributed no more than them by row point when pressing row distribution
With bandwidth assigned during bandwidth, so keep its bandwidth constant, i.e.,
Distribute after bandwidth to two streams of first row, if their bandwidth sum is less than destination interface P1 inBand
Width, such as becauseStream f should be distributed to originally21Bandwidth be not fully allocated away, so as toAt this moment remaining bandwidth is obtainedIf it is determined that this stage is distributed to
Stream f31The bandwidth that is assigned in distributed by row less than it of bandwidth, i.e.,Because there is remaining bandwidth, it is possible to will
Remaining bandwidth distributes to stream f31.IfThen M1Inbound port remaining bandwidth be fully allocated to stream
f31, i.e.,Otherwise, by M1Inbound port some residual bandwidth allocation to stream f31So that
In the same way processing R1Secondary series and the 3rd row, obtain bandwidth matrices
The bandwidth allocation information is sent to above-mentioned three main frames.
Wherein, controller can be to each main frame sending metrix R2Information, the i-th row jth column element thereinFor main frame MiArrive
MjData flow fijBandwidth value;The bandwidth information related to the main frame, i.e. a transmission bandwidth point can also be sent to each main frame
The main frame is given with the Partial Elements in matrix.The main frame is received after bandwidth allocation information, according to the information, is carried out final
Bandwidth allocation.
The embodiment of the present invention by according to data stream bandwidth solicited message and data stream priority information, and it is described enter end
Port band width information and exit port bandwidth information, carry out bandwidth allocation, and the data flow that can cause high priority is timely responded to,
The bandwidth resources of each main frame can reasonably be distributed, and congestion both will not have been caused because of over-allocation, also will not be because of
Distribution causes very little bandwidth resources using insufficient, it is to avoid the waste of bandwidth resources.
Embodiment three:
The embodiment of the present invention three provide it is a kind of be directed to three main frames and carry out the specific example of bandwidth allocation, Fig. 4 is this
The data stream transmitting hum pattern of bright embodiment three, its bandwidth allocation methods are similar with embodiment one, specially:
Controller receives data stream bandwidth solicited message and the data stream priority information that 3 main frames send.Here bandwidth
RequestTheir weights are respectively ω12=1, ω13=4,
ω21=2, ω23=3, ω31=5, ω32=7, There are 6 streams in data center, the bandwidth request matrix and weights matrix difference of these streams
For
First, these stream distribution bandwidths are given by row.Easily it is calculatedAndSo can
So that f will be flowed12Bandwidth be updated toEqually can be calculatedAndInstitute
Can keep flowing f13Bandwidth it is constant, i.e.,Subsequently, M is checked1Exit port remaining bandwidthAnd flow f12Assigned bandwidth 1.2 is less than its bandwidth request 2, so
0.8 can be taken out from remaining bandwidth and distribute to it.Then to M1Exit port in stream, situation about finally distributing isUsing same method, to R0The second row and the third line processed, obtain bandwidth matrices
Then, by row to R1It is updated.Such as first row, becauseSo protecting
Hold and distribute to stream f21Bandwidth it is constant.BecauseDistribute to stream f when by row distribution31's
Band distributes to its bandwidth when being wider than distributed by row, but because the bandwidth that a stream is distributed to by row should not be greater than by row point
The bandwidth of the dispensing stream, so remaining allocated to flow f31Bandwidth it is constant, i.e.,M is directed to again2Inbound port carry out
Bandwidth allocation, is easily calculated,AndSo main frame M2Inbound port can only to stream f12Point
With bandwidth 1.1, thenEqually,AndBut due to distributing to a stream by row
Bandwidth should not be greater than bandwidth of the distributed by row to the stream, so keep f32Bandwidth it is constant, i.e.,
Remaining bandwidth is reexamined, due to f12And f32The bandwidth sum being assigned to is less than M2Inbound port bandwidth, M2Enter
The remaining bandwidth of port isStream f12The band distributed in distributed by row is a width ofBut now the bandwidth of distribution only hasTherefore 0.9 can be taken out from remaining bandwidth and distributes to stream f12, in
It isUsing same method, to R1The 3rd row carry out bandwidth allocation, finally obtain bandwidth allocation matrix
Controller is to each main frame sending metrix R2Information, the i-th row jth column element thereinFor main frame MiTo MjData
Stream fijBandwidth value.The bandwidth information related to the main frame, i.e. a transmission bandwidth allocation matrix can also be sent to each main frame
In Partial Elements give the main frame.The main frame is received after bandwidth allocation information, according to the information, carries out final bandwidth point
Match somebody with somebody.
The embodiment of the present invention by according to data stream bandwidth solicited message and data stream priority information, and it is described enter end
Port band width information and exit port bandwidth information, carry out bandwidth allocation, and the data flow that can cause high priority is timely responded to,
The bandwidth resources of each main frame can reasonably be distributed, and congestion both will not have been caused because of over-allocation, also will not be because of
Distribution causes very little bandwidth resources using insufficient, it is to avoid the waste of bandwidth resources.
Example IV:
The embodiment of the present invention four provides a kind of controller, and Fig. 5 is the apparatus structure block diagram of the embodiment of the present invention four, including
Receiver module 501, bandwidth allocation module 502, sending module 503, wherein
Receiver module 501, for receiving data stream bandwidth solicited message and the data stream priority information that each main frame sends;
Bandwidth allocation module 502, for the data stream bandwidth solicited message sum received according to the receiver module 501
According to flow priority information, and the inbound port bandwidth information and exit port bandwidth information of each main frame, generate bandwidth allocation letter
Breath;
Sending module 503, for sending the bandwidth allocation information to each main frame.
Specifically, controller can also include generation module, for generating data stream bandwidth request matrix R0And it is preferential
Level weight matrix W, wherein the R0The i-th row jth column elementFor main frame MiTo MjData flow fijBandwidth request, it is described
I-th row jth column element ω of weights matrix WijFor main frame MiTo MjData flow fijWeights, the R0With
W is m m matrix, and m represents the number of main frame, and i and j is natural number, and the i≤m, j≤m.
Wherein, bandwidth allocation module 502 specifically for:
To the matrix R0Often go, successively calculate data flow fijThe bandwidth of according to priority weights distributionWhereinR(Pi out) it is main frame MiExit port bandwidth information;
WillWithSmaller value in both is used as matrix R1In the i-th row jth row element
According to main frame MiExit port bandwidth R (Pi out) remaining bandwidth, update matrix R1In the i-th row jth row element
To the matrix R1Each column, successively calculate data flow fijThe bandwidth of according to priority weights distributionWhereinR(Pi in) it is main frame MiInbound port bandwidth information;
WillWithSmaller value in both is used as matrix R2In the i-th row jth row element
According to main frame MiInbound port bandwidth R (Pi in) remaining bandwidth, update
The acquisition methods of bandwidth matrices are specifically referred to embodiment two and embodiment three, will not be described here.
Sending module 503 to every main frame specifically for sending the bandwidth allocation information related to the main frame;Or to each
Main frame sending metrix R2Information, the i-th row jth column element thereinFor main frame MiTo MjData flow fijBandwidth value.
Controller provided in an embodiment of the present invention, by being believed according to data stream bandwidth solicited message and data stream priority
Breath, and the inbound port bandwidth information and exit port bandwidth information, carry out bandwidth allocation, can cause the data of high priority
Stream is timely responded to, and the bandwidth resources of each main frame can reasonably be distributed, and both will not be caused because of over-allocation
Congestion, also will not very little cause bandwidth resources using insufficient because of distribution, it is to avoid the waste of bandwidth resources.
Embodiment five:
The embodiment of the present invention five provides a kind of communication system, and its network architecture diagram is similar with Fig. 3, simply the present embodiment
Main frame can be more than 3.
Communication system provided in an embodiment of the present invention, including a controller and at least two main frames, the controller is used
In,
Receive data stream bandwidth solicited message and data stream priority information that each main frame sends;
According to the data stream bandwidth solicited message for receiving and data stream priority information, and each main frame
Inbound port bandwidth information and exit port bandwidth information, generate bandwidth allocation information;
The bandwidth allocation information is sent to each main frame.
It is pointed out that controller here is identical with example IV, its implementation also with said method embodiment
It is identical.The controller of the communication system can be switch, or a certain main frame, this is not restricted for the present invention.
Communication system provided in an embodiment of the present invention, by being believed according to data stream bandwidth solicited message and data stream priority
Breath, and the inbound port bandwidth information and exit port bandwidth information, carry out bandwidth allocation, can cause the data of high priority
Stream is timely responded to, and the bandwidth resources of each main frame can reasonably be distributed, and both will not be caused because of over-allocation
Congestion, also will not very little cause bandwidth resources using insufficient because of distribution, it is to avoid the waste of bandwidth resources.
One of ordinary skill in the art will appreciate that all or part of flow process of above-described embodiment method, can be by meter
The related hardware of calculation machine programmed instruction is completed, and described program can be stored in computer-readable recording medium, and the program exists
During execution, it may include such as the flow process of the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic disc, CD, read-only
Storage memory (Read Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the present invention, it is all the present invention spirit and
Any modification, equivalent and improvement for being made within principle etc., should be included within the scope of the present invention.